@abtnode/blocklet-services 1.17.8 → 1.17.9
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/dist/assets/{Google-CG1lv5ol.js → Google-BpkBLSiL.js} +1 -1
- package/dist/assets/{access-control-CWoVUHgh.js → access-control-BIhY5wfd.js} +1 -1
- package/dist/assets/{actions-rfPaFLCj.js → actions-Cqfaor6G.js} +1 -1
- package/dist/assets/{add-component-core-D0UktG5E.js → add-component-core-B8HzULLJ.js} +1 -1
- package/dist/assets/{add-resource-B7lRLkA_.js → add-resource-CEddRkJz.js} +1 -1
- package/dist/assets/{advanced-ymKehsrI.js → advanced-DkQUAOtW.js} +1 -1
- package/dist/assets/{aigne-yDpeUg7z.js → aigne-BXMpb7iF.js} +1 -1
- package/dist/assets/{appearance-CG-6r2py.js → appearance-xmocGS9K.js} +1 -1
- package/dist/assets/{audit-logs-C-OsN7ub.js → audit-logs-BJPoC3sp.js} +1 -1
- package/dist/assets/{authorize-DjikDURs.js → authorize-CeTEulz5.js} +1 -1
- package/dist/assets/{base32-BFSrw7-h.js → base32-Cx5Qjcq5.js} +1 -1
- package/dist/assets/{bind-account-BVdU9BOU.js → bind-account-Dpc4iwR3.js} +1 -1
- package/dist/assets/{branding-D6MicIet.js → branding-Bz1ajNEX.js} +1 -1
- package/dist/assets/{branding-C42_zeHW.js → branding-OeU_TRNz.js} +1 -1
- package/dist/assets/{branding-CqLoLW7D.js → branding-vz6onXUa.js} +1 -1
- package/dist/assets/{bundle-avatar-7Wt_FbiF.js → bundle-avatar-CQ5BcuIS.js} +1 -1
- package/dist/assets/{complete-ziHMeIgC.js → complete-RloCU6Dp.js} +1 -1
- package/dist/assets/{component-Djqgi00F.js → component-Cjmzo-fv.js} +2 -2
- package/dist/assets/{config-Bko_B6fT.js → config-Bb4cFHRC.js} +1 -1
- package/dist/assets/{config-BQiW0tZA.js → config-CJmL1lNg.js} +1 -1
- package/dist/assets/{config-navigation-BwAXHqA4.js → config-navigation-CV6BVvIo.js} +2 -2
- package/dist/assets/{config-DtX2hGRq.js → config-rELfdDu6.js} +1 -1
- package/dist/assets/{config-space-DMk4apM9.js → config-space-CjtdFXkd.js} +1 -1
- package/dist/assets/{confirm-BMWka5pp.js → confirm-DhDNorbd.js} +1 -1
- package/dist/assets/{connect-D7P92kCs.js → connect-DrvWw6WK.js} +1 -1
- package/dist/assets/{connect-BP5XU00d.js → connect-J76vh4nC.js} +1 -1
- package/dist/assets/{connect-CzwZd1QL.js → connect-pvi_9C1U.js} +1 -1
- package/dist/assets/{connect-to-D5tNZXTo.js → connect-to-BRIhV6_s.js} +1 -1
- package/dist/assets/{dashboard-BZs_YRr4.js → dashboard-OrVG8J2E.js} +2 -2
- package/dist/assets/{delete-confirm-CwOFci6r.js → delete-confirm-C0N4quT9.js} +1 -1
- package/dist/assets/{domain-CvkFdrHE.js → domain-DRBQmuep.js} +1 -1
- package/dist/assets/{domain-action-card-D9LF4Rpy.js → domain-action-card-BXg1GQv4.js} +1 -1
- package/dist/assets/{domains-BeQB_OAv.js → domains-ClxiW6KS.js} +1 -1
- package/dist/assets/{email-DmH_Ukt2.js → email-QHwvdq0F.js} +1 -1
- package/dist/assets/engine-BmJsBu5Z.js +1 -0
- package/dist/assets/{exchange-passport-CidDSOuv.js → exchange-passport-_nLFQuN2.js} +1 -1
- package/dist/assets/{federated-detail-dialog-CkIKuPwA.js → federated-detail-dialog-B3FXukx8.js} +1 -1
- package/dist/assets/{form-DwiizKm1.js → form-BEZi0to4.js} +1 -1
- package/dist/assets/{fuel-D1KEpJ7m.js → fuel-D3ouL-7h.js} +1 -1
- package/dist/assets/{gen-access-key-rsAO4mAP.js → gen-access-key-DDpUJQ6-.js} +1 -1
- package/dist/assets/{gen-simple-access-key-DGcsvu3t.js → gen-simple-access-key-BTB-PYVK.js} +1 -1
- package/dist/assets/{get-safe-url-C1Ml6qBb.js → get-safe-url-uxJSMQTF.js} +1 -1
- package/dist/assets/{home-DKIZCHrI.js → home-BuvlMo1H.js} +1 -1
- package/dist/assets/{iframe-eNnbtEC_.js → iframe-CVEnFycA.js} +1 -1
- package/dist/assets/{index-DliNbpRr.js → index--yN2lwQm.js} +1 -1
- package/dist/assets/{index-BDz_o8O7.js → index-8APBdkv_.js} +1 -1
- package/dist/assets/{index-BVgxwS3B.js → index-BLYrVxV3.js} +1 -1
- package/dist/assets/{index-3rd8tEjJ.js → index-BLi7-52u.js} +1 -1
- package/dist/assets/{index-CPwDD0Vr.js → index-BaK_cJO7.js} +1 -1
- package/dist/assets/{index-B4YwAnux.js → index-Bz8EYhmA.js} +1 -1
- package/dist/assets/{index-DtobDjZ_.js → index-C0ZPC8OS.js} +1 -1
- package/dist/assets/{index-BjD8juw_.js → index-C2_MQP4T.js} +1 -1
- package/dist/assets/{index-BKqykGJ0.js → index-C2jYGrXX.js} +1 -1
- package/dist/assets/{index-ChjBQq8c.js → index-C9rUhDwd.js} +1 -1
- package/dist/assets/{index-fulV4VYn.js → index-CBR-Vn-z.js} +1 -1
- package/dist/assets/{index-BqN4XYa3.js → index-CEH7q22l.js} +1 -1
- package/dist/assets/{index-QkGGubJA.js → index-CNX69Q5e.js} +1 -1
- package/dist/assets/{index-qy92cIq_.js → index-CUa0qHck.js} +1 -1
- package/dist/assets/{index-DPBkkhMC.js → index-CZWagtq4.js} +1 -1
- package/dist/assets/{index-C_8V6Zdm.js → index-C_LVs1QE.js} +1 -1
- package/dist/assets/{index-CRVOCdMR.js → index-CbgqxO1V.js} +1 -1
- package/dist/assets/{index-BgdIPmn8.js → index-CeSwZI3Q.js} +1 -1
- package/dist/assets/{index-DOtXGGiB.js → index-CeaSaqPE.js} +1 -1
- package/dist/assets/{index-DcM4ljaV.js → index-CgSpL7jz.js} +4 -4
- package/dist/assets/{index-dA_JPQDw.js → index-CiGaRVW9.js} +1 -1
- package/dist/assets/{index-6ovPLp0y.js → index-D0mTUcjJ.js} +2 -2
- package/dist/assets/{index-BtpVtm9d.js → index-DI80KOep.js} +1 -1
- package/dist/assets/{index-EZZK7Nyo.js → index-DwaBdfGv.js} +3 -3
- package/dist/assets/{index-CEsBpdP3.js → index-DzOChX1R.js} +1 -1
- package/dist/assets/{index-rwBbhEdR.js → index-WAnZs-pf.js} +1 -1
- package/dist/assets/{index-DjpY9R14.js → index-_llkmI7F.js} +1 -1
- package/dist/assets/{index-t0K-45aJ.js → index-k0OLPTEM.js} +1 -1
- package/dist/assets/{info-outline-rounded-CxbBCZbx.js → info-outline-rounded-CmLwPXzn.js} +1 -1
- package/dist/assets/{invitation-tRY9vnXE.js → invitation-CcqRXA0x.js} +1 -1
- package/dist/assets/{invitations-Db5hitbJ.js → invitations-Rtn4ZgkA.js} +1 -1
- package/dist/assets/{invite-FhylBBBB.js → invite-BVCWrw1u.js} +1 -1
- package/dist/assets/{issue-passport-BMFNH3nj.js → issue-passport-D9KC0G_A.js} +1 -1
- package/dist/assets/{item-CHfrpFLz.js → item-Cno3GsuG.js} +1 -1
- package/dist/assets/{layout-ej-JNJCP.js → layout-DkUZePxy.js} +1 -1
- package/dist/assets/{list-CIMWgr08.js → list-BaZEqvv_.js} +1 -1
- package/dist/assets/{list-DX9meaEq.js → list-qpUoyhan.js} +1 -1
- package/dist/assets/{localization-DJF_aQrB.js → localization-VWhLouBc.js} +1 -1
- package/dist/assets/{log-C-XJlJmX.js → log-CGsJ5N6b.js} +1 -1
- package/dist/assets/{login-WWa0obto.js → login-BUZAiJi7.js} +1 -1
- package/dist/assets/{login-oauth-callback-558tm7Kk.js → login-oauth-callback-D7IVWJCK.js} +1 -1
- package/dist/assets/{logo-uploader-C_AnxhNP.js → logo-uploader-CEZXDf8O.js} +1 -1
- package/dist/assets/{lost-passport-DauVMfLO.js → lost-passport-BShdkOY2.js} +1 -1
- package/dist/assets/{metadata-CbEG9b2n.js → metadata-iEUnwzkK.js} +1 -1
- package/dist/assets/{open-window-hkynwoL5.js → open-window-CKutfNqx.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-CPLJV5KG.js → over-due-invoice-payment-D6491JHf.js} +1 -1
- package/dist/assets/{overview-JVbZ7hCB.js → overview-ns7CHx6H.js} +1 -1
- package/dist/assets/{passport-bxIQRuHM.js → passport-2AVRJTQK.js} +1 -1
- package/dist/assets/{passport-item-C7svpOMT.js → passport-item-CeYGFFGn.js} +1 -1
- package/dist/assets/{permission-CiRkLVwn.js → permission-C2bdzuoM.js} +1 -1
- package/dist/assets/{preferences-DgvuFkNS.js → preferences-Bm3lpvWM.js} +1 -1
- package/dist/assets/{profile-embed-DyHkusY5.js → profile-embed-CBiaNgfm.js} +1 -1
- package/dist/assets/{publish-resource-DqQSmKCy.js → publish-resource-Cb8cFftb.js} +1 -1
- package/dist/assets/{runtime-OuwOSzER.js → runtime-W3sVCToB.js} +1 -1
- package/dist/assets/sdk-CuoW9qgj.js +1 -0
- package/dist/assets/{security-DwWYfqfY.js → security-FuAWjgqg.js} +1 -1
- package/dist/assets/{session-D6Z4R7oi.js → session-BEf_KK-i.js} +1 -1
- package/dist/assets/{setup-N7vDP87_.js → setup-BUrG-d2H.js} +1 -1
- package/dist/assets/{spaces-B8t2gKsu.js → spaces-DiyZ082O.js} +1 -1
- package/dist/assets/{start-D0WlW7li.js → start-Rwj2OQ5m.js} +1 -1
- package/dist/assets/{starting-progress--6NzzPU1.js → starting-progress-s-XqSluO.js} +1 -1
- package/dist/assets/{status-DI89bjlc.js → status-CTDbw135.js} +1 -1
- package/dist/assets/{step-actions-D0ooBDiZ.js → step-actions-Ezqn_AMv.js} +1 -1
- package/dist/assets/{studio-fGrv4L1C.js → studio-CYIn9aNz.js} +1 -1
- package/dist/assets/{team-sypU8pIA.js → team-Bso_Sjaa.js} +1 -1
- package/dist/assets/{traffic-CB937Mlw.js → traffic-BqxYiIWh.js} +1 -1
- package/dist/assets/{transfer-C29v213E.js → transfer-OPn3RlKK.js} +1 -1
- package/dist/assets/{unsubscribe-D4mqt-ru.js → unsubscribe-CdltWhMv.js} +1 -1
- package/dist/assets/{use-app-logo-Dt5Rf_oh.js → use-app-logo-DcBQK--f.js} +1 -1
- package/dist/assets/{user-center-BNVLcFuw.js → user-center-Bc5-qHT9.js} +2 -2
- package/dist/assets/{user-follower-BF8dghPj.js → user-follower-D8zGIprF.js} +1 -1
- package/dist/assets/{util-BKm61knf.js → util-CIgNPQhV.js} +1 -1
- package/dist/assets/{util-C7ejGMZd.js → util-Cz5-V-1E.js} +1 -1
- package/dist/assets/{utils-yU0z64Pf.js → utils-CWRBZd9l.js} +1 -1
- package/dist/assets/{wait-connect-B1z3SEpN.js → wait-connect-2CirehkG.js} +1 -1
- package/dist/assets/{wallet-hidden-topbar-SQtOXLKg.js → wallet-hidden-topbar-CZaZNW94.js} +1 -1
- package/dist/assets/{wizard-components-Dxf0c0dt.js → wizard-components-BwA5watz.js} +1 -1
- package/dist/assets/{wizard-DwUESHQa.js → wizard-xTNgKfB7.js} +1 -1
- package/dist/assets/{wrap-locale-Ck3xud_e.js → wrap-locale-AxlzuLIu.js} +1 -1
- package/dist/assets/{zh-oZCQbfAf.js → zh-BYHnQ2ca.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +23 -23
- package/dist/assets/engine-CvxZhwAf.js +0 -1
- package/dist/assets/sdk-BDbUPswI.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as Ce,d as xe,g as ke,a as s,r as A}from"./vendor-react-DX7tU9aY.js";import{X as g}from"./vendor-mui-core-CDEc-eG6.js";import{ao as wt,ap as Et,aq as St,$ as R,t as Ct,ar as kt,d as Rt,as as N,c as We}from"./vendor-utils-_C9URqjS.js";import{bK as _t}from"./index-DcM4ljaV.js";import{r as Ot}from"./cloneDeep-D_udiNLL.js";var k={},$={};const Re=Ce(wt),Mt=Ce(Et),Ft=Ce(St);var Ie;function Bt(){if(Ie)return $;Ie=1,Object.defineProperty($,"__esModule",{value:!0}),$.flattenNames=void 0;var a=_t,e=h(a),t=Re,r=h(t),n=Mt,i=h(n),o=Ft,l=h(o);function h(c){return c&&c.__esModule?c:{default:c}}var p=$.flattenNames=function c(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,l.default)(u,function(f){Array.isArray(f)?c(f).map(function(v){return d.push(v)}):(0,i.default)(f)?(0,r.default)(f,function(v,b){v===!0&&d.push(b),d.push(b+"-"+v)}):(0,e.default)(f)&&d.push(f)}),d};return $.default=p,$}var L={},qe;function At(){if(qe)return L;qe=1,Object.defineProperty(L,"__esModule",{value:!0}),L.mergeClasses=void 0;var a=Re,e=i(a),t=Ot,r=i(t),n=Object.assign||function(l){for(var h=1;h<arguments.length;h++){var p=arguments[h];for(var c in p)Object.prototype.hasOwnProperty.call(p,c)&&(l[c]=p[c])}return l};function i(l){return l&&l.__esModule?l:{default:l}}var o=L.mergeClasses=function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=h.default&&(0,r.default)(h.default)||{};return p.map(function(u){var d=h[u];return d&&(0,e.default)(d,function(f,v){c[v]||(c[v]={}),c[v]=n({},c[v],d[v])}),u}),c};return L.default=o,L}var j={},Ve;function Ht(){if(Ve)return j;Ve=1,Object.defineProperty(j,"__esModule",{value:!0}),j.autoprefix=void 0;var a=Re,e=r(a),t=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&(o[p]=h[p])}return o};function r(o){return o&&o.__esModule?o:{default:o}}var n={borderRadius:function(l){return{msBorderRadius:l,MozBorderRadius:l,OBorderRadius:l,WebkitBorderRadius:l,borderRadius:l}},boxShadow:function(l){return{msBoxShadow:l,MozBoxShadow:l,OBoxShadow:l,WebkitBoxShadow:l,boxShadow:l}},userSelect:function(l){return{WebkitTouchCallout:l,KhtmlUserSelect:l,MozUserSelect:l,msUserSelect:l,WebkitUserSelect:l,userSelect:l}},flex:function(l){return{WebkitBoxFlex:l,MozBoxFlex:l,WebkitFlex:l,msFlex:l,flex:l}},flexBasis:function(l){return{WebkitFlexBasis:l,flexBasis:l}},justifyContent:function(l){return{WebkitJustifyContent:l,justifyContent:l}},transition:function(l){return{msTransition:l,MozTransition:l,OTransition:l,WebkitTransition:l,transition:l}},transform:function(l){return{msTransform:l,MozTransform:l,OTransform:l,WebkitTransform:l,transform:l}},absolute:function(l){var h=l&&l.split(" ");return{position:"absolute",top:h&&h[0],right:h&&h[1],bottom:h&&h[2],left:h&&h[3]}},extend:function(l,h){var p=h[l];return p||{extend:l}}},i=j.autoprefix=function(l){var h={};return(0,e.default)(l,function(p,c){var u={};(0,e.default)(p,function(d,f){var v=n[f];v?u=t({},u,v(d)):u[f]=d}),h[c]=u}),h};return j.default=i,j}var z={},Xe;function Pt(){if(Xe)return z;Xe=1,Object.defineProperty(z,"__esModule",{value:!0}),z.hover=void 0;var a=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(h[u]=c[u])}return h},e=xe(),t=r(e);function r(h){return h&&h.__esModule?h:{default:h}}function n(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function i(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function o(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var l=z.hover=function(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(u){o(d,u);function d(){var f,v,b,m;n(this,d);for(var E=arguments.length,O=Array(E),C=0;C<E;C++)O[C]=arguments[C];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(O))),b),b.state={hover:!1},b.handleMouseOver=function(){return b.setState({hover:!0})},b.handleMouseOut=function(){return b.setState({hover:!1})},b.render=function(){return t.default.createElement(c,{onMouseOver:b.handleMouseOver,onMouseOut:b.handleMouseOut},t.default.createElement(p,a({},b.props,b.state)))},v),i(b,m)}return d})(t.default.Component)};return z.default=l,z}var G={},Ye;function Tt(){if(Ye)return G;Ye=1,Object.defineProperty(G,"__esModule",{value:!0}),G.active=void 0;var a=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(h[u]=c[u])}return h},e=xe(),t=r(e);function r(h){return h&&h.__esModule?h:{default:h}}function n(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function i(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function o(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var l=G.active=function(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(u){o(d,u);function d(){var f,v,b,m;n(this,d);for(var E=arguments.length,O=Array(E),C=0;C<E;C++)O[C]=arguments[C];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(O))),b),b.state={active:!1},b.handleMouseDown=function(){return b.setState({active:!0})},b.handleMouseUp=function(){return b.setState({active:!1})},b.render=function(){return t.default.createElement(c,{onMouseDown:b.handleMouseDown,onMouseUp:b.handleMouseUp},t.default.createElement(p,a({},b.props,b.state)))},v),i(b,m)}return d})(t.default.Component)};return G.default=l,G}var fe={},Ke;function Nt(){if(Ke)return fe;Ke=1,Object.defineProperty(fe,"__esModule",{value:!0});var a=function(t,r){var n={},i=function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n[l]=h};return t===0&&i("first-child"),t===r-1&&i("last-child"),(t===0||t%2===0)&&i("even"),Math.abs(t%2)===1&&i("odd"),i("nth-child",t),n};return fe.default=a,fe}var Ze;function Dt(){if(Ze)return k;Ze=1,Object.defineProperty(k,"__esModule",{value:!0}),k.ReactCSS=k.loop=k.handleActive=k.handleHover=k.hover=void 0;var a=Bt(),e=d(a),t=At(),r=d(t),n=Ht(),i=d(n),o=Pt(),l=d(o),h=Tt(),p=d(h),c=Nt(),u=d(c);function d(v){return v&&v.__esModule?v:{default:v}}k.hover=l.default,k.handleHover=l.default,k.handleActive=p.default,k.loop=u.default;var f=k.ReactCSS=function(b){for(var m=arguments.length,E=Array(m>1?m-1:0),O=1;O<m;O++)E[O-1]=arguments[O];var C=(0,e.default)(E),P=(0,r.default)(b,C);return(0,i.default)(P)};return k.default=f,k}var _e=Dt();const y=ke(_e);var $t=function(e,t,r,n,i){var o=i.clientWidth,l=i.clientHeight,h=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,p=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=h-(i.getBoundingClientRect().left+window.pageXOffset),u=p-(i.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var d=void 0;if(u<0?d=0:u>l?d=1:d=Math.round(u*100/l)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(c<0?f=0:c>o?f=1:f=Math.round(c*100/o)/100,n!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},we={},Lt=function(e,t,r,n){if(typeof document>"u"&&!n)return null;var i=n?new n:document.createElement("canvas");i.width=r*2,i.height=r*2;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,r,r),o.translate(r,r),o.fillRect(0,0,r,r),i.toDataURL()):null},jt=function(e,t,r,n){var i=e+"-"+t+"-"+r+(n?"-server":"");if(we[i])return we[i];var o=Lt(e,t,r,n);return we[i]=o,o},Je=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},oe=function(e){var t=e.white,r=e.grey,n=e.size,i=e.renderers,o=e.borderRadius,l=e.boxShadow,h=e.children,p=y({default:{grid:{borderRadius:o,boxShadow:l,absolute:"0px 0px 0px 0px",background:"url("+jt(t,r,n,i.canvas)+") center left"}}});return A.isValidElement(h)?s.cloneElement(h,Je({},h.props,{style:Je({},h.props.style,p.grid)})):s.createElement("div",{style:p.grid})};oe.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var zt=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},Gt=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})();function Ut(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function Qe(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function Wt(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var Oe=(function(a){Wt(e,a);function e(){var t,r,n,i;Ut(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(r=(n=Qe(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),n),n.handleChange=function(p){var c=$t(p,n.props.hsl,n.props.direction,n.props.a,n.container);c&&typeof n.props.onChange=="function"&&n.props.onChange(c,p)},n.handleMouseDown=function(p){n.handleChange(p),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},r),Qe(n,i)}return Gt(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var r=this,n=this.props.rgb,i=y({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
|
|
1
|
+
import{e as Ce,d as xe,g as ke,a as s,r as A}from"./vendor-react-DX7tU9aY.js";import{X as g}from"./vendor-mui-core-CDEc-eG6.js";import{ao as wt,ap as Et,aq as St,$ as R,t as Ct,ar as kt,d as Rt,as as N,c as We}from"./vendor-utils-_C9URqjS.js";import{bK as _t}from"./index-CgSpL7jz.js";import{r as Ot}from"./cloneDeep-D_udiNLL.js";var k={},$={};const Re=Ce(wt),Mt=Ce(Et),Ft=Ce(St);var Ie;function Bt(){if(Ie)return $;Ie=1,Object.defineProperty($,"__esModule",{value:!0}),$.flattenNames=void 0;var a=_t,e=h(a),t=Re,r=h(t),n=Mt,i=h(n),o=Ft,l=h(o);function h(c){return c&&c.__esModule?c:{default:c}}var p=$.flattenNames=function c(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,l.default)(u,function(f){Array.isArray(f)?c(f).map(function(v){return d.push(v)}):(0,i.default)(f)?(0,r.default)(f,function(v,b){v===!0&&d.push(b),d.push(b+"-"+v)}):(0,e.default)(f)&&d.push(f)}),d};return $.default=p,$}var L={},qe;function At(){if(qe)return L;qe=1,Object.defineProperty(L,"__esModule",{value:!0}),L.mergeClasses=void 0;var a=Re,e=i(a),t=Ot,r=i(t),n=Object.assign||function(l){for(var h=1;h<arguments.length;h++){var p=arguments[h];for(var c in p)Object.prototype.hasOwnProperty.call(p,c)&&(l[c]=p[c])}return l};function i(l){return l&&l.__esModule?l:{default:l}}var o=L.mergeClasses=function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=h.default&&(0,r.default)(h.default)||{};return p.map(function(u){var d=h[u];return d&&(0,e.default)(d,function(f,v){c[v]||(c[v]={}),c[v]=n({},c[v],d[v])}),u}),c};return L.default=o,L}var j={},Ve;function Ht(){if(Ve)return j;Ve=1,Object.defineProperty(j,"__esModule",{value:!0}),j.autoprefix=void 0;var a=Re,e=r(a),t=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&(o[p]=h[p])}return o};function r(o){return o&&o.__esModule?o:{default:o}}var n={borderRadius:function(l){return{msBorderRadius:l,MozBorderRadius:l,OBorderRadius:l,WebkitBorderRadius:l,borderRadius:l}},boxShadow:function(l){return{msBoxShadow:l,MozBoxShadow:l,OBoxShadow:l,WebkitBoxShadow:l,boxShadow:l}},userSelect:function(l){return{WebkitTouchCallout:l,KhtmlUserSelect:l,MozUserSelect:l,msUserSelect:l,WebkitUserSelect:l,userSelect:l}},flex:function(l){return{WebkitBoxFlex:l,MozBoxFlex:l,WebkitFlex:l,msFlex:l,flex:l}},flexBasis:function(l){return{WebkitFlexBasis:l,flexBasis:l}},justifyContent:function(l){return{WebkitJustifyContent:l,justifyContent:l}},transition:function(l){return{msTransition:l,MozTransition:l,OTransition:l,WebkitTransition:l,transition:l}},transform:function(l){return{msTransform:l,MozTransform:l,OTransform:l,WebkitTransform:l,transform:l}},absolute:function(l){var h=l&&l.split(" ");return{position:"absolute",top:h&&h[0],right:h&&h[1],bottom:h&&h[2],left:h&&h[3]}},extend:function(l,h){var p=h[l];return p||{extend:l}}},i=j.autoprefix=function(l){var h={};return(0,e.default)(l,function(p,c){var u={};(0,e.default)(p,function(d,f){var v=n[f];v?u=t({},u,v(d)):u[f]=d}),h[c]=u}),h};return j.default=i,j}var z={},Xe;function Pt(){if(Xe)return z;Xe=1,Object.defineProperty(z,"__esModule",{value:!0}),z.hover=void 0;var a=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(h[u]=c[u])}return h},e=xe(),t=r(e);function r(h){return h&&h.__esModule?h:{default:h}}function n(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function i(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function o(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var l=z.hover=function(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(u){o(d,u);function d(){var f,v,b,m;n(this,d);for(var E=arguments.length,O=Array(E),C=0;C<E;C++)O[C]=arguments[C];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(O))),b),b.state={hover:!1},b.handleMouseOver=function(){return b.setState({hover:!0})},b.handleMouseOut=function(){return b.setState({hover:!1})},b.render=function(){return t.default.createElement(c,{onMouseOver:b.handleMouseOver,onMouseOut:b.handleMouseOut},t.default.createElement(p,a({},b.props,b.state)))},v),i(b,m)}return d})(t.default.Component)};return z.default=l,z}var G={},Ye;function Tt(){if(Ye)return G;Ye=1,Object.defineProperty(G,"__esModule",{value:!0}),G.active=void 0;var a=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var c=arguments[p];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(h[u]=c[u])}return h},e=xe(),t=r(e);function r(h){return h&&h.__esModule?h:{default:h}}function n(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function i(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function o(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var l=G.active=function(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(u){o(d,u);function d(){var f,v,b,m;n(this,d);for(var E=arguments.length,O=Array(E),C=0;C<E;C++)O[C]=arguments[C];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(O))),b),b.state={active:!1},b.handleMouseDown=function(){return b.setState({active:!0})},b.handleMouseUp=function(){return b.setState({active:!1})},b.render=function(){return t.default.createElement(c,{onMouseDown:b.handleMouseDown,onMouseUp:b.handleMouseUp},t.default.createElement(p,a({},b.props,b.state)))},v),i(b,m)}return d})(t.default.Component)};return G.default=l,G}var fe={},Ke;function Nt(){if(Ke)return fe;Ke=1,Object.defineProperty(fe,"__esModule",{value:!0});var a=function(t,r){var n={},i=function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n[l]=h};return t===0&&i("first-child"),t===r-1&&i("last-child"),(t===0||t%2===0)&&i("even"),Math.abs(t%2)===1&&i("odd"),i("nth-child",t),n};return fe.default=a,fe}var Ze;function Dt(){if(Ze)return k;Ze=1,Object.defineProperty(k,"__esModule",{value:!0}),k.ReactCSS=k.loop=k.handleActive=k.handleHover=k.hover=void 0;var a=Bt(),e=d(a),t=At(),r=d(t),n=Ht(),i=d(n),o=Pt(),l=d(o),h=Tt(),p=d(h),c=Nt(),u=d(c);function d(v){return v&&v.__esModule?v:{default:v}}k.hover=l.default,k.handleHover=l.default,k.handleActive=p.default,k.loop=u.default;var f=k.ReactCSS=function(b){for(var m=arguments.length,E=Array(m>1?m-1:0),O=1;O<m;O++)E[O-1]=arguments[O];var C=(0,e.default)(E),P=(0,r.default)(b,C);return(0,i.default)(P)};return k.default=f,k}var _e=Dt();const y=ke(_e);var $t=function(e,t,r,n,i){var o=i.clientWidth,l=i.clientHeight,h=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,p=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=h-(i.getBoundingClientRect().left+window.pageXOffset),u=p-(i.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var d=void 0;if(u<0?d=0:u>l?d=1:d=Math.round(u*100/l)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(c<0?f=0:c>o?f=1:f=Math.round(c*100/o)/100,n!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},we={},Lt=function(e,t,r,n){if(typeof document>"u"&&!n)return null;var i=n?new n:document.createElement("canvas");i.width=r*2,i.height=r*2;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,r,r),o.translate(r,r),o.fillRect(0,0,r,r),i.toDataURL()):null},jt=function(e,t,r,n){var i=e+"-"+t+"-"+r+(n?"-server":"");if(we[i])return we[i];var o=Lt(e,t,r,n);return we[i]=o,o},Je=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},oe=function(e){var t=e.white,r=e.grey,n=e.size,i=e.renderers,o=e.borderRadius,l=e.boxShadow,h=e.children,p=y({default:{grid:{borderRadius:o,boxShadow:l,absolute:"0px 0px 0px 0px",background:"url("+jt(t,r,n,i.canvas)+") center left"}}});return A.isValidElement(h)?s.cloneElement(h,Je({},h.props,{style:Je({},h.props.style,p.grid)})):s.createElement("div",{style:p.grid})};oe.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var zt=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r])}return a},Gt=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})();function Ut(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function Qe(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function Wt(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var Oe=(function(a){Wt(e,a);function e(){var t,r,n,i;Ut(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(r=(n=Qe(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),n),n.handleChange=function(p){var c=$t(p,n.props.hsl,n.props.direction,n.props.a,n.container);c&&typeof n.props.onChange=="function"&&n.props.onChange(c,p)},n.handleMouseDown=function(p){n.handleChange(p),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleChange),window.removeEventListener("mouseup",n.handleMouseUp)},r),Qe(n,i)}return Gt(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var r=this,n=this.props.rgb,i=y({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
|
|
2
2
|
rgba(`+n.r+","+n.g+","+n.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:n.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+n.r+","+n.g+","+n.b+`, 0) 0%,
|
|
3
3
|
rgba(`+n.r+","+n.g+","+n.b+", 1) 100%)"},pointer:{left:0,top:n.a*100+"%"}},overwrite:zt({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return s.createElement("div",{style:i.alpha},s.createElement("div",{style:i.checkboard},s.createElement(oe,{renderers:this.props.renderers})),s.createElement("div",{style:i.gradient}),s.createElement("div",{style:i.container,ref:function(l){return r.container=l},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("div",{style:i.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:i.slider}))))}}]),e})(A.PureComponent||A.Component),It=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})();function qt(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function Vt(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function Xt(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function Yt(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var Kt=1,ft=38,Zt=40,Jt=[ft,Zt],Qt=function(e){return Jt.indexOf(e)>-1},er=function(e){return Number(String(e).replace(/%/g,""))},tr=1,w=(function(a){Yt(e,a);function e(t){Vt(this,e);var r=Xt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(n){r.setUpdatedValue(n.target.value,n)},r.handleKeyDown=function(n){var i=er(n.target.value);if(!isNaN(i)&&Qt(n.keyCode)){var o=r.getArrowOffset(),l=n.keyCode===ft?i+o:i-o;r.setUpdatedValue(l,n)}},r.handleDrag=function(n){if(r.props.dragLabel){var i=Math.round(r.props.value+n.movementX);i>=0&&i<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(i),n)}},r.handleMouseDown=function(n){r.props.dragLabel&&(n.preventDefault(),r.handleDrag(n),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},r.inputId="rc-editable-input-"+tr++,r}return It(e,[{key:"componentDidUpdate",value:function(r,n){this.props.value!==this.state.value&&(r.value!==this.props.value||n.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return qt({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||Kt}},{key:"setUpdatedValue",value:function(r,n){var i=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(i,n),this.setState({value:r})}},{key:"render",value:function(){var r=this,n=y({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return s.createElement("div",{style:n.wrap},s.createElement("input",{id:this.inputId,style:n.input,ref:function(o){return r.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?s.createElement("label",{htmlFor:this.inputId,style:n.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e})(A.PureComponent||A.Component),rr=function(e,t,r,n){var i=n.clientWidth,o=n.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,h=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,p=l-(n.getBoundingClientRect().left+window.pageXOffset),c=h-(n.getBoundingClientRect().top+window.pageYOffset);if(t==="vertical"){var u=void 0;if(c<0)u=359;else if(c>o)u=0;else{var d=-(c*100/o)+100;u=360*d/100}if(r.h!==u)return{h:u,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var f=void 0;if(p<0)f=0;else if(p>i)f=359;else{var v=p*100/i;f=360*v/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},nr=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})();function ar(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function et(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function ir(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var le=(function(a){ir(e,a);function e(){var t,r,n,i;ar(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(r=(n=et(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),n),n.handleChange=function(p){var c=rr(p,n.props.direction,n.props.hsl,n.container);c&&typeof n.props.onChange=="function"&&n.props.onChange(c,p)},n.handleMouseDown=function(p){n.handleChange(p),window.addEventListener("mousemove",n.handleChange),window.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},r),et(n,i)}return nr(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var r=this,n=this.props.direction,i=n===void 0?"horizontal":n,o=y({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:i==="vertical"});return s.createElement("div",{style:o.hue},s.createElement("div",{className:"hue-"+i,style:o.container,ref:function(h){return r.container=h},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("style",null,`
|
|
4
4
|
.hue-horizontal {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as E,j as e,al as l,z as j,bJ as L,bK as y,bL as _,aT as b,X as I}from"./vendor-mui-core-CDEc-eG6.js";import{r as m}from"./vendor-react-DX7tU9aY.js";import{aa as A,a3 as N}from"./vendor-ux-PO0jFgJf.js";import{A as v}from"./config-
|
|
1
|
+
import{G as E,j as e,al as l,z as j,bJ as L,bK as y,bL as _,aT as b,X as I}from"./vendor-mui-core-CDEc-eG6.js";import{r as m}from"./vendor-react-DX7tU9aY.js";import{aa as A,a3 as N}from"./vendor-ux-PO0jFgJf.js";import{A as v}from"./config-Bb4cFHRC.js";import{a as O}from"./page-header-CEL5h6do.js";import{v as R,n as T,cj as Y,ck as a,o as k,cl as f,ac as D,cm as P,cn as B,co as U}from"./index-CgSpL7jz.js";import{S as V}from"./layout-DkUZePxy.js";import{S as z}from"./step-actions-Ezqn_AMv.js";import{S as F}from"./button-BdkIS-Qs.js";import"./vendor-utils-_C9URqjS.js";import"./vendor-hooks-Ca2cSNuD.js";import"./vendor-arcblock-BVQTtbN-.js";import"./content-layout-D49-hpq6.js";import"./use-mobile-DUKvJoqs.js";function w({onNext:o=()=>{}}){const x=E(),{t:n,locale:p}=A(),[i,c]=m.useState(!1),[u,d]=m.useState(""),{blocklet:r}=R();m.useEffect(()=>{const t=T.findServiceFromMeta(r.meta,Y.AUTH);d(t?.config?.whoCanAccess||a.ALL)},[r]);const S=async t=>{let s=f;t===a.ALL?s=f:t===a.INVITED?s=P:t===a.OWNER?s=B:t===a.ADMIN&&(s=U);try{c(!0),await k.updateBlockletSecurityRule({input:{did:r.meta.did,data:{id:D,accessPolicyId:s}}}),c(!1)}catch(g){c(!1),N.error(g.message)}},C=async t=>{i||(d(t.target.value),await S(t.target.value))},h={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:x.palette.text.secondary};return e.jsxs(H,{children:[e.jsx(l,{className:"header",children:e.jsx(O,{title:n("blocklet.config.access.title"),subTitle:n("blocklet.config.access.description")})}),e.jsx(l,{className:"form-container",children:e.jsx(j,{component:"fieldset",children:e.jsx(L,{name:"inherit",value:u,onChange:C,children:v.map(t=>e.jsxs(l,{sx:{mb:2,"&:last-child":{mb:0}},children:[e.jsx(y,{value:t.value,control:e.jsx(_,{size:"small",color:"primary"}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center",position:"relative"},children:[e.jsx(t.icon,{style:h}),e.jsx("span",{style:{marginTop:2},children:t.title[p]})]})}),e.jsx(l,{className:"tip",children:t.description[p]})]},t.value))})})}),e.jsx(z,{mt:8,disabled:i,blocklet:r,onStartNow:()=>o("complete"),children:e.jsx(F,{loading:i,variant:"contained",disabled:i,onClick:()=>o(),children:n("setup.continue")})})]})}w.propTypes={onNext:I.func};const H=b(V)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
.header {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n,b4 as N,A as V,b3 as Q,al as K,aT as w,Z as Y,b1 as ee,a0 as te,R as z,a7 as H,S as ne,X as i}from"./vendor-mui-core-CDEc-eG6.js";import{r as T}from"./vendor-react-DX7tU9aY.js";import{n as L,ad as C}from"./vendor-utils-_C9URqjS.js";import{b8 as U,b9 as q,ba as O,bb as re}from"./index-
|
|
1
|
+
import{j as n,b4 as N,A as V,b3 as Q,al as K,aT as w,Z as Y,b1 as ee,a0 as te,R as z,a7 as H,S as ne,X as i}from"./vendor-mui-core-CDEc-eG6.js";import{r as T}from"./vendor-react-DX7tU9aY.js";import{n as L,ad as C}from"./vendor-utils-_C9URqjS.js";import{b8 as U,b9 as q,ba as O,bb as re}from"./index-CgSpL7jz.js";import{a3 as _,$ as X,bP as ie,ab as W,bl as A,ae}from"./vendor-ux-PO0jFgJf.js";import{b as u}from"./vendor-hooks-Ca2cSNuD.js";import{d as G}from"./passkey-rounded-_WDHIZVd.js";import{R as oe}from"./login-method-item-CmdeSlz8.js";import{C as P}from"./isEmail-BwGDo3Ws.js";const se={width:24,height:24,body:'<path fill="currentColor" d="M18 11h-2q-.425 0-.713-.288T15 10q0-.425.288-.713T16 9h2V7q0-.425.288-.713T19 6q.425 0 .713.288T20 7v2h2q.425 0 .713.288T23 10q0 .425-.288.713T22 11h-2v2q0 .425-.288.713T19 14q-.425 0-.713-.288T18 13v-2Zm-9 1q-1.65 0-2.825-1.175T5 8q0-1.65 1.175-2.825T9 4q1.65 0 2.825 1.175T13 8q0 1.65-1.175 2.825T9 12Zm-8 6v-.8q0-.85.438-1.563T2.6 14.55q1.55-.775 3.15-1.163T9 13q1.65 0 3.25.388t3.15 1.162q.725.375 1.163 1.088T17 17.2v.8q0 .825-.588 1.413T15 20H3q-.825 0-1.413-.588T1 18Z"/>'},F=6;function J({ref:g,extraParams:m={},createMode:p="connect",action:y,onSuccess:x=L,onError:j=L}){const{api:v,locale:E,t:a,loginPasskey:D,logoutPasskey:I,passkeyState:e,connectPasskey:$}=U(),c=p==="register",[h,l]=T.useState(!1),d=window.innerWidth<600,M=u(()=>{e.openDialog=!0,e.error="",e.creatingStatus="",e.verifyingStatus="";const t=e.email;l(t&&c?!P(t):!1)}),S=u(()=>{e.openDialog=!1,e.error="",e.creatingStatus="",e.verifyingStatus="";const t=e.email;l(t&&c?!P(t):!1)}),o=u(async t=>{if(t.preventDefault(),c&&!P(e.email)){l(!0);return}l(!1),e.loading=!0;try{await v.post(`../kyc/email/send?locale=${E}`,{email:e.email}),e.sent=!0,_.success(a("codeSentSuccess"))}catch(r){_.error(r.message),document.getElementById("email-input")?.focus()}finally{e.loading=!1}}),R=u(async(t="")=>{try{e.verifying=!0,e.error="",t||(e.verifyingStatus="");const r=await D({...m,action:y,credentialId:t}),s=X({expireInDays:7});q.remove("connected_did",s),q.remove("connected_pk",s),q.remove("connected_wallet_os",s),e.verifying=!1,r?.sessionToken&&(e.verifyingStatus="succeed",x({...r,encrypted:!1},B=>B))}catch(r){console.error("Failed to verify passkey",r);const s=O(r,a("verifyPasskeyFailed"));e.verifying=!1,e.error=s,e.verifyingStatus="error",await I(),j(new Error(s))}}),b=u(async()=>{if(c&&!P(e.email)){l(!0);return}l(!1),e.creating=!0,e.error="",e.creatingStatus="";try{const t=await $({...m,action:y,purpose:c?"register":"connect",email:c?ie.encode(e.email):""});if(!t){e.error=a("cancelAuth"),e.creatingStatus="error",e.creating=!1,e.verifying=!1,e.verifyingStatus="";return}e.creating=!1,e.openDialog=!1,e.creatingStatus="succeed",p==="connect"?x({...t,encrypted:!1},r=>r):t?.credentialId&&R(t.credentialId)}catch(t){console.error("Failed to create passkey",t),e.creating=!1,e.error=O(t,a("createPasskeyFailed")),e.creatingStatus="error"}}),k=u(async t=>{t&&t.preventDefault(),e.loading=!0;try{await v.post(`../kyc/email/verify?locale=${E}`,{code:e.code}),e.verified=!0,b()}catch(r){_.error(r.message),e.verified=!1,document.getElementById(`code-input-${C(e.code).length-1}`)?.focus()}finally{e.loading=!1}});T.useImperativeHandle(g,()=>({open:M,close:S,handleVerifyCode:k}),[M,S,k]);const f=()=>n.jsxs(n.Fragment,{children:[n.jsx(z,{onClick:S,sx:{color:"text.secondary"},children:a("cancel")}),c&&n.jsxs(z,{variant:"contained",onClick:e.verified?b:e.sent?k:o,disabled:e.verifying||e.creating||!e.email||e.sent&&C(e.code).length!==F,children:[(e.loading||e.creating)&&n.jsx(H,{size:16,sx:{mr:1}}),e.verified?a("createPasskey"):e.sent?a("verifyButton"):a("sendCodeButton")]}),!c&&n.jsx(z,{variant:"contained",color:"primary",onClick:b,disabled:e.loading||e.creating||c&&(!e.email||!e.verified),startIcon:(e.loading||e.creating)&&n.jsx(H,{size:16,sx:{mr:1},color:"inherit"}),children:e.loading||e.creating?a("creatingPasskey"):a("createPasskey")})]});return n.jsxs(ce,{open:e.openDialog,onClose:S,fullWidth:!0,maxWidth:"sm",fullScreen:d,children:[n.jsxs(le,{children:[n.jsx(pe,{children:n.jsx(W,{icon:G,fontSize:24,color:"initial"})}),a("createPasskey")]}),n.jsxs(de,{children:[n.jsx(A,{variant:"body1",children:a("createPasskeyDesc1")}),n.jsx(A,{variant:"body1",children:a("createPasskeyDesc2")}),e.error&&n.jsx(N,{severity:"error",children:e.error}),c&&n.jsxs(fe,{children:[!e.sent&&n.jsx(V,{type:"email",id:"email-input",size:"medium",placeholder:a("emailPlaceholder"),sx:{width:"100%",".MuiFormHelperText-root":{ml:0}},value:e.email,onChange:t=>{e.email=t.target.value,l(!P(e.email))},disabled:e.loading||e.creating,required:!0,error:h,helperText:h?a("emailInvalid"):""}),e.sent&&!e.verified&&n.jsxs(Q,{direction:"column",sx:{justifyContent:"center",alignItems:"center",mb:2},children:[n.jsx(A,{variant:"body2",children:a("codeSentMessage",{email:e.email})}),n.jsx(K,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:2,mt:0},children:Array(F).fill("").map((t,r)=>n.jsx(V,{value:C(e.code[r])||"",type:"number",margin:"none",onChange:s=>{const B=e.code.split("");B[r]=s.target.value,e.code=B.join(""),s.target.value&&r<5&&document.getElementById(`code-input-${r+1}`)?.focus()},onKeyDown:s=>{s.key==="Backspace"&&!C(e.code[r])&&r>0&&document.getElementById(`code-input-${r-1}`)?.focus()},disabled:e.loading,required:!0,id:`code-input-${r}`,autoComplete:"off",slotProps:{htmlInput:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"}}},`code-input-${r}`))})]})]}),d&&n.jsx(K,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",mt:2},children:f()})]}),!d&&n.jsx(ue,{children:f()})]})}J.propTypes={extraParams:i.object,createMode:i.string,action:i.string.isRequired,onSuccess:i.func,onError:i.func,ref:i.any.isRequired};const ce=w(Y)`
|
|
2
2
|
.MuiDialog-paper {
|
|
3
3
|
border-radius: 12px;
|
|
4
4
|
max-width: 440px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{X as _,j as l,a7 as Le,aT as pe,al as F,G as He,T as Y,L as tt,bK as Kr,a6 as Vr,I as qo,cy as Uo,U as zo,cs as Da,b$ as Na,aN as Ko,F as Ma,A as xn,bh as Aa,bi as Ba,bj as $a,cn as Fa,b4 as Vo,W as Wa,aM as qa,cP as Ua,cQ as za,cm as Ka,cG as Va,M as Hr,an as Ho,ar as Ha,b3 as ye,bX as Ga,bZ as Xa,a9 as Go,ae as Xo,aW as Ya,ak as Yo,R as Wt,Z as Ja,c3 as Jo,p as Qo,aV as Qa,as as Ze,cR as Za,cS as el,a_ as ci,V as ui,ai as tl,b_ as nl,Q as rl,N as il,P as ol,aj as sl,ao as Zo,C as di,aG as al,cT as ll}from"./vendor-mui-core-CDEc-eG6.js";import{r as O,g as es,j as cl,u as ul,e as dl,a as Ae,m as hl}from"./vendor-react-DX7tU9aY.js";import{r as Gr,S as fl,s as ts,A as pl}from"./item-
|
|
1
|
+
import{X as _,j as l,a7 as Le,aT as pe,al as F,G as He,T as Y,L as tt,bK as Kr,a6 as Vr,I as qo,cy as Uo,U as zo,cs as Da,b$ as Na,aN as Ko,F as Ma,A as xn,bh as Aa,bi as Ba,bj as $a,cn as Fa,b4 as Vo,W as Wa,aM as qa,cP as Ua,cQ as za,cm as Ka,cG as Va,M as Hr,an as Ho,ar as Ha,b3 as ye,bX as Ga,bZ as Xa,a9 as Go,ae as Xo,aW as Ya,ak as Yo,R as Wt,Z as Ja,c3 as Jo,p as Qo,aV as Qa,as as Ze,cR as Za,cS as el,a_ as ci,V as ui,ai as tl,b_ as nl,Q as rl,N as il,P as ol,aj as sl,ao as Zo,C as di,aG as al,cT as ll}from"./vendor-mui-core-CDEc-eG6.js";import{r as O,g as es,j as cl,u as ul,e as dl,a as Ae,m as hl}from"./vendor-react-DX7tU9aY.js";import{r as Gr,S as fl,s as ts,A as pl}from"./item-Cno3GsuG.js";import{bk as ke,b1 as Xr,ac as ns,aa as Ce,ab as je,c5 as ml,aF as gl,a3 as wn,c6 as hi,l as ut,ae as rs,a7 as hn,c7 as yl,bs as is,b2 as vl,aD as vr,c8 as bl}from"./vendor-ux-PO0jFgJf.js";import{X as wt,n as Ve,bm as xl,bn as wl,aL as Sl,aO as kl,bo as jl,bp as os,bq as Tl,br as Cl,z as El,Z as Ol,w as ss,bs as Pl,bt as Il,ar as _l,bu as Rl,V as Sn,bv as as,bd as ls,aZ as fi,bw as Ll,b5 as Dl,bx as Nl,F as et,by as Ml,bz as Jt,bA as pi,bB as Al}from"./index-CgSpL7jz.js";import{j as mi,o as Bl,T as $l,L as Fl,P as Wl}from"./vendor-arcblock-BVQTtbN-.js";import{u as gi}from"./launch-result-message-Br6OdJMs.js";import{a as br}from"./page-header-CEL5h6do.js";import{e as Se,B as ql,y as lt,F as kn,D as yi,a4 as cs,g as Qt,$ as Ul,aa as zl,x as Kl,o as Nn,ab as Vl,ak as Hl,al as Gl,am as Xl,a as Rt,an as Yl,b as Jl}from"./vendor-utils-_C9URqjS.js";import{f as xr}from"./index-DBs9Ljax.js";import{e as Ql}from"./engine-BmJsBu5Z.js";import{u as Zl,C as ec}from"./config-space-CjtdFXkd.js";import{R as Zt}from"./required-BO8emcue.js";import{S as tc}from"./index-CZWagtq4.js";import{s as us,h as nc,w as rc,f as ic,a as oc,b as sc,M as ac}from"./index-B0cxyMBd.js";import{r as qt,a as lc,b as cc,u as ds,i as uc,x as dc}from"./vendor-hooks-Ca2cSNuD.js";import{g as hc}from"./get-safe-url-uxJSMQTF.js";import{r as hs,A as fc}from"./config-rELfdDu6.js";import{r as jn}from"./index-BLYrVxV3.js";import{r as pc}from"./index-jIvFgWDS.js";import{r as mc}from"./cloneDeep-D_udiNLL.js";import{u as Yr}from"./useLocalStorage-CSvyQkk-.js";import{v as vi}from"./index-BEbBg3NW.js";import{u as gc}from"./session-BEf_KK-i.js";import{W as yc}from"./did-address-BNKX5oDP.js";import{R as vc}from"./login-method-item-CmdeSlz8.js";import{d as bc}from"./passkey-rounded-_WDHIZVd.js";import{a as bi}from"./api-Bo6lutcq.js";import{v as xc,e as wc}from"./util-Cz5-V-1E.js";import{u as fs}from"./use-mobile-CnCzXOEv.js";import{C as Sc}from"./content-layout-D49-hpq6.js";import{C as kc,D as jc,a as Tc}from"./connect-to-BRIhV6_s.js";import{k as Tn}from"./fallback-DAsXuNMP.js";import{d as Mn}from"./search-4YYphs0l.js";const qp="blocklet-add-component-registry",Up="server-add-registry",zp=e=>`resource-${e}-add-registry`;function ps(e){const{info:t}=wt();return O.useMemo(()=>!e||!e.docker?.image||e.docker?.image&&e.docker?.runBaseScript?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork,[e,t])}function ms({disabled:e=!1,children:t,onConfirm:n}){return O.useEffect(()=>{if(e)return()=>{};const r=s=>{s.code==="Enter"&&(s.metaKey===!0||s.ctrlKey===!0)&&(s.preventDefault(),s.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}ms.propTypes={disabled:_.bool,children:_.any.isRequired,onConfirm:_.func.isRequired};function gs({onContinue:e,nextDisabled:t=!1,launching:n=!1,texts:r={listenName:"",launchingText:"",buttonNext:""},description:s=""}){const[i,o]=O.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(Cc,{children:l.jsxs(ms,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:r.listenName}),l.jsx(ke,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?l.jsxs(l.Fragment,{children:[l.jsx(Le,{size:14}),r.launchingText]}):r.buttonNext})]})}),l.jsx(Xr,{open:i,title:r.listenName,onClose:()=>o(!1),children:s})]})}gs.propTypes={onContinue:_.func.isRequired,nextDisabled:_.bool,launching:_.bool,description:_.any,texts:_.object};const Cc=pe.div`
|
|
2
2
|
margin: 0 auto;
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as v,j as l}from"./vendor-mui-core-CDEc-eG6.js";import{m as B,r}from"./vendor-react-DX7tU9aY.js";import{y as L,D as W}from"./vendor-utils-_C9URqjS.js";import{aa as O,b1 as A}from"./vendor-ux-PO0jFgJf.js";import{A as T,S as _}from"./add-component-core-
|
|
1
|
+
import{L as v,j as l}from"./vendor-mui-core-CDEc-eG6.js";import{m as B,r}from"./vendor-react-DX7tU9aY.js";import{y as L,D as W}from"./vendor-utils-_C9URqjS.js";import{aa as O,b1 as A}from"./vendor-ux-PO0jFgJf.js";import{A as T,S as _}from"./add-component-core-B8HzULLJ.js";import{j as d,b as $,z as F}from"./vendor-hooks-Ca2cSNuD.js";import{v as K,af as z}from"./index-CgSpL7jz.js";import"./item-Cno3GsuG.js";import"./index-DBs9Ljax.js";import"./delete-confirm-C0N4quT9.js";import"./click-to-copy-BmatCVrP.js";import"./confirm-DhDNorbd.js";import"./session-BEf_KK-i.js";import"./get-safe-url-uxJSMQTF.js";import"./did-address-BNKX5oDP.js";import"./wait-connect-2CirehkG.js";import"./vendor-arcblock-BVQTtbN-.js";import"./launch-result-message-Br6OdJMs.js";import"./page-header-CEL5h6do.js";import"./engine-BmJsBu5Z.js";import"./config-space-CjtdFXkd.js";import"./spaces-DiyZ082O.js";import"./api-Bo6lutcq.js";import"./required-BO8emcue.js";import"./index-CZWagtq4.js";import"./Google-BpkBLSiL.js";import"./cloneDeep-D_udiNLL.js";import"./create-passport-svg-DNOT-xbE.js";import"./form-wrapper-BqPFgoVY.js";import"./logo-uploader-CEZXDf8O.js";import"./collapse-DRkXbQaT.js";import"./index-B0cxyMBd.js";import"./config-rELfdDu6.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./section-CC2BHD5s.js";import"./form-text-input-XsQkiayU.js";import"./edit.svg-BGhTyO6h.js";import"./index-jIvFgWDS.js";import"./index-BLYrVxV3.js";import"./useLocalStorage-CSvyQkk-.js";import"./index-BEbBg3NW.js";import"./login-method-item-CmdeSlz8.js";import"./passkey-rounded-_WDHIZVd.js";import"./util-Cz5-V-1E.js";import"./use-mobile-CnCzXOEv.js";import"./content-layout-D49-hpq6.js";import"./connect-to-BRIhV6_s.js";import"./index-CeSwZI3Q.js";import"./index-D29L5UKE.js";import"./index-BojVbZw0.js";import"./index-BY7bAdcP.js";import"./fallback-DAsXuNMP.js";import"./search-4YYphs0l.js";function Gt(){const{t:u}=O(),{blocklet:h}=K(),{componentDid:s}=B(),f=v(t=>t.breakpoints.down("md")),e=new URL(window.location.href),w=e.searchParams.get("mode")==="dialog",n=e.searchParams.get("resourceType")||"",m=e.searchParams.get("resourceDid")||s,g=e.searchParams.get("store")||"",R=e.searchParams.get("showFromUrl")!=="false",b=e.searchParams.get("showResourcesSwitch")!=="false",y=e.searchParams.get("enableRunBackground")!=="false",C=e.searchParams.get("showCategory")!=="false",a=h?.meta?.did,i=g.split(",").filter(Boolean).map(t=>{try{return new URL(t.startsWith("http")?t:`https://${t}`).origin}catch(o){return console.error(o),null}}).filter(Boolean),[S,E]=r.useState(i.map(t=>({url:t,name:t.replace("https://","")}))),[P,D]=r.useState(null),[U,j]=r.useState("");r.useEffect(()=>{(async()=>{try{const t=await Promise.all(i.map(async o=>{const x=L(o,"/api/store.json"),{data:M}=await W.get(x);return{url:o,name:M.name}}));E(t||[])}catch(t){console.error(t)}})()},[i.join(",")]);const k=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const t=z();return a&&t.connect(),()=>{a&&t.isConnected()&&t.disconnect()}},[a]),d(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const c=$(t=>{t.data?.event==="resourceDialog.select"&&t.data?.componentDid===s&&(D(t.data.data),j(t.data.storeUrl))});d(()=>{window.addEventListener("message",c)}),F(()=>{window.removeEventListener("message",c)});const p=({inDialog:t=!0}={})=>l.jsx(T,{stores:S,selectedMeta:P,storeUrl:U,resourceType:n,resourceDid:m,mode:"embed",inDialog:t,storageKey:_(`${n}+${m}`),showResourcesSwitch:b,showFromUrl:R,enableRunBackground:y,showCategory:C});return w?l.jsx(A,{className:"resource-dialog",title:u("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:f?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(t,o)=>{o!=="backdropClick"&&k()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:p()}):p({inDialog:!1})}export{Gt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as B,g as Ue}from"./vendor-react-DX7tU9aY.js";import{j as $,a7 as ue,al as P,R as We,dL as Ve,T as ee,X as U,bK as Ke,a6 as He,cn as Ge,b4 as Ze,aT as Oe,V as Ye,b3 as ne,A as Je,C as Qe,dM as Ae,b8 as Q,a4 as K,dN as Xe,an as xe,b6 as we}from"./vendor-mui-core-CDEc-eG6.js";import{X as te,V as et,w as Ce,n as tt,a4 as rt,cy as st,A as nt,cz as at,ax as it,cA as ge,cB as ot,cC as lt,cD as ct,cE as ce,ay as me,cF as ut,cG as ft,O as $e,E as Ee,aa as De,F as Y,cH as dt}from"./index-
|
|
1
|
+
import{r as B,g as Ue}from"./vendor-react-DX7tU9aY.js";import{j as $,a7 as ue,al as P,R as We,dL as Ve,T as ee,X as U,bK as Ke,a6 as He,cn as Ge,b4 as Ze,aT as Oe,V as Ye,b3 as ne,A as Je,C as Qe,dM as Ae,b8 as Q,a4 as K,dN as Xe,an as xe,b6 as we}from"./vendor-mui-core-CDEc-eG6.js";import{X as te,V as et,w as Ce,n as tt,a4 as rt,cy as st,A as nt,cz as at,ax as it,cA as ge,cB as ot,cC as lt,cD as ct,cE as ce,ay as me,cF as ut,cG as ft,O as $e,E as Ee,aa as De,F as Y,cH as dt}from"./index-CgSpL7jz.js";import{w as fe,P as mt}from"./permission-C2bdzuoM.js";import{aa as oe,bk as Z,a3 as H,b1 as Ie,bW as J,W as ae,ac as je,bj as pt}from"./vendor-ux-PO0jFgJf.js";import{w as Te}from"./vendor-hooks-Ca2cSNuD.js";import{C as be}from"./confirm-DhDNorbd.js";import{f as ie}from"./index-DBs9Ljax.js";import{u as ht}from"./useSetState-CUbypYGT.js";import{u as Le}from"./session-BEf_KK-i.js";import{S as V}from"./section-CC2BHD5s.js";import{C as gt}from"./click-to-copy-BmatCVrP.js";import{b as qe}from"./team-Bso_Sjaa.js";import{J as pe,ae as yt}from"./vendor-utils-_C9URqjS.js";import{v as bt}from"./index-BEbBg3NW.js";import{W as vt}from"./did-address-BNKX5oDP.js";import{V as _t}from"./status-CTDbw135.js";import{F as ke}from"./form-text-input-XsQkiayU.js";import"./vendor-arcblock-BVQTtbN-.js";import"./required-BO8emcue.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-CZaZNW94.js";import"./theme-mode-toggle-WRMGhjzA.js";import"./use-mobile-DKWj9MJD.js";import"./index-BLYrVxV3.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-nVOJALp0.js";import"./use-app-logo-DcBQK--f.js";import"./omit-CPWAgebP.js";import"./index-CBR-Vn-z.js";import"./form-wrapper-BqPFgoVY.js";import"./edit.svg-BGhTyO6h.js";const xt=localStorage.getItem("enableDebug")==="true";function wt({teamDid:T,size:O="small",...I}){const{t:A}=oe(),{api:j}=te(),[x,h]=B.useState(!1),[l,y]=B.useState(null),p=()=>{h(!1),y(null)},f=async()=>{try{h(!0);const n=await j.clearCache({input:{teamDid:T}});H.success(A("blocklet.config.clearCache.success",{count:n.removed?.length||0}))}catch(n){H.error(ie(n))}finally{h(!1),y(null)}},e={title:A("blocklet.config.clearCache.title"),description:A("blocklet.config.clearCache.description"),confirm:A("common.confirm"),cancel:A("common.cancel"),onConfirm:f,onCancel:p};return $.jsxs("div",{...I,children:[$.jsxs(Z,{onClick:()=>y(e),color:"error",variant:"outlined",size:O,children:[x?$.jsx(ue,{size:16,style:{marginRight:5}}):null,A("blocklet.config.clearCache.action")]}),l&&$.jsx(be,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}function Pe({onChange:T=()=>{},disabled:O=!1,loading:I=!1,inService:A=!1}){const{t:j}=oe(),{api:x,session:h}=Le(),{blocklet:l}=et(),[y,p]=ht({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>p({isConnectOpen:!1}),e=()=>{if(tt.isInProgress(l.status)){H.error(j("blocklet.error.isInProgress"));return}p({confirmDialogOpen:!0})};return $.jsxs($.Fragment,{children:[$.jsx(V,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:$.jsx(P,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:$.jsxs(We,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:O||I,onClick:e,children:[$.jsx(Ve,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),$.jsxs($.Fragment,{children:[y.isConnectOpen&&$.jsx(Ce,{popup:!0,open:y.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:x.get,checkTimeout:300*1e3,onSuccess:()=>{T(),A&&h.logout(),f()},extraParams:{appDid:l.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),y.confirmDialogOpen&&$.jsx(be,{title:$.jsx(ee,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:$.jsx(ee,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>p({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>p({confirmDialogOpen:!1})})]})]})}Pe.propTypes={onChange:U.func,disabled:U.bool,loading:U.bool,inService:U.bool};function Me({onCancel:T,onSuccess:O,onError:I=()=>{}}){const{api:A}=B.useContext(rt),[j,x]=B.useState(!1),{t:h,locale:l}=oe(),[y,p]=B.useState(""),[f,e]=B.useState(!1),[n,a]=B.useState(0),[r,t]=B.useState(""),{endpoint:o}=qe(),[s,i]=B.useState(!1),u=c=>{p(null),x(!0);try{t(c.result),a(_.length-1)}catch(m){const b=ie(m);p(b),I(m)}finally{x(!1)}},d=()=>{e(!0),a(1)},g=()=>{e(!1),a(0)},_=[{body:$.jsxs(P,{children:[$.jsx(ee,{children:h("team.transferApp.transferDialog.tips.progress")}),$.jsx(ee,{sx:{mt:3,mb:2},children:h("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:h("common.cancel"),confirm:h("team.transferApp.transferDialog.createTransferLink"),onCancel:T,onConfirm:d},{cancel:h("common.cancel"),confirm:h("team.transferApp.transferDialog.createTransferLink"),body:()=>$.jsx(Ce,{action:"transfer-app-owner",open:f,locale:l,checkFn:A.get,onClose:g,onSuccess:u,checkTimeout:300*1e3,extraParams:{},messages:{title:h("team.transferApp.connectDialog.title"),scan:h("team.transferApp.connectDialog.scan"),confirm:h("team.transferApp.connectDialog.confirm"),success:h("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=st({transferId:r.transferId,endpoint:o});return $.jsxs($.Fragment,{children:[$.jsx(P,{component:X,dangerouslySetInnerHTML:{__html:h("team.transferApp.transferDialog.createSuccessTip1")}}),$.jsx(P,{component:X,sx:{mt:2},children:$.jsx(X,{children:h("team.transferApp.transferDialog.createSuccessTip3")})}),$.jsxs(P,{children:[$.jsx(P,{component:X,sx:{mt:2},children:$.jsx(X,{children:h("team.transferApp.transferDialog.createSuccessTip2",{expireDate:nt(r.expireDate,l)})})}),$.jsx(P,{sx:{my:1},children:$.jsx(gt,{children:c})})]}),$.jsx("div",{children:$.jsx(Ke,{value:"end",control:$.jsx(He,{checked:s,onChange:m=>i(m.target.checked)}),label:h("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:h("common.confirm"),onConfirm:O}],v=_[n];return $.jsxs(Ie,{title:$.jsx(X,{className:"title",children:h("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:$.jsxs($.Fragment,{children:[v.cancel&&$.jsx(Z,{onClick:v.onCancel,color:"inherit",children:v.cancel}),$.jsxs(Z,{onClick:v.onConfirm,color:"error",disabled:j||n===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&$.jsx(ue,{size:16}),v.confirm]})]}),children:[$.jsx(Ge,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!y&&$.jsx(Ze,{severity:"error",variant:"icon",children:y})]})}Me.propTypes={onCancel:U.func.isRequired,onSuccess:U.func.isRequired,onError:U.func};const X=Oe.div`
|
|
2
2
|
font-size: 16px;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
&.title {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,al as d,R as p,aT as x,X as u}from"./vendor-mui-core-CDEc-eG6.js";import{r as o}from"./vendor-react-DX7tU9aY.js";import{bj as g}from"./vendor-ux-PO0jFgJf.js";import{a as h}from"./page-header-CEL5h6do.js";import{V as j}from"./index-
|
|
1
|
+
import{j as t,al as d,R as p,aT as x,X as u}from"./vendor-mui-core-CDEc-eG6.js";import{r as o}from"./vendor-react-DX7tU9aY.js";import{bj as g}from"./vendor-ux-PO0jFgJf.js";import{a as h}from"./page-header-CEL5h6do.js";import{V as j}from"./index-CgSpL7jz.js";import{A as b}from"./config-rELfdDu6.js";import{S as k}from"./step-actions-Ezqn_AMv.js";import{S}from"./layout-DkUZePxy.js";import"./vendor-utils-_C9URqjS.js";import"./vendor-hooks-Ca2cSNuD.js";import"./vendor-arcblock-BVQTtbN-.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./section-CC2BHD5s.js";import"./required-BO8emcue.js";import"./form-wrapper-BqPFgoVY.js";import"./form-text-input-XsQkiayU.js";import"./edit.svg-BGhTyO6h.js";import"./wait-connect-2CirehkG.js";import"./get-safe-url-uxJSMQTF.js";import"./index-jIvFgWDS.js";import"./index-DBs9Ljax.js";import"./use-mobile-DUKvJoqs.js";import"./content-layout-D49-hpq6.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=j(),i=o.useMemo(()=>e?.meta?.requirements,[e]),n=o.useRef(null),[a,m]=o.useState(!1),f=async()=>{try{m(!0),(await n.current.onSubmit()||!i?.aigne)&&s()}catch(c){console.error("error",c)}finally{m(!1)}};return t.jsxs(C,{children:[t.jsx("div",{className:"header",children:t.jsx(h,{title:r("setting.aigne.config"),onClickBack:l})}),t.jsx(d,{className:"form-container",children:t.jsx(b,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,ref:n,source:"setup",forceValidate:i?.aigne})}),t.jsxs(k,{blocklet:e,children:[!i?.aigne&&t.jsx(p,{className:"bottom-button-skip",sx:{mr:1},onClick:()=>s(),children:r("setup.skip")}),t.jsx(p,{className:"start-now bottom-button",loading:a,variant:"contained",disabled:a,onClick:f,children:r("setup.continue")})]})]})}y.propTypes={onNext:u.func,onPrevious:u.func};const C=x(S)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as E,x as T}from"./vendor-utils-_C9URqjS.js";import{X as j,V as k,W as M}from"./index-
|
|
1
|
+
import{y as E,x as T}from"./vendor-utils-_C9URqjS.js";import{X as j,V as k,W as M}from"./index-CgSpL7jz.js";import{r as e}from"./vendor-react-DX7tU9aY.js";import{aa as B}from"./vendor-ux-PO0jFgJf.js";import{u as H}from"./use-mobile-CnCzXOEv.js";import{G as I,j as o,al as w,a7 as N}from"./vendor-mui-core-CDEc-eG6.js";import"./vendor-arcblock-BVQTtbN-.js";import"./vendor-hooks-Ca2cSNuD.js";function z(){const{info:x,inService:g}=j(),{blocklet:y}=k(),{locale:u}=B(),f=e.useRef(null),r=I(),[L,R]=e.useState(0),m=H(),[t,S]=e.useState(!0),s=e.useRef(null);let a="";g?a=M:a=x.routing.adminPath;const c=new URLSearchParams;g?c.set("appUrl",window.location.origin):c.set("authKey","__sst"),c.set("schemaKey",E(window.location.origin,a,`/api/theme?id=${encodeURIComponent(y.meta.did)}`));const l=e.useCallback(()=>{if(s.current){const n=T(JSON.parse(JSON.stringify(r)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);s.current.contentWindow.postMessage({type:"SEND_THEME",payload:n},window.location.origin)}},[r]),d=e.useCallback(()=>{s.current&&s.current.contentWindow.postMessage({type:"SEND_LOCALE",payload:u},window.location.origin)},[u]);return e.useEffect(()=>{const n=i=>{i.origin===window.location.origin&&(i.data.type==="REQUEST_THEME"&&l(),i.data.type==="THEME_BUILDER_LOADED"&&(d(),S(!1)))};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[l,d]),e.useEffect(()=>{t===!1&&l()},[r,t,l]),e.useEffect(()=>{t===!1&&d()},[u,t,d]),e.useEffect(()=>{const n=document.querySelector("#arc__dashboard-main"),i=document.querySelector(".dashboard-content"),p=()=>{if(f.current){const{height:b}=n.getBoundingClientRect(),{top:C}=i.getBoundingClientRect(),{top:_}=f.current.getBoundingClientRect();let h=b-_+C-(m?108:164);m&&(h=Math.min(h,600)),R(h)}};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[m,r]),o.jsxs(o.Fragment,{children:[o.jsx(w,{ref:f}),t&&o.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px"},children:o.jsx(N,{})}),o.jsx("iframe",{title:"Theme Builder",ref:s,src:`${E(window.location.origin,a,"/hosted/theme-builder/")}?${c.toString()}`,style:{border:0,width:"100%",height:`${L}px`,display:t?"none":"block"}})]})}export{z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a3 as R,aa as E,bA as H,bT as F,ce as Z,b2 as G,bp as K}from"./vendor-ux-PO0jFgJf.js";import{X as V,W as B,L as Q}from"./index-
|
|
1
|
+
import{a3 as R,aa as E,bA as H,bT as F,ce as Z,b2 as G,bp as K}from"./vendor-ux-PO0jFgJf.js";import{X as V,W as B,L as Q}from"./index-CgSpL7jz.js";import{j as e,G as I,al as g,aY as X,T as z,an as W,b6 as Y,I as _,cc as q,dQ as J,L as ee,a7 as te,z as oe,y as ne,bN as se,M as re,bO as ae,aT as ie}from"./vendor-mui-core-CDEc-eG6.js";import{r as i,L as le}from"./vendor-react-DX7tU9aY.js";import{p as ce}from"./util-CIgNPQhV.js";import{u as de}from"./useLocalStorage-CSvyQkk-.js";import{M as D}from"./index-B0cxyMBd.js";import{d as pe,e as M}from"./vendor-utils-_C9URqjS.js";import{S as T}from"./shorten-label-CEQFm35C.js";import{r as O}from"./index-BUN3g9UB.js";import{b as ue}from"./team-Bso_Sjaa.js";import"./vendor-hooks-Ca2cSNuD.js";import"./vendor-arcblock-BVQTtbN-.js";import"./base32-Cx5Qjcq5.js";import"./session-BEf_KK-i.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-CZaZNW94.js";import"./theme-mode-toggle-WRMGhjzA.js";import"./use-mobile-DKWj9MJD.js";import"./index-BLYrVxV3.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-nVOJALp0.js";import"./use-app-logo-DcBQK--f.js";const N=i.createContext({}),{Provider:me,Consumer:Ge}=N;function fe(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function ge({children:t,scope:c="",categories:n=[],showScope:l,scopeFormatter:u,blocklets:x}){const{api:h,info:v}=V(),[C,m]=i.useState([]),[f,y]=i.useState({total:0,pageSize:fe(),pageCount:0,page:1}),[L,s]=i.useState(!1),[w,a]=i.useState(""),[d,o]=de(`audit-log-category-${c}`,"all"),j=[{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($=>n.length?$.value==="all"||n.includes($.value):!0),b=async({page:$=1,pageSize:r=20,silent:P=!0}={})=>{if(!L){P||s(!0);try{const S=await h.getAuditLogs({input:{paging:{page:$,pageSize:r},category:d==="all"?"":d,scope:c,actionOrContent:w}});l&&(S.list||[]).forEach(A=>{A.scope!==v.did&&(A.link=`/blocklets/${A.scope}/components`)}),m(S.list),y(S.paging),s(!1)}catch(S){R.error(S.message),s(!1)}}};i.useEffect(()=>{localStorage.setItem("audit-log-page-size",f.pageSize)},[f.pageSize]),i.useEffect(()=>{b({page:1,pageSize:f.pageSize,silent:!1})},[]),i.useEffect(()=>{b({page:1,pageSize:f.pageSize,silent:!1})},[d,w]);const k={loading:L,fetch:b,filter:{category:d,scope:c},categories:j,blocklets:x,setCategory:o,data:C,paging:f,setPaging:y,showScope:l,scopeFormatter:u,actionOrContent:w,setActionOrContent:a};return e.jsx(me,{value:{auditLogs:k},children:t})}function U(){const{auditLogs:t}=i.useContext(N);return t}function xe(t){if(!t)return[];const c=/\[([^\]]+)\]\(([^)]+)\)/g,n=[];let l;for(;(l=c.exec(t))!==null;)n.push({text:l[1],url:l[2]});return n}const he=`
|
|
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)"/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as A,j as e,al as t,a7 as z,R as l,ci as R,T as a,aY as W,an as I,bP as E,bK as L,a6 as O,a4 as T,bb as j,b3 as D}from"./vendor-mui-core-CDEc-eG6.js";import{r as x}from"./vendor-react-DX7tU9aY.js";import{w as F}from"./vendor-hooks-Ca2cSNuD.js";import{y as f}from"./vendor-utils-_C9URqjS.js";import{u as U,W as b,U as B,H,aQ as M,aR as K,m as Q}from"./index-
|
|
1
|
+
import{L as A,j as e,al as t,a7 as z,R as l,ci as R,T as a,aY as W,an as I,bP as E,bK as L,a6 as O,a4 as T,bb as j,b3 as D}from"./vendor-mui-core-CDEc-eG6.js";import{r as x}from"./vendor-react-DX7tU9aY.js";import{w as F}from"./vendor-hooks-Ca2cSNuD.js";import{y as f}from"./vendor-utils-_C9URqjS.js";import{u as U,W as b,U as B,H,aQ as M,aR as K,m as Q}from"./index-CgSpL7jz.js";import{K as u}from"./landing-page-BvgQ3gcP.js";import{aa as V,M as y}from"./vendor-ux-PO0jFgJf.js";import{W as Y}from"./did-address-BNKX5oDP.js";import"./vendor-arcblock-BVQTtbN-.js";import"./use-blocklet-logo-nVOJALp0.js";function se(){const{searchParams:r}=new URL(window.location.href),{session:d}=U(),{t:c}=V(),p=r.get("client_id"),w=r.get("scope")||"profile:read",[m,_]=x.useState(w.split(" ").filter(Boolean)),v=A("(max-width: 600px)"),k=f(window.location.origin,b,"/oauth/authorize"),C=x.useCallback(i=>i?i.startsWith("http")?i:`${f(b,"/api/media/upload",window.blocklet.appPid)}/${i}`:"",[]),[h,g]=F({client:null,loading:!0});x.useEffect(()=>{(async()=>{const{data:n}=await Q.get("/oauth/client",{params:{clientId:p}});g({client:n,loading:!1})})()},[p,g]);const S=i=>{i!=="profile:read"&&_(n=>n.includes(i)?n.filter(P=>P!==i):[...n,i])};if(h.loading||!d?.user)return e.jsx(u,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(z,{})})});if(!h.client)return e.jsx(u,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(B,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(l,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(R,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:s}=h,{user:o}=d,N=(s.scope||"").split(" ");return e.jsxs(u,{did:window.blocklet?.appPid,standalone:!0,children:[e.jsx(H,{children:e.jsxs("title",{children:[c("oauth.authorize")," | ",window.blocklet?.appName]})}),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(y,{src:window.blocklet?.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(y,{src:C(s.logo_uri),alt:s.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:s.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:o.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(I,{title:o.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:o.fullName})}),e.jsx(t,{className:"did",children:e.jsx(Y,{compact:!0,responsive:!1,did:o.did,showQrcode:!v})})]})]}),e.jsxs(a,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",s.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(E,{children:Object.entries(K).filter(([i])=>N.includes(i)).map(([i,n])=>e.jsx(L,{control:e.jsx(O,{checked:m.includes(i),onChange:()=>S(i),disabled:i==="profile:read"||["blocklet:read","blocklet:write"].includes(i)&&!["owner","admin","member"].includes(o.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}},i))})}),(s.tos_uri||s.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"," ",!!s.tos_uri&&e.jsx(j,{href:s.tos_uri,target:"_blank",children:"Terms of Use"}),!!s.tos_uri&&!!s.policy_uri&&" and ",!!s.policy_uri&&e.jsx(j,{href:s.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:k,children:[r.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:r.get("client_id")}),r.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:r.get("response_type")}),r.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:r.get("redirect_uri")}),r.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:r.get("code_challenge")}),r.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:r.get("code_challenge_method")}),r.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:r.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:m.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(D,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(a,{variant:"body2",sx:{color:"text.secondary"},children:"You will be redirected to"}),e.jsx(a,{variant:"body2",sx:{color:"text.secondary",wordBreak:"break-all"},children:r.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(a,{variant:"body2",children:["Not you?"," ",e.jsx(l,{variant:"text",color:"primary",onClick:()=>d.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aL as x}from"./index-
|
|
1
|
+
import{aL as x}from"./index-CgSpL7jz.js";import{e as m}from"./vendor-react-DX7tU9aY.js";class w{constructor(e,r,o){this.name=e,this.prefix=r,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class g{constructor(e,r,o){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.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 l(this,e)}}class y{constructor(e){this.decoders=e}or(e){return l(this,e)}decode(e){const r=e[0],o=this.decoders[r];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 l=(t,e)=>new y({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class E{constructor(e,r,o,s){this.name=e,this.prefix=r,this.baseEncode=o,this.baseDecode=s,this.encoder=new w(e,r,o),this.decoder=new g(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const A=({name:t,prefix:e,encode:r,decode:o})=>new E(t,e,r,o),C=(t,e,r,o)=>{const s={};for(let p=0;p<e.length;++p)s[e[p]]=p;let i=t.length;for(;t[i-1]==="=";)--i;const a=new Uint8Array(i*r/8|0);let n=0,c=0,h=0;for(let p=0;p<i;++p){const u=s[t[p]];if(u===void 0)throw new SyntaxError(`Non-${o} character`);c=c<<r|u,n+=r,n>=8&&(n-=8,a[h++]=255&c>>n)}if(n>=r||255&c<<8-n)throw new SyntaxError("Unexpected end of data");return a},P=(t,e,r)=>{const o=e[e.length-1]==="=",s=(1<<r)-1;let i="",a=0,n=0;for(let c=0;c<t.length;++c)for(n=n<<8|t[c],a+=8;a>r;)a-=r,i+=e[s&n>>a];if(a&&(i+=e[s&n<<r-a]),o)for(;i.length*r&7;)i+="=";return i},d=({name:t,prefix:e,bitsPerChar:r,alphabet:o})=>A({prefix:e,name:t,encode(s){return P(s,o,r)},decode(s){return C(s,o,r,t)}}),$=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),v=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),B=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),j=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),k=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),D=Object.freeze(Object.defineProperty({__proto__:null,base32:$,base32hex:q,base32hexpad:O,base32hexpadupper:j,base32hexupper:B,base32pad:S,base32padupper:U,base32upper:v,base32z:k},Symbol.toStringTag,{value:"Module"})),N=m(D);var f,b;function L(){if(b)return f;b=1;const{toBuffer:t,toAddress:e,toBase58:r,toHex:o}=x(),{base32:s}=N;return f={encode:n=>{if(!n)return n;const c=t(e(n));return s.encode(c)},decode:n=>{if(!n)return n;const c=s.decode(n),h=r(c);return h.length>30?h:o(c)}},f}export{L as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,al as l,b4 as B,T as f,G as H,n as Z,an as $,X as u}from"./vendor-mui-core-CDEc-eG6.js";import{V as O,u as U,w as I,c9 as P}from"./index-
|
|
1
|
+
import{j as e,al as l,b4 as B,T as f,G as H,n as Z,an as $,X as u}from"./vendor-mui-core-CDEc-eG6.js";import{V as O,u as U,w as I,c9 as P}from"./index-CgSpL7jz.js";import{aa as D,ab as w,bi as F,ac as G}from"./vendor-ux-PO0jFgJf.js";import{a as Q}from"./page-header-CEL5h6do.js";import{r as x}from"./vendor-react-DX7tU9aY.js";import{U as X}from"./actions-Cqfaor6G.js";import{S as W}from"./button-BdkIS-Qs.js";import{S as Y}from"./layout-DkUZePxy.js";import{S as _}from"./step-actions-Ezqn_AMv.js";import"./vendor-arcblock-BVQTtbN-.js";import"./vendor-hooks-Ca2cSNuD.js";import"./vendor-utils-_C9URqjS.js";import"./passkey-rounded-_WDHIZVd.js";import"./login-method-item-CmdeSlz8.js";import"./isEmail-BwGDo3Ws.js";import"./isIP-BBY240SU.js";import"./content-layout-D49-hpq6.js";import"./use-mobile-DUKvJoqs.js";const J={width:24,height:24,body:'<path fill="currentColor" d="M17 17q.625 0 1.063-.438T18.5 15.5q0-.625-.438-1.063T17 14q-.625 0-1.063.438T15.5 15.5q0 .625.438 1.063T17 17Zm0 3q.775 0 1.425-.363t1.05-.962q-.55-.325-1.175-.5T17 18q-.675 0-1.3.175t-1.175.5q.4.6 1.05.963T17 20Zm0 2q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22Zm-5 0q-3.475-.875-5.738-3.988T4 11.1V5l8-3l8 3v5.675q-.65-.325-1.463-.5T17 10q-2.9 0-4.95 2.05T10 17q0 1.55.588 2.8t1.487 2.175q-.025 0-.037.013T12 22Z"/>'},K={width:24,height:24,body:'<path fill="currentColor" d="M7 15q1.25 0 2.125-.875T10 12q0-1.25-.875-2.125T7 9q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15Zm0 3q-2.5 0-4.25-1.75T1 12q0-2.5 1.75-4.25T7 6q2.025 0 3.538 1.15T12.65 10h8.375L23 11.975l-3.5 4L17 14l-2 2l-2-2h-.35q-.625 1.8-2.175 2.9T7 18Z"/>'},ee={width:24,height:24,body:'<path fill="currentColor" d="M4 20q-.825 0-1.413-.588T2 18V6q0-.825.588-1.413T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.588 1.413T20 20H4Zm8-7L4 8v10h16V8l-8 5Zm0-2l8-5H4l8 5ZM4 8V6v12V8Z"/>'},te={width:24,height:24,body:'<path fill="currentColor" d="M6 20q-1.65 0-2.825-1.175T2 16V8q0-1.65 1.175-2.825T6 4h12q1.65 0 2.825 1.175T22 8v8q0 1.65-1.175 2.825T18 20H6ZM6 8h12q.55 0 1.05.125t.95.4V8q0-.825-.588-1.413T18 6H6q-.825 0-1.413.588T4 8v.525q.45-.275.95-.4T6 8Zm-1.85 3.25l11.125 2.7q.225.05.45 0t.425-.2l3.475-2.9q-.275-.375-.7-.613T18 10H6q-.65 0-1.137.338t-.713.912Z"/>'},z=n=>({wallet:{icon:te,label:n("setup.connectAccount.wallet"),description:n("setup.connectAccount.walletDesc"),isDefault:!1,priority:1},passkey:{icon:K,label:n("setup.connectAccount.passkey"),description:n("setup.connectAccount.passkeyDesc"),isDefault:!1,priority:2},email:{icon:ee,label:n("setup.connectAccount.email"),description:n("setup.connectAccount.emailDesc"),isDefault:!0,priority:3}});function M({type:n,account:b=null,onBind:s,bindButton:g=null,loading:q=!1,recommended:o=!1}){const{t:m}=D(),a=z(m)[n],h=!!b,i=H();return e.jsx(l,{sx:{mb:2,p:{xs:1.5,sm:2},border:1,borderColor:o?Z(i.palette.primary.main,.2):"divider",borderRadius:1,bgcolor:o?Z(i.palette.primary.main,.08):"background.paper"},children:e.jsxs(l,{sx:{display:"flex",alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:{xs:1.5,sm:2}},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1.5,width:{xs:"100%",sm:"auto"}},children:[e.jsx(w,{icon:a.icon,style:{fontSize:"20px"}}),e.jsxs(l,{sx:{flex:1,minWidth:0},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[e.jsx(f,{variant:"subtitle2",sx:{fontWeight:500,fontSize:{xs:"0.875rem",sm:"1rem"}},children:a.label}),h&&c("mobile"),o&&e.jsx(f,{variant:"caption",sx:{color:"warning.main",fontWeight:500,fontSize:"0.7rem"},children:m("setup.connectAccount.recommended")})]}),e.jsx(l,{sx:{mt:.5},children:C(b)})]})]}),a.isDefault?c():e.jsx(l,{sx:{width:{xs:"100%",sm:"auto"},display:"flex",justifyContent:"center"},children:h?c():g||e.jsx(W,{variant:"outlined",size:"small",onClick:()=>s(n),disabled:q,fullWidth:{xs:!0,sm:!1},sx:{borderColor:"primary.main",height:"32px !important",minWidth:{xs:"100%",sm:"60px"},fontSize:{xs:"0.875rem",sm:"0.8125rem"}},children:m("setup.connectAccount.connect")})})]})});function C(d){return h?d.displayName===d.did?e.jsx(G,{did:d.did,showQrcode:!0}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",mt:.5},children:d.displayName}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a.description})}function c(d){const p=d==="mobile";return e.jsx(l,{sx:{minWidth:p?"auto":{xs:"100%",sm:"60px"},display:p?{xs:"flex",md:"none"}:{xs:"none",md:"flex"},alignItems:"center",justifyContent:"center"},children:e.jsx($,{title:m("setup.connectAccount.connected"),placement:"top",children:e.jsx(w,{icon:P,style:{color:i.palette.success.main,fontSize:p?"18px":"24px"}})})})}}M.propTypes={type:u.string.isRequired,account:u.object,onBind:u.func.isRequired,bindButton:u.node,loading:u.bool,recommended:u.bool};function se({onNext:n=()=>{},onPrevious:b=()=>{}}){const{t:s}=D(),{blocklet:g}=O(),[q,o]=x.useState(!1),[m,a]=x.useState(!1),[h,i]=x.useState(null),{api:C,session:c}=U(),d=x.useRef(null),p=()=>{const t=c.user?.connectedAccounts||[],r={};return t.forEach(j=>{const{provider:S,userInfo:E,did:T,id:L}=j;S==="email"?r.email={did:T,displayName:L?.replace("email|","")||c.user?.email,...j}:S==="wallet"?r.wallet={did:T,displayName:T,...j}:S==="passkey"&&(r.passkey={did:T,displayName:E?.name||T,...j})}),r},[y,N]=x.useState(p());x.useEffect(()=>{N(p())},[c]);const V=t=>{i(t),o(!0),t==="wallet"?a(!0):t==="passkey"&&d.current.click()},k=()=>{c.refresh(),o(!1),a(!1),i(null)},v=z(s),R=Object.keys(v).filter(r=>!y[r]&&!v[r].isDefault).slice(0,2),A=Object.values(y).filter(Boolean).length;return e.jsxs(Y,{children:[e.jsx("div",{className:"header",children:e.jsx(Q,{title:s("setup.connectAccount.title"),onClickBack:b})}),e.jsxs(l,{className:"form-container",sx:{maxWidth:"700px",px:{xs:1,sm:0},width:"100%"},children:[Object.entries(v).filter(([t])=>y[t]||t!=="email").sort(([,t],[,r])=>t.priority-r.priority).map(([t])=>e.jsx(M,{type:t,account:y[t],onBind:V,bindButton:t==="passkey"?e.jsx(X,{behavior:"only-new",action:"connect",sx:{height:"32px",minWidth:{xs:"100%",sm:"60px"},border:"1px solid",borderColor:"primary.main","& .MuiTypography-root":{color:"primary.main",textAlign:"center",fontSize:{xs:"0.875rem",sm:"0.8125rem"}},"& > div:first-child":{display:"none"},"& > svg":{display:"none !important"}},createButtonText:s("setup.connectAccount.connect"),createMode:"connect",onConnect:()=>{o(!0),i("passkey")},onSuccess:()=>{k()},onError:()=>{o(!1),i(null)},dense:!0},"passkey"):null,loading:q&&h===t,recommended:R.includes(t)},t)),A===1?!!y.email&&e.jsx(B,{severity:"warning",sx:{mt:-1},children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.securityTip")})}):e.jsx(B,{severity:"success",sx:{mb:{xs:2,sm:3}},icon:e.jsx(w,{icon:J}),children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.statusSuccess",{count:A})})}),e.jsx(I,{popup:!0,open:m,action:"bind-wallet",checkFn:C.get,checkTimeout:600*1e3,webWalletUrl:F(),onClose:()=>{a(!1),o(!1),i(null)},onSuccess:()=>{k()},locale:"zh",messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{previousUserDid:c.user?.did,skipMigrateAccount:!0,isService:!0}})]}),e.jsx(_,{blocklet:g,children:e.jsx(W,{variant:"contained",onClick:()=>n(),disabled:q,sx:{minWidth:{xs:100,sm:120}},children:A>0?s("setup.continue"):s("setup.connectAccount.skipBinding")})})]})}se.propTypes={onNext:u.func,onPrevious:u.func};export{se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,al as r,X as p}from"./vendor-mui-core-CDEc-eG6.js";import m from"./branding-
|
|
1
|
+
import{j as t,al as r,X as p}from"./vendor-mui-core-CDEc-eG6.js";import m from"./branding-vz6onXUa.js";import{F as o}from"./index-CgSpL7jz.js";import"./vendor-react-DX7tU9aY.js";import"./vendor-ux-PO0jFgJf.js";import"./vendor-utils-_C9URqjS.js";import"./vendor-hooks-Ca2cSNuD.js";import"./sanitize-V0WziGer.js";import"./omit-CPWAgebP.js";import"./index-jIvFgWDS.js";import"./form-text-input-XsQkiayU.js";import"./required-BO8emcue.js";import"./form-wrapper-BqPFgoVY.js";import"./edit.svg-BGhTyO6h.js";import"./permission-C2bdzuoM.js";import"./session-BEf_KK-i.js";import"./use-app-logo-DcBQK--f.js";import"./logo-uploader-CEZXDf8O.js";import"./section-CC2BHD5s.js";import"./vendor-arcblock-BVQTtbN-.js";function s({blocklet:i}){return t.jsx(r,{sx:{width:"100%","& .section-left":{width:340},"& .section":{gap:3}},children:t.jsx(m,{blocklet:i,showFields:[o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO]})})}s.propTypes={blocklet:p.object.isRequired};export{s as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrCTi6nm.css"),window.__toCdnUrl("assets/index-_3Fxot8G.css")])))=>i.map(i=>d[i]);
|
|
2
|
-
import{aa as fe,J as be}from"./vendor-ux-PO0jFgJf.js";import{j as e,b3 as z,T as D,al as x,aY as je,an as J,I as A,bB as Z,Z as se,aT as ve,b1 as ye,a0 as we,c3 as Ce,C as X,aH as Se,c4 as ke,S as Ie,R as E,X as I}from"./vendor-mui-core-CDEc-eG6.js";import{W as U}from"./index-DcM4ljaV.js";import{E as F}from"./empty-spinner-2fS4Uw6Z.js";import{r as Pe,u as Re}from"./vendor-hooks-Ca2cSNuD.js";import{r as m}from"./vendor-react-DX7tU9aY.js";import{D as G,C as Q,P as ee}from"./react-beautiful-dnd.esm-C9wbL7D6.js";import{S as q}from"./studio-fGrv4L1C.js";import"./vendor-utils-_C9URqjS.js";import"./vendor-arcblock-BVQTtbN-.js";import"./raf-schd.esm-BZ-2sjAE.js";import"./index-BtpVtm9d.js";import"./nav-menu-CFJ8S6L5.js";import"./fallback-DAsXuNMP.js";var k={},te;function De(){if(te)return k;te=1,Object.defineProperty(k,"__esModule",{value:!0}),k.getVideoId=b,k.getEmbedUrl=c,k.getVideoCoverUrl=P,k.getVideoCheckUrl=y,k.getYoutubeId=r,k.getVimeoId=a,k.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function P(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return k}var B=De();const re=m.lazy(()=>be(()=>import("./index-6ovPLp0y.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${U}/api/studio/logo/upload`,Ve=`${U}/api/studio/screenshots/upload`,Te=`${U}/api/studio/logo`,L=`${U}/api/studio/screenshots`,Ue=`${U}/api/studio/videos`,oe=5,ie=3;function Je(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,P]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=Pe(async()=>{const i=await(await fetch(L)).json();return P(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(q,{children:e.jsx(F,{size:40})});if(l.error)return e.jsx(q,{children:e.jsx(z,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(D,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const $=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(Ue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await $(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),P(i),await fetch(`${L}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},M=o=>{g(o.trim()),c(!0)},N=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await $(h),l.runAsync()},de=o=>{b(!0),t(o)},K=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx(W,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Te}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx(W,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(G,{onDragEnd:H,children:e.jsx(Q,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,_)=>e.jsx(ee,{draggableId:S,index:_,children:(R,T)=>{const Y=`${L}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:T.isDragging?"scale(1.05)":"none",boxShadow:T.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:Y,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(J,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(Y,{method:"DELETE"}),l.runAsync()},children:e.jsx(Z,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{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"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs(W,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(G,{onDragEnd:H,children:e.jsx(Q,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,_)=>e.jsx(ee,{draggableId:S,index:_,children:(R,T)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:T.isDragging?"scale(1.05)":"none",boxShadow:T.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:B.getVideoCoverUrl(S),onClick:()=>M(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>M(S),children:e.jsx(ae,{})}),e.jsx(J,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>N(null,S),children:e.jsx(Z,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:N,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:K,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${L}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:K})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(F,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,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(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.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 ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(q,{children:e.jsxs($e,{children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(D,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(D,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function W({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(D,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(z,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}W.propTypes={title:I.string.isRequired,rules:I.array.isRequired,tips:I.array.isRequired,children:I.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,P]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(X,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(X,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(ke,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(D,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(D,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:B.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(F,{size:40}):e.jsx(D,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(Ie,{children:[e.jsx(E,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(E,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(E,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(E,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=B.getVideoCheckUrl(f);w(f?!C:!1),C&&(P(!0),fetch(C).then($=>{$.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>P(!1)))}}ne.propTypes={handleOperateVideo:I.func.isRequired,t:I.func.isRequired,defaultUrl:I.string,videos:I.array.isRequired};function ae(){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 $e=ve.div`
|
|
2
|
+
import{aa as fe,J as be}from"./vendor-ux-PO0jFgJf.js";import{j as e,b3 as z,T as D,al as x,aY as je,an as J,I as A,bB as Z,Z as se,aT as ve,b1 as ye,a0 as we,c3 as Ce,C as X,aH as Se,c4 as ke,S as Ie,R as E,X as I}from"./vendor-mui-core-CDEc-eG6.js";import{W as U}from"./index-CgSpL7jz.js";import{E as F}from"./empty-spinner-2fS4Uw6Z.js";import{r as Pe,u as Re}from"./vendor-hooks-Ca2cSNuD.js";import{r as m}from"./vendor-react-DX7tU9aY.js";import{D as G,C as Q,P as ee}from"./react-beautiful-dnd.esm-C9wbL7D6.js";import{S as q}from"./studio-CYIn9aNz.js";import"./vendor-utils-_C9URqjS.js";import"./vendor-arcblock-BVQTtbN-.js";import"./raf-schd.esm-BZ-2sjAE.js";import"./index-DI80KOep.js";import"./nav-menu-CFJ8S6L5.js";import"./fallback-DAsXuNMP.js";var k={},te;function De(){if(te)return k;te=1,Object.defineProperty(k,"__esModule",{value:!0}),k.getVideoId=b,k.getEmbedUrl=c,k.getVideoCoverUrl=P,k.getVideoCheckUrl=y,k.getYoutubeId=r,k.getVimeoId=a,k.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function P(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return k}var B=De();const re=m.lazy(()=>be(()=>import("./index-D0mTUcjJ.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${U}/api/studio/logo/upload`,Ve=`${U}/api/studio/screenshots/upload`,Te=`${U}/api/studio/logo`,L=`${U}/api/studio/screenshots`,Ue=`${U}/api/studio/videos`,oe=5,ie=3;function Je(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,P]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=Pe(async()=>{const i=await(await fetch(L)).json();return P(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(q,{children:e.jsx(F,{size:40})});if(l.error)return e.jsx(q,{children:e.jsx(z,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(D,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const $=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(Ue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await $(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),P(i),await fetch(`${L}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},M=o=>{g(o.trim()),c(!0)},N=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await $(h),l.runAsync()},de=o=>{b(!0),t(o)},K=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx(W,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Te}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx(W,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(G,{onDragEnd:H,children:e.jsx(Q,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,_)=>e.jsx(ee,{draggableId:S,index:_,children:(R,T)=>{const Y=`${L}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:T.isDragging?"scale(1.05)":"none",boxShadow:T.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:Y,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(J,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(Y,{method:"DELETE"}),l.runAsync()},children:e.jsx(Z,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{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"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs(W,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(G,{onDragEnd:H,children:e.jsx(Q,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,_)=>e.jsx(ee,{draggableId:S,index:_,children:(R,T)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:T.isDragging?"scale(1.05)":"none",boxShadow:T.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:B.getVideoCoverUrl(S),onClick:()=>M(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>M(S),children:e.jsx(ae,{})}),e.jsx(J,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>N(null,S),children:e.jsx(Z,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:N,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:K,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${L}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:K})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(F,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,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(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.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 ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(q,{children:e.jsxs($e,{children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(D,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(D,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function W({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs(z,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(D,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(z,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}W.propTypes={title:I.string.isRequired,rules:I.array.isRequired,tips:I.array.isRequired,children:I.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,P]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(X,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(X,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(ke,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(D,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(D,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:B.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(F,{size:40}):e.jsx(D,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(Ie,{children:[e.jsx(E,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(E,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(E,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(E,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=B.getVideoCheckUrl(f);w(f?!C:!1),C&&(P(!0),fetch(C).then($=>{$.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>P(!1)))}}ne.propTypes={handleOperateVideo:I.func.isRequired,t:I.func.isRequired,defaultUrl:I.string,videos:I.array.isRequired};function ae(){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 $e=ve.div`
|
|
3
3
|
margin-top: 24px;
|
|
4
4
|
.image-wrapper {
|
|
5
5
|
margin-bottom: 16px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as g}from"./vendor-react-DX7tU9aY.js";import{j as e,cy as o1,aT as F,al as c,ak as W,A as h1,V as n1,I as Y,a7 as d1,bk as p1,F as f1,Q as x1,dg as $,X as r,bX as v1,aY as m1,as as g1,T as v,a4 as u,R as V,b3 as u1}from"./vendor-mui-core-CDEc-eG6.js";import{D as j1,M as y1,ac as Z1,bj as L1,a3 as w1}from"./vendor-ux-PO0jFgJf.js";import{w as E1}from"./vendor-hooks-Ca2cSNuD.js";import{X as q,E as _1,aa as b1,F as d}from"./index-
|
|
1
|
+
import{r as g}from"./vendor-react-DX7tU9aY.js";import{j as e,cy as o1,aT as F,al as c,ak as W,A as h1,V as n1,I as Y,a7 as d1,bk as p1,F as f1,Q as x1,dg as $,X as r,bX as v1,aY as m1,as as g1,T as v,a4 as u,R as V,b3 as u1}from"./vendor-mui-core-CDEc-eG6.js";import{D as j1,M as y1,ac as Z1,bj as L1,a3 as w1}from"./vendor-ux-PO0jFgJf.js";import{w as E1}from"./vendor-hooks-Ca2cSNuD.js";import{X as q,E as _1,aa as b1,F as d}from"./index-CgSpL7jz.js";import{s as k1}from"./sanitize-V0WziGer.js";import{F as O1}from"./form-text-input-XsQkiayU.js";import{R as M1}from"./required-BO8emcue.js";import{F as B1}from"./form-wrapper-BqPFgoVY.js";import{w as X}from"./permission-C2bdzuoM.js";import{u as R1}from"./use-app-logo-DcBQK--f.js";import{L as j}from"./logo-uploader-CEZXDf8O.js";import{S as E}from"./section-CC2BHD5s.js";import"./vendor-utils-_C9URqjS.js";import"./vendor-arcblock-BVQTtbN-.js";import"./omit-CPWAgebP.js";import"./index-jIvFgWDS.js";import"./edit.svg-BGhTyO6h.js";import"./session-BEf_KK-i.js";function Q({label:i="",disabled:h=!1,required:p=!1,initialValue:s="",onChange:M=()=>{},style:G={},onSubmit:f=()=>{},triggers:m=[],options:a=[],formatterBeforeSubmit:_=Z=>Z.join(","),helperText:B="",placeholder:T="",renderImage:I=()=>null,renderLabel:N=()=>"",filterKeys:y=["name"],noEmpty:b=!1,...R}){const[Z,C]=g.useState(!1),[P,A]=g.useState(!1),[k,U]=g.useState(""),O=g.useRef(null),[L,S]=g.useState(s),[l,n]=g.useState(L),w=g.useMemo(()=>{if(!a)return{};const o={};return a.forEach(t=>{o[t.code]=t}),o},[a]),H=()=>{if(!a)return[];if(!k)return a.map(t=>t.code);const o=new RegExp(k.toLowerCase());return a.filter(t=>{for(let x=0;x<y.length;x++){const K=y[x];if(o.test(t[K]?.toLowerCase()))return!0}return!1}).map(t=>t.code)},c1=async()=>{A(!0);try{await f(typeof _=="function"?_(l):l)===!1?n(L):b&&!l.length?(n(s),S(s)):(n(l),S(l))}catch{n(L)}finally{A(!1),C(!1)}},t1=(o,t)=>{if(!Array.isArray(t)){n([]),M([]);return}const x=t.filter(K=>w[K]);if(!x.length){n([]),M([]);return}n(x),M(x)},s1=o=>{o.stopPropagation(),C(!0),setTimeout(()=>{if(O.current){const t=O.current.querySelector("input");t&&t.focus()}},500)},r1=Z?e.jsx(o1,{ref:O,options:a,value:l,onChange:t1,inputValue:k,onInputChange:(o,t)=>{U(t)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:H,getOptionLabel:o=>w[o]?.name,renderInput:o=>e.jsx(h1,{...o,label:"",placeholder:T}),renderOption:(o,t)=>{const x=l.indexOf(t)!==-1;return g.createElement(C1,{component:"li",...o,key:t},I(w[t]||{}),e.jsx(c,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:x?"700":"normal"},children:N(t,w[t])||w[t]?.name}),e.jsx(c,{component:W,sx:{opacity:.5,width:18,height:18},style:{visibility:x?"visible":"hidden"}}))},...R,slots:{popper:P1}}):e.jsx(c,{className:"form-item-input slot",onClick:s1,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:l.filter(o=>a.some(t=>t.code===o)).map(o=>e.jsx(n1,{label:a.find(t=>t.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(B1,{className:"form",style:G,children:e.jsxs(c,{className:"form-item",children:[e.jsxs(c,{className:"form-item-label",children:[i,p&&e.jsx(M1,{})]}),e.jsxs(c,{className:"form-item-body",children:[e.jsx(c,{className:"form-item-input",children:r1}),Z?e.jsx(c,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:c1,disabled:h||P,size:"large",children:P?e.jsx(d1,{size:24}):e.jsx(p1,{})}),e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{n(L),C(!1)},disabled:h||P,size:"large",children:e.jsx(W,{})})]})}):null]}),Z&&B&&e.jsx(f1,{children:B})]})})}Q.propTypes={style:r.object,onSubmit:r.func,onChange:r.func,label:r.string,initialValue:r.string,required:r.bool,disabled:r.bool,triggers:r.array,options:r.array,helperText:r.string,formatterBeforeSubmit:r.func,placeholder:r.string,renderImage:r.func,filterKeys:r.arrayOf(r.string),noEmpty:r.bool,renderLabel:r.func};const C1=F.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u,aY as x,X as t}from"./vendor-mui-core-CDEc-eG6.js";import{a7 as $}from"./vendor-ux-PO0jFgJf.js";import{y as d}from"./vendor-utils-_C9URqjS.js";import{X as l,a8 as v,b3 as y,W as j,b4 as E,b5 as P}from"./index-
|
|
1
|
+
import{j as u,aY as x,X as t}from"./vendor-mui-core-CDEc-eG6.js";import{a7 as $}from"./vendor-ux-PO0jFgJf.js";import{y as d}from"./vendor-utils-_C9URqjS.js";import{X as l,a8 as v,b3 as y,W as j,b4 as E,b5 as P}from"./index-CgSpL7jz.js";function R({blocklet:o,ancestors:c=[]}){const e=l(),{inService:s}=e,n=v(o?.status)||y(o?.status),r=`?v=${o?.meta?.version}${n?"~":""}`;let a=s?`${d(E,j,"/blocklet/logo-bundle")}${r}`:d(e.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)a=`${d(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=c.concat(o),p=s?i.slice(1):i;a=`${d(g,`/blocklet/logo-bundle${p.map(m=>`/${m.meta.did}`).join("")}`)}${r}`}return{logoUrl:a,inService:s}}function h({blocklet:o,style:c={},size:e=40,ancestors:s=[],...n}){const r=l(),{logoUrl:a,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=n,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let m=u.jsx("img",{src:a,onError:p,alt:o.meta.name,style:{width:e}});return o.meta.logo||(m=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:e,height:e,borderRadius:10},c),...n,children:m})}h.propTypes={blocklet:t.object.isRequired,style:t.object,size:t.oneOfType([t.number,t.string]),ancestors:t.array};export{h as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aT as E,j as e,al as m,X as W}from"./vendor-mui-core-CDEc-eG6.js";import{au as Q,v as ne,G as H,cp as oe,n as ae,j as ie,W as ce,m as le,o as ue,cq as de,K as me}from"./index-
|
|
1
|
+
import{aT as E,j as e,al as m,X as W}from"./vendor-mui-core-CDEc-eG6.js";import{au as Q,v as ne,G as H,cp as oe,n as ae,j as ie,W as ce,m as le,o as ue,cq as de,K as me}from"./index-CgSpL7jz.js";import{b as he,a as j,m as O}from"./vendor-hooks-Ca2cSNuD.js";import{r as d}from"./vendor-react-DX7tU9aY.js";import{ab as pe,a2 as fe,B as ge,F as we,y as X}from"./vendor-utils-_C9URqjS.js";import{u as xe}from"./launch-result-message-Br6OdJMs.js";import{aa as be,ae as ke,a3 as q}from"./vendor-ux-PO0jFgJf.js";import{g as Ue}from"./get-safe-url-uxJSMQTF.js";import{S as K}from"./button-BdkIS-Qs.js";import{S as ye}from"./layout-DkUZePxy.js";import{p as Re,P as Se,S as ve}from"./starting-progress-s-XqSluO.js";import"./vendor-arcblock-BVQTtbN-.js";import"./content-layout-D49-hpq6.js";const Le=E(xe)`
|
|
2
2
|
&& .result-footer {
|
|
3
3
|
height: 120px;
|
|
4
4
|
> div {
|