@abtnode/blocklet-services 1.16.44-beta-20250526-130644-5e05dc90 → 1.16.44-beta-20250528-003415-7a5e5d90
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/services/auth/index.js +4 -0
- package/dist/assets/{AdapterDayjs-Bs_Q9JXL.js → AdapterDayjs-gCvKcGfu.js} +1 -1
- package/dist/assets/{ArrowDropDown-DUn14Acv.js → ArrowDropDown-D32FY-Mt.js} +1 -1
- package/dist/assets/{CheckCircle-DsdIIzds.js → CheckCircle-BBSSDlcc.js} +1 -1
- package/dist/assets/{ChevronLeft-BXDIS6AE.js → ChevronLeft-CF24ouxR.js} +1 -1
- package/dist/assets/{ChevronRight-BfSAowju.js → ChevronRight-DA9t_C-l.js} +1 -1
- package/dist/assets/{DeleteOutline-lCPjjhKz.js → DeleteOutline-CzIOFoFP.js} +1 -1
- package/dist/assets/{Done-BoNuG9Iy.js → Done-MQdb8YLa.js} +1 -1
- package/dist/assets/{Download-4NCgy4QK.js → Download-IxxF4Ujs.js} +1 -1
- package/dist/assets/{Edit-BqpcPg9o.js → Edit-DSht16TX.js} +1 -1
- package/dist/assets/{Error-B7SzGNr8.js → Error-CkoCqY66.js} +1 -1
- package/dist/assets/{ExpandLess-EFI-Ij5Y.js → ExpandLess-CudE_1oQ.js} +1 -1
- package/dist/assets/{Google-DYpd3dQM.js → Google-AZBuQJFI.js} +1 -1
- package/dist/assets/{Home-Ccm-s4KT.js → Home-BaA3V3I7.js} +1 -1
- package/dist/assets/{InfoOutlined-Duq1UDPu.js → InfoOutlined-Cd28U1Oc.js} +1 -1
- package/dist/assets/{Launch-ipC6Ic2p.js → Launch-Ddo_WSQI.js} +1 -1
- package/dist/assets/{LaunchOutlined-C-M166rt.js → LaunchOutlined-CO4dugwH.js} +1 -1
- package/dist/assets/{MoreHoriz-jwSUI8G2.js → MoreHoriz-D-L8sA4c.js} +1 -1
- package/dist/assets/{PlayArrow-Cv1uXXJt.js → PlayArrow-CLKgdv6H.js} +1 -1
- package/dist/assets/{TuneOutlined-BvxrpP1M.js → TuneOutlined-BWqIZK2m.js} +1 -1
- package/dist/assets/{ViewList-PrXAmQts.js → ViewList-DWudZTBg.js} +1 -1
- package/dist/assets/access-control-DlT-JQML.js +14 -0
- package/dist/assets/{actions-BA8hCarh.js → actions-azdiYocL.js} +1 -1
- package/dist/assets/{add-component-core-RTpy3oS3.js → add-component-core-Cm8Y0zkt.js} +13 -13
- package/dist/assets/{add-resource-DKnJ3N_A.js → add-resource-CVCoahx_.js} +1 -1
- package/dist/assets/{addon-DmglQWiB.js → addon-3ZMGwARO.js} +1 -1
- package/dist/assets/{advanced-CzssFl-I.js → advanced-Nvg1CqJg.js} +1 -1
- package/dist/assets/{appearance-DIaCQMdO.js → appearance-CAsFMLaC.js} +1 -1
- package/dist/assets/{audit-logs-BwUEGKxZ.js → audit-logs-BPjUleS-.js} +3 -3
- package/dist/assets/{authorize-DqVeyhPc.js → authorize-CdTK5Air.js} +1 -1
- package/dist/assets/{base32-D35YSxth.js → base32-CLrnUJal.js} +1 -1
- package/dist/assets/{branding-D9cgoVZN.js → branding-B8r8EJ2R.js} +2 -2
- package/dist/assets/{branding-yRBlkhNg.js → branding-Cr4GBUXi.js} +1 -1
- package/dist/assets/{bundle-avatar-BP8xFngr.js → bundle-avatar-Br48PGS5.js} +1 -1
- package/dist/assets/{button-Da_a32NC.js → button-8G90WP8a.js} +1 -1
- package/dist/assets/click-to-copy-ByEMWZD_.js +1 -0
- package/dist/assets/{collapse-BF9pIOsL.js → collapse-Cliwxlbv.js} +1 -1
- package/dist/assets/{complete-BFgID4Zc.js → complete-CzlLydJT.js} +2 -2
- package/dist/assets/{component-ESUBkOno.js → component-5_wmVxpp.js} +1 -1
- package/dist/assets/{config-rMbgmGkF.js → config-BnObxTpi.js} +1 -1
- package/dist/assets/{config-Bt_JcEZR.js → config-emhMgKqq.js} +1 -1
- package/dist/assets/{config-navigation-Dyu8rgOf.js → config-navigation-DbyhYIMw.js} +3 -3
- package/dist/assets/config-space-TsP5osn9.js +1 -0
- package/dist/assets/{confirm-CiiHIA-a.js → confirm-DI8TUyRK.js} +1 -1
- package/dist/assets/connect-B_BnGQjp.js +1 -0
- package/dist/assets/connect-D55qWQWC.js +5 -0
- package/dist/assets/connect-to-DzPwhREN.js +1 -0
- package/dist/assets/{dashboard-vkFEu-wZ.js → dashboard-AdC8-kkA.js} +3 -3
- package/dist/assets/{delete-confirm-BPtFZ4JP.js → delete-confirm-Bn1HZjaL.js} +1 -1
- package/dist/assets/{did-address-BtAnHi7m.js → did-address-BlAXR08O.js} +1 -1
- package/dist/assets/domain-Cod_zL8_.js +9 -0
- package/dist/assets/{domain-action-card-CEIB4y6O.js → domain-action-card-C4FpSn67.js} +2 -2
- package/dist/assets/domains-BhqtMbC1.js +1 -0
- package/dist/assets/dot-itVN8XTt.js +7 -0
- package/dist/assets/{email-D6f0kuZJ.js → email-CqVIYJc4.js} +2 -2
- package/dist/assets/exchange-passport-C-hTCqg0.js +1 -0
- package/dist/assets/{fuel-BzVicj7n.js → fuel-M5L6Wmxz.js} +1 -1
- package/dist/assets/{gen-access-key-DiLTrx9k.js → gen-access-key-D6jr4e_G.js} +1 -1
- package/dist/assets/get-safe-url-CRv5HbAK.js +1 -0
- package/dist/assets/get-safe-url-DrR-6D-i.js +1 -0
- package/dist/assets/{home-AVCu7DmN.js → home-C7e6Ftxj.js} +1 -1
- package/dist/assets/{iframe-CJ1Wo1WH.js → iframe-DSG-Hd99.js} +1 -1
- package/dist/assets/{index-99E5Ux4J.js → index-AetYfL_f.js} +1 -1
- package/dist/assets/{index-Biu0_3VS.js → index-B5_fBwtl.js} +9 -9
- package/dist/assets/{index-IuBCAZn2.js → index-BFWnCQrF.js} +1 -1
- package/dist/assets/{index-BhMu-yLO.js → index-BJHSgjnI.js} +14 -14
- package/dist/assets/{index-CCsDojsm.js → index-BJbAX71g.js} +7 -7
- package/dist/assets/{index-CG5aY0sO.js → index-BLbU4gf9.js} +2 -2
- package/dist/assets/index-BM1ZGOPs.js +55 -0
- package/dist/assets/{index-DeD4o13y.js → index-BUrgmCmL.js} +1 -1
- package/dist/assets/{index-nhpGyAFA.js → index-Bj2-CpPI.js} +2 -2
- package/dist/assets/{index-XdA5ax9j.js → index-C2F-GVrD.js} +4 -4
- package/dist/assets/{index-CVeug3aj.js → index-C4vmLohg.js} +1 -1
- package/dist/assets/index-CEeLwMYO.js +113 -0
- package/dist/assets/{index-CkuD5Vfn.js → index-CtLialsm.js} +6 -6
- package/dist/assets/{index-Cj_-M8SX.js → index-DSoHmrHd.js} +1 -1
- package/dist/assets/index-DthGrDK3.js +1 -0
- package/dist/assets/{index-DJzuhKQh.js → index-YbYWmpAT.js} +4 -4
- package/dist/assets/{index-8lA5-nM7.js → index-bIHubQ8z.js} +3 -3
- package/dist/assets/{index-hO3Mo-qi.js → index-iQsPOXlb.js} +1 -1
- package/dist/assets/{index-BDhncHq5.js → index-rn2nf2kX.js} +2 -2
- package/dist/assets/{index-Jryn5flm.js → index-yvg4DpNi.js} +10 -10
- package/dist/assets/{invitation-CbZcjplG.js → invitation-StUiuLYU.js} +5 -5
- package/dist/assets/invite-E96eT2DF.js +1 -0
- package/dist/assets/{issue-passport-3aP4u6AF.js → issue-passport-DrGPTNsG.js} +1 -1
- package/dist/assets/item-Dgu9vLko.js +2 -0
- package/dist/assets/{landing-page-B3KyXZXw.js → landing-page-BOy_W1aP.js} +1 -1
- package/dist/assets/{layout-BzSCNNrb.js → layout-CYJJYqb_.js} +1 -1
- package/dist/assets/list-C8X2Voou.js +2 -0
- package/dist/assets/{list-D29W3nMj.js → list-uPz9xAWJ.js} +5 -5
- package/dist/assets/localization-CI5Q0B2F.js +1 -0
- package/dist/assets/{log-D5wtGlYv.js → log-CzRRb9lq.js} +1 -1
- package/dist/assets/{logger-DTzDRWqY.js → logger-B4ZKcD6x.js} +1 -1
- package/dist/assets/login-D3GnBJn4.js +1 -0
- package/dist/assets/{login-oauth-callback-DjqRVYt8.js → login-oauth-callback-CVS9TwNM.js} +1 -1
- package/dist/assets/{logo-uploader-B-RJuXxH.js → logo-uploader-CbM-N8qP.js} +3 -3
- package/dist/assets/{lost-passport-n3UXYXA8.js → lost-passport-5P2EFbv0.js} +2 -2
- package/dist/assets/{open-window-Dyr68wBS.js → open-window-c9TGr49M.js} +1 -1
- package/dist/assets/{overview-C2L5ReTa.js → overview-BZRXhA-K.js} +2 -2
- package/dist/assets/{page-header-BS-digIw.js → page-header-D_m0ANZl.js} +1 -1
- package/dist/assets/{passport-item-B9iOvD4Y.js → passport-item-DE-9Q-Cx.js} +1 -1
- package/dist/assets/{permission-CbTKdC7W.js → permission-fpFyADH8.js} +1 -1
- package/dist/assets/{preferences-DETzTJeF.js → preferences-0RYr2e_y.js} +1 -1
- package/dist/assets/{profile-embed-7uAZGWnU.js → profile-embed-BwbGy3El.js} +1 -1
- package/dist/assets/{publish-resource-Bk1sOsMC.js → publish-resource-CWz86TY0.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-WW1RMrIr.js → react-beautiful-dnd.esm-G9cRB9Uf.js} +1 -1
- package/dist/assets/{runtime-CA329eRU.js → runtime-63aIXcah.js} +1 -1
- package/dist/assets/sdk-D4BoQHdn.js +1 -0
- package/dist/assets/{security-BYPCwU9I.js → security-YPRPQuQL.js} +4 -4
- package/dist/assets/{session-ugMCR4Iu.js → session-Djj2U6sa.js} +1 -1
- package/dist/assets/setup-C9DGbmM7.js +30 -0
- package/dist/assets/{spaces-CTEbtAyX.js → spaces-fGcGlx-U.js} +1 -1
- package/dist/assets/start-Cz_j6UYt.js +187 -0
- package/dist/assets/{starting-progress-Dvw39Hou.js → starting-progress-DHv9oucO.js} +1 -1
- package/dist/assets/{status-CH0vjcu4.js → status-B5ff49WY.js} +1 -1
- package/dist/assets/{step-actions-QyMIKyQA.js → step-actions-CPiUgWLW.js} +1 -1
- package/dist/assets/{studio-B1PGcNac.js → studio-DnKLD9XD.js} +1 -1
- package/dist/assets/{switch-control-D5eJVUaV.js → switch-control-DWjnOuBy.js} +1 -1
- package/dist/assets/{table-tips-biAHyN1z.js → table-tips-DEGQUNJa.js} +1 -1
- package/dist/assets/{traffic-DVUW14yF.js → traffic-C262RTgV.js} +1 -1
- package/dist/assets/{transfer-CsdMd63R.js → transfer-CXfjw5Xg.js} +1 -1
- package/dist/assets/unsubscribe-CdFXzPwR.js +1 -0
- package/dist/assets/{use-blocklet-logo-a8QJI4r-.js → use-blocklet-logo-C_pDvfYN.js} +2 -2
- package/dist/assets/use-server-logo-CxuMvwKh.js +1 -1
- package/dist/assets/useAsync-510ntT1B.js +1 -0
- package/dist/assets/{useLocalStorage-BDA4jbwL.js → useLocalStorage-DO6t2PeQ.js} +1 -1
- package/dist/assets/{user-center-BQcfE646.js → user-center-DR1kV4iN.js} +3 -3
- package/dist/assets/{util-BwAoiA7E.js → util-Cs-QbPU0.js} +1 -1
- package/dist/assets/{util-D-q3oYk9.js → util-VM27PwRk.js} +1 -1
- package/dist/assets/{vendor-arcblock-5qqHEVGo.js → vendor-arcblock-DuPySS9V.js} +85 -85
- package/dist/assets/{vendor-ux-did-connect-DROQhYpS.js → vendor-ux-did-connect-DIlRfE_S.js} +113 -113
- package/dist/assets/{wrap-locale-CvN5krOj.js → wrap-locale-BWx2hEb7.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +29 -29
- package/dist/assets/access-control-Dvlg7x0h.js +0 -14
- package/dist/assets/click-to-copy-B26zKr7i.js +0 -1
- package/dist/assets/config-space-D2Cjeyk0.js +0 -1
- package/dist/assets/connect-Druwkt_h.js +0 -1
- package/dist/assets/connect-QKA3Mcyx.js +0 -5
- package/dist/assets/connect-to-BLuNgRR8.js +0 -1
- package/dist/assets/domain-CSsoH0JI.js +0 -9
- package/dist/assets/domains-DySxSy7r.js +0 -1
- package/dist/assets/dot-DX56IFTM.js +0 -7
- package/dist/assets/exchange-passport-CyZiYD_w.js +0 -1
- package/dist/assets/get-safe-url-CiQ8_q49.js +0 -1
- package/dist/assets/get-safe-url-DSt3eVbO.js +0 -1
- package/dist/assets/index-B7Ih-tce.js +0 -55
- package/dist/assets/index-CpRFDVw4.js +0 -113
- package/dist/assets/index-D_aS7-BV.js +0 -1
- package/dist/assets/invite-CG68Mxoz.js +0 -1
- package/dist/assets/item-DLwktWNI.js +0 -2
- package/dist/assets/list-y33VQBpr.js +0 -2
- package/dist/assets/localization-Y6Zfd1Kb.js +0 -1
- package/dist/assets/login-Bq9K3qHu.js +0 -1
- package/dist/assets/sdk-Bxy9kDUo.js +0 -1
- package/dist/assets/setup-BuHGJK0U.js +0 -30
- package/dist/assets/start-Df7Wiv2W.js +0 -187
- package/dist/assets/unsubscribe-1jeXeeTi.js +0 -1
- package/dist/assets/useAsync-Dv214fz8.js +0 -1
- package/dist/assets/useAsync-KYUBhVsb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as B,j as h}from"./vendor-mui-core-BV2FUxWJ.js";import{l as L,r}from"./vendor-react-DEoibe3W.js";import{A as W,E as A}from"./vendor-utils-rHXShPKm.js";import{a as O,
|
|
1
|
+
import{v as B,j as h}from"./vendor-mui-core-BV2FUxWJ.js";import{l as L,r}from"./vendor-react-DEoibe3W.js";import{A as W,E as A}from"./vendor-utils-rHXShPKm.js";import{a as O,ao as T}from"./vendor-ux-did-connect-DIlRfE_S.js";import{m as w,u as _,s as F}from"./vendor-hooks-BgUTpb6X.js";import{A as K,S as $}from"./add-component-core-Cm8Y0zkt.js";import{k as z,U as G}from"./index-YbYWmpAT.js";import"./lottie-web-jYmAQWuC.js";import"./item-Dgu9vLko.js";import"./vendor-arcblock-DuPySS9V.js";import"./index-8eXqqyHQ.js";import"./Launch-Ddo_WSQI.js";import"./Done-MQdb8YLa.js";import"./DeleteOutline-CzIOFoFP.js";import"./delete-confirm-Bn1HZjaL.js";import"./click-to-copy-ByEMWZD_.js";import"./confirm-DI8TUyRK.js";import"./session-Djj2U6sa.js";import"./get-safe-url-DrR-6D-i.js";import"./did-address-BlAXR08O.js";import"./launch-result-message-FuvJDCvp.js";import"./page-header-D_m0ANZl.js";import"./config-space-TsP5osn9.js";import"./spaces-fGcGlx-U.js";import"./api-BjteVZFg.js";import"./logo-uploader-CbM-N8qP.js";import"./index-DVQCgvFb.js";import"./index-rn2nf2kX.js";import"./collapse-Cliwxlbv.js";import"./Google-AZBuQJFI.js";import"./cloneDeep-UpFQ2VNg.js";import"./index-RsjqbOR7.js";import"./index-Bs1kxR8_.js";import"./index-DSoHmrHd.js";import"./useLocalStorage-DO6t2PeQ.js";import"./util-Cs-QbPU0.js";import"./use-mobile-C21X4TYN.js";import"./content-layout-fV4nyVb5.js";import"./connect-to-DzPwhREN.js";import"./ArrowDropDown-D32FY-Mt.js";import"./ChevronLeft-CF24ouxR.js";import"./ChevronRight-DA9t_C-l.js";function Be(){var u;const{t:f}=O(),{blocklet:i}=z(),{componentDid:s}=L(),g=B(e=>e.breakpoints.down("md")),o=new URL(window.location.href),C=o.searchParams.get("mode")==="dialog",c=o.searchParams.get("resourceType")||"",p=o.searchParams.get("resourceDid")||s,R=o.searchParams.get("store")||"",E=o.searchParams.get("showFromUrl")!=="false",S=o.searchParams.get("showResourcesSwitch")!=="false",y=o.searchParams.get("enableRunBackground")!=="false",P=o.searchParams.get("showCategory")!=="false",n=(u=i==null?void 0:i.meta)==null?void 0:u.did,m=R.split(",").filter(Boolean).map(e=>{try{return new URL(e.startsWith("http")?e:`https://${e}`).origin}catch(t){return console.error(t),null}}).filter(Boolean),[D,U]=r.useState(m.map(e=>({url:e,name:e.replace("https://","")}))),[b,x]=r.useState(null),[j,M]=r.useState("");r.useEffect(()=>{(async()=>{try{const e=await Promise.all(m.map(async t=>{const a=W(t,"/api/store.json"),{data:v}=await A.get(a);return{url:t,name:v.name}}));U(e||[])}catch(e){console.error(e)}})()},[m.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const e=G();return n&&e.connect(),()=>{n&&e.isConnected()&&e.disconnect()}},[n]),w(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const l=_(e=>{var t,a;((t=e.data)==null?void 0:t.event)==="resourceDialog.select"&&((a=e.data)==null?void 0:a.componentDid)===s&&(x(e.data.data),M(e.data.storeUrl))});w(()=>{window.addEventListener("message",l)}),F(()=>{window.removeEventListener("message",l)});const d=({inDialog:e=!0}={})=>h.jsx(K,{stores:D,selectedMeta:b,storeUrl:j,resourceType:c,resourceDid:p,mode:"embed",inDialog:e,storageKey:$(`${c}+${p}`),showResourcesSwitch:S,showFromUrl:E,enableRunBackground:y,showCategory:P});return C?h.jsx(T,{className:"resource-dialog",title:f("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:g?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,t)=>{t!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:d()}):d({inDialog:!1})}export{Be as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,u as M}from"./vendor-react-DEoibe3W.js";import{j as e,I as b,H as o,ah as r}from"./vendor-mui-core-BV2FUxWJ.js";import{
|
|
1
|
+
import{r as t,u as M}from"./vendor-react-DEoibe3W.js";import{j as e,I as b,H as o,ah as r}from"./vendor-mui-core-BV2FUxWJ.js";import{b4 as g,n as f,L as H}from"./vendor-ux-did-connect-DIlRfE_S.js";import{T as Z}from"./vendor-arcblock-DuPySS9V.js";import{Q as j}from"./QuestionMarkCircle-DTGyWFVS.js";var a=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60567 17.3203C7.38971 16.9661 7.19606 16.5686 7.02468 16.1402C6.86016 15.7289 6.7127 15.2804 6.58436 14.801C6.01415 15.0849 5.48171 15.439 4.99946 15.855C5.7556 16.5015 6.63848 17.004 7.60567 17.3203ZM8.26264 15.645C8.10246 15.2446 7.95842 14.7971 7.83425 14.3104C8.53612 14.104 9.26539 13.9991 9.9998 14H10.0015C10.7359 13.9991 11.4652 14.104 12.167 14.3104C12.0429 14.7971 11.8988 15.2446 11.7386 15.645C11.4556 16.3525 11.1353 16.8804 10.8137 17.2204C10.4935 17.559 10.2185 17.6667 10.0006 17.6667C9.78281 17.6667 9.50783 17.559 9.18757 17.2204C8.86599 16.8804 8.54566 16.3525 8.26264 15.645ZM10.0007 12.6667C10.8258 12.6657 11.6453 12.7785 12.4365 13.0005C12.5533 12.274 12.6295 11.49 12.6565 10.6666H7.34483C7.37175 11.49 7.448 12.274 7.56482 13.0006C8.35599 12.7785 9.17556 12.6657 10.0007 12.6667ZM7.34483 9.33331C7.37175 8.50999 7.448 7.72596 7.56482 6.99945C8.35598 7.22152 9.17556 7.33433 10.0007 7.33334C10.8258 7.33433 11.6453 7.22153 12.4365 6.99947C12.5533 7.72597 12.6295 8.51 12.6565 9.33331H7.34483ZM13.9905 10.6666C13.9603 11.6495 13.8639 12.5916 13.7104 13.4645C14.5207 13.8311 15.2715 14.3159 15.9385 14.9026C16.9065 13.7315 17.5347 12.2691 17.6722 10.6666H13.9905ZM17.6721 9.33331H13.9904C13.9603 8.35043 13.8639 7.40842 13.7104 6.5355C14.5207 6.16891 15.2715 5.68412 15.9385 5.09743C16.9065 6.26854 17.5347 7.73084 17.6721 9.33331ZM19.0006 10.0017C18.9997 14.9715 14.9706 19 10.0006 19H10.0006C5.03005 19 1.00061 14.9706 1.00061 10C1.00061 9.99999 1.00061 9.99999 1.00061 9.99998C1.00062 5.02943 5.03005 1 10.0006 1C14.9712 1 19.0006 5.02944 19.0006 10C19.0006 10.0006 19.0006 10.0011 19.0006 10.0017ZM2.32907 9.33331C2.46651 7.73082 3.09476 6.2685 4.0628 5.09738C4.72975 5.68407 5.48055 6.16888 6.29084 6.53548C6.13742 7.40841 6.041 8.35042 6.01083 9.33331H2.32907ZM2.32907 10.6666H6.01083C6.04099 11.6496 6.13742 12.5916 6.29084 13.4645C5.48055 13.8311 4.72975 14.3159 4.06281 14.9026C3.09475 13.7315 2.46649 12.2692 2.32907 10.6666ZM12.9766 16.1402C13.1411 15.7289 13.2886 15.2804 13.4169 14.8009C13.9871 15.0849 14.5196 15.4389 15.0018 15.8549C14.2457 16.5014 13.3628 17.004 12.3956 17.3202C12.6116 16.9661 12.8052 16.5686 12.9766 16.1402ZM12.3956 2.67976C13.3628 2.996 14.2457 3.49858 15.0018 4.14508C14.5196 4.56106 13.9871 4.91516 13.4169 5.19908C13.2886 4.71963 13.1411 4.2711 12.9766 3.85979C12.8052 3.43137 12.6116 3.03387 12.3956 2.67976ZM11.7386 4.355C11.8988 4.75545 12.0429 5.20292 12.167 5.68962C11.4652 5.89603 10.7359 6.00096 10.0015 6.00001H9.9998C9.26539 6.00096 8.53612 5.89602 7.83424 5.68961C7.95841 5.20291 8.10246 4.75544 8.26264 4.355C8.54566 3.64747 8.86599 3.11964 9.18757 2.7796C9.50783 2.44096 9.78281 2.33333 10.0006 2.33333C10.2185 2.33333 10.4935 2.44096 10.8137 2.7796C11.1353 3.11964 11.4556 3.64747 11.7386 4.355ZM7.02468 3.85979C6.86015 4.2711 6.71269 4.71961 6.58436 5.19906C6.01414 4.91513 5.4817 4.56103 4.99945 4.14504C5.7556 3.49854 6.63848 2.99596 7.60567 2.67973C7.38971 3.03385 7.19606 3.43136 7.02468 3.85979Z",fill:"currentColor"})})};a.defaultProps={width:"21",height:"20",viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg"};a.displayName="globe";const k=a;function l({SessionContext:s,extraItems:C,showLocale:c,showHelper:i,showSessionManager:p,sessionManagerProps:d}){const{session:w}=t.useContext(s),{locale:h}=t.useContext(g),u=M(),x=()=>{if(u.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[C.map((n,m)=>t.cloneElement(n,{key:m})),c&&e.jsx(y,{"data-cy":"locale-addon",icon:k,size:23,showText:!1,className:"locale-addon"}),e.jsx(Z,{}),i&&e.jsx(b,{onClick:x,children:e.jsx(j,{})}),p&&e.jsx(v,{locale:h,session:w,size:24,showRole:!0,...d,showManageBlocklet:!1})]})}l.propTypes={SessionContext:o.object.isRequired,webWalletUrl:o.string,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};l.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};const v=r(f)`
|
|
2
2
|
.user-addon {
|
|
3
3
|
.user-avatar {
|
|
4
4
|
width: 28px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as Ee,e as ze}from"./vendor-react-DEoibe3W.js";import{a9 as bt,j as q,ab as We,H as Oe,aa as U,y as hr,T as Be,ah as _t,bs as dr,bR as mr,bx as pr,ak as gr,E as vr,al as er,O as yr,N as br,bt as gt,X as qe}from"./vendor-mui-core-BV2FUxWJ.js";import{D as Je,G as _r,f as wr,aK as xr,n as Mr,aC as $r,z as Yt,W as tr,V as rr}from"./index-
|
|
1
|
+
import{r as Ee,e as ze}from"./vendor-react-DEoibe3W.js";import{a9 as bt,j as q,ab as We,H as Oe,aa as U,y as hr,T as Be,ah as _t,bs as dr,bR as mr,bx as pr,ak as gr,E as vr,al as er,O as yr,N as br,bt as gt,X as qe}from"./vendor-mui-core-BV2FUxWJ.js";import{D as Je,G as _r,f as wr,aK as xr,n as Mr,aC as $r,z as Yt,W as tr,V as rr}from"./index-YbYWmpAT.js";import{P as kr,w as Ze}from"./permission-fpFyADH8.js";import{r as wt,a as Ve,B as Le,a0 as Te,aq as sr,e as jr,ao as nr,bY as Sr,aL as Rr,h as De,j as Ar,Z as Qt,b4 as Or}from"./vendor-ux-did-connect-DIlRfE_S.js";import{x as ir}from"./vendor-hooks-BgUTpb6X.js";import{c as Ne}from"./vendor-arcblock-DuPySS9V.js";import{C as xt}from"./confirm-DI8TUyRK.js";import{f as Ue}from"./index-8eXqqyHQ.js";import{_ as Er}from"./useSetState-CWq0AVWn.js";import{u as ar}from"./session-Djj2U6sa.js";import{S as Ie}from"./section-BB6hVmdO.js";import{C as Cr}from"./click-to-copy-ByEMWZD_.js";import{u as or}from"./dashboard-AdC8-kkA.js";import{r as Dr,aL as Ir}from"./vendor-utils-rHXShPKm.js";import{I as Tr}from"./index-DSoHmrHd.js";import{W as Lr}from"./did-address-BlAXR08O.js";import{V as qr}from"./status-B5ff49WY.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DO6t2PeQ.js";import"./PlayArrow-CLKgdv6H.js";import"./get-safe-url-DrR-6D-i.js";import"./use-blocklet-logo-C_pDvfYN.js";import"./InfoOutlined-Cd28U1Oc.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./use-mobile-BAa0wi8o.js";import"./omit-D2k92RIF.js";var Mt={},Nr=bt;Object.defineProperty(Mt,"__esModule",{value:!0});var lr=Mt.default=void 0,Pr=Nr(wt()),zr=q;lr=Mt.default=(0,Pr.default)((0,zr.jsx)("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}),"VolunteerActivismOutlined");var $t={},Fr=bt;Object.defineProperty($t,"__esModule",{value:!0});var kt=$t.default=void 0,Br=Fr(wt()),Xt=q;kt=$t.default=(0,Br.default)([(0,Xt.jsx)("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),(0,Xt.jsx)("circle",{cx:"16",cy:"12",r:"1.5"},"1")],"AccountBalanceWalletOutlined");const Jr=localStorage.getItem("enableDebug")==="true";function Ur({teamDid:I,size:P="small",...B}){const{t:T}=Ve(),{api:L}=Je(),[p,w]=Ee.useState(!1),[l,$]=Ee.useState(null),y=()=>{w(!1),$(null)},m=async()=>{var a;try{w(!0);const i=await L.clearCache({input:{teamDid:I}});Te.success(T("blocklet.config.clearCache.success",{count:((a=i.removed)==null?void 0:a.length)||0}))}catch(i){Te.error(Ue(i))}finally{w(!1),$(null)}},e={title:T("blocklet.config.clearCache.title"),description:T("blocklet.config.clearCache.description"),confirm:T("common.confirm"),cancel:T("common.cancel"),onConfirm:m,onCancel:y};return q.jsxs("div",{...B,children:[q.jsxs(Le,{onClick:()=>$(e),color:"error",variant:"outlined",size:P,children:[p?q.jsx(We,{size:16,style:{marginRight:5}}):null,T("blocklet.config.clearCache.action")]}),l&&q.jsx(xt,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}var jt={},Vr=bt;Object.defineProperty(jt,"__esModule",{value:!0});var cr=jt.default=void 0,Kr=Vr(wt()),Wr=q;cr=jt.default=(0,Kr.default)((0,Wr.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"KeyOutlined");function St({onChange:I,disabled:P,loading:B,inService:T}){const{t:L}=Ve(),{api:p,session:w}=ar(),{blocklet:l}=_r(),[$,y]=Er({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),m=()=>y({isConnectOpen:!1}),e=()=>{if(wr.isInProgress(l.status)){Te.error(L("blocklet.error.isInProgress"));return}y({confirmDialogOpen:!0})};return q.jsxs(q.Fragment,{children:[q.jsx(Ie,{title:L("blocklet.config.migrate.button"),desc:L("blocklet.config.migrate.description"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsxs(hr,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:P||B,onClick:e,children:[q.jsx(cr,{style:{fontSize:"1.3em",marginRight:4}}),L("blocklet.config.migrate.button")]})})}),q.jsxs(q.Fragment,{children:[$.isConnectOpen&&q.jsx(sr,{popup:!0,open:$.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:p.get,checkTimeout:5*60*1e3,onSuccess:()=>{I(),T&&w.logout(),m()},extraParams:{appDid:l.appDid},messages:{title:L("setup.keyPair.title"),scan:L("setup.keyPair.scan"),confirm:L("setup.keyPair.confirm"),success:L("setup.keyPair.success")},onClose:m}),$.confirmDialogOpen&&q.jsx(xt,{title:q.jsx(Be,{sx:{fontSize:"20px",fontWeight:"500"},children:L("blocklet.config.migrate.title")}),description:q.jsx(Be,{sx:{fontSize:"14px",color:"#9397A1"},children:L("blocklet.config.migrate.confirm")}),confirm:L("common.confirm"),cancel:L("common.cancel"),onConfirm:()=>y({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>y({confirmDialogOpen:!1})})]})]})}St.propTypes={onChange:Oe.func,disabled:Oe.bool,loading:Oe.bool,inService:Oe.bool};St.defaultProps={onChange:()=>{},disabled:!1,loading:!1,inService:!1};function Rt({onCancel:I,onSuccess:P,onError:B}){const{api:T}=Ee.useContext(jr),[L,p]=Ee.useState(!1),{t:w,locale:l}=Ve(),[$,y]=Ee.useState(""),[m,e]=Ee.useState(!1),[a,i]=Ee.useState(0),[r,t]=Ee.useState(""),{endpoint:c}=or(),[s,o]=Ee.useState(!1),h=f=>{y(null),p(!0);try{t(f.result),i(j.length-1)}catch(v){const x=Ue(v);y(x),B(v)}finally{p(!1)}},g=()=>{e(!0),i(1)},b=()=>{e(!1),i(0)},j=[{body:q.jsxs(U,{children:[q.jsx(Be,{children:w("team.transferApp.transferDialog.tips.progress")}),q.jsx(Be,{mt:3,mb:2,children:w("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:w("common.cancel"),confirm:w("team.transferApp.transferDialog.createTransferLink"),onCancel:I,onConfirm:g},{cancel:w("common.cancel"),confirm:w("team.transferApp.transferDialog.createTransferLink"),body:()=>q.jsx(sr,{action:"transfer-app-owner",open:m,locale:l,checkFn:T.get,onClose:b,onSuccess:h,checkTimeout:5*60*1e3,extraParams:{},messages:{title:w("team.transferApp.connectDialog.title"),scan:w("team.transferApp.connectDialog.scan"),confirm:w("team.transferApp.connectDialog.confirm"),success:w("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const f=xr({transferId:r.transferId,endpoint:c});return q.jsxs(q.Fragment,{children:[q.jsx(U,{component:Fe,dangerouslySetInnerHTML:{__html:w("team.transferApp.transferDialog.createSuccessTip1")}}),q.jsx(U,{component:Fe,mt:2,children:q.jsx(Fe,{children:w("team.transferApp.transferDialog.createSuccessTip3")})}),q.jsxs(U,{children:[q.jsx(U,{component:Fe,mt:2,children:q.jsx(Fe,{children:w("team.transferApp.transferDialog.createSuccessTip2",{expireDate:Mr(r.expireDate,l)})})}),q.jsx(U,{my:1,children:q.jsx(Cr,{children:f})})]}),q.jsx("div",{children:q.jsx(dr,{value:"end",control:q.jsx(mr,{checked:s,onChange:v=>o(v.target.checked)}),label:w("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:w("common.confirm"),onConfirm:P}],k=j[a];return q.jsxs(nr,{title:q.jsx(Fe,{className:"title",children:w("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:q.jsxs(q.Fragment,{children:[k.cancel&&q.jsx(Le,{onClick:k.onCancel,color:"inherit",children:k.cancel}),q.jsxs(Le,{onClick:k.onConfirm,color:"error",disabled:L||a===j.length-1&&!s,variant:"contained",autoFocus:!0,children:[L&&q.jsx(We,{size:16}),k.confirm]})]}),children:[q.jsx(pr,{component:"div",children:typeof k.body=="function"?k.body():k.body}),!!$&&q.jsx(gr,{severity:"error",variant:"icon",children:$})]})}Rt.propTypes={onCancel:Oe.func.isRequired,onSuccess:Oe.func.isRequired,onError:Oe.func};Rt.defaultProps={onError:()=>{}};const Fe=_t.div`
|
|
2
2
|
font-size: 16px;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
&.title {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as p,J as _}from"./vendor-utils-rHXShPKm.js";import{j}from"./vendor-ux-did-connect-
|
|
1
|
+
import{A as p,J as _}from"./vendor-utils-rHXShPKm.js";import{j}from"./vendor-ux-did-connect-DIlRfE_S.js";import{r as e}from"./vendor-react-DEoibe3W.js";import{D as C,G as T}from"./index-YbYWmpAT.js";import{u as B}from"./use-mobile-C21X4TYN.js";import{e as k,j as o,aa as h,ab as H}from"./vendor-mui-core-BV2FUxWJ.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-DuPySS9V.js";function $(){const{info:g,inService:m}=C(),{did:E}=T(),c=e.useRef(null),s=k(),[w,x]=e.useState(0),f=B(),[i,y]=e.useState(!0),d=e.useRef(null);let r="";m?r=j.WELLKNOWN_SERVICE_PATH_PREFIX:r=g.routing.adminPath;const l=new URLSearchParams;m||l.set("authKey","__sst"),l.set("schemaKey",p(window.location.origin,r,`/api/theme?id=${encodeURIComponent(E)}`));const a=e.useCallback(()=>{if(d.current){const n=window.location.origin,t=_(JSON.parse(JSON.stringify(s)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);d.current.contentWindow.postMessage({type:"SEND_THEME",payload:t},n)}},[s]);return e.useEffect(()=>{const n=t=>{t.origin===window.location.origin&&(t.data.type==="REQUEST_THEME"&&a(),t.data.type==="THEME_BUILDER_LOADED"&&y(!1))};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[a]),e.useEffect(()=>{i===!1&&a()},[s,i,a]),e.useEffect(()=>{const n=document.querySelector("#arc__dashboard-main"),t=document.querySelector(".dashboard-content"),u=()=>{if(c.current){const{height:R}=n.getBoundingClientRect(),{top:S}=t.getBoundingClientRect(),{top:L}=c.current.getBoundingClientRect(),b=R-L+S-(f?108:164);x(b)}};return u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},[f,s]),o.jsxs(o.Fragment,{children:[o.jsx(h,{ref:c}),i&&o.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(H,{})}),o.jsx("iframe",{title:"Theme Builder",ref:d,src:`${p(window.location.origin,r,"/hosted/theme-builder/")}?${l.toString()}`,style:{border:0,width:"100%",height:`${w}px`,display:i?"none":"block"}})]})}export{$ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a0 as U,r as H,a as $,j as V,Y as F,bo as Z,bB as G,a2 as q}from"./vendor-ux-did-connect-DIlRfE_S.js";import{j as e,a9 as K,e as B,aa as u,bc as Y,T as j,ad as X,I as M,ab as J,bo as Q,br as ee,bn as te,q as re,bP as ae,ah as oe}from"./vendor-mui-core-BV2FUxWJ.js";import{p as se}from"./util-VM27PwRk.js";import{r as s,L as ne}from"./vendor-react-DEoibe3W.js";import{_ as ie}from"./useLocalStorage-DO6t2PeQ.js";import{D}from"./index-YbYWmpAT.js";import{M as I}from"./index-RsjqbOR7.js";import{Y as le}from"./vendor-arcblock-DuPySS9V.js";import{d as ce}from"./InfoOutlined-Cd28U1Oc.js";import{d as de,e as _}from"./vendor-utils-rHXShPKm.js";import{S as T}from"./shorten-label-DPIZ5X7v.js";import{r as O}from"./index-BmXcRfZR.js";import{u as ue}from"./dashboard-AdC8-kkA.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./base32-CLrnUJal.js";import"./index-8eXqqyHQ.js";import"./confirm-DI8TUyRK.js";import"./PlayArrow-CLKgdv6H.js";import"./get-safe-url-DrR-6D-i.js";import"./session-Djj2U6sa.js";import"./use-blocklet-logo-C_pDvfYN.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BAa0wi8o.js";const R=s.createContext({}),{Provider:pe,Consumer:Xe}=R;function me(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function fe({children:t,scope:l="",categories:r=[],showScope:n,scopeFormatter:p}){const{api:m,info:v}=D(),[L,C]=s.useState([]),[c,h]=s.useState({total:0,pageSize:me(),pageCount:0,page:1}),[f,d]=s.useState(!1),[x,a]=s.useState(""),[i,S]=ie(`audit-log-category-${l}`,"all"),z=[{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(b=>r.length?b.value==="all"||r.includes(b.value):!0),w=async({page:b=1,pageSize:o=20,silent:y=!0}={})=>{if(!f){y||d(!0);try{const g=await m.getAuditLogs({input:{paging:{page:b,pageSize:o},category:i==="all"?"":i,scope:l,actionOrContent:x}});n&&(g.list||[]).forEach(P=>{P.scope!==v.did&&(P.link=`/blocklets/${P.scope}/components`)}),C(g.list),h(g.paging),d(!1)}catch(g){U.error(g.message),d(!1)}}};s.useEffect(()=>{localStorage.setItem("audit-log-page-size",c.pageSize)},[c.pageSize]),s.useEffect(()=>{w({page:1,pageSize:c.pageSize,silent:!1})},[]),s.useEffect(()=>{w({page:1,pageSize:c.pageSize,silent:!1})},[i,x]);const k={loading:f,fetch:w,filter:{category:i,scope:l},categories:z,setCategory:S,data:L,paging:c,setPaging:h,showScope:n,scopeFormatter:p,actionOrContent:x,setActionOrContent:a};return e.jsx(pe,{value:{auditLogs:k},children:t})}function W(){const{auditLogs:t}=s.useContext(R);return t}var A={},ge=K;Object.defineProperty(A,"__esModule",{value:!0});var N=A.default=void 0,xe=ge(H()),Le=e;N=A.default=(0,xe.default)((0,Le.jsx)("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15z"}),"UnfoldMore");function he(t){if(!t)return[];const l=/\[([^\]]+)\]\(([^)]+)\)/g,r=[];let n;for(;(n=l.exec(t))!==null;)r.push({text:n[1],url:n[2]});return r}const ve=`
|
|
2
2
|
<svg style="width:38px;height:38px;" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z" fill="url(#paint0_linear_606_96)"/>
|
|
4
4
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z" fill="url(#paint1_linear_606_96)"/>
|
|
@@ -15,7 +15,7 @@ import{Z as U,r as H,a as $,j as V,W as Z,bi as F,bv as G,a0 as q}from"./vendor-
|
|
|
15
15
|
</linearGradient>
|
|
16
16
|
</defs>
|
|
17
17
|
</svg>
|
|
18
|
-
`;function Ce({title:t,subTitle:l,titleInfo:r,action:n,createdAt:p,content:m,isLast:v,titleLink:L,avatarUrl:C,inService:c}){const{locale:h}=$(),{palette:f}=
|
|
18
|
+
`;function Ce({title:t,subTitle:l,titleInfo:r,action:n,createdAt:p,content:m,isLast:v,titleLink:L,avatarUrl:C,inService:c}){const{locale:h}=$(),{palette:f}=B(),[d,x]=s.useState(!1),[a,i]=s.useState(!1),[S,E]=s.useState(window.innerWidth),z=s.useRef(null),w=()=>{var y,g;const o=(g=(y=z.current)==null?void 0:y.mdp)==null?void 0:g.current;o&&i(o.scrollHeight>o.offsetHeight)};s.useEffect(()=>{const o=de(()=>{E(window.innerWidth)},100);return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),s.useEffect(()=>{w()},[S,m]);const k=s.useMemo(()=>Object.entries(r).map(([o,y])=>({key:o,value:y})).filter(o=>!!o.value),[r]),b=s.useMemo(()=>{let o=m;return c&&he(m).forEach(g=>{/^(?:\/[^/]+)*\/blocklets\/[^/]+\/members$/.test(g.url)&&(o=o.replace(g.url,`${V.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/did-connect/members`))}),o},[m,c]);return e.jsx(u,{"data-cy":"log-entry",sx:{borderBottom:v?"none":`1px solid ${f.divider}`,padding:2},children:e.jsxs(u,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,width:"100%"},children:[e.jsx(u,{sx:{mt:.5},className:"log-author",children:C?e.jsx(Y,{src:C,size:36,shape:"circle"}):e.jsx("div",{dangerouslySetInnerHTML:{__html:ve}})}),e.jsxs(u,{sx:{width:240},children:[e.jsx(j,{color:"textSecondary",component:"p",display:"flex",children:L?e.jsx(ne,{to:L,target:"_blank",children:e.jsx(T,{maxLength:26,children:t})}):e.jsx(T,{maxLength:26,children:t})}),e.jsx(X,{"aria-label":"Audit device info",title:e.jsx(u,{sx:{color:"#fff",display:"flex",flexDirection:"column",fontSize:12},children:k==null?void 0:k.map(o=>e.jsx(j,{sx:{color:"#fff"},fontSize:12,children:`${o.key}: ${o.value}`},o.key))}),children:e.jsxs(j,{component:"span",color:"textSecondary",fontSize:13,children:[l,e.jsx(ce,{sx:{ml:.5,fontSize:12,verticalAlign:"middle"}})]})})]}),e.jsxs(u,{sx:{width:200},children:[e.jsx(j,{sx:{fontSize:"16px",color:f.text.primary,backgroundColor:f.background.default,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'"},children:n}),e.jsx(j,{component:"span",color:"textSecondary",children:e.jsx(F,{value:p,locale:h,type:"all",disableTimezone:!0,sx:{fontSize:12}})})]}),e.jsx(u,{sx:{flex:1,".wmde-markdown":{bgcolor:"background.default",color:"text.primary"}},children:a&&d?e.jsx(j,{className:"log-content",maxWidth:"lg",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,children:e.jsx(I,{source:b,rehypePlugins:[[O,{target:"_blank"}]]})}):e.jsx(j,{className:"log-content",maxWidth:"lg",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{display:d?"block":"-webkit-box",WebkitLineClamp:d?"none":2,WebkitBoxOrient:"vertical",overflow:d?"visible":"hidden",wordBreak:"break-word"},children:e.jsx(I,{ref:z,source:b,rehypePlugins:[[O,{target:"_blank"}]]})})}),e.jsxs(u,{children:[a&&e.jsx(M,{size:"small",onClick:()=>x(!d),children:d?e.jsx(le,{sx:{fontSize:22}}):e.jsx(N,{sx:{fontSize:22}})}),e.jsx(M,{size:"small",children:e.jsx(Z,{sx:{fontSize:22},content:m})})]})]})})}const be=({log:t,info:l,inService:r})=>r?`${V.WELLKNOWN_BLOCKLET_ADMIN_PATH}/members?did=${t.actor.did}`:t.scope===l.did?`/team/members?did=${t.actor.did}`:`/blocklets/${t.scope}/members?did=${t.actor.did}`;function ye({log:t,isLast:l}){var d,x;const{inService:r,info:n}=D(),{t:p}=$(),{teamDid:m}=ue(),{showScope:v,scopeFormatter:L=a=>a}=W();if(!t.actor.did)return null;const C=!["blocklet",""].includes(t.actor.role);let c=t.actor.fullName;v&&(c=t.actor.fullName?`${c} - ${L(t.scope)}`:L(t.scope));const h=v?t.link:be({log:t,inService:r,info:n}),f=t.actor.avatar?se((d=t.actor)==null?void 0:d.avatar,m,r,((x=t.actor)==null?void 0:x.source)==="server"):"";return e.jsx(Ce,{isLast:l,isUser:C,avatarDid:t.actor.did,avatarUrl:f,title:c||p("common.unrecordedUser"),titleLink:h,subTitle:t.actor.role?t.actor.role:"guest",content:t.content,action:t.action,inService:r,titleInfo:{IP:t.ip,OS:`${_(t,"env.os.name","")}${_(t,"env.os.version","")}`,Client:`${_(t,"env.browser.name","")}${_(t,"env.browser.Version","")}`},createdAt:t.createdAt})}function je(){const{t}=$(),{palette:l}=B(),{data:r,loading:n,paging:p,setPaging:m,filter:v,categories:L,setCategory:C,fetch:c,actionOrContent:h,setActionOrContent:f}=W(),d=a=>{const i=Number(a.target.value);m({...p,pageSize:i}),c({page:1,pageSize:i,silent:!1})},x=a=>{m({...p,page:a+1}),c({page:a+1,pageSize:p.pageSize,silent:!1})};return n&&r.length===0?e.jsx("div",{style:{textAlign:"center",marginTop:"50px"},children:e.jsx(J,{})}):e.jsxs(Se,{"data-cy":"audit-logs",children:[e.jsxs(u,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsxs(Q,{style:{width:"240px"},variant:"outlined",children:[e.jsx(ee,{children:t("common.filter")}),e.jsx(te,{size:"small","data-cy":"filter-by-category-trigger",value:v.category,onChange:a=>C(a.target.value),fullWidth:!0,sx:{borderRadius:1},label:t("common.category"),disabled:n,children:L.map(a=>e.jsx(re,{value:a.value,"data-cy":`filter-by-category-${a.value}`,children:e.jsx(u,{children:e.jsx("span",{children:a.label})})},a.label))})]}),e.jsx(u,{sx:{flex:1}}),e.jsx(G,{options:{searchPlaceholder:t("common.auditLogsSearch"),searchDebounceTime:600},search:h,searchText:h,searchTextUpdate:f,searchClose:()=>f(""),onSearchOpen:()=>{}})]}),r.length===0&&e.jsx(q,{children:t("common.empty")}),e.jsx(u,{sx:{mt:2,border:(r==null?void 0:r.length)>0?`1px solid ${l.divider}`:"none",borderRadius:1},children:r.length>0&&r.map((a,i)=>e.jsx(ye,{log:a,isLast:i===r.length-1},a.id))}),e.jsx(u,{sx:{display:"flex",justifyContent:"flex-end",mt:2},children:e.jsx(ae,{disabled:n,page:p.page-1,count:p.total,rowsPerPage:p.pageSize,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:a,to:i,count:S})=>`${a}–${i} / ${S!==-1?S:`${t()}more than ${i}`}`,onPageChange:(a,i)=>x(i),onRowsPerPageChange:d})})]})}function Je({scope:t,categories:l,showScope:r,scopeFormatter:n}){return e.jsx(fe,{scope:t,categories:l,showScope:r,scopeFormatter:n,children:e.jsx(je,{})})}const Se=oe.div`
|
|
19
19
|
.log-content {
|
|
20
20
|
p {
|
|
21
21
|
margin-bottom: 4px;
|
|
@@ -32,4 +32,4 @@ import{Z as U,r as H,a as $,j as V,W as Z,bi as F,bv as G,a0 as q}from"./vendor-
|
|
|
32
32
|
overflow: auto;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
`;export{
|
|
35
|
+
`;export{Je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as
|
|
1
|
+
import{v as R,j as e,aa as t,ab as I,y as d,T as a,bc as W,ad as L,bQ as D,bs as E,bR as O,X as T,be as y,al as F}from"./vendor-mui-core-BV2FUxWJ.js";import{r as _}from"./vendor-react-DEoibe3W.js";import{x as B}from"./vendor-hooks-BgUTpb6X.js";import{A as U}from"./vendor-utils-rHXShPKm.js";import{a as H,bj as M,z as w,j as v}from"./vendor-ux-did-connect-DIlRfE_S.js";import{L as x}from"./landing-page-BOy_W1aP.js";import{R as Q,H as X}from"./vendor-arcblock-DuPySS9V.js";import{W as G}from"./did-address-BlAXR08O.js";import{d as K}from"./Home-BaA3V3I7.js";import{u as V,d as Y}from"./index-YbYWmpAT.js";import"./lottie-web-jYmAQWuC.js";function oe(){var g,j,f,b;const{searchParams:i}=new URL(window.location.href),{session:o}=V(),{t:c}=H(),u=i.get("client_id"),C=i.get("scope")||"profile:read",[m,k]=_.useState(C.split(" ").filter(Boolean)),S=R("(max-width: 600px)"),A=U(window.location.origin,v.WELLKNOWN_SERVICE_PATH_PREFIX,"/oauth/authorize"),[h,p]=B({client:null,loading:!0});_.useEffect(()=>{(async()=>{const{data:n}=await Y.get("/oauth/client",{params:{clientId:u}});p({client:n,loading:!1})})()},[u,p]);const z=s=>{s!=="profile:read"&&k(n=>n.includes(s)?n.filter(P=>P!==s):[...n,s])};if(h.loading||!(o!=null&&o.user))return e.jsx(x,{did:(g=window.blocklet)==null?void 0:g.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(I,{})})});if(!h.client)return e.jsx(x,{did:(j=window.blocklet)==null?void 0:j.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(Q,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(d,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(K,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:r}=h,{user:l}=o,N=(r.scope||"").split(" ");return e.jsxs(x,{did:(f=window.blocklet)==null?void 0:f.appPid,standalone:!0,children:[e.jsx(X,{children:e.jsx("title",{children:c("oauth.authorize")})}),e.jsx(M,{hideCloseButton:!0,children:e.jsxs(t,{sx:{display:"flex",flexDirection:"column",p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},className:"page-authorize",children:[e.jsxs(t,{sx:{textAlign:"center",mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:[e.jsx(w,{src:(b=window.blocklet)==null?void 0:b.appLogo,alt:"Server",width:48,height:48}),e.jsxs(t,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"})]}),e.jsx(w,{src:r.logo_uri,alt:r.client_name,width:48,height:48})]}),e.jsxs(a,{sx:{mb:1,fontSize:"1.2rem","& .app-name":{color:"primary.main"}},children:["Authorize ",e.jsx("span",{className:"app-name",children:r.client_name})]})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden",mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},className:"info",children:[e.jsx(W,{src:l.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(L,{title:l.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:l.fullName})}),e.jsx(t,{className:"did",children:e.jsx(G,{compact:!0,responsive:!1,did:l.did,showQrcode:!S})})]})]}),e.jsxs(a,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",r.client_name," to do the following on your behalf:"]}),e.jsxs(t,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden"},children:[e.jsx(t,{sx:{p:2},children:e.jsx(D,{children:Object.entries(v.OAUTH_SCOPES).filter(([s])=>N.includes(s)).map(([s,n])=>e.jsx(E,{control:e.jsx(O,{checked:m.includes(s),onChange:()=>z(s),disabled:s==="profile:read"||["blocklet:read","blocklet:write"].includes(s)&&!["owner","admin","member"].includes(l.role),color:"primary",sx:{"&.Mui-checked":{color:"success.main"}}}),label:e.jsx(t,{children:e.jsx(a,{variant:"body1",sx:{fontWeight:500},children:n})}),sx:{mb:0}},s))})}),(r.tos_uri||r.policy_uri)&&e.jsxs(e.Fragment,{children:[e.jsx(T,{}),e.jsx(t,{sx:{height:1,bgcolor:"divider"}}),e.jsx(t,{sx:{p:2,color:"text.secondary"},children:e.jsxs(a,{variant:"body2",children:["By authorize the access, you also agree with the"," ",!!r.tos_uri&&e.jsx(y,{href:r.tos_uri,target:"_blank",children:"Terms of Use"}),!!r.tos_uri&&!!r.policy_uri&&" and ",!!r.policy_uri&&e.jsx(y,{href:r.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:A,children:[i.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:i.get("client_id")}),i.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:i.get("response_type")}),i.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:i.get("redirect_uri")}),i.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:i.get("code_challenge")}),i.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:i.get("code_challenge_method")}),i.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:i.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:m.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(F,{direction:"row",spacing:2,children:[e.jsx(d,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(d,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),i.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(a,{variant:"body2",color:"text.secondary",children:"You will be redirected to"}),e.jsx(a,{variant:"body2",color:"text.secondary",sx:{wordBreak:"break-all"},children:i.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(a,{variant:"body2",children:["Not you?"," ",e.jsx(d,{variant:"text",color:"primary",onClick:()=>o.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aC as l}from"./vendor-ux-did-connect-DIlRfE_S.js";import{a as x}from"./vendor-react-DEoibe3W.js";class m{constructor(e,t,o){this.name=e,this.prefix=t,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class w{constructor(e,t,o){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return f(this,e)}}class g{constructor(e){this.decoders=e}or(e){return f(this,e)}decode(e){const t=e[0],o=this.decoders[t];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const f=(r,e)=>new g({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class y{constructor(e,t,o,s){this.name=e,this.prefix=t,this.baseEncode=o,this.baseDecode=s,this.encoder=new m(e,t,o),this.decoder=new w(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const E=({name:r,prefix:e,encode:t,decode:o})=>new y(r,e,t,o),$=(r,e,t,o)=>{const s={};for(let p=0;p<e.length;++p)s[e[p]]=p;let c=r.length;for(;r[c-1]==="=";)--c;const i=new Uint8Array(c*t/8|0);let n=0,d=0,u=0;for(let p=0;p<c;++p){const h=s[r[p]];if(h===void 0)throw new SyntaxError(`Non-${o} character`);d=d<<t|h,n+=t,n>=8&&(n-=8,i[u++]=255&d>>n)}if(n>=t||255&d<<8-n)throw new SyntaxError("Unexpected end of data");return i},C=(r,e,t)=>{const o=e[e.length-1]==="=",s=(1<<t)-1;let c="",i=0,n=0;for(let d=0;d<r.length;++d)for(n=n<<8|r[d],i+=8;i>t;)i-=t,c+=e[s&n>>i];if(i&&(c+=e[s&n<<t-i]),o)for(;c.length*t&7;)c+="=";return c},a=({name:r,prefix:e,bitsPerChar:t,alphabet:o})=>E({prefix:e,name:r,encode(s){return C(s,o,t)},decode(s){return $(s,o,t,r)}}),A=a({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),P=a({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S=a({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=a({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),v=a({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),O=a({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),j=a({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),k=a({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),D=a({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),N=Object.freeze(Object.defineProperty({__proto__:null,base32:A,base32hex:v,base32hexpad:j,base32hexpadupper:k,base32hexupper:O,base32pad:S,base32padupper:U,base32upper:P,base32z:D},Symbol.toStringTag,{value:"Module"})),B=x(N),{toBuffer:q,toAddress:z,toBase58:J,toHex:T}=l,{base32:b}=B,H=r=>{if(!r)return r;const e=q(z(r));return b.encode(e)},I=r=>{if(!r)return r;const e=b.decode(r),t=J(e);return t.length>30?t:T(e)};var V={encode:H,decode:I};export{V as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{r as Se,a as Ie,_ as Pe,ba as Re,j as O}from"./vendor-ux-did-connect-DROQhYpS.js";import{a9 as ke,j as e,al as z,T as P,aa as m,bc as Ee,ad as re,I as F,D as ue,H as w,aj as _e,t as De,bU as Le,N as oe,z as Oe,y as U,ah as Ve}from"./vendor-mui-core-BV2FUxWJ.js";import{E as M}from"./empty-spinner-BdaCO6xq.js";import{d as ie}from"./DeleteOutline-lCPjjhKz.js";import{l as Te,e as Ue}from"./vendor-hooks-BgUTpb6X.js";import{r as h}from"./vendor-react-DEoibe3W.js";import{D as se,C as ne,P as ae}from"./react-beautiful-dnd.esm-WW1RMrIr.js";import{S as K}from"./studio-B1PGcNac.js";import"./vendor-utils-rHXShPKm.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";import"./vendor-arcblock-5qqHEVGo.js";import"./TuneOutlined-BvxrpP1M.js";var C={};Object.defineProperty(C,"__esModule",{value:!0});C.getVideoId=V;var $e=C.getEmbedUrl=ze,We=C.getVideoCoverUrl=Fe,Ae=C.getVideoCheckUrl=Ne;C.getYoutubeId=pe;C.getVimeoId=he;C.isVideoUrl=He;function pe(r){var s,l,i;const t=r.trim();return t.includes("youtu.be/")?(s=t.split("youtu.be/")[1])==null?void 0:s.split("?")[0]:t.includes("/embed/")?(l=t.split("/embed/")[1])==null?void 0:l.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?(i=t.split("/shorts/")[1])==null?void 0:i.split("?")[0]:""}function he(r){var s,l,i,a,u,y,f;const t=r.trim();return t.includes("/embed/")?(s=t.split("/embed/")[1])==null?void 0:s.split("?")[0]:t.includes("vimeo.com/video/")?(l=t.split("/video/")[1])==null?void 0:l.split("?")[0]:t.includes("vimeo.com/channels/")?(a=(i=t.split("/channels/")[1])==null?void 0:i.split("/")[1])==null?void 0:a.split("?")[0]:t.includes("vimeo.com/groups/")?(y=(u=t.split("/groups/")[1])==null?void 0:u.split("/")[1])==null?void 0:y.split("?")[0]:t.includes("vimeo.com/")?(f=t.split("vimeo.com/")[1])==null?void 0:f.split("?")[0]:""}const $={};function V(r){const t=r.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:($[t]||($[t]=(()=>{const s=new URL(t);return s.host.includes("youtube.com")||s.host.includes("youtu.be")?[pe(t),"youtube"]:s.host.includes("vimeo.com")?[he(t),"vimeo"]:[]})()),$[t])}const k={};function ze(r,{modestbranding:t=1,controls:s=0,autoplay:l=0}={}){const i=r.trim();if(!i)return"";if(k[i]!==void 0)return k[i];const[a,u]=V(i);return u==="youtube"?k[i]=`https://www.youtube.com/embed/${a}?modestbranding=${t}&controls=${s}&autoplay=${l}`:u==="vimeo"?k[i]=`https://player.vimeo.com/video/${a}?autoplay=${l}`:k[i]="",k[i]}const E={};function Fe(r){const t=r.trim();if(!t)return"";if(E[t]!==void 0)return E[t];const[s,l]=V(t);return l==="youtube"?E[t]=`https://img.youtube.com/vi/${s}/mqdefault.jpg`:l==="vimeo"?E[t]=`https://i.vimeocdn.com/${s}/1000x563`:E[t]="",E[t]}function Ne(r){const t=r.trim();if(!t)return"";const[s,l]=V(t);return l==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${s}&format=json`:l==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${s}`:""}function He(r){const t=r.trim();return V(t).length>0}var X={},qe=ke;Object.defineProperty(X,"__esModule",{value:!0});var me=X.default=void 0,Be=qe(Se()),Ke=e;me=X.default=(0,Be.default)((0,Ke.jsx)("path",{d:"M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m7 18H5V4h2v3h10V4h2z"}),"ContentPaste");const le=h.lazy(()=>Pe(()=>import("./index-8lA5-nM7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader}))),Me=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Xe=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Ye=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,W=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,Je=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,ce=5,de=3;function ut(){var ee;const{t:r,locale:t}=Ie(),[s,l]=h.useState(!1),[i,a]=h.useState(!1),[u,y]=h.useState([]),[f,j]=h.useState([]),[x,S]=h.useState(""),[T,_]=h.useState(""),[N,H]=h.useState(Date.now()),p=Te(async()=>{var c;const n=await(await fetch(W)).json();return y(n.screenshots||[]),j(((c=n.videos)==null?void 0:c.filter(d=>!!d))||[]),n}),R=h.useRef(null),g=h.useRef(null);if(p.loading&&!p.data)return e.jsx(K,{children:e.jsx(M,{size:40})});if(p.error)return e.jsx(K,{children:e.jsx(z,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(P,{color:"error.main",sx:{fontWeight:"bold"},children:p.error.message})})});const v=async o=>{const n=o.filter(c=>!!c);j(n),await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:n})})},q=async o=>{const n=Array.from(f),[c]=n.splice(o.source.index,1);n.splice(o.destination.index,0,c),await v(n)},fe=async o=>{const n=Array.from(u),[c]=n.splice(o.source.index,1);n.splice(o.destination.index,0,c),y(n),await fetch(`${W}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:n})})},J=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await fe(o):o.source.droppableId==="videos"&&await q(o),p.runAsync())},Z=o=>{_(o.trim()),a(!0)},G=async(o,n="")=>{let c=[];n?c=o?f.map(d=>d===n?o.trim():d):f.filter(d=>d!==n):o&&(c=[...f,o.trim()]),_(""),a(!1),(o||n)&&await v(c),p.runAsync()},xe=o=>{l(!0),S(o)},Q=()=>{l(!1),S("")};function be(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],n=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx(A,{title:r("common.logo"),rules:o,tips:n,children:e.jsx(m,{sx:{flex:1,cursor:"pointer"},children:e.jsx(Ee,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Ye}?t=${N}`,onClick:()=>{var c;return(c=R.current)==null?void 0:c.open()}})})})}function ve(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${ce}`},{label:r("studio.size"),value:"<5MB"}],n=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx(A,{title:r("common.screenshot"),tips:n,rules:o,children:e.jsx(se,{onDragEnd:J,children:e.jsx(ne,{droppableId:"screenshots",direction:"horizontal",children:(d,D)=>e.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:D.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:D.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:d.innerRef,...d.droppableProps,children:[u.map((b,B)=>e.jsx(ae,{draggableId:b,index:B,children:(I,L)=>{const te=`${W}/${b}`;return e.jsxs(m,{ref:I.innerRef,...I.draggableProps,...I.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:te,onClick:()=>xe(b),style:{cursor:"pointer"}}),e.jsx(re,{title:r("studio.deleteTooltip"),children:e.jsx(F,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(te,{method:"DELETE"}),p.runAsync()},children:e.jsx(ie,{})})})]})}},b)),d.placeholder,u.length<ce&&c()]})})})});function c(){return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,sx:{background:"#eee",cursor:"pointer",color:"#999"},onClick:()=>{var d;return(d=g.current)==null?void 0:d.open()},children:"+"})}}function je(){const o=[{label:r("studio.count"),value:`1~${de}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],n=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs(A,{title:r("studio.video"),tips:n,rules:o,children:[e.jsx(se,{onDragEnd:J,children:e.jsx(ne,{droppableId:"videos",direction:"horizontal",children:(d,D)=>e.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:D.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:D.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:d.innerRef,...d.droppableProps,children:[f.map((b,B)=>e.jsx(ae,{draggableId:b,index:B,children:(I,L)=>e.jsxs(m,{ref:I.innerRef,...I.draggableProps,...I.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:We(b),onClick:()=>Z(b),style:{cursor:"pointer"}}),e.jsx(m,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>Z(b),children:e.jsx(ge,{})}),e.jsx(re,{title:r("studio.deleteTooltip"),children:e.jsx(F,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>G(null,b),children:e.jsx(ie,{})})})]})},b)),d.placeholder,f.length<de&&c()]})})}),i&&e.jsx(Y,{t:r,handleOperateVideo:G,defaultUrl:T,videos:f})]});function c(){return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,sx:{background:"#eee",cursor:"pointer",color:"#999"},onClick:()=>a(!0),children:"+"})}}function ye(){return e.jsx(ue,{open:s,onClose:Q,maxWidth:"xl",PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none"}},children:e.jsx("img",{src:`${W}/${x}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:Q})})}function we(){return e.jsxs(h.Suspense,{fallback:e.jsx(M,{size:40}),children:[e.jsx(le,{ref:R,locale:t,popup:!0,onUploadFinish:()=>{var o;(o=R.current)==null||o.close(),H(Date.now()),p.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Me,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(le,{ref:g,locale:t,popup:!0,onUploadFinish:()=>{var o;(o=g.current)==null||o.close(),p.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Xe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-u.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const Ce=`https://www.arcblock.io/docs/blocklet-store/${t}/supplying-images`;return e.jsx(K,{children:e.jsxs(Ze,{children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(P,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:(ee=p.data)==null?void 0:ee.title})}),e.jsxs(P,{variant:"body2",color:"text.secondary",children:[r("studio.description")," ",e.jsx("a",{href:Ce,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),be(),ve(),je(),ye(),we()]})})}function A({title:r,rules:t,tips:s,children:l}){return e.jsxs(m,{display:"flex",flexDirection:"column",sx:{mb:4},children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(P,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(z,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:t.map(a=>i(a.label,a.value))}),s.map(a=>e.jsx(m,{sx:{fontSize:"13px",opacity:.8},children:i(a.label,a.value)}))]}),l]});function i(a,u){return e.jsxs(m,{component:"span",children:[e.jsxs(m,{component:"span",sx:{color:"#555",mr:.5},children:[a,":"]}),e.jsx(m,{component:"span",sx:{color:"#007ec6"},children:u})]})}}A.propTypes={title:w.string.isRequired,rules:w.array.isRequired,tips:w.array.isRequired,children:w.node.isRequired};function Y({handleOperateVideo:r,t,defaultUrl:s="",videos:l}){var R;const[i,a]=h.useState(s),[u,y]=h.useState(!1),[f,j]=h.useState(!1),x=h.useRef(i),S=i!==s&&l.includes(i),T=!i&&s,_=!S&&(i&&i!==x.current||u),N=!!((R=navigator.clipboard)!=null&&R.readText),{run:H}=Ue(p,{wait:500,leading:!0});return e.jsxs(ue,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(_e,{children:t(s?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(De,{children:[e.jsx(Le,{fullWidth:!0,value:i,onChange:g=>{const v=g.target.value.trim();a(v),v?H(v):j(!1)},placeholder:t("studio.videoInputLabel"),endAdornment:i?e.jsx(oe,{position:"end",children:e.jsx(F,{onClick:()=>{a(""),p("")},children:e.jsx(Re,{})})}):N&&e.jsx(oe,{position:"end",children:e.jsx(F,{onClick:async()=>{try{const g=(await navigator.clipboard.readText()||"").trim();a(g),p(g)}catch(g){console.error(g)}},children:e.jsx(me,{})})})}),e.jsxs(m,{mb:2,mt:.5,children:[S&&e.jsx(P,{variant:"body2",color:"error",children:t("studio.duplicateVideo")}),!S&&f&&e.jsx(P,{variant:"body2",color:"error",children:t("studio.videoDialogNoSrc")})]}),x.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${x.current}`,src:$e(x.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:u?e.jsx(M,{size:40}):e.jsx(P,{variant:"h5",color:"text.secondary",children:e.jsx(ge,{})})})]}),e.jsxs(Oe,{children:[e.jsx(U,{onClick:()=>r(),children:t("studio.cancel")}),T&&e.jsx(U,{variant:"contained",color:"error",onClick:()=>r(null,s),children:t("studio.delete")}),_&&e.jsx(U,{variant:"contained",onClick:()=>p(i),disabled:!i||u,children:t("studio.preview")}),!T&&!_&&e.jsx(U,{variant:"contained",onClick:()=>r(x.current),disabled:!x.current||s===x.current||S,children:t("studio.confirm")})]})]});function p(g){x.current="";const v=Ae(g);j(g?!v:!1),v&&(y(!0),fetch(v).then(q=>{q.ok?(x.current=g,j(!1)):j(!0)}).catch(()=>{j(!0)}).finally(()=>y(!1)))}}Y.propTypes={handleOperateVideo:w.func.isRequired,t:w.func.isRequired,defaultUrl:w.string,videos:w.array.isRequired};Y.defaultProps={defaultUrl:""};function ge(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Ze=Ve.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-bIHubQ8z.js","assets/vendor-ux-did-connect-DIlRfE_S.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-mui-core-BV2FUxWJ.js","assets/vendor-hooks-BgUTpb6X.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-DuPySS9V.js","assets/index-Bs1kxR8_.js","assets/index-YbYWmpAT.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as Se,a as Ie,_ as Pe,bg as Re,j as O}from"./vendor-ux-did-connect-DIlRfE_S.js";import{a9 as ke,j as e,al as z,T as P,aa as m,bc as Ee,ad as re,I as F,D as ue,H as w,aj as _e,t as De,bU as Le,N as oe,z as Oe,y as U,ah as Ve}from"./vendor-mui-core-BV2FUxWJ.js";import{E as M}from"./empty-spinner-BdaCO6xq.js";import{d as ie}from"./DeleteOutline-CzIOFoFP.js";import{l as Te,e as Ue}from"./vendor-hooks-BgUTpb6X.js";import{r as h}from"./vendor-react-DEoibe3W.js";import{D as se,C as ne,P as ae}from"./react-beautiful-dnd.esm-G9cRB9Uf.js";import{S as K}from"./studio-DnKLD9XD.js";import"./vendor-utils-rHXShPKm.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";import"./vendor-arcblock-DuPySS9V.js";import"./TuneOutlined-BWqIZK2m.js";var C={};Object.defineProperty(C,"__esModule",{value:!0});C.getVideoId=V;var $e=C.getEmbedUrl=ze,We=C.getVideoCoverUrl=Fe,Ae=C.getVideoCheckUrl=Ne;C.getYoutubeId=pe;C.getVimeoId=he;C.isVideoUrl=He;function pe(r){var s,l,i;const t=r.trim();return t.includes("youtu.be/")?(s=t.split("youtu.be/")[1])==null?void 0:s.split("?")[0]:t.includes("/embed/")?(l=t.split("/embed/")[1])==null?void 0:l.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?(i=t.split("/shorts/")[1])==null?void 0:i.split("?")[0]:""}function he(r){var s,l,i,a,u,y,f;const t=r.trim();return t.includes("/embed/")?(s=t.split("/embed/")[1])==null?void 0:s.split("?")[0]:t.includes("vimeo.com/video/")?(l=t.split("/video/")[1])==null?void 0:l.split("?")[0]:t.includes("vimeo.com/channels/")?(a=(i=t.split("/channels/")[1])==null?void 0:i.split("/")[1])==null?void 0:a.split("?")[0]:t.includes("vimeo.com/groups/")?(y=(u=t.split("/groups/")[1])==null?void 0:u.split("/")[1])==null?void 0:y.split("?")[0]:t.includes("vimeo.com/")?(f=t.split("vimeo.com/")[1])==null?void 0:f.split("?")[0]:""}const $={};function V(r){const t=r.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:($[t]||($[t]=(()=>{const s=new URL(t);return s.host.includes("youtube.com")||s.host.includes("youtu.be")?[pe(t),"youtube"]:s.host.includes("vimeo.com")?[he(t),"vimeo"]:[]})()),$[t])}const k={};function ze(r,{modestbranding:t=1,controls:s=0,autoplay:l=0}={}){const i=r.trim();if(!i)return"";if(k[i]!==void 0)return k[i];const[a,u]=V(i);return u==="youtube"?k[i]=`https://www.youtube.com/embed/${a}?modestbranding=${t}&controls=${s}&autoplay=${l}`:u==="vimeo"?k[i]=`https://player.vimeo.com/video/${a}?autoplay=${l}`:k[i]="",k[i]}const E={};function Fe(r){const t=r.trim();if(!t)return"";if(E[t]!==void 0)return E[t];const[s,l]=V(t);return l==="youtube"?E[t]=`https://img.youtube.com/vi/${s}/mqdefault.jpg`:l==="vimeo"?E[t]=`https://i.vimeocdn.com/${s}/1000x563`:E[t]="",E[t]}function Ne(r){const t=r.trim();if(!t)return"";const[s,l]=V(t);return l==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${s}&format=json`:l==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${s}`:""}function He(r){const t=r.trim();return V(t).length>0}var X={},qe=ke;Object.defineProperty(X,"__esModule",{value:!0});var me=X.default=void 0,Be=qe(Se()),Ke=e;me=X.default=(0,Be.default)((0,Ke.jsx)("path",{d:"M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m7 18H5V4h2v3h10V4h2z"}),"ContentPaste");const le=h.lazy(()=>Pe(()=>import("./index-bIHubQ8z.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader}))),Me=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Xe=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Ye=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,W=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,Je=`${O.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,ce=5,de=3;function ut(){var ee;const{t:r,locale:t}=Ie(),[s,l]=h.useState(!1),[i,a]=h.useState(!1),[u,y]=h.useState([]),[f,j]=h.useState([]),[x,S]=h.useState(""),[T,_]=h.useState(""),[N,H]=h.useState(Date.now()),p=Te(async()=>{var c;const n=await(await fetch(W)).json();return y(n.screenshots||[]),j(((c=n.videos)==null?void 0:c.filter(d=>!!d))||[]),n}),R=h.useRef(null),g=h.useRef(null);if(p.loading&&!p.data)return e.jsx(K,{children:e.jsx(M,{size:40})});if(p.error)return e.jsx(K,{children:e.jsx(z,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(P,{color:"error.main",sx:{fontWeight:"bold"},children:p.error.message})})});const v=async o=>{const n=o.filter(c=>!!c);j(n),await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:n})})},q=async o=>{const n=Array.from(f),[c]=n.splice(o.source.index,1);n.splice(o.destination.index,0,c),await v(n)},fe=async o=>{const n=Array.from(u),[c]=n.splice(o.source.index,1);n.splice(o.destination.index,0,c),y(n),await fetch(`${W}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:n})})},J=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await fe(o):o.source.droppableId==="videos"&&await q(o),p.runAsync())},Z=o=>{_(o.trim()),a(!0)},G=async(o,n="")=>{let c=[];n?c=o?f.map(d=>d===n?o.trim():d):f.filter(d=>d!==n):o&&(c=[...f,o.trim()]),_(""),a(!1),(o||n)&&await v(c),p.runAsync()},xe=o=>{l(!0),S(o)},Q=()=>{l(!1),S("")};function be(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],n=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx(A,{title:r("common.logo"),rules:o,tips:n,children:e.jsx(m,{sx:{flex:1,cursor:"pointer"},children:e.jsx(Ee,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Ye}?t=${N}`,onClick:()=>{var c;return(c=R.current)==null?void 0:c.open()}})})})}function ve(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${ce}`},{label:r("studio.size"),value:"<5MB"}],n=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx(A,{title:r("common.screenshot"),tips:n,rules:o,children:e.jsx(se,{onDragEnd:J,children:e.jsx(ne,{droppableId:"screenshots",direction:"horizontal",children:(d,D)=>e.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:D.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:D.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:d.innerRef,...d.droppableProps,children:[u.map((b,B)=>e.jsx(ae,{draggableId:b,index:B,children:(I,L)=>{const te=`${W}/${b}`;return e.jsxs(m,{ref:I.innerRef,...I.draggableProps,...I.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:te,onClick:()=>xe(b),style:{cursor:"pointer"}}),e.jsx(re,{title:r("studio.deleteTooltip"),children:e.jsx(F,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(te,{method:"DELETE"}),p.runAsync()},children:e.jsx(ie,{})})})]})}},b)),d.placeholder,u.length<ce&&c()]})})})});function c(){return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,sx:{background:"#eee",cursor:"pointer",color:"#999"},onClick:()=>{var d;return(d=g.current)==null?void 0:d.open()},children:"+"})}}function je(){const o=[{label:r("studio.count"),value:`1~${de}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],n=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs(A,{title:r("studio.video"),tips:n,rules:o,children:[e.jsx(se,{onDragEnd:J,children:e.jsx(ne,{droppableId:"videos",direction:"horizontal",children:(d,D)=>e.jsxs(m,{display:"flex",alignItems:"center",sx:{flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:D.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:D.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:d.innerRef,...d.droppableProps,children:[f.map((b,B)=>e.jsx(ae,{draggableId:b,index:B,children:(I,L)=>e.jsxs(m,{ref:I.innerRef,...I.draggableProps,...I.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:We(b),onClick:()=>Z(b),style:{cursor:"pointer"}}),e.jsx(m,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>Z(b),children:e.jsx(ge,{})}),e.jsx(re,{title:r("studio.deleteTooltip"),children:e.jsx(F,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>G(null,b),children:e.jsx(ie,{})})})]})},b)),d.placeholder,f.length<de&&c()]})})}),i&&e.jsx(Y,{t:r,handleOperateVideo:G,defaultUrl:T,videos:f})]});function c(){return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,sx:{background:"#eee",cursor:"pointer",color:"#999"},onClick:()=>a(!0),children:"+"})}}function ye(){return e.jsx(ue,{open:s,onClose:Q,maxWidth:"xl",PaperProps:{style:{backgroundColor:"transparent",boxShadow:"none"}},children:e.jsx("img",{src:`${W}/${x}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:Q})})}function we(){return e.jsxs(h.Suspense,{fallback:e.jsx(M,{size:40}),children:[e.jsx(le,{ref:R,locale:t,popup:!0,onUploadFinish:()=>{var o;(o=R.current)==null||o.close(),H(Date.now()),p.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Me,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),e.jsx(le,{ref:g,locale:t,popup:!0,onUploadFinish:()=>{var o;(o=g.current)==null||o.close(),p.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Xe,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-u.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const Ce=`https://www.arcblock.io/docs/blocklet-store/${t}/supplying-images`;return e.jsx(K,{children:e.jsxs(Ze,{children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(P,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:(ee=p.data)==null?void 0:ee.title})}),e.jsxs(P,{variant:"body2",color:"text.secondary",children:[r("studio.description")," ",e.jsx("a",{href:Ce,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),be(),ve(),je(),ye(),we()]})})}function A({title:r,rules:t,tips:s,children:l}){return e.jsxs(m,{display:"flex",flexDirection:"column",sx:{mb:4},children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(P,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(z,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:t.map(a=>i(a.label,a.value))}),s.map(a=>e.jsx(m,{sx:{fontSize:"13px",opacity:.8},children:i(a.label,a.value)}))]}),l]});function i(a,u){return e.jsxs(m,{component:"span",children:[e.jsxs(m,{component:"span",sx:{color:"#555",mr:.5},children:[a,":"]}),e.jsx(m,{component:"span",sx:{color:"#007ec6"},children:u})]})}}A.propTypes={title:w.string.isRequired,rules:w.array.isRequired,tips:w.array.isRequired,children:w.node.isRequired};function Y({handleOperateVideo:r,t,defaultUrl:s="",videos:l}){var R;const[i,a]=h.useState(s),[u,y]=h.useState(!1),[f,j]=h.useState(!1),x=h.useRef(i),S=i!==s&&l.includes(i),T=!i&&s,_=!S&&(i&&i!==x.current||u),N=!!((R=navigator.clipboard)!=null&&R.readText),{run:H}=Ue(p,{wait:500,leading:!0});return e.jsxs(ue,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(_e,{children:t(s?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(De,{children:[e.jsx(Le,{fullWidth:!0,value:i,onChange:g=>{const v=g.target.value.trim();a(v),v?H(v):j(!1)},placeholder:t("studio.videoInputLabel"),endAdornment:i?e.jsx(oe,{position:"end",children:e.jsx(F,{onClick:()=>{a(""),p("")},children:e.jsx(Re,{})})}):N&&e.jsx(oe,{position:"end",children:e.jsx(F,{onClick:async()=>{try{const g=(await navigator.clipboard.readText()||"").trim();a(g),p(g)}catch(g){console.error(g)}},children:e.jsx(me,{})})})}),e.jsxs(m,{mb:2,mt:.5,children:[S&&e.jsx(P,{variant:"body2",color:"error",children:t("studio.duplicateVideo")}),!S&&f&&e.jsx(P,{variant:"body2",color:"error",children:t("studio.videoDialogNoSrc")})]}),x.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${x.current}`,src:$e(x.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:u?e.jsx(M,{size:40}):e.jsx(P,{variant:"h5",color:"text.secondary",children:e.jsx(ge,{})})})]}),e.jsxs(Oe,{children:[e.jsx(U,{onClick:()=>r(),children:t("studio.cancel")}),T&&e.jsx(U,{variant:"contained",color:"error",onClick:()=>r(null,s),children:t("studio.delete")}),_&&e.jsx(U,{variant:"contained",onClick:()=>p(i),disabled:!i||u,children:t("studio.preview")}),!T&&!_&&e.jsx(U,{variant:"contained",onClick:()=>r(x.current),disabled:!x.current||s===x.current||S,children:t("studio.confirm")})]})]});function p(g){x.current="";const v=Ae(g);j(g?!v:!1),v&&(y(!0),fetch(v).then(q=>{q.ok?(x.current=g,j(!1)):j(!0)}).catch(()=>{j(!0)}).finally(()=>y(!1)))}}Y.propTypes={handleOperateVideo:w.func.isRequired,t:w.func.isRequired,defaultUrl:w.string,videos:w.array.isRequired};Y.defaultProps={defaultUrl:""};function ge(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Ze=Ve.div`
|
|
3
3
|
margin-top: 24px;
|
|
4
4
|
.image-wrapper {
|
|
5
5
|
margin-bottom: 16px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as AA,r as H}from"./vendor-react-DEoibe3W.js";import{H as P,j as A,I as i,bw as xA,y as p,P as gA,w as QA,a8 as sA,M as jA,q as MA,c1 as yA,O as PA,aa as g,ab as BA,ah as h,d3 as fA,bZ as IA,E as EA,bq as LA,al as YA,T,X as o}from"./vendor-mui-core-BV2FUxWJ.js";import{
|
|
1
|
+
import{b as AA,r as H}from"./vendor-react-DEoibe3W.js";import{H as P,j as A,I as i,bw as xA,y as p,P as gA,w as QA,a8 as sA,M as jA,q as MA,c1 as yA,O as PA,aa as g,ab as BA,ah as h,d3 as fA,bZ as IA,E as EA,bq as LA,al as YA,T,X as o}from"./vendor-mui-core-BV2FUxWJ.js";import{b4 as zA,d as q,a0 as TA}from"./vendor-ux-did-connect-DIlRfE_S.js";import{x as ZA}from"./vendor-hooks-BgUTpb6X.js";import{c as Q}from"./vendor-arcblock-DuPySS9V.js";import{d as eA}from"./Done-MQdb8YLa.js";import{F as nA,R as wA,L as N}from"./logo-uploader-CbM-N8qP.js";import{E as lA}from"./EditIcon-8BXW1OHp.js";import{d as GA}from"./ArrowDropDown-D32FY-Mt.js";import{D as dA,V as JA,W as NA}from"./index-YbYWmpAT.js";import{w as DA}from"./permission-fpFyADH8.js";import{h as kA}from"./use-blocklet-logo-C_pDvfYN.js";import{S as W}from"./section-BB6hVmdO.js";import"./vendor-utils-rHXShPKm.js";import"./lottie-web-jYmAQWuC.js";import"./index-DVQCgvFb.js";import"./session-Djj2U6sa.js";function U({triggers:f,onEnterEdit:B,disabled:t}){const X=AA.useRef(null),[s,C]=AA.useState(!1),c=D=>{C(!1),D()},v=()=>{C(D=>!D)},w=D=>{X.current&&X.current.contains(D.target)||C(!1)};return f.length===0?A.jsx(i,{"data-cy":"schema-form-item-edit",onClick:B,disabled:t,size:"large",children:A.jsx(lA,{})}):A.jsxs(A.Fragment,{children:[A.jsx(xA,{variant:"outlined",ref:X,"aria-label":"split button",children:A.jsx(p,{size:"large","aria-controls":s?"split-button-menu":void 0,"aria-expanded":s?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:v,children:A.jsx(GA,{})})}),A.jsx(gA,{sx:{zIndex:9999},open:s,anchorEl:X.current,role:void 0,placement:"bottom-end",children:A.jsx(QA,{children:A.jsx(sA,{onClickAway:w,children:A.jsx(jA,{id:"split-button-menu",autoFocusItem:!0,children:f.map(D=>A.jsx(MA,{onClick:()=>c(D.handler),children:D.title},D.key))})})})})]})}U.propTypes={triggers:P.arrayOf(P.shape({key:P.string.isRequired,title:P.string.isRequired,handler:P.func.isRequired})),onEnterEdit:P.func.isRequired,disabled:P.bool.isRequired};U.defaultProps={triggers:[]};const vA=(f,B,t)=>f===null&&B&&t?"******":f?B?"******":f:"",mA=yA`
|
|
2
2
|
0%, 100% {
|
|
3
3
|
transform: scale(1) translateX(0);
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f,bc as
|
|
1
|
+
import{j as f,bc as x,H as a}from"./vendor-mui-core-BV2FUxWJ.js";import{j,$ as E}from"./vendor-ux-did-connect-DIlRfE_S.js";import{A as g}from"./vendor-utils-rHXShPKm.js";import{D as y,E as P,Z as h,_ as R,$ as A}from"./index-YbYWmpAT.js";function w({blocklet:r,ancestors:p=[]}){var d,m;const s=y(),{inService:n}=s,i=P(r==null?void 0:r.status)||h(r==null?void 0:r.status),o=`?v=${(d=r==null?void 0:r.meta)==null?void 0:d.version}${i?"~":""}`;let t=n?`${g(A,j.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${o}`:g(s.imgPrefix,"blocklet.png");if(r.source==="registry"&&r.deployedFrom&&r.meta.logo)t=`${g(r.deployedFrom,R(r.meta.bundleDid,r.meta.logo))}${o}`;else{const u=((m=window.env)==null?void 0:m.apiPrefix)||"/",e=p.concat(r),c=n?e.slice(1):e;t=`${g(u,`/blocklet/logo-bundle${c.map(v=>`/${v.meta.did}`).join("")}`)}${o}`}return{logoUrl:t,inService:n}}function $({blocklet:r,style:p,size:s,ancestors:n,...i}){const o=y(),{logoUrl:t,inService:d}=w({blocklet:r,ancestors:n}),{variant:m}=i,u=d?()=>{}:c=>{c.target.src=`${o.imgPrefix}/blocklet.png`};let e=f.jsx("img",{src:t,onError:u,alt:r.meta.name,style:{width:s}});return r.meta.logo||(e=f.jsx(E,{did:r.meta.did||"",responsive:!0})),f.jsx(x,{variant:m||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},p),...i,children:e})}$.propTypes={blocklet:a.object.isRequired,style:a.object,size:a.oneOfType([a.number,a.string]),ancestors:a.array};$.defaultProps={style:{},size:40,ancestors:[]};export{$ as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./vendor-mui-core-BV2FUxWJ.js";import{B as n}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as o}from"./vendor-mui-core-BV2FUxWJ.js";import{B as n}from"./vendor-ux-did-connect-DIlRfE_S.js";function m({...t}){return o.jsx(n,{className:"bottom-button",variant:"contained",color:"primary",...t})}export{m as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i}from"./vendor-react-DEoibe3W.js";import{j as t,H as e}from"./vendor-mui-core-BV2FUxWJ.js";import{b4 as s,bz as c}from"./vendor-ux-did-connect-DIlRfE_S.js";function n({children:p,...r}){const{t:o}=i.useContext(s);return t.jsx(c,{tip:o("common.copyTip"),copiedTip:o("common.copiedTip"),...r,children:p})}n.propTypes={children:e.any.isRequired};export{n as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-react-DEoibe3W.js";import{a9 as s,j as e,s as o,c2 as d,c3 as i,c4 as n}from"./vendor-mui-core-BV2FUxWJ.js";import{r as c}from"./vendor-ux-did-connect-
|
|
1
|
+
import"./vendor-react-DEoibe3W.js";import{a9 as s,j as e,s as o,c2 as d,c3 as i,c4 as n}from"./vendor-mui-core-BV2FUxWJ.js";import{r as c}from"./vendor-ux-did-connect-DIlRfE_S.js";var a={},p=s;Object.defineProperty(a,"__esModule",{value:!0});var t=a.default=void 0,u=p(c()),l=e;t=a.default=(0,u.default)((0,l.jsx)("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"}),"ArrowForwardIosSharp");const v=o(r=>e.jsx(d,{disableGutters:!0,elevation:0,square:!0,...r}))(({theme:r})=>({border:`1px solid ${r.palette.divider}`,"&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}})),b=o(r=>e.jsx(i,{expandIcon:e.jsx(t,{sx:{fontSize:"0.9rem"}}),...r}))(({theme:r})=>({backgroundColor:r.palette.mode==="dark"?"rgba(255, 255, 255, .05)":"rgba(0, 0, 0, .03)",flexDirection:"row-reverse","& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(90deg)"},"& .MuiAccordionSummary-content":{marginLeft:r.spacing(1)}})),g=o(n)(({theme:r})=>({padding:r.spacing(2),borderTop:"1px solid rgba(0, 0, 0, .125)"}));export{v as A,b as a,g as b,t as d};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{ah as U,j as e,aa as u,H as _}from"./vendor-mui-core-BV2FUxWJ.js";import{a as
|
|
1
|
+
import{ah as U,j as e,aa as u,H as _}from"./vendor-mui-core-BV2FUxWJ.js";import{a as q,R as G,a5 as J,a0 as z,j as Y}from"./vendor-ux-did-connect-DIlRfE_S.js";import{k as Z,t as A,au as tt,d as et,e as rt,am as st,av as nt,r as ot,x as at}from"./index-YbYWmpAT.js";import{r as c}from"./vendor-react-DEoibe3W.js";import{A as F,z as it}from"./vendor-utils-rHXShPKm.js";import{u as lt,f as y}from"./vendor-hooks-BgUTpb6X.js";import{L as ct}from"./launch-result-message-FuvJDCvp.js";import{g as ut}from"./get-safe-url-CRv5HbAK.js";import{g as mt,a as dt}from"./setup-C9DGbmM7.js";import{S as D}from"./button-8G90WP8a.js";import{S as pt}from"./layout-CYJJYqb_.js";import{P as ht,S as gt,p as ft}from"./starting-progress-DHv9oucO.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-DuPySS9V.js";import"./config-space-TsP5osn9.js";import"./spaces-fGcGlx-U.js";import"./api-BjteVZFg.js";import"./addon-3ZMGwARO.js";import"./QuestionMarkCircle-DTGyWFVS.js";import"./use-server-logo-CxuMvwKh.js";import"./use-mobile-C21X4TYN.js";import"./content-layout-fV4nyVb5.js";const xt=U(ct)`
|
|
2
2
|
&& .result-footer {
|
|
3
3
|
height: 120px;
|
|
4
4
|
> div {
|
|
5
5
|
flex-wrap: wrap;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,wt=xt;function N({onPrevious:a,launcherSession:w}){const{t:o}=
|
|
8
|
+
`,wt=xt;function N({onPrevious:a,launcherSession:w}){const{t:o}=q(),[W,k]=c.useState(!1),[i,d]=c.useState("starting"),[l,b]=c.useState(),[p,v]=c.useState(null),{blocklet:t}=Z(),[m,H]=c.useState(""),S=A("fromLauncher"),O=A("launcherUrl"),Q=mt(O),V=dt(w==null?void 0:w.userDid),h=!["starting","running"].includes(i),R=i==="starting",P={stopped:o("blocklet.start"),starting:o("blocklet.starting"),running:o("blocklet.open")},C=lt(async()=>{var I,M;const s=((I=t==null?void 0:t.controller)==null?void 0:I.launcherSessionId)||((M=t==null?void 0:t.meta)==null?void 0:M.did),r=s?`/apps/${s}/overview`:"apps",n=await ot(Q);return it(F(n,"/u/",r),V)});c.useEffect(()=>{C().then(s=>{v(s)}).catch(()=>{v(null)})},[C]);const E=()=>{if(S&&p){window.location.href=p;return}const r=new URL(window.location.href).searchParams.get("redirect");if(!m||!J(m)){z.error(o("blocklet.gotoVisitError"));return}let n=new URL(m);r&&(n=new URL(r,m));const L=tt.get("login_token");n.host!==window.location.host&&L&&(n.pathname=F(Y.WELLKNOWN_SERVICE_PATH_PREFIX,"redirect-with-login"),n.searchParams.set("setupToken",L)),window.location.href=ut(n.href)},j=async()=>{var s;k(!0),d("starting");try{await et.post("/blocklet/start?fromSetup=1");const{blocklet:{status:r}={}}=await rt.getBlocklet({input:{did:t.meta.did}});k(!1),d(r),b(r==="running"?null:o("setup.complete.notRunning"))}catch(r){const n=((s=r==null?void 0:r.response)==null?void 0:s.data)||r.message;z.error(n),k(!1),d("stopped"),b(n)}};c.useEffect(()=>{d(t.status),["starting","running"].includes(t.status)||j()},[]),c.useEffect(()=>{m||(async()=>{const r=await st.evaluateURLs(t.site.domainAliases.map(n=>nt(n.value,at)),{preferAccessible:!0});r.length>0&&H(r[0].url)})()},[t,m]);const g=y(()=>{var s;return(s=t==null?void 0:t.children)==null?void 0:s.length},[t]),f=y(()=>{var s,r;return((r=(s=t==null?void 0:t.children)==null?void 0:s.filter(n=>n.status==="running"))==null?void 0:r.length)||0},[t]),x=y(()=>g?f?Math.round(Math.max(f/g,.15)*100):5:0,[f,g]),$=localStorage.getItem("blocklet-server-url"),B=R||!m;S&&!B&&(h?j():E());const X=G(ft,h?{ml:3}:{},R?{width:`${x}%`,"&::after":{width:`${x}%`},"&::before":{width:`${x}%`,animation:"shimmer 1s infinite cubic-bezier(0.4, 0.0, 0.2, 1)","@keyframes shimmer":{"0%":{width:0},"100%":{width:`${x}%`}}}}:{}),K={starting:o("setup.complete.readyToStart"),running:o("setup.complete.title")},T=e.jsx(ht,{blocklets:t.children??[],status:i,debounce:!1,children:e.jsx(D,{sx:X,onClick:()=>h?j():E(),loading:B,children:e.jsx("span",{style:{position:"relative",zIndex:2},children:i==="starting"&&!l?`(${f}/${g}) ${o("blocklet.starting")}`:P[i]||P.stopped})})});return e.jsx(kt,{children:e.jsx(wt,{variant:l?"error":"success",title:e.jsxs(u,{display:"flex",flexDirection:"column",alignItems:"center",gap:1,children:[e.jsx(u,{fontSize:24,fontWeight:600,children:l?o("setup.complete.failedTitle"):K[i]||""}),i==="starting"&&!l?e.jsx(gt,{blocklets:t.children??[]}):null]}),footer:e.jsxs(St,{children:[h&&e.jsx(D,{variant:"outlined",disabled:W,onClick:()=>a(),children:o("setup.previous")}),S?e.jsxs(e.Fragment,{children:[e.jsx(u,{display:"flex",flexDirection:"column",alignItems:"center",gap:1,children:T}),l&&p?e.jsx(u,{width:"100%",mt:2,children:e.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:o("launchBlocklet.nav.viewMyApps")})}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(u,{display:"flex",flexDirection:"column",alignItems:"center",gap:1,children:T}),(i==="running"||l)&&!!$&&e.jsx(u,{width:"100%",mt:2,children:e.jsx("a",{href:$,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:o("setup.complete.backToServer")})}),l&&e.jsx(u,{className:"error-message",fontSize:14,color:"#888",mt:1,children:l})]})]})})})}const kt=U(pt)`
|
|
9
9
|
justify-content: center;
|
|
10
10
|
.icon-success {
|
|
11
11
|
width: 64px;
|