@abtnode/blocklet-services 1.16.18-beta-7aa6be5a → 1.16.18-beta-bb4ebacc
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/index.js +2 -7
- package/api/libs/connect/session.js +45 -33
- package/api/middlewares/check-running.js +1 -1
- package/api/routes/blocklet.js +18 -0
- package/api/routes/env.js +4 -2
- package/api/routes/federated.js +10 -9
- package/api/routes/oauth.js +79 -60
- package/api/routes/user-session.js +23 -16
- package/api/routes/user.js +160 -22
- package/api/services/auth/connect/invite.js +21 -12
- package/api/services/auth/index.js +77 -13
- package/api/services/auth/session.js +48 -1
- package/api/services/notification/blocklet-events-notifier.js +1 -0
- package/api/socket/channel/component.js +6 -5
- package/api/socket/channel/did.js +51 -20
- package/api/socket/util.js +1 -0
- package/api/util/federated.js +13 -12
- package/api/validators/login.js +12 -0
- package/build/asset-manifest.json +144 -112
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/service-worker.js.map +1 -1
- package/build/static/css/{807.65f26433.chunk.css → 1233.dba37e64.chunk.css} +1 -1
- package/build/static/js/1.138935fc.chunk.js +2 -0
- package/build/static/js/{1148.4b2a7347.chunk.js → 1148.5ccba08e.chunk.js} +2 -2
- package/build/static/js/1233.276cf2d0.chunk.js +3 -0
- package/build/static/js/1233.276cf2d0.chunk.js.LICENSE.txt +23 -0
- package/build/static/js/{2291.7ffdc7df.chunk.js → 2291.37b0ad3a.chunk.js} +2 -2
- package/build/static/js/2653.980158ea.chunk.js +2 -0
- package/build/static/js/2664.da443f31.chunk.js +2 -0
- package/build/static/js/2801.33d2f238.chunk.js +2 -0
- package/build/static/js/{2838.fcdea2fa.chunk.js → 2838.ec459fda.chunk.js} +3 -3
- package/build/static/js/2940.ce32ab3f.chunk.js +2 -0
- package/build/static/js/3025.7c99c058.chunk.js +2 -0
- package/build/static/js/{3033.6623d19d.chunk.js → 3033.9fe46d7f.chunk.js} +2 -2
- package/build/static/js/3076.28658ffc.chunk.js +2 -0
- package/build/static/js/{3131.672170fb.chunk.js → 3131.99541aca.chunk.js} +2 -2
- package/build/static/js/3430.dc830483.chunk.js +2 -0
- package/build/static/js/{3688.48e7b69c.chunk.js → 3688.679796d1.chunk.js} +2 -2
- package/build/static/js/3708.7e2ad66b.chunk.js +3 -0
- package/build/static/js/3842.e1bb702b.chunk.js +3 -0
- package/build/static/js/3953.ddf8be86.chunk.js +2 -0
- package/build/static/js/3979.f9a5aa48.chunk.js +3 -0
- package/build/static/js/{807.249d2d01.chunk.js.LICENSE.txt → 3979.f9a5aa48.chunk.js.LICENSE.txt} +0 -18
- package/build/static/js/3994.e53e7ce2.chunk.js +2 -0
- package/build/static/js/4009.65d1c083.chunk.js +2 -0
- package/build/static/js/{4023.1658794f.chunk.js → 4023.5fe8180a.chunk.js} +2 -2
- package/build/static/js/4076.5ca97365.chunk.js +2 -0
- package/build/static/js/4160.e45b5ba1.chunk.js +2 -0
- package/build/static/js/{4319.8d9e189e.chunk.js → 4319.9f120992.chunk.js} +2 -2
- package/build/static/js/4461.26253c6a.chunk.js +2 -0
- package/build/static/js/4587.9a042d46.chunk.js +2 -0
- package/build/static/js/4802.217e3956.chunk.js +2 -0
- package/build/static/js/4882.0435e418.chunk.js +2 -0
- package/build/static/js/5070.31a74ba7.chunk.js +2 -0
- package/build/static/js/5468.b54ce65b.chunk.js +2 -0
- package/build/static/js/5547.d68bfde3.chunk.js +3 -0
- package/build/static/js/556.e1875260.chunk.js +3 -0
- package/build/static/js/{5683.47011724.chunk.js → 5683.051a03c1.chunk.js} +2 -2
- package/build/static/js/6032.1001afd3.chunk.js +2 -0
- package/build/static/js/6139.161b2e7f.chunk.js +2 -0
- package/build/static/js/6218.9a4feced.chunk.js +2 -0
- package/build/static/js/655.cdee65b4.chunk.js +2 -0
- package/build/static/js/{6658.090d923f.chunk.js → 6658.98f9956d.chunk.js} +2 -2
- package/build/static/js/{6771.a1510398.chunk.js → 6771.920fa5b6.chunk.js} +3 -3
- package/build/static/js/7006.bb90b167.chunk.js +2 -0
- package/build/static/js/{716.9c76ad65.chunk.js → 716.e68425d7.chunk.js} +3 -3
- package/build/static/js/716.e68425d7.chunk.js.LICENSE.txt +5 -0
- package/build/static/js/7305.465df4a1.chunk.js +2 -0
- package/build/static/js/7313.b53b59d8.chunk.js +2 -0
- package/build/static/js/779.73350f02.chunk.js +2 -0
- package/build/static/js/{7832.741ac84f.chunk.js → 7832.81aaf011.chunk.js} +2 -2
- package/build/static/js/7858.52930f63.chunk.js +2 -0
- package/build/static/js/8016.3ef64a2c.chunk.js +2 -0
- package/build/static/js/8181.6c2a7dcb.chunk.js +2 -0
- package/build/static/js/8393.ea7ef05d.chunk.js +2 -0
- package/build/static/js/840.5bc210dd.chunk.js +2 -0
- package/build/static/js/8604.ece06cf7.chunk.js +3 -0
- package/build/static/js/{8622.f9639db9.chunk.js → 8622.ebd44812.chunk.js} +2 -2
- package/build/static/js/{8641.506d61d5.chunk.js → 8641.bec13444.chunk.js} +2 -2
- package/build/static/js/8702.bb84d009.chunk.js +2 -0
- package/build/static/js/{8792.8b009f81.chunk.js → 8792.0f55707c.chunk.js} +2 -2
- package/build/static/js/8944.559ade67.chunk.js +2 -0
- package/build/static/js/9017.56c20b17.chunk.js +2 -0
- package/build/static/js/9033.ebf65926.chunk.js +2 -0
- package/build/static/js/9107.7f32925d.chunk.js +2 -0
- package/build/static/js/9314.f0add972.chunk.js +2 -0
- package/build/static/js/9582.2c539fcf.chunk.js +2 -0
- package/build/static/js/{9596.5251398b.chunk.js → 9596.a4eead04.chunk.js} +2 -2
- package/build/static/js/9865.d5dfa72b.chunk.js +2 -0
- package/build/static/js/{9900.cce3f786.chunk.js → 9900.3b72165e.chunk.js} +2 -2
- package/build/static/js/9996.5545ea26.chunk.js +2 -0
- package/build/static/js/main.36b0deea.js +3 -0
- package/build/static/js/{main.50d5cec4.js.LICENSE.txt → main.36b0deea.js.LICENSE.txt} +1 -1
- package/package.json +38 -37
- package/build/static/js/1431.29b0bc0a.chunk.js +0 -3
- package/build/static/js/2093.3ce9b59d.chunk.js +0 -3
- package/build/static/js/2653.6610534f.chunk.js +0 -2
- package/build/static/js/2686.890b32ed.chunk.js +0 -2
- package/build/static/js/2972.2d5268c3.chunk.js +0 -2
- package/build/static/js/3025.a48c96f5.chunk.js +0 -2
- package/build/static/js/3038.40d611d1.chunk.js +0 -2
- package/build/static/js/3490.4d3a51ea.chunk.js +0 -2
- package/build/static/js/4022.5ec79b56.chunk.js +0 -2
- package/build/static/js/4076.bcc72fcc.chunk.js +0 -2
- package/build/static/js/4461.f412553b.chunk.js +0 -2
- package/build/static/js/4587.906e3023.chunk.js +0 -2
- package/build/static/js/4716.a8a5b75d.chunk.js +0 -2
- package/build/static/js/4764.51208c0d.chunk.js +0 -2
- package/build/static/js/4802.fe56c787.chunk.js +0 -2
- package/build/static/js/5465.dd0f7a20.chunk.js +0 -2
- package/build/static/js/5547.5a341867.chunk.js +0 -3
- package/build/static/js/5662.03f06ae0.chunk.js +0 -2
- package/build/static/js/5673.0dd67df6.chunk.js +0 -2
- package/build/static/js/5960.35db200d.chunk.js +0 -2
- package/build/static/js/6139.cabc22a2.chunk.js +0 -2
- package/build/static/js/6498.698608f8.chunk.js +0 -2
- package/build/static/js/6868.881bd141.chunk.js +0 -2
- package/build/static/js/7006.8f0645e5.chunk.js +0 -2
- package/build/static/js/7050.3281ad5f.chunk.js +0 -2
- package/build/static/js/7367.15383006.chunk.js +0 -2
- package/build/static/js/779.b64e7db1.chunk.js +0 -2
- package/build/static/js/7858.e4167dfd.chunk.js +0 -2
- package/build/static/js/807.249d2d01.chunk.js +0 -3
- package/build/static/js/8604.a8ef404e.chunk.js +0 -3
- package/build/static/js/8702.2d858942.chunk.js +0 -2
- package/build/static/js/8944.2d60df14.chunk.js +0 -2
- package/build/static/js/main.50d5cec4.js +0 -3
- /package/build/static/js/{2838.fcdea2fa.chunk.js.LICENSE.txt → 2838.ec459fda.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2093.3ce9b59d.chunk.js.LICENSE.txt → 3708.7e2ad66b.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{716.9c76ad65.chunk.js.LICENSE.txt → 3842.e1bb702b.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5547.5a341867.chunk.js.LICENSE.txt → 5547.d68bfde3.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1431.29b0bc0a.chunk.js.LICENSE.txt → 556.e1875260.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{6771.a1510398.chunk.js.LICENSE.txt → 6771.920fa5b6.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{8604.a8ef404e.chunk.js.LICENSE.txt → 8604.ece06cf7.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[4587],{34587:function(n,e,t){t.r(e),t.d(e,{default:function(){return K}});var r,o,i,a,s=t(71171),l=t(32723),d=t(34795),c=t(33028),p=t(96234),u=t(59740),h=t(30969),f=t(86822),x=t(16380),m=t(54470),g=t(38361),v=t(8825),b=t(60680),w=t(46672),Z=t(19638),j=t(29996),k=t(26022),y=t(1986),_=t(62399),N=t(36558),S=t(12268),I=t(238),z=t(59505),C=t(94308),P=t(75255),E=t(47650),L=t(7017),M=t(20244),R=t(99574),T=t(24891),D=t(83364),W=t(99042),B=t(48952),H=t(4485),U=t(38507),O=t(37574),A=["appInfo"];function F(n){var e=n.appInfo,t=(0,u.Z)(n,A),r=(0,h.useState)(!1),o=(0,p.Z)(r,2),i=o[0],a=o[1],s=(0,P.Z)((function(n){return n.breakpoints.down("md")}))?32:48;return i?(0,O.jsx)(_.Z,{did:e.publisher,size:s}):(0,O.jsx)(S.Z,(0,c.Z)((0,c.Z)({src:e.icon,alt:e.title,width:s,height:s},t),{},{onError:function(){return a(!0)}}))}var V=function(n,e){return(0,L.findComponentByIdV2)(n,e)||n};function K(){var n,e,t,r=(0,k.PE)(),o=r.t,i=r.locale,a=(0,h.useState)(null),s=(0,p.Z)(a,2),c=s[0],u=s[1],x=(0,h.useState)(null),w=(0,p.Z)(x,2),_=w[0],S=w[1],A=(0,h.useState)(!1),K=(0,p.Z)(A,2),Q=K[0],Y=K[1],$=(0,h.useState)(!1),nn=(0,p.Z)($,2),en=nn[0],tn=nn[1],rn=(0,P.Z)((function(n){return n.breakpoints.down("md")})),on=new URL(window.location.href),an=on.searchParams.get("componentId"),sn=function(){var n=on.searchParams.get("redirect")||"/";window.location=decodeURIComponent(n)},ln=function(){var n=setInterval((function(){W.Z.get("/blocklet/detail").then((function(e){var t=e.data,r=V(t,an);"running"!==r.status?"starting"!==r.status&&(tn(!1),u(t),t!==r&&S(r),clearInterval(n)):sn()})).catch((function(n){Y(!1),y.Z.error(n.message)}))}),3e3)};(0,h.useEffect)((function(){Y(!0),W.Z.get("/blocklet/detail").then(function(){var n=(0,d.Z)((0,l.Z)().mark((function n(e){var t,r,o;return(0,l.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.data,r=V(t,an),!(o=t.controller)){n.next=7;break}return n.next=6,(0,T.Nh)(o.chainHost,o.nftId);case 6:t.nftState=n.sent;case 7:if(Y(!1),"running"!==r.status){n.next=11;break}return sn(),n.abrupt("return");case 11:u(t),t!==r&&S(r),"starting"===r.status&&(tn(!0),ln());case 14:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()).catch((function(n){Y(!1),y.Z.error(n.message)}))}),[]);var dn=(0,h.useCallback)((function(){Y(!0),tn(!0);var n={did:c.meta.did};_&&(n.componentDids=[_.meta.did]),B.Z.startBlocklet({input:n}).then((function(){ln()})).catch((function(n){y.Z.error(n.message),Y(!1),tn(!1)}))}),[_,c]);if(!c)return(0,O.jsx)(I.Z,{children:(0,O.jsx)(C.Z,{})});var cn={icon:"".concat(M.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),title:(0,L.getDisplayName)(c),publisher:c.appDid},pn=localStorage.getItem("blocklet-server-url");return(0,O.jsxs)(X,{children:[(0,O.jsx)(m.Global,{styles:q}),(0,O.jsxs)("header",{className:"root-header",children:[!rn&&(0,O.jsx)("div",{className:"left",children:(0,O.jsx)(E.Z,{width:"128",height:"48",onClick:function(){pn&&window.open(pn)},style:{cursor:pn?"pointer":""}})}),(0,O.jsx)("div",{className:"right",children:(0,O.jsx)(R.Z,{SessionContext:H.B3})})]}),(0,O.jsxs)(G,{elevation:0,children:[(0,O.jsxs)(J,{children:[(0,O.jsx)(F,{appInfo:cn}),(0,O.jsxs)("div",{className:"app-info_content",children:[(0,O.jsx)(g.Z,{className:"app-info_name",children:cn.title}),(0,O.jsx)(N.Z,{size:14,className:"app-info_did",did:cn.publisher})]})]}),(null===c||void 0===c||null===(n=c.controller)||void 0===n||null===(e=n.status)||void 0===e?void 0:e.value)!==z.BLOCKLET_CONTROLLER_STATUS.suspended&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(g.Z,{className:"title-box",children:[(0,O.jsx)(g.Z,{className:"icon",children:(0,O.jsx)(v.Z,{})}),(0,O.jsx)(g.Z,{className:"title",children:o("blocklet.startApplication")})]}),(0,O.jsx)(g.Z,{className:"sub-title",children:o("blocklet.startDescription",{name:_?(0,L.getDisplayName)(_,!0):(0,L.getDisplayName)(c)})}),(0,O.jsx)(g.Z,{mt:8,children:(0,O.jsx)(j.Z,{style:{minWidth:200},disabled:Q||en,variant:"contained",color:"primary",size:"large",loading:en,onClick:function(){return dn()},children:o(en?"blocklet.starting":"blocklet.start")})})]}),(0,U.xp)(null===c||void 0===c?void 0:c.controller,null===c||void 0===c?void 0:c.nftState)&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(g.Z,{className:"title-box",children:[(0,O.jsx)(b.Z,{className:"icon-error"}),(0,O.jsx)(g.Z,{className:"title error",children:o("blocklet.suspended")})]}),(0,O.jsx)(g.Z,{className:"sub-title",children:o("blocklet.redemptionTip",{deadline:(0,U.a7)((0,D.getNftExpirationDate)(c.nftState),i)})}),(0,O.jsx)(g.Z,{mt:8,children:(0,O.jsx)(j.Z,{component:Z.Z,style:{minWidth:200},variant:"contained",color:"primary",size:"large",href:(0,T.Hz)({nftState:c.nftState,nftId:null===(t=c.nftState)||void 0===t?void 0:t.address,locale:i}),children:o("common.renew")})})]}),(0,O.jsx)(g.Z,{mt:5,children:(0,O.jsx)(f.rU,{className:"footer-link",to:"".concat(M.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/overview"),children:o("blocklet.dashboard")})})]})]})}var q=(0,m.css)(r||(r=(0,s.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),X=x.Z.div(o||(o=(0,s.Z)(["\n width: 100vw;\n height: 100%;\n background: #f6f8fa;\n display: flex;\n justify-content: center;\n align-items: center;\n\n .root-header {\n position: fixed;\n z-index: 200;\n top: 0;\n display: flex;\n width: 100%;\n height: 68px;\n align-items: center;\n justify-content: flex-end;\n padding: 24px;\n max-width: 1245px;\n\n "," {\n padding: 14px 16px;\n height: 56px;\n }\n\n .left {\n margin-top: 4px;\n margin-right: auto;\n "," {\n margin-top: 0%;\n }\n }\n\n .right {\n display: flex;\n align-items: center;\n "," {\n button,\n a {\n padding-left: 8px;\n padding-right: 8px;\n }\n }\n }\n }\n"])),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.breakpoints.down("md")})),G=(0,x.Z)(w.Z)(i||(i=(0,s.Z)(["\n width: 80vw;\n max-width: 1245px;\n height: 80vh;\n box-sizing: border-box;\n padding: 32px;\n &.MuiPaper-rounded {\n border-radius: 8px;\n }\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n\n "," {\n width: 100vw;\n height: 100%;\n left: 0;\n top: 0;\n padding: 32px 0;\n }\n\n .MuiIconButton-root {\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n\n .title-box {\n display: flex;\n align-items: center;\n "," {\n margin-top: 60px;\n }\n }\n\n .icon {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n background-color: ",";\n color: ",";\n }\n\n .icon-error {\n width: 32px;\n height: 32px;\n color: ",";\n }\n\n .title {\n margin-left: 12px;\n color: ",";\n font-size: 24px;\n font-weight: bolder;\n }\n\n .error {\n color: ",";\n }\n\n .sub-title {\n margin-top: 24px;\n color: ",";\n font-size: 16px;\n max-width: 360px;\n word-break: break-word;\n hyphens: auto;\n\n "," {\n padding: 0 32px;\n }\n }\n\n .footer-link {\n color: ",";\n }\n"])),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.palette.primary.main}),(function(n){return n.theme.palette.common.white}),(function(n){return n.theme.palette.error.main}),(function(n){return n.theme.palette.primary.main}),(function(n){return n.theme.palette.error.main}),(function(n){return n.theme.palette.grey[700]}),(function(n){return n.theme.breakpoints.down("md")}),(function(n){return n.theme.palette.primary.main})),J=x.Z.div(a||(a=(0,s.Z)(["\n display: flex;\n align-items: center;\n position: absolute;\n left: 24px;\n right: 24px;\n top: 24px;\n font-size: 16px;\n font-weight: 500;\n color: #222;\n\n /* \u7981\u6b62 app icon shrink */\n > *:first-child {\n flex: 0 0 auto;\n }\n\n .app-info_content {\n padding-left: 16px;\n overflow: hidden;\n }\n\n .app-info_name {\n max-width: 100%;\n padding-right: 32px;\n line-height: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: bold;\n }\n\n .app-info_did {\n transform: translate(0, 2px);\n }\n\n .app-info_did .did-address__text {\n color: #666;\n font-size: 14px;\n }\n\n "," {\n top: 12px;\n .app-info_did {\n transform: translate(0, 0);\n }\n .app-info_did .did-address__text {\n font-size: 12px;\n }\n }\n"])),(function(n){return n.theme.breakpoints.down("md")}))},36558:function(n,e,t){var r=t(33028),o=t(59740),i=t(24974),a=t.n(i),s=t(86822),l=t(19638),d=t(23586),c=t(37574),p=["did","href","external","avatarProps"];function u(n){var e=n.did,t=n.href,i=n.external,a=(n.avatarProps,(0,o.Z)(n,p)),u=(0,c.jsx)(d.Z,(0,r.Z)({did:e},a));return t?i?(0,c.jsx)(l.Z,{target:"_blank",href:t,underline:"hover",children:u}):(0,c.jsx)(s.rU,{to:t,children:u}):u}u.propTypes={did:a().string.isRequired,to:a().string,href:a().string,avatarProps:a().object,external:a().bool},u.defaultProps={to:"",href:"",avatarProps:{},external:!1},e.Z=u},99574:function(n,e,t){t.d(e,{Z:function(){return v}});var r,o=t(71171),i=t(33028),a=t(30969),s=t(16380),l=t(24974),d=t.n(l),c=t(94551),p=t(30734),u=t(87843),h=t(26681),f=t(26022),x=t(46513),m=t(91077),g=t(37574);function v(n){var e=n.SessionContext,t=n.extraItems,r=n.showLocale,o=n.showHelper,s=n.showSessionManager,l=n.sessionManagerProps,d=(0,a.useContext)(e).session,v=(0,a.useContext)(f.RD).locale,w=(0,p.useLocation)(),Z={"/store":{endpoint:"https://store.blocklet.io"},"/dashboard":{path:"/conceptual/overview"},"/settings/router":{path:"/conceptual/server-architecture"}};return(0,g.jsxs)(b,{children:[t.map((function(n,e){return(0,a.cloneElement)(n,{key:e})})),r&&(0,g.jsx)(h.Z,{"data-cy":"locale-addon",icon:x.Z,size:23,showText:!1,className:"locale-addon"}),o&&(0,g.jsx)(c.Z,{onClick:function(){var n=w.pathname,e={};n.indexOf("/store")>-1?e=Z["/store"]:Z[n]&&(e=Z[n]),window.open("".concat(e.endpoint||"https://developer.blocklet.io/docs","/").concat(v).concat(e.path||""),"_blank")},children:(0,g.jsx)(m.Z,{})}),s&&(0,g.jsx)(u.Z,(0,i.Z)((0,i.Z)({locale:v,session:d,size:24,showRole:!0},l),{},{showManageBlocklet:!1}))]})}v.propTypes={SessionContext:d().object.isRequired,webWalletUrl:d().string,extraItems:d().array,showLocale:d().bool,showSessionManager:d().bool,showHelper:d().bool,sessionManagerProps:d().object},v.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};var b=s.Z.div(r||(r=(0,o.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n .MuiIconButton-root svg {\n width: 26px;\n height: 26px;\n }\n\n .user-addon {\n .user-avatar {\n width: 28px;\n border-radius: 14px;\n height: auto;\n }\n }\n\n "," {\n > button,\n > a {\n padding-left: 8px;\n padding-right: 8px;\n }\n }\n"])),(function(n){return n.theme.breakpoints.down("md")}))},60680:function(n,e,t){var r=t(71600);e.Z=void 0;var o=r(t(48035)),i=t(37574),a=(0,o.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");e.Z=a},8825:function(n,e,t){var r=t(71600);e.Z=void 0;var o=r(t(48035)),i=t(37574),a=(0,o.default)((0,i.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");e.Z=a}}]);
|
|
2
|
+
//# sourceMappingURL=4587.9a042d46.chunk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[4802],{70998:function(e,n,t){t.d(n,{Z:function(){return x}});var r=t(33028),i=t(59740),o=t(24974),a=t.n(o),l=t(59467),s=t(62399),c=t(19611),d=t.n(c),u=t(20244),f=t(41395),p=t(24891);var m=t(37574),h=["blocklet","style","size","ancestors"];function x(e){var n=e.blocklet,t=e.style,o=e.size,a=e.ancestors,c=(0,i.Z)(e,h),x=(0,f.h6)(),g=function(e){var n,t=e.blocklet,r=e.ancestors,i=void 0===r?[]:r,o=(0,f.h6)(),a=o.inService,l="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,p.XN)(null===t||void 0===t?void 0:t.status)?"~":""),s=a?d()(p.zn,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",l):d()(o.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)s=d()(t.deployedFrom,(0,p.lk)(t.meta.bundleDid,t.meta.logo),l);else{var c=window.env.apiPrefix||"/",m=i.concat(t),h=a?m.slice(1):m;s=d()(c,"/blocklet/logo-bundle".concat(h.map((function(e){return"/".concat(e.meta.did)})).join("")),l)}return{logoUrl:s,inService:a}}({blocklet:n,ancestors:a}),Z=g.logoUrl,v=g.inService,b=c.variant,j=v?function(){}:function(e){e.target.src="".concat(x.imgPrefix,"/blocklet.png")},y=(0,m.jsx)("img",{src:Z,onError:j,alt:n.meta.name,style:{width:o}});return n.meta.logo||(y=(0,m.jsx)(s.Z,{did:n.meta.did||"",responsive:!0})),(0,m.jsx)(l.Z,(0,r.Z)((0,r.Z)({variant:b||"square",style:Object.assign({backgroundColor:"transparent",width:o,height:o,borderRadius:10},t)},c),{},{children:y}))}x.propTypes={blocklet:a().object.isRequired,style:a().object,size:a().oneOfType([a().number,a().string]),ancestors:a().array},x.defaultProps={style:{},size:40,ancestors:[]}},2569:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(24974),i=t.n(r),o=t(38361),a=t(37574);function l(e){var n=e.depth;return(0,a.jsx)(o.Z,{ml:Math.max(2*(n-1),0),sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}l.propTypes={depth:i().number},l.defaultProps={depth:1}},92746:function(e,n,t){var r,i=t(71171),o=t(33028),a=t(59740),l=t(16380),s=t(50442),c=t(37574),d=["labelProps","className","style"];function u(e){var n=e.labelProps,t=e.className,r=e.style,i=(0,a.Z)(e,d),l=(0,o.Z)((0,o.Z)({},n),{},{labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"});return(0,c.jsx)(f,{className:t,style:r,children:(0,c.jsx)(s.Z,(0,o.Z)({labelProps:l},i))})}u.propTypes=s.Z.propTypes,u.defaultProps=s.Z.defaultProps;var f=l.Z.div(r||(r=(0,i.Z)(["\n max-width: 300px;\n > label {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n "," {\n max-width: 100%;\n }\n"])),(function(e){return e.theme.breakpoints.down("sm")}));n.Z=u},21802:function(e,n,t){t.d(n,{Z:function(){return b}});var r,i=t(71171),o=t(30969),a=t(24974),l=t.n(a),s=t(19611),c=t.n(s),d=t(16380),u=t(61398),f=t.n(u),p=t(38361),m=t(65667),h=t.n(m),x=t(26022),g=t(37574),Z=(0,o.lazy)((function(){return Promise.all([t.e(4917),t.e(5547)]).then(t.bind(t,25547)).then((function(e){return{default:e.Uploader}}))})),v="/blocklet/logo/upload";function b(e){var n=e.url,t=e.height,r=e.width,i=e.enabled,a=e.type,l=e.did,s=e.prefix,d=e.headers,u=e.onUploaded,f=(0,x.PE)().t,m=(0,o.useRef)(null),b={cursor:i?"pointer":"default","&::after":{content:'"'.concat(f("common.switch"),'"')}};return(0,g.jsxs)(j,{id:"uploader-".concat(l,"-").concat(a),children:[(0,g.jsx)(Z,{ref:m,popup:!0,onUploadFinish:function(){var e;u(),null===(e=m.current)||void 0===e||e.close()},plugins:["ImageEditor"],apiPathProps:{uploader:c()(s,v,a,l),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,g.jsx)(p.Z,{className:h()("uploader-wrapper",i&&"enabled"),sx:b,onClick:function(){var e;null===(e=m.current)||void 0===e||e.open()},children:(0,g.jsx)("img",{alt:"Logo",src:n,style:{height:t,width:r}})})]},"uploader-".concat(l,"-").concat(a))}b.propTypes={url:l().string.isRequired,type:l().oneOf(["square","rect","favicon"]).isRequired,did:l().string.isRequired,prefix:l().string.isRequired,headers:l().func,onUploaded:l().func,height:l().number,width:l().any,enabled:l().bool},b.defaultProps={height:80,width:"auto",enabled:!0,headers:function(){return{}},onUploaded:f()};var j=d.Z.div(r||(r=(0,i.Z)(["\n .uploader-wrapper {\n display: inline-flex;\n position: relative;\n font-size: 0px;\n &.enabled {\n cursor: pointer;\n }\n &::after {\n display: none;\n }\n &.enabled::after {\n display: block;\n opacity: 0;\n position: absolute;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n left: 0;\n right: 0;\n height: 2.2em;\n color: white;\n text-align: center;\n font-size: 12px;\n line-height: 2em;\n transition: opacity 0.3s ease;\n }\n &:hover::after {\n opacity: 1;\n }\n }\n"])))},121:function(e,n,t){t.r(n),t.d(n,{default:function(){return xt}});var r=t(71171),i=t(33028),o=t(96234),a=t(59740),l=t(68079),s=t(30969),c=t(16380),d=t(24974),u=t.n(d),f=t(95973),p=t(19611),m=t.n(p),h=t(20244),x=t(38361),g=t(3994),Z=t(79823),v=t(64689),b=t(99254),j=t(76527),y=t(85385),k=t(52838),C=t(23038),w=t(86822),S=t(26022),L=t(19865),E=t(7017),P=t(70998),T=t(84802),_=t(32723),A=t(34795),O=t(46292),N=t.n(O),R=t(15888),I=t.n(R),F=t(34159),B=t(75295),z=t(29996),U=t(13134),D=t(59505),K=t(1986),W=t(67019),q=t(94308),V=t(88581),G=t(27724),H=t(94551),M=t(2689),Y=t(39130),J=t(7173),Q=t(94702),X=t(98123),$=t(14458),ee=t(28412),ne=t(76934),te=t(37574),re=["label","disabled","required","initialValue","onChange","style","onSubmit","triggers","options","formatterBeforeSubmit","helperText"],ie={PaperProps:{style:{maxHeight:224,width:250}}},oe=function(e,n,t){return{fontWeight:-1===n.indexOf(e)?t.typography.fontWeightRegular:t.typography.fontWeightMedium}};function ae(e){var n=e.label,t=e.disabled,r=e.required,l=e.initialValue,c=e.onChange,d=e.style,u=e.onSubmit,f=e.triggers,p=e.options,m=e.formatterBeforeSubmit,h=e.helperText,g=(0,a.Z)(e,re),Z=(0,Q.Z)(),v=(0,s.useState)(!1),b=(0,o.Z)(v,2),j=b[0],y=b[1],k=(0,s.useState)(!1),C=(0,o.Z)(k,2),w=C[0],S=C[1],L=(0,s.useState)(l),E=(0,o.Z)(L,2),P=E[0],T=E[1],O=(0,s.useState)(P),N=(0,o.Z)(O,2),R=N[0],I=N[1],F=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(){return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(!0),e.prev=1,e.next=4,u("function"===typeof m?m(R):R);case 4:!1===e.sent?I(P):(I(R),T(R)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),I(P);case 11:return e.prev=11,S(!1),y(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),B=j?(0,te.jsx)(Y.Z,(0,i.Z)((0,i.Z)({value:R,onChange:function(e){var n=e.target.value;n="string"===typeof n?n.split(","):n,I(n),c(n)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",renderValue:function(e){return(0,te.jsx)(x.Z,{sx:{display:"flex",flexWrap:"wrap"},children:e.filter((function(e){return p.some((function(n){return n.code===e}))})).map((function(e){return(0,te.jsx)(J.Z,{label:p.find((function(n){return n.code===e})).name,style:{marginRight:8},size:"small"},e)}))})},MenuProps:ie},g),{},{children:p.map((function(e){return(0,te.jsx)(M.Z,{value:e.code,style:oe(e.code,R,Z),children:e.name},e.code)}))})):(0,te.jsx)(x.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:R.filter((function(e){return p.some((function(n){return n.code===e}))})).map((function(e){return(0,te.jsx)(J.Z,{label:p.find((function(n){return n.code===e})).name,style:{marginRight:8},size:"small"},e)}))});return(0,te.jsx)(ee.Z,{className:"form",style:d,children:(0,te.jsxs)(x.Z,{className:"form-item",children:[(0,te.jsxs)(x.Z,{className:"form-item-label",children:[n,r&&(0,te.jsx)($.Z,{})]}),(0,te.jsxs)(x.Z,{className:"form-item-body",children:[(0,te.jsx)(x.Z,{className:"form-item-input",children:B}),(0,te.jsx)(x.Z,{className:"form-item-action",children:j?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(H.Z,{"data-cy":"schema-form-item-confirm",onClick:F,disabled:t||w,size:"large",children:w?(0,te.jsx)(q.Z,{size:24}):(0,te.jsx)(G.Z,{})}),(0,te.jsx)(H.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){I(P),y(!1)},disabled:t||w,size:"large",children:(0,te.jsx)(V.default,{})})]}):(0,te.jsx)(ne.Z,{triggers:f,onEnterEdit:function(){return y(!0)},disabled:t})})]}),j&&h&&(0,te.jsx)(X.Z,{children:h})]})})}ae.propTypes={style:u().object,onSubmit:u().func,onChange:u().func,label:u().string,initialValue:u().string,required:u().bool,disabled:u().bool,triggers:u().array,options:u().array,helperText:u().string,formatterBeforeSubmit:u().func},ae.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:function(e){return e.join(",")}};var le=t(41395),se=t(24891),ce=t(19066),de=t(22572),ue=t(85710),fe=t(8479),pe=["teamDid","size"];function me(e){var n=e.teamDid,t=e.size,r=void 0===t?"small":t,l=(0,a.Z)(e,pe),c=(0,S.PE)().t,d=(0,le.h6)().api,u=(0,s.useState)(!1),f=(0,o.Z)(u,2),p=f[0],m=f[1],h=(0,s.useState)(null),x=(0,o.Z)(h,2),g=x[0],Z=x[1],v=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(){var t,r;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,m(!0),e.next=4,d.clearCache({input:{teamDid:n}});case 4:r=e.sent,K.Z.success(c("blocklet.config.clearCache.success",{count:(null===(t=r.removed)||void 0===t?void 0:t.length)||0})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),K.Z.error((0,ue.Z)(e.t0));case 11:return e.prev=11,m(!1),Z(null),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[0,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),b={title:c("blocklet.config.clearCache.title"),description:c("blocklet.config.clearCache.description"),confirm:c("common.confirm"),cancel:c("common.cancel"),onConfirm:v,onCancel:function(){m(!1),Z(null)}};return(0,te.jsxs)("div",(0,i.Z)((0,i.Z)({},l),{},{children:[(0,te.jsxs)(z.Z,{onClick:function(){return Z(b)},color:"error",variant:"outlined",size:r,children:[p?(0,te.jsx)(q.Z,{size:16,style:{marginRight:5}}):null,c("blocklet.config.clearCache.action")]}),g&&(0,te.jsx)(fe.Z,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,onConfirm:g.onConfirm,onCancel:g.onCancel})]}))}var he,xe=t(43178),ge=t(26328),Ze=t(77370),ve=t(45008);function be(e){var n=e.initialValue,t=e.onChange,r=e.disabled,i=e.loading,a=(0,S.PE)().t,l=(0,Ze.T)().api,s=(0,ve.y0)().blocklet,c=(0,xe.Z)({newAppSk:"",isConnectOpen:!1}),d=(0,o.Z)(c,2),u=d[0],f=d[1],p=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n){return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n);case 3:return e.prev=3,f({newAppSk:""}),e.finish(3);case 6:case"end":return e.stop()}}),e,null,[[0,,3,6]])})));return function(n){return e.apply(this,arguments)}}(),m=function(){return f({isConnectOpen:!1})},g=s.structVersion===h.APP_STRUCT_VERSION?[{key:"rotate-with-did-wallet",title:"Migrate with DID Wallet",handler:function(){(0,se.An)(s.status)?K.Z.error(a("blocklet.error.isRunning")):(0,E.isInProgress)(s.status)?K.Z.error(a("blocklet.error.isInProgress")):f({isConnectOpen:!0})}}]:[];return[(0,te.jsx)(W.Z,{disabled:r,loading:i,initialValue:n,onSubmit:function(e){return f({newAppSk:e}),!1},triggers:g,secure:!0}),u.newAppSk&&(0,te.jsx)(fe.Z,{title:a("blocklet.config.appSkTitle"),description:(0,te.jsxs)(x.Z,{children:[(0,te.jsx)(x.Z,{children:a("blocklet.config.appSkChangeTip")}),(0,te.jsx)(x.Z,{fontWeight:"bold",mt:2,children:a("blocklet.config.appDidChangeTip")}),(0,te.jsxs)(ye,{children:[(0,te.jsx)("li",{children:a("blocklet.config.appDidChangeTipL1")}),(0,te.jsx)("li",{children:a("blocklet.config.appDidChangeTipL2")})]})]}),confirm:a("confirm"),cancel:a("cancel"),onConfirm:function(){return p(u.newAppSk)},onCancel:function(){return f({newAppSk:""})}}),(0,te.jsx)(ge.Z,{popup:!0,open:u.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:l.get,checkTimeout:3e5,onSuccess:m,extraParams:{appDid:s.appDid},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:m})]}be.propTypes={initialValue:u().string,onChange:u().func,disabled:u().bool,loading:u().bool},be.defaultProps={initialValue:"default",onChange:function(){},disabled:!1,loading:!1};var je,ye=(0,c.Z)("ul")(he||(he=(0,r.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"]))),ke=t(50496),Ce=t(43207),we=t(33359),Se=t(23299),Le=t(49884),Ee=t(88876),Pe=t(73820),Te=t(80670);function _e(e){var n=e.onCancel,t=e.onSuccess,r=e.onError,i=(0,s.useContext)(Ze.B).api,a=(0,s.useState)(!1),l=(0,o.Z)(a,2),c=l[0],d=l[1],u=(0,S.PE)(),f=u.t,p=u.locale,m=(0,s.useState)(""),h=(0,o.Z)(m,2),g=h[0],Z=h[1],v=(0,s.useState)(!1),b=(0,o.Z)(v,2),j=b[0],y=b[1],k=(0,s.useState)(0),C=(0,o.Z)(k,2),w=C[0],L=C[1],E=(0,s.useState)(""),P=(0,o.Z)(E,2),T=P[0],_=P[1],A=(0,Te.DJ)().endpoint,O=(0,s.useState)(!1),N=(0,o.Z)(O,2),R=N[0],I=N[1],F=function(e){Z(null),d(!0);try{_(e.result),L(U.length-1)}catch(t){var n=(0,se.Z)(t);Z(n),r(t)}finally{d(!1)}},B=function(){y(!1),L(0)},U=[{body:(0,te.jsxs)(x.Z,{children:[(0,te.jsx)(we.Z,{children:f("team.transferApp.transferDialog.tips.progress")}),(0,te.jsx)(we.Z,{mt:3,mb:2,children:f("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:f("common.cancel"),confirm:f("team.transferApp.transferDialog.createTransferLink"),onCancel:n,onConfirm:function(){y(!0),L(1)}},{body:function(){return(0,te.jsx)(ge.Z,{action:"transfer-app-owner",open:j,locale:p,checkFn:i.get,onClose:B,onSuccess:F,checkTimeout:3e5,extraParams:{},messages:{title:f("team.transferApp.connectDialog.title"),scan:f("team.transferApp.connectDialog.scan"),confirm:f("team.transferApp.connectDialog.confirm"),success:f("team.transferApp.connectDialog.success")},popup:!0})}},{body:function(){var e=(0,se.VP)({transferId:T.transferId,endpoint:A});return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(x.Z,{component:Oe,dangerouslySetInnerHTML:{__html:f("team.transferApp.transferDialog.createSuccessTip1")}}),(0,te.jsx)(x.Z,{component:Oe,mt:2,children:(0,te.jsx)(Oe,{children:f("team.transferApp.transferDialog.createSuccessTip3")})}),(0,te.jsxs)(x.Z,{children:[(0,te.jsx)(x.Z,{component:Oe,mt:2,children:(0,te.jsx)(Oe,{children:f("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,se.B2)(T.expireDate,p)})})}),(0,te.jsx)(x.Z,{my:1,children:(0,te.jsx)(Pe.Z,{children:e})})]}),(0,te.jsx)("div",{children:(0,te.jsx)(Le.Z,{value:"end",control:(0,te.jsx)(Ee.Z,{checked:R,onChange:function(e){return I(e.target.checked)}}),label:f("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:f("common.confirm"),onConfirm:t}],D=U[w];return(0,te.jsxs)(ke.ZP,{title:(0,te.jsx)(Oe,{className:"title",children:f("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,te.jsxs)(te.Fragment,{children:[D.cancel&&(0,te.jsx)(z.Z,{onClick:D.onCancel,color:"inherit",children:D.cancel}),(0,te.jsxs)(z.Z,{onClick:D.onConfirm,color:"error",disabled:c||w===U.length-1&&!R,variant:"contained",autoFocus:!0,children:[c&&(0,te.jsx)(q.Z,{size:16}),D.confirm]})]}),children:[(0,te.jsx)(Ce.Z,{component:"div",children:"function"===typeof D.body?D.body():D.body}),!!g&&(0,te.jsx)(Se.Z,{type:"error",variant:"icon",children:g})]})}_e.propTypes={onCancel:u().func.isRequired,onSuccess:u().func.isRequired,onError:u().func},_e.defaultProps={onError:function(){}};var Ae,Oe=c.Z.div(je||(je=(0,r.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"]))),Ne=t(15300),Re=t(21802),Ie=["blocklet","onUpdate","hasPermission"],Fe=Object.keys(D.SUPPORTED_LANGUAGES).map((function(e){return{code:e,name:D.SUPPORTED_LANGUAGES[e].nativeName}}));function Be(e){var n,t=e.blocklet,r=e.onUpdate,l=e.hasPermission,c=(0,a.Z)(e,Ie),d=(0,le.h6)(),u=d.api,f=d.inService,p=d.prefix,m=d.getSessionInHeader,g=d.ws.useSubscription,Z=(0,s.useContext)(S.RD).t,v=(0,s.useState)(""),b=(0,o.Z)(v,2),j=b[0],y=b[1],k=(0,s.useState)(""),C=(0,o.Z)(k,2),w=C[0],L=C[1],P=(0,s.useState)(!1),T=(0,o.Z)(P,2),O=T[0],R=T[1],q=(0,E.getWhoCanAccess)(t),V=null===t||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.publicToStore,G=w||!l,H=(0,Ne.Z)({blocklet:t}),M=H.logoUrl,Y=H.rectLogoUrl,J=H.faviconUrl,Q=t.meta.did,X=t.site,$=N()(t.meta,"capabilities.clusterMode",!1);if(g(h.EVENTS.NODE_RUNTIME_INFO,(function(e){$&&y(N()(e,"cpu.physicalCores",""))})),(0,se.wS)(t.status))return null;var ee=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE})),ne=!ee||"yes"===ee.value,re=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES})),ie=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL})),oe=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER})),ue=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR})),fe=[{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:Z("blocklet.config.name"),value:t.environments.find((function(e){return"BLOCKLET_APP_NAME"===e.key})).value},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:Z("blocklet.config.description"),value:t.environments.find((function(e){return"BLOCKLET_APP_DESCRIPTION"===e.key})).value},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:Z("blocklet.config.appUrl"),value:ie?ie.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:Z("blocklet.config.copyrightOwner"),value:oe?oe.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:Z("blocklet.config.copyrightYear"),value:ue?ue.value:""}];if($){var pe=t.configs.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE})),he=pe?pe.value:j;fe.push({key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:Z("blocklet.config.clusterSize"),value:he,cpuCores:j})}var xe=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n){var i,o,a;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!w){e.next=2;break}return e.abrupt("return");case 2:return L(!0),e.prev=3,i=n.target.checked,e.next=7,u.configPublicToStore({input:{did:t.meta.did,publicToStore:i}});case 7:o=e.sent,a=o.blocklet,r(a),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),K.Z.error(e.t0.message);case 15:return e.prev=15,L(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[3,12,15,18]])})));return function(n){return e.apply(this,arguments)}}(),ge=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n,i){var o,a,l,s;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){e.next=5;break}if(!(o=(0,se.I)({value:i,cpuCores:j}))){e.next=5;break}return K.Z.error(o),e.abrupt("return");case 5:return a=[{key:n,value:i}],e.prev=6,L(!0),e.next=10,u.configBlocklet({input:{did:t.meta.did,configs:a}});case 10:l=e.sent,s=l.blocklet,r(s),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(6),K.Z.error(e.t0.message);case 18:return e.prev=18,L(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[6,15,18,21]])})));return function(n,t){return e.apply(this,arguments)}}(),Ze=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n){var i,o,a;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!w){e.next=2;break}return e.abrupt("return");case 2:return L(!0),e.prev=3,i=n.target.checked,e.next=7,u.configBlocklet({input:{did:t.meta.did,configs:[{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE,value:i?"no":"yes"}]}});case 7:o=e.sent,a=o.blocklet,r(a),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),K.Z.error(e.t0.message);case 15:return e.prev=15,L(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[3,12,15,18]])})));return function(n){return e.apply(this,arguments)}}(),ve=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n){var r,i,o;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=X.corsAllowedOrigins||[],i=n.split(",").map((function(e){return e.trim()})).filter(Boolean),!I()(r,i)){e.next=4;break}return e.abrupt("return",!1);case 4:return e.prev=4,L(!0),o=i.length?i:["__none__"],e.next=9,u.updateRoutingSite({input:{id:X.id,corsAllowedOrigins:o,teamDid:t.meta.did}});case 9:L(!1),e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(4),K.Z.error(e.t0.message),L(!1),e.abrupt("return",!1);case 17:return e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(n){return e.apply(this,arguments)}}(),je=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n){var i,o;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!w){e.next=2;break}return e.abrupt("return");case 2:return L(!0),e.prev=3,e.next=6,u.configBlocklet({input:{did:t.meta.did,configs:[{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SK,value:n}]}});case 6:i=e.sent,o=i.blocklet,r(o),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),K.Z.error(e.t0.message);case 14:return e.prev=14,L(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[3,11,14,17]])})));return function(n){return e.apply(this,arguments)}}();return(0,te.jsxs)(Ke,(0,i.Z)((0,i.Z)({},c),{},{children:[fe.map((function(e){return(0,te.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,te.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:e.description}),(0,te.jsx)(W.Z,{style:{marginTop:0},disabled:w||G,loading:w,initialValue:e.value,onSubmit:function(n){return ge(e.key,n)}})]})})),(0,te.jsx)(x.Z,{className:"config-form",component:B.Z,my:3}),(0,te.jsx)(x.Z,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:Z("blocklet.config.logoSquare")}),(0,te.jsx)(Re.Z,{did:t.meta.did,height:80,width:80,type:"square",prefix:p,url:M,enabled:l,headers:m}),(0,te.jsx)(x.Z,{className:"config-label",fontSize:14,mt:4,children:Z("blocklet.config.logoRect")}),(0,te.jsx)(x.Z,{mb:1.5,className:"config-desc",children:Z("blocklet.config.logoRectDesc")}),(0,te.jsx)(Re.Z,{did:t.meta.did,height:80,type:"rect",prefix:p,url:Y,enabled:l,headers:m}),(0,te.jsx)(x.Z,{className:"config-label",fontSize:14,mt:4,children:Z("blocklet.config.logoFavicon")}),(0,te.jsx)(x.Z,{mb:1.5,className:"config-desc",children:Z("blocklet.config.logoFaviconDesc")}),(0,te.jsx)(Re.Z,{did:t.meta.did,height:25,width:25,type:"favicon",prefix:p,url:J,enabled:l,headers:m}),(0,te.jsx)(x.Z,{className:"config-form",children:"all"===q&&"registry"===t.source&&(0,te.jsxs)(x.Z,{className:"config-item",children:[(0,te.jsxs)(x.Z,{className:"config-label",children:[Z("blocklet.config.access.publicToStore"),(0,te.jsx)(x.Z,{className:"config-desc",children:Z("blocklet.config.access.publicInstanceTip")})]}),(0,te.jsx)(F.Z,{disabled:G,checked:V,defaultChecked:!0,onChange:xe})]})}),(0,te.jsx)(x.Z,{className:"config-form",component:B.Z,my:3}),(0,te.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,te.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:Z("blocklet.config.languages")}),(0,te.jsx)(ae,{style:{marginTop:0},disabled:w||G,loading:w,options:Fe,initialValue:re?re.value.split(","):["en","zh"],onSubmit:function(e){return ge("BLOCKLET_APP_LANGUAGES",e)},helperText:Z("blocklet.config.selectLanguagesTip")})]}),(0,te.jsx)(x.Z,{className:"config-form",component:B.Z,my:3}),(0,te.jsx)(x.Z,{className:"config-form",mt:2,children:(0,te.jsx)(x.Z,{className:"config-label",mb:0,children:Z("common.security")})}),(0,te.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,te.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:Z("router.domainSecurity.cors.title")}),(0,te.jsx)(x.Z,{mb:1.5,className:"config-desc",children:Z("router.domainSecurity.cors.description",{name:"the blocklet"})}),(0,te.jsx)(W.Z,{style:{marginTop:0},disabled:w||G,loading:w,initialValue:(X.corsAllowedOrigins||[]).join(", "),onSubmit:ve})]}),(0,te.jsx)(x.Z,{className:"config-form",component:B.Z,my:3}),(0,te.jsx)(x.Z,{mb:2,className:"config-label",fontSize:20,children:Z("blocklet.config.dangerZone")}),(0,te.jsxs)(x.Z,{px:2,py:1,sx:{border:"1px solid red",borderRadius:2},children:[(0,te.jsx)(x.Z,{className:"config-form",mt:2,children:!f&&(0,te.jsxs)(x.Z,{className:"config-item",children:[(0,te.jsxs)(x.Z,{className:"config-label",children:[Z("blocklet.config.deletable.name"),(0,te.jsx)(x.Z,{className:"config-desc",children:Z(ne?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,te.jsx)(F.Z,{disabled:G,checked:!ne,defaultChecked:!0,onChange:Ze})]})}),(0,te.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,te.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:Z("blocklet.config.sk")}),(0,te.jsx)(be,{disabled:w||G,loading:w,initialValue:t.environments.find((function(e){return"BLOCKLET_APP_SK"===e.key})).value,onChange:je})]}),f&&(0,te.jsx)(de.Z,{role:"owner",children:function(e){return(e||ce.C)&&(0,te.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,te.jsxs)(x.Z,{className:"config-item",children:[(0,te.jsx)(x.Z,{className:"config-label",mb:0,children:Z("team.transferApp.name")}),(0,te.jsxs)(z.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"transfer-app",onClick:function(){return R(!0)},children:[(0,te.jsx)(U.Z,{style:{fontSize:"1.3em",marginRight:4}}),Z("team.transferApp.name")]})]}),O&&(0,te.jsx)(_e,{onCancel:function(){return R(!1)},onSuccess:function(){return R(!1)}})]})}}),(0,te.jsx)(x.Z,{className:"config-form",mt:2,children:(0,te.jsxs)(x.Z,{className:"config-item",children:[(0,te.jsxs)(x.Z,{className:"config-label",children:[Z("blocklet.config.clearCache.name"),(0,te.jsx)(x.Z,{className:"config-desc",children:Z("blocklet.config.clearCache.purpose")})]}),(0,te.jsx)(me,{teamDid:Q})]})})]})]}))}var ze=(0,de.V)(Be,"mutate_blocklets"),Ue=(0,de.V)(Be,"",se.Wf);function De(e){return(0,le.h6)().inService?(0,te.jsx)(Ue,(0,i.Z)({},e)):(0,te.jsx)(ze,(0,i.Z)({},e))}Be.propTypes={blocklet:u().object.isRequired,onUpdate:u().func,hasPermission:u().bool},Be.defaultProps={onUpdate:function(){},hasPermission:!1};var Ke=c.Z.div(Ae||(Ae=(0,r.Z)(["\n padding-top: 24px;\n .config-form {\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n }\n }\n\n .config-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 16px 0;\n }\n\n .config-label {\n font-weight: bold;\n }\n\n .config-desc {\n font-weight: normal;\n font-size: 12px;\n color: #666;\n }\n\n .form-item {\n margin-top: 0;\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),We=t(78789),qe=t(46121),Ve=t(87535),Ge=t(87006),He=t(72097),Me=t(49735),Ye=t.n(Me),Je=t(35147),Qe=t(13953),Xe=t(52553),$e=t.n(Xe),en=t(27021),nn=t.n(en),tn=t(44632),rn=t.n(tn),on={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};var an=function(){var e,n,t,r=(0,le.h6)().api,o=(0,ve.y0)().blocklet,a=(0,S.PE)().t,l=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,s=Object.assign((0,i.Z)({},on),(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.notification)||void 0===t?void 0:t.email)||{}),c=(0,Qe.cI)({defaultValues:Ye()(s,Object.keys(on))}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),g=(0,Je.Z)(function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n){var t,o,s,c,d;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.configNotification({input:{did:l,notification:JSON.stringify({email:n})}});case 3:s=e.sent,c=s.blocklet,d=Object.assign((0,i.Z)({},on),(null===c||void 0===c||null===(t=c.settings)||void 0===t||null===(o=t.notification)||void 0===o?void 0:o.email)||{}),m(d),K.Z.success(a("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),K.Z.error(e.t0.message||a("oauth.saveFailed"));case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}()),Z=(0,Je.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!$e()(n)||a("notification.email.fromInvalid"):a("notification.email.fromRequired")})),v=(0,Je.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!nn()(n,{require_host:!1,protocols:[]})||a("notification.email.hostInvalid"):a("notification.email.hostRequired")})),b=(0,Je.Z)((function(e){return e?!!rn()(e)||a("notification.email.portInvalid"):a("notification.email.portRequired")})),j=(0,Je.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("notification.email.userRequired")})),y=(0,Je.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("notification.email.passwordRequired")})),k=(0,Je.Z)((function(){return!0}));return(0,te.jsx)(x.Z,{children:(0,te.jsxs)("form",{onSubmit:d(g),disabled:!0,children:[(0,te.jsx)(Qe.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,te.jsx)(Le.Z,{control:(0,te.jsx)(F.Z,(0,i.Z)({checked:n.value},n)),label:a("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,te.jsx)(Qe.Qr,{name:"from",control:u,rules:{validate:h?Z:k},render:function(e){var n,t=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,children:(0,te.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{label:a("notification.email.from"),error:!!f.errors[t.name],helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,te.jsx)(Qe.Qr,{name:"host",control:u,rules:{validate:h?v:k},render:function(e){var n,t=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,children:(0,te.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:a("notification.email.host"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,te.jsx)(Qe.Qr,{name:"port",control:u,rules:{validate:h?b:k},render:function(e){var n,t=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,children:(0,te.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{type:"number",error:!!f.errors[t.name],label:a("notification.email.port"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,te.jsx)(Qe.Qr,{name:"user",control:u,rules:{validate:h?j:k},render:function(e){var n,t=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,children:(0,te.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:a("notification.email.user"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,te.jsx)(Qe.Qr,{name:"password",control:u,rules:{validate:h?y:k},render:function(e){var n,t=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,children:(0,te.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{type:"password",error:!!f.errors[t.name],label:a("notification.email.password"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,te.jsx)(Qe.Qr,{name:"secure",control:u,rules:{validate:k},render:function(e){var n=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,children:(0,te.jsx)(Le.Z,{control:(0,te.jsx)(F.Z,(0,i.Z)((0,i.Z)({checked:n.value},n),{},{disabled:!h})),label:a("notification.email.secure"),style:{marginBottom:16}})})}}),(0,te.jsx)(He.Z,{type:"submit",variant:"contained",onSubmit:d(g),disabled:!f.isDirty,children:a("oauth.save")})]})})},ln=[{label:(0,te.jsx)(x.Z,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:(0,te.jsx)(x.Z,{textAlign:"center",width:"100%",children:"More"}),value:"more"}];var sn,cn,dn=function(){var e=(0,s.useState)(ln[0].value),n=(0,o.Z)(e,2),t=n[0],r=n[1],i=(0,s.useContext)(S.RD).t,a=(0,qe.Z)((function(){return{email:(0,te.jsx)(an,{}),more:(0,te.jsx)(x.Z,{children:(0,te.jsx)(We.Z,{children:i("notification.comingSoon")})})}}),[i]);return(0,te.jsxs)(x.Z,{children:[(0,te.jsx)(L.Z,{tabs:ln,current:t,onChange:r}),(0,te.jsx)(x.Z,{marginTop:"10px",children:a[t]})]})},un=t(6779),fn=t(6698),pn=t(11909),mn=t(1484),hn=t(2569),xn=t(88356),gn=t(98127),Zn=t(86008),vn=t(70115),bn="roles",jn=[].concat((0,l.Z)(vn.Z),[{value:bn,icon:gn.Z,title:{zh:"\u6307\u5b9a\u901a\u884c\u8bc1\u53ef\u8bbf\u95ee",en:"Accessible to selected passports"},description:{zh:"\u53ea\u6709\u6307\u5b9a\u7684\u901a\u884c\u8bc1\u53ef\u4ee5\u8bbf\u95ee",en:"Only specified passports can access"}}]),yn=function(e,n){if(e&&e.startsWith(h.WHO_CAN_ACCESS_PREFIX_ROLES)){var t=(0,E.getRolesFromAuthConfig)({whoCanAccess:e}),r=n.filter((function(e){return t.includes(e.name)}));return{access:bn,roles:r}}return{access:e,roles:[]}},kn=function(e,n){var t=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).roles,r=void 0===t?[]:t,i=(e.configs||[]).find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO}));if(i)return yn(i.value,r);if(n&&N()(n,"settings.whoCanAccess")&&N()(n,"settings.whoCanAccess")!==h.WHO_CAN_ACCESS.ALL)return yn(N()(n,"settings.whoCanAccess"),r);var o=(0,E.findServiceFromMeta)(e.meta,h.NODE_SERVICES.AUTH);return N()(o,"config.whoCanAccess")?yn(o.config.whoCanAccess,r):{access:h.WHO_CAN_ACCESS.ALL,roles:[]}};function Cn(e){var n=e.blocklet,t=e.ancestors,r=e.children,i=(0,Q.Z)(),a=(0,s.useState)(""),c=(0,o.Z)(a,2),d=c[0],u=c[1],f=(0,S.PE)(),p=f.t,m=f.locale,g=(0,le.h6)().api,Z=(0,Te.DJ)().roles,v=(0,s.useState)(""),b=(0,o.Z)(v,2),j=b[0],y=b[1],k=t[0]||n,C=kn(n,k,{roles:Z}),w=C.access,L=C.roles,P=(0,s.useState)(w),T=(0,o.Z)(P,2),O=T[0],N=T[1],R=(0,s.useState)(L),I=(0,o.Z)(R,2),F=I[0],B=I[1],U=[].concat((0,l.Z)(t.map((function(e){return e.meta.did}))),[n.meta.did]),D={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:i.palette.text.secondary},W=t.concat(n).map((function(e){return(0,E.getDisplayName)(e,!0)})).join(" / ");if((0,se.wS)(n.status))return null;if("unknown"===n.status&&(0,se.wS)(n.status))return null;var V=function(){u(!1)},G=function(e){e.stopPropagation(),u(!0)},Y=function(){var e=(0,A.Z)((0,_.Z)().mark((function e(){var n;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){e.next=2;break}return e.abrupt("return");case 2:return y(!0),e.prev=3,(n=O)===bn&&(n="".concat(h.WHO_CAN_ACCESS_PREFIX_ROLES).concat(F.map((function(e){return e.name})).join(","))),e.next=8,g.updateWhoCanAccess({input:{did:U,whoCanAccess:n}});case 8:K.Z.success(p("blocklet.config.access.updatedTip")),V(),y(!1),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(3),y(!1),K.Z.error((0,se.Z)(e.t0));case 17:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(){return e.apply(this,arguments)}}(),X=j||O===bn&&!F.length;return["function"===typeof r?r({open:G}):(0,te.jsx)(H.Z,{onClick:G,"data-cy":"action-config-component",children:(0,te.jsx)(xn.default,{})}),d&&(0,te.jsxs)(Sn,{open:!0,fullWidth:!0,title:W,onClose:V,PaperProps:{style:{minHeight:"auto"}},actions:(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(z.Z,{onClick:V,color:"inherit","data-cy":"config-access-cancel",children:p("common.cancel")}),(0,te.jsxs)(z.Z,{onClick:Y,color:"primary",disabled:X,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[j&&(0,te.jsx)(q.Z,{size:16}),p("common.confirm")]})]}),children:[(0,te.jsx)(x.Z,{mt:4,mb:3,children:(0,te.jsx)(Ge.Z,{label:p("blocklet.config.access.description"),select:!0,fullWidth:!0,value:O,onChange:function(e){var n=e.target.value;N(n)},"data-cy":"config-access-select",SelectProps:{renderValue:function(e){var n=jn.find((function(n){return n.value===e}));return n?(0,te.jsxs)(x.Z,{children:[(0,te.jsx)(n.icon,{style:D}),n.title[m]]}):null}},children:jn.map((function(e){return(0,te.jsxs)(Ln,{value:e.value,sx:{display:"block"},"data-cy":"config-access-opt-".concat(e.value),children:[(0,te.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,te.jsx)(e.icon,{style:D}),(0,te.jsx)(x.Z,{children:e.title[m]})]}),(0,te.jsx)(x.Z,{children:(0,te.jsx)(x.Z,{className:"tip",children:e.description[m]})})]})}))})}),O===bn&&(0,te.jsx)(x.Z,{mt:4,mb:3,children:(0,te.jsx)(Ge.Z,{label:p("blocklet.config.access.description"),select:!0,fullWidth:!0,value:F.map((function(e){return e.name})),onChange:function(e){B(Z.filter((function(n){return(e.target.value||[]).includes(n.name)})))},SelectProps:{multiple:!0,renderValue:function(e){return(0,te.jsx)(x.Z,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:e.map((function(e){var n=Z.find((function(n){return n.name===e}));return(0,te.jsx)(J.Z,{label:n.title},n.text)}))})}},children:Z.map((function(e){var n=e.name,t=e.title;return(0,te.jsxs)(M.Z,{value:n,children:[(0,te.jsx)(Ee.Z,{checked:F.some((function(e){return e.name===n}))}),(0,te.jsx)(Zn.Z,{primary:t})]},n)}))})})]})]}Cn.propTypes={blocklet:u().object.isRequired,ancestors:u().array,children:u().any},Cn.defaultProps={ancestors:[],children:null};var wn,Sn=(0,c.Z)(ke.ZP)(sn||(sn=(0,r.Z)(["\n .MuiDialogContent-root {\n padding-top: 0;\n margin-top: -32px;\n }\n .MuiToolbar-root {\n padding-right: 12px;\n }\n .ux-dialog_right {\n padding-right: 20px;\n }\n"]))),Ln=(0,c.Z)(M.Z)(cn||(cn=(0,r.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.text.secondary}));function En(e){var n,t,r=e.blocklet,i=e.ancestors,a=e.depth,c=(0,Q.Z)(),d=(0,S.PE)(),u=d.t,f=d.locale,p=(0,Te.DJ)().roles,m=(0,s.useState)(!0),h=(0,o.Z)(m,2),g=h[0],Z=h[1],v=(0,ve.y0)().recommendedDomain,b=i[0]||r,j="/".concat(i.map((function(e){return e.mountPoint||"/"})).join("/"),"/").concat(r.mountPoint||"/").replace(/\/+/g,"/"),y=(0,se.vH)({blocklet:b,domain:{value:v},mountPoint:j,params:(0,se.f0)(b,f)}),w={fill:c.palette.text.secondary},L=a>0&&r.children.length>0,T=(0,te.jsx)(H.Z,{size:"small",children:g?(0,te.jsx)(C.Z,{fontSize:"inherit"}):(0,te.jsx)(k.default,{fontSize:"inherit"})}),_=kn(r,b,{roles:p}),A=_.access,O=_.roles;if("roles"!==A)t=vn.Z.find((function(e){return e.value===A}))||vn.Z[2];else{var N=O.map((function(e){return e.title})).join("/");t={title:{zh:"\u53ea\u6709 ".concat(N," \u53ef\u4ee5\u8bbf\u95ee"),en:"Only ".concat(N," can access")}}}return[(a>0||"gateway"!==r.meta.group)&&(0,te.jsxs)(x.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,te.jsxs)(x.Z,{pl:Math.max(2*(a-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:L?"pointer":"cursor"},onClick:function(){return L&&Z(!g)},children:[L?T:(0,te.jsx)(x.Z,{width:28}),(0,te.jsx)(P.Z,{blocklet:r,ancestors:i}),(0,te.jsxs)(x.Z,{ml:"16px",children:[(0,te.jsx)(x.Z,{style:{color:"#222",fontSize:18},children:(0,E.getDisplayName)(r,!0)}),(0,te.jsx)(x.Z,{display:"flex",alignItems:"center",children:(0,te.jsx)(x.Z,{color:"text.secondary",children:t.title[f]})})]})]},r),(0,te.jsxs)(x.Z,{children:[(0,te.jsx)(un.Z,{title:u("common.visit"),children:(0,te.jsx)("a",{target:"_blank",href:y,rel:"noopener noreferrer",title:y,children:(0,te.jsx)(H.Z,{children:(0,te.jsx)(pn.Z,{})})})}),(0,te.jsx)(Cn,{blocklet:r,ancestors:i,children:function(e){var n=e.open;return(0,te.jsx)(un.Z,{title:u("common.edit"),children:(0,te.jsx)(H.Z,{onClick:n,"data-cy":"btn-edit-".concat(r.meta.did),children:(0,te.jsx)(mn.Z,{style:w})})})}})]},"actions")]},"group-not-gateway-box"),(0,te.jsx)(hn.Z,{depth:a}),null!==(n=r.children)&&void 0!==n&&n.length?(0,te.jsx)(fn.Z,{in:g,children:r.children.map((function(e){return(0,te.jsx)(En,{blocklet:e,ancestors:[].concat((0,l.Z)(i),[r]),depth:a+1},"".concat(a+1,"-").concat(e.meta.did))}))},"blocklet-collapse"):null]}function Pn(){var e=(0,S.PE)().t,n=(0,ve.y0)().blocklet,t=(0,l.Z)(n.children)||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,te.jsx)(Tn,{component:"div",children:t&&t.length?[(0,te.jsx)(x.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},style:{maxWidth:1080},children:(0,te.jsx)(En,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,te.jsx)(x.Z,{mt:8,children:(0,te.jsx)(We.Z,{children:e("blocklet.component.noComponent")})})})}En.propTypes={blocklet:u().object.isRequired,ancestors:u().array,depth:u().number},En.defaultProps={ancestors:[],depth:0},Pn.propTypes={};var Tn=(0,c.Z)(x.Z)(wn||(wn=(0,r.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-top: ",";\n margin-bottom: ",";\n &.first {\n margin-top: 0;\n }\n }\n"])),(function(e){return e.theme.spacing(5)}),(function(e){return e.theme.spacing(3)})),_n=t(92746);var An=function(){var e,n,t,r=(0,le.h6)().api,o=(0,ve.y0)().blocklet,a=(0,S.PE)().t,l=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,s=Object.assign({enabled:!1,domain:"",clientId:""},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{}),c=(0,Qe.cI)({defaultValues:Ye()(s,["domain","clientId","enabled"])}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),g=(0,Je.Z)(function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n){var t,i,o,s,c;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.configOAuth({input:{did:l,oauth:JSON.stringify({auth0:n})}});case 3:o=e.sent,s=o.blocklet,c=Object.assign({enabled:!1,domain:"",clientId:""},(null===s||void 0===s||null===(t=s.settings)||void 0===t||null===(i=t.oauth)||void 0===i?void 0:i.auth0)||{}),m(c),K.Z.success(a("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),K.Z.error(e.t0.message||a("oauth.saveFailed"));case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}()),Z=(0,Je.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("oauth.auth0.domainDescribe")})),v=(0,Je.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("oauth.auth0.clientIdDescribe")})),b=(0,Je.Z)((function(){return!0}));return(0,te.jsx)(x.Z,{children:(0,te.jsxs)("form",{onSubmit:d(g),disabled:!0,children:[(0,te.jsx)(Qe.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,te.jsx)(Le.Z,{control:(0,te.jsx)(_n.Z,(0,i.Z)({checked:n.value,style:{marginRight:"6px"}},n)),label:a("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,te.jsx)(Qe.Qr,{name:"domain",control:u,rules:{validate:h?Z:b},render:function(e){var n,t=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,children:(0,te.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{label:a("oauth.auth0.domain"),error:!!f.errors[t.name],helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,te.jsx)(Qe.Qr,{name:"clientId",control:u,rules:{validate:h?v:b},render:function(e){var n,t=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,children:(0,te.jsx)(Ge.Z,(0,i.Z)((0,i.Z)({},t),{},{error:!!f.errors[t.name],label:a("oauth.auth0.clientId"),helperText:(null===(n=f.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h}))})}}),(0,te.jsx)(He.Z,{type:"submit",variant:"contained",onSubmit:d(g),disabled:!f.isDirty,children:a("oauth.save")})]})})},On=t(29529),Nn=t(25139),Rn={ttl:604800};function In(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?86400*e.ttl:e.ttl/86400;return(0,i.Z)((0,i.Z)({},e),{},{ttl:n})}function Fn(){var e,n,t=(0,le.h6)().api,r=(0,ve.y0)().blocklet,o=null===r||void 0===r||null===(e=r.meta)||void 0===e?void 0:e.did,a=Object.assign({},Rn,(null===r||void 0===r||null===(n=r.settings)||void 0===n?void 0:n.session)||{}),l=(0,Qe.cI)({defaultValues:Ye()(In(a),["ttl"])}),s=l.handleSubmit,c=l.control,d=l.formState,u=l.reset,f=(0,S.PE)().t,p=(0,Je.Z)(function(){var e=(0,A.Z)((0,_.Z)().mark((function e(n){var r,i,a,l;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.updateAppSessionConfig({input:{did:o,config:In(n,!0)}});case 3:i=e.sent,a=i.blocklet,l=Object.assign({},Rn,Ye()((null===a||void 0===a||null===(r=a.settings)||void 0===r?void 0:r.session)||{},["ttl"])),u(In(l)),K.Z.success(f("common.configSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),K.Z.error(e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(n){return e.apply(this,arguments)}}());return(0,te.jsx)(x.Z,{children:(0,te.jsxs)("form",{onSubmit:s(p),disabled:!0,children:[(0,te.jsx)(Qe.Qr,{name:"ttl",control:c,render:function(e){var n=e.field;return(0,te.jsx)(Ve.Z,{fullWidth:!0,sx:{mb:2},children:(0,te.jsxs)(Nn.Z,{px:3,children:[(0,te.jsx)(x.Z,{mx:-3,my:.5,children:f("blocklet.config.session.ttl",{day:n.value})}),(0,te.jsx)(On.ZP,(0,i.Z)((0,i.Z)({},n),{},{defaultValue:7,step:1,marks:[{value:1,label:f("blocklet.config.session.day",{day:1})},{value:7,label:f("blocklet.config.session.days",{day:7})},{value:14,label:f("blocklet.config.session.days",{day:14})},{value:21,label:f("blocklet.config.session.days",{day:21})},{value:30,label:f("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto",style:{maxWidth:"360px"}}))]})})}}),(0,te.jsx)(He.Z,{type:"submit",variant:"contained",onSubmit:s(p),disabled:!d.isDirty,children:f("oauth.save")})]})})}var Bn=t(48537),zn=t(95002),Un=t(2291),Dn=t(75260),Kn=t(28595),Wn=t(61398),qn=t.n(Wn),Vn=(0,s.forwardRef)((function(e,n){var t=(0,s.useContext)(S.RD).t,r=(0,Kn.Z)({show:!1,title:"",content:"",onConfirm:qn(),onCancel:qn(),loading:!1}),i=(0,Je.Z)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.show=!0,r.title=e.title,r.content=e.content,r.onConfirm=e.onConfirm||qn(),r.onCancel=e.onCancel||qn(),r.loading=!1})),o=(0,Je.Z)((function(){r.title="",r.content="",r.onConfirm=qn(),r.onCancel=qn()})),a=(0,Je.Z)((function(){r.show=!1,setTimeout((function(){o()}),300)})),l=(0,Je.Z)((function(){a(),null===r||void 0===r||r.onCancel()}),[]),c=(0,Je.Z)((0,A.Z)((0,_.Z)().mark((function e(){return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.loading=!0,e.prev=1,e.next=4,null===r||void 0===r?void 0:r.onConfirm(a);case 4:return e.prev=4,r.loading=!1,e.finish(4);case 7:case"end":return e.stop()}}),e,null,[[1,,4,7]])}))),[]);return(0,s.useImperativeHandle)(n,(function(){return{open:i,close:a}}),[i,a]),(0,te.jsx)(ke.I4,{open:r.show,title:r.title,onConfirm:c,onCancel:l,confirmButton:{text:t("common.confirm"),props:{variant:"contained",color:"primary",loading:r.loading}},cancelButton:{text:t("common.cancel"),props:{variant:"outlined",color:"primary"}},children:r.content})}));var Gn=t(70177),Hn=t(59182),Mn=t.n(Hn),Yn=t(76032),Jn=t.n(Yn),Qn=t(55581),Xn=t(63531),$n=t(92522),et=t.n($n),nt=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(S.RD).t,o=(0,ve.y0)().blocklet,a=(0,le.h6)().api,l=(0,Kn.Z)({mode:"view",show:!1,data:{},callback:qn()}),c=(0,Qn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(r=t.duration)||void 0===r?void 0:r.leavingScreen)||300,u=(0,Je.Z)((function(){l.mode="view",l.data={},l.callback=qn()}),[]),f=(0,Je.Z)((function(){l.show=!1,setTimeout((function(){u()}),d)}),[]),p=(0,Je.Z)((function(e){l.mode="view",l.show=!0,l.data=e}),[]),h=(0,Je.Z)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qn();l.mode="approve",l.show=!0,l.data=e,l.callback=n}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:p,close:f,approve:h}}),[p,f,h]);var g=(0,qe.Z)((function(){if(!l.show)return[];l.data.migratedFrom=[l.data.appId,l.data.appPid];var e=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return!1!==l.data.isMaster&&Mn()(e,"appliedAt","status"),e.map((function(e){var n=i("federated.info.".concat(e)),t=l.data[e];if("appName"===e&&l.data.isMaster&&(t=(0,te.jsxs)(x.Z,{children:[(0,te.jsx)(Bn.Z,{component:zn.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,te.jsx)(Xn.kL,{children:t})),["appUrl"].includes(e)&&(t=(0,te.jsx)(x.Z,{component:"a",href:t,target:"_blank",children:t})),["appLogo"].includes(e)){var r=et()(t)?t:m()(l.data.appUrl||"",t||"");try{var o=new URL(r);o.searchParams.set("imageFilter","resize"),o.searchParams.set("w","80"),o.searchParams.set("h","80"),t=(0,te.jsx)("img",{src:o.href,width:"60",height:"60",alt:l.data.appName})}catch(a){t=(0,te.jsx)("img",{src:r,width:"60",height:"60",alt:l.data.appName})}}("status"===e&&(t=t&&i("federated.status.".concat(t))),"migratedFrom"===e)&&(t=(l.data.migratedFrom||[]).filter((function(e){return![l.data.appId,l.data.appPid].includes(e)})).map((function(e){return(0,te.jsx)(Xn.kL,{children:e})})));return Jn()(t)&&(t="-"),{name:n,value:t}}))}),[l.data]),Z="approve"===l.mode,v=(0,Je.Z)((0,A.Z)((0,_.Z)().mark((function e(){return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.auditFederatedLogin({input:{memberPid:l.data.appPid,did:o.appPid,status:"rejected"}});case 2:f(),null===l||void 0===l||l.callback(!1);case 4:case"end":return e.stop()}}),e)})))),b=(0,Je.Z)((0,A.Z)((0,_.Z)().mark((function e(){return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.auditFederatedLogin({input:{memberPid:l.data.appPid,did:o.appPid,status:"approved"}});case 2:f(),null===l||void 0===l||l.callback(!0);case 4:case"end":return e.stop()}}),e)}))));return(0,te.jsx)(ke.ZP,{open:l.show,title:i(Z?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:f,actions:Z?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(He.Z,{color:"error",variant:"contained",onClick:v,children:i("common.reject")}),(0,te.jsx)(He.Z,{variant:"contained",onClick:b,children:i("common.approve")})]}):(0,te.jsx)(He.Z,{variant:"outlined",onClick:f,children:i("common.close")}),children:g.map((function(e){return(0,te.jsx)(Gn.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)}))})})),tt=nt,rt=t(29951),it=t(34760),ot=t.n(it),at=(0,s.forwardRef)((function(e,n){var t,r,i=(0,Qn.Fg)(),o=(null===i||void 0===i||null===(t=i.transitions)||void 0===t||null===(r=t.duration)||void 0===r?void 0:r.leavingScreen)||300,a=(0,s.useContext)(S.RD).t,l=(0,Kn.Z)({show:!1,data:{link:""}}),c=(0,Je.Z)((function(){l.data.link=""}),[]),d=(0,Je.Z)((function(){l.show=!1,setTimeout((function(){c()}),o)}),[]),u=(0,Je.Z)((function(e){var n=e.link;l.show=!0,l.data.link=n}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:u,close:d}}),[u,d]);var f=(0,Je.Z)((function(){ot()(l.data.link),d()}),[d]);return(0,te.jsxs)(ke.ZP,{open:l.show,title:a("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:(0,te.jsx)(z.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:f,children:a("common.copyAndClose")}),children:[(0,te.jsx)(x.Z,{mb:1,children:a("federated.inviteJoinFederatedLoginDescription")}),(0,te.jsx)(x.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,te.jsx)(rt.Z,{language:"shell",style:{marginBottom:0},children:l.data.link})})]})}));function lt(e){var n,t,r,i,o,a=e.mode,l=(0,s.useRef)(null),c=(0,s.useRef)(null),d=(0,s.useContext)(S.RD),u=d.t,f=d.locale,p=(0,ve.y0)(),m=p.blocklet,h=p.actions.refreshBlocklet,g=function(){var e=(0,s.useRef)(null),n=(0,Je.Z)((function(){for(var n,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];null===(n=e.current)||void 0===n||n.open.apply(n,r)})),t=(0,Je.Z)((function(){for(var n,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];null===(n=e.current)||void 0===n||n.close.apply(n,r)})),r={open:n,close:t};return{confirmHolder:(0,te.jsx)(Vn,{ref:e}),confirmApi:r}}(),Z=g.confirmApi,v=g.confirmHolder,b=(0,le.h6)().api,j=(null===(n=m.settings.federated)||void 0===n?void 0:n.sites)||[],y=(null===(t=m.settings.federated)||void 0===t?void 0:t.config)||{},k=!1!==y.isMaster,C=(0,Je.Z)((function(e){var n;null===(n=c.current)||void 0===n||n.open(e)})),w=(0,Je.Z)((function(e){var n;null===(n=c.current)||void 0===n||n.approve(e,h)})),L=(0,Je.Z)((function(e){Z.open({title:u("federated.disableFederatedLogin"),content:u("federated.disableFederatedLoginDescription"),onConfirm:function(n){return(0,A.Z)((0,_.Z)().mark((function t(){return(0,_.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.auditFederatedLogin({input:{memberPid:e.appPid,did:m.appPid,status:"revoked"}});case 2:n();case 3:case"end":return t.stop()}}),t)})))()}})})),E=(0,Je.Z)((function(e){Z.open({title:u("federated.enableFederatedLogin"),content:u("federated.enableFederatedLoginDescription"),onConfirm:function(n){return(0,A.Z)((0,_.Z)().mark((function t(){return(0,_.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.auditFederatedLogin({input:{memberPid:e.appPid,did:m.appPid,status:"approved"}});case 2:n();case 3:case"end":return t.stop()}}),t)})))()}})})),P=(0,qe.Z)((function(){var e=[{label:u("common.name"),name:"appName",options:{customBodyRenderLite:function(e){var n=j[e],t=!1!==n.isMaster;return(0,te.jsx)(x.Z,{display:"inline-block",children:(0,te.jsxs)(x.Z,{component:"a",display:"flex",alignItems:"center",href:n.appUrl,target:"_blank",onClick:function(e){e.stopPropagation()},children:[t&&(0,te.jsx)(Bn.Z,{component:zn.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:u("common.did"),name:"appId",options:{customBodyRenderLite:function(e){var n=j[e];return(0,te.jsx)(Dn.Z,{children:n.appId})}}},{label:u("common.status"),name:"status",options:{customBodyRenderLite:function(e){var n=j[e],t=!1!==n.isMaster;return(0,te.jsx)(x.Z,{children:t?"-":u("federated.status.".concat(n.status))})}}}];return k&&e.push({label:u("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=j[e],t=!1!==n.isMaster;return(0,te.jsx)(x.Z,{display:"flex",gap:1,children:t?(0,te.jsxs)(te.Fragment,{children:["rejected"===n.status&&(0,te.jsx)(z.Z,{variant:"contained",color:"error",size:"small",onClick:function(e){e.stopPropagation()},children:u("federated.status.rejected")}),"revoked"===n.status&&(0,te.jsx)(z.Z,{variant:"contained",color:"secondary",size:"small",onClick:function(e){e.stopPropagation()},children:u("federated.status.revoked")})]}):(0,te.jsxs)(te.Fragment,{children:["pending"===n.status&&(0,te.jsx)(z.Z,{variant:"contained",color:"primary",size:"small",onClick:function(e){e.stopPropagation(),w(n)},children:u("federated.status.pending")}),"approved"===n.status&&(0,te.jsx)(z.Z,{variant:"contained",color:"error",size:"small",onClick:function(e){e.stopPropagation(),L(n)},style:{whiteSpace:"nowrap"},children:u("federated.revoke")}),"revoked"===n.status&&(0,te.jsx)(z.Z,{variant:"contained",color:"warning",size:"small",onClick:function(e){e.stopPropagation(),E(n)},style:{whiteSpace:"nowrap"},children:u("federated.approve")})]})})}}}),e}),[y.appId,j,k,u]),T=(0,qe.Z)((function(){return{sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick:function(e,n){var t=n.dataIndex,r=j[t];C(r)}}}),[]),O=(0,Je.Z)((function(){var e,n=m.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL}));null!==n&&void 0!==n&&n.value?null===(e=l.current)||void 0===e||e.open({link:n.value}):K.Z.error(u("federated.failedToGetFederatedLoginLink"))}),[null===(r=m.site)||void 0===r||null===(i=r.domainAliases)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.href]),N=(0,Je.Z)((function(){Z.open({title:u("federated.quitFederatedLogin"),content:u("federated.quitFederatedLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,_.Z)().mark((function n(){return(0,_.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,b.quitFederatedLogin({input:{did:m.appPid}});case 2:e();case 3:case"end":return n.stop()}}),n)})))()}})})),R=(0,Je.Z)((function(){Z.open({title:u("federated.disbandFederatedLogin"),content:u("federated.disbandFederatedLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,_.Z)().mark((function n(){return(0,_.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,b.disbandFederatedLogin({input:{did:m.appPid}});case 2:e();case 3:case"end":return n.stop()}}),n)})))()}})})),I=[];return"master"!==a?I.push((0,te.jsx)(z.Z,{size:"small",variant:"contained",color:"error",onClick:N,sx:{ml:1},children:u("federated.quitFederatedLogin")},"quitFederatedLogin")):(I.push((0,te.jsx)(z.Z,{size:"small",variant:"contained",onClick:O,sx:{ml:1},children:u("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),I.push((0,te.jsx)(z.Z,{color:"error",size:"small",variant:"contained",onClick:R,sx:{ml:1},children:u("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(Un.Z,{className:"main-table",locale:f,data:j,columns:P,customButtons:I,title:(0,te.jsx)(x.Z,{className:"table-toolbar-left",children:u("oauth.federated")}),options:T}),v,(0,te.jsx)(at,{ref:l}),(0,te.jsx)(tt,{ref:c})]})}lt.propTypes={mode:u().oneOf(["member","master"])},lt.defaultProps={mode:"member"};var st=lt,ct=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(S.RD).t,o=(0,le.h6)().api,a=(0,ve.y0)().blocklet,l=null===a||void 0===a?void 0:a.appPid,c=(0,Qn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(r=t.duration)||void 0===r?void 0:r.leavingScreen)||300,u=(0,Kn.Z)({show:!1,appUrl:"",appUrlError:"",callback:qn()}),f=(0,Je.Z)((function(){u.appUrl="",u.appUrlError="",u.callback=qn()}),[]),p=(0,Je.Z)((function(){u.show=!1,setTimeout((function(){f()}),d)}),[]),m=(0,Je.Z)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qn();u.show=!0,u.callback=e}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:m,close:p}}),[m,p]);var h=(0,Je.Z)((function(e){if(!e)throw new Error(i("federated.federatedJoinAppUrlRequired"));if(!et()(e))throw new Error(i("federated.federatedJoinAppUrlInvalid"))})),g=(0,Je.Z)((0,A.Z)((0,_.Z)().mark((function e(){var n;return(0,_.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,h(u.appUrl),e.next=4,o.joinFederatedLogin({input:{did:l,appUrl:u.appUrl}});case 4:n=e.sent,u.show=!1,p(),null===u||void 0===u||u.callback(n),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),u.appUrlError=e.t0.message;case 13:case"end":return e.stop()}}),e,null,[[0,10]])}))),[p,l]);return(0,te.jsxs)(ke.ZP,{open:u.show,title:i("federated.joinFederatedLogin"),onClose:p,PaperProps:{style:{minHeight:"unset"}},actions:(0,te.jsx)(z.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:g,children:i("common.confirm")}),children:[(0,te.jsx)(x.Z,{mb:1,children:i("federated.joinFederatedLoginDescription")}),(0,te.jsx)(Ge.Z,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:i("federated.federatedJoinAppUrl"),label:i("federated.federatedJoinAppUrl"),value:u.appUrl,error:!!u.appUrlError,helperText:u.appUrlError||"eg: https://www.arcblock.io",onChange:function(e){u.appUrl=e.target.value}})]})})),dt=ct;function ut(){var e,n,t,r,i=(0,s.useRef)(null),o=(0,s.useRef)(null),a=(0,s.useContext)(S.RD).t,l=(0,ve.y0)(),c=l.blocklet,d=l.actions.refreshBlocklet,u=(0,Je.Z)((function(){var e,n,t,r=null===(e=c.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href;if(r)try{var o,l=new URL(r);null===(o=i.current)||void 0===o||o.open({link:l.origin})}catch(s){K.Z.error(a("federated.failedToGetFederatedLoginLink"))}}),[null===(e=c.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href]),f=(0,Je.Z)((function(){var e;null===(e=o.current)||void 0===e||e.open((function(){d()}))}),[d]);if((null===(r=c.settings.federated)||void 0===r?void 0:r.sites.length)>0){var p,m=!1!==(null===(p=c.settings.federated)||void 0===p?void 0:p.config.isMaster);return(0,te.jsx)(st,{mode:m?"master":"member"})}return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsxs)(x.Z,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[(0,te.jsx)(z.Z,{variant:"contained",onClick:u,children:a("federated.inviteJoinFederatedLogin")}),(0,te.jsx)(B.Z,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),(0,te.jsx)(z.Z,{variant:"outlined",onClick:f,children:a("federated.joinFederatedLogin")})]}),(0,te.jsx)(at,{ref:i}),(0,te.jsx)(dt,{ref:o})]})}var ft,pt=function(){var e=(0,s.useContext)(S.RD).t,n=[{label:(0,te.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.commonSettings")}),value:"settings"},{label:(0,te.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.federated")}),value:"federated"},{label:(0,te.jsx)(x.Z,{textAlign:"center",width:"100%",children:"Auth0"}),value:"auth0"},{label:(0,te.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.moreLogin")}),value:"more"}],t=(0,s.useState)(n[0].value),r=(0,o.Z)(t,2),i=r[0],a=r[1],l=(0,qe.Z)((function(){return{auth0:(0,te.jsx)(An,{}),federated:(0,te.jsx)(ut,{}),more:(0,te.jsx)(x.Z,{children:(0,te.jsx)(We.Z,{children:e("oauth.comingSoon")})}),settings:(0,te.jsx)(x.Z,{children:(0,te.jsx)(Fn,{})})}}),[e]);return(0,te.jsxs)(x.Z,{children:[(0,te.jsx)(L.Z,{tabs:n,current:i,onChange:a}),(0,te.jsx)(x.Z,{marginTop:"10px",children:l[i]})]})},mt=["blocklet","onUpdate"],ht=function e(n){var t=n.tabs,r=n.blocklet,i=n.ancestors,o=void 0===i?[]:i,a=n.depth,s=void 0===a?1:a,c=n.t,d=[].concat((0,l.Z)(o.map((function(e){return e.meta.did}))),[r.meta.did]).join("/"),u=!(null!==o&&void 0!==o&&o.length);t.push({label:(0,te.jsxs)(x.Z,{pl:2*Math.max(1,s-1),display:"flex",alignItems:"center",justifyContent:"flex-start",children:[u?(0,te.jsx)(T.Z,{size:24,blocklet:r}):(0,te.jsx)(P.Z,{size:24,blocklet:r,ancestors:o}),(0,te.jsx)(x.Z,{ml:"16px",children:(0,te.jsx)(x.Z,{style:{color:"#222"},children:u?c("blocklet.component.container"):(0,E.getDisplayName)(r,!0)})})]},d),value:d}),r.children.length>0&&r.children.forEach((function(n){e({tabs:t,blocklet:n,ancestors:[].concat((0,l.Z)(o),[r]),depth:s+1,t:c})}))};function xt(e){var n=e.blocklet,t=e.onUpdate,r=(0,a.Z)(e,mt),l=(0,s.useContext)(S.RD).t,c=(0,le.h6)(),d=c.info,u=c.inService,p=(0,s.useState)(!0),E=(0,o.Z)(p,2),P=E[0],T=E[1],_=(0,w.lr)(),A=(0,o.Z)(_,2),O=A[0],N=A[1],R=O.get("tab")||"general",I=[{label:(0,te.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-general",children:[(0,te.jsx)(Z.Z,{sx:{fontSize:24}}),(0,te.jsx)(x.Z,{ml:"16px",children:(0,te.jsx)(x.Z,{style:{color:"#222"},children:l("common.general")})})]},"general"),value:"general"},{label:(0,te.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-access",children:[(0,te.jsx)(v.Z,{sx:{fontSize:24}}),(0,te.jsx)(x.Z,{ml:"16px",children:(0,te.jsx)(x.Z,{style:{color:"#222"},children:l("common.access")})})]},"access"),value:"access"},{label:(0,te.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-oauth",children:[(0,te.jsx)(b.Z,{sx:{fontSize:24}}),(0,te.jsx)(x.Z,{ml:"16px",children:(0,te.jsx)(x.Z,{style:{color:"#222"},children:l("common.login")})})]},"oauth"),value:"oauth"},{label:(0,te.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-notification",children:[(0,te.jsx)(j.Z,{sx:{fontSize:24}}),(0,te.jsx)(x.Z,{ml:"16px",children:(0,te.jsx)(x.Z,{style:{color:"#222"},children:l("common.notification")})})]},"notification"),value:"notification"},{label:(0,te.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-preference",children:[(0,te.jsx)(x.Z,{ml:-2,style:{transform:"translateY(2px)"},children:P?(0,te.jsx)(C.Z,{fontSize:"inherit"}):(0,te.jsx)(k.default,{fontSize:"inherit"})}),(0,te.jsx)(y.Z,{sx:{fontSize:24}}),(0,te.jsx)(x.Z,{ml:"16px",children:(0,te.jsx)(x.Z,{style:{color:"#222"},children:l("common.preferences")})})]},"preference"),value:"preference"}];P&&ht({tabs:I,blocklet:n,t:l});var F=null;if("general"===R)F=(0,te.jsx)(De,{blocklet:n,onUpdate:t});else if("access"===R)F=(0,te.jsx)(Pn,{});else if("oauth"===R)F=(0,te.jsx)(pt,{});else if("notification"===R)F=(0,te.jsx)(dn,{});else{var B=u?h.WELLKNOWN_SERVICE_PATH_PREFIX:d.routing.adminPath,z=new URLSearchParams;u||z.set("authKey","__sst"),z.set("schemaKey",m()(window.location.origin,B,"/api/preferences?id=".concat(encodeURIComponent(R)))),F=(0,te.jsx)(f.Z,{url:"".concat(m()(window.location.origin,B,"/hosted/form-collector/"),"?").concat(z.toString()),width:"100%",height:"100%",frameBorder:0,styles:{border:0}})}return(0,te.jsx)(gt,(0,i.Z)((0,i.Z)({},r),{},{children:(0,te.jsxs)(g.ZP,{container:!0,spacing:4,columns:24,children:[(0,te.jsx)(g.ZP,{item:!0,sm:7,md:5,children:(0,te.jsx)(L.Z,{tabs:I,current:R,orientation:"vertical",onChange:function(e){"preference"===e?T(!P):N((function(n){return"general"===e?n.delete("tab"):n.set("tab",e),n}))},sx:{borderRight:1,height:"100%",borderColor:"divider"}})}),(0,te.jsx)(g.ZP,{item:!0,sm:17,md:19,children:(0,te.jsx)(x.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:F})})]})}))}xt.propTypes={blocklet:u().object.isRequired,onUpdate:u().func},xt.defaultProps={onUpdate:function(){}};var gt=c.Z.div(ft||(ft=(0,r.Z)(["\n .MuiTab-root {\n text-align: left;\n align-items: flex-start;\n font-weight: normal;\n }\n .Mui-selected {\n font-weight: bold;\n }\n"])))},73820:function(e,n,t){t.d(n,{Z:function(){return f}});var r=t(33028),i=t(59740),o=t(30969),a=t(24974),l=t.n(a),s=t(99631),c=t(26022),d=t(37574),u=["children"];function f(e){var n=e.children,t=(0,i.Z)(e,u),a=(0,o.useContext)(c.RD).t;return(0,d.jsx)(s.Z,(0,r.Z)((0,r.Z)({tip:a("common.copyTip"),copiedTip:a("common.copiedTip")},t),{},{children:n}))}f.propTypes={children:l().any.isRequired}},67019:function(e,n,t){t.d(n,{Z:function(){return k}});var r=t(33028),i=t(32723),o=t(34795),a=t(96234),l=t(59740),s=t(30969),c=t(24974),d=t.n(c),u=t(38361),f=t(87006),p=t(94308),m=t(88581),h=t(27724),x=t(94551),g=t(14458),Z=t(28412),v=t(76934),b=t(37574),j=["label","disabled","required","initialValue","onChange","placeholder","style","onSubmit","secure","triggers","formatterBeforeSubmit"],y=function(e,n,t){return null===e&&n&&t?"******":e?n?"******":e:""};function k(e){var n=e.label,t=e.disabled,c=e.required,d=e.initialValue,k=e.onChange,C=e.placeholder,w=e.style,S=e.onSubmit,L=e.secure,E=e.triggers,P=e.formatterBeforeSubmit,T=(0,l.Z)(e,j),_=(0,s.useState)(!1),A=(0,a.Z)(_,2),O=A[0],N=A[1],R=(0,s.useState)(!1),I=(0,a.Z)(R,2),F=I[0],B=I[1],z=(0,s.useState)(L&&"__encrypted__"===d?null:d),U=(0,a.Z)(z,2),D=U[0],K=U[1],W=(0,s.useState)(D),q=(0,a.Z)(W,2),V=q[0],G=q[1],H=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.prev=1,e.next=4,S(V);case 4:!1===e.sent?G(D):(n=V,"function"===typeof P&&(n=P(V)),G(n),K(n)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),G(D);case 11:return e.prev=11,B(!1),N(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),M=function(e){G(e),k(e)},Y=O?(0,b.jsx)(f.Z,(0,r.Z)({style:{flex:1},fullWidth:!0,value:V,onChange:function(e){M(e.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:C,onKeyDown:function(e){"Enter"===e.key&&H()},disabled:t,type:L?"password":"text"},T)):(0,b.jsx)(u.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:y(V,L,d)});return(0,b.jsx)(Z.Z,{className:"form",style:w,children:(0,b.jsxs)(u.Z,{className:"form-item",children:[(0,b.jsxs)(u.Z,{className:"form-item-label",children:[n,c&&(0,b.jsx)(g.Z,{})]}),(0,b.jsxs)(u.Z,{className:"form-item-body",children:[(0,b.jsx)(u.Z,{className:"form-item-input",children:Y}),(0,b.jsx)(u.Z,{className:"form-item-action",children:O?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-confirm",onClick:H,disabled:t||F,size:"large",children:F?(0,b.jsx)(p.Z,{size:24}):(0,b.jsx)(h.Z,{})}),(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){G(D),N(!1)},disabled:t||F,size:"large",children:(0,b.jsx)(m.default,{})})]}):(0,b.jsx)(v.Z,{triggers:E,onEnterEdit:function(){return N(!0)},disabled:t})})]})]})})}k.propTypes={style:d().object,onSubmit:d().func,onChange:d().func,label:d().string,initialValue:d().string,placeholder:d().string,required:d().bool,disabled:d().bool,secure:d().bool,triggers:d().array,formatterBeforeSubmit:d().func},k.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},28412:function(e,n,t){var r,i=t(71171),o=t(16380),a=t(38361);n.Z=(0,o.Z)(a.Z)(r||(r=(0,i.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.down("md")}))},76934:function(e,n,t){t.d(n,{Z:function(){return Z}});var r=t(96234),i=t(30969),o=t(24974),a=t.n(o),l=t(1484),s=t(94551),c=t(72097),d=t(27265),u=t(97475),f=t(38589),p=t(46672),m=t(45761),h=t(2689),x=t(23484),g=t(37574);function Z(e){var n=e.triggers,t=e.onEnterEdit,o=e.disabled,a=i.useRef(null),Z=i.useState(!1),v=(0,r.Z)(Z,2),b=v[0],j=v[1];return 0===n.length?(0,g.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(d.Z,{variant:"outlined",ref:a,"aria-label":"split button",children:[(0,g.jsx)(c.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}),(0,g.jsx)(c.Z,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,onClick:function(){j((function(e){return!e}))},children:(0,g.jsx)(u.Z,{})})]}),(0,g.jsx)(m.Z,{sx:{zIndex:9999},open:b,anchorEl:a.current,role:void 0,placement:"bottom-end",children:(0,g.jsx)(p.Z,{children:(0,g.jsx)(f.d,{onClickAway:function(e){a.current&&a.current.contains(e.target)||j(!1)},children:(0,g.jsx)(x.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((function(e){return(0,g.jsx)(h.Z,{onClick:function(){return n=e.handler,j(!1),void n();var n},children:e.title},e.key)}))})})})})]})}Z.propTypes={triggers:a().arrayOf(a().shape({key:a().string.isRequired,title:a().string.isRequired,handler:a().func.isRequired})),onEnterEdit:a().func.isRequired,disabled:a().bool.isRequired},Z.defaultProps={triggers:[]}},14458:function(e,n,t){var r,i=t(71171),o=t(16380).Z.span(r||(r=(0,i.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(function(e){return e.theme.palette.error.main}));n.Z=o},22572:function(e,n,t){t.d(n,{V:function(){return c},Z:function(){return s}});var r=t(33028),i=t(24974),o=t.n(i),a=t(77370),l=t(37574);function s(e){var n=e.permission,t=e.role,r=e.component,i=e.children,o=(0,a.T)().session,l=!0,s=[].concat(n).filter(Boolean),c=[].concat(t).filter(Boolean);if(s.length){var d=o.user&&o.user.permissions||[];l=s.some((function(e){return d.includes(e)}))}return l&&c.length&&(l=c.includes(o.user.role)),"function"===typeof r?r(l):"function"===typeof i?i(l):l&&(r||i)||null}function c(e,n,t){return function(i){return(0,l.jsx)(s,{permission:n,role:t,children:function(n){return(0,l.jsx)(e,(0,r.Z)((0,r.Z)({},i),{},{hasPermission:n}))}})}}s.propTypes={permission:o().oneOfType([o().string,o().arrayOf(o().string)]),role:o().oneOfType([o().string,o().arrayOf(o().string)]),component:o().oneOfType([o().func,o().node]),children:o().oneOfType([o().func,o().node])},s.defaultProps={permission:"",role:"",component:null,children:null}},19066:function(e,n,t){t.d(n,{C:function(){return r}});var r="true"===localStorage.getItem("enableDebug")},70115:function(e,n,t){var r=t(39517),i=t(87642),o=t(64076),a=t(20244);n.Z=[{value:a.WHO_CAN_ACCESS.ALL,icon:o.Z,title:{zh:"\u6240\u6709\u4eba\u53ef\u8bbf\u95ee",en:"Accessible to all"},description:{zh:"\u5411\u6240\u6709\u4eba\u5f00\u653e\uff0c\u65e0\u9700\u901a\u884c\u8bc1\u5373\u53ef\u8bbf\u95ee\u5e94\u7528",en:"Open to the world anyone can access without passport"}},{value:a.WHO_CAN_ACCESS.INVITED,icon:i.Z,title:{zh:"\u53ea\u6709\u88ab\u9080\u8bf7\u7684\u4eba\u53ef\u4ee5\u8bbf\u95ee",en:"Only invited people can access"},description:{zh:"\u7a0d\u540e\u60a8\u53ef\u4ee5\u5728\u7ba1\u7406\u9875\u9762\u4e2d\u9080\u8bf7\u6210\u5458",en:"You can invite members later in the admin page"}},{value:a.WHO_CAN_ACCESS.OWNER,icon:r.Z,title:{zh:"\u53ea\u6709\u5e94\u7528\u6240\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee",en:"Only Owner of the blocklet can access"},description:{zh:"\u5fc5\u987b\u63d0\u4f9b\u6240\u6709\u8005\u901a\u884c\u8bc1\u624d\u80fd\u8bbf\u95ee\u5e94\u7528",en:"You must provide owner passport to access this application"}}]}}]);
|
|
2
|
+
//# sourceMappingURL=4802.217e3956.chunk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[4882],{4882:function(e,t,n){n.r(t),n.d(t,{default:function(){return l}});var s,r=n(71171),a=n(30969),c=n(16380),o=n(26022),u=n(20003),i=n(37574);function l(){var e=(0,a.useContext)(o.RD).t;return(0,i.jsx)(d,{style:{paddingTop:"25vh"},children:(0,i.jsx)(u.Z,{status:"404",description:e("noMatch.desc"),style:{backgroundColor:"transparent"}})})}var d=c.Z.main(s||(s=(0,r.Z)([""])))}}]);
|
|
2
|
+
//# sourceMappingURL=4882.0435e418.chunk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[5070,5434],{46513:function(e,n,t){"use strict";n.Z=void 0;(r=t(30969))&&r.__esModule;var r,i=t(37574);function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){c(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var u=function(e){return(0,i.jsx)("svg",a(a({},e),{},{children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.606 17.32a7.933 7.933 0 0 1-.581-1.18c-.165-.411-.312-.86-.44-1.339a7.639 7.639 0 0 0-1.586 1.054 7.69 7.69 0 0 0 2.607 1.465zm.657-1.675c-.16-.4-.305-.848-.429-1.335A7.643 7.643 0 0 1 10 14h.002c.734 0 1.463.104 2.165.31-.124.487-.268.935-.428 1.335-.283.707-.604 1.235-.925 1.575-.32.339-.595.447-.813.447-.218 0-.493-.108-.813-.447-.322-.34-.642-.867-.925-1.575zM10 12.667a8.976 8.976 0 0 1 2.436.334c.116-.727.193-1.511.22-2.334H7.344c.027.823.103 1.607.22 2.334A8.972 8.972 0 0 1 10 12.667zM7.345 9.333c.027-.823.103-1.607.22-2.334.791.223 1.61.335 2.436.334A8.974 8.974 0 0 0 12.437 7c.116.727.193 1.511.22 2.334H7.344zm6.646 1.334c-.03.982-.127 1.925-.28 2.797.81.367 1.56.852 2.227 1.439a7.666 7.666 0 0 0 1.734-4.236h-3.681zm3.681-1.334H13.99a19.718 19.718 0 0 0-.28-2.798 8.975 8.975 0 0 0 2.228-1.438 7.665 7.665 0 0 1 1.734 4.236zm1.329.669A9 9 0 1 1 1 10a9 9 0 0 1 18 0v.002zM2.329 9.333a7.665 7.665 0 0 1 1.734-4.236A8.974 8.974 0 0 0 6.29 6.535a19.74 19.74 0 0 0-.28 2.798H2.329zm0 1.334h3.682c.03.983.126 1.925.28 2.797a8.974 8.974 0 0 0-2.228 1.439 7.665 7.665 0 0 1-1.734-4.236zm10.648 5.473c.164-.411.312-.86.44-1.34.57.285 1.103.639 1.585 1.055a7.687 7.687 0 0 1-2.606 1.465c.216-.354.41-.751.58-1.18zm-.581-13.46c.967.316 1.85.819 2.606 1.465A7.64 7.64 0 0 1 13.417 5.2c-.128-.48-.276-.928-.44-1.34a7.925 7.925 0 0 0-.581-1.18zm-.657 1.675c.16.4.304.848.428 1.335a7.64 7.64 0 0 1-2.165.31H10a7.64 7.64 0 0 1-2.166-.31c.124-.487.268-.935.429-1.335.283-.708.603-1.235.925-1.575.32-.339.595-.447.813-.447.218 0 .492.108.813.447.321.34.642.867.925 1.575zM7.025 3.86c-.165.411-.312.86-.44 1.34a7.64 7.64 0 0 1-1.586-1.055A7.688 7.688 0 0 1 7.606 2.68c-.216.354-.41.751-.581 1.18z",fill:"currentColor"})}))};u.defaultProps={width:"21",height:"20",viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg"},u.displayName="globe";var s=u;n.Z=s},26681:function(e,n,t){"use strict";t.d(n,{Z:function(){return O}});var r,i,o=t(71171),a=t(33028),c=t(96234),u=t(59740),s=t(30969),l=t(24974),f=t.n(l),d=t(72097),h=t(94551),p=t(38361),v=t(33359),g=t(38589),b=t(23484),m=t(2689),y=t(45761),w=t(38996),x=t(46513),k=t(79216),j=t(26022),_=t(55581),Z=t(37574),A=["showText","popperProps","popperType","icon","size"];function O(e){var n,t,r,i=e.showText,o=e.popperProps,l=e.popperType,f=e.icon,y=e.size,k=(0,u.Z)(e,A),O=(0,s.useContext)(j.RD),S=O.locale,M=O.changeLocale,T=O.languages,I=(0,s.useRef)(null),E=(0,s.useState)(!1),z=(0,c.Z)(E,2),N=z[0],L=z[1],R=(0,_.Fg)(),F="dark"===(null===R||void 0===R||null===(n=R.palette)||void 0===n?void 0:n.mode),D=i?d.Z:h.Z,J="hover"===l?{onMouseEnter:function(){L(!0)},onMouseLeave:function(){L(!1)}}:{onClick:function(){L(!N)}},B=(0,s.useMemo)((function(){return f?(0,Z.jsx)(f,{}):(0,Z.jsx)(x.Z,{style:{width:"auto",height:y,color:R.palette.text.secondary}})}),[f,null===R||void 0===R||null===(t=R.palette)||void 0===t||null===(r=t.text)||void 0===r?void 0:r.secondary,y]);return(0,Z.jsxs)(C,(0,a.Z)((0,a.Z)((0,a.Z)({component:"div",dark:F,theme:R},k),J),{},{children:[(0,Z.jsx)(D,{ref:I,className:"trigger",role:"button","aria-label":"Locale selector button",children:(0,Z.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[B,i?(0,Z.jsx)(v.Z,{component:"strong",className:"trigger-text",children:T.find((function(e){return e.code===S})).name}):""]})}),(0,Z.jsx)(P,(0,a.Z)((0,a.Z)({open:N,anchorEl:I.current},o),{},{disablePortal:!0,children:(0,Z.jsx)("div",{className:"locales",children:(0,Z.jsx)(g.d,{onClickAway:function(e){var n;null!==(n=I.current)&&void 0!==n&&n.contains(e.target)||L(!1)},children:(0,Z.jsx)(b.Z,{children:T.map((function(n){var t=n.code,r=n.name;return(0,Z.jsxs)(m.Z,{className:"locale-item",onClick:function(){return M(n=t),L(!1),void("function"===typeof e.onChange&&e.onChange(n));var n},children:[(0,Z.jsx)(w.default,{className:t===S?"check-icon check-icon-visible":"check-icon",fontSize:"small"}),r]},t)}))})})})}))]}))}O.propTypes={size:f().number,showText:f().bool,popperProps:f().object,onChange:f().func,popperType:f().oneOf(["hover","click"]),icon:f().any},O.defaultProps={showText:!0,size:24,popperProps:{},onChange:function(){},popperType:"click",icon:null};var C=(0,_.zo)("div",{shouldForwardProp:function(e){return"dark"!==e}})(r||(r=(0,o.Z)(["\n display: inline-block;\n\n .trigger {\n display: flex;\n flex-direction: column;\n justify-content: center;\n font-size: 14px;\n white-space: nowrap;\n\n .trigger-text {\n margin-left: 5px;\n font-size: 14px;\n color: ",";\n }\n }\n\n .locales {\n background: ",";\n box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);\n }\n\n .locale-item {\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: 2px;\n text-align: center;\n color: ",";\n cursor: pointer;\n display: flex;\n padding: 16px;\n align-items: center;\n .check-icon {\n visibility: hidden;\n margin-right: 4px;\n }\n .check-icon-visible {\n visibility: visible;\n }\n }\n"])),(function(e){return(0,k.Lq)(e)}),(function(e){return(0,k.Vu)(e)}),(function(e){return(0,k.Lq)(e)})),P=(0,_.zo)(y.Z)(i||(i=(0,o.Z)(["\n z-index: ",";\n"])),(function(e){return e.theme.zIndex.tooltip+10}))},56368:function(e,n,t){"use strict";t.d(n,{KN:function(){return l},Kb:function(){return p},RX:function(){return d},iU:function(){return s}});var r,i,o,a,c=t(33028),u=t(97347),s=(null===(r=window)||void 0===r||null===(i=r.blocklet)||void 0===i?void 0:i.groupPrefix)||(null===(o=window)||void 0===o||null===(a=o.blocklet)||void 0===a?void 0:a.prefix)||"/",l=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";if(null===e||void 0===e||!e.length)return e;var t=function(e,n){return"string"===typeof e?e:"object"===typeof e?e[n]||(null===e||void 0===e?void 0:e.en)||(null===e||void 0===e?void 0:e.zh):e},r=function(e,n){if("string"===typeof e){if((0,u.CB)(e)){var t=new URL(e);return t.searchParams.set("locale",n),t.href}var r=new URL(e,window.location.origin);return r.searchParams.set("locale",n),r.pathname+r.search}return"object"===typeof e?e[n]||(null===e||void 0===e?void 0:e.en)||(null===e||void 0===e?void 0:e.zh):e};return(0,u._J)(e,(function(e){var i;return(0,c.Z)((0,c.Z)({},e),{},{title:t(e.title,n),link:null!==(i=e.items)&&void 0!==i&&i.length?e.link:r(e.link,n)})}),"items")},f=function(e){if(null===e||void 0===e||!e.length)return null;var n=function(e){return(0,u._J)(e,(function(e){return e.role?(0,c.Z)((0,c.Z)({},e),{},{role:Array.isArray(e.role)?e.role:[e.role]}):e}),"items")}(e),t={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[]};return n.forEach((function(e){if(e.section){if(Array.isArray(e.section))e.section.forEach((function(n){var r;null===(r=t[n])||void 0===r||r.push(e)}));else if("string"===typeof e.section){var n;null===(n=t[e.section])||void 0===n||n.push(e)}}else t.header.push(e)})),t},d=function(e){if(!e)return null;var n=(0,c.Z)({},e);return n.theme=function(e){var n=(0,c.Z)({},e),t=null===e||void 0===e?void 0:e.background;return"string"===typeof t?n.background={header:t,footer:t,default:t}:t&&"object"===typeof t&&(n.background={header:t.header||t.default,footer:t.footer||t.default,default:t.default}),n}(n.theme),n.navigation=f(h(n.navigation)),n},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,u.fA)(e,(function(e,n){var t;return!!e.link||(null===(t=n.filteredChildren)||void 0===t?void 0:t.length)}),"items")},p=function(e,n){return(0,u.fA)(e,(function(e,t){var r,i=!e.role||n&&e.role.includes(n);return t.isLeaf?i:i&&(null===(r=t.filteredChildren)||void 0===r?void 0:r.length)}),"items")}},11689:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var r=t(68079),i=t(33028),o=(t(86204),t(30969)),a=t(24974),c=t.n(a),u=t(37574),s=t(82972),l=t(87843),f=t(26681),d=t(26022),h=t(26862),p=t(56368);function v(e){var n,t,a,c,h=e.formattedBlocklet,v=e.addons,g=e.sessionManagerProps,b=(0,o.useContext)(s.B3),m=((0,d.PE)()||{}).locale,y=h.enableConnect,w=void 0===y||y,x=h.enableLocale,k=void 0===x||x,j=!(null===b||void 0===b||null===(n=b.session)||void 0===n||!n.user),_=(0,p.KN)(null===h||void 0===h||null===(t=h.navigation)||void 0===t?void 0:t.sessionManager,m)||[];_=(0,p.Kb)(_,null===b||void 0===b||null===(a=b.session)||void 0===a||null===(c=a.user)||void 0===c?void 0:c.role);var Z=function(){if(v&&"function"!==typeof v)return Array.isArray(v)?v:[v];var e=[];if(k&&m&&e.push((0,u.jsx)(f.Z,{showText:!1},"locale-selector")),w&&b){var n=[];if(j)(_?_.slice(0,5):[]).forEach((function(e){n.push({label:e.title,icon:e.icon?(0,u.jsx)("iconify-icon",{icon:e.icon,height:24,style:{marginRight:8}}):null,component:"a",href:e.link,key:e.link})}));e.push((0,u.jsx)(l.Z,(0,i.Z)({session:b.session,locale:m,menu:n,showRole:!0},g),"session-manager"))}return"function"===typeof v&&(e=v(e)||[]),e}();return o.createElement.apply(void 0,[u.Fragment,null].concat((0,r.Z)(Array.isArray(Z)?Z:[Z])))}v.propTypes={formattedBlocklet:c().object.isRequired,addons:c().oneOfType([c().func,c().node]),sessionManagerProps:h.Z},v.defaultProps={addons:null,sessionManagerProps:{showRole:!0}}},23906:function(e,n,t){"use strict";t.d(n,{x:function(){return c}});var r=t(30969),i=t(92771),o=t(45434),a=t.n(o),c=function(){var e=(0,i.Z)();(0,r.useEffect)((function(){e.wallet&&a().call("arcHideTopBar","{}")}),[e])}},26862:function(e,n,t){"use strict";t.d(n,{I:function(){return o},Z:function(){return a}});var r=t(24974),i=t.n(r),o=i().shape({appLogo:i().node,appName:i().string,theme:i().shape({background:i().string}),enableConnect:i().bool,enableLocale:i().bool,navigation:i().arrayOf(i().shape({title:i().oneOfType([i().string,i().object]),link:i().oneOfType([i().string,i().object]),icon:i().string,items:i().arrayOf(i().shape({title:i().oneOfType([i().string,i().object]),link:i().oneOfType([i().string,i().object])}))}))}),a=i().shape({showText:i().bool,showRole:i().bool,switchDid:i().bool,switchProfile:i().bool,switchPassport:i().bool,disableLogout:i().bool,onLogin:i().func,onLogout:i().func,onSwitchDid:i().func,onSwitchProfile:i().func,onSwitchPassport:i().func,menu:i().array,menuRender:i().func,dark:i().bool,size:i().number})},97347:function(e,n,t){"use strict";t.d(n,{CB:function(){return u},Ik:function(){return a},RX:function(){return l},Xk:function(){return s},_J:function(){return o},fA:function(){return c}});var r=t(56666),i=t(33028),o=function e(n,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return n.map((function(n){return Array.isArray(n[o])?t((0,i.Z)((0,i.Z)({},n),{},(0,r.Z)({},o,e(n[o],t,o)))):t(n)}))},a=function(e){var n=[];return o(e,(function(e){return n.push(e)}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:"children"),n},c=function e(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return n.map((function(e){return(0,i.Z)({},e)})).filter((function(n){var i=n[r];if(Array.isArray(i)){var o=e(i,t,r);n[r]=null!==o&&void 0!==o&&o.length?o:void 0}var a={filteredChildren:n[r],isLeaf:!(null!==i&&void 0!==i&&i.length)};return t(n,a)}))},u=function(e){return/^https?:\/\//.test(e)},s=function(e){return/^[\w-]+:[\w-]+$/.test(e)},l=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e,n){return{path:e,index:n}})).filter((function(e){return function(e){if(!e||null===e||void 0===e||!e.startsWith("/"))return!1;var n=function(e){return e.endsWith("/")?e:"".concat(e,"/")},t=n(window.location.pathname),r=n(new URL(e,window.location.origin).pathname);return t.startsWith(r)}(e.path)}));return null!==e&&void 0!==e&&e.length?e.slice(1).reduce((function(e,n){return e.path.length>=n.path.length?e:n}),e[0]).index:-1}},45434:function(e){var n={default:this,call:function(e,n,t){var r="";"function"==typeof n&&(t=n,n={});var i={data:void 0===n?null:n};if("function"==typeof t){var o="dscb"+window.dscb++;window[o]=t,i._dscbstub=o}return i=JSON.stringify(i),window._dsbridge?r=_dsbridge.call(e,i):(window._dswk||-1!=navigator.userAgent.indexOf("_dsbridge"))&&(r=prompt("_dsbridge="+e,i)),JSON.parse(r||"{}").data},register:function(e,t,r){var i=r?window._dsaf:window._dsf;window._dsInit||(window._dsInit=!0,setTimeout((function(){n.call("_dsb.dsinit")}),0)),"object"==typeof t?i._obs[e]=t:i[e]=t},registerAsyn:function(e,n){this.register(e,n,!0)},hasNativeMethod:function(e,n){return this.call("_dsb.hasNativeMethod",{name:e,type:n||"all"})},disableJavascriptDialogBlock:function(e){this.call("_dsb.disableJavascriptDialogBlock",{disable:!1!==e})}};!function(){if(!window._dsf){var e={_dsf:{_obs:{}},_dsaf:{_obs:{}},dscb:0,dsBridge:n,close:function(){n.call("_dsb.closePage")},_handleMessageFromNative:function(e){var t=JSON.parse(e.data),r={id:e.callbackId,complete:!0},i=this._dsf[e.method],o=this._dsaf[e.method],a=function(e,i){r.data=e.apply(i,t),n.call("_dsb.returnValue",r)},c=function(e,i){t.push((function(e,t){r.data=e,r.complete=!1!==t,n.call("_dsb.returnValue",r)})),e.apply(i,t)};if(i)a(i,this._dsf);else if(o)c(o,this._dsaf);else{var u=e.method.split(".");if(u.length<2)return;var s=u.pop(),l=u.join("."),f=this._dsf._obs,d=f[l]||{},h=d[s];if(h&&"function"==typeof h)return void a(h,d);if((h=(d=(f=this._dsaf._obs)[l]||{})[s])&&"function"==typeof h)return void c(h,d)}}};for(var t in e)window[t]=e[t];n.register("_hasJavascriptMethod",(function(e,n){var t=e.split(".");if(t.length<2)return!(!_dsf[t]&&!_dsaf[t]);e=t.pop();var r=t.join("."),i=_dsf._obs[r]||_dsaf._obs[r];return i&&!!i[e]}))}}(),e.exports=n},86204:function(e,n,t){"use strict";var r=t(9249),i=t(87371),o=t(80753),a=t(45754),c=t(86906),u=t(56666),s=t(33028),l=Object.freeze({left:0,top:0,width:16,height:16}),f=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),d=Object.freeze((0,s.Z)((0,s.Z)({},l),f)),h=Object.freeze((0,s.Z)((0,s.Z)({},d),{},{body:"",hidden:!1})),p=Object.freeze({width:null,height:null}),v=Object.freeze((0,s.Z)((0,s.Z)({},p),f));var g=/[\s,]+/;var b=(0,s.Z)((0,s.Z)({},v),{},{preserveAspectRatio:""});function m(e){var n,t=(0,s.Z)({},b),r=function(n,t){return e.getAttribute(n)||t};return t.width=r("width",null),t.height=r("height",null),t.rotate=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=e.replace(/^-?[0-9.]*/,"");function r(e){for(;e<0;)e+=4;return e%4}if(""===t){var i=parseInt(e);return isNaN(i)?0:r(i)}if(t!==e){var o=0;switch(t){case"%":o=25;break;case"deg":o=90}if(o){var a=parseFloat(e.slice(0,e.length-t.length));return isNaN(a)?0:(a/=o)%1===0?r(a):0}}return n}(r("rotate","")),n=t,r("flip","").split(g).forEach((function(e){switch(e.trim()){case"horizontal":n.hFlip=!0;break;case"vertical":n.vFlip=!0}})),t.preserveAspectRatio=r("preserveAspectRatio",r("preserveaspectratio","")),t}var y=/^[a-z0-9]+(-[a-z0-9]+)*$/,w=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=e.split(":");if("@"===e.slice(0,1)){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){var o=i.pop(),a=i.pop(),c={provider:i.length>0?i[0]:r,prefix:a,name:o};return n&&!x(c)?null:c}var u=i[0],s=u.split("-");if(s.length>1){var l={provider:r,prefix:s.shift(),name:s.join("-")};return n&&!x(l)?null:l}if(t&&""===r){var f={provider:r,prefix:"",name:u};return n&&!x(f,t)?null:f}return null},x=function(e,n){return!!e&&!(""!==e.provider&&!e.provider.match(y)||!(n&&""===e.prefix||e.prefix.match(y))||!e.name.match(y))};function k(e,n){var t=function(e,n){var t={};!e.hFlip!==!n.hFlip&&(t.hFlip=!0),!e.vFlip!==!n.vFlip&&(t.vFlip=!0);var r=((e.rotate||0)+(n.rotate||0))%4;return r&&(t.rotate=r),t}(e,n);for(var r in h)r in f?r in e&&!(r in t)&&(t[r]=f[r]):r in n?t[r]=n[r]:r in e&&(t[r]=e[r]);return t}function j(e,n,t){var r=e.icons,i=e.aliases||Object.create(null),o={};function a(e){o=k(r[e]||i[e],o)}return a(n),t.forEach(a),k(e,o)}function _(e,n){var t=[];if("object"!==typeof e||"object"!==typeof e.icons)return t;e.not_found instanceof Array&&e.not_found.forEach((function(e){n(e,null),t.push(e)}));var r=function(e,n){var t=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);return(n||Object.keys(t).concat(Object.keys(r))).forEach((function e(n){if(t[n])return i[n]=[];if(!(n in i)){i[n]=null;var o=r[n]&&r[n].parent,a=o&&e(o);a&&(i[n]=[o].concat(a))}return i[n]})),i}(e);for(var i in r){var o=r[i];o&&(n(i,j(e,i,o)),t.push(i))}return t}var Z=(0,s.Z)({provider:"",aliases:{},not_found:{}},l);function A(e,n){for(var t in n)if(t in e&&typeof e[t]!==typeof n[t])return!1;return!0}function O(e){if("object"!==typeof e||null===e)return null;var n=e;if("string"!==typeof n.prefix||!e.icons||"object"!==typeof e.icons)return null;if(!A(e,Z))return null;var t=n.icons;for(var r in t){var i=t[r];if(!r.match(y)||"string"!==typeof i.body||!A(i,h))return null}var o=n.aliases||Object.create(null);for(var a in o){var c=o[a],u=c.parent;if(!a.match(y)||"string"!==typeof u||!t[u]&&!o[u]||!A(c,h))return null}return n}var C=Object.create(null);function P(e,n){var t=C[e]||(C[e]=Object.create(null));return t[n]||(t[n]=function(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}(e,n))}function S(e,n){return O(n)?_(n,(function(n,t){t?e.icons[n]=t:e.missing.add(n)})):[]}function M(e,n){var t=[];return("string"===typeof e?[e]:Object.keys(C)).forEach((function(e){("string"===typeof e&&"string"===typeof n?[n]:Object.keys(C[e]||{})).forEach((function(n){var r=P(e,n);t=t.concat(Object.keys(r.icons).map((function(t){return(""!==e?"@"+e+":":"")+n+":"+t})))}))})),t}var T=!1;function I(e){return"boolean"===typeof e&&(T=e),T}function E(e){var n="string"===typeof e?w(e,!0,T):e;if(n){var t=P(n.provider,n.prefix),r=n.name;return t.icons[r]||(t.missing.has(r)?null:void 0)}}function z(e,n){var t=w(e,!0,T);return!!t&&function(e,n,t){try{if("string"===typeof t.body)return e.icons[n]=(0,s.Z)({},t),!0}catch(r){}return!1}(P(t.provider,t.prefix),t.name,n)}function N(e,n){if("object"!==typeof e)return!1;if("string"!==typeof n&&(n=e.provider||""),T&&!n&&!e.prefix){var t=!1;return O(e)&&(e.prefix="",_(e,(function(e,n){n&&z(e,n)&&(t=!0)}))),t}var r=e.prefix;return!!x({provider:n,prefix:r,name:"a"})&&!!S(P(n,r),e)}function L(e){return!!E(e)}function R(e){var n=E(e);return n?(0,s.Z)((0,s.Z)({},d),n):null}function F(e,n){e.forEach((function(e){var t=e.loaderCallbacks;t&&(e.loaderCallbacks=t.filter((function(e){return e.id!==n})))}))}var D=0;var J=Object.create(null);function B(e,n){J[e]=n}function q(e){return J[e]||J[""]}var H={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Q(e,n,t,r){var i,o=e.resources.length,a=e.random?Math.floor(Math.random()*o):e.index;if(e.random){var c=e.resources.slice(0);for(i=[];c.length>1;){var u=Math.floor(Math.random()*c.length);i.push(c[u]),c=c.slice(0,u).concat(c.slice(u+1))}i=i.concat(c)}else i=e.resources.slice(a).concat(e.resources.slice(0,a));var s,l=Date.now(),f="pending",d=0,h=null,p=[],v=[];function g(){h&&(clearTimeout(h),h=null)}function b(){"pending"===f&&(f="aborted"),g(),p.forEach((function(e){"pending"===e.status&&(e.status="aborted")})),p=[]}function m(e,n){n&&(v=[]),"function"===typeof e&&v.push(e)}function y(){f="failed",v.forEach((function(e){e(void 0,s)}))}function w(){p.forEach((function(e){"pending"===e.status&&(e.status="aborted")})),p=[]}function x(){if("pending"===f){g();var r=i.shift();if(void 0===r)return p.length?void(h=setTimeout((function(){g(),"pending"===f&&(w(),y())}),e.timeout)):void y();var o={status:"pending",resource:r,callback:function(n,t){!function(n,t,r){var o="success"!==t;switch(p=p.filter((function(e){return e!==n})),f){case"pending":break;case"failed":if(o||!e.dataAfterTimeout)return;break;default:return}if("abort"===t)return s=r,void y();if(o)return s=r,void(p.length||(i.length?x():y()));if(g(),w(),!e.random){var a=e.resources.indexOf(n.resource);-1!==a&&a!==e.index&&(e.index=a)}f="completed",v.forEach((function(e){e(r)}))}(o,n,t)}};p.push(o),d++,h=setTimeout(x,e.rotate),t(r,n,o.callback)}}return"function"===typeof r&&v.push(r),setTimeout(x),function(){return{startTime:l,payload:n,status:f,queriesSent:d,queriesPending:p.length,subscribe:m,abort:b}}}function U(e){var n=(0,s.Z)((0,s.Z)({},H),e),t=[];function r(){t=t.filter((function(e){return"pending"===e().status}))}return{query:function(e,i,o){var a=Q(n,e,i,(function(e,n){r(),o&&o(e,n)}));return t.push(a),a},find:function(e){return t.find((function(n){return e(n)}))||null},setIndex:function(e){n.index=e},getIndex:function(){return n.index},cleanup:r}}function K(e){var n;if("string"===typeof e.resources)n=[e.resources];else if(!((n=e.resources)instanceof Array)||!n.length)return null;return{resources:n,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}for(var V=Object.create(null),$=["https://api.simplesvg.com","https://api.unisvg.com"],W=[];$.length>0;)1===$.length||Math.random()>.5?W.push($.shift()):W.push($.pop());function X(e,n){var t=K(n);return null!==t&&(V[e]=t,!0)}function G(e){return V[e]}function Y(){return Object.keys(V)}function ee(){}V[""]=K({resources:["https://api.iconify.design"].concat(W)});var ne=Object.create(null);function te(e,n,t){var r,i;if("string"===typeof e){var o=q(e);if(!o)return t(void 0,424),ee;i=o.send;var a=function(e){if(!ne[e]){var n=G(e);if(!n)return;var t={config:n,redundancy:U(n)};ne[e]=t}return ne[e]}(e);a&&(r=a.redundancy)}else{var c=K(e);if(c){r=U(c);var u=q(e.resources?e.resources[0]:"");u&&(i=u.send)}}return r&&i?r.query(n,i,t)().abort:(t(void 0,424),ee)}var re="iconify2",ie="iconify",oe=ie+"-count",ae=ie+"-version",ce=36e5,ue=168;function se(e,n){try{return e.getItem(n)}catch(t){}}function le(e,n,t){try{return e.setItem(n,t),!0}catch(r){}}function fe(e,n){try{e.removeItem(n)}catch(t){}}function de(e,n){return le(e,oe,n.toString())}function he(e){return parseInt(se(e,oe))||0}var pe={local:!0,session:!0},ve={local:new Set,session:new Set},ge=!1;var be="undefined"===typeof window?{}:window;function me(e){var n=e+"Storage";try{if(be&&be[n]&&"number"===typeof be[n].length)return be[n]}catch(t){}pe[e]=!1}function ye(e,n){var t=me(e);if(t){var r=se(t,ae);if(r!==re){if(r)for(var i=he(t),o=0;o<i;o++)fe(t,ie+o.toString());return le(t,ae,re),void de(t,0)}for(var a=Math.floor(Date.now()/ce)-ue,c=function(e){var r=ie+e.toString(),i=se(t,r);if("string"===typeof i){try{var o=JSON.parse(i);if("object"===typeof o&&"number"===typeof o.cached&&o.cached>a&&"string"===typeof o.provider&&"object"===typeof o.data&&"string"===typeof o.data.prefix&&n(o,e))return!0}catch(c){}fe(t,r)}},u=he(t),s=u-1;s>=0;s--)c(s)||(s===u-1?(u--,de(t,u)):ve[e].add(s))}}function we(){if(!ge)for(var e in ge=!0,pe)ye(e,(function(e){var n=e.data,t=P(e.provider,n.prefix);if(!S(t,n).length)return!1;var r=n.lastModified||-1;return t.lastModifiedCached=t.lastModifiedCached?Math.min(t.lastModifiedCached,r):r,!0}))}function xe(e,n){function t(t){var r;if(pe[t]&&(r=me(t))){var i,o=ve[t];if(o.size)o.delete(i=Array.from(o).shift());else if(!de(r,(i=he(r))+1))return;var a={cached:Math.floor(Date.now()/ce),provider:e.provider,data:n};return le(r,ie+i.toString(),JSON.stringify(a))}}ge||we(),n.lastModified&&!function(e,n){var t=e.lastModifiedCached;if(t&&t>=n)return t===n;if(e.lastModifiedCached=n,t)for(var r in pe)ye(r,(function(t){var r=t.data;return t.provider!==e.provider||r.prefix!==e.prefix||r.lastModified===n}));return!0}(e,n.lastModified)||Object.keys(n.icons).length&&(n.not_found&&delete(n=Object.assign({},n)).not_found,t("local")||t("session"))}function ke(){}function je(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout((function(){e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout((function(){e.pendingCallbacksFlag=!1;var n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(n.length){var t=!1,r=e.provider,i=e.prefix;n.forEach((function(n){var o=n.icons,a=o.pending.length;o.pending=o.pending.filter((function(n){if(n.prefix!==i)return!0;var a=n.name;if(e.icons[a])o.loaded.push({provider:r,prefix:i,name:a});else{if(!e.missing.has(a))return t=!0,!0;o.missing.push({provider:r,prefix:i,name:a})}return!1})),o.pending.length!==a&&(t||F([e],n.id),n.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),n.abort))}))}})))}(e)})))}var _e=function(e,n){var t=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[];return e.forEach((function(e){var i="string"===typeof e?w(e,n,t):e;i&&r.push(i)})),r}(e,!0,I()),r=function(e){var n={loaded:[],missing:[],pending:[]},t=Object.create(null);e.sort((function(e,n){return e.provider!==n.provider?e.provider.localeCompare(n.provider):e.prefix!==n.prefix?e.prefix.localeCompare(n.prefix):e.name.localeCompare(n.name)}));var r={provider:"",prefix:"",name:""};return e.forEach((function(e){if(r.name!==e.name||r.prefix!==e.prefix||r.provider!==e.provider){r=e;var i=e.provider,o=e.prefix,a=e.name,c=t[i]||(t[i]=Object.create(null)),u=c[o]||(c[o]=P(i,o)),s={provider:i,prefix:o,name:a};(a in u.icons?n.loaded:""===o||u.missing.has(a)?n.missing:n.pending).push(s)}})),n}(t);if(!r.pending.length){var i=!0;return n&&setTimeout((function(){i&&n(r.loaded,r.missing,r.pending,ke)})),function(){i=!1}}var o,a,c=Object.create(null),u=[];return r.pending.forEach((function(e){var n=e.provider,t=e.prefix;if(t!==a||n!==o){o=n,a=t,u.push(P(n,t));var r=c[n]||(c[n]=Object.create(null));r[t]||(r[t]=[])}})),r.pending.forEach((function(e){var n=e.provider,t=e.prefix,r=e.name,i=P(n,t),o=i.pendingIcons||(i.pendingIcons=new Set);o.has(r)||(o.add(r),c[n][t].push(r))})),u.forEach((function(e){var n=e.provider,t=e.prefix;c[n][t].length&&function(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout((function(){e.iconsQueueFlag=!1;var n,t=e.provider,r=e.prefix,i=e.iconsToLoad;delete e.iconsToLoad,i&&(n=q(t))&&n.prepare(t,r,i).forEach((function(n){te(t,n,(function(t){if("object"!==typeof t)n.icons.forEach((function(n){e.missing.add(n)}));else try{var r=S(e,t);if(!r.length)return;var i=e.pendingIcons;i&&r.forEach((function(e){i.delete(e)})),xe(e,t)}catch(o){console.error(o)}je(e)}))}))})))}(e,c[n][t])})),n?function(e,n,t){var r=D++,i=F.bind(null,t,r);if(!n.pending.length)return i;var o={id:r,icons:n,callback:e,abort:i};return t.forEach((function(e){(e.loaderCallbacks||(e.loaderCallbacks=[])).push(o)})),i}(n,r,u):ke},Ze=function(e){return new Promise((function(n,t){var r="string"===typeof e?w(e,!0):e;r?_e([r||e],(function(i){if(i.length&&r){var o=E(r);if(o)return void n((0,s.Z)((0,s.Z)({},d),o))}t(e)})):t(e)}))};function Ae(e,n){var t="string"===typeof e?w(e,!0,!0):null;if(!t){var r=function(e){try{var n="string"===typeof e?JSON.parse(e):e;if("string"===typeof n.body)return(0,s.Z)({},n)}catch(t){}}(e);return{value:e,data:r}}var i=E(t);if(void 0!==i||!t.prefix)return{value:e,name:t,data:i};var o=_e([t],(function(){return n(e,t,E(t))}));return{value:e,name:t,loading:o}}function Oe(e){return e.hasAttribute("inline")}var Ce=!1;try{Ce=0===navigator.vendor.indexOf("Apple")}catch(on){}var Pe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Se=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Me(e,n,t){if(1===n)return e;if(t=t||100,"number"===typeof e)return Math.ceil(e*n*t)/t;if("string"!==typeof e)return e;var r=e.split(Pe);if(null===r||!r.length)return e;for(var i=[],o=r.shift(),a=Se.test(o);;){if(a){var c=parseFloat(o);isNaN(c)?i.push(o):i.push(Math.ceil(c*n*t)/t)}else i.push(o);if(void 0===(o=r.shift()))return i.join("");a=!a}}var Te=function(e){return"unset"===e||"undefined"===e||"none"===e};function Ie(e,n){var t=(0,s.Z)((0,s.Z)({},d),e),r=(0,s.Z)((0,s.Z)({},v),n),i={left:t.left,top:t.top,width:t.width,height:t.height},o=t.body;[t,r].forEach((function(e){var n,t=[],r=e.hFlip,a=e.vFlip,c=e.rotate;switch(r?a?c+=2:(t.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),t.push("scale(-1 1)"),i.top=i.left=0):a&&(t.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),t.push("scale(1 -1)"),i.top=i.left=0),c<0&&(c-=4*Math.floor(c/4)),c%=4){case 1:n=i.height/2+i.top,t.unshift("rotate(90 "+n.toString()+" "+n.toString()+")");break;case 2:t.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:n=i.width/2+i.left,t.unshift("rotate(-90 "+n.toString()+" "+n.toString()+")")}c%2===1&&(i.left!==i.top&&(n=i.left,i.left=i.top,i.top=n),i.width!==i.height&&(n=i.width,i.width=i.height,i.height=n)),t.length&&(o='<g transform="'+t.join(" ")+'">'+o+"</g>")}));var a,c,u=r.width,l=r.height,f=i.width,h=i.height;null===u?a=Me(c=null===l?"1em":"auto"===l?h:l,f/h):(a="auto"===u?f:u,c=null===l?Me(a,h/f):"auto"===l?h:l);var p={},g=function(e,n){Te(n)||(p[e]=n.toString())};return g("width",a),g("height",c),p.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+h.toString(),{attributes:p,body:o}}var Ee=function(){var e;try{if("function"===typeof(e=fetch))return e}catch(on){}}();function ze(e){Ee=e}function Ne(){return Ee}var Le={prepare:function(e,n,t){var r=[],i=function(e,n){var t,r=G(e);if(!r)return 0;if(r.maxURL){var i=0;r.resources.forEach((function(e){var n=e;i=Math.max(i,n.length)}));var o=n+".json?icons=";t=r.maxURL-i-r.path.length-o.length}else t=0;return t}(e,n),o="icons",a={type:o,provider:e,prefix:n,icons:[]},c=0;return t.forEach((function(t,u){(c+=t.length+1)>=i&&u>0&&(r.push(a),a={type:o,provider:e,prefix:n,icons:[]},c=t.length),a.icons.push(t)})),r.push(a),r},send:function(e,n,t){if(Ee){var r=function(e){if("string"===typeof e){var n=G(e);if(n)return n.path}return"/"}(n.provider);switch(n.type){case"icons":var i=n.prefix,o=n.icons.join(",");r+=i+".json?"+new URLSearchParams({icons:o}).toString();break;case"custom":var a=n.uri;r+="/"===a.slice(0,1)?a.slice(1):a;break;default:return void t("abort",400)}var c=503;Ee(e+r).then((function(e){var n=e.status;if(200===n)return c=501,e.json();setTimeout((function(){t(function(e){return 404===e}(n)?"abort":"next",n)}))})).then((function(e){"object"===typeof e&&null!==e?setTimeout((function(){t("success",e)})):setTimeout((function(){404===e?t("abort",e):t("next",c)}))})).catch((function(){t("next",c)}))}else t("abort",424)}};function Re(e,n){switch(e){case"local":case"session":pe[e]=n;break;case"all":for(var t in pe)pe[t]=n}}var Fe="data-style",De="";function Je(e){De=e}function Be(e,n){var t=Array.from(e.childNodes).find((function(e){return e.hasAttribute&&e.hasAttribute(Fe)}));t||((t=document.createElement("style")).setAttribute(Fe,Fe),e.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(n?"-0.125em":"0")+"}span,svg{display:block}"+De}function qe(){var e;B("",Le),I(!0);try{e=window}catch(t){}if(e){if(we(),void 0!==e.IconifyPreload){var n=e.IconifyPreload,t="Invalid IconifyPreload syntax.";"object"===typeof n&&null!==n&&(n instanceof Array?n:[n]).forEach((function(e){try{("object"!==typeof e||null===e||e instanceof Array||"object"!==typeof e.icons||"string"!==typeof e.prefix||!N(e))&&console.error(t)}catch(n){console.error(t)}}))}if(void 0!==e.IconifyProviders){var r=e.IconifyProviders;if("object"===typeof r&&null!==r)for(var i in r){var o="IconifyProviders["+i+"] is invalid.";try{var a=r[i];if("object"!==typeof a||!a||void 0===a.resources)continue;X(i,a)||console.error(o)}catch(c){console.error(o)}}}}return{enableCache:function(e){return Re(e,!0)},disableCache:function(e){return Re(e,!1)},iconExists:L,getIcon:R,listIcons:M,addIcon:z,addCollection:N,calculateSize:Me,buildIcon:Ie,loadIcons:_e,loadIcon:Ze,addAPIProvider:X,appendCustomStyle:Je,_api:{getAPIConfig:G,setAPIModule:B,sendAPIQuery:te,setFetch:ze,getFetch:Ne,listAPIProviders:Y}}}function He(e,n){var t=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(var r in n)t+=" "+r+'="'+n[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+e+"</svg>"}var Qe,Ue={"background-color":"currentColor"},Ke={"background-color":"transparent"},Ve={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},$e={"-webkit-mask":Ue,mask:Ue,background:Ke};for(var We in $e){var Xe=$e[We];for(var Ge in Ve)Xe[We+"-"+Ge]=Ve[Ge]}function Ye(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function en(e){return void 0===Qe&&function(){try{Qe=window.trustedTypes.createPolicy("iconify",{createHTML:function(e){return e}})}catch(on){Qe=null}}(),Qe?Qe.createHTML(e):e}function nn(e,n){var t=n.icon.data,r=n.customisations,i=Ie(t,r);r.preserveAspectRatio&&(i.attributes.preserveAspectRatio=r.preserveAspectRatio);var o,a=n.renderedMode;if("svg"===a)o=function(e){var n=document.createElement("span"),t=e.attributes,r="";t.width||(r="width: inherit;"),t.height||(r+="height: inherit;"),r&&(t.style=r);var i=He(e.body,t);return n.innerHTML=en(i),n.firstChild}(i);else o=function(e,n,t){var r=document.createElement("span"),i=e.body;-1!==i.indexOf("<a")&&(i+="\x3c!-- "+Date.now()+" --\x3e");var o=e.attributes,a='url("'+(l=He(i,(0,s.Z)((0,s.Z)({},o),{},{width:n.width+"",height:n.height+""})),"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(l)+'")'),c=r.style,u=(0,s.Z)({"--svg":a,width:Ye(o.width),height:Ye(o.height)},t?Ue:Ke);var l;for(var f in u)c.setProperty(f,u[f]);return r}(i,(0,s.Z)((0,s.Z)({},d),t),"mask"===a);var c=Array.from(e.childNodes).find((function(e){var n=e.tagName&&e.tagName.toUpperCase();return"SPAN"===n||"SVG"===n}));c?"SPAN"===o.tagName&&c.tagName===o.tagName?c.setAttribute("style",o.getAttribute("style")):e.replaceChild(o,c):e.appendChild(o)}function tn(e,n,t){return{rendered:!1,inline:n,icon:e,lastRender:t&&(t.rendered?t:t.lastRender)}}var rn=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"iconify-icon";try{e=window.customElements,n=window.HTMLElement}catch(on){return}if(e&&n){var s=e.get(t);if(s)return s;var l=["icon","mode","inline","width","height","rotate","flip"],f=function(e){(0,a.Z)(t,e);var n=(0,c.Z)(t);function t(){var e;(0,r.Z)(this,t),e=n.call(this),(0,u.Z)((0,o.Z)(e),"_shadowRoot",void 0),(0,u.Z)((0,o.Z)(e),"_state",void 0),(0,u.Z)((0,o.Z)(e),"_checkQueued",!1);var i=e._shadowRoot=e.attachShadow({mode:"open"}),a=Oe((0,o.Z)(e));return Be(i,a),e._state=tn({value:""},a),e._queueCheck(),e}return(0,i.Z)(t,[{key:"attributeChangedCallback",value:function(e){if("inline"===e){var n=Oe(this),t=this._state;n!==t.inline&&(t.inline=n,Be(this._shadowRoot,n))}else this._queueCheck()}},{key:"icon",get:function(){var e=this.getAttribute("icon");if(e&&"{"===e.slice(0,1))try{return JSON.parse(e)}catch(on){}return e},set:function(e){"object"===typeof e&&(e=JSON.stringify(e)),this.setAttribute("icon",e)}},{key:"inline",get:function(){return Oe(this)},set:function(e){e?this.setAttribute("inline","true"):this.removeAttribute("inline")}},{key:"restartAnimation",value:function(){var e=this._state;if(e.rendered){var n=this._shadowRoot;if("svg"===e.renderedMode)try{return void n.lastChild.setCurrentTime(0)}catch(on){}nn(n,e)}}},{key:"status",get:function(){var e=this._state;return e.rendered?"rendered":null===e.icon.data?"failed":"loading"}},{key:"_queueCheck",value:function(){var e=this;this._checkQueued||(this._checkQueued=!0,setTimeout((function(){e._check()})))}},{key:"_check",value:function(){if(this._checkQueued){this._checkQueued=!1;var e=this._state,n=this.getAttribute("icon");if(n===e.icon.value){if(e.rendered){var t=this.getAttribute("mode"),r=m(this);(e.attrMode!==t||function(e,n){for(var t in b)if(e[t]!==n[t])return!0;return!1}(e.customisations,r))&&this._renderIcon(e.icon,r,t)}}else this._iconChanged(n)}}},{key:"_iconChanged",value:function(e){var n=this,t=Ae(e,(function(e,t,r){var i=n._state;if(!i.rendered&&n.getAttribute("icon")===e){var o={value:e,name:t,data:r};o.data?n._gotIconData(o):i.icon=o}}));t.data?this._gotIconData(t):this._state=tn(t,this._state.inline,this._state)}},{key:"_gotIconData",value:function(e){this._checkQueued=!1,this._renderIcon(e,m(this),this.getAttribute("mode"))}},{key:"_renderIcon",value:function(e,n,t){var r=function(e,n){switch(n){case"svg":case"bg":case"mask":return n}return"style"===n||!Ce&&-1!==e.indexOf("<a")?-1===e.indexOf("currentColor")?"bg":"mask":"svg"}(e.data.body,t),i=this._state.inline;nn(this._shadowRoot,this._state={rendered:!0,icon:e,inline:i,customisations:n,attrMode:t,renderedMode:r})}}],[{key:"observedAttributes",get:function(){return l.slice(0)}}]),t}(n);l.forEach((function(e){e in f.prototype||Object.defineProperty(f.prototype,e,{get:function(){return this.getAttribute(e)},set:function(n){null!==n?this.setAttribute(e,n):this.removeAttribute(e)}})}));var d=qe();for(var h in d)f[h]=f.prototype[h]=d[h];return e.define(t,f),f}}()||qe();rn.enableCache,rn.disableCache,rn.iconExists,rn.getIcon,rn.listIcons,rn.addIcon,rn.addCollection,rn.calculateSize,rn.buildIcon,rn.loadIcons,rn.loadIcon,rn.addAPIProvider,rn._api}}]);
|
|
2
|
+
//# sourceMappingURL=5070.31a74ba7.chunk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[5468],{65468:function(e,n,r){r.r(n),r.d(n,{UserPassports:function(){return le},UserProfile:function(){return ae},default:function(){return ce}});var t=r(71171),i=r(33028),o=(r(30969),r(65321)),s=r(70177),a=r(19865),l=r(78789),c=r(46292),d=r.n(c),u=r(61398),m=r.n(u),p=r(16380),h=r(29996),x=r(26022),f=r(25139),v=r(59467),Z=r(33359),g=r(38361),j=r(7173),b=r(1059),y=r(28595),w=r(20244),k=r(59505),P=r(36558),C=r(12502),I=r(75980),T=r(24891),S=r(30734),E=r(53279),z=r(4485),R=r(32723),_=r(34795),A=r(96234),L=r(62558),N=r.n(L),W=r(1986),q=r(86384),D=r(92522),O=r.n(D),U=r(63269),V=r(65453),B=r(31076),M=r(49884),Q=r(88876),F=r(39130),G=r(2689),H=r(87006),K=r(4953),J=r(94551),X=r(18877),Y=r(94308),$=r(39185),ee=r(54164),ne=r(13953),re=r(37574);function te(e){var n=e.data,r=e.user,t=(0,x.PE)().t,o=(0,z.Tt)().api,a=(0,$.Z)({editing:!1,dirty:!1}),c=(0,A.Z)(a,2),u=c[0],m=c[1],p=(0,ne.cI)({defaultValues:N()({notifications:{email:!0,wallet:!0,phone:!1},webhooks:[]},n)}),v=p.control,g=p.getValues,j=p.setValue,b=p.formState,y=p.handleSubmit,w=(0,ne.Dq)({control:v,name:"webhooks"}),k=y(function(){var e=(0,_.Z)((0,R.Z)().mark((function e(n){return(0,R.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.post("/api/user/extra",n);case 3:W.Z.success(t("common.saveSuccess")),m({editing:!1}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),W.Z.error((0,T.Z)(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(n){return e.apply(this,arguments)}}()),P=function(){var e=(0,_.Z)((0,R.Z)().mark((function e(n){return(0,R.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.put("/api/user/extra",w.fields[n]);case 3:W.Z.success(t("team.member.settings.tested")),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),W.Z.error((0,T.Z)(e.t0));case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(n){return e.apply(this,arguments)}}();return(0,re.jsxs)(f.Z,{spacing:3,children:[(0,re.jsxs)(f.Z,{sx:{width:"100%"},children:[(0,re.jsxs)(f.Z,{direction:"row",justifyContent:"space-between",children:[(0,re.jsx)(Z.Z,{variant:"h6",gutterBottom:!0,children:t("team.member.settings.notification")}),(0,re.jsx)(h.Z,{variant:"contained",size:"small",color:"primary",style:{height:"32px"},onClick:k,disabled:b.isSubmitting,children:t("common.save")})]}),(0,re.jsx)(ne.Qr,{name:"notifications.wallet",control:v,render:function(e){var n=e.field;return(0,re.jsx)(M.Z,{control:(0,re.jsx)(Q.Z,(0,i.Z)((0,i.Z)({checked:g().notifications.wallet},n),{},{onChange:function(e,r){return j(n.name,r)}})),disableTypography:!0,label:(0,re.jsxs)(Z.Z,{color:"text.primary",children:[t("team.member.settings.wallet"),(0,re.jsx)(Z.Z,{component:"span",color:"text.secondary",ml:1,children:(0,q.h1)(r)})]})})}}),(0,re.jsx)(ne.Qr,{name:"notifications.email",control:v,render:function(e){var n=e.field;return(0,re.jsx)(M.Z,{control:(0,re.jsx)(Q.Z,(0,i.Z)((0,i.Z)({checked:g().notifications.email},n),{},{onChange:function(e,r){return j(n.name,r)}})),disableTypography:!0,label:(0,re.jsxs)(Z.Z,{color:"text.primary",children:[t("team.member.settings.email"),(0,re.jsx)(Z.Z,{component:"span",color:"text.secondary",ml:1,children:r.email||""})]})})}}),(0,re.jsx)(ne.Qr,{name:"notifications.phone",control:v,render:function(e){var n=e.field;return(0,re.jsx)(M.Z,{control:(0,re.jsx)(Q.Z,(0,i.Z)((0,i.Z)({checked:g().notifications.phone},n),{},{onChange:function(e,r){return j(n.name,r)}})),disableTypography:!0,disabled:!0,label:(0,re.jsxs)(Z.Z,{color:"text.primary",children:[t("team.member.settings.phone"),(0,re.jsx)(Z.Z,{component:"span",color:"text.secondary",ml:1,children:r.phone||""})]})})}})]}),(0,re.jsxs)(f.Z,{children:[(0,re.jsxs)(f.Z,{direction:"row",justifyContent:"space-between",children:[(0,re.jsx)(Z.Z,{variant:"h6",gutterBottom:!0,children:t("team.member.settings.webhook")}),(0,re.jsxs)(f.Z,{direction:"row",children:[u.editing&&(0,re.jsx)(h.Z,{variant:"text",size:"small",color:"primary",style:{height:"32px"},onClick:function(){return m({editing:!1})},children:t("common.cancel")}),(0,re.jsx)(h.Z,{variant:"contained",size:"small",color:"primary",style:{height:"32px"},onClick:u.editing?k:function(){return m({editing:!0})},disabled:b.isSubmitting,children:u.editing?t("common.save"):t("common.edit")})]})]}),w.fields.map((function(e,n){var r,o=null===(r=d()(b.errors,"webhooks.".concat(n,".url")))||void 0===r?void 0:r.message;return u.editing?(0,re.jsxs)(f.Z,{mt:2,spacing:2,sx:{width:"100%"},direction:"row",alignItems:"center",children:[(0,re.jsxs)(f.Z,{direction:"row",spacing:2,sx:{width:"80%"},children:[(0,re.jsx)(ne.Qr,{name:"webhooks.".concat(n,".type"),control:v,rules:{required:t("common.required")},render:function(e){var n=e.field;return(0,re.jsxs)(F.Z,(0,i.Z)((0,i.Z)({},n),{},{sx:{flex:1},fullWidth:!0,size:"small",children:[(0,re.jsx)(G.Z,{value:"api",children:t("team.member.settings.url")}),(0,re.jsx)(G.Z,{value:"slack",children:t("team.member.settings.slack")})]}))}}),(0,re.jsx)(ne.Qr,{name:"webhooks.".concat(n,".url"),control:v,rules:{required:t("common.required"),validate:function(e){return O()(e)||t("common.invalid")}},render:function(e){var n=e.field;return(0,re.jsx)(H.Z,(0,i.Z)((0,i.Z)({sx:{flex:4},fullWidth:!0,size:"small",required:!0},n),{},{error:!!o,InputProps:{endAdornment:o?(0,re.jsx)(K.Z,{position:"end",children:(0,re.jsx)(Z.Z,{component:"span",color:"error",children:o})}):null}}))}})]}),(0,re.jsxs)(f.Z,{direction:"row",spacing:1,children:[(0,re.jsx)(J.Z,{size:"small",onClick:function(){return P(n)},children:(0,re.jsx)(U.Z,{color:"primary",sx:{opacity:.75}})}),(0,re.jsx)(J.Z,{size:"small",onClick:function(){return w.remove(n)},children:(0,re.jsx)(V.Z,{color:"error",sx:{opacity:.75}})})]})]},e.id):(0,re.jsx)(s.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.type,children:e.url},e.id)})),!u.editing&&!w.fields.length&&(0,re.jsx)(l.Z,{children:t("common.empty")}),u.editing&&(0,re.jsx)(f.Z,{mt:w.fields.length?2:1,direction:"row",justifyContent:"space-between",children:(0,re.jsxs)(h.Z,{size:"small",variant:"outlined",color:"primary",onClick:function(){return w.append({type:"slack",url:""})},children:[(0,re.jsx)(B.Z,{fontSize:"small"})," ",t("team.member.settings.add")]})})]})]})}function ie(e){var n=e.user,r=(0,z.Tt)().api,t=(0,ee.Z)((function(){return r.get("/api/user/extra").then((function(e){return e.data}))})),i=t.loading,o=t.error,s=t.data;return o?(0,re.jsx)(X.Z,{severity:"error",children:o.message}):i||!s?(0,re.jsx)(Y.Z,{}):(0,re.jsx)(te,{data:s,user:n})}var oe,se=r(38507);function ae(e){var n=e.user,r=(0,x.PE)(),t=r.t,i=r.locale;return[{name:t("team.member.name"),value:n.fullName},{name:t("common.email"),value:n.email},{name:t("common.phone"),value:n.phone},{name:t("team.member.lastLogin"),value:(0,T.B2)(n.lastLoginAt,i)},{name:t("team.member.lastLoginIp"),value:n.lastLoginIp||""},{name:t("common.createdAt"),value:(0,T.B2)(n.createdAt,i)},{name:t("team.member.source"),value:{auth0:"Auth0",wallet:"DID wallet",federated:"Federated"}[(null===n||void 0===n?void 0:n.sourceProvider)||w.USER_TYPE.WALLET]||(null===n||void 0===n?void 0:n.sourceProvider)}].filter(Boolean).map((function(e){return e.name===t("common.did")?(0,re.jsx)(s.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return t("common.did")},children:e.value},e.name):(0,re.jsx)(s.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)}))}function le(e){var n=e.user,r=(0,x.PE)().t,t=(d()(n,"passports")||[]).map((function(e){return(0,i.Z)((0,i.Z)({},e),{},{revoked:e.status===w.PASSPORT_STATUS.REVOKED})}));return 0===t.length?(0,re.jsx)(l.Z,{children:r("common.empty")}):(0,re.jsx)(f.Z,{direction:"row",spacing:3,children:t.map((function(e){return(0,re.jsx)(I.Z,{passport:e,user:n,width:200,color:window.blocklet.passportColor,createPassportSvg:se.Ju,sx:{flexDirection:"column",alignItems:"center"}},e.id)}))})}function ce(){var e=(0,S.useNavigate)(),n=(0,S.useParams)(),r=(0,x.PE)().t,t=(0,z.Tt)().session,i=(0,y.Z)({user:t.user,tab:n.tab||"profile"}),s={info:{label:r("common.profile"),value:"profile",component:ae},oauth:{label:r("team.member.connections"),value:"connections",component:C.Z},passports:{label:r("team.member.passports"),value:"passports",component:le},settings:{label:r("common.setting"),value:"settings",component:ie}},l=Object.values(s).map((function(e){return{label:e.label,value:e.value}})).filter((function(e){var n;return"connections"!==e.value||((null===(n=i.user)||void 0===n?void 0:n.connectedAccounts)||[]).find((function(e){var n;return e.provider!==((null===(n=i.user)||void 0===n?void 0:n.sourceProvider)||k.LOGIN_PROVIDER.WALLET)}))})),c=s[i.tab]||s.info;return(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(o.Z,{}),(0,re.jsxs)(de,{sx:{mt:4},children:[(0,re.jsxs)(f.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,re.jsxs)(f.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,re.jsx)(v.Z,{src:i.user.avatar,variant:"rounded",style:{width:80,height:80,backgroundColor:"transparent",marginRight:8}}),(0,re.jsxs)(f.Z,{direction:"column",spacing:.5,children:[(0,re.jsx)(Z.Z,{variant:"h4",fontWeight:"bold",children:i.user.fullName}),(0,re.jsx)(g.Z,{children:(0,re.jsx)(j.Z,{label:i.user.role.toUpperCase(),size:"small",variant:"outlined",color:"success",sx:{height:"auto",fontWeight:"bold",fontSize:"12px"},icon:(0,re.jsx)(E.Z,{sx:{fontSize:"0.8em"}})})}),(0,re.jsx)(P.Z,{did:i.user.did})]})]}),(0,re.jsxs)(f.Z,{children:["profile"===i.tab&&(0,re.jsx)(h.Z,{variant:"contained",size:"small",color:"primary",onClick:function(){return t.switchProfile(m(),{})},children:r("team.member.switch.profile")}),"passports"===i.tab&&(0,re.jsx)(h.Z,{variant:"contained",size:"small",color:"primary",onClick:function(){return t.switchPassport(m(),{})},children:r("team.member.switch.passport")})]})]}),(0,re.jsx)(g.Z,{className:"tabs",sx:{my:3},children:(0,re.jsx)(a.Z,{tabs:l,current:i.tab,onChange:function(n){i.tab=n,e("".concat(w.WELLKNOWN_SERVICE_PATH_PREFIX,"/user/").concat(n))}})}),(0,re.jsx)("div",{className:"body",children:(0,re.jsx)(c.component,{user:i.user})})]})]})}var de=(0,p.Z)(b.Z)(oe||(oe=(0,t.Z)(["\n .MuiTab-root {\n padding: 0;\n margin-right: 24px;\n min-height: 32px;\n min-width: auto;\n }\n\n .MuiTabs-root {\n min-height: 32px;\n margin-bottom: 8px;\n }\n\n .MuiTabs-scroller {\n border-bottom: 1px solid #eee;\n }\n\n .MuiCheckbox-root {\n padding-top: 2px;\n padding-bottom: 2px;\n }\n"])))},86384:function(e,n,r){n.h1=void 0;var t=r(59505);function i(e){return(null===e||void 0===e?void 0:e.connectedAccounts)||[]}function o(e){return i(e).find((function(e){return e.provider===t.LOGIN_PROVIDER.WALLET}))}n.h1=function(e){var n=o(e);return null===n||void 0===n?void 0:n.did}},36558:function(e,n,r){var t=r(33028),i=r(59740),o=r(24974),s=r.n(o),a=r(86822),l=r(19638),c=r(23586),d=r(37574),u=["did","href","external","avatarProps"];function m(e){var n=e.did,r=e.href,o=e.external,s=(e.avatarProps,(0,i.Z)(e,u)),m=(0,d.jsx)(c.Z,(0,t.Z)({did:n},s));return r?o?(0,d.jsx)(l.Z,{target:"_blank",href:r,underline:"hover",children:m}):(0,d.jsx)(a.rU,{to:r,children:m}):m}m.propTypes={did:s().string.isRequired,to:s().string,href:s().string,avatarProps:s().object,external:s().bool},m.defaultProps={to:"",href:"",avatarProps:{},external:!1},n.Z=m},12502:function(e,n,r){r.d(n,{Z:function(){return l}});r(30969);var t=r(24974),i=r.n(t),o=r(70177),s=r(36558),a=r(37574);function l(e){return(e.user.connectedAccounts||[]).map((function(e){return(0,a.jsx)(o.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.provider,children:(0,a.jsx)(s.Z,{did:e.did})},e.did)}))}l.propTypes={user:i().object.isRequired},l.defaultProps={}},75980:function(e,n,r){r.d(n,{Z:function(){return v}});var t,i=r(71171),o=r(33028),s=r(59740),a=(r(30969),r(24974)),l=r.n(a),c=r(16380),d=r(70093),u=r.n(d),m=r(38361),p=r(26022),h=r(69936),x=r(37574),f=["passport","user","color","width","icon","children","createPassportSvg"];function v(e){var n=e.passport,r=e.user,t=e.color,i=e.width,a=e.icon,l=e.children,c=e.createPassportSvg,d=(0,s.Z)(e,f),v=(0,p.PE)().t;return(0,x.jsxs)(Z,(0,o.Z)((0,o.Z)({display:"flex",alignItems:"center"},d),{},{children:[(0,x.jsx)("div",{dangerouslySetInnerHTML:{__html:c({title:n.title||n.name,issuer:n.issuer&&n.issuer.name,issuerDid:n.issuer&&n.issuer.id,ownerName:r.fullName,ownerDid:r.did,ownerAvatarUrl:r.avatar,revoked:n.revoked,preferredColor:t,width:i})}}),(0,x.jsxs)("div",{className:"body",children:[(0,x.jsxs)(m.Z,{className:"title",display:"flex",alignItems:"center",children:[u()(n.title),(0,x.jsxs)("div",{className:"status-icons",children:[a,n.revoked&&(0,x.jsx)(h.Z,{})]})]}),n.expirationDate&&(0,x.jsx)(m.Z,{className:"title",display:"flex",alignItems:"center",children:v("team.passport.validUntil",{date:n.expirationDate})}),l]})]}))}v.propTypes={passport:l().any.isRequired,user:l().any.isRequired,color:l().string.isRequired,createPassportSvg:l().func.isRequired,icon:l().any,children:l().any,width:l().number},v.defaultProps={icon:null,children:null,width:150};var Z=(0,c.Z)(m.Z)(t||(t=(0,i.Z)(["\n .body {\n padding: 0;\n margin-left: 24px;\n margin-top: 0;\n }\n .title {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n color: #222222;\n }\n .tip {\n display: flex;\n align-items: center;\n font-size: 14px;\n margin-top: 6px;\n color: #bbb;\n }\n .status-icons {\n svg {\n fill: #bfbfbf;\n height: 1.2em;\n margin-left: 0.4em;\n }\n }\n"])))}}]);
|
|
2
|
+
//# sourceMappingURL=5468.b54ce65b.chunk.js.map
|