@abtnode/webapp 1.16.16-beta-ca17cc31 → 1.16.16

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.
Files changed (65) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/build/asset-manifest.json +44 -44
  4. package/build/index.html +1 -1
  5. package/build/service-worker.js +1 -1
  6. package/build/static/js/1234.f36f4363.chunk.js +1 -0
  7. package/build/static/js/{8059.d969b349.chunk.js → 1368.371269bf.chunk.js} +1 -1
  8. package/build/static/js/{1371.96d56167.chunk.js → 1371.8b63f85c.chunk.js} +1 -1
  9. package/build/static/js/{1685.ad51d1ae.chunk.js → 1685.e6dee535.chunk.js} +2 -2
  10. package/build/static/js/2042.a05e2050.chunk.js +2 -0
  11. package/build/static/js/{2291.f7b42545.chunk.js → 2291.4e8c2ea2.chunk.js} +1 -1
  12. package/build/static/js/{2294.d78e6ed6.chunk.js → 2294.2173fa5e.chunk.js} +1 -1
  13. package/build/static/js/{2305.1de337f9.chunk.js → 2305.8aad13ef.chunk.js} +2 -2
  14. package/build/static/js/2611.453c9be7.chunk.js +1 -0
  15. package/build/static/js/{2746.de7a9508.chunk.js → 2746.dedc02f5.chunk.js} +1 -1
  16. package/build/static/js/{3135.92de458b.chunk.js → 3135.ab6ac0d1.chunk.js} +1 -1
  17. package/build/static/js/{3704.e2d6cd48.chunk.js → 3704.6cc3ed6b.chunk.js} +2 -2
  18. package/build/static/js/{3716.edb3d2ce.chunk.js → 3716.f3fb0076.chunk.js} +1 -1
  19. package/build/static/js/{436.90c2d75f.chunk.js → 436.729b5a5a.chunk.js} +1 -1
  20. package/build/static/js/{4362.ca3fb274.chunk.js → 4362.f0059b8d.chunk.js} +1 -1
  21. package/build/static/js/{4407.723415c4.chunk.js → 4407.b024db46.chunk.js} +2 -2
  22. package/build/static/js/{4718.5dedb2bb.chunk.js → 4718.d80adf8d.chunk.js} +2 -2
  23. package/build/static/js/{4775.20e952b9.chunk.js → 4775.b79ed382.chunk.js} +1 -1
  24. package/build/static/js/{4901.00cc1363.chunk.js → 4901.6b52436e.chunk.js} +1 -1
  25. package/build/static/js/{5509.245431ce.chunk.js → 5509.6c906749.chunk.js} +1 -1
  26. package/build/static/js/5760.9034ed47.chunk.js +1 -0
  27. package/build/static/js/5953.80783c99.chunk.js +1 -0
  28. package/build/static/js/{6457.e28eaaed.chunk.js → 6457.280fd1c8.chunk.js} +1 -1
  29. package/build/static/js/{6511.89243c88.chunk.js → 6511.cf601bbb.chunk.js} +1 -1
  30. package/build/static/js/{6580.a36ef27c.chunk.js → 6580.aeb4153f.chunk.js} +1 -1
  31. package/build/static/js/6960.ccb14d14.chunk.js +1 -0
  32. package/build/static/js/{7020.5aaf930e.chunk.js → 7020.325760ed.chunk.js} +1 -1
  33. package/build/static/js/7126.f753e698.chunk.js +1 -0
  34. package/build/static/js/{7534.ab4d9f6e.chunk.js → 7534.15f431d9.chunk.js} +1 -1
  35. package/build/static/js/{7638.ae3e296a.chunk.js → 7638.f7d773c5.chunk.js} +1 -1
  36. package/build/static/js/{7718.68cb259e.chunk.js → 7718.34a51e00.chunk.js} +1 -1
  37. package/build/static/js/{8219.7e3bd847.chunk.js → 8219.59649a93.chunk.js} +1 -1
  38. package/build/static/js/{8382.94b3ec45.chunk.js → 8382.a163f589.chunk.js} +1 -1
  39. package/build/static/js/{875.f12224ef.chunk.js → 875.af5cb0ea.chunk.js} +1 -1
  40. package/build/static/js/{8973.a66e8187.chunk.js → 8973.eaff00d1.chunk.js} +1 -1
  41. package/build/static/js/{8986.9a970a9b.chunk.js → 8986.b2c42433.chunk.js} +1 -1
  42. package/build/static/js/9038.d4d5c249.chunk.js +1 -0
  43. package/build/static/js/{9041.84c1ff27.chunk.js → 9041.0f1c9ac4.chunk.js} +1 -1
  44. package/build/static/js/{9327.b7f3ca87.chunk.js → 9327.77d4d1d8.chunk.js} +1 -1
  45. package/build/static/js/{9354.c3636ea4.chunk.js → 9354.20dcf57f.chunk.js} +1 -1
  46. package/build/static/js/{9662.ce2f3bff.chunk.js → 9662.31e1a4b5.chunk.js} +1 -1
  47. package/build/static/js/{984.1b63b00b.chunk.js → 984.147787d4.chunk.js} +1 -1
  48. package/build/static/js/main.f4613b44.js +2 -0
  49. package/package.json +1 -1
  50. package/build/static/js/2611.453b18de.chunk.js +0 -1
  51. package/build/static/js/5760.420f21b0.chunk.js +0 -1
  52. package/build/static/js/5953.5bc549e1.chunk.js +0 -1
  53. package/build/static/js/6651.bd381be6.chunk.js +0 -2
  54. package/build/static/js/6960.4bad7ec1.chunk.js +0 -1
  55. package/build/static/js/7126.3c844fd9.chunk.js +0 -1
  56. package/build/static/js/9038.717c88a8.chunk.js +0 -1
  57. package/build/static/js/9963.2f462f42.chunk.js +0 -1
  58. package/build/static/js/main.7115a1cb.js +0 -2
  59. /package/build/static/js/{1685.ad51d1ae.chunk.js.LICENSE.txt → 1685.e6dee535.chunk.js.LICENSE.txt} +0 -0
  60. /package/build/static/js/{6651.bd381be6.chunk.js.LICENSE.txt → 2042.a05e2050.chunk.js.LICENSE.txt} +0 -0
  61. /package/build/static/js/{2305.1de337f9.chunk.js.LICENSE.txt → 2305.8aad13ef.chunk.js.LICENSE.txt} +0 -0
  62. /package/build/static/js/{3704.e2d6cd48.chunk.js.LICENSE.txt → 3704.6cc3ed6b.chunk.js.LICENSE.txt} +0 -0
  63. /package/build/static/js/{4407.723415c4.chunk.js.LICENSE.txt → 4407.b024db46.chunk.js.LICENSE.txt} +0 -0
  64. /package/build/static/js/{4718.5dedb2bb.chunk.js.LICENSE.txt → 4718.d80adf8d.chunk.js.LICENSE.txt} +0 -0
  65. /package/build/static/js/{main.7115a1cb.js.LICENSE.txt → main.f4613b44.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[875],{64886:function(t,e,a){"use strict";var n,o=a(71171),r=a(33028),c=a(59740),i=a(55898),l=a.n(i),s=a(51540),d=a.n(s),u=a(26538),h=a.n(u),m=a(11750),p=a(47685),v=a(96266),f=["name","nameFormatter","layout","children","valueComponent","nameWidth"];function w(t){var e=t.name,a=t.nameFormatter,n=t.layout,o=t.children,i=t.valueComponent,l=t.nameWidth,s=(0,c.Z)(t,f);return(0,v.jsxs)(g,(0,r.Z)((0,r.Z)({layout:n,width:l},s),{},{children:[(0,v.jsx)(m.Z,{color:"textSecondary",className:"info-row__name",children:a(e)}),o&&(0,v.jsx)(m.Z,{color:"textPrimary",component:i,className:"info-row__value",children:o})]}))}w.propTypes={name:l().any.isRequired,layout:l().oneOf(["horizontal","vertical"]),children:l().any,nameFormatter:l().func,valueComponent:l().string,nameWidth:l().number},w.defaultProps={children:null,nameWidth:90,nameFormatter:function(t){var e=t.split(" ").map((function(t){return h()(d()(t))})).join(" ");return"string"===typeof t?e:t},valueComponent:"div",layout:"horizontal"};var g=(0,p.zo)("div")(n||(n=(0,o.Z)(["\n display: flex;\n flex-direction: ",";\n justify-content: flex-start;\n align-items: ",";\n margin-bottom: 16px;\n\n .info-row__name {\n width: ","px;\n margin-right: ",";\n margin-bottom: ",";\n text-transform: capitalize;\n }\n\n .info-row__value {\n flex: 1;\n overflow: auto;\n word-wrap: break-word;\n font-weight: 500;\n }\n\n @media (max-width: ","px) {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n .info-row__name {\n font-weight: bold;\n }\n\n .info-row__value {\n width: 100%;\n font-size: 12px;\n margin-top: 8px;\n }\n }\n"])),(function(t){return"vertical"===t.layout?"column":"row"}),(function(t){return"vertical"===t.layout?"flex-start":"center"}),(function(t){return t.width}),(function(t){return"vertical"===t.layout?"0":"8px"}),(function(t){return"vertical"===t.layout?"8px":"0"}),(function(t){return t.theme.breakpoints.values.md}));e.Z=w},40736:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");e.Z=c},56184:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}),"Done");e.Z=c},34966:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");e.Z=c},33271:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"}),"Link");e.Z=c},45267:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz");e.Z=c},48037:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}),"SettingsOutlined");e.Z=c},99194:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3v7.12zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5z"}),"Update");e.Z=c},36554:function(t,e,a){"use strict";a.d(e,{Z:function(){return y}});var n=a(56666),o=a(31461),r=a(7896),c=a(5057),i=a(8271),l=a(91213),s=a(66685),d=a(6285),u=a(39273),h=a(42908),m=a(62773),p=a(31821),v=a(18561);function f(t){return(0,v.Z)("MuiSwitch",t)}var w=(0,p.Z)("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),g=a(96266),Z=["className","color","edge","size","sx"],x=(0,m.ZP)("span",{name:"MuiSwitch",slot:"Root",overridesResolver:function(t,e){var a=t.ownerState;return[e.root,a.edge&&e["edge".concat((0,d.Z)(a.edge))],e["size".concat((0,d.Z)(a.size))]]}})((function(t){var e,a=t.ownerState;return(0,r.Z)({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},"start"===a.edge&&{marginLeft:-8},"end"===a.edge&&{marginRight:-8},"small"===a.size&&(e={width:40,height:24,padding:7},(0,n.Z)(e,"& .".concat(w.thumb),{width:16,height:16}),(0,n.Z)(e,"& .".concat(w.switchBase),(0,n.Z)({padding:4},"&.".concat(w.checked),{transform:"translateX(16px)"})),e))})),b=(0,m.ZP)(u.Z,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:function(t,e){var a=t.ownerState;return[e.switchBase,(0,n.Z)({},"& .".concat(w.input),e.input),"default"!==a.color&&e["color".concat((0,d.Z)(a.color))]]}})((function(t){var e,a=t.theme;return e={position:"absolute",top:0,left:0,zIndex:1,color:a.vars?a.vars.palette.Switch.defaultColor:"".concat("light"===a.palette.mode?a.palette.common.white:a.palette.grey[300]),transition:a.transitions.create(["left","transform"],{duration:a.transitions.duration.shortest})},(0,n.Z)(e,"&.".concat(w.checked),{transform:"translateX(20px)"}),(0,n.Z)(e,"&.".concat(w.disabled),{color:a.vars?a.vars.palette.Switch.defaultDisabledColor:"".concat("light"===a.palette.mode?a.palette.grey[100]:a.palette.grey[600])}),(0,n.Z)(e,"&.".concat(w.checked," + .").concat(w.track),{opacity:.5}),(0,n.Z)(e,"&.".concat(w.disabled," + .").concat(w.track),{opacity:a.vars?a.vars.opacity.switchTrackDisabled:"".concat("light"===a.palette.mode?.12:.2)}),(0,n.Z)(e,"& .".concat(w.input),{left:"-100%",width:"300%"}),e}),(function(t){var e,a=t.theme,o=t.ownerState;return(0,r.Z)({"&:hover":{backgroundColor:a.vars?"rgba(".concat(a.vars.palette.action.activeChannel," / ").concat(a.vars.palette.action.hoverOpacity,")"):(0,s.Fq)(a.palette.action.active,a.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==o.color&&(e={},(0,n.Z)(e,"&.".concat(w.checked),(0,n.Z)({color:(a.vars||a).palette[o.color].main,"&:hover":{backgroundColor:a.vars?"rgba(".concat(a.vars.palette[o.color].mainChannel," / ").concat(a.vars.palette.action.hoverOpacity,")"):(0,s.Fq)(a.palette[o.color].main,a.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&.".concat(w.disabled),{color:a.vars?a.vars.palette.Switch["".concat(o.color,"DisabledColor")]:"".concat("light"===a.palette.mode?(0,s.$n)(a.palette[o.color].main,.62):(0,s._j)(a.palette[o.color].main,.55))})),(0,n.Z)(e,"&.".concat(w.checked," + .").concat(w.track),{backgroundColor:(a.vars||a).palette[o.color].main}),e))})),k=(0,m.ZP)("span",{name:"MuiSwitch",slot:"Track",overridesResolver:function(t,e){return e.track}})((function(t){var e=t.theme;return{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:"".concat("light"===e.palette.mode?e.palette.common.black:e.palette.common.white),opacity:e.vars?e.vars.opacity.switchTrack:"".concat("light"===e.palette.mode?.38:.3)}})),z=(0,m.ZP)("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:function(t,e){return e.thumb}})((function(t){var e=t.theme;return{boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}})),y=c.forwardRef((function(t,e){var a=(0,h.Z)({props:t,name:"MuiSwitch"}),n=a.className,c=a.color,s=void 0===c?"primary":c,u=a.edge,m=void 0!==u&&u,p=a.size,v=void 0===p?"medium":p,w=a.sx,y=(0,o.Z)(a,Z),S=(0,r.Z)({},a,{color:s,edge:m,size:v}),C=function(t){var e=t.classes,a=t.edge,n=t.size,o=t.color,c=t.checked,i=t.disabled,s={root:["root",a&&"edge".concat((0,d.Z)(a)),"size".concat((0,d.Z)(n))],switchBase:["switchBase","color".concat((0,d.Z)(o)),c&&"checked",i&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},u=(0,l.Z)(s,f,e);return(0,r.Z)({},e,u)}(S),j=(0,g.jsx)(z,{className:C.thumb,ownerState:S});return(0,g.jsxs)(x,{className:(0,i.Z)(C.root,n),sx:w,ownerState:S,children:[(0,g.jsx)(b,(0,r.Z)({type:"checkbox",icon:j,checkedIcon:j,ref:e,ownerState:S},y,{classes:(0,r.Z)({},C,{root:C.switchBase})})),(0,g.jsx)(k,{className:C.track,ownerState:S})]})}))},2078:function(t,e,a){var n=a(26849);t.exports=function(t){return n(t).toUpperCase()}},30278:function(t,e,a){var n=a(31104),o=a(43676);t.exports=function(t,e){return t&&t.length?o(t,n(e,2)):[]}}}]);
1
+ (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[875],{64886:function(t,e,a){"use strict";var n,o=a(71171),r=a(33028),c=a(59740),i=a(55898),l=a.n(i),s=a(51540),d=a.n(s),u=a(26538),h=a.n(u),m=a(11750),p=a(47685),v=a(96266),f=["name","nameFormatter","layout","children","valueComponent","nameWidth"];function w(t){var e=t.name,a=t.nameFormatter,n=t.layout,o=t.children,i=t.valueComponent,l=t.nameWidth,s=(0,c.Z)(t,f);return(0,v.jsxs)(g,(0,r.Z)((0,r.Z)({layout:n,width:l},s),{},{children:[(0,v.jsx)(m.Z,{color:"textSecondary",className:"info-row__name",children:a(e)}),o&&(0,v.jsx)(m.Z,{color:"textPrimary",component:i,className:"info-row__value",children:o})]}))}w.propTypes={name:l().any.isRequired,layout:l().oneOf(["horizontal","vertical"]),children:l().any,nameFormatter:l().func,valueComponent:l().string,nameWidth:l().number},w.defaultProps={children:null,nameWidth:90,nameFormatter:function(t){var e=t.split(" ").map((function(t){return h()(d()(t))})).join(" ");return"string"===typeof t?e:t},valueComponent:"div",layout:"horizontal"};var g=(0,p.zo)("div")(n||(n=(0,o.Z)(["\n display: flex;\n flex-direction: ",";\n justify-content: flex-start;\n align-items: ",";\n margin-bottom: 16px;\n\n .info-row__name {\n width: ","px;\n margin-right: ",";\n margin-bottom: ",";\n text-transform: capitalize;\n }\n\n .info-row__value {\n flex: 1;\n overflow: auto;\n word-wrap: break-word;\n font-weight: 500;\n }\n\n @media (max-width: ","px) {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n .info-row__name {\n font-weight: bold;\n }\n\n .info-row__value {\n width: 100%;\n font-size: 12px;\n margin-top: 8px;\n }\n }\n"])),(function(t){return"vertical"===t.layout?"column":"row"}),(function(t){return"vertical"===t.layout?"flex-start":"center"}),(function(t){return t.width}),(function(t){return"vertical"===t.layout?"0":"8px"}),(function(t){return"vertical"===t.layout?"8px":"0"}),(function(t){return t.theme.breakpoints.values.md}));e.Z=w},40736:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");e.Z=c},56184:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}),"Done");e.Z=c},34966:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");e.Z=c},33271:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"}),"Link");e.Z=c},45267:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz");e.Z=c},48037:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}),"SettingsOutlined");e.Z=c},99194:function(t,e,a){"use strict";var n=a(71600);e.Z=void 0;var o=n(a(56930)),r=a(96266),c=(0,o.default)((0,r.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3v7.12zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5z"}),"Update");e.Z=c},36554:function(t,e,a){"use strict";a.d(e,{Z:function(){return y}});var n=a(56666),o=a(31461),r=a(7896),c=a(5057),i=a(9978),l=a(91213),s=a(66685),d=a(6285),u=a(39273),h=a(42908),m=a(62773),p=a(31821),v=a(18561);function f(t){return(0,v.Z)("MuiSwitch",t)}var w=(0,p.Z)("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),g=a(96266),Z=["className","color","edge","size","sx"],x=(0,m.ZP)("span",{name:"MuiSwitch",slot:"Root",overridesResolver:function(t,e){var a=t.ownerState;return[e.root,a.edge&&e["edge".concat((0,d.Z)(a.edge))],e["size".concat((0,d.Z)(a.size))]]}})((function(t){var e,a=t.ownerState;return(0,r.Z)({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},"start"===a.edge&&{marginLeft:-8},"end"===a.edge&&{marginRight:-8},"small"===a.size&&(e={width:40,height:24,padding:7},(0,n.Z)(e,"& .".concat(w.thumb),{width:16,height:16}),(0,n.Z)(e,"& .".concat(w.switchBase),(0,n.Z)({padding:4},"&.".concat(w.checked),{transform:"translateX(16px)"})),e))})),b=(0,m.ZP)(u.Z,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:function(t,e){var a=t.ownerState;return[e.switchBase,(0,n.Z)({},"& .".concat(w.input),e.input),"default"!==a.color&&e["color".concat((0,d.Z)(a.color))]]}})((function(t){var e,a=t.theme;return e={position:"absolute",top:0,left:0,zIndex:1,color:a.vars?a.vars.palette.Switch.defaultColor:"".concat("light"===a.palette.mode?a.palette.common.white:a.palette.grey[300]),transition:a.transitions.create(["left","transform"],{duration:a.transitions.duration.shortest})},(0,n.Z)(e,"&.".concat(w.checked),{transform:"translateX(20px)"}),(0,n.Z)(e,"&.".concat(w.disabled),{color:a.vars?a.vars.palette.Switch.defaultDisabledColor:"".concat("light"===a.palette.mode?a.palette.grey[100]:a.palette.grey[600])}),(0,n.Z)(e,"&.".concat(w.checked," + .").concat(w.track),{opacity:.5}),(0,n.Z)(e,"&.".concat(w.disabled," + .").concat(w.track),{opacity:a.vars?a.vars.opacity.switchTrackDisabled:"".concat("light"===a.palette.mode?.12:.2)}),(0,n.Z)(e,"& .".concat(w.input),{left:"-100%",width:"300%"}),e}),(function(t){var e,a=t.theme,o=t.ownerState;return(0,r.Z)({"&:hover":{backgroundColor:a.vars?"rgba(".concat(a.vars.palette.action.activeChannel," / ").concat(a.vars.palette.action.hoverOpacity,")"):(0,s.Fq)(a.palette.action.active,a.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==o.color&&(e={},(0,n.Z)(e,"&.".concat(w.checked),(0,n.Z)({color:(a.vars||a).palette[o.color].main,"&:hover":{backgroundColor:a.vars?"rgba(".concat(a.vars.palette[o.color].mainChannel," / ").concat(a.vars.palette.action.hoverOpacity,")"):(0,s.Fq)(a.palette[o.color].main,a.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&.".concat(w.disabled),{color:a.vars?a.vars.palette.Switch["".concat(o.color,"DisabledColor")]:"".concat("light"===a.palette.mode?(0,s.$n)(a.palette[o.color].main,.62):(0,s._j)(a.palette[o.color].main,.55))})),(0,n.Z)(e,"&.".concat(w.checked," + .").concat(w.track),{backgroundColor:(a.vars||a).palette[o.color].main}),e))})),k=(0,m.ZP)("span",{name:"MuiSwitch",slot:"Track",overridesResolver:function(t,e){return e.track}})((function(t){var e=t.theme;return{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:"".concat("light"===e.palette.mode?e.palette.common.black:e.palette.common.white),opacity:e.vars?e.vars.opacity.switchTrack:"".concat("light"===e.palette.mode?.38:.3)}})),z=(0,m.ZP)("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:function(t,e){return e.thumb}})((function(t){var e=t.theme;return{boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}})),y=c.forwardRef((function(t,e){var a=(0,h.Z)({props:t,name:"MuiSwitch"}),n=a.className,c=a.color,s=void 0===c?"primary":c,u=a.edge,m=void 0!==u&&u,p=a.size,v=void 0===p?"medium":p,w=a.sx,y=(0,o.Z)(a,Z),S=(0,r.Z)({},a,{color:s,edge:m,size:v}),C=function(t){var e=t.classes,a=t.edge,n=t.size,o=t.color,c=t.checked,i=t.disabled,s={root:["root",a&&"edge".concat((0,d.Z)(a)),"size".concat((0,d.Z)(n))],switchBase:["switchBase","color".concat((0,d.Z)(o)),c&&"checked",i&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},u=(0,l.Z)(s,f,e);return(0,r.Z)({},e,u)}(S),j=(0,g.jsx)(z,{className:C.thumb,ownerState:S});return(0,g.jsxs)(x,{className:(0,i.Z)(C.root,n),sx:w,ownerState:S,children:[(0,g.jsx)(b,(0,r.Z)({type:"checkbox",icon:j,checkedIcon:j,ref:e,ownerState:S},y,{classes:(0,r.Z)({},C,{root:C.switchBase})})),(0,g.jsx)(k,{className:C.track,ownerState:S})]})}))},2078:function(t,e,a){var n=a(26849);t.exports=function(t){return n(t).toUpperCase()}},30278:function(t,e,a){var n=a(31104),o=a(43676);t.exports=function(t,e){return t&&t.length?o(t,n(e,2)):[]}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8973],{80378:function(e,n,t){t.d(n,{Z:function(){return x}});var r=t(33028),i=t(59740),o=t(55898),a=t.n(o),l=t(62681),s=t(72333),c=t(6352),d=t.n(c),u=t(35432),f=t(58238),p=t(14491);var m=t(96266),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:[]}},74286:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(55898),i=t.n(r),o=t(39948),a=t(96266);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}},44784:function(e,n,t){var r,i=t(71171),o=t(33028),a=t(59740),l=t(33518),s=t(82790),c=t(96266),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},5119:function(e,n,t){t.r(n),t.d(n,{default:function(){return mt}});var r=t(71171),i=t(33028),o=t(96234),a=t(59740),l=t(68079),s=t(5057),c=t(33518),d=t(55898),u=t.n(d),f=t(96181),p=t(6352),m=t.n(p),h=t(35432),x=t(39948),g=t(55402),Z=t(82275),v=t(96399),b=t(65688),j=t(37633),y=t(48037),k=t(92273),C=t(76720),L=t(15849),w=t(68420),E=t(94464),S=t(38242),_=t(80378),P=t(1722),O=t(32723),A=t(34795),T=t(43681),R=t.n(T),N=t(50482),B=t.n(N),I=t(36554),F=t(29034),K=t(28726),U=t(80578),D=t(76811),z=t(86229),G=t(28641),W=t(44846),V=t(13727),q=t(56184),Y=t(67680),M=t(74490),H=t(51177),J=t(19654),Q=t(96366),X=t(35406),$=t(11875),ee=t(95890),ne=t(96266),te=["label","disabled","required","initialValue","onChange","style","onSubmit","triggers","options","formatterBeforeSubmit"],re={PaperProps:{style:{maxHeight:224,width:250}}},ie=function(e,n,t){return{fontWeight:-1===n.indexOf(e)?t.typography.fontWeightRegular:t.typography.fontWeightMedium}};function oe(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=(0,a.Z)(e,te),g=(0,Q.Z)(),Z=(0,s.useState)(!1),v=(0,o.Z)(Z,2),b=v[0],j=v[1],y=(0,s.useState)(!1),k=(0,o.Z)(y,2),C=k[0],L=k[1],w=(0,s.useState)(l),E=(0,o.Z)(w,2),S=E[0],_=E[1],P=(0,s.useState)(S),T=(0,o.Z)(P,2),R=T[0],N=T[1],B=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(){return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.prev=1,e.next=4,u("function"===typeof m?m(R):R);case 4:!1===e.sent?N(S):(N(R),_(R)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),N(S);case 11:return e.prev=11,L(!1),j(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),I=b?(0,ne.jsx)(H.Z,(0,i.Z)((0,i.Z)({value:R,onChange:function(e){var n=e.target.value;n="string"===typeof n?n.split(","):n,N(n),c(n)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",renderValue:function(e){return(0,ne.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,ne.jsx)(J.Z,{label:p.find((function(n){return n.code===e})).name,style:{marginRight:8},size:"small"},e)}))})},MenuProps:re},h),{},{children:p.map((function(e){return(0,ne.jsx)(M.Z,{value:e.code,style:ie(e.code,R,g),children:e.name},e.code)}))})):(0,ne.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,ne.jsx)(J.Z,{label:p.find((function(n){return n.code===e})).name,style:{marginRight:8},size:"small"},e)}))});return(0,ne.jsx)($.Z,{className:"form",style:d,children:(0,ne.jsxs)(x.Z,{className:"form-item",children:[(0,ne.jsxs)(x.Z,{className:"form-item-label",children:[n,r&&(0,ne.jsx)(X.Z,{})]}),(0,ne.jsxs)(x.Z,{className:"form-item-body",children:[(0,ne.jsx)(x.Z,{className:"form-item-input",children:I}),(0,ne.jsx)(x.Z,{className:"form-item-action",children:b?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Y.Z,{"data-cy":"schema-form-item-confirm",onClick:B,disabled:t||C,size:"large",children:C?(0,ne.jsx)(W.Z,{size:24}):(0,ne.jsx)(q.Z,{})}),(0,ne.jsx)(Y.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){N(S),j(!1)},disabled:t||C,size:"large",children:(0,ne.jsx)(V.default,{})})]}):(0,ne.jsx)(ee.Z,{triggers:f,onEnterEdit:function(){return j(!0)},disabled:t})})]})]})})}oe.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,formatterBeforeSubmit:u().func},oe.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],formatterBeforeSubmit:function(e){return e.join(",")}};var ae,le=t(58238),se=t(14491),ce=t(54063),de=t(63406),ue=t(78410),fe=t(31853),pe=t(55152),me=t(70461),he=t(73545),xe=t(29054);function ge(e){var n=e.initialValue,t=e.onChange,r=e.disabled,i=e.loading,a=(0,w.PE)().t,l=(0,he.T)().api,s=(0,xe.y0)().blocklet,c=(0,fe.Z)({newAppSk:"",isConnectOpen:!1}),d=(0,o.Z)(c,2),u=d[0],f=d[1],p=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){return(0,O.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)?z.Z.error(a("blocklet.error.isRunning")):(0,S.isInProgress)(s.status)?z.Z.error(a("blocklet.error.isInProgress")):f({isConnectOpen:!0})}}]:[];return[(0,ne.jsx)(G.Z,{disabled:r,loading:i,initialValue:n,onSubmit:function(e){return f({newAppSk:e}),!1},triggers:g,secure:!0}),u.newAppSk&&(0,ne.jsx)(me.Z,{title:a("blocklet.config.appSkTitle"),description:(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(x.Z,{children:a("blocklet.config.appSkChangeTip")}),(0,ne.jsx)(x.Z,{fontWeight:"bold",mt:2,children:a("blocklet.config.appDidChangeTip")}),(0,ne.jsxs)(ve,{children:[(0,ne.jsx)("li",{children:a("blocklet.config.appDidChangeTipL1")}),(0,ne.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,ne.jsx)(pe.default,{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})]}ge.propTypes={initialValue:u().string,onChange:u().func,disabled:u().bool,loading:u().bool},ge.defaultProps={initialValue:"default",onChange:function(){},disabled:!1,loading:!1};var Ze,ve=(0,c.Z)("ul")(ae||(ae=(0,r.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"]))),be=t(13128),je=t(55372),ye=t(11750),ke=t(88574),Ce=t(26174),Le=t(88092),we=t(50185),Ee=t(17425);function Se(e){var n=e.onCancel,t=e.onSuccess,r=e.onError,i=(0,s.useContext)(he.B).api,a=(0,s.useState)(!1),l=(0,o.Z)(a,2),c=l[0],d=l[1],u=(0,w.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),L=C[0],E=C[1],S=(0,s.useState)(""),_=(0,o.Z)(S,2),P=_[0],O=_[1],A=(0,Ee.DJ)().endpoint,T=(0,s.useState)(!1),R=(0,o.Z)(T,2),N=R[0],B=R[1],I=function(e){Z(null),d(!0);try{O(e.result),E(U.length-1)}catch(t){var n=(0,se.Z)(t);Z(n),r(t)}finally{d(!1)}},F=function(){y(!1),E(0)},U=[{body:(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(ye.Z,{children:f("team.transferApp.transferDialog.tips.progress")}),(0,ne.jsx)(ye.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),E(1)}},{body:function(){return(0,ne.jsx)(pe.default,{action:"transfer-app-owner",open:j,locale:p,checkFn:i.get,onClose:F,onSuccess:I,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:P.transferId,endpoint:A});return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(x.Z,{component:Pe,dangerouslySetInnerHTML:{__html:f("team.transferApp.transferDialog.createSuccessTip1")}}),(0,ne.jsx)(x.Z,{component:Pe,mt:2,children:(0,ne.jsx)(Pe,{children:f("team.transferApp.transferDialog.createSuccessTip3")})}),(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(x.Z,{component:Pe,mt:2,children:(0,ne.jsx)(Pe,{children:f("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,se.B2)(P.expireDate,p)})})}),(0,ne.jsx)(x.Z,{my:1,children:(0,ne.jsx)(we.Z,{children:e})})]}),(0,ne.jsx)("div",{children:(0,ne.jsx)(Ce.Z,{value:"end",control:(0,ne.jsx)(Le.Z,{checked:N,onChange:function(e){return B(e.target.checked)}}),label:f("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:f("common.confirm"),onConfirm:t}],D=U[L];return(0,ne.jsxs)(be.ZP,{title:(0,ne.jsx)(Pe,{className:"title",children:f("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,ne.jsxs)(ne.Fragment,{children:[D.cancel&&(0,ne.jsx)(K.Z,{onClick:D.onCancel,color:"inherit",children:D.cancel}),(0,ne.jsxs)(K.Z,{onClick:D.onConfirm,color:"error",disabled:c||L===U.length-1&&!N,variant:"contained",autoFocus:!0,children:[c&&(0,ne.jsx)(W.Z,{size:16}),D.confirm]})]}),children:[(0,ne.jsx)(je.Z,{component:"div",children:"function"===typeof D.body?D.body():D.body}),!!g&&(0,ne.jsx)(ke.Z,{type:"error",variant:"icon",children:g})]})}Se.propTypes={onCancel:u().func.isRequired,onSuccess:u().func.isRequired,onError:u().func},Se.defaultProps={onError:function(){}};var _e,Pe=c.Z.div(Ze||(Ze=(0,r.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"]))),Oe=["blocklet","onUpdate","hasPermission"],Ae=Object.keys(D.SUPPORTED_LANGUAGES).map((function(e){return{code:e,name:D.SUPPORTED_LANGUAGES[e].nativeName}}));function Te(e){var n,t=e.blocklet,r=e.onUpdate,l=e.hasPermission,c=(0,a.Z)(e,Oe),d=(0,le.h6)(),u=(0,s.useContext)(w.RD).t,f=(0,s.useState)(""),p=(0,o.Z)(f,2),m=p[0],g=p[1],Z=(0,s.useState)(""),v=(0,o.Z)(Z,2),b=v[0],j=v[1],y=(0,s.useState)(!1),k=(0,o.Z)(y,2),C=k[0],L=k[1],E=(0,S.getWhoCanAccess)(t),_=null===t||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.publicToStore,P=b||!l,T=d.inService,N=d.ws.useSubscription,W=t.meta.did,V=t.site,q=R()(t.meta,"capabilities.clusterMode",!1);if(N(h.EVENTS.NODE_RUNTIME_INFO,(function(e){q&&g(R()(e,"cpu.physicalCores",""))})),(0,se.wS)(t.status))return null;var Y=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE})),M=!Y||"yes"===Y.value,H=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES})),J=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL})),Q=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE})),X=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT})),$=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON})),ee=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO})),te=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER})),re=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR})),ie=[{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:u("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:u("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:u("blocklet.config.appUrl"),value:J?J.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE,description:u("blocklet.config.logoSquare"),value:Q?Q.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT,description:u("blocklet.config.logoRect"),value:X?X.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON,description:u("blocklet.config.logoFavicon"),value:$?$.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO,description:u("blocklet.config.logo"),value:ee?ee.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:u("blocklet.config.copyrightOwner"),value:te?te.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:u("blocklet.config.copyrightYear"),value:re?re.value:""}];if(q){var ae=t.configs.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE})),fe=ae?ae.value:m;ie.push({key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:u("blocklet.config.clusterSize"),value:fe,cpuCores:m})}var pe=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o,a;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,i=n.target.checked,e.next=7,d.api.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),z.Z.error(e.t0.message);case 15:return e.prev=15,j(!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)}}(),me=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n,i){var o,a,l,s;return(0,O.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:m}))){e.next=5;break}return z.Z.error(o),e.abrupt("return");case 5:return a=[{key:n,value:i}],e.prev=6,j(!0),e.next=10,d.api.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),z.Z.error(e.t0.message);case 18:return e.prev=18,j(!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)}}(),he=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o,a;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,i=n.target.checked,e.next=7,d.api.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),z.Z.error(e.t0.message);case 15:return e.prev=15,j(!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)}}(),xe=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var r,i,o;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=V.corsAllowedOrigins||[],i=n.split(",").map((function(e){return e.trim()})).filter(Boolean),!B()(r,i)){e.next=4;break}return e.abrupt("return",!1);case 4:return e.prev=4,j(!0),o=i.length?i:["__none__"],e.next=9,d.api.updateRoutingSite({input:{id:V.id,corsAllowedOrigins:o,teamDid:t.meta.did}});case 9:j(!1),e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(4),z.Z.error(e.t0.message),j(!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)}}(),Ze=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,e.next=6,d.api.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),z.Z.error(e.t0.message);case 14:return e.prev=14,j(!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,ne.jsxs)(Ie,(0,i.Z)((0,i.Z)({},c),{},{children:[ie.map((function(e){return(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:e.description}),(0,ne.jsx)(G.Z,{style:{marginTop:0},disabled:b||P,loading:b,initialValue:e.value,onSubmit:function(n){return me(e.key,n)}})]})})),(0,ne.jsx)(x.Z,{className:"config-form",children:"all"===E&&"registry"===t.source&&(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.access.publicToStore"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u("blocklet.config.access.publicInstanceTip")})]}),(0,ne.jsx)(I.Z,{disabled:P,checked:_,defaultChecked:!0,onChange:pe})]})}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("blocklet.config.languages")}),(0,ne.jsx)(oe,{style:{marginTop:0},disabled:b||P,loading:b,options:Ae,initialValue:H?H.value.split(","):["en","zh"],onSubmit:function(e){return me("BLOCKLET_APP_LANGUAGES",e)}})]}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:(0,ne.jsx)(x.Z,{className:"config-label",mb:0,children:u("common.security")})}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("router.domainSecurity.cors.title")}),(0,ne.jsx)(x.Z,{mb:1.5,className:"config-desc",children:u("router.domainSecurity.cors.description",{name:"the blocklet"})}),(0,ne.jsx)(G.Z,{style:{marginTop:0},disabled:b||P,loading:b,initialValue:(V.corsAllowedOrigins||[]).join(", "),onSubmit:xe})]}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsx)(x.Z,{mb:2,className:"config-label",fontSize:20,children:u("blocklet.config.dangerZone")}),(0,ne.jsxs)(x.Z,{px:2,py:1,sx:{border:"1px solid red",borderRadius:2},children:[(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:!T&&(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.deletable.name"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u(M?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,ne.jsx)(I.Z,{disabled:P,checked:!M,defaultChecked:!0,onChange:he})]})}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("blocklet.config.sk")}),(0,ne.jsx)(ge,{disabled:b||P,loading:b,initialValue:t.environments.find((function(e){return"BLOCKLET_APP_SK"===e.key})).value,onChange:Ze})]}),T&&(0,ne.jsx)(de.Z,{role:"owner",children:function(e){return(e||ce.C)&&(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsx)(x.Z,{className:"config-label",mb:0,children:u("team.transferApp.name")}),(0,ne.jsxs)(K.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"transfer-app",onClick:function(){return L(!0)},children:[(0,ne.jsx)(U.Z,{style:{fontSize:"1.3em",marginRight:4}}),u("team.transferApp.name")]})]}),C&&(0,ne.jsx)(Se,{onCancel:function(){return L(!1)},onSuccess:function(){return L(!1)}})]})}}),(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.clearCache.name"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u("blocklet.config.clearCache.purpose")})]}),(0,ne.jsx)(ue.Z,{teamDid:W})]})})]})]}))}var Re=(0,de.V)(Te,"mutate_blocklets"),Ne=(0,de.V)(Te,"",se.Wf);function Be(e){return(0,le.h6)().inService?(0,ne.jsx)(Ne,(0,i.Z)({},e)):(0,ne.jsx)(Re,(0,i.Z)({},e))}Te.propTypes={blocklet:u().object.isRequired,onUpdate:u().func,hasPermission:u().bool},Te.defaultProps={onUpdate:function(){},hasPermission:!1};var Ie=c.Z.div(_e||(_e=(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 max-height: 60vh;\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")})),Fe=t(25710),Ke=t(93066),Ue=t(80576),De=t(47020),ze=t(56556),Ge=t(8708),We=t.n(Ge),Ve=t(99360),qe=t(95550),Ye=t(766),Me=t.n(Ye),He=t(24529),Je=t.n(He),Qe=t(16727),Xe=t.n(Qe),$e={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};var en=function(){var e,n,t,r=(0,le.h6)().api,o=(0,xe.y0)().blocklet,a=(0,w.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)({},$e),(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:We()(s,Object.keys($e))}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),g=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var t,o,s,c,d;return(0,O.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)({},$e),(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),z.Z.success(a("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.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,Ve.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!Me()(n)||a("notification.email.fromInvalid"):a("notification.email.fromRequired")})),v=(0,Ve.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!Je()(n,{require_host:!1,protocols:[]})||a("notification.email.hostInvalid"):a("notification.email.hostRequired")})),b=(0,Ve.Z)((function(e){return e?!!Xe()(e)||a("notification.email.portInvalid"):a("notification.email.portRequired")})),j=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("notification.email.userRequired")})),y=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("notification.email.passwordRequired")})),k=(0,Ve.Z)((function(){return!0}));return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:d(g),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(I.Z,(0,i.Z)({checked:n.value},n)),label:a("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,ne.jsx)(qe.Qr,{name:"from",control:u,rules:{validate:h?Z:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"host",control:u,rules:{validate:h?v:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"port",control:u,rules:{validate:h?b:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"user",control:u,rules:{validate:h?j:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"password",control:u,rules:{validate:h?y:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"secure",control:u,rules:{validate:k},render:function(e){var n=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(I.Z,(0,i.Z)((0,i.Z)({checked:n.value},n),{},{disabled:!h})),label:a("notification.email.secure"),style:{marginBottom:16}})})}}),(0,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:d(g),disabled:!f.isDirty,children:a("oauth.save")})]})})},nn=[{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"More"}),value:"more"}];var tn,rn,on=function(){var e=(0,s.useState)(nn[0].value),n=(0,o.Z)(e,2),t=n[0],r=n[1],i=(0,s.useContext)(w.RD).t,a=(0,Ke.Z)((function(){return{email:(0,ne.jsx)(en,{}),more:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Fe.Z,{children:i("notification.comingSoon")})})}}),[i]);return(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(E.Z,{tabs:nn,current:t,onChange:r}),(0,ne.jsx)(x.Z,{marginTop:"10px",children:a[t]})]})},an=t(75239),ln=t(48342),sn=t(94552),cn=t(24558),dn=t(74286),un=t(76667),fn=t(70648),pn=t(44067),mn=t(7664),hn=t(44123),xn=t(53906),gn=[{value:h.WHO_CAN_ACCESS.ALL,icon:xn.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:h.WHO_CAN_ACCESS.INVITED,icon:hn.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:h.WHO_CAN_ACCESS.OWNER,icon:mn.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"}}],Zn="roles",vn=[].concat((0,l.Z)(gn),[{value:Zn,icon:fn.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"}}]),bn=function(e,n){if(e&&e.startsWith(h.WHO_CAN_ACCESS_PREFIX_ROLES)){var t=(0,S.getRolesFromAuthConfig)({whoCanAccess:e}),r=n.filter((function(e){return t.includes(e.name)}));return{access:Zn,roles:r}}return{access:e,roles:[]}},jn=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 bn(i.value,r);if(n&&R()(n,"settings.whoCanAccess")&&R()(n,"settings.whoCanAccess")!==h.WHO_CAN_ACCESS.ALL)return bn(R()(n,"settings.whoCanAccess"),r);var o=(0,S.findServiceFromMeta)(e.meta,h.NODE_SERVICES.AUTH);return R()(o,"config.whoCanAccess")?bn(o.config.whoCanAccess,r):{access:h.WHO_CAN_ACCESS.ALL,roles:[]}};function yn(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,w.PE)(),p=f.t,m=f.locale,g=(0,le.h6)().api,Z=(0,Ee.DJ)().roles,v=(0,s.useState)(""),b=(0,o.Z)(v,2),j=b[0],y=b[1],k=t[0]||n,C=jn(n,k,{roles:Z}),L=C.access,E=C.roles,_=(0,s.useState)(L),P=(0,o.Z)(_,2),T=P[0],R=P[1],N=(0,s.useState)(E),B=(0,o.Z)(N,2),I=B[0],F=B[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},G=t.concat(n).map((function(e){return(0,S.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)},q=function(e){e.stopPropagation(),u(!0)},H=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(){var n;return(0,O.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=T)===Zn&&(n="".concat(h.WHO_CAN_ACCESS_PREFIX_ROLES).concat(I.map((function(e){return e.name})).join(","))),e.next=8,g.updateWhoCanAccess({input:{did:U,whoCanAccess:n}});case 8:z.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),z.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||T===Zn&&!I.length;return["function"===typeof r?r({open:q}):(0,ne.jsx)(Y.Z,{onClick:q,"data-cy":"action-config-component",children:(0,ne.jsx)(un.default,{})}),d&&(0,ne.jsxs)(Cn,{open:!0,fullWidth:!0,title:G,onClose:V,PaperProps:{style:{minHeight:"auto"}},actions:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(K.Z,{onClick:V,color:"inherit","data-cy":"config-access-cancel",children:p("common.cancel")}),(0,ne.jsxs)(K.Z,{onClick:H,color:"primary",disabled:X,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[j&&(0,ne.jsx)(W.Z,{size:16}),p("common.confirm")]})]}),children:[(0,ne.jsx)(x.Z,{mt:4,mb:3,children:(0,ne.jsx)(De.Z,{label:p("blocklet.config.access.description"),select:!0,fullWidth:!0,value:T,onChange:function(e){var n=e.target.value;R(n)},"data-cy":"config-access-select",SelectProps:{renderValue:function(e){var n=vn.find((function(n){return n.value===e}));return n?(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(n.icon,{style:D}),n.title[m]]}):null}},children:vn.map((function(e){return(0,ne.jsxs)(Ln,{value:e.value,sx:{display:"block"},"data-cy":"config-access-opt-".concat(e.value),children:[(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(e.icon,{style:D}),(0,ne.jsx)(x.Z,{children:e.title[m]})]}),(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(x.Z,{className:"tip",children:e.description[m]})})]})}))})}),T===Zn&&(0,ne.jsx)(x.Z,{mt:4,mb:3,children:(0,ne.jsx)(De.Z,{label:p("blocklet.config.access.description"),select:!0,fullWidth:!0,value:I.map((function(e){return e.name})),onChange:function(e){F(Z.filter((function(n){return(e.target.value||[]).includes(n.name)})))},SelectProps:{multiple:!0,renderValue:function(e){return(0,ne.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,ne.jsx)(J.Z,{label:n.title},n.text)}))})}},children:Z.map((function(e){var n=e.name,t=e.title;return(0,ne.jsxs)(M.Z,{value:n,children:[(0,ne.jsx)(Le.Z,{checked:I.some((function(e){return e.name===n}))}),(0,ne.jsx)(pn.Z,{primary:t})]},n)}))})})]})]}yn.propTypes={blocklet:u().object.isRequired,ancestors:u().array,children:u().any},yn.defaultProps={ancestors:[],children:null};var kn,Cn=(0,c.Z)(be.ZP)(tn||(tn=(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)(rn||(rn=(0,r.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.text.secondary}));function wn(e){var n,t,r=e.blocklet,i=e.ancestors,a=e.depth,c=(0,Q.Z)(),d=(0,w.PE)(),u=d.t,f=d.locale,p=(0,Ee.DJ)().roles,m=(0,s.useState)(!0),h=(0,o.Z)(m,2),g=h[0],Z=h[1],v=(0,xe.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)}),L={fill:c.palette.text.secondary},E=a>0&&r.children.length>0,P=(0,ne.jsx)(Y.Z,{size:"small",children:g?(0,ne.jsx)(C.Z,{fontSize:"inherit"}):(0,ne.jsx)(k.default,{fontSize:"inherit"})}),O=jn(r,b,{roles:p}),A=O.access,T=O.roles;if("roles"!==A)t=gn.find((function(e){return e.value===A}))||gn[2];else{var R=T.map((function(e){return e.title})).join("/");t={title:{zh:"\u53ea\u6709 ".concat(R," \u53ef\u4ee5\u8bbf\u95ee"),en:"Only ".concat(R," can access")}}}return[(a>0||"gateway"!==r.meta.group)&&(0,ne.jsxs)(x.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(x.Z,{pl:Math.max(2*(a-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:E?"pointer":"cursor"},onClick:function(){return E&&Z(!g)},children:[E?P:(0,ne.jsx)(x.Z,{width:28}),(0,ne.jsx)(_.Z,{blocklet:r,ancestors:i}),(0,ne.jsxs)(x.Z,{ml:"16px",children:[(0,ne.jsx)(x.Z,{style:{color:"#222",fontSize:18},children:(0,S.getDisplayName)(r,!0)}),(0,ne.jsx)(x.Z,{display:"flex",alignItems:"center",children:(0,ne.jsx)(x.Z,{color:"text.secondary",children:t.title[f]})})]})]},r),(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(an.Z,{title:u("common.visit"),children:(0,ne.jsx)("a",{target:"_blank",href:y,rel:"noopener noreferrer",title:y,children:(0,ne.jsx)(Y.Z,{children:(0,ne.jsx)(sn.Z,{})})})}),(0,ne.jsx)(yn,{blocklet:r,ancestors:i,children:function(e){var n=e.open;return(0,ne.jsx)(an.Z,{title:u("common.edit"),children:(0,ne.jsx)(Y.Z,{onClick:n,"data-cy":"btn-edit-".concat(r.meta.did),children:(0,ne.jsx)(cn.Z,{style:L})})})}})]},"actions")]},"group-not-gateway-box"),(0,ne.jsx)(dn.Z,{depth:a}),null!==(n=r.children)&&void 0!==n&&n.length?(0,ne.jsx)(ln.Z,{in:g,children:r.children.map((function(e){return(0,ne.jsx)(wn,{blocklet:e,ancestors:[].concat((0,l.Z)(i),[r]),depth:a+1},"".concat(a+1,"-").concat(e.meta.did))}))},"blocklet-collapse"):null]}function En(){var e=(0,w.PE)().t,n=(0,xe.y0)().blocklet,t=(0,l.Z)(n.children)||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,ne.jsx)(Sn,{component:"div",children:t&&t.length?[(0,ne.jsx)(x.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},style:{maxWidth:1080},children:(0,ne.jsx)(wn,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,ne.jsx)(x.Z,{mt:8,children:(0,ne.jsx)(Fe.Z,{children:e("blocklet.component.noComponent")})})})}wn.propTypes={blocklet:u().object.isRequired,ancestors:u().array,depth:u().number},wn.defaultProps={ancestors:[],depth:0},En.propTypes={};var Sn=(0,c.Z)(x.Z)(kn||(kn=(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(44784);var Pn=function(){var e,n,t,r=(0,le.h6)().api,o=(0,xe.y0)().blocklet,a=(0,w.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:We()(s,["domain","clientId","enabled"])}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),g=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var t,i,o,s,c;return(0,O.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),z.Z.success(a("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.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,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("oauth.auth0.domainDescribe")})),v=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("oauth.auth0.clientIdDescribe")})),b=(0,Ve.Z)((function(){return!0}));return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:d(g),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(_n.Z,(0,i.Z)({checked:n.value,style:{marginRight:"6px"}},n)),label:a("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,ne.jsx)(qe.Qr,{name:"domain",control:u,rules:{validate:h?Z:b},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"clientId",control:u,rules:{validate:h?v:b},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:d(g),disabled:!f.isDirty,children:a("oauth.save")})]})})},On=t(77150),An=t(24103),Tn={ttl:604800};function Rn(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 Nn(){var e,n,t=(0,le.h6)().api,r=(0,xe.y0)().blocklet,o=null===r||void 0===r||null===(e=r.meta)||void 0===e?void 0:e.did,a=Object.assign({},Tn,(null===r||void 0===r||null===(n=r.settings)||void 0===n?void 0:n.session)||{}),l=(0,qe.cI)({defaultValues:We()(Rn(a),["ttl"])}),s=l.handleSubmit,c=l.control,d=l.formState,u=l.reset,f=(0,w.PE)().t,p=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var r,i,a,l;return(0,O.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:Rn(n,!0)}});case 3:i=e.sent,a=i.blocklet,l=Object.assign({},Tn,We()((null===a||void 0===a||null===(r=a.settings)||void 0===r?void 0:r.session)||{},["ttl"])),u(Rn(l)),z.Z.success(f("common.configSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.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,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:s(p),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"ttl",control:c,render:function(e){var n=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,sx:{mb:2},children:(0,ne.jsxs)(An.Z,{px:3,children:[(0,ne.jsx)(x.Z,{mx:-3,my:.5,children:f("blocklet.config.session.ttl",{day:n.value})}),(0,ne.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,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:s(p),disabled:!d.isDirty,children:f("oauth.save")})]})})}var Bn=t(82555),In=t(30333),Fn=t(75760),Kn=t(97038),Un=t(12673),Dn=t(92706),zn=t.n(Dn),Gn=(0,s.forwardRef)((function(e,n){var t=(0,s.useContext)(w.RD).t,r=(0,Un.Z)({show:!1,title:"",content:"",onConfirm:zn(),onCancel:zn(),loading:!1}),i=(0,Ve.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||zn(),r.onCancel=e.onCancel||zn(),r.loading=!1})),o=(0,Ve.Z)((function(){r.title="",r.content="",r.onConfirm=zn(),r.onCancel=zn()})),a=(0,Ve.Z)((function(){r.show=!1,setTimeout((function(){o()}),300)})),l=(0,Ve.Z)((function(){a(),null===r||void 0===r||r.onCancel()}),[]),c=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.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,ne.jsx)(be.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 Wn=t(64886),Vn=t(42080),qn=t.n(Vn),Yn=t(75506),Mn=t.n(Yn),Hn=t(47685),Jn=t(13260),Qn=t(82434),Xn=t.n(Qn),$n=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(w.RD).t,o=(0,xe.y0)().blocklet,a=(0,le.h6)().api,l=(0,Un.Z)({mode:"view",show:!1,data:{},callback:zn()}),c=(0,Hn.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,Ve.Z)((function(){l.mode="view",l.data={},l.callback=zn()}),[]),f=(0,Ve.Z)((function(){l.show=!1,setTimeout((function(){u()}),d)}),[]),p=(0,Ve.Z)((function(e){l.mode="view",l.show=!0,l.data=e}),[]),h=(0,Ve.Z)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zn();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,Ke.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&&qn()(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,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(Bn.Z,{component:In.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,ne.jsx)(Jn.kL,{children:t})),["appUrl"].includes(e)&&(t=(0,ne.jsx)(x.Z,{component:"a",href:t,target:"_blank",children:t})),["appLogo"].includes(e)){var r=Xn()(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,ne.jsx)("img",{src:o.href,width:"60",height:"60",alt:l.data.appName})}catch(a){t=(0,ne.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,ne.jsx)(Jn.kL,{children:e})})));return Mn()(t)&&(t="-"),{name:n,value:t}}))}),[l.data]),Z="approve"===l.mode,v=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.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,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.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,ne.jsx)(be.ZP,{open:l.show,title:i(Z?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:f,actions:Z?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(ze.Z,{color:"error",variant:"contained",onClick:v,children:i("common.reject")}),(0,ne.jsx)(ze.Z,{variant:"contained",onClick:b,children:i("common.approve")})]}):(0,ne.jsx)(ze.Z,{variant:"outlined",onClick:f,children:i("common.close")}),children:g.map((function(e){return(0,ne.jsx)(Wn.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)}))})})),et=$n,nt=t(79842),tt=t(85408),rt=t.n(tt),it=(0,s.forwardRef)((function(e,n){var t,r,i=(0,Hn.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)(w.RD).t,l=(0,Un.Z)({show:!1,data:{link:""}}),c=(0,Ve.Z)((function(){l.data.link=""}),[]),d=(0,Ve.Z)((function(){l.show=!1,setTimeout((function(){c()}),o)}),[]),u=(0,Ve.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,Ve.Z)((function(){rt()(l.data.link),d()}),[d]);return(0,ne.jsxs)(be.ZP,{open:l.show,title:a("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:(0,ne.jsx)(K.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:f,children:a("common.copyAndClose")}),children:[(0,ne.jsx)(x.Z,{mb:1,children:a("federated.inviteJoinFederatedLoginDescription")}),(0,ne.jsx)(x.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,ne.jsx)(nt.Z,{language:"shell",style:{marginBottom:0},children:l.data.link})})]})}));function ot(e){var n,t,r,i,a,l=e.mode,c=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useContext)(w.RD),f=u.t,p=u.locale,m=(0,xe.y0)(),h=m.blocklet,g=m.actions.refreshBlocklet,Z=function(){var e=(0,s.useRef)(null),n=(0,Ve.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,Ve.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,ne.jsx)(Gn,{ref:e}),confirmApi:r}}(),v=Z.confirmApi,b=Z.confirmHolder,j=(0,le.h6)().api,y=(null===(n=h.settings.federated)||void 0===n?void 0:n.sites)||[],k=(null===(t=h.settings.federated)||void 0===t?void 0:t.config)||{autoLogin:!1},C=!1!==k.isMaster,L=(0,Ve.Z)((function(e){var n;null===(n=d.current)||void 0===n||n.open(e)})),E=(0,Ve.Z)((function(e){var n;null===(n=d.current)||void 0===n||n.approve(e,g)})),S=(0,Ve.Z)((function(e){v.open({title:f("federated.disableFederatedLogin"),content:f("federated.disableFederatedLoginDescription"),onConfirm:function(n){return(0,A.Z)((0,O.Z)().mark((function t(){return(0,O.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j.auditFederatedLogin({input:{memberPid:e.appPid,did:h.appPid,status:"revoked"}});case 2:n();case 3:case"end":return t.stop()}}),t)})))()}})})),_=(0,Ve.Z)((function(e){v.open({title:f("federated.enableFederatedLogin"),content:f("federated.enableFederatedLoginDescription"),onConfirm:function(n){return(0,A.Z)((0,O.Z)().mark((function t(){return(0,O.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j.auditFederatedLogin({input:{memberPid:e.appPid,did:h.appPid,status:"approved"}});case 2:n();case 3:case"end":return t.stop()}}),t)})))()}})})),P=(0,Ke.Z)((function(){var e=[{label:f("common.name"),name:"appName",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{display:"inline-block",children:(0,ne.jsxs)(x.Z,{component:"a",display:"flex",alignItems:"center",href:n.appUrl,target:"_blank",onClick:function(e){e.stopPropagation()},children:[t&&(0,ne.jsx)(Bn.Z,{component:In.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:f("common.did"),name:"appId",options:{customBodyRenderLite:function(e){var n=y[e];return(0,ne.jsx)(Kn.Z,{children:n.appId})}}},{label:f("common.status"),name:"status",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{children:t?"-":f("federated.status.".concat(n.status))})}}}];return C&&e.push({label:f("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{display:"flex",gap:1,children:t?(0,ne.jsxs)(ne.Fragment,{children:["rejected"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"error",size:"small",onClick:function(e){e.stopPropagation()},children:f("federated.status.rejected")}),"revoked"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"secondary",size:"small",onClick:function(e){e.stopPropagation()},children:f("federated.status.revoked")})]}):(0,ne.jsxs)(ne.Fragment,{children:["pending"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"primary",size:"small",onClick:function(e){e.stopPropagation(),E(n)},children:f("federated.status.pending")}),"approved"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"error",size:"small",onClick:function(e){e.stopPropagation(),S(n)},style:{whiteSpace:"nowrap"},children:f("federated.revoke")}),"revoked"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"warning",size:"small",onClick:function(e){e.stopPropagation(),_(n)},style:{whiteSpace:"nowrap"},children:f("federated.approve")})]})})}}}),e}),[k.appId,y,C]),T=(0,Ke.Z)((function(){return{sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick:function(e,n){var t=n.dataIndex,r=y[t];L(r)}}}),[]),R=(0,Ve.Z)((function(){var e,n=h.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL}));null!==n&&void 0!==n&&n.value?null===(e=c.current)||void 0===e||e.open({link:n.value}):z.Z.error(f("federated.failedToGetFederatedLoginLink"))}),[null===(r=h.site)||void 0===r||null===(i=r.domainAliases)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.href]),N=(0,s.useState)(k.autoLogin||!1),B=(0,o.Z)(N,2),I=B[0],F=B[1],U=(0,Ve.Z)((function(){v.open({title:f(I?"federated.disableFederatedAutoLogin":"federated.enableFederatedAutoLogin"),content:f(I?"federated.disableFederatedAutoLoginDescription":"federated.enableFederatedAutoLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.configFederated({input:{did:h.appPid,autoLogin:!I}});case 2:F((function(e){return!e})),e();case 4:case"end":return n.stop()}}),n)})))()}})}),[F,I]),G=(0,Ve.Z)((function(){v.open({title:f("federated.quitFederatedLogin"),content:f("federated.quitFederatedLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.quitFederatedLogin({input:{did:h.appPid}});case 2:e();case 3:case"end":return n.stop()}}),n)})))()}})})),W=(0,Ve.Z)((function(){v.open({title:f("federated.disbandFederatedLogin"),content:f("federated.disbandFederatedLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.disbandFederatedLogin({input:{did:h.appPid}});case 2:e();case 3:case"end":return n.stop()}}),n)})))()}})})),V=[];return"master"!==l?V.push((0,ne.jsx)(K.Z,{size:"small",variant:"contained",color:"error",onClick:G,sx:{ml:1},children:f("federated.quitFederatedLogin")},"quitFederatedLogin")):(V.push((0,ne.jsx)(K.Z,{size:"small",variant:"contained",onClick:R,sx:{ml:1},children:f("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),V.push((0,ne.jsx)(K.Z,{color:"error",size:"small",variant:"contained",onClick:W,sx:{ml:1},children:f("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Fn.Z,{className:"main-table",locale:p,data:y,columns:P,customButtons:V,title:(0,ne.jsx)(x.Z,{className:"table-toolbar-left",children:"master"===l?f("oauth.federated"):(0,ne.jsx)(Ce.Z,{sx:{ml:0,"& span.MuiSwitch-switchBase":{display:"flex"},"& span.MuiSwitch-track":{display:"block"}},control:(0,ne.jsx)(_n.Z,{checked:I,style:{marginRight:"6px"},onChange:U}),label:f("federated.enableFederatedAutoLogin")})}),options:T}),b,(0,ne.jsx)(it,{ref:c}),(0,ne.jsx)(et,{ref:d})]})}ot.propTypes={mode:u().oneOf(["member","master"])},ot.defaultProps={mode:"member"};var at=ot,lt=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(w.RD).t,o=(0,le.h6)().api,a=(0,xe.y0)().blocklet,l=null===a||void 0===a?void 0:a.appPid,c=(0,Hn.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,Un.Z)({show:!1,appUrl:"",appUrlError:"",callback:zn()}),f=(0,Ve.Z)((function(){u.appUrl="",u.appUrlError="",u.callback=zn()}),[]),p=(0,Ve.Z)((function(){u.show=!1,setTimeout((function(){f()}),d)}),[]),m=(0,Ve.Z)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zn();u.show=!0,u.callback=e}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:m,close:p}}),[m,p]);var h=(0,Ve.Z)((function(e){if(!e)throw new Error(i("federated.federatedJoinAppUrlRequired"));if(!Xn()(e))throw new Error(i("federated.federatedJoinAppUrlInvalid"))})),g=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){var n;return(0,O.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,ne.jsxs)(be.ZP,{open:u.show,title:i("federated.joinFederatedLogin"),onClose:p,PaperProps:{style:{minHeight:"unset"}},actions:(0,ne.jsx)(K.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:g,children:i("common.confirm")}),children:[(0,ne.jsx)(x.Z,{mb:1,children:i("federated.joinFederatedLoginDescription")}),(0,ne.jsx)(De.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}})]})})),st=lt;function ct(){var e,n,t,r,i=(0,s.useRef)(null),o=(0,s.useRef)(null),a=(0,s.useContext)(w.RD).t,l=(0,xe.y0)(),c=l.blocklet,d=l.actions.refreshBlocklet,u=(0,Ve.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){z.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,Ve.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,ne.jsx)(at,{mode:m?"master":"member"})}return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)(x.Z,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[(0,ne.jsx)(K.Z,{variant:"contained",onClick:u,children:a("federated.inviteJoinFederatedLogin")}),(0,ne.jsx)(F.Z,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),(0,ne.jsx)(K.Z,{variant:"outlined",onClick:f,children:a("federated.joinFederatedLogin")})]}),(0,ne.jsx)(it,{ref:i}),(0,ne.jsx)(st,{ref:o})]})}var dt,ut=function(){var e=(0,s.useContext)(w.RD).t,n=[{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.commonSettings")}),value:"settings"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.federated")}),value:"federated"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"Auth0"}),value:"auth0"},{label:(0,ne.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,Ke.Z)((function(){return{auth0:(0,ne.jsx)(Pn,{}),federated:(0,ne.jsx)(ct,{}),more:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Fe.Z,{children:e("oauth.comingSoon")})}),settings:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Nn,{})})}}),[e]);return(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(E.Z,{tabs:n,current:i,onChange:a}),(0,ne.jsx)(x.Z,{marginTop:"10px",children:l[i]})]})},ft=["blocklet","onUpdate"],pt=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,ne.jsxs)(x.Z,{pl:2*Math.max(1,s-1),display:"flex",alignItems:"center",justifyContent:"flex-start",children:[u?(0,ne.jsx)(P.Z,{size:24,blocklet:r}):(0,ne.jsx)(_.Z,{size:24,blocklet:r,ancestors:o}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:u?c("blocklet.component.container"):(0,S.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 mt(e){var n=e.blocklet,t=e.onUpdate,r=(0,a.Z)(e,ft),l=(0,s.useContext)(w.RD).t,c=(0,le.h6)(),d=c.info,u=c.inService,p=(0,s.useState)(!0),S=(0,o.Z)(p,2),_=S[0],P=S[1],O=(0,L.useSearchParams)(),A=(0,o.Z)(O,2),T=A[0],R=A[1],N=T.get("tab")||"general",B=[{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-general",children:[(0,ne.jsx)(Z.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.general")})})]},"general"),value:"general"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-access",children:[(0,ne.jsx)(v.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.access")})})]},"access"),value:"access"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-oauth",children:[(0,ne.jsx)(b.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.login")})})]},"oauth"),value:"oauth"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-notification",children:[(0,ne.jsx)(j.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.notification")})})]},"notification"),value:"notification"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-preference",children:[(0,ne.jsx)(x.Z,{ml:-2,style:{transform:"translateY(2px)"},children:_?(0,ne.jsx)(C.Z,{fontSize:"inherit"}):(0,ne.jsx)(k.default,{fontSize:"inherit"})}),(0,ne.jsx)(y.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.preferences")})})]},"preference"),value:"preference"}];_&&pt({tabs:B,blocklet:n,t:l});var I=null;if("general"===N)I=(0,ne.jsx)(Be,{blocklet:n,onUpdate:t});else if("access"===N)I=(0,ne.jsx)(En,{});else if("oauth"===N)I=(0,ne.jsx)(ut,{});else if("notification"===N)I=(0,ne.jsx)(on,{});else{var F=u?h.WELLKNOWN_SERVICE_PATH_PREFIX:d.routing.adminPath,K=new URLSearchParams;u||K.set("authKey","__sst"),K.set("schemaKey",m()(window.location.origin,F,"/api/preferences?id=".concat(encodeURIComponent(N)))),I=(0,ne.jsx)(f.Z,{url:"".concat(m()(window.location.origin,F,"/hosted/form-collector/"),"?").concat(K.toString()),width:"100%",height:"100%",frameBorder:0,styles:{border:0}})}return(0,ne.jsx)(ht,(0,i.Z)((0,i.Z)({},r),{},{children:(0,ne.jsxs)(g.ZP,{container:!0,spacing:4,columns:24,children:[(0,ne.jsx)(g.ZP,{item:!0,sm:7,md:5,children:(0,ne.jsx)(E.Z,{tabs:B,current:N,orientation:"vertical",onChange:function(e){"preference"===e?P(!_):R((function(n){return"general"===e?n.delete("tab"):n.set("tab",e),n}))},sx:{borderRight:1,height:"100%",borderColor:"divider"}})}),(0,ne.jsx)(g.ZP,{item:!0,sm:17,md:19,children:(0,ne.jsx)(x.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:I})})]})}))}mt.propTypes={blocklet:u().object.isRequired,onUpdate:u().func},mt.defaultProps={onUpdate:function(){}};var ht=c.Z.div(dt||(dt=(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"])))},78410:function(e,n,t){t.d(n,{Z:function(){return Z}});var r=t(33028),i=t(32723),o=t(34795),a=t(96234),l=t(59740),s=t(5057),c=t(86229),d=t(28726),u=t(44846),f=t(68420),p=t(99875),m=t(58238),h=t(70461),x=t(96266),g=["teamDid","size"];function Z(e){var n=e.teamDid,t=e.size,Z=void 0===t?"small":t,v=(0,l.Z)(e,g),b=(0,f.PE)().t,j=(0,m.h6)().api,y=(0,s.useState)(!1),k=(0,a.Z)(y,2),C=k[0],L=k[1],w=(0,s.useState)(null),E=(0,a.Z)(w,2),S=E[0],_=E[1],P=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),e.next=4,j.clearCache({input:{teamDid:n}});case 4:r=e.sent,c.Z.success(b("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),c.Z.error((0,p.Z)(e.t0));case 11:return e.prev=11,L(!1),_(null),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[0,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),O={title:b("blocklet.config.clearCache.title"),description:b("blocklet.config.clearCache.description"),confirm:b("common.confirm"),cancel:b("common.cancel"),onConfirm:P,onCancel:function(){L(!1),_(null)}};return(0,x.jsxs)("div",(0,r.Z)((0,r.Z)({},v),{},{children:[(0,x.jsxs)(d.Z,{onClick:function(){return _(O)},color:"error",variant:"outlined",size:Z,children:[C?(0,x.jsx)(u.Z,{size:16,style:{marginRight:5}}):null,b("blocklet.config.clearCache.action")]}),S&&(0,x.jsx)(h.Z,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,onConfirm:S.onConfirm,onCancel:S.onCancel})]}))}},50185:function(e,n,t){t.d(n,{Z:function(){return f}});var r=t(33028),i=t(59740),o=t(5057),a=t(55898),l=t.n(a),s=t(12937),c=t(68420),d=t(96266),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}},28641: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(5057),c=t(55898),d=t.n(c),u=t(39948),f=t(47020),p=t(44846),m=t(13727),h=t(56184),x=t(67680),g=t(35406),Z=t(11875),v=t(95890),b=t(96266),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,L=e.style,w=e.onSubmit,E=e.secure,S=e.triggers,_=e.formatterBeforeSubmit,P=(0,l.Z)(e,j),O=(0,s.useState)(!1),A=(0,a.Z)(O,2),T=A[0],R=A[1],N=(0,s.useState)(!1),B=(0,a.Z)(N,2),I=B[0],F=B[1],K=(0,s.useState)(E&&"__encrypted__"===d?null:d),U=(0,a.Z)(K,2),D=U[0],z=U[1],G=(0,s.useState)(D),W=(0,a.Z)(G,2),V=W[0],q=W[1],Y=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 F(!0),e.prev=1,e.next=4,w(V);case 4:!1===e.sent?q(D):(n=V,"function"===typeof _&&(n=_(V)),q(n),z(n)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),q(D);case 11:return e.prev=11,F(!1),R(!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){q(e),k(e)},H=T?(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&&Y()},disabled:t,type:E?"password":"text"},P)):(0,b.jsx)(u.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:y(V,E,d)});return(0,b.jsx)(Z.Z,{className:"form",style:L,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:H}),(0,b.jsx)(u.Z,{className:"form-item-action",children:T?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-confirm",onClick:Y,disabled:t||I,size:"large",children:I?(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(){q(D),R(!1)},disabled:t||I,size:"large",children:(0,b.jsx)(m.default,{})})]}):(0,b.jsx)(v.Z,{triggers:S,onEnterEdit:function(){return R(!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}},11875:function(e,n,t){var r,i=t(71171),o=t(33518),a=t(39948);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")}))},95890:function(e,n,t){t.d(n,{Z:function(){return Z}});var r=t(96234),i=t(5057),o=t(55898),a=t.n(o),l=t(24558),s=t(67680),c=t(56556),d=t(80633),u=t(49390),f=t(37200),p=t(25228),m=t(24202),h=t(74490),x=t(1733),g=t(96266);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:[]}},35406:function(e,n,t){var r,i=t(71171),o=t(33518).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},54063:function(e,n,t){t.d(n,{C:function(){return r}});var r="true"===localStorage.getItem("enableDebug")}}]);
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8973],{80378:function(e,n,t){t.d(n,{Z:function(){return x}});var r=t(33028),i=t(59740),o=t(55898),a=t.n(o),l=t(62681),s=t(72333),c=t(6352),d=t.n(c),u=t(35432),f=t(58238),p=t(14491);var m=t(96266),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:[]}},74286:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(55898),i=t.n(r),o=t(39948),a=t(96266);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}},44784:function(e,n,t){var r,i=t(71171),o=t(33028),a=t(59740),l=t(33518),s=t(82790),c=t(96266),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},5119:function(e,n,t){t.r(n),t.d(n,{default:function(){return mt}});var r=t(71171),i=t(33028),o=t(96234),a=t(59740),l=t(68079),s=t(5057),c=t(33518),d=t(55898),u=t.n(d),f=t(96181),p=t(6352),m=t.n(p),h=t(35432),x=t(39948),g=t(55402),Z=t(82275),v=t(96399),b=t(65688),j=t(37633),y=t(48037),k=t(92273),C=t(76720),L=t(15849),w=t(68420),E=t(94464),S=t(38242),_=t(80378),P=t(1722),O=t(32723),A=t(34795),T=t(43681),R=t.n(T),N=t(50482),B=t.n(N),I=t(36554),F=t(29034),K=t(28726),U=t(80578),D=t(76811),z=t(86229),G=t(28641),W=t(44846),V=t(13727),q=t(56184),Y=t(67680),M=t(74490),H=t(51177),J=t(19654),Q=t(96366),X=t(35406),$=t(11875),ee=t(95890),ne=t(96266),te=["label","disabled","required","initialValue","onChange","style","onSubmit","triggers","options","formatterBeforeSubmit"],re={PaperProps:{style:{maxHeight:224,width:250}}},ie=function(e,n,t){return{fontWeight:-1===n.indexOf(e)?t.typography.fontWeightRegular:t.typography.fontWeightMedium}};function oe(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=(0,a.Z)(e,te),g=(0,Q.Z)(),Z=(0,s.useState)(!1),v=(0,o.Z)(Z,2),b=v[0],j=v[1],y=(0,s.useState)(!1),k=(0,o.Z)(y,2),C=k[0],L=k[1],w=(0,s.useState)(l),E=(0,o.Z)(w,2),S=E[0],_=E[1],P=(0,s.useState)(S),T=(0,o.Z)(P,2),R=T[0],N=T[1],B=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(){return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.prev=1,e.next=4,u("function"===typeof m?m(R):R);case 4:!1===e.sent?N(S):(N(R),_(R)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),N(S);case 11:return e.prev=11,L(!1),j(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),I=b?(0,ne.jsx)(H.Z,(0,i.Z)((0,i.Z)({value:R,onChange:function(e){var n=e.target.value;n="string"===typeof n?n.split(","):n,N(n),c(n)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",renderValue:function(e){return(0,ne.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,ne.jsx)(J.Z,{label:p.find((function(n){return n.code===e})).name,style:{marginRight:8},size:"small"},e)}))})},MenuProps:re},h),{},{children:p.map((function(e){return(0,ne.jsx)(M.Z,{value:e.code,style:ie(e.code,R,g),children:e.name},e.code)}))})):(0,ne.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,ne.jsx)(J.Z,{label:p.find((function(n){return n.code===e})).name,style:{marginRight:8},size:"small"},e)}))});return(0,ne.jsx)($.Z,{className:"form",style:d,children:(0,ne.jsxs)(x.Z,{className:"form-item",children:[(0,ne.jsxs)(x.Z,{className:"form-item-label",children:[n,r&&(0,ne.jsx)(X.Z,{})]}),(0,ne.jsxs)(x.Z,{className:"form-item-body",children:[(0,ne.jsx)(x.Z,{className:"form-item-input",children:I}),(0,ne.jsx)(x.Z,{className:"form-item-action",children:b?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Y.Z,{"data-cy":"schema-form-item-confirm",onClick:B,disabled:t||C,size:"large",children:C?(0,ne.jsx)(W.Z,{size:24}):(0,ne.jsx)(q.Z,{})}),(0,ne.jsx)(Y.Z,{"data-cy":"schema-form-item-cancel",onClick:function(){N(S),j(!1)},disabled:t||C,size:"large",children:(0,ne.jsx)(V.default,{})})]}):(0,ne.jsx)(ee.Z,{triggers:f,onEnterEdit:function(){return j(!0)},disabled:t})})]})]})})}oe.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,formatterBeforeSubmit:u().func},oe.defaultProps={style:{},onSubmit:function(){},onChange:function(){},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],formatterBeforeSubmit:function(e){return e.join(",")}};var ae,le=t(58238),se=t(14491),ce=t(54063),de=t(63406),ue=t(78410),fe=t(31853),pe=t(55152),me=t(70461),he=t(73545),xe=t(29054);function ge(e){var n=e.initialValue,t=e.onChange,r=e.disabled,i=e.loading,a=(0,w.PE)().t,l=(0,he.T)().api,s=(0,xe.y0)().blocklet,c=(0,fe.Z)({newAppSk:"",isConnectOpen:!1}),d=(0,o.Z)(c,2),u=d[0],f=d[1],p=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){return(0,O.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)?z.Z.error(a("blocklet.error.isRunning")):(0,S.isInProgress)(s.status)?z.Z.error(a("blocklet.error.isInProgress")):f({isConnectOpen:!0})}}]:[];return[(0,ne.jsx)(G.Z,{disabled:r,loading:i,initialValue:n,onSubmit:function(e){return f({newAppSk:e}),!1},triggers:g,secure:!0}),u.newAppSk&&(0,ne.jsx)(me.Z,{title:a("blocklet.config.appSkTitle"),description:(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(x.Z,{children:a("blocklet.config.appSkChangeTip")}),(0,ne.jsx)(x.Z,{fontWeight:"bold",mt:2,children:a("blocklet.config.appDidChangeTip")}),(0,ne.jsxs)(ve,{children:[(0,ne.jsx)("li",{children:a("blocklet.config.appDidChangeTipL1")}),(0,ne.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,ne.jsx)(pe.default,{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})]}ge.propTypes={initialValue:u().string,onChange:u().func,disabled:u().bool,loading:u().bool},ge.defaultProps={initialValue:"default",onChange:function(){},disabled:!1,loading:!1};var Ze,ve=(0,c.Z)("ul")(ae||(ae=(0,r.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"]))),be=t(13128),je=t(55372),ye=t(11750),ke=t(88574),Ce=t(26174),Le=t(88092),we=t(50185),Ee=t(17425);function Se(e){var n=e.onCancel,t=e.onSuccess,r=e.onError,i=(0,s.useContext)(he.B).api,a=(0,s.useState)(!1),l=(0,o.Z)(a,2),c=l[0],d=l[1],u=(0,w.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),L=C[0],E=C[1],S=(0,s.useState)(""),_=(0,o.Z)(S,2),P=_[0],O=_[1],A=(0,Ee.DJ)().endpoint,T=(0,s.useState)(!1),R=(0,o.Z)(T,2),N=R[0],B=R[1],I=function(e){Z(null),d(!0);try{O(e.result),E(U.length-1)}catch(t){var n=(0,se.Z)(t);Z(n),r(t)}finally{d(!1)}},F=function(){y(!1),E(0)},U=[{body:(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(ye.Z,{children:f("team.transferApp.transferDialog.tips.progress")}),(0,ne.jsx)(ye.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),E(1)}},{body:function(){return(0,ne.jsx)(pe.default,{action:"transfer-app-owner",open:j,locale:p,checkFn:i.get,onClose:F,onSuccess:I,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:P.transferId,endpoint:A});return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(x.Z,{component:Pe,dangerouslySetInnerHTML:{__html:f("team.transferApp.transferDialog.createSuccessTip1")}}),(0,ne.jsx)(x.Z,{component:Pe,mt:2,children:(0,ne.jsx)(Pe,{children:f("team.transferApp.transferDialog.createSuccessTip3")})}),(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(x.Z,{component:Pe,mt:2,children:(0,ne.jsx)(Pe,{children:f("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,se.B2)(P.expireDate,p)})})}),(0,ne.jsx)(x.Z,{my:1,children:(0,ne.jsx)(we.Z,{children:e})})]}),(0,ne.jsx)("div",{children:(0,ne.jsx)(Ce.Z,{value:"end",control:(0,ne.jsx)(Le.Z,{checked:N,onChange:function(e){return B(e.target.checked)}}),label:f("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:f("common.confirm"),onConfirm:t}],D=U[L];return(0,ne.jsxs)(be.ZP,{title:(0,ne.jsx)(Pe,{className:"title",children:f("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,ne.jsxs)(ne.Fragment,{children:[D.cancel&&(0,ne.jsx)(K.Z,{onClick:D.onCancel,color:"inherit",children:D.cancel}),(0,ne.jsxs)(K.Z,{onClick:D.onConfirm,color:"error",disabled:c||L===U.length-1&&!N,variant:"contained",autoFocus:!0,children:[c&&(0,ne.jsx)(W.Z,{size:16}),D.confirm]})]}),children:[(0,ne.jsx)(je.Z,{component:"div",children:"function"===typeof D.body?D.body():D.body}),!!g&&(0,ne.jsx)(ke.Z,{type:"error",variant:"icon",children:g})]})}Se.propTypes={onCancel:u().func.isRequired,onSuccess:u().func.isRequired,onError:u().func},Se.defaultProps={onError:function(){}};var _e,Pe=c.Z.div(Ze||(Ze=(0,r.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"]))),Oe=["blocklet","onUpdate","hasPermission"],Ae=Object.keys(D.SUPPORTED_LANGUAGES).map((function(e){return{code:e,name:D.SUPPORTED_LANGUAGES[e].nativeName}}));function Te(e){var n,t=e.blocklet,r=e.onUpdate,l=e.hasPermission,c=(0,a.Z)(e,Oe),d=(0,le.h6)(),u=(0,s.useContext)(w.RD).t,f=(0,s.useState)(""),p=(0,o.Z)(f,2),m=p[0],g=p[1],Z=(0,s.useState)(""),v=(0,o.Z)(Z,2),b=v[0],j=v[1],y=(0,s.useState)(!1),k=(0,o.Z)(y,2),C=k[0],L=k[1],E=(0,S.getWhoCanAccess)(t),_=null===t||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.publicToStore,P=b||!l,T=d.inService,N=d.ws.useSubscription,W=t.meta.did,V=t.site,q=R()(t.meta,"capabilities.clusterMode",!1);if(N(h.EVENTS.NODE_RUNTIME_INFO,(function(e){q&&g(R()(e,"cpu.physicalCores",""))})),(0,se.wS)(t.status))return null;var Y=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE})),M=!Y||"yes"===Y.value,H=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES})),J=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL})),Q=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE})),X=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT})),$=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON})),ee=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO})),te=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER})),re=t.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR})),ie=[{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:u("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:u("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:u("blocklet.config.appUrl"),value:J?J.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE,description:u("blocklet.config.logoSquare"),value:Q?Q.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT,description:u("blocklet.config.logoRect"),value:X?X.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON,description:u("blocklet.config.logoFavicon"),value:$?$.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO,description:u("blocklet.config.logo"),value:ee?ee.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:u("blocklet.config.copyrightOwner"),value:te?te.value:""},{key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:u("blocklet.config.copyrightYear"),value:re?re.value:""}];if(q){var ae=t.configs.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE})),fe=ae?ae.value:m;ie.push({key:D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:u("blocklet.config.clusterSize"),value:fe,cpuCores:m})}var pe=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o,a;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,i=n.target.checked,e.next=7,d.api.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),z.Z.error(e.t0.message);case 15:return e.prev=15,j(!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)}}(),me=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n,i){var o,a,l,s;return(0,O.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:m}))){e.next=5;break}return z.Z.error(o),e.abrupt("return");case 5:return a=[{key:n,value:i}],e.prev=6,j(!0),e.next=10,d.api.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),z.Z.error(e.t0.message);case 18:return e.prev=18,j(!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)}}(),he=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o,a;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,i=n.target.checked,e.next=7,d.api.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),z.Z.error(e.t0.message);case 15:return e.prev=15,j(!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)}}(),xe=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var r,i,o;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=V.corsAllowedOrigins||[],i=n.split(",").map((function(e){return e.trim()})).filter(Boolean),!B()(r,i)){e.next=4;break}return e.abrupt("return",!1);case 4:return e.prev=4,j(!0),o=i.length?i:["__none__"],e.next=9,d.api.updateRoutingSite({input:{id:V.id,corsAllowedOrigins:o,teamDid:t.meta.did}});case 9:j(!1),e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(4),z.Z.error(e.t0.message),j(!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)}}(),Ze=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var i,o;return(0,O.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return j(!0),e.prev=3,e.next=6,d.api.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),z.Z.error(e.t0.message);case 14:return e.prev=14,j(!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,ne.jsxs)(Ie,(0,i.Z)((0,i.Z)({},c),{},{children:[ie.map((function(e){return(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:e.description}),(0,ne.jsx)(G.Z,{style:{marginTop:0},disabled:b||P,loading:b,initialValue:e.value,onSubmit:function(n){return me(e.key,n)}})]})})),(0,ne.jsx)(x.Z,{className:"config-form",children:"all"===E&&"registry"===t.source&&(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.access.publicToStore"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u("blocklet.config.access.publicInstanceTip")})]}),(0,ne.jsx)(I.Z,{disabled:P,checked:_,defaultChecked:!0,onChange:pe})]})}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("blocklet.config.languages")}),(0,ne.jsx)(oe,{style:{marginTop:0},disabled:b||P,loading:b,options:Ae,initialValue:H?H.value.split(","):["en","zh"],onSubmit:function(e){return me("BLOCKLET_APP_LANGUAGES",e)}})]}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:(0,ne.jsx)(x.Z,{className:"config-label",mb:0,children:u("common.security")})}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("router.domainSecurity.cors.title")}),(0,ne.jsx)(x.Z,{mb:1.5,className:"config-desc",children:u("router.domainSecurity.cors.description",{name:"the blocklet"})}),(0,ne.jsx)(G.Z,{style:{marginTop:0},disabled:b||P,loading:b,initialValue:(V.corsAllowedOrigins||[]).join(", "),onSubmit:xe})]}),(0,ne.jsx)(x.Z,{className:"config-form",component:F.Z,my:3}),(0,ne.jsx)(x.Z,{mb:2,className:"config-label",fontSize:20,children:u("blocklet.config.dangerZone")}),(0,ne.jsxs)(x.Z,{px:2,py:1,sx:{border:"1px solid red",borderRadius:2},children:[(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:!T&&(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.deletable.name"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u(M?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,ne.jsx)(I.Z,{disabled:P,checked:!M,defaultChecked:!0,onChange:he})]})}),(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsx)(x.Z,{className:"config-label",fontSize:14,mb:0,children:u("blocklet.config.sk")}),(0,ne.jsx)(ge,{disabled:b||P,loading:b,initialValue:t.environments.find((function(e){return"BLOCKLET_APP_SK"===e.key})).value,onChange:Ze})]}),T&&(0,ne.jsx)(de.Z,{role:"owner",children:function(e){return(e||ce.C)&&(0,ne.jsxs)(x.Z,{className:"config-form",mt:2,children:[(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsx)(x.Z,{className:"config-label",mb:0,children:u("team.transferApp.name")}),(0,ne.jsxs)(K.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"transfer-app",onClick:function(){return L(!0)},children:[(0,ne.jsx)(U.Z,{style:{fontSize:"1.3em",marginRight:4}}),u("team.transferApp.name")]})]}),C&&(0,ne.jsx)(Se,{onCancel:function(){return L(!1)},onSuccess:function(){return L(!1)}})]})}}),(0,ne.jsx)(x.Z,{className:"config-form",mt:2,children:(0,ne.jsxs)(x.Z,{className:"config-item",children:[(0,ne.jsxs)(x.Z,{className:"config-label",children:[u("blocklet.config.clearCache.name"),(0,ne.jsx)(x.Z,{className:"config-desc",children:u("blocklet.config.clearCache.purpose")})]}),(0,ne.jsx)(ue.Z,{teamDid:W})]})})]})]}))}var Re=(0,de.V)(Te,"mutate_blocklets"),Ne=(0,de.V)(Te,"",se.Wf);function Be(e){return(0,le.h6)().inService?(0,ne.jsx)(Ne,(0,i.Z)({},e)):(0,ne.jsx)(Re,(0,i.Z)({},e))}Te.propTypes={blocklet:u().object.isRequired,onUpdate:u().func,hasPermission:u().bool},Te.defaultProps={onUpdate:function(){},hasPermission:!1};var Ie=c.Z.div(_e||(_e=(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 max-height: 60vh;\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")})),Fe=t(25710),Ke=t(93066),Ue=t(80576),De=t(47020),ze=t(56556),Ge=t(8708),We=t.n(Ge),Ve=t(99360),qe=t(95550),Ye=t(766),Me=t.n(Ye),He=t(24529),Je=t.n(He),Qe=t(16727),Xe=t.n(Qe),$e={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};var en=function(){var e,n,t,r=(0,le.h6)().api,o=(0,xe.y0)().blocklet,a=(0,w.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)({},$e),(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:We()(s,Object.keys($e))}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),g=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var t,o,s,c,d;return(0,O.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)({},$e),(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),z.Z.success(a("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.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,Ve.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!Me()(n)||a("notification.email.fromInvalid"):a("notification.email.fromRequired")})),v=(0,Ve.Z)((function(e){var n=null===e||void 0===e?void 0:e.trim();return n?!!Je()(n,{require_host:!1,protocols:[]})||a("notification.email.hostInvalid"):a("notification.email.hostRequired")})),b=(0,Ve.Z)((function(e){return e?!!Xe()(e)||a("notification.email.portInvalid"):a("notification.email.portRequired")})),j=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("notification.email.userRequired")})),y=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("notification.email.passwordRequired")})),k=(0,Ve.Z)((function(){return!0}));return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:d(g),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(I.Z,(0,i.Z)({checked:n.value},n)),label:a("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,ne.jsx)(qe.Qr,{name:"from",control:u,rules:{validate:h?Z:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"host",control:u,rules:{validate:h?v:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"port",control:u,rules:{validate:h?b:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"user",control:u,rules:{validate:h?j:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"password",control:u,rules:{validate:h?y:k},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"secure",control:u,rules:{validate:k},render:function(e){var n=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(I.Z,(0,i.Z)((0,i.Z)({checked:n.value},n),{},{disabled:!h})),label:a("notification.email.secure"),style:{marginBottom:16}})})}}),(0,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:d(g),disabled:!f.isDirty,children:a("oauth.save")})]})})},nn=[{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"More"}),value:"more"}];var tn,rn,on=function(){var e=(0,s.useState)(nn[0].value),n=(0,o.Z)(e,2),t=n[0],r=n[1],i=(0,s.useContext)(w.RD).t,a=(0,Ke.Z)((function(){return{email:(0,ne.jsx)(en,{}),more:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Fe.Z,{children:i("notification.comingSoon")})})}}),[i]);return(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(E.Z,{tabs:nn,current:t,onChange:r}),(0,ne.jsx)(x.Z,{marginTop:"10px",children:a[t]})]})},an=t(75239),ln=t(48342),sn=t(94552),cn=t(24558),dn=t(74286),un=t(76667),fn=t(70648),pn=t(44067),mn=t(7664),hn=t(44123),xn=t(53906),gn=[{value:h.WHO_CAN_ACCESS.ALL,icon:xn.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:h.WHO_CAN_ACCESS.INVITED,icon:hn.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:h.WHO_CAN_ACCESS.OWNER,icon:mn.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"}}],Zn="roles",vn=[].concat((0,l.Z)(gn),[{value:Zn,icon:fn.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"}}]),bn=function(e,n){if(e&&e.startsWith(h.WHO_CAN_ACCESS_PREFIX_ROLES)){var t=(0,S.getRolesFromAuthConfig)({whoCanAccess:e}),r=n.filter((function(e){return t.includes(e.name)}));return{access:Zn,roles:r}}return{access:e,roles:[]}},jn=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 bn(i.value,r);if(n&&R()(n,"settings.whoCanAccess")&&R()(n,"settings.whoCanAccess")!==h.WHO_CAN_ACCESS.ALL)return bn(R()(n,"settings.whoCanAccess"),r);var o=(0,S.findServiceFromMeta)(e.meta,h.NODE_SERVICES.AUTH);return R()(o,"config.whoCanAccess")?bn(o.config.whoCanAccess,r):{access:h.WHO_CAN_ACCESS.ALL,roles:[]}};function yn(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,w.PE)(),p=f.t,m=f.locale,g=(0,le.h6)().api,Z=(0,Ee.DJ)().roles,v=(0,s.useState)(""),b=(0,o.Z)(v,2),j=b[0],y=b[1],k=t[0]||n,C=jn(n,k,{roles:Z}),L=C.access,E=C.roles,_=(0,s.useState)(L),P=(0,o.Z)(_,2),T=P[0],R=P[1],N=(0,s.useState)(E),B=(0,o.Z)(N,2),I=B[0],F=B[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},G=t.concat(n).map((function(e){return(0,S.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)},q=function(e){e.stopPropagation(),u(!0)},H=function(){var e=(0,A.Z)((0,O.Z)().mark((function e(){var n;return(0,O.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=T)===Zn&&(n="".concat(h.WHO_CAN_ACCESS_PREFIX_ROLES).concat(I.map((function(e){return e.name})).join(","))),e.next=8,g.updateWhoCanAccess({input:{did:U,whoCanAccess:n}});case 8:z.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),z.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||T===Zn&&!I.length;return["function"===typeof r?r({open:q}):(0,ne.jsx)(Y.Z,{onClick:q,"data-cy":"action-config-component",children:(0,ne.jsx)(un.default,{})}),d&&(0,ne.jsxs)(Cn,{open:!0,fullWidth:!0,title:G,onClose:V,PaperProps:{style:{minHeight:"auto"}},actions:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(K.Z,{onClick:V,color:"inherit","data-cy":"config-access-cancel",children:p("common.cancel")}),(0,ne.jsxs)(K.Z,{onClick:H,color:"primary",disabled:X,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[j&&(0,ne.jsx)(W.Z,{size:16}),p("common.confirm")]})]}),children:[(0,ne.jsx)(x.Z,{mt:4,mb:3,children:(0,ne.jsx)(De.Z,{label:p("blocklet.config.access.description"),select:!0,fullWidth:!0,value:T,onChange:function(e){var n=e.target.value;R(n)},"data-cy":"config-access-select",SelectProps:{renderValue:function(e){var n=vn.find((function(n){return n.value===e}));return n?(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(n.icon,{style:D}),n.title[m]]}):null}},children:vn.map((function(e){return(0,ne.jsxs)(Ln,{value:e.value,sx:{display:"block"},"data-cy":"config-access-opt-".concat(e.value),children:[(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,ne.jsx)(e.icon,{style:D}),(0,ne.jsx)(x.Z,{children:e.title[m]})]}),(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(x.Z,{className:"tip",children:e.description[m]})})]})}))})}),T===Zn&&(0,ne.jsx)(x.Z,{mt:4,mb:3,children:(0,ne.jsx)(De.Z,{label:p("blocklet.config.access.description"),select:!0,fullWidth:!0,value:I.map((function(e){return e.name})),onChange:function(e){F(Z.filter((function(n){return(e.target.value||[]).includes(n.name)})))},SelectProps:{multiple:!0,renderValue:function(e){return(0,ne.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,ne.jsx)(J.Z,{label:n.title},n.text)}))})}},children:Z.map((function(e){var n=e.name,t=e.title;return(0,ne.jsxs)(M.Z,{value:n,children:[(0,ne.jsx)(Le.Z,{checked:I.some((function(e){return e.name===n}))}),(0,ne.jsx)(pn.Z,{primary:t})]},n)}))})})]})]}yn.propTypes={blocklet:u().object.isRequired,ancestors:u().array,children:u().any},yn.defaultProps={ancestors:[],children:null};var kn,Cn=(0,c.Z)(be.ZP)(tn||(tn=(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)(rn||(rn=(0,r.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.text.secondary}));function wn(e){var n,t,r=e.blocklet,i=e.ancestors,a=e.depth,c=(0,Q.Z)(),d=(0,w.PE)(),u=d.t,f=d.locale,p=(0,Ee.DJ)().roles,m=(0,s.useState)(!0),h=(0,o.Z)(m,2),g=h[0],Z=h[1],v=(0,xe.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)}),L={fill:c.palette.text.secondary},E=a>0&&r.children.length>0,P=(0,ne.jsx)(Y.Z,{size:"small",children:g?(0,ne.jsx)(C.Z,{fontSize:"inherit"}):(0,ne.jsx)(k.default,{fontSize:"inherit"})}),O=jn(r,b,{roles:p}),A=O.access,T=O.roles;if("roles"!==A)t=gn.find((function(e){return e.value===A}))||gn[2];else{var R=T.map((function(e){return e.title})).join("/");t={title:{zh:"\u53ea\u6709 ".concat(R," \u53ef\u4ee5\u8bbf\u95ee"),en:"Only ".concat(R," can access")}}}return[(a>0||"gateway"!==r.meta.group)&&(0,ne.jsxs)(x.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,ne.jsxs)(x.Z,{pl:Math.max(2*(a-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:E?"pointer":"cursor"},onClick:function(){return E&&Z(!g)},children:[E?P:(0,ne.jsx)(x.Z,{width:28}),(0,ne.jsx)(_.Z,{blocklet:r,ancestors:i}),(0,ne.jsxs)(x.Z,{ml:"16px",children:[(0,ne.jsx)(x.Z,{style:{color:"#222",fontSize:18},children:(0,S.getDisplayName)(r,!0)}),(0,ne.jsx)(x.Z,{display:"flex",alignItems:"center",children:(0,ne.jsx)(x.Z,{color:"text.secondary",children:t.title[f]})})]})]},r),(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(an.Z,{title:u("common.visit"),children:(0,ne.jsx)("a",{target:"_blank",href:y,rel:"noopener noreferrer",title:y,children:(0,ne.jsx)(Y.Z,{children:(0,ne.jsx)(sn.Z,{})})})}),(0,ne.jsx)(yn,{blocklet:r,ancestors:i,children:function(e){var n=e.open;return(0,ne.jsx)(an.Z,{title:u("common.edit"),children:(0,ne.jsx)(Y.Z,{onClick:n,"data-cy":"btn-edit-".concat(r.meta.did),children:(0,ne.jsx)(cn.Z,{style:L})})})}})]},"actions")]},"group-not-gateway-box"),(0,ne.jsx)(dn.Z,{depth:a}),null!==(n=r.children)&&void 0!==n&&n.length?(0,ne.jsx)(ln.Z,{in:g,children:r.children.map((function(e){return(0,ne.jsx)(wn,{blocklet:e,ancestors:[].concat((0,l.Z)(i),[r]),depth:a+1},"".concat(a+1,"-").concat(e.meta.did))}))},"blocklet-collapse"):null]}function En(){var e=(0,w.PE)().t,n=(0,xe.y0)().blocklet,t=(0,l.Z)(n.children)||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,ne.jsx)(Sn,{component:"div",children:t&&t.length?[(0,ne.jsx)(x.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},style:{maxWidth:1080},children:(0,ne.jsx)(wn,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,ne.jsx)(x.Z,{mt:8,children:(0,ne.jsx)(Fe.Z,{children:e("blocklet.component.noComponent")})})})}wn.propTypes={blocklet:u().object.isRequired,ancestors:u().array,depth:u().number},wn.defaultProps={ancestors:[],depth:0},En.propTypes={};var Sn=(0,c.Z)(x.Z)(kn||(kn=(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(44784);var Pn=function(){var e,n,t,r=(0,le.h6)().api,o=(0,xe.y0)().blocklet,a=(0,w.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:We()(s,["domain","clientId","enabled"])}),d=c.handleSubmit,u=c.control,f=c.formState,p=c.watch,m=c.reset,h=p("enabled"),g=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var t,i,o,s,c;return(0,O.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),z.Z.success(a("oauth.saveSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.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,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("oauth.auth0.domainDescribe")})),v=(0,Ve.Z)((function(e){return!(null===e||void 0===e||!e.trim())||a("oauth.auth0.clientIdDescribe")})),b=(0,Ve.Z)((function(){return!0}));return(0,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:d(g),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"enabled",control:u,render:function(e){var n=e.field;return(0,ne.jsx)(Ce.Z,{control:(0,ne.jsx)(_n.Z,(0,i.Z)({checked:n.value,style:{marginRight:"6px"}},n)),label:a("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,ne.jsx)(qe.Qr,{name:"domain",control:u,rules:{validate:h?Z:b},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(qe.Qr,{name:"clientId",control:u,rules:{validate:h?v:b},render:function(e){var n,t=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,children:(0,ne.jsx)(De.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,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:d(g),disabled:!f.isDirty,children:a("oauth.save")})]})})},On=t(51279),An=t(24103),Tn={ttl:604800};function Rn(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 Nn(){var e,n,t=(0,le.h6)().api,r=(0,xe.y0)().blocklet,o=null===r||void 0===r||null===(e=r.meta)||void 0===e?void 0:e.did,a=Object.assign({},Tn,(null===r||void 0===r||null===(n=r.settings)||void 0===n?void 0:n.session)||{}),l=(0,qe.cI)({defaultValues:We()(Rn(a),["ttl"])}),s=l.handleSubmit,c=l.control,d=l.formState,u=l.reset,f=(0,w.PE)().t,p=(0,Ve.Z)(function(){var e=(0,A.Z)((0,O.Z)().mark((function e(n){var r,i,a,l;return(0,O.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:Rn(n,!0)}});case 3:i=e.sent,a=i.blocklet,l=Object.assign({},Tn,We()((null===a||void 0===a||null===(r=a.settings)||void 0===r?void 0:r.session)||{},["ttl"])),u(Rn(l)),z.Z.success(f("common.configSuccess")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),z.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,ne.jsx)(x.Z,{children:(0,ne.jsxs)("form",{onSubmit:s(p),disabled:!0,children:[(0,ne.jsx)(qe.Qr,{name:"ttl",control:c,render:function(e){var n=e.field;return(0,ne.jsx)(Ue.Z,{fullWidth:!0,sx:{mb:2},children:(0,ne.jsxs)(An.Z,{px:3,children:[(0,ne.jsx)(x.Z,{mx:-3,my:.5,children:f("blocklet.config.session.ttl",{day:n.value})}),(0,ne.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,ne.jsx)(ze.Z,{type:"submit",variant:"contained",onSubmit:s(p),disabled:!d.isDirty,children:f("oauth.save")})]})})}var Bn=t(82555),In=t(30333),Fn=t(75760),Kn=t(97038),Un=t(12673),Dn=t(92706),zn=t.n(Dn),Gn=(0,s.forwardRef)((function(e,n){var t=(0,s.useContext)(w.RD).t,r=(0,Un.Z)({show:!1,title:"",content:"",onConfirm:zn(),onCancel:zn(),loading:!1}),i=(0,Ve.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||zn(),r.onCancel=e.onCancel||zn(),r.loading=!1})),o=(0,Ve.Z)((function(){r.title="",r.content="",r.onConfirm=zn(),r.onCancel=zn()})),a=(0,Ve.Z)((function(){r.show=!1,setTimeout((function(){o()}),300)})),l=(0,Ve.Z)((function(){a(),null===r||void 0===r||r.onCancel()}),[]),c=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.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,ne.jsx)(be.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 Wn=t(64886),Vn=t(42080),qn=t.n(Vn),Yn=t(75506),Mn=t.n(Yn),Hn=t(47685),Jn=t(13260),Qn=t(82434),Xn=t.n(Qn),$n=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(w.RD).t,o=(0,xe.y0)().blocklet,a=(0,le.h6)().api,l=(0,Un.Z)({mode:"view",show:!1,data:{},callback:zn()}),c=(0,Hn.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,Ve.Z)((function(){l.mode="view",l.data={},l.callback=zn()}),[]),f=(0,Ve.Z)((function(){l.show=!1,setTimeout((function(){u()}),d)}),[]),p=(0,Ve.Z)((function(e){l.mode="view",l.show=!0,l.data=e}),[]),h=(0,Ve.Z)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zn();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,Ke.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&&qn()(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,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(Bn.Z,{component:In.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,ne.jsx)(Jn.kL,{children:t})),["appUrl"].includes(e)&&(t=(0,ne.jsx)(x.Z,{component:"a",href:t,target:"_blank",children:t})),["appLogo"].includes(e)){var r=Xn()(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,ne.jsx)("img",{src:o.href,width:"60",height:"60",alt:l.data.appName})}catch(a){t=(0,ne.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,ne.jsx)(Jn.kL,{children:e})})));return Mn()(t)&&(t="-"),{name:n,value:t}}))}),[l.data]),Z="approve"===l.mode,v=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.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,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){return(0,O.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,ne.jsx)(be.ZP,{open:l.show,title:i(Z?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:f,actions:Z?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(ze.Z,{color:"error",variant:"contained",onClick:v,children:i("common.reject")}),(0,ne.jsx)(ze.Z,{variant:"contained",onClick:b,children:i("common.approve")})]}):(0,ne.jsx)(ze.Z,{variant:"outlined",onClick:f,children:i("common.close")}),children:g.map((function(e){return(0,ne.jsx)(Wn.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)}))})})),et=$n,nt=t(79842),tt=t(85408),rt=t.n(tt),it=(0,s.forwardRef)((function(e,n){var t,r,i=(0,Hn.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)(w.RD).t,l=(0,Un.Z)({show:!1,data:{link:""}}),c=(0,Ve.Z)((function(){l.data.link=""}),[]),d=(0,Ve.Z)((function(){l.show=!1,setTimeout((function(){c()}),o)}),[]),u=(0,Ve.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,Ve.Z)((function(){rt()(l.data.link),d()}),[d]);return(0,ne.jsxs)(be.ZP,{open:l.show,title:a("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:(0,ne.jsx)(K.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:f,children:a("common.copyAndClose")}),children:[(0,ne.jsx)(x.Z,{mb:1,children:a("federated.inviteJoinFederatedLoginDescription")}),(0,ne.jsx)(x.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,ne.jsx)(nt.Z,{language:"shell",style:{marginBottom:0},children:l.data.link})})]})}));function ot(e){var n,t,r,i,a,l=e.mode,c=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useContext)(w.RD),f=u.t,p=u.locale,m=(0,xe.y0)(),h=m.blocklet,g=m.actions.refreshBlocklet,Z=function(){var e=(0,s.useRef)(null),n=(0,Ve.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,Ve.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,ne.jsx)(Gn,{ref:e}),confirmApi:r}}(),v=Z.confirmApi,b=Z.confirmHolder,j=(0,le.h6)().api,y=(null===(n=h.settings.federated)||void 0===n?void 0:n.sites)||[],k=(null===(t=h.settings.federated)||void 0===t?void 0:t.config)||{autoLogin:!1},C=!1!==k.isMaster,L=(0,Ve.Z)((function(e){var n;null===(n=d.current)||void 0===n||n.open(e)})),E=(0,Ve.Z)((function(e){var n;null===(n=d.current)||void 0===n||n.approve(e,g)})),S=(0,Ve.Z)((function(e){v.open({title:f("federated.disableFederatedLogin"),content:f("federated.disableFederatedLoginDescription"),onConfirm:function(n){return(0,A.Z)((0,O.Z)().mark((function t(){return(0,O.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j.auditFederatedLogin({input:{memberPid:e.appPid,did:h.appPid,status:"revoked"}});case 2:n();case 3:case"end":return t.stop()}}),t)})))()}})})),_=(0,Ve.Z)((function(e){v.open({title:f("federated.enableFederatedLogin"),content:f("federated.enableFederatedLoginDescription"),onConfirm:function(n){return(0,A.Z)((0,O.Z)().mark((function t(){return(0,O.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j.auditFederatedLogin({input:{memberPid:e.appPid,did:h.appPid,status:"approved"}});case 2:n();case 3:case"end":return t.stop()}}),t)})))()}})})),P=(0,Ke.Z)((function(){var e=[{label:f("common.name"),name:"appName",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{display:"inline-block",children:(0,ne.jsxs)(x.Z,{component:"a",display:"flex",alignItems:"center",href:n.appUrl,target:"_blank",onClick:function(e){e.stopPropagation()},children:[t&&(0,ne.jsx)(Bn.Z,{component:In.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:f("common.did"),name:"appId",options:{customBodyRenderLite:function(e){var n=y[e];return(0,ne.jsx)(Kn.Z,{children:n.appId})}}},{label:f("common.status"),name:"status",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{children:t?"-":f("federated.status.".concat(n.status))})}}}];return C&&e.push({label:f("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=y[e],t=!1!==n.isMaster;return(0,ne.jsx)(x.Z,{display:"flex",gap:1,children:t?(0,ne.jsxs)(ne.Fragment,{children:["rejected"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"error",size:"small",onClick:function(e){e.stopPropagation()},children:f("federated.status.rejected")}),"revoked"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"secondary",size:"small",onClick:function(e){e.stopPropagation()},children:f("federated.status.revoked")})]}):(0,ne.jsxs)(ne.Fragment,{children:["pending"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"primary",size:"small",onClick:function(e){e.stopPropagation(),E(n)},children:f("federated.status.pending")}),"approved"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"error",size:"small",onClick:function(e){e.stopPropagation(),S(n)},style:{whiteSpace:"nowrap"},children:f("federated.revoke")}),"revoked"===n.status&&(0,ne.jsx)(K.Z,{variant:"contained",color:"warning",size:"small",onClick:function(e){e.stopPropagation(),_(n)},style:{whiteSpace:"nowrap"},children:f("federated.approve")})]})})}}}),e}),[k.appId,y,C]),T=(0,Ke.Z)((function(){return{sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick:function(e,n){var t=n.dataIndex,r=y[t];L(r)}}}),[]),R=(0,Ve.Z)((function(){var e,n=h.environments.find((function(e){return e.key===D.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL}));null!==n&&void 0!==n&&n.value?null===(e=c.current)||void 0===e||e.open({link:n.value}):z.Z.error(f("federated.failedToGetFederatedLoginLink"))}),[null===(r=h.site)||void 0===r||null===(i=r.domainAliases)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.href]),N=(0,s.useState)(k.autoLogin||!1),B=(0,o.Z)(N,2),I=B[0],F=B[1],U=(0,Ve.Z)((function(){v.open({title:f(I?"federated.disableFederatedAutoLogin":"federated.enableFederatedAutoLogin"),content:f(I?"federated.disableFederatedAutoLoginDescription":"federated.enableFederatedAutoLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.configFederated({input:{did:h.appPid,autoLogin:!I}});case 2:F((function(e){return!e})),e();case 4:case"end":return n.stop()}}),n)})))()}})}),[F,I]),G=(0,Ve.Z)((function(){v.open({title:f("federated.quitFederatedLogin"),content:f("federated.quitFederatedLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.quitFederatedLogin({input:{did:h.appPid}});case 2:e();case 3:case"end":return n.stop()}}),n)})))()}})})),W=(0,Ve.Z)((function(){v.open({title:f("federated.disbandFederatedLogin"),content:f("federated.disbandFederatedLoginDescription"),onConfirm:function(e){return(0,A.Z)((0,O.Z)().mark((function n(){return(0,O.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,j.disbandFederatedLogin({input:{did:h.appPid}});case 2:e();case 3:case"end":return n.stop()}}),n)})))()}})})),V=[];return"master"!==l?V.push((0,ne.jsx)(K.Z,{size:"small",variant:"contained",color:"error",onClick:G,sx:{ml:1},children:f("federated.quitFederatedLogin")},"quitFederatedLogin")):(V.push((0,ne.jsx)(K.Z,{size:"small",variant:"contained",onClick:R,sx:{ml:1},children:f("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),V.push((0,ne.jsx)(K.Z,{color:"error",size:"small",variant:"contained",onClick:W,sx:{ml:1},children:f("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Fn.Z,{className:"main-table",locale:p,data:y,columns:P,customButtons:V,title:(0,ne.jsx)(x.Z,{className:"table-toolbar-left",children:"master"===l?f("oauth.federated"):(0,ne.jsx)(Ce.Z,{sx:{ml:0,"& span.MuiSwitch-switchBase":{display:"flex"},"& span.MuiSwitch-track":{display:"block"}},control:(0,ne.jsx)(_n.Z,{checked:I,style:{marginRight:"6px"},onChange:U}),label:f("federated.enableFederatedAutoLogin")})}),options:T}),b,(0,ne.jsx)(it,{ref:c}),(0,ne.jsx)(et,{ref:d})]})}ot.propTypes={mode:u().oneOf(["member","master"])},ot.defaultProps={mode:"member"};var at=ot,lt=(0,s.forwardRef)((function(e,n){var t,r,i=(0,s.useContext)(w.RD).t,o=(0,le.h6)().api,a=(0,xe.y0)().blocklet,l=null===a||void 0===a?void 0:a.appPid,c=(0,Hn.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,Un.Z)({show:!1,appUrl:"",appUrlError:"",callback:zn()}),f=(0,Ve.Z)((function(){u.appUrl="",u.appUrlError="",u.callback=zn()}),[]),p=(0,Ve.Z)((function(){u.show=!1,setTimeout((function(){f()}),d)}),[]),m=(0,Ve.Z)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zn();u.show=!0,u.callback=e}),[]);(0,s.useImperativeHandle)(n,(function(){return{open:m,close:p}}),[m,p]);var h=(0,Ve.Z)((function(e){if(!e)throw new Error(i("federated.federatedJoinAppUrlRequired"));if(!Xn()(e))throw new Error(i("federated.federatedJoinAppUrlInvalid"))})),g=(0,Ve.Z)((0,A.Z)((0,O.Z)().mark((function e(){var n;return(0,O.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,ne.jsxs)(be.ZP,{open:u.show,title:i("federated.joinFederatedLogin"),onClose:p,PaperProps:{style:{minHeight:"unset"}},actions:(0,ne.jsx)(K.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:g,children:i("common.confirm")}),children:[(0,ne.jsx)(x.Z,{mb:1,children:i("federated.joinFederatedLoginDescription")}),(0,ne.jsx)(De.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}})]})})),st=lt;function ct(){var e,n,t,r,i=(0,s.useRef)(null),o=(0,s.useRef)(null),a=(0,s.useContext)(w.RD).t,l=(0,xe.y0)(),c=l.blocklet,d=l.actions.refreshBlocklet,u=(0,Ve.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){z.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,Ve.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,ne.jsx)(at,{mode:m?"master":"member"})}return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsxs)(x.Z,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[(0,ne.jsx)(K.Z,{variant:"contained",onClick:u,children:a("federated.inviteJoinFederatedLogin")}),(0,ne.jsx)(F.Z,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),(0,ne.jsx)(K.Z,{variant:"outlined",onClick:f,children:a("federated.joinFederatedLogin")})]}),(0,ne.jsx)(it,{ref:i}),(0,ne.jsx)(st,{ref:o})]})}var dt,ut=function(){var e=(0,s.useContext)(w.RD).t,n=[{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.commonSettings")}),value:"settings"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:e("oauth.federated")}),value:"federated"},{label:(0,ne.jsx)(x.Z,{textAlign:"center",width:"100%",children:"Auth0"}),value:"auth0"},{label:(0,ne.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,Ke.Z)((function(){return{auth0:(0,ne.jsx)(Pn,{}),federated:(0,ne.jsx)(ct,{}),more:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Fe.Z,{children:e("oauth.comingSoon")})}),settings:(0,ne.jsx)(x.Z,{children:(0,ne.jsx)(Nn,{})})}}),[e]);return(0,ne.jsxs)(x.Z,{children:[(0,ne.jsx)(E.Z,{tabs:n,current:i,onChange:a}),(0,ne.jsx)(x.Z,{marginTop:"10px",children:l[i]})]})},ft=["blocklet","onUpdate"],pt=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,ne.jsxs)(x.Z,{pl:2*Math.max(1,s-1),display:"flex",alignItems:"center",justifyContent:"flex-start",children:[u?(0,ne.jsx)(P.Z,{size:24,blocklet:r}):(0,ne.jsx)(_.Z,{size:24,blocklet:r,ancestors:o}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:u?c("blocklet.component.container"):(0,S.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 mt(e){var n=e.blocklet,t=e.onUpdate,r=(0,a.Z)(e,ft),l=(0,s.useContext)(w.RD).t,c=(0,le.h6)(),d=c.info,u=c.inService,p=(0,s.useState)(!0),S=(0,o.Z)(p,2),_=S[0],P=S[1],O=(0,L.useSearchParams)(),A=(0,o.Z)(O,2),T=A[0],R=A[1],N=T.get("tab")||"general",B=[{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-general",children:[(0,ne.jsx)(Z.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.general")})})]},"general"),value:"general"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-access",children:[(0,ne.jsx)(v.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.access")})})]},"access"),value:"access"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-oauth",children:[(0,ne.jsx)(b.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.login")})})]},"oauth"),value:"oauth"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-notification",children:[(0,ne.jsx)(j.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.notification")})})]},"notification"),value:"notification"},{label:(0,ne.jsxs)(x.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-preference",children:[(0,ne.jsx)(x.Z,{ml:-2,style:{transform:"translateY(2px)"},children:_?(0,ne.jsx)(C.Z,{fontSize:"inherit"}):(0,ne.jsx)(k.default,{fontSize:"inherit"})}),(0,ne.jsx)(y.Z,{sx:{fontSize:24}}),(0,ne.jsx)(x.Z,{ml:"16px",children:(0,ne.jsx)(x.Z,{style:{color:"#222"},children:l("common.preferences")})})]},"preference"),value:"preference"}];_&&pt({tabs:B,blocklet:n,t:l});var I=null;if("general"===N)I=(0,ne.jsx)(Be,{blocklet:n,onUpdate:t});else if("access"===N)I=(0,ne.jsx)(En,{});else if("oauth"===N)I=(0,ne.jsx)(ut,{});else if("notification"===N)I=(0,ne.jsx)(on,{});else{var F=u?h.WELLKNOWN_SERVICE_PATH_PREFIX:d.routing.adminPath,K=new URLSearchParams;u||K.set("authKey","__sst"),K.set("schemaKey",m()(window.location.origin,F,"/api/preferences?id=".concat(encodeURIComponent(N)))),I=(0,ne.jsx)(f.Z,{url:"".concat(m()(window.location.origin,F,"/hosted/form-collector/"),"?").concat(K.toString()),width:"100%",height:"100%",frameBorder:0,styles:{border:0}})}return(0,ne.jsx)(ht,(0,i.Z)((0,i.Z)({},r),{},{children:(0,ne.jsxs)(g.ZP,{container:!0,spacing:4,columns:24,children:[(0,ne.jsx)(g.ZP,{item:!0,sm:7,md:5,children:(0,ne.jsx)(E.Z,{tabs:B,current:N,orientation:"vertical",onChange:function(e){"preference"===e?P(!_):R((function(n){return"general"===e?n.delete("tab"):n.set("tab",e),n}))},sx:{borderRight:1,height:"100%",borderColor:"divider"}})}),(0,ne.jsx)(g.ZP,{item:!0,sm:17,md:19,children:(0,ne.jsx)(x.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:I})})]})}))}mt.propTypes={blocklet:u().object.isRequired,onUpdate:u().func},mt.defaultProps={onUpdate:function(){}};var ht=c.Z.div(dt||(dt=(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"])))},78410:function(e,n,t){t.d(n,{Z:function(){return Z}});var r=t(33028),i=t(32723),o=t(34795),a=t(96234),l=t(59740),s=t(5057),c=t(86229),d=t(28726),u=t(44846),f=t(68420),p=t(99875),m=t(58238),h=t(70461),x=t(96266),g=["teamDid","size"];function Z(e){var n=e.teamDid,t=e.size,Z=void 0===t?"small":t,v=(0,l.Z)(e,g),b=(0,f.PE)().t,j=(0,m.h6)().api,y=(0,s.useState)(!1),k=(0,a.Z)(y,2),C=k[0],L=k[1],w=(0,s.useState)(null),E=(0,a.Z)(w,2),S=E[0],_=E[1],P=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),e.next=4,j.clearCache({input:{teamDid:n}});case 4:r=e.sent,c.Z.success(b("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),c.Z.error((0,p.Z)(e.t0));case 11:return e.prev=11,L(!1),_(null),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[0,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),O={title:b("blocklet.config.clearCache.title"),description:b("blocklet.config.clearCache.description"),confirm:b("common.confirm"),cancel:b("common.cancel"),onConfirm:P,onCancel:function(){L(!1),_(null)}};return(0,x.jsxs)("div",(0,r.Z)((0,r.Z)({},v),{},{children:[(0,x.jsxs)(d.Z,{onClick:function(){return _(O)},color:"error",variant:"outlined",size:Z,children:[C?(0,x.jsx)(u.Z,{size:16,style:{marginRight:5}}):null,b("blocklet.config.clearCache.action")]}),S&&(0,x.jsx)(h.Z,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,onConfirm:S.onConfirm,onCancel:S.onCancel})]}))}},50185:function(e,n,t){t.d(n,{Z:function(){return f}});var r=t(33028),i=t(59740),o=t(5057),a=t(55898),l=t.n(a),s=t(12937),c=t(68420),d=t(96266),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}},28641: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(5057),c=t(55898),d=t.n(c),u=t(39948),f=t(47020),p=t(44846),m=t(13727),h=t(56184),x=t(67680),g=t(35406),Z=t(11875),v=t(95890),b=t(96266),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,L=e.style,w=e.onSubmit,E=e.secure,S=e.triggers,_=e.formatterBeforeSubmit,P=(0,l.Z)(e,j),O=(0,s.useState)(!1),A=(0,a.Z)(O,2),T=A[0],R=A[1],N=(0,s.useState)(!1),B=(0,a.Z)(N,2),I=B[0],F=B[1],K=(0,s.useState)(E&&"__encrypted__"===d?null:d),U=(0,a.Z)(K,2),D=U[0],z=U[1],G=(0,s.useState)(D),W=(0,a.Z)(G,2),V=W[0],q=W[1],Y=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 F(!0),e.prev=1,e.next=4,w(V);case 4:!1===e.sent?q(D):(n=V,"function"===typeof _&&(n=_(V)),q(n),z(n)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),q(D);case 11:return e.prev=11,F(!1),R(!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){q(e),k(e)},H=T?(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&&Y()},disabled:t,type:E?"password":"text"},P)):(0,b.jsx)(u.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:y(V,E,d)});return(0,b.jsx)(Z.Z,{className:"form",style:L,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:H}),(0,b.jsx)(u.Z,{className:"form-item-action",children:T?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x.Z,{"data-cy":"schema-form-item-confirm",onClick:Y,disabled:t||I,size:"large",children:I?(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(){q(D),R(!1)},disabled:t||I,size:"large",children:(0,b.jsx)(m.default,{})})]}):(0,b.jsx)(v.Z,{triggers:S,onEnterEdit:function(){return R(!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}},11875:function(e,n,t){var r,i=t(71171),o=t(33518),a=t(39948);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")}))},95890:function(e,n,t){t.d(n,{Z:function(){return Z}});var r=t(96234),i=t(5057),o=t(55898),a=t.n(o),l=t(24558),s=t(67680),c=t(56556),d=t(80633),u=t(49390),f=t(72113),p=t(25228),m=t(38456),h=t(74490),x=t(1733),g=t(96266);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:[]}},35406:function(e,n,t){var r,i=t(71171),o=t(33518).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},54063:function(e,n,t){t.d(n,{C:function(){return r}});var r="true"===localStorage.getItem("enableDebug")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8986],{13239:function(e,r,n){n.r(r),n.d(r,{default:function(){return W}});var t=n(71171),a=n(33518),o=n(15849),i=n(37676),s=n(72333),l=n(44846),c=n(25710),d=n(68420),u=n(35432),p=n(39948),m=n(11750),f=n(59662),g=n(74490),h=n(51177),v=n(6041),x=n(80576),Z=n(19778),b=n(32723),y=n(34795),k=n(96234),j=n(5057),w=n(67654),S=n(86229),L=n(58238),C=n(96266),z=(0,j.createContext)({}),M=z.Provider;z.Consumer;function N(e){var r=e.children,n=e.scope,t=void 0===n?"":n,a=e.categories,o=void 0===a?[]:a,i=e.showScope,s=e.scopeFormatter,l=(0,L.h6)(),c=l.api,d=l.info,u=(0,j.useState)([]),p=(0,k.Z)(u,2),m=p[0],f=p[1],g=(0,j.useState)({total:0,pageSize:20,pageCount:0,page:1}),h=(0,k.Z)(g,2),v=h[0],x=h[1],Z=(0,j.useState)(!1),z=(0,k.Z)(Z,2),N=z[0],F=z[1],q=(0,w.Z)("audit-log-category-".concat(t),"all"),A=(0,k.Z)(q,2),P=A[0],E=A[1],I=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter((function(e){return!o.length||("all"===e.value||o.includes(e.value))})),W=function(){var e=(0,y.Z)((0,b.Z)().mark((function e(){var r,n,a,o,s,l,u=arguments;return(0,b.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(r=u.length>0&&void 0!==u[0]?u[0]:{}).page,a=void 0===n?1:n,o=r.silent,s=void 0===o||o,!N){e.next=3;break}return e.abrupt("return");case 3:return s||F(!0),e.prev=4,e.next=7,c.getAuditLogs({input:{paging:{page:a},category:"all"===P?"":P,scope:t}});case 7:l=e.sent,i&&(l.list||[]).forEach((function(e){e.scope!==d.did&&(e.link="/blocklets/".concat(e.scope,"/components"))})),f(l.list),x(l.paging),F(!1),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(4),S.Z.error(e.t0.message),F(!1);case 18:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(){return e.apply(this,arguments)}}();(0,j.useEffect)((function(){W({page:1,silent:!1})}),[]),(0,j.useEffect)((function(){W({page:1,silent:!1})}),[P]);var _={loading:N,fetch:W,filter:{category:P,scope:t},categories:I,setCategory:E,data:m,paging:v,showScope:i,scopeFormatter:s};return(0,C.jsx)(M,{value:{auditLogs:_},children:r})}function F(){return(0,j.useContext)(z).auditLogs}var q,A=n(65402),P=function(e){var r=e.log,n=e.info;return e.inService?"".concat(u.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/members?did=").concat(r.actor.did):r.scope===n.did?"/team/members?did=".concat(r.actor.did):"/blocklets/".concat(r.scope,"/members?did=").concat(r.actor.did)};function E(e){var r,n,t=e.log,a=(0,L.h6)(),l=a.inService,c=a.info,d=F(),u=d.showScope,f=d.scopeFormatter,g=void 0===f?function(e){return e}:f;if(!t.actor.did)return null;var h=!["blocklet",""].includes(t.actor.role);return(0,C.jsxs)(p.Z,{className:"log-entry","data-cy":"log-entry",children:[(0,C.jsx)("div",{className:"log-author",children:h?(0,C.jsx)(s.Z,{did:t.actor.did,size:36,shape:"circle"}):(0,C.jsx)(s.Z,{did:t.actor.did,size:36})}),(0,C.jsxs)("div",{className:"log-body",children:[(0,C.jsxs)(m.Z,{className:"log-header",color:"textSecondary",component:"p",gutterBottom:!0,display:"flex",alignItems:"center",children:[u&&(0,C.jsx)(o.Link,{to:t.link,children:(0,C.jsx)(Z.Z,{style:{marginRight:8},children:g(t.scope)})}),h?(0,C.jsxs)(o.Link,{to:P({log:t,inService:l,info:c}),target:"_blank",children:[t.actor.fullName,t.actor.role?"(".concat(t.actor.role,")"):""]}):(0,C.jsxs)("span",{children:[t.actor.fullName,t.actor.role?"(".concat(t.actor.role,")"):""]})," ",(0,C.jsx)("span",{style:{margin:"0 4px"},children:"-"})," ",t.action]}),(0,C.jsx)(m.Z,{className:"log-content",maxWidth:"lg",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,children:(0,C.jsx)(i.Z,{source:t.content,linkTarget:"_blank"})}),(0,C.jsxs)(p.Z,{className:"log-meta",variant:"body2",children:[!!t.ip&&(0,C.jsx)(m.Z,{component:"span",color:"textSecondary",children:"IP: ".concat(t.ip)}),!(null===(r=t.env.os)||void 0===r||!r.name)&&(0,C.jsxs)(m.Z,{component:"span",color:"textSecondary",children:[t.env.os.name,"(",t.env.os.version,")"]}),!(null===(n=t.env.browser)||void 0===n||!n.name)&&(0,C.jsxs)(m.Z,{component:"span",color:"textSecondary",children:[t.env.browser.name,"(",t.env.browser.version,")"]}),(0,C.jsx)(m.Z,{component:"span",color:"textSecondary",children:(0,C.jsx)(A.Z,{value:t.createdAt})})]})]})]})}function I(){var e=(0,d.PE)().t,r=F(),n=r.data,t=r.loading,a=r.paging,o=r.filter,i=r.categories,s=r.setCategory,u=r.fetch;return t?(0,C.jsx)("div",{style:{textAlign:"center",marginTop:"50px"},children:(0,C.jsx)(l.Z,{})}):(0,C.jsxs)(_,{"data-cy":"audit-logs",children:[(0,C.jsx)(p.Z,{className:"log-controls",children:(0,C.jsxs)(x.Z,{style:{width:"240px"},variant:"outlined",children:[(0,C.jsx)(v.Z,{children:e("common.filter")}),(0,C.jsx)(h.Z,{"data-cy":"filter-by-category-trigger",value:o.category,onChange:function(e){return s(e.target.value)},fullWidth:!0,label:e("common.category"),disabled:t,children:i.map((function(e){return(0,C.jsx)(g.Z,{value:e.value,"data-cy":"filter-by-category-".concat(e.value),children:(0,C.jsx)(p.Z,{children:(0,C.jsx)("span",{children:e.label})})},e.label)}))})]})}),0===n.length&&(0,C.jsx)(c.Z,{children:e("common.empty")}),n.length>0&&n.map((function(e){return(0,C.jsx)(E,{log:e},e.id)})),a.pageCount>1&&(0,C.jsx)(f.Z,{page:a.page,count:a.pageCount,onChange:function(e,r){return u({page:r})},showFirstButton:!0,showLastButton:!0})]})}function W(e){var r=e.scope,n=e.categories,t=e.showScope,a=e.scopeFormatter;return(0,C.jsx)(N,{scope:r,categories:n,showScope:t,scopeFormatter:a,children:(0,C.jsx)(I,{})})}var _=a.Z.div(q||(q=(0,t.Z)(["\n .log-controls {\n display: flex;\n justify-content: space-between;\n }\n .log-entry {\n display: flex;\n margin: 16px 0;\n\n .log-author {\n margin-right: 8px;\n }\n\n .log-body {\n flex: 1;\n\n a {\n color: ",";\n }\n\n .log-header {\n }\n\n .log-content {\n p {\n margin-bottom: 4px;\n }\n ul,\n ol {\n padding-left: 2rem;\n }\n li {\n list-style-type: disc;\n }\n code.code-highlight {\n max-height: 300px;\n overflow: auto;\n }\n }\n\n .log-meta {\n margin-top: 4px;\n\n span {\n font-size: 0.8rem;\n display: inline-block;\n margin-right: 8px;\n padding-right: 8px;\n border-right: 1px solid #ccc;\n\n &:last-of-type {\n border-right: none;\n }\n }\n }\n }\n }\n"])),(function(e){return e.theme.palette.primary.main}))},6041:function(e,r,n){n.d(r,{Z:function(){return L}});var t=n(56666),a=n(31461),o=n(7896),i=n(5057),s=n(91213),l=n(8271),c=n(43070),d=n(38038),u=n(6285),p=n(42908),m=n(62773),f=n(31821),g=n(18561);function h(e){return(0,g.Z)("MuiFormLabel",e)}var v=(0,f.Z)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),x=n(96266),Z=["children","className","color","component","disabled","error","filled","focused","required"],b=(0,m.ZP)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:function(e,r){var n=e.ownerState;return(0,o.Z)({},r.root,"secondary"===n.color&&r.colorSecondary,n.filled&&r.filled)}})((function(e){var r,n=e.theme,a=e.ownerState;return(0,o.Z)({color:(n.vars||n).palette.text.secondary},n.typography.body1,(r={lineHeight:"1.4375em",padding:0,position:"relative"},(0,t.Z)(r,"&.".concat(v.focused),{color:(n.vars||n).palette[a.color].main}),(0,t.Z)(r,"&.".concat(v.disabled),{color:(n.vars||n).palette.text.disabled}),(0,t.Z)(r,"&.".concat(v.error),{color:(n.vars||n).palette.error.main}),r))})),y=(0,m.ZP)("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:function(e,r){return r.asterisk}})((function(e){var r=e.theme;return(0,t.Z)({},"&.".concat(v.error),{color:(r.vars||r).palette.error.main})})),k=i.forwardRef((function(e,r){var n=(0,p.Z)({props:e,name:"MuiFormLabel"}),t=n.children,i=n.className,m=n.component,f=void 0===m?"label":m,g=(0,a.Z)(n,Z),v=(0,d.Z)(),k=(0,c.Z)({props:n,muiFormControl:v,states:["color","required","focused","disabled","error","filled"]}),j=(0,o.Z)({},n,{color:k.color||"primary",component:f,disabled:k.disabled,error:k.error,filled:k.filled,focused:k.focused,required:k.required}),w=function(e){var r=e.classes,n=e.color,t=e.focused,a=e.disabled,o=e.error,i=e.filled,l=e.required,c={root:["root","color".concat((0,u.Z)(n)),a&&"disabled",o&&"error",i&&"filled",t&&"focused",l&&"required"],asterisk:["asterisk",o&&"error"]};return(0,s.Z)(c,h,r)}(j);return(0,x.jsxs)(b,(0,o.Z)({as:f,ownerState:j,className:(0,l.Z)(w.root,i),ref:r},g,{children:[t,k.required&&(0,x.jsxs)(y,{ownerState:j,"aria-hidden":!0,className:w.asterisk,children:["\u2009","*"]})]}))})),j=n(12823),w=["disableAnimation","margin","shrink","variant","className"],S=(0,m.ZP)(k,{shouldForwardProp:function(e){return(0,m.FO)(e)||"classes"===e},name:"MuiInputLabel",slot:"Root",overridesResolver:function(e,r){var n=e.ownerState;return[(0,t.Z)({},"& .".concat(v.asterisk),r.asterisk),r.root,n.formControl&&r.formControl,"small"===n.size&&r.sizeSmall,n.shrink&&r.shrink,!n.disableAnimation&&r.animated,r[n.variant]]}})((function(e){var r=e.theme,n=e.ownerState;return(0,o.Z)({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},n.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},"small"===n.size&&{transform:"translate(0, 17px) scale(1)"},n.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!n.disableAnimation&&{transition:r.transitions.create(["color","transform","max-width"],{duration:r.transitions.duration.shorter,easing:r.transitions.easing.easeOut})},"filled"===n.variant&&(0,o.Z)({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===n.size&&{transform:"translate(12px, 13px) scale(1)"},n.shrink&&(0,o.Z)({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},"small"===n.size&&{transform:"translate(12px, 4px) scale(0.75)"})),"outlined"===n.variant&&(0,o.Z)({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===n.size&&{transform:"translate(14px, 9px) scale(1)"},n.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))})),L=i.forwardRef((function(e,r){var n=(0,p.Z)({name:"MuiInputLabel",props:e}),t=n.disableAnimation,i=void 0!==t&&t,m=n.shrink,f=n.className,g=(0,a.Z)(n,w),h=(0,d.Z)(),v=m;"undefined"===typeof v&&h&&(v=h.filled||h.focused||h.adornedStart);var Z=(0,c.Z)({props:n,muiFormControl:h,states:["size","variant","required"]}),b=(0,o.Z)({},n,{disableAnimation:i,formControl:h,shrink:v,size:Z.size,variant:Z.variant,required:Z.required}),y=function(e){var r=e.classes,n=e.formControl,t=e.size,a=e.shrink,i=e.disableAnimation,l=e.variant,c=e.required,d={root:["root",n&&"formControl",!i&&"animated",a&&"shrink",t&&"normal"!==t&&"size".concat((0,u.Z)(t)),l],asterisk:[c&&"asterisk"]},p=(0,s.Z)(d,j.Y,r);return(0,o.Z)({},r,p)}(b);return(0,x.jsx)(S,(0,o.Z)({"data-shrink":v,ownerState:b,ref:r,className:(0,l.Z)(y.root,f)},g,{classes:y}))}))},12823:function(e,r,n){n.d(r,{Y:function(){return o}});var t=n(31821),a=n(18561);function o(e){return(0,a.Z)("MuiInputLabel",e)}var i=(0,t.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);r.Z=i},96646:function(e,r,n){n(5057);var t=n(57471),a=n(96266);r.Z=(0,t.Z)((0,a.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage")},54665:function(e,r,n){n(5057);var t=n(57471),a=n(96266);r.Z=(0,t.Z)((0,a.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage")}}]);
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8986],{13239:function(e,r,n){n.r(r),n.d(r,{default:function(){return W}});var t=n(71171),a=n(33518),o=n(15849),i=n(37676),s=n(72333),l=n(44846),c=n(25710),d=n(68420),u=n(35432),p=n(39948),m=n(11750),f=n(59662),g=n(74490),h=n(51177),v=n(6041),x=n(80576),Z=n(19778),b=n(32723),y=n(34795),k=n(96234),j=n(5057),w=n(67654),S=n(86229),L=n(58238),C=n(96266),z=(0,j.createContext)({}),M=z.Provider;z.Consumer;function N(e){var r=e.children,n=e.scope,t=void 0===n?"":n,a=e.categories,o=void 0===a?[]:a,i=e.showScope,s=e.scopeFormatter,l=(0,L.h6)(),c=l.api,d=l.info,u=(0,j.useState)([]),p=(0,k.Z)(u,2),m=p[0],f=p[1],g=(0,j.useState)({total:0,pageSize:20,pageCount:0,page:1}),h=(0,k.Z)(g,2),v=h[0],x=h[1],Z=(0,j.useState)(!1),z=(0,k.Z)(Z,2),N=z[0],F=z[1],q=(0,w.Z)("audit-log-category-".concat(t),"all"),A=(0,k.Z)(q,2),P=A[0],E=A[1],I=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter((function(e){return!o.length||("all"===e.value||o.includes(e.value))})),W=function(){var e=(0,y.Z)((0,b.Z)().mark((function e(){var r,n,a,o,s,l,u=arguments;return(0,b.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(r=u.length>0&&void 0!==u[0]?u[0]:{}).page,a=void 0===n?1:n,o=r.silent,s=void 0===o||o,!N){e.next=3;break}return e.abrupt("return");case 3:return s||F(!0),e.prev=4,e.next=7,c.getAuditLogs({input:{paging:{page:a},category:"all"===P?"":P,scope:t}});case 7:l=e.sent,i&&(l.list||[]).forEach((function(e){e.scope!==d.did&&(e.link="/blocklets/".concat(e.scope,"/components"))})),f(l.list),x(l.paging),F(!1),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(4),S.Z.error(e.t0.message),F(!1);case 18:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(){return e.apply(this,arguments)}}();(0,j.useEffect)((function(){W({page:1,silent:!1})}),[]),(0,j.useEffect)((function(){W({page:1,silent:!1})}),[P]);var _={loading:N,fetch:W,filter:{category:P,scope:t},categories:I,setCategory:E,data:m,paging:v,showScope:i,scopeFormatter:s};return(0,C.jsx)(M,{value:{auditLogs:_},children:r})}function F(){return(0,j.useContext)(z).auditLogs}var q,A=n(65402),P=function(e){var r=e.log,n=e.info;return e.inService?"".concat(u.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/members?did=").concat(r.actor.did):r.scope===n.did?"/team/members?did=".concat(r.actor.did):"/blocklets/".concat(r.scope,"/members?did=").concat(r.actor.did)};function E(e){var r,n,t=e.log,a=(0,L.h6)(),l=a.inService,c=a.info,d=F(),u=d.showScope,f=d.scopeFormatter,g=void 0===f?function(e){return e}:f;if(!t.actor.did)return null;var h=!["blocklet",""].includes(t.actor.role);return(0,C.jsxs)(p.Z,{className:"log-entry","data-cy":"log-entry",children:[(0,C.jsx)("div",{className:"log-author",children:h?(0,C.jsx)(s.Z,{did:t.actor.did,size:36,shape:"circle"}):(0,C.jsx)(s.Z,{did:t.actor.did,size:36})}),(0,C.jsxs)("div",{className:"log-body",children:[(0,C.jsxs)(m.Z,{className:"log-header",color:"textSecondary",component:"p",gutterBottom:!0,display:"flex",alignItems:"center",children:[u&&(0,C.jsx)(o.Link,{to:t.link,children:(0,C.jsx)(Z.Z,{style:{marginRight:8},children:g(t.scope)})}),h?(0,C.jsxs)(o.Link,{to:P({log:t,inService:l,info:c}),target:"_blank",children:[t.actor.fullName,t.actor.role?"(".concat(t.actor.role,")"):""]}):(0,C.jsxs)("span",{children:[t.actor.fullName,t.actor.role?"(".concat(t.actor.role,")"):""]})," ",(0,C.jsx)("span",{style:{margin:"0 4px"},children:"-"})," ",t.action]}),(0,C.jsx)(m.Z,{className:"log-content",maxWidth:"lg",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,children:(0,C.jsx)(i.Z,{source:t.content,linkTarget:"_blank"})}),(0,C.jsxs)(p.Z,{className:"log-meta",variant:"body2",children:[!!t.ip&&(0,C.jsx)(m.Z,{component:"span",color:"textSecondary",children:"IP: ".concat(t.ip)}),!(null===(r=t.env.os)||void 0===r||!r.name)&&(0,C.jsxs)(m.Z,{component:"span",color:"textSecondary",children:[t.env.os.name,"(",t.env.os.version,")"]}),!(null===(n=t.env.browser)||void 0===n||!n.name)&&(0,C.jsxs)(m.Z,{component:"span",color:"textSecondary",children:[t.env.browser.name,"(",t.env.browser.version,")"]}),(0,C.jsx)(m.Z,{component:"span",color:"textSecondary",children:(0,C.jsx)(A.Z,{value:t.createdAt})})]})]})]})}function I(){var e=(0,d.PE)().t,r=F(),n=r.data,t=r.loading,a=r.paging,o=r.filter,i=r.categories,s=r.setCategory,u=r.fetch;return t?(0,C.jsx)("div",{style:{textAlign:"center",marginTop:"50px"},children:(0,C.jsx)(l.Z,{})}):(0,C.jsxs)(_,{"data-cy":"audit-logs",children:[(0,C.jsx)(p.Z,{className:"log-controls",children:(0,C.jsxs)(x.Z,{style:{width:"240px"},variant:"outlined",children:[(0,C.jsx)(v.Z,{children:e("common.filter")}),(0,C.jsx)(h.Z,{"data-cy":"filter-by-category-trigger",value:o.category,onChange:function(e){return s(e.target.value)},fullWidth:!0,label:e("common.category"),disabled:t,children:i.map((function(e){return(0,C.jsx)(g.Z,{value:e.value,"data-cy":"filter-by-category-".concat(e.value),children:(0,C.jsx)(p.Z,{children:(0,C.jsx)("span",{children:e.label})})},e.label)}))})]})}),0===n.length&&(0,C.jsx)(c.Z,{children:e("common.empty")}),n.length>0&&n.map((function(e){return(0,C.jsx)(E,{log:e},e.id)})),a.pageCount>1&&(0,C.jsx)(f.Z,{page:a.page,count:a.pageCount,onChange:function(e,r){return u({page:r})},showFirstButton:!0,showLastButton:!0})]})}function W(e){var r=e.scope,n=e.categories,t=e.showScope,a=e.scopeFormatter;return(0,C.jsx)(N,{scope:r,categories:n,showScope:t,scopeFormatter:a,children:(0,C.jsx)(I,{})})}var _=a.Z.div(q||(q=(0,t.Z)(["\n .log-controls {\n display: flex;\n justify-content: space-between;\n }\n .log-entry {\n display: flex;\n margin: 16px 0;\n\n .log-author {\n margin-right: 8px;\n }\n\n .log-body {\n flex: 1;\n\n a {\n color: ",";\n }\n\n .log-header {\n }\n\n .log-content {\n p {\n margin-bottom: 4px;\n }\n ul,\n ol {\n padding-left: 2rem;\n }\n li {\n list-style-type: disc;\n }\n code.code-highlight {\n max-height: 300px;\n overflow: auto;\n }\n }\n\n .log-meta {\n margin-top: 4px;\n\n span {\n font-size: 0.8rem;\n display: inline-block;\n margin-right: 8px;\n padding-right: 8px;\n border-right: 1px solid #ccc;\n\n &:last-of-type {\n border-right: none;\n }\n }\n }\n }\n }\n"])),(function(e){return e.theme.palette.primary.main}))},6041:function(e,r,n){n.d(r,{Z:function(){return L}});var t=n(56666),a=n(31461),o=n(7896),i=n(5057),s=n(91213),l=n(9978),c=n(43070),d=n(38038),u=n(6285),p=n(42908),m=n(62773),f=n(31821),g=n(18561);function h(e){return(0,g.Z)("MuiFormLabel",e)}var v=(0,f.Z)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),x=n(96266),Z=["children","className","color","component","disabled","error","filled","focused","required"],b=(0,m.ZP)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:function(e,r){var n=e.ownerState;return(0,o.Z)({},r.root,"secondary"===n.color&&r.colorSecondary,n.filled&&r.filled)}})((function(e){var r,n=e.theme,a=e.ownerState;return(0,o.Z)({color:(n.vars||n).palette.text.secondary},n.typography.body1,(r={lineHeight:"1.4375em",padding:0,position:"relative"},(0,t.Z)(r,"&.".concat(v.focused),{color:(n.vars||n).palette[a.color].main}),(0,t.Z)(r,"&.".concat(v.disabled),{color:(n.vars||n).palette.text.disabled}),(0,t.Z)(r,"&.".concat(v.error),{color:(n.vars||n).palette.error.main}),r))})),y=(0,m.ZP)("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:function(e,r){return r.asterisk}})((function(e){var r=e.theme;return(0,t.Z)({},"&.".concat(v.error),{color:(r.vars||r).palette.error.main})})),k=i.forwardRef((function(e,r){var n=(0,p.Z)({props:e,name:"MuiFormLabel"}),t=n.children,i=n.className,m=n.component,f=void 0===m?"label":m,g=(0,a.Z)(n,Z),v=(0,d.Z)(),k=(0,c.Z)({props:n,muiFormControl:v,states:["color","required","focused","disabled","error","filled"]}),j=(0,o.Z)({},n,{color:k.color||"primary",component:f,disabled:k.disabled,error:k.error,filled:k.filled,focused:k.focused,required:k.required}),w=function(e){var r=e.classes,n=e.color,t=e.focused,a=e.disabled,o=e.error,i=e.filled,l=e.required,c={root:["root","color".concat((0,u.Z)(n)),a&&"disabled",o&&"error",i&&"filled",t&&"focused",l&&"required"],asterisk:["asterisk",o&&"error"]};return(0,s.Z)(c,h,r)}(j);return(0,x.jsxs)(b,(0,o.Z)({as:f,ownerState:j,className:(0,l.Z)(w.root,i),ref:r},g,{children:[t,k.required&&(0,x.jsxs)(y,{ownerState:j,"aria-hidden":!0,className:w.asterisk,children:["\u2009","*"]})]}))})),j=n(12823),w=["disableAnimation","margin","shrink","variant","className"],S=(0,m.ZP)(k,{shouldForwardProp:function(e){return(0,m.FO)(e)||"classes"===e},name:"MuiInputLabel",slot:"Root",overridesResolver:function(e,r){var n=e.ownerState;return[(0,t.Z)({},"& .".concat(v.asterisk),r.asterisk),r.root,n.formControl&&r.formControl,"small"===n.size&&r.sizeSmall,n.shrink&&r.shrink,!n.disableAnimation&&r.animated,r[n.variant]]}})((function(e){var r=e.theme,n=e.ownerState;return(0,o.Z)({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},n.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},"small"===n.size&&{transform:"translate(0, 17px) scale(1)"},n.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!n.disableAnimation&&{transition:r.transitions.create(["color","transform","max-width"],{duration:r.transitions.duration.shorter,easing:r.transitions.easing.easeOut})},"filled"===n.variant&&(0,o.Z)({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===n.size&&{transform:"translate(12px, 13px) scale(1)"},n.shrink&&(0,o.Z)({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},"small"===n.size&&{transform:"translate(12px, 4px) scale(0.75)"})),"outlined"===n.variant&&(0,o.Z)({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===n.size&&{transform:"translate(14px, 9px) scale(1)"},n.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))})),L=i.forwardRef((function(e,r){var n=(0,p.Z)({name:"MuiInputLabel",props:e}),t=n.disableAnimation,i=void 0!==t&&t,m=n.shrink,f=n.className,g=(0,a.Z)(n,w),h=(0,d.Z)(),v=m;"undefined"===typeof v&&h&&(v=h.filled||h.focused||h.adornedStart);var Z=(0,c.Z)({props:n,muiFormControl:h,states:["size","variant","required"]}),b=(0,o.Z)({},n,{disableAnimation:i,formControl:h,shrink:v,size:Z.size,variant:Z.variant,required:Z.required}),y=function(e){var r=e.classes,n=e.formControl,t=e.size,a=e.shrink,i=e.disableAnimation,l=e.variant,c=e.required,d={root:["root",n&&"formControl",!i&&"animated",a&&"shrink",t&&"normal"!==t&&"size".concat((0,u.Z)(t)),l],asterisk:[c&&"asterisk"]},p=(0,s.Z)(d,j.Y,r);return(0,o.Z)({},r,p)}(b);return(0,x.jsx)(S,(0,o.Z)({"data-shrink":v,ownerState:b,ref:r,className:(0,l.Z)(y.root,f)},g,{classes:y}))}))},12823:function(e,r,n){n.d(r,{Y:function(){return o}});var t=n(31821),a=n(18561);function o(e){return(0,a.Z)("MuiInputLabel",e)}var i=(0,t.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);r.Z=i},96646:function(e,r,n){n(5057);var t=n(57471),a=n(96266);r.Z=(0,t.Z)((0,a.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage")},54665:function(e,r,n){n(5057);var t=n(57471),a=n(96266);r.Z=(0,t.Z)((0,a.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage")}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[9038],{39038:function(e,t,r){r.r(t),r.d(t,{default:function(){return f}});var n,o=r(71171),i=r(5057),a=r(33518),s=r(11750),l=r(68420),d=r(33028),h=r(33665),c=r(35432),p=r(96266),m=function(e){var t=Object.assign({},((0,h.Z)(e),e));return(0,p.jsxs)("div",(0,d.Z)((0,d.Z)({},t),{},{children:[(0,p.jsx)("h3",{children:"End User License Agreement for Blocklet Server"}),(0,p.jsxs)("p",{children:["Blocklet Server License Agreement ",c.COPYRIGHT_OWNER," version 2020-08-28"]}),(0,p.jsx)("p",{children:"Blocklet Server LICENSE AGREEMENT"}),(0,p.jsxs)("p",{children:["PLEASE READ THIS END USER LICENCE AGREEMENT CAREFULLY. This Blocklet Server License Agreement ('Agreement') is a legal agreement between you (the 'End User') and ",c.COPYRIGHT_OWNER," (ARCBLOCK) for the Blocklet Server software (the 'Software') licensed to End User hereunder and supplied to End User. The term Software includes any APIs, software modules, and any associated materials and 'online' or electronic documentation. This Agreement applies to End User's use of the Software but it shall be superseded by any signed agreement between End User and ARCBLOCK concerning the Software."]}),(0,p.jsx)("p",{children:"By installing or using the Software, You agree to accept and to be bound by this Agreement at all times. If You do not agree with one of these, please do not install or use the Software."}),(0,p.jsx)("h4",{children:"1. Software license"}),(0,p.jsx)("p",{children:"Notwithstanding any reference to 'sale' or 'purchase', the Software is licensed, not sold. Subject to the terms and conditions of this Agreement, ARCBLOCK grants End User a non-exclusive, non-transferable right to access and use the Software as part of the services for End User's use ('Authorized Use') in object form in the products, versions, and number of installed instances as purchased from ARCBLOCK."}),(0,p.jsx)("h4",{children:"2. Limitations"}),(0,p.jsx)("p",{children:"2.1. Restrictions. End User shall not itself, or through any parent, subsidiary, affiliate, agent or other third party: (a) sell, lease, license, distribute, sublicense or otherwise transfer in whole or in part, the Software to a third party; (b) decompile, disassemble, translate, reverse engineer or otherwise attempt to derive source code from the Software except to the limited extent, if any, that applicable law permits such acts notwithstanding any contractual prohibitions, provided, however, before End User exercises any rights that End User believes to be entitled to based on mandatory law, End User shall provide ARCBLOCK with thirty (30) days prior written notice and provide all reasonably requested information to allow ARCBLOCK to assess End User's claim and, at ARCBLOCK sole discretion, to provide alternatives that reduce any adverse impact on ARCBLOCK's intellectual property or other rights; (c) allow access or permit use of the Software by any third party except authorized third party contractors solely to provide services to End User, provided that End User shall be liable for all acts and omissions of such authorized third party contractors; (d) modify or create derivative works based upon the Software; (e) disclose the results of any benchmark test of the Software to any third party; (f) change any proprietary rights notices which appear in the Software; or (g) circumvent the license keys embedded within the Software."}),(0,p.jsx)("p",{children:"2.2. Software Transfer. Upon written consent from ARCBLOCK, which will not be unreasonably withheld, End User may permanently transfer all of its rights under this Agreement; provided that the recipient agrees to the terms of this Agreement."}),(0,p.jsx)("p",{children:"2.3. High Risk Activities. The Software is not intended for use in hazardous environments requiring fail safe performance (such as, without limitation, the planning, construction, maintenance, control, or direct operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, medical device and life support machines, or weapon systems) in which the failure of the Software could lead to death, personal injury or physical and environmental damage ('High Risk Activities'). Accordingly, this Agreement excludes any High Risk Activities and End User agrees not to use the Software in connection with High Risk Activities."}),(0,p.jsx)("h4",{children:"3. Ownership"}),(0,p.jsx)("p",{children:"The Software is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. ARCBLOCK owns all rights, title and interest in the copyrights, patents and all other intellectual property rights in and to the Software and any accompanying printed materials, and all derivative works thereof."}),(0,p.jsx)("h4",{children:"4. Open source programs"}),(0,p.jsx)("p",{children:"The Software may include individual open source software components, each of which has its own copyright and its own applicable license conditions. The open source software components are licensed to End User under the terms of the applicable open source license conditions and/or copyright notices that can be found in the licenses file, the related documentation or other materials accompanying the Software."}),(0,p.jsx)("h4",{children:"5. Trademarks"}),(0,p.jsx)("p",{children:"The marks 'ARCBLOCK', \u2018BLOCKLETS\u2019 and \u2018Blocklet Server\u2019 are trademarks of ARCBLOCK. ARCBLOCK's failure to list a trademark in this Section shall not constitute a waiver of any trademark rights. All other trademarks in the Software not owned by ARCBLOCK are the property of their respective owners."}),(0,p.jsx)("h4",{children:"6. Disclaimer and Warranty"}),(0,p.jsx)("p",{children:"6.1. DISCLAIMER OF WARRANTIES. THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND AND ARCBLOCK EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED OR ARISING OUT OF A COURSE OF CONDUCT OR COURSE OF DEALING, INCLUDING ALL WARRANTIES OF TITLE, PERFORMANCE, USE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON INFRINGEMENT AND THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. ARCBLOCK MAKES NO WARRANTY REGARDING NON INTERRUPTION OF USE. NO ORAL OR WRITTEN STATEMENT PROVIDED BY ARCBLOCK SHALL CREATE ANY WARRANTY."}),(0,p.jsx)("p",{children:"6.2. LIMITATION OF LIABILITY. THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY END USER. ARCBLOCK SHALL NOT HAVE ANY LIABILITY TO END USER OR ANY OTHER PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUE, PROFIT OR OPPORTUNITY, LOST OR DAMAGED DATA OR OTHER COMMERCIAL OR ECONOMIC LOSS, EVEN IF ARCBLOCK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR THEY ARE FORESEEABLE. ARCBLOCK'S MAXIMUM AGGREGATE LIABILITY RELATING TO THIS AGREEMENT OR THE SOFTWARE SHALL NOT EXCEED THE AMOUNT PAID BY END USER FOR THE SOFTWARE."}),(0,p.jsx)("p",{children:"6.3. ALLOCATION. THE PROVISIONS OF THIS SECTION ALLOCATE RISKS UNDER THIS AGREEMENT BETWEEN ARCBLOCK AND END USER. ARCBLOCK'S LICENSING FEES FOR THE SOFTWARE REFLECT THIS ALLOCATION OF RISKS AND LIMITATION OF LIABILITY. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS IN ITS ESSENTIAL PURPOSE."}),(0,p.jsx)("p",{children:"6.4. Limitation. Because some jurisdictions do not allow certain disclaimers, exclusions or limitations of warranties, damages or liability, the above disclaimers, exclusions or limitations may not apply to End User and, therefore, shall apply only to the maximum extent allowed under applicable law."}),(0,p.jsx)("h4",{children:"7. Term"}),(0,p.jsx)("p",{children:"This Agreement is effective until terminated. End Users may terminate the Agreement at any time by returning or destroying all copies of the Software and related documentation. End User's rights under this Agreement will terminate automatically if End User fails to comply with the Agreement."}),(0,p.jsx)("h4",{children:"8. Miscellaneous"}),(0,p.jsx)("p",{children:"8.1. Governing Law. This Agreement shall be governed by the laws of the State of Washington, without reference to the principles of conflicts of law. The provisions of the Uniform Computerized Information Transaction Act and United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Agreement. Any litigation related to this Agreement shall be brought in the state or federal courts located in Washington, and only in those courts and each party irrevocably waives any objections to such venue. Notwithstanding anything to the contrary herein, ARCBLOCK shall be entitled to seek injunctive or other equitable relief, wherever ARCBLOCK deems appropriate in any jurisdiction, in order to preserve or enforce ARCBLOCK's rights for any breach or threatened breach of this Agreement."}),(0,p.jsx)("p",{children:"8.2. Severability. Every term, condition or provision of this Agreement is severable from the others. If a court or an arbitrator of competent jurisdiction holds any term, condition or provision of this Agreement to be invalid, unenforceable or illegal in whole or in part for any reason, the validity and enforceability of the remaining terms, conditions or provisions, or portions of them, will not be affected."}),(0,p.jsx)("p",{children:"8.3. Confidentiality. Except as expressly allowed by this Agreement, End User will not use or disclose any Software or related technology, idea, algorithm or information ('Confidential Information') except to the extent End User can document that it is generally available for use and disclosure by the public without charge or license. End User shall hold the Confidential Information in trust and confidence and avoid the disclosure or release thereof to any other person or entity by using the same degree of care as it uses to avoid unauthorized use, disclosure, or dissemination of its own Confidential Information of a similar nature, but not less than reasonable care. End User may disclose Confidential Information as required to comply with binding orders of governmental entities that have jurisdiction over it; provided that End User gives ARCBLOCK reasonable written notice to allow ARCBLOCK to seek a protective order or other appropriate remedy, discloses only such Confidential Information as is required by the governmental entity, and uses commercially reasonable efforts to obtain confidential treatment for any Confidential Information disclosed. End User recognizes and agrees that there is no adequate remedy at law for a breach of this Section, that such a breach would irreparably harm ARCBLOCK and that ARCBLOCK is entitled to equitable relief (without need to post a bond) with respect to any such breach or potential breach in addition to any other remedies."}),(0,p.jsx)("p",{children:"8.4. Indemnity. End User shall defend, indemnify and hold harmless ARCBLOCK, and its officers, directors, employees and agents (the ARCBLOCK indemnities\u2019), from and against all suits, claims, demands, losses, liabilities, damages and expenses (including reasonable attorneys' fees and costs) that the ARCBLOCK Indemnities may suffer or incur in connection with: (i) any third party claim arising from End User's breach of this Agreement; and (ii) any infringement by End User of ARCBLOCK's intellectual property rights in the Software."}),(0,p.jsx)("p",{children:"8.5. Entire Agreement and Waiver. The Agreement is the sole, final and entire agreement between the parties with respect to the subject matter hereof, may only be amended in writing signed by both ARCBLOCK License parties. A failure or delay in enforcing any provisions, exercising any option or requiring performance, be construed to be a waiver by ARCBLOCK."}),(0,p.jsx)("p",{children:"8.6. Marketing. ARCBLOCK may use End User's name and company logo on its customer list and web site, and link to End User's web site."}),(0,p.jsx)("p",{children:"8.7. Independent Contractor. The relationship of the parties is that of independent contractors. Neither party will be deemed to be the legal representative of the other nor will it have any right to bind the other party to any contract or commitment. This Agreement does not, and will not, be construed to create an employer employee, agency, joint venture or partnership relationship between the parties. Each party agrees to assume complete responsibility for its own employees regarding federal or state laws, including employers' liability and tax withholding, worker's compensation, social security, unemployment insurance, and OSHA requirements."}),(0,p.jsx)("p",{children:"8.8. Notices. All notices must be in writing and will be effective three (3) days after the date sent to each party's corporate headquarters."}),(0,p.jsx)("p",{children:"8.9. Audit. During the term of this Agreement and for one (1) year following termination or expiration (but no more than once in a calendar year), ARCBLOCK and its auditors may inspect End User's records relating to its reproduction and use of the Software for the purposes of verifying End User's compliance with this Agreement. End User shall cooperate fully with ARCBLOCK and its auditors in conducting audits and provide reasonable assistance. If an underpayment is discovered, End User shall promptly pay such amount and End User shall reimburse ARCBLOCK for the cost of the audit."}),(0,p.jsx)("p",{children:'8.10. Government Regulation. End User acknowledges that the Software is subject to export restrictions by the U.S. government and import restrictions by certain foreign governments. End User may not export or re-export the Software except in compliance with the U.S. Export Administration Act and the related rules and regulations and similar non-U.S. government restrictions, if applicable. End User shall not and shall not allow any third party to remove or export from the United States or allow the export or re export of any part of the Software or any direct product thereof: (i) into (or to a national or resident of) any embargoed or terrorist supporting country; (ii) to anyone on the U.S. Commerce Department\'s Table of Denial Orders or U.S. Treasury Department\'s list of Specially Designated Nationals; (iii) to any country to which such export or re export is restricted or prohibited, or as to which the U.S. government or any agency thereof requires an export license or other governmental approval at the time of export or re export without first obtaining such license or approval; or (iv) otherwise in violation of any export or import restrictions, laws or regulations of any United States or foreign agency or authority. End User agrees to the foregoing and warrants that it is not located in, under the control of, or a national or resident of any such prohibited country or on any such prohibited party list. The Software is further restricted from being used for terrorist activity, or for the design or development of nuclear, chemical, or biological weapons or missile technology without the prior permission of the U.S. government. The Software and accompanying documentation are deemed to be "commercial computer software" and "commercial computer software documentation", respectively, pursuant to DFAR Section 227.7202 and FAR Section 12.212(b), as applicable. Any use, modification, reproduction, release, performing, displaying or disclosing of the Software and related documentation by the U.S. Government shall be governed solely by the terms of this Agreement.'})]}))};function f(){var e=(0,i.useContext)(l.RD).t;return(0,p.jsxs)(E,{children:[(0,p.jsx)(s.Z,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:e("setup.steps.eula")}),(0,p.jsx)(m,{})]})}var E=a.Z.main(n||(n=(0,o.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-content {\n margin-top: 16px;\n }\n"])))}}]);