@abtnode/webapp 1.16.28-beta-6917161a → 1.16.28-beta-7ddc3b2d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-B0xbM7Le.js → Add-i_eGmIkF.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-ClrQyvBh.js → ArrowDropDown-CRJiMsxl.js} +1 -1
  5. package/dist/assets/{Autocomplete-DZF5zrAk.js → Autocomplete-BkNAtuyq.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-ueVPL5p1.js → Breadcrumbs-D8UxFHZC.js} +1 -1
  7. package/dist/assets/{ButtonGroup-CJKZEioi.js → ButtonGroup-G7oFneKA.js} +1 -1
  8. package/dist/assets/{CheckCircle-DN9h3n-S.js → CheckCircle-CpgwIoc6.js} +1 -1
  9. package/dist/assets/{ChevronLeft-CBJaHuZr.js → ChevronLeft-BqOWO5Oh.js} +1 -1
  10. package/dist/assets/{ChevronRight-ftDGFcdo.js → ChevronRight-DDJkuJhV.js} +1 -1
  11. package/dist/assets/{Close-C48Pcuaf.js → Close-BltjIlg7.js} +1 -1
  12. package/dist/assets/{Delete-sQJNb5lC.js → Delete-KztH8pOq.js} +1 -1
  13. package/dist/assets/{DeleteOutline-DswcpP3L.js → DeleteOutline-Cwej9e35.js} +1 -1
  14. package/dist/assets/DeleteOutline-DvFRqyWQ.js +1 -0
  15. package/dist/assets/{Done-DiDjPJ6u.js → Done-CEgWviUN.js} +1 -1
  16. package/dist/assets/{Edit-EFnItLUd.js → Edit-jbcm5AKt.js} +1 -1
  17. package/dist/assets/{EditIcon-BWQLvTgB.js → EditIcon-DAtBHTkl.js} +1 -1
  18. package/dist/assets/{FilterList-DxfB8aQ7.js → FilterList-D84A-7C6.js} +1 -1
  19. package/dist/assets/{Google-B06mZgFu.js → Google-CCNGxrji.js} +1 -1
  20. package/dist/assets/{Https-BjVFoYWJ.js → Https-DsiZfUtZ.js} +1 -1
  21. package/dist/assets/{InputAdornment-BHI6-6Hp.js → InputAdornment-CfEcRXzS.js} +1 -1
  22. package/dist/assets/{InputLabel-EIEW8n2S.js → InputLabel-ERXbfftZ.js} +1 -1
  23. package/dist/assets/{LastPage-C4JcFXs5.js → LastPage-Cad46J9e.js} +1 -1
  24. package/dist/assets/{Launch-BqeaAnil.js → Launch-fB5PS8PY.js} +1 -1
  25. package/dist/assets/{Link-BOP78bx2.js → Link-Dzd80klt.js} +1 -1
  26. package/dist/assets/{LoadingButton-DrTul6Tx.js → LoadingButton-hHC9D6Jh.js} +1 -1
  27. package/dist/assets/{LockIcon-DCeQ6cnx.js → LockIcon-BgCC_gMD.js} +1 -1
  28. package/dist/assets/{Loop-HYbUt-bh.js → Loop-BTQochTH.js} +1 -1
  29. package/dist/assets/{MoreVert-BajHOelZ.js → MoreVert-CWypNP8g.js} +1 -1
  30. package/dist/assets/{Pagination-CJ7hCMrh.js → Pagination-Btpup9Q2.js} +1 -1
  31. package/dist/assets/{Public-9nhLGRVr.js → Public-YuAmoyPx.js} +1 -1
  32. package/dist/assets/{SchemaReference.es-Byjjrfj8.js → SchemaReference.es-DbpM2rcO.js} +1 -1
  33. package/dist/assets/{Search-K8V-qpJ2.js → Search-uFerpv5L.js} +1 -1
  34. package/dist/assets/{Select-DvwGvpRe.js → Select-b09v8FPX.js} +1 -1
  35. package/dist/assets/{Skeleton-C7FrH0CU.js → Skeleton-zb5bXzJn.js} +1 -1
  36. package/dist/assets/{Slider-ByfyDpEL.js → Slider-Ct9swbug.js} +1 -1
  37. package/dist/assets/{Stepper-nGCToByw.js → Stepper-WgjnG7-H.js} +1 -1
  38. package/dist/assets/{TextField-ujCYjYid.js → TextField-BPO9Hci-.js} +1 -1
  39. package/dist/assets/{ToggleButtonGroup-kyokF_8F.js → ToggleButtonGroup-PBOhq3jx.js} +1 -1
  40. package/dist/assets/{ViewList-BYXhHHY2.js → ViewList-DiAWVo-f.js} +1 -1
  41. package/dist/assets/{actions-COa7JwvC.js → actions-CS2Trs8B.js} +1 -1
  42. package/dist/assets/actions-CYOQRhpw.js +11 -0
  43. package/dist/assets/{agreement-nYAwBPUN.js → agreement-Br53N-6_.js} +1 -1
  44. package/dist/assets/api-UFWd_s1k.js +1 -0
  45. package/dist/assets/{app-avatar-C4XusMwW.js → app-avatar-BhPctNAT.js} +1 -1
  46. package/dist/assets/{audit-logs-BKf16Ec2.js → audit-logs-DTUtFnAK.js} +1 -1
  47. package/dist/assets/{brace-fold.es-rWkt1F7x.js → brace-fold.es-BSNAOfKd.js} +1 -1
  48. package/dist/assets/{bundle-avatar-BAQeilKf.js → bundle-avatar-CbU_wbB2.js} +1 -1
  49. package/dist/assets/{chart-BxnxKx2Z.js → chart-BUxn7CWp.js} +1 -1
  50. package/dist/assets/{click-to-copy-Bu1JGAV8.js → click-to-copy-BLqu2SLV.js} +1 -1
  51. package/dist/assets/{closebrackets.es-Uu6VSAeP.js → closebrackets.es-DynJAn1e.js} +1 -1
  52. package/dist/assets/{codemirror.es-CyMlPAkY.js → codemirror.es-cljF5Vfg.js} +1 -1
  53. package/dist/assets/{comment.es-CHC_iNoS.js → comment.es-CoFz2Oy_.js} +1 -1
  54. package/dist/assets/{config-navigation-DUSJe2Q7.js → config-navigation-DZx1cn4-.js} +1 -1
  55. package/dist/assets/{delete-confirm-tengYOpR.js → delete-confirm-CcpxufKB.js} +1 -1
  56. package/dist/assets/{detail-CY9bLcUn.js → detail-CIhc9jZt.js} +3 -3
  57. package/dist/assets/{dialog.es-DU0qooVo.js → dialog.es-C6n3qH0v.js} +1 -1
  58. package/dist/assets/{download-DdiIFvPA.js → download-xUEvruKh.js} +1 -1
  59. package/dist/assets/{foldgutter.es-CMSi-X-G.js → foldgutter.es-C2zr_tXR.js} +1 -1
  60. package/dist/assets/getValidReactChildren-7IUHA6fR.js +1 -0
  61. package/dist/assets/{hint.es-Dag50cEw.js → hint.es-D0wd5c9g.js} +1 -1
  62. package/dist/assets/{hint.es2-1wAW2GlO.js → hint.es2-DMsolbMA.js} +1 -1
  63. package/dist/assets/{iframe-CSlxNh-f.js → iframe-n_w2gI30.js} +1 -1
  64. package/dist/assets/{index-lQlCM5cN.js → index-B2PJyxbf.js} +1 -1
  65. package/dist/assets/{index-taLEcwqp.js → index-BBEuxxjq.js} +1 -1
  66. package/dist/assets/{index-C9m4NILu.js → index-BEQyLEKb.js} +1 -1
  67. package/dist/assets/{index-D3f50Al7.js → index-BLEzKgrJ.js} +1 -1
  68. package/dist/assets/{index-wYgdnkvk.js → index-BOADFDIv.js} +1 -1
  69. package/dist/assets/{index-DC5brgv-.js → index-BR3eM8Lx.js} +1 -1
  70. package/dist/assets/{index-BJly7w5W.js → index-BSqmsUTI.js} +1 -1
  71. package/dist/assets/{index-BDWQt3oG.js → index-B_u7mT5U.js} +1 -1
  72. package/dist/assets/{index-CP2qVp-g.js → index-BgG0evtj.js} +1 -1
  73. package/dist/assets/{index-CjBT-zb_.js → index-BoHcyWvQ.js} +1 -1
  74. package/dist/assets/{index-COaUqh15.js → index-BtKnBn2o.js} +1 -1
  75. package/dist/assets/{index-D2-Ad6ai.js → index-BwD5fAbE.js} +5 -5
  76. package/dist/assets/{index-D66mArSt.js → index-C2Cgygdk.js} +1 -1
  77. package/dist/assets/{index-RF8S_PnF.js → index-C8pFKy9H.js} +1 -1
  78. package/dist/assets/{index-DXmaz-ul.js → index-CCIbtRAj.js} +1 -1
  79. package/dist/assets/{index-Cw40SxmM.js → index-CHBNQD8C.js} +3 -3
  80. package/dist/assets/{index-IJyykbif.js → index-CLIK5uaQ.js} +1 -1
  81. package/dist/assets/{index-BdJr7Zgs.js → index-Chps_oCL.js} +1 -1
  82. package/dist/assets/{index-DnSCVi1t.js → index-Cr1Psinm.js} +1 -1
  83. package/dist/assets/{index-DuGr2JNW.js → index-CxaGo2hZ.js} +1 -1
  84. package/dist/assets/{index-GKFTjX-h.js → index-CzXBr0fB.js} +1 -1
  85. package/dist/assets/{index-CDmYlSRL.js → index-D3ulER0U.js} +1 -1
  86. package/dist/assets/{index-OAYLZ90-.js → index-D9E6SEa0.js} +1 -1
  87. package/dist/assets/{index-C3g13IB_.js → index-DCQd0BKE.js} +1 -1
  88. package/dist/assets/{index-D3Lh5mWG.js → index-DIuisRmH.js} +1 -1
  89. package/dist/assets/{index-BlVavhLU.js → index-DNSbmp0u.js} +1 -1
  90. package/dist/assets/{index-lLmhSKeG.js → index-DPGMTLlW.js} +1 -1
  91. package/dist/assets/{index-CAswdZkd.js → index-DS1JU_-_.js} +2 -2
  92. package/dist/assets/{index-BfVXnGzp.js → index-DZdSy-Ha.js} +1 -1
  93. package/dist/assets/{index-Bow06vSy.js → index-Db0xkYaW.js} +3 -3
  94. package/dist/assets/{index-CfddNrs0.js → index-DitmQRsw.js} +1 -1
  95. package/dist/assets/{index-DoarpdRq.js → index-Dl2hud6k.js} +1 -1
  96. package/dist/assets/{index-CjCBAzIs.js → index-DqdZ9FKF.js} +1 -1
  97. package/dist/assets/{index-4D6EIVyf.js → index-Dvf0fvGe.js} +1 -1
  98. package/dist/assets/{index-BsueC2xL.js → index-DvtCtx64.js} +1 -1
  99. package/dist/assets/{index-B7s3omb3.js → index-DxGSDzwI.js} +1 -1
  100. package/dist/assets/{index-DdJbp08q.js → index-DxX4hb7b.js} +1 -1
  101. package/dist/assets/{index-FMKJ-tCc.js → index-H43aSOyt.js} +1 -1
  102. package/dist/assets/{index-DvMwfNNM.js → index-JffoMuKt.js} +1 -1
  103. package/dist/assets/{index-DHgGaafE.js → index-RAfI5Ovd.js} +1 -1
  104. package/dist/assets/{index-L2BZJjBO.js → index-xRBNy1in.js} +1 -1
  105. package/dist/assets/{index-CxZxRNSQ.js → index-yF_Q2_O-.js} +1 -1
  106. package/dist/assets/{index-sL9uwgI4.js → index-zZFI1GlJ.js} +1 -1
  107. package/dist/assets/{index.es-Bpl1HjpP.js → index.es-Bq5abo39.js} +1 -1
  108. package/dist/assets/{index.esm-H4-fr4BI.js → index.esm-DvG22D3z.js} +1 -1
  109. package/dist/assets/{info-addon.es-moa6A46t.js → info-addon.es-C24VfKdY.js} +1 -1
  110. package/dist/assets/{info.es-Cx9eOxrn.js → info.es-Bqu2hgxq.js} +1 -1
  111. package/dist/assets/{install-from-url-D7PtGv0X.js → install-from-url-BsrxhAMw.js} +1 -1
  112. package/dist/assets/{invitation-CnjKbHVz.js → invitation-BMg6rGzW.js} +1 -1
  113. package/dist/assets/{is-path-prefix-equal-3L6YAtCO.js → is-path-prefix-equal-PjyGugoV.js} +1 -1
  114. package/dist/assets/{isEqual-Da9udG4a.js → isEqual-3iEl-twA.js} +1 -1
  115. package/dist/assets/{item-6qLADCdC.js → item-Yv551hqX.js} +1 -1
  116. package/dist/assets/{javascript.es-Cxi14G44.js → javascript.es-DqZLq1Ic.js} +1 -1
  117. package/dist/assets/{jump-to-line.es-D0F2DpUt.js → jump-to-line.es-CUkkqFSr.js} +1 -1
  118. package/dist/assets/{jump.es-D8oP-dLY.js → jump.es-dT0NLpeH.js} +1 -1
  119. package/dist/assets/{line-D8NitAu7.js → line-CG9AJRHJ.js} +3 -3
  120. package/dist/assets/{lint.es-B8MsVbgW.js → lint.es-BQv8s92u.js} +1 -1
  121. package/dist/assets/{lint.es2-BfR3Ktr4.js → lint.es2-Bw5fcxch.js} +1 -1
  122. package/dist/assets/{lint.es3-CK47tyt4.js → lint.es3-CX_qCTWo.js} +1 -1
  123. package/dist/assets/{list-header--Fe2XUHh.js → list-header-3UZEZSQm.js} +1 -1
  124. package/dist/assets/{log-BUtOZdBQ.js → log-C6NBJs93.js} +1 -1
  125. package/dist/assets/{lottie-x0vNNnqO.js → lottie-GpNsBU3J.js} +1 -1
  126. package/dist/assets/{matchbrackets.es-CgQMZ9dr.js → matchbrackets.es-Kf3wI0kD.js} +1 -1
  127. package/dist/assets/{memory-CqWPgCw7.js → memory-CnY03W9t.js} +1 -1
  128. package/dist/assets/{mode.es-B3AkPTOy.js → mode.es-DGRXJ00j.js} +1 -1
  129. package/dist/assets/{mode.es2-ChTaNGQr.js → mode.es2-DtvaqXOt.js} +1 -1
  130. package/dist/assets/{mode.es3-CuYT-OGK.js → mode.es3-B8JtCbCV.js} +1 -1
  131. package/dist/assets/{onlineParser.es-CRZlHDDr.js → onlineParser.es-ZkK82Jda.js} +1 -1
  132. package/dist/assets/{overview-CcYxGMZQ.js → overview-BUJYpj1Q.js} +1 -1
  133. package/dist/assets/{react-DqCSLPIl.js → react-BjVyu04q.js} +3 -3
  134. package/dist/assets/{redux-BkD59_OZ.js → redux-gonzvYQ4.js} +1 -1
  135. package/dist/assets/{resource-dialog-OyKxyPEI.js → resource-dialog-DO7gkp11.js} +1 -1
  136. package/dist/assets/{runtime-Fi9N1sWR.js → runtime-BtNyIENm.js} +1 -1
  137. package/dist/assets/{search.es-4owDc11Y.js → search.es-B_DIO3P6.js} +1 -1
  138. package/dist/assets/{searchcursor.es-CG_sIeqT.js → searchcursor.es-DSbkhPIa.js} +1 -1
  139. package/dist/assets/service-B4g9jUew.js +1 -0
  140. package/dist/assets/{show-hint.es-CwNrJoIK.js → show-hint.es-DNIrnFs-.js} +1 -1
  141. package/dist/assets/{slicedToArray-Bi5-H7jI.js → slicedToArray-CjyU228M.js} +1 -1
  142. package/dist/assets/{spaces-BxL638Gf.js → spaces-BSCd0GtL.js} +1 -1
  143. package/dist/assets/{sublime.es-CYAWYiu2.js → sublime.es-PWDR4BS_.js} +1 -1
  144. package/dist/assets/{switch-control-Dp3K26tm.js → switch-control-C8El4PwO.js} +1 -1
  145. package/dist/assets/{table-icons-l8GK26sd.js → table-icons-DwX90JdI.js} +9 -9
  146. package/dist/assets/{tag-DhW_Xw5i.js → tag-Cvwm2gDk.js} +1 -1
  147. package/dist/assets/{team-Qlfyy4ag.js → team-N6DYcIw9.js} +1 -1
  148. package/dist/assets/{toUpper-DX-movl7.js → toUpper-psJiJObX.js} +1 -1
  149. package/dist/assets/{traffic-CskMDMM9.js → traffic-CQiojOw9.js} +1 -1
  150. package/dist/assets/{url-evaluation-DhK3EWMs.js → url-evaluation-DjVe9I2g.js} +1 -1
  151. package/dist/assets/{url-join-CzWhFqcJ.js → url-join-D1xrWbhs.js} +1 -1
  152. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-YT5-NU0m.js → use-blocklet-info-for-connect-did-spaces-IAC6QCQz.js} +1 -1
  153. package/dist/assets/{useLocalStorage-C6lWDRq3.js → useLocalStorage-CcTbqaWM.js} +1 -1
  154. package/dist/assets/{util-CnlZVVl5.js → util-_4tqOqNO.js} +1 -1
  155. package/dist/assets/{wait-container-CsVPJrgn.js → wait-container-4d4Uc1iI.js} +1 -1
  156. package/dist/assets/{withStyles-DqyyCsvW.js → withStyles-BiL7OyyA.js} +1 -1
  157. package/dist/assets/{wrap-locale-Dz5ZUUi6.js → wrap-locale-b15Mq8e0.js} +1 -1
  158. package/dist/index.html +1 -1
  159. package/dist/service-worker.js +1 -1
  160. package/package.json +1 -1
  161. package/dist/assets/DeleteOutline-PvgoccWQ.js +0 -1
  162. package/dist/assets/actions-BqB5CLlu.js +0 -11
  163. package/dist/assets/api-BanFO9WV.js +0 -1
  164. package/dist/assets/getValidReactChildren-1X43ZiNl.js +0 -1
  165. package/dist/assets/service-Ce06US_B.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as I,j as t,ft as hn,cj as X,fu as xn,f9 as ce,O as T,as as _t,ax as Y,m as _,ez as vn,d2 as ht,fv as yn,q as K,fw as $e,fx as bn,aG as jn,ci as wn,dM as xt,R as ve,bl as H,S as Me,fy as Ue,at as de,D as J,B as z,C as oe,w as ze,J as se,K as ee,P as S,n as V,fz as Sn,k as Be,aS as Cn,x as In,y as Rn,f8 as Pn,f as me,ad as we,U as Q,cd as te,A as ie,fA as An,aK as $t,aL as Mt,b as Z,d6 as Dn,t as Ut,F as q,a1 as vt,W as We,co as On,cf as Tn,fB as zt,aN as En,aD as kn,a9 as Ln,fa as Bn,a2 as Fn,bq as Nn,aX as _n,aY as $n,Q as Mn}from"./index-CAswdZkd.js";import{c as Un}from"./index-DC5brgv-.js";import{d as ye}from"./Add-B0xbM7Le.js";import{d as zn}from"./Loop-HYbUt-bh.js";import{d as Wn}from"./ViewList-BYXhHHY2.js";import{L as qn,S as Vn,d as Wt}from"./list-header--Fe2XUHh.js";import{D as qe,g as Hn}from"./index-D3Lh5mWG.js";import"./index-BfVXnGzp.js";import{c as Oe,U as Te,d as qt}from"./resource-dialog-OyKxyPEI.js";import{T as Kn}from"./index-DdJbp08q.js";import{E as Vt}from"./index-BJly7w5W.js";import"./index-CjCBAzIs.js";import{W as Ht}from"./tag-DhW_Xw5i.js";import{b as G,u as Kt}from"./team-Qlfyy4ag.js";import{C as Se}from"./click-to-copy-Bu1JGAV8.js";import{F as Qt,S as Yt}from"./Select-DvwGvpRe.js";import{I as Gt}from"./InputLabel-EIEW8n2S.js";import{T as Xt}from"./TextField-ujCYjYid.js";import{I as Fe}from"./index-CP2qVp-g.js";import{d as Qn}from"./Delete-sQJNb5lC.js";import{A as Yn}from"./actions-COa7JwvC.js";var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var Jt=Ve.default=void 0;Gn(I);var re=t;function Gn(e){return e&&e.__esModule?e:{default:e}}function yt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),r.push.apply(r,i)}return r}function bt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(i){Xn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xn(e,n,r){return n=Jn(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e){var n=Zn(e,"string");return typeof n=="symbol"?n:String(n)}function Zn(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var He=function(n){return(0,re.jsxs)("svg",bt(bt({},n),{},{children:[(0,re.jsx)("g",{clipPath:"url(#clip0)",children:(0,re.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,re.jsx)("defs",{children:(0,re.jsx)("clipPath",{id:"clip0",children:(0,re.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};He.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};He.displayName="person";Jt=Ve.default=He;var xe={},er=e=>encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`),Zt="%[a-f0-9]{2}",jt=new RegExp("("+Zt+")|([^%]+?)","gi"),wt=new RegExp("("+Zt+")+","gi");function Ne(e,n){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;n=n||1;var r=e.slice(0,n),i=e.slice(n);return Array.prototype.concat.call([],Ne(r),Ne(i))}function tr(e){try{return decodeURIComponent(e)}catch{for(var n=e.match(jt)||[],r=1;r<n.length;r++)e=Ne(n,r).join(""),n=e.match(jt)||[];return e}}function nr(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=wt.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch{var i=tr(r[0]);i!==r[0]&&(n[r[0]]=i)}r=wt.exec(e)}n["%C2"]="�";for(var m=Object.keys(n),j=0;j<m.length;j++){var P=m[j];e=e.replace(new RegExp(P,"g"),n[P])}return e}var rr=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return nr(e)}},sr=(e,n)=>{if(!(typeof e=="string"&&typeof n=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n==="")return[e];const r=e.indexOf(n);return r===-1?[e]:[e.slice(0,r),e.slice(r+n.length)]},or=function(e,n){for(var r={},i=Object.keys(e),m=Array.isArray(n),j=0;j<i.length;j++){var P=i[j],p=e[P];(m?n.indexOf(P)!==-1:n(P,p,e))&&(r[P]=p)}return r};(function(e){const n=er,r=rr,i=sr,m=or,j=o=>o==null;function P(o){switch(o.arrayFormat){case"index":return s=>(a,l)=>{const c=a.length;return l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[",c,"]"].join("")]:[...a,[h(s,o),"[",h(c,o),"]=",h(l,o)].join("")]};case"bracket":return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[]"].join("")]:[...a,[h(s,o),"[]=",h(l,o)].join("")];case"comma":case"separator":return s=>(a,l)=>l==null||l.length===0?a:a.length===0?[[h(s,o),"=",h(l,o)].join("")]:[[a,h(l,o)].join(o.arrayFormatSeparator)];default:return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,h(s,o)]:[...a,[h(s,o),"=",h(l,o)].join("")]}}function p(o){let s;switch(o.arrayFormat){case"index":return(a,l,c)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){c[a]=l;return}c[a]===void 0&&(c[a]={}),c[a][s[1]]=l};case"bracket":return(a,l,c)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){c[a]=l;return}if(c[a]===void 0){c[a]=[l];return}c[a]=[].concat(c[a],l)};case"comma":case"separator":return(a,l,c)=>{const b=typeof l=="string"&&l.includes(o.arrayFormatSeparator),d=typeof l=="string"&&!b&&u(l,o).includes(o.arrayFormatSeparator);l=d?u(l,o):l;const v=b||d?l.split(o.arrayFormatSeparator).map(k=>u(k,o)):l===null?l:u(l,o);c[a]=v};default:return(a,l,c)=>{if(c[a]===void 0){c[a]=l;return}c[a]=[].concat(c[a],l)}}}function g(o){if(typeof o!="string"||o.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(o,s){return s.encode?s.strict?n(o):encodeURIComponent(o):o}function u(o,s){return s.decode?r(o):o}function w(o){return Array.isArray(o)?o.sort():typeof o=="object"?w(Object.keys(o)).sort((s,a)=>Number(s)-Number(a)).map(s=>o[s]):o}function f(o){const s=o.indexOf("#");return s!==-1&&(o=o.slice(0,s)),o}function y(o){let s="";const a=o.indexOf("#");return a!==-1&&(s=o.slice(a)),s}function A(o){o=f(o);const s=o.indexOf("?");return s===-1?"":o.slice(s+1)}function C(o,s){return s.parseNumbers&&!Number.isNaN(Number(o))&&typeof o=="string"&&o.trim()!==""?o=Number(o):s.parseBooleans&&o!==null&&(o.toLowerCase()==="true"||o.toLowerCase()==="false")&&(o=o.toLowerCase()==="true"),o}function x(o,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),g(s.arrayFormatSeparator);const a=p(s),l=Object.create(null);if(typeof o!="string"||(o=o.trim().replace(/^[?#&]/,""),!o))return l;for(const c of o.split("&")){if(c==="")continue;let[b,d]=i(s.decode?c.replace(/\+/g," "):c,"=");d=d===void 0?null:["comma","separator"].includes(s.arrayFormat)?d:u(d,s),a(u(b,s),d,l)}for(const c of Object.keys(l)){const b=l[c];if(typeof b=="object"&&b!==null)for(const d of Object.keys(b))b[d]=C(b[d],s);else l[c]=C(b,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((c,b)=>{const d=l[b];return d&&typeof d=="object"&&!Array.isArray(d)?c[b]=w(d):c[b]=d,c},Object.create(null))}e.extract=A,e.parse=x,e.stringify=(o,s)=>{if(!o)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),g(s.arrayFormatSeparator);const a=d=>s.skipNull&&j(o[d])||s.skipEmptyString&&o[d]==="",l=P(s),c={};for(const d of Object.keys(o))a(d)||(c[d]=o[d]);const b=Object.keys(c);return s.sort!==!1&&b.sort(s.sort),b.map(d=>{const v=o[d];return v===void 0?"":v===null?h(d,s):Array.isArray(v)?v.reduce(l(d),[]).join("&"):h(d,s)+"="+h(v,s)}).filter(d=>d.length>0).join("&")},e.parseUrl=(o,s)=>{s=Object.assign({decode:!0},s);const[a,l]=i(o,"#");return Object.assign({url:a.split("?")[0]||"",query:x(A(o),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:u(l,s)}:{})},e.stringifyUrl=(o,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=f(o.url).split("?")[0]||"",l=e.extract(o.url),c=e.parse(l,{sort:!1}),b=Object.assign(c,o.query);let d=e.stringify(b,s);d&&(d=`?${d}`);let v=y(o.url);return o.fragmentIdentifier&&(v=`#${h(o.fragmentIdentifier,s)}`),`${a}${d}${v}`},e.pick=(o,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:l,query:c,fragmentIdentifier:b}=e.parseUrl(o,a);return e.stringifyUrl({url:l,query:m(c,s),fragmentIdentifier:b},a)},e.exclude=(o,s,a)=>{const l=Array.isArray(s)?c=>!s.includes(c):(c,b)=>!s(c,b);return e.pick(o,l,a)}})(xe);const le=xn,ir={parseNumbers:!1,parseBooleans:!1},ar={skipNull:!1,skipEmptyString:!1},lr=(e,n)=>{var r,i;const{navigateMode:m="push",parseOptions:j,stringifyOptions:P}=n||{},p=Object.assign(Object.assign({},ir),j),g=Object.assign(Object.assign({},ar),P),h=le.useLocation(),u=(r=le.useHistory)===null||r===void 0?void 0:r.call(le),w=(i=le.useNavigate)===null||i===void 0?void 0:i.call(le),f=hn(),y=I.useRef(typeof e=="function"?e():e||{}),A=I.useMemo(()=>xe.parse(h.search,p),[h.search]),C=I.useMemo(()=>Object.assign(Object.assign({},y.current),A),[A]);return[C,X(o=>{const s=typeof o=="function"?o(C):o;f(),u&&u[m]({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},h.state),w&&w({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},{replace:m==="replace",state:h.state})})]},cr=lr;let ur=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const St=e=>globalThis.DOMException===void 0?new ur(e):new DOMException(e),Ct=e=>{const n=e.reason===void 0?St("This operation was aborted."):e.reason;return n instanceof Error?n:St(n)};async function dr(e,n,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:m}={}){return new Promise((j,P)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);const p=[],g=[],h=new Map;let u=!1,w=!1,f=!1,y=0,A=0;const C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),x=s=>{u=!0,w=!0,P(s)};m&&(m.aborted&&x(Ct(m)),m.addEventListener("abort",()=>{x(Ct(m))}));const o=async()=>{if(w)return;const s=await C.next(),a=A;if(A++,s.done){if(f=!0,y===0&&!w){if(!i&&g.length>0){x(new AggregateError(g));return}if(w=!0,h.size===0){j(p);return}const l=[];for(const[c,b]of p.entries())h.get(c)!==It&&l.push(b);j(l)}return}y++,(async()=>{try{const l=await s.value;if(w)return;const c=await n(l,a);c===It&&h.set(a,c),p[a]=c,y--,await o()}catch(l){if(i)x(l);else{g.push(l),y--;try{await o()}catch(c){x(c)}}}})()};(async()=>{for(let s=0;s<r;s++){try{await o()}catch(a){x(a);break}if(f||u)break}})()})}const It=Symbol("skip");async function mr(e,n){return dr(e,r=>r(),n)}function fr({user:e,sessionUser:n}){const r=ce(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(m=>m.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(_t,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),t.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Y,{title:n.fullName,children:t.jsx(_,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),t.jsx(vn,{label:(r==null?void 0:r.title)||(r==null?void 0:r.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:ht.textBase,borderColor:ht.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),t.jsx(Y,{title:n.email,children:t.jsx(_,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const pr={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},en="Reserved IP",Rt="ip-region-cache";async function gr(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country_name,i.region,i.city].filter(Boolean).join("/"),m}async function hr(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country,i.region,i.city].filter(Boolean).join("/"),m}async function xr(e){let n="",r={};try{const i=localStorage.getItem(Rt);i&&(r=JSON.parse(i))}catch{r={}}if(r[e])n=r[e];else{try{n=await hr(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await gr(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(r);i.length>100&&delete r[i[0]],r[e]&&delete r[e],r[e]=n,localStorage.setItem(Rt,JSON.stringify(r))}return n}async function vr(e){return Promise.all(e.map(n=>xr(n)))}const Pt=e=>new Te(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[Te.BROWSER.NAME,Te.BROWSER.VERSION]]}).getResult();function yr({user:e,showAction:n=!0,showUser:r=!0}){const i=yn(),{locale:m}=K(),{confirmApi:j,confirmHolder:P}=$e(),p=X((s,a={})=>bn(pr,s,m,"en",a)),g=X(async()=>{let s=e==null?void 0:e.userSessions;s||(s=await Oe.userSession.getUserSessions({did:e.did}));try{const l=s==null?void 0:s.map((d,v)=>[v,d.lastLoginIp]).filter(d=>!!d[1]),c=l==null?void 0:l.map(d=>d[1]),b=await vr(c);for(let d=0;d<b.length;d++){const v=b[d],k=l[d],M=s[k[0]];M.ipRegion=v}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const a=new Date().getTime();return jn(s,l=>l.visitorId===i?-1:a-new Date(l.updatedAt).getTime())}),h=wn(g),u=ce(()=>h.data||[],[h.data]),w=ce(()=>u.reduce((s,a)=>(s[a.lastLoginIp]=a.ipRegion,s),{}),[u]),f=X(({visitorId:s})=>{j.open({title:p("logoutThisSession"),content:p("logoutThisSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:s}),h.refresh(),j.close()}})}),y=ce(()=>u.filter(a=>a.visitorId!==i),[u]),A=X(()=>{j.open({title:p("logoutAllSession"),content:p("logoutAllSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{const s=y.map(a=>()=>Oe.user.logout({visitorId:a.visitorId}));await mr(s,{concurrency:3,stopOnError:!1}),h.refresh(),j.close()}})}),C=[];n&&C.push(t.jsx(Y,{title:p("logoutAllTips"),children:t.jsx(xt,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:A,disabled:y.length===0,children:p("logoutAll")})},"logoutAll"));const x=ce(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),o=[{label:p("platform"),name:"platform",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.os)==null?void 0:c.name,(b=l.os)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("deviceType"),name:"deviceType",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.browser)==null?void 0:c.name,(b=l.browser)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("walletOS"),name:"walletOS",options:{customBodyRenderLite:s=>{var l;const a=u[s];return t.jsx(T,{children:((l=a.extra)==null?void 0:l.walletOS)||p("unknown")})}}},r&&{label:p("user"),name:"user",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{sx:{minWidth:150,maxWidth:250},children:t.jsx(fr,{sessionUser:a.user,user:e})})}}},{label:p("createdAt"),name:"createdAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.createdAt?t.jsx(ve,{value:a.createdAt,relativeRange:3*86400*1e3,locale:m}):p("unknown")}}},{label:p("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.status==="expired"?p("expired"):t.jsx(ve,{value:a.updatedAt,relativeRange:3*86400*1e3,locale:m})}}},{label:p("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:w[a.lastLoginIp]?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"body2",children:w[a.lastLoginIp]}),t.jsx(_,{variant:"body2",color:"grey",children:a.lastLoginIp||p("unknown")})]}):t.jsx(_,{children:a.lastLoginIp||p("unknown")})})}}},n&&{label:p("actions"),name:"actions",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:t.jsx(xt,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===a.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>f({visitorId:a.visitorId}),children:a.status==="expired"?p("remove"):i===a.visitorId?p("currentSession"):p("logout")})})}}}].filter(Boolean);return t.jsxs(T,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[P,t.jsx(qe,{locale:m,data:u,columns:o,customButtons:C,options:x,loading:h.loading})]})}function Ke({teamDid:e,roles:n,onCancel:r,onSuccess:i,onError:m,endpoint:j}){const{api:P}=H(),[p,g]=I.useState(!1),[h,u]=I.useState(""),{t:w,locale:f}=K(),[y,A]=I.useState(0),[C,x]=I.useState(""),[o,s]=I.useState(""),[a,l]=I.useState(""),c=async()=>{if(!o){u(w("team.member.error.passportEmpty"));return}const v=a.trim();u(null),g(!0);try{const{inviteInfo:k}=await P.createMemberInvitation({input:{teamDid:e,role:o,remark:v}});x(k),A(1)}catch(k){const M=ee(k);u(M),m(k)}finally{g(!1)}},d=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(Qt,{style:{width:"100%"},variant:"outlined",children:[t.jsx(Gt,{children:w("common.passport")}),t.jsx(Yt,{"data-cy":"invite-member-select-role",value:o,onChange:v=>{u(null),s(v.target.value)},fullWidth:!0,label:w("common.passport"),disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),c())},children:n.filter(v=>v.name!=="owner").map(v=>t.jsx(Me,{value:v.name,"data-cy":`invite-member-select-option-${v.name}`,children:t.jsx("span",{children:v.title||v.name})},v.name))})]}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:w("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:a,onChange:v=>{u(null),l(v.target.value)},disabled:p,"data-cy":"invite-member-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:w("common.cancel"),confirm:w("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:c},{body:()=>{const v=Ue({inviteId:C.inviteId,endpoint:j});return t.jsxs("div",{children:[t.jsx(br,{children:w("team.member.inviteDialog.createSuccessTip",{expireDate:de(C.expireDate,f)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:v})]})},confirm:w("common.confirm"),onConfirm:i}][y];return t.jsxs(J,{title:w("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[d.cancel&&t.jsx(z,{onClick:d.onCancel,color:"inherit",children:d.cancel}),t.jsxs(z,{onClick:d.onConfirm,color:"primary",disabled:p||!o,variant:"contained",autoFocus:!0,children:[p&&t.jsx(oe,{size:16}),d.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof d.body=="function"?d.body():d.body}),!!h&&t.jsx(se,{type:"error",variant:"icon",children:h})]})}Ke.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,roles:S.array,endpoint:S.string};Ke.defaultProps={onError:()=>{},roles:[],endpoint:""};const br=V.div`
1
+ import{r as I,j as t,ft as hn,cj as X,fu as xn,f9 as ce,O as T,as as _t,ax as Y,m as _,ez as vn,d2 as ht,fv as yn,q as K,fw as $e,fx as bn,aG as jn,ci as wn,dM as xt,R as ve,bl as H,S as Me,fy as Ue,at as de,D as J,B as z,C as oe,w as ze,J as se,K as ee,P as S,n as V,fz as Sn,k as Be,aS as Cn,x as In,y as Rn,f8 as Pn,f as me,ad as we,U as Q,cd as te,A as ie,fA as An,aK as $t,aL as Mt,b as Z,d6 as Dn,t as Ut,F as q,a1 as vt,W as We,co as On,cf as Tn,fB as zt,aN as En,aD as kn,a9 as Ln,fa as Bn,a2 as Fn,bq as Nn,aX as _n,aY as $n,Q as Mn}from"./index-DS1JU_-_.js";import{c as Un}from"./index-BR3eM8Lx.js";import{d as ye}from"./Add-i_eGmIkF.js";import{d as zn}from"./Loop-BTQochTH.js";import{d as Wn}from"./ViewList-DiAWVo-f.js";import{L as qn,S as Vn,d as Wt}from"./list-header-3UZEZSQm.js";import{D as qe,g as Hn}from"./index-DIuisRmH.js";import"./index-DZdSy-Ha.js";import{c as Oe,U as Te,d as qt}from"./resource-dialog-DO7gkp11.js";import{T as Kn}from"./index-DxX4hb7b.js";import{E as Vt}from"./index-BSqmsUTI.js";import"./index-DqdZ9FKF.js";import{W as Ht}from"./tag-Cvwm2gDk.js";import{b as G,u as Kt}from"./team-N6DYcIw9.js";import{C as Se}from"./click-to-copy-BLqu2SLV.js";import{F as Qt,S as Yt}from"./Select-b09v8FPX.js";import{I as Gt}from"./InputLabel-ERXbfftZ.js";import{T as Xt}from"./TextField-BPO9Hci-.js";import{I as Fe}from"./index-BgG0evtj.js";import{d as Qn}from"./Delete-KztH8pOq.js";import{A as Yn}from"./actions-CS2Trs8B.js";var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var Jt=Ve.default=void 0;Gn(I);var re=t;function Gn(e){return e&&e.__esModule?e:{default:e}}function yt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),r.push.apply(r,i)}return r}function bt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(i){Xn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xn(e,n,r){return n=Jn(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e){var n=Zn(e,"string");return typeof n=="symbol"?n:String(n)}function Zn(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var He=function(n){return(0,re.jsxs)("svg",bt(bt({},n),{},{children:[(0,re.jsx)("g",{clipPath:"url(#clip0)",children:(0,re.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,re.jsx)("defs",{children:(0,re.jsx)("clipPath",{id:"clip0",children:(0,re.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};He.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};He.displayName="person";Jt=Ve.default=He;var xe={},er=e=>encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`),Zt="%[a-f0-9]{2}",jt=new RegExp("("+Zt+")|([^%]+?)","gi"),wt=new RegExp("("+Zt+")+","gi");function Ne(e,n){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;n=n||1;var r=e.slice(0,n),i=e.slice(n);return Array.prototype.concat.call([],Ne(r),Ne(i))}function tr(e){try{return decodeURIComponent(e)}catch{for(var n=e.match(jt)||[],r=1;r<n.length;r++)e=Ne(n,r).join(""),n=e.match(jt)||[];return e}}function nr(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=wt.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch{var i=tr(r[0]);i!==r[0]&&(n[r[0]]=i)}r=wt.exec(e)}n["%C2"]="�";for(var m=Object.keys(n),j=0;j<m.length;j++){var P=m[j];e=e.replace(new RegExp(P,"g"),n[P])}return e}var rr=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return nr(e)}},sr=(e,n)=>{if(!(typeof e=="string"&&typeof n=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n==="")return[e];const r=e.indexOf(n);return r===-1?[e]:[e.slice(0,r),e.slice(r+n.length)]},or=function(e,n){for(var r={},i=Object.keys(e),m=Array.isArray(n),j=0;j<i.length;j++){var P=i[j],p=e[P];(m?n.indexOf(P)!==-1:n(P,p,e))&&(r[P]=p)}return r};(function(e){const n=er,r=rr,i=sr,m=or,j=o=>o==null;function P(o){switch(o.arrayFormat){case"index":return s=>(a,l)=>{const c=a.length;return l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[",c,"]"].join("")]:[...a,[h(s,o),"[",h(c,o),"]=",h(l,o)].join("")]};case"bracket":return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[]"].join("")]:[...a,[h(s,o),"[]=",h(l,o)].join("")];case"comma":case"separator":return s=>(a,l)=>l==null||l.length===0?a:a.length===0?[[h(s,o),"=",h(l,o)].join("")]:[[a,h(l,o)].join(o.arrayFormatSeparator)];default:return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,h(s,o)]:[...a,[h(s,o),"=",h(l,o)].join("")]}}function p(o){let s;switch(o.arrayFormat){case"index":return(a,l,c)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){c[a]=l;return}c[a]===void 0&&(c[a]={}),c[a][s[1]]=l};case"bracket":return(a,l,c)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){c[a]=l;return}if(c[a]===void 0){c[a]=[l];return}c[a]=[].concat(c[a],l)};case"comma":case"separator":return(a,l,c)=>{const b=typeof l=="string"&&l.includes(o.arrayFormatSeparator),d=typeof l=="string"&&!b&&u(l,o).includes(o.arrayFormatSeparator);l=d?u(l,o):l;const v=b||d?l.split(o.arrayFormatSeparator).map(k=>u(k,o)):l===null?l:u(l,o);c[a]=v};default:return(a,l,c)=>{if(c[a]===void 0){c[a]=l;return}c[a]=[].concat(c[a],l)}}}function g(o){if(typeof o!="string"||o.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(o,s){return s.encode?s.strict?n(o):encodeURIComponent(o):o}function u(o,s){return s.decode?r(o):o}function w(o){return Array.isArray(o)?o.sort():typeof o=="object"?w(Object.keys(o)).sort((s,a)=>Number(s)-Number(a)).map(s=>o[s]):o}function f(o){const s=o.indexOf("#");return s!==-1&&(o=o.slice(0,s)),o}function y(o){let s="";const a=o.indexOf("#");return a!==-1&&(s=o.slice(a)),s}function A(o){o=f(o);const s=o.indexOf("?");return s===-1?"":o.slice(s+1)}function C(o,s){return s.parseNumbers&&!Number.isNaN(Number(o))&&typeof o=="string"&&o.trim()!==""?o=Number(o):s.parseBooleans&&o!==null&&(o.toLowerCase()==="true"||o.toLowerCase()==="false")&&(o=o.toLowerCase()==="true"),o}function x(o,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),g(s.arrayFormatSeparator);const a=p(s),l=Object.create(null);if(typeof o!="string"||(o=o.trim().replace(/^[?#&]/,""),!o))return l;for(const c of o.split("&")){if(c==="")continue;let[b,d]=i(s.decode?c.replace(/\+/g," "):c,"=");d=d===void 0?null:["comma","separator"].includes(s.arrayFormat)?d:u(d,s),a(u(b,s),d,l)}for(const c of Object.keys(l)){const b=l[c];if(typeof b=="object"&&b!==null)for(const d of Object.keys(b))b[d]=C(b[d],s);else l[c]=C(b,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((c,b)=>{const d=l[b];return d&&typeof d=="object"&&!Array.isArray(d)?c[b]=w(d):c[b]=d,c},Object.create(null))}e.extract=A,e.parse=x,e.stringify=(o,s)=>{if(!o)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),g(s.arrayFormatSeparator);const a=d=>s.skipNull&&j(o[d])||s.skipEmptyString&&o[d]==="",l=P(s),c={};for(const d of Object.keys(o))a(d)||(c[d]=o[d]);const b=Object.keys(c);return s.sort!==!1&&b.sort(s.sort),b.map(d=>{const v=o[d];return v===void 0?"":v===null?h(d,s):Array.isArray(v)?v.reduce(l(d),[]).join("&"):h(d,s)+"="+h(v,s)}).filter(d=>d.length>0).join("&")},e.parseUrl=(o,s)=>{s=Object.assign({decode:!0},s);const[a,l]=i(o,"#");return Object.assign({url:a.split("?")[0]||"",query:x(A(o),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:u(l,s)}:{})},e.stringifyUrl=(o,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=f(o.url).split("?")[0]||"",l=e.extract(o.url),c=e.parse(l,{sort:!1}),b=Object.assign(c,o.query);let d=e.stringify(b,s);d&&(d=`?${d}`);let v=y(o.url);return o.fragmentIdentifier&&(v=`#${h(o.fragmentIdentifier,s)}`),`${a}${d}${v}`},e.pick=(o,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:l,query:c,fragmentIdentifier:b}=e.parseUrl(o,a);return e.stringifyUrl({url:l,query:m(c,s),fragmentIdentifier:b},a)},e.exclude=(o,s,a)=>{const l=Array.isArray(s)?c=>!s.includes(c):(c,b)=>!s(c,b);return e.pick(o,l,a)}})(xe);const le=xn,ir={parseNumbers:!1,parseBooleans:!1},ar={skipNull:!1,skipEmptyString:!1},lr=(e,n)=>{var r,i;const{navigateMode:m="push",parseOptions:j,stringifyOptions:P}=n||{},p=Object.assign(Object.assign({},ir),j),g=Object.assign(Object.assign({},ar),P),h=le.useLocation(),u=(r=le.useHistory)===null||r===void 0?void 0:r.call(le),w=(i=le.useNavigate)===null||i===void 0?void 0:i.call(le),f=hn(),y=I.useRef(typeof e=="function"?e():e||{}),A=I.useMemo(()=>xe.parse(h.search,p),[h.search]),C=I.useMemo(()=>Object.assign(Object.assign({},y.current),A),[A]);return[C,X(o=>{const s=typeof o=="function"?o(C):o;f(),u&&u[m]({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},h.state),w&&w({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},{replace:m==="replace",state:h.state})})]},cr=lr;let ur=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const St=e=>globalThis.DOMException===void 0?new ur(e):new DOMException(e),Ct=e=>{const n=e.reason===void 0?St("This operation was aborted."):e.reason;return n instanceof Error?n:St(n)};async function dr(e,n,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:m}={}){return new Promise((j,P)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);const p=[],g=[],h=new Map;let u=!1,w=!1,f=!1,y=0,A=0;const C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),x=s=>{u=!0,w=!0,P(s)};m&&(m.aborted&&x(Ct(m)),m.addEventListener("abort",()=>{x(Ct(m))}));const o=async()=>{if(w)return;const s=await C.next(),a=A;if(A++,s.done){if(f=!0,y===0&&!w){if(!i&&g.length>0){x(new AggregateError(g));return}if(w=!0,h.size===0){j(p);return}const l=[];for(const[c,b]of p.entries())h.get(c)!==It&&l.push(b);j(l)}return}y++,(async()=>{try{const l=await s.value;if(w)return;const c=await n(l,a);c===It&&h.set(a,c),p[a]=c,y--,await o()}catch(l){if(i)x(l);else{g.push(l),y--;try{await o()}catch(c){x(c)}}}})()};(async()=>{for(let s=0;s<r;s++){try{await o()}catch(a){x(a);break}if(f||u)break}})()})}const It=Symbol("skip");async function mr(e,n){return dr(e,r=>r(),n)}function fr({user:e,sessionUser:n}){const r=ce(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(m=>m.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(_t,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),t.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Y,{title:n.fullName,children:t.jsx(_,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),t.jsx(vn,{label:(r==null?void 0:r.title)||(r==null?void 0:r.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:ht.textBase,borderColor:ht.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),t.jsx(Y,{title:n.email,children:t.jsx(_,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const pr={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},en="Reserved IP",Rt="ip-region-cache";async function gr(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country_name,i.region,i.city].filter(Boolean).join("/"),m}async function hr(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country,i.region,i.city].filter(Boolean).join("/"),m}async function xr(e){let n="",r={};try{const i=localStorage.getItem(Rt);i&&(r=JSON.parse(i))}catch{r={}}if(r[e])n=r[e];else{try{n=await hr(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await gr(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(r);i.length>100&&delete r[i[0]],r[e]&&delete r[e],r[e]=n,localStorage.setItem(Rt,JSON.stringify(r))}return n}async function vr(e){return Promise.all(e.map(n=>xr(n)))}const Pt=e=>new Te(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[Te.BROWSER.NAME,Te.BROWSER.VERSION]]}).getResult();function yr({user:e,showAction:n=!0,showUser:r=!0}){const i=yn(),{locale:m}=K(),{confirmApi:j,confirmHolder:P}=$e(),p=X((s,a={})=>bn(pr,s,m,"en",a)),g=X(async()=>{let s=e==null?void 0:e.userSessions;s||(s=await Oe.userSession.getUserSessions({did:e.did}));try{const l=s==null?void 0:s.map((d,v)=>[v,d.lastLoginIp]).filter(d=>!!d[1]),c=l==null?void 0:l.map(d=>d[1]),b=await vr(c);for(let d=0;d<b.length;d++){const v=b[d],k=l[d],M=s[k[0]];M.ipRegion=v}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const a=new Date().getTime();return jn(s,l=>l.visitorId===i?-1:a-new Date(l.updatedAt).getTime())}),h=wn(g),u=ce(()=>h.data||[],[h.data]),w=ce(()=>u.reduce((s,a)=>(s[a.lastLoginIp]=a.ipRegion,s),{}),[u]),f=X(({visitorId:s})=>{j.open({title:p("logoutThisSession"),content:p("logoutThisSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:s}),h.refresh(),j.close()}})}),y=ce(()=>u.filter(a=>a.visitorId!==i),[u]),A=X(()=>{j.open({title:p("logoutAllSession"),content:p("logoutAllSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{const s=y.map(a=>()=>Oe.user.logout({visitorId:a.visitorId}));await mr(s,{concurrency:3,stopOnError:!1}),h.refresh(),j.close()}})}),C=[];n&&C.push(t.jsx(Y,{title:p("logoutAllTips"),children:t.jsx(xt,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:A,disabled:y.length===0,children:p("logoutAll")})},"logoutAll"));const x=ce(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),o=[{label:p("platform"),name:"platform",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.os)==null?void 0:c.name,(b=l.os)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("deviceType"),name:"deviceType",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.browser)==null?void 0:c.name,(b=l.browser)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("walletOS"),name:"walletOS",options:{customBodyRenderLite:s=>{var l;const a=u[s];return t.jsx(T,{children:((l=a.extra)==null?void 0:l.walletOS)||p("unknown")})}}},r&&{label:p("user"),name:"user",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{sx:{minWidth:150,maxWidth:250},children:t.jsx(fr,{sessionUser:a.user,user:e})})}}},{label:p("createdAt"),name:"createdAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.createdAt?t.jsx(ve,{value:a.createdAt,relativeRange:3*86400*1e3,locale:m}):p("unknown")}}},{label:p("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.status==="expired"?p("expired"):t.jsx(ve,{value:a.updatedAt,relativeRange:3*86400*1e3,locale:m})}}},{label:p("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:w[a.lastLoginIp]?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"body2",children:w[a.lastLoginIp]}),t.jsx(_,{variant:"body2",color:"grey",children:a.lastLoginIp||p("unknown")})]}):t.jsx(_,{children:a.lastLoginIp||p("unknown")})})}}},n&&{label:p("actions"),name:"actions",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:t.jsx(xt,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===a.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>f({visitorId:a.visitorId}),children:a.status==="expired"?p("remove"):i===a.visitorId?p("currentSession"):p("logout")})})}}}].filter(Boolean);return t.jsxs(T,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[P,t.jsx(qe,{locale:m,data:u,columns:o,customButtons:C,options:x,loading:h.loading})]})}function Ke({teamDid:e,roles:n,onCancel:r,onSuccess:i,onError:m,endpoint:j}){const{api:P}=H(),[p,g]=I.useState(!1),[h,u]=I.useState(""),{t:w,locale:f}=K(),[y,A]=I.useState(0),[C,x]=I.useState(""),[o,s]=I.useState(""),[a,l]=I.useState(""),c=async()=>{if(!o){u(w("team.member.error.passportEmpty"));return}const v=a.trim();u(null),g(!0);try{const{inviteInfo:k}=await P.createMemberInvitation({input:{teamDid:e,role:o,remark:v}});x(k),A(1)}catch(k){const M=ee(k);u(M),m(k)}finally{g(!1)}},d=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(Qt,{style:{width:"100%"},variant:"outlined",children:[t.jsx(Gt,{children:w("common.passport")}),t.jsx(Yt,{"data-cy":"invite-member-select-role",value:o,onChange:v=>{u(null),s(v.target.value)},fullWidth:!0,label:w("common.passport"),disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),c())},children:n.filter(v=>v.name!=="owner").map(v=>t.jsx(Me,{value:v.name,"data-cy":`invite-member-select-option-${v.name}`,children:t.jsx("span",{children:v.title||v.name})},v.name))})]}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:w("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:a,onChange:v=>{u(null),l(v.target.value)},disabled:p,"data-cy":"invite-member-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:w("common.cancel"),confirm:w("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:c},{body:()=>{const v=Ue({inviteId:C.inviteId,endpoint:j});return t.jsxs("div",{children:[t.jsx(br,{children:w("team.member.inviteDialog.createSuccessTip",{expireDate:de(C.expireDate,f)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:v})]})},confirm:w("common.confirm"),onConfirm:i}][y];return t.jsxs(J,{title:w("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[d.cancel&&t.jsx(z,{onClick:d.onCancel,color:"inherit",children:d.cancel}),t.jsxs(z,{onClick:d.onConfirm,color:"primary",disabled:p||!o,variant:"contained",autoFocus:!0,children:[p&&t.jsx(oe,{size:16}),d.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof d.body=="function"?d.body():d.body}),!!h&&t.jsx(se,{type:"error",variant:"icon",children:h})]})}Ke.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,roles:S.array,endpoint:S.string};Ke.defaultProps={onError:()=>{},roles:[],endpoint:""};const br=V.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  `;function Qe({teamDid:e,onCancel:n,onSuccess:r,onError:i,endpoint:m}){const{api:j,info:P}=H(),{api:p}=I.useContext(Sn),[g,h]=I.useState(!1),{t:u,locale:w}=K(),[f,y]=I.useState(""),[A,C]=I.useState(!1),[x,o]=I.useState(0),[s,a]=I.useState(""),[l,c]=I.useState(""),b=!!Be(P,"ownerNft.did"),d=Cn(async()=>{if(b){const{state:F}=await j.getDelegationState();return F}return{delegated:!0}});if(d.loading)return t.jsx(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:n,children:t.jsx("div",{style:{display:"flex",justifyContent:"center"},children:t.jsx(oe,{})})});if(d.error)return t.jsx(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:n,children:t.jsx(se,{type:"error",variant:"icon",children:ee(d.error)})});const v=async()=>{y(null),h(!0);try{const{inviteInfo:F}=await j.createTransferInvitation({input:{teamDid:e,role:"owner",remark:l.trim()}});a(F),o(W.length-1)}catch(F){const ne=ee(F);y(ne),i(F)}finally{h(!1)}},k=()=>{C(!0),o(1)},M=()=>{C(!1),o(0)},W=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(se,{type:"warning",children:[t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.progress")}),t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),t.jsx(se,{type:"warning",children:t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.revoke")})}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:u("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:l,onChange:F=>{y(null),c(F.target.value)},disabled:g,"data-cy":"transfer-node-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:u("common.cancel"),confirm:u("team.transferNode.inviteDialog.createInviteLink"),onCancel:n,onConfirm:b&&!Be(d,"value.delegated")?k:v},{body:()=>t.jsx(In,{action:"delegate-transfer-nft",open:A,locale:w,checkFn:p.get,onClose:M,onSuccess:v,checkTimeout:5*60*1e3,webWalletUrl:Rn(P),extraParams:{targetDID:P.did},messages:{title:u("team.transferNode.delegateDialog.title"),scan:u("team.transferNode.delegateDialog.scan"),confirm:u("team.transferNode.delegateDialog.confirm"),success:u("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const F=Ue({inviteId:s.inviteId,endpoint:m});return t.jsxs("div",{children:[t.jsx(jr,{children:u("team.transferNode.inviteDialog.createSuccessTip",{expireDate:de(s.expireDate,w)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:F})]})},confirm:u("common.confirm"),onConfirm:r}],$=W[x];return t.jsxs(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[$.cancel&&t.jsx(z,{onClick:$.onCancel,color:"inherit",children:$.cancel}),t.jsxs(z,{onClick:$.onConfirm,color:"primary",disabled:g,variant:"contained",autoFocus:!0,children:[g&&t.jsx(oe,{size:16}),$.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof $.body=="function"?$.body():$.body}),!!f&&t.jsx(se,{type:"error",variant:"icon",children:f})]})}Qe.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,endpoint:S.string};Qe.defaultProps={onError:()=>{},endpoint:""};const jr=V.div`
@@ -1 +1 @@
1
- import{u as d,j as o,C as f,z as h,aw as v,ci as j,cj as u,O as C,bk as I,ae as P,F as k}from"./index-CAswdZkd.js";import{I as R}from"./invitation-CnjKbHVz.js";import"./index-RF8S_PnF.js";import"./index-BDWQt3oG.js";import"./CheckCircle-DN9h3n-S.js";import"./wrap-locale-Dz5ZUUi6.js";function S(n){const{searchParams:i}=new URL(window.location.href),g=h(),{api:a,session:r}=v(),{info:l}=d(),c=i.get("redirect"),p=i.get("id"),s=j(async()=>{if(!p)return null;const{data:e}=await a.get("/api/invitation",{params:{inviteId:p,mode:"issue-passport"}});return e}),m=u(()=>{if(s.error)throw s.error;return s==null?void 0:s.data}),w=u(async(e,x=t=>t)=>{e&&(e.sessionToken&&P(x(e.sessionToken)),await r.refresh()),setTimeout(()=>{if(c){const t=decodeURIComponent(c);t.startsWith(k.WELLKNOWN_SERVICE_PATH_PREFIX)?g(t,{replace:!0}):window.location=t}else window.location=window.env.pathPrefix||"/"},50)});return s.loading?o.jsx(f,{}):o.jsx(C,{className:"page-invite",sx:{width:"100vw",height:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f6f8fa",overflow:"auto",padding:"20px"},children:o.jsx(R,{...n,action:"issue-passport",getDataFn:m,createPassportSvg:e=>I(e,l),checkFn:a.get,onLoginSuccess:w,passportColor:"default",onLogin:r.login})})}function W(){return d().loading?o.jsx(f,{}):o.jsx(S,{})}export{W as default};
1
+ import{u as d,j as o,C as f,z as h,aw as v,ci as j,cj as u,O as C,bk as I,ae as P,F as k}from"./index-DS1JU_-_.js";import{I as R}from"./invitation-BMg6rGzW.js";import"./index-C8pFKy9H.js";import"./index-B_u7mT5U.js";import"./CheckCircle-CpgwIoc6.js";import"./wrap-locale-b15Mq8e0.js";function S(n){const{searchParams:i}=new URL(window.location.href),g=h(),{api:a,session:r}=v(),{info:l}=d(),c=i.get("redirect"),p=i.get("id"),s=j(async()=>{if(!p)return null;const{data:e}=await a.get("/api/invitation",{params:{inviteId:p,mode:"issue-passport"}});return e}),m=u(()=>{if(s.error)throw s.error;return s==null?void 0:s.data}),w=u(async(e,x=t=>t)=>{e&&(e.sessionToken&&P(x(e.sessionToken)),await r.refresh()),setTimeout(()=>{if(c){const t=decodeURIComponent(c);t.startsWith(k.WELLKNOWN_SERVICE_PATH_PREFIX)?g(t,{replace:!0}):window.location=t}else window.location=window.env.pathPrefix||"/"},50)});return s.loading?o.jsx(f,{}):o.jsx(C,{className:"page-invite",sx:{width:"100vw",height:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f6f8fa",overflow:"auto",padding:"20px"},children:o.jsx(R,{...n,action:"issue-passport",getDataFn:m,createPassportSvg:e=>I(e,l),checkFn:a.get,onLoginSuccess:w,passportColor:"default",onLogin:r.login})})}function W(){return d().loading?o.jsx(f,{}):o.jsx(S,{})}export{W as default};
@@ -1,4 +1,4 @@
1
- import{aK as S,aL as D,j as e,bl as _,r as p,f as O,m as u,aX as U,aY as E,U as F,cd as V,B as $,C as k,bd as K,a7 as X,a8 as R,N as Y,ce as w,cf as A,cg as L,a9 as I,a6 as P,ax as T,a2 as M,O as G,at as H,n as J,P as i,o as Q,ch as W}from"./index-CAswdZkd.js";import{f as Z}from"./index-D9k2I5J1.js";import{P as ee}from"./Pagination-CJ7hCMrh.js";import"./LastPage-C4JcFXs5.js";var x={},te=D;Object.defineProperty(x,"__esModule",{value:!0});var g=x.default=void 0,ie=te(S()),ae=e;g=x.default=(0,ie.default)((0,ae.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");function h({api:a,paging:o,loading:c,notifications:s,updateNotifications:r,teamDid:j}){const{inService:d}=_(),[m,q]=p.useState(!0),[y,b]=p.useState(!1),{t:n,locale:N}=p.useContext(O),z=async()=>{b(!0);const t=s.filter(l=>l.read===!1).map(l=>l.id).join(",");d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r(),b(!1)},v=async t=>{d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r()},f=m?s:s.filter(t=>t.read===!1),B=s.filter(t=>t.read===!1).length>0,C=t=>e.jsxs("div",{className:"title",children:[t.title," ",e.jsx("span",{className:"time-ago",title:H(t.createdAt,N),children:Z(new Date(t.createdAt),Q(N))})]});return e.jsxs(se,{children:[e.jsxs(u,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[n("notification.title"),e.jsxs(u,{component:"span",className:"notification-actions",children:[e.jsx(U,{control:e.jsx(E,{checked:m,onChange:()=>q(!m),name:"showRead",color:"primary"}),label:n("notification.showRead")}),e.jsx(F,{permission:d?"":"mutate_notification",role:d?V:[],children:B&&e.jsxs($,{disabled:y,onClick:z,className:"",children:[y&&e.jsx(k,{size:16,style:{marginRight:"1em"}}),n("notification.markAllAsRead")]})})]})]}),e.jsx(K,{}),e.jsxs(X,{className:"notification-list",children:[c&&e.jsx(k,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),f.length===0&&e.jsx(u,{component:"p",variant:"body1",className:"notification-tip",children:n("notification.empty")}),f.length>0&&f.map(t=>t.action?e.jsxs(R,{component:Y,to:t.action,alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id):e.jsxs(R,{alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id))]}),!!f.length&&o.pageCount>1&&e.jsx(G,{mt:2,display:"flex",justifyContent:"flex-end",children:e.jsx(ee,{disabled:c,count:o.pageCount,page:o.page,onChange:(t,l)=>{r({page:l})}})})]})}const se=J.div`
1
+ import{aK as S,aL as D,j as e,bl as _,r as p,f as O,m as u,aX as U,aY as E,U as F,cd as V,B as $,C as k,bd as K,a7 as X,a8 as R,N as Y,ce as w,cf as A,cg as L,a9 as I,a6 as P,ax as T,a2 as M,O as G,at as H,n as J,P as i,o as Q,ch as W}from"./index-DS1JU_-_.js";import{f as Z}from"./index-D9k2I5J1.js";import{P as ee}from"./Pagination-Btpup9Q2.js";import"./LastPage-Cad46J9e.js";var x={},te=D;Object.defineProperty(x,"__esModule",{value:!0});var g=x.default=void 0,ie=te(S()),ae=e;g=x.default=(0,ie.default)((0,ae.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");function h({api:a,paging:o,loading:c,notifications:s,updateNotifications:r,teamDid:j}){const{inService:d}=_(),[m,q]=p.useState(!0),[y,b]=p.useState(!1),{t:n,locale:N}=p.useContext(O),z=async()=>{b(!0);const t=s.filter(l=>l.read===!1).map(l=>l.id).join(",");d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r(),b(!1)},v=async t=>{d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r()},f=m?s:s.filter(t=>t.read===!1),B=s.filter(t=>t.read===!1).length>0,C=t=>e.jsxs("div",{className:"title",children:[t.title," ",e.jsx("span",{className:"time-ago",title:H(t.createdAt,N),children:Z(new Date(t.createdAt),Q(N))})]});return e.jsxs(se,{children:[e.jsxs(u,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[n("notification.title"),e.jsxs(u,{component:"span",className:"notification-actions",children:[e.jsx(U,{control:e.jsx(E,{checked:m,onChange:()=>q(!m),name:"showRead",color:"primary"}),label:n("notification.showRead")}),e.jsx(F,{permission:d?"":"mutate_notification",role:d?V:[],children:B&&e.jsxs($,{disabled:y,onClick:z,className:"",children:[y&&e.jsx(k,{size:16,style:{marginRight:"1em"}}),n("notification.markAllAsRead")]})})]})]}),e.jsx(K,{}),e.jsxs(X,{className:"notification-list",children:[c&&e.jsx(k,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),f.length===0&&e.jsx(u,{component:"p",variant:"body1",className:"notification-tip",children:n("notification.empty")}),f.length>0&&f.map(t=>t.action?e.jsxs(R,{component:Y,to:t.action,alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id):e.jsxs(R,{alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id))]}),!!f.length&&o.pageCount>1&&e.jsx(G,{mt:2,display:"flex",justifyContent:"flex-end",children:e.jsx(ee,{disabled:c,count:o.pageCount,page:o.page,onChange:(t,l)=>{r({page:l})}})})]})}const se=J.div`
2
2
  min-height: 60vh;
3
3
 
4
4
  .page-header {
@@ -1,4 +1,4 @@
1
- import{n as $,P,r as w,f as ge,j as e,C as V,i as ke,u as me,q,t as je,v as ye,D as Ce,B as W,w as ve,m as L,x as Se,y as Be,z as de,A as z,E as we,d as Ae,F as De,H as Te,J as ee,K as Ee,M as T,N as te,O as y,Q as Ie,R as F,S as Le,U as Pe,V as Re}from"./index-CAswdZkd.js";import{_ as se}from"./useLocalStorage-C6lWDRq3.js";import{g as _e,D as Fe}from"./index-D3Lh5mWG.js";import{E as Ne}from"./index-BJly7w5W.js";import{u as $e,B as oe}from"./url-evaluation-DhK3EWMs.js";import{D as Ue,u as Me,B as ne}from"./actions-BqB5CLlu.js";import{l as le}from"./index-wYgdnkvk.js";import{W as Oe}from"./tag-DhW_Xw5i.js";import{I as We,B as ze}from"./install-from-url-D7PtGv0X.js";import{B as ae}from"./app-avatar-C4XusMwW.js";import{d as Ve}from"./Add-B0xbM7Le.js";import{S as E}from"./index-sL9uwgI4.js";import{T as re}from"./TextField-ujCYjYid.js";import{F as qe,S as Ke}from"./Select-DvwGvpRe.js";import"./FilterList-DxfB8aQ7.js";import"./Delete-sQJNb5lC.js";import"./InputLabel-EIEW8n2S.js";import"./LastPage-C4JcFXs5.js";import"./index-CfddNrs0.js";import"./redux-BkD59_OZ.js";import"./Search-K8V-qpJ2.js";import"./MoreVert-BajHOelZ.js";import"./ButtonGroup-CJKZEioi.js";import"./getValidReactChildren-1X43ZiNl.js";import"./isEqual-Da9udG4a.js";import"./index-CP2qVp-g.js";import"./Stepper-nGCToByw.js";function N({blocklet:g,skipAccessibilityCheck:c=!1,...p}){const{t:a}=w.useContext(ge),{urls:C,loading:o,recommendedUrl:m}=$e(g);if(o&&!c)return e.jsx(V,{size:12,...p});const x=c?C[0]:m;return x?e.jsx(He,{...p,children:e.jsx(Qe,{children:e.jsx(ke,{href:x,target:"_blank",className:"blocklet-interface",underline:"hover",children:a("common.open")})})}):a("blocklet.router.noAccessibleUrl")}const Qe=$.div`
1
+ import{n as $,P,r as w,f as ge,j as e,C as V,i as ke,u as me,q,t as je,v as ye,D as Ce,B as W,w as ve,m as L,x as Se,y as Be,z as de,A as z,E as we,d as Ae,F as De,H as Te,J as ee,K as Ee,M as T,N as te,O as y,Q as Ie,R as F,S as Le,U as Pe,V as Re}from"./index-DS1JU_-_.js";import{_ as se}from"./useLocalStorage-CcTbqaWM.js";import{g as _e,D as Fe}from"./index-DIuisRmH.js";import{E as Ne}from"./index-BSqmsUTI.js";import{u as $e,B as oe}from"./url-evaluation-DjVe9I2g.js";import{D as Ue,u as Me,B as ne}from"./actions-CYOQRhpw.js";import{l as le}from"./index-BOADFDIv.js";import{W as Oe}from"./tag-Cvwm2gDk.js";import{I as We,B as ze}from"./install-from-url-BsrxhAMw.js";import{B as ae}from"./app-avatar-BhPctNAT.js";import{d as Ve}from"./Add-i_eGmIkF.js";import{S as E}from"./index-zZFI1GlJ.js";import{T as re}from"./TextField-BPO9Hci-.js";import{F as qe,S as Ke}from"./Select-b09v8FPX.js";import"./FilterList-D84A-7C6.js";import"./Delete-KztH8pOq.js";import"./InputLabel-ERXbfftZ.js";import"./LastPage-Cad46J9e.js";import"./index-DitmQRsw.js";import"./redux-gonzvYQ4.js";import"./Search-uFerpv5L.js";import"./MoreVert-CWypNP8g.js";import"./ButtonGroup-G7oFneKA.js";import"./getValidReactChildren-7IUHA6fR.js";import"./isEqual-3iEl-twA.js";import"./index-BgG0evtj.js";import"./Stepper-WgjnG7-H.js";function N({blocklet:g,skipAccessibilityCheck:c=!1,...p}){const{t:a}=w.useContext(ge),{urls:C,loading:o,recommendedUrl:m}=$e(g);if(o&&!c)return e.jsx(V,{size:12,...p});const x=c?C[0]:m;return x?e.jsx(He,{...p,children:e.jsx(Qe,{children:e.jsx(ke,{href:x,target:"_blank",className:"blocklet-interface",underline:"hover",children:a("common.open")})})}):a("blocklet.router.noAccessibleUrl")}const Qe=$.div`
2
2
  display: flex;
3
3
  margin: 4px 0;
4
4
  `,He=$.div`
@@ -1,4 +1,4 @@
1
- import{u as z,j as n,r as d,L as X,P as g,f as V,l as b,O as m,m as E,d as Y,V as Z,C as ee,q as te,M as v,a as f,F as T,b as j,cV as re,G as y,A as L,p as ne,o as oe,z as se,bg as ie,n as ae}from"./index-CAswdZkd.js";import{T as me}from"./index-DdJbp08q.js";import le from"./traffic-CskMDMM9.js";import{D as ce}from"./index-D3Lh5mWG.js";import{B as ue}from"./app-avatar-C4XusMwW.js";import{B as de}from"./bundle-avatar-BAQeilKf.js";import{C as pe,M as S}from"./memory-CqWPgCw7.js";import{I as fe}from"./chart-BxnxKx2Z.js";import{w as ge}from"./withStyles-DqyyCsvW.js";import{_ as he}from"./useLocalStorage-C6lWDRq3.js";import{T as ve,a as ye}from"./ToggleButtonGroup-kyokF_8F.js";import"./Delete-sQJNb5lC.js";import"./iframe-CSlxNh-f.js";import"./ChevronLeft-CBJaHuZr.js";import"./ChevronRight-ftDGFcdo.js";import"./Select-DvwGvpRe.js";import"./TextField-ujCYjYid.js";import"./InputLabel-EIEW8n2S.js";import"./InputAdornment-BHI6-6Hp.js";import"./FilterList-DxfB8aQ7.js";import"./LastPage-C4JcFXs5.js";import"./index-CfddNrs0.js";import"./redux-BkD59_OZ.js";import"./Search-K8V-qpJ2.js";import"./index-BJly7w5W.js";import"./MoreVert-BajHOelZ.js";import"./getValidReactChildren-1X43ZiNl.js";function xe(){const{api:e,info:t}=z();return n.jsx(le,{client:e,did:t.did})}var M={};Object.defineProperty(M,"__esModule",{value:!0});var A=M.default=void 0;je(d);var C=n;function je(e){return e&&e.__esModule?e:{default:e}}function k(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),i.push.apply(i,a)}return i}function _(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?k(Object(i),!0).forEach(function(a){be(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function be(e,t,i){return t=Ie(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ie(e){var t=Ne(e,"string");return typeof t=="symbol"?t:String(t)}function Ne(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O=function(t){return(0,C.jsxs)("svg",_(_({},t),{},{children:[(0,C.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.083 3.2c0-.619.501-1.12 1.12-1.12h25.6c.619 0 1.12.501 1.12 1.12v10.24a1.12 1.12 0 0 1-1.12 1.12h-25.6a1.12 1.12 0 0 1-1.12-1.12V3.2zm2.24 1.12v8h23.36v-8H4.323zm-2.24 14.24c0-.619.501-1.12 1.12-1.12h25.6c.619 0 1.12.501 1.12 1.12V28.8a1.12 1.12 0 0 1-1.12 1.12h-25.6a1.12 1.12 0 0 1-1.12-1.12V18.56zm2.24 1.12v8h23.36v-8H4.323z",fill:"currentColor"}),(0,C.jsx)("path",{d:"M8.963 7.04h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64V7.68a.64.64 0 0 0-.64-.64zm0 15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64v-1.28a.64.64 0 0 0-.64-.64zm5.12-15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64V7.68a.64.64 0 0 0-.64-.64zm0 15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64v-1.28a.64.64 0 0 0-.64-.64z",fill:"currentColor"})]}))};O.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"};O.displayName="server";A=M.default=O;const Pe=ge(e=>({root:{height:10},colorPrimary:{backgroundColor:e.palette.grey[e.palette.mode==="light"?200:700]},bar:{backgroundColor:e.palette.secondary.main}}))(X);function H(e){const{value:t}=e;return n.jsxs(m,{display:"flex",alignItems:"center",mt:2,children:[n.jsx(m,{width:"100%",style:{overflow:"hidden"},mr:1,children:n.jsx(Pe,{variant:"determinate",...e})}),n.jsx(m,{minWidth:35,children:n.jsx(E,{variant:"body2",color:"textSecondary",children:`${Math.round(t)}%`})})]})}H.propTypes={value:g.number.isRequired};function R({disk:e}){const{t}=d.useContext(V),i=[{id:1,className:"used",title:t("system.used"),metric:b(e.used)},{id:2,className:"free",title:t("system.free"),metric:b(e.free)},{id:3,className:"total",title:t("system.total"),metric:b(e.total)}];return n.jsx(fe,{title:`${t("common.disk")} (${e.device})`,value:b(e.used),graph:n.jsx(m,{mt:3,children:n.jsx(H,{value:e.used/e.total*100})}),description:i.map((a,u)=>n.jsxs(m,{sx:{marginLeft:u===0?0:2},children:[a.title,": ",a.metric]},a.title))})}R.propTypes={disk:g.shape({used:g.number,free:g.number,total:g.number,device:g.string})};R.defaultProps={disk:{used:0,free:0,total:1,device:""}};const D={uptime:0,pid:-1,cpuUsage:0,memoryUsage:0},U="Blocklet Server";function $({initialBlocklets:e}){const{t,locale:i}=te(),{api:a}=z(),[u,I]=he("runtime-view-interval",6),x=d.useMemo(()=>{const r=[];return r.push({type:"server",groupId:"server",groupName:U,id:"server:daemon",name:"Server (Daemon)",runtimeInfo:D}),r.push({type:"server",groupId:"server",groupName:U,id:"server:service",name:"Server (Service)",runtimeInfo:D}),e.forEach(o=>{v.forEachBlockletSync(o,(s,{id:l,ancestors:c})=>{s.runtimeInfo&&r.push({type:"blocklet",groupId:o.meta.did,groupName:v.getDisplayName(o),id:l,name:v.getDisplayName(s,!0),blocklet:o,component:s,runtimeInfo:s.runtimeInfo,ancestors:c})})}),r},[]),[p,N]=d.useState(x),[h,F]=d.useState({os:{platform:""},mem:{used:0,free:0,total:1},cpu:{cpus:[],currentLoad:1},disks:[],daemon:{},service:{}}),[P,q]=d.useState({cpu:[],mem:[],daemonMem:[],serviceMem:[]});f(T.EVENTS.NODE_RUNTIME_INFO,r=>{r.mem.total=r.mem.total||0,r.mem.used=r.mem.total-(r.mem.available||0),F(r),N(o=>o.map(s=>s.id==="server:daemon"?{...s,runtimeInfo:{...s.runtimeInfo,...r.daemon}}:s.id==="server:service"?{...s,runtimeInfo:{...s.runtimeInfo,...r.service}}:s))}),f(T.EVENTS.BLOCKLETS_RUNTIME_INFO,r=>{if(!r||!r.length){console.error("incorrect blocklets runtime info format",r);return}N(o=>o.map(s=>{const l=r.find(c=>c.componentId===s.id);return l?{...s,runtimeInfo:{...s.runtimeInfo,...l.runtimeInfo}}:s}))});const w=r=>{N(o=>o.filter(s=>s.groupId!==r.meta.did))},B=async r=>{try{const{blocklet:o}=await a.getBlocklet({input:{did:r.meta.did,attachRuntimeInfo:!0}});o.status!=="running"&&w(o),N(s=>{const l=s.filter(c=>c.groupId!==o.meta.did);return v.forEachBlockletSync(o,(c,{id:J,ancestors:Q})=>{c.runtimeInfo&&l.push({type:"blocklet",groupId:o.meta.did,groupName:v.getDisplayName(o),id:J,name:v.getDisplayName(c,!0),blocklet:o,component:c,runtimeInfo:c.runtimeInfo,ancestors:Q})}),l})}catch(o){L.error(o.message)}};f(j.BlockletEvents.removed,w),f(j.BlockletEvents.startFailed,w),f(j.BlockletEvents.statusChange,r=>{if(r.status!=="running"){w(r);return}B(r)}),f(j.BlockletEvents.updated,B),f(j.BlockletEvents.started,B);const G=()=>{a.getNodeRuntimeHistory({input:{hours:u}}).then(r=>{const o=r.history||[];q({cpu:o.map(s=>({date:s.date,value:s.cpu})),mem:o.map(s=>({date:s.date,value:s.mem})),daemonMem:o.map(s=>({date:s.date,value:s.daemonMem})),serviceMem:o.map(s=>({date:s.date,value:s.serviceMem}))})}).catch(r=>{L.error(r.message)})};d.useEffect(()=>{G()},[u]);const W=r=>ne(Number(r||0),{locale:oe(i)}),K=[{label:t("common.group"),name:"groupName",options:{customBodyRenderLite(r){const{type:o,blocklet:s,groupName:l}=p[r];return o==="server"?n.jsxs(m,{display:"flex",alignItems:"center",children:[n.jsx(re,{width:"14",height:"14"}),n.jsx(m,{ml:1,children:l})]}):n.jsxs(m,{display:"flex",alignItems:"center",children:[n.jsx(ue,{size:14,blocklet:s}),n.jsx(m,{ml:1,children:l})]})}}},{label:t("common.name"),name:"name",options:{customBodyRenderLite(r){const{type:o,name:s,component:l,ancestors:c}=p[r];return o==="server"?n.jsxs(m,{display:"flex",alignItems:"center",children:[n.jsx(A,{width:"14",height:"14"}),n.jsx(m,{ml:1,children:s})]}):n.jsxs(m,{display:"flex",alignItems:"center",children:[n.jsx(de,{size:14,blocklet:l,ancestors:c}),n.jsx(m,{ml:1,children:s})]})}}},{label:t("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(r){const{runtimeInfo:o}=p[r];return W(o.uptime)}}},{label:t("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(r){const{runtimeInfo:o}=p[r];return b((o==null?void 0:o.memoryUsage)||0)},sortDirection:"asc"}},{label:t("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(r){const{runtimeInfo:o}=p[r];return`${(o.cpuUsage||0).toFixed(1)}%`}}},{label:t("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"},{label:t("blocklet.runtimeInfo.port"),name:"runtimeInfo.port"}];return n.jsxs("div",{children:[n.jsxs(m,{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2,children:[n.jsx(E,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},children:t("analytics.trend")}),n.jsx(ve,{size:"small",exclusive:!0,value:u,onChange:(r,o)=>I(o),children:[1,3,6,12,24].map(r=>n.jsxs(ye,{value:r,children:[r,"H"]},r))})]}),n.jsxs(y,{mb:4,container:!0,spacing:4,children:[n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(pe,{...h.cpu,history:P.cpu})},"cpu"),n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(S,{...h.mem,history:P.mem})},"memory"),n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(S,{title:`${t("common.memory")} (Daemon)`,used:h.daemon.memoryUsage||0,history:P.daemonMem})},"memory-daemon"),n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(S,{title:`${t("common.memory")} (Service)`,instanceCount:h.service.instanceCount||0,used:h.service.memoryUsage||0,history:P.serviceMem})},"memory-service"),h.disks.map(r=>n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(R,{disk:r})},"disk"))]}),n.jsx(ce,{className:"runtime-insight-list",title:t("analytics.detail"),locale:i,data:p,columns:K,options:{download:!1,filter:!1,print:!1,pagination:!1,rowsPerPage:100}})]})}$.propTypes={initialBlocklets:g.array.isRequired};function we(){const{data:e,externalData:t,initialized:i}=Y();if(!i)return n.jsx(Z,{relative:"parent",children:n.jsx(ee,{})});const a=[...e,...t];return n.jsx($,{initialBlocklets:a})}function et(){const e=se(),{t}=d.useContext(V),{tab:i="traffic"}=ie(),a=p=>{e(`/analytics/${p}`)},u=[{label:t("common.traffic"),value:"traffic"},{label:t("common.runtime"),value:"runtime"}],I={traffic:xe,runtime:we},x=I[i]||I.traffic;return n.jsxs(Be,{children:[n.jsx(E,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:t("common.analytics")}),n.jsx(me,{tabs:u,current:i,onChange:a}),n.jsx("div",{className:"page-content",children:d.isValidElement(x)?x:n.jsx(x,{})})]})}const Be=ae.main`
1
+ import{u as z,j as n,r as d,L as X,P as g,f as V,l as b,O as m,m as E,d as Y,V as Z,C as ee,q as te,M as v,a as f,F as T,b as j,cV as re,G as y,A as L,p as ne,o as oe,z as se,bg as ie,n as ae}from"./index-DS1JU_-_.js";import{T as me}from"./index-DxX4hb7b.js";import le from"./traffic-CQiojOw9.js";import{D as ce}from"./index-DIuisRmH.js";import{B as ue}from"./app-avatar-BhPctNAT.js";import{B as de}from"./bundle-avatar-CbU_wbB2.js";import{C as pe,M as S}from"./memory-CnY03W9t.js";import{I as fe}from"./chart-BUxn7CWp.js";import{w as ge}from"./withStyles-BiL7OyyA.js";import{_ as he}from"./useLocalStorage-CcTbqaWM.js";import{T as ve,a as ye}from"./ToggleButtonGroup-PBOhq3jx.js";import"./Delete-KztH8pOq.js";import"./iframe-n_w2gI30.js";import"./ChevronLeft-BqOWO5Oh.js";import"./ChevronRight-DDJkuJhV.js";import"./Select-b09v8FPX.js";import"./TextField-BPO9Hci-.js";import"./InputLabel-ERXbfftZ.js";import"./InputAdornment-CfEcRXzS.js";import"./FilterList-D84A-7C6.js";import"./LastPage-Cad46J9e.js";import"./index-DitmQRsw.js";import"./redux-gonzvYQ4.js";import"./Search-uFerpv5L.js";import"./index-BSqmsUTI.js";import"./MoreVert-CWypNP8g.js";import"./getValidReactChildren-7IUHA6fR.js";function xe(){const{api:e,info:t}=z();return n.jsx(le,{client:e,did:t.did})}var M={};Object.defineProperty(M,"__esModule",{value:!0});var A=M.default=void 0;je(d);var C=n;function je(e){return e&&e.__esModule?e:{default:e}}function k(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),i.push.apply(i,a)}return i}function _(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?k(Object(i),!0).forEach(function(a){be(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function be(e,t,i){return t=Ie(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ie(e){var t=Ne(e,"string");return typeof t=="symbol"?t:String(t)}function Ne(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O=function(t){return(0,C.jsxs)("svg",_(_({},t),{},{children:[(0,C.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.083 3.2c0-.619.501-1.12 1.12-1.12h25.6c.619 0 1.12.501 1.12 1.12v10.24a1.12 1.12 0 0 1-1.12 1.12h-25.6a1.12 1.12 0 0 1-1.12-1.12V3.2zm2.24 1.12v8h23.36v-8H4.323zm-2.24 14.24c0-.619.501-1.12 1.12-1.12h25.6c.619 0 1.12.501 1.12 1.12V28.8a1.12 1.12 0 0 1-1.12 1.12h-25.6a1.12 1.12 0 0 1-1.12-1.12V18.56zm2.24 1.12v8h23.36v-8H4.323z",fill:"currentColor"}),(0,C.jsx)("path",{d:"M8.963 7.04h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64V7.68a.64.64 0 0 0-.64-.64zm0 15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64v-1.28a.64.64 0 0 0-.64-.64zm5.12-15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64V7.68a.64.64 0 0 0-.64-.64zm0 15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64v-1.28a.64.64 0 0 0-.64-.64z",fill:"currentColor"})]}))};O.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"};O.displayName="server";A=M.default=O;const Pe=ge(e=>({root:{height:10},colorPrimary:{backgroundColor:e.palette.grey[e.palette.mode==="light"?200:700]},bar:{backgroundColor:e.palette.secondary.main}}))(X);function H(e){const{value:t}=e;return n.jsxs(m,{display:"flex",alignItems:"center",mt:2,children:[n.jsx(m,{width:"100%",style:{overflow:"hidden"},mr:1,children:n.jsx(Pe,{variant:"determinate",...e})}),n.jsx(m,{minWidth:35,children:n.jsx(E,{variant:"body2",color:"textSecondary",children:`${Math.round(t)}%`})})]})}H.propTypes={value:g.number.isRequired};function R({disk:e}){const{t}=d.useContext(V),i=[{id:1,className:"used",title:t("system.used"),metric:b(e.used)},{id:2,className:"free",title:t("system.free"),metric:b(e.free)},{id:3,className:"total",title:t("system.total"),metric:b(e.total)}];return n.jsx(fe,{title:`${t("common.disk")} (${e.device})`,value:b(e.used),graph:n.jsx(m,{mt:3,children:n.jsx(H,{value:e.used/e.total*100})}),description:i.map((a,u)=>n.jsxs(m,{sx:{marginLeft:u===0?0:2},children:[a.title,": ",a.metric]},a.title))})}R.propTypes={disk:g.shape({used:g.number,free:g.number,total:g.number,device:g.string})};R.defaultProps={disk:{used:0,free:0,total:1,device:""}};const D={uptime:0,pid:-1,cpuUsage:0,memoryUsage:0},U="Blocklet Server";function $({initialBlocklets:e}){const{t,locale:i}=te(),{api:a}=z(),[u,I]=he("runtime-view-interval",6),x=d.useMemo(()=>{const r=[];return r.push({type:"server",groupId:"server",groupName:U,id:"server:daemon",name:"Server (Daemon)",runtimeInfo:D}),r.push({type:"server",groupId:"server",groupName:U,id:"server:service",name:"Server (Service)",runtimeInfo:D}),e.forEach(o=>{v.forEachBlockletSync(o,(s,{id:l,ancestors:c})=>{s.runtimeInfo&&r.push({type:"blocklet",groupId:o.meta.did,groupName:v.getDisplayName(o),id:l,name:v.getDisplayName(s,!0),blocklet:o,component:s,runtimeInfo:s.runtimeInfo,ancestors:c})})}),r},[]),[p,N]=d.useState(x),[h,F]=d.useState({os:{platform:""},mem:{used:0,free:0,total:1},cpu:{cpus:[],currentLoad:1},disks:[],daemon:{},service:{}}),[P,q]=d.useState({cpu:[],mem:[],daemonMem:[],serviceMem:[]});f(T.EVENTS.NODE_RUNTIME_INFO,r=>{r.mem.total=r.mem.total||0,r.mem.used=r.mem.total-(r.mem.available||0),F(r),N(o=>o.map(s=>s.id==="server:daemon"?{...s,runtimeInfo:{...s.runtimeInfo,...r.daemon}}:s.id==="server:service"?{...s,runtimeInfo:{...s.runtimeInfo,...r.service}}:s))}),f(T.EVENTS.BLOCKLETS_RUNTIME_INFO,r=>{if(!r||!r.length){console.error("incorrect blocklets runtime info format",r);return}N(o=>o.map(s=>{const l=r.find(c=>c.componentId===s.id);return l?{...s,runtimeInfo:{...s.runtimeInfo,...l.runtimeInfo}}:s}))});const w=r=>{N(o=>o.filter(s=>s.groupId!==r.meta.did))},B=async r=>{try{const{blocklet:o}=await a.getBlocklet({input:{did:r.meta.did,attachRuntimeInfo:!0}});o.status!=="running"&&w(o),N(s=>{const l=s.filter(c=>c.groupId!==o.meta.did);return v.forEachBlockletSync(o,(c,{id:J,ancestors:Q})=>{c.runtimeInfo&&l.push({type:"blocklet",groupId:o.meta.did,groupName:v.getDisplayName(o),id:J,name:v.getDisplayName(c,!0),blocklet:o,component:c,runtimeInfo:c.runtimeInfo,ancestors:Q})}),l})}catch(o){L.error(o.message)}};f(j.BlockletEvents.removed,w),f(j.BlockletEvents.startFailed,w),f(j.BlockletEvents.statusChange,r=>{if(r.status!=="running"){w(r);return}B(r)}),f(j.BlockletEvents.updated,B),f(j.BlockletEvents.started,B);const G=()=>{a.getNodeRuntimeHistory({input:{hours:u}}).then(r=>{const o=r.history||[];q({cpu:o.map(s=>({date:s.date,value:s.cpu})),mem:o.map(s=>({date:s.date,value:s.mem})),daemonMem:o.map(s=>({date:s.date,value:s.daemonMem})),serviceMem:o.map(s=>({date:s.date,value:s.serviceMem}))})}).catch(r=>{L.error(r.message)})};d.useEffect(()=>{G()},[u]);const W=r=>ne(Number(r||0),{locale:oe(i)}),K=[{label:t("common.group"),name:"groupName",options:{customBodyRenderLite(r){const{type:o,blocklet:s,groupName:l}=p[r];return o==="server"?n.jsxs(m,{display:"flex",alignItems:"center",children:[n.jsx(re,{width:"14",height:"14"}),n.jsx(m,{ml:1,children:l})]}):n.jsxs(m,{display:"flex",alignItems:"center",children:[n.jsx(ue,{size:14,blocklet:s}),n.jsx(m,{ml:1,children:l})]})}}},{label:t("common.name"),name:"name",options:{customBodyRenderLite(r){const{type:o,name:s,component:l,ancestors:c}=p[r];return o==="server"?n.jsxs(m,{display:"flex",alignItems:"center",children:[n.jsx(A,{width:"14",height:"14"}),n.jsx(m,{ml:1,children:s})]}):n.jsxs(m,{display:"flex",alignItems:"center",children:[n.jsx(de,{size:14,blocklet:l,ancestors:c}),n.jsx(m,{ml:1,children:s})]})}}},{label:t("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(r){const{runtimeInfo:o}=p[r];return W(o.uptime)}}},{label:t("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(r){const{runtimeInfo:o}=p[r];return b((o==null?void 0:o.memoryUsage)||0)},sortDirection:"asc"}},{label:t("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(r){const{runtimeInfo:o}=p[r];return`${(o.cpuUsage||0).toFixed(1)}%`}}},{label:t("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"},{label:t("blocklet.runtimeInfo.port"),name:"runtimeInfo.port"}];return n.jsxs("div",{children:[n.jsxs(m,{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2,children:[n.jsx(E,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},children:t("analytics.trend")}),n.jsx(ve,{size:"small",exclusive:!0,value:u,onChange:(r,o)=>I(o),children:[1,3,6,12,24].map(r=>n.jsxs(ye,{value:r,children:[r,"H"]},r))})]}),n.jsxs(y,{mb:4,container:!0,spacing:4,children:[n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(pe,{...h.cpu,history:P.cpu})},"cpu"),n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(S,{...h.mem,history:P.mem})},"memory"),n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(S,{title:`${t("common.memory")} (Daemon)`,used:h.daemon.memoryUsage||0,history:P.daemonMem})},"memory-daemon"),n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(S,{title:`${t("common.memory")} (Service)`,instanceCount:h.service.instanceCount||0,used:h.service.memoryUsage||0,history:P.serviceMem})},"memory-service"),h.disks.map(r=>n.jsx(y,{item:!0,lg:3,md:6,sm:6,xs:12,children:n.jsx(R,{disk:r})},"disk"))]}),n.jsx(ce,{className:"runtime-insight-list",title:t("analytics.detail"),locale:i,data:p,columns:K,options:{download:!1,filter:!1,print:!1,pagination:!1,rowsPerPage:100}})]})}$.propTypes={initialBlocklets:g.array.isRequired};function we(){const{data:e,externalData:t,initialized:i}=Y();if(!i)return n.jsx(Z,{relative:"parent",children:n.jsx(ee,{})});const a=[...e,...t];return n.jsx($,{initialBlocklets:a})}function et(){const e=se(),{t}=d.useContext(V),{tab:i="traffic"}=ie(),a=p=>{e(`/analytics/${p}`)},u=[{label:t("common.traffic"),value:"traffic"},{label:t("common.runtime"),value:"runtime"}],I={traffic:xe,runtime:we},x=I[i]||I.traffic;return n.jsxs(Be,{children:[n.jsx(E,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:t("common.analytics")}),n.jsx(me,{tabs:u,current:i,onChange:a}),n.jsx("div",{className:"page-content",children:d.isValidElement(x)?x:n.jsx(x,{})})]})}const Be=ae.main`
2
2
  .page-header {
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -1,4 +1,4 @@
1
- import{r,S as u,j as e,dM as p,b4 as I,dN as b,dO as z,dP as O,P as o,dv as S,s as m,dQ as v}from"./index-CAswdZkd.js";import{B as E}from"./ButtonGroup-CJKZEioi.js";function d(s){const{size:f,color:a,menu:i,children:l,variant:h,onClick:x,menuButtonProps:y,...g}=s,[j,c]=r.useState(!1),t=r.useRef(null),P=Array.isArray(i)?i.map((n,M)=>r.isValidElement(n)?n:r.createElement(u,{...n,key:M})):i,k=()=>{c(n=>!n)},B=n=>{t.current&&t.current.contains(n.target)||c(!1)},C=n=>{n.target.closest(".MuiMenuItem-root")&&c(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(A,{variant:h,size:f,color:a,ref:t,...g,children:[typeof l=="function"?l():e.jsx(p,{onClick:x,color:a,children:l}),e.jsx(p,{onClick:k,color:a,...y,"aria-label":"more functions",children:e.jsx(I,{})})]}),e.jsx(L,{open:j,anchorEl:t.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(b,{children:e.jsx(z,{onClickAway:B,children:e.jsx(O,{onClick:C,children:P})})})})]})}d.propTypes={size:o.oneOf(["small","medium","large"]),color:o.oneOf(["primary","secondary","inherit"]),menu:o.oneOfType([o.node,o.array]),children:o.node,variant:o.oneOf(["outlined","contained"]),onClick:o.func,menuButtonProps:o.object};d.defaultProps={size:"medium",color:"primary",menu:[],children:null,variant:"contained",onClick:S,menuButtonProps:{}};d.Item=u;const A=m(E)`
1
+ import{r,S as u,j as e,dM as p,b4 as I,dN as b,dO as z,dP as O,P as o,dv as S,s as m,dQ as v}from"./index-DS1JU_-_.js";import{B as E}from"./ButtonGroup-G7oFneKA.js";function d(s){const{size:f,color:a,menu:i,children:l,variant:h,onClick:x,menuButtonProps:y,...g}=s,[j,c]=r.useState(!1),t=r.useRef(null),P=Array.isArray(i)?i.map((n,M)=>r.isValidElement(n)?n:r.createElement(u,{...n,key:M})):i,k=()=>{c(n=>!n)},B=n=>{t.current&&t.current.contains(n.target)||c(!1)},C=n=>{n.target.closest(".MuiMenuItem-root")&&c(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(A,{variant:h,size:f,color:a,ref:t,...g,children:[typeof l=="function"?l():e.jsx(p,{onClick:x,color:a,children:l}),e.jsx(p,{onClick:k,color:a,...y,"aria-label":"more functions",children:e.jsx(I,{})})]}),e.jsx(L,{open:j,anchorEl:t.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(b,{children:e.jsx(z,{onClickAway:B,children:e.jsx(O,{onClick:C,children:P})})})})]})}d.propTypes={size:o.oneOf(["small","medium","large"]),color:o.oneOf(["primary","secondary","inherit"]),menu:o.oneOfType([o.node,o.array]),children:o.node,variant:o.oneOf(["outlined","contained"]),onClick:o.func,menuButtonProps:o.object};d.defaultProps={size:"medium",color:"primary",menu:[],children:null,variant:"contained",onClick:S,menuButtonProps:{}};d.Item=u;const A=m(E)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;
@@ -1,3 +1,3 @@
1
- import{l as q}from"./lottie-x0vNNnqO.js";import{r as D,ba as z}from"./index-CAswdZkd.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,o,b=[],s=!0,A=!1;try{if(c=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);s=!0);}catch(g){A=!0,u=g}finally{try{if(!s&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{l as q}from"./lottie-GpNsBU3J.js";import{r as D,ba as z}from"./index-DS1JU_-_.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,o,b=[],s=!0,A=!1;try{if(c=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);s=!0);}catch(g){A=!0,u=g}finally{try{if(!s&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ae(t){var e=re(t,"string");return typeof e=="symbol"?e:String(e)}var ie=["animationData","loop","autoplay","initialSegment","onComplete","onLoopComplete","onEnterFrame","onSegmentStart","onConfigReady","onDataReady","onDataFailed","onLoadedImages","onDOMLoaded","onDestroy","lottieRef","renderer","name","assetsPath","rendererSettings"],oe=function(e,r){var n=e.animationData,u=e.loop,c=e.autoplay,o=e.initialSegment,b=e.onComplete,s=e.onLoopComplete,A=e.onEnterFrame,g=e.onSegmentStart,O=e.onConfigReady,w=e.onDataReady,h=e.onDataFailed,l=e.onLoadedImages,L=e.onDOMLoaded,S=e.onDestroy;e.lottieRef,e.renderer,e.name,e.assetsPath,e.rendererSettings;var p=x(e,ie),P=D.useState(!1),d=Z(P,2),C=d[0],I=d[1],i=D.useRef(),v=D.useRef(null),H=function(){var a;(a=i.current)===null||a===void 0||a.play()},M=function(){var a;(a=i.current)===null||a===void 0||a.stop()},F=function(){var a;(a=i.current)===null||a===void 0||a.pause()},V=function(a){var f;(f=i.current)===null||f===void 0||f.setSpeed(a)},N=function(a,f){var m;(m=i.current)===null||m===void 0||m.goToAndPlay(a,f)},B=function(a,f){var m;(m=i.current)===null||m===void 0||m.goToAndStop(a,f)},$=function(a){var f;(f=i.current)===null||f===void 0||f.setDirection(a)},k=function(a,f){var m;(m=i.current)===null||m===void 0||m.playSegments(a,f)},W=function(a){var f;(f=i.current)===null||f===void 0||f.setSubframe(a)},K=function(a){var f;return(f=i.current)===null||f===void 0?void 0:f.getDuration(a)},U=function(){var a;(a=i.current)===null||a===void 0||a.destroy(),i.current=void 0},X=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f;if(v.current){(f=i.current)===null||f===void 0||f.destroy();var m=T(T(T({},e),a),{},{container:v.current});return i.current=q.loadAnimation(m),I(!!i.current),function(){var R;(R=i.current)===null||R===void 0||R.destroy(),i.current=void 0}}};D.useEffect(function(){var y=X();return function(){return y==null?void 0:y()}},[n,u]),D.useEffect(function(){i.current&&(i.current.autoplay=!!c)},[c]),D.useEffect(function(){if(i.current){if(!o){i.current.resetSegments(!0);return}!Array.isArray(o)||!o.length||((i.current.currentRawFrame<o[0]||i.current.currentRawFrame>o[1])&&(i.current.currentRawFrame=o[0]),i.current.setSegment(o[0],o[1]))}},[o]),D.useEffect(function(){var y=[{name:"complete",handler:b},{name:"loopComplete",handler:s},{name:"enterFrame",handler:A},{name:"segmentStart",handler:g},{name:"config_ready",handler:O},{name:"data_ready",handler:w},{name:"data_failed",handler:h},{name:"loaded_images",handler:l},{name:"DOMLoaded",handler:L},{name:"destroy",handler:S}],a=y.filter(function(m){return m.handler!=null});if(a.length){var f=a.map(function(m){var R;return(R=i.current)===null||R===void 0||R.addEventListener(m.name,m.handler),function(){var _;(_=i.current)===null||_===void 0||_.removeEventListener(m.name,m.handler)}});return function(){f.forEach(function(m){return m()})}}},[b,s,A,g,O,w,h,l,L,S]);var Y=z.createElement("div",T({style:r,ref:v},p));return{View:Y,play:H,stop:M,pause:F,setSpeed:V,goToAndStop:B,goToAndPlay:N,setDirection:$,playSegments:k,setSubframe:W,getDuration:K,destroy:U,animationContainerRef:v,animationLoaded:C,animationItem:i.current}};function ue(t){var e=t.getBoundingClientRect(),r=e.top,n=e.height,u=window.innerHeight-r,c=window.innerHeight+n;return u/c}function le(t,e,r){var n=t.getBoundingClientRect(),u=n.top,c=n.left,o=n.width,b=n.height,s=(e-c)/o,A=(r-u)/b;return{x:s,y:A}}var se=function(e){var r=e.wrapperRef,n=e.animationItem,u=e.mode,c=e.actions;D.useEffect(function(){var o=r.current;if(!(!o||!n||!c.length)){n.stop();var b=function(){var g=null,O=function(){var h=ue(o),l=c.find(function(S){var p=S.visibility;return p&&h>=p[0]&&h<=p[1]});if(l){if(l.type==="seek"&&l.visibility&&l.frames.length===2){var L=l.frames[0]+Math.ceil((h-l.visibility[0])/(l.visibility[1]-l.visibility[0])*l.frames[1]);//! goToAndStop must be relative to the start of the current segment
3
3
  n.goToAndStop(L-n.firstFrame-1,!0)}l.type==="loop"&&(g===null||g!==l.frames||n.isPaused)&&(n.playSegments(l.frames,!0),g=l.frames),l.type==="play"&&n.isPaused&&(n.resetSegments(!0),n.play()),l.type==="stop"&&n.goToAndStop(l.frames[0]-n.firstFrame-1,!0)}};return document.addEventListener("scroll",O),function(){document.removeEventListener("scroll",O)}},s=function(){var g=function(l,L){var S=l,p=L;if(S!==-1&&p!==-1){var P=le(o,S,p);S=P.x,p=P.y}var d=c.find(function(i){var v=i.position;return v&&Array.isArray(v.x)&&Array.isArray(v.y)?S>=v.x[0]&&S<=v.x[1]&&p>=v.y[0]&&p<=v.y[1]:v&&!Number.isNaN(v.x)&&!Number.isNaN(v.y)?S===v.x&&p===v.y:!1});if(d){if(d.type==="seek"&&d.position&&Array.isArray(d.position.x)&&Array.isArray(d.position.y)&&d.frames.length===2){var C=(S-d.position.x[0])/(d.position.x[1]-d.position.x[0]),I=(p-d.position.y[0])/(d.position.y[1]-d.position.y[0]);n.playSegments(d.frames,!0),n.goToAndStop(Math.ceil((C+I)/2*(d.frames[1]-d.frames[0])),!0)}d.type==="loop"&&n.playSegments(d.frames,!0),d.type==="play"&&(n.isPaused&&n.resetSegments(!1),n.playSegments(d.frames)),d.type==="stop"&&n.goToAndStop(d.frames[0],!0)}},O=function(l){g(l.clientX,l.clientY)},w=function(){g(-1,-1)};return o.addEventListener("mousemove",O),o.addEventListener("mouseout",w),function(){o.removeEventListener("mousemove",O),o.removeEventListener("mouseout",w)}};switch(u){case"scroll":return b();case"cursor":return s()}}},[u,n])},de=function(e){var r=e.actions,n=e.mode,u=e.lottieObj,c=u.animationItem,o=u.View,b=u.animationContainerRef;return se({actions:r,animationItem:c,mode:n,wrapperRef:b}),o},fe=["style","interactivity"],ve=function(e){var r,n,u,c=e.style,o=e.interactivity,b=x(e,fe),s=oe(b,c),A=s.View,g=s.play,O=s.stop,w=s.pause,h=s.setSpeed,l=s.goToAndStop,L=s.goToAndPlay,S=s.setDirection,p=s.playSegments,P=s.setSubframe,d=s.getDuration,C=s.destroy,I=s.animationContainerRef,i=s.animationLoaded,v=s.animationItem;return D.useEffect(function(){e.lottieRef&&(e.lottieRef.current={play:g,stop:O,pause:w,setSpeed:h,goToAndPlay:L,goToAndStop:l,setDirection:S,playSegments:p,setSubframe:P,getDuration:d,destroy:C,animationContainerRef:I,animationLoaded:i,animationItem:v})},[(r=e.lottieRef)===null||r===void 0?void 0:r.current]),de({lottieObj:{View:A,play:g,stop:O,pause:w,setSpeed:h,goToAndStop:l,goToAndPlay:L,setDirection:S,playSegments:p,setSubframe:P,getDuration:d,destroy:C,animationContainerRef:I,animationLoaded:i,animationItem:v},actions:(n=o==null?void 0:o.actions)!==null&&n!==void 0?n:[],mode:(u=o==null?void 0:o.mode)!==null&&u!==void 0?u:"scroll"})};export{q as LottiePlayer,ve as default,oe as useLottie,de as useLottieInteractivity};
@@ -1 +1 @@
1
- import{ba as D}from"./index-CAswdZkd.js";var fe=e=>e.type==="checkbox",ie=e=>e instanceof Date,O=e=>e==null;const et=e=>typeof e=="object";var T=e=>!O(e)&&!Array.isArray(e)&&et(e)&&!ie(e),tt=e=>T(e)&&e.target?fe(e.target)?e.target.checked:e.target.value:e,At=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,rt=(e,s)=>e.has(At(s)),xt=e=>{const s=e.constructor&&e.constructor.prototype;return T(s)&&s.hasOwnProperty("isPrototypeOf")},Re=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function p(e){let s;const t=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Re&&(e instanceof Blob||e instanceof FileList))&&(t||T(e)))if(s=t?[]:{},!t&&!xt(e))s=e;else for(const u in e)e.hasOwnProperty(u)&&(s[u]=p(e[u]));else return e;return s}var ce=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>e===void 0,f=(e,s,t)=>{if(!s||!T(e))return t;const u=ce(s.split(/[,[\].]+?/)).reduce((n,a)=>O(n)?n:n[a],e);return w(u)||u===e?w(e[s])?t:e[s]:u},j=e=>typeof e=="boolean",Te=e=>/^\w*$/.test(e),st=e=>ce(e.replace(/["|']|\]/g,"").split(/\.|\[/)),x=(e,s,t)=>{let u=-1;const n=Te(s)?[s]:st(s),a=n.length,y=a-1;for(;++u<a;){const h=n[u];let m=t;if(u!==y){const S=e[h];m=T(S)||Array.isArray(S)?S:isNaN(+n[u+1])?{}:[]}if(h==="__proto__")return;e[h]=m,e=e[h]}return e};const _e={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},W={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},mt=D.createContext(null),Le=()=>D.useContext(mt);var it=(e,s,t,u=!0)=>{const n={defaultValues:s._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const y=a;return s._proxyFormState[y]!==W.all&&(s._proxyFormState[y]=!u||W.all),t&&(t[y]=!0),e[y]}});return n},B=e=>T(e)&&!Object.keys(e).length,ut=(e,s,t,u)=>{t(e);const{name:n,...a}=e;return B(a)||Object.keys(a).length>=Object.keys(s).length||Object.keys(a).find(y=>s[y]===(!u||W.all))},he=e=>Array.isArray(e)?e:[e],lt=(e,s,t)=>!e||!s||e===s||he(e).some(u=>u&&(t?u===s:u.startsWith(s)||s.startsWith(u)));function Ue(e){const s=D.useRef(e);s.current=e,D.useEffect(()=>{const t=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}function Dt(e){const s=Le(),{control:t=s.control,disabled:u,name:n,exact:a}=e||{},[y,h]=D.useState(t._formState),m=D.useRef(!0),S=D.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),_=D.useRef(n);return _.current=n,Ue({disabled:u,next:v=>m.current&&lt(_.current,v.name,a)&&ut(v,S.current,t._updateFormState)&&h({...t._formState,...v}),subject:t._subjects.state}),D.useEffect(()=>(m.current=!0,S.current.isValid&&t._updateValid(!0),()=>{m.current=!1}),[t]),it(y,t,S.current,!1)}var $=e=>typeof e=="string",at=(e,s,t,u,n)=>$(e)?(u&&s.watch.add(e),f(t,e,n)):Array.isArray(e)?e.map(a=>(u&&s.watch.add(a),f(t,a))):(u&&(s.watchAll=!0),t);function wt(e){const s=Le(),{control:t=s.control,name:u,defaultValue:n,disabled:a,exact:y}=e||{},h=D.useRef(u);h.current=u,Ue({disabled:a,subject:t._subjects.values,next:_=>{lt(h.current,_.name,y)&&S(p(at(h.current,t._names,_.values||t._formValues,!1,n)))}});const[m,S]=D.useState(t._getWatch(u,n));return D.useEffect(()=>t._removeUnmounted()),m}function Et(e){const s=Le(),{name:t,disabled:u,control:n=s.control,shouldUnregister:a}=e,y=rt(n._names.array,t),h=wt({control:n,name:t,defaultValue:f(n._formValues,t,f(n._defaultValues,t,e.defaultValue)),exact:!0}),m=Dt({control:n,name:t}),S=D.useRef(n.register(t,{...e.rules,value:h,...j(e.disabled)?{disabled:e.disabled}:{}}));return D.useEffect(()=>{const _=n._options.shouldUnregister||a,v=(N,H)=>{const L=f(n._fields,N);L&&L._f&&(L._f.mount=H)};if(v(t,!0),_){const N=p(f(n._options.defaultValues,t));x(n._defaultValues,t,N),w(f(n._formValues,t))&&x(n._formValues,t,N)}return()=>{(y?_&&!n._state.action:_)?n.unregister(t):v(t,!1)}},[t,n,y,a]),D.useEffect(()=>{f(n._fields,t)&&n._updateDisabledField({disabled:u,fields:n._fields,name:t,value:f(n._fields,t)._f.value})},[u,t,n]),{field:{name:t,value:h,...j(u)||m.disabled?{disabled:m.disabled||u}:{},onChange:D.useCallback(_=>S.current.onChange({target:{value:tt(_),name:t},type:_e.CHANGE}),[t]),onBlur:D.useCallback(()=>S.current.onBlur({target:{value:f(n._formValues,t),name:t},type:_e.BLUR}),[t,n]),ref:_=>{const v=f(n._fields,t);v&&_&&(v._f.ref={focus:()=>_.focus(),select:()=>_.select(),setCustomValidity:N=>_.setCustomValidity(N),reportValidity:()=>_.reportValidity()})}},formState:m,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!f(m.errors,t)},isDirty:{enumerable:!0,get:()=>!!f(m.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!f(m.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!f(m.validatingFields,t)},error:{enumerable:!0,get:()=>f(m.errors,t)}})}}const Wt=e=>e.render(Et(e));var St=(e,s,t,u,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[u]:n||!0}}:{},Ke=e=>({isOnSubmit:!e||e===W.onSubmit,isOnBlur:e===W.onBlur,isOnChange:e===W.onChange,isOnAll:e===W.all,isOnTouch:e===W.onTouched}),Ge=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(u=>e.startsWith(u)&&/^\.\w+/.test(e.slice(u.length))));const oe=(e,s,t,u)=>{for(const n of t||Object.keys(e)){const a=f(e,n);if(a){const{_f:y,...h}=a;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!u)break;if(y.ref&&s(y.ref,y.name)&&!u)break;oe(h,s)}else T(h)&&oe(h,s)}}};var kt=(e,s,t)=>{const u=ce(f(e,t));return x(u,"root",s[t]),x(e,t,u),e},Oe=e=>e.type==="file",X=e=>typeof e=="function",be=e=>{if(!Re)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},ve=e=>$(e),pe=e=>e.type==="radio",Ve=e=>e instanceof RegExp;const ze={value:!1,isValid:!1},Je={value:!0,isValid:!0};var nt=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===""?Je:{value:e[0].value,isValid:!0}:Je:ze}return ze};const Qe={isValid:!1,value:null};var ot=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Qe):Qe;function Xe(e,s,t="validate"){if(ve(e)||Array.isArray(e)&&e.every(ve)||j(e)&&!e)return{type:t,message:ve(e)?e:"",ref:s}}var se=e=>T(e)&&!Ve(e)?e:{value:e,message:""},Ye=async(e,s,t,u,n)=>{const{ref:a,refs:y,required:h,maxLength:m,minLength:S,min:_,max:v,pattern:N,validate:H,name:L,valueAsNumber:xe,mount:J,disabled:Q}=e._f,V=f(s,L);if(!J||Q)return{};const K=y?y[0]:a,G=b=>{u&&K.reportValidity&&(K.setCustomValidity(j(b)?"":b||""),K.reportValidity())},k={},ee=pe(a),de=fe(a),Y=ee||de,te=(xe||Oe(a))&&w(a.value)&&w(V)||be(a)&&a.value===""||V===""||Array.isArray(V)&&!V.length,P=St.bind(null,L,t,k),ye=(b,F,C,U=z.maxLength,q=z.minLength)=>{const I=b?F:C;k[L]={type:b?U:q,message:I,ref:a,...P(b?U:q,I)}};if(n?!Array.isArray(V)||!V.length:h&&(!Y&&(te||O(V))||j(V)&&!V||de&&!nt(y).isValid||ee&&!ot(y).isValid)){const{value:b,message:F}=ve(h)?{value:!!h,message:h}:se(h);if(b&&(k[L]={type:z.required,message:F,ref:K,...P(z.required,F)},!t))return G(F),k}if(!te&&(!O(_)||!O(v))){let b,F;const C=se(v),U=se(_);if(!O(V)&&!isNaN(V)){const q=a.valueAsNumber||V&&+V;O(C.value)||(b=q>C.value),O(U.value)||(F=q<U.value)}else{const q=a.valueAsDate||new Date(V),I=ae=>new Date(new Date().toDateString()+" "+ae),ue=a.type=="time",le=a.type=="week";$(C.value)&&V&&(b=ue?I(V)>I(C.value):le?V>C.value:q>new Date(C.value)),$(U.value)&&V&&(F=ue?I(V)<I(U.value):le?V<U.value:q<new Date(U.value))}if((b||F)&&(ye(!!b,C.message,U.message,z.max,z.min),!t))return G(k[L].message),k}if((m||S)&&!te&&($(V)||n&&Array.isArray(V))){const b=se(m),F=se(S),C=!O(b.value)&&V.length>+b.value,U=!O(F.value)&&V.length<+F.value;if((C||U)&&(ye(C,b.message,F.message),!t))return G(k[L].message),k}if(N&&!te&&$(V)){const{value:b,message:F}=se(N);if(Ve(b)&&!V.match(b)&&(k[L]={type:z.pattern,message:F,ref:a,...P(z.pattern,F)},!t))return G(F),k}if(H){if(X(H)){const b=await H(V,s),F=Xe(b,K);if(F&&(k[L]={...F,...P(z.validate,F.message)},!t))return G(F.message),k}else if(T(H)){let b={};for(const F in H){if(!B(b)&&!t)break;const C=Xe(await H[F](V,s),K,F);C&&(b={...C,...P(F,C.message)},G(C.message),t&&(k[L]=b))}if(!B(b)&&(k[L]={ref:K,...b},!t))return k}}return G(!0),k};function Ct(e,s){const t=s.slice(0,-1).length;let u=0;for(;u<t;)e=w(e)?u++:e[s[u++]];return e}function Rt(e){for(const s in e)if(e.hasOwnProperty(s)&&!w(e[s]))return!1;return!0}function R(e,s){const t=Array.isArray(s)?s:Te(s)?[s]:st(s),u=t.length===1?e:Ct(e,t),n=t.length-1,a=t[n];return u&&delete u[a],n!==0&&(T(u)&&B(u)||Array.isArray(u)&&Rt(u))&&R(e,t.slice(0,-1)),e}var Se=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}},Fe=e=>O(e)||!et(e);function Z(e,s){if(Fe(e)||Fe(s))return e===s;if(ie(e)&&ie(s))return e.getTime()===s.getTime();const t=Object.keys(e),u=Object.keys(s);if(t.length!==u.length)return!1;for(const n of t){const a=e[n];if(!u.includes(n))return!1;if(n!=="ref"){const y=s[n];if(ie(a)&&ie(y)||T(a)&&T(y)||Array.isArray(a)&&Array.isArray(y)?!Z(a,y):a!==y)return!1}}return!0}var ft=e=>e.type==="select-multiple",Tt=e=>pe(e)||fe(e),ke=e=>be(e)&&e.isConnected,ct=e=>{for(const s in e)if(X(e[s]))return!0;return!1};function Ae(e,s={}){const t=Array.isArray(e);if(T(e)||t)for(const u in e)Array.isArray(e[u])||T(e[u])&&!ct(e[u])?(s[u]=Array.isArray(e[u])?[]:{},Ae(e[u],s[u])):O(e[u])||(s[u]=!0);return s}function dt(e,s,t){const u=Array.isArray(e);if(T(e)||u)for(const n in e)Array.isArray(e[n])||T(e[n])&&!ct(e[n])?w(s)||Fe(t[n])?t[n]=Array.isArray(e[n])?Ae(e[n],[]):{...Ae(e[n])}:dt(e[n],O(s)?{}:s[n],t[n]):t[n]=!Z(e[n],s[n]);return t}var ge=(e,s)=>dt(e,s,Ae(s)),yt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:u})=>w(e)?e:s?e===""?NaN:e&&+e:t&&$(e)?new Date(e):u?u(e):e;function Ce(e){const s=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):s.disabled))return Oe(s)?s.files:pe(s)?ot(e.refs).value:ft(s)?[...s.selectedOptions].map(({value:t})=>t):fe(s)?nt(e.refs).value:yt(w(s.value)?e.ref.value:s.value,e)}var Lt=(e,s,t,u)=>{const n={};for(const a of e){const y=f(s,a);y&&x(n,a,y._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:u}},ne=e=>w(e)?e:Ve(e)?e.source:T(e)?Ve(e.value)?e.value.source:e.value:e,Ut=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ze(e,s,t){const u=f(e,t);if(u||Te(t))return{error:u,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),y=f(s,a),h=f(e,a);if(y&&!Array.isArray(y)&&t!==a)return{name:t};if(h&&h.type)return{name:a,error:h};n.pop()}return{name:t}}var Ot=(e,s,t,u,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?u.isOnBlur:n.isOnBlur)?!e:(t?u.isOnChange:n.isOnChange)?e:!0,pt=(e,s)=>!ce(f(e,s)).length&&R(e,s);const Mt={mode:W.onSubmit,reValidateMode:W.onChange,shouldFocusError:!0};function Bt(e={}){let s={...Mt,...e},t={submitCount:0,isDirty:!1,isLoading:X(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},u={},n=T(s.defaultValues)||T(s.values)?p(s.defaultValues||s.values)||{}:{},a=s.shouldUnregister?{}:p(n),y={action:!1,mount:!1,watch:!1},h={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m,S=0;const _={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:Se(),array:Se(),state:Se()},N=Ke(s.mode),H=Ke(s.reValidateMode),L=s.criteriaMode===W.all,xe=r=>i=>{clearTimeout(S),S=setTimeout(r,i)},J=async r=>{if(_.isValid||r){const i=s.resolver?B((await Y()).errors):await P(u,!0);i!==t.isValid&&v.state.next({isValid:i})}},Q=(r,i)=>{(_.isValidating||_.validatingFields)&&((r||Array.from(h.mount)).forEach(l=>{l&&(i?x(t.validatingFields,l,i):R(t.validatingFields,l))}),v.state.next({validatingFields:t.validatingFields,isValidating:!B(t.validatingFields)}))},V=(r,i=[],l,d,c=!0,o=!0)=>{if(d&&l){if(y.action=!0,o&&Array.isArray(f(u,r))){const g=l(f(u,r),d.argA,d.argB);c&&x(u,r,g)}if(o&&Array.isArray(f(t.errors,r))){const g=l(f(t.errors,r),d.argA,d.argB);c&&x(t.errors,r,g),pt(t.errors,r)}if(_.touchedFields&&o&&Array.isArray(f(t.touchedFields,r))){const g=l(f(t.touchedFields,r),d.argA,d.argB);c&&x(t.touchedFields,r,g)}_.dirtyFields&&(t.dirtyFields=ge(n,a)),v.state.next({name:r,isDirty:b(r,i),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else x(a,r,i)},K=(r,i)=>{x(t.errors,r,i),v.state.next({errors:t.errors})},G=r=>{t.errors=r,v.state.next({errors:t.errors,isValid:!1})},k=(r,i,l,d)=>{const c=f(u,r);if(c){const o=f(a,r,w(l)?f(n,r):l);w(o)||d&&d.defaultChecked||i?x(a,r,i?o:Ce(c._f)):U(r,o),y.mount&&J()}},ee=(r,i,l,d,c)=>{let o=!1,g=!1;const A={name:r},E=!!(f(u,r)&&f(u,r)._f&&f(u,r)._f.disabled);if(!l||d){_.isDirty&&(g=t.isDirty,t.isDirty=A.isDirty=b(),o=g!==A.isDirty);const M=E||Z(f(n,r),i);g=!!(!E&&f(t.dirtyFields,r)),M||E?R(t.dirtyFields,r):x(t.dirtyFields,r,!0),A.dirtyFields=t.dirtyFields,o=o||_.dirtyFields&&g!==!M}if(l){const M=f(t.touchedFields,r);M||(x(t.touchedFields,r,l),A.touchedFields=t.touchedFields,o=o||_.touchedFields&&M!==l)}return o&&c&&v.state.next(A),o?A:{}},de=(r,i,l,d)=>{const c=f(t.errors,r),o=_.isValid&&j(i)&&t.isValid!==i;if(e.delayError&&l?(m=xe(()=>K(r,l)),m(e.delayError)):(clearTimeout(S),m=null,l?x(t.errors,r,l):R(t.errors,r)),(l?!Z(c,l):c)||!B(d)||o){const g={...d,...o&&j(i)?{isValid:i}:{},errors:t.errors,name:r};t={...t,...g},v.state.next(g)}},Y=async r=>{Q(r,!0);const i=await s.resolver(a,s.context,Lt(r||h.mount,u,s.criteriaMode,s.shouldUseNativeValidation));return Q(r),i},te=async r=>{const{errors:i}=await Y(r);if(r)for(const l of r){const d=f(i,l);d?x(t.errors,l,d):R(t.errors,l)}else t.errors=i;return i},P=async(r,i,l={valid:!0})=>{for(const d in r){const c=r[d];if(c){const{_f:o,...g}=c;if(o){const A=h.array.has(o.name);Q([d],!0);const E=await Ye(c,a,L,s.shouldUseNativeValidation&&!i,A);if(Q([d]),E[o.name]&&(l.valid=!1,i))break;!i&&(f(E,o.name)?A?kt(t.errors,E,o.name):x(t.errors,o.name,E[o.name]):R(t.errors,o.name))}g&&await P(g,i,l)}}return l.valid},ye=()=>{for(const r of h.unMount){const i=f(u,r);i&&(i._f.refs?i._f.refs.every(l=>!ke(l)):!ke(i._f.ref))&&me(r)}h.unMount=new Set},b=(r,i)=>(r&&i&&x(a,r,i),!Z(Me(),n)),F=(r,i,l)=>at(r,h,{...y.mount?a:w(i)?n:$(r)?{[r]:i}:i},l,i),C=r=>ce(f(y.mount?a:n,r,e.shouldUnregister?f(n,r,[]):[])),U=(r,i,l={})=>{const d=f(u,r);let c=i;if(d){const o=d._f;o&&(!o.disabled&&x(a,r,yt(i,o)),c=be(o.ref)&&O(i)?"":i,ft(o.ref)?[...o.ref.options].forEach(g=>g.selected=c.includes(g.value)):o.refs?fe(o.ref)?o.refs.length>1?o.refs.forEach(g=>(!g.defaultChecked||!g.disabled)&&(g.checked=Array.isArray(c)?!!c.find(A=>A===g.value):c===g.value)):o.refs[0]&&(o.refs[0].checked=!!c):o.refs.forEach(g=>g.checked=g.value===c):Oe(o.ref)?o.ref.value="":(o.ref.value=c,o.ref.type||v.values.next({name:r,values:{...a}})))}(l.shouldDirty||l.shouldTouch)&&ee(r,c,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ae(r)},q=(r,i,l)=>{for(const d in i){const c=i[d],o=`${r}.${d}`,g=f(u,o);(h.array.has(r)||!Fe(c)||g&&!g._f)&&!ie(c)?q(o,c,l):U(o,c,l)}},I=(r,i,l={})=>{const d=f(u,r),c=h.array.has(r),o=p(i);x(a,r,o),c?(v.array.next({name:r,values:{...a}}),(_.isDirty||_.dirtyFields)&&l.shouldDirty&&v.state.next({name:r,dirtyFields:ge(n,a),isDirty:b(r,o)})):d&&!d._f&&!O(o)?q(r,o,l):U(r,o,l),Ge(r,h)&&v.state.next({...t}),v.values.next({name:y.mount?r:void 0,values:{...a}})},ue=async r=>{y.mount=!0;const i=r.target;let l=i.name,d=!0;const c=f(u,l),o=()=>i.type?Ce(c._f):tt(r),g=A=>{d=Number.isNaN(A)||A===f(a,l,A)};if(c){let A,E;const M=o(),re=r.type===_e.BLUR||r.type===_e.FOCUS_OUT,bt=!Ut(c._f)&&!s.resolver&&!f(t.errors,l)&&!c._f.deps||Ot(re,f(t.touchedFields,l),t.isSubmitted,H,N),we=Ge(l,h,re);x(a,l,M),re?(c._f.onBlur&&c._f.onBlur(r),m&&m(0)):c._f.onChange&&c._f.onChange(r);const Ee=ee(l,M,re,!1),Vt=!B(Ee)||we;if(!re&&v.values.next({name:l,type:r.type,values:{...a}}),bt)return _.isValid&&J(),Vt&&v.state.next({name:l,...we?{}:Ee});if(!re&&we&&v.state.next({...t}),s.resolver){const{errors:je}=await Y([l]);if(g(M),d){const Ft=Ze(t.errors,u,l),$e=Ze(je,u,Ft.name||l);A=$e.error,l=$e.name,E=B(je)}}else Q([l],!0),A=(await Ye(c,a,L,s.shouldUseNativeValidation))[l],Q([l]),g(M),d&&(A?E=!1:_.isValid&&(E=await P(u,!0)));d&&(c._f.deps&&ae(c._f.deps),de(l,E,A,Ee))}},le=(r,i)=>{if(f(t.errors,i)&&r.focus)return r.focus(),1},ae=async(r,i={})=>{let l,d;const c=he(r);if(s.resolver){const o=await te(w(r)?r:c);l=B(o),d=r?!c.some(g=>f(o,g)):l}else r?(d=(await Promise.all(c.map(async o=>{const g=f(u,o);return await P(g&&g._f?{[o]:g}:g)}))).every(Boolean),!(!d&&!t.isValid)&&J()):d=l=await P(u);return v.state.next({...!$(r)||_.isValid&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),i.shouldFocus&&!d&&oe(u,le,r?c:h.mount),d},Me=r=>{const i={...y.mount?a:n};return w(r)?i:$(r)?f(i,r):r.map(l=>f(i,l))},Be=(r,i)=>({invalid:!!f((i||t).errors,r),isDirty:!!f((i||t).dirtyFields,r),error:f((i||t).errors,r),isValidating:!!f(t.validatingFields,r),isTouched:!!f((i||t).touchedFields,r)}),gt=r=>{r&&he(r).forEach(i=>R(t.errors,i)),v.state.next({errors:r?t.errors:{}})},Pe=(r,i,l)=>{const d=(f(u,r,{_f:{}})._f||{}).ref,c=f(t.errors,r)||{},{ref:o,message:g,type:A,...E}=c;x(t.errors,r,{...E,...i,ref:d}),v.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&d&&d.focus&&d.focus()},ht=(r,i)=>X(r)?v.values.subscribe({next:l=>r(F(void 0,i),l)}):F(r,i,!0),me=(r,i={})=>{for(const l of r?he(r):h.mount)h.mount.delete(l),h.array.delete(l),i.keepValue||(R(u,l),R(a,l)),!i.keepError&&R(t.errors,l),!i.keepDirty&&R(t.dirtyFields,l),!i.keepTouched&&R(t.touchedFields,l),!i.keepIsValidating&&R(t.validatingFields,l),!s.shouldUnregister&&!i.keepDefaultValue&&R(n,l);v.values.next({values:{...a}}),v.state.next({...t,...i.keepDirty?{isDirty:b()}:{}}),!i.keepIsValid&&J()},Ie=({disabled:r,name:i,field:l,fields:d,value:c})=>{if(j(r)&&y.mount||r){const o=r?void 0:w(c)?Ce(l?l._f:f(d,i)._f):c;x(a,i,o),ee(i,o,!1,!1,!0)}},De=(r,i={})=>{let l=f(u,r);const d=j(i.disabled);return x(u,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...i}}),h.mount.add(r),l?Ie({field:l,disabled:i.disabled,name:r,value:i.value}):k(r,!0,i.value),{...d?{disabled:i.disabled}:{},...s.progressive?{required:!!i.required,min:ne(i.min),max:ne(i.max),minLength:ne(i.minLength),maxLength:ne(i.maxLength),pattern:ne(i.pattern)}:{},name:r,onChange:ue,onBlur:ue,ref:c=>{if(c){De(r,i),l=f(u,r);const o=w(c.value)&&c.querySelectorAll&&c.querySelectorAll("input,select,textarea")[0]||c,g=Tt(o),A=l._f.refs||[];if(g?A.find(E=>E===o):o===l._f.ref)return;x(u,r,{_f:{...l._f,...g?{refs:[...A.filter(ke),o,...Array.isArray(f(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),k(r,!1,void 0,o)}else l=f(u,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||i.shouldUnregister)&&!(rt(h.array,r)&&y.action)&&h.unMount.add(r)}}},Ne=()=>s.shouldFocusError&&oe(u,le,h.mount),vt=r=>{j(r)&&(v.state.next({disabled:r}),oe(u,(i,l)=>{const d=f(u,l);d&&(i.disabled=d._f.disabled||r,Array.isArray(d._f.refs)&&d._f.refs.forEach(c=>{c.disabled=d._f.disabled||r}))},0,!1))},qe=(r,i)=>async l=>{let d;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let c=p(a);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:g}=await Y();t.errors=o,c=g}else await P(u);if(R(t.errors,"root"),B(t.errors)){v.state.next({errors:{}});try{await r(c,l)}catch(o){d=o}}else i&&await i({...t.errors},l),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:B(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d},_t=(r,i={})=>{f(u,r)&&(w(i.defaultValue)?I(r,p(f(n,r))):(I(r,i.defaultValue),x(n,r,p(i.defaultValue))),i.keepTouched||R(t.touchedFields,r),i.keepDirty||(R(t.dirtyFields,r),t.isDirty=i.defaultValue?b(r,p(f(n,r))):b()),i.keepError||(R(t.errors,r),_.isValid&&J()),v.state.next({...t}))},We=(r,i={})=>{const l=r?p(r):n,d=p(l),c=B(r),o=c?n:d;if(i.keepDefaultValues||(n=l),!i.keepValues){if(i.keepDirtyValues)for(const g of h.mount)f(t.dirtyFields,g)?x(o,g,f(a,g)):I(g,f(o,g));else{if(Re&&w(r))for(const g of h.mount){const A=f(u,g);if(A&&A._f){const E=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(be(E)){const M=E.closest("form");if(M){M.reset();break}}}}u={}}a=e.shouldUnregister?i.keepDefaultValues?p(n):{}:p(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}h={mount:i.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!_.isValid||!!i.keepIsValid||!!i.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:i.keepSubmitCount?t.submitCount:0,isDirty:c?!1:i.keepDirty?t.isDirty:!!(i.keepDefaultValues&&!Z(r,n)),isSubmitted:i.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:c?[]:i.keepDirtyValues?i.keepDefaultValues&&a?ge(n,a):t.dirtyFields:i.keepDefaultValues&&r?ge(n,r):i.keepDirty?t.dirtyFields:{},touchedFields:i.keepTouched?t.touchedFields:{},errors:i.keepErrors?t.errors:{},isSubmitSuccessful:i.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},He=(r,i)=>We(X(r)?r(a):r,i);return{control:{register:De,unregister:me,getFieldState:Be,handleSubmit:qe,setError:Pe,_executeSchema:Y,_getWatch:F,_getDirty:b,_updateValid:J,_removeUnmounted:ye,_updateFieldArray:V,_updateDisabledField:Ie,_getFieldArray:C,_reset:We,_resetDefaultValues:()=>X(s.defaultValues)&&s.defaultValues().then(r=>{He(r,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:r=>{t={...t,...r}},_disableForm:vt,_subjects:v,_proxyFormState:_,_setErrors:G,get _fields(){return u},get _formValues(){return a},get _state(){return y},set _state(r){y=r},get _defaultValues(){return n},get _names(){return h},set _names(r){h=r},get _formState(){return t},set _formState(r){t=r},get _options(){return s},set _options(r){s={...s,...r}}},trigger:ae,register:De,handleSubmit:qe,watch:ht,setValue:I,getValues:Me,reset:He,resetField:_t,clearErrors:gt,unregister:me,setError:Pe,setFocus:(r,i={})=>{const l=f(u,r),d=l&&l._f;if(d){const c=d.refs?d.refs[0]:d.ref;c.focus&&(c.focus(),i.shouldSelect&&c.select())}},getFieldState:Be}}function Ht(e={}){const s=D.useRef(),t=D.useRef(),[u,n]=D.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...Bt(e),formState:u});const a=s.current.control;return a._options=e,Ue({subject:a._subjects.state,next:y=>{ut(y,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),D.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),D.useEffect(()=>{if(a._proxyFormState.isDirty){const y=a._getDirty();y!==u.isDirty&&a._subjects.state.next({isDirty:y})}},[a,u.isDirty]),D.useEffect(()=>{e.values&&!Z(e.values,t.current)?(a._reset(e.values,a._options.resetOptions),t.current=e.values,n(y=>({...y}))):a._resetDefaultValues()},[e.values,a]),D.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),D.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),D.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),s.current.formState=it(u,a),s.current}export{Wt as C,wt as a,Ht as u};
1
+ import{ba as D}from"./index-DS1JU_-_.js";var fe=e=>e.type==="checkbox",ie=e=>e instanceof Date,O=e=>e==null;const et=e=>typeof e=="object";var T=e=>!O(e)&&!Array.isArray(e)&&et(e)&&!ie(e),tt=e=>T(e)&&e.target?fe(e.target)?e.target.checked:e.target.value:e,At=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,rt=(e,s)=>e.has(At(s)),xt=e=>{const s=e.constructor&&e.constructor.prototype;return T(s)&&s.hasOwnProperty("isPrototypeOf")},Re=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function p(e){let s;const t=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Re&&(e instanceof Blob||e instanceof FileList))&&(t||T(e)))if(s=t?[]:{},!t&&!xt(e))s=e;else for(const u in e)e.hasOwnProperty(u)&&(s[u]=p(e[u]));else return e;return s}var ce=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>e===void 0,f=(e,s,t)=>{if(!s||!T(e))return t;const u=ce(s.split(/[,[\].]+?/)).reduce((n,a)=>O(n)?n:n[a],e);return w(u)||u===e?w(e[s])?t:e[s]:u},j=e=>typeof e=="boolean",Te=e=>/^\w*$/.test(e),st=e=>ce(e.replace(/["|']|\]/g,"").split(/\.|\[/)),x=(e,s,t)=>{let u=-1;const n=Te(s)?[s]:st(s),a=n.length,y=a-1;for(;++u<a;){const h=n[u];let m=t;if(u!==y){const S=e[h];m=T(S)||Array.isArray(S)?S:isNaN(+n[u+1])?{}:[]}if(h==="__proto__")return;e[h]=m,e=e[h]}return e};const _e={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},W={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},mt=D.createContext(null),Le=()=>D.useContext(mt);var it=(e,s,t,u=!0)=>{const n={defaultValues:s._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const y=a;return s._proxyFormState[y]!==W.all&&(s._proxyFormState[y]=!u||W.all),t&&(t[y]=!0),e[y]}});return n},B=e=>T(e)&&!Object.keys(e).length,ut=(e,s,t,u)=>{t(e);const{name:n,...a}=e;return B(a)||Object.keys(a).length>=Object.keys(s).length||Object.keys(a).find(y=>s[y]===(!u||W.all))},he=e=>Array.isArray(e)?e:[e],lt=(e,s,t)=>!e||!s||e===s||he(e).some(u=>u&&(t?u===s:u.startsWith(s)||s.startsWith(u)));function Ue(e){const s=D.useRef(e);s.current=e,D.useEffect(()=>{const t=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}function Dt(e){const s=Le(),{control:t=s.control,disabled:u,name:n,exact:a}=e||{},[y,h]=D.useState(t._formState),m=D.useRef(!0),S=D.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),_=D.useRef(n);return _.current=n,Ue({disabled:u,next:v=>m.current&&lt(_.current,v.name,a)&&ut(v,S.current,t._updateFormState)&&h({...t._formState,...v}),subject:t._subjects.state}),D.useEffect(()=>(m.current=!0,S.current.isValid&&t._updateValid(!0),()=>{m.current=!1}),[t]),it(y,t,S.current,!1)}var $=e=>typeof e=="string",at=(e,s,t,u,n)=>$(e)?(u&&s.watch.add(e),f(t,e,n)):Array.isArray(e)?e.map(a=>(u&&s.watch.add(a),f(t,a))):(u&&(s.watchAll=!0),t);function wt(e){const s=Le(),{control:t=s.control,name:u,defaultValue:n,disabled:a,exact:y}=e||{},h=D.useRef(u);h.current=u,Ue({disabled:a,subject:t._subjects.values,next:_=>{lt(h.current,_.name,y)&&S(p(at(h.current,t._names,_.values||t._formValues,!1,n)))}});const[m,S]=D.useState(t._getWatch(u,n));return D.useEffect(()=>t._removeUnmounted()),m}function Et(e){const s=Le(),{name:t,disabled:u,control:n=s.control,shouldUnregister:a}=e,y=rt(n._names.array,t),h=wt({control:n,name:t,defaultValue:f(n._formValues,t,f(n._defaultValues,t,e.defaultValue)),exact:!0}),m=Dt({control:n,name:t}),S=D.useRef(n.register(t,{...e.rules,value:h,...j(e.disabled)?{disabled:e.disabled}:{}}));return D.useEffect(()=>{const _=n._options.shouldUnregister||a,v=(N,H)=>{const L=f(n._fields,N);L&&L._f&&(L._f.mount=H)};if(v(t,!0),_){const N=p(f(n._options.defaultValues,t));x(n._defaultValues,t,N),w(f(n._formValues,t))&&x(n._formValues,t,N)}return()=>{(y?_&&!n._state.action:_)?n.unregister(t):v(t,!1)}},[t,n,y,a]),D.useEffect(()=>{f(n._fields,t)&&n._updateDisabledField({disabled:u,fields:n._fields,name:t,value:f(n._fields,t)._f.value})},[u,t,n]),{field:{name:t,value:h,...j(u)||m.disabled?{disabled:m.disabled||u}:{},onChange:D.useCallback(_=>S.current.onChange({target:{value:tt(_),name:t},type:_e.CHANGE}),[t]),onBlur:D.useCallback(()=>S.current.onBlur({target:{value:f(n._formValues,t),name:t},type:_e.BLUR}),[t,n]),ref:_=>{const v=f(n._fields,t);v&&_&&(v._f.ref={focus:()=>_.focus(),select:()=>_.select(),setCustomValidity:N=>_.setCustomValidity(N),reportValidity:()=>_.reportValidity()})}},formState:m,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!f(m.errors,t)},isDirty:{enumerable:!0,get:()=>!!f(m.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!f(m.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!f(m.validatingFields,t)},error:{enumerable:!0,get:()=>f(m.errors,t)}})}}const Wt=e=>e.render(Et(e));var St=(e,s,t,u,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[u]:n||!0}}:{},Ke=e=>({isOnSubmit:!e||e===W.onSubmit,isOnBlur:e===W.onBlur,isOnChange:e===W.onChange,isOnAll:e===W.all,isOnTouch:e===W.onTouched}),Ge=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(u=>e.startsWith(u)&&/^\.\w+/.test(e.slice(u.length))));const oe=(e,s,t,u)=>{for(const n of t||Object.keys(e)){const a=f(e,n);if(a){const{_f:y,...h}=a;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!u)break;if(y.ref&&s(y.ref,y.name)&&!u)break;oe(h,s)}else T(h)&&oe(h,s)}}};var kt=(e,s,t)=>{const u=ce(f(e,t));return x(u,"root",s[t]),x(e,t,u),e},Oe=e=>e.type==="file",X=e=>typeof e=="function",be=e=>{if(!Re)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},ve=e=>$(e),pe=e=>e.type==="radio",Ve=e=>e instanceof RegExp;const ze={value:!1,isValid:!1},Je={value:!0,isValid:!0};var nt=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===""?Je:{value:e[0].value,isValid:!0}:Je:ze}return ze};const Qe={isValid:!1,value:null};var ot=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Qe):Qe;function Xe(e,s,t="validate"){if(ve(e)||Array.isArray(e)&&e.every(ve)||j(e)&&!e)return{type:t,message:ve(e)?e:"",ref:s}}var se=e=>T(e)&&!Ve(e)?e:{value:e,message:""},Ye=async(e,s,t,u,n)=>{const{ref:a,refs:y,required:h,maxLength:m,minLength:S,min:_,max:v,pattern:N,validate:H,name:L,valueAsNumber:xe,mount:J,disabled:Q}=e._f,V=f(s,L);if(!J||Q)return{};const K=y?y[0]:a,G=b=>{u&&K.reportValidity&&(K.setCustomValidity(j(b)?"":b||""),K.reportValidity())},k={},ee=pe(a),de=fe(a),Y=ee||de,te=(xe||Oe(a))&&w(a.value)&&w(V)||be(a)&&a.value===""||V===""||Array.isArray(V)&&!V.length,P=St.bind(null,L,t,k),ye=(b,F,C,U=z.maxLength,q=z.minLength)=>{const I=b?F:C;k[L]={type:b?U:q,message:I,ref:a,...P(b?U:q,I)}};if(n?!Array.isArray(V)||!V.length:h&&(!Y&&(te||O(V))||j(V)&&!V||de&&!nt(y).isValid||ee&&!ot(y).isValid)){const{value:b,message:F}=ve(h)?{value:!!h,message:h}:se(h);if(b&&(k[L]={type:z.required,message:F,ref:K,...P(z.required,F)},!t))return G(F),k}if(!te&&(!O(_)||!O(v))){let b,F;const C=se(v),U=se(_);if(!O(V)&&!isNaN(V)){const q=a.valueAsNumber||V&&+V;O(C.value)||(b=q>C.value),O(U.value)||(F=q<U.value)}else{const q=a.valueAsDate||new Date(V),I=ae=>new Date(new Date().toDateString()+" "+ae),ue=a.type=="time",le=a.type=="week";$(C.value)&&V&&(b=ue?I(V)>I(C.value):le?V>C.value:q>new Date(C.value)),$(U.value)&&V&&(F=ue?I(V)<I(U.value):le?V<U.value:q<new Date(U.value))}if((b||F)&&(ye(!!b,C.message,U.message,z.max,z.min),!t))return G(k[L].message),k}if((m||S)&&!te&&($(V)||n&&Array.isArray(V))){const b=se(m),F=se(S),C=!O(b.value)&&V.length>+b.value,U=!O(F.value)&&V.length<+F.value;if((C||U)&&(ye(C,b.message,F.message),!t))return G(k[L].message),k}if(N&&!te&&$(V)){const{value:b,message:F}=se(N);if(Ve(b)&&!V.match(b)&&(k[L]={type:z.pattern,message:F,ref:a,...P(z.pattern,F)},!t))return G(F),k}if(H){if(X(H)){const b=await H(V,s),F=Xe(b,K);if(F&&(k[L]={...F,...P(z.validate,F.message)},!t))return G(F.message),k}else if(T(H)){let b={};for(const F in H){if(!B(b)&&!t)break;const C=Xe(await H[F](V,s),K,F);C&&(b={...C,...P(F,C.message)},G(C.message),t&&(k[L]=b))}if(!B(b)&&(k[L]={ref:K,...b},!t))return k}}return G(!0),k};function Ct(e,s){const t=s.slice(0,-1).length;let u=0;for(;u<t;)e=w(e)?u++:e[s[u++]];return e}function Rt(e){for(const s in e)if(e.hasOwnProperty(s)&&!w(e[s]))return!1;return!0}function R(e,s){const t=Array.isArray(s)?s:Te(s)?[s]:st(s),u=t.length===1?e:Ct(e,t),n=t.length-1,a=t[n];return u&&delete u[a],n!==0&&(T(u)&&B(u)||Array.isArray(u)&&Rt(u))&&R(e,t.slice(0,-1)),e}var Se=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}},Fe=e=>O(e)||!et(e);function Z(e,s){if(Fe(e)||Fe(s))return e===s;if(ie(e)&&ie(s))return e.getTime()===s.getTime();const t=Object.keys(e),u=Object.keys(s);if(t.length!==u.length)return!1;for(const n of t){const a=e[n];if(!u.includes(n))return!1;if(n!=="ref"){const y=s[n];if(ie(a)&&ie(y)||T(a)&&T(y)||Array.isArray(a)&&Array.isArray(y)?!Z(a,y):a!==y)return!1}}return!0}var ft=e=>e.type==="select-multiple",Tt=e=>pe(e)||fe(e),ke=e=>be(e)&&e.isConnected,ct=e=>{for(const s in e)if(X(e[s]))return!0;return!1};function Ae(e,s={}){const t=Array.isArray(e);if(T(e)||t)for(const u in e)Array.isArray(e[u])||T(e[u])&&!ct(e[u])?(s[u]=Array.isArray(e[u])?[]:{},Ae(e[u],s[u])):O(e[u])||(s[u]=!0);return s}function dt(e,s,t){const u=Array.isArray(e);if(T(e)||u)for(const n in e)Array.isArray(e[n])||T(e[n])&&!ct(e[n])?w(s)||Fe(t[n])?t[n]=Array.isArray(e[n])?Ae(e[n],[]):{...Ae(e[n])}:dt(e[n],O(s)?{}:s[n],t[n]):t[n]=!Z(e[n],s[n]);return t}var ge=(e,s)=>dt(e,s,Ae(s)),yt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:u})=>w(e)?e:s?e===""?NaN:e&&+e:t&&$(e)?new Date(e):u?u(e):e;function Ce(e){const s=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):s.disabled))return Oe(s)?s.files:pe(s)?ot(e.refs).value:ft(s)?[...s.selectedOptions].map(({value:t})=>t):fe(s)?nt(e.refs).value:yt(w(s.value)?e.ref.value:s.value,e)}var Lt=(e,s,t,u)=>{const n={};for(const a of e){const y=f(s,a);y&&x(n,a,y._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:u}},ne=e=>w(e)?e:Ve(e)?e.source:T(e)?Ve(e.value)?e.value.source:e.value:e,Ut=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ze(e,s,t){const u=f(e,t);if(u||Te(t))return{error:u,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),y=f(s,a),h=f(e,a);if(y&&!Array.isArray(y)&&t!==a)return{name:t};if(h&&h.type)return{name:a,error:h};n.pop()}return{name:t}}var Ot=(e,s,t,u,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?u.isOnBlur:n.isOnBlur)?!e:(t?u.isOnChange:n.isOnChange)?e:!0,pt=(e,s)=>!ce(f(e,s)).length&&R(e,s);const Mt={mode:W.onSubmit,reValidateMode:W.onChange,shouldFocusError:!0};function Bt(e={}){let s={...Mt,...e},t={submitCount:0,isDirty:!1,isLoading:X(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},u={},n=T(s.defaultValues)||T(s.values)?p(s.defaultValues||s.values)||{}:{},a=s.shouldUnregister?{}:p(n),y={action:!1,mount:!1,watch:!1},h={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m,S=0;const _={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:Se(),array:Se(),state:Se()},N=Ke(s.mode),H=Ke(s.reValidateMode),L=s.criteriaMode===W.all,xe=r=>i=>{clearTimeout(S),S=setTimeout(r,i)},J=async r=>{if(_.isValid||r){const i=s.resolver?B((await Y()).errors):await P(u,!0);i!==t.isValid&&v.state.next({isValid:i})}},Q=(r,i)=>{(_.isValidating||_.validatingFields)&&((r||Array.from(h.mount)).forEach(l=>{l&&(i?x(t.validatingFields,l,i):R(t.validatingFields,l))}),v.state.next({validatingFields:t.validatingFields,isValidating:!B(t.validatingFields)}))},V=(r,i=[],l,d,c=!0,o=!0)=>{if(d&&l){if(y.action=!0,o&&Array.isArray(f(u,r))){const g=l(f(u,r),d.argA,d.argB);c&&x(u,r,g)}if(o&&Array.isArray(f(t.errors,r))){const g=l(f(t.errors,r),d.argA,d.argB);c&&x(t.errors,r,g),pt(t.errors,r)}if(_.touchedFields&&o&&Array.isArray(f(t.touchedFields,r))){const g=l(f(t.touchedFields,r),d.argA,d.argB);c&&x(t.touchedFields,r,g)}_.dirtyFields&&(t.dirtyFields=ge(n,a)),v.state.next({name:r,isDirty:b(r,i),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else x(a,r,i)},K=(r,i)=>{x(t.errors,r,i),v.state.next({errors:t.errors})},G=r=>{t.errors=r,v.state.next({errors:t.errors,isValid:!1})},k=(r,i,l,d)=>{const c=f(u,r);if(c){const o=f(a,r,w(l)?f(n,r):l);w(o)||d&&d.defaultChecked||i?x(a,r,i?o:Ce(c._f)):U(r,o),y.mount&&J()}},ee=(r,i,l,d,c)=>{let o=!1,g=!1;const A={name:r},E=!!(f(u,r)&&f(u,r)._f&&f(u,r)._f.disabled);if(!l||d){_.isDirty&&(g=t.isDirty,t.isDirty=A.isDirty=b(),o=g!==A.isDirty);const M=E||Z(f(n,r),i);g=!!(!E&&f(t.dirtyFields,r)),M||E?R(t.dirtyFields,r):x(t.dirtyFields,r,!0),A.dirtyFields=t.dirtyFields,o=o||_.dirtyFields&&g!==!M}if(l){const M=f(t.touchedFields,r);M||(x(t.touchedFields,r,l),A.touchedFields=t.touchedFields,o=o||_.touchedFields&&M!==l)}return o&&c&&v.state.next(A),o?A:{}},de=(r,i,l,d)=>{const c=f(t.errors,r),o=_.isValid&&j(i)&&t.isValid!==i;if(e.delayError&&l?(m=xe(()=>K(r,l)),m(e.delayError)):(clearTimeout(S),m=null,l?x(t.errors,r,l):R(t.errors,r)),(l?!Z(c,l):c)||!B(d)||o){const g={...d,...o&&j(i)?{isValid:i}:{},errors:t.errors,name:r};t={...t,...g},v.state.next(g)}},Y=async r=>{Q(r,!0);const i=await s.resolver(a,s.context,Lt(r||h.mount,u,s.criteriaMode,s.shouldUseNativeValidation));return Q(r),i},te=async r=>{const{errors:i}=await Y(r);if(r)for(const l of r){const d=f(i,l);d?x(t.errors,l,d):R(t.errors,l)}else t.errors=i;return i},P=async(r,i,l={valid:!0})=>{for(const d in r){const c=r[d];if(c){const{_f:o,...g}=c;if(o){const A=h.array.has(o.name);Q([d],!0);const E=await Ye(c,a,L,s.shouldUseNativeValidation&&!i,A);if(Q([d]),E[o.name]&&(l.valid=!1,i))break;!i&&(f(E,o.name)?A?kt(t.errors,E,o.name):x(t.errors,o.name,E[o.name]):R(t.errors,o.name))}g&&await P(g,i,l)}}return l.valid},ye=()=>{for(const r of h.unMount){const i=f(u,r);i&&(i._f.refs?i._f.refs.every(l=>!ke(l)):!ke(i._f.ref))&&me(r)}h.unMount=new Set},b=(r,i)=>(r&&i&&x(a,r,i),!Z(Me(),n)),F=(r,i,l)=>at(r,h,{...y.mount?a:w(i)?n:$(r)?{[r]:i}:i},l,i),C=r=>ce(f(y.mount?a:n,r,e.shouldUnregister?f(n,r,[]):[])),U=(r,i,l={})=>{const d=f(u,r);let c=i;if(d){const o=d._f;o&&(!o.disabled&&x(a,r,yt(i,o)),c=be(o.ref)&&O(i)?"":i,ft(o.ref)?[...o.ref.options].forEach(g=>g.selected=c.includes(g.value)):o.refs?fe(o.ref)?o.refs.length>1?o.refs.forEach(g=>(!g.defaultChecked||!g.disabled)&&(g.checked=Array.isArray(c)?!!c.find(A=>A===g.value):c===g.value)):o.refs[0]&&(o.refs[0].checked=!!c):o.refs.forEach(g=>g.checked=g.value===c):Oe(o.ref)?o.ref.value="":(o.ref.value=c,o.ref.type||v.values.next({name:r,values:{...a}})))}(l.shouldDirty||l.shouldTouch)&&ee(r,c,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ae(r)},q=(r,i,l)=>{for(const d in i){const c=i[d],o=`${r}.${d}`,g=f(u,o);(h.array.has(r)||!Fe(c)||g&&!g._f)&&!ie(c)?q(o,c,l):U(o,c,l)}},I=(r,i,l={})=>{const d=f(u,r),c=h.array.has(r),o=p(i);x(a,r,o),c?(v.array.next({name:r,values:{...a}}),(_.isDirty||_.dirtyFields)&&l.shouldDirty&&v.state.next({name:r,dirtyFields:ge(n,a),isDirty:b(r,o)})):d&&!d._f&&!O(o)?q(r,o,l):U(r,o,l),Ge(r,h)&&v.state.next({...t}),v.values.next({name:y.mount?r:void 0,values:{...a}})},ue=async r=>{y.mount=!0;const i=r.target;let l=i.name,d=!0;const c=f(u,l),o=()=>i.type?Ce(c._f):tt(r),g=A=>{d=Number.isNaN(A)||A===f(a,l,A)};if(c){let A,E;const M=o(),re=r.type===_e.BLUR||r.type===_e.FOCUS_OUT,bt=!Ut(c._f)&&!s.resolver&&!f(t.errors,l)&&!c._f.deps||Ot(re,f(t.touchedFields,l),t.isSubmitted,H,N),we=Ge(l,h,re);x(a,l,M),re?(c._f.onBlur&&c._f.onBlur(r),m&&m(0)):c._f.onChange&&c._f.onChange(r);const Ee=ee(l,M,re,!1),Vt=!B(Ee)||we;if(!re&&v.values.next({name:l,type:r.type,values:{...a}}),bt)return _.isValid&&J(),Vt&&v.state.next({name:l,...we?{}:Ee});if(!re&&we&&v.state.next({...t}),s.resolver){const{errors:je}=await Y([l]);if(g(M),d){const Ft=Ze(t.errors,u,l),$e=Ze(je,u,Ft.name||l);A=$e.error,l=$e.name,E=B(je)}}else Q([l],!0),A=(await Ye(c,a,L,s.shouldUseNativeValidation))[l],Q([l]),g(M),d&&(A?E=!1:_.isValid&&(E=await P(u,!0)));d&&(c._f.deps&&ae(c._f.deps),de(l,E,A,Ee))}},le=(r,i)=>{if(f(t.errors,i)&&r.focus)return r.focus(),1},ae=async(r,i={})=>{let l,d;const c=he(r);if(s.resolver){const o=await te(w(r)?r:c);l=B(o),d=r?!c.some(g=>f(o,g)):l}else r?(d=(await Promise.all(c.map(async o=>{const g=f(u,o);return await P(g&&g._f?{[o]:g}:g)}))).every(Boolean),!(!d&&!t.isValid)&&J()):d=l=await P(u);return v.state.next({...!$(r)||_.isValid&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),i.shouldFocus&&!d&&oe(u,le,r?c:h.mount),d},Me=r=>{const i={...y.mount?a:n};return w(r)?i:$(r)?f(i,r):r.map(l=>f(i,l))},Be=(r,i)=>({invalid:!!f((i||t).errors,r),isDirty:!!f((i||t).dirtyFields,r),error:f((i||t).errors,r),isValidating:!!f(t.validatingFields,r),isTouched:!!f((i||t).touchedFields,r)}),gt=r=>{r&&he(r).forEach(i=>R(t.errors,i)),v.state.next({errors:r?t.errors:{}})},Pe=(r,i,l)=>{const d=(f(u,r,{_f:{}})._f||{}).ref,c=f(t.errors,r)||{},{ref:o,message:g,type:A,...E}=c;x(t.errors,r,{...E,...i,ref:d}),v.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&d&&d.focus&&d.focus()},ht=(r,i)=>X(r)?v.values.subscribe({next:l=>r(F(void 0,i),l)}):F(r,i,!0),me=(r,i={})=>{for(const l of r?he(r):h.mount)h.mount.delete(l),h.array.delete(l),i.keepValue||(R(u,l),R(a,l)),!i.keepError&&R(t.errors,l),!i.keepDirty&&R(t.dirtyFields,l),!i.keepTouched&&R(t.touchedFields,l),!i.keepIsValidating&&R(t.validatingFields,l),!s.shouldUnregister&&!i.keepDefaultValue&&R(n,l);v.values.next({values:{...a}}),v.state.next({...t,...i.keepDirty?{isDirty:b()}:{}}),!i.keepIsValid&&J()},Ie=({disabled:r,name:i,field:l,fields:d,value:c})=>{if(j(r)&&y.mount||r){const o=r?void 0:w(c)?Ce(l?l._f:f(d,i)._f):c;x(a,i,o),ee(i,o,!1,!1,!0)}},De=(r,i={})=>{let l=f(u,r);const d=j(i.disabled);return x(u,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...i}}),h.mount.add(r),l?Ie({field:l,disabled:i.disabled,name:r,value:i.value}):k(r,!0,i.value),{...d?{disabled:i.disabled}:{},...s.progressive?{required:!!i.required,min:ne(i.min),max:ne(i.max),minLength:ne(i.minLength),maxLength:ne(i.maxLength),pattern:ne(i.pattern)}:{},name:r,onChange:ue,onBlur:ue,ref:c=>{if(c){De(r,i),l=f(u,r);const o=w(c.value)&&c.querySelectorAll&&c.querySelectorAll("input,select,textarea")[0]||c,g=Tt(o),A=l._f.refs||[];if(g?A.find(E=>E===o):o===l._f.ref)return;x(u,r,{_f:{...l._f,...g?{refs:[...A.filter(ke),o,...Array.isArray(f(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),k(r,!1,void 0,o)}else l=f(u,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||i.shouldUnregister)&&!(rt(h.array,r)&&y.action)&&h.unMount.add(r)}}},Ne=()=>s.shouldFocusError&&oe(u,le,h.mount),vt=r=>{j(r)&&(v.state.next({disabled:r}),oe(u,(i,l)=>{const d=f(u,l);d&&(i.disabled=d._f.disabled||r,Array.isArray(d._f.refs)&&d._f.refs.forEach(c=>{c.disabled=d._f.disabled||r}))},0,!1))},qe=(r,i)=>async l=>{let d;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let c=p(a);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:g}=await Y();t.errors=o,c=g}else await P(u);if(R(t.errors,"root"),B(t.errors)){v.state.next({errors:{}});try{await r(c,l)}catch(o){d=o}}else i&&await i({...t.errors},l),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:B(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d},_t=(r,i={})=>{f(u,r)&&(w(i.defaultValue)?I(r,p(f(n,r))):(I(r,i.defaultValue),x(n,r,p(i.defaultValue))),i.keepTouched||R(t.touchedFields,r),i.keepDirty||(R(t.dirtyFields,r),t.isDirty=i.defaultValue?b(r,p(f(n,r))):b()),i.keepError||(R(t.errors,r),_.isValid&&J()),v.state.next({...t}))},We=(r,i={})=>{const l=r?p(r):n,d=p(l),c=B(r),o=c?n:d;if(i.keepDefaultValues||(n=l),!i.keepValues){if(i.keepDirtyValues)for(const g of h.mount)f(t.dirtyFields,g)?x(o,g,f(a,g)):I(g,f(o,g));else{if(Re&&w(r))for(const g of h.mount){const A=f(u,g);if(A&&A._f){const E=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(be(E)){const M=E.closest("form");if(M){M.reset();break}}}}u={}}a=e.shouldUnregister?i.keepDefaultValues?p(n):{}:p(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}h={mount:i.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!_.isValid||!!i.keepIsValid||!!i.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:i.keepSubmitCount?t.submitCount:0,isDirty:c?!1:i.keepDirty?t.isDirty:!!(i.keepDefaultValues&&!Z(r,n)),isSubmitted:i.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:c?[]:i.keepDirtyValues?i.keepDefaultValues&&a?ge(n,a):t.dirtyFields:i.keepDefaultValues&&r?ge(n,r):i.keepDirty?t.dirtyFields:{},touchedFields:i.keepTouched?t.touchedFields:{},errors:i.keepErrors?t.errors:{},isSubmitSuccessful:i.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},He=(r,i)=>We(X(r)?r(a):r,i);return{control:{register:De,unregister:me,getFieldState:Be,handleSubmit:qe,setError:Pe,_executeSchema:Y,_getWatch:F,_getDirty:b,_updateValid:J,_removeUnmounted:ye,_updateFieldArray:V,_updateDisabledField:Ie,_getFieldArray:C,_reset:We,_resetDefaultValues:()=>X(s.defaultValues)&&s.defaultValues().then(r=>{He(r,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:r=>{t={...t,...r}},_disableForm:vt,_subjects:v,_proxyFormState:_,_setErrors:G,get _fields(){return u},get _formValues(){return a},get _state(){return y},set _state(r){y=r},get _defaultValues(){return n},get _names(){return h},set _names(r){h=r},get _formState(){return t},set _formState(r){t=r},get _options(){return s},set _options(r){s={...s,...r}}},trigger:ae,register:De,handleSubmit:qe,watch:ht,setValue:I,getValues:Me,reset:He,resetField:_t,clearErrors:gt,unregister:me,setError:Pe,setFocus:(r,i={})=>{const l=f(u,r),d=l&&l._f;if(d){const c=d.refs?d.refs[0]:d.ref;c.focus&&(c.focus(),i.shouldSelect&&c.select())}},getFieldState:Be}}function Ht(e={}){const s=D.useRef(),t=D.useRef(),[u,n]=D.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...Bt(e),formState:u});const a=s.current.control;return a._options=e,Ue({subject:a._subjects.state,next:y=>{ut(y,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),D.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),D.useEffect(()=>{if(a._proxyFormState.isDirty){const y=a._getDirty();y!==u.isDirty&&a._subjects.state.next({isDirty:y})}},[a,u.isDirty]),D.useEffect(()=>{e.values&&!Z(e.values,t.current)?(a._reset(e.values,a._options.resetOptions),t.current=e.values,n(y=>({...y}))):a._resetDefaultValues()},[e.values,a]),D.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),D.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),D.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),s.current.formState=it(u,a),s.current}export{Wt as C,wt as a,Ht as u};
@@ -1 +1 @@
1
- import{C as i}from"./codemirror.es-CyMlPAkY.js";import"./index-D2-Ad6ai.js";import"./index-CAswdZkd.js";var y=Object.defineProperty,u=(e,t)=>y(e,"name",{value:t,configurable:!0});i.defineOption("info",!1,(e,t,n)=>{if(n&&n!==i.Init){const o=e.state.info.onMouseOver;i.off(e.getWrapperElement(),"mouseover",o),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){const o=e.state.info=v(t);o.onMouseOver=h.bind(null,e),i.on(e.getWrapperElement(),"mouseover",o.onMouseOver)}});function v(e){return{options:e instanceof Function?{render:e}:e===!0?{}:e}}u(v,"createState");function g(e){const t=e.state.info.options;return(t==null?void 0:t.hoverTime)||500}u(g,"getHoverTime");function h(e,t){const n=e.state.info,o=t.target||t.srcElement;if(!(o instanceof HTMLElement)||o.nodeName!=="SPAN"||n.hoverTimeout!==void 0)return;const s=o.getBoundingClientRect(),r=u(function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(f,a)},"onMouseMove"),p=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0},"onMouseOut"),f=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),n.hoverTimeout=void 0,T(e,s)},"onHover"),a=g(e);n.hoverTimeout=setTimeout(f,a),i.on(document,"mousemove",r),i.on(e.getWrapperElement(),"mouseout",p)}u(h,"onMouseOver");function T(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),s=e.state.info.options,r=s.render||e.getHelper(n,"info");if(r){const p=e.getTokenAt(n,!0);if(p){const f=r(p,s,e,n);f&&M(e,t,f)}}}u(T,"onMouseHover");function M(e,t,n){const o=document.createElement("div");o.className="CodeMirror-info",o.appendChild(n),document.body.appendChild(o);const s=o.getBoundingClientRect(),r=window.getComputedStyle(o),p=s.right-s.left+parseFloat(r.marginLeft)+parseFloat(r.marginRight),f=s.bottom-s.top+parseFloat(r.marginTop)+parseFloat(r.marginBottom);let a=t.bottom;f>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(a=t.top-f),a<0&&(a=t.bottom);let l=Math.max(0,window.innerWidth-p-15);l>t.left&&(l=t.left),o.style.opacity="1",o.style.top=a+"px",o.style.left=l+"px";let d;const c=u(function(){clearTimeout(d)},"onMouseOverPopup"),m=u(function(){clearTimeout(d),d=setTimeout(O,200)},"onMouseOut"),O=u(function(){i.off(o,"mouseover",c),i.off(o,"mouseout",m),i.off(e.getWrapperElement(),"mouseout",m),o.style.opacity?(o.style.opacity="0",setTimeout(()=>{o.parentNode&&o.parentNode.removeChild(o)},600)):o.parentNode&&o.parentNode.removeChild(o)},"hidePopup");i.on(o,"mouseover",c),i.on(o,"mouseout",m),i.on(e.getWrapperElement(),"mouseout",m)}u(M,"showPopup");
1
+ import{C as i}from"./codemirror.es-cljF5Vfg.js";import"./index-BwD5fAbE.js";import"./index-DS1JU_-_.js";var y=Object.defineProperty,u=(e,t)=>y(e,"name",{value:t,configurable:!0});i.defineOption("info",!1,(e,t,n)=>{if(n&&n!==i.Init){const o=e.state.info.onMouseOver;i.off(e.getWrapperElement(),"mouseover",o),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){const o=e.state.info=v(t);o.onMouseOver=h.bind(null,e),i.on(e.getWrapperElement(),"mouseover",o.onMouseOver)}});function v(e){return{options:e instanceof Function?{render:e}:e===!0?{}:e}}u(v,"createState");function g(e){const t=e.state.info.options;return(t==null?void 0:t.hoverTime)||500}u(g,"getHoverTime");function h(e,t){const n=e.state.info,o=t.target||t.srcElement;if(!(o instanceof HTMLElement)||o.nodeName!=="SPAN"||n.hoverTimeout!==void 0)return;const s=o.getBoundingClientRect(),r=u(function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(f,a)},"onMouseMove"),p=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0},"onMouseOut"),f=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),n.hoverTimeout=void 0,T(e,s)},"onHover"),a=g(e);n.hoverTimeout=setTimeout(f,a),i.on(document,"mousemove",r),i.on(e.getWrapperElement(),"mouseout",p)}u(h,"onMouseOver");function T(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),s=e.state.info.options,r=s.render||e.getHelper(n,"info");if(r){const p=e.getTokenAt(n,!0);if(p){const f=r(p,s,e,n);f&&M(e,t,f)}}}u(T,"onMouseHover");function M(e,t,n){const o=document.createElement("div");o.className="CodeMirror-info",o.appendChild(n),document.body.appendChild(o);const s=o.getBoundingClientRect(),r=window.getComputedStyle(o),p=s.right-s.left+parseFloat(r.marginLeft)+parseFloat(r.marginRight),f=s.bottom-s.top+parseFloat(r.marginTop)+parseFloat(r.marginBottom);let a=t.bottom;f>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(a=t.top-f),a<0&&(a=t.bottom);let l=Math.max(0,window.innerWidth-p-15);l>t.left&&(l=t.left),o.style.opacity="1",o.style.top=a+"px",o.style.left=l+"px";let d;const c=u(function(){clearTimeout(d)},"onMouseOverPopup"),m=u(function(){clearTimeout(d),d=setTimeout(O,200)},"onMouseOut"),O=u(function(){i.off(o,"mouseover",c),i.off(o,"mouseout",m),i.off(e.getWrapperElement(),"mouseout",m),o.style.opacity?(o.style.opacity="0",setTimeout(()=>{o.parentNode&&o.parentNode.removeChild(o)},600)):o.parentNode&&o.parentNode.removeChild(o)},"hidePopup");i.on(o,"mouseover",c),i.on(o,"mouseout",m),i.on(e.getWrapperElement(),"mouseout",m)}u(M,"showPopup");
@@ -1 +1 @@
1
- import{C as h}from"./codemirror.es-CyMlPAkY.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es-Byjjrfj8.js";import"./info-addon.es-moa6A46t.js";import{Y as A,r as F}from"./index-D2-Ad6ai.js";import"./index-CAswdZkd.js";import"./introspection.es-CPJcz6nz.js";import"./forEachState.es-D8bf0zSr.js";var L=Object.defineProperty,l=(r,e)=>L(r,"name",{value:e,configurable:!0});h.registerHelper("info","graphql",(r,e)=>{if(!e.schema||!r.state)return;const i=r.state,n=i.kind,d=i.step,c=E(e.schema,r.state);if(n==="Field"&&d===0&&c.fieldDef||n==="AliasedField"&&d===2&&c.fieldDef){const a=document.createElement("div");return o(a,c,e),u(a,e,c.fieldDef),a}else if(n==="Directive"&&d===1&&c.directiveDef){const a=document.createElement("div");return f(a,c,e),u(a,e,c.directiveDef),a}else if(n==="Argument"&&d===0&&c.argDef){const a=document.createElement("div");return p(a,c,e),u(a,e,c.argDef),a}else if(n==="EnumValue"&&c.enumValue&&c.enumValue.description){const a=document.createElement("div");return D(a,c,e),u(a,e,c.enumValue),a}else if(n==="NamedType"&&c.type&&c.type.description){const a=document.createElement("div");return m(a,c,e,c.type),u(a,e,c.type),a}});function o(r,e,i){s(r,e,i),v(r,e,i,e.type)}l(o,"renderField");function s(r,e,i){var n;const d=((n=e.fieldDef)===null||n===void 0?void 0:n.name)||"";d.slice(0,2)!=="__"&&(m(r,e,i,e.parentType),t(r,".")),t(r,d,"field-name",i,C(e))}l(s,"renderQualifiedField");function f(r,e,i){var n;const d="@"+(((n=e.directiveDef)===null||n===void 0?void 0:n.name)||"");t(r,d,"directive-name",i,N(e))}l(f,"renderDirective");function p(r,e,i){var n;e.directiveDef?f(r,e,i):e.fieldDef&&s(r,e,i);const d=((n=e.argDef)===null||n===void 0?void 0:n.name)||"";t(r,"("),t(r,d,"arg-name",i,_(e)),v(r,e,i,e.inputType),t(r,")")}l(p,"renderArg");function v(r,e,i,n){t(r,": "),m(r,e,i,n)}l(v,"renderTypeAnnotation");function D(r,e,i){var n;const d=((n=e.enumValue)===null||n===void 0?void 0:n.name)||"";m(r,e,i,e.inputType),t(r,"."),t(r,d,"enum-value",i,V(e))}l(D,"renderEnumValue");function m(r,e,i,n){n instanceof A?(m(r,e,i,n.ofType),t(r,"!")):n instanceof F?(t(r,"["),m(r,e,i,n.ofType),t(r,"]")):t(r,(n==null?void 0:n.name)||"","type-name",i,x(e,n))}l(m,"renderType");function u(r,e,i){const n=i.description;if(n){const d=document.createElement("div");d.className="info-description",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n)),r.appendChild(d)}T(r,e,i)}l(u,"renderDescription");function T(r,e,i){const n=i.deprecationReason;if(n){const d=document.createElement("div");d.className="info-deprecation",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n));const c=document.createElement("span");c.className="info-deprecation-label",c.appendChild(document.createTextNode("Deprecated: ")),d.insertBefore(c,d.firstChild),r.appendChild(d)}}l(T,"renderDeprecation");function t(r,e,i="",n={onClick:null},d=null){if(i){const c=n.onClick;let a;c?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",g=>{c(d,g)})):a=document.createElement("span"),a.className=i,a.appendChild(document.createTextNode(e)),r.appendChild(a)}else r.appendChild(document.createTextNode(e))}l(t,"text");
1
+ import{C as h}from"./codemirror.es-cljF5Vfg.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es-DbpM2rcO.js";import"./info-addon.es-C24VfKdY.js";import{Y as A,r as F}from"./index-BwD5fAbE.js";import"./index-DS1JU_-_.js";import"./introspection.es-CPJcz6nz.js";import"./forEachState.es-D8bf0zSr.js";var L=Object.defineProperty,l=(r,e)=>L(r,"name",{value:e,configurable:!0});h.registerHelper("info","graphql",(r,e)=>{if(!e.schema||!r.state)return;const i=r.state,n=i.kind,d=i.step,c=E(e.schema,r.state);if(n==="Field"&&d===0&&c.fieldDef||n==="AliasedField"&&d===2&&c.fieldDef){const a=document.createElement("div");return o(a,c,e),u(a,e,c.fieldDef),a}else if(n==="Directive"&&d===1&&c.directiveDef){const a=document.createElement("div");return f(a,c,e),u(a,e,c.directiveDef),a}else if(n==="Argument"&&d===0&&c.argDef){const a=document.createElement("div");return p(a,c,e),u(a,e,c.argDef),a}else if(n==="EnumValue"&&c.enumValue&&c.enumValue.description){const a=document.createElement("div");return D(a,c,e),u(a,e,c.enumValue),a}else if(n==="NamedType"&&c.type&&c.type.description){const a=document.createElement("div");return m(a,c,e,c.type),u(a,e,c.type),a}});function o(r,e,i){s(r,e,i),v(r,e,i,e.type)}l(o,"renderField");function s(r,e,i){var n;const d=((n=e.fieldDef)===null||n===void 0?void 0:n.name)||"";d.slice(0,2)!=="__"&&(m(r,e,i,e.parentType),t(r,".")),t(r,d,"field-name",i,C(e))}l(s,"renderQualifiedField");function f(r,e,i){var n;const d="@"+(((n=e.directiveDef)===null||n===void 0?void 0:n.name)||"");t(r,d,"directive-name",i,N(e))}l(f,"renderDirective");function p(r,e,i){var n;e.directiveDef?f(r,e,i):e.fieldDef&&s(r,e,i);const d=((n=e.argDef)===null||n===void 0?void 0:n.name)||"";t(r,"("),t(r,d,"arg-name",i,_(e)),v(r,e,i,e.inputType),t(r,")")}l(p,"renderArg");function v(r,e,i,n){t(r,": "),m(r,e,i,n)}l(v,"renderTypeAnnotation");function D(r,e,i){var n;const d=((n=e.enumValue)===null||n===void 0?void 0:n.name)||"";m(r,e,i,e.inputType),t(r,"."),t(r,d,"enum-value",i,V(e))}l(D,"renderEnumValue");function m(r,e,i,n){n instanceof A?(m(r,e,i,n.ofType),t(r,"!")):n instanceof F?(t(r,"["),m(r,e,i,n.ofType),t(r,"]")):t(r,(n==null?void 0:n.name)||"","type-name",i,x(e,n))}l(m,"renderType");function u(r,e,i){const n=i.description;if(n){const d=document.createElement("div");d.className="info-description",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n)),r.appendChild(d)}T(r,e,i)}l(u,"renderDescription");function T(r,e,i){const n=i.deprecationReason;if(n){const d=document.createElement("div");d.className="info-deprecation",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n));const c=document.createElement("span");c.className="info-deprecation-label",c.appendChild(document.createTextNode("Deprecated: ")),d.insertBefore(c,d.firstChild),r.appendChild(d)}}l(T,"renderDeprecation");function t(r,e,i="",n={onClick:null},d=null){if(i){const c=n.onClick;let a;c?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",g=>{c(d,g)})):a=document.createElement("span"),a.className=i,a.appendChild(document.createTextNode(e)),r.appendChild(a)}else r.appendChild(document.createTextNode(e))}l(t,"text");
@@ -1 +1 @@
1
- import{P as l,j as t,bl as G,t as J,r as s,q as V,M as H,W as Q,dE as X,m as Y,D as Z,B as E,C as I,w as _,J as ee,x as te,bm as ne,K as oe}from"./index-CAswdZkd.js";import{W as se}from"./tag-DhW_Xw5i.js";import{I as w}from"./index-CP2qVp-g.js";import{T as re}from"./TextField-ujCYjYid.js";import{S as ae,a as le,b as ie}from"./Stepper-nGCToByw.js";function ce({mode:r,...i}){return r==="development"?t.jsx(se,{type:"primary",...i,children:"DEV"}):null}ce.propTypes={mode:l.string.isRequired};function D({defaultUrl:r,onCancel:i,onSuccess:v,onError:W,mode:B,handleText:c}){const{api:F}=G(),{api:L}=J(),[d,m]=s.useState(!1),[y,p]=s.useState(""),{t:n}=V(),j={dist:{}},[u,M]=s.useState(r),[f,h]=s.useState(r?1:0),[o,k]=s.useState(j),[R,x]=s.useState(!1),[S,T]=s.useState({}),P=B==="component",g=P?!0:!r,C=async()=>{k(j),p(null),m(!0);try{const e=decodeURIComponent(u.trim());try{new URL(e)}catch{throw new Error("Invalid URL")}const{meta:b,inStore:$,registryUrl:z}=await F.getBlockletMetaFromUrl({input:{url:e}});k(b),T({inStore:$,registryUrl:z,inputUrl:u.trim()})}catch(e){console.error(e);const b=`Blocklet Install failed: ${oe(e)}`;p(b),W(e)}finally{m(!1)}},q=()=>{if(P){v({meta:o,...S}),i();return}m(!0),x(!0)},A=()=>{m(!1),x(!1),v({meta:o,...S}),i()},K=()=>{m(!1),x(!1)};s.useEffect(()=>{r&&C()},[r]);const N=[{name:n("common.name"),value:H.getDisplayName({meta:o},!0)},{name:n("common.version"),value:o.version},{name:n("common.did"),value:t.jsx(Q,{did:o.did})},{name:n("common.author"),value:X(o.author)},{name:n("blocklet.dist.downloadLink"),value:o.dist.tarball}],O=()=>d?t.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:t.jsx(I,{})}):o.did?t.jsx("div",{style:{paddingLeft:"10%"},children:N.map(e=>e.name===n("common.did")?t.jsx(w,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>n("common.did"),children:e.value},e.name):t.jsx(w,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name))}):null,U=[{label:n("blocklet.fromUrl.step0"),body:t.jsx(Y,{component:"div",children:t.jsx(re,{label:n("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:n("blocklet.fromUrl.description"),value:u,onChange:e=>{p(null),M(e.target.value)},disabled:d,onKeyPress:e=>{e.key==="Enter"&&(e.preventDefault(),C(),h(1))}})}),cancel:n("common.cancel"),confirm:n("common.next"),onCancel:i,onConfirm:()=>{C(),h(1)}},{label:n("blocklet.fromUrl.step1"),body:O(),cancel:n(g?"common.pre":"common.cancel"),confirm:(c==null?void 0:c.confirm)||n("blocklet.fromUrl.confirm"),onCancel:()=>{g?h(e=>e-1):i()},onConfirm:()=>{q()}}],a=U[f];return t.jsxs(t.Fragment,{children:[t.jsxs(Z,{title:(c==null?void 0:c.title)||n("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>a.onCancel(),showCloseButton:f===0,disableEscapeKeyDown:!0,open:!0,actions:t.jsxs(t.Fragment,{children:[a.cancel&&t.jsx(E,{onClick:e=>{e.stopPropagation(),p(null),a.onCancel()},color:"inherit",children:a.cancel||n("common.cancel")}),t.jsxs(E,{onClick:e=>{e.stopPropagation(),a.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:d||!u||y,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[d&&f===0&&t.jsx(I,{size:16}),a.confirm]})]}),children:[g&&t.jsx(ae,{alternativeLabel:!0,activeStep:f,children:U.map(({label:e})=>t.jsx(le,{children:t.jsx(ie,{children:e})},e))}),t.jsx(_,{component:"div",style:{marginTop:24},children:a.body}),!!y&&t.jsx(ee,{type:"error",style:{width:"100%",marginTop:8},children:y})]}),o&&R&&t.jsx(te,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:L.get,checkTimeout:5*60*1e3,onSuccess:A,extraParams:{title:o.title,wt:ne(o),blockletMetaUrl:decodeURIComponent(u.trim())},messages:{title:n("setup.keyPair.title"),scan:n("setup.keyPair.scan"),confirm:n("setup.keyPair.confirm"),success:n("setup.keyPair.success")},onClose:K})]})}D.propTypes={defaultUrl:l.string,onCancel:l.func.isRequired,onSuccess:l.func.isRequired,onError:l.func,mode:l.oneOf(["install","component"]),handleText:l.object};D.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};export{ce as B,D as I};
1
+ import{P as l,j as t,bl as G,t as J,r as s,q as V,M as H,W as Q,dE as X,m as Y,D as Z,B as E,C as I,w as _,J as ee,x as te,bm as ne,K as oe}from"./index-DS1JU_-_.js";import{W as se}from"./tag-Cvwm2gDk.js";import{I as w}from"./index-BgG0evtj.js";import{T as re}from"./TextField-BPO9Hci-.js";import{S as ae,a as le,b as ie}from"./Stepper-WgjnG7-H.js";function ce({mode:r,...i}){return r==="development"?t.jsx(se,{type:"primary",...i,children:"DEV"}):null}ce.propTypes={mode:l.string.isRequired};function D({defaultUrl:r,onCancel:i,onSuccess:v,onError:W,mode:B,handleText:c}){const{api:F}=G(),{api:L}=J(),[d,m]=s.useState(!1),[y,p]=s.useState(""),{t:n}=V(),j={dist:{}},[u,M]=s.useState(r),[f,h]=s.useState(r?1:0),[o,k]=s.useState(j),[R,x]=s.useState(!1),[S,T]=s.useState({}),P=B==="component",g=P?!0:!r,C=async()=>{k(j),p(null),m(!0);try{const e=decodeURIComponent(u.trim());try{new URL(e)}catch{throw new Error("Invalid URL")}const{meta:b,inStore:$,registryUrl:z}=await F.getBlockletMetaFromUrl({input:{url:e}});k(b),T({inStore:$,registryUrl:z,inputUrl:u.trim()})}catch(e){console.error(e);const b=`Blocklet Install failed: ${oe(e)}`;p(b),W(e)}finally{m(!1)}},q=()=>{if(P){v({meta:o,...S}),i();return}m(!0),x(!0)},A=()=>{m(!1),x(!1),v({meta:o,...S}),i()},K=()=>{m(!1),x(!1)};s.useEffect(()=>{r&&C()},[r]);const N=[{name:n("common.name"),value:H.getDisplayName({meta:o},!0)},{name:n("common.version"),value:o.version},{name:n("common.did"),value:t.jsx(Q,{did:o.did})},{name:n("common.author"),value:X(o.author)},{name:n("blocklet.dist.downloadLink"),value:o.dist.tarball}],O=()=>d?t.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:t.jsx(I,{})}):o.did?t.jsx("div",{style:{paddingLeft:"10%"},children:N.map(e=>e.name===n("common.did")?t.jsx(w,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>n("common.did"),children:e.value},e.name):t.jsx(w,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name))}):null,U=[{label:n("blocklet.fromUrl.step0"),body:t.jsx(Y,{component:"div",children:t.jsx(re,{label:n("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,style:{marginBottom:32},margin:"dense",helperText:n("blocklet.fromUrl.description"),value:u,onChange:e=>{p(null),M(e.target.value)},disabled:d,onKeyPress:e=>{e.key==="Enter"&&(e.preventDefault(),C(),h(1))}})}),cancel:n("common.cancel"),confirm:n("common.next"),onCancel:i,onConfirm:()=>{C(),h(1)}},{label:n("blocklet.fromUrl.step1"),body:O(),cancel:n(g?"common.pre":"common.cancel"),confirm:(c==null?void 0:c.confirm)||n("blocklet.fromUrl.confirm"),onCancel:()=>{g?h(e=>e-1):i()},onConfirm:()=>{q()}}],a=U[f];return t.jsxs(t.Fragment,{children:[t.jsxs(Z,{title:(c==null?void 0:c.title)||n("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>a.onCancel(),showCloseButton:f===0,disableEscapeKeyDown:!0,open:!0,actions:t.jsxs(t.Fragment,{children:[a.cancel&&t.jsx(E,{onClick:e=>{e.stopPropagation(),p(null),a.onCancel()},color:"inherit",children:a.cancel||n("common.cancel")}),t.jsxs(E,{onClick:e=>{e.stopPropagation(),a.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:d||!u||y,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[d&&f===0&&t.jsx(I,{size:16}),a.confirm]})]}),children:[g&&t.jsx(ae,{alternativeLabel:!0,activeStep:f,children:U.map(({label:e})=>t.jsx(le,{children:t.jsx(ie,{children:e})},e))}),t.jsx(_,{component:"div",style:{marginTop:24},children:a.body}),!!y&&t.jsx(ee,{type:"error",style:{width:"100%",marginTop:8},children:y})]}),o&&R&&t.jsx(te,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:L.get,checkTimeout:5*60*1e3,onSuccess:A,extraParams:{title:o.title,wt:ne(o),blockletMetaUrl:decodeURIComponent(u.trim())},messages:{title:n("setup.keyPair.title"),scan:n("setup.keyPair.scan"),confirm:n("setup.keyPair.confirm"),success:n("setup.keyPair.success")},onClose:K})]})}D.propTypes={defaultUrl:l.string,onCancel:l.func.isRequired,onSuccess:l.func.isRequired,onError:l.func,mode:l.oneOf(["install","component"]),handleText:l.object};D.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};export{ce as B,D as I};
@@ -1,4 +1,4 @@
1
- import{bL as $,j as i,P as n,n as f,r as p,f as q,D as E,q as j,t as H,a1 as U,cC as F,cD as M,cE as A,cs as O,cF as N,cG as P,as as S,O as L,ci as B,C as V}from"./index-CAswdZkd.js";import{R as W}from"./index-RF8S_PnF.js";import{C as z}from"./index-BDWQt3oG.js";import{d as X}from"./CheckCircle-DN9h3n-S.js";import{w as G}from"./wrap-locale-Dz5ZUUi6.js";const J=$(i.jsx("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2m0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19z"}),"Inbox");function y({invitation:e,createPassportSvg:r,passportColor:a}){const[d,o]=p.useState(!1),{t}=p.useContext(q),c=p.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),l=p.useMemo(()=>r({title:c,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||a}),[e,c]),x=p.useCallback(()=>{o(!0)},[]),s=p.useCallback(()=>{o(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(Y,{children:i.jsx("div",{className:"invite-passport__card",onClick:x,children:i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:l}})})}),i.jsx(E,{open:d,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:s,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(u=>i.jsx("li",{style:{listStyle:"circle"},children:u.description},u.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(J,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:t("invite.emptyPermission")})]})})]})}y.propTypes={invitation:n.object.isRequired,createPassportSvg:n.func.isRequired,passportColor:n.string};y.defaultProps={passportColor:"auto"};const Y=f.div`
1
+ import{bL as $,j as i,P as n,n as f,r as p,f as q,D as E,q as j,t as H,a1 as U,cC as F,cD as M,cE as A,cs as O,cF as N,cG as P,as as S,O as L,ci as B,C as V}from"./index-DS1JU_-_.js";import{R as W}from"./index-C8pFKy9H.js";import{C as z}from"./index-B_u7mT5U.js";import{d as X}from"./CheckCircle-CpgwIoc6.js";import{w as G}from"./wrap-locale-b15Mq8e0.js";const J=$(i.jsx("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2m0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19z"}),"Inbox");function y({invitation:e,createPassportSvg:r,passportColor:a}){const[d,o]=p.useState(!1),{t}=p.useContext(q),c=p.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),l=p.useMemo(()=>r({title:c,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||a}),[e,c]),x=p.useCallback(()=>{o(!0)},[]),s=p.useCallback(()=>{o(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(Y,{children:i.jsx("div",{className:"invite-passport__card",onClick:x,children:i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:l}})})}),i.jsx(E,{open:d,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:s,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(u=>i.jsx("li",{style:{listStyle:"circle"},children:u.description},u.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(J,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:t("invite.emptyPermission")})]})})]})}y.propTypes={invitation:n.object.isRequired,createPassportSvg:n.func.isRequired,passportColor:n.string};y.defaultProps={passportColor:"auto"};const Y=f.div`
2
2
  display: flex;
3
3
  max-width: 350px;
4
4
  margin: 30px auto;
@@ -1 +1 @@
1
- import{aK as i,aL as o,j as s,g as u,fj as f}from"./index-CAswdZkd.js";var e={},l=o;Object.defineProperty(e,"__esModule",{value:!0});var n=e.default=void 0,v=l(i()),d=s;n=e.default=(0,v.default)((0,d.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");const a=f;var x=(t,r)=>a(t)===a(r);const h=u(x);export{n as d,h as i};
1
+ import{aK as i,aL as o,j as s,g as u,fj as f}from"./index-DS1JU_-_.js";var e={},l=o;Object.defineProperty(e,"__esModule",{value:!0});var n=e.default=void 0,v=l(i()),d=s;n=e.default=(0,v.default)((0,d.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");const a=f;var x=(t,r)=>a(t)===a(r);const h=u(x);export{n as d,h as i};
@@ -1 +1 @@
1
- import{g as r,eS as t}from"./index-CAswdZkd.js";var u=t;function e(a,s){return u(a,s)}var o=e;const l=r(o);export{o as a,l as i};
1
+ import{g as r,eS as t}from"./index-DS1JU_-_.js";var u=t;function e(a,s){return u(a,s)}var o=e;const l=r(o);export{o as a,l as i};