@abtnode/blocklet-services 1.16.17-beta-952ef53d → 1.16.17-beta-d81014f4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +15 -13
- package/api/libs/connect/session.js +1 -1
- package/api/libs/open-graph/index.js +1 -1
- package/api/routes/federated.js +0 -1
- package/api/routes/oauth.js +1 -2
- package/api/routes/user-session.js +31 -5
- package/api/routes/user.js +25 -7
- package/api/services/auth/connect/invite.js +24 -2
- package/api/services/image/index.js +1 -1
- package/build/asset-manifest.json +69 -77
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/service-worker.js.map +1 -1
- package/build/static/js/1148.4b2a7347.chunk.js +2 -0
- package/build/static/js/{2093.3192d241.chunk.js → 2093.3ce9b59d.chunk.js} +3 -3
- package/build/static/js/218.74e73a26.chunk.js +2 -0
- package/build/static/js/2653.6610534f.chunk.js +2 -0
- package/build/static/js/3025.a48c96f5.chunk.js +2 -0
- package/build/static/js/3033.6623d19d.chunk.js +2 -0
- package/build/static/js/3131.672170fb.chunk.js +2 -0
- package/build/static/js/3593.b9a1a7f5.chunk.js +2 -0
- package/build/static/js/3688.48e7b69c.chunk.js +2 -0
- package/build/static/js/4022.5ec79b56.chunk.js +2 -0
- package/build/static/js/4023.1658794f.chunk.js +2 -0
- package/build/static/js/4076.bcc72fcc.chunk.js +2 -0
- package/build/static/js/4587.906e3023.chunk.js +2 -0
- package/build/static/js/468.bbc69bbf.chunk.js +2 -0
- package/build/static/js/4716.a8a5b75d.chunk.js +2 -0
- package/build/static/js/4802.fe56c787.chunk.js +2 -0
- package/build/static/js/4961.89add60c.chunk.js +3 -0
- package/build/static/js/5662.03f06ae0.chunk.js +2 -0
- package/build/static/js/{5982.d9eb7e90.chunk.js → 5982.4f8369df.chunk.js} +2 -2
- package/build/static/js/6084.30821f2c.chunk.js +3 -0
- package/build/static/js/6139.cabc22a2.chunk.js +2 -0
- package/build/static/js/6658.090d923f.chunk.js +2 -0
- package/build/static/js/{716.438b9c22.chunk.js → 716.9c76ad65.chunk.js} +3 -3
- package/build/static/js/779.b64e7db1.chunk.js +2 -0
- package/build/static/js/7832.741ac84f.chunk.js +2 -0
- package/build/static/js/7858.e4167dfd.chunk.js +2 -0
- package/build/static/js/8622.c39b4054.chunk.js +2 -0
- package/build/static/js/{8641.f2bb0ffc.chunk.js → 8641.506d61d5.chunk.js} +2 -2
- package/build/static/js/8702.2d858942.chunk.js +2 -0
- package/build/static/js/8792.8b009f81.chunk.js +2 -0
- package/build/static/js/8944.2d60df14.chunk.js +2 -0
- package/build/static/js/{9596.0e51cd6e.chunk.js → 9596.5251398b.chunk.js} +2 -2
- package/build/static/js/9900.cce3f786.chunk.js +2 -0
- package/build/static/js/main.b3164561.js +3 -0
- package/build/static/js/{main.3cf7fedb.js.LICENSE.txt → main.b3164561.js.LICENSE.txt} +9 -0
- package/package.json +34 -33
- package/api/util/user-session.js +0 -47
- package/build/static/js/1148.e5dc907a.chunk.js +0 -2
- package/build/static/js/2653.6a6c1c6c.chunk.js +0 -2
- package/build/static/js/3025.e2b1dac4.chunk.js +0 -2
- package/build/static/js/3033.1bbcc14e.chunk.js +0 -2
- package/build/static/js/3131.f75fa792.chunk.js +0 -2
- package/build/static/js/3593.17dc42f3.chunk.js +0 -2
- package/build/static/js/3688.2cea0226.chunk.js +0 -2
- package/build/static/js/4023.a79b0858.chunk.js +0 -2
- package/build/static/js/4076.e73cb63a.chunk.js +0 -2
- package/build/static/js/4355.f459ab57.chunk.js +0 -2
- package/build/static/js/4587.5b31e02e.chunk.js +0 -2
- package/build/static/js/468.5af177b9.chunk.js +0 -2
- package/build/static/js/4716.1ecc2bb6.chunk.js +0 -2
- package/build/static/js/4802.d185b9f1.chunk.js +0 -2
- package/build/static/js/4932.c7c954aa.chunk.js +0 -2
- package/build/static/js/4946.dbbdb25b.chunk.js +0 -2
- package/build/static/js/5012.551dbbc3.chunk.js +0 -2
- package/build/static/js/5662.919cc4a2.chunk.js +0 -2
- package/build/static/js/5969.2791e4e5.chunk.js +0 -3
- package/build/static/js/6139.cf6eb9b1.chunk.js +0 -2
- package/build/static/js/6465.e704f56b.chunk.js +0 -3
- package/build/static/js/6473.d89e783e.chunk.js +0 -2
- package/build/static/js/6658.0a27e04e.chunk.js +0 -2
- package/build/static/js/779.99b3f0d2.chunk.js +0 -2
- package/build/static/js/7858.bac05f8f.chunk.js +0 -2
- package/build/static/js/8622.8478c900.chunk.js +0 -2
- package/build/static/js/8702.957f131a.chunk.js +0 -2
- package/build/static/js/873.d6d31b32.chunk.js +0 -3
- package/build/static/js/873.d6d31b32.chunk.js.LICENSE.txt +0 -8
- package/build/static/js/8792.eff43237.chunk.js +0 -2
- package/build/static/js/8944.09a1c53a.chunk.js +0 -2
- package/build/static/js/9403.b72e020c.chunk.js +0 -2
- package/build/static/js/9900.b66896e6.chunk.js +0 -2
- package/build/static/js/main.3cf7fedb.js +0 -3
- /package/build/static/js/{2093.3192d241.chunk.js.LICENSE.txt → 2093.3ce9b59d.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5969.2791e4e5.chunk.js.LICENSE.txt → 4961.89add60c.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{6465.e704f56b.chunk.js.LICENSE.txt → 6084.30821f2c.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{716.438b9c22.chunk.js.LICENSE.txt → 716.9c76ad65.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[6139],{70998:function(e,n,t){t.d(n,{Z:function(){return b}});var o=t(33028),l=t(59740),r=t(24974),i=t.n(r),c=t(59467),a=t(62399),s=t(19611),d=t.n(s),u=t(20244),p=t(41395),h=t(24891);var m=t(37574),f=["blocklet","style","size","ancestors"];function b(e){var n=e.blocklet,t=e.style,r=e.size,i=e.ancestors,s=(0,l.Z)(e,f),b=(0,p.h6)(),x=function(e){var n,t=e.blocklet,o=e.ancestors,l=void 0===o?[]:o,r=(0,p.h6)(),i=r.inService,c="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,h.XN)(null===t||void 0===t?void 0:t.status)?"~":""),a=i?d()(h.zn,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",c):d()(r.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)a=d()(t.deployedFrom,(0,h.lk)(t.meta.bundleDid,t.meta.logo),c);else{var s=window.env.apiPrefix||"/",m=l.concat(t),f=i?m.slice(1):m;a=d()(s,"/blocklet/logo-bundle".concat(f.map((function(e){return"/".concat(e.meta.did)})).join("")),c)}return{logoUrl:a,inService:i}}({blocklet:n,ancestors:i}),v=x.logoUrl,Z=x.inService,j=s.variant,k=Z?function(){}:function(e){e.target.src="".concat(b.imgPrefix,"/blocklet.png")},g=(0,m.jsx)("img",{src:v,onError:k,alt:n.meta.name,style:{width:r}});return n.meta.logo||(g=(0,m.jsx)(a.Z,{did:n.meta.did||"",responsive:!0})),(0,m.jsx)(c.Z,(0,o.Z)((0,o.Z)({variant:j||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},t)},s),{},{children:g}))}b.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string]),ancestors:i().array},b.defaultProps={style:{},size:40,ancestors:[]}},16139:function(e,n,t){t.r(n),t.d(n,{default:function(){return Qe}});var o=t(71171),l=t(30969),r=t(30734),i=t(16380),c=t(38361),a=t(96234),s=t(86822),d=t(26022),u=t(94551),p=t(10814),h=t(2291),m=t(29996),f=t(1986),b=t(9715),x=t(16438),v=t(45008),Z=t(41395),j=t(33028),k=t(59740),g=t(24974),y=t.n(g),T=t(94308),I=t(37574),E=["size"];function P(e){var n=e.size,t=(0,k.Z)(e,E);return(0,I.jsx)(c.Z,(0,j.Z)((0,j.Z)({display:"flex",mt:4},t),{},{children:(0,I.jsx)(T.Z,{size:n})}))}P.propTypes={size:y().number},P.defaultProps={size:24};var R,S=t(36558),C=t(8479);function N(){var e=(0,d.PE)(),n=e.t,t=e.locale,o=(0,Z.h6)().api,r=(0,l.useState)(!0),i=(0,a.Z)(r,2),j=i[0],k=i[1],g=(0,v.y0)().blocklet,y=(0,l.useState)(null),T=(0,a.Z)(y,2),E=T[0],R=T[1],N=(0,l.useState)(null),w=(0,a.Z)(N,2),_=w[0],z=w[1],V=function(){o.getProjects({input:{did:g.meta.did}}).then((function(e){var n=(null===e||void 0===e?void 0:e.projects)||[];k(!1),z(n)})).catch((function(e){k(!1),f.Z.error(e.message)}))};if((0,l.useEffect)((function(){V()}),[]),!_&&j)return(0,I.jsx)(P,{});if(!_)return null;if(!_.length)return(0,I.jsxs)(c.Z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[(0,I.jsx)(c.Z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:n("blocklet.publish.blockletEmptyTip")}),(0,I.jsx)(c.Z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createBlockletTip")}),(0,I.jsx)(s.rU,{to:"create",children:(0,I.jsx)(m.Z,{variant:"contained",children:n("blocklet.publish.createBlocklet")})})]});var A=[{label:"Blocklet",name:"blockletTitle",options:{customBodyRenderLite:function(e){var n=_[e];return(0,I.jsx)(s.rU,{to:"".concat(n.id),children:n.blockletTitle||"/"})}}},{label:"DID",name:"blockletDid",options:{customBodyRender:function(e){return(0,I.jsx)(S.Z,{size:14,responsive:!0,did:e})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:function(e){return e?(0,I.jsx)(b.Z,{type:"success",children:e}):""}}},{label:n("common.updatedAt"),name:"updatedAt",options:{customBodyRender:function(e){return(0,I.jsx)(x.Z,{value:Number(e),locale:t})}}},{label:n("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=_[e];return(0,I.jsx)(c.Z,{display:"flex",children:(0,I.jsx)(u.Z,{color:"error","aria-label":"delete",onClick:function(){return function(e){R(e)}(n)},children:(0,I.jsx)(p.default,{sx:{fontSize:18}})})})}}}];return(0,I.jsxs)(B,{children:[(0,I.jsx)(c.Z,{sx:{textAlign:"right"},children:(0,I.jsx)(s.rU,{to:"create",children:(0,I.jsx)(m.Z,{variant:"contained",children:n("blocklet.publish.createBlocklet")})})}),(0,I.jsx)(h.Z,{className:"main-table",locale:t,data:_,columns:A,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),E&&(0,I.jsx)(C.Z,{title:"".concat(n("common.delete")," ").concat(E.blockletTitle),description:n("blocklet.publish.deleteBlockletTip"),confirm:n("common.confirm"),onConfirm:function(){k(!1);var e=E.id;o.deleteProject({input:{did:g.meta.did,projectId:e}}).then((function(){k(!1),V(),f.Z.success(n("common.removeSuccess"))})).catch((function(e){k(!1),f.Z.error(e.message)}))},onCancel:function(){return R(null)}})]})}N.propTypes={};var w,B=(0,i.Z)(c.Z)(R||(R=(0,o.Z)(["\n .main-table > div:first-child {\n display: none;\n }\n"]))),_=t(33665),z=t(2689),V=t(87006),A=t(33359),L=t(15012),O=t(4953),D=t(31575),W=t(77370),M=[{label:{en:"Resource",zh:"\u8d44\u6e90"},value:"resource"},{label:{en:"Application",zh:"\u5e94\u7528"},value:"pack",disabled:!0}];function U(e){var n=Object.assign({},((0,_.Z)(e),e)),t=(0,r.useNavigate)(),o=(0,d.PE)(),i=o.t,u=o.locale,p=(0,v.y0)().blocklet,h=(0,l.useState)(""),b=(0,a.Z)(h,2),x=b[0],k=b[1],g=(0,l.useState)(!1),y=(0,a.Z)(g,2),T=y[0],E=y[1],P=(0,l.useState)("resource"),R=(0,a.Z)(P,2),S=R[0],C=R[1],N=(0,W.T)().api,w=(0,Z.h6)().api,B=(0,l.useState)(),U=(0,a.Z)(B,2),F=U[0],X=U[1],H=(0,l.useState)(!1),J=(0,a.Z)(H,2),K=J[0],G=J[1];return(0,I.jsxs)(q,(0,j.Z)((0,j.Z)({},n),{},{children:[(0,I.jsxs)(L.Z,{className:"breadcrumbs","aria-label":"breadcrumb",children:[(0,I.jsx)(s.rU,{to:"..",children:i("common.publish")}),(0,I.jsxs)(A.Z,{color:"text.primary",children:[i("common.create")," Blocklet"]})]}),(0,I.jsxs)(c.Z,{style:{maxWidth:500},children:[(0,I.jsx)(V.Z,{required:!0,sx:{mb:4},label:"Blocklet DID",fullWidth:!0,readonly:!0,autoComplete:"off",variant:"outlined",onClick:function(){return!F&&G(!0)},InputProps:{"data-cy":"export-blocklet-did",endAdornment:(0,I.jsx)(O.Z,{position:"end",children:(0,I.jsx)(m.Z,{onClick:function(){return G(!0)},children:i(F?"common.update":"common.create")})})},helperText:"",value:F||""}),K&&(0,I.jsx)(D.Z,{open:!0,popup:!0,onClose:function(){return G(!1)},action:"gen-blocklet-key-pair",locale:u,checkFn:N.get,saveConnect:!1,forceConnected:!1,checkTimeout:3e5,onSuccess:function(e){var n,t=null===e||void 0===e||null===(n=e.blockletWallet)||void 0===n?void 0:n.address;t?X(t):f.Z.error("Empty Blocklet DID"),G(!1)},onError:function(e){f.Z.error(e.message),G(!1)},extraParams:{did:p.meta.did},messages:{title:i("blocklet.publish.connect.title"),scan:i("blocklet.publish.connect.scan"),confirm:i("blocklet.publish.connect.confirm"),success:i("blocklet.publish.connect.success")}}),(0,I.jsx)(V.Z,{required:!0,label:"Blocklet ".concat(i("common.title")),autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-title"},fullWidth:!0,helperText:"",value:x||"",onChange:function(e){k(e.target.value)}}),(0,I.jsx)(V.Z,{sx:{my:4},id:"blocklet-type",select:!0,label:"Blocklet ".concat(i("common.type")),helperText:"",fullWidth:!0,value:S,onChange:function(e){return C(e.target.value)},children:M.map((function(e){return(0,I.jsx)(z.Z,{value:e.value,disabled:e.disabled,children:e.label[u]||e.label.en},e.value)}))})]}),(0,I.jsx)(m.Z,{variant:"contained",disabled:T,onClick:function(){F?x?(E(!0),w.createProject({input:{did:p.meta.did,blockletTitle:x||"",blockletDid:F,type:S}}).then((function(){E(!1),t("../",{replace:!0})})).catch((function(e){E(!1),f.Z.error(e.message)}))):f.Z.error(i("blocklet.publish.errorTip.noTitle")):f.Z.error(i("blocklet.publish.errorTip.noDid"))},children:i("common.create")})]}))}U.propTypes={},U.defaultProps={};var F,q=i.Z.div(w||(w=(0,o.Z)(["\n .breadcrumbs {\n margin-bottom: 24px;\n }\n"]))),X=t(19611),H=t.n(X),J=t(70093),K=t.n(J),G=t(32677),Q=t(20244),Y=t(59505);function $(){var e=(0,d.PE)(),n=e.t,t=e.locale,o=(0,r.useParams)().projectId,i=(0,Z.h6)().api,j=(0,l.useState)(!0),k=(0,a.Z)(j,2),g=k[0],y=k[1],T=(0,v.y0)().blocklet,E=(0,l.useState)(null),R=(0,a.Z)(E,2),S=R[0],N=R[1],w=(0,l.useState)(null),B=(0,a.Z)(w,2),_=B[0],z=B[1],V=(0,l.useState)(null),O=(0,a.Z)(V,2),D=O[0],W=O[1];(0,l.useEffect)((function(){i.doBatchQuery({getProject:{input:{did:T.meta.did,projectId:o}},getReleases:{input:{did:T.meta.did,projectId:o}}}).then((function(e){z(e.getProject.project||{}),N(e.getReleases.releases||[]),y(!1)})).catch((function(e){y(!1),f.Z.error(e.message)}))}),[]);if(!S&&g)return(0,I.jsx)(P,{});if(!S)return null;var M=(0,I.jsxs)(L.Z,{className:"breadcrumbs","aria-label":"breadcrumb",children:[(0,I.jsx)(s.rU,{to:"..",children:n("common.publish")}),(0,I.jsx)(A.Z,{color:"text.primary",children:_.blockletTitle})]});if(!S.length)return(0,I.jsxs)(I.Fragment,{children:[M,(0,I.jsxs)(c.Z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[(0,I.jsx)(c.Z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:n("blocklet.publish.releaseEmptyTip")}),(0,I.jsx)(c.Z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createReleaseTip")}),(0,I.jsx)(s.rU,{to:"create",children:(0,I.jsx)(m.Z,{variant:"contained",children:n("blocklet.publish.createRelease")})})]})]});var U=[{label:n("common.version"),name:"blockletVersion",options:{customBodyRenderLite:function(e){var n=S[e];return(0,I.jsx)(s.rU,{to:"".concat(n.id),children:n.blockletVersion||"/"})}}},{label:n("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:function(e){var n=S[e];return(0,I.jsx)(A.Z,{className:"note",children:n.note||""})}}},{label:n("common.status"),name:"status",options:{customBodyRender:function(e){return(0,I.jsx)(b.Z,{type:"published"===e?"success":"warning",children:K()(e)})}}},{label:n("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:function(e){var n=S[e];return n.status!==Y.PROJECT.RELEASE_STATUS.published?"":(0,I.jsx)(x.Z,{value:Number(n.updatedAt),locale:t})}}},{label:n("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=S[e];return(0,I.jsxs)(c.Z,{display:"flex",alignItems:"center",children:[(0,I.jsx)(u.Z,{color:"primary","aria-label":"download",disabled:"published"!==n.status,children:"published"===n.status?(0,I.jsx)("a",{style:{display:"flex"},href:H()("".concat(Q.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project/").concat(T.meta.did,"/").concat(_.id,"/").concat(n.id,"/download/").concat((n.files||[])[0])),children:(0,I.jsx)(G.Z,{sx:{fontSize:18}})}):(0,I.jsx)(G.Z,{sx:{fontSize:18}})}),(0,I.jsx)(u.Z,{color:"error","aria-label":"delete",onClick:function(){return function(e){W(e)}(n)},children:(0,I.jsx)(p.default,{sx:{fontSize:18}})})]})}}}];return(0,I.jsxs)(ne,{children:[(0,I.jsxs)(c.Z,{className:"header",children:[M,(0,I.jsx)(s.rU,{to:"create",children:(0,I.jsx)(m.Z,{variant:"contained",children:n("blocklet.publish.createRelease")})})]}),(0,I.jsx)(h.Z,{className:"main-table",verticalKeyWidth:100,locale:t,data:S,columns:U,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),D&&(0,I.jsx)(C.Z,{title:n("".concat(n("common.delete")," ").concat(D.blockletVersion)),description:n("blocklet.publish.deleteReleaseTip"),confirm:n("common.confirm"),onConfirm:function(){y(!1);var e=D.id;i.deleteRelease({input:{did:T.meta.did,projectId:o,releaseId:e}}).then((function(){y(!1),i.getReleases({input:{did:T.meta.did,projectId:o}}).then((function(e){var n=(null===e||void 0===e?void 0:e.releases)||[];y(!1),N(n)})).catch((function(e){y(!1),f.Z.error(e.message)})),f.Z.success(n("common.removeSuccess"))})).catch((function(e){y(!1),f.Z.error(e.message)}))},onCancel:function(){return W(null)}})]})}$.propTypes={};var ee,ne=(0,i.Z)(c.Z)(F||(F=(0,o.Z)(["\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .main-table > div:first-child {\n display: none;\n }\n .note {\n word-break: break-all;\n white-space: pre-line;\n }\n"]))),te=t(68079),oe=t(56666),le=t(43178),re=t(49735),ie=t.n(re),ce=t(60451),ae=t.n(ce),se=t(59467),de=t(30291),ue=t(78789),pe=t(19865),he=t(70998),me=t(24891),fe=t(32723),be=t(34795),xe=t(63146),ve=t.n(xe),Ze=t(65667),je=t.n(Ze),ke=t(92522),ge=t.n(ke),ye=t(49884),Te=t(24837),Ie=t(7418),Ee=t(88876),Pe=t(23038),Re=t(52838),Se=t(16374),Ce=t(96628),Ne=function(e,n){for(var t=(0,te.Z)(e);t.length>0;){var o=t.shift();if(o.id===n)return o;o.children&&t.push.apply(t,(0,te.Z)(o.children))}return[]};function we(e){var n=e.icon;return n?ge()(n)?(0,I.jsx)("img",{className:"resource-icon",src:n,alt:"icon"}):(0,I.jsx)(Ce.JO,{className:"resource-icon",icon:n}):null}function Be(e){var n=e.disabled,t=e.data,o=e.onChange,l=e.value;function r(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.push(e.id),e.children&&e.children.forEach((function(e){return r(e,n)})),n}var i=function(e){return r(Ne(t,e))},a=function e(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=Ne(t,n);return l.parent?(o.push(l.parent),e(l.parent,o)):o};function s(e,n){var t=i(e.id),o=t.indexOf(e.id);return t.splice(o,1),t.every((function(e){return l.concat(n).includes(e)}))}var d=function(e,n){e.stopPropagation();var r=i(n),c=a(n);if(l.includes(n)){var d=l.filter((function(e){return!r.concat(c).includes(e)}));o(d)}else{for(var u=r,p=0;p<c.length;++p)s(Ne(t,c[p]),u)&&u.push(c[p]);o((0,te.Z)(l).concat(u))}},u=function(e){e.stopPropagation()},p=t.some((function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)>0})),h=function e(t){return(0,I.jsx)(Ie.Z,{nodeId:t.id,label:(0,I.jsx)(ye.Z,{onClick:u,control:(0,I.jsx)(Ee.Z,{size:"small",checked:-1!==l.indexOf(t.id),tabIndex:-1,disableRipple:!0,onClick:function(e){return d(e,t.id)},disabled:n}),label:(0,I.jsxs)(c.Z,{className:"content",children:[(0,I.jsxs)(c.Z,{display:"flex",alignItems:"center",children:[t.icon&&(0,I.jsx)(we,{icon:t.icon}),(0,I.jsx)(c.Z,{className:"name",children:t.name}),t.url&&(0,I.jsx)("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"link",children:(0,I.jsx)(Se.Z,{className:"link-icon"})})]}),!!t.description&&(0,I.jsx)(c.Z,{className:"description",children:t.description})]})}),children:Array.isArray(t.children)?t.children.map(e):null},t.id)};return(0,I.jsx)(ze,{className:je()(!p&&"no-children"),multiSelect:!0,defaultCollapseIcon:(0,I.jsx)(Pe.Z,{}),defaultExpandIcon:(0,I.jsx)(Re.default,{}),selected:l,children:t.map((function(e){return h(e)}))})}we.propTypes={icon:y().string},we.defaultProps={icon:""},Be.propTypes={data:y().array,value:y().array,onChange:y().func,disabled:y().bool},Be.defaultProps={data:[],value:[],onChange:function(){},disabled:!1};var _e,ze=(0,i.Z)(Te.Z)(ee||(ee=(0,o.Z)(["\n &.no-children {\n .MuiTreeItem-content {\n padding: 0;\n .MuiTreeItem-iconContainer {\n display: none;\n }\n .MuiTreeItem-label {\n padding-left: 0;\n }\n }\n }\n .MuiTreeItem-content {\n align-items: flex-start;\n .MuiTreeItem-iconContainer {\n transform: translateY(10px);\n }\n &.Mui-selected {\n background-color: transparent;\n }\n }\n .MuiTreeItem-label {\n cursor: default;\n }\n .MuiFormControlLabel-root {\n align-items: flex-start;\n }\n .content {\n padding-top: 6px;\n }\n .name {\n font-size: 16px;\n font-weight: 700;\n }\n .resource-icon {\n margin-right: 2px;\n font-size: 16px;\n }\n img.resource-icon {\n width: 1rem;\n height: 1rem;\n }\n .link {\n margin-left: 8px;\n font-size: 16px;\n color: ",";\n display: flex;\n }\n .link-icon {\n font-size: inherit;\n }\n .description {\n font-size: 14px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.text.secondary})),Ve=t(54559),Ae=function e(n,t){return n.forEach((function(n){t&&(n.parent=t),(n.children||[]).forEach((function(t){t.parent=n.id,e(t.children||[],t.id)}))})),n},Le=function(e,n){return e.length!==n.length||!!ve()(e,n||[]).length};function Oe(e){var n=e.app,t=e.component,o=e.projectId,r=e.release,i=(0,d.PE)(),s=i.t,u=i.locale,p=(0,Z.h6)().api,h=(0,l.useState)([]),b=(0,a.Z)(h,2),x=b[0],v=b[1],j=(0,l.useState)([]),k=(0,a.Z)(j,2),g=k[0],y=k[1],T=(0,l.useState)([]),E=(0,a.Z)(T,2),P=E[0],R=E[1],S=(0,l.useState)(!1),C=(0,a.Z)(S,2),N=C[0],w=C[1],B=r.id,_="published"===r.status,z=((null===t||void 0===t?void 0:t.meta.capabilities)||{}).resourceExportApi,V=void 0===z?"/":z,A=(0,l.useMemo)((function(){return Le(P,g)}),[P,g]),L=new URL(H()("http://127.0.0.1",t.mountPoint,V||"/").replace(/\/+/g,"/"));L.searchParams.set("projectId",o),L.searchParams.set("releaseId",B),L.searchParams.set("local",u);var O="".concat(L.pathname).concat(L.search),D=function(){var e=(0,be.Z)((0,fe.Z)().mark((function e(l){return(0,fe.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p.updateSelectedResources({input:{did:n.meta.did,projectId:o,releaseId:B,componentDid:t.meta.did,resources:l}});case 3:R(l),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),f.Z.error(e.t0.message);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(n){return e.apply(this,arguments)}}(),W=function(){var e=(0,be.Z)((0,fe.Z)().mark((function e(){var n;return(0,fe.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g,e.prev=1,w(!0),e.next=5,Ve.od.post(O,{resources:n,projectId:o,releaseId:B,locale:u});case 5:f.Z.success(s("common.saveSuccess")),w(!1),D(g),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(1),w(!1),f.Z.error(e.t0.message);case 14:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(){return e.apply(this,arguments)}}();return(0,l.useEffect)((function(){Ve.od.get(O).then((function(e){var n,t=Ae((null===(n=e.data)||void 0===n?void 0:n.resources)||[]);v(t)})).catch((function(e){f.Z.error(e.message)})),p.getSelectedResources({input:{did:n.meta.did,projectId:o,releaseId:B,componentDid:t.meta.did}}).then((function(e){var n=(null===e||void 0===e?void 0:e.resources)||[];y(n),R(n)})).catch((function(e){f.Z.error(e.message)}))}),[O]),"running"!==t.status?(0,I.jsx)(We,{children:(0,I.jsx)(c.Z,{pt:6,children:s("blocklet.publish.componentNotRunning",{name:t.meta.title})})}):(0,I.jsx)(We,{children:(0,I.jsxs)(c.Z,{children:[(0,I.jsx)(Be,{data:x,value:g,onChange:function(e){y(e)},disabled:N||_}),!_&&(0,I.jsx)(c.Z,{className:"footer",children:(0,I.jsx)(m.Z,{variant:"contained",disabled:N||!A,onClick:function(){return W()},children:s("common.save")})})]})})}Oe.propTypes={component:y().object.isRequired,app:y().object.isRequired,projectId:y().string.isRequired,release:y().shape({id:y().string.isRequired,status:y().string})},Oe.defaultProps={release:{id:""}};var De,We=(0,i.Z)(c.Z)(_e||(_e=(0,o.Z)(["\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 16px;\n padding-bottom: 0px;\n max-height: 600px;\n overflow-y: auto;\n .footer {\n border-top: 1px solid #ddd;\n display: flex;\n padding: 12px 0;\n margin-top: 12px;\n position: sticky;\n bottom: 0;\n background: #fff;\n }\n"]))),Me=["image/*",".jpg",".jpeg",".png",".gif",".svg"],Ue=10485760,Fe=(0,l.lazy)((function(){return Promise.all([t.e(4917),t.e(5547)]).then(t.bind(t,25547)).then((function(e){return{default:e.Uploader}}))})),qe=function(e,n,t){var o=[];return e.blockletTitle||o.push({param:"blockletTitle",message:t("blocklet.publish.errorTip.noTitle")}),e.blockletVersion?ae().valid(e.blockletVersion)||o.push({param:"blockletVersion",message:"Invalid Blocklet Version"}):o.push({param:"blockletVersion",message:t("blocklet.publish.errorTip.noVersion")}),n===Y.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||o.push({param:"blockletDescription",message:t("blocklet.publish.errorTip.noDescription")}),e.note||o.push({param:"note",message:t("blocklet.publish.errorTip.noNote")})),o.length?o:null},Xe=function(e){var n=e.tabs,t=e.blocklet,o=e.ancestors,l=void 0===o?[]:o,r=t.meta.did;n.push({label:(0,I.jsxs)(c.Z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[(0,I.jsx)(he.Z,{size:24,blocklet:t,ancestors:l}),(0,I.jsx)(c.Z,{ml:"4px",className:"text",children:(0,I.jsx)(c.Z,{children:t.meta.title})})]},r),value:r})},He=function(e){var n=ie()(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","note"]);return n.blockletScreenshots||(n.blockletScreenshots=[]),n};function Je(e){var n,t,o,i=Object.assign({},((0,_.Z)(e),e)),p=(0,r.useNavigate)(),h=(0,r.useParams)(),b=h.projectId,x=h.releaseId,k=(0,d.PE)().t,g=(0,v.y0)().blocklet,y=(0,le.Z)(null),T=(0,a.Z)(y,2),E=T[0],R=T[1],S=(0,l.useState)({}),C=(0,a.Z)(S,2),N=C[0],w=C[1],B=(0,l.useState)(!1),z=(0,a.Z)(B,2),D=z[0],W=z[1],M=(0,l.useState)(null),U=(0,a.Z)(M,2),F=U[0],q=U[1],X=(0,Z.h6)().api,J=(0,l.useRef)(null),K=(0,l.useRef)(null),G="create"===x?"":x,$="create"===x?"create":"edit",ee=[],ne=((null===g||void 0===g?void 0:g.children)||[]).filter((function(e){return e.meta.capabilities.resourceExportApi}));ne.forEach((function(e){Xe({tabs:ee,blocklet:e,t:k,ancestors:[g]})}));var re=(0,l.useState)(null===(n=ee[0])||void 0===n?void 0:n.value),ie=(0,a.Z)(re,2),ce=ie[0],he=ie[1],fe="published"===(null===F||void 0===F?void 0:F.status),be=fe,xe=function(){if("edit"===$){if(!G)return void f.Z.error("Empty release id");X.getRelease({input:{did:g.meta.did,projectId:b,releaseId:G}}).then((function(e){W(!1),R(He(null===e||void 0===e?void 0:e.release)),q(null===e||void 0===e?void 0:e.release)})).catch((function(e){W(!1),f.Z.error((0,me.Z)(e))}))}"create"===$&&X.getProject({input:{did:g.meta.did,projectId:b}}).then((function(e){W(!1);var n=e.project||{};n.blockletVersion?ae().valid(n.blockletVersion)&&(n.blockletVersion=ae().inc(n.blockletVersion,"patch")):n.blockletVersion="1.0.0",R(He(n))})).catch((function(e){W(!1),f.Z.error((0,me.Z)(e))}))};(0,l.useEffect)((function(){xe()}),[]);var ve=function(e){var n=qe(E,e,k);if(n)return f.Z.error(n.map((function(e){return e.message})).join("; ")),void w(n.reduce((function(e,n){return(0,j.Z)((0,j.Z)({},e),{},(0,oe.Z)({},n.param,n.message))}),{}));var t=(0,j.Z)({},E);if(t.blockletVersion=ae().valid(t.blockletVersion),!t.blockletVersion)return f.Z.error("Invalid Blocklet Version"),void w({blockletVersion:"Invalid Blocklet Version"});t.blockletTitle=(t.blockletTitle||"").trim(),t.blockletDescription=(t.blockletDescription||"").trim(),t.blockletIntroduction=(t.blockletIntroduction||"").trim(),t.note=(t.note||"").trim(),X.createRelease({input:(0,j.Z)((0,j.Z)({},t),{},{did:g.meta.did,projectId:b,releaseId:G,status:e})}).then((function(){"draft"===e?(f.Z.success("Save draft success"),"create"===$&&p("../".concat(b),{replace:!0})):(f.Z.success("Create Release success"),p("../".concat(b),{replace:!0}))})).catch((function(e){f.Z.error((0,me.Z)(e))}))};if(!E&&D)return(0,I.jsx)(P,{});if(!E)return null;var Ze="".concat(Q.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project/").concat(g.meta.did,"/").concat(b,"/logo/upload"),je="".concat(Q.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project/").concat(g.meta.did,"/").concat(b,"/screenshot/upload"),ke=null!==E&&void 0!==E&&E.blockletLogo?"".concat(Ze,"/").concat(E.blockletLogo):"".concat(Q.WELLKNOWN_SERVICE_PATH_PREFIX,"/static/images/logo.png"),ge=((null===E||void 0===E?void 0:E.blockletScreenshots)||[]).filter(Boolean).map((function(e){return"".concat(je,"/").concat(e)})),ye=ne.find((function(e){return e.meta.did===ce})),Te=ye?(0,I.jsx)(c.Z,{children:(0,I.jsx)(Oe,{app:g,component:ye,projectId:b,release:(0,j.Z)((0,j.Z)({},F),{},{id:G})})}):(0,I.jsx)(c.Z,{display:"flex",mt:-3,children:(0,I.jsx)(ue.Z,{children:k("common.empty")})});return(0,I.jsxs)(Ge,(0,j.Z)((0,j.Z)({},i),{},{children:[(0,I.jsxs)(c.Z,{className:"sticky-header",children:[(0,I.jsxs)(L.Z,{className:"breadcrumbs","aria-label":"breadcrumb",children:[(0,I.jsx)(s.rU,{to:"../",children:k("common.publish")}),(0,I.jsx)(s.rU,{to:"../".concat(b),children:(null===E||void 0===E?void 0:E.blockletTitle)||"Blocklet"}),(0,I.jsx)(A.Z,{color:"text.primary",children:"create"===$?k("common.create"):(null===E||void 0===E?void 0:E.blockletVersion)||k("common.edit")})]}),(0,I.jsxs)(c.Z,{display:"flex",children:[!fe&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(m.Z,{variant:"outlined",disabled:D,onClick:function(){return ve(Y.PROJECT.RELEASE_STATUS.draft)},style:{marginRight:12},children:k("blocklet.publish.saveDraft")}),(0,I.jsx)(m.Z,{variant:"contained",disabled:D,onClick:function(){return ve(Y.PROJECT.RELEASE_STATUS.published)},children:k("common.release")})]}),fe&&(0,I.jsx)(m.Z,{variant:"contained",children:(0,I.jsx)("a",{href:H()("".concat(Q.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project/").concat(g.meta.did,"/").concat(b,"/").concat(G,"/download/").concat((F.files||[])[0])),children:k("common.download")})})]})]}),(0,I.jsxs)(c.Z,{pt:3,children:[(0,I.jsxs)(c.Z,{display:"flex",className:"section",children:[(0,I.jsx)(A.Z,{variant:"h3",className:"left",children:k("blocklet.publish.productTitle")}),(0,I.jsxs)(c.Z,{sx:{flex:1},children:[(0,I.jsx)(V.Z,{label:"Blocklet ".concat(k("common.title")),placeholder:"Blocklet ".concat(k("common.title")),InputProps:{"data-cy":"blocklet-title",readOnly:be},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:E.blockletTitle||"",onChange:function(e){w({blockletTitle:""}),R({blockletTitle:e.target.value})},error:!!N.blockletTitle,helperText:N.blockletTitle||""}),(0,I.jsx)(V.Z,{label:"Blocklet ".concat(k("common.description")),placeholder:"Blocklet ".concat(k("common.description")),InputProps:{"data-cy":"blocklet-description",readOnly:be},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:E.blockletDescription||"",onChange:function(e){w({blockletDescription:""}),R({blockletDescription:e.target.value})},error:!!N.blockletDescription,helperText:N.blockletDescription||"",sx:{mt:3}}),(0,I.jsx)(V.Z,{label:"Blocklet ".concat(k("common.introduction")),placeholder:"Blocklet ".concat(k("common.introduction")),InputProps:{"data-cy":"export-blocklet-introduction",readOnly:be,endAdornment:(0,I.jsxs)(O.Z,{position:"end",children:[(null===E||void 0===E||null===(t=E.blockletIntroduction)||void 0===t?void 0:t.length)||0," / ",Y.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:E.blockletIntroduction||"",onChange:function(e){w({blockletIntroduction:""}),R({blockletIntroduction:e.target.value.slice(0,Y.PROJECT.MAX_INTRO_LENGTH)})},error:!!N.blockletIntroduction,helperText:N.blockletIntroduction||"",sx:{mt:3}})]})]}),(0,I.jsxs)(c.Z,{display:"flex",mt:3,className:"section",children:[(0,I.jsx)(A.Z,{variant:"h3",className:"left",children:k("blocklet.publish.versionTitle")}),(0,I.jsxs)(c.Z,{sx:{flex:1},children:[(0,I.jsx)(V.Z,{required:!0,label:"Blocklet ".concat(k("common.version")),placeholder:"Blocklet ".concat(k("common.version")),InputProps:{"data-cy":"blocklet-version",readOnly:be},autoComplete:"off",variant:"outlined",fullWidth:!0,value:E.blockletVersion,onChange:function(e){w({blockletVersion:""}),R({blockletVersion:e.target.value})},error:!!N.blockletVersion,helperText:N.blockletVersion||""}),(0,I.jsx)(V.Z,{label:k("blocklet.publish.releaseNote"),autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:be,endAdornment:(0,I.jsxs)(O.Z,{position:"end",children:[(null===E||void 0===E||null===(o=E.note)||void 0===o?void 0:o.length)||0," / ",Y.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:E.note,onChange:function(e){w({note:""}),R({note:e.target.value.slice(0,Y.PROJECT.MAX_NOTE_LENGTH)})},error:!!N.note,helperText:N.note||"",sx:{mt:3}})]})]}),(0,I.jsxs)(c.Z,{display:"flex",mt:3,className:"section full-width",children:[(0,I.jsx)(A.Z,{variant:"h3",className:"left",children:k("blocklet.publish.imgTitle")}),(0,I.jsxs)(c.Z,{sx:{flex:1},children:[(0,I.jsxs)(c.Z,{display:"flex",children:[(0,I.jsx)(A.Z,{variant:"subtitle1",sx:{mr:2},children:k("common.logo")}),(0,I.jsx)(c.Z,{sx:{flex:1,cursor:be?"default":"pointer"},children:(0,I.jsx)(se.Z,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:ke,onClick:function(){return!be&&J.current.open()}})})]}),(0,I.jsxs)(c.Z,{display:"flex",mt:3,children:[(0,I.jsx)(A.Z,{variant:"subtitle1",sx:{mr:2},children:k("common.screenshot")}),(0,I.jsxs)(c.Z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[ge.map((function(e,n){return(0,I.jsxs)(c.Z,{className:"screenshot",children:[(0,I.jsx)("img",{alt:"screenshot",src:e}),!be&&(0,I.jsx)(u.Z,{className:"action",onClick:function(){var e=(0,te.Z)(E.blockletScreenshots);e.splice(n,1),R({blockletScreenshots:e})},children:(0,I.jsx)(de.default,{})})]})})),ge.length<5&&(0,I.jsx)(c.Z,{sx:{width:200,height:140,background:"#eee",cursor:be?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:function(){return!be&&K.current.open()},children:"+"})]})]})]}),(0,I.jsx)(Fe,{id:"\u200buploader-logo",ref:J,popup:!0,onUploadFinish:function(e){R({blockletLogo:e.data.filename}),J.current.close()},plugins:[],apiPathProps:{uploader:Ze,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:Me,maxFileSize:Ue,maxNumberOfFiles:1}}},"uploader-logo"),(0,I.jsx)(Fe,{id:"\u200buploader-screenshot",ref:K,popup:!0,onUploadFinish:function(e){var n,t=E.blockletScreenshots||[];t.push(null===(n=e.data)||void 0===n?void 0:n.filename),R({blockletScreenshots:t}),K.current.close()},plugins:[],apiPathProps:{uploader:je,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:Me,maxFileSize:Ue,maxNumberOfFiles:5-ge.length}}},"uploader-screenshot")]}),(0,I.jsxs)(c.Z,{display:"flex",mt:3,className:"section full-width",children:[(0,I.jsx)(c.Z,{className:"left",children:(0,I.jsx)(A.Z,{variant:"h3",children:k("blocklet.publish.resourceTitle")})}),(0,I.jsxs)(c.Z,{sx:{flex:1},children:[(0,I.jsx)(pe.Z,{tabs:ee,current:ce,onChange:function(e){he(e)},sx:{ml:-2,mt:-1.5}}),(0,I.jsx)(c.Z,{children:Te})]})]})]})]}))}Je.propTypes={},Je.defaultProps={};var Ke,Ge=i.Z.div(De||(De=(0,o.Z)(["\n .sticky-header {\n margin-top: -12px;\n padding: 12px 0;\n position: sticky;\n top: 0;\n z-index: 99;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background-color: #fff;\n padding-bottom: 12px;\n border-bottom: ",";\n }\n .screenshot {\n margin-bottom: 16px;\n max-width: 200px;\n max-height: 140px;\n width: 200px;\n height: 140px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #eee;\n margin-right: 16px;\n position: relative;\n .action {\n visibility: hidden;\n position: absolute;\n top: 0px;\n right: 0px;\n background-color: rgba(0, 0, 0, 0.2);\n color: rgba(255, 255, 255, 0.8);\n }\n &:hover .action {\n visibility: visible;\n }\n }\n .screenshot img {\n width: 100%; /* \u56fe\u50cf\u5bbd\u5ea6\u586b\u5145\u5bb9\u5668 */\n height: auto; /* \u56fe\u50cf\u9ad8\u5ea6\u81ea\u9002\u5e94 */\n }\n .section {\n max-width: 800px;\n &.full-width {\n max-width: 100%;\n }\n .MuiTypography-h3 {\n font-size: 1.1rem;\n font-weight: 700;\n }\n .left {\n flex-shrink: 0;\n width: 140px;\n }\n .MuiTabs-indicator {\n display: none;\n }\n .MuiTypography-subtitle1 {\n width: 120px;\n font-weight: 700;\n font-size: 1rem;\n "," {\n width: 80px;\n }\n }\n }\n .MuiButtonBase-root {\n a {\n color: inherit;\n }\n }\n .MuiInputBase-multiline .MuiInputAdornment-positionEnd {\n align-self: flex-end;\n .MuiTypography-root {\n font-size: 0.8rem;\n }\n font-size: 0.8rem;\n }\n"])),(function(e){var n=e.theme;return"1px solid ".concat(n.palette.divider)}),(function(e){return e.theme.breakpoints.down("sm")}));function Qe(){return(0,I.jsx)(Ye,{children:(0,I.jsxs)(r.Routes,{children:[(0,I.jsx)(r.Route,{path:"/",element:(0,I.jsx)(N,{})}),(0,I.jsx)(r.Route,{path:"/create",element:(0,I.jsx)(U,{})}),(0,I.jsx)(r.Route,{path:"/:projectId",element:(0,I.jsx)($,{})}),(0,I.jsx)(r.Route,{path:"/:projectId/:releaseId",element:(0,I.jsx)(Je,{})})]})})}Qe.propTypes={};var Ye=(0,i.Z)(c.Z)(Ke||(Ke=(0,o.Z)(["\n a {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main}))},36558:function(e,n,t){var o=t(33028),l=t(59740),r=t(24974),i=t.n(r),c=t(86822),a=t(19638),s=t(23586),d=t(37574),u=["did","href","external","avatarProps"];function p(e){var n=e.did,t=e.href,r=e.external,i=(e.avatarProps,(0,l.Z)(e,u)),p=(0,d.jsx)(s.Z,(0,o.Z)({did:n},i));return t?r?(0,d.jsx)(a.Z,{target:"_blank",href:t,underline:"hover",children:p}):(0,d.jsx)(c.rU,{to:t,children:p}):p}p.propTypes={did:i().string.isRequired,to:i().string,href:i().string,avatarProps:i().object,external:i().bool},p.defaultProps={to:"",href:"",avatarProps:{},external:!1},n.Z=p}}]);
|
|
2
|
+
//# sourceMappingURL=6139.cabc22a2.chunk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[6658],{26658:function(e,n,s){"use strict";s.r(n),s.d(n,{default:function(){return k}});var t,o=s(71171),r=s(32723),c=s(34795),a=s(30969),i=s(16380),l=s(30734),u=s(94308),f=s(238),d=s(1986),p=s(31575),x=s(26022),h=s(20244),w=s(85752),g=s(37574);var v=(0,w.Z)((function(e){var n=e.SessionContext,s=e.webWalletUrl,t=e.onSuccess,o=(0,a.useContext)(n),i=o.api,w=o.session,v=(0,x.PE)(),Z=v.t,b=v.locale,k=(0,l.useNavigate)(),P=new URL(window.location.href).searchParams,_=P.get("redirect"),j=function(){var e=(0,c.Z)((0,r.Z)().mark((function e(n,s){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(n,s),e.next=3,w.refresh();case 3:d.Z.success(Z("exchangePassport.success")),setTimeout((function(){if(_){var e=decodeURIComponent(_);e.startsWith(h.WELLKNOWN_SERVICE_PATH_PREFIX)?k(e,{replace:!0}):window.location=e}else window.location=window.env.pathPrefix||window.env.apiPrefix||"/"}),3e3);case 5:case"end":return e.stop()}}),e)})));return function(n,s){return e.apply(this,arguments)}}(),C={},I=P.get("componentId");return I&&(C.componentId=I),w.loading?(0,g.jsx)(f.Z,{children:(0,g.jsx)(u.Z,{})}):(0,g.jsx)(m,{children:(0,g.jsx)("div",{className:"connect-wrapper",children:(0,g.jsx)(p.Z,{className:"connect",action:"exchange-passport",checkFn:i.get,checkTimeout:6e5,webWalletUrl:s,onSuccess:j,onError:function(e){d.Z.error(e.message)},locale:b,messages:{title:Z("exchangePassport.dialog.title"),scan:Z("exchangePassport.dialog.scan"),confirm:Z("exchangePassport.dialog.confirm"),success:Z("exchangePassport.dialog.success")},extraParams:C,extraContent:null})})})})),m=i.Z.div(t||(t=(0,o.Z)(["\n box-sizing: border-box;\n width: 100%;\n height: 100vh;\n position: relative;\n display: flex;\n flex-direction: column;\n .connect-wrapper {\n flex: 1;\n }\n .connect {\n background: #fafafa;\n }\n"]))),Z=s(4485),b=s(38507);function k(){var e=(0,b.yP)();return(0,g.jsx)(v,{SessionContext:Z.B3,webWalletUrl:e,onSuccess:function(e,n){e.sessionToken&&((0,b.ZB)(n(e.sessionToken)),(0,b.zI)(n(e.refreshToken)))}})}},19477:function(e,n,s){var t=s(2717),o=s(37095),r=s(93113);e.exports={translations:{zh:t(r),en:t(o)}}},85752:function(e,n,s){"use strict";s.d(n,{Z:function(){return a}});var t=s(33028),o=s(26022),r=s(19477),c=s(37574);function a(e){return function(n){return(0,c.jsx)(o.Iw,{translations:r.translations,children:(0,c.jsx)(e,(0,t.Z)({},n))})}}}}]);
|
|
2
|
+
//# sourceMappingURL=6658.090d923f.chunk.js.map
|