@abtnode/webapp 1.17.9 → 1.17.10-beta-20260209-080716-d070612b
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-DWO9WIHe.js → AdapterDayjs-UTEBvFmb.js} +1 -1
- package/dist/assets/{Add-CaX-C76B.js → Add-CWdQuYaD.js} +1 -1
- package/dist/assets/ArrowDropDown-CHoioLUW.js +1 -0
- package/dist/assets/{Autocomplete-CoHLc9sw.js → Autocomplete-yImsm8ZS.js} +1 -1
- package/dist/assets/{Breadcrumbs-CtmWaPWD.js → Breadcrumbs-Civ-g97C.js} +1 -1
- package/dist/assets/{ButtonGroup-CFUm4DnA.js → ButtonGroup-BKp-Wu6T.js} +1 -1
- package/dist/assets/{CSSTransition-BoEOBxnu.js → CSSTransition-w1DHR1_d.js} +1 -1
- package/dist/assets/{CallMerge-g03IIE2c.js → CallMerge-DmmwHGXk.js} +1 -1
- package/dist/assets/{CardContent-De2diFnM.js → CardContent-DNvyDSsD.js} +1 -1
- package/dist/assets/{ChevronLeft-6mKauCKy.js → ChevronLeft-uBeZJCqL.js} +1 -1
- package/dist/assets/{ChevronRight-Ba1GeQFe.js → ChevronRight-BC2neeaz.js} +1 -1
- package/dist/assets/{Clear-B_hKjaJj.js → Clear--1cV57uz.js} +1 -1
- package/dist/assets/{Delete-B-jFRJwJ.js → Delete-K51EeG49.js} +1 -1
- package/dist/assets/{DeleteOutline-7b3f7PEm.js → DeleteOutline-BEPb1x3R.js} +1 -1
- package/dist/assets/{Done-L7ZRzL_V.js → Done-Cqinal6J.js} +1 -1
- package/dist/assets/{Edit-DUM500XS.js → Edit-D9ZhjnRN.js} +1 -1
- package/dist/assets/{ErrorOutline-DsKZTEd8.js → ErrorOutline-D1L-_0MO.js} +1 -1
- package/dist/assets/{FilterList-ChbigVQM.js → FilterList-oS-lVZbr.js} +1 -1
- package/dist/assets/{Google-CWlHJZAv.js → Google-B-qPqki4.js} +1 -1
- package/dist/assets/{HelpOutline-dihfOb5v.js → HelpOutline-DeYqkIeW.js} +1 -1
- package/dist/assets/{Launch-BkVAoVZE.js → Launch-BkYfxaBZ.js} +1 -1
- package/dist/assets/{Link-DOvnx4g5.js → Link-Cq1-Sn3W.js} +1 -1
- package/dist/assets/{ListItemButton-BQDScowx.js → ListItemButton-Cj5TfDg5.js} +1 -1
- package/dist/assets/{ListSubheader-Cl_ECqW2.js → ListSubheader-nBi3IFvC.js} +1 -1
- package/dist/assets/{LoadingButton-CDH-grwB.js → LoadingButton-Bvho72-k.js} +1 -1
- package/dist/assets/{LottiePlayer.modern-CLfr42jY.js → LottiePlayer.modern-jT-ZZL8Z.js} +1 -1
- package/dist/assets/{MoreVert-DV_CQ8ui.js → MoreVert-BcrwhM_q.js} +1 -1
- package/dist/assets/{OpenInNew-DXke8B9Y.js → OpenInNew-D7ZHvBz_.js} +1 -1
- package/dist/assets/{Refresh-D_WONHhn.js → Refresh-CzhocoUQ.js} +1 -1
- package/dist/assets/{Replay-B4flsCqt.js → Replay-D1gMLUpv.js} +1 -1
- package/dist/assets/{Search-z9bCqmrZ.js → Search-CZb8MpSi.js} +1 -1
- package/dist/assets/{Stepper-DKmKSFCG.js → Stepper-DKMrerj2.js} +1 -1
- package/dist/assets/{TableSearch-C5Kz0G1P.js → TableSearch-x8t1M7OG.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BZx2FaaL.js → ToggleButtonGroup-BWiIOB2q.js} +1 -1
- package/dist/assets/{UnfoldMore-B28R2WSj.js → UnfoldMore-DQCavdGY.js} +1 -1
- package/dist/assets/{Verified-TZI1j-Va.js → Verified-CqtxcebR.js} +1 -1
- package/dist/assets/{VerifiedUser-Ddu-50lW.js → VerifiedUser-DUixMDR8.js} +1 -1
- package/dist/assets/{ViewList-D-osXRf3.js → ViewList-Dbcemsyf.js} +1 -1
- package/dist/assets/{Visibility-BVnDeVk-.js → Visibility-sTYSXb_Z.js} +1 -1
- package/dist/assets/{_createAggregator-DvxY8dpL.js → _createAggregator-CTTHFCie.js} +1 -1
- package/dist/assets/{actions-CUnz9wHy.js → actions-AQbY2FuA.js} +1 -1
- package/dist/assets/{actions-TKbswZRW.js → actions-BYumOwFP.js} +1 -1
- package/dist/assets/{actions-rnAVohGM.js → actions-DNLQJIGb.js} +1 -1
- package/dist/assets/{agreement-B81jBHjm.js → agreement-Dh9hzhdJ.js} +1 -1
- package/dist/assets/api-CxCPrjQQ.js +1 -0
- package/dist/assets/{appearance-BnoPFfcA.js → appearance-c0LgY25-.js} +1 -1
- package/dist/assets/{audit-logs-rRPPzNCV.js → audit-logs-DmhKHMuY.js} +1 -1
- package/dist/assets/{babel-BhzMK_Nh.js → babel-CLSFi4lI.js} +1 -1
- package/dist/assets/{base-chart-B-7wNcRu.js → base-chart-CUur7L90.js} +1 -1
- package/dist/assets/{blocklet-B65NZ0SL.js → blocklet--DdX67Y5.js} +1 -1
- package/dist/assets/{chain-De_ycb3s.js → chain-DJ1DKYhz.js} +1 -1
- package/dist/assets/{click-to-copy-BgfWbRfM.js → click-to-copy-B-4XSjp3.js} +1 -1
- package/dist/assets/cloneDeep-DqD6wDwD.js +1 -0
- package/dist/assets/{config-navigation-CAY0oLM7.js → config-navigation-C_j17Vjq.js} +3 -3
- package/dist/assets/{connect-DeAl0a0w.js → connect-1VjWES1q.js} +1 -1
- package/dist/assets/{connect-to-TtcHrCpE.js → connect-to-uisE5AIX.js} +1 -1
- package/dist/assets/{delete-confirm-BCALKic0.js → delete-confirm-D72IwWQV.js} +1 -1
- package/dist/assets/{depsEqual-iVI-ppGn.js → depsEqual-DLMKNy1M.js} +1 -1
- package/dist/assets/{detail-B9b8qEuw.js → detail-BMxdesdv.js} +2 -2
- package/dist/assets/{domains-ilDCawII.js → domains-DCeN06Gc.js} +1 -1
- package/dist/assets/{download-BLP_P5GN.js → download-Dr5a1zL7.js} +1 -1
- package/dist/assets/{edit.svg-088QpjsR.js → edit.svg-DZew8QZd.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-C-o7-kYP.js +1 -0
- package/dist/assets/engine-Bj---ism.js +1 -0
- package/dist/assets/{federated-detail-dialog-FIBSqJbV.js → federated-detail-dialog-D1-tYtuH.js} +1 -1
- package/dist/assets/{get-safe-url-C0YzO5pG.js → get-safe-url-D0G1hOGs.js} +1 -1
- package/dist/assets/getValidReactChildren-DtHaCFXY.js +1 -0
- package/dist/assets/{graphql-DZtbZ5p5.js → graphql-5eGH_NYQ.js} +1 -1
- package/dist/assets/{graphqlMode-D6b77q6d.js → graphqlMode-CUgVw-V2.js} +2 -2
- package/dist/assets/{html-title-wftxlNic.js → html-title-9oXf3hnw.js} +1 -1
- package/dist/assets/{iframe-CVO90dup.js → iframe-BaDG2Wlm.js} +1 -1
- package/dist/assets/{index-CJtH7ShQ.js → index-49Qse4GQ.js} +1 -1
- package/dist/assets/{index-DkOCnoPS.js → index-61X2Ogbc.js} +1 -1
- package/dist/assets/{index-BTW5KgWm.js → index-827dwNMd.js} +1 -1
- package/dist/assets/{index-GSHwCvc7.js → index-AvysaFMT.js} +1 -1
- package/dist/assets/{index-imQtUA1Y.js → index-BBF53Q7a.js} +1 -1
- package/dist/assets/{index-f-tffvn9.js → index-BHcgO_SJ.js} +6 -6
- package/dist/assets/{index-BdA3fNuc.js → index-BJK24rOa.js} +1 -1
- package/dist/assets/{index-DTafCIMf.js → index-BM0ITaY0.js} +1 -1
- package/dist/assets/{index-KvvUCU7Y.js → index-BNas1pWM.js} +1 -1
- package/dist/assets/{index-XFNKEyIx.js → index-BTqg98Jy.js} +1 -1
- package/dist/assets/index-BUcRzlo0.js +1 -0
- package/dist/assets/{index-DReJtC5l.js → index-BX5yVBx9.js} +3 -3
- package/dist/assets/{index-OZ9TU2gG.js → index-BYR7dUZX.js} +3 -3
- package/dist/assets/{index-Fa8vAbIc.js → index-BkMlSUGS.js} +1 -1
- package/dist/assets/{index-DdoE1xT5.js → index-Bu9TGJWU.js} +1 -1
- package/dist/assets/{index-BApx63vN.js → index-C6ZvmgZt.js} +1 -1
- package/dist/assets/{index-DXSDhJsN.js → index-C76F3kmA.js} +1 -1
- package/dist/assets/{index-etYz30nT.js → index-C9TPckai.js} +1 -1
- package/dist/assets/{index-Def_Nrmy.js → index-CEy2PJoh.js} +1 -1
- package/dist/assets/{index-BuwIEPLP.js → index-CM8wI4MT.js} +3 -3
- package/dist/assets/{index-CSRgOtp2.js → index-CNLc3sjT.js} +1 -1
- package/dist/assets/{index-TLvz3wdj.js → index-CUh73CTd.js} +1 -1
- package/dist/assets/{index-CSC84DXT.js → index-CehlW6fb.js} +1 -1
- package/dist/assets/{index-DKy5xk6V.js → index-Cli3fN45.js} +1 -1
- package/dist/assets/{index-DHJJWO6c.js → index-CoN0ZC2W.js} +3 -3
- package/dist/assets/{index-B0mArAvv.js → index-CsYcuXHv.js} +1 -1
- package/dist/assets/{index-DtdZa4Ii.js → index-CwAnYLEW.js} +1 -1
- package/dist/assets/{index-C9laDmdO.js → index-D7n-SeYl.js} +1 -1
- package/dist/assets/{index-DSoeY_gC.js → index-DSaIe8YU.js} +2 -2
- package/dist/assets/{index-DW68hKiw.js → index-DYyWFu_h.js} +1 -1
- package/dist/assets/{index--K9Fm5hg.js → index-Da4hAx6D.js} +1 -1
- package/dist/assets/{index-BgEoonJf.js → index-DbEnyJAy.js} +1 -1
- package/dist/assets/{index-kfl7onTb.js → index-Dm7aiwWU.js} +3 -3
- package/dist/assets/{index-YDhLwC2f.js → index-DmPMXuEy.js} +1 -1
- package/dist/assets/{index-BXslTYRT.js → index-DmoyVTvU.js} +1 -1
- package/dist/assets/{index-2QIyI-hX.js → index-DofqJV7l.js} +1 -1
- package/dist/assets/{index-C6-nc71s.js → index-S9TQPsa4.js} +1 -1
- package/dist/assets/{index-BsxJA--7.js → index-UlrZBhpR.js} +1 -1
- package/dist/assets/{index-Cnc9i7Ak.js → index-m4xwc3vq.js} +1 -1
- package/dist/assets/{index-DWMihgj_.js → index-nGWlrS-7.js} +1 -1
- package/dist/assets/{index-Bt02N9ee.js → index-ocMiQSTQ.js} +1 -1
- package/dist/assets/{index-Ce4rkgom.js → index-pyvsPKr0.js} +1 -1
- package/dist/assets/{index-UjkYO3io.js → index-v6GrH27P.js} +1 -1
- package/dist/assets/{index-Dtj3cePH.js → index-xKewGzjC.js} +4 -4
- package/dist/assets/{index-DrnnoDEf.js → index-zK8Hx4RO.js} +1 -1
- package/dist/assets/{index.esm-KhX4wp--.js → index.esm-BbGTF1sQ.js} +1 -1
- package/dist/assets/{install-from-url-B05WE8Ly.js → install-from-url-v_yjBEI5.js} +1 -1
- package/dist/assets/{invitation-BV4-svSZ.js → invitation-dGyOhh2Q.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-BxWUya7r.js → is-path-prefix-equal-BQwfaxGA.js} +1 -1
- package/dist/assets/{isEmail-DeuFXn6y.js → isEmail-DqqNzPgi.js} +1 -1
- package/dist/assets/{item-DI_IF5jI.js → item-DQm26Fdm.js} +1 -1
- package/dist/assets/{jsonMode-U78AHGim.js → jsonMode-lyAE_KHt.js} +1 -1
- package/dist/assets/{list-header-B3--_6Bl.js → list-header-DqK90OBv.js} +1 -1
- package/dist/assets/{lite-s4CjMGFV.js → lite-BijqooUd.js} +2 -2
- package/dist/assets/{lock.svg-Cgo551jB.js → lock.svg-DjIKxYVb.js} +1 -1
- package/dist/assets/{log-ll3_FUxN.js → log-O-94ibsD.js} +1 -1
- package/dist/assets/{login-method-item-rb7xoaP3.js → login-method-item-KmsBo8TR.js} +1 -1
- package/dist/assets/{lottie-react.esm-B1Y5_TqJ.js → lottie-react.esm-D3MPuI_v.js} +1 -1
- package/dist/assets/{memory-DzWPIeHP.js → memory-CTIYyQr_.js} +1 -1
- package/dist/assets/{metric-DCKs2r9K.js → metric-DhxuLAOD.js} +1 -1
- package/dist/assets/{monaco-editor-3B-B1pdB.js → monaco-editor-ie9ljpWK.js} +3 -3
- package/dist/assets/{mouseTarget-BZ5frXuo.js → mouseTarget-DEC5Z4-r.js} +1 -1
- package/dist/assets/omit-CtfUfHa7.js +1 -0
- package/dist/assets/{overview-Cu4YrIFe.js → overview-BsIeoL20.js} +1 -1
- package/dist/assets/{permission-B-geZ8jf.js → permission-CtC06VjN.js} +1 -1
- package/dist/assets/{preference-C8QaexiP.js → preference-qWlN5Q-O.js} +3 -3
- package/dist/assets/{provider-icon-lv3oS7d4.js → provider-icon-OPl5iUMB.js} +1 -1
- package/dist/assets/{raf-schd.esm-B49R8L3J.js → raf-schd.esm-DgDGl_YG.js} +1 -1
- package/dist/assets/{rotate-session-key-BPhFiNZy.js → rotate-session-key-BeoXztkb.js} +1 -1
- package/dist/assets/{runtime-DhJ59c5Q.js → runtime-DZKNFyMr.js} +1 -1
- package/dist/assets/schema-DUxPnJIn.js +1 -0
- package/dist/assets/sdk-ChqUwCFm.js +1 -0
- package/dist/assets/{service-Bad7qk9f.js → service-BNMKzSeC.js} +1 -1
- package/dist/assets/{shorten-label-DmKAPPTX.js → shorten-label-dEjcCcWt.js} +1 -1
- package/dist/assets/{simple-select-CHH0_oB5.js → simple-select-Ca0GAR5n.js} +1 -1
- package/dist/assets/{spaces-BsLjYZLj.js → spaces-a6SrjF6x.js} +1 -1
- package/dist/assets/{status-CcMfecIj.js → status-8syaX-4l.js} +1 -1
- package/dist/assets/{status-VF8vuUxF.js → status-Cv5_DxJM.js} +1 -1
- package/dist/assets/{switch-control-CzpP7CIf.js → switch-control-BlQqkYEY.js} +1 -1
- package/dist/assets/{table-icons-Bo0tOvqU.js → table-icons-pWIMwNtX.js} +1 -1
- package/dist/assets/{team-cDk0EvPf.js → team-CVCOeAkO.js} +1 -1
- package/dist/assets/{toLower-D7a3qnvH.js → toLower-DAlWrsru.js} +1 -1
- package/dist/assets/toUpper-OjfWE4Do.js +1 -0
- package/dist/assets/{traffic-DYynIkpC.js → traffic-DTerW5fk.js} +1 -1
- package/dist/assets/{trim-Diihj-s0.js → trim-DzuffaGw.js} +1 -1
- package/dist/assets/{url-evaluation-D49POKf_.js → url-evaluation-IuTW0fNq.js} +1 -1
- package/dist/assets/{url-join-CYWu6vsi.js → url-join-D7ip8DEU.js} +1 -1
- package/dist/assets/{use-mobile-wKUCaVoo.js → use-mobile-BvGbFC9J.js} +1 -1
- package/dist/assets/{use-mobile-xq_yWBax.js → use-mobile-DYOwHeWa.js} +1 -1
- package/dist/assets/{useAsync-CLJdaax3.js → useAsync-B0d54WBL.js} +1 -1
- package/dist/assets/{useAsyncRetry-DLctK9N7.js → useAsyncRetry-DBcFwTF8.js} +1 -1
- package/dist/assets/{useLocalStorage-Dn6UErBV.js → useLocalStorage-DnNTBdw-.js} +1 -1
- package/dist/assets/{useThemeProps-9zV1AZbb.js → useThemeProps-DN7zZ6Cj.js} +1 -1
- package/dist/assets/{util-BVHL76Cg.js → util-CWRQuvFK.js} +1 -1
- package/dist/assets/{wait-container-ClqOwvvu.js → wait-container-Bye2r7zn.js} +1 -1
- package/dist/assets/{without-wallet-BzLoVl__.js → without-wallet-BR3mhb2n.js} +1 -1
- package/dist/assets/wrap-locale-BmqOK-7R.js +1 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-225S5d4X.js +0 -1
- package/dist/assets/api-BLIecOBq.js +0 -1
- package/dist/assets/cloneDeep-BBtZ6NeX.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-fPnQyG8C.js +0 -1
- package/dist/assets/engine-xHEY-z1Q.js +0 -1
- package/dist/assets/getValidReactChildren-BwWzCXzg.js +0 -1
- package/dist/assets/index-CkfMmvW2.js +0 -1
- package/dist/assets/omit-C22NrHjF.js +0 -1
- package/dist/assets/schema-BwJa8hO6.js +0 -1
- package/dist/assets/sdk-Bx_WDGD1.js +0 -1
- package/dist/assets/toUpper-B8LTwalX.js +0 -1
- package/dist/assets/wrap-locale-CowysH2k.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Ne,j as Y,ah as ke,q as ge,U as $e,d1 as je,af as Le,o as te,r as he,fi as ze,br as Ke,aS as Ie,al as qe,aB as Ve,bj as Ge,V as Ye,B as pe,bz as De,C as Re,cu as Xe,F as Je,S as Ze,M as Qe,dg as et,H as tt}from"./index-
|
|
1
|
+
import{c as Ne,j as Y,ah as ke,q as ge,U as $e,d1 as je,af as Le,o as te,r as he,fi as ze,br as Ke,aS as Ie,al as qe,aB as Ve,bj as Ge,V as Ye,B as pe,bz as De,C as Re,cu as Xe,F as Je,S as Ze,M as Qe,dg as et,H as tt}from"./index-xKewGzjC.js";import{B as it}from"./ButtonGroup-BKp-Wu6T.js";const rt=Ne(Y.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}));var we={exports:{}},Ae;function st(){return Ae||(Ae=1,(function(X,q){(function(j,V){X.exports=V()})(globalThis,(()=>(()=>{var j={4567:function(A,s,o){var d=this&&this.__decorate||function(e,r,a,f){var p,g=arguments.length,l=g<3?r:f===null?f=Object.getOwnPropertyDescriptor(r,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(r,a,l):p(r,a))||l);return g>3&&l&&Object.defineProperty(r,a,l),l},_=this&&this.__param||function(e,r){return function(a,f){r(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const n=o(9042),c=o(9924),u=o(844),v=o(4725),h=o(2585),t=o(3656);let i=s.AccessibilityManager=class extends u.Disposable{constructor(e,r,a,f){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=f,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new c.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((p=>this._handleResize(p.rows)))),this.register(this._terminal.onRender((p=>this._refreshRows(p.start,p.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((p=>this._handleChar(p)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
2
2
|
`)))),this.register(this._terminal.onA11yTab((p=>this._handleTab(p)))),this.register(this._terminal.onKey((p=>this._handleKey(p.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,t.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,u.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let r=0;r<e;r++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,r){this._liveRegionDebouncer.refresh(e,r,this._terminal.rows)}_renderRows(e,r){const a=this._terminal.buffer,f=a.lines.length.toString();for(let p=e;p<=r;p++){const g=a.lines.get(a.ydisp+p),l=[],m=g?.translateToString(!0,void 0,void 0,l)||"",E=(a.ydisp+p+1).toString(),x=this._rowElements[p];x&&(m.length===0?(x.innerText=" ",this._rowColumns.set(x,[0,1])):(x.textContent=m,this._rowColumns.set(x,l)),x.setAttribute("aria-posinset",E),x.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,r){const a=e.target,f=this._rowElements[r===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(r===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let p,g;if(r===0?(p=a,g=this._rowElements.pop(),this._rowContainer.removeChild(g)):(p=this._rowElements.shift(),g=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),g.removeEventListener("focus",this._bottomBoundaryFocusListener),r===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(r===0?-1:1),this._rowElements[r===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let r={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((r.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||r.node===a.node&&r.offset>a.offset)&&([r,a]=[a,r]),r.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(r={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(r.node))return;const f=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:f,offset:f.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:m,offset:E})=>{const x=m instanceof Text?m.parentNode:m;let L=parseInt(x?.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const b=this._rowColumns.get(x);if(!b)return console.warn("columns is null. Race condition?"),null;let R=E<b.length?b[E]:b.slice(-1)[0]+1;return R>=this._terminal.cols&&(++L,R=0),{row:L,column:R}},g=p(r),l=p(a);if(g&&l){if(g.row>l.row||g.row===l.row&&g.column>=l.column)throw new Error("invalid range");this._terminal.select(g.column,g.row,(l.row-g.row)*this._terminal.cols-g.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let r=this._rowContainer.children.length;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=i=d([_(1,h.IInstantiationService),_(2,v.ICoreBrowserService),_(3,v.IRenderService)],i)},3614:(A,s)=>{function o(c){return c.replace(/\r?\n/g,"\r")}function d(c,u){return u?"\x1B[200~"+c+"\x1B[201~":c}function _(c,u,v,h){c=d(c=o(c),v.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(c,!0),u.value=""}function n(c,u,v){const h=v.getBoundingClientRect(),t=c.clientX-h.left-10,i=c.clientY-h.top-10;u.style.width="20px",u.style.height="20px",u.style.left=`${t}px`,u.style.top=`${i}px`,u.style.zIndex="1000",u.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=d,s.copyHandler=function(c,u){c.clipboardData&&c.clipboardData.setData("text/plain",u.selectionText),c.preventDefault()},s.handlePasteEvent=function(c,u,v,h){c.stopPropagation(),c.clipboardData&&_(c.clipboardData.getData("text/plain"),u,v,h)},s.paste=_,s.moveTextAreaUnderMouseCursor=n,s.rightClickHandler=function(c,u,v,h,t){n(c,u,v),t&&h.rightClickSelect(c),u.value=h.selectionText,u.select()}},7239:(A,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const d=o(1505);s.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(_,n,c){this._css.set(_,n,c)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,c){this._color.set(_,n,c)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(A,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,d,_,n){o.addEventListener(d,_,n);let c=!1;return{dispose:()=>{c||(c=!0,o.removeEventListener(d,_,n))}}}},3551:function(A,s,o){var d=this&&this.__decorate||function(i,e,r,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,e,r,a);else for(var l=i.length-1;l>=0;l--)(f=i[l])&&(g=(p<3?f(g):p>3?f(e,r,g):f(e,r))||g);return p>3&&g&&Object.defineProperty(e,r,g),g},_=this&&this.__param||function(i,e){return function(r,a){e(r,a,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const n=o(3656),c=o(8460),u=o(844),v=o(2585),h=o(4725);let t=s.Linkifier=class extends u.Disposable{get currentLink(){return this._currentLink}constructor(i,e,r,a,f){super(),this._element=i,this._mouseService=e,this._renderService=r,this._bufferService=a,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new c.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new c.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,u.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,u.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const r=i.composedPath();for(let a=0;a<r.length;a++){const f=r[a];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach((a=>{a?.forEach((f=>{f.link.dispose&&f.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=i.y);let r=!1;for(const[a,f]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(r=this._checkLinkProviderResult(a,i,r)):f.provideLinks(i.y,(p=>{if(this._isMouseOut)return;const g=p?.map((l=>({link:l})));this._activeProviderReplies?.set(a,g),r=this._checkLinkProviderResult(a,i,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)}))}_removeIntersectingLinks(i,e){const r=new Set;for(let a=0;a<e.size;a++){const f=e.get(a);if(f)for(let p=0;p<f.length;p++){const g=f[p],l=g.link.range.start.y<i?0:g.link.range.start.x,m=g.link.range.end.y>i?this._bufferService.cols:g.link.range.end.x;for(let E=l;E<=m;E++){if(r.has(E)){f.splice(p--,1);break}r.add(E)}}}}_checkLinkProviderResult(i,e,r){if(!this._activeProviderReplies)return r;const a=this._activeProviderReplies.get(i);let f=!1;for(let p=0;p<i;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&a){const p=a.find((g=>this._linkAtPosition(g.link,e)));p&&(r=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let p=0;p<this._activeProviderReplies.size;p++){const g=this._activeProviderReplies.get(p)?.find((l=>this._linkAtPosition(l.link,e)));if(g){r=!0,this._handleNewLink(g);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,e){this._currentLink&&this._lastMouseEvent&&(!i||!e||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,u.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((r=>{if(!this._currentLink)return;const a=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(a,f),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}}))))}_linkHover(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(r,e.text)}_fireUnderlineEvent(i,e){const r=i.range,a=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-a-1,r.end.x,r.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(r,e.text)}_linkAtPosition(i,e){const r=i.range.start.y*this._bufferService.cols+i.range.start.x,a=i.range.end.y*this._bufferService.cols+i.range.end.x,f=e.y*this._bufferService.cols+e.x;return r<=f&&f<=a}_positionFromMouseEvent(i,e,r){const a=r.getCoords(i,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,e,r,a,f){return{x1:i,y1:e,x2:r,y2:a,cols:this._bufferService.cols,fg:f}}};s.Linkifier=t=d([_(1,h.IMouseService),_(2,h.IRenderService),_(3,v.IBufferService),_(4,h.ILinkProviderService)],t)},9042:(A,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(A,s,o){var d=this&&this.__decorate||function(h,t,i,e){var r,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,i,e);else for(var p=h.length-1;p>=0;p--)(r=h[p])&&(f=(a<3?r(f):a>3?r(t,i,f):r(t,i))||f);return a>3&&f&&Object.defineProperty(t,i,f),f},_=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const n=o(511),c=o(2585);let u=s.OscLinkProvider=class{constructor(h,t,i){this._bufferService=h,this._optionsService=t,this._oscLinkService=i}provideLinks(h,t){const i=this._bufferService.buffer.lines.get(h-1);if(!i)return void t(void 0);const e=[],r=this._optionsService.rawOptions.linkHandler,a=new n.CellData,f=i.getTrimmedLength();let p=-1,g=-1,l=!1;for(let m=0;m<f;m++)if(g!==-1||i.hasContent(m)){if(i.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId){if(g===-1){g=m,p=a.extended.urlId;continue}l=a.extended.urlId!==p}else g!==-1&&(l=!0);if(l||g!==-1&&m===f-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const x={start:{x:g+1,y:h},end:{x:m+(l||m!==f-1?0:1),y:h}};let L=!1;if(!r?.allowNonHttpProtocols)try{const b=new URL(E);["http:","https:"].includes(b.protocol)||(L=!0)}catch{L=!0}L||e.push({text:E,range:x,activate:(b,R)=>r?r.activate(b,R,x):v(0,R),hover:(b,R)=>r?.hover?.(b,R,x),leave:(b,R)=>r?.leave?.(b,R,x)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(g=m,p=a.extended.urlId):(g=-1,p=-1)}}t(e)}};function v(h,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./index-
|
|
1
|
+
import{r as a}from"./index-xKewGzjC.js";const r=t=>a.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},a.createElement("path",{d:"M6.04 17.625a.953.953 0 0 0 .14-.012l3.943-.691a.23.23 0 0 0 .124-.066l9.935-9.935a.233.233 0 0 0 0-.33l-3.895-3.898a.232.232 0 0 0-.167-.068.232.232 0 0 0-.166.068l-9.935 9.935a.238.238 0 0 0-.066.124l-.691 3.943a.785.785 0 0 0 .22.698c.155.15.35.232.558.232zm1.58-4.088 8.5-8.498 1.718 1.718-8.5 8.498-2.084.368.366-2.085zm13.005 6.057H3.375a.75.75 0 0 0-.75.75v.843c0 .104.084.188.188.188h18.375a.188.188 0 0 0 .187-.188v-.843a.75.75 0 0 0-.75-.75z"}));export{r as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ai as e,bg as r,bh as s}from"./index-xKewGzjC.js";const o=e(r),t=e(s);export{t as a,o as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ar as r}from"./index-xKewGzjC.js";var a=r();export{a as e};
|
package/dist/assets/{federated-detail-dialog-FIBSqJbV.js → federated-detail-dialog-D1-tYtuH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,j as t,dp as _,bk as N,dq as T,dr as U,ds as $,r as P,p as O,aS as z,b6 as M,af as F,ab as y,k as p,bF as q,x as W,W as H,dt as b,bt as V,B as A,du as G,cu as X,aB as j,C as L,o as J}from"./index-
|
|
1
|
+
import{c as w,j as t,dp as _,bk as N,dq as T,dr as U,ds as $,r as P,p as O,aS as z,b6 as M,af as F,ab as y,k as p,bF as q,x as W,W as H,dt as b,bt as V,B as A,du as G,cu as X,aB as j,C as L,o as J}from"./index-xKewGzjC.js";import{v as K}from"./index-CUh73CTd.js";import{u as Q}from"./blocklet--DdX67Y5.js";const de=w(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),Y=w(t.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"}));var Z=Array.prototype,k=Z.splice;function ee(s,a,m,c){var e=N,g=-1,l=a.length,d=s;for(s===a&&(a=_(a));++g<l;)for(var i=0,f=a[g],h=f;(i=e(d,h,i))>-1;)d!==s&&k.call(d,i,1),k.call(s,i,1);return s}function ae(s,a){return s&&s.length&&a&&a.length?ee(s,a):s}var te=T(ae),D,B;function oe(){if(B)return D;B=1;const{DEFAULT_IP_DOMAIN_SUFFIX:s,SLOT_FOR_IP_DNS_SITE:a,DEFAULT_DID_DOMAIN:m}=U(),{encode:c}=$();return D={getIpDnsDomainForBlocklet:l=>`${c(l.meta.did)}-${a}.${s}`,getDidDomainForBlocklet:({did:l,didDomain:d=m})=>`${c(l)}.${d}`},D}var se=oe();function ie({ref:s=null}){const{t:a}=P.useContext(O),{blocklet:m}=Q(),{api:c}=z(),e=M({loadingReject:!1,loadingApprove:!1,mode:"view",show:!1,data:{},callback:F}),l=y()?.transitions?.duration?.leavingScreen||300,d=p(()=>{e.mode="view",e.data={},e.callback=F}),i=p(()=>{e.show=!1,setTimeout(()=>{d()},l)}),f=p(n=>{e.mode="view",e.show=!0,e.data=n}),h=p((n,r=F)=>{e.mode="approve",e.show=!0,e.data=n,e.callback=r});P.useImperativeHandle(s,()=>({open:f,close:i,approve:h}),[f,i,h]);const R=q(()=>{if(!e.show)return[];e.data.migratedFrom=[e.data.appId,e.data.appPid];const n=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return e.data.isMaster!==!1&&te(n,"appliedAt","status"),n.map(r=>{const S=a(`federated.info.${r}`);let o=e.data[r];if(r==="appName"&&e.data.isMaster&&(o=t.jsxs(A,{sx:{display:"flex",alignItems:"center",gap:.5},children:[t.jsx(G,{component:Y}),o]})),["appId","appPid","serverId"].includes(r)&&(o=t.jsx(b,{children:o})),["appUrl"].includes(r)&&(o=t.jsx(A,{component:"a",href:o,target:"_blank",children:o})),["appLogo"].includes(r)){const v=W(`https://${se.getDidDomainForBlocklet({did:e.data.appPid})}`,H,"/blocklet/logo");try{const u=new URL(v);u.searchParams.set("imageFilter","resize"),u.searchParams.set("w","80"),u.searchParams.set("h","80"),o=t.jsx("img",{src:u.href,width:"60",height:"60",alt:e.data.appName})}catch{o=t.jsx("img",{src:v,width:"60",height:"60",alt:e.data.appName})}}return r==="status"&&(o=o&&a(`federated.status.${o}`)),r==="migratedFrom"&&(o=(e.data.migratedFrom||[]).filter(x=>![e.data.appId,e.data.appPid].includes(x)).map(x=>t.jsx(b,{children:x}))),V(o)&&(o="-"),{name:S,value:o}})},[e.data]),I=e.mode==="approve",C=p(async()=>{try{e.loadingReject=!0,await c.auditFederatedLogin({input:{memberPid:e.data.appPid,did:m.appPid,status:"rejected"}}),i(),e?.callback(!1)}finally{e.loadingReject=!1}}),E=p(async()=>{try{e.loadingApprove=!0,await c.auditFederatedLogin({input:{memberPid:e.data.appPid,did:m.appPid,status:"approved"}}),i(),e?.callback(!0)}finally{e.loadingApprove=!1}});return t.jsx(X,{open:e.show,title:a(I?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:i,actions:I?t.jsxs(t.Fragment,{children:[t.jsxs(j,{color:"error",variant:"contained",onClick:C,disabled:e.loadingReject,children:[e.loadingReject?t.jsx(L,{size:16,color:"grey"}):null,a("common.reject")]}),t.jsxs(j,{variant:"contained",onClick:E,disabled:e.loadingApprove,children:[e.loadingApprove?t.jsx(L,{size:16,color:"grey"}):null,a("common.approve")]})]}):t.jsx(j,{variant:"outlined",onClick:i,children:a("common.close")}),children:R.map(n=>t.jsx(K,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:n.name,children:n.value},n.name))})}ie.propTypes={ref:J.any};export{de as E,ie as F,Y as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as t,H as o}from"./index-
|
|
1
|
+
import{n as t,H as o}from"./index-xKewGzjC.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r}from"./index-xKewGzjC.js";function a(t){return r.Children.toArray(t).filter(e=>r.isValidElement(e))}export{a as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bj as fn}from"./index-
|
|
1
|
+
import{bj as fn}from"./index-xKewGzjC.js";function En(w,G){for(var _=0;_<G.length;_++){const g=G[_];if(typeof g!="string"&&!Array.isArray(g)){for(const D in g)if(D!=="default"&&!(D in w)){const P=Object.getOwnPropertyDescriptor(g,D);P&&Object.defineProperty(w,D,P.get?P:{enumerable:!0,get:()=>g[D]})}}}return Object.freeze(Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}))}var Z={exports:{}},xe;function mn(){return xe||(xe=1,(function(w,G){(function(_){function g(){var D=_();return D.default||D}w.exports=g()})(function(){var _=Object.defineProperty,g=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,P=Object.prototype.hasOwnProperty,ee=(e,t)=>{for(var n in t)_(e,n,{get:t[n],enumerable:!0})},ke=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D(t))!P.call(e,i)&&i!==n&&_(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e},Ce=e=>ke(_({},"__esModule",{value:!0}),e),te={};ee(te,{languages:()=>At,options:()=>gt,parsers:()=>de,printers:()=>dn});var Se=(e,t)=>(n,r,...i)=>n|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,i),be=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},Re=Se("replaceAll",function(){if(typeof this=="string")return be}),Y=Re,Le=()=>{},Fe=Le,we="indent",Pe="group",Me="if-break",q="line",Ue="break-parent",Ve=Fe;function N(e){return{type:we,contents:e}}var Be={type:Ue};function y(e,t={}){return Ve(t.expandedStates),{type:Pe,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function A(e,t="",n={}){return{type:Me,breakContents:e,flatContents:t,groupId:n.groupId}}function E(e,t){let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}var S={type:q},u={type:q,soft:!0},je={type:q,hard:!0},h=[je,Be];function J(e){return(t,n,r)=>{let i=!!r?.backwards;if(n===!1)return!1;let{length:s}=t,l=n;for(;l>=0&&l<s;){let c=t.charAt(l);if(e instanceof RegExp){if(!e.test(c))return l}else if(!e.includes(c))return l;i?l--:l++}return l===-1||l===s?l:!1}}var ne=J(" "),$e=J(",; "),Ke=J(/[^\n\r]/u),ie=e=>e===`
|
|
2
2
|
`||e==="\r"||e==="\u2028"||e==="\u2029";function Ge(e,t,n){let r=!!n?.backwards;if(t===!1)return!1;let i=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&i===`
|
|
3
3
|
`)return t-2;if(ie(i))return t-1}else{if(i==="\r"&&e.charAt(t+1)===`
|
|
4
4
|
`)return t+2;if(ie(i))return t+1}return t}var re=Ge;function Ye(e,t,n={}){let r=ne(e,n.backwards?t-1:t,n),i=re(e,r,n);return r!==i}var qe=Ye;function Je(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let n=t+2;n<e.length;++n)if(e.charAt(n)==="*"&&e.charAt(n+1)==="/")return n+2}return t}var Qe=Je;function Xe(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Ke(e,t):t}var ze=Xe;function He(e,t){let n=null,r=t;for(;r!==n;)n=r,r=$e(e,r),r=Qe(e,r),r=ne(e,r);return r=ze(e,r),r=re(e,r),r!==!1&&qe(e,r)}var We=He;function Ze(e){return Array.isArray(e)&&e.length>0}var se=Ze,et=class extends Error{name="UnexpectedNodeError";constructor(e,t,n="type"){super(`Unexpected ${t} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},tt=et,M=null;function U(e){if(M!==null&&typeof M.property){let t=M;return M=U.prototype=null,t}return M=U.prototype=e??Object.create(null),new U}var nt=10;for(let e=0;e<=nt;e++)U();function it(e){return U(e)}function rt(e,t="type"){it(e);function n(r){let i=r[t],s=e[i];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:r});return s}return n}var st=rt,at=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},ae=class{constructor(e,t,n,r,i,s){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},oe={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]};new Set(Object.keys(oe));var b;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(b||(b={}));var le={...oe};for(let e of["ArgumentCoordinate","DirectiveArgumentCoordinate","DirectiveCoordinate","MemberCoordinate","TypeCoordinate"])delete le[e];var ot=le,lt=st(ot,"kind"),ct=lt,ce=e=>e.loc.start,ue=e=>e.loc.end,ut="format",pt=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u,ht=/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u,dt=e=>ht.test(e),ft=e=>pt.test(e),Et=e=>`# @${ut}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./monaco-editor-
|
|
2
|
-
import{e as h,U as v,l as m}from"./monaco-editor-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./monaco-editor-ie9ljpWK.js","./index-xKewGzjC.js","./index-BLDnEtdF.css","./mouseTarget-DEC5Z4-r.js","./index-BHcgO_SJ.js","./index-CWrrTi4L.css","./monaco-editor-C5ZQUaPo.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{e as h,U as v,l as m}from"./monaco-editor-ie9ljpWK.js";import{g as M,a as f,C as r}from"./index-BHcgO_SJ.js";import{G as T}from"./index-xKewGzjC.js";import"./mouseTarget-DEC5Z4-r.js";const x=120*1e3;class F{_defaults;_idleCheckInterval;_lastUsedTime=0;_configChangeListener;_worker=null;_client=null;constructor(e){this._defaults=e,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._configChangeListener=this._defaults.onDidChange(()=>{this._stopWorker()})}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>x&&this._stopWorker()}async _getClient(){if(this._lastUsedTime=Date.now(),!this._client&&!this._worker)try{const{languageId:e,formattingOptions:s,schemas:c,externalFragmentDefinitions:a,completionSettings:l}=this._defaults;this._worker=h.createWebWorker({moduleId:"monaco-graphql/esm/GraphQLWorker.js",label:e,createData:{languageId:e,formattingOptions:s,languageConfig:{schemas:c?.map(M),externalFragmentDefinitions:a,fillLeafsOnComplete:l.__experimental__fillLeafsOnComplete}}}),this._client=this._worker.getProxy()}catch(e){console.error("error loading worker",e)}return this._client}async getLanguageServiceWorker(...e){const s=await this._getClient();return await this._worker.withSyncedResources(e),s}}class b{defaults;_worker;_disposables=[];_listener=Object.create(null);constructor(e,s){this.defaults=e,this._worker=s,this._worker=s;let c;const a=t=>{const d=f(t);if(d!==this.defaults.languageId)return;const g=t.uri.toString(),u=e.diagnosticSettings.validateVariablesJSON?.[g];c=setTimeout(()=>{this._doValidate(t.uri,d,u)},400),this._listener[g]=t.onDidChangeContent(()=>{clearTimeout(c),c=setTimeout(()=>{this._doValidate(t.uri,d,u)},400)})},l=t=>{h.setModelMarkers(t,this.defaults.languageId,[]);const d=t.uri.toString(),g=this._listener[d];g&&(g.dispose(),delete this._listener[d])};this._disposables.push(h.onDidCreateModel(a),{dispose(){clearTimeout(c)}},h.onWillDisposeModel(t=>{l(t)}),h.onDidChangeModelLanguage(t=>{l(t.model),a(t.model)}),{dispose:()=>{for(const t of Object.values(this._listener))t.dispose()}},e.onDidChange(()=>{for(const t of h.getModels())f(t)===this.defaults.languageId&&(l(t),a(t))}));for(const t of h.getModels())f(t)===this.defaults.languageId&&a(t)}dispose(){for(const e of this._disposables)e.dispose();this._disposables=[]}async _doValidate(e,s,c){const a=await this._worker(e);if(!a)return;const l=await a.doValidation(e.toString());if(h.setModelMarkers(h.getModel(e),s,l),c){if(await T(()=>import("./monaco-editor-ie9ljpWK.js").then(p=>p.a),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),!c.length)throw new Error("No variables URI strings provided to validate");const t=await a.doGetVariablesJSONSchema(e.toString());if(!t)return;const d=v.file(c[0].replace(".json","-schema.json")).toString(),g={uri:d,schema:t,fileMatch:c},u=m.json.jsonDefaults.diagnosticsOptions.schemas?.filter(p=>p.uri!==d)||[];m.json.jsonDefaults.setDiagnosticsOptions({schemaValidation:"error",validate:!0,...this.defaults.diagnosticSettings.jsonDiagnosticSettings,schemas:[...u,g],enableSchemaRequest:!1})}}}const i=m.CompletionItemKind,C={[r.Text]:i.Text,[r.Method]:i.Method,[r.Function]:i.Function,[r.Constructor]:i.Constructor,[r.Field]:i.Field,[r.Variable]:i.Variable,[r.Class]:i.Class,[r.Interface]:i.Interface,[r.Module]:i.Module,[r.Property]:i.Property,[r.Unit]:i.Unit,[r.Value]:i.Value,[r.Enum]:i.Enum,[r.Keyword]:i.Keyword,[r.Snippet]:i.Snippet,[r.Color]:i.Color,[r.File]:i.File,[r.Reference]:i.Reference,[r.Folder]:i.Folder,[r.EnumMember]:i.EnumMember,[r.Constant]:i.Constant,[r.Struct]:i.Struct,[r.Event]:i.Event,[r.Operator]:i.Operator,[r.TypeParameter]:i.TypeParameter};function E(o){return o in C?C[o]:i.Text}function O(o){return{range:o.range,kind:E(o.kind),label:o.label,insertText:o.insertText??o.label,insertTextRules:o.insertText?m.CompletionItemInsertTextRule.InsertAsSnippet:void 0,sortText:o.sortText,filterText:o.filterText,documentation:o.documentation,detail:o.detail,command:o.command}}class L{_worker;constructor(e){this._worker=e,this._worker=e}get triggerCharacters(){return[":","$"," ","(","@"]}async provideCompletionItems(e,s,c,a){try{return{incomplete:!0,suggestions:(await(await this._worker(e.uri)).doComplete(e.uri.toString(),s)).map(O)}}catch(l){return console.error("Error fetching completion items",l),{suggestions:[]}}}}class P{_worker;constructor(e){this._worker=e,this._worker=e}async provideDocumentFormattingEdits(e,s,c){const l=await(await this._worker(e.uri)).doFormat(e.uri.toString());return l?[{range:e.getFullModelRange(),text:l}]:[]}}class V{_worker;constructor(e){this._worker=e}async provideHover(e,s,c){const a=e.uri,t=await(await this._worker(e.uri)).doHover(a.toString(),s);return t?{range:t.range,contents:[{value:t.content}]}:{contents:[]}}dispose(){}}function A(o){const e=[],s=[],c=new F(o);e.push(c);const a=(...n)=>{try{return c.getLanguageServiceWorker(...n)}catch{throw new Error("Error fetching graphql language service worker")}};function l(){const{modeConfiguration:n,languageId:_}=o;n.documentFormattingEdits&&s.push(m.registerDocumentFormattingEditProvider(_,new P(a)))}function t(n){const{modeConfiguration:_,languageId:w}=o;S(s),_.completionItems&&s.push(m.registerCompletionItemProvider(w,new L(a))),_.diagnostics&&s.push(new b(n,a)),_.hovers&&s.push(m.registerHoverProvider(w,new V(a))),l()}let{modeConfiguration:d,formattingOptions:g,diagnosticSettings:u,externalFragmentDefinitions:p,schemas:k}=o;return t(o),o.onDidChange(n=>{n.modeConfiguration!==d&&(d=n.modeConfiguration,t(n)),n.formattingOptions!==g&&(g=n.formattingOptions,l()),n.externalFragmentDefinitions!==p&&(p=n.externalFragmentDefinitions,t(n)),n.diagnosticSettings!==u&&(u=n.diagnosticSettings,t(n)),n.schemas!==k&&(k=n.schemas,t(n))}),e.push(I(s)),I(e)}function I(o){return{dispose:()=>S(o)}}function S(o){for(;o.length;)o.pop().dispose()}export{A as setupMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aY as bt,aZ as pt,r as u,$ as ft,a4 as W,j as p,a3 as N,b0 as At,a5 as ht,a7 as Ft,a9 as St,a1 as fe,ei as Ot,ej as Dt,dP as Xt,ek as he,el as Se,ca as lt,ab as ve,bR as dt,bV as D,em as me,dL as xe,O as ye,b as ge,bF as Ce,en as we,eo as Be}from"./index-Dtj3cePH.js";function Te(e){return pt("MuiTab",e)}const x=bt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Ie=e=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:i,selected:b,disabled:f}=e,v={root:["root",a&&i&&"labelIcon",`textColor${At(l)}`,s&&"fullWidth",n&&"wrapped",b&&"selected",f&&"disabled"],icon:["iconWrapper","icon"]};return ht(v,Te,t)},Me=N(Ft,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${At(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${x.iconWrapper}`]:t.iconWrapper},{[`& .${x.icon}`]:t.icon}]}})(St(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="top",style:{[`& > .${x.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="bottom",style:{[`& > .${x.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="start",style:{[`& > .${x.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="end",style:{[`& > .${x.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${x.selected}`]:{opacity:1},[`&.${x.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${x.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${x.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${x.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${x.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),vt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:i=!1,fullWidth:b,icon:f,iconPosition:v="top",indicator:C,label:m,onChange:S,onClick:w,onFocus:j,selected:B,selectionFollowsFocus:y,textColor:Z="inherit",value:M,wrapped:rt=!1,...P}=s,A={...s,disabled:a,disableFocusRipple:i,selected:B,icon:!!f,iconPosition:v,label:!!m,fullWidth:b,textColor:Z,wrapped:rt},K=Ie(A),Y=f&&m&&u.isValidElement(f)?u.cloneElement(f,{className:W(K.icon,f.props.className)}):f,J=E=>{!B&&S&&S(E,M),w&&w(E)},F=E=>{y&&!B&&S&&S(E,M),j&&j(E)};return p.jsxs(Me,{focusRipple:!i,className:W(K.root,n),ref:l,role:"tab","aria-selected":B,disabled:a,onClick:J,onFocus:F,ownerState:A,tabIndex:B?0:-1,...P,children:[v==="top"||v==="start"?p.jsxs(u.Fragment,{children:[Y,m]}):p.jsxs(u.Fragment,{children:[m,Y]}),C]})});function Pe(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function Ee(e,t,l,s={},n=()=>{}){const{ease:a=Pe,duration:i=300}=s;let b=null;const f=t[e];let v=!1;const C=()=>{v=!0},m=S=>{if(v){n(new Error("Animation cancelled"));return}b===null&&(b=S);const w=Math.min(1,(S-b)/i);if(t[e]=a(w)*(l-f)+f,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(m)};return f===l?(n(new Error("Element already at target position")),C):(requestAnimationFrame(m),C)}const Re={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ke(e){const{onChange:t,...l}=e,s=u.useRef(),n=u.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return fe(()=>{const i=Ot(()=>{const f=s.current;a(),f!==s.current&&t(s.current)}),b=Dt(n.current);return b.addEventListener("resize",i),()=>{i.clear(),b.removeEventListener("resize",i)}},[t]),u.useEffect(()=>{a(),t(s.current)},[t]),p.jsx("div",{style:Re,...l,ref:n})}function ze(e){return pt("MuiTabScrollButton",e)}const We=bt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),je=e=>{const{classes:t,orientation:l,disabled:s}=e;return ht({root:["root",l,s&&"disabled"]},ze,t)},He=N(Ft,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.orientation&&t[l.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${We.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),$e=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabScrollButton"}),{className:n,slots:a={},slotProps:i={},direction:b,orientation:f,disabled:v,...C}=s,m=Xt(),S={isRtl:m,...s},w=je(S),j=a.StartScrollButtonIcon??he,B=a.EndScrollButtonIcon??Se,y=lt({elementType:j,externalSlotProps:i.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),Z=lt({elementType:B,externalSlotProps:i.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(He,{component:"div",className:W(w.root,n),ref:l,role:null,ownerState:S,tabIndex:null,...C,style:{...C.style,...f==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${m?-90:90}deg)`}},children:b==="left"?p.jsx(j,{...y}):p.jsx(B,{...Z})})});function Le(e){return pt("MuiTabs",e)}const ut=bt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ht=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,$t=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,ot=(e,t,l)=>{let s=!1,n=l(e,t);for(;n;){if(n===e.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(e,n);else{n.focus();return}}},Ne=e=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:i,scrollButtonsHideMobile:b,classes:f}=e;return ht({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",i&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",b&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Le,f)},Ae=N("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${ut.scrollButtons}`]:t.scrollButtons},{[`& .${ut.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(St(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${ut.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),Fe=N("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),Oe=N("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.list,t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),De=N("span",{name:"MuiTabs",slot:"Indicator"})(St(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),Xe=N(ke)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},mt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabs"}),n=ve(),a=Xt(),{"aria-label":i,"aria-labelledby":b,action:f,centered:v=!1,children:C,className:m,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:j="primary",onChange:B,orientation:y="horizontal",ScrollButtonComponent:Z,scrollButtons:M="auto",selectionFollowsFocus:rt,slots:P={},slotProps:A={},TabIndicatorProps:K={},TabScrollButtonProps:Y={},textColor:J="primary",value:F,variant:E="standard",visibleScrollbar:nt=!1,...Kt}=s,T=E==="scrollable",g=y==="vertical",U=g?"scrollTop":"scrollLeft",Q=g?"top":"left",_=g?"bottom":"right",st=g?"clientHeight":"clientWidth",V=g?"height":"width",R={...s,component:S,allowScrollButtonsMobile:w,indicatorColor:j,orientation:y,vertical:g,scrollButtons:M,textColor:J,variant:E,visibleScrollbar:nt,fixed:!T,hideScrollbar:T&&!nt,scrollableX:T&&!g,scrollableY:T&&g,centered:v&&!T,scrollButtonsHideMobile:!w},z=Ne(R),Yt=lt({elementType:P.StartScrollButtonIcon,externalSlotProps:A.startScrollButtonIcon,ownerState:R}),Ut=lt({elementType:P.EndScrollButtonIcon,externalSlotProps:A.endScrollButtonIcon,ownerState:R}),[xt,Vt]=u.useState(!1),[H,yt]=u.useState(Lt),[gt,qt]=u.useState(!1),[Ct,Gt]=u.useState(!1),[wt,Zt]=u.useState(!1),[Bt,Jt]=u.useState({overflow:"hidden",scrollbarWidth:0}),Tt=new Map,k=u.useRef(null),$=u.useRef(null),O={slots:P,slotProps:{indicator:K,scrollButtons:Y,...A}},It=()=>{const o=k.current;let r;if(o){const c=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollWidth:o.scrollWidth,top:c.top,bottom:c.bottom,left:c.left,right:c.right}}let d;if(o&&F!==!1){const c=$.current.children;if(c.length>0){const h=c[Tt.get(F)];d=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:d}},q=dt(()=>{const{tabsMeta:o,tabMeta:r}=It();let d=0,c;g?(c="top",r&&o&&(d=r.top-o.top+o.scrollTop)):(c=a?"right":"left",r&&o&&(d=(a?-1:1)*(r[c]-o[c]+o.scrollLeft)));const h={[c]:d,[V]:r?r[V]:0};if(typeof H[c]!="number"||typeof H[V]!="number")yt(h);else{const I=Math.abs(H[c]-h[c]),L=Math.abs(H[V]-h[V]);(I>=1||L>=1)&&yt(h)}}),at=(o,{animation:r=!0}={})=>{r?Ee(U,k.current,o,{duration:n.transitions.duration.standard}):k.current[U]=o},Mt=o=>{let r=k.current[U];g?r+=o:r+=o*(a?-1:1),at(r)},Pt=()=>{const o=k.current[st];let r=0;const d=Array.from($.current.children);for(let c=0;c<d.length;c+=1){const h=d[c];if(r+h[st]>o){c===0&&(r=o);break}r+=h[st]}return r},Qt=()=>{Mt(-1*Pt())},_t=()=>{Mt(Pt())},[te,{onChange:Et,...ee}]=D("scrollbar",{className:W(z.scrollableX,z.hideScrollbar),elementType:Xe,shouldForwardComponentProp:!0,externalForwardedProps:O,ownerState:R}),oe=u.useCallback(o=>{Et?.(o),Jt({overflow:null,scrollbarWidth:o})},[Et]),[Rt,kt]=D("scrollButtons",{className:W(z.scrollButtons,Y.className),elementType:$e,externalForwardedProps:O,ownerState:R,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:P.startScrollButtonIcon||P.StartScrollButtonIcon,EndScrollButtonIcon:P.endScrollButtonIcon||P.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:Yt,endScrollButtonIcon:Ut}}}),le=()=>{const o={};o.scrollbarSizeListener=T?p.jsx(te,{...ee,onChange:oe}):null;const d=T&&(M==="auto"&&(gt||Ct)||M===!0);return o.scrollButtonStart=d?p.jsx(Rt,{direction:a?"right":"left",onClick:Qt,disabled:!gt,...kt}):null,o.scrollButtonEnd=d?p.jsx(Rt,{direction:a?"left":"right",onClick:_t,disabled:!Ct,...kt}):null,o},zt=dt(o=>{const{tabsMeta:r,tabMeta:d}=It();if(!(!d||!r)){if(d[Q]<r[Q]){const c=r[U]+(d[Q]-r[Q]);at(c,{animation:o})}else if(d[_]>r[_]){const c=r[U]+(d[_]-r[_]);at(c,{animation:o})}}}),tt=dt(()=>{T&&M!==!1&&Zt(!wt)});u.useEffect(()=>{const o=Ot(()=>{k.current&&q()});let r;const d=I=>{I.forEach(L=>{L.removedNodes.forEach(G=>{r?.unobserve(G)}),L.addedNodes.forEach(G=>{r?.observe(G)})}),o(),tt()},c=Dt(k.current);c.addEventListener("resize",o);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from($.current.children).forEach(I=>{r.observe(I)})),typeof MutationObserver<"u"&&(h=new MutationObserver(d),h.observe($.current,{childList:!0})),()=>{o.clear(),c.removeEventListener("resize",o),h?.disconnect(),r?.disconnect()}},[q,tt]),u.useEffect(()=>{const o=Array.from($.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&T&&M!==!1){const d=o[0],c=o[r-1],h={root:k.current,threshold:.99},I=ct=>{qt(!ct[0].isIntersecting)},L=new IntersectionObserver(I,h);L.observe(d);const G=ct=>{Gt(!ct[0].isIntersecting)},jt=new IntersectionObserver(G,h);return jt.observe(c),()=>{L.disconnect(),jt.disconnect()}}},[T,M,wt,C?.length]),u.useEffect(()=>{Vt(!0)},[]),u.useEffect(()=>{q()}),u.useEffect(()=>{zt(Lt!==H)},[zt,H]),u.useImperativeHandle(f,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const[re,ne]=D("indicator",{className:W(z.indicator,K.className),elementType:De,externalForwardedProps:O,ownerState:R,additionalProps:{style:H}}),Wt=p.jsx(re,{...ne});let et=0;const se=u.Children.map(C,o=>{if(!u.isValidElement(o))return null;const r=o.props.value===void 0?et:o.props.value;Tt.set(r,et);const d=r===F;return et+=1,u.cloneElement(o,{fullWidth:E==="fullWidth",indicator:d&&!xt&&Wt,selected:d,selectionFollowsFocus:rt,onChange:B,textColor:J,value:r,...et===1&&F===!1&&!o.props.tabIndex?{tabIndex:0}:{}})}),ae=o=>{if(o.altKey||o.shiftKey||o.ctrlKey||o.metaKey)return;const r=$.current,d=me(xe(r));if(d?.getAttribute("role")!=="tab")return;let h=y==="horizontal"?"ArrowLeft":"ArrowUp",I=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&a&&(h="ArrowRight",I="ArrowLeft"),o.key){case h:o.preventDefault(),ot(r,d,$t);break;case I:o.preventDefault(),ot(r,d,Ht);break;case"Home":o.preventDefault(),ot(r,null,Ht);break;case"End":o.preventDefault(),ot(r,null,$t);break}},it=le(),[ie,ce]=D("root",{ref:l,className:W(z.root,m),elementType:Ae,externalForwardedProps:{...O,...Kt,component:S},ownerState:R}),[de,ue]=D("scroller",{ref:k,className:z.scroller,elementType:Fe,externalForwardedProps:O,ownerState:R,additionalProps:{style:{overflow:Bt.overflow,[g?`margin${a?"Left":"Right"}`:"marginBottom"]:nt?void 0:-Bt.scrollbarWidth}}}),[be,pe]=D("list",{ref:$,className:W(z.list,z.flexContainer),elementType:Oe,externalForwardedProps:O,ownerState:R,getSlotProps:o=>({...o,onKeyDown:r=>{ae(r),o.onKeyDown?.(r)}})});return p.jsxs(ie,{...ce,children:[it.scrollButtonStart,it.scrollbarSizeListener,p.jsxs(de,{...ue,children:[p.jsx(be,{"aria-label":i,"aria-labelledby":b,"aria-orientation":y==="vertical"?"vertical":null,role:"tablist",...pe,children:se}),xt&&Wt]}),it.scrollButtonEnd]})}),Nt="index",X={tabs:`${Nt}-tabs`,tab:`${Nt}-tab`},Ke=ye(mt)(({theme:e})=>({[`& .${X.tabs}`]:{},[`& .${X.tab}`]:{fontSize:"0.875rem",[e.breakpoints.up("md")]:{fontSize:"1rem"}}}));function Ye({tabs:e,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:"grey.100",padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...a.sx},children:e.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function Ue({tabs:e,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":a.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...a.sx},children:e.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function qe({tabs:e,current:t,onChange:l,variant:s=void 0,iconPosition:n=void 0,enableTabClick:a=!1,...i}){return s==="card"?p.jsx(Ye,{...i,tabs:e,current:t,enableTabClick:a,onChange:l,iconPosition:n}):s==="line"?p.jsx(Ue,{...i,tabs:e,current:t,enableTabClick:a,onChange:l,iconPosition:n}):p.jsx(Ke,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(b,f)=>!a&&l(f),indicatorColor:"primary",...i,className:[X.tabs,i.className||""].join(" "),children:e.map(b=>p.jsx(vt,{className:X.tab,value:b.value,label:b.label,icon:b.icon,iconPosition:n,onClick:()=>a&&l(b.value)},b.value))})}function Ge(e,t=""){const{info:l}=ge(),s=Ce(()=>{const n=e?.breadcrumbsLabel||e?.label||"";return we(n,t,l)},[e,t,l]);return s?p.jsx(Be,{children:p.jsx("title",{children:s})}):null}export{qe as T,mt as a,vt as b,ut as t,Ge as u};
|
|
1
|
+
import{aY as bt,aZ as pt,r as u,$ as ft,a4 as W,j as p,a3 as N,b0 as At,a5 as ht,a7 as Ft,a9 as St,a1 as fe,ei as Ot,ej as Dt,dP as Xt,ek as he,el as Se,ca as lt,ab as ve,bR as dt,bV as D,em as me,dL as xe,O as ye,b as ge,bF as Ce,en as we,eo as Be}from"./index-xKewGzjC.js";function Te(e){return pt("MuiTab",e)}const x=bt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Ie=e=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:i,selected:b,disabled:f}=e,v={root:["root",a&&i&&"labelIcon",`textColor${At(l)}`,s&&"fullWidth",n&&"wrapped",b&&"selected",f&&"disabled"],icon:["iconWrapper","icon"]};return ht(v,Te,t)},Me=N(Ft,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${At(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${x.iconWrapper}`]:t.iconWrapper},{[`& .${x.icon}`]:t.icon}]}})(St(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="top",style:{[`& > .${x.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="bottom",style:{[`& > .${x.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="start",style:{[`& > .${x.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:t,iconPosition:l})=>t.icon&&t.label&&l==="end",style:{[`& > .${x.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${x.selected}`]:{opacity:1},[`&.${x.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${x.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${x.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${x.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${x.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),vt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:i=!1,fullWidth:b,icon:f,iconPosition:v="top",indicator:C,label:m,onChange:S,onClick:w,onFocus:j,selected:B,selectionFollowsFocus:y,textColor:Z="inherit",value:M,wrapped:rt=!1,...P}=s,A={...s,disabled:a,disableFocusRipple:i,selected:B,icon:!!f,iconPosition:v,label:!!m,fullWidth:b,textColor:Z,wrapped:rt},K=Ie(A),Y=f&&m&&u.isValidElement(f)?u.cloneElement(f,{className:W(K.icon,f.props.className)}):f,J=E=>{!B&&S&&S(E,M),w&&w(E)},F=E=>{y&&!B&&S&&S(E,M),j&&j(E)};return p.jsxs(Me,{focusRipple:!i,className:W(K.root,n),ref:l,role:"tab","aria-selected":B,disabled:a,onClick:J,onFocus:F,ownerState:A,tabIndex:B?0:-1,...P,children:[v==="top"||v==="start"?p.jsxs(u.Fragment,{children:[Y,m]}):p.jsxs(u.Fragment,{children:[m,Y]}),C]})});function Pe(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function Ee(e,t,l,s={},n=()=>{}){const{ease:a=Pe,duration:i=300}=s;let b=null;const f=t[e];let v=!1;const C=()=>{v=!0},m=S=>{if(v){n(new Error("Animation cancelled"));return}b===null&&(b=S);const w=Math.min(1,(S-b)/i);if(t[e]=a(w)*(l-f)+f,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(m)};return f===l?(n(new Error("Element already at target position")),C):(requestAnimationFrame(m),C)}const Re={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ke(e){const{onChange:t,...l}=e,s=u.useRef(),n=u.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return fe(()=>{const i=Ot(()=>{const f=s.current;a(),f!==s.current&&t(s.current)}),b=Dt(n.current);return b.addEventListener("resize",i),()=>{i.clear(),b.removeEventListener("resize",i)}},[t]),u.useEffect(()=>{a(),t(s.current)},[t]),p.jsx("div",{style:Re,...l,ref:n})}function ze(e){return pt("MuiTabScrollButton",e)}const We=bt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),je=e=>{const{classes:t,orientation:l,disabled:s}=e;return ht({root:["root",l,s&&"disabled"]},ze,t)},He=N(Ft,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.orientation&&t[l.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${We.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),$e=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabScrollButton"}),{className:n,slots:a={},slotProps:i={},direction:b,orientation:f,disabled:v,...C}=s,m=Xt(),S={isRtl:m,...s},w=je(S),j=a.StartScrollButtonIcon??he,B=a.EndScrollButtonIcon??Se,y=lt({elementType:j,externalSlotProps:i.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),Z=lt({elementType:B,externalSlotProps:i.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(He,{component:"div",className:W(w.root,n),ref:l,role:null,ownerState:S,tabIndex:null,...C,style:{...C.style,...f==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${m?-90:90}deg)`}},children:b==="left"?p.jsx(j,{...y}):p.jsx(B,{...Z})})});function Le(e){return pt("MuiTabs",e)}const ut=bt("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ht=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,$t=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,ot=(e,t,l)=>{let s=!1,n=l(e,t);for(;n;){if(n===e.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(e,n);else{n.focus();return}}},Ne=e=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:i,scrollButtonsHideMobile:b,classes:f}=e;return ht({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",i&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",b&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Le,f)},Ae=N("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${ut.scrollButtons}`]:t.scrollButtons},{[`& .${ut.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(St(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${ut.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),Fe=N("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),Oe=N("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.list,t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),De=N("span",{name:"MuiTabs",slot:"Indicator"})(St(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),Xe=N(ke)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},mt=u.forwardRef(function(t,l){const s=ft({props:t,name:"MuiTabs"}),n=ve(),a=Xt(),{"aria-label":i,"aria-labelledby":b,action:f,centered:v=!1,children:C,className:m,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:j="primary",onChange:B,orientation:y="horizontal",ScrollButtonComponent:Z,scrollButtons:M="auto",selectionFollowsFocus:rt,slots:P={},slotProps:A={},TabIndicatorProps:K={},TabScrollButtonProps:Y={},textColor:J="primary",value:F,variant:E="standard",visibleScrollbar:nt=!1,...Kt}=s,T=E==="scrollable",g=y==="vertical",U=g?"scrollTop":"scrollLeft",Q=g?"top":"left",_=g?"bottom":"right",st=g?"clientHeight":"clientWidth",V=g?"height":"width",R={...s,component:S,allowScrollButtonsMobile:w,indicatorColor:j,orientation:y,vertical:g,scrollButtons:M,textColor:J,variant:E,visibleScrollbar:nt,fixed:!T,hideScrollbar:T&&!nt,scrollableX:T&&!g,scrollableY:T&&g,centered:v&&!T,scrollButtonsHideMobile:!w},z=Ne(R),Yt=lt({elementType:P.StartScrollButtonIcon,externalSlotProps:A.startScrollButtonIcon,ownerState:R}),Ut=lt({elementType:P.EndScrollButtonIcon,externalSlotProps:A.endScrollButtonIcon,ownerState:R}),[xt,Vt]=u.useState(!1),[H,yt]=u.useState(Lt),[gt,qt]=u.useState(!1),[Ct,Gt]=u.useState(!1),[wt,Zt]=u.useState(!1),[Bt,Jt]=u.useState({overflow:"hidden",scrollbarWidth:0}),Tt=new Map,k=u.useRef(null),$=u.useRef(null),O={slots:P,slotProps:{indicator:K,scrollButtons:Y,...A}},It=()=>{const o=k.current;let r;if(o){const c=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollWidth:o.scrollWidth,top:c.top,bottom:c.bottom,left:c.left,right:c.right}}let d;if(o&&F!==!1){const c=$.current.children;if(c.length>0){const h=c[Tt.get(F)];d=h?h.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:d}},q=dt(()=>{const{tabsMeta:o,tabMeta:r}=It();let d=0,c;g?(c="top",r&&o&&(d=r.top-o.top+o.scrollTop)):(c=a?"right":"left",r&&o&&(d=(a?-1:1)*(r[c]-o[c]+o.scrollLeft)));const h={[c]:d,[V]:r?r[V]:0};if(typeof H[c]!="number"||typeof H[V]!="number")yt(h);else{const I=Math.abs(H[c]-h[c]),L=Math.abs(H[V]-h[V]);(I>=1||L>=1)&&yt(h)}}),at=(o,{animation:r=!0}={})=>{r?Ee(U,k.current,o,{duration:n.transitions.duration.standard}):k.current[U]=o},Mt=o=>{let r=k.current[U];g?r+=o:r+=o*(a?-1:1),at(r)},Pt=()=>{const o=k.current[st];let r=0;const d=Array.from($.current.children);for(let c=0;c<d.length;c+=1){const h=d[c];if(r+h[st]>o){c===0&&(r=o);break}r+=h[st]}return r},Qt=()=>{Mt(-1*Pt())},_t=()=>{Mt(Pt())},[te,{onChange:Et,...ee}]=D("scrollbar",{className:W(z.scrollableX,z.hideScrollbar),elementType:Xe,shouldForwardComponentProp:!0,externalForwardedProps:O,ownerState:R}),oe=u.useCallback(o=>{Et?.(o),Jt({overflow:null,scrollbarWidth:o})},[Et]),[Rt,kt]=D("scrollButtons",{className:W(z.scrollButtons,Y.className),elementType:$e,externalForwardedProps:O,ownerState:R,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:P.startScrollButtonIcon||P.StartScrollButtonIcon,EndScrollButtonIcon:P.endScrollButtonIcon||P.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:Yt,endScrollButtonIcon:Ut}}}),le=()=>{const o={};o.scrollbarSizeListener=T?p.jsx(te,{...ee,onChange:oe}):null;const d=T&&(M==="auto"&&(gt||Ct)||M===!0);return o.scrollButtonStart=d?p.jsx(Rt,{direction:a?"right":"left",onClick:Qt,disabled:!gt,...kt}):null,o.scrollButtonEnd=d?p.jsx(Rt,{direction:a?"left":"right",onClick:_t,disabled:!Ct,...kt}):null,o},zt=dt(o=>{const{tabsMeta:r,tabMeta:d}=It();if(!(!d||!r)){if(d[Q]<r[Q]){const c=r[U]+(d[Q]-r[Q]);at(c,{animation:o})}else if(d[_]>r[_]){const c=r[U]+(d[_]-r[_]);at(c,{animation:o})}}}),tt=dt(()=>{T&&M!==!1&&Zt(!wt)});u.useEffect(()=>{const o=Ot(()=>{k.current&&q()});let r;const d=I=>{I.forEach(L=>{L.removedNodes.forEach(G=>{r?.unobserve(G)}),L.addedNodes.forEach(G=>{r?.observe(G)})}),o(),tt()},c=Dt(k.current);c.addEventListener("resize",o);let h;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from($.current.children).forEach(I=>{r.observe(I)})),typeof MutationObserver<"u"&&(h=new MutationObserver(d),h.observe($.current,{childList:!0})),()=>{o.clear(),c.removeEventListener("resize",o),h?.disconnect(),r?.disconnect()}},[q,tt]),u.useEffect(()=>{const o=Array.from($.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&T&&M!==!1){const d=o[0],c=o[r-1],h={root:k.current,threshold:.99},I=ct=>{qt(!ct[0].isIntersecting)},L=new IntersectionObserver(I,h);L.observe(d);const G=ct=>{Gt(!ct[0].isIntersecting)},jt=new IntersectionObserver(G,h);return jt.observe(c),()=>{L.disconnect(),jt.disconnect()}}},[T,M,wt,C?.length]),u.useEffect(()=>{Vt(!0)},[]),u.useEffect(()=>{q()}),u.useEffect(()=>{zt(Lt!==H)},[zt,H]),u.useImperativeHandle(f,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const[re,ne]=D("indicator",{className:W(z.indicator,K.className),elementType:De,externalForwardedProps:O,ownerState:R,additionalProps:{style:H}}),Wt=p.jsx(re,{...ne});let et=0;const se=u.Children.map(C,o=>{if(!u.isValidElement(o))return null;const r=o.props.value===void 0?et:o.props.value;Tt.set(r,et);const d=r===F;return et+=1,u.cloneElement(o,{fullWidth:E==="fullWidth",indicator:d&&!xt&&Wt,selected:d,selectionFollowsFocus:rt,onChange:B,textColor:J,value:r,...et===1&&F===!1&&!o.props.tabIndex?{tabIndex:0}:{}})}),ae=o=>{if(o.altKey||o.shiftKey||o.ctrlKey||o.metaKey)return;const r=$.current,d=me(xe(r));if(d?.getAttribute("role")!=="tab")return;let h=y==="horizontal"?"ArrowLeft":"ArrowUp",I=y==="horizontal"?"ArrowRight":"ArrowDown";switch(y==="horizontal"&&a&&(h="ArrowRight",I="ArrowLeft"),o.key){case h:o.preventDefault(),ot(r,d,$t);break;case I:o.preventDefault(),ot(r,d,Ht);break;case"Home":o.preventDefault(),ot(r,null,Ht);break;case"End":o.preventDefault(),ot(r,null,$t);break}},it=le(),[ie,ce]=D("root",{ref:l,className:W(z.root,m),elementType:Ae,externalForwardedProps:{...O,...Kt,component:S},ownerState:R}),[de,ue]=D("scroller",{ref:k,className:z.scroller,elementType:Fe,externalForwardedProps:O,ownerState:R,additionalProps:{style:{overflow:Bt.overflow,[g?`margin${a?"Left":"Right"}`:"marginBottom"]:nt?void 0:-Bt.scrollbarWidth}}}),[be,pe]=D("list",{ref:$,className:W(z.list,z.flexContainer),elementType:Oe,externalForwardedProps:O,ownerState:R,getSlotProps:o=>({...o,onKeyDown:r=>{ae(r),o.onKeyDown?.(r)}})});return p.jsxs(ie,{...ce,children:[it.scrollButtonStart,it.scrollbarSizeListener,p.jsxs(de,{...ue,children:[p.jsx(be,{"aria-label":i,"aria-labelledby":b,"aria-orientation":y==="vertical"?"vertical":null,role:"tablist",...pe,children:se}),xt&&Wt]}),it.scrollButtonEnd]})}),Nt="index",X={tabs:`${Nt}-tabs`,tab:`${Nt}-tab`},Ke=ye(mt)(({theme:e})=>({[`& .${X.tabs}`]:{},[`& .${X.tab}`]:{fontSize:"0.875rem",[e.breakpoints.up("md")]:{fontSize:"1rem"}}}));function Ye({tabs:e,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:"grey.100",padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:"text.secondary",fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"action.selected",borderColor:"grey.100",color:"grey.A700"}},".MuiTabs-indicator":{display:"none"},...a.sx},children:e.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function Ue({tabs:e,current:t,onChange:l,iconPosition:s=void 0,enableTabClick:n=!1,...a}){return p.jsx(mt,{scrollButtons:"auto",value:t,onChange:(i,b)=>!n&&l(b),...a,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":a.orientation!=="vertical"?{"&::after":{content:'""',display:"block",position:"sticky",left:0,zIndex:-1,width:"100%",height:"1px",backgroundColor:"grey.300"}}:{},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:"text.secondary",fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:"primary.main"}},".MuiTabs-indicator":{height:"1px",backgroundColor:"primary.main"},...a.sx},children:e.map(i=>p.jsx(vt,{className:X.tab,value:i.value,label:i.label,icon:i.icon,iconPosition:s,onClick:()=>n&&l(i.value)},i.value))})}function qe({tabs:e,current:t,onChange:l,variant:s=void 0,iconPosition:n=void 0,enableTabClick:a=!1,...i}){return s==="card"?p.jsx(Ye,{...i,tabs:e,current:t,enableTabClick:a,onChange:l,iconPosition:n}):s==="line"?p.jsx(Ue,{...i,tabs:e,current:t,enableTabClick:a,onChange:l,iconPosition:n}):p.jsx(Ke,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(b,f)=>!a&&l(f),indicatorColor:"primary",...i,className:[X.tabs,i.className||""].join(" "),children:e.map(b=>p.jsx(vt,{className:X.tab,value:b.value,label:b.label,icon:b.icon,iconPosition:n,onClick:()=>a&&l(b.value)},b.value))})}function Ge(e,t=""){const{info:l}=ge(),s=Ce(()=>{const n=e?.breadcrumbsLabel||e?.label||"";return we(n,t,l)},[e,t,l]);return s?p.jsx(Be,{children:p.jsx("title",{children:s})}):null}export{qe as T,mt as a,vt as b,ut as t,Ge as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aO as E,U as G}from"./index-
|
|
1
|
+
import{aO as E,U as G}from"./index-xKewGzjC.js";const N=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:w,onMouseOut:b,scrolling:d,id:m,frameBorder:t,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:P,name:v,target:A,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const n=E({src:q||r,target:A||null,style:{position:a||null,display:u||"initial",overflow:c||null},scrolling:d||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:v||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":P||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:i||null,onLoad:p||null,onMouseOver:w||null,onMouseOut:b||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(n))n[e]!=null&&(l[e]=n[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return t>=0&&(l.style.hasOwnProperty("border")||(l.style.border=t)),G.createElement("iframe",Object.assign({},l))};export{N as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c4 as J}from"./index-Dtj3cePH.js";function y(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function k(e){return y(e)==="object"}function re(e){return Array.isArray(e)&&e.length>0&&e.every(f=>"message"in f)}function Z(e,f){return e.length<124?e:f}const ne="graphql-transport-ws";var m;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(m||(m={}));var c;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(c||(c={}));function ee(e){if(!k(e))throw new Error(`Message is expected to be an object, but got ${y(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${y(e.type)}`);switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:{if(e.payload!=null&&!k(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case c.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${y(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!k(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${y(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${y(e.payload.query)}`);if(e.payload.variables!=null&&!k(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${y(e.payload.variables)}`);if(e.payload.operationName!=null&&y(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${y(e.payload.operationName)}`);if(e.payload.extensions!=null&&!k(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${y(e.payload.extensions)}`);break}case c.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${y(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!k(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${y(e.payload)}`);break}case c.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${y(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!re(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case c.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${y(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function oe(e,f){return ee(typeof e=="string"?JSON.parse(e,f):e)}function j(e,f){return ee(e),JSON.stringify(e,f)}var A=function(e){return this instanceof A?(this.v=e,this):new A(e)},ie=function(e,f,R){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var z=R.apply(e,f||[]),h,w=[];return h=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),q("next"),q("throw"),q("return",O),h[Symbol.asyncIterator]=function(){return this},h;function O(t){return function(g){return Promise.resolve(g).then(t,F)}}function q(t,g){z[t]&&(h[t]=function($){return new Promise(function(_,D){w.push([t,$,_,D])>1||x(t,$)})},g&&(h[t]=g(h[t])))}function x(t,g){try{B(z[t](g))}catch($){I(w[0][3],$)}}function B(t){t.value instanceof A?Promise.resolve(t.value.v).then(U,F):I(w[0][2],t)}function U(t){x("next",t)}function F(t){x("throw",t)}function I(t,g){t(g),w.shift(),w.length&&x(w[0][0],w[0][1])}};function pe(e){const{url:f,connectionParams:R,lazy:z=!0,onNonLazyError:h=console.error,lazyCloseTimeout:w=0,keepAlive:O=0,disablePong:q,connectionAckWaitTimeout:x=0,retryAttempts:B=5,retryWait:U=async function(a){let r=1e3;for(let o=0;o<a;o++)r*=2;await new Promise(o=>setTimeout(o,r+Math.floor(Math.random()*2700+300)))},shouldRetry:F=Q,isFatalConnectionProblem:I,on:t,webSocketImpl:g,generateID:$=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const r=Math.random()*16|0;return(a=="x"?r:r&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:D}=e;let P;if(g){if(!ae(g))throw new Error("Invalid WebSocket implementation provided");P=g}else typeof WebSocket<"u"?P=WebSocket:typeof J<"u"?P=J.WebSocket||J.MozWebSocket:typeof window<"u"&&(P=window.WebSocket||window.MozWebSocket);if(!P)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const T=P,p=(()=>{const n=(()=>{const r={};return{on(o,s){return r[o]=s,()=>{delete r[o]}},emit(o){var s;"id"in o&&((s=r[o.id])===null||s===void 0||s.call(r,o))}}})(),a={connecting:t?.connecting?[t.connecting]:[],opened:t?.opened?[t.opened]:[],connected:t?.connected?[t.connected]:[],ping:t?.ping?[t.ping]:[],pong:t?.pong?[t.pong]:[],message:t?.message?[n.emit,t.message]:[n.emit],closed:t?.closed?[t.closed]:[],error:t?.error?[t.error]:[]};return{onMessage:n.on,on(r,o){const s=a[r];return s.push(o),()=>{s.splice(s.indexOf(o),1)}},emit(r,...o){for(const s of[...a[r]])s(...o)}}})();function H(n){const a=[p.on("error",r=>{a.forEach(o=>o()),n(r)}),p.on("closed",r=>{a.forEach(o=>o()),n(r)})]}let b,S=0,C,W=!1,G=0,K=!1;async function V(){clearTimeout(C);const[n,a]=await(b??(b=new Promise((s,l)=>(async()=>{if(W){if(await U(G),!S)return b=void 0,l({code:1e3,reason:"All Subscriptions Gone"});G++}p.emit("connecting",W);const i=new T(typeof f=="function"?await f():f,ne);let E,M;function L(){isFinite(O)&&O>0&&(clearTimeout(M),M=setTimeout(()=>{i.readyState===T.OPEN&&(i.send(j({type:c.Ping})),p.emit("ping",!1,void 0))},O))}H(d=>{b=void 0,clearTimeout(E),clearTimeout(M),l(d),d instanceof v&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=d=>p.emit("error",d),i.onclose=d=>p.emit("closed",d),i.onopen=async()=>{try{p.emit("opened",i);const d=typeof R=="function"?await R():R;if(i.readyState!==T.OPEN)return;i.send(j(d?{type:c.ConnectionInit,payload:d}:{type:c.ConnectionInit},_)),isFinite(x)&&x>0&&(E=setTimeout(()=>{i.close(m.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},x)),L()}catch(d){p.emit("error",d),i.close(m.InternalClientError,Z(d instanceof Error?d.message:new Error(d).message,"Internal client error"))}};let N=!1;i.onmessage=({data:d})=>{try{const u=oe(d,D);if(p.emit("message",u),u.type==="ping"||u.type==="pong"){p.emit(u.type,!0,u.payload),u.type==="pong"?L():q||(i.send(j(u.payload?{type:c.Pong,payload:u.payload}:{type:c.Pong})),p.emit("pong",!1,u.payload));return}if(N)return;if(u.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${u.type}`);clearTimeout(E),N=!0,p.emit("connected",i,u.payload,W),W=!1,G=0,s([i,new Promise((ce,te)=>H(te))])}catch(u){i.onmessage=null,p.emit("error",u),i.close(m.BadResponse,Z(u instanceof Error?u.message:new Error(u).message,"Bad response"))}}})())));n.readyState===T.CLOSING&&await a;let r=()=>{};const o=new Promise(s=>r=s);return[n,r,Promise.race([o.then(()=>{if(!S){const s=()=>n.close(1e3,"Normal Closure");isFinite(w)&&w>0?C=setTimeout(()=>{n.readyState===T.OPEN&&s()},w):s()}}),a])]}function X(n){if(Q(n)&&(se(n.code)||[m.InternalServerError,m.InternalClientError,m.BadRequest,m.BadResponse,m.Unauthorized,m.SubprotocolNotAcceptable,m.SubscriberAlreadyExists,m.TooManyInitialisationRequests].includes(n.code)))throw n;if(K)return!1;if(Q(n)&&n.code===1e3)return S>0;if(!B||G>=B||!F(n)||I?.(n))throw n;return W=!0}z||(async()=>{for(S++;;)try{const[,,n]=await V();await n}catch(n){try{if(!X(n))return}catch(a){return h?.(a)}}})();function Y(n,a){const r=$(n);let o=!1,s=!1,l=()=>{S--,o=!0};return(async()=>{for(S++;;)try{const[i,E,M]=await V();if(o)return E();const L=p.onMessage(r,N=>{switch(N.type){case c.Next:{a.next(N.payload);return}case c.Error:{s=!0,o=!0,a.error(N.payload),l();return}case c.Complete:{o=!0,l();return}}});i.send(j({id:r,type:c.Subscribe,payload:n},_)),l=()=>{!o&&i.readyState===T.OPEN&&i.send(j({id:r,type:c.Complete},_)),S--,o=!0,E()},await M.finally(L);return}catch(i){if(!X(i))return}})().then(()=>{s||a.complete()}).catch(i=>{a.error(i)}),()=>{o||l()}}return{on:p.on,subscribe:Y,iterate(n){const a=[],r={done:!1,error:null,resolve:()=>{}},o=Y(n,{next(l){a.push(l),r.resolve()},error(l){r.done=!0,r.error=l,r.resolve()},complete(){r.done=!0,r.resolve()}}),s=(function(){return ie(this,arguments,function*(){for(;;){for(a.length||(yield A(new Promise(E=>r.resolve=E)));a.length;)yield yield A(a.shift());if(r.error)throw r.error;if(r.done)return yield A(void 0)}})})();return s.throw=async l=>(r.done||(r.done=!0,r.error=l,r.resolve()),{done:!0,value:void 0}),s.return=async()=>(o(),{done:!0,value:void 0}),s},async dispose(){if(K=!0,b){const[n]=await b;n.close(1e3,"Normal Closure")}},terminate(){b&&p.emit("closed",new v)}}}class v extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function Q(e){return k(e)&&"code"in e&&"reason"in e}function se(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function ae(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}export{m as CloseCode,ne as GRAPHQL_TRANSPORT_WS_PROTOCOL,c as MessageType,v as TerminatedCloseEvent,pe as createClient,oe as parseMessage,j as stringifyMessage,ee as validateMessage};
|
|
1
|
+
import{c4 as J}from"./index-xKewGzjC.js";function y(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function k(e){return y(e)==="object"}function re(e){return Array.isArray(e)&&e.length>0&&e.every(f=>"message"in f)}function Z(e,f){return e.length<124?e:f}const ne="graphql-transport-ws";var m;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(m||(m={}));var c;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(c||(c={}));function ee(e){if(!k(e))throw new Error(`Message is expected to be an object, but got ${y(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${y(e.type)}`);switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:{if(e.payload!=null&&!k(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case c.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${y(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!k(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${y(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${y(e.payload.query)}`);if(e.payload.variables!=null&&!k(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${y(e.payload.variables)}`);if(e.payload.operationName!=null&&y(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${y(e.payload.operationName)}`);if(e.payload.extensions!=null&&!k(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${y(e.payload.extensions)}`);break}case c.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${y(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!k(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${y(e.payload)}`);break}case c.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${y(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!re(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case c.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${y(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function oe(e,f){return ee(typeof e=="string"?JSON.parse(e,f):e)}function j(e,f){return ee(e),JSON.stringify(e,f)}var A=function(e){return this instanceof A?(this.v=e,this):new A(e)},ie=function(e,f,R){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var z=R.apply(e,f||[]),h,w=[];return h=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),q("next"),q("throw"),q("return",O),h[Symbol.asyncIterator]=function(){return this},h;function O(t){return function(g){return Promise.resolve(g).then(t,F)}}function q(t,g){z[t]&&(h[t]=function($){return new Promise(function(_,D){w.push([t,$,_,D])>1||x(t,$)})},g&&(h[t]=g(h[t])))}function x(t,g){try{B(z[t](g))}catch($){I(w[0][3],$)}}function B(t){t.value instanceof A?Promise.resolve(t.value.v).then(U,F):I(w[0][2],t)}function U(t){x("next",t)}function F(t){x("throw",t)}function I(t,g){t(g),w.shift(),w.length&&x(w[0][0],w[0][1])}};function pe(e){const{url:f,connectionParams:R,lazy:z=!0,onNonLazyError:h=console.error,lazyCloseTimeout:w=0,keepAlive:O=0,disablePong:q,connectionAckWaitTimeout:x=0,retryAttempts:B=5,retryWait:U=async function(a){let r=1e3;for(let o=0;o<a;o++)r*=2;await new Promise(o=>setTimeout(o,r+Math.floor(Math.random()*2700+300)))},shouldRetry:F=Q,isFatalConnectionProblem:I,on:t,webSocketImpl:g,generateID:$=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const r=Math.random()*16|0;return(a=="x"?r:r&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:D}=e;let P;if(g){if(!ae(g))throw new Error("Invalid WebSocket implementation provided");P=g}else typeof WebSocket<"u"?P=WebSocket:typeof J<"u"?P=J.WebSocket||J.MozWebSocket:typeof window<"u"&&(P=window.WebSocket||window.MozWebSocket);if(!P)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const T=P,p=(()=>{const n=(()=>{const r={};return{on(o,s){return r[o]=s,()=>{delete r[o]}},emit(o){var s;"id"in o&&((s=r[o.id])===null||s===void 0||s.call(r,o))}}})(),a={connecting:t?.connecting?[t.connecting]:[],opened:t?.opened?[t.opened]:[],connected:t?.connected?[t.connected]:[],ping:t?.ping?[t.ping]:[],pong:t?.pong?[t.pong]:[],message:t?.message?[n.emit,t.message]:[n.emit],closed:t?.closed?[t.closed]:[],error:t?.error?[t.error]:[]};return{onMessage:n.on,on(r,o){const s=a[r];return s.push(o),()=>{s.splice(s.indexOf(o),1)}},emit(r,...o){for(const s of[...a[r]])s(...o)}}})();function H(n){const a=[p.on("error",r=>{a.forEach(o=>o()),n(r)}),p.on("closed",r=>{a.forEach(o=>o()),n(r)})]}let b,S=0,C,W=!1,G=0,K=!1;async function V(){clearTimeout(C);const[n,a]=await(b??(b=new Promise((s,l)=>(async()=>{if(W){if(await U(G),!S)return b=void 0,l({code:1e3,reason:"All Subscriptions Gone"});G++}p.emit("connecting",W);const i=new T(typeof f=="function"?await f():f,ne);let E,M;function L(){isFinite(O)&&O>0&&(clearTimeout(M),M=setTimeout(()=>{i.readyState===T.OPEN&&(i.send(j({type:c.Ping})),p.emit("ping",!1,void 0))},O))}H(d=>{b=void 0,clearTimeout(E),clearTimeout(M),l(d),d instanceof v&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=d=>p.emit("error",d),i.onclose=d=>p.emit("closed",d),i.onopen=async()=>{try{p.emit("opened",i);const d=typeof R=="function"?await R():R;if(i.readyState!==T.OPEN)return;i.send(j(d?{type:c.ConnectionInit,payload:d}:{type:c.ConnectionInit},_)),isFinite(x)&&x>0&&(E=setTimeout(()=>{i.close(m.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},x)),L()}catch(d){p.emit("error",d),i.close(m.InternalClientError,Z(d instanceof Error?d.message:new Error(d).message,"Internal client error"))}};let N=!1;i.onmessage=({data:d})=>{try{const u=oe(d,D);if(p.emit("message",u),u.type==="ping"||u.type==="pong"){p.emit(u.type,!0,u.payload),u.type==="pong"?L():q||(i.send(j(u.payload?{type:c.Pong,payload:u.payload}:{type:c.Pong})),p.emit("pong",!1,u.payload));return}if(N)return;if(u.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${u.type}`);clearTimeout(E),N=!0,p.emit("connected",i,u.payload,W),W=!1,G=0,s([i,new Promise((ce,te)=>H(te))])}catch(u){i.onmessage=null,p.emit("error",u),i.close(m.BadResponse,Z(u instanceof Error?u.message:new Error(u).message,"Bad response"))}}})())));n.readyState===T.CLOSING&&await a;let r=()=>{};const o=new Promise(s=>r=s);return[n,r,Promise.race([o.then(()=>{if(!S){const s=()=>n.close(1e3,"Normal Closure");isFinite(w)&&w>0?C=setTimeout(()=>{n.readyState===T.OPEN&&s()},w):s()}}),a])]}function X(n){if(Q(n)&&(se(n.code)||[m.InternalServerError,m.InternalClientError,m.BadRequest,m.BadResponse,m.Unauthorized,m.SubprotocolNotAcceptable,m.SubscriberAlreadyExists,m.TooManyInitialisationRequests].includes(n.code)))throw n;if(K)return!1;if(Q(n)&&n.code===1e3)return S>0;if(!B||G>=B||!F(n)||I?.(n))throw n;return W=!0}z||(async()=>{for(S++;;)try{const[,,n]=await V();await n}catch(n){try{if(!X(n))return}catch(a){return h?.(a)}}})();function Y(n,a){const r=$(n);let o=!1,s=!1,l=()=>{S--,o=!0};return(async()=>{for(S++;;)try{const[i,E,M]=await V();if(o)return E();const L=p.onMessage(r,N=>{switch(N.type){case c.Next:{a.next(N.payload);return}case c.Error:{s=!0,o=!0,a.error(N.payload),l();return}case c.Complete:{o=!0,l();return}}});i.send(j({id:r,type:c.Subscribe,payload:n},_)),l=()=>{!o&&i.readyState===T.OPEN&&i.send(j({id:r,type:c.Complete},_)),S--,o=!0,E()},await M.finally(L);return}catch(i){if(!X(i))return}})().then(()=>{s||a.complete()}).catch(i=>{a.error(i)}),()=>{o||l()}}return{on:p.on,subscribe:Y,iterate(n){const a=[],r={done:!1,error:null,resolve:()=>{}},o=Y(n,{next(l){a.push(l),r.resolve()},error(l){r.done=!0,r.error=l,r.resolve()},complete(){r.done=!0,r.resolve()}}),s=(function(){return ie(this,arguments,function*(){for(;;){for(a.length||(yield A(new Promise(E=>r.resolve=E)));a.length;)yield yield A(a.shift());if(r.error)throw r.error;if(r.done)return yield A(void 0)}})})();return s.throw=async l=>(r.done||(r.done=!0,r.error=l,r.resolve()),{done:!0,value:void 0}),s.return=async()=>(o(),{done:!0,value:void 0}),s},async dispose(){if(K=!0,b){const[n]=await b;n.close(1e3,"Normal Closure")}},terminate(){b&&p.emit("closed",new v)}}}class v extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function Q(e){return k(e)&&"code"in e&&"reason"in e}function se(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function ae(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}export{m as CloseCode,ne as GRAPHQL_TRANSPORT_WS_PROTOCOL,c as MessageType,v as TerminatedCloseEvent,pe as createClient,oe as parseMessage,j as stringifyMessage,ee as validateMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as g,a as v,b as y,j as r,F as f,S as x,M as h}from"./index-
|
|
1
|
+
import{u as g,a as v,b as y,j as r,F as f,S as x,M as h}from"./index-xKewGzjC.js";import{L as S,D as j}from"./download-Dr5a1zL7.js";import{u as L}from"./useLocalStorage-DnNTBdw-.js";import"./ButtonGroup-BKp-Wu6T.js";import"./getValidReactChildren-DtHaCFXY.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as m,p as Be,j as e,C as J,Q as Te,q as M,o as A,b as me,V as X,d as Fe,ct as Ae,cu as De,cv as Ee,J as R,au as te,bz as K,A as Ie,D as Pe,x as Re,ao as _e,u as de,H as $,g as Le,bE as Ne,ab as ze,al as Ue,k as $e,b3 as Me,B as y,bM as se,bK as le,aU as N,bt as We,cw as z,ad as Oe,F as oe,aC as qe,S as ne,M as re,cx as Ve,at as ae,bB as He}from"./index-
|
|
1
|
+
import{r as m,p as Be,j as e,C as J,Q as Te,q as M,o as A,b as me,V as X,d as Fe,ct as Ae,cu as De,cv as Ee,J as R,au as te,bz as K,A as Ie,D as Pe,x as Re,ao as _e,u as de,H as $,g as Le,bE as Ne,ab as ze,al as Ue,k as $e,b3 as Me,B as y,bM as se,bK as le,aU as N,bt as We,cw as z,ad as Oe,F as oe,aC as qe,S as ne,M as re,cx as Ve,at as ae,bB as He}from"./index-xKewGzjC.js";import{u as Ke}from"./useLocalStorage-DnNTBdw-.js";import{E as Qe}from"./ErrorOutline-D1L-_0MO.js";import{g as Je,H as Xe}from"./index-CwAnYLEW.js";import{y as Ge}from"./index-BBF53Q7a.js";import{B as I,W as Ye}from"./status-8syaX-4l.js";import{D as Ze,u as et,B as ie}from"./actions-AQbY2FuA.js";import{I as tt,B as st}from"./install-from-url-v_yjBEI5.js";import{u as ue}from"./url-evaluation-IuTW0fNq.js";import{L as lt}from"./Launch-BkYfxaBZ.js";import{A as ot}from"./Add-CWdQuYaD.js";import{O as P}from"./index-v6GrH27P.js";import{s as ce}from"./schema-DUxPnJIn.js";import{P as nt}from"./permission-CtC06VjN.js";import"./FilterList-oS-lVZbr.js";import"./CSSTransition-w1DHR1_d.js";import"./emotion-cache.browser.esm-C-o7-kYP.js";import"./index-CehlW6fb.js";import"./redux-Ab4buSXY.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DLMKNy1M.js";import"./TableSearch-x8t1M7OG.js";import"./Search-CZb8MpSi.js";import"./Clear--1cV57uz.js";import"./MoreVert-BcrwhM_q.js";import"./DeleteOutline-BEPb1x3R.js";import"./get-safe-url-D0G1hOGs.js";import"./ButtonGroup-BKp-Wu6T.js";import"./getValidReactChildren-DtHaCFXY.js";import"./without-wallet-BR3mhb2n.js";import"./index-DbEnyJAy.js";import"./login-method-item-KmsBo8TR.js";import"./passkey-rounded-_WDHIZVd.js";import"./cloneDeep-DqD6wDwD.js";import"./index-CUh73CTd.js";import"./Delete-K51EeG49.js";import"./Autocomplete-yImsm8ZS.js";import"./ListSubheader-nBi3IFvC.js";import"./ListItemButton-Cj5TfDg5.js";import"./Stepper-DKMrerj2.js";function Q({blocklet:j,skipAccessibilityCheck:f=!1,...d}){const{t:i}=m.useContext(Be),{urls:S,loading:r,recommendedUrl:g}=ue(j);if(r&&!f)return e.jsx(J,{size:12,...d});const x=f?S[0]:g;return x?e.jsx(at,{...d,children:e.jsx(rt,{children:e.jsxs(Te,{href:x,target:"_blank",className:"blocklet-interface",underline:"hover",children:[i("common.visit"),e.jsx(lt,{fontSize:"12",sx:{marginLeft:.5}})]})})}):i("blocklet.router.noAccessibleUrl")}const rt=M.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
margin: 4px 0;
|
|
4
4
|
`,at=M.div`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aZ as Fe,aY as Ge,r as h,$ as Ye,j as e,a3 as ee,a4 as $e,b0 as Z,a5 as Ke,a9 as qe,b1 as He,c as he,bt as H,aS as O,i as Ce,H as B,bB as V,dg as E,d1 as we,fx as Be,am as N,fy as Ve,V as D,fz as Qe,o as f,D as Xe,E as De,x as fe,y as Je,p as Ze,C as A,J as j,bs as et,q as tt,ab as st,fA as X,fB as J,fC as ot,B as S,aI as F,eq as T,Q as nt,bN as q,cI as at,ad as Se,M as Y,az as $,aA as K,eT as rt,aB as it,aw as ct,ax as lt,bz as pe,A as dt,bu as be,b3 as Ee,bF as xe,g as pt}from"./index-Dtj3cePH.js";import{T as ut}from"./html-title-wftxlNic.js";import{u as P}from"./blocklet-B65NZ0SL.js";import{u as mt}from"./use-mobile-xq_yWBax.js";import{u as Ie,D as ft,a as xt,b as gt,S as ht,c as ue,d as St,C as yt,e as bt,f as kt,g as jt,h as Ct}from"./connect-to-TtcHrCpE.js";import"./index-BojVbZw0.js";import"./api-BLIecOBq.js";import{b as wt,g as Bt,a as Dt,i as Et,c as ge,d as It,e as Tt,h as Rt}from"./spaces-BsLjYZLj.js";import{v as zt}from"./index-TLvz3wdj.js";import{E as vt}from"./index-B0mArAvv.js";import{H as Lt}from"./HelpOutline-dihfOb5v.js";import{H as Ot}from"./index-DtdZa4Ii.js";import{x as At}from"./index-D29L5UKE.js";import{D as Pt}from"./DeleteOutline-7b3f7PEm.js";import{g as ke}from"./get-safe-url-C0YzO5pG.js";import{S as Ut}from"./switch-control-CzpP7CIf.js";import{L as je}from"./list-header-B3--_6Bl.js";import"./OpenInNew-DXke8B9Y.js";import"./index-UjkYO3io.js";import"./ButtonGroup-CFUm4DnA.js";import"./getValidReactChildren-BwWzCXzg.js";import"./FilterList-ChbigVQM.js";import"./CSSTransition-BoEOBxnu.js";import"./emotion-cache.browser.esm-fPnQyG8C.js";import"./index-CSC84DXT.js";import"./redux-Ab4buSXY.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-iVI-ppGn.js";import"./index-imQtUA1Y.js";import"./TableSearch-C5Kz0G1P.js";import"./Search-z9bCqmrZ.js";import"./Clear-B_hKjaJj.js";import"./MoreVert-DV_CQ8ui.js";function Mt(t){return Fe("MuiIcon",t)}Ge("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${Z(s)}`,`fontSize${Z(n)}`]};return Ke(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${Z(n.color)}`],s[`fontSize${Z(n.fontSize)}`]]}})(qe(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(He()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ye({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},u=Nt(p);return e.jsx(_t,{as:i,className:$e(r,"notranslate",u.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Ft=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Gt=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Yt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await wt(a.endpoint);return!H(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function $t({refresh:t}={}){const{blocklet:s}=P(),n=s?.meta?.did,{api:o}=O();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Yt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=P(),[r,a]=h.useState([]),{api:c}=O(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function Kt({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=O(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function qt({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=P(),[o,r]=h.useState([]),{api:a}=O(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}}),p=Array.isArray(l)?l.map(u=>({...u,successCount:+u.successCount,errorCount:+u.errorCount})):[];r(p)}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:Ht,Consumer:Ws}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=O(),{blocklet:o}=P(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:c}),u=Qe(d),x=Kt({appDid:o?.appDid}),m=h.useMemo(()=>Bt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=qt({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===m)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},G=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,L)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),m!==L&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:L}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===m&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await G({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(L=>{const R=[...L];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),m!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===m;return e.jsx(Ht,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:C,updateAutoBackup:G,abortBlockletBackup:Q,backupEndpoint:m,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:f.any.isRequired};function U(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=P(),{info:n}=O(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:De.create({baseURL:fe(window.location.origin,Je())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:u,name:x,did:m})=>{const k=await Dt(u);if(!await Et(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===u)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:m,url:k,endpoint:u},u)},p=async({spaceGateway:u})=>{try{await l(u)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=O(),{blocklet:s}=P(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Le({...t}){const{t:s}=h.useContext(Ze),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(zt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(A,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Oe(){const{t}=D(),{setBackupDate:s,backupSummary:n}=U(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),u=new Map(n.map(m=>[m.date,{date:m.date,successCount:m.successCount,errorCount:m.errorCount}])),x=[];for(let m=p.clone();E(m).isBefore(l);m=m.add(1,"day")){const k=m.format("YYYY-MM-DD");x.push(u.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
1
|
+
import{aZ as Fe,aY as Ge,r as h,$ as Ye,j as e,a3 as ee,a4 as $e,b0 as Z,a5 as Ke,a9 as qe,b1 as He,c as he,bt as H,aS as O,i as Ce,H as B,bB as V,dg as E,d1 as we,fx as Be,am as N,fy as Ve,V as D,fz as Qe,o as f,D as Xe,E as De,x as fe,y as Je,p as Ze,C as A,J as j,bs as et,q as tt,ab as st,fA as X,fB as J,fC as ot,B as S,aI as F,eq as T,Q as nt,bN as q,cI as at,ad as Se,M as Y,az as $,aA as K,eT as rt,aB as it,aw as ct,ax as lt,bz as pe,A as dt,bu as be,b3 as Ee,bF as xe,g as pt}from"./index-xKewGzjC.js";import{T as ut}from"./html-title-9oXf3hnw.js";import{u as P}from"./blocklet--DdX67Y5.js";import{u as mt}from"./use-mobile-DYOwHeWa.js";import{u as Ie,D as ft,a as xt,b as gt,S as ht,c as ue,d as St,C as yt,e as bt,f as kt,g as jt,h as Ct}from"./connect-to-uisE5AIX.js";import"./index-BojVbZw0.js";import"./api-CxCPrjQQ.js";import{b as wt,g as Bt,a as Dt,i as Et,c as ge,d as It,e as Tt,h as Rt}from"./spaces-a6SrjF6x.js";import{v as zt}from"./index-CUh73CTd.js";import{E as vt}from"./index-CsYcuXHv.js";import{H as Lt}from"./HelpOutline-DeYqkIeW.js";import{H as Ot}from"./index-CwAnYLEW.js";import{x as At}from"./index-D29L5UKE.js";import{D as Pt}from"./DeleteOutline-BEPb1x3R.js";import{g as ke}from"./get-safe-url-D0G1hOGs.js";import{S as Ut}from"./switch-control-BlQqkYEY.js";import{L as je}from"./list-header-DqK90OBv.js";import"./OpenInNew-D7ZHvBz_.js";import"./index-v6GrH27P.js";import"./ButtonGroup-BKp-Wu6T.js";import"./getValidReactChildren-DtHaCFXY.js";import"./FilterList-oS-lVZbr.js";import"./CSSTransition-w1DHR1_d.js";import"./emotion-cache.browser.esm-C-o7-kYP.js";import"./index-CehlW6fb.js";import"./redux-Ab4buSXY.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DLMKNy1M.js";import"./index-BBF53Q7a.js";import"./TableSearch-x8t1M7OG.js";import"./Search-CZb8MpSi.js";import"./Clear--1cV57uz.js";import"./MoreVert-BcrwhM_q.js";function Mt(t){return Fe("MuiIcon",t)}Ge("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${Z(s)}`,`fontSize${Z(n)}`]};return Ke(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${Z(n.color)}`],s[`fontSize${Z(n.fontSize)}`]]}})(qe(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(He()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ye({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},u=Nt(p);return e.jsx(_t,{as:i,className:$e(r,"notranslate",u.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Ft=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Gt=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Yt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await wt(a.endpoint);return!H(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function $t({refresh:t}={}){const{blocklet:s}=P(),n=s?.meta?.did,{api:o}=O();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Yt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=P(),[r,a]=h.useState([]),{api:c}=O(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function Kt({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=O(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function qt({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=P(),[o,r]=h.useState([]),{api:a}=O(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}}),p=Array.isArray(l)?l.map(u=>({...u,successCount:+u.successCount,errorCount:+u.errorCount})):[];r(p)}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:Ht,Consumer:Ws}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=O(),{blocklet:o}=P(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:c}),u=Qe(d),x=Kt({appDid:o?.appDid}),m=h.useMemo(()=>Bt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=qt({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===m)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},G=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,L)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),m!==L&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:L}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===m&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await G({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(L=>{const R=[...L];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),m!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===m;return e.jsx(Ht,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:C,updateAutoBackup:G,abortBlockletBackup:Q,backupEndpoint:m,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:f.any.isRequired};function U(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=P(),{info:n}=O(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:De.create({baseURL:fe(window.location.origin,Je())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:u,name:x,did:m})=>{const k=await Dt(u);if(!await Et(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===u)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:m,url:k,endpoint:u},u)},p=async({spaceGateway:u})=>{try{await l(u)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=O(),{blocklet:s}=P(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Le({...t}){const{t:s}=h.useContext(Ze),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(zt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(A,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Oe(){const{t}=D(),{setBackupDate:s,backupSummary:n}=U(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),u=new Map(n.map(m=>[m.date,{date:m.date,successCount:m.successCount,errorCount:m.errorCount}])),x=[];for(let m=p.clone();E(m).isBefore(l);m=m.add(1,"day")){const k=m.format("YYYY-MM-DD");x.push(u.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:J[300]},{min:3,max:6,color:J[400]},{min:6,max:9,color:J[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:J[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(vt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(F,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.STATUS.PROGRESS&&E().diff(n,"hours")>=T.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.STATUS.PROGRESS&&!r,i=t===T.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(q,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(Lt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ae.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};function Pe({metadata:t={}}){const{t:s}=D();if(H(t))return e.jsx(q,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=At(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Pe.propTypes={metadata:f.object};function Ue(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=U(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:u}=o[i],x=p===T.STATUS.PROGRESS&&E().diff(u,"hours")>=T.TIMEOUT_HOURS,m=p===T.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return m?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>H(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:u,metadata:x}=d,m=l===T.STATUS.PROGRESS&&E().diff(u,"hours")>=T.TIMEOUT_HOURS,k=l===T.STATUS.PROGRESS&&!m,w=l===T.STATUS.SUCCEEDED&&!m;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Pe,{metadata:x}):e.jsx(Ae,{status:l,message:p,createdAt:u})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Ot,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Jt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Oe,{})]})]}),e.jsx(Ue,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Le,{})]})}function Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(u,x)=>{u?.preventDefault(),u?.stopPropagation(),a(x)},l=async u=>{try{u?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=u=>{d(u,!1),n?.(u)};return e.jsxs(e.Fragment,{children:[e.jsxs(Y,{color:"red",onClick:u=>d(u,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(Pt,{fontSize:"small"})}),e.jsx(K,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=U(),[d,l]=h.useState(null),{t:p}=D(),[u,x]=h.useState(!1),m=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),m(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),m(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[u||t?.loading?e.jsx(A,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>m(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>m(y,!1),children:[e.jsxs(Y,{onClick:y=>{m(y,!1),window.open(ke(t.endpoint?It(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx(K,{children:p("common.open")})]}),e.jsxs(Y,{onClick:y=>{m(y,!1),window.open(ke(Tt(t.endpoint),{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx(K,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(Y,{onClick:k,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx(K,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(Y,{onClick:w,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(ht,{fontSize:"small"})}),e.jsx(K,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};const Zt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=P(),{api:l,info:{did:p}}=O(),{appDid:u,appName:x,appDescription:m,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=U(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,G=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Rt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:u,appName:x,appDescription:m,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const L=g(C.endpoint),R=ge(L),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(L),endpoint:L};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await se(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),G&&e.jsx(Zt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(A,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||H(b?.message),backupInProgress:G})]})}_e.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Oe,{}),e.jsx(Ue,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=U(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ut,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=U(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(A,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(St,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Le,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=U();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(A,{})}):H(s)?e.jsx(Jt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=bt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(A,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(kt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(jt,{}),e.jsx(S,{sx:c,children:e.jsx(Ct,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(yt,{children:[e.jsxs(F,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=P(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],m=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:m,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(F,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};const me=ee(S)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as t,B as o,O as a,o as l}from"./index-
|
|
1
|
+
import{r as i,j as t,B as o,O as a,o as l}from"./index-xKewGzjC.js";const c=e=>i.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.361 2.4a.8.8 0 0 0-.728.469L.873 15.54a.8.8 0 0 0-.072.33v11.523a.8.8 0 0 0 .8.8h28.8a.8.8 0 0 0 .8-.8v-11.52a.8.8 0 0 0-.072-.331L25.37 2.869a.8.8 0 0 0-.728-.47H7.361zm-4.96 14.4v9.792h27.2v-9.799a.814.814 0 0 1-.104.007h-7.098l-2.066 3.1a.8.8 0 0 1-.666.356h-8.064a.8.8 0 0 1-.665-.356L8.87 16.8H2.4zm26.816-1.6H21.97a.8.8 0 0 0-.665.356l-2.067 3.1H12.03l-2.066-3.1a.8.8 0 0 0-.666-.356H2.785L7.876 4h16.25l5.09 11.2z",fill:"currentColor"})),h=a(o)`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|