@abtnode/blocklet-services 1.16.38-beta-20250118-033334-2da05ae8 → 1.16.38-beta-20250120-112111-55c032e8
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/env.js +2 -0
- package/dist/assets/{Add-DA06or_T.js → Add-DwDyMZjP.js} +1 -1
- package/dist/assets/{ArrowDropDown-ByvmY1fG.js → ArrowDropDown-6xgUlX8W.js} +1 -1
- package/dist/assets/{CheckCircle-61kAAbS7.js → CheckCircle-D3qBEHQS.js} +1 -1
- package/dist/assets/{ChevronLeft-BEMgr19u.js → ChevronLeft-DgLREh72.js} +1 -1
- package/dist/assets/{ChevronRight-C9Sf_Tx7.js → ChevronRight-IFh5bkgF.js} +1 -1
- package/dist/assets/{DeleteOutline-CUlVP0SU.js → DeleteOutline-DQMkPBvg.js} +1 -1
- package/dist/assets/{Done-DBzH2QOU.js → Done-DLCsccPu.js} +1 -1
- package/dist/assets/{Download-CufGBMcn.js → Download-DTpNGuLl.js} +1 -1
- package/dist/assets/{Error-BRj42iX7.js → Error-UtB5QYSZ.js} +1 -1
- package/dist/assets/{Google-C9fXfahB.js → Google-BOAVI-Xc.js} +1 -1
- package/dist/assets/{InfoOutlined-CB0cJwBU.js → InfoOutlined-DQLlyyVh.js} +1 -1
- package/dist/assets/{Launch-DhDcxyle.js → Launch-Dh_xOrs9.js} +1 -1
- package/dist/assets/{LaunchOutlined--NsW2V4X.js → LaunchOutlined-foAf5c3n.js} +1 -1
- package/dist/assets/{Loop-DecQ6hrf.js → Loop-C4-HT3aE.js} +1 -1
- package/dist/assets/{MoreHoriz-jR1hvlRv.js → MoreHoriz-CUpIy534.js} +1 -1
- package/dist/assets/{PlayArrow-BQPL8ZKx.js → PlayArrow-DXnaLQNG.js} +1 -1
- package/dist/assets/{ViewList-COpI8i9D.js → ViewList-CRla7mfM.js} +1 -1
- package/dist/assets/_createAggregator-B36dTDyD.js +1 -0
- package/dist/assets/{access-control-DRWHWy3M.js → access-control-vt3SOToF.js} +1 -1
- package/dist/assets/{actions-DDDMPf_w.js → actions-Ca8zHti6.js} +1 -1
- package/dist/assets/add-component-core-CacRzL5C.js +716 -0
- package/dist/assets/{add-resource-BsYmNHG4.js → add-resource-ZEGylpES.js} +1 -1
- package/dist/assets/{addon-DRWTut9y.js → addon-CD5JNqbI.js} +1 -1
- package/dist/assets/{analytics-DJeRvifL.js → analytics-hNGjKcAT.js} +1 -1
- package/dist/assets/api-CjgpDSsI.js +1 -0
- package/dist/assets/ar-4M8AtNpp.js +3 -0
- package/dist/assets/{audit-logs-Dm5FbBZf.js → audit-logs-BKvkrneR.js} +1 -1
- package/dist/assets/{base32-BJ0zdvwj.js → base32-uGF9kxBw.js} +1 -1
- package/dist/assets/{branding-CJaxWW-w.js → branding-BfuJue_R.js} +2 -2
- package/dist/assets/{bundle-avatar-C5AcmC3p.js → bundle-avatar-BkNNM9he.js} +1 -1
- package/dist/assets/{button-bqdvVuzW.js → button-6RO042tO.js} +1 -1
- package/dist/assets/{click-to-copy-CmMy3CrF.js → click-to-copy-DSvEXBYz.js} +1 -1
- package/dist/assets/{complete-DrVsBs5y.js → complete-DOx-lUao.js} +1 -1
- package/dist/assets/{component-C5IX8wdu.js → component-DuXXl9Wb.js} +1 -1
- package/dist/assets/{config-10aPmzrE.js → config-BY9NHNw2.js} +2 -2
- package/dist/assets/{config-CJbVE0vv.js → config-_Ff2iSUC.js} +1 -1
- package/dist/assets/{config-navigation-CE_c3uZg.js → config-navigation-m1gKN3Qh.js} +3 -3
- package/dist/assets/{config-space-vTcG8SS6.js → config-space-DFc6Pvuv.js} +1 -1
- package/dist/assets/{confirm-CCF7Eh83.js → confirm-DUAXonUU.js} +1 -1
- package/dist/assets/{connect-DjXf6uie.js → connect-B8cD_Man.js} +1 -1
- package/dist/assets/{connect-DLAivc8W.js → connect-CywmqoEu.js} +1 -1
- package/dist/assets/{connect-to-DDEY8_e3.js → connect-to-DrkQpX8j.js} +1 -1
- package/dist/assets/{dashboard-D7d4Tags.js → dashboard-ChoAkepn.js} +3 -3
- package/dist/assets/{de-BYtQQOr-.js → de-BVgb1fEg.js} +1 -1
- package/dist/assets/de-D7CG0ov1.js +3 -0
- package/dist/assets/{did-address-DsOFwsmU.js → did-address-BD4xjcb5.js} +1 -1
- package/dist/assets/{domain-ZudrUt0P.js → domain-C3fxr6Yg.js} +1 -1
- package/dist/assets/{domain-list-DmocBvA0.js → domain-list-Do_JR9rl.js} +2 -2
- package/dist/assets/{email-DiKDXKCR.js → email-Bne33m4E.js} +3 -3
- package/dist/assets/es-DDr-aesw.js +3 -0
- package/dist/assets/{exchange-passport-CTKeYxYs.js → exchange-passport-De6icZUJ.js} +1 -1
- package/dist/assets/{form-text-input-juPY5e76.js → form-text-input-BCHcrKD9.js} +1 -1
- package/dist/assets/fr-CsECkLCu.js +3 -0
- package/dist/assets/{fuel-kHIIeGc9.js → fuel-BCXVQ7L0.js} +1 -1
- package/dist/assets/{fullpage-vhYlt62g.js → fullpage-Dd-4ilXd.js} +1 -1
- package/dist/assets/{get-safe-url-Bg-eYJFz.js → get-safe-url-CWTjw4O_.js} +1 -1
- package/dist/assets/{get-safe-url-CUm2E-jn.js → get-safe-url-g5s2_Tjs.js} +1 -1
- package/dist/assets/hi-Bojespkc.js +1 -0
- package/dist/assets/{home-X6wxlptK.js → home-Cy8ZPRh3.js} +1 -1
- package/dist/assets/{id-CgtYzmhQ.js → id-CUsGyKYW.js} +1 -1
- package/dist/assets/id-PvpxFUDg.js +3 -0
- package/dist/assets/{iframe-CVBJbqTp.js → iframe-B1rCM9Eo.js} +1 -1
- package/dist/assets/{index-H5hAQJcb.js → index-0YXNPVgm.js} +26 -26
- package/dist/assets/index-3ytyTrcC.js +2 -0
- package/dist/assets/{index-CYWGE7K9.js → index-BEw2AyDT.js} +7 -7
- package/dist/assets/{index-BnQkyyTO.js → index-BJ7_xt0j.js} +29 -29
- package/dist/assets/{index-NpTIA0Yh.js → index-Bj0uuh8o.js} +1 -1
- package/dist/assets/{index-JFhSGIs6.js → index-BnIb4VTf.js} +1 -1
- package/dist/assets/{index-C9c6FdP7.js → index-C1Xq6XBK.js} +1 -1
- package/dist/assets/{index-CuxhzgqO.js → index-C73dl7Hb.js} +1 -1
- package/dist/assets/{index-XdZHSkHK.js → index-CWMVCzCZ.js} +1 -1
- package/dist/assets/{index-BguQHm2Z.js → index-CfrumxV3.js} +1 -1
- package/dist/assets/index-D2ZJq7sT.js +228 -0
- package/dist/assets/{index-CUlGef8y.js → index-D5GvmQYq.js} +15 -15
- package/dist/assets/{index-CEmXvpjH.js → index-DKA7-XNE.js} +1 -1
- package/dist/assets/{index-BGO2DsWz.js → index-Dtif7RsI.js} +1 -1
- package/dist/assets/{index-B-my800N.js → index-HfngL4ZQ.js} +1 -1
- package/dist/assets/{index-BbrJG83p.js → index-wVbkSf51.js} +1 -1
- package/dist/assets/{invitation-CVhobKZ4.js → invitation-HSZrTxov.js} +1 -1
- package/dist/assets/{invite-CEfQ9Xdu.js → invite-Bq0wk8ts.js} +1 -1
- package/dist/assets/{issue-passport-C-sKKAKS.js → issue-passport-CVJgqjoO.js} +1 -1
- package/dist/assets/{item-BueNp2tn.js → item-ClsWGBWW.js} +2 -2
- package/dist/assets/ja-B9wMKQOb.js +3 -0
- package/dist/assets/ko-C_Flkwn-.js +3 -0
- package/dist/assets/{layout-CTddQfyh.js → layout-C4CjSZo6.js} +1 -1
- package/dist/assets/{list-header-Bce1kvpA.js → list-header-DH99VXjo.js} +1 -1
- package/dist/assets/localization-CBcpjiaX.js +1 -0
- package/dist/assets/{log-DV5xJK8V.js → log-DURqeXoL.js} +1 -1
- package/dist/assets/{login-CW9RVbaj.js → login-Bspf2QPd.js} +1 -1
- package/dist/assets/{login-oauth-callback-BVkafEHi.js → login-oauth-callback-C_wyWhiQ.js} +1 -1
- package/dist/assets/{logo-uploader-BuW1IV_-.js → logo-uploader-Dd2aFjos.js} +3 -3
- package/dist/assets/{lost-passport-C6Doyr0n.js → lost-passport-BSTbRq2w.js} +1 -1
- package/dist/assets/{open-window-CIN-c_8i.js → open-window-CbZilAH2.js} +1 -1
- package/dist/assets/{overview-Cx1NHKw_.js → overview-fXNI1ek4.js} +1 -1
- package/dist/assets/{page-header-PFRlhj0j.js → page-header-CjQ-ywzU.js} +1 -1
- package/dist/assets/{permission-BwvfjqYI.js → permission-7KeKIEKG.js} +1 -1
- package/dist/assets/{preferences-DY1qnOCx.js → preferences-BvdZgVe4.js} +1 -1
- package/dist/assets/pt-BqEVlA-1.js +1 -0
- package/dist/assets/publish-resource-DKGi8v_y.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DZo8yE8C.js → react-beautiful-dnd.esm-1AJr8vv6.js} +4 -4
- package/dist/assets/{relative-time-C-6wlxmy.js → relative-time-DXGmoAYD.js} +1 -1
- package/dist/assets/ru-u0x_icQc.js +1 -0
- package/dist/assets/sdk-iUaLet3q.js +1 -0
- package/dist/assets/session-Cz3pOVxP.js +1 -0
- package/dist/assets/{setup-Ejw_ADHH.js → setup-BoMrIrRo.js} +3 -3
- package/dist/assets/{start-mCJ8IO-s.js → start-DbCciQyK.js} +1 -1
- package/dist/assets/{step-actions-BbCSiBWz.js → step-actions-BF4Z-WD4.js} +1 -1
- package/dist/assets/{studio-C8ceaGGk.js → studio-DJOlNVRZ.js} +1 -1
- package/dist/assets/{switch-control-DzGhrJO3.js → switch-control-Df6SSLH9.js} +1 -1
- package/dist/assets/th-BX_96cb2.js +1 -0
- package/dist/assets/{toUpper-Ch8IcBS5.js → toUpper-BYBs387H.js} +1 -1
- package/dist/assets/{transfer-B7yyybIU.js → transfer-CoIJ2-Fh.js} +1 -1
- package/dist/assets/{unsubscribe-DqJ3ZVmc.js → unsubscribe-DHlZPuAs.js} +1 -1
- package/dist/assets/{useAsync-cdOzMWPw.js → useAsync-D2wKH3Wq.js} +1 -1
- package/dist/assets/{useAsyncRetry-ng-QDeMG.js → useAsyncRetry-B87-aW-H.js} +1 -1
- package/dist/assets/{useLocalStorage-CM8R1gkX.js → useLocalStorage-Dsxa7zZV.js} +1 -1
- package/dist/assets/user-center-BY7PdrGc.js +203 -0
- package/dist/assets/{util-D8HyMwt2.js → util-DzhfzPwC.js} +1 -1
- package/dist/assets/vendor-arcblock-D-SOxQ_x.js +3509 -0
- package/dist/assets/{vendor-hooks-CLzfFpO7.js → vendor-hooks-CAfthYak.js} +1 -1
- package/dist/assets/vendor-utils-B7sI0FpJ.js +11 -0
- package/dist/assets/vi-7r8InJhP.js +1 -0
- package/dist/assets/wrap-locale-CjCBeQlY.js +1 -0
- package/dist/assets/zh-D0JQ3A7z.js +4 -0
- package/dist/assets/{zh-tw-B8oIFv7R.js → zh-tw-CnxtpiBO.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/service-worker.js +1 -1
- package/package.json +21 -21
- package/dist/assets/_createAggregator-D73d37er.js +0 -1
- package/dist/assets/add-component-core-Cz5AqUoX.js +0 -716
- package/dist/assets/api-C0C4sDJA.js +0 -1
- package/dist/assets/ar-Dr7fntBt.js +0 -3
- package/dist/assets/de-GmIXK1UD.js +0 -3
- package/dist/assets/es-DVK5-peZ.js +0 -3
- package/dist/assets/fr-CjZFjFm5.js +0 -3
- package/dist/assets/hi-8hECDYim.js +0 -1
- package/dist/assets/id-Dv6VZG0f.js +0 -3
- package/dist/assets/index-iNTIfB79.js +0 -228
- package/dist/assets/ja-Cdy8ZhTC.js +0 -3
- package/dist/assets/ko-DrTpzs7q.js +0 -3
- package/dist/assets/localization-_hzGA-9a.js +0 -1
- package/dist/assets/pt-CMTeSYTi.js +0 -1
- package/dist/assets/publish-resource-ByN4rwnZ.js +0 -1
- package/dist/assets/ru-C9ShBb28.js +0 -1
- package/dist/assets/sdk-CrCNIpAP.js +0 -1
- package/dist/assets/session-Ku4cwX2M.js +0 -1
- package/dist/assets/th-Ci6_lraJ.js +0 -1
- package/dist/assets/user-center-BEkeBApB.js +0 -202
- package/dist/assets/vendor-arcblock-BlPSuvWz.js +0 -3506
- package/dist/assets/vendor-utils-DCpRgzMR.js +0 -11
- package/dist/assets/vi-CzSsX7fL.js +0 -1
- package/dist/assets/wrap-locale-CQCi4c6m.js +0 -1
- package/dist/assets/zh-Bo-Td4CQ.js +0 -4
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import{E as p,j as r,a3 as b,x as V,bp as be,T as M,aa as k,t as _,ah as Y,am as ve,a4 as Ge,bC as Ve,aq as Qe,as as Xe,e as Ye,aK as Je,bD as Ze,bE as et,bF as tt,aP as nt,bG as rt,M as st,al as me,a2 as xe}from"./vendor-mui-core-jh6OMVvU.js";import{E as ot,U as J,af as D,aH as we,aI as it,aJ as at,aK as lt,aL as ct,v as U,g as Z,aM as dt,aN as pt,P as ut,aO as ft,d as ht}from"./vendor-arcblock-BlPSuvWz.js";import{r as h,g as je,l as mt}from"./vendor-react-D-afvo_7.js";import{o as W}from"./vendor-hooks-CLzfFpO7.js";import{j as xt}from"./vendor-utils-DCpRgzMR.js";import{S as gt}from"./index-DvtOujRp.js";import{B as Ce}from"./bundle-avatar-C5AcmC3p.js";import{B as yt}from"./index-CEmXvpjH.js";import{R as bt}from"./relative-time-C-6wlxmy.js";import{M as vt,O as A,Q as wt,R as jt}from"./index-BnQkyyTO.js";import{d as Ct}from"./InfoOutlined-CB0cJwBU.js";Se.propTypes={theme:p.string,type:p.oneOf(["button","line"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function Se({theme:e="dark",type:t="button",onSelectType:s,extra:n=void 0,currentTab:o="",loading:i=!1,...a}){const l=[{label:"All",value:""},{label:"Info",value:"info"},{label:"Success",value:"success"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}],u=c=>{(c!==o||!i)&&s(c)},m=h.useMemo(()=>{const c={width:"100%",bgcolor:e==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return t==="line"?Object.assign(c,{}):c},[t,e]),f=(c,x,g)=>r.jsx(V,{disabled:i,onClick:()=>u(c.value),className:`profile-button ${x?"active":""}`,...a,children:c.label},c.value||g),d=(c,x,g)=>r.jsx(V,{variant:"text",disabled:i,onClick:()=>u(c.value),className:`profile-line-button ${x?"active":""}`,...a,children:c.label},c.value||g);return r.jsxs(b,{className:"severity-tabs",sx:m,children:[r.jsx("div",{style:t==="line"?{flex:1,borderBottom:"1px solid rgba(209, 213, 219, 1)"}:{},children:l==null?void 0:l.map((c,x)=>{const g=o===(c==null?void 0:c.value);return t==="line"?r.jsx(h.Fragment,{children:d(c,g,x)},c.value||x):r.jsx(h.Fragment,{children:f(c,g,x)},c.value||x)})}),n]})}var St=h;function Lt(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var q=Lt(St);function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Q.apply(this,arguments)}function Tt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,X(e,t)}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},X(e,t)}function Et(e,t){if(e==null)return{};var s={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(s[o]=e[o]);return s}var ge={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},kt=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function Rt(e,t){if(!e||typeof e!="object")return e;var s={};return Object.keys(e).forEach(function(n){t.indexOf(n)>-1||(s[n]=e[n])}),s}var Pt=["component","className","unsafeHTML"];function Le(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var s=document.createDocumentFragment(),n;switch(t){case"words":n=e.textContent.split(/\b|(?=\W)/);break;case"letters":n=Array.from(e.textContent);break}n.forEach(function(l){s.appendChild($t(l))}),e.parentNode.replaceChild(s,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var o=[].slice.call(e.childNodes),i=o.length,a=0;a<i;a++)Le(o[a],t)}function $t(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function ye(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function Te(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);Te(e.parentNode,t)}}function Mt(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function K(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var Ee={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Nt=Object.keys(Ee),ke=function(e){Tt(t,e);function t(n){var o;return o=e.call(this,n)||this,o.state={html:n.unsafeHTML,clamped:!1},o.canvas=null,o.maxLine=0,o.nlUnits=[],o}var s=t.prototype;return s.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},s.componentDidUpdate=function(o){o.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==o&&this.reflow(this.props)},s.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},s.setState=function(o,i){return typeof o.clamped<"u"&&(this.clamped=o.clamped),e.prototype.setState.call(this,o,i)},s.initCanvas=function(){if(!this.canvas){var o=this.canvas=document.createElement("div");o.className="LinesEllipsis-canvas "+this.props.className,o.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(ge).forEach(function(i){o.style[i]=ge[i]}),document.body.appendChild(o)}},s.copyStyleToCanvas=function(){var o=this,i=window.getComputedStyle(this.target);kt.forEach(function(a){o.canvas.style[a]=i[a]})},s.reflow=function(o){this.maxLine=+o.maxLine||1,this.canvas.innerHTML=o.unsafeHTML;var i=o.basedOn||(/^[\x00-\x7F]+$/.test(o.unsafeHTML)?"words":"letters");Le(this.canvas,i);var a=this.putEllipsis(this.calcIndexes()),l={clamped:a,html:this.canvas.innerHTML};this.setState(l,o.onReflow.bind(this,l))},s.calcIndexes=function(){var o=[0],i=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),a=i.length;if(!i.length)return o;var l=i.find(K);if(!l)return o;for(var u=1,m=l.offsetTop,f=1;f<a&&!(K(i[f])&&i[f].offsetTop-m>1&&(u++,o.push(f),m=i[f].offsetTop,u>this.maxLine));f++);return o},s.putEllipsis=function(o){if(o.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,o[this.maxLine]);var i=this.nlUnits.pop(),a=this.makeEllipsisSpan();do Te(i,this.canvas),Mt(i).appendChild(a),i=this.nlUnits.pop();while(i&&(!K(i)||a.offsetHeight>i.offsetHeight||a.offsetTop>i.offsetTop));return i&&ye(i),this.nlUnits.forEach(ye),!0},s.makeEllipsisSpan=function(){var o=this.props,i=o.ellipsisHTML,a=o.ellipsis,l=document.createElement("span");l.appendChild(document.createElement("wbr"));var u=document.createElement("span");return u.className="LinesEllipsis-ellipsis",i?u.innerHTML=i:u.textContent=a,l.appendChild(u),l},s.isClamped=function(){return this.clamped},s.render=function(){var o=this,i=this.state,a=i.html,l=i.clamped,u=this.props,m=u.component,f=u.className,d=u.unsafeHTML,c=Et(u,Pt);return q.default.createElement(m,Q({className:"LinesEllipsis "+(l?"LinesEllipsis--clamped":"")+" "+f,ref:function(g){return o.target=g}},Rt(c,Nt)),q.default.createElement("div",{dangerouslySetInnerHTML:{__html:l?a:d}}))},t}(q.default.Component);ke.defaultProps=Ee;var Ot=ke;const _t=je(Ot),{joinURL:S,withQuery:R}=vt,{toTypeInfo:At}=ot,{isEVMChain:It,getExplorerUrl:Dt}=A,{arcChainConfig:Ht}=wt,Ut={ROLE_ACCOUNT:"number",ROLE_NODE:"number",ROLE_DEVICE:"number",ROLE_APPLICATION:"number",ROLE_SMART_CONTRACT:"number",ROLE_BOT:"number",ROLE_ASSET:"number",ROLE_STAKE:"number",ROLE_VALIDATOR:"number",ROLE_GROUP:"number",ROLE_TX:"number",ROLE_TETHER:"number",ROLE_SWAP:"number",ROLE_DELEGATION:"number",ROLE_VC:"number",ROLE_BLOCKLET:"number",ROLE_STORE:"number",ROLE_TOKEN:"number",ROLE_FACTORY:"number",ROLE_ROLLUP:"number",ROLE_STORAGE:"number",ROLE_PROFILE:"number",ROLE_ANY:"number"},P="https://explorer.abtnetwork.io/explorer/";var zt=function({hash:t,asset:s,rollup:n,address:o,token:i,stake:a,chainId:l=""}){if(It(l)){const d=Dt(l);return t?S(d,`tx/${t}`):s?S(d,`token/${s}`):S(d,`address/${o}`)}const u=Ht[l],m=u==null?void 0:u.defaultRPC,f=m?`${m}`:void 0;return n&&At(n).role===Ut.ROLE_ROLLUP?t?R(S(P,`rollups/${n}/moves/${t}`),{host:f}):R(S(P,`rollups/${n}`),{host:f}):s?R(S(P,`assets/${s}`),{host:f}):t?R(S(P,`txs/${t}`),{host:f}):i?R(S(P,`tokens/${i}/tx`),{host:f}):a?R(S(P,`stakes/${a}`),{host:f}):R(S(P,`accounts/${o}`),{host:f})},ee={isSameAddr:(e,t)=>String(e).toLowerCase()===String(t).toLowerCase()};const O=zt,{isSameAddr:$}=ee;class F{constructor({type:t,did:s,chainId:n,text:o}){this.text=o,this.did=s,this.type=t,this.chainId=n}}const te=e=>{const t=[];try{let s=0;const n=/<(.+?)\(?[tx|nft|token|stake|did|dapp|link]+[:](.+?)\)?>/gi,o=e.matchAll(n);for(const i of o){const a=/\([tx|nft|token|stake|did|dapp|link]+[:](.+?)\)/gi,l=i[0],u=i.index||s,m=u+l.length;if([...l.matchAll(a)].length>1)return[e];let d="";const c=a.exec(l);let x="";if(c){const T=c[0];d=l.replace(T,"").replace(/^</,"").replace(/(>)$/,""),x=T.replace(/\)$/,"").replace(/^\(/,"")}else x=l;const g=x.split(":"),v=(g[0]||"").replace(/^</,"").replace(/^\(/,"").toUpperCase(),j=(g[1]||"").replace(/>$/,"").replace(/\)$/,""),C=(g[g.length-1]||"").replace(/>$/,"").replace(/\)$/,"");t.push(e.substring(s,u)),t.push(new F({type:v,chainId:j,did:C,text:d||v})),s=m}return s<e.length&&t.push(e.substring(s)),t}catch(s){return console.error(s==null?void 0:s.message),[e]}},ne=e=>{let t;const{type:s,chainId:n,did:o}=e;return $(s,"link")?t=`${n}:${o}`:$(s,"tx")?t=O({hash:o,chainId:n}):$(s,"stake")?t=O({stake:o,chainId:n}):$(s,"nft")?t=O({asset:o,chainId:n}):$(s,"token")?t=O({token:o,chainId:n}):$(s,"did")&&(t=O({address:o,chainId:n})),t},Bt=(e,t=!0)=>te(e).map(n=>{if(n instanceof F){if(t){const o=ne(n),{type:i,chainId:a,did:l}=n;return $(i,"dapp")?`<em style="font-weight:bold;" data-type="${i}" data-chain-id="${a}" data-did="${l}">${n.text}</em>`:o?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${o}">${n.text}</a>`:`<em style="font-weight:bold;" data-type="${i}" data-chain-id="${a}" data-did="${l}">${n.text}</em>`}return n.text}return n}).join(""),Wt=e=>te(e).map(s=>s instanceof F?`<${ne(s)}|${s.text}>`:s.replace(/:\n/g,": ")).join("");var z={toClickableSpan:Bt,toTextList:te,toSlackLink:Wt,Link:F,getLink:ne};function Re({attachment:e}){const{data:t}=e;let s="";try{s=new URL(t.url).host}catch{s=t.url}return r.jsxs(be,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},children:[!!s&&r.jsx("span",{className:"url",children:s}),!!t.title&&r.jsx(b,{className:"title",children:t.title}),!!t.description&&r.jsx(b,{className:"description",style:{whiteSpace:"unset",color:"rgba(75, 85, 99, 1)"},children:t.description}),!!t.image&&r.jsx("img",{srcSet:`${A.getImagePath(t.image)}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${A.getImagePath(t.image)}?w=128&h=128&fit=crop&auto=format`,alt:t.title||"",loading:"lazy",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})]})}Re.propTypes={attachment:p.object.isRequired};function Pe({attachment:e}){const{data:t}=e;return r.jsx("img",{srcSet:`${A.getImagePath(t.url)}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${A.getImagePath(t.url)}?w=128&h=128&fit=crop&auto=format`,alt:t.title||"",loading:"lazy",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})}Pe.propTypes={attachment:p.object.isRequired};function re({attachment:e,...t}){var l;const{data:s}=e,n=((l=s.color)==null?void 0:l.toLowerCase())||t.color,o=s.size||t.size,i=s.fontWeight||t.fontWeight||400;let a="14px";return o==="small"?a="12px":o==="normal"?a="14px":o==="big"?a="16px":o==="large"&&(a="18px"),r.jsx("span",{className:"title",style:{fontSize:a,color:n,whiteSpace:"unset",fontWeight:i},children:s.text})}re.propTypes={attachment:p.object.isRequired};const Ft=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},qt=e=>{try{return new URL(e).host}catch{return e}};var I={getChainHost:Ft,getUrlHost:qt},B={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}};se.propTypes={locale:p.string,data:p.object.isRequired};se.defaultProps={locale:"en"};function se({locale:e="en",data:t}){const s={zh:"来自",en:"from"}[e]||"from",n={zh:"接收",en:"Received"}[e]||"Received",i=`https://${I.getUrlHost(t.chainHost)||I.getChainHost(t.chainId)}/explorer/tokens/${t.address}/tx`;let a=t.amount;t.decimal&&(a=t.amount/10**t.decimal);const l=W(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return r.jsx("a",{href:i,target:"_blank",rel:"noreferrer",children:r.jsxs(b,{display:"flex",flexDirection:"column",children:[r.jsxs(b,{sx:l,children:[r.jsx(M,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:n}),r.jsxs(M,{component:"div",align:"right",style:B.summaryStyle,flex:1,children:["+",a," ",t.symbol]})]}),r.jsxs(b,{sx:l,children:[r.jsx(M,{component:"div",style:{...B.remarkStyle,fontSize:14},children:s}),r.jsx(b,{sx:{maxWidth:"252px",fontSize:"14px"},children:r.jsx(J,{did:t.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}oe.propTypes={locale:p.string,data:p.object.isRequired};oe.defaultProps={locale:"en"};function oe({locale:e,data:t}){var u,m;const s={zh:"接收",en:"Received"}[e]||"Received",n={zh:"来自",en:"from"}[e]||"from",o=I.getUrlHost(t.chainHost)||I.getChainHost(t.chainId),i=t.did||((m=(u=t==null?void 0:t.credential)==null?void 0:u.issuer)==null?void 0:m.id)||"",a=`https://${o}/explorer/assets/${i}`,l=W(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return r.jsx(b,{sx:{pr:1},children:r.jsx("a",{href:a,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},rel:"noreferrer",children:r.jsxs(b,{display:"flex",flexDirection:"column",children:[r.jsxs(b,{sx:l,children:[r.jsx(M,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:s}),r.jsx(M,{component:"div",align:"right",style:B.summaryStyle,children:"+1 Asset"})]}),i?r.jsxs(b,{sx:l,children:[r.jsx(M,{component:"div",style:{...B.remarkStyle,fontSize:14},children:n}),r.jsx(b,{sx:{maxWidth:"252px",fontSize:"14px"},children:r.jsx(J,{did:i,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}$e.propTypes={data:p.object.isRequired,locale:p.string};function $e({data:e,locale:t="en"}){return r.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},rel:"noreferrer",children:[r.jsx("img",{className:"image",src:e.logo,width:50,height:50,alt:""}),r.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[r.jsx("div",{style:{marginBottom:"6px"},children:e.title}),r.jsx("div",{style:{color:"#a5a5a5",fontSize:10,maxWidth:"252px"},children:r.jsx(J,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:t})})]})]})}ie.propTypes={locale:p.string,data:p.object.isRequired};ie.defaultProps={locale:"en"};function ie({locale:e,data:t}){const s=I.getChainHost(t.chainId),n=`https://${s}/explorer/txs/${t.hash}`,o={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",i={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash";return r.jsxs("a",{href:n,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block",fontSize:14},rel:"noreferrer",children:[r.jsx("h6",{style:{color:"#a5a5a5",margin:0},children:s}),r.jsx("p",{style:{color:"#4598fa",margin:0},children:o}),r.jsxs("div",{style:{wordBreak:"break-all"},children:[i,": ",t.hash]})]})}function Me({data:e,isMd:t=!1}){return r.jsx(b,{display:"flex",flexDirection:t?"row":"column",justifyContent:"space-between",sx:{width:t?"100%":"auto"},children:e.items.map((s,n)=>r.jsx(re,{attachment:s,color:n===0?"rgba(156, 163, 175, 1)":"",size:n===0?"normal":"big",fontWeight:n===0?400:600},n))})}Me.propTypes={data:p.array.isRequired,isMd:p.bool};function Ne({attachment:e,...t}){const{local:s}=h.useContext(D),n=_(o=>o.breakpoints.down("md"));return r.jsxs(Kt,{"data-testid":"attachment-preview",...t,isMd:n,children:[e.type==="link"&&r.jsx(Re,{attachment:e,...t,isMd:n}),e.type==="image"&&r.jsx(Pe,{attachment:e,isMd:n}),e.type==="text"&&r.jsx(re,{attachment:e,isMd:n}),e.type==="token"&&r.jsx(se,{data:e.data,local:s,isMd:n}),e.type==="asset"||e.type==="vc"?r.jsx(oe,{data:e.data,local:s,isMd:n}):null,e.type==="dapp"&&r.jsx($e,{data:e.data,local:s,isMd:n}),e.type==="transaction"&&r.jsx(ie,{data:e.data,local:s,...t,isMd:n}),e.type==="divider"&&r.jsx(Y,{sx:{mb:1,mt:1},style:{color:we.dividerColor}}),e.type==="combined"&&r.jsx(Me,{data:e,isMd:n})]})}const Kt=k.div`
|
|
2
|
-
display: ${({sx:e={}})=>e.display||"flex"};
|
|
3
|
-
flex-direction: ${({sx:e={}})=>e.flexDirection||"column"};
|
|
4
|
-
gap: ${({sx:e={}})=>e.gap||1};
|
|
5
|
-
width: ${({isMd:e=!1})=>e?"100%":"auto"};
|
|
6
|
-
&:last-child {
|
|
7
|
-
margin-bottom: 0;
|
|
8
|
-
}
|
|
9
|
-
`;Ne.propTypes={attachment:p.object.isRequired};function Oe({data:e,...t}){const{items:s}=e;return r.jsx(Gt,{...t,children:s.map(n=>r.jsxs(ve,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128},children:[r.jsxs(b,{display:"flex",alignItems:"center",gap:1,children:[n.icon?r.jsx("img",{src:n.icon,alt:n.title,style:{width:16,height:16}}):null,r.jsxs(b,{className:"metric-name",display:"flex",alignItems:"center",children:[n.title,n.subtitle?r.jsx(Ge,{title:n.subtitle,arrow:!0,placement:"top",children:r.jsx(Ct,{fontSize:"small",sx:{fontSize:14,ml:.5}})}):null]})]}),r.jsxs(b,{className:"metric-number",sx:{color:n.content_color||"rgba(3, 7, 18, 1)"},children:[n.content,n.sub_content?r.jsxs("span",{className:"sub-content",style:{color:n.sub_content_color||"rgba(156, 163, 175, 1)"},children:["(",n.sub_content,")"]}):null]})]},n.title))})}const Gt=k(b)`
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: flex-start;
|
|
12
|
-
flex-wrap: wrap;
|
|
13
|
-
gap: 16px;
|
|
14
|
-
.metric-number {
|
|
15
|
-
font-size: 18px;
|
|
16
|
-
font-weight: 600;
|
|
17
|
-
.sub-content {
|
|
18
|
-
font-size: 12px;
|
|
19
|
-
font-weight: 400;
|
|
20
|
-
margin-left: 4px;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
.metric-name {
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
color: rgba(156, 163, 175, 1);
|
|
26
|
-
}
|
|
27
|
-
`;Oe.propTypes={data:p.object.isRequired};function _e({data:e}){const{items:t}=e,s=_(a=>a.breakpoints.down("sm")),n=_(a=>a.breakpoints.down("md")),o=_(a=>a.breakpoints.down("lg")),i=()=>s?1:n?3:o?4:6;return r.jsx(Ve,{variant:"quilted",cols:i(),gap:8,rowHeight:128,sx:{margin:0},children:t.map(a=>{const l=a.cover||a.display;return l?r.jsx("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",children:r.jsx(Qe,{children:r.jsx("img",{srcSet:`${l}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${l}?w=128&h=128&fit=crop&auto=format`,alt:a.title||"",loading:"lazy",style:{borderRadius:"8px"}})})},l):null})})}_e.propTypes={data:p.object.isRequired};function ae({data:e,feedType:t,...s}){return r.jsxs(Vt,{...s,children:[t==="data-tracker"&&e.type==="table"&&r.jsx(Oe,{data:e}),(t==="graphic"||t==="gallery")&&r.jsx(_e,{data:e})]})}const Vt=k.div`
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
width: 100%;
|
|
31
|
-
margin-bottom: 4px;
|
|
32
|
-
&:last-child {
|
|
33
|
-
margin-bottom: 0;
|
|
34
|
-
}
|
|
35
|
-
`;ae.propTypes={data:p.object.isRequired,feedType:p.string};ae.defaultProps={feedType:"data-tracker"};var Qt=it,Xt=at,Yt=lt,Jt=Math.ceil,Zt=Math.max;function en(e,t,s){(s?Xt(e,t,s):t===void 0)?t=1:t=Zt(Yt(t),0);var n=e==null?0:e.length;if(!n||t<1)return[];for(var o=0,i=0,a=Array(Jt(n/t));o<n;)a[i++]=Qt(e,o,o+=t);return a}var tn=en;const nn=je(tn),rn=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},sn=e=>e.every(t=>t.type==="text"),on=e=>e.every(t=>t.type==="image"),an=e=>nn(e,2).map(t=>({type:"combined",items:t})),ln=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(s=>s.type===t)},cn=async(e,t)=>{const n=new ct().user;if(n)try{return await n.getUserPublicInfo({did:e})?await n.getProfileUrl({did:e,locale:t}):void 0}catch(o){console.error(o);return}};function le({notification:e,severity:t,showSke:s=!0}){const{attachments:n,data:o,...i}=e,a=_(f=>f.breakpoints.down("md"));if((!n||!n.length)&&U(o))return null;const l=rn(t),u=(f,d=!1)=>{if(!f&&!Array.isArray(f))return null;let c=f,x={},g="horizontal";d&&sn(f)&&(c=an(f),g="vertical",x={display:"flex",gap:1,flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",height:"100%"});const v=ln(c);return r.jsx(b,{sx:{display:"flex",gap:1,flexDirection:d?"row":"column",justifyContent:"flex-start",alignItems:d?"center":"unset",flexWrap:"wrap"},children:c.map((j,C)=>j.type==="section"?r.jsx(h.Fragment,{children:u(j.fields,!0)},C):r.jsxs(h.Fragment,{children:[r.jsx(Ne,{attachment:j,sx:x,...i}),!(a&&g==="vertical")&&v&&c.length>1&&C!==c.length-1?r.jsx(Y,{orientation:g,style:{color:we.dividerColor},sx:g==="vertical"?{ml:2,mr:2,height:32}:{}}):null]},C))})},m=on(n);return r.jsx(dn,{children:r.jsxs("div",{className:"message-in-list",children:[n.length>0&&r.jsx("div",{className:"message-container",children:m?u(n):r.jsx(ve,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128,borderColor:l},children:u(n)})}),!U(o)&&r.jsx("div",{className:"message-container",children:r.jsx("div",{className:"data-container",children:r.jsx(ae,{data:o,feedType:e.feedType})})}),n.length===0&&U(o)&&s&&r.jsx(Xe,{className:"attach-ske",style:{marginTop:10},variant:"rectangular",height:150})]})})}const dn=k.div`
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
.message-in-list {
|
|
39
|
-
padding: 8px 8px 8px 0;
|
|
40
|
-
display: flex;
|
|
41
|
-
border-radius: 8px;
|
|
42
|
-
}
|
|
43
|
-
.message-title {
|
|
44
|
-
color: #25292f;
|
|
45
|
-
font-size: 18px;
|
|
46
|
-
font-weight: bold;
|
|
47
|
-
word-break: break-all;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.attach-ske {
|
|
51
|
-
position: relative;
|
|
52
|
-
margin-left: 10px;
|
|
53
|
-
&::after {
|
|
54
|
-
content: '';
|
|
55
|
-
position: absolute;
|
|
56
|
-
left: -10px;
|
|
57
|
-
top: 0;
|
|
58
|
-
height: 100%;
|
|
59
|
-
width: 4px;
|
|
60
|
-
background-color: ${e=>e.leftLineColor};
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.message-body {
|
|
65
|
-
color: #25292f;
|
|
66
|
-
font-size: 16px;
|
|
67
|
-
word-break: break-all;
|
|
68
|
-
white-space: pre-line;
|
|
69
|
-
}
|
|
70
|
-
.message-container {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
justify-content: flex-start;
|
|
74
|
-
.data-container,
|
|
75
|
-
.attachment-container {
|
|
76
|
-
display: flex;
|
|
77
|
-
flex-direction: column;
|
|
78
|
-
width: 100%;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
.actions-container {
|
|
82
|
-
margin-top: 10px;
|
|
83
|
-
.actions-item {
|
|
84
|
-
margin-right: 8px;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
`;le.propTypes={severity:p.string.isRequired,notification:p.object.isRequired,showSke:p.bool};le.defaultProps={showSke:!0};const G=e=>dt.sanitize(e,{ALLOWED_ATTR:["href","target","rel","class","id","style"]}),pn=async(e,t)=>{const{type:s,did:n}=e;return ee.isSameAddr(s,"did")&&await cn(n,t)||z.getLink(e)},un=async(e,t,s=!0)=>{const n=z.toTextList(e);return await Promise.all(n.map(async i=>{if(i instanceof z.Link){if(s){const a=await pn(i,t),{type:l,chainId:u,did:m}=i;return ee.isSameAddr(l,"dapp")?`<em style="font-weight:bold;" data-type="${l}" data-chain-id="${u}" data-did="${m}">${i.text}</em>`:a?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${a}">${i.text}</a>`:`<em style="font-weight:bold;" data-type="${l}" data-chain-id="${u}" data-did="${m}">${i.text}</em>`}return i.text}return i})).then(i=>i.join(""))};Ae.propTypes={notification:p.object,rows:p.number};function Ae({notification:e,rows:t=2}){const[s,n]=h.useState(!1),[o,i]=h.useState(""),{t:a,locale:l}=Z(),u=h.useMemo(()=>{const{attachments:v}=e||{};if(!v)return!1;try{return v.length>0}catch{return!1}},[e]),m=h.useMemo(()=>{const{blocks:v}=e||{};if(!v)return!1;try{return v.length>0}catch{return!1}},[e]),f=h.useMemo(()=>{const{description:v}=e||{};return!!v},[e]),d=h.useMemo(()=>{const{data:v}=e||{};return!U(v)},[e]),c=h.useMemo(()=>u||m||f||d,[u,m,f,d]);if(h.useEffect(()=>{un((e==null?void 0:e.description)??"",l).then(v=>{i(v)})},[e==null?void 0:e.description,l]),!c)return null;const x=()=>t===0?"":s?`<span class='toggle-btn' data-name='toggle-expanded'>${a("common.collapse")}</span>`:`...<span class='toggle-btn' data-name='toggle-expanded'>${a("common.expand")}</span>`,g=v=>{const{target:j}=v;j.getAttribute("data-name")==="toggle-expanded"&&n(!s)};return r.jsxs(fn,{children:[r.jsx(b,{className:"text-container",children:r.jsx(b,{component:"div",sx:{marginBottom:"4px"},onClick:g,children:o&&(!s&&t>0?r.jsx(_t,{basedOn:"letters",unsafeHTML:G(o),maxLine:t,ellipsisHTML:G(x())}):r.jsx(M,{component:"div",className:`content ${t===0?"ellipsis":""}`,style:{whiteSpace:"pre-line!important",fontSize:"14px"},dangerouslySetInnerHTML:{__html:G(`${o}${x()}`)}}))})}),u||d?r.jsx(le,{severity:e.severity,notification:e}):null]})}const fn=k(b)`
|
|
88
|
-
margin-bottom: 6px;
|
|
89
|
-
color: rgba(75, 85, 99, 1);
|
|
90
|
-
.text-container {
|
|
91
|
-
word-wrap: break-word;
|
|
92
|
-
font-size: 14px;
|
|
93
|
-
color: rgba(75, 85, 99, 1);
|
|
94
|
-
.toggle-btn {
|
|
95
|
-
display: inline-block;
|
|
96
|
-
white-space: nowrap;
|
|
97
|
-
cursor: pointer;
|
|
98
|
-
margin-left: 4px;
|
|
99
|
-
font-size: 14px;
|
|
100
|
-
color: rgba(59, 130, 246, 1);
|
|
101
|
-
}
|
|
102
|
-
.content.ellipsis {
|
|
103
|
-
overflow: hidden;
|
|
104
|
-
text-overflow: ellipsis;
|
|
105
|
-
display: block
|
|
106
|
-
display: -webkit-box;
|
|
107
|
-
-webkit-box-orient: vertical;
|
|
108
|
-
max-height: 3em;
|
|
109
|
-
line-height: 1.5em;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
`,hn=h.memo(Ae);De.propTypes={data:p.array,blockletMap:p.object,onReadNotification:p.func,inDialog:p.bool};Ie.propTypes={notification:p.object,blocklet:p.object,onReadNotification:p.func,inDialog:p.bool};function Ie({notification:e,blocklet:t,onReadNotification:s=()=>{},inDialog:n=!1}){var f;const{locale:o}=h.useContext(D),i=Ye(),a=h.useMemo(()=>{const{receivers:d=[]}=e;return d.length?d[0].read:!0},[e]),l=h.useMemo(()=>{const{actions:d,action:c}=e;let x=d??[];return!x.length&&c&&(x=[{name:"Visit",link:c}]),x},[e]),u=(t==null?void 0:t.did)||((f=t==null?void 0:t.meta)==null?void 0:f.did)||"",m=((t==null?void 0:t.alsoKnownAs)||[]).concat((t==null?void 0:t.appId)||(t==null?void 0:t.appDid)||(t==null?void 0:t.appPid)||"");return r.jsxs(mn,{className:"notification-row",display:"flex",gap:2,sx:{padding:"8px"},onClick:()=>s(e),children:[r.jsx(Je,{variant:"dot",color:"error",invisible:a,children:t?r.jsx(b,{children:m.includes(u)?r.jsx(yt,{blocklet:t}):r.jsx(Ce,{blocklet:t,ancestors:t.ancestors??[]})}):r.jsx(gt,{width:"40",height:"40"})}),r.jsxs(b,{className:"notification",display:"flex",flexDirection:"column",alignItems:"start",children:[r.jsxs(b,{display:"flex",justifyContent:"start",alignItems:"center",gap:1,sx:{width:"100%"},children:[r.jsx(b,{className:"title",children:e.title}),"·",r.jsx(bt,{value:e.createdAt,locale:o,shouldUpdate:!0,style:{color:i.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),r.jsx(hn,{notification:e,rows:n?0:2}),l.length>0?r.jsx(b,{display:"flex",justifyContent:"start",alignItems:"center",gap:1,children:l.map((d,c)=>r.jsxs(h.Fragment,{children:[r.jsx(be,{href:d.link,target:"_blank",className:"link",sx:{fontSize:"15px"},children:d.name},d.link),c<l.length-1?r.jsx(Y,{orientation:"vertical",sx:{ml:1,mr:1,height:12,borderWidth:"1px"}}):null]},d.link))}):null]})]})}function De({data:e,blockletMap:t,onReadNotification:s=()=>{},inDialog:n=!1}){const{t:o}=Z(),i=h.useMemo(()=>n?e==null?void 0:e.slice(0,5):e,[n,e]);return e!=null&&e.length?r.jsx(b,{display:"flex",flexDirection:"column",sx:{mt:1,...n?{maxHeight:"calc(-200px + 100vh)",overflow:"auto"}:{}},children:i==null?void 0:i.map(a=>{var u;const l=a.source==="system"?t.get(a.entityId||a.sender):t.get(a.componentDid||a.sender);return((u=a==null?void 0:a.type)==null?void 0:u.toLowerCase())==="passthrough"?null:r.jsx(Ie,{inDialog:n,notification:a,blocklet:l,onReadNotification:()=>s(a)},a.id)})}):r.jsx(pt,{children:o("common.emptyData")})}const mn=k(b)`
|
|
113
|
-
cursor: pointer;
|
|
114
|
-
|
|
115
|
-
.notification {
|
|
116
|
-
width: calc(100% - 50px);
|
|
117
|
-
|
|
118
|
-
.title {
|
|
119
|
-
min-width: 0;
|
|
120
|
-
overflow: hidden;
|
|
121
|
-
text-overflow: ellipsis;
|
|
122
|
-
white-space: nowrap;
|
|
123
|
-
color: rgba(3, 7, 18, 1);
|
|
124
|
-
font-size: 16px;
|
|
125
|
-
}
|
|
126
|
-
.link {
|
|
127
|
-
color: rgba(59, 130, 246, 1);
|
|
128
|
-
font-size: 14px;
|
|
129
|
-
text-decoration: none;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
`;He.propTypes={paging:p.objectOf(p.any).isRequired,loading:p.bool.isRequired,onChange:p.func.isRequired};function He({loading:e,paging:t,onChange:s}){const{t:n}=h.useContext(D);if(t.pageCount<=0)return null;const o=(l,u)=>{s({page:u+1})},i=l=>{const u=Number(l.target.value);s({page:1,pageSize:u})},a=t.page-1<=0?0:t.page-1;return r.jsx(b,{mt:2,display:"flex",justifyContent:"flex-end",children:r.jsx(Ze,{disabled:e,count:t.total,page:a,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:l,to:u,count:m})=>`${l}–${u} / ${m!==-1?m:`${n()}more than ${u}`}`,rowsPerPage:t.pageSize,onPageChange:o,onRowsPerPageChange:i})})}const xn=h.memo(He);Ue.propTypes={selectedId:p.string,blockletMap:p.object,onSelectChange:p.func,loading:p.bool,filterType:p.oneOf(["component","entity"])};const gn=k.div`
|
|
133
|
-
display: flex;
|
|
134
|
-
justify-items: flex-start;
|
|
135
|
-
align-items: center;
|
|
136
|
-
gap: 8px;
|
|
137
|
-
.name {
|
|
138
|
-
display: block;
|
|
139
|
-
max-width: 260px;
|
|
140
|
-
white-space: nowrap;
|
|
141
|
-
overflow: hidden;
|
|
142
|
-
text-overflow: ellipsis;
|
|
143
|
-
}
|
|
144
|
-
`;function Ue({selectedId:e="",filterType:t="component",blockletMap:s=new Map,onSelectChange:n=()=>{},loading:o=!1}){const[i,a]=h.useState(""),{t:l}=h.useContext(D),u=d=>{if(o)return;const c=d.target.value;n(c==="all"?"":c)},m=h.useMemo(()=>{if(!s.size)return[];const d=[];return Array.from(s).forEach(([,c])=>{var C,T;const x=c.did||((C=c.meta)==null?void 0:C.did),g=c.title||((T=c.meta)==null?void 0:T.title)||"",v=c.appPid||c.appDid,j=g.toLowerCase().includes(i.toLowerCase());(t==="component"&&v!==x&&j||t==="entity"&&v===x&&j)&&d.push(c)}),d},[s,i,t]),f=h.useMemo(()=>{var c;const d=m.find(x=>{var g;return(x.did||((g=x.meta)==null?void 0:g.did))===e});return(d==null?void 0:d.did)||((c=d==null?void 0:d.meta)==null?void 0:c.did)||"all"},[m,e]);return s.size?r.jsxs(et,{sx:{minWidth:240,maxWidth:300},children:[r.jsx(tt,{id:"demo-simple-select-label",children:"Sender"}),r.jsxs(nt,{MenuProps:{autoFocus:!1},value:f,onChange:u,onClose:()=>a(""),size:"small",label:"Sender",variant:"outlined",children:[r.jsx(rt,{children:r.jsx(st,{autoFocus:!0,value:i,placeholder:"Search",variant:"outlined",size:"small",fullWidth:!0,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key!=="Escape"&&d.stopPropagation()}})}),r.jsx(me,{value:"all",children:l("common.all")}),m.map(d=>{var g,v;const c=d.did||((g=d.meta)==null?void 0:g.did),x=d.title||((v=d.meta)==null?void 0:v.title);return r.jsx(me,{value:c,children:r.jsxs(gn,{children:[r.jsx(Ce,{size:24,blocklet:d,ancestors:d.ancestors}),r.jsx("span",{className:"name",children:x})]})},c)})]})]}):null}const yn=h.memo(Ue),bn=k.div`
|
|
145
|
-
.MuiContainer-root {
|
|
146
|
-
padding-right: 0;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.profile-button.MuiButtonBase-root {
|
|
150
|
-
border-radius: 9999px;
|
|
151
|
-
margin-right: 2px;
|
|
152
|
-
color: #4b5563;
|
|
153
|
-
padding: 5px 12px;
|
|
154
|
-
line-height: 22px;
|
|
155
|
-
font-size: 13px;
|
|
156
|
-
border: 1px solid transparent;
|
|
157
|
-
}
|
|
158
|
-
.profile-button.active.MuiButtonBase-root {
|
|
159
|
-
background-color: #ffffff;
|
|
160
|
-
color: #030712;
|
|
161
|
-
border: 1px solid #e5e7eb !important;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.profile-line-button.MuiButtonBase-root {
|
|
165
|
-
margin-right: 2px;
|
|
166
|
-
color: #4b5563;
|
|
167
|
-
padding: 5px 12px;
|
|
168
|
-
line-height: 22px;
|
|
169
|
-
font-size: 13px;
|
|
170
|
-
border: none !important;
|
|
171
|
-
border-radius: 0;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.profile-line-button.active.MuiButtonBase-root {
|
|
175
|
-
color: rgba(3, 7, 18, 1);
|
|
176
|
-
border-bottom: 1px solid rgba(3, 7, 18, 1) !important;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.profile-button.MuiButtonBase-root:last-of-type,
|
|
180
|
-
.profile-line-button.MuiButtonBase-root {
|
|
181
|
-
margin-right: 0;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.profile-button.MuiButtonBase-root:hover {
|
|
185
|
-
background-color: #ffffff;
|
|
186
|
-
color: #030712;
|
|
187
|
-
border: 1px solid #e5e7eb;
|
|
188
|
-
}
|
|
189
|
-
.profile-line-button.MuiButtonBase-root:hover {
|
|
190
|
-
color: rgba(3, 7, 18, 1);
|
|
191
|
-
background-color: unset;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
* {
|
|
195
|
-
scrollbar-width: none; /* Firefox */
|
|
196
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
*::-webkit-scrollbar {
|
|
200
|
-
display: none; /* Chrome, Safari and Opera */
|
|
201
|
-
}
|
|
202
|
-
`;ze.propTypes={blocklets:p.array,context:p.object,pagination:p.bool,inDialog:p.bool,filterType:p.oneOf(["component","entity"]),toViewAll:p.func,tabType:p.oneOf(["button","line"]),enableMarkAllAsRead:p.bool};function ze({blocklets:e=[],context:t,pagination:s=!0,tabType:n="button",inDialog:o=!1,filterType:i="component",toViewAll:a=()=>{},enableMarkAllAsRead:l=!1}){const{data:u,paging:m,refresh:f,loading:d,params:c,onReadNotification:x,unReadCount:g,componentDids:v}=t,j=w=>{f({...c,severity:w,paging:{...c.paging,page:1}})},{t:C}=h.useContext(D),[T,ce]=h.useState(!1),Be=async()=>{ce(!0),t.makeAllAsRead&&typeof t.makeAllAsRead=="function"&&await t.makeAllAsRead(),ce(!1)},de=h.useCallback(w=>{const{blocklet:y={}}=window,E=[y==null?void 0:y.did,...((y==null?void 0:y.ancestors)||[]).map(N=>N)];return(v==null?void 0:v.includes(w))||E.findIndex(N=>N===w)>-1},[v]),pe=h.useMemo(()=>{const w=new Map;return e.length&&e.forEach(y=>{var N,ue,fe;const E=(y==null?void 0:y.did)||((N=y.meta)==null?void 0:N.did);E&&!w.has(E)&&(y.ancestors=[],w.set(E,y),((ue=y==null?void 0:y.alsoKnownAs)==null?void 0:ue.length)>0&&y.alsoKnownAs.forEach(L=>{w.has(L)||w.set(L,y)})),((fe=y==null?void 0:y.children)==null?void 0:fe.length)>0&&y.children.forEach(L=>{var he;const H=(L==null?void 0:L.did)||((he=L.meta)==null?void 0:he.did);H&&!w.has(H)&&de(H)&&(L.ancestors=[y],w.set(H,L))})}),w},[e,de]),We=w=>{f({...c,paging:{...c.paging,...w}})},Fe=w=>{var y,E;!w||(E=(y=w.receivers)==null?void 0:y[0])!=null&&E.read||x(w.id).then(()=>{o&&a()})},qe=w=>{if(d)return;let y={};i==="component"?y={entityId:"",componentDid:w}:i==="entity"&&(y={componentDid:"",entityId:w}),f({...c,...y,paging:{...c.paging,page:1}})},Ke=W(()=>i==="component"?c.componentDid||"":i==="entity"&&c.entityId||"",[c,i]);return r.jsxs(bn,{children:[r.jsx(Se,{currentTab:c.severity,type:n,theme:"light",onSelectType:j,extra:o?null:[g>0&&l&&r.jsxs(V,{disabled:T||d,onClick:Be,sx:{ml:"auto"},children:[T&&r.jsx(xe,{size:16,style:{marginRight:"1em"}}),C("notification.markAllAsRead")]},"make-all-read"),r.jsx(yn,{onSelectChange:qe,selectedId:Ke,filterType:i,blockletMap:pe,loading:d},"component-filter")]}),d?r.jsx(b,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:r.jsx(xe,{sx:{color:"#4598fa"}})}):r.jsx(De,{data:u,blockletMap:pe,onReadNotification:Fe,inDialog:o}),s?r.jsx(xn,{loading:d,paging:m,onChange:We}):null]})}const vn=h.memo(ze);function Mn(){const t=mt().tab,{t:s}=Z(),n=jt(),{makeAllAsRead:o}=n,i=W(()=>{var a;return{...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:(a=window==null?void 0:window.blocklet)==null?void 0:a.componentMountPoints.map(l=>({...l,meta:{...l,did:l.did,name:l.name||l.title||"",logo:"logo.png"}}))}});return h.useEffect(()=>{t==="notifications"&&o&&o()},[t,o]),r.jsxs(r.Fragment,{children:[r.jsx(ut,{children:r.jsx("title",{children:s("pageTitle.userCenter")})}),r.jsx(ft,{currentTab:t?xt(ht.WELLKNOWN_SERVICE_PATH_PREFIX,"user",t):"",disableAutoRedirect:t==="settings",children:t==="notifications"?r.jsx(vn,{blocklets:[i],context:n}):null})]})}export{Mn as default};
|