@abtnode/blocklet-services 1.17.1 → 1.17.2-beta-20251111-010532-4bb3b162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/routes/oauth/client.js +19 -3
- package/dist/assets/{AdapterDayjs-DS6RugP1.js → AdapterDayjs-Cf3ilEXQ.js} +1 -1
- package/dist/assets/{Google-DL2G-Im-.js → Google-CAi86Mf6.js} +1 -1
- package/dist/assets/{access-control-BcP45PDK.js → access-control-CtmOVtqN.js} +1 -1
- package/dist/assets/{add-component-core-CDw-LKTz.js → add-component-core-BmqcC6wx.js} +1 -1
- package/dist/assets/add-resource-Wd8eygtg.js +1 -0
- package/dist/assets/{addon-BNvN2vhl.js → addon-b88MM48E.js} +1 -1
- package/dist/assets/{advanced-C0Q1MXTZ.js → advanced-B3-RuDYH.js} +1 -1
- package/dist/assets/aigne-dOgJ2u-w.js +10 -0
- package/dist/assets/api-Btn0Tp3W.js +1 -0
- package/dist/assets/{appearance-Du24FS2u.js → appearance-BqBKdeI5.js} +1 -1
- package/dist/assets/{arrow-down.svg-BNc6qym0.js → arrow-down.svg-DeLZPBrE.js} +1 -1
- package/dist/assets/{audit-logs-CC69qHzz.js → audit-logs-DtLr59sc.js} +1 -1
- package/dist/assets/{authorize-R4UDUnLr.js → authorize-DwHmsRbR.js} +1 -1
- package/dist/assets/{base-chart-CPiuDOeg.js → base-chart-C-Raz4Q-.js} +1 -1
- package/dist/assets/{base32-DvFJDTUa.js → base32-MTP_2iYY.js} +1 -1
- package/dist/assets/{bind-account-BHDDyJhv.js → bind-account-kNuk8_sP.js} +1 -1
- package/dist/assets/branding-B5SFGC6H.js +1 -0
- package/dist/assets/{branding-JJOTrGtN.js → branding-BDl2jvZZ.js} +1 -1
- package/dist/assets/{branding-DtWd56Gj.js → branding-ZWV6HBf3.js} +1 -1
- package/dist/assets/{bundle-avatar-DKBZZwLh.js → bundle-avatar-CTtvmGO1.js} +1 -1
- package/dist/assets/{button-Cg6OrnF6.js → button-vwR-NYG5.js} +1 -1
- package/dist/assets/{click-to-copy-8VrSVycN.js → click-to-copy-BOJgIYli.js} +1 -1
- package/dist/assets/{cloneDeep-D_w1MBt4.js → cloneDeep-C6qewg0C.js} +1 -1
- package/dist/assets/{complete-DPUMGf1q.js → complete-Bkaq2hgz.js} +2 -2
- package/dist/assets/{component-BHy3j7aa.js → component-C45V1KlM.js} +2 -2
- package/dist/assets/{config-BaVMK6fr.js → config-BLLq9bPE.js} +1 -1
- package/dist/assets/config-Ceq_JEL5.js +53 -0
- package/dist/assets/{config-9XjBKwBj.js → config-gkybDvOM.js} +1 -1
- package/dist/assets/{config-navigation-CFyO-icX.js → config-navigation-D1-Loy5H.js} +2 -2
- package/dist/assets/{config-space-u-t0AaTk.js → config-space-zpk7zMxf.js} +1 -1
- package/dist/assets/{confirm-BCjJ3Xga.js → confirm-CR8be0u2.js} +1 -1
- package/dist/assets/{connect-DlGrdygd.js → connect-BXpb2qd7.js} +1 -1
- package/dist/assets/{connect-B6Xh5geZ.js → connect-DOJrWNED.js} +1 -1
- package/dist/assets/{connect-to-DcXC96wu.js → connect-to-CmnRyCBb.js} +1 -1
- package/dist/assets/{create-passport-svg-BYZ8eY0w.js → create-passport-svg-C7Utfs-J.js} +1 -1
- package/dist/assets/{createClass-BQSl7_FJ.js → createClass-C0dSRoDm.js} +1 -1
- package/dist/assets/{dashboard-CQ72RYH1.js → dashboard-Dw224r_Y.js} +2 -2
- package/dist/assets/{delete-confirm-D2vWlDhQ.js → delete-confirm-DhJd_sYk.js} +1 -1
- package/dist/assets/{did-address-BxZuOgUQ.js → did-address-QgOhyegQ.js} +1 -1
- package/dist/assets/{domain-DrZ8Lgz4.js → domain-Cp9UTLSk.js} +1 -1
- package/dist/assets/{domain-action-card-CjprVCsh.js → domain-action-card-ClQw061p.js} +2 -2
- package/dist/assets/domains-Bqr-LIHe.js +1 -0
- package/dist/assets/{email-BLnwK6WC.js → email-CyuoT9tq.js} +1 -1
- package/dist/assets/engine-DPn0LHHl.js +1 -0
- package/dist/assets/{exchange-passport-CNwWQumn.js → exchange-passport-BpZ027R8.js} +1 -1
- package/dist/assets/{form-BmYfNrVX.js → form-5lUoL51-.js} +1 -1
- package/dist/assets/{form-text-input-BZq_zjB8.js → form-text-input-Ce6g965V.js} +1 -1
- package/dist/assets/{fuel-UmS8I6V5.js → fuel-SLYYbiDW.js} +1 -1
- package/dist/assets/{gen-access-key-BG0P5o2E.js → gen-access-key-CXXIb3w7.js} +1 -1
- package/dist/assets/gen-simple-access-key-BHzLGV5y.js +1 -0
- package/dist/assets/get-safe-url-DpalOXcM.js +1 -0
- package/dist/assets/{home-DDCrDH3h.js → home-DIAEkSVB.js} +1 -1
- package/dist/assets/{iframe-UTQ_4DZf.js → iframe-BUJLmqjE.js} +1 -1
- package/dist/assets/index-40i6YjCX.js +6 -0
- package/dist/assets/{index-bAaF7GbQ.js → index-5h5rz7VN.js} +1 -1
- package/dist/assets/index-7L77Yf9w.js +120 -0
- package/dist/assets/{index-CFpcdpS5.js → index-BQF4zMs8.js} +3 -3
- package/dist/assets/{index-BCuYGA8L.js → index-BiE-bsm3.js} +1 -1
- package/dist/assets/{index-BCF14HSR.js → index-BiRWeiPY.js} +1 -1
- package/dist/assets/{index-Db6d_BmF.js → index-Bjj89nDJ.js} +1 -1
- package/dist/assets/{index-CYIpEo41.js → index-Bpiwm7Vd.js} +1 -1
- package/dist/assets/{index-DoyPDWTY.js → index-C-ToEbCG.js} +1 -1
- package/dist/assets/{index-CRlbskWD.js → index-C45ih46D.js} +11 -11
- package/dist/assets/{index-BydChKjR.js → index-COTazo1u.js} +2 -2
- package/dist/assets/{index-H8Dc7uuB.js → index-CkOr9jjZ.js} +1 -1
- package/dist/assets/{index-Ct7hdtD6.js → index-CsfqJ8ys.js} +1 -1
- package/dist/assets/{index-COj40KfT.js → index-CxfTwIi4.js} +1 -1
- package/dist/assets/{index-C2c32kYu.js → index-DBJMdrD8.js} +1 -1
- package/dist/assets/index-DZRxerxf.js +7 -0
- package/dist/assets/{index-Kwxwmog8.js → index-DZsn1cNa.js} +3 -3
- package/dist/assets/{index-CrRuO2BQ.js → index-DicW-7Bz.js} +1 -1
- package/dist/assets/{index-D-Y0UA7w.js → index-DoMhm8T2.js} +1 -1
- package/dist/assets/{index-CfVxzco9.js → index-DzmaBRJ8.js} +1 -1
- package/dist/assets/{index-DrTSvHzP.js → index-F1NFyTyg.js} +7 -7
- package/dist/assets/index-FV6qYjQd.js +62 -0
- package/dist/assets/{index-D2k5qLgT.js → index-FpxO_1p7.js} +1 -1
- package/dist/assets/{index-I8DDinX-.js → index-GExzZtCU.js} +1 -1
- package/dist/assets/{index-C_bSN26w.js → index-I2xk2ilS.js} +2 -2
- package/dist/assets/{index-BM4g9p9K.js → index-NomqB6Iy.js} +1 -1
- package/dist/assets/{index-ChcIPY6P.js → index-UR2bgVDi.js} +2 -2
- package/dist/assets/{index-CKPpLyCQ.js → index-gt5P4O5b.js} +1 -1
- package/dist/assets/{index-Ch4CmFJG.js → index-l32Mt1U_.js} +1 -1
- package/dist/assets/{index-CkTEzTCn.js → index-sNHCLgAE.js} +140 -142
- package/dist/assets/{index-BjsH7wg6.js → index-x4Yvq15-.js} +1 -1
- package/dist/assets/{invitation-PFI3mpiQ.js → invitation-Bu3ivg7N.js} +1 -1
- package/dist/assets/{invitations-DBukPMcf.js → invitations-o-DfaNhe.js} +1 -1
- package/dist/assets/{invite-Z_7oCnoB.js → invite-C_VhlmyZ.js} +1 -1
- package/dist/assets/{isURL-CyShrkvP.js → isURL-D_2bLHU_.js} +2 -2
- package/dist/assets/{issue-passport-BexF9o0Q.js → issue-passport-BQmXTz6k.js} +1 -1
- package/dist/assets/{item-CBDRQx8K.js → item-BnTXSpRf.js} +1 -1
- package/dist/assets/{landing-page-BBuNoMf2.js → landing-page-sUHYSREd.js} +1 -1
- package/dist/assets/{layout-DsLcTLhU.js → layout-Ccrs-yyw.js} +1 -1
- package/dist/assets/list-Bzvh-74X.js +2 -0
- package/dist/assets/list-DORIbGy_.js +103 -0
- package/dist/assets/localization-DDhbgRgn.js +1 -0
- package/dist/assets/{log-CQbIkXws.js → log-C34JsgaL.js} +1 -1
- package/dist/assets/logger-CLmQ42wa.js +1 -0
- package/dist/assets/{login-CvnRp8HX.js → login-DHfG4EkA.js} +1 -1
- package/dist/assets/{login-oauth-callback-LnLYjVIe.js → login-oauth-callback-B7KlB_uu.js} +1 -1
- package/dist/assets/{logo-uploader-DRaSgU8c.js → logo-uploader-D-JPEx8I.js} +1 -1
- package/dist/assets/{lost-passport-B5NjzFZd.js → lost-passport-BLFCoJdG.js} +1 -1
- package/dist/assets/{omit-CigYLGmT.js → omit-hhiOJGRf.js} +1 -1
- package/dist/assets/{open-window-B_B0pir6.js → open-window-Bcj__Y7L.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-mGIRggXd.js → over-due-invoice-payment-DUg5ApsD.js} +1 -1
- package/dist/assets/{overview-DmcFvtLD.js → overview-B-nkIeNy.js} +2 -2
- package/dist/assets/passport-Y64u4kIS.js +1 -0
- package/dist/assets/passport-item-DvglsId-.js +1 -0
- package/dist/assets/{permission-COoKrWxk.js → permission-DhYNRf8T.js} +1 -1
- package/dist/assets/{preferences-CDP-HNka.js → preferences-C4h4Dsj9.js} +1 -1
- package/dist/assets/profile-embed-lrJQLQky.js +1 -0
- package/dist/assets/{publish-resource-BMF29YI2.js → publish-resource-YXu5vhjp.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-4ukAiqxb.js → react-beautiful-dnd.esm-Ci2FESra.js} +1 -1
- package/dist/assets/runtime-DK0VmoOa.js +1 -0
- package/dist/assets/{sanitize-Bib7lw-G.js → sanitize-BEqBHa8a.js} +1 -1
- package/dist/assets/sdk-DFkL0HsT.js +1 -0
- package/dist/assets/{security-BcRPxWAt.js → security-DrqBVw07.js} +3 -3
- package/dist/assets/{session-GdZETrt0.js → session-BAD0lxQk.js} +1 -1
- package/dist/assets/{setup-MQVteZIu.js → setup-Br2wkFI2.js} +1 -1
- package/dist/assets/{simple-select-K2bKpwDf.js → simple-select-CzvjrR9I.js} +1 -1
- package/dist/assets/{spaces-iPLS3X1a.js → spaces-B0p4-23K.js} +1 -1
- package/dist/assets/{start-DE38ex9f.js → start-CXoSJa5Y.js} +1 -1
- package/dist/assets/{starting-progress-BQjEEvIV.js → starting-progress-NSYAzE2f.js} +1 -1
- package/dist/assets/{status-B0TeD-D-.js → status-guZHdt1q.js} +1 -1
- package/dist/assets/{step-actions-DPFoKvBN.js → step-actions-thgNsMmu.js} +1 -1
- package/dist/assets/{studio-CEsaMQhd.js → studio-Ceq7d-nC.js} +1 -1
- package/dist/assets/{switch-control-BHqY-fHZ.js → switch-control-CHsjrwFX.js} +1 -1
- package/dist/assets/{table-tips-6mCQ469z.js → table-tips-cwfDerzR.js} +1 -1
- package/dist/assets/{team-aiCyLcOV.js → team-DQuySqMB.js} +1 -1
- package/dist/assets/{traffic-CPElxbIH.js → traffic-QKQkjau1.js} +1 -1
- package/dist/assets/{transfer-DvfbExaq.js → transfer-B2DeADo4.js} +1 -1
- package/dist/assets/{unsubscribe-BfZzYk0c.js → unsubscribe-CBCoBRAZ.js} +1 -1
- package/dist/assets/{use-app-logo-Duu7Oh3J.js → use-app-logo-BQTE7YvS.js} +1 -1
- package/dist/assets/{use-window-close-CmeMvKPG.js → use-window-close-BgT_dImc.js} +1 -1
- package/dist/assets/{useAsync-DouUkRB3.js → useAsync-BcVLpt2E.js} +1 -1
- package/dist/assets/{useAsync-BvASW8Y8.js → useAsync-cZ_FPf9k.js} +1 -1
- package/dist/assets/{useAsyncRetry-C8ETjgdm.js → useAsyncRetry-DwwEjrjs.js} +1 -1
- package/dist/assets/{useLocalStorage-DZQPax49.js → useLocalStorage-C9RLNbTa.js} +1 -1
- package/dist/assets/{user-center-BVnh5pB3.js → user-center-Cj7ClpAN.js} +2 -2
- package/dist/assets/user-follower-D2fRTkiD.js +32 -0
- package/dist/assets/{util-Cx4i9QNN.js → util-BEWQY3Rq.js} +1 -1
- package/dist/assets/{util-D4K1svNc.js → util-BsAmOTBh.js} +1 -1
- package/dist/assets/{vendor-arcblock-A4RQuZfN.js → vendor-arcblock-CuFtPveO.js} +1 -1
- package/dist/assets/{vendor-hooks-OpgB8gyY.js → vendor-hooks-CjESGRlR.js} +1 -1
- package/dist/assets/vendor-utils-cJEl_UEd.js +213 -0
- package/dist/assets/{vendor-ux-RIH1nUSh.js → vendor-ux-IiQnod3w.js} +7 -7
- package/dist/assets/{wait-connect-KtqPocoC.js → wait-connect-DiO80nu-.js} +1 -1
- package/dist/assets/{wizard-C9022r7q.js → wizard-Br7PYJDY.js} +1 -1
- package/dist/assets/{wizard-components-DboyJGog.js → wizard-components-BJpLH2_r.js} +1 -1
- package/dist/assets/wrap-locale-fIPwg8LW.js +1 -0
- package/dist/assets/{zh-BQQVY0SI.js → zh-EIKQ0AV8.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +48 -48
- package/dist/assets/add-resource-CcTb_2qn.js +0 -1
- package/dist/assets/aigne-CIAkCLWQ.js +0 -10
- package/dist/assets/api-BNrHV6cZ.js +0 -1
- package/dist/assets/branding-z2zNNpPB.js +0 -1
- package/dist/assets/config-zjFvoy0D.js +0 -57
- package/dist/assets/domains-Pt7MqfcA.js +0 -1
- package/dist/assets/engine-BkRDnUT9.js +0 -1
- package/dist/assets/gen-simple-access-key-BD4DDZLa.js +0 -1
- package/dist/assets/get-safe-url-Cgcqi5oF.js +0 -1
- package/dist/assets/index-C0w3lI6i.js +0 -120
- package/dist/assets/index-CpPbuWHL.js +0 -7
- package/dist/assets/index-CuFT_Y96.js +0 -6
- package/dist/assets/index-DBjdZ7k_.js +0 -63
- package/dist/assets/index-OYI_VqY3.js +0 -1
- package/dist/assets/list-BDeeBLEM.js +0 -103
- package/dist/assets/list-BZRp_F7-.js +0 -2
- package/dist/assets/localization-Dp6_R66r.js +0 -1
- package/dist/assets/logger-BI25CDXT.js +0 -1
- package/dist/assets/passport-CScachCU.js +0 -1
- package/dist/assets/passport-item-BefzYs0z.js +0 -1
- package/dist/assets/profile-embed-CfTauOJU.js +0 -1
- package/dist/assets/runtime-CC2luaxU.js +0 -1
- package/dist/assets/sdk-CkMqUWSI.js +0 -1
- package/dist/assets/user-follower-z3gqroPM.js +0 -32
- package/dist/assets/vendor-utils-ByKYcWuf.js +0 -213
- package/dist/assets/wrap-locale-Dkx98Pk6.js +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import{B as qr}from"./vendor-utils-cJEl_UEd.js";import{p as ae}from"./vendor-react-Dvs43sk9.js";import{ag as Se,ah as jr,ai as xr,aj as Nr,ak as _r,al as Kr,am as Sr,an as Tr,ao as ke,ap as Ur,aq as Br,ar as Dr,as as Mr,a6 as Lr,r as Cr}from"./vendor-ux-IiQnod3w.js";import{bd as Or,aF as Vr}from"./index-sNHCLgAE.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
|
|
2
|
+
`),I=oe(m).split(`
|
|
3
|
+
`),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
|
|
4
|
+
|
|
5
|
+
`)+"".concat(w[0]," !== ").concat(I[0],`
|
|
6
|
+
`)}else if(U!=="strictEqualObject"){var X=ae.stderr&&ae.stderr.isTTY?ae.stderr.columns:80;if(k<X){for(;w[0][D]===I[0][D];)D++;D>2&&(z=`
|
|
7
|
+
`.concat(H(" ",D),"^"),D=0)}}}for(var ee=w[w.length-1],se=I[I.length-1];ee===se&&(D++<2?i=`
|
|
8
|
+
`.concat(ee).concat(i):x=ee,w.pop(),I.pop(),!(w.length===0||I.length===0));)ee=w[w.length-1],se=I[I.length-1];var ge=Math.max(w.length,I.length);if(ge===0){var le=R.split(`
|
|
9
|
+
`);if(le.length>30)for(le[26]="".concat(V,"...").concat(Z);le.length>27;)le.pop();return"".concat(J.notIdentical,`
|
|
10
|
+
|
|
11
|
+
`).concat(le.join(`
|
|
12
|
+
`),`
|
|
13
|
+
`)}D>3&&(i=`
|
|
14
|
+
`.concat(V,"...").concat(Z).concat(i),c=!0),x!==""&&(i=`
|
|
15
|
+
`.concat(x).concat(i),x="");var ne=0,ve=J[U]+`
|
|
16
|
+
`.concat(W,"+ actual").concat(Z," ").concat(te,"- expected").concat(Z),Oe=" ".concat(V,"...").concat(Z," Lines skipped");for(D=0;D<ge;D++){var ie=D-a;if(w.length<D+1)ie>1&&D>2&&(ie>4?(C+=`
|
|
17
|
+
`.concat(V,"...").concat(Z),c=!0):ie>3&&(C+=`
|
|
18
|
+
`.concat(I[D-2]),ne++),C+=`
|
|
19
|
+
`.concat(I[D-1]),ne++),a=D,x+=`
|
|
20
|
+
`.concat(te,"-").concat(Z," ").concat(I[D]),ne++;else if(I.length<D+1)ie>1&&D>2&&(ie>4?(C+=`
|
|
21
|
+
`.concat(V,"...").concat(Z),c=!0):ie>3&&(C+=`
|
|
22
|
+
`.concat(w[D-2]),ne++),C+=`
|
|
23
|
+
`.concat(w[D-1]),ne++),a=D,C+=`
|
|
24
|
+
`.concat(W,"+").concat(Z," ").concat(w[D]),ne++;else{var pe=I[D],ue=w[D],t=ue!==pe&&(!K(ue,",")||ue.slice(0,-1)!==pe);t&&K(pe,",")&&pe.slice(0,-1)===ue&&(t=!1,ue+=","),t?(ie>1&&D>2&&(ie>4?(C+=`
|
|
25
|
+
`.concat(V,"...").concat(Z),c=!0):ie>3&&(C+=`
|
|
26
|
+
`.concat(w[D-2]),ne++),C+=`
|
|
27
|
+
`.concat(w[D-1]),ne++),a=D,C+=`
|
|
28
|
+
`.concat(W,"+").concat(Z," ").concat(ue),x+=`
|
|
29
|
+
`.concat(te,"-").concat(Z," ").concat(pe),ne+=2):(C+=x,x="",(ie===1||D===0)&&(C+=`
|
|
30
|
+
`.concat(ue),ne++))}if(ne>20&&D<ge-2)return"".concat(ve).concat(Oe,`
|
|
31
|
+
`).concat(C,`
|
|
32
|
+
`).concat(V,"...").concat(Z).concat(x,`
|
|
33
|
+
`)+"".concat(V,"...").concat(Z)}return"".concat(ve).concat(c?Oe:"",`
|
|
34
|
+
`).concat(C).concat(x).concat(i).concat(z)}var ce=function(v,m){n(x,v);var U=e(x);function x(C){var a;if(b(this,x),u(C)!=="object"||C===null)throw new B("options","Object",C);var i=C.message,c=C.operator,R=C.stackStartFn,w=C.actual,I=C.expected,D=Error.stackTraceLimit;if(Error.stackTraceLimit=0,i!=null)a=U.call(this,String(i));else if(ae.stderr&&ae.stderr.isTTY&&(ae.stderr&&ae.stderr.getColorDepth&&ae.stderr.getColorDepth()!==1?(V="\x1B[34m",W="\x1B[32m",Z="\x1B[39m",te="\x1B[31m"):(V="",W="",Z="",te="")),u(w)==="object"&&w!==null&&u(I)==="object"&&I!==null&&"stack"in w&&w instanceof Error&&"stack"in I&&I instanceof Error&&(w=de(w),I=de(I)),c==="deepStrictEqual"||c==="strictEqual")a=U.call(this,ye(w,I,c));else if(c==="notDeepStrictEqual"||c==="notStrictEqual"){var z=J[c],k=oe(w).split(`
|
|
35
|
+
`);if(c==="notStrictEqual"&&u(w)==="object"&&w!==null&&(z=J.notStrictEqualObject),k.length>30)for(k[26]="".concat(V,"...").concat(Z);k.length>27;)k.pop();k.length===1?a=U.call(this,"".concat(z," ").concat(k[0])):a=U.call(this,"".concat(z,`
|
|
36
|
+
|
|
37
|
+
`).concat(k.join(`
|
|
38
|
+
`),`
|
|
39
|
+
`))}else{var X=oe(w),ee="",se=J[c];c==="notDeepEqual"||c==="notEqual"?(X="".concat(J[c],`
|
|
40
|
+
|
|
41
|
+
`).concat(X),X.length>1024&&(X="".concat(X.slice(0,1021),"..."))):(ee="".concat(oe(I)),X.length>512&&(X="".concat(X.slice(0,509),"...")),ee.length>512&&(ee="".concat(ee.slice(0,509),"...")),c==="deepEqual"||c==="equal"?X="".concat(se,`
|
|
42
|
+
|
|
43
|
+
`).concat(X,`
|
|
44
|
+
|
|
45
|
+
should equal
|
|
46
|
+
|
|
47
|
+
`):ee=" ".concat(c," ").concat(ee)),a=U.call(this,"".concat(X).concat(ee))}return Error.stackTraceLimit=D,a.generatedMessage=!i,Object.defineProperty(d(a),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),a.code="ERR_ASSERTION",a.actual=w,a.expected=I,a.operator=c,Error.captureStackTrace&&Error.captureStackTrace(d(a),R),a.stack,a.name="AssertionError",r(a)}return L(x,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:m,value:function(a,i){return S(this,g(g({},i),{},{customInspect:!1,depth:0}))}}]),x}(y(Error),S.custom);return Ie=ce,Ie}var qe,er;function $r(){if(er)return qe;er=1;var h=Or(),g=jr()(),s=xr(),b=Nr(),_=s("Array.prototype.push"),L=s("Object.prototype.propertyIsEnumerable"),E=g?b.getOwnPropertySymbols:null;return qe=function(n,e){if(n==null)throw new TypeError("target must be an object");var r=b(n);if(arguments.length===1)return r;for(var d=1;d<arguments.length;++d){var y=b(arguments[d]),l=h(y),q=g&&(b.getOwnPropertySymbols||E);if(q)for(var O=q(y),A=0;A<O.length;++A){var j=O[A];L(y,j)&&_(l,j)}for(var u=0;u<l.length;++u){var p=l[u];if(L(y,p)){var S=y[p];r[p]=S}}}return r},qe}var je,rr;function Gr(){if(rr)return je;rr=1;var h=$r(),g=function(){if(!Object.assign)return!1;for(var b="abcdefghijklmnopqrst",_=b.split(""),L={},E=0;E<_.length;++E)L[_[E]]=_[E];var f=Object.assign({},L),n="";for(var e in f)n+=e;return b!==n},s=function(){if(!Object.assign||!Object.preventExtensions)return!1;var b=Object.preventExtensions({1:2});try{Object.assign(b,"xy")}catch{return b[1]==="y"}return!1};return je=function(){return!Object.assign||g()||s()?h:Object.assign},je}var xe,tr;function Pr(){if(tr)return xe;tr=1;var h=function(g){return g!==g};return xe=function(s,b){return s===0&&b===0?1/s===1/b:!!(s===b||h(s)&&h(b))},xe}var Ne,nr;function Xe(){if(nr)return Ne;nr=1;var h=Pr();return Ne=function(){return typeof Object.is=="function"?Object.is:h},Ne}var _e,ir;function Ae(){if(ir)return _e;ir=1;var h=Or(),g=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",s=Object.prototype.toString,b=Array.prototype.concat,_=_r(),L=function(e){return typeof e=="function"&&s.call(e)==="[object Function]"},E=Kr()(),f=function(e,r,d,y){if(r in e){if(y===!0){if(e[r]===d)return}else if(!L(y)||!y())return}E?_(e,r,d,!0):_(e,r,d)},n=function(e,r){var d=arguments.length>2?arguments[2]:{},y=h(r);g&&(y=b.call(y,Object.getOwnPropertySymbols(r)));for(var l=0;l<y.length;l+=1)f(e,y[l],r[y[l]],d[y[l]])};return n.supportsDescriptors=!!E,_e=n,_e}var Ke,or;function zr(){if(or)return Ke;or=1;var h=Xe(),g=Ae();return Ke=function(){var b=h();return g(Object,{is:b},{is:function(){return Object.is!==b}}),b},Ke}var Te,ar;function Yr(){if(ar)return Te;ar=1;var h=Ae(),g=Sr(),s=Pr(),b=Xe(),_=zr(),L=g(b(),Object);return h(L,{getPolyfill:b,implementation:s,shim:_}),Te=L,Te}var Ue,cr;function Rr(){return cr||(cr=1,Ue=function(g){return g!==g}),Ue}var Be,ur;function Ir(){if(ur)return Be;ur=1;var h=Rr();return Be=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:h},Be}var De,fr;function Hr(){if(fr)return De;fr=1;var h=Ae(),g=Ir();return De=function(){var b=g();return h(Number,{isNaN:b},{isNaN:function(){return Number.isNaN!==b}}),b},De}var Me,sr;function Zr(){if(sr)return Me;sr=1;var h=Sr(),g=Ae(),s=Rr(),b=Ir(),_=Hr(),L=h(b(),Number);return g(L,{getPolyfill:b,implementation:s,shim:_}),Me=L,Me}var Le,lr;function Wr(){if(lr)return Le;lr=1;function h(t,o){return L(t)||_(t,o)||s(t,o)||g()}function g(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
48
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(t,o){if(t){if(typeof t=="string")return b(t,o);var P=Object.prototype.toString.call(t).slice(8,-1);if(P==="Object"&&t.constructor&&(P=t.constructor.name),P==="Map"||P==="Set")return Array.from(t);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return b(t,o)}}function b(t,o){(o==null||o>t.length)&&(o=t.length);for(var P=0,T=new Array(o);P<o;P++)T[P]=t[P];return T}function _(t,o){var P=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(P!=null){var T,M,$,F,G=[],Y=!0,Q=!1;try{if($=(P=P.call(t)).next,o!==0)for(;!(Y=(T=$.call(P)).done)&&(G.push(T.value),G.length!==o);Y=!0);}catch(re){Q=!0,M=re}finally{try{if(!Y&&P.return!=null&&(F=P.return(),Object(F)!==F))return}finally{if(Q)throw M}}return G}}function L(t){if(Array.isArray(t))return t}function E(t){"@babel/helpers - typeof";return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},E(t)}var f=/a/g.flags!==void 0,n=function(o){var P=[];return o.forEach(function(T){return P.push(T)}),P},e=function(o){var P=[];return o.forEach(function(T,M){return P.push([M,T])}),P},r=Object.is?Object.is:Yr(),d=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},y=Number.isNaN?Number.isNaN:Zr();function l(t){return t.call.bind(t)}var q=l(Object.prototype.hasOwnProperty),O=l(Object.prototype.propertyIsEnumerable),A=l(Object.prototype.toString),j=Se().types,u=j.isAnyArrayBuffer,p=j.isArrayBufferView,S=j.isDate,N=j.isMap,B=j.isRegExp,K=j.isSet,H=j.isNativeError,V=j.isBoxedPrimitive,W=j.isNumberObject,te=j.isStringObject,Z=j.isBooleanObject,J=j.isBigIntObject,he=j.isSymbolObject,de=j.isFloat32Array,oe=j.isFloat64Array;function ye(t){if(t.length===0||t.length>10)return!0;for(var o=0;o<t.length;o++){var P=t.charCodeAt(o);if(P<48||P>57)return!0}return t.length===10&&t>=Math.pow(2,32)}function ce(t){return Object.keys(t).filter(ye).concat(d(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}/*!
|
|
49
|
+
* The buffer module from node.js, for the browser.
|
|
50
|
+
*
|
|
51
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
52
|
+
* @license MIT
|
|
53
|
+
*/function v(t,o){if(t===o)return 0;for(var P=t.length,T=o.length,M=0,$=Math.min(P,T);M<$;++M)if(t[M]!==o[M]){P=t[M],T=o[M];break}return P<T?-1:T<P?1:0}var m=!0,U=!1,x=0,C=1,a=2,i=3;function c(t,o){return f?t.source===o.source&&t.flags===o.flags:RegExp.prototype.toString.call(t)===RegExp.prototype.toString.call(o)}function R(t,o){if(t.byteLength!==o.byteLength)return!1;for(var P=0;P<t.byteLength;P++)if(t[P]!==o[P])return!1;return!0}function w(t,o){return t.byteLength!==o.byteLength?!1:v(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(o.buffer,o.byteOffset,o.byteLength))===0}function I(t,o){return t.byteLength===o.byteLength&&v(new Uint8Array(t),new Uint8Array(o))===0}function D(t,o){return W(t)?W(o)&&r(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(o)):te(t)?te(o)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(o):Z(t)?Z(o)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(o):J(t)?J(o)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(o):he(o)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(o)}function z(t,o,P,T){if(t===o)return t!==0?!0:P?r(t,o):!0;if(P){if(E(t)!=="object")return typeof t=="number"&&y(t)&&y(o);if(E(o)!=="object"||t===null||o===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(o))return!1}else{if(t===null||E(t)!=="object")return o===null||E(o)!=="object"?t==o:!1;if(o===null||E(o)!=="object")return!1}var M=A(t),$=A(o);if(M!==$)return!1;if(Array.isArray(t)){if(t.length!==o.length)return!1;var F=ce(t),G=ce(o);return F.length!==G.length?!1:X(t,o,P,T,C,F)}if(M==="[object Object]"&&(!N(t)&&N(o)||!K(t)&&K(o)))return!1;if(S(t)){if(!S(o)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(o))return!1}else if(B(t)){if(!B(o)||!c(t,o))return!1}else if(H(t)||t instanceof Error){if(t.message!==o.message||t.name!==o.name)return!1}else if(p(t)){if(!P&&(de(t)||oe(t))){if(!R(t,o))return!1}else if(!w(t,o))return!1;var Y=ce(t),Q=ce(o);return Y.length!==Q.length?!1:X(t,o,P,T,x,Y)}else{if(K(t))return!K(o)||t.size!==o.size?!1:X(t,o,P,T,a);if(N(t))return!N(o)||t.size!==o.size?!1:X(t,o,P,T,i);if(u(t)){if(!I(t,o))return!1}else if(V(t)&&!D(t,o))return!1}return X(t,o,P,T,x)}function k(t,o){return o.filter(function(P){return O(t,P)})}function X(t,o,P,T,M,$){if(arguments.length===5){$=Object.keys(t);var F=Object.keys(o);if($.length!==F.length)return!1}for(var G=0;G<$.length;G++)if(!q(o,$[G]))return!1;if(P&&arguments.length===5){var Y=d(t);if(Y.length!==0){var Q=0;for(G=0;G<Y.length;G++){var re=Y[G];if(O(t,re)){if(!O(o,re))return!1;$.push(re),Q++}else if(O(o,re))return!1}var Ee=d(o);if(Y.length!==Ee.length&&k(o,Ee).length!==Q)return!1}else{var be=d(o);if(be.length!==0&&k(o,be).length!==0)return!1}}if($.length===0&&(M===x||M===C&&t.length===0||t.size===0))return!0;if(T===void 0)T={val1:new Map,val2:new Map,position:0};else{var me=T.val1.get(t);if(me!==void 0){var fe=T.val2.get(o);if(fe!==void 0)return me===fe}T.position++}T.val1.set(t,T.position),T.val2.set(o,T.position);var we=ie(t,o,P,$,T,M);return T.val1.delete(t),T.val2.delete(o),we}function ee(t,o,P,T){for(var M=n(t),$=0;$<M.length;$++){var F=M[$];if(z(o,F,P,T))return t.delete(F),!0}return!1}function se(t){switch(E(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(y(t))return!1}return!0}function ge(t,o,P){var T=se(P);return T??(o.has(T)&&!t.has(T))}function le(t,o,P,T,M){var $=se(P);if($!=null)return $;var F=o.get($);return F===void 0&&!o.has($)||!z(T,F,!1,M)?!1:!t.has($)&&z(T,F,!1,M)}function ne(t,o,P,T){for(var M=null,$=n(t),F=0;F<$.length;F++){var G=$[F];if(E(G)==="object"&&G!==null)M===null&&(M=new Set),M.add(G);else if(!o.has(G)){if(P||!ge(t,o,G))return!1;M===null&&(M=new Set),M.add(G)}}if(M!==null){for(var Y=n(o),Q=0;Q<Y.length;Q++){var re=Y[Q];if(E(re)==="object"&&re!==null){if(!ee(M,re,P,T))return!1}else if(!P&&!t.has(re)&&!ee(M,re,P,T))return!1}return M.size===0}return!0}function ve(t,o,P,T,M,$){for(var F=n(t),G=0;G<F.length;G++){var Y=F[G];if(z(P,Y,M,$)&&z(T,o.get(Y),M,$))return t.delete(Y),!0}return!1}function Oe(t,o,P,T){for(var M=null,$=e(t),F=0;F<$.length;F++){var G=h($[F],2),Y=G[0],Q=G[1];if(E(Y)==="object"&&Y!==null)M===null&&(M=new Set),M.add(Y);else{var re=o.get(Y);if(re===void 0&&!o.has(Y)||!z(Q,re,P,T)){if(P||!le(t,o,Y,Q,T))return!1;M===null&&(M=new Set),M.add(Y)}}}if(M!==null){for(var Ee=e(o),be=0;be<Ee.length;be++){var me=h(Ee[be],2),fe=me[0],we=me[1];if(E(fe)==="object"&&fe!==null){if(!ve(M,t,fe,we,P,T))return!1}else if(!P&&(!t.has(fe)||!z(t.get(fe),we,!1,T))&&!ve(M,t,fe,we,!1,T))return!1}return M.size===0}return!0}function ie(t,o,P,T,M,$){var F=0;if($===a){if(!ne(t,o,P,M))return!1}else if($===i){if(!Oe(t,o,P,M))return!1}else if($===C)for(;F<t.length;F++)if(q(t,F)){if(!q(o,F)||!z(t[F],o[F],P,M))return!1}else{if(q(o,F))return!1;for(var G=Object.keys(t);F<G.length;F++){var Y=G[F];if(!q(o,Y)||!z(t[Y],o[Y],P,M))return!1}return G.length===Object.keys(o).length}for(F=0;F<T.length;F++){var Q=T[F];if(!z(t[Q],o[Q],P,M))return!1}return!0}function pe(t,o){return z(t,o,U)}function ue(t,o){return z(t,o,m)}return Le={isDeepEqual:pe,isDeepStrictEqual:ue},Le}var pr;function We(){if(pr)return Pe.exports;pr=1;function h(a){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},h(a)}function g(a,i,c){return Object.defineProperty(a,"prototype",{writable:!1}),a}function s(a,i){if(!(a instanceof i))throw new TypeError("Cannot call a class as a function")}var b=Ar(),_=b.codes,L=_.ERR_AMBIGUOUS_ARGUMENT,E=_.ERR_INVALID_ARG_TYPE,f=_.ERR_INVALID_ARG_VALUE,n=_.ERR_INVALID_RETURN_VALUE,e=_.ERR_MISSING_ARGS,r=Fr(),d=Se(),y=d.inspect,l=Se().types,q=l.isPromise,O=l.isRegExp,A=Gr()(),j=Xe()(),u=Tr()("RegExp.prototype.test"),p,S;function N(){var a=Wr();p=a.isDeepEqual,S=a.isDeepStrictEqual}var B=!1,K=Pe.exports=Z,H={};function V(a){throw a.message instanceof Error?a.message:new r(a)}function W(a,i,c,R,w){var I=arguments.length,D;if(I===0)D="Failed";else if(I===1)c=a,a=void 0;else{if(B===!1){B=!0;var z=ae.emitWarning?ae.emitWarning:console.warn.bind(console);z("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}I===2&&(R="!=")}if(c instanceof Error)throw c;var k={actual:a,expected:i,operator:R===void 0?"fail":R,stackStartFn:w||W};c!==void 0&&(k.message=c);var X=new r(k);throw D&&(X.message=D,X.generatedMessage=!0),X}K.fail=W,K.AssertionError=r;function te(a,i,c,R){if(!c){var w=!1;if(i===0)w=!0,R="No value argument passed to `assert.ok()`";else if(R instanceof Error)throw R;var I=new r({actual:c,expected:!0,message:R,operator:"==",stackStartFn:a});throw I.generatedMessage=w,I}}function Z(){for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];te.apply(void 0,[Z,i.length].concat(i))}K.ok=Z,K.equal=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");i!=c&&V({actual:i,expected:c,message:R,operator:"==",stackStartFn:a})},K.notEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");i==c&&V({actual:i,expected:c,message:R,operator:"!=",stackStartFn:a})},K.deepEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),p(i,c)||V({actual:i,expected:c,message:R,operator:"deepEqual",stackStartFn:a})},K.notDeepEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),p(i,c)&&V({actual:i,expected:c,message:R,operator:"notDeepEqual",stackStartFn:a})},K.deepStrictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),S(i,c)||V({actual:i,expected:c,message:R,operator:"deepStrictEqual",stackStartFn:a})},K.notDeepStrictEqual=J;function J(a,i,c){if(arguments.length<2)throw new e("actual","expected");p===void 0&&N(),S(a,i)&&V({actual:a,expected:i,message:c,operator:"notDeepStrictEqual",stackStartFn:J})}K.strictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");j(i,c)||V({actual:i,expected:c,message:R,operator:"strictEqual",stackStartFn:a})},K.notStrictEqual=function a(i,c,R){if(arguments.length<2)throw new e("actual","expected");j(i,c)&&V({actual:i,expected:c,message:R,operator:"notStrictEqual",stackStartFn:a})};var he=g(function a(i,c,R){var w=this;s(this,a),c.forEach(function(I){I in i&&(R!==void 0&&typeof R[I]=="string"&&O(i[I])&&u(i[I],R[I])?w[I]=R[I]:w[I]=i[I])})});function de(a,i,c,R,w,I){if(!(c in a)||!S(a[c],i[c])){if(!R){var D=new he(a,w),z=new he(i,w,a),k=new r({actual:D,expected:z,operator:"deepStrictEqual",stackStartFn:I});throw k.actual=a,k.expected=i,k.operator=I.name,k}V({actual:a,expected:i,message:R,operator:I.name,stackStartFn:I})}}function oe(a,i,c,R){if(typeof i!="function"){if(O(i))return u(i,a);if(arguments.length===2)throw new E("expected",["Function","RegExp"],i);if(h(a)!=="object"||a===null){var w=new r({actual:a,expected:i,message:c,operator:"deepStrictEqual",stackStartFn:R});throw w.operator=R.name,w}var I=Object.keys(i);if(i instanceof Error)I.push("name","message");else if(I.length===0)throw new f("error",i,"may not be an empty object");return p===void 0&&N(),I.forEach(function(D){typeof a[D]=="string"&&O(i[D])&&u(i[D],a[D])||de(a,i,D,c,I,R)}),!0}return i.prototype!==void 0&&a instanceof i?!0:Error.isPrototypeOf(i)?!1:i.call({},a)===!0}function ye(a){if(typeof a!="function")throw new E("fn","Function",a);try{a()}catch(i){return i}return H}function ce(a){return q(a)||a!==null&&h(a)==="object"&&typeof a.then=="function"&&typeof a.catch=="function"}function v(a){return Promise.resolve().then(function(){var i;if(typeof a=="function"){if(i=a(),!ce(i))throw new n("instance of Promise","promiseFn",i)}else if(ce(a))i=a;else throw new E("promiseFn",["Function","Promise"],a);return Promise.resolve().then(function(){return i}).then(function(){return H}).catch(function(c){return c})})}function m(a,i,c,R){if(typeof c=="string"){if(arguments.length===4)throw new E("error",["Object","Error","Function","RegExp"],c);if(h(i)==="object"&&i!==null){if(i.message===c)throw new L("error/message",'The error message "'.concat(i.message,'" is identical to the message.'))}else if(i===c)throw new L("error/message",'The error "'.concat(i,'" is identical to the message.'));R=c,c=void 0}else if(c!=null&&h(c)!=="object"&&typeof c!="function")throw new E("error",["Object","Error","Function","RegExp"],c);if(i===H){var w="";c&&c.name&&(w+=" (".concat(c.name,")")),w+=R?": ".concat(R):".";var I=a.name==="rejects"?"rejection":"exception";V({actual:void 0,expected:c,operator:a.name,message:"Missing expected ".concat(I).concat(w),stackStartFn:a})}if(c&&!oe(i,c,R,a))throw i}function U(a,i,c,R){if(i!==H){if(typeof c=="string"&&(R=c,c=void 0),!c||oe(i,c)){var w=R?": ".concat(R):".",I=a.name==="doesNotReject"?"rejection":"exception";V({actual:i,expected:c,operator:a.name,message:"Got unwanted ".concat(I).concat(w,`
|
|
54
|
+
`)+'Actual message: "'.concat(i&&i.message,'"'),stackStartFn:a})}throw i}}K.throws=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),w=1;w<c;w++)R[w-1]=arguments[w];m.apply(void 0,[a,ye(i)].concat(R))},K.rejects=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),w=1;w<c;w++)R[w-1]=arguments[w];return v(i).then(function(I){return m.apply(void 0,[a,I].concat(R))})},K.doesNotThrow=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),w=1;w<c;w++)R[w-1]=arguments[w];U.apply(void 0,[a,ye(i)].concat(R))},K.doesNotReject=function a(i){for(var c=arguments.length,R=new Array(c>1?c-1:0),w=1;w<c;w++)R[w-1]=arguments[w];return v(i).then(function(I){return U.apply(void 0,[a,I].concat(R))})},K.ifError=function a(i){if(i!=null){var c="ifError got unwanted exception: ";h(i)==="object"&&typeof i.message=="string"?i.message.length===0&&i.constructor?c+=i.constructor.name:c+=i.message:c+=y(i);var R=new r({actual:i,expected:null,operator:"ifError",message:c,stackStartFn:a}),w=i.stack;if(typeof w=="string"){var I=w.split(`
|
|
55
|
+
`);I.shift();for(var D=R.stack.split(`
|
|
56
|
+
`),z=0;z<I.length;z++){var k=D.indexOf(I[z]);if(k!==-1){D=D.slice(0,k);break}}R.stack="".concat(D.join(`
|
|
57
|
+
`),`
|
|
58
|
+
`).concat(I.join(`
|
|
59
|
+
`))}throw R}};function x(a,i,c,R,w){if(!O(i))throw new E("regexp","RegExp",i);var I=w==="match";if(typeof a!="string"||u(i,a)!==I){if(c instanceof Error)throw c;var D=!c;c=c||(typeof a!="string"?'The "string" argument must be of type string. Received type '+"".concat(h(a)," (").concat(y(a),")"):(I?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(y(i),`. Input:
|
|
60
|
+
|
|
61
|
+
`).concat(y(a),`
|
|
62
|
+
`));var z=new r({actual:a,expected:i,message:c,operator:w,stackStartFn:R});throw z.generatedMessage=D,z}}K.match=function a(i,c,R){x(i,c,R,a,"match")},K.doesNotMatch=function a(i,c,R){x(i,c,R,a,"doesNotMatch")};function C(){for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];te.apply(void 0,[C,i.length].concat(i))}return K.strict=A(C,K,{equal:K.strictEqual,deepEqual:K.deepStrictEqual,notEqual:K.notStrictEqual,notDeepEqual:K.notDeepStrictEqual}),K.strict.strict=K.strict,Pe.exports}var Ce,hr;function kr(){if(hr)return Ce;hr=1;var h=ke().Buffer;function g(s){if(s.length>=255)throw new TypeError("Alphabet too long");for(var b=new Uint8Array(256),_=0;_<b.length;_++)b[_]=255;for(var L=0;L<s.length;L++){var E=s.charAt(L),f=E.charCodeAt(0);if(b[f]!==255)throw new TypeError(E+" is ambiguous");b[f]=L}var n=s.length,e=s.charAt(0),r=Math.log(n)/Math.log(256),d=Math.log(256)/Math.log(n);function y(O){if((Array.isArray(O)||O instanceof Uint8Array)&&(O=h.from(O)),!h.isBuffer(O))throw new TypeError("Expected Buffer");if(O.length===0)return"";for(var A=0,j=0,u=0,p=O.length;u!==p&&O[u]===0;)u++,A++;for(var S=(p-u)*d+1>>>0,N=new Uint8Array(S);u!==p;){for(var B=O[u],K=0,H=S-1;(B!==0||K<j)&&H!==-1;H--,K++)B+=256*N[H]>>>0,N[H]=B%n>>>0,B=B/n>>>0;if(B!==0)throw new Error("Non-zero carry");j=K,u++}for(var V=S-j;V!==S&&N[V]===0;)V++;for(var W=e.repeat(A);V<S;++V)W+=s.charAt(N[V]);return W}function l(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return h.alloc(0);for(var A=0,j=0,u=0;O[A]===e;)j++,A++;for(var p=(O.length-A)*r+1>>>0,S=new Uint8Array(p);A<O.length;){var N=b[O.charCodeAt(A)];if(N===255)return;for(var B=0,K=p-1;(N!==0||B<u)&&K!==-1;K--,B++)N+=n*S[K]>>>0,S[K]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");u=B,A++}for(var H=p-u;H!==p&&S[H]===0;)H++;var V=h.allocUnsafe(j+(p-H));V.fill(0,0,j);for(var W=j;H!==p;)V[W++]=S[H++];return V}function q(O){var A=l(O);if(A)return A;throw new Error("Non-base"+n+" character")}return{encode:y,decodeUnsafe:l,decode:q}}return Ce=g,Ce}var Ve,dr;function Xr(){if(dr)return Ve;dr=1;var h=kr(),g="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return Ve=h(g),Ve}var Fe,yr;function Jr(){if(yr)return Fe;yr=1;var h=Xr(),g=ke().Buffer;return Fe=function(s){function b(f){var n=s(f);return h.encode(g.concat([f,n],f.length+4))}function _(f){var n=f.slice(0,-4),e=f.slice(-4),r=s(n);if(!(e[0]^r[0]|e[1]^r[1]|e[2]^r[2]|e[3]^r[3]))return n}function L(f){var n=h.decodeUnsafe(f);if(n)return _(n)}function E(f){var n=h.decode(f),e=_(n);if(!e)throw new Error("Invalid checksum");return e}return{encode:b,decode:E,decodeUnsafe:L}},Fe}var $e,br;function Qr(){if(br)return $e;br=1;var h=Ur(),g=Jr();function s(b){var _=h("sha256").update(b).digest();return h("sha256").update(_).digest()}return $e=g(s),$e}var Ge,gr;function et(){if(gr)return Ge;gr=1;const h={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function g(E,f){if(!E)throw new Error(f)}function s(E,f,n){if(g(f instanceof Uint8Array,`Expected ${E} to be an Uint8Array`),n!==void 0)if(Array.isArray(n)){const e=n.join(", "),r=`Expected ${E} to be an Uint8Array with length [${e}]`;g(n.includes(f.length),r)}else{const e=`Expected ${E} to be an Uint8Array with length ${n}`;g(f.length===n,e)}}function b(E){g(L(E)==="Boolean","Expected compressed to be a Boolean")}function _(E=n=>new Uint8Array(n),f){return typeof E=="function"&&(E=E(f)),s("output",E,f),E}function L(E){return Object.prototype.toString.call(E).slice(8,-1)}return Ge=E=>({contextRandomize(f){switch(g(f===null||f instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),f!==null&&s("seed",f,32),E.contextRandomize(f)){case 1:throw new Error(h.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(f){return s("private key",f,32),E.privateKeyVerify(f)===0},privateKeyNegate(f){switch(s("private key",f,32),E.privateKeyNegate(f)){case 0:return f;case 1:throw new Error(h.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(f,n){switch(s("private key",f,32),s("tweak",n,32),E.privateKeyTweakAdd(f,n)){case 0:return f;case 1:throw new Error(h.TWEAK_ADD)}},privateKeyTweakMul(f,n){switch(s("private key",f,32),s("tweak",n,32),E.privateKeyTweakMul(f,n)){case 0:return f;case 1:throw new Error(h.TWEAK_MUL)}},publicKeyVerify(f){return s("public key",f,[33,65]),E.publicKeyVerify(f)===0},publicKeyCreate(f,n=!0,e){switch(s("private key",f,32),b(n),e=_(e,n?33:65),E.publicKeyCreate(e,f)){case 0:return e;case 1:throw new Error(h.SECKEY_INVALID);case 2:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyConvert(f,n=!0,e){switch(s("public key",f,[33,65]),b(n),e=_(e,n?33:65),E.publicKeyConvert(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyNegate(f,n=!0,e){switch(s("public key",f,[33,65]),b(n),e=_(e,n?33:65),E.publicKeyNegate(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE);case 3:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyCombine(f,n=!0,e){g(Array.isArray(f),"Expected public keys to be an Array"),g(f.length>0,"Expected public keys array will have more than zero items");for(const r of f)s("public key",r,[33,65]);switch(b(n),e=_(e,n?33:65),E.publicKeyCombine(e,f)){case 0:return e;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.PUBKEY_COMBINE);case 3:throw new Error(h.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(f,n,e=!0,r){switch(s("public key",f,[33,65]),s("tweak",n,32),b(e),r=_(r,e?33:65),E.publicKeyTweakAdd(r,f,n)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.TWEAK_ADD)}},publicKeyTweakMul(f,n,e=!0,r){switch(s("public key",f,[33,65]),s("tweak",n,32),b(e),r=_(r,e?33:65),E.publicKeyTweakMul(r,f,n)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.TWEAK_MUL)}},signatureNormalize(f){switch(s("signature",f,64),E.signatureNormalize(f)){case 0:return f;case 1:throw new Error(h.SIG_PARSE)}},signatureExport(f,n){s("signature",f,64),n=_(n,72);const e={output:n,outputlen:72};switch(E.signatureExport(e,f)){case 0:return n.slice(0,e.outputlen);case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},signatureImport(f,n){switch(s("signature",f),n=_(n,64),E.signatureImport(n,f)){case 0:return n;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},ecdsaSign(f,n,e={},r){s("message",f,32),s("private key",n,32),g(L(e)==="Object","Expected options to be an Object"),e.data!==void 0&&s("options.data",e.data),e.noncefn!==void 0&&g(L(e.noncefn)==="Function","Expected options.noncefn to be a Function"),r=_(r,64);const d={signature:r,recid:null};switch(E.ecdsaSign(d,f,n,e.data,e.noncefn)){case 0:return d;case 1:throw new Error(h.SIGN);case 2:throw new Error(h.IMPOSSIBLE_CASE)}},ecdsaVerify(f,n,e){switch(s("signature",f,64),s("message",n,32),s("public key",e,[33,65]),E.ecdsaVerify(f,n,e)){case 0:return!0;case 3:return!1;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.PUBKEY_PARSE)}},ecdsaRecover(f,n,e,r=!0,d){switch(s("signature",f,64),g(L(n)==="Number"&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),s("message",e,32),b(r),d=_(d,r?33:65),E.ecdsaRecover(d,f,n,e)){case 0:return d;case 1:throw new Error(h.SIG_PARSE);case 2:throw new Error(h.RECOVER);case 3:throw new Error(h.IMPOSSIBLE_CASE)}},ecdh(f,n,e={},r){switch(s("public key",f,[33,65]),s("private key",n,32),g(L(e)==="Object","Expected options to be an Object"),e.data!==void 0&&s("options.data",e.data),e.hashfn!==void 0?(g(L(e.hashfn)==="Function","Expected options.hashfn to be a Function"),e.xbuf!==void 0&&s("options.xbuf",e.xbuf,32),e.ybuf!==void 0&&s("options.ybuf",e.ybuf,32),s("output",r)):r=_(r,32),E.ecdh(r,f,n,e.data,e.hashfn,e.xbuf,e.ybuf)){case 0:return r;case 1:throw new Error(h.PUBKEY_PARSE);case 2:throw new Error(h.ECDH)}}}),Ge}var ze,vr;function rt(){if(vr)return ze;vr=1;const h=Br().ec,g=new h("secp256k1"),s=g.curve,b=s.n.constructor;function _(n,e){let r=new b(e);if(r.cmp(s.p)>=0)return null;r=r.toRed(s.red);let d=r.redSqr().redIMul(r).redIAdd(s.b).redSqrt();return n===3!==d.isOdd()&&(d=d.redNeg()),g.keyPair({pub:{x:r,y:d}})}function L(n,e,r){let d=new b(e),y=new b(r);if(d.cmp(s.p)>=0||y.cmp(s.p)>=0||(d=d.toRed(s.red),y=y.toRed(s.red),(n===6||n===7)&&y.isOdd()!==(n===7)))return null;const l=d.redSqr().redIMul(d);return y.redSqr().redISub(l.redIAdd(s.b)).isZero()?g.keyPair({pub:{x:d,y}}):null}function E(n){const e=n[0];switch(e){case 2:case 3:return n.length!==33?null:_(e,n.subarray(1,33));case 4:case 6:case 7:return n.length!==65?null:L(e,n.subarray(1,33),n.subarray(33,65));default:return null}}function f(n,e){const r=e.encode(null,n.length===33);for(let d=0;d<n.length;++d)n[d]=r[d]}return ze={contextRandomize(){return 0},privateKeyVerify(n){const e=new b(n);return e.cmp(s.n)<0&&!e.isZero()?0:1},privateKeyNegate(n){const e=new b(n),r=s.n.sub(e).umod(s.n).toArrayLike(Uint8Array,"be",32);return n.set(r),0},privateKeyTweakAdd(n,e){const r=new b(e);if(r.cmp(s.n)>=0||(r.iadd(new b(n)),r.cmp(s.n)>=0&&r.isub(s.n),r.isZero()))return 1;const d=r.toArrayLike(Uint8Array,"be",32);return n.set(d),0},privateKeyTweakMul(n,e){let r=new b(e);if(r.cmp(s.n)>=0||r.isZero())return 1;r.imul(new b(n)),r.cmp(s.n)>=0&&(r=r.umod(s.n));const d=r.toArrayLike(Uint8Array,"be",32);return n.set(d),0},publicKeyVerify(n){return E(n)===null?1:0},publicKeyCreate(n,e){const r=new b(e);if(r.cmp(s.n)>=0||r.isZero())return 1;const d=g.keyFromPrivate(e).getPublic();return f(n,d),0},publicKeyConvert(n,e){const r=E(e);if(r===null)return 1;const d=r.getPublic();return f(n,d),0},publicKeyNegate(n,e){const r=E(e);if(r===null)return 1;const d=r.getPublic();return d.y=d.y.redNeg(),f(n,d),0},publicKeyCombine(n,e){const r=new Array(e.length);for(let y=0;y<e.length;++y)if(r[y]=E(e[y]),r[y]===null)return 1;let d=r[0].getPublic();for(let y=1;y<r.length;++y)d=d.add(r[y].pub);return d.isInfinity()?2:(f(n,d),0)},publicKeyTweakAdd(n,e,r){const d=E(e);if(d===null)return 1;if(r=new b(r),r.cmp(s.n)>=0)return 2;const y=d.getPublic().add(s.g.mul(r));return y.isInfinity()?2:(f(n,y),0)},publicKeyTweakMul(n,e,r){const d=E(e);if(d===null)return 1;if(r=new b(r),r.cmp(s.n)>=0||r.isZero())return 2;const y=d.getPublic().mul(r);return f(n,y),0},signatureNormalize(n){const e=new b(n.subarray(0,32)),r=new b(n.subarray(32,64));return e.cmp(s.n)>=0||r.cmp(s.n)>=0?1:(r.cmp(g.nh)===1&&n.set(s.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(n,e){const r=e.subarray(0,32),d=e.subarray(32,64);if(new b(r).cmp(s.n)>=0||new b(d).cmp(s.n)>=0)return 1;const{output:y}=n;let l=y.subarray(4,37);l[0]=0,l.set(r,1);let q=33,O=0;for(;q>1&&l[O]===0&&!(l[O+1]&128);--q,++O);if(l=l.subarray(O),l[0]&128||q>1&&l[0]===0&&!(l[1]&128))return 1;let A=y.subarray(39,72);A[0]=0,A.set(d,1);let j=33,u=0;for(;j>1&&A[u]===0&&!(A[u+1]&128);--j,++u);return A=A.subarray(u),A[0]&128||j>1&&A[0]===0&&!(A[1]&128)?1:(n.outputlen=6+q+j,y[0]=48,y[1]=n.outputlen-2,y[2]=2,y[3]=l.length,y.set(l,4),y[4+q]=2,y[5+q]=A.length,y.set(A,6+q),0)},signatureImport(n,e){if(e.length<8||e.length>72||e[0]!==48||e[1]!==e.length-2||e[2]!==2)return 1;const r=e[3];if(r===0||5+r>=e.length||e[4+r]!==2)return 1;const d=e[5+r];if(d===0||6+r+d!==e.length||e[4]&128||r>1&&e[4]===0&&!(e[5]&128)||e[r+6]&128||d>1&&e[r+6]===0&&!(e[r+7]&128))return 1;let y=e.subarray(4,4+r);if(y.length===33&&y[0]===0&&(y=y.subarray(1)),y.length>32)return 1;let l=e.subarray(6+r);if(l.length===33&&l[0]===0&&(l=l.slice(1)),l.length>32)throw new Error("S length is too long");let q=new b(y);q.cmp(s.n)>=0&&(q=new b(0));let O=new b(e.subarray(6+r));return O.cmp(s.n)>=0&&(O=new b(0)),n.set(q.toArrayLike(Uint8Array,"be",32),0),n.set(O.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(n,e,r,d,y){if(y){const O=y;y=A=>{const j=O(e,r,null,d,A);if(!(j instanceof Uint8Array&&j.length===32))throw new Error("This is the way");return new b(j)}}const l=new b(r);if(l.cmp(s.n)>=0||l.isZero())return 1;let q;try{q=g.sign(e,r,{canonical:!0,k:y,pers:d})}catch{return 1}return n.signature.set(q.r.toArrayLike(Uint8Array,"be",32),0),n.signature.set(q.s.toArrayLike(Uint8Array,"be",32),32),n.recid=q.recoveryParam,0},ecdsaVerify(n,e,r){const d={r:n.subarray(0,32),s:n.subarray(32,64)},y=new b(d.r),l=new b(d.s);if(y.cmp(s.n)>=0||l.cmp(s.n)>=0)return 1;if(l.cmp(g.nh)===1||y.isZero()||l.isZero())return 3;const q=E(r);if(q===null)return 2;const O=q.getPublic();return g.verify(e,d,O)?0:3},ecdsaRecover(n,e,r,d){const y={r:e.slice(0,32),s:e.slice(32,64)},l=new b(y.r),q=new b(y.s);if(l.cmp(s.n)>=0||q.cmp(s.n)>=0)return 1;if(l.isZero()||q.isZero())return 2;let O;try{O=g.recoverPubKey(d,y,r)}catch{return 2}return f(n,O),0},ecdh(n,e,r,d,y,l,q){const O=E(e);if(O===null)return 1;const A=new b(r);if(A.cmp(s.n)>=0||A.isZero())return 2;const j=O.getPublic().mul(A);if(y===void 0){const u=j.encode(null,!0),p=g.hash().update(u).digest();for(let S=0;S<32;++S)n[S]=p[S]}else{l||(l=new Uint8Array(32));const u=j.getX().toArray("be",32);for(let B=0;B<32;++B)l[B]=u[B];q||(q=new Uint8Array(32));const p=j.getY().toArray("be",32);for(let B=0;B<32;++B)q[B]=p[B];const S=y(l,q,d);if(!(S instanceof Uint8Array&&S.length===n.length))return 2;n.set(S)}return 0}},ze}var Ye,Er;function tt(){return Er||(Er=1,Ye=et()(rt())),Ye}var He,mr;function nt(){if(mr)return He;mr=1;var h=We(),g=ke().Buffer,s=Dr(),b=Mr(),_=Qr(),L=tt(),E=g.from("Bitcoin seed","utf8"),f=2147483648,n=78,e={private:76066276,public:76067358};function r(l){this.versions=l||e,this.depth=0,this.index=0,this._privateKey=null,this._publicKey=null,this.chainCode=null,this._fingerprint=0,this.parentFingerprint=0}Object.defineProperty(r.prototype,"fingerprint",{get:function(){return this._fingerprint}}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this._identifier}}),Object.defineProperty(r.prototype,"pubKeyHash",{get:function(){return this.identifier}}),Object.defineProperty(r.prototype,"privateKey",{get:function(){return this._privateKey},set:function(l){l=Uint8Array.from(l),h.equal(l.length,32,"Private key must be 32 bytes."),h(L.privateKeyVerify(l)===!0,"Invalid private key"),this._privateKey=g.from(l),this._publicKey=g.from(L.publicKeyCreate(l,!0)),this._identifier=y(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0)}}),Object.defineProperty(r.prototype,"publicKey",{get:function(){return this._publicKey},set:function(l){h(l.length===33||l.length===65,"Public key must be 33 or 65 bytes."),h(L.publicKeyVerify(l)===!0,"Invalid public key"),this._publicKey=g.from(L.publicKeyConvert(l,!0)),this._identifier=y(this.publicKey),this._fingerprint=this._identifier.slice(0,4).readUInt32BE(0),this._privateKey=null}}),Object.defineProperty(r.prototype,"privateExtendedKey",{get:function(){return this._privateKey?_.encode(d(this,this.versions.private,g.concat([g.alloc(1,0),this.privateKey]))):null}}),Object.defineProperty(r.prototype,"publicExtendedKey",{get:function(){return _.encode(d(this,this.versions.public,this.publicKey))}}),r.prototype.derive=function(l){if(l==="m"||l==="M"||l==="m'"||l==="M'")return this;var q=l.split("/"),O=this;return q.forEach(function(A,j){if(j===0){h(/^[mM]{1}/.test(A),'Path must start with "m" or "M"');return}var u=A.length>1&&A[A.length-1]==="'",p=parseInt(A,10);h(p<f,"Invalid index"),u&&(p+=f),O=O.deriveChild(p)}),O},r.prototype.deriveChild=function(l){var q=l>=f,O=g.allocUnsafe(4);O.writeUInt32BE(l,0);var A;if(q){h(this.privateKey,"Could not derive hardened child key");var j=g.from(this.privateKey),u=g.alloc(1,0);j=g.concat([u,j]),A=g.concat([j,O])}else A=g.concat([this.publicKey,O]);var p=s.createHmac("sha512",this.chainCode).update(A).digest(),S=p.slice(0,32),N=p.slice(32),B=new r(this.versions);if(this.privateKey)try{B.privateKey=g.from(L.privateKeyTweakAdd(g.from(this.privateKey),S))}catch{return this.deriveChild(l+1)}else try{B.publicKey=g.from(L.publicKeyTweakAdd(g.from(this.publicKey),S,!0))}catch{return this.deriveChild(l+1)}return B.chainCode=N,B.depth=this.depth+1,B.parentFingerprint=this.fingerprint,B.index=l,B},r.prototype.sign=function(l){return g.from(L.ecdsaSign(l,this.privateKey).signature)},r.prototype.verify=function(l,q){return L.ecdsaVerify(Uint8Array.from(q),Uint8Array.from(l),Uint8Array.from(this.publicKey))},r.prototype.wipePrivateData=function(){return this._privateKey&&s.randomBytes(this._privateKey.length).copy(this._privateKey),this._privateKey=null,this},r.prototype.toJSON=function(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}},r.fromMasterSeed=function(l,q){var O=s.createHmac("sha512",E).update(l).digest(),A=O.slice(0,32),j=O.slice(32),u=new r(q);return u.chainCode=j,u.privateKey=A,u},r.fromExtendedKey=function(l,q){q=q||e;var O=new r(q),A=_.decode(l),j=A.readUInt32BE(0);h(j===q.private||j===q.public,"Version mismatch: does not match private or public"),O.depth=A.readUInt8(4),O.parentFingerprint=A.readUInt32BE(5),O.index=A.readUInt32BE(9),O.chainCode=A.slice(13,45);var u=A.slice(45);return u.readUInt8(0)===0?(h(j===q.private,"Version mismatch: version does not match private"),O.privateKey=g.from(u.slice(1))):(h(j===q.public,"Version mismatch: version does not match public"),O.publicKey=g.from(u)),O},r.fromJSON=function(l){return r.fromExtendedKey(l.xpriv)};function d(l,q,O){var A=g.allocUnsafe(n);A.writeUInt32BE(q,0),A.writeUInt8(l.depth,4);var j=l.depth?l.parentFingerprint:0;return A.writeUInt32BE(j,5),A.writeUInt32BE(l.index,9),l.chainCode.copy(A,13),O.copy(A,45),A}function y(l){var q=s.createHash("sha256").update(l).digest();return new b().update(q).digest()}return r.HARDENED_OFFSET=f,He=r,He}var Ze,wr;function ut(){if(wr)return Ze;wr=1;const h=nt(),g=Lr(),{fromSecretKey:s,WalletType:b}=Vr(),{isHexStrict:_,toHex:L,toBuffer:E,stripHexPrefix:f}=Cr(),{types:n}=g;return Ze={fromAppDid:(r,d,y={role:n.RoleType.ROLE_ACCOUNT},l=0)=>{if(!d)throw new Error("Cannot get user wallet with empty root sk");const q=g.Hasher.SHA3.hash256(E(r)),O=f(q).slice(0,16),A=O.slice(0,8),j=O.slice(8,16),u=parseInt(+`0x${A}`,10)&2147483647,p=parseInt(+`0x${j}`,10)&2147483647,S=f(_(d)?d:L(d)),N=h.fromMasterSeed(qr.from(S,"hex")),B=`m/44'/260'/${u}'/${p}'/${l}`,K=N.derive(B),H=b(y),{pk:V=n.KeyType.ED25519}=H;let W;return V===n.KeyType.ED25519?W=g.Signer.Ed25519.genKeyPair("hex",K.privateKey).secretKey:W=L(K.privateKey),V===n.KeyType.ETHEREUM&&(W=W.slice(0,66)),s(W,H)}},Ze}export{ut as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,b6 as e,bg as a,W as s}from"./vendor-mui-core-CnXrAOs3.js";import{l}from"./vendor-ux-
|
|
1
|
+
import{j as i,b6 as e,bg as a,W as s}from"./vendor-mui-core-CnXrAOs3.js";import{l}from"./vendor-ux-IiQnod3w.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as j,g as ge}from"./vendor-react-Dvs43sk9.js";import{j as o,T as H,z as $,x as ye,c3 as ve,c4 as Y,bw as je,F as Ce,bD as Te,aX as Fe,a6 as U,W as C,b6 as be,a5 as we,I as K,at as G,ak as B,J as Se,Q as Be,cb as De,am as Re}from"./vendor-mui-core-CnXrAOs3.js";import{_ as E,
|
|
1
|
+
import{r as j,g as ge}from"./vendor-react-Dvs43sk9.js";import{j as o,T as H,z as $,x as ye,c3 as ve,c4 as Y,bw as je,F as Ce,bD as Te,aX as Fe,a6 as U,W as C,b6 as be,a5 as we,I as K,at as G,ak as B,J as Se,Q as Be,cb as De,am as Re}from"./vendor-mui-core-CnXrAOs3.js";import{_ as E,b5 as ae,B as le,c as Ne}from"./index-sNHCLgAE.js";import{V as L,b as ce,n as _,H as z,E as ee,S as Pe}from"./vendor-ux-IiQnod3w.js";import{e as ue}from"./edit.svg-DycWG9v3.js";import{C as He}from"./lock.svg-COUP8tyO.js";import{G as Ie,H as _e}from"./vendor-utils-cJEl_UEd.js";import{f as pe}from"./index-DBs9Ljax.js";import{u as de}from"./team-DQuySqMB.js";import{w as me,P as Ee}from"./permission-DhYNRf8T.js";import{C as Le}from"./confirm-CR8be0u2.js";const Me=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));var A={exports:{}},W={exports:{}},te;function ke(){return te||(te=1,function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};W.exports=m}()),W.exports}var V,re;function ne(){if(re)return V;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return V=u,V}/*!
|
|
2
2
|
* Determine if an object is a Buffer
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,y as ht,bc as ye,M as ne,ak as h,Q as G,W as p,J as ve,c1 as xt,I as D,aN as gt,T as E,aj as mt,b5 as Pe,P as Ie,b6 as Te,a5 as Re,z as Ue,A as Fe,ci as bt,bh as yt,U as Me,cR as vt,cS as wt,at as Z,cT as jt,a6 as V,n as oe,D as Ct,cU as kt,ar as Ae,b1 as we,cV as St,aX as Pt,a$ as It,cW as Tt}from"./vendor-mui-core-CnXrAOs3.js";import{r as y,a as Rt,u as Mt,j as At}from"./vendor-react-Dvs43sk9.js";import{t as _e,Z as Et,a4 as zt,R as Ee,D as Lt,C as se,n as H,A as Wt}from"./vendor-utils-ByKYcWuf.js";import{a as Dt,G as Bt,bf as Ot,c as je,Z as $t,bg as Nt,aw as qe,X as le,bd as Ut,bh as Ft,a9 as _t,aa as qt,bi as Ht}from"./index-CkTEzTCn.js";import{a as T,h as Gt,k as ce,g as Q,b as A,j as Kt}from"./vendor-hooks-OpgB8gyY.js";import{l as He}from"./arrow-down.svg-BNc6qym0.js";import{p as Ce,U as L,V as W,ag as Vt,i as Ge,ah as Yt,H as $,ai as Zt,aj as Qt,ak as ze,e as Xt,n as Ke,d as ke,al as Jt,am as P,D as er,C as tr,$ as rr,an as nr,ao as or,o as Ve}from"./vendor-ux-RIH1nUSh.js";import{N as sr}from"./list-BDeeBLEM.js";import{d as ir}from"./search-4YYphs0l.js";import{B as Le}from"./bundle-avatar-DKBZZwLh.js";import{h as We,T as ar}from"./team-aiCyLcOV.js";import{b as lr,d as cr,a as dr,c as ur,e as pr,f as fr,h as hr,O as xr}from"./user-center-BVnh5pB3.js";import{T as De,O as gr}from"./index-CuFT_Y96.js";import{c as mr}from"./passport-CScachCU.js";import{N as Ye,U as Ze}from"./index-H8Dc7uuB.js";import{u as de}from"./use-mobile-DCNBsOlH.js";import br from"./index-BCF14HSR.js";import{U as yr,a as vr}from"./user-follower-z3gqroPM.js";import{f as Y}from"./index-DBs9Ljax.js";import{u as me}from"./index-D2k5qLgT.js";import wr from"./index-D-Y0UA7w.js";import{o as jr}from"./vendor-arcblock-A4RQuZfN.js";import{c as Cr,b as ie,a as kr,S as Sr}from"./index-BydChKjR.js";import"./index-CrRuO2BQ.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-OYI_VqY3.js";import"./util-Cx4i9QNN.js";import"./base32-DvFJDTUa.js";import"./session-GdZETrt0.js";import"./isURL-CyShrkvP.js";import"./use-app-logo-Duu7Oh3J.js";import"./index-Kwxwmog8.js";import"./revoke.svg-CmffMlcP.js";import"./use-mobile-maRlSUwU.js";import"./actions-DqoNrBDK.js";import"./index-Ch4CmFJG.js";import"./form-text-input-BZq_zjB8.js";import"./required-BGaDOGrj.js";import"./form-wrapper-C8oo_Fdy.js";import"./edit.svg-DycWG9v3.js";import"./lock.svg-COUP8tyO.js";import"./index-I8DDinX-.js";import"./permission-COoKrWxk.js";import"./confirm-BCjJ3Xga.js";import"./click-to-copy-8VrSVycN.js";import"./invitations-DBukPMcf.js";import"./create-passport-svg-BYZ8eY0w.js";import"./api-BNrHV6cZ.js";import"./table-tips-6mCQ469z.js";import"./ua-parser-DP5omx3I.js";import"./sdk-CkMqUWSI.js";import"./passport-item-BefzYs0z.js";import"./did-address-BxZuOgUQ.js";import"./index-COj40KfT.js";import"./vendor-mui-x-bJ5idfMH.js";import"./AdapterDayjs-DS6RugP1.js";import"./delete-confirm-D2vWlDhQ.js";import"./index-DRYJ0xIl.js";function Pr(){let t=new Map;function i({root:s,rootMargin:n,threshold:o}){let u=t.get(s);u||(u=new Map,t.set(s,u));let a=JSON.stringify({rootMargin:n,threshold:o}),d=u.get(a);if(!d){let r=new Map;d={observer:new IntersectionObserver(f=>{f.forEach(g=>{r.get(g.target)?.(g)})},{root:s,rootMargin:n,threshold:o}),entryCallbacks:r},u.set(a,d)}return{observe:(r,f)=>{d.entryCallbacks.set(r,f),d.observer.observe(r)},unobserve:r=>{d.entryCallbacks.delete(r),d.observer.unobserve(r)}}}return{getObserver:i}}var Ir="0px",Tr=[0],Rr=Pr();function Mr(t){let i=t?.rootMargin??Ir,s=t?.threshold??Tr,n=y.useRef(null),o=y.useRef(null),u=y.useRef(null),[a,d]=y.useState(),r=y.useCallback(()=>{let j=n.current;if(!j){d(void 0);return}let v=Rr.getObserver({root:o.current,rootMargin:i,threshold:s});v.observe(j,l=>{d(l)}),u.current=v},[i,s]),f=y.useCallback(()=>{let j=u.current,v=n.current;v&&j?.unobserve(v),u.current=null},[]),g=y.useCallback(j=>{f(),n.current=j,r()},[r,f]),x=y.useCallback(j=>{f(),o.current=j,r()},[r,f]);return[g,{entry:a,rootRef:x}]}var Ar=Mr;function Er(t){let[i,s]=Ar(t),n=!!s.entry?.isIntersecting,[o,u]=y.useState(n);return n&&!o&&u(!0),[i,{...s,isVisible:n,wasEverVisible:o}]}var zr=Er,Lr=100;function Wr({loading:t,hasNextPage:i,onLoadMore:s,rootMargin:n,disabled:o,delayInMs:u=Lr}){let a=y.useRef(s),[d,{rootRef:r,isVisible:f}]=zr({rootMargin:n});y.useEffect(()=>{a.current=s},[s]);let g=!o&&!t&&f&&i;return y.useEffect(()=>{if(g){let x=setTimeout(()=>{a.current()},u);return()=>{clearTimeout(x)}}},[g,u]),[d,{rootRef:r}]}var Dr=Wr;const ge={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:p.oneOf(["info","success","warning","error",""]).isRequired,size:p.number};function ae({severity:t,size:i=8}){return ge[t]?e.jsx(h,{component:"span",sx:{display:"inline-block",width:i,height:i,borderRadius:"50%",backgroundColor:ge[t]||ge.info}}):null}Qe.propTypes={theme:p.string,type:p.oneOf(["button","line","select"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function Qe({theme:t="dark",type:i="button",onSelectType:s,extra:n=void 0,currentTab:o="",loading:u=!1,...a}){const{t:d}=y.useContext(Ce),r=[{label:d("notification.allSeverity"),value:""},{label:d("notification.severityType.info"),value:"info"},{label:d("notification.severityType.success"),value:"success"},{label:d("notification.severityType.warning"),value:"warning"},{label:d("notification.severityType.error"),value:"error"}],f=m=>{(m!==o||!u)&&s(m)},g=y.useMemo(()=>{const m={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:i==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return i==="line"?Object.assign(m,{}):m},[i,t]),x=(m,C,I)=>e.jsx(G,{disabled:u,onClick:()=>f(m.value),className:`profile-button ${C?"active":""}`,...a,children:m.label},m.value||I),j=(m,C,I)=>e.jsx(G,{variant:"text",disabled:u,onClick:()=>f(m.value),className:`profile-line-button ${C?"active":""}`,...a,children:m.label},m.value||I),v=()=>r?.map((m,C)=>{const I=o===m?.value;return i==="line"?e.jsx(y.Fragment,{children:j(m,I,C)},m.value||C):e.jsx(y.Fragment,{children:x(m,I,C)},m.value||C)}),l=m=>{const{value:C}=m.target;f(C==="all"?"":C)};return i==="select"?e.jsx(ht,{sx:{maxWidth:300},children:e.jsx(ye,{value:o||"all",onChange:l,size:"small",label:"Severity",IconComponent:m=>e.jsx(He,{...m,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((m,C)=>e.jsx(ne,{value:m.value||"all",children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:m.value}),m.label]})},m.value||C))})}):e.jsxs(h,{className:"severity-tabs",sx:g,children:[e.jsx(h,{sx:{...i==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}Xe.propTypes={paging:p.objectOf(p.any).isRequired,loading:p.bool.isRequired,onChange:p.func.isRequired};function Xe({loading:t,paging:i,onChange:s}){const{t:n}=y.useContext(Ce),o=ve(r=>r.breakpoints.down("md"));if(i.pageCount<=0||o)return null;const u=(r,f)=>{s({page:f+1})},a=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},d=i.page-1<=0?0:i.page-1;return e.jsx(h,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(xt,{component:"div",disabled:t,count:i.total,page:d,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:g})=>`${r}–${f} / ${g!==-1?g:`${n()}more than ${f}`}`,rowsPerPage:i.pageSize,onPageChange:u,onRowsPerPageChange:a})})}const Br=y.memo(Xe),Or={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Be=6,Oe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},$r={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},$e=()=>({...$r,width:"calc(50% - 8px)"});Je.propTypes={loading:p.bool,type:p.oneOf(["server","service"]),onFilterChange:p.func,blockletMap:p.object,filterType:p.oneOf(["component","entity"]),selectedId:p.array,severity:p.array,enableMarkAllAsRead:p.bool,unReadCount:p.number,onReadFilterChange:p.func,currentReadFilter:p.string};function Je({onFilterChange:t=()=>{},loading:i=!1,type:s="service",blockletMap:n={},filterType:o="component",selectedId:u=[],severity:a=[],enableMarkAllAsRead:d=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:g="all"}){const{t:x}=y.useContext(Ce),[j,v]=y.useState(null),l=!!j,[m,C]=y.useState(u),[I,k]=y.useState(a),[b,R]=y.useState(!1),[M,_]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{C(u),k(a)},[u,a]);const U=[{label:x("notification.filterType.all"),value:"all"},{label:x("notification.filterType.unread"),value:"unread"}],X=c=>{(c!==g||!i)&&f(c)},K=[{label:x("notification.severityType.info"),value:"info"},{label:x("notification.severityType.success"),value:"success"},{label:x("notification.severityType.warning"),value:"warning"},{label:x("notification.severityType.error"),value:"error"}],J=c=>{v(c.currentTarget),_(""),R(!1)},pe=()=>{v(null)},ee=c=>{const w=m.includes(c)?m.filter(S=>S!==c):[...m,c];C(w),t({id:w,severity:I})},te=c=>{const w=I.includes(c)?I.filter(S=>S!==c):[...I,c];k(w),t({severity:w,id:m})},fe=c=>{_(c.target.value)},he=()=>{R(!b)},q=Rt.useMemo(()=>{if(!n.size)return[];const c=[];return o==="component"&&c.push({label:x("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const S=w.did||w.meta?.did,z=w.title||w.meta?.title||"",O=w.appPid||w.appDid;(o==="component"&&O!==S||o==="entity"&&O===S)&&c.push({label:z,id:S,blocklet:w,ancestors:w.ancestors})}),c},[n,o,x]);y.useEffect(()=>{if(M.trim()==="")N(q);else{const c=M.toLowerCase(),w=q.filter(S=>S.label.toLowerCase().includes(c));N(w)}},[M,q]);const xe=M.trim()!==""||b?B:B.slice(0,Be);return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",justifyContent:d?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[d&&e.jsx(h,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:i,onClick:()=>X(c.value),className:`profile-button ${g===c.value?"active":""}`,sx:{...s==="service"&&g===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:g===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&r>0&&` (${r})`]},c.value))}),e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(D,{size:"small",onClick:J,disabled:i,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(L,{icon:Or,hFlip:!0})}),e.jsx(gt,{open:l,anchorEl:j,onClose:pe,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:x("notification.severity")}),e.jsx(h,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(m.length>0||I.length>0)&&e.jsx(G,{size:"small",onClick:()=>{C([]),k([]),t({severity:[],id:[]})},startIcon:e.jsx(mt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:x("notification.clear")})})]}),e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Ie,{elevation:0,sx:$e(I.includes(c.value)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Oe},control:e.jsx(Re,{checked:I.includes(c.value),onChange:()=>te(c.value),disabled:i,size:"small"}),label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(h,{sx:{mb:2},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:x("notification.from")}),e.jsx(h,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ue,{size:"small",placeholder:"search",value:M,onChange:fe,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Fe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(L,{icon:ir})})}}})})]}),e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Ie,{elevation:0,sx:$e(m.includes(c.id)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Oe},control:e.jsx(Re,{checked:m.includes(c.id),onChange:()=>ee(c.id),disabled:i,size:"small"}),label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(Le,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(E,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>Be&&M.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:b?e.jsx(bt,{}):e.jsx(yt,{})})]})]})})]})]}),m.length>0||I.length>0?e.jsxs(h,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[I.map(c=>{const w=K.find(S=>S.value===c);return e.jsx(Me,{label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>te(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),m.map(c=>{const w=q.find(S=>S.id===c);return e.jsx(Me,{label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Le,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const Nr=Z(jt)`
|
|
1
|
+
import{j as e,y as ht,bc as ye,M as ne,ak as h,Q as G,W as p,J as ve,c1 as xt,I as D,aN as gt,T as E,aj as mt,b5 as Pe,P as Ie,b6 as Te,a5 as Re,z as Ue,A as Fe,ci as bt,bh as yt,U as Me,cR as vt,cS as wt,at as Z,cT as jt,a6 as V,n as oe,D as Ct,cU as kt,ar as Ae,b1 as we,cV as St,aX as Pt,a$ as It,cW as Tt}from"./vendor-mui-core-CnXrAOs3.js";import{r as y,a as Rt,u as Mt,j as At}from"./vendor-react-Dvs43sk9.js";import{t as _e,Z as Et,a4 as zt,R as Ee,D as Lt,C as se,n as H,A as Wt}from"./vendor-utils-cJEl_UEd.js";import{a as Dt,G as Bt,be as Ot,c as je,Z as $t,bf as Nt,az as qe,X as le,bb as Ut,bg as Ft,a9 as _t,aa as qt,bh as Ht}from"./index-sNHCLgAE.js";import{a as T,h as Gt,k as ce,g as Q,b as A,j as Kt}from"./vendor-hooks-CjESGRlR.js";import{l as He}from"./arrow-down.svg-DeLZPBrE.js";import{p as Ce,U as L,V as W,at as Vt,i as Ge,au as Yt,H as $,av as Zt,aw as Qt,ax as ze,e as Xt,n as Ke,d as ke,ay as Jt,az as P,D as er,C as tr,$ as rr,aA as nr,aB as or,o as Ve}from"./vendor-ux-IiQnod3w.js";import{N as sr}from"./list-DORIbGy_.js";import{d as ir}from"./search-4YYphs0l.js";import{B as Le}from"./bundle-avatar-CTtvmGO1.js";import{h as We,T as ar}from"./team-DQuySqMB.js";import{b as lr,d as cr,a as dr,c as ur,e as pr,f as fr,h as hr,O as xr}from"./user-center-Cj7ClpAN.js";import{T as De,O as gr}from"./index-40i6YjCX.js";import{c as mr}from"./passport-Y64u4kIS.js";import{N as Ye,U as Ze}from"./index-CkOr9jjZ.js";import{u as de}from"./use-mobile-DCNBsOlH.js";import br from"./index-BiRWeiPY.js";import{U as yr,a as vr}from"./user-follower-D2fRTkiD.js";import{f as Y}from"./index-DBs9Ljax.js";import{u as me}from"./index-FpxO_1p7.js";import wr from"./index-DoMhm8T2.js";import{o as jr}from"./vendor-arcblock-CuFtPveO.js";import{c as Cr,b as ie,a as kr,S as Sr}from"./index-COTazo1u.js";import"./index-DicW-7Bz.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./util-BEWQY3Rq.js";import"./base32-MTP_2iYY.js";import"./session-BAD0lxQk.js";import"./isURL-D_2bLHU_.js";import"./use-app-logo-BQTE7YvS.js";import"./index-DZsn1cNa.js";import"./revoke.svg-CmffMlcP.js";import"./use-mobile-maRlSUwU.js";import"./actions-DqoNrBDK.js";import"./index-l32Mt1U_.js";import"./form-text-input-Ce6g965V.js";import"./required-BGaDOGrj.js";import"./form-wrapper-C8oo_Fdy.js";import"./edit.svg-DycWG9v3.js";import"./lock.svg-COUP8tyO.js";import"./index-GExzZtCU.js";import"./permission-DhYNRf8T.js";import"./confirm-CR8be0u2.js";import"./click-to-copy-BOJgIYli.js";import"./invitations-o-DfaNhe.js";import"./create-passport-svg-C7Utfs-J.js";import"./api-Btn0Tp3W.js";import"./table-tips-cwfDerzR.js";import"./ua-parser-DP5omx3I.js";import"./sdk-DFkL0HsT.js";import"./passport-item-DvglsId-.js";import"./did-address-QgOhyegQ.js";import"./index-CxfTwIi4.js";import"./vendor-mui-x-bJ5idfMH.js";import"./AdapterDayjs-Cf3ilEXQ.js";import"./delete-confirm-DhJd_sYk.js";import"./index-DRYJ0xIl.js";function Pr(){let t=new Map;function i({root:s,rootMargin:n,threshold:o}){let u=t.get(s);u||(u=new Map,t.set(s,u));let a=JSON.stringify({rootMargin:n,threshold:o}),d=u.get(a);if(!d){let r=new Map;d={observer:new IntersectionObserver(f=>{f.forEach(g=>{r.get(g.target)?.(g)})},{root:s,rootMargin:n,threshold:o}),entryCallbacks:r},u.set(a,d)}return{observe:(r,f)=>{d.entryCallbacks.set(r,f),d.observer.observe(r)},unobserve:r=>{d.entryCallbacks.delete(r),d.observer.unobserve(r)}}}return{getObserver:i}}var Ir="0px",Tr=[0],Rr=Pr();function Mr(t){let i=t?.rootMargin??Ir,s=t?.threshold??Tr,n=y.useRef(null),o=y.useRef(null),u=y.useRef(null),[a,d]=y.useState(),r=y.useCallback(()=>{let j=n.current;if(!j){d(void 0);return}let v=Rr.getObserver({root:o.current,rootMargin:i,threshold:s});v.observe(j,l=>{d(l)}),u.current=v},[i,s]),f=y.useCallback(()=>{let j=u.current,v=n.current;v&&j?.unobserve(v),u.current=null},[]),g=y.useCallback(j=>{f(),n.current=j,r()},[r,f]),x=y.useCallback(j=>{f(),o.current=j,r()},[r,f]);return[g,{entry:a,rootRef:x}]}var Ar=Mr;function Er(t){let[i,s]=Ar(t),n=!!s.entry?.isIntersecting,[o,u]=y.useState(n);return n&&!o&&u(!0),[i,{...s,isVisible:n,wasEverVisible:o}]}var zr=Er,Lr=100;function Wr({loading:t,hasNextPage:i,onLoadMore:s,rootMargin:n,disabled:o,delayInMs:u=Lr}){let a=y.useRef(s),[d,{rootRef:r,isVisible:f}]=zr({rootMargin:n});y.useEffect(()=>{a.current=s},[s]);let g=!o&&!t&&f&&i;return y.useEffect(()=>{if(g){let x=setTimeout(()=>{a.current()},u);return()=>{clearTimeout(x)}}},[g,u]),[d,{rootRef:r}]}var Dr=Wr;const ge={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:p.oneOf(["info","success","warning","error",""]).isRequired,size:p.number};function ae({severity:t,size:i=8}){return ge[t]?e.jsx(h,{component:"span",sx:{display:"inline-block",width:i,height:i,borderRadius:"50%",backgroundColor:ge[t]||ge.info}}):null}Qe.propTypes={theme:p.string,type:p.oneOf(["button","line","select"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function Qe({theme:t="dark",type:i="button",onSelectType:s,extra:n=void 0,currentTab:o="",loading:u=!1,...a}){const{t:d}=y.useContext(Ce),r=[{label:d("notification.allSeverity"),value:""},{label:d("notification.severityType.info"),value:"info"},{label:d("notification.severityType.success"),value:"success"},{label:d("notification.severityType.warning"),value:"warning"},{label:d("notification.severityType.error"),value:"error"}],f=m=>{(m!==o||!u)&&s(m)},g=y.useMemo(()=>{const m={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:i==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return i==="line"?Object.assign(m,{}):m},[i,t]),x=(m,C,I)=>e.jsx(G,{disabled:u,onClick:()=>f(m.value),className:`profile-button ${C?"active":""}`,...a,children:m.label},m.value||I),j=(m,C,I)=>e.jsx(G,{variant:"text",disabled:u,onClick:()=>f(m.value),className:`profile-line-button ${C?"active":""}`,...a,children:m.label},m.value||I),v=()=>r?.map((m,C)=>{const I=o===m?.value;return i==="line"?e.jsx(y.Fragment,{children:j(m,I,C)},m.value||C):e.jsx(y.Fragment,{children:x(m,I,C)},m.value||C)}),l=m=>{const{value:C}=m.target;f(C==="all"?"":C)};return i==="select"?e.jsx(ht,{sx:{maxWidth:300},children:e.jsx(ye,{value:o||"all",onChange:l,size:"small",label:"Severity",IconComponent:m=>e.jsx(He,{...m,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((m,C)=>e.jsx(ne,{value:m.value||"all",children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:m.value}),m.label]})},m.value||C))})}):e.jsxs(h,{className:"severity-tabs",sx:g,children:[e.jsx(h,{sx:{...i==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}Xe.propTypes={paging:p.objectOf(p.any).isRequired,loading:p.bool.isRequired,onChange:p.func.isRequired};function Xe({loading:t,paging:i,onChange:s}){const{t:n}=y.useContext(Ce),o=ve(r=>r.breakpoints.down("md"));if(i.pageCount<=0||o)return null;const u=(r,f)=>{s({page:f+1})},a=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},d=i.page-1<=0?0:i.page-1;return e.jsx(h,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(xt,{component:"div",disabled:t,count:i.total,page:d,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:g})=>`${r}–${f} / ${g!==-1?g:`${n()}more than ${f}`}`,rowsPerPage:i.pageSize,onPageChange:u,onRowsPerPageChange:a})})}const Br=y.memo(Xe),Or={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Be=6,Oe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},$r={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},$e=()=>({...$r,width:"calc(50% - 8px)"});Je.propTypes={loading:p.bool,type:p.oneOf(["server","service"]),onFilterChange:p.func,blockletMap:p.object,filterType:p.oneOf(["component","entity"]),selectedId:p.array,severity:p.array,enableMarkAllAsRead:p.bool,unReadCount:p.number,onReadFilterChange:p.func,currentReadFilter:p.string};function Je({onFilterChange:t=()=>{},loading:i=!1,type:s="service",blockletMap:n={},filterType:o="component",selectedId:u=[],severity:a=[],enableMarkAllAsRead:d=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:g="all"}){const{t:x}=y.useContext(Ce),[j,v]=y.useState(null),l=!!j,[m,C]=y.useState(u),[I,k]=y.useState(a),[b,R]=y.useState(!1),[M,_]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{C(u),k(a)},[u,a]);const U=[{label:x("notification.filterType.all"),value:"all"},{label:x("notification.filterType.unread"),value:"unread"}],X=c=>{(c!==g||!i)&&f(c)},K=[{label:x("notification.severityType.info"),value:"info"},{label:x("notification.severityType.success"),value:"success"},{label:x("notification.severityType.warning"),value:"warning"},{label:x("notification.severityType.error"),value:"error"}],J=c=>{v(c.currentTarget),_(""),R(!1)},pe=()=>{v(null)},ee=c=>{const w=m.includes(c)?m.filter(S=>S!==c):[...m,c];C(w),t({id:w,severity:I})},te=c=>{const w=I.includes(c)?I.filter(S=>S!==c):[...I,c];k(w),t({severity:w,id:m})},fe=c=>{_(c.target.value)},he=()=>{R(!b)},q=Rt.useMemo(()=>{if(!n.size)return[];const c=[];return o==="component"&&c.push({label:x("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const S=w.did||w.meta?.did,z=w.title||w.meta?.title||"",O=w.appPid||w.appDid;(o==="component"&&O!==S||o==="entity"&&O===S)&&c.push({label:z,id:S,blocklet:w,ancestors:w.ancestors})}),c},[n,o,x]);y.useEffect(()=>{if(M.trim()==="")N(q);else{const c=M.toLowerCase(),w=q.filter(S=>S.label.toLowerCase().includes(c));N(w)}},[M,q]);const xe=M.trim()!==""||b?B:B.slice(0,Be);return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",justifyContent:d?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[d&&e.jsx(h,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:i,onClick:()=>X(c.value),className:`profile-button ${g===c.value?"active":""}`,sx:{...s==="service"&&g===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:g===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&r>0&&` (${r})`]},c.value))}),e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(D,{size:"small",onClick:J,disabled:i,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(L,{icon:Or,hFlip:!0})}),e.jsx(gt,{open:l,anchorEl:j,onClose:pe,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold"},children:x("notification.severity")}),e.jsx(h,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(m.length>0||I.length>0)&&e.jsx(G,{size:"small",onClick:()=>{C([]),k([]),t({severity:[],id:[]})},startIcon:e.jsx(mt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:x("notification.clear")})})]}),e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Ie,{elevation:0,sx:$e(I.includes(c.value)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Oe},control:e.jsx(Re,{checked:I.includes(c.value),onChange:()=>te(c.value),disabled:i,size:"small"}),label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(h,{sx:{mb:2},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(E,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:x("notification.from")}),e.jsx(h,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ue,{size:"small",placeholder:"search",value:M,onChange:fe,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Fe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(L,{icon:ir})})}}})})]}),e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Ie,{elevation:0,sx:$e(m.includes(c.id)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Oe},control:e.jsx(Re,{checked:m.includes(c.id),onChange:()=>ee(c.id),disabled:i,size:"small"}),label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(Le,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(E,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>Be&&M.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:b?e.jsx(bt,{}):e.jsx(yt,{})})]})]})})]})]}),m.length>0||I.length>0?e.jsxs(h,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[I.map(c=>{const w=K.find(S=>S.value===c);return e.jsx(Me,{label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>te(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),m.map(c=>{const w=q.find(S=>S.id===c);return e.jsx(Me,{label:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Le,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const Nr=Z(jt)`
|
|
2
2
|
position: fixed;
|
|
3
3
|
bottom: 20px;
|
|
4
4
|
right: 20px;
|
|
@@ -118,7 +118,7 @@ import{j as e,y as ht,bc as ye,M as ne,ak as h,Q as G,W as p,J as ve,c1 as xt,I
|
|
|
118
118
|
height: 75vmin;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
`,Kr=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:oe(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:oe(t.palette.background.paper,1)}}}),Vr={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ne="https://main.abtnetwork.io/explorer";function rt({user:t}){const{t:i}=W(),s=de(),[n,o]=y.useState({visible:!1,nft:null}),[u,a]=y.useState({anchorEl:null,props:null}),d=k=>{const b=se(Ne,"assets",k);window.open(b,"_blank")},r=(k,b)=>{let R="";typeof b.data?.value=="string"?R=JSON.parse(b.data?.value)?.domain:R=b.data?.value?.domain,a({anchorEl:k,props:{title:R?`Hey, I just won an NFT at the ${R} event!`:"Hey, I just won an NFT!",url:se(Ne,"assets",b.address)}})},f=k=>{o({visible:!0,nft:k})},g=Q({page:1,size:20}),x=ce(async(k=g)=>(await Lt.get(`${je.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...k}})).data,{ready:t?.did&&g,defaultParams:[g],refreshDeps:[t?.did,g]}),{loading:j,data:v}=x,l=v?.page??{cursor:0,next:!1,total:0},m=(k,b)=>{g.page=b,x.run(g)},C=A(k=>[e.jsx(D,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),d(k.address)},children:e.jsx(L,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(D,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,k)},className:"mask-item",children:e.jsx(L,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(D,{size:"small",onClick:b=>{b.stopPropagation(),f(k)},className:"mask-item",children:e.jsx(L,{icon:"tabler:eye",fontSize:18})},"view")]),I=T(()=>{if(j){const k=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Ae,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Ae,{width:"20%"}),e.jsx(h,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:k})]})}return e.jsxs(e.Fragment,{children:[e.jsx(E,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:i("userCenter.common.nft")}),v?.assets?.length===0&&!j&&e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(Ge,{children:i("userCenter.common.noNFT")})}),e.jsx(h,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(k=>e.jsxs(h,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(Ye,{data:Ze(k),address:k.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(h,{className:"footer-mask",sx:Vr,children:C(k)}):e.jsx(h,{className:"mask",sx:Kr,children:e.jsx(we,{direction:"row",spacing:1,children:C(k)})})]},k.address))}),l.next||g.page>1?e.jsx(St,{sx:{display:"flex",justifyContent:"center",mt:2},page:g.page,onChange:m,count:Math.ceil(l.total/g.size),size:"small"}):null,e.jsx(qr,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{o({visible:!1,nft:null})}}),e.jsx(Yt,{anchorEl:u.anchorEl,onClose:()=>{a({anchorEl:null,props:null})},sharedProps:u.props||{title:"",url:""}})]})},[j,l,g.page,g.size,m,u,n]);return e.jsx(h,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:I})}rt.propTypes={user:p.object.isRequired};function Yr(){const{t}=W(),{user:i,isMyself:s,viewUser:n}=ue();return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(h,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(E,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(tt,{user:i})]}):null,e.jsx(rt,{user:s?i:n})]})}const Zr=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function nt({user:t,onSave:i}){const{t:s,changeLocale:n}=W(),o=Q({locale:t.locale,loading:!1}),u=A(async a=>{try{const{value:d}=a.target;o.loading=!0,await F.user.saveProfile({locale:d}),await i("profile"),n(d),o.locale=d}catch(d){$.error(Y(d))}finally{o.loading=!1}});return e.jsxs(h,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(h,{children:s("userCenter.commonSetting.locale")}),e.jsx(h,{children:e.jsx(ye,{value:o.locale,onChange:u,size:"small",IconComponent:a=>e.jsx(He,{...a,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||Zr).map(a=>e.jsx(ne,{value:a.code,children:a.name},a.code))})})]})}nt.propTypes={user:p.shape({locale:p.string}).isRequired,onSave:p.func.isRequired};function be({onTest:t=H,onDelete:i=H,onSave:s=H,onCancel:n=H,type:o="slack",url:u="",edit:a=!1}){const{t:d}=W(),r=Q({type:o||"slack",url:u||"",edit:a??!1,error:"",loading:!1}),f=A(()=>r.url?$t(r.url)?(r.error="",!0):(r.error=d("common.invalid"),!1):(r.error=d("common.required"),!1)),g=A(()=>{r.edit=!1,r.url=u||"",r.type=o||"slack",r.error="",r.loading=!1,n()}),x=A(async l=>{r.loading=!0,await t(l),r.loading=!1}),j=A(l=>()=>{f()&&l({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(E,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(V,{size:16}):e.jsx(D,{size:"small",onClick:j(x),sx:{mr:-1},children:e.jsx(L,{icon:cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(h,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(ye,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:l=>{r.type=l.target.value},children:[e.jsx(ne,{value:"api",children:d("userCenter.webhook.url")}),e.jsx(ne,{value:"slack",children:d("userCenter.webhook.slack")})]}),e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ue,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:l=>{r.url=l.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Fe,{position:"end",children:v})}}}),e.jsx(h,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(D,{color:"success",onClick:j((...l)=>{s(...l),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:Zt})}),e.jsx(D,{color:"error",onClick:g,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:Qt})})]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:dr})}),e.jsx(D,{color:"error",onClick:()=>{i({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:ur})})]})})]})]})}be.propTypes={onTest:p.func,onDelete:p.func,onSave:p.func,onCancel:p.func,type:p.oneOf(["api","slack"]),url:p.string,edit:p.bool};function re({title:t=void 0,description:i=void 0,value:s,onChange:n,isMobile:o}){const u=A(a=>{a.stopPropagation()});return e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(me,{checked:s,size:"small",onChange:n}),e.jsxs(E,{component:"div",onClick:u,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:o?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:o?"normal":"nowrap"},children:[t,i]})]})}re.propTypes={title:p.string,description:p.node,value:p.bool.isRequired,onChange:p.func.isRequired,isMobile:p.bool.isRequired};function ot({user:t,isMobile:i}){const{t:s}=W(),n=Q({showAdd:!1}),o=ce(async()=>await F.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),u=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...o?.data?.notifications||{}}),[o?.data?.notifications]),a=T(()=>o?.data?.webhooks||[],[o?.data?.webhooks]),d=A(async v=>{try{await F.user.saveUserNotificationConfig(v),$.success(s("userCenter.saveSuccess")),o.run()}catch(l){$.error(Y(l))}}),r=A(async(v,l)=>{await d({notifications:{[v]:l}})}),f=async v=>{try{await F.user.testNotificationWebhook(v),$.success(s("userCenter.webhookTested"))}catch(l){$.error(Y(l))}},g=A(async v=>{await d({webhooks:a.filter((l,m)=>m!==v)})}),x=A(async(v,l)=>{await d({webhooks:a.map((m,C)=>C===v?l:m)})}),j=A(async v=>{await d({webhooks:[...a,v]}),n.showAdd=!1});return o.error?e.jsx(Pt,{severity:"error",children:o.error.message}):o.loading||!o.data?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(V,{})}):e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(re,{value:u.wallet,isMobile:i,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:ze(t)&&e.jsx(Xt,{did:ze(t),showQrcode:!1,showAvatar:!i,copyable:!0,compact:!0,responsive:!0,startChars:i?2:6})}),e.jsx(re,{value:u.email,isMobile:i,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(E,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(re,{isMobile:i,value:u.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(we,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[a.map((v,l)=>e.jsx(be,{onTest:f,onDelete:()=>g(l),onSave:(...m)=>x(l,...m),type:v.type,url:v.url,edit:!1},`${l}_${v.url}`)),n.showAdd&&e.jsx(be,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>j(...v),edit:!0},"add"),e.jsx(Ke,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(L,{icon:pr}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ot.propTypes={user:p.object.isRequired,isMobile:p.bool.isRequired};function st({item:t}){const i=ke(),{blocklet:s}=Nt(),{confirmApi:n,confirmHolder:o}=qe(),u=Q({loading:!1}),{t:a}=W(),{session:d}=y.use(le),{bindOAuth:r,unbindOAuth:f,setBaseUrl:g,baseUrl:x}=d.useOAuth(),{disconnectPasskey:j,setTargetAppPid:v}=d.usePasskey(),l=T(()=>Jt[t?.provider]||"unknown",[t?.provider]),m=A(b=>b?._bind?b.provider===P.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===P.PASSKEY&&i.arcSphere?a("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&i.arcSphere?a("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),C=A(async()=>{if(t?.provider===P.PASSKEY){await new Promise((b,R)=>{n.open({title:a("userCenter.thirdPartyLogin.disconnectPasskey",{name:l}),content:a("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(M){j({session:d,connectedAccount:t}).then(b).catch(R),M()},onCancel:b})});return}try{u.loading=!0,await new Promise((b,R)=>{if(t?._bind)n.open({title:a("userCenter.thirdPartyLogin.confirmUnbind",{name:l}),content:a("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(M){f({session:d,connectedAccount:{...Wt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(R),M()},onCancel:b});else if(t.provider===P.WALLET)n.open({title:a("userCenter.thirdPartyLogin.confirmBindWallet",{name:l}),content:a("userCenter.thirdPartyLogin.confirmBindWalletDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"primary"},cancelButtonText:a("common.cancel"),onConfirm:M=>{d.bindWallet({onSuccess:b,onCancel:R}),M()},onCancel:b});else{const M=x,_=window?.blocklet;let B="/";const N=er(_),U=tr(_);N&&U?.appPid&&d?.user?.sourceAppPid&&(B=U.appUrl),g(B),v(s?.appPid),r({session:d,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(R).finally(()=>{g(M),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{u.loading=!1}}),I=A(b=>b.provider===P.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?a("userCenter.thirdPartyLogin.mainAccount"):b?._bind?a("userCenter.thirdPartyLogin.disconnect"):a("userCenter.thirdPartyLogin.connect")),k=A(b=>b.provider===P.WALLET&&b.did||b.provider===P.PASSKEY&&(i.arcSphere||i.wallet)?!0:!!t._mainProvider,[i.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(Ut,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(h,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:l}),t.userInfo?.email||t.did?e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(h,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(De,{title:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(rr,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(h,{children:[e.jsx(E,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(E,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(h,{component:L,icon:Ft,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(De,{title:m(t),placement:"auto",children:e.jsx(h,{children:e.jsx(Ke,{variant:"outlined",size:"small",sx:b=>{const R=b.palette.error.main,M=b.palette.primary.main;return{color:t?._bind?R:M,borderColor:t?._bind?R:M,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?R:M,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:u.loading?null:e.jsx(L,{icon:fr}),onClick:C,disabled:k(t),loading:u.loading,children:I(t)})})}),o]})}st.propTypes={item:p.shape({provider:p.string,did:p.string,pk:p.string,userInfo:p.object,id:p.string,_bind:p.bool,_rawProvider:p.string,_mainProvider:p.bool}).isRequired};function it({user:t}){const{session:i}=y.use(le),[s,n]=y.useState({}),{getOAuthConfigs:o}=i.useOAuth(),u=ke();Kt(async()=>{const r=await o({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const a=T(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:P.WALLET,order:-1},...r,{provider:P.PASSKEY,order:1/0}]},[s]),d=T(()=>{const r=nr(t);let f=!1,g="",x=or(t);const j=r.find(l=>l.provider===P.AUTH0);return j&&(j.id.startsWith("google-oauth2|")&&(r.some(l=>l.provider==="google")||(f=!0,g=P.GOOGLE,x===P.AUTH0&&(x=P.GOOGLE))),j.id.startsWith("appleid|")&&(r.some(l=>l.provider===P.APPLE)||(f=!0,g=P.APPLE,x===P.AUTH0&&(x=P.APPLE))),j.id.startsWith("github|")&&(r.some(l=>l.provider===P.GITHUB)||(f=!0,g=P.GITHUB,x===P.AUTH0&&(x=P.GITHUB)))),a.map(l=>{if(l.provider===P.AUTH0&&f)return null;const m=f&&l.provider===g?r.find(C=>C.provider===P.AUTH0):r.find(C=>C.provider===l.provider);return m?{...l,provider:l.provider,did:m.did,pk:m.pk,userInfo:m.userInfo,_bind:!0,_rawProvider:m.provider,_mainProvider:l.provider===x}:{...l,provider:l.provider,_rawProvider:l.provider,_mainProvider:l.provider===x}}).filter(l=>!(!l||l.provider===P.PASSKEY&&!l.did)).sort((l,m)=>l._mainProvider?-1:l?.order!==void 0&&m?.order!==void 0?l.order-m.order:l?.order!==void 0?-1:1)},[t?.connectedAccounts,a]);return e.jsxs(h,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[d.map(r=>e.jsx(st,{item:r},r?.provider)),u.wallet||u.arcSphere?null:e.jsx(_t,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:H,onError:H,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}it.propTypes={user:p.object.isRequired};function at({configList:t,onSave:i}){const[s,n]=y.useState(t),{t:o}=W(),u=A(async(a,d)=>{try{const r=await F.user.saveUserPrivacyConfig({[a]:typeof d=="string"?d:!d});n(s.map(f=>({...f,value:r?.[f.key]??f.value}))),$.success(o("userCenter.saveSuccess")),i("privacy")}catch(r){$.error(Y(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(a=>{if(a.isPrivate)return null;const d=!a.value||["all","follower-only"].includes(a.value);return e.jsxs(h,{children:[e.jsx(me,{checked:d,labelProps:{label:e.jsx(E,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("userCenter.toPublic",{name:a.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;a.followersOnly?u(a.key,f?"all":"private"):u(a.key,f)}},a.key),a.followersOnly&&d&&e.jsx(h,{sx:{pl:3,pt:1},children:e.jsx(me,{checked:a.value==="follower-only",labelProps:{label:e.jsx(E,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;u(a.key,f?"follower-only":"all")}})})]})})})}at.propTypes={configList:p.arrayOf(p.shape({key:p.string.isRequired,name:p.string.isRequired,value:p.bool.isRequired,isPrivate:p.bool})).isRequired,onSave:p.func.isRequired};function lt({onDestroySelf:t=void 0}){const{confirmHolder:i}=qe(),{t:s}=W(),{session:n}=y.use(le),o=A(async()=>{if(!t||typeof t!="function")return;const u=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await u(),n.logout()}catch(a){$.error(a?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(h,{children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(h,{children:[e.jsx(E,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(E,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(G,{variant:"contained",color:"error",size:"small",onClick:o,children:s("userCenter.dangerZone.delete")})]})}),i]})}lt.propTypes={onDestroySelf:p.func};function Qr(){const t=de({key:"md"}),i=ve(o=>o.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>Ve({},t?s:{}),[t]);return e.jsx(h,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":i?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:o=>`${o.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(wr,{isSelf:!0,columnSx:n})})}function ct({onDestroySelf:t=void 0,userCenterTabs:i=[]}){const{t:s}=W(),{user:n,session:o,isMyself:u,isOwner:a}=ue(),r=ke().arcSphere,f=de({key:"md"}),g=ce(async()=>n&&u?await F.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,u],loadingDelay:300}),x=T(()=>i.map(l=>({key:l.value,name:l.label,value:l.protected,isPrivate:l.isPrivate,followersOnly:l.followersOnly})),[i]),j=A(async l=>l==="privacy"?(await g.runAsync(),g.data):(l==="profile"&&await o.refresh(),null));y.useEffect(()=>{const l=window.location.hash.slice(1);l&&document.getElementById(l)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(nt,{user:n,onSave:j})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ot,{user:n,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(it,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(Qr,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(br,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(at,{configList:x,onSave:j})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yr,{user:n,showUser:!1,getUserSessions:l=>F.userSession.getMyLoginSessions({},l)})},!a&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(lt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,x,f,a,t]);return u?e.jsx(h,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(l=>l?e.jsxs(h,{id:l.value,sx:Ve({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},l.sx),children:[e.jsx(E,{sx:{color:"text.primary",fontWeight:600},children:l.label}),e.jsx(h,{sx:{mt:2.5},children:l.content})]},l.value):null)}):null}ct.propTypes={onDestroySelf:p.func,userCenterTabs:p.array};const dt=y.createContext({}),{Provider:Xr,Consumer:ho}=dt;function ut({children:t}){const[i]=y.useState(!1),{session:s}=y.use(le),{user:n}=s,[o,u]=y.useState(),a=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{u(n?.didSpace)},[n?.didSpace]);const d=async()=>{u(void 0)},r=x=>{},f=async x=>{u(x),await r(x.endpoint)},g=!!(a&&o);return e.jsx(Xr,{value:{loading:i,spaceGateway:o,session:s,deleteSpaceGateway:d,updateSpaceGateway:f,storageEndpoint:a,settingStorageEndpoint:r,hasStorageEndpoint:g},children:t})}function Se(){return y.use(dt)}ut.propTypes={children:p.node.isRequired};function Jr(t){const i=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return se(i,"space",n)}function pt({session:t,spaceGateway:i,spaceStatus:s,refresh:n}){return e.jsxs(we,{direction:"row",spacing:1,children:[s===Cr.DISCONNECTED&&e.jsx(ie,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:o=>{console.error(o),$.error(Y(o))}}),e.jsx(D,{size:"small",LinkComponent:It,href:Jr(i.endpoint),target:"_blank",children:e.jsx(Tt,{})})]})}pt.propTypes={session:p.object.isRequired,spaceGateway:p.object.isRequired,spaceStatus:p.string.isRequired,refresh:p.func.isRequired};function ft({spaceGateway:t=void 0}){const{t:i}=W(),{updateSpaceGateway:s,session:n}=Se(),o=de(),u=({spaceGateway:a})=>s(a);return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(E,{sx:{fontSize:"16px",fontWeight:"bold"},children:i("userCenter.storage.spaces.connected.title")}),!o&&e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:u})]}),e.jsx(h,{children:t&&e.jsx(kr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:a=>e.jsx(pt,{session:n,...a})},t.endpoint)}),o&&e.jsx(h,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:u})})]})}ft.propTypes={spaceGateway:p.object};function en(){const{t}=W(),{updateSpaceGateway:i,session:s}=Se(),n=({spaceGateway:o})=>i(o);return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(E,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Sr,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(h,{children:e.jsx(ie,{session:s,onSuccess:n})})]})}function tn(){const{spaceGateway:t,hasStorageEndpoint:i,loading:s}=Se(),{isMyself:n}=ue();return n?s?e.jsx(jr,{relative:"parent",children:e.jsx(V,{})}):e.jsx(nn,{children:e.jsx(h,{sx:{maxWidth:"720px"},children:i?e.jsx(ft,{spaceGateway:t}):e.jsx(en,{})})}):null}function rn(){return e.jsx(ut,{children:e.jsx(tn,{})})}const nn=Z(h)`
|
|
121
|
+
`,Kr=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:oe(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:oe(t.palette.background.paper,1)}}}),Vr={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ne="https://main.abtnetwork.io/explorer";function rt({user:t}){const{t:i}=W(),s=de(),[n,o]=y.useState({visible:!1,nft:null}),[u,a]=y.useState({anchorEl:null,props:null}),d=k=>{const b=se(Ne,"assets",k);window.open(b,"_blank")},r=(k,b)=>{let R="";typeof b.data?.value=="string"?R=JSON.parse(b.data?.value)?.domain:R=b.data?.value?.domain,a({anchorEl:k,props:{title:R?`Hey, I just won an NFT at the ${R} event!`:"Hey, I just won an NFT!",url:se(Ne,"assets",b.address)}})},f=k=>{o({visible:!0,nft:k})},g=Q({page:1,size:20}),x=ce(async(k=g)=>(await Lt.get(`${je.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...k}})).data,{ready:t?.did&&g,defaultParams:[g],refreshDeps:[t?.did,g]}),{loading:j,data:v}=x,l=v?.page??{cursor:0,next:!1,total:0},m=(k,b)=>{g.page=b,x.run(g)},C=A(k=>[e.jsx(D,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),d(k.address)},children:e.jsx(L,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(D,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,k)},className:"mask-item",children:e.jsx(L,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(D,{size:"small",onClick:b=>{b.stopPropagation(),f(k)},className:"mask-item",children:e.jsx(L,{icon:"tabler:eye",fontSize:18})},"view")]),I=T(()=>{if(j){const k=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Ae,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Ae,{width:"20%"}),e.jsx(h,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:k})]})}return e.jsxs(e.Fragment,{children:[e.jsx(E,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:i("userCenter.common.nft")}),v?.assets?.length===0&&!j&&e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(Ge,{children:i("userCenter.common.noNFT")})}),e.jsx(h,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(k=>e.jsxs(h,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(Ye,{data:Ze(k),address:k.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(h,{className:"footer-mask",sx:Vr,children:C(k)}):e.jsx(h,{className:"mask",sx:Kr,children:e.jsx(we,{direction:"row",spacing:1,children:C(k)})})]},k.address))}),l.next||g.page>1?e.jsx(St,{sx:{display:"flex",justifyContent:"center",mt:2},page:g.page,onChange:m,count:Math.ceil(l.total/g.size),size:"small"}):null,e.jsx(qr,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{o({visible:!1,nft:null})}}),e.jsx(Yt,{anchorEl:u.anchorEl,onClose:()=>{a({anchorEl:null,props:null})},sharedProps:u.props||{title:"",url:""}})]})},[j,l,g.page,g.size,m,u,n]);return e.jsx(h,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:I})}rt.propTypes={user:p.object.isRequired};function Yr(){const{t}=W(),{user:i,isMyself:s,viewUser:n}=ue();return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(h,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(E,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(tt,{user:i})]}):null,e.jsx(rt,{user:s?i:n})]})}const Zr=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function nt({user:t,onSave:i}){const{t:s,changeLocale:n}=W(),o=Q({locale:t.locale,loading:!1}),u=A(async a=>{try{const{value:d}=a.target;o.loading=!0,await F.user.saveProfile({locale:d}),await i("profile"),n(d),o.locale=d}catch(d){$.error(Y(d))}finally{o.loading=!1}});return e.jsxs(h,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(h,{children:s("userCenter.commonSetting.locale")}),e.jsx(h,{children:e.jsx(ye,{value:o.locale,onChange:u,size:"small",IconComponent:a=>e.jsx(He,{...a,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||Zr).map(a=>e.jsx(ne,{value:a.code,children:a.name},a.code))})})]})}nt.propTypes={user:p.shape({locale:p.string}).isRequired,onSave:p.func.isRequired};function be({onTest:t=H,onDelete:i=H,onSave:s=H,onCancel:n=H,type:o="slack",url:u="",edit:a=!1}){const{t:d}=W(),r=Q({type:o||"slack",url:u||"",edit:a??!1,error:"",loading:!1}),f=A(()=>r.url?$t(r.url)?(r.error="",!0):(r.error=d("common.invalid"),!1):(r.error=d("common.required"),!1)),g=A(()=>{r.edit=!1,r.url=u||"",r.type=o||"slack",r.error="",r.loading=!1,n()}),x=A(async l=>{r.loading=!0,await t(l),r.loading=!1}),j=A(l=>()=>{f()&&l({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(E,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(V,{size:16}):e.jsx(D,{size:"small",onClick:j(x),sx:{mr:-1},children:e.jsx(L,{icon:cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(h,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(ye,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:l=>{r.type=l.target.value},children:[e.jsx(ne,{value:"api",children:d("userCenter.webhook.url")}),e.jsx(ne,{value:"slack",children:d("userCenter.webhook.slack")})]}),e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ue,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:l=>{r.url=l.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Fe,{position:"end",children:v})}}}),e.jsx(h,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(D,{color:"success",onClick:j((...l)=>{s(...l),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:Zt})}),e.jsx(D,{color:"error",onClick:g,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:Qt})})]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:dr})}),e.jsx(D,{color:"error",onClick:()=>{i({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(L,{icon:ur})})]})})]})]})}be.propTypes={onTest:p.func,onDelete:p.func,onSave:p.func,onCancel:p.func,type:p.oneOf(["api","slack"]),url:p.string,edit:p.bool};function re({title:t=void 0,description:i=void 0,value:s,onChange:n,isMobile:o}){const u=A(a=>{a.stopPropagation()});return e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(me,{checked:s,size:"small",onChange:n}),e.jsxs(E,{component:"div",onClick:u,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:o?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:o?"normal":"nowrap"},children:[t,i]})]})}re.propTypes={title:p.string,description:p.node,value:p.bool.isRequired,onChange:p.func.isRequired,isMobile:p.bool.isRequired};function ot({user:t,isMobile:i}){const{t:s}=W(),n=Q({showAdd:!1}),o=ce(async()=>await F.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),u=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...o?.data?.notifications||{}}),[o?.data?.notifications]),a=T(()=>o?.data?.webhooks||[],[o?.data?.webhooks]),d=A(async v=>{try{await F.user.saveUserNotificationConfig(v),$.success(s("userCenter.saveSuccess")),o.run()}catch(l){$.error(Y(l))}}),r=A(async(v,l)=>{await d({notifications:{[v]:l}})}),f=async v=>{try{await F.user.testNotificationWebhook(v),$.success(s("userCenter.webhookTested"))}catch(l){$.error(Y(l))}},g=A(async v=>{await d({webhooks:a.filter((l,m)=>m!==v)})}),x=A(async(v,l)=>{await d({webhooks:a.map((m,C)=>C===v?l:m)})}),j=A(async v=>{await d({webhooks:[...a,v]}),n.showAdd=!1});return o.error?e.jsx(Pt,{severity:"error",children:o.error.message}):o.loading||!o.data?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(V,{})}):e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(re,{value:u.wallet,isMobile:i,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:ze(t)&&e.jsx(Xt,{did:ze(t),showQrcode:!1,showAvatar:!i,copyable:!0,compact:!0,responsive:!0,startChars:i?2:6})}),e.jsx(re,{value:u.email,isMobile:i,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(E,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(re,{isMobile:i,value:u.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(we,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[a.map((v,l)=>e.jsx(be,{onTest:f,onDelete:()=>g(l),onSave:(...m)=>x(l,...m),type:v.type,url:v.url,edit:!1},`${l}_${v.url}`)),n.showAdd&&e.jsx(be,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>j(...v),edit:!0},"add"),e.jsx(Ke,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(L,{icon:pr}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ot.propTypes={user:p.object.isRequired,isMobile:p.bool.isRequired};function st({item:t}){const i=ke(),{blocklet:s}=Nt(),{confirmApi:n,confirmHolder:o}=qe(),u=Q({loading:!1}),{t:a}=W(),{session:d}=y.use(le),{bindOAuth:r,unbindOAuth:f,setBaseUrl:g,baseUrl:x}=d.useOAuth(),{disconnectPasskey:j,setTargetAppPid:v}=d.usePasskey(),l=T(()=>Jt[t?.provider]||"unknown",[t?.provider]),m=A(b=>b?._bind?b.provider===P.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===P.PASSKEY&&i.arcSphere?a("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&i.arcSphere?a("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),C=A(async()=>{if(t?.provider===P.PASSKEY){await new Promise((b,R)=>{n.open({title:a("userCenter.thirdPartyLogin.disconnectPasskey",{name:l}),content:a("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(M){j({session:d,connectedAccount:t}).then(b).catch(R),M()},onCancel:b})});return}try{u.loading=!0,await new Promise((b,R)=>{if(t?._bind)n.open({title:a("userCenter.thirdPartyLogin.confirmUnbind",{name:l}),content:a("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(M){f({session:d,connectedAccount:{...Wt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(R),M()},onCancel:b});else if(t.provider===P.WALLET)n.open({title:a("userCenter.thirdPartyLogin.confirmBindWallet",{name:l}),content:a("userCenter.thirdPartyLogin.confirmBindWalletDescription",{name:l}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"primary"},cancelButtonText:a("common.cancel"),onConfirm:M=>{d.bindWallet({onSuccess:b,onCancel:R}),M()},onCancel:b});else{const M=x,_=window?.blocklet;let B="/";const N=er(_),U=tr(_);N&&U?.appPid&&d?.user?.sourceAppPid&&(B=U.appUrl),g(B),v(s?.appPid),r({session:d,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(R).finally(()=>{g(M),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{u.loading=!1}}),I=A(b=>b.provider===P.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?a("userCenter.thirdPartyLogin.mainAccount"):b?._bind?a("userCenter.thirdPartyLogin.disconnect"):a("userCenter.thirdPartyLogin.connect")),k=A(b=>b.provider===P.WALLET&&b.did||b.provider===P.PASSKEY&&(i.arcSphere||i.wallet)?!0:!!t._mainProvider,[i.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(Ut,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(h,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:l}),t.userInfo?.email||t.did?e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(h,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(De,{title:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(rr,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(h,{children:[e.jsx(E,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(E,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(h,{component:L,icon:Ft,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(De,{title:m(t),placement:"auto",children:e.jsx(h,{children:e.jsx(Ke,{variant:"outlined",size:"small",sx:b=>{const R=b.palette.error.main,M=b.palette.primary.main;return{color:t?._bind?R:M,borderColor:t?._bind?R:M,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?R:M,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:u.loading?null:e.jsx(L,{icon:fr}),onClick:C,disabled:k(t),loading:u.loading,children:I(t)})})}),o]})}st.propTypes={item:p.shape({provider:p.string,did:p.string,pk:p.string,userInfo:p.object,id:p.string,_bind:p.bool,_rawProvider:p.string,_mainProvider:p.bool}).isRequired};function it({user:t}){const{session:i}=y.use(le),[s,n]=y.useState({}),{getOAuthConfigs:o}=i.useOAuth(),u=ke();Kt(async()=>{const r=await o({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const a=T(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:P.WALLET,order:-1},...r,{provider:P.PASSKEY,order:1/0}]},[s]),d=T(()=>{const r=nr(t);let f=!1,g="",x=or(t);const j=r.find(l=>l.provider===P.AUTH0);return j&&(j.id.startsWith("google-oauth2|")&&(r.some(l=>l.provider==="google")||(f=!0,g=P.GOOGLE,x===P.AUTH0&&(x=P.GOOGLE))),j.id.startsWith("appleid|")&&(r.some(l=>l.provider===P.APPLE)||(f=!0,g=P.APPLE,x===P.AUTH0&&(x=P.APPLE))),j.id.startsWith("github|")&&(r.some(l=>l.provider===P.GITHUB)||(f=!0,g=P.GITHUB,x===P.AUTH0&&(x=P.GITHUB)))),a.map(l=>{if(l.provider===P.AUTH0&&f)return null;const m=f&&l.provider===g?r.find(C=>C.provider===P.AUTH0):r.find(C=>C.provider===l.provider);return m?{...l,provider:l.provider,did:m.did,pk:m.pk,userInfo:m.userInfo,_bind:!0,_rawProvider:m.provider,_mainProvider:l.provider===x}:{...l,provider:l.provider,_rawProvider:l.provider,_mainProvider:l.provider===x}}).filter(l=>!(!l||l.provider===P.PASSKEY&&!l.did)).sort((l,m)=>l._mainProvider?-1:l?.order!==void 0&&m?.order!==void 0?l.order-m.order:l?.order!==void 0?-1:1)},[t?.connectedAccounts,a]);return e.jsxs(h,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[d.map(r=>e.jsx(st,{item:r},r?.provider)),u.wallet||u.arcSphere?null:e.jsx(_t,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:H,onError:H,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}it.propTypes={user:p.object.isRequired};function at({configList:t,onSave:i}){const[s,n]=y.useState(t),{t:o}=W(),u=A(async(a,d)=>{try{const r=await F.user.saveUserPrivacyConfig({[a]:typeof d=="string"?d:!d});n(s.map(f=>({...f,value:r?.[f.key]??f.value}))),$.success(o("userCenter.saveSuccess")),i("privacy")}catch(r){$.error(Y(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(a=>{if(a.isPrivate)return null;const d=!a.value||["all","follower-only"].includes(a.value);return e.jsxs(h,{children:[e.jsx(me,{checked:d,labelProps:{label:e.jsx(E,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("userCenter.toPublic",{name:a.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;a.followersOnly?u(a.key,f?"all":"private"):u(a.key,f)}},a.key),a.followersOnly&&d&&e.jsx(h,{sx:{pl:3,pt:1},children:e.jsx(me,{checked:a.value==="follower-only",labelProps:{label:e.jsx(E,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;u(a.key,f?"follower-only":"all")}})})]})})})}at.propTypes={configList:p.arrayOf(p.shape({key:p.string.isRequired,name:p.string.isRequired,value:p.bool.isRequired,isPrivate:p.bool})).isRequired,onSave:p.func.isRequired};function lt({onDestroySelf:t=void 0}){const{confirmHolder:i}=qe(),{t:s}=W(),{session:n}=y.use(le),o=A(async()=>{if(!t||typeof t!="function")return;const u=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await u(),n.logout()}catch(a){$.error(a?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(h,{children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(h,{children:[e.jsx(E,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(E,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(G,{variant:"contained",color:"error",size:"small",onClick:o,children:s("userCenter.dangerZone.delete")})]})}),i]})}lt.propTypes={onDestroySelf:p.func};function Qr(){const t=de({key:"md"}),i=ve(o=>o.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>Ve({},t?s:{}),[t]);return e.jsx(h,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":i?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:o=>`${o.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(wr,{isSelf:!0,columnSx:n})})}function ct({onDestroySelf:t=void 0,userCenterTabs:i=[]}){const{t:s}=W(),{user:n,session:o,isMyself:u,isOwner:a}=ue(),r=ke().arcSphere,f=de({key:"md"}),g=ce(async()=>n&&u?await F.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,u],loadingDelay:300}),x=T(()=>i.map(l=>({key:l.value,name:l.label,value:l.protected,isPrivate:l.isPrivate,followersOnly:l.followersOnly})),[i]),j=A(async l=>l==="privacy"?(await g.runAsync(),g.data):(l==="profile"&&await o.refresh(),null));y.useEffect(()=>{const l=window.location.hash.slice(1);l&&document.getElementById(l)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(nt,{user:n,onSave:j})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ot,{user:n,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(it,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(Qr,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(br,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(at,{configList:x,onSave:j})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yr,{user:n,showUser:!1,getUserSessions:l=>F.userSession.getMyLoginSessions({},l)})},!a&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(lt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,x,f,a,t]);return u?e.jsx(h,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(l=>l?e.jsxs(h,{id:l.value,sx:Ve({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},l.sx),children:[e.jsx(E,{sx:{color:"text.primary",fontWeight:600},children:l.label}),e.jsx(h,{sx:{mt:2.5},children:l.content})]},l.value):null)}):null}ct.propTypes={onDestroySelf:p.func,userCenterTabs:p.array};const dt=y.createContext({}),{Provider:Xr,Consumer:fo}=dt;function ut({children:t}){const[i]=y.useState(!1),{session:s}=y.use(le),{user:n}=s,[o,u]=y.useState(),a=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{u(n?.didSpace)},[n?.didSpace]);const d=async()=>{u(void 0)},r=x=>{},f=async x=>{u(x),await r(x.endpoint)},g=!!(a&&o);return e.jsx(Xr,{value:{loading:i,spaceGateway:o,session:s,deleteSpaceGateway:d,updateSpaceGateway:f,storageEndpoint:a,settingStorageEndpoint:r,hasStorageEndpoint:g},children:t})}function Se(){return y.use(dt)}ut.propTypes={children:p.node.isRequired};function Jr(t){const i=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return se(i,"space",n)}function pt({session:t,spaceGateway:i,spaceStatus:s,refresh:n}){return e.jsxs(we,{direction:"row",spacing:1,children:[s===Cr.DISCONNECTED&&e.jsx(ie,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:o=>{console.error(o),$.error(Y(o))}}),e.jsx(D,{size:"small",LinkComponent:It,href:Jr(i.endpoint),target:"_blank",children:e.jsx(Tt,{})})]})}pt.propTypes={session:p.object.isRequired,spaceGateway:p.object.isRequired,spaceStatus:p.string.isRequired,refresh:p.func.isRequired};function ft({spaceGateway:t=void 0}){const{t:i}=W(),{updateSpaceGateway:s,session:n}=Se(),o=de(),u=({spaceGateway:a})=>s(a);return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(E,{sx:{fontSize:"16px",fontWeight:"bold"},children:i("userCenter.storage.spaces.connected.title")}),!o&&e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:u})]}),e.jsx(h,{children:t&&e.jsx(kr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:a=>e.jsx(pt,{session:n,...a})},t.endpoint)}),o&&e.jsx(h,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:u})})]})}ft.propTypes={spaceGateway:p.object};function en(){const{t}=W(),{updateSpaceGateway:i,session:s}=Se(),n=({spaceGateway:o})=>i(o);return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(E,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Sr,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(h,{children:e.jsx(ie,{session:s,onSuccess:n})})]})}function tn(){const{spaceGateway:t,hasStorageEndpoint:i,loading:s}=Se(),{isMyself:n}=ue();return n?s?e.jsx(jr,{relative:"parent",children:e.jsx(V,{})}):e.jsx(nn,{children:e.jsx(h,{sx:{maxWidth:"720px"},children:i?e.jsx(ft,{spaceGateway:t}):e.jsx(en,{})})}):null}function rn(){return e.jsx(ut,{children:e.jsx(tn,{})})}const nn=Z(h)`
|
|
122
122
|
height: 100%;
|
|
123
123
|
overflow-y: auto;
|
|
124
124
|
`;function on(){const{user:t,isMyself:i,viewUser:s}=ue(),{followed:n}=hr();return e.jsx(h,{children:e.jsx(vr,{teamDid:window?.blocklet?.did||"",user:i?t:s,showInvitees:i,followed:n})})}function sn({tab:t=""}){const{api:i}=qt(),s=y.useRef(null),n=At(),o=t||n.tab,a=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),d=Ht(),r=T(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(g=>({...g,meta:{...g,did:g.did,name:g.name||g.title||"",logo:"logo.png"}}))})),f=async g=>{const{input:x,sessionId:j}=g;try{await i.destroySelf({input:{...x,sessionId:j}})}catch(v){console.error("destroy myself error",v)}};return e.jsx(ar,{mode:"user-center",children:e.jsxs(xr,{ref:s,embed:a==="1",currentTab:o?se(je.WELLKNOWN_SERVICE_PATH_PREFIX,"user",o):"",disableAutoRedirect:o==="settings",children:[o==="notifications"?e.jsx(_r,{blocklets:[r],context:d}):null,o==="nfts"?e.jsx(Yr,{}):null,o==="settings"?e.jsx(ct,{onDestroySelf:f}):null,o==="did-spaces"?e.jsx(rn,{}):null,o==="user-followers"?e.jsx(on,{}):null,o==="orgs"?e.jsx(gr,{id:n.id||""}):null]})})}sn.propTypes={tab:p.string};export{sn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as oT,F as $m,G as Xm,H as Zm}from"./vendor-hooks-
|
|
1
|
+
import{E as oT,F as $m,G as Xm,H as Zm}from"./vendor-hooks-CjESGRlR.js";import{B as qm}from"./vendor-utils-cJEl_UEd.js";import{g as jL,a as JL,r as QL}from"./vendor-react-Dvs43sk9.js";/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|