@abtnode/webapp 1.16.28-beta-10ca1aad → 1.16.28-beta-8acda0e6

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 (166) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-NewVG93V.js → Add-CazR0vZK.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-Bd9sR9Kj.js → ArrowDropDown-BUrSvBpJ.js} +1 -1
  5. package/dist/assets/{Autocomplete-BvkSiNum.js → Autocomplete-DtvRC-0f.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-AZ_8G3rf.js → Breadcrumbs-D_LYBn3C.js} +1 -1
  7. package/dist/assets/{ButtonGroup-pLJbtCLI.js → ButtonGroup-DxRrpbFw.js} +1 -1
  8. package/dist/assets/{CheckCircle-DkW4b6y7.js → CheckCircle-DbpNufE5.js} +1 -1
  9. package/dist/assets/{ChevronLeft-C0YN2KhY.js → ChevronLeft-Bqynugte.js} +1 -1
  10. package/dist/assets/{ChevronRight-hQNW7SHU.js → ChevronRight-C8sGT-T0.js} +1 -1
  11. package/dist/assets/{Close-S913aeni.js → Close-uiQeu7_r.js} +1 -1
  12. package/dist/assets/{Delete-LMbP8m3y.js → Delete-DHiwhVmP.js} +1 -1
  13. package/dist/assets/DeleteOutline-CnmOxEUl.js +1 -0
  14. package/dist/assets/{Done-BJ9nFL7V.js → Done-LyiBXZqg.js} +1 -1
  15. package/dist/assets/{Edit-BgzVDDnU.js → Edit-BgU3t9-z.js} +1 -1
  16. package/dist/assets/{EditIcon-D0wQcFnY.js → EditIcon-CeWwrlQZ.js} +1 -1
  17. package/dist/assets/{FilterList-YahW7b2T.js → FilterList-usqmRCGh.js} +1 -1
  18. package/dist/assets/{Google-DU7ZCGKH.js → Google-BzTTYoLn.js} +1 -1
  19. package/dist/assets/{Https-CsrqmSk1.js → Https-B3r3YjjJ.js} +1 -1
  20. package/dist/assets/{InputAdornment-CP3BhuEs.js → InputAdornment-0DnARlEj.js} +1 -1
  21. package/dist/assets/{InputLabel-DOxBtPfl.js → InputLabel-Csh1ynXt.js} +1 -1
  22. package/dist/assets/{LastPage-DmVgRYiw.js → LastPage-DnsJsUIR.js} +1 -1
  23. package/dist/assets/{Launch-D-68sLeU.js → Launch-BOea_wCy.js} +1 -1
  24. package/dist/assets/{Link-CSeasEZI.js → Link-ByQdtjfh.js} +1 -1
  25. package/dist/assets/{LoadingButton-CuJ6PUWH.js → LoadingButton-Cj_wXKeI.js} +1 -1
  26. package/dist/assets/{LockIcon-BlIFddg8.js → LockIcon-C082WeKw.js} +1 -1
  27. package/dist/assets/{Loop-DIds44Mh.js → Loop-m_399M1H.js} +1 -1
  28. package/dist/assets/{MoreVert-Cei2Rx5H.js → MoreVert-BzXa-i1R.js} +1 -1
  29. package/dist/assets/{Pagination-C2m02Dsu.js → Pagination-DSEqJST1.js} +1 -1
  30. package/dist/assets/{Public-B9WCVLI7.js → Public-0DIMrFya.js} +1 -1
  31. package/dist/assets/{SchemaReference.es--cFrK-mF.js → SchemaReference.es-ISuYhpDf.js} +1 -1
  32. package/dist/assets/{Search-xUbipjHz.js → Search-CQMDHt0w.js} +1 -1
  33. package/dist/assets/{Select-DdUtkwyq.js → Select-DXPyl9dO.js} +1 -1
  34. package/dist/assets/{Skeleton-DVrY1Qbr.js → Skeleton-URH_1vdL.js} +1 -1
  35. package/dist/assets/{Slider-110G8tdG.js → Slider-Bs8PTrpt.js} +1 -1
  36. package/dist/assets/{Stepper-D1V6NqBX.js → Stepper-F9lgPB4i.js} +1 -1
  37. package/dist/assets/{TextField-3uVNonhd.js → TextField-B9TZBqQf.js} +1 -1
  38. package/dist/assets/{ToggleButtonGroup-JLgFfvsV.js → ToggleButtonGroup-B4DF013K.js} +1 -1
  39. package/dist/assets/{ViewList-jxsh9SMq.js → ViewList-BsKNUMlP.js} +1 -1
  40. package/dist/assets/{actions-C2sJQ8Fo.js → actions-B9P9hAjw.js} +1 -1
  41. package/dist/assets/{actions-DbKUVgjV.js → actions-Dunvsfuf.js} +1 -1
  42. package/dist/assets/{agreement-DDEIcdN2.js → agreement-C1qfhTtQ.js} +1 -1
  43. package/dist/assets/api-BM9dJimB.js +1 -0
  44. package/dist/assets/{app-avatar-DxfZHNQ7.js → app-avatar-DQiSEUVG.js} +1 -1
  45. package/dist/assets/{audit-logs-CteQbS8_.js → audit-logs-C18DG_HF.js} +1 -1
  46. package/dist/assets/{brace-fold.es-CGA9Przx.js → brace-fold.es-5N33ToDI.js} +1 -1
  47. package/dist/assets/{bundle-avatar-DrhjE4I8.js → bundle-avatar-6edO3WvW.js} +1 -1
  48. package/dist/assets/{chart-D4E9CCIm.js → chart-DxusdyLS.js} +1 -1
  49. package/dist/assets/{click-to-copy-Cd2slBnK.js → click-to-copy-DdhnSrH5.js} +1 -1
  50. package/dist/assets/{closebrackets.es-n2RjIdxq.js → closebrackets.es-iyZsaRgi.js} +1 -1
  51. package/dist/assets/{codemirror.es-DPri5EWV.js → codemirror.es-DeO7gDXr.js} +1 -1
  52. package/dist/assets/{comment.es-C5rcyFQ8.js → comment.es-CfO1lV_o.js} +1 -1
  53. package/dist/assets/{config-navigation-Dhvd0Io1.js → config-navigation-CcJGg9PY.js} +1 -1
  54. package/dist/assets/{delete-confirm-ri-NT9BE.js → delete-confirm-C4Bk8D3q.js} +1 -1
  55. package/dist/assets/{detail-DjuS1eoq.js → detail-ByJGw6CQ.js} +3 -3
  56. package/dist/assets/{dialog.es-BwhOJ4Cq.js → dialog.es-CQHFFbgC.js} +1 -1
  57. package/dist/assets/{download-DChiY5q1.js → download-DjWKDAKk.js} +1 -1
  58. package/dist/assets/{foldgutter.es-BBpI4A5D.js → foldgutter.es-D2ybLApJ.js} +1 -1
  59. package/dist/assets/getValidReactChildren-BhT8Dia7.js +1 -0
  60. package/dist/assets/{hint.es-BAS5bESO.js → hint.es-U_5yDQ-L.js} +1 -1
  61. package/dist/assets/{hint.es2-BHkOTzjY.js → hint.es2-B5AxTcUD.js} +1 -1
  62. package/dist/assets/{iframe-9Q6zcs_o.js → iframe-CN6X1zkC.js} +1 -1
  63. package/dist/assets/index-7hmZo5yz.js +54 -0
  64. package/dist/assets/{index-Dw3AMY5z.js → index-9FRtImOR.js} +1 -1
  65. package/dist/assets/{index-D8yUR2aq.js → index-BO1T0fz0.js} +1 -1
  66. package/dist/assets/{index-BQUIGxYm.js → index-BUQuICIV.js} +1 -1
  67. package/dist/assets/{index-DysPnzV7.js → index-BXxemGex.js} +1 -1
  68. package/dist/assets/{index-BJEYtaIe.js → index-BiYiUZU0.js} +1 -1
  69. package/dist/assets/{index-CWU-40xT.js → index-Bj3d2EwJ.js} +3 -3
  70. package/dist/assets/{index-wR2FBwGe.js → index-Bpjx7556.js} +1 -1
  71. package/dist/assets/{index-F32lbxl3.js → index-BsRcoDUD.js} +1 -1
  72. package/dist/assets/{index-BQK6o51a.js → index-BysoAAKf.js} +10 -10
  73. package/dist/assets/{index-C3dyY7Jn.js → index-C5VGS0or.js} +1 -1
  74. package/dist/assets/{index-CFcksbYG.js → index-CBFgpWWt.js} +1 -1
  75. package/dist/assets/{index-CxfL2iNj.js → index-CBQDge9H.js} +1 -1
  76. package/dist/assets/{index-DtqP33jl.js → index-CBcjH65j.js} +1 -1
  77. package/dist/assets/{index-B6ebv4kj.js → index-CDk9gqwO.js} +1 -1
  78. package/dist/assets/{index-f9oKLglL.js → index-CNEFxICJ.js} +1 -1
  79. package/dist/assets/{index-D74eXDyn.js → index-CYqmm0Sa.js} +1 -1
  80. package/dist/assets/{index-CXkSaJRT.js → index-CaM460rw.js} +1 -1
  81. package/dist/assets/{index-CLeW9jNa.js → index-CiB-ceGd.js} +1 -1
  82. package/dist/assets/{index-C9Gucb3e.js → index-ClMriVhA.js} +1 -1
  83. package/dist/assets/{index-Dc91z-EC.js → index-CmUhV6b0.js} +1 -1
  84. package/dist/assets/{index-CcuoQAH9.js → index-Cqf3kTsw.js} +1 -1
  85. package/dist/assets/{index-BnOCj4ky.js → index-CsJW-E3u.js} +1 -1
  86. package/dist/assets/{index-DeBMBarq.js → index-CtlJtm28.js} +1 -1
  87. package/dist/assets/{index-DHhEgUS1.js → index-CzxambID.js} +5 -5
  88. package/dist/assets/{index-CXQ7qGR9.js → index-D3isMJCC.js} +1 -1
  89. package/dist/assets/{index-VH-ysxX_.js → index-D6XxoBY_.js} +1 -1
  90. package/dist/assets/{index-DwmHAX9V.js → index-DB54SdYK.js} +1 -1
  91. package/dist/assets/{index-BJy0Aykg.js → index-DHvVD3rl.js} +2 -2
  92. package/dist/assets/{index-CTxq4D6b.js → index-DINuwc4O.js} +3 -3
  93. package/dist/assets/{index-BhFjM9au.js → index-DRwkxXBX.js} +1 -1
  94. package/dist/assets/{index-CoYxdjrw.js → index-DqHjW7tc.js} +1 -1
  95. package/dist/assets/{index-BhpRo-lZ.js → index-DrZqlcHr.js} +1 -1
  96. package/dist/assets/index-Dw6syXvl.js +21 -0
  97. package/dist/assets/{index-DXRZFI-i.js → index-JuXoqefL.js} +1 -1
  98. package/dist/assets/{index-_GlgH8Bo.js → index-KnfQ44ac.js} +1 -1
  99. package/dist/assets/{index-Dyefferl.js → index-LuGhm-KA.js} +1 -1
  100. package/dist/assets/{index-8O7BlyHt.js → index-UfVz51n9.js} +1 -1
  101. package/dist/assets/{index-CzzL15YH.js → index-Ur9l5Pkv.js} +1 -1
  102. package/dist/assets/{index-Hv2GfUwQ.js → index-edI690Jp.js} +1 -1
  103. package/dist/assets/{index-CB6bYAXd.js → index-jYLpiIQq.js} +2 -2
  104. package/dist/assets/{index-B7nYrN4m.js → index-oWv9ehU5.js} +1 -1
  105. package/dist/assets/{index-BFpB8kh-.js → index-oxLMT1TZ.js} +1 -1
  106. package/dist/assets/{index.es-BYEd319I.js → index.es-BaoJVcS0.js} +1 -1
  107. package/dist/assets/{index.esm-CcmphPDr.js → index.esm-D5EJdopB.js} +1 -1
  108. package/dist/assets/{info-addon.es-Cj5Am4W8.js → info-addon.es-BF8YxAo6.js} +1 -1
  109. package/dist/assets/{info.es-CO85iRU8.js → info.es-BG-sFq93.js} +1 -1
  110. package/dist/assets/{install-from-url-DuMsEyFI.js → install-from-url-D_JUSXN1.js} +1 -1
  111. package/dist/assets/{invitation-B_cHWnei.js → invitation-B9fShyCE.js} +1 -1
  112. package/dist/assets/{is-path-prefix-equal-CYIvKmVL.js → is-path-prefix-equal-DTqcyXik.js} +1 -1
  113. package/dist/assets/{isEqual-GyLZxSRY.js → isEqual-BT0_AVZN.js} +1 -1
  114. package/dist/assets/{item-DE1w-7fx.js → item-k8JU-j43.js} +1 -1
  115. package/dist/assets/{javascript.es-BW5_tRcP.js → javascript.es-BxU6I3W8.js} +1 -1
  116. package/dist/assets/{jump-to-line.es-CHXn1yBu.js → jump-to-line.es-BJmdmPwT.js} +1 -1
  117. package/dist/assets/{jump.es-XIPua2Fi.js → jump.es-DdndOalg.js} +1 -1
  118. package/dist/assets/{line-aqaJQGOE.js → line-h_bDsdkk.js} +3 -3
  119. package/dist/assets/{lint.es-DDqYT3Z3.js → lint.es-S1IqD8Ty.js} +1 -1
  120. package/dist/assets/{lint.es2-UzvCZWiN.js → lint.es2-Pg9vOGzA.js} +1 -1
  121. package/dist/assets/{lint.es3-w94C1fvi.js → lint.es3-S5rsbMt9.js} +1 -1
  122. package/dist/assets/{list-header-BeAWG4F0.js → list-header-sMQeptfh.js} +1 -1
  123. package/dist/assets/{log-C18GoSnt.js → log-cMe-yCc9.js} +1 -1
  124. package/dist/assets/{lottie-BbyPiNfn.js → lottie-oKugLW27.js} +1 -1
  125. package/dist/assets/{matchbrackets.es-DZ1mhuIO.js → matchbrackets.es-CedBfYiO.js} +1 -1
  126. package/dist/assets/{memory-htbPwmSg.js → memory-DtZsgQku.js} +1 -1
  127. package/dist/assets/{mode.es-7keuh6oH.js → mode.es-BCvVo63y.js} +1 -1
  128. package/dist/assets/{mode.es2-vFQEp92Z.js → mode.es2-ahvvTvAM.js} +1 -1
  129. package/dist/assets/{mode.es3-Dn5SA7Oh.js → mode.es3-Bhh5S718.js} +1 -1
  130. package/dist/assets/{onlineParser.es--cELFe5v.js → onlineParser.es-D5Qe3rjM.js} +1 -1
  131. package/dist/assets/{overview-D6KKjePJ.js → overview-C8aXpNrX.js} +1 -1
  132. package/dist/assets/{react-BhYF7sD_.js → react-UY6g3dsd.js} +3 -3
  133. package/dist/assets/{redux-CIzpcDy1.js → redux-DYjmRPcE.js} +1 -1
  134. package/dist/assets/{resource-dialog-AGPGjRF5.js → resource-dialog-C82ZhW4T.js} +1 -1
  135. package/dist/assets/{runtime-CLIPNHPm.js → runtime-D1eyE8B1.js} +1 -1
  136. package/dist/assets/{search.es-CfOeePsS.js → search.es-0GT84-M2.js} +1 -1
  137. package/dist/assets/{searchcursor.es-RLZnp-2M.js → searchcursor.es-CX66aj_i.js} +1 -1
  138. package/dist/assets/service-DOjp5s19.js +1 -0
  139. package/dist/assets/{show-hint.es-D6R1Oh0E.js → show-hint.es-vCcUyQMQ.js} +1 -1
  140. package/dist/assets/{slicedToArray-CkMd8cEG.js → slicedToArray-I-ObepI-.js} +1 -1
  141. package/dist/assets/{spaces-Ndl2Z_l-.js → spaces-m3k1wtEz.js} +1 -1
  142. package/dist/assets/{sublime.es-BWpn5oL5.js → sublime.es-wltndpKH.js} +1 -1
  143. package/dist/assets/{switch-control-BL5Q92y_.js → switch-control-DSzxDtfl.js} +1 -1
  144. package/dist/assets/{table-icons-Bjq5TgED.js → table-icons-D70UZfU7.js} +2 -2
  145. package/dist/assets/{tag-Cksz2rJp.js → tag-BDr72C87.js} +1 -1
  146. package/dist/assets/{team-iad1pbmQ.js → team-Ch-Gj2hO.js} +1 -1
  147. package/dist/assets/{toUpper-DnPhzApo.js → toUpper-Bqm-4sXI.js} +1 -1
  148. package/dist/assets/{traffic-CWlSTLTp.js → traffic-BS6Lfitp.js} +1 -1
  149. package/dist/assets/{url-evaluation-CTHUhxLd.js → url-evaluation-ceiaoY0M.js} +1 -1
  150. package/dist/assets/{url-join-Dfl-k5vL.js → url-join-Bsj5KCM1.js} +1 -1
  151. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-BqhgZgq5.js → use-blocklet-info-for-connect-did-spaces-BQtm5420.js} +1 -1
  152. package/dist/assets/{useLocalStorage-B9e_6vUG.js → useLocalStorage-BOaGasKr.js} +1 -1
  153. package/dist/assets/{util-Brqqzx0p.js → util-CMnoIJSr.js} +1 -1
  154. package/dist/assets/{wait-container-CgxLnrOt.js → wait-container-CtbhxRrL.js} +1 -1
  155. package/dist/assets/{withStyles-CkukjHle.js → withStyles-CjmLVNUl.js} +1 -1
  156. package/dist/assets/{wrap-locale-Bh4fVNfi.js → wrap-locale-K8WYS2HB.js} +1 -1
  157. package/dist/index.html +1 -1
  158. package/dist/service-worker.js +1 -1
  159. package/package.json +1 -1
  160. package/dist/assets/DeleteOutline-BlZHBiGU.js +0 -1
  161. package/dist/assets/DeleteOutline-D7kF8YLA.js +0 -1
  162. package/dist/assets/api-3nNr_UzI.js +0 -1
  163. package/dist/assets/getValidReactChildren-2v0cL06g.js +0 -1
  164. package/dist/assets/index-CV9H0Z8Q.js +0 -54
  165. package/dist/assets/index-HsX6FBQ6.js +0 -21
  166. package/dist/assets/service-BE130afq.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as w,j as n,q as Z,u as ee,aj as Oe,cu as te,M as J,n as U,B as Xe,P as K,aw as Ye,z as Ne,cv as Ze,v as et,cw as tt,ac as nt,av as ge,bm as ve,a1 as G,b as oe,A as le,K as xe,ah as st,Q,V as X,C as A,N as Re,i as at,W as rt,x as ot,y as De,ag as lt,cx as it,ae as ct,c5 as $e,cy as ze,aa as ut,F as dt,aC as pt,H as ht,ak as mt,al as ft,am as gt,cz as vt,an as xt,J as bt,ao as yt,ap as q,aq as kt,ar as jt}from"./index-BJy0Aykg.js";import{L as Y,P as Ee,A as wt,S as Ct,a as Pt}from"./index-BnOCj4ky.js";import{u as Lt,A as _t,W as Ut,P as Bt,D as be,L as ye,d as ke,a as je}from"./wait-container-CgxLnrOt.js";import{C as Ie,d as St,A as Ot}from"./agreement-DDEIcdN2.js";import{a as Nt}from"./api-3nNr_UzI.js";import{i as Rt}from"./isEqual-GyLZxSRY.js";import{_ as Dt}from"./useLocalStorage-B9e_6vUG.js";import{s as $t}from"./logo-BKA11TRi.js";import"./url-join-Dfl-k5vL.js";import"./Skeleton-DVrY1Qbr.js";import"./Close-S913aeni.js";import"./lottie-BbyPiNfn.js";import"./index-BQUIGxYm.js";var ie={};Object.defineProperty(ie,"__esModule",{value:!0});var Te=ie.default=void 0;zt(w);var j=n;function zt(e){return e&&e.__esModule?e:{default:e}}function we(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),s.push.apply(s,r)}return s}function Ce(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?we(Object(s),!0).forEach(function(r){Et(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):we(Object(s)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})}return e}function Et(e,t,s){return t=It(t),t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function It(e){var t=Tt(e,"string");return typeof t=="symbol"?t:String(t)}function Tt(e,t){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ce=function(t){return(0,j.jsxs)("svg",Ce(Ce({},t),{},{children:[(0,j.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.642L31.72 0 13.288 10.642v14.152L1 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L62.44 53.172V31.89l-12.288-7.095V10.642zM60.52 32.997l-12.288-7.094V11.75L31.72 2.217 15.208 11.75v14.153L2.92 32.997v19.067l16.512 9.533L31.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_428)"}),(0,j.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 24.83L31.72 14.19 13.288 24.831v21.283L31.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L31.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L29.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L38.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_428)"}),(0,j.jsxs)("defs",{children:[(0,j.jsxs)("linearGradient",{id:"paint0_linear_615_428",x1:"31.72",y1:"95.721",x2:"95.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,j.jsx)("stop",{stopColor:"#0FA4B7"}),(0,j.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,j.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,j.jsxs)("linearGradient",{id:"paint1_linear_615_428",x1:"28.437",y1:"99.246",x2:"98.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,j.jsx)("stop",{stopColor:"#0FA4B7"}),(0,j.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,j.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};ce.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};ce.displayName="launcher-logo-notext";Te=ie.default=ce;var ue={};Object.defineProperty(ue,"__esModule",{value:!0});var Ae=ue.default=void 0;At(w);var x=n;function At(e){return e&&e.__esModule?e:{default:e}}function Pe(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),s.push.apply(s,r)}return s}function Le(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?Pe(Object(s),!0).forEach(function(r){Mt(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Pe(Object(s)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})}return e}function Mt(e,t,s){return t=Vt(t),t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Vt(e){var t=Ft(e,"string");return typeof t=="symbol"?t:String(t)}function Ft(e,t){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var de=function(t){return(0,x.jsxs)("svg",Le(Le({},t),{},{children:[(0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M80.005 25.994V10h7.737a3.79 3.79 0 0 1 3.79 3.79v1.149a3.777 3.777 0 0 1-1.035 2.602 3.788 3.788 0 0 1 1.901 3.286v1.377a3.79 3.79 0 0 1-3.79 3.79h-8.603zm1.684-8.957h6.226a2.105 2.105 0 0 0 1.932-2.098v-1.15a2.105 2.105 0 0 0-2.105-2.105h-6.053v5.353zm0 7.273v-5.582l6.92-.007c1.163 0 2.105.943 2.105 2.106v1.377a2.105 2.105 0 0 1-2.105 2.106h-6.92zM97.255 10v15.994h-1.762V10h1.762zm8.733 4.319h-1.827a3.81 3.81 0 0 0-3.811 3.81v4.054a3.81 3.81 0 0 0 3.811 3.81h1.827a3.811 3.811 0 0 0 3.811-3.81V18.13a3.811 3.811 0 0 0-3.811-3.81zm-1.827 1.762a2.05 2.05 0 0 0-2.049 2.048v4.054a2.05 2.05 0 0 0 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049V18.13a2.048 2.048 0 0 0-2.048-2.048h-1.827zM125.204 26v-5.754h2.148L130.674 26h2.035l-3.821-6.618 2.993-5.184h-2.035l-2.474 4.286h-2.168V10h-1.762v16h1.762zm-5.556-7.56v-.31a2.048 2.048 0 0 0-2.048-2.05h-1.827a2.048 2.048 0 0 0-2.049 2.05v4.053c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.312h-1.762zm17.918 7.554V10h-1.762v15.994h1.762zm4.989-5.357v1.546c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.746h.001v1.762h-7.687zm5.924-1.762h-5.924v-.746c0-1.131.917-2.048 2.049-2.048h1.827c1.131 0 2.048.917 2.048 2.048v.746zm5.489-1.912H152.4v-1.762h1.568v-2.848h1.684v2.848h4.077v1.762h-4.077v5.677a1.669 1.669 0 1 0 3.339 0v-.35h1.684v.35a3.353 3.353 0 1 1-6.707 0v-5.677z",fill:"#121319"}),(0,x.jsx)("path",{d:"M92.112 50.259v3.108H80.254V33.123h3.766v17.136h8.092zM101.843 47.235c-.999.047-1.839.135-2.52.266-.681.121-1.227.28-1.638.476-.41.196-.705.425-.882.686a1.49 1.49 0 0 0-.266.854c0 .606.177 1.04.532 1.302.364.261.835.392 1.414.392.71 0 1.32-.126 1.834-.378.523-.261 1.031-.654 1.526-1.176v-2.422zm-7.924-6.23c1.652-1.512 3.64-2.268 5.964-2.268.84 0 1.591.14 2.254.42.663.27 1.223.653 1.68 1.148a4.765 4.765 0 0 1 1.036 1.75c.243.681.364 1.428.364 2.24v9.072h-1.568c-.327 0-.579-.047-.756-.14-.177-.103-.317-.303-.42-.602l-.308-1.036c-.364.327-.719.616-1.064.868a6.54 6.54 0 0 1-1.078.616 5.498 5.498 0 0 1-1.204.378c-.42.093-.887.14-1.4.14-.607 0-1.167-.08-1.68-.238a3.775 3.775 0 0 1-1.33-.742 3.297 3.297 0 0 1-.868-1.218c-.206-.486-.308-1.05-.308-1.694a3.308 3.308 0 0 1 .77-2.114 5.12 5.12 0 0 1 1.078-.924c.438-.29.975-.541 1.61-.756a13.74 13.74 0 0 1 2.24-.518c.85-.14 1.82-.224 2.912-.252v-.84c0-.962-.205-1.67-.616-2.128-.411-.467-1.003-.7-1.778-.7-.56 0-1.027.065-1.4.196-.364.13-.686.28-.966.448-.28.159-.537.303-.77.434-.224.13-.476.196-.756.196-.243 0-.448-.06-.616-.182a1.67 1.67 0 0 1-.406-.448l-.616-1.106zM120.85 39.003v14.364h-2.114c-.458 0-.747-.21-.868-.63l-.238-1.148a7.862 7.862 0 0 1-1.946 1.456c-.71.364-1.545.546-2.506.546-.784 0-1.48-.13-2.086-.392a4.236 4.236 0 0 1-1.512-1.134 5.016 5.016 0 0 1-.938-1.722 7.52 7.52 0 0 1-.308-2.212v-9.128h3.458v9.128c0 .877.2 1.559.602 2.044.41.476 1.022.714 1.834.714.597 0 1.157-.13 1.68-.392a6.037 6.037 0 0 0 1.484-1.106V39.003h3.458zM127.512 40.767c.29-.29.593-.556.91-.798a5.623 5.623 0 0 1 2.184-1.036 5.542 5.542 0 0 1 1.344-.154c.784 0 1.48.135 2.086.406a3.957 3.957 0 0 1 1.512 1.12 4.69 4.69 0 0 1 .924 1.722c.215.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.2-1.554-.602-2.03-.401-.486-1.012-.728-1.834-.728-.597 0-1.157.135-1.68.406-.522.27-1.017.64-1.484 1.106v10.388h-3.458V39.003h2.114c.448 0 .742.21.882.63l.238 1.134zM150.373 42.04c-.103.132-.205.234-.308.309-.093.075-.233.112-.42.112a.982.982 0 0 1-.518-.154 9.315 9.315 0 0 0-.602-.364 3.902 3.902 0 0 0-.84-.364c-.317-.112-.714-.168-1.19-.168-.607 0-1.139.112-1.596.336-.457.215-.84.527-1.148.938-.299.41-.523.91-.672 1.498-.149.578-.224 1.236-.224 1.974 0 .765.079 1.447.238 2.044.168.597.406 1.101.714 1.512.308.401.681.71 1.12.924.439.205.933.308 1.484.308.551 0 .994-.066 1.33-.196.345-.14.635-.29.868-.448.233-.168.434-.318.602-.448a.925.925 0 0 1 .588-.21c.28 0 .49.107.63.322l.994 1.26a6.449 6.449 0 0 1-1.246 1.134 7.144 7.144 0 0 1-1.4.728 7.208 7.208 0 0 1-1.484.378 10.3 10.3 0 0 1-1.512.112 6.448 6.448 0 0 1-2.506-.49 6 6 0 0 1-2.058-1.456c-.588-.635-1.055-1.41-1.4-2.324-.336-.924-.504-1.974-.504-3.15 0-1.055.149-2.03.448-2.926.308-.906.756-1.685 1.344-2.338a6.09 6.09 0 0 1 2.184-1.554c.868-.373 1.867-.56 2.996-.56 1.073 0 2.011.172 2.814.518.812.345 1.54.84 2.184 1.484l-.91 1.26zM157.049 40.543a7.51 7.51 0 0 1 1.848-1.274c.672-.327 1.46-.49 2.366-.49.784 0 1.479.135 2.086.406.606.261 1.11.634 1.512 1.12.41.476.718 1.05.924 1.722.214.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.201-1.554-.602-2.03-.402-.486-1.013-.728-1.834-.728-.598 0-1.158.135-1.68.406-.523.27-1.018.64-1.484 1.106v10.388h-3.458V32.563h3.458v7.98zM178.649 44.533a3.95 3.95 0 0 0-.196-1.26 2.908 2.908 0 0 0-.559-1.05 2.562 2.562 0 0 0-.967-.7c-.382-.178-.83-.266-1.343-.266-.999 0-1.788.285-2.367.854-.569.57-.933 1.377-1.091 2.422h6.523zm-6.593 2.086c.056.737.186 1.377.392 1.918.205.532.475.975.811 1.33.336.345.733.607 1.191.784.466.168.98.252 1.54.252s1.04-.066 1.442-.196c.41-.13.765-.276 1.063-.434.308-.159.575-.304.799-.434.233-.13.457-.196.671-.196.29 0 .504.107.644.322l.995 1.26a5.93 5.93 0 0 1-1.289 1.134 7.641 7.641 0 0 1-1.498.728 8.291 8.291 0 0 1-1.581.378c-.532.074-1.05.112-1.554.112a7.766 7.766 0 0 1-2.786-.49 6.352 6.352 0 0 1-2.24-1.47c-.635-.653-1.134-1.456-1.498-2.408-.364-.962-.546-2.072-.546-3.332 0-.98.158-1.9.476-2.758.317-.868.77-1.62 1.358-2.254a6.462 6.462 0 0 1 2.17-1.526c.858-.373 1.824-.56 2.898-.56.905 0 1.74.144 2.506.434a5.41 5.41 0 0 1 1.973 1.274c.551.55.981 1.232 1.289 2.044.317.803.475 1.722.475 2.758 0 .523-.055.877-.167 1.064-.112.177-.327.266-.644.266h-8.89zM187.615 41.495c.448-.859.98-1.53 1.596-2.016.616-.495 1.344-.742 2.184-.742.662 0 1.194.145 1.596.434l-.224 2.59c-.047.168-.117.29-.21.364a.558.558 0 0 1-.35.098c-.14 0-.35-.023-.63-.07a4.704 4.704 0 0 0-.798-.07c-.383 0-.724.056-1.022.168-.299.112-.57.275-.812.49a3.359 3.359 0 0 0-.63.756c-.178.298-.346.64-.504 1.022v8.848h-3.458V39.003h2.03c.354 0 .602.065.742.196.14.121.233.345.28.672l.21 1.624z",fill:"#121319"}),(0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 10.642L30.72 0 12.288 10.642v14.152L0 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L61.44 53.172V31.89l-12.288-7.095V10.642zM59.52 32.997l-12.288-7.094V11.75L30.72 2.217 14.208 11.75v14.153L1.92 32.997v19.067l16.512 9.533L30.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_416)"}),(0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 24.83L30.72 14.19 12.288 24.831v21.283L30.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L30.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L28.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L37.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_416)"}),(0,x.jsxs)("defs",{children:[(0,x.jsxs)("linearGradient",{id:"paint0_linear_615_416",x1:"30.72",y1:"95.721",x2:"94.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,x.jsx)("stop",{stopColor:"#0FA4B7"}),(0,x.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,x.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,x.jsxs)("linearGradient",{id:"paint1_linear_615_416",x1:"27.437",y1:"99.246",x2:"97.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,x.jsx)("stop",{stopColor:"#0FA4B7"}),(0,x.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,x.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};de.defaultProps={width:"193",height:"64",viewBox:"0 0 193 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};de.displayName="launcher-logo";Ae=ue.default=de;function Wt(){const{t:e}=Z(),{info:t}=ee(),s=Oe(),r=decodeURIComponent(s.get("accessUrl")||""),{meta:l}=te();return n.jsx(qt,{children:n.jsx("div",{className:"body",children:n.jsx(Y,{variant:"success",title:J.getDisplayName({meta:l},!0),subTitle:e("launchBlocklet.installSuccess",{serverName:t.name}),footer:n.jsx(Ht,{href:r,rel:"noreferrer","data-cy":"open-blocklet",children:e("common.open")})})})})}const Ht=U.a`
1
+ import{r as w,j as n,q as Z,u as ee,aj as Oe,cu as te,M as J,n as U,B as Xe,P as K,aw as Ye,z as Ne,cv as Ze,v as et,cw as tt,ac as nt,av as ge,bm as ve,a1 as G,b as oe,A as le,K as xe,ah as st,Q,V as X,C as A,N as Re,i as at,W as rt,x as ot,y as De,ag as lt,cx as it,ae as ct,c5 as $e,cy as ze,aa as ut,F as dt,aC as pt,H as ht,ak as mt,al as ft,am as gt,cz as vt,an as xt,J as bt,ao as yt,ap as q,aq as kt,ar as jt}from"./index-DHvVD3rl.js";import{L as Y,P as Ee,A as wt,S as Ct,a as Pt}from"./index-CsJW-E3u.js";import{u as Lt,A as _t,W as Ut,P as Bt,D as be,L as ye,d as ke,a as je}from"./wait-container-CtbhxRrL.js";import{C as Ie,d as St,A as Ot}from"./agreement-C1qfhTtQ.js";import{a as Nt}from"./api-BM9dJimB.js";import{i as Rt}from"./isEqual-BT0_AVZN.js";import{_ as Dt}from"./useLocalStorage-BOaGasKr.js";import{s as $t}from"./logo-BKA11TRi.js";import"./url-join-Bsj5KCM1.js";import"./Skeleton-URH_1vdL.js";import"./Close-uiQeu7_r.js";import"./lottie-oKugLW27.js";import"./index-BUQuICIV.js";var ie={};Object.defineProperty(ie,"__esModule",{value:!0});var Te=ie.default=void 0;zt(w);var j=n;function zt(e){return e&&e.__esModule?e:{default:e}}function we(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),s.push.apply(s,r)}return s}function Ce(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?we(Object(s),!0).forEach(function(r){Et(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):we(Object(s)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})}return e}function Et(e,t,s){return t=It(t),t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function It(e){var t=Tt(e,"string");return typeof t=="symbol"?t:String(t)}function Tt(e,t){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ce=function(t){return(0,j.jsxs)("svg",Ce(Ce({},t),{},{children:[(0,j.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.642L31.72 0 13.288 10.642v14.152L1 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L62.44 53.172V31.89l-12.288-7.095V10.642zM60.52 32.997l-12.288-7.094V11.75L31.72 2.217 15.208 11.75v14.153L2.92 32.997v19.067l16.512 9.533L31.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_428)"}),(0,j.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 24.83L31.72 14.19 13.288 24.831v21.283L31.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L31.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L29.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L38.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_428)"}),(0,j.jsxs)("defs",{children:[(0,j.jsxs)("linearGradient",{id:"paint0_linear_615_428",x1:"31.72",y1:"95.721",x2:"95.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,j.jsx)("stop",{stopColor:"#0FA4B7"}),(0,j.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,j.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,j.jsxs)("linearGradient",{id:"paint1_linear_615_428",x1:"28.437",y1:"99.246",x2:"98.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,j.jsx)("stop",{stopColor:"#0FA4B7"}),(0,j.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,j.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};ce.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};ce.displayName="launcher-logo-notext";Te=ie.default=ce;var ue={};Object.defineProperty(ue,"__esModule",{value:!0});var Ae=ue.default=void 0;At(w);var x=n;function At(e){return e&&e.__esModule?e:{default:e}}function Pe(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),s.push.apply(s,r)}return s}function Le(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?Pe(Object(s),!0).forEach(function(r){Mt(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Pe(Object(s)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(s,r))})}return e}function Mt(e,t,s){return t=Vt(t),t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function Vt(e){var t=Ft(e,"string");return typeof t=="symbol"?t:String(t)}function Ft(e,t){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var r=s.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var de=function(t){return(0,x.jsxs)("svg",Le(Le({},t),{},{children:[(0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M80.005 25.994V10h7.737a3.79 3.79 0 0 1 3.79 3.79v1.149a3.777 3.777 0 0 1-1.035 2.602 3.788 3.788 0 0 1 1.901 3.286v1.377a3.79 3.79 0 0 1-3.79 3.79h-8.603zm1.684-8.957h6.226a2.105 2.105 0 0 0 1.932-2.098v-1.15a2.105 2.105 0 0 0-2.105-2.105h-6.053v5.353zm0 7.273v-5.582l6.92-.007c1.163 0 2.105.943 2.105 2.106v1.377a2.105 2.105 0 0 1-2.105 2.106h-6.92zM97.255 10v15.994h-1.762V10h1.762zm8.733 4.319h-1.827a3.81 3.81 0 0 0-3.811 3.81v4.054a3.81 3.81 0 0 0 3.811 3.81h1.827a3.811 3.811 0 0 0 3.811-3.81V18.13a3.811 3.811 0 0 0-3.811-3.81zm-1.827 1.762a2.05 2.05 0 0 0-2.049 2.048v4.054a2.05 2.05 0 0 0 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049V18.13a2.048 2.048 0 0 0-2.048-2.048h-1.827zM125.204 26v-5.754h2.148L130.674 26h2.035l-3.821-6.618 2.993-5.184h-2.035l-2.474 4.286h-2.168V10h-1.762v16h1.762zm-5.556-7.56v-.31a2.048 2.048 0 0 0-2.048-2.05h-1.827a2.048 2.048 0 0 0-2.049 2.05v4.053c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.312h-1.762zm17.918 7.554V10h-1.762v15.994h1.762zm4.989-5.357v1.546c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.746h.001v1.762h-7.687zm5.924-1.762h-5.924v-.746c0-1.131.917-2.048 2.049-2.048h1.827c1.131 0 2.048.917 2.048 2.048v.746zm5.489-1.912H152.4v-1.762h1.568v-2.848h1.684v2.848h4.077v1.762h-4.077v5.677a1.669 1.669 0 1 0 3.339 0v-.35h1.684v.35a3.353 3.353 0 1 1-6.707 0v-5.677z",fill:"#121319"}),(0,x.jsx)("path",{d:"M92.112 50.259v3.108H80.254V33.123h3.766v17.136h8.092zM101.843 47.235c-.999.047-1.839.135-2.52.266-.681.121-1.227.28-1.638.476-.41.196-.705.425-.882.686a1.49 1.49 0 0 0-.266.854c0 .606.177 1.04.532 1.302.364.261.835.392 1.414.392.71 0 1.32-.126 1.834-.378.523-.261 1.031-.654 1.526-1.176v-2.422zm-7.924-6.23c1.652-1.512 3.64-2.268 5.964-2.268.84 0 1.591.14 2.254.42.663.27 1.223.653 1.68 1.148a4.765 4.765 0 0 1 1.036 1.75c.243.681.364 1.428.364 2.24v9.072h-1.568c-.327 0-.579-.047-.756-.14-.177-.103-.317-.303-.42-.602l-.308-1.036c-.364.327-.719.616-1.064.868a6.54 6.54 0 0 1-1.078.616 5.498 5.498 0 0 1-1.204.378c-.42.093-.887.14-1.4.14-.607 0-1.167-.08-1.68-.238a3.775 3.775 0 0 1-1.33-.742 3.297 3.297 0 0 1-.868-1.218c-.206-.486-.308-1.05-.308-1.694a3.308 3.308 0 0 1 .77-2.114 5.12 5.12 0 0 1 1.078-.924c.438-.29.975-.541 1.61-.756a13.74 13.74 0 0 1 2.24-.518c.85-.14 1.82-.224 2.912-.252v-.84c0-.962-.205-1.67-.616-2.128-.411-.467-1.003-.7-1.778-.7-.56 0-1.027.065-1.4.196-.364.13-.686.28-.966.448-.28.159-.537.303-.77.434-.224.13-.476.196-.756.196-.243 0-.448-.06-.616-.182a1.67 1.67 0 0 1-.406-.448l-.616-1.106zM120.85 39.003v14.364h-2.114c-.458 0-.747-.21-.868-.63l-.238-1.148a7.862 7.862 0 0 1-1.946 1.456c-.71.364-1.545.546-2.506.546-.784 0-1.48-.13-2.086-.392a4.236 4.236 0 0 1-1.512-1.134 5.016 5.016 0 0 1-.938-1.722 7.52 7.52 0 0 1-.308-2.212v-9.128h3.458v9.128c0 .877.2 1.559.602 2.044.41.476 1.022.714 1.834.714.597 0 1.157-.13 1.68-.392a6.037 6.037 0 0 0 1.484-1.106V39.003h3.458zM127.512 40.767c.29-.29.593-.556.91-.798a5.623 5.623 0 0 1 2.184-1.036 5.542 5.542 0 0 1 1.344-.154c.784 0 1.48.135 2.086.406a3.957 3.957 0 0 1 1.512 1.12 4.69 4.69 0 0 1 .924 1.722c.215.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.2-1.554-.602-2.03-.401-.486-1.012-.728-1.834-.728-.597 0-1.157.135-1.68.406-.522.27-1.017.64-1.484 1.106v10.388h-3.458V39.003h2.114c.448 0 .742.21.882.63l.238 1.134zM150.373 42.04c-.103.132-.205.234-.308.309-.093.075-.233.112-.42.112a.982.982 0 0 1-.518-.154 9.315 9.315 0 0 0-.602-.364 3.902 3.902 0 0 0-.84-.364c-.317-.112-.714-.168-1.19-.168-.607 0-1.139.112-1.596.336-.457.215-.84.527-1.148.938-.299.41-.523.91-.672 1.498-.149.578-.224 1.236-.224 1.974 0 .765.079 1.447.238 2.044.168.597.406 1.101.714 1.512.308.401.681.71 1.12.924.439.205.933.308 1.484.308.551 0 .994-.066 1.33-.196.345-.14.635-.29.868-.448.233-.168.434-.318.602-.448a.925.925 0 0 1 .588-.21c.28 0 .49.107.63.322l.994 1.26a6.449 6.449 0 0 1-1.246 1.134 7.144 7.144 0 0 1-1.4.728 7.208 7.208 0 0 1-1.484.378 10.3 10.3 0 0 1-1.512.112 6.448 6.448 0 0 1-2.506-.49 6 6 0 0 1-2.058-1.456c-.588-.635-1.055-1.41-1.4-2.324-.336-.924-.504-1.974-.504-3.15 0-1.055.149-2.03.448-2.926.308-.906.756-1.685 1.344-2.338a6.09 6.09 0 0 1 2.184-1.554c.868-.373 1.867-.56 2.996-.56 1.073 0 2.011.172 2.814.518.812.345 1.54.84 2.184 1.484l-.91 1.26zM157.049 40.543a7.51 7.51 0 0 1 1.848-1.274c.672-.327 1.46-.49 2.366-.49.784 0 1.479.135 2.086.406.606.261 1.11.634 1.512 1.12.41.476.718 1.05.924 1.722.214.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.201-1.554-.602-2.03-.402-.486-1.013-.728-1.834-.728-.598 0-1.158.135-1.68.406-.523.27-1.018.64-1.484 1.106v10.388h-3.458V32.563h3.458v7.98zM178.649 44.533a3.95 3.95 0 0 0-.196-1.26 2.908 2.908 0 0 0-.559-1.05 2.562 2.562 0 0 0-.967-.7c-.382-.178-.83-.266-1.343-.266-.999 0-1.788.285-2.367.854-.569.57-.933 1.377-1.091 2.422h6.523zm-6.593 2.086c.056.737.186 1.377.392 1.918.205.532.475.975.811 1.33.336.345.733.607 1.191.784.466.168.98.252 1.54.252s1.04-.066 1.442-.196c.41-.13.765-.276 1.063-.434.308-.159.575-.304.799-.434.233-.13.457-.196.671-.196.29 0 .504.107.644.322l.995 1.26a5.93 5.93 0 0 1-1.289 1.134 7.641 7.641 0 0 1-1.498.728 8.291 8.291 0 0 1-1.581.378c-.532.074-1.05.112-1.554.112a7.766 7.766 0 0 1-2.786-.49 6.352 6.352 0 0 1-2.24-1.47c-.635-.653-1.134-1.456-1.498-2.408-.364-.962-.546-2.072-.546-3.332 0-.98.158-1.9.476-2.758.317-.868.77-1.62 1.358-2.254a6.462 6.462 0 0 1 2.17-1.526c.858-.373 1.824-.56 2.898-.56.905 0 1.74.144 2.506.434a5.41 5.41 0 0 1 1.973 1.274c.551.55.981 1.232 1.289 2.044.317.803.475 1.722.475 2.758 0 .523-.055.877-.167 1.064-.112.177-.327.266-.644.266h-8.89zM187.615 41.495c.448-.859.98-1.53 1.596-2.016.616-.495 1.344-.742 2.184-.742.662 0 1.194.145 1.596.434l-.224 2.59c-.047.168-.117.29-.21.364a.558.558 0 0 1-.35.098c-.14 0-.35-.023-.63-.07a4.704 4.704 0 0 0-.798-.07c-.383 0-.724.056-1.022.168-.299.112-.57.275-.812.49a3.359 3.359 0 0 0-.63.756c-.178.298-.346.64-.504 1.022v8.848h-3.458V39.003h2.03c.354 0 .602.065.742.196.14.121.233.345.28.672l.21 1.624z",fill:"#121319"}),(0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 10.642L30.72 0 12.288 10.642v14.152L0 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L61.44 53.172V31.89l-12.288-7.095V10.642zM59.52 32.997l-12.288-7.094V11.75L30.72 2.217 14.208 11.75v14.153L1.92 32.997v19.067l16.512 9.533L30.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_416)"}),(0,x.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 24.83L30.72 14.19 12.288 24.831v21.283L30.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L30.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L28.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L37.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_416)"}),(0,x.jsxs)("defs",{children:[(0,x.jsxs)("linearGradient",{id:"paint0_linear_615_416",x1:"30.72",y1:"95.721",x2:"94.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,x.jsx)("stop",{stopColor:"#0FA4B7"}),(0,x.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,x.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,x.jsxs)("linearGradient",{id:"paint1_linear_615_416",x1:"27.437",y1:"99.246",x2:"97.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,x.jsx)("stop",{stopColor:"#0FA4B7"}),(0,x.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,x.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};de.defaultProps={width:"193",height:"64",viewBox:"0 0 193 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};de.displayName="launcher-logo";Ae=ue.default=de;function Wt(){const{t:e}=Z(),{info:t}=ee(),s=Oe(),r=decodeURIComponent(s.get("accessUrl")||""),{meta:l}=te();return n.jsx(qt,{children:n.jsx("div",{className:"body",children:n.jsx(Y,{variant:"success",title:J.getDisplayName({meta:l},!0),subTitle:e("launchBlocklet.installSuccess",{serverName:t.name}),footer:n.jsx(Ht,{href:r,rel:"noreferrer","data-cy":"open-blocklet",children:e("common.open")})})})})}const Ht=U.a`
2
2
  display: block;
3
3
  height: 36px;
4
4
  color: ${e=>e.theme.palette.primary.main};
@@ -1,4 +1,4 @@
1
- import{bL as zo,j as e,aK as Mt,aL as Gt,q as V,O as j,ax as fe,P as r,A as N,bl as H,r as g,f as ye,bp as Ve,b as K,M as O,aO as Vn,U as Nt,cd as Be,n as F,K as Z,gG as Vo,bH as Ne,aW as xe,aV as dt,aC as At,a2 as ee,D as pt,F as k,bn as qo,Y as qe,$ as qn,a$ as _o,fD as Wo,fE as Ho,C as ae,f8 as Yo,y as co,av as rt,a1 as Ee,x as Lt,hv as Jo,hw as Ko,B as X,bb as po,H as zt,hx as Qo,m as $,a3 as Zo,ez as Xo,W as uo,Z as mo,ak as $o,w as es,J as fo,Q as Ge,V as ts,hy as ho,S as me,az as ns,aA as os,aB as ss,i as ut,hz as rs,cz as is,bg as as,h6 as ls,hA as cs,ay as _n,cx as ds,ad as Ae,aJ as go,bJ as Vt,cf as ps,hB as us,b6 as ms,z as fs,aX as Ot,T as hs,aN as ze,at as kt,dE as gs,bq as xo,fP as Ft,aF as xs,dM as ys,hC as Cs,ge as Wn,hD as Hn,gg as Yn,aY as js,G as nt,gi as vs,bI as Ss}from"./index-BJy0Aykg.js";import{d as Jn}from"./Add-NewVG93V.js";import{a as Rs,R as st,F as bs,L as Es,d as qt,b as _t}from"./line-aqaJQGOE.js";import{C as Ts,A as ws,d as Ps}from"./agreement-DDEIcdN2.js";import{E as Is}from"./index-Dc91z-EC.js";import{b as ks,a as Us,c as Ds,u as Wt,e as Bs}from"./actions-DbKUVgjV.js";import{S as Ns}from"./switch-control-BL5Q92y_.js";import{u as As}from"./detail-DjuS1eoq.js";import{d as yo}from"./Edit-BgzVDDnU.js";import{T as Ls}from"./index-DysPnzV7.js";import{T as Os,M as Fs,t as Ms}from"./table-icons-Bjq5TgED.js";import{C as Kn}from"./click-to-copy-Cd2slBnK.js";import{T as J}from"./TextField-3uVNonhd.js";import{d as Ht}from"./Link-CSeasEZI.js";import{c as Gs,C as zs,a as Vs,b as qs,D as _s,A as Ws,B as Hs,d as Ys,S as Js}from"./item-DE1w-7fx.js";import{u as Ks,a as Qs,P as Co,L as Qn,A as Zs,S as Xs}from"./index-BnOCj4ky.js";import{u as jo,t as $s}from"./toUpper-DnPhzApo.js";import{u as se,a as er}from"./team-iad1pbmQ.js";import{c as tr,d as nr,a as or,e as sr,f as rr,g as Zn,h as ir,i as Xn}from"./spaces-Ndl2Z_l-.js";import{d as ar}from"./EditIcon-D0wQcFnY.js";import{d as lr}from"./Done-BJ9nFL7V.js";import{C as cr}from"./Google-DU7ZCGKH.js";import{I as dr,B as pr}from"./install-from-url-DuMsEyFI.js";import{a as $n}from"./api-3nNr_UzI.js";import{v as vo,a as it}from"./util-Brqqzx0p.js";import{P as ur,u as mr}from"./use-blocklet-info-for-connect-did-spaces-BqhgZgq5.js";import{D as fr}from"./DeleteOutline-BlZHBiGU.js";import{S as eo}from"./index-DeBMBarq.js";import{d as hr}from"./ArrowDropDown-Bd9sR9Kj.js";import{_ as gr}from"./useLocalStorage-B9e_6vUG.js";import{d as xr}from"./LockIcon-BlIFddg8.js";import{d as mt}from"./Delete-LMbP8m3y.js";import{d as So}from"./Launch-D-68sLeU.js";import{C as yr}from"./delete-confirm-ri-NT9BE.js";import{W as _e}from"./tag-Cksz2rJp.js";import{d as Cr}from"./is-path-prefix-equal-CYIvKmVL.js";import{R as jr,b as to,B as Ro}from"./url-evaluation-CTHUhxLd.js";import{B as vr}from"./bundle-avatar-DrhjE4I8.js";import{A as Sr}from"./actions-C2sJQ8Fo.js";import{I as Ut}from"./index-VH-ysxX_.js";import{a as Rr}from"./index-F32lbxl3.js";import"./ButtonGroup-pLJbtCLI.js";import"./getValidReactChildren-2v0cL06g.js";import"./index-_GlgH8Bo.js";import"./index-BQUIGxYm.js";import"./url-join-Dfl-k5vL.js";import"./MoreVert-Cei2Rx5H.js";import"./app-avatar-DxfZHNQ7.js";import"./Breadcrumbs-AZ_8G3rf.js";import"./FilterList-YahW7b2T.js";import"./Select-DdUtkwyq.js";import"./InputLabel-DOxBtPfl.js";import"./LastPage-DmVgRYiw.js";import"./slicedToArray-CkMd8cEG.js";import"./Search-xUbipjHz.js";import"./ChevronLeft-C0YN2KhY.js";import"./ChevronRight-hQNW7SHU.js";import"./DeleteOutline-D7kF8YLA.js";import"./redux-CIzpcDy1.js";import"./Skeleton-DVrY1Qbr.js";import"./InputAdornment-CP3BhuEs.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-wR2FBwGe.js";import"./preact.module-B1z5cdvs.js";import"./Close-S913aeni.js";import"./lottie-BbyPiNfn.js";import"./Stepper-D1V6NqBX.js";import"./index-C9Gucb3e.js";const br=zo(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var Yt={},Er=Gt;Object.defineProperty(Yt,"__esModule",{value:!0});var bo=Yt.default=void 0,Tr=Er(Mt()),wr=e;bo=Yt.default=(0,Tr.default)((0,wr.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");function Jt({children:t,...o}){const{t:s}=V(),{updateAutoCheckUpdate:l,autoCheckUpdate:n}=As(),i=async()=>{try{const a=!(n!=null&&n.enabled);await l({enabled:a}),N.success(s(a?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(a){N.error(a.message)}},p=!!(n!=null&&n.enabled);return e.jsxs(j,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(fe,{title:s("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ns,{checked:p,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Jt.propTypes={children:r.any};Jt.defaultProps={children:null};const Pr=(t,o)=>{let{description:s}=t;return(Object.values(K.CHAIN_PROP_MAP).includes(t.key)||O.isEnvShareable(t))&&(s?s=`${s} (${o("blocklet.config.sharedToAllComponents")})`:s=o("blocklet.config.sharedToAllComponents")),s&&e.jsx("div",{style:{marginLeft:12},children:s})},Dt=(t,o,s=[])=>!(s!=null&&s.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(l=>l.name===t.key)&&o.children.every(l=>!l.meta.environments.find(n=>n.name===t.key))?!0:t.custom;function at({blocklet:t,ancestors:o}){const s=H(),{inService:l}=s,{t:n}=g.useContext(ye),i=[...o.map(f=>f.meta.did),t.meta.did],p=()=>N.success(n("blocklet.config.changedTip")),a=f=>Dt(f,t,o);if(Ve(t.status)||t.status==="unknown"&&Ve(t.status))return null;const u=async f=>{if(!f.key.trim()||!f.value.trim()){N.error(n("blocklet.config.environment.keyValueRequired"));return}if(f.key.startsWith("BLOCKLET_")||f.key.startsWith("COMPONENT_")){N.error(n("blocklet.config.environment.invalidKey"));return}f.custom=!0;try{const S=await s.api.configBlocklet({input:{did:i,configs:[f]}});p(S.blocklet)}catch(S){N.error(Z(S))}},x=async(f,S)=>{if(f.required&&(!f.key.trim()||!f.value.trim())){N.error(n("blocklet.config.environment.keyValueRequired"));return}if(f.key.startsWith("BLOCKLET_")&&!K.BLOCKLET_CONFIGURABLE_KEY[f.key]){N.error(n("blocklet.config.environment.invalidKey"));return}if(f.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const P=Vo(f);if(P){N.error(P);return}}const R=[{...f,value:f.secure&&f.value==="__encrypted__"?"":f.value}];if(f.key!==S.key){if(!Dt(f,t,o)){N.error("Only key of custom env can be changed");return}R.push({key:S.key,custom:!0})}try{const P=await s.api.configBlocklet({input:{did:i,configs:R}});p(P.blocklet)}catch(P){N.error(Z(P))}},y=async f=>{if(f.required){N.error(n("blocklet.config.environment.deleteForbidden"));return}if(!Dt(f,t,o)){N.error("Only key of custom env can be changed");return}try{const S=await s.api.configBlocklet({input:{did:i,configs:[{key:f.key,custom:!0}]}});p(S.blocklet)}catch(S){N.error(Z(S))}},d=(t.configs||[]).filter(f=>!K.BLOCKLET_CONFIGURABLE_KEY[f.key]),v=O.getSharedConfigObj(o[0],t),c=O.getComponentMissingConfigs(t,o[0]),h=d.map(f=>({...f,value:Object.values(K.CHAIN_PROP_MAP).includes(f.key)&&Object.keys(v).includes(f.key)?v[f.key]:v[f.key]||f.value})),C=h.some(f=>f.key&&f.key.startsWith("BWA_")),m={onRowAdd:u,onRowUpdate:x,onRowDelete:y,isDeletable:a},b=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:f=>e.jsx(Kn,{value:f.value,style:{color:f.required&&!f.value?"#ff4436":"#222222",fontWeight:f.required?"bold":"normal"},children:f.key}),editComponent:f=>{const{value:S,rowData:R,onChange:P}=f;return e.jsx(no,{children:e.jsx(J,{fullWidth:!0,size:"small",disabled:a(R)===!1,value:S,onChange:L=>P(L.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:f=>f.value?f.secure?"******":e.jsx(Kn,{unstyled:!0,value:f.value,style:{wordBreak:"break-all"},children:f.value}):null,editComponent:f=>{const{value:S,rowData:R,onChange:P}=f;return e.jsxs(no,{children:[e.jsx(J,{fullWidth:!0,size:"small",value:S==="__encrypted__"?"":S,onChange:L=>P(L.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Pr(R,n)]})}}];return e.jsxs(Ir,{children:[!!c.length&&e.jsx(Vn,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(Vn,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Nt,{permission:l?"":"mutate_blocklets",role:l?Be:[],children:f=>e.jsx(Os,{className:"config-table",children:e.jsx(Fs,{title:e.jsx("h4",{children:n("common.environment")}),columns:b(),icons:{...ks,...Ms},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:h,editable:f?m:{}})})})]})}at.propTypes={blocklet:r.object.isRequired,ancestors:r.array};at.defaultProps={ancestors:[]};const Ir=F.div`
1
+ import{bL as zo,j as e,aK as Mt,aL as Gt,q as V,O as j,ax as fe,P as r,A as N,bl as H,r as g,f as ye,bp as Ve,b as K,M as O,aO as Vn,U as Nt,cd as Be,n as F,K as Z,gG as Vo,bH as Ne,aW as xe,aV as dt,aC as At,a2 as ee,D as pt,F as k,bn as qo,Y as qe,$ as qn,a$ as _o,fD as Wo,fE as Ho,C as ae,f8 as Yo,y as co,av as rt,a1 as Ee,x as Lt,hv as Jo,hw as Ko,B as X,bb as po,H as zt,hx as Qo,m as $,a3 as Zo,ez as Xo,W as uo,Z as mo,ak as $o,w as es,J as fo,Q as Ge,V as ts,hy as ho,S as me,az as ns,aA as os,aB as ss,i as ut,hz as rs,cz as is,bg as as,h6 as ls,hA as cs,ay as _n,cx as ds,ad as Ae,aJ as go,bJ as Vt,cf as ps,hB as us,b6 as ms,z as fs,aX as Ot,T as hs,aN as ze,at as kt,dE as gs,bq as xo,fP as Ft,aF as xs,dM as ys,hC as Cs,ge as Wn,hD as Hn,gg as Yn,aY as js,G as nt,gi as vs,bI as Ss}from"./index-DHvVD3rl.js";import{d as Jn}from"./Add-CazR0vZK.js";import{a as Rs,R as st,F as bs,L as Es,d as qt,b as _t}from"./line-h_bDsdkk.js";import{C as Ts,A as ws,d as Ps}from"./agreement-C1qfhTtQ.js";import{E as Is}from"./index-CmUhV6b0.js";import{b as ks,a as Us,c as Ds,u as Wt,e as Bs}from"./actions-Dunvsfuf.js";import{S as Ns}from"./switch-control-DSzxDtfl.js";import{u as As}from"./detail-ByJGw6CQ.js";import{d as yo}from"./Edit-BgU3t9-z.js";import{T as Ls}from"./index-BXxemGex.js";import{T as Os,M as Fs,t as Ms}from"./table-icons-D70UZfU7.js";import{C as Kn}from"./click-to-copy-DdhnSrH5.js";import{T as J}from"./TextField-B9TZBqQf.js";import{d as Ht}from"./Link-ByQdtjfh.js";import{c as Gs,C as zs,a as Vs,b as qs,D as _s,A as Ws,B as Hs,d as Ys,S as Js}from"./item-k8JU-j43.js";import{u as Ks,a as Qs,P as Co,L as Qn,A as Zs,S as Xs}from"./index-CsJW-E3u.js";import{u as jo,t as $s}from"./toUpper-Bqm-4sXI.js";import{u as se,a as er}from"./team-Ch-Gj2hO.js";import{c as tr,d as nr,a as or,e as sr,f as rr,g as Zn,h as ir,i as Xn}from"./spaces-m3k1wtEz.js";import{d as ar}from"./EditIcon-CeWwrlQZ.js";import{d as lr}from"./Done-LyiBXZqg.js";import{C as cr}from"./Google-BzTTYoLn.js";import{I as dr,B as pr}from"./install-from-url-D_JUSXN1.js";import{a as $n}from"./api-BM9dJimB.js";import{v as vo,a as it}from"./util-CMnoIJSr.js";import{P as ur,u as mr}from"./use-blocklet-info-for-connect-did-spaces-BQtm5420.js";import{d as fr}from"./DeleteOutline-CnmOxEUl.js";import{S as eo}from"./index-CtlJtm28.js";import{d as hr}from"./ArrowDropDown-BUrSvBpJ.js";import{_ as gr}from"./useLocalStorage-BOaGasKr.js";import{d as xr}from"./LockIcon-C082WeKw.js";import{d as mt}from"./Delete-DHiwhVmP.js";import{d as So}from"./Launch-BOea_wCy.js";import{C as yr}from"./delete-confirm-C4Bk8D3q.js";import{W as _e}from"./tag-BDr72C87.js";import{d as Cr}from"./is-path-prefix-equal-DTqcyXik.js";import{R as jr,b as to,B as Ro}from"./url-evaluation-ceiaoY0M.js";import{B as vr}from"./bundle-avatar-6edO3WvW.js";import{A as Sr}from"./actions-B9P9hAjw.js";import{I as Ut}from"./index-D6XxoBY_.js";import{a as Rr}from"./index-BsRcoDUD.js";import"./ButtonGroup-DxRrpbFw.js";import"./getValidReactChildren-BhT8Dia7.js";import"./index-KnfQ44ac.js";import"./index-BUQuICIV.js";import"./url-join-Bsj5KCM1.js";import"./MoreVert-BzXa-i1R.js";import"./app-avatar-DQiSEUVG.js";import"./Breadcrumbs-D_LYBn3C.js";import"./FilterList-usqmRCGh.js";import"./Select-DXPyl9dO.js";import"./InputLabel-Csh1ynXt.js";import"./LastPage-DnsJsUIR.js";import"./slicedToArray-I-ObepI-.js";import"./Search-CQMDHt0w.js";import"./ChevronLeft-Bqynugte.js";import"./ChevronRight-C8sGT-T0.js";import"./redux-DYjmRPcE.js";import"./Skeleton-URH_1vdL.js";import"./InputAdornment-0DnARlEj.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-Bpjx7556.js";import"./preact.module-B1z5cdvs.js";import"./Close-uiQeu7_r.js";import"./lottie-oKugLW27.js";import"./Stepper-F9lgPB4i.js";import"./index-ClMriVhA.js";const br=zo(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var Yt={},Er=Gt;Object.defineProperty(Yt,"__esModule",{value:!0});var bo=Yt.default=void 0,Tr=Er(Mt()),wr=e;bo=Yt.default=(0,Tr.default)((0,wr.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");function Jt({children:t,...o}){const{t:s}=V(),{updateAutoCheckUpdate:l,autoCheckUpdate:n}=As(),i=async()=>{try{const a=!(n!=null&&n.enabled);await l({enabled:a}),N.success(s(a?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(a){N.error(a.message)}},p=!!(n!=null&&n.enabled);return e.jsxs(j,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(fe,{title:s("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ns,{checked:p,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Jt.propTypes={children:r.any};Jt.defaultProps={children:null};const Pr=(t,o)=>{let{description:s}=t;return(Object.values(K.CHAIN_PROP_MAP).includes(t.key)||O.isEnvShareable(t))&&(s?s=`${s} (${o("blocklet.config.sharedToAllComponents")})`:s=o("blocklet.config.sharedToAllComponents")),s&&e.jsx("div",{style:{marginLeft:12},children:s})},Dt=(t,o,s=[])=>!(s!=null&&s.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(l=>l.name===t.key)&&o.children.every(l=>!l.meta.environments.find(n=>n.name===t.key))?!0:t.custom;function at({blocklet:t,ancestors:o}){const s=H(),{inService:l}=s,{t:n}=g.useContext(ye),i=[...o.map(f=>f.meta.did),t.meta.did],p=()=>N.success(n("blocklet.config.changedTip")),a=f=>Dt(f,t,o);if(Ve(t.status)||t.status==="unknown"&&Ve(t.status))return null;const u=async f=>{if(!f.key.trim()||!f.value.trim()){N.error(n("blocklet.config.environment.keyValueRequired"));return}if(f.key.startsWith("BLOCKLET_")||f.key.startsWith("COMPONENT_")){N.error(n("blocklet.config.environment.invalidKey"));return}f.custom=!0;try{const S=await s.api.configBlocklet({input:{did:i,configs:[f]}});p(S.blocklet)}catch(S){N.error(Z(S))}},x=async(f,S)=>{if(f.required&&(!f.key.trim()||!f.value.trim())){N.error(n("blocklet.config.environment.keyValueRequired"));return}if(f.key.startsWith("BLOCKLET_")&&!K.BLOCKLET_CONFIGURABLE_KEY[f.key]){N.error(n("blocklet.config.environment.invalidKey"));return}if(f.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const P=Vo(f);if(P){N.error(P);return}}const R=[{...f,value:f.secure&&f.value==="__encrypted__"?"":f.value}];if(f.key!==S.key){if(!Dt(f,t,o)){N.error("Only key of custom env can be changed");return}R.push({key:S.key,custom:!0})}try{const P=await s.api.configBlocklet({input:{did:i,configs:R}});p(P.blocklet)}catch(P){N.error(Z(P))}},y=async f=>{if(f.required){N.error(n("blocklet.config.environment.deleteForbidden"));return}if(!Dt(f,t,o)){N.error("Only key of custom env can be changed");return}try{const S=await s.api.configBlocklet({input:{did:i,configs:[{key:f.key,custom:!0}]}});p(S.blocklet)}catch(S){N.error(Z(S))}},d=(t.configs||[]).filter(f=>!K.BLOCKLET_CONFIGURABLE_KEY[f.key]),v=O.getSharedConfigObj(o[0],t),c=O.getComponentMissingConfigs(t,o[0]),h=d.map(f=>({...f,value:Object.values(K.CHAIN_PROP_MAP).includes(f.key)&&Object.keys(v).includes(f.key)?v[f.key]:v[f.key]||f.value})),C=h.some(f=>f.key&&f.key.startsWith("BWA_")),m={onRowAdd:u,onRowUpdate:x,onRowDelete:y,isDeletable:a},b=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:f=>e.jsx(Kn,{value:f.value,style:{color:f.required&&!f.value?"#ff4436":"#222222",fontWeight:f.required?"bold":"normal"},children:f.key}),editComponent:f=>{const{value:S,rowData:R,onChange:P}=f;return e.jsx(no,{children:e.jsx(J,{fullWidth:!0,size:"small",disabled:a(R)===!1,value:S,onChange:L=>P(L.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:f=>f.value?f.secure?"******":e.jsx(Kn,{unstyled:!0,value:f.value,style:{wordBreak:"break-all"},children:f.value}):null,editComponent:f=>{const{value:S,rowData:R,onChange:P}=f;return e.jsxs(no,{children:[e.jsx(J,{fullWidth:!0,size:"small",value:S==="__encrypted__"?"":S,onChange:L=>P(L.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Pr(R,n)]})}}];return e.jsxs(Ir,{children:[!!c.length&&e.jsx(Vn,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(Vn,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Nt,{permission:l?"":"mutate_blocklets",role:l?Be:[],children:f=>e.jsx(Os,{className:"config-table",children:e.jsx(Fs,{title:e.jsx("h4",{children:n("common.environment")}),columns:b(),icons:{...ks,...Ms},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:h,editable:f?m:{}})})})]})}at.propTypes={blocklet:r.object.isRequired,ancestors:r.array};at.defaultProps={ancestors:[]};const Ir=F.div`
2
2
  .config-table {
3
3
  margin-bottom: 24px;
4
4
  position: relative;
@@ -63,7 +63,7 @@ import{bL as zo,j as e,aK as Mt,aL as Gt,q as V,O as j,ax as fe,P as r,A as N,bl
63
63
  .ux-dialog_right {
64
64
  padding-right: 20px;
65
65
  }
66
- `,{NODE_MODES:oo}=k,Ar=({mode:t,previousMode:o}={})=>t===oo.SERVERLESS||o===oo.SERVERLESS;var Eo={isInServerlessMode:Ar};function Lr(){const[t,o]=g.useState(null),{blocklet:s}=se();return g.useEffect(()=>{o(tr(s))},[s]),{storageEndpoint:t}}const To=g.createContext({}),{Provider:Or,Consumer:Ja}=To;function Kt({children:t}){const[o,s]=g.useState(!1),[l,n]=g.useState(null),{blocklet:i,actions:{refreshBlocklet:p}}=se(),{storageEndpoint:a}=Lr(),{api:u}=H();qo(async()=>{try{if(s(!0),qn.isEmpty(a)){n(null);return}const c=await nr(a);n(c)}catch(c){console.error(c),N.error(c.message)}finally{s(!1)}},[a]);const x=()=>{n(null),p()},y=async c=>{n(c),await d(c.endpoint),p()},d=async c=>{await u.configBlocklet({input:{did:[i.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:c}]}}),p()};g.useEffect(()=>{async function c(){if(!l)return;const h=await or(l.endpoint,l.name),C=qn.merge(l,{name:h});n(C)}c()},[]);const v=!!(a&&l);return e.jsx(Or,{value:{loading:o,spaceGateway:l,deleteSpaceGateway:x,updateSpaceGateway:y,storageEndpoint:a,settingStorageEndpoint:d,hasStorageEndpoint:v},children:t})}Kt.propTypes={children:qe.node.isRequired};Kt.defaultProps={};function Qt(){return g.useContext(To)}const Zt={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function Xt({editing:t,value:o,onChange:s}){const[l,n]=g.useState(!1),i=g.useRef(),p=g.useRef(o);g.useEffect(()=>{let d=null;return t&&(d=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(d)}},[t]);const a=d=>{p.current=d,s(d)},u=()=>{n(!1),s(p.current)},x=e.jsx(j,{className:"form-item-input slot",px:1,children:e.jsxs(j,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),y=e.jsxs(j,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[e.jsx(j,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),e.jsx(_o,{open:l,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(cr,{color:o,onChange:d=>a(d.hex)})})]});return t?y:x}Xt.propTypes=Zt;function $t({editing:t,description:o,value:s,onChange:l,componentProps:n,...i}){const{placeholder:p}=n,a=g.useRef(s),u=y=>{y.key==="Enter"&&l(a.current,"confirm")},x=y=>{a.current=y,l(y)};return t?e.jsx(J,{style:{flex:1},fullWidth:!0,value:s,onChange:y=>{y.persist(),x(y.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:u,...i}):e.jsx(j,{px:1,className:"form-item-input slot",children:s})}$t.propTypes=Zt;$t.defaultProps={componentProps:{}};function en({editing:t,value:o,onChange:s,componentProps:l,...n}){const{blocklet:i}=l,p=o==="auto"?Wo.getPassportColorFromDid(i.appDid):o;return e.jsxs(j,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Ho({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(Xt,{...n,editing:t,value:t?p:o,onChange:s,componentProps:l})]})}en.propTypes={...Zt,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};en.defaultProps={};const Fr={input:$t,color:Xt,passport:en,uploader:t=>e.jsx(Es,{...t.componentProps})};function Mr(t,{editing:o=!1}){const{componentType:s="input",render:l,renderFormItem:n}=t;return o&&n?n:!o&&l?l:Fr[s==null?void 0:s.toLowerCase()]}function tn({schema:t,loading:o,value:s,defaultValue:l,onChange:n,style:i,disabled:p}){const a=Object.prototype.toString.call(s)==="[object Object]",[u,x]=g.useState(null),[y,d]=g.useState(a?s:l),v=g.useRef();function c(m,b,f){const{key:S,secure:R}=m,L=y[S]!==b,A={...y,[S]:b};L&&d(A),n({[S]:b},{allValues:A,action:f,currentItem:m}),f==="confirm"&&R&&d({...y,[S]:"__encrypted__"}),["confirm","cancel"].includes(f)?h(null):h(m)}function h(m){if(m){v.current=y[m.key],x(m);return}v.current=null,x(null)}function C(m,{editing:b=!1}){const{key:f}=m,S=a?s[f]:y[f];return S==="__encrypted__"?b?"":"******":S}return e.jsx(Gr,{className:"form",style:i,children:t==null?void 0:t.map(m=>{const{key:b,description:f,required:S,solo:R=!1,hidden:P=!1,componentProps:L={}}=m;if(P)return null;const A=!!(u&&b===u.key),B=C(m,{editing:A}),D=Mr(m,{editing:A}),M={inputProps:{"data-cy":"schema-form-item-component"},key:b,description:f,editing:A,value:B,onChange:(I,Y="change")=>c(m,I,Y),componentProps:L};return e.jsxs(j,{className:"form-item",children:[!R&&e.jsxs(j,{className:"form-item-label",style:{color:S&&!B?"#ff0000":"#333"},children:[f,S&&e.jsx(st,{})]}),e.jsxs(j,{className:"form-item-body",children:[e.jsx(j,{className:"form-item-input",sx:{textAlign:R?"center":"left"},children:e.jsx(D,{...M})}),!R&&e.jsx(j,{className:"form-item-action",children:A?e.jsxs(e.Fragment,{children:[e.jsx(ee,{"data-cy":"schema-form-item-confirm",onClick:()=>{c(m,B,"confirm")},disabled:p||o,size:"large",children:o?e.jsx(ae,{size:24}):e.jsx(lr,{})}),e.jsx(ee,{"data-cy":"schema-form-item-cancel",onClick:()=>{c(m,v.current,"cancel")},disabled:p||o,size:"large",children:e.jsx(Yo,{})})]}):e.jsx(ee,{"data-cy":"schema-form-item-edit",onClick:()=>{c(m,y[b],"edit")},disabled:p||u,size:"large",children:e.jsx(ar,{})})})]})]},b)})})}tn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};tn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Gr=F(bs)``;function nn({meta:t,onCancel:o,mode:s,handlePaySuccess:l}){const{t:n,locale:i}=V(),{info:p}=H(),a=co(p),[u,x]=g.useState(null),y=new URL(t==null?void 0:t.registryUrl).origin,d=O.getDisplayName({meta:t}),v=async(h,C)=>{const m=({downloadTokenList:S})=>{l({downloadTokenList:S})},b=S=>{N.error(S),o(S)};function f(S){return Ko(()=>$n.get(S).then(async({data:R})=>{const P=R==null?void 0:R.downloadTokenList;if(R.status==="succeed"){if(P&&P.length)await m({downloadTokenList:P});else return await b(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return R.status==="error"?(console.error("vc error: ",R),await b(R==null?void 0:R.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:S}=Jo(u);await f(S)}else await m({downloadTokenList:h.downloadTokenList&&C(h.downloadTokenList)})};if(g.useEffect(()=>{if(s==="purchase"){const h=new URL(y);h.pathname="/api/did/verify-purchase-blocklet/token",h.searchParams.set("serverDid",p.did),h.searchParams.set("blockletDid",t==null?void 0:t.did);try{$n.get(h.href).then(({data:C})=>{const m=`${C.url}`;x(m)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{x(null)}},[s]),s==="purchase"&&!u)return"";const c={verify:{action:"verify-purchase-blocklet",checkFn:rt.create({baseURL:y}).get,extraParams:{serverDid:p.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:d}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:rt.create({baseURL:Ee(y,"/store")}).get,extraParams:{factory:t.nftFactory,nw:u},messages:{title:n("store.purchase.auth.title",{name:d}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(Lt,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:y,onSuccess:v,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:a,disableClose:!0,showDownload:!1,...c[s]})}nn.propTypes={...Gs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};nn.defaultProps={handlePaySuccess:()=>{}};const on=g.forwardRef(({mode:t,...o},s)=>{const[l,n]=g.useState(t!=="both"?t:"verify"),[i,p]=g.useState(t!=="both"?2:1),a=x=>{x!==l&&n(x)},u=()=>{l&&i!==2&&p(2)};return g.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(zs,{action:l,onNext:null,onSelect:a})}):e.jsx(nn,{...o,mode:l})});on.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};on.defaultProps={ref:{}};const zr=on;function Vr({...t}){return e.jsx(X,{className:"bottom-button",variant:"contained",color:"primary",...t})}function sn({key:t}={key:"sm"}){const o=po();return zt(o.breakpoints.down(t))}function rn({blocklet:t,onStartNow:o,children:s,disabled:l}){const{t:n}=V(),i=sn();return!t||Qo(t.meta)?e.jsx(qr,{children:s}):e.jsxs(_r,{isMobile:i,children:[e.jsx(Vr,{className:"start-now",variant:"contained",color:"primary",disabled:l,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(j,{display:"flex",alignItems:"center",children:s})]})}rn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};rn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const qr=F(j)`
66
+ `,{NODE_MODES:oo}=k,Ar=({mode:t,previousMode:o}={})=>t===oo.SERVERLESS||o===oo.SERVERLESS;var Eo={isInServerlessMode:Ar};function Lr(){const[t,o]=g.useState(null),{blocklet:s}=se();return g.useEffect(()=>{o(tr(s))},[s]),{storageEndpoint:t}}const To=g.createContext({}),{Provider:Or,Consumer:Ya}=To;function Kt({children:t}){const[o,s]=g.useState(!1),[l,n]=g.useState(null),{blocklet:i,actions:{refreshBlocklet:p}}=se(),{storageEndpoint:a}=Lr(),{api:u}=H();qo(async()=>{try{if(s(!0),qn.isEmpty(a)){n(null);return}const c=await nr(a);n(c)}catch(c){console.error(c),N.error(c.message)}finally{s(!1)}},[a]);const x=()=>{n(null),p()},y=async c=>{n(c),await d(c.endpoint),p()},d=async c=>{await u.configBlocklet({input:{did:[i.meta.did],configs:[{key:K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:c}]}}),p()};g.useEffect(()=>{async function c(){if(!l)return;const h=await or(l.endpoint,l.name),C=qn.merge(l,{name:h});n(C)}c()},[]);const v=!!(a&&l);return e.jsx(Or,{value:{loading:o,spaceGateway:l,deleteSpaceGateway:x,updateSpaceGateway:y,storageEndpoint:a,settingStorageEndpoint:d,hasStorageEndpoint:v},children:t})}Kt.propTypes={children:qe.node.isRequired};Kt.defaultProps={};function Qt(){return g.useContext(To)}const Zt={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function Xt({editing:t,value:o,onChange:s}){const[l,n]=g.useState(!1),i=g.useRef(),p=g.useRef(o);g.useEffect(()=>{let d=null;return t&&(d=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(d)}},[t]);const a=d=>{p.current=d,s(d)},u=()=>{n(!1),s(p.current)},x=e.jsx(j,{className:"form-item-input slot",px:1,children:e.jsxs(j,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),y=e.jsxs(j,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[e.jsx(j,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),e.jsx(_o,{open:l,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(cr,{color:o,onChange:d=>a(d.hex)})})]});return t?y:x}Xt.propTypes=Zt;function $t({editing:t,description:o,value:s,onChange:l,componentProps:n,...i}){const{placeholder:p}=n,a=g.useRef(s),u=y=>{y.key==="Enter"&&l(a.current,"confirm")},x=y=>{a.current=y,l(y)};return t?e.jsx(J,{style:{flex:1},fullWidth:!0,value:s,onChange:y=>{y.persist(),x(y.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||p,onKeyDown:u,...i}):e.jsx(j,{px:1,className:"form-item-input slot",children:s})}$t.propTypes=Zt;$t.defaultProps={componentProps:{}};function en({editing:t,value:o,onChange:s,componentProps:l,...n}){const{blocklet:i}=l,p=o==="auto"?Wo.getPassportColorFromDid(i.appDid):o;return e.jsxs(j,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Ho({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(Xt,{...n,editing:t,value:t?p:o,onChange:s,componentProps:l})]})}en.propTypes={...Zt,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};en.defaultProps={};const Fr={input:$t,color:Xt,passport:en,uploader:t=>e.jsx(Es,{...t.componentProps})};function Mr(t,{editing:o=!1}){const{componentType:s="input",render:l,renderFormItem:n}=t;return o&&n?n:!o&&l?l:Fr[s==null?void 0:s.toLowerCase()]}function tn({schema:t,loading:o,value:s,defaultValue:l,onChange:n,style:i,disabled:p}){const a=Object.prototype.toString.call(s)==="[object Object]",[u,x]=g.useState(null),[y,d]=g.useState(a?s:l),v=g.useRef();function c(m,b,f){const{key:S,secure:R}=m,L=y[S]!==b,A={...y,[S]:b};L&&d(A),n({[S]:b},{allValues:A,action:f,currentItem:m}),f==="confirm"&&R&&d({...y,[S]:"__encrypted__"}),["confirm","cancel"].includes(f)?h(null):h(m)}function h(m){if(m){v.current=y[m.key],x(m);return}v.current=null,x(null)}function C(m,{editing:b=!1}){const{key:f}=m,S=a?s[f]:y[f];return S==="__encrypted__"?b?"":"******":S}return e.jsx(Gr,{className:"form",style:i,children:t==null?void 0:t.map(m=>{const{key:b,description:f,required:S,solo:R=!1,hidden:P=!1,componentProps:L={}}=m;if(P)return null;const A=!!(u&&b===u.key),B=C(m,{editing:A}),D=Mr(m,{editing:A}),M={inputProps:{"data-cy":"schema-form-item-component"},key:b,description:f,editing:A,value:B,onChange:(I,Y="change")=>c(m,I,Y),componentProps:L};return e.jsxs(j,{className:"form-item",children:[!R&&e.jsxs(j,{className:"form-item-label",style:{color:S&&!B?"#ff0000":"#333"},children:[f,S&&e.jsx(st,{})]}),e.jsxs(j,{className:"form-item-body",children:[e.jsx(j,{className:"form-item-input",sx:{textAlign:R?"center":"left"},children:e.jsx(D,{...M})}),!R&&e.jsx(j,{className:"form-item-action",children:A?e.jsxs(e.Fragment,{children:[e.jsx(ee,{"data-cy":"schema-form-item-confirm",onClick:()=>{c(m,B,"confirm")},disabled:p||o,size:"large",children:o?e.jsx(ae,{size:24}):e.jsx(lr,{})}),e.jsx(ee,{"data-cy":"schema-form-item-cancel",onClick:()=>{c(m,v.current,"cancel")},disabled:p||o,size:"large",children:e.jsx(Yo,{})})]}):e.jsx(ee,{"data-cy":"schema-form-item-edit",onClick:()=>{c(m,y[b],"edit")},disabled:p||u,size:"large",children:e.jsx(ar,{})})})]})]},b)})})}tn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};tn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Gr=F(bs)``;function nn({meta:t,onCancel:o,mode:s,handlePaySuccess:l}){const{t:n,locale:i}=V(),{info:p}=H(),a=co(p),[u,x]=g.useState(null),y=new URL(t==null?void 0:t.registryUrl).origin,d=O.getDisplayName({meta:t}),v=async(h,C)=>{const m=({downloadTokenList:S})=>{l({downloadTokenList:S})},b=S=>{N.error(S),o(S)};function f(S){return Ko(()=>$n.get(S).then(async({data:R})=>{const P=R==null?void 0:R.downloadTokenList;if(R.status==="succeed"){if(P&&P.length)await m({downloadTokenList:P});else return await b(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return R.status==="error"?(console.error("vc error: ",R),await b(R==null?void 0:R.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:S}=Jo(u);await f(S)}else await m({downloadTokenList:h.downloadTokenList&&C(h.downloadTokenList)})};if(g.useEffect(()=>{if(s==="purchase"){const h=new URL(y);h.pathname="/api/did/verify-purchase-blocklet/token",h.searchParams.set("serverDid",p.did),h.searchParams.set("blockletDid",t==null?void 0:t.did);try{$n.get(h.href).then(({data:C})=>{const m=`${C.url}`;x(m)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{x(null)}},[s]),s==="purchase"&&!u)return"";const c={verify:{action:"verify-purchase-blocklet",checkFn:rt.create({baseURL:y}).get,extraParams:{serverDid:p.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:d}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:rt.create({baseURL:Ee(y,"/store")}).get,extraParams:{factory:t.nftFactory,nw:u},messages:{title:n("store.purchase.auth.title",{name:d}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(Lt,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:y,onSuccess:v,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:a,disableClose:!0,showDownload:!1,...c[s]})}nn.propTypes={...Gs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};nn.defaultProps={handlePaySuccess:()=>{}};const on=g.forwardRef(({mode:t,...o},s)=>{const[l,n]=g.useState(t!=="both"?t:"verify"),[i,p]=g.useState(t!=="both"?2:1),a=x=>{x!==l&&n(x)},u=()=>{l&&i!==2&&p(2)};return g.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(zs,{action:l,onNext:null,onSelect:a})}):e.jsx(nn,{...o,mode:l})});on.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};on.defaultProps={ref:{}};const zr=on;function Vr({...t}){return e.jsx(X,{className:"bottom-button",variant:"contained",color:"primary",...t})}function sn({key:t}={key:"sm"}){const o=po();return zt(o.breakpoints.down(t))}function rn({blocklet:t,onStartNow:o,children:s,disabled:l}){const{t:n}=V(),i=sn();return!t||Qo(t.meta)?e.jsx(qr,{children:s}):e.jsxs(_r,{isMobile:i,children:[e.jsx(Vr,{className:"start-now",variant:"contained",color:"primary",disabled:l,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(j,{display:"flex",alignItems:"center",children:s})]})}rn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};rn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const qr=F(j)`
67
67
  width: 100%;
68
68
  margin-top: auto;
69
69
  padding-top: 24px;
@@ -1,4 +1,4 @@
1
- import{r as p,c as ue,u as J,e as Pe,aE as Rr,j as e,F as D,aF as ln,aG as $n,aH as Tr,aI as cn,aJ as _t,aK as ge,aL as he,P as u,n as V,q as N,ad as ne,aM as dn,m as L,U as te,ax as pe,J as Se,B as G,C as Y,aN as Mn,K as de,O as ee,A as ce,f as Dt,R as zn,aO as Er,aP as Pr,aQ as Ar,aa as Ir,aR as Lr,aS as Or,aT as kr,z as Bn,W as un,T as mn,k as Q,aU as Rt,a as xt,S as ie,b as Je,aV as Wn,aW as qn,aX as Hn,aY as Fr,a2 as Nr,aZ as Ur,a_ as $r,a$ as Mr,b0 as zr,b1 as Br,b2 as ze,a8 as Wr,d as Kn,M as qr,b3 as Hr,aD as ut,b4 as Kr,a9 as mt,a6 as ft,b5 as Gr,a7 as yt,i as Gn,N as Yr,b6 as Vr,b7 as we,b8 as _e,b9 as Xr,ba as Qr,D as Yn,w as vt,bb as Jr,h as Zr,at as fn,bc as ei,bd as pn,aj as ti,be as ni,bf as ri,bg as ii}from"./index-BJy0Aykg.js";import{T as oi}from"./index-DysPnzV7.js";import{d as ai}from"./ArrowDropDown-Bd9sR9Kj.js";import{u as Tt,C as re,a as gn}from"./index.esm-CcmphPDr.js";import{S as je}from"./switch-control-BL5Q92y_.js";import{d as Vn,i as si}from"./is-path-prefix-equal-CYIvKmVL.js";import{T as K,F as li}from"./TextField-3uVNonhd.js";import{D as Xn,g as ci}from"./index-CLeW9jNa.js";import{d as Qn}from"./Link-CSeasEZI.js";import{d as Ae}from"./Delete-LMbP8m3y.js";import{C as Et}from"./delete-confirm-ri-NT9BE.js";import{I as Be}from"./index-VH-ysxX_.js";import{s as di}from"./logo-BKA11TRi.js";import{_ as ui}from"./useLocalStorage-B9e_6vUG.js";import{L as mi}from"./LoadingButton-CuJ6PUWH.js";import{C as fi,d as Jn}from"./Public-B9WCVLI7.js";import{d as Pt}from"./Add-NewVG93V.js";import{a as pi,B as Zn,D as hn,R as gi,b as hi}from"./url-evaluation-CTHUhxLd.js";import{d as xi}from"./CheckCircle-DkW4b6y7.js";import{d as yi}from"./ChevronRight-hQNW7SHU.js";import{d as vi}from"./MoreVert-Cei2Rx5H.js";import{d as er}from"./Edit-BgzVDDnU.js";import{d as bi,a as tr}from"./Https-CsrqmSk1.js";import{W as $e}from"./tag-Cksz2rJp.js";import{w as ji}from"./withStyles-CkukjHle.js";import{S as Ci}from"./Slider-110G8tdG.js";import"./index-F32lbxl3.js";import"./Select-DdUtkwyq.js";import"./InputLabel-DOxBtPfl.js";import"./FilterList-YahW7b2T.js";import"./LastPage-DmVgRYiw.js";import"./index-f9oKLglL.js";import"./redux-CIzpcDy1.js";import"./Search-xUbipjHz.js";import"./index-Dc91z-EC.js";import"./click-to-copy-Cd2slBnK.js";const fe="Dashboard",nr=p.createContext({}),{Provider:Si,Consumer:ns}=nr,xn=[fe,D.DOMAIN_FOR_IP_SITE,D.DOMAIN_FOR_IP_SITE_REGEXP],wi=(t,n)=>{if(t.name===D.DOMAIN_FOR_DEFAULT_SITE)return-1;if(n.name===D.DOMAIN_FOR_DEFAULT_SITE)return 1;const r=xn.includes(t.name),i=xn.includes(n.name);return r&&i?cn(t.name,n.name):r?-1:i?1:cn(t.name,n.name)},_i=({sites:t,nodePort:n})=>{const r=window.location.host,o=(t||[]).map(a=>{const{id:l,rules:c=[],corsAllowedOrigins:h=[]}=a;let{domain:d,domainAliases:m}=a;m=m||[],[D.DOMAIN_FOR_IP_SITE,D.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=fe,m.find(f=>f.value===r)||m.unshift({protected:!1,value:r}));const g={id:l,name:d,type:"domain",items:[],domainAliases:m,isProtected:a.isProtected,corsAllowedOrigins:h};return(c||[]).forEach(f=>{const{id:y,isProtected:j,from:{pathPrefix:b},to:S}=f;if(S.type===D.ROUTING_RULE_TYPES.BLOCKLET){let R="";Number.parseInt(S.port,10)===Number.parseInt(n,10)?(R="Blocklet Server Dashboard",S.type=D.ROUTING_RULE_TYPES.DAEMON):R=S.did,g.items.push({id:y,name:ln(b||"/"),title:R,type:"rule",isProtected:j,pathPrefix:b,to:S})}else g.items.push({id:y,pathPrefix:b,name:ln(b||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:j,to:S})}),g.items=$n(g.items,f=>f.name),g}).sort(wi),s=o.reduce((a,l)=>{let{name:c}=l;return c.endsWith(D.BLOCKLET_SITE_GROUP_SUFFIX)&&([c]=c.split(".")),a[c]={...l,rules:l.items},a},{});return{sites:o,siteMap:s}},Di=({did:t,domain:n,mountPoint:r,siteMap:i,params:o}={})=>{if(!i)return null;const s=i[t];if(!s)return null;const a=n||(s.domainAliases||[])[0];if(!a)return null;let l=r;if(!l){const c=s.rules.filter(h=>!h.name.startsWith(D.WELLKNOWN_PATH_PREFIX))[0];l=c?c.name:"/"}return _t(a.value,l,o)},Ri=({did:t,mountPoint:n,siteMap:r,params:i}={})=>{if(!r)return[];const o=r[t];if(!o)return[];const s=o.domainAliases||[];if(!s.length)return[];let a=n;if(!a){const l=o.rules.filter(c=>!c.name.startsWith(D.WELLKNOWN_PATH_PREFIX))[0];a=l?l.name:"/"}return s.map(l=>_t(l.value,a,i))},Ti=t=>{const n=t.map(i=>i.domain).filter(i=>![D.DOMAIN_FOR_IP_SITE_REGEXP,D.DOMAIN_FOR_DEFAULT_SITE].includes(i));let r=[];return t.forEach(i=>r.push(...i.domainAliases||[])),r=r.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:n,domainsAliases:r}};function yn({children:t}){const n=ue(),{info:r}=J(),[i,o]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState([]),h=Pe(async()=>{const{sites:P}=await n.getRoutingSites({input:{snapshotHash:""}}),T=P||[];await Promise.all(T.map(async v=>(v.domainAliases=await Rr(v.domainAliases,{getIP:Tr}),v)));const I=Ti(T);o(T),a(I.domains),c([window.location.hostname,...I.domains,...I.domainsAliases.map(v=>v.value)])},[r]),d=(P,T)=>{o(I=>I.map(v=>v.id===P?T.domain?T:{...T,domain:v.domain}:v))},m=P=>n.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),g=async P=>{const T=await n.addRoutingSite({input:P});o(i.concat(T.site))},f=async(P,T)=>{const I=await n.updateRoutingSite({input:{id:P,...T}});if(I.site&&I.site.id){const v=i.findIndex(A=>A.id===I.site.id);v!==-1&&(i.splice(v,1,I.site),o([].concat(i)))}},y=async P=>{await n.deleteRoutingSite({input:{id:P}}),o(i.filter(T=>T.id!==P))},j=async(P,T,I)=>{const v=await n.addDomainAlias({input:{id:P,domainAlias:T,force:I}});d(P,v.site)},b=async(P,T)=>{const I=await n.deleteDomainAlias({input:{id:P,domainAlias:T}});d(P,I.site)},S=async(P,T)=>{const{site:I}=await n.addRoutingRule({input:{id:P,rule:T}});d(P,I)},R=async(P,T)=>{const{site:I}=await n.updateRoutingRule({input:{id:P,rule:T}});d(P,I)},C=async(P,T)=>{const{site:I}=await n.deleteRoutingRule({input:{id:P,ruleId:T}});d(P,I)},x={loading:h.loading,error:h.error,refresh:h.retry,api:n,actions:{addSite:g,updateSite:f,deleteSite:y,addDomainAlias:j,deleteDomainAlias:b,takeSnapshot:m,addRule:S,updateRule:R,deleteRule:C}},{sites:E,siteMap:_}=_i({sites:i,nodePort:r.port});return x.sites=E,x.siteMap=_,x.domains=s,x.allDomains=l,x.getBlockletUrl=({did:P,domain:T,mountPoint:I,params:v})=>Di({did:P,domain:T,mountPoint:I,siteMap:x.siteMap,params:v}),x.getBlockletUrls=({did:P,mountPoint:T,params:I})=>Ri({did:P,mountPoint:T,siteMap:x.siteMap,params:I}),e.jsx(Si,{value:{routing:x},children:t})}function ae(){const{routing:t}=p.useContext(nr);return t}function At(t){const n=[D.DOMAIN_FOR_IP_SITE_REGEXP,D.DOMAIN_FOR_DEFAULT_SITE,D.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&n.push(window.location.hostname),n.includes(t)}var It={},Ei=he;Object.defineProperty(It,"__esModule",{value:!0});var rr=It.default=void 0,Pi=Ei(ge()),Ai=e;rr=It.default=(0,Pi.default)((0,Ai.jsx)("path",{d:"m7 14 5-5 5 5z"}),"ArrowDropUp");function Ii(){return null}function Lt({confirm:t}){const[n,r]=p.useState(null),{t:i}=N(),o=()=>{r(null)},s=async l=>{if(l){let c=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";c==="/"?dn.push(`${l.pathname}`):(c.endsWith("/")&&(c=c.substring(0,c.length-1)),dn.push(`${c}${l.pathname}`)),window.location.reload()}},a=(l,...c)=>{let h=typeof t=="function"?t(l,...c):t;return h?(typeof h=="string"&&(h={description:h}),r({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>s(l),onCancel:()=>o(),...h}),!1):!0};return e.jsxs(Li,{children:[e.jsx(Ii,{message:a}),n&&e.jsx(ne,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})]})}Lt.propTypes={confirm:u.oneOfType([u.object,u.string,u.func])};Lt.defaultProps={confirm:null};const Li=V.div`
1
+ import{r as p,c as ue,u as J,e as Pe,aE as Rr,j as e,F as D,aF as ln,aG as $n,aH as Tr,aI as cn,aJ as _t,aK as ge,aL as he,P as u,n as V,q as N,ad as ne,aM as dn,m as L,U as te,ax as pe,J as Se,B as G,C as Y,aN as Mn,K as de,O as ee,A as ce,f as Dt,R as zn,aO as Er,aP as Pr,aQ as Ar,aa as Ir,aR as Lr,aS as Or,aT as kr,z as Bn,W as un,T as mn,k as Q,aU as Rt,a as xt,S as ie,b as Je,aV as Wn,aW as qn,aX as Hn,aY as Fr,a2 as Nr,aZ as Ur,a_ as $r,a$ as Mr,b0 as zr,b1 as Br,b2 as ze,a8 as Wr,d as Kn,M as qr,b3 as Hr,aD as ut,b4 as Kr,a9 as mt,a6 as ft,b5 as Gr,a7 as yt,i as Gn,N as Yr,b6 as Vr,b7 as we,b8 as _e,b9 as Xr,ba as Qr,D as Yn,w as vt,bb as Jr,h as Zr,at as fn,bc as ei,bd as pn,aj as ti,be as ni,bf as ri,bg as ii}from"./index-DHvVD3rl.js";import{T as oi}from"./index-BXxemGex.js";import{d as ai}from"./ArrowDropDown-BUrSvBpJ.js";import{u as Tt,C as re,a as gn}from"./index.esm-D5EJdopB.js";import{S as je}from"./switch-control-DSzxDtfl.js";import{d as Vn,i as si}from"./is-path-prefix-equal-DTqcyXik.js";import{T as K,F as li}from"./TextField-B9TZBqQf.js";import{D as Xn,g as ci}from"./index-CiB-ceGd.js";import{d as Qn}from"./Link-ByQdtjfh.js";import{d as Ae}from"./Delete-DHiwhVmP.js";import{C as Et}from"./delete-confirm-C4Bk8D3q.js";import{I as Be}from"./index-D6XxoBY_.js";import{s as di}from"./logo-BKA11TRi.js";import{_ as ui}from"./useLocalStorage-BOaGasKr.js";import{L as mi}from"./LoadingButton-Cj_wXKeI.js";import{C as fi,d as Jn}from"./Public-0DIMrFya.js";import{d as Pt}from"./Add-CazR0vZK.js";import{a as pi,B as Zn,D as hn,R as gi,b as hi}from"./url-evaluation-ceiaoY0M.js";import{d as xi}from"./CheckCircle-DbpNufE5.js";import{d as yi}from"./ChevronRight-C8sGT-T0.js";import{d as vi}from"./MoreVert-BzXa-i1R.js";import{d as er}from"./Edit-BgU3t9-z.js";import{d as bi,a as tr}from"./Https-B3r3YjjJ.js";import{W as $e}from"./tag-BDr72C87.js";import{w as ji}from"./withStyles-CjmLVNUl.js";import{S as Ci}from"./Slider-Bs8PTrpt.js";import"./index-BsRcoDUD.js";import"./Select-DXPyl9dO.js";import"./InputLabel-Csh1ynXt.js";import"./FilterList-usqmRCGh.js";import"./LastPage-DnsJsUIR.js";import"./index-CNEFxICJ.js";import"./redux-DYjmRPcE.js";import"./Search-CQMDHt0w.js";import"./index-CmUhV6b0.js";import"./click-to-copy-DdhnSrH5.js";const fe="Dashboard",nr=p.createContext({}),{Provider:Si,Consumer:ns}=nr,xn=[fe,D.DOMAIN_FOR_IP_SITE,D.DOMAIN_FOR_IP_SITE_REGEXP],wi=(t,n)=>{if(t.name===D.DOMAIN_FOR_DEFAULT_SITE)return-1;if(n.name===D.DOMAIN_FOR_DEFAULT_SITE)return 1;const r=xn.includes(t.name),i=xn.includes(n.name);return r&&i?cn(t.name,n.name):r?-1:i?1:cn(t.name,n.name)},_i=({sites:t,nodePort:n})=>{const r=window.location.host,o=(t||[]).map(a=>{const{id:l,rules:c=[],corsAllowedOrigins:h=[]}=a;let{domain:d,domainAliases:m}=a;m=m||[],[D.DOMAIN_FOR_IP_SITE,D.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=fe,m.find(f=>f.value===r)||m.unshift({protected:!1,value:r}));const g={id:l,name:d,type:"domain",items:[],domainAliases:m,isProtected:a.isProtected,corsAllowedOrigins:h};return(c||[]).forEach(f=>{const{id:y,isProtected:j,from:{pathPrefix:b},to:S}=f;if(S.type===D.ROUTING_RULE_TYPES.BLOCKLET){let R="";Number.parseInt(S.port,10)===Number.parseInt(n,10)?(R="Blocklet Server Dashboard",S.type=D.ROUTING_RULE_TYPES.DAEMON):R=S.did,g.items.push({id:y,name:ln(b||"/"),title:R,type:"rule",isProtected:j,pathPrefix:b,to:S})}else g.items.push({id:y,pathPrefix:b,name:ln(b||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:j,to:S})}),g.items=$n(g.items,f=>f.name),g}).sort(wi),s=o.reduce((a,l)=>{let{name:c}=l;return c.endsWith(D.BLOCKLET_SITE_GROUP_SUFFIX)&&([c]=c.split(".")),a[c]={...l,rules:l.items},a},{});return{sites:o,siteMap:s}},Di=({did:t,domain:n,mountPoint:r,siteMap:i,params:o}={})=>{if(!i)return null;const s=i[t];if(!s)return null;const a=n||(s.domainAliases||[])[0];if(!a)return null;let l=r;if(!l){const c=s.rules.filter(h=>!h.name.startsWith(D.WELLKNOWN_PATH_PREFIX))[0];l=c?c.name:"/"}return _t(a.value,l,o)},Ri=({did:t,mountPoint:n,siteMap:r,params:i}={})=>{if(!r)return[];const o=r[t];if(!o)return[];const s=o.domainAliases||[];if(!s.length)return[];let a=n;if(!a){const l=o.rules.filter(c=>!c.name.startsWith(D.WELLKNOWN_PATH_PREFIX))[0];a=l?l.name:"/"}return s.map(l=>_t(l.value,a,i))},Ti=t=>{const n=t.map(i=>i.domain).filter(i=>![D.DOMAIN_FOR_IP_SITE_REGEXP,D.DOMAIN_FOR_DEFAULT_SITE].includes(i));let r=[];return t.forEach(i=>r.push(...i.domainAliases||[])),r=r.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:n,domainsAliases:r}};function yn({children:t}){const n=ue(),{info:r}=J(),[i,o]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState([]),h=Pe(async()=>{const{sites:P}=await n.getRoutingSites({input:{snapshotHash:""}}),T=P||[];await Promise.all(T.map(async v=>(v.domainAliases=await Rr(v.domainAliases,{getIP:Tr}),v)));const I=Ti(T);o(T),a(I.domains),c([window.location.hostname,...I.domains,...I.domainsAliases.map(v=>v.value)])},[r]),d=(P,T)=>{o(I=>I.map(v=>v.id===P?T.domain?T:{...T,domain:v.domain}:v))},m=P=>n.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),g=async P=>{const T=await n.addRoutingSite({input:P});o(i.concat(T.site))},f=async(P,T)=>{const I=await n.updateRoutingSite({input:{id:P,...T}});if(I.site&&I.site.id){const v=i.findIndex(A=>A.id===I.site.id);v!==-1&&(i.splice(v,1,I.site),o([].concat(i)))}},y=async P=>{await n.deleteRoutingSite({input:{id:P}}),o(i.filter(T=>T.id!==P))},j=async(P,T,I)=>{const v=await n.addDomainAlias({input:{id:P,domainAlias:T,force:I}});d(P,v.site)},b=async(P,T)=>{const I=await n.deleteDomainAlias({input:{id:P,domainAlias:T}});d(P,I.site)},S=async(P,T)=>{const{site:I}=await n.addRoutingRule({input:{id:P,rule:T}});d(P,I)},R=async(P,T)=>{const{site:I}=await n.updateRoutingRule({input:{id:P,rule:T}});d(P,I)},C=async(P,T)=>{const{site:I}=await n.deleteRoutingRule({input:{id:P,ruleId:T}});d(P,I)},x={loading:h.loading,error:h.error,refresh:h.retry,api:n,actions:{addSite:g,updateSite:f,deleteSite:y,addDomainAlias:j,deleteDomainAlias:b,takeSnapshot:m,addRule:S,updateRule:R,deleteRule:C}},{sites:E,siteMap:_}=_i({sites:i,nodePort:r.port});return x.sites=E,x.siteMap=_,x.domains=s,x.allDomains=l,x.getBlockletUrl=({did:P,domain:T,mountPoint:I,params:v})=>Di({did:P,domain:T,mountPoint:I,siteMap:x.siteMap,params:v}),x.getBlockletUrls=({did:P,mountPoint:T,params:I})=>Ri({did:P,mountPoint:T,siteMap:x.siteMap,params:I}),e.jsx(Si,{value:{routing:x},children:t})}function ae(){const{routing:t}=p.useContext(nr);return t}function At(t){const n=[D.DOMAIN_FOR_IP_SITE_REGEXP,D.DOMAIN_FOR_DEFAULT_SITE,D.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&n.push(window.location.hostname),n.includes(t)}var It={},Ei=he;Object.defineProperty(It,"__esModule",{value:!0});var rr=It.default=void 0,Pi=Ei(ge()),Ai=e;rr=It.default=(0,Pi.default)((0,Ai.jsx)("path",{d:"m7 14 5-5 5 5z"}),"ArrowDropUp");function Ii(){return null}function Lt({confirm:t}){const[n,r]=p.useState(null),{t:i}=N(),o=()=>{r(null)},s=async l=>{if(l){let c=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";c==="/"?dn.push(`${l.pathname}`):(c.endsWith("/")&&(c=c.substring(0,c.length-1)),dn.push(`${c}${l.pathname}`)),window.location.reload()}},a=(l,...c)=>{let h=typeof t=="function"?t(l,...c):t;return h?(typeof h=="string"&&(h={description:h}),r({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>s(l),onCancel:()=>o(),...h}),!1):!0};return e.jsxs(Li,{children:[e.jsx(Ii,{message:a}),n&&e.jsx(ne,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})]})}Lt.propTypes={confirm:u.oneOfType([u.object,u.string,u.func])};Lt.defaultProps={confirm:null};const Li=V.div`
2
2
  margin-bottom: 24px;
3
3
  .top-btns-alert {
4
4
  @media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
@@ -1 +1 @@
1
- import{P as s,j as t,B as i,ga as r}from"./index-BJy0Aykg.js";function n({children:e,...o}){return t.jsxs(i,{color:"did",variant:"contained",...o,children:[t.jsx("span",{style:{fontWeight:400},children:e||"Continue With"}),t.jsx(r,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}n.propTypes={children:s.any};n.defaultProps={children:""};export{n as C};
1
+ import{P as s,j as t,B as i,ga as r}from"./index-DHvVD3rl.js";function n({children:e,...o}){return t.jsxs(i,{color:"did",variant:"contained",...o,children:[t.jsx("span",{style:{fontWeight:400},children:e||"Continue With"}),t.jsx(r,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}n.propTypes={children:s.any};n.defaultProps={children:""};export{n as C};
@@ -1,3 +1,3 @@
1
- import{l as q}from"./lottie-BbyPiNfn.js";import{r as D,ba as z}from"./index-BJy0Aykg.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-oKugLW27.js";import{r as D,ba as z}from"./index-DHvVD3rl.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-BJy0Aykg.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-DHvVD3rl.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-DPri5EWV.js";import"./index-DHhEgUS1.js";import"./index-BJy0Aykg.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-DeO7gDXr.js";import"./index-CzxambID.js";import"./index-DHvVD3rl.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-DPri5EWV.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es--cFrK-mF.js";import"./info-addon.es-Cj5Am4W8.js";import{Y as A,r as F}from"./index-DHhEgUS1.js";import"./index-BJy0Aykg.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-DeO7gDXr.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es-ISuYhpDf.js";import"./info-addon.es-BF8YxAo6.js";import{Y as A,r as F}from"./index-CzxambID.js";import"./index-DHvVD3rl.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-BJy0Aykg.js";import{W as se}from"./tag-Cksz2rJp.js";import{I as w}from"./index-VH-ysxX_.js";import{T as re}from"./TextField-3uVNonhd.js";import{S as ae,a as le,b as ie}from"./Stepper-D1V6NqBX.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-DHvVD3rl.js";import{W as se}from"./tag-BDr72C87.js";import{I as w}from"./index-D6XxoBY_.js";import{T as re}from"./TextField-B9TZBqQf.js";import{S as ae,a as le,b as ie}from"./Stepper-F9lgPB4i.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-BJy0Aykg.js";import{R as W}from"./index-Dyefferl.js";import{C as z}from"./index-BFpB8kh-.js";import{d as X}from"./CheckCircle-DkW4b6y7.js";import{w as G}from"./wrap-locale-Bh4fVNfi.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-DHvVD3rl.js";import{R as W}from"./index-LuGhm-KA.js";import{C as z}from"./index-oxLMT1TZ.js";import{d as X}from"./CheckCircle-DbpNufE5.js";import{w as G}from"./wrap-locale-K8WYS2HB.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-BJy0Aykg.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-DHvVD3rl.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-BJy0Aykg.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-DHvVD3rl.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};