@abtnode/webapp 1.16.44-beta-20250529-004636-15e80e20 → 1.16.44-beta-20250529-223630-10e16ac8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-DinGLvP5.js → AdapterDayjs-B3lRsj9D.js} +6 -6
- package/dist/assets/{Add-CBhJFYQx.js → Add-B9VQn0vA.js} +1 -1
- package/dist/assets/{ArrowDropDown-SdWg3cER.js → ArrowDropDown-DHVyJbX0.js} +1 -1
- package/dist/assets/{Autocomplete-C5_M8mFC.js → Autocomplete-CR1bdhJ8.js} +1 -1
- package/dist/assets/{Breadcrumbs-BCQlw5gT.js → Breadcrumbs-CSkUIV3c.js} +1 -1
- package/dist/assets/{ButtonGroup-Fs3wIcrc.js → ButtonGroup-wDVjf00e.js} +1 -1
- package/dist/assets/{CSSTransition-C8l9UTP4.js → CSSTransition-Di6Z29-P.js} +1 -1
- package/dist/assets/{CallMerge-Kk12a7ey.js → CallMerge-DYQ3WM24.js} +1 -1
- package/dist/assets/CardContent-35Oftqzk.js +1 -0
- package/dist/assets/{ChevronLeft-BMvNEdLF.js → ChevronLeft-CK0wXsqo.js} +1 -1
- package/dist/assets/{ChevronRight-DWmI9IJ9.js → ChevronRight-EV2u1ASi.js} +1 -1
- package/dist/assets/{Clear-CQoneWNV.js → Clear-DTRe7ee3.js} +1 -1
- package/dist/assets/{Close-BT3NLZ5O.js → Close-DDEQviVu.js} +1 -1
- package/dist/assets/{Community-x97jRM08.js → Community-BX7_DmQR.js} +1 -1
- package/dist/assets/{Delete-DM0QAMOh.js → Delete-55_a7QjD.js} +1 -1
- package/dist/assets/{Delete-hG59H-h1.js → Delete-DrNmL2-8.js} +1 -1
- package/dist/assets/{DeleteOutline-Cdq3gHRY.js → DeleteOutline-CtJvLUtz.js} +1 -1
- package/dist/assets/{Done-Drec891I.js → Done-DJvQ4tWu.js} +1 -1
- package/dist/assets/{Edit-CSYT7Sg_.js → Edit-Dgp8PeZV.js} +1 -1
- package/dist/assets/{ErrorOutline-QthS_95b.js → ErrorOutline-NyS0RRuz.js} +1 -1
- package/dist/assets/{HelpOutline-CjbuZpgD.js → HelpOutline-BUsU7j2B.js} +1 -1
- package/dist/assets/{Holiday-BNZQq9zo.js → Holiday-B2k-yrmX.js} +1 -1
- package/dist/assets/{Launch-Du5imLta.js → Launch-B2oUG1C0.js} +1 -1
- package/dist/assets/{Link-B5HDfMUJ.js → Link-BImZG8Rc.js} +1 -1
- package/dist/assets/{ListItemButton-CsAyFEiR.js → ListItemButton-BXWgHblj.js} +1 -1
- package/dist/assets/{ListSubheader-DimB9eF4.js → ListSubheader-BAZjpPdT.js} +1 -1
- package/dist/assets/{LoadingButton-fap88MWT.js → LoadingButton-Buam56YP.js} +1 -1
- package/dist/assets/{LockIcon-Cb0s99jc.js → LockIcon-C6Gaa2D7.js} +1 -1
- package/dist/assets/{Meeting-CQG1DdAB.js → Meeting-CfztF-1n.js} +1 -1
- package/dist/assets/{MoreHoriz-DWWN4Ng-.js → MoreHoriz-xQKbHBXk.js} +1 -1
- package/dist/assets/{MoreVert-DOgd-oDI.js → MoreVert-k56JiJFI.js} +1 -1
- package/dist/assets/{OffSick-DFTVKYj3.js → OffSick-CMNH_UXH.js} +1 -1
- package/dist/assets/{OpenInNew-Rr4vQPzz.js → OpenInNew-xYlKnl4T.js} +1 -1
- package/dist/assets/{Public-DsLLG2ue.js → Public-Dkc4c2uW.js} +1 -1
- package/dist/assets/{Refresh-DrCeQQ8P.js → Refresh-DSru7HGW.js} +1 -1
- package/dist/assets/{SchemaReference.es-UTDlBrmS.js → SchemaReference.es-C8psaih6.js} +1 -1
- package/dist/assets/{Search-TzEPZc4S.js → Search-C29PuVwY.js} +1 -1
- package/dist/assets/{Slider-DfNDVCZg.js → Slider-BFYC-ndf.js} +1 -1
- package/dist/assets/{Stepper-CMm5g8HX.js → Stepper-CZ3vmn4U.js} +1 -1
- package/dist/assets/{Switch-DufHzTUv.js → Switch-BPjqimd5.js} +1 -1
- package/dist/assets/{TableRow-DU9-K8kr.js → TableRow-8x6smyXO.js} +1 -1
- package/dist/assets/{TableSearch-D3ttUrMW.js → TableSearch-DuQJlkst.js} +2 -2
- package/dist/assets/{ToggleButtonGroup-CBb-R_aY.js → ToggleButtonGroup-DZr66Ds-.js} +1 -1
- package/dist/assets/{Verified-XfHOW1HP.js → Verified-BLKTzR1S.js} +1 -1
- package/dist/assets/{VerifiedUser-ANB0mvJb.js → VerifiedUser-B9UfFGjN.js} +1 -1
- package/dist/assets/{ViewColumn-CmVGkXxH.js → ViewColumn-BgIEd8qO.js} +1 -1
- package/dist/assets/{ViewList-Csk2o7Do.js → ViewList-DPtR3wEh.js} +1 -1
- package/dist/assets/{WorkingRemotely-V9Lqlnci.js → WorkingRemotely-DvsNzIyW.js} +1 -1
- package/dist/assets/{_createAggregator-DjkaDOaA.js → _createAggregator-CmKiiWsR.js} +1 -1
- package/dist/assets/{actions-C5bVdhKM.js → actions-DWRhFxc5.js} +1 -1
- package/dist/assets/{actions-dsd4OpkB.js → actions-pbI5M0vz.js} +1 -1
- package/dist/assets/{agreement-Dhm9rc3C.js → agreement-BQ93KLNO.js} +1 -1
- package/dist/assets/api-Biyey5qO.js +1 -0
- package/dist/assets/{appearance-DZ8Ks0H9.js → appearance-CzYZB9UW.js} +1 -1
- package/dist/assets/{audit-logs-Cxm3Ca_L.js → audit-logs-Dk3r3uT-.js} +2 -2
- package/dist/assets/{base-chart-De2I12la.js → base-chart-CIY0AC1H.js} +1 -1
- package/dist/assets/blocklet-CVPCTpAm.js +1 -0
- package/dist/assets/{brace-fold.es-jdDpI7V6.js → brace-fold.es-DqNZqlv9.js} +1 -1
- package/dist/assets/{chain-Cy7rzX10.js → chain-C9igIP4y.js} +1 -1
- package/dist/assets/{click-to-copy-B-Nf9c3z.js → click-to-copy-DaPVNRo5.js} +1 -1
- package/dist/assets/cloneDeep-BggEwLYZ.js +1 -0
- package/dist/assets/{closebrackets.es-DtaJEplX.js → closebrackets.es-BgG6qYM2.js} +1 -1
- package/dist/assets/{codemirror.es-BnuJWXxR.js → codemirror.es-CTXkiUOQ.js} +1 -1
- package/dist/assets/{collapse-DmbZuZio.js → collapse-CZFfzu8E.js} +1 -1
- package/dist/assets/{comment.es-DqMPUK6b.js → comment.es-C15Ov1_H.js} +1 -1
- package/dist/assets/config-navigation-BeBEz5Q9.js +86 -0
- package/dist/assets/{connect-to-B2aJ9foS.js → connect-to-vI-I0H9i.js} +1 -1
- package/dist/assets/{delete-confirm-C5hVBVBe.js → delete-confirm-DqkJQzdi.js} +1 -1
- package/dist/assets/{detail-CRV4IPZx.js → detail-CSw8Ql4D.js} +3 -3
- package/dist/assets/{dialog.es-CnZcQPlC.js → dialog.es-BU1CIq3h.js} +1 -1
- package/dist/assets/{domains-Naf0eUkZ.js → domains-oBbBjUEN.js} +2 -2
- package/dist/assets/{download-Dwwoh_tj.js → download-Cfz9oBDg.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-CuV9bEZ-.js +1 -0
- package/dist/assets/{foldgutter.es-DXYPfETU.js → foldgutter.es-DgGC_LFa.js} +1 -1
- package/dist/assets/{get-safe-url-BwZ1_jGd.js → get-safe-url-B6JOJoE_.js} +1 -1
- package/dist/assets/{get-safe-url-DIlh-GlR.js → get-safe-url-BBt-uWG8.js} +1 -1
- package/dist/assets/getValidReactChildren-JswGrRpZ.js +1 -0
- package/dist/assets/{hint.es-BQZvRXLe.js → hint.es-CFiaIFxE.js} +1 -1
- package/dist/assets/{hint.es2-BKxfSzYX.js → hint.es2-CpA9Wth4.js} +1 -1
- package/dist/assets/{iframe-C420BXed.js → iframe-DliQzZxh.js} +1 -1
- package/dist/assets/{index-JuIygs6c.js → index-5IYDIOdG.js} +1 -1
- package/dist/assets/{index-0sbUWWmv.js → index-8FN_CRrc.js} +1 -1
- package/dist/assets/{index-Cr8wuQmm.js → index-B-OsCFX-.js} +1 -1
- package/dist/assets/{index-DLSynwxs.js → index-BAZsDody.js} +1 -1
- package/dist/assets/{index-DWz2Gdbw.js → index-BPpkUirs.js} +2 -2
- package/dist/assets/index-BkuoRakK.js +1 -0
- package/dist/assets/index-BqH5Ju1G.js +11 -0
- package/dist/assets/{index-CxZV605i.js → index-C-id8KDN.js} +10 -10
- package/dist/assets/{index-B0sbjakP.js → index-C3fgvCrl.js} +1 -1
- package/dist/assets/{index-BGjoqPnj.js → index-C4zyKV3D.js} +1 -1
- package/dist/assets/{index-C-XTKS0o.js → index-C63YydxY.js} +1 -1
- package/dist/assets/{index-CtmOgjIn.js → index-CBSRK8lI.js} +1 -1
- package/dist/assets/{index-ByXFqYXz.js → index-CIysKeBp.js} +4 -4
- package/dist/assets/{index-C-NqD-ZI.js → index-CMafy6eu.js} +1 -1
- package/dist/assets/{index-Bs6Krlqz.js → index-CPiBcx6c.js} +1 -1
- package/dist/assets/{index-C4otE4aQ.js → index-CUMmXS_l.js} +1 -1
- package/dist/assets/{index-Djf90FMv.js → index-CUYD3dGd.js} +1 -1
- package/dist/assets/index-CYfyYQl4.js +109 -0
- package/dist/assets/{index-CM0m5dNj.js → index-Cb2LNWks.js} +15 -15
- package/dist/assets/{index-C8N6MVBX.js → index-Cb_3XJu-.js} +1 -1
- package/dist/assets/{index-CQA6XGzA.js → index-CdOTV-kY.js} +1 -1
- package/dist/assets/index-ChiIuSx6.js +1 -0
- package/dist/assets/{index-BwwfPkpe.js → index-Csic3buZ.js} +1 -1
- package/dist/assets/{index-aI_WK3lC.js → index-CtrkOEvS.js} +1 -1
- package/dist/assets/{index-DiJp1f5_.js → index-D7unoW0b.js} +8 -8
- package/dist/assets/{index-BwjHW5Do.js → index-DAHv_Ku0.js} +1 -1
- package/dist/assets/{index-4XTo8IyO.js → index-DESgmXka.js} +1 -1
- package/dist/assets/{index-B0ejBM3x.js → index-DG_ac7dA.js} +1 -1
- package/dist/assets/{index-C14JLgyC.js → index-DH0IH7YX.js} +1 -1
- package/dist/assets/{index-BEoiZQ4v.js → index-DNPCQUrt.js} +5 -5
- package/dist/assets/{index-Bw3PNnBQ.js → index-DPvdLpsO.js} +1 -1
- package/dist/assets/{index-NirGJtdP.js → index-DR-LzDpz.js} +30 -30
- package/dist/assets/{index-DtB4YGQz.js → index-DVLGVAgs.js} +1 -1
- package/dist/assets/{index-CGdbhgNF.js → index-DfFTq7r9.js} +1 -1
- package/dist/assets/{index-BIZ2efmj.js → index-DhbJRUp_.js} +1 -1
- package/dist/assets/{index-BfU9MPi3.js → index-Doaw7xqe.js} +1 -1
- package/dist/assets/{index-BpBA0IvL.js → index-DsljBihW.js} +1 -1
- package/dist/assets/index-Du_hmbEG.js +1 -0
- package/dist/assets/{index-Y0H3xUv4.js → index-DvfHbz04.js} +1 -1
- package/dist/assets/index-DxTy0IeW.js +1 -0
- package/dist/assets/index-DzM8h-LB.js +1 -0
- package/dist/assets/{index-CkbAFRoz.js → index-EiX7FuXm.js} +1 -1
- package/dist/assets/{index-BICF6NMn.js → index-SUxPMT-v.js} +1 -1
- package/dist/assets/{index-BL7rMOsj.js → index-TroCKI1w.js} +3 -3
- package/dist/assets/{index-BXb5UNlN.js → index-Zy0t374Z.js} +1 -1
- package/dist/assets/{index-By8emAsh.js → index-e_43Wk9J.js} +1 -1
- package/dist/assets/{index-DyLYzd73.js → index-fvOlvRD2.js} +5 -5
- package/dist/assets/{index-DeX6HSBf.js → index-kmBuomRf.js} +1 -1
- package/dist/assets/{index-BEx36Fl3.js → index-ljLsN0wl.js} +4 -4
- package/dist/assets/{index.esm-B5H4KBkc.js → index.esm-t3Dt5R40.js} +1 -1
- package/dist/assets/{info-addon.es-DR8_v_3j.js → info-addon.es-aGFlpxMB.js} +1 -1
- package/dist/assets/{info.es-CljYnRqy.js → info.es-CyJU-4fQ.js} +1 -1
- package/dist/assets/{install-from-url-B-u9io6B.js → install-from-url-BZcbqkwi.js} +1 -1
- package/dist/assets/{invitation-CRLeDtB1.js → invitation-CdsSMcaa.js} +6 -6
- package/dist/assets/is-path-prefix-equal-BgJYQUJu.js +1 -0
- package/dist/assets/{item-5FSiJyPn.js → item-b_KxectM.js} +6 -6
- package/dist/assets/{javascript.es-DNOv6rgY.js → javascript.es-Cd2hXYh6.js} +1 -1
- package/dist/assets/{jump-to-line.es-BR7eFhcc.js → jump-to-line.es-Be4-wwrh.js} +1 -1
- package/dist/assets/{jump.es-CpyaZYdp.js → jump.es-Cw1u4Cod.js} +1 -1
- package/dist/assets/{lint.es-DiMcEbEh.js → lint.es-wtkMeboj.js} +1 -1
- package/dist/assets/{lint.es2-Pwyn6VKt.js → lint.es2-BLKz9qSb.js} +1 -1
- package/dist/assets/{lint.es3-BHdxA7m7.js → lint.es3-Dq363MBD.js} +1 -1
- package/dist/assets/{list-header-BDv92PyU.js → list-header-CLekLloJ.js} +1 -1
- package/dist/assets/{log-DZbCmIMA.js → log-CbUepvQq.js} +1 -1
- package/dist/assets/{lottie-react.esm-B6UfxeU-.js → lottie-react.esm-DwkBIzVd.js} +1 -1
- package/dist/assets/{matchbrackets.es-C7CmjDLq.js → matchbrackets.es-CV1dPOnN.js} +1 -1
- package/dist/assets/{memory-BIcGczzH.js → memory-DzP4paU3.js} +1 -1
- package/dist/assets/{metric-CHmNfLM5.js → metric-q8tPjLqf.js} +1 -1
- package/dist/assets/{mode.es-BgFzELso.js → mode.es-KfODvPi3.js} +1 -1
- package/dist/assets/{mode.es2-C_gzbT8B.js → mode.es2-C08AdJFw.js} +1 -1
- package/dist/assets/{mode.es3-B-g7PSZg.js → mode.es3-D2D9hLP2.js} +1 -1
- package/dist/assets/omit-CzN3pMi0.js +1 -0
- package/dist/assets/{onlineParser.es-DaklCAOB.js → onlineParser.es-BYFYiBb_.js} +1 -1
- package/dist/assets/{overview-DHlUfNDU.js → overview-CyoCdi1p.js} +1 -1
- package/dist/assets/{permission-D7WAH9pl.js → permission-CuRYZFJE.js} +1 -1
- package/dist/assets/{preference-C6RSsm_f.js → preference-C7q1tf5E.js} +4 -4
- package/dist/assets/{raf-schd.esm-cPMdpiJR.js → raf-schd.esm-UumrWtPx.js} +1 -1
- package/dist/assets/refType-CJ9l93jo.js +1 -0
- package/dist/assets/{resource-dialog-BfdWfPnu.js → resource-dialog-DQ6bEefA.js} +20 -20
- package/dist/assets/{runtime-Bdbyxdvk.js → runtime-bmXU67NX.js} +1 -1
- package/dist/assets/{schema-Cb35ZxuZ.js → schema-ajF7Icmt.js} +1 -1
- package/dist/assets/sdk-C9mSNzSG.js +1 -0
- package/dist/assets/{search.es-DQAw761H.js → search.es-Cdtg1E_a.js} +1 -1
- package/dist/assets/{searchcursor.es-B1RRwem_.js → searchcursor.es-C8NGpPzz.js} +1 -1
- package/dist/assets/{service-CelKCvsn.js → service-B0u9bhKQ.js} +1 -1
- package/dist/assets/{shorten-label-CpjjrZE4.js → shorten-label-DkggqcXr.js} +1 -1
- package/dist/assets/{show-hint.es-CNjurN-G.js → show-hint.es-BVbkXAkF.js} +1 -1
- package/dist/assets/{simple-select-BeDH_svN.js → simple-select-BERx0W6t.js} +1 -1
- package/dist/assets/{spaces-4QocNuUE.js → spaces-BxS4555U.js} +1 -1
- package/dist/assets/{status-CNkFoN9_.js → status-DGwv9PNu.js} +1 -1
- package/dist/assets/{status-DBEXHPFk.js → status-DxS42kJ4.js} +1 -1
- package/dist/assets/{sublime.es-6-EY00Rq.js → sublime.es-4xcH9g5s.js} +1 -1
- package/dist/assets/{switch-control-p6zVviIU.js → switch-control-BUQ6khCW.js} +1 -1
- package/dist/assets/{table-icons-CVc352jh.js → table-icons-DqNHQWYR.js} +1 -1
- package/dist/assets/{table-tips-_uB0WZhe.js → table-tips-CJF6FN7W.js} +1 -1
- package/dist/assets/{team-B10DbiWq.js → team-DBW6O8K7.js} +1 -1
- package/dist/assets/{toLower-DZdeJ630.js → toLower-KtsWbzF6.js} +1 -1
- package/dist/assets/toUpper-DH4cZccA.js +1 -0
- package/dist/assets/{traffic-9N1qpgfE.js → traffic-D1EL195Z.js} +1 -1
- package/dist/assets/url-evaluation-BXXYRG2X.js +1 -0
- package/dist/assets/{url-join-BTkrevwu.js → url-join-CUA866NM.js} +1 -1
- package/dist/assets/{use-mobile-nGuU-0s0.js → use-mobile-B1ZUasmg.js} +1 -1
- package/dist/assets/{use-mobile-BETyv0lm.js → use-mobile-Bv46kdF2.js} +1 -1
- package/dist/assets/{useAsync-qCIf3UK3.js → useAsync-B8VSOMJe.js} +1 -1
- package/dist/assets/{useAsyncRetry-Cnqg2dBD.js → useAsyncRetry-CEX3Ed2W.js} +1 -1
- package/dist/assets/{useLocalStorage-CUruJXEg.js → useLocalStorage-UQyPQgbL.js} +1 -1
- package/dist/assets/{useThemeProps-_M9Jxn4x.js → useThemeProps-6swD8rT0.js} +1 -1
- package/dist/assets/{util-BvuTWfbr.js → util-ysDoKxkj.js} +1 -1
- package/dist/assets/{wait-container-CTDxHMer.js → wait-container-BtmYhxs0.js} +1 -1
- package/dist/assets/withStyles-DwEbga_Y.js +1 -0
- package/dist/assets/{wrap-locale-i1hddZ5J.js → wrap-locale-7CaFuwKr.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/CardContent-DZIT7Ui8.js +0 -1
- package/dist/assets/api-xWlJtS98.js +0 -1
- package/dist/assets/blocklet-CoVwmbdq.js +0 -1
- package/dist/assets/cloneDeep-Dx0IDKG5.js +0 -1
- package/dist/assets/config-navigation-DHLqjU5h.js +0 -86
- package/dist/assets/emotion-react.browser.esm-DtUYZL9V.js +0 -1
- package/dist/assets/getValidReactChildren-C6zzguzA.js +0 -1
- package/dist/assets/index-BJoLX8m_.js +0 -1
- package/dist/assets/index-BMk8KJYe.js +0 -1
- package/dist/assets/index-BP2uvtJN.js +0 -11
- package/dist/assets/index-C1VNZueQ.js +0 -109
- package/dist/assets/index-C6XfV9TG.js +0 -1
- package/dist/assets/index-DzuvY_7m.js +0 -1
- package/dist/assets/index-Ikc8Qhzz.js +0 -1
- package/dist/assets/is-path-prefix-equal-BWtvRrCf.js +0 -1
- package/dist/assets/omit-BGtDTHXW.js +0 -1
- package/dist/assets/refType-DW_L7yu5.js +0 -1
- package/dist/assets/sdk-yPMfNr2b.js +0 -1
- package/dist/assets/toUpper-C3j48noa.js +0 -1
- package/dist/assets/url-evaluation-CEYtfcX2.js +0 -1
- package/dist/assets/withStyles-Cn384WJb.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{am as ee,x as N,r as p,a as te,b as se,P as b,m as w,u as j,w as oe,ay as _,H as O,j as t,v as W,az as re,a2 as y,k as R,D as z,aA as ne,aB as ae,B as M,C as V,aC as le,y as K,X as H,aD as ie,aE as ce,K as E,aF as ue,A as de,aG as D,g as pe,aH as he,n as G,ab as fe,a6 as me,a8 as ge,a9 as xe,aI as be,aa as ke}from"./index-
|
|
1
|
+
import{am as ee,x as N,r as p,a as te,b as se,P as b,m as w,u as j,w as oe,ay as _,H as O,j as t,v as W,az as re,a2 as y,k as R,D as z,aA as ne,aB as ae,B as M,C as V,aC as le,y as K,X as H,aD as ie,aE as ce,K as E,aF as ue,A as de,aG as D,g as pe,aH as he,n as G,ab as fe,a6 as me,a8 as ge,a9 as xe,aI as be,aa as ke}from"./index-DR-LzDpz.js";import{_ as B}from"./useLocalStorage-UQyPQgbL.js";import{c as ye,C as Se,A as we,z as je,a as ve,d as Pe,B as Re,S as Q,b as Ce,e as Be}from"./item-b_KxectM.js";import{g as T}from"./get-safe-url-B6JOJoE_.js";import{P as X}from"./permission-CuRYZFJE.js";import{d as Le}from"./ArrowDropDown-DHVyJbX0.js";import{B as De}from"./Breadcrumbs-CSkUIV3c.js";import"./index-BkuoRakK.js";import"./ChevronLeft-CK0wXsqo.js";import"./ChevronRight-EV2u1ASi.js";import"./Search-C29PuVwY.js";import"./index-DVLGVAgs.js";import"./blocklet-CVPCTpAm.js";import"./Autocomplete-CR1bdhJ8.js";import"./ListSubheader-BAZjpPdT.js";import"./Verified-BLKTzR1S.js";import"./VerifiedUser-B9UfFGjN.js";import"./Add-B9VQn0vA.js";import"./Launch-B2oUG1C0.js";import"./Done-DJvQ4tWu.js";import"./DeleteOutline-CtJvLUtz.js";import"./delete-confirm-DqkJQzdi.js";import"./click-to-copy-DaPVNRo5.js";import"./MoreVert-k56JiJFI.js";import"./get-safe-url-BBt-uWG8.js";import"./ButtonGroup-wDVjf00e.js";import"./getValidReactChildren-JswGrRpZ.js";function Ee(e){const r=ee(),c=N(),[s,o]=B(`sid:blocklet:purchase:${e}`),[a,u]=p.useState(!1),[h,l]=p.useState(null),f=()=>{const{pathname:n,searchParams:d}=new URL(window.location.href),i=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";d.get("sid")&&(o(""),c(n.replace(i,"/"),{replace:!0}))},m=!!(r.get("assetDid")&&s&&r.get("sid")===s);return te(se.BlockletEvents.purchaseChange,n=>{n.did===e&&(l(n.session),["declined","confirmed","error"].includes(n.session.status)&&(u(!0),setTimeout(f,2e3)))}),p.useEffect(()=>{h&&h.id!==s&&o(h.id)},[h]),{hasCompleted:a,hasPurchased:m,session:h,setSession:l,doRedirect:f}}function U({meta:e,onCancel:r,handlePaySuccess:c,storeUrl:s}){const{t:o}=w(),{info:a}=j(),[u,h]=p.useState("both"),[l,f]=p.useState(1),m=oe(a),n=_(e,a,s),d=P=>{P!==u&&h(P)},i=()=>{u&&(f(2),u==="verify"&&(window.location.href=T(n)))},k=(P,L)=>{L!=="backdropClick"&&r()},v=()=>{c(n)},g=O.getDisplayName({meta:e});if(u==="purchase"&&l===2)return t.jsx(W,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:y(s,"/store")}).get,onSuccess:v,onClose:r,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:m,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:g}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:g})]})]})}});const x=z;return t.jsx(x,{title:o("store.purchase.title",{name:g}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:k,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(Se,{action:u,onNext:i,onSelect:d})})})}U.propTypes={...ye,storeUrl:b.string.isRequired,handlePaySuccess:b.func};U.defaultProps={handlePaySuccess:e=>{setTimeout(()=>{window.location.href=T(e,{allowDomains:null})},1e3)}};function I({meta:e,buttonText:r,storeUrl:c,isResource:s}){const{t:o}=w(),a=N(),{info:u}=j(),{api:h}=ne(),l=O.isFreeBlocklet(e)===!1,[f,m]=p.useState(!1),{hasPurchased:n}=Ee(e.did),[d,i]=p.useState(!1),[k]=B("instant-blocklet-install",!1),[v,g]=p.useState(!1),x=p.useMemo(()=>f?o(l?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[f,o,l]),P=p.useMemo(()=>s?o("blocklet.status.resource"):l?r.purchase:r.launch,[l,r,s]),L=S=>{S.preventDefault(),S.stopPropagation();try{if(m(!0),l){i(!0);return}if(k){g(!0);return}if(!l){const C=_(e,u,c);window.location.href=T(C)}}catch(C){K.error(H(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{m(!1)}},Y=()=>{m(!1),i(!1)},J=S=>{m(!1),g(!1),a(`/blocklets/${S.appDid}/components`)},Z=()=>{m(!1),g(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(we,{children:t.jsx(X,{permission:"mutate_blocklets",children:S=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(M,{onClick:L,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(x||!S),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:x?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:16,style:{marginRight:3}}),x]}):P},e.did)})})}),(n||d)&&t.jsx(U,{method:"launch",meta:e,mode:"both",onCancel:Y,storeUrl:c}),v&&t.jsx(W,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:J,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(le(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}I.propTypes={isResource:b.bool,meta:b.object.isRequired,buttonText:b.shape({purchase:b.string.isRequired,launch:b.string.isRequired}).isRequired,storeUrl:b.string.isRequired};I.defaultProps={isResource:!1};const Te=(e,r,c)=>{const s=fe(r);return y(c,`/blocklets/${e.did}/?server-url=${s}`)},q=({meta:e,attribute:r,value:c})=>e._formatted?e._formatted[r]:c,Ue=(e,r)=>{if(!e||!r)return"";try{return y(r,e)}catch(c){return console.warn("Failed to construct avatar URL:",c),""}};function F({blocklet:e,endpoint:r,serverVersion:c}){var n,d;const{t:s}=w(),o=j();let a=y(o.imgPrefix,"blocklet.png");const u=r;if(u.startsWith("http")&&e.logo)a=y(u,ue(e.did,e.logo,e.version));else{let k=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");k&&(k=`/${k}`),a=y(k,`/blocklet/logo/${e.did}`)}try{const i=new URL(a);i.searchParams.set("v",e.version||+new Date),a=i.href}catch{}const h=(o==null?void 0:o.info.mode)!==de.NODE_MODES.SERVERLESS,l=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),f={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:u};let m=null;return h&&(m=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(ve,{serverVersion:c,requirementVersion:(n=e.requirements)==null?void 0:n.server,size:"small",children:t.jsx(I,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...f})})})),t.jsx(pe,{href:Te(e,o.info,r),style:{color:"initial",textDecoration:"none"},onClick:l,target:"_blank",children:t.jsx(Ie,{title:q({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:q({meta:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,icons:(d=e.docker)!=null&&d.image?[{key:"docker",icon:t.jsx(E,{display:"flex",color:"primary.main",children:t.jsx(he,{icon:Pe})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ue(e.owner.avatar,r),download:e.stats.downloads,button:m})})}F.propTypes={blocklet:b.object.isRequired,serverVersion:b.string,endpoint:b.string};F.defaultProps={endpoint:"",serverVersion:""};function A({storeUrl:e,handleSearchSelect:r,extraFilter:c,...s}){var n;const{locale:o}=w(),a=j(),[u,h]=p.useState({}),l=d=>{h(d)},f=e,m=(n=a==null?void 0:a.info)==null?void 0:n.version;return p.useEffect(()=>{h({})},[f]),t.jsx(ie,{FallbackComponent:ce,resetKeys:[f],children:t.jsx(E,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:d=>{const i={...d,endpoint:f};return t.jsx(F,{...i})},baseSearch:!0,endpoint:f,locale:o,onFilterChange:l,onSearchSelect:r,filters:u,extraFilter:c,serverVersion:m})})})}A.propTypes={storeUrl:b.string.isRequired,handleSearchSelect:b.func,extraFilter:b.func};A.defaultProps={handleSearchSelect:null,extraFilter:void 0};const Ie=G(Re)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{r as p,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DH0IH7YX.js","./index-DR-LzDpz.js","./index-2qex5JRJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as p,cu as F,c4 as X,cv as H,cw as q,aP as G,aQ as O,j as s,n as E,P as j,E as Q,aT as V,e as J,cx as K,v as _,K as x,cy as Y,W as Z,B as I,bc as ee,k as M,cz as $,g as te,cA as se,bA as ae,cB as oe,cC as ne,u as re,w as ie,ap as ce,by as le,af as pe}from"./index-DR-LzDpz.js";import{d as de}from"./ViewList-DPtR3wEh.js";import{d as ue}from"./Done-DJvQ4tWu.js";import{N as me}from"./index-B-OsCFX-.js";import{w as fe}from"./wrap-locale-7CaFuwKr.js";import{g as he}from"./get-safe-url-BBt-uWG8.js";import{S as xe,a as ge,b as ve}from"./Stepper-CZ3vmn4U.js";import"./emotion-react.browser.esm-CuV9bEZ-.js";var P=function(t){if(!t)return 0;var r=q(t).valueOf()-Date.now();return r<0?0:r},be=function(t){return{days:Math.floor(t/864e5),hours:Math.floor(t/36e5)%24,minutes:Math.floor(t/6e4)%60,seconds:Math.floor(t/1e3)%60,milliseconds:Math.floor(t)%1e3}},we=function(t){t===void 0&&(t={});var r=t||{},l=r.leftTime,i=r.targetDate,d=r.interval,v=d===void 0?1e3:d,b=r.onEnd,g=p.useMemo(function(){return F(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in t?g:i,m=X(p.useState(function(){return P(a)}),2),f=m[0],u=m[1],o=H(b);p.useEffect(function(){if(!a){u(0);return}u(P(a));var w=setInterval(function(){var n,c=P(a);u(c),c===0&&(clearInterval(w),(n=o.current)===null||n===void 0||n.call(o))},v);return function(){return clearInterval(w)}},[a,v]);var y=p.useMemo(function(){return be(f)},[f]);return[f,y]},k={},ye=O;Object.defineProperty(k,"__esModule",{value:!0});var R=k.default=void 0,je=ye(G()),Se=s;R=k.default=(0,je.default)((0,Se.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function T({list:t,width:r,height:l,cardSpace:i,onSelect:d,defaultIndex:v}){const[b,g]=p.useState(0),[a,m]=p.useState(0),f=p.useRef(null),u=n=>{if(n<0||n>t.length-1)return;g(n);const c=f.current.clientWidth;m(n*(r+i)-(c-r)/2+i*.5),d(n)};p.useEffect(()=>{u(v);const n=c=>c.preventDefault();f.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const y=n=>{o=n.touches[0].clientX},w=n=>{const c=n.changedTouches[0],S=o-c.clientX;Math.abs(S)>60&&(S>0?u(b+1):u(b-1))};return s.jsx(Pe,{ref:f,onTouchStart:y,onTouchEnd:w,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:t.map((n,c)=>s.jsx("div",{className:`card-item ${c===b?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>u(c),children:n.display?s.jsx("div",{className:"card-content",children:s.jsx(me,{data:n.display,style:{width:"100%",height:"100%"}})}):s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const Pe=E.div`
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
|
|
5
5
|
overflow: hidden;
|
|
@@ -33,7 +33,7 @@ import{r as p,cv as F,c6 as X,cw as H,cx as q,aP as G,aQ as O,j as s,n as E,P as
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
`;T.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};function ke({icon:t,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(R,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(t)]})}function Te({SessionContext:t,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(t),g=Q(e=>e.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),m=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:f,clearPassportId:u}=ne(),{t:o,locale:y}=p.useContext(J),{wallet:w}=K(),[n,c]=p.useState(0),{searchParams:S}=new URL(window.location.href),C=()=>{a.activeStep++},W=e=>{a.user=e.user},A=()=>{C()},z=(e,h)=>{e!=null&&e.passportId&&f(e.passportId),e!=null&&e.sessionToken&&(m.current.sessionToken=h(e.sessionToken)),e!=null&&e.refreshToken&&(m.current.refreshToken=h(e.refreshToken)),a.success=!0,C()},U=async()=>{try{await b.logout()}catch(e){console.warn(e)}},
|
|
36
|
+
`;T.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};function ke({icon:t,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(R,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(t)]})}function Te({SessionContext:t,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(t),g=Q(e=>e.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),m=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:f,clearPassportId:u}=ne(),{t:o,locale:y}=p.useContext(J),{wallet:w}=K(),[n,c]=p.useState(0),{searchParams:S}=new URL(window.location.href),C=()=>{a.activeStep++},W=e=>{a.user=e.user},A=()=>{C()},z=(e,h)=>{e!=null&&e.passportId&&f(e.passportId),e!=null&&e.sessionToken&&(m.current.sessionToken=h(e.sessionToken)),e!=null&&e.refreshToken&&(m.current.refreshToken=h(e.refreshToken)),a.success=!0,C()},U=async()=>{try{await b.logout()}catch(e){console.warn(e)}},N=async()=>{if(w&&$()){ae(()=>import("./index-DH0IH7YX.js").then(h=>h.i),__vite__mapDeps([0,1,2]),import.meta.url).then(h=>{h.call("arcClosePage")});return}await U(),oe(d)&&d({sessionToken:m.current.sessionToken,refreshToken:m.current.refreshToken});const e=S.get("redirect");if(e){window.location.replace(he(e));return}u(),window.location.replace("/")},B=e=>{a.passport=e.target.value},[D]=we({leftTime:n,onEnd:()=>{N()}}),L=[{label:o("lostPassport.recoverPassport"),content:()=>a.user?s.jsxs(x,{className:"select-passport",children:[s.jsxs(x,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[s.jsx(Y,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(x,{children:[s.jsx(x,{className:"name",children:a.user.fullName}),s.jsx(x,{className:"did",mt:1,children:s.jsx(Z,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx("div",{children:s.jsx(T,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(e=>({src:l({scope:e.scope,role:e.role,title:e.scope==="kyc"?e.name:e.title,issuer:e.issuer.name,issuerDid:e.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:e.scope==="kyc"?{key:"Email",value:e.name}:void 0}),name:e.title,id:e.id,display:e.display})),onSelect:e=>B({target:{value:a.user.passportTypes[e].id}}),defaultIndex:0})}),s.jsx(x,{textAlign:"center",children:s.jsx(I,{variant:"contained",color:"primary",onClick:()=>A(),disabled:!a.passport,children:o("common.next")})})]}):s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:W,locale:y,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")}})},{label:o("lostPassport.receivePassport"),content:()=>{var h;const e={receiverDid:a.user.did,passportId:a.passport,teamDid:((h=window==null?void 0:window.blocklet)==null?void 0:h.did)||""};return s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:z,locale:y,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:e})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),s.jsxs(x,{textAlign:"center",children:[s.jsx(x,{mb:3,color:"success.main",children:s.jsx(ee,{style:{fontSize:60}})}),s.jsx(M,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),s.jsx(M,{component:"p",variant:"body2",color:"gray",children:w&&$()?o("issuePassport.dialog.autoClose",{seconds:Math.round(D/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(D/1e3)})}),s.jsx(I,{style:{marginTop:40},variant:"contained",color:"primary",onClick:N,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(Ce,{children:s.jsxs("div",{className:"stepper",children:[s.jsx(xe,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:L.map(({label:e})=>s.jsx(ge,{children:s.jsx(ve,{StepIconComponent:ke,children:e})},e))}),s.jsx("div",{className:"stepper-content",children:L[a.activeStep].content()}),!a.success&&s.jsx(x,{textAlign:"center",fontSize:12,children:s.jsx(te,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const Ce=E(se)`
|
|
37
37
|
padding-top: 46px;
|
|
38
38
|
padding-bottom: 46px;
|
|
39
39
|
height: 100%;
|
|
@@ -165,4 +165,4 @@ import{r as p,cv as F,c6 as X,cw as H,cx as q,aP as G,aQ as O,j as s,n as E,P as
|
|
|
165
165
|
.connect {
|
|
166
166
|
background: #fafafa;
|
|
167
167
|
}
|
|
168
|
-
`,
|
|
168
|
+
`,Ne=fe(Te);function We(){const{info:t}=re(),r=ie(t),l=({sessionToken:i}={})=>{i&&pe(i)};return s.jsx(Ne,{SessionContext:ce,webWalletUrl:r,createPassportSvg:i=>le(i,t),passportColor:"default",onLogin:l})}export{We as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bh as b}from"./index-NirGJtdP.js";var _e=e=>e.type==="checkbox",ue=e=>e instanceof Date,j=e=>e==null;const dt=e=>typeof e=="object";var U=e=>!j(e)&&!Array.isArray(e)&&dt(e)&&!ue(e),yt=e=>U(e)&&e.target?_e(e.target)?e.target.checked:e.target.value:e,Ut=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,gt=(e,s)=>e.has(Ut(s)),Mt=e=>{const s=e.constructor&&e.constructor.prototype;return U(s)&&s.hasOwnProperty("isPrototypeOf")},We=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function T(e){let s;const t=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(We&&(e instanceof Blob||i))&&(t||U(e)))if(s=t?[]:{},!t&&!Mt(e))s=e;else for(const n in e)e.hasOwnProperty(n)&&(s[n]=T(e[n]));else return e;return s}var he=e=>Array.isArray(e)?e.filter(Boolean):[],O=e=>e===void 0,c=(e,s,t)=>{if(!s||!U(e))return t;const i=he(s.split(/[,[\].]+?/)).reduce((n,u)=>j(n)?n:n[u],e);return O(i)||i===e?O(e[s])?t:e[s]:i},Q=e=>typeof e=="boolean",qe=e=>/^\w*$/.test(e),_t=e=>he(e.replace(/["|']|\]/g,"").split(/\.|\[/)),C=(e,s,t)=>{let i=-1;const n=qe(s)?[s]:_t(s),u=n.length,d=u-1;for(;++i<u;){const y=n[i];let A=t;if(i!==d){const x=e[y];A=U(x)||Array.isArray(x)?x:isNaN(+n[i+1])?{}:[]}if(y==="__proto__"||y==="constructor"||y==="prototype")return;e[y]=A,e=e[y]}};const me={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ee={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ie={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Nt=b.createContext(null),xe=()=>b.useContext(Nt);var ht=(e,s,t,i=!0)=>{const n={defaultValues:s._defaultValues};for(const u in e)Object.defineProperty(n,u,{get:()=>{const d=u;return s._proxyFormState[d]!==ee.all&&(s._proxyFormState[d]=!i||ee.all),t&&(t[d]=!0),e[d]}});return n};function Bt(e){const s=xe(),{control:t=s.control,disabled:i,name:n,exact:u}=e||{},[d,y]=b.useState(t._formState),A=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),x=b.useRef(n);return x.current=n,b.useEffect(()=>t._subscribe({name:x.current,formState:A.current,exact:u,callback:w=>{!i&&y({...t._formState,...w})}}),[t,i,u]),b.useEffect(()=>{A.current.isValid&&t._setValid(!0)},[t]),b.useMemo(()=>ht(d,t,A.current,!1),[d,t])}var se=e=>typeof e=="string",vt=(e,s,t,i,n)=>se(e)?(i&&s.watch.add(e),c(t,e,n)):Array.isArray(e)?e.map(u=>(i&&s.watch.add(u),c(t,u))):(i&&(s.watchAll=!0),t);function It(e){const s=xe(),{control:t=s.control,name:i,defaultValue:n,disabled:u,exact:d}=e||{},y=b.useRef(i),A=b.useRef(n);y.current=i,b.useEffect(()=>t._subscribe({name:y.current,formState:{values:!0},exact:d,callback:E=>!u&&w(vt(y.current,t._names,E.values||t._formValues,!1,A.current))}),[t,u,d]);const[x,w]=b.useState(t._getWatch(i,n));return b.useEffect(()=>t._removeUnmounted()),x}function Pt(e){const s=xe(),{name:t,disabled:i,control:n=s.control,shouldUnregister:u}=e,d=gt(n._names.array,t),y=It({control:n,name:t,defaultValue:c(n._formValues,t,c(n._defaultValues,t,e.defaultValue)),exact:!0}),A=Bt({control:n,name:t,exact:!0}),x=b.useRef(e),w=b.useRef(n.register(t,{...e.rules,value:y,...Q(e.disabled)?{disabled:e.disabled}:{}})),E=b.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(A.errors,t)},isDirty:{enumerable:!0,get:()=>!!c(A.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!c(A.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!c(A.validatingFields,t)},error:{enumerable:!0,get:()=>c(A.errors,t)}}),[A,t]),F=b.useCallback(P=>w.current.onChange({target:{value:yt(P),name:t},type:me.CHANGE}),[t]),R=b.useCallback(()=>w.current.onBlur({target:{value:c(n._formValues,t),name:t},type:me.BLUR}),[t,n._formValues]),G=b.useCallback(P=>{const W=c(n._fields,t);W&&P&&(W._f.ref={focus:()=>P.focus(),select:()=>P.select(),setCustomValidity:m=>P.setCustomValidity(m),reportValidity:()=>P.reportValidity()})},[n._fields,t]),I=b.useMemo(()=>({name:t,value:y,...Q(i)||A.disabled?{disabled:A.disabled||i}:{},onChange:F,onBlur:R,ref:G}),[t,i,A.disabled,F,R,G,y]);return b.useEffect(()=>{const P=n._options.shouldUnregister||u;n.register(t,{...x.current.rules,...Q(x.current.disabled)?{disabled:x.current.disabled}:{}});const W=(m,Y)=>{const $=c(n._fields,m);$&&$._f&&($._f.mount=Y)};if(W(t,!0),P){const m=T(c(n._options.defaultValues,t));C(n._defaultValues,t,m),O(c(n._formValues,t))&&C(n._formValues,t,m)}return!d&&n.register(t),()=>{(d?P&&!n._state.action:P)?n.unregister(t):W(t,!1)}},[t,n,d,u]),b.useEffect(()=>{n._setDisabledField({disabled:i,name:t})},[i,t,n]),b.useMemo(()=>({field:I,formState:A,fieldState:E}),[I,A,E])}const sr=e=>e.render(Pt(e));var Wt=(e,s,t,i,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:n||!0}}:{},z=e=>Array.isArray(e)?e:[e],st=()=>{let e=[];return{get observers(){return e},next:n=>{for(const u of e)u.next&&u.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(u=>u!==n)}}),unsubscribe:()=>{e=[]}}},Be=e=>j(e)||!dt(e);function le(e,s){if(Be(e)||Be(s))return e===s;if(ue(e)&&ue(s))return e.getTime()===s.getTime();const t=Object.keys(e),i=Object.keys(s);if(t.length!==i.length)return!1;for(const n of t){const u=e[n];if(!i.includes(n))return!1;if(n!=="ref"){const d=s[n];if(ue(u)&&ue(d)||U(u)&&U(d)||Array.isArray(u)&&Array.isArray(d)?!le(u,d):u!==d)return!1}}return!0}var H=e=>U(e)&&!Object.keys(e).length,He=e=>e.type==="file",te=e=>typeof e=="function",Ae=e=>{if(!We)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},bt=e=>e.type==="select-multiple",$e=e=>e.type==="radio",qt=e=>$e(e)||_e(e),Ee=e=>Ae(e)&&e.isConnected;function Ht(e,s){const t=s.slice(0,-1).length;let i=0;for(;i<t;)e=O(e)?i++:e[s[i++]];return e}function $t(e){for(const s in e)if(e.hasOwnProperty(s)&&!O(e[s]))return!1;return!0}function B(e,s){const t=Array.isArray(s)?s:qe(s)?[s]:_t(s),i=t.length===1?e:Ht(e,t),n=t.length-1,u=t[n];return i&&delete i[u],n!==0&&(U(i)&&H(i)||Array.isArray(i)&&$t(i))&&B(e,t.slice(0,-1)),e}var mt=e=>{for(const s in e)if(te(e[s]))return!0;return!1};function Fe(e,s={}){const t=Array.isArray(e);if(U(e)||t)for(const i in e)Array.isArray(e[i])||U(e[i])&&!mt(e[i])?(s[i]=Array.isArray(e[i])?[]:{},Fe(e[i],s[i])):j(e[i])||(s[i]=!0);return s}function At(e,s,t){const i=Array.isArray(e);if(U(e)||i)for(const n in e)Array.isArray(e[n])||U(e[n])&&!mt(e[n])?O(s)||Be(t[n])?t[n]=Array.isArray(e[n])?Fe(e[n],[]):{...Fe(e[n])}:At(e[n],j(s)?{}:s[n],t[n]):t[n]=!le(e[n],s[n]);return t}var ye=(e,s)=>At(e,s,Fe(s));const it={value:!1,isValid:!1},at={value:!0,isValid:!0};var Ft=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&&!O(e[0].attributes.value)?O(e[0].value)||e[0].value===""?at:{value:e[0].value,isValid:!0}:at:it}return it},Vt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:i})=>O(e)?e:s?e===""?NaN:e&&+e:t&&se(e)?new Date(e):i?i(e):e;const nt={isValid:!1,value:null};var xt=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,nt):nt;function lt(e){const s=e.ref;return He(s)?s.files:$e(s)?xt(e.refs).value:bt(s)?[...s.selectedOptions].map(({value:t})=>t):_e(s)?Ft(e.refs).value:Vt(O(s.value)?e.ref.value:s.value,e)}var jt=(e,s,t,i)=>{const n={};for(const u of e){const d=c(s,u);d&&C(n,u,d._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},Ve=e=>e instanceof RegExp,ge=e=>O(e)?e:Ve(e)?e.source:U(e)?Ve(e.value)?e.value.source:e.value:e,ce=e=>({isOnSubmit:!e||e===ee.onSubmit,isOnBlur:e===ee.onBlur,isOnChange:e===ee.onChange,isOnAll:e===ee.all,isOnTouch:e===ee.onTouched});const ut="AsyncFunction";var Kt=e=>!!e&&!!e.validate&&!!(te(e.validate)&&e.validate.constructor.name===ut||U(e.validate)&&Object.values(e.validate).find(s=>s.constructor.name===ut)),zt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ie=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fe=(e,s,t,i)=>{for(const n of t||Object.keys(e)){const u=c(e,n);if(u){const{_f:d,...y}=u;if(d){if(d.refs&&d.refs[0]&&s(d.refs[0],n)&&!i)return!0;if(d.ref&&s(d.ref,d.name)&&!i)return!0;if(fe(y,s))break}else if(U(y)&&fe(y,s))break}}};function ot(e,s,t){const i=c(e,t);if(i||qe(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const u=n.join("."),d=c(s,u),y=c(e,u);if(d&&!Array.isArray(d)&&t!==u)return{name:t};if(y&&y.type)return{name:u,error:y};n.pop()}return{name:t}}var Gt=(e,s,t,i)=>{t(e);const{name:n,...u}=e;return H(u)||Object.keys(u).length>=Object.keys(s).length||Object.keys(u).find(d=>s[d]===(!i||ee.all))},Yt=(e,s,t)=>!e||!s||e===s||z(e).some(i=>i&&(t?i===s:i.startsWith(s)||s.startsWith(i))),Jt=(e,s,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Qt=(e,s)=>!he(c(e,s)).length&&B(e,s),St=(e,s,t)=>{const i=z(c(e,t));return C(i,"root",s[t]),C(e,t,i),e},be=e=>se(e);function ct(e,s,t="validate"){if(be(e)||Array.isArray(e)&&e.every(be)||Q(e)&&!e)return{type:t,message:be(e)?e:"",ref:s}}var oe=e=>U(e)&&!Ve(e)?e:{value:e,message:""},Pe=async(e,s,t,i,n,u)=>{const{ref:d,refs:y,required:A,maxLength:x,minLength:w,min:E,max:F,pattern:R,validate:G,name:I,valueAsNumber:P,mount:W}=e._f,m=c(t,I);if(!W||s.has(I))return{};const Y=y?y[0]:d,$=p=>{n&&Y.reportValidity&&(Y.setCustomValidity(Q(p)?"":p||""),Y.reportValidity())},M={},v=$e(d),h=_e(d),V=v||h,D=(P||He(d))&&O(d.value)&&O(m)||Ae(d)&&d.value===""||m===""||Array.isArray(m)&&!m.length,J=Wt.bind(null,I,i,M),X=(p,S,L,K=ie.maxLength,Z=ie.minLength)=>{const re=p?S:L;M[I]={type:p?K:Z,message:re,ref:d,...J(p?K:Z,re)}};if(u?!Array.isArray(m)||!m.length:A&&(!V&&(D||j(m))||Q(m)&&!m||h&&!Ft(y).isValid||v&&!xt(y).isValid)){const{value:p,message:S}=be(A)?{value:!!A,message:A}:oe(A);if(p&&(M[I]={type:ie.required,message:S,ref:Y,...J(ie.required,S)},!i))return $(S),M}if(!D&&(!j(E)||!j(F))){let p,S;const L=oe(F),K=oe(E);if(!j(m)&&!isNaN(m)){const Z=d.valueAsNumber||m&&+m;j(L.value)||(p=Z>L.value),j(K.value)||(S=Z<K.value)}else{const Z=d.valueAsDate||new Date(m),re=ve=>new Date(new Date().toDateString()+" "+ve),ae=d.type=="time",de=d.type=="week";se(L.value)&&m&&(p=ae?re(m)>re(L.value):de?m>L.value:Z>new Date(L.value)),se(K.value)&&m&&(S=ae?re(m)<re(K.value):de?m<K.value:Z<new Date(K.value))}if((p||S)&&(X(!!p,L.message,K.message,ie.max,ie.min),!i))return $(M[I].message),M}if((x||w)&&!D&&(se(m)||u&&Array.isArray(m))){const p=oe(x),S=oe(w),L=!j(p.value)&&m.length>+p.value,K=!j(S.value)&&m.length<+S.value;if((L||K)&&(X(L,p.message,S.message),!i))return $(M[I].message),M}if(R&&!D&&se(m)){const{value:p,message:S}=oe(R);if(Ve(p)&&!m.match(p)&&(M[I]={type:ie.pattern,message:S,ref:d,...J(ie.pattern,S)},!i))return $(S),M}if(G){if(te(G)){const p=await G(m,t),S=ct(p,Y);if(S&&(M[I]={...S,...J(ie.validate,S.message)},!i))return $(S.message),M}else if(U(G)){let p={};for(const S in G){if(!H(p)&&!i)break;const L=ct(await G[S](m,t),Y,S);L&&(p={...L,...J(S,L.message)},$(L.message),i&&(M[I]=p))}if(!H(p)&&(M[I]={ref:Y,...p},!i))return M}}return $(!0),M};const Xt={mode:ee.onSubmit,reValidateMode:ee.onChange,shouldFocusError:!0};function Zt(e={}){let s={...Xt,...e},t={submitCount:0,isDirty:!1,isLoading:te(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1};const i={};let n=U(s.defaultValues)||U(s.values)?T(s.values||s.defaultValues)||{}:{},u=s.shouldUnregister?{}:T(n),d={action:!1,mount:!1,watch:!1},y={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},A,x=0;const w={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let E={...w};const F={array:st(),state:st()},R=ce(s.mode),G=ce(s.reValidateMode),I=s.criteriaMode===ee.all,P=r=>a=>{clearTimeout(x),x=setTimeout(r,a)},W=async r=>{if(!s.disabled&&(w.isValid||E.isValid||r)){const a=s.resolver?H((await D()).errors):await X(i,!0);a!==t.isValid&&F.state.next({isValid:a})}},m=(r,a)=>{!s.disabled&&(w.isValidating||w.validatingFields||E.isValidating||E.validatingFields)&&((r||Array.from(y.mount)).forEach(l=>{l&&(a?C(t.validatingFields,l,a):B(t.validatingFields,l))}),F.state.next({validatingFields:t.validatingFields,isValidating:!H(t.validatingFields)}))},Y=(r,a=[],l,g,f=!0,o=!0)=>{if(g&&l&&!s.disabled){if(d.action=!0,o&&Array.isArray(c(i,r))){const _=l(c(i,r),g.argA,g.argB);f&&C(i,r,_)}if(o&&Array.isArray(c(t.errors,r))){const _=l(c(t.errors,r),g.argA,g.argB);f&&C(t.errors,r,_),Qt(t.errors,r)}if((w.touchedFields||E.touchedFields)&&o&&Array.isArray(c(t.touchedFields,r))){const _=l(c(t.touchedFields,r),g.argA,g.argB);f&&C(t.touchedFields,r,_)}(w.dirtyFields||E.dirtyFields)&&(t.dirtyFields=ye(n,u)),F.state.next({name:r,isDirty:S(r,a),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else C(u,r,a)},$=(r,a)=>{C(t.errors,r,a),F.state.next({errors:t.errors})},M=r=>{t.errors=r,F.state.next({errors:t.errors,isValid:!1})},v=(r,a,l,g)=>{const f=c(i,r);if(f){const o=c(u,r,O(l)?c(n,r):l);O(o)||g&&g.defaultChecked||a?C(u,r,a?o:lt(f._f)):Z(r,o),d.mount&&W()}},h=(r,a,l,g,f)=>{let o=!1,_=!1;const k={name:r};if(!s.disabled){if(!l||g){(w.isDirty||E.isDirty)&&(_=t.isDirty,t.isDirty=k.isDirty=S(),o=_!==k.isDirty);const N=le(c(n,r),a);_=!!c(t.dirtyFields,r),N?B(t.dirtyFields,r):C(t.dirtyFields,r,!0),k.dirtyFields=t.dirtyFields,o=o||(w.dirtyFields||E.dirtyFields)&&_!==!N}if(l){const N=c(t.touchedFields,r);N||(C(t.touchedFields,r,l),k.touchedFields=t.touchedFields,o=o||(w.touchedFields||E.touchedFields)&&N!==l)}o&&f&&F.state.next(k)}return o?k:{}},V=(r,a,l,g)=>{const f=c(t.errors,r),o=(w.isValid||E.isValid)&&Q(a)&&t.isValid!==a;if(s.delayError&&l?(A=P(()=>$(r,l)),A(s.delayError)):(clearTimeout(x),A=null,l?C(t.errors,r,l):B(t.errors,r)),(l?!le(f,l):f)||!H(g)||o){const _={...g,...o&&Q(a)?{isValid:a}:{},errors:t.errors,name:r};t={...t,..._},F.state.next(_)}},D=async r=>{m(r,!0);const a=await s.resolver(u,s.context,jt(r||y.mount,i,s.criteriaMode,s.shouldUseNativeValidation));return m(r),a},J=async r=>{const{errors:a}=await D(r);if(r)for(const l of r){const g=c(a,l);g?C(t.errors,l,g):B(t.errors,l)}else t.errors=a;return a},X=async(r,a,l={valid:!0})=>{for(const g in r){const f=r[g];if(f){const{_f:o,..._}=f;if(o){const k=y.array.has(o.name),N=f._f&&Kt(f._f);N&&w.validatingFields&&m([g],!0);const q=await Pe(f,y.disabled,u,I,s.shouldUseNativeValidation&&!a,k);if(N&&w.validatingFields&&m([g]),q[o.name]&&(l.valid=!1,a))break;!a&&(c(q,o.name)?k?St(t.errors,q,o.name):C(t.errors,o.name,q[o.name]):B(t.errors,o.name))}!H(_)&&await X(_,a,l)}}return l.valid},p=()=>{for(const r of y.unMount){const a=c(i,r);a&&(a._f.refs?a._f.refs.every(l=>!Ee(l)):!Ee(a._f.ref))&&we(r)}y.unMount=new Set},S=(r,a)=>!s.disabled&&(r&&a&&C(u,r,a),!le(je(),n)),L=(r,a,l)=>vt(r,y,{...d.mount?u:O(a)?n:se(r)?{[r]:a}:a},l,a),K=r=>he(c(d.mount?u:n,r,s.shouldUnregister?c(n,r,[]):[])),Z=(r,a,l={})=>{const g=c(i,r);let f=a;if(g){const o=g._f;o&&(!o.disabled&&C(u,r,Vt(a,o)),f=Ae(o.ref)&&j(a)?"":a,bt(o.ref)?[...o.ref.options].forEach(_=>_.selected=f.includes(_.value)):o.refs?_e(o.ref)?o.refs.length>1?o.refs.forEach(_=>(!_.defaultChecked||!_.disabled)&&(_.checked=Array.isArray(f)?!!f.find(k=>k===_.value):f===_.value)):o.refs[0]&&(o.refs[0].checked=!!f):o.refs.forEach(_=>_.checked=_.value===f):He(o.ref)?o.ref.value="":(o.ref.value=f,o.ref.type||F.state.next({name:r,values:T(u)})))}(l.shouldDirty||l.shouldTouch)&&h(r,f,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&Se(r)},re=(r,a,l)=>{for(const g in a){const f=a[g],o=`${r}.${g}`,_=c(i,o);(y.array.has(r)||U(f)||_&&!_._f)&&!ue(f)?re(o,f,l):Z(o,f,l)}},ae=(r,a,l={})=>{const g=c(i,r),f=y.array.has(r),o=T(a);C(u,r,o),f?(F.array.next({name:r,values:T(u)}),(w.isDirty||w.dirtyFields||E.isDirty||E.dirtyFields)&&l.shouldDirty&&F.state.next({name:r,dirtyFields:ye(n,u),isDirty:S(r,o)})):g&&!g._f&&!j(o)?re(r,o,l):Z(r,o,l),Ie(r,y)&&F.state.next({...t}),F.state.next({name:d.mount?r:void 0,values:T(u)})},de=async r=>{d.mount=!0;const a=r.target;let l=a.name,g=!0;const f=c(i,l),o=_=>{g=Number.isNaN(_)||ue(_)&&isNaN(_.getTime())||le(_,c(u,l,_))};if(f){let _,k;const N=a.type?lt(f._f):yt(r),q=r.type===me.BLUR||r.type===me.FOCUS_OUT,Rt=!zt(f._f)&&!s.resolver&&!c(t.errors,l)&&!f._f.deps||Jt(q,c(t.touchedFields,l),t.isSubmitted,G,R),De=Ie(l,y,q);C(u,l,N),q?(f._f.onBlur&&f._f.onBlur(r),A&&A(0)):f._f.onChange&&f._f.onChange(r);const pe=h(l,N,q),Tt=!H(pe)||De;if(!q&&F.state.next({name:l,type:r.type,values:T(u)}),Rt)return(w.isValid||E.isValid)&&(s.mode==="onBlur"?q&&W():q||W()),Tt&&F.state.next({name:l,...De?{}:pe});if(!q&&De&&F.state.next({...t}),s.resolver){const{errors:tt}=await D([l]);if(o(N),g){const Lt=ot(t.errors,i,l),rt=ot(tt,i,Lt.name||l);_=rt.error,l=rt.name,k=H(tt)}}else m([l],!0),_=(await Pe(f,y.disabled,u,I,s.shouldUseNativeValidation))[l],m([l]),o(N),g&&(_?k=!1:(w.isValid||E.isValid)&&(k=await X(i,!0)));g&&(f._f.deps&&Se(f._f.deps),V(l,k,_,pe))}},ve=(r,a)=>{if(c(t.errors,a)&&r.focus)return r.focus(),1},Se=async(r,a={})=>{let l,g;const f=z(r);if(s.resolver){const o=await J(O(r)?r:f);l=H(o),g=r?!f.some(_=>c(o,_)):l}else r?(g=(await Promise.all(f.map(async o=>{const _=c(i,o);return await X(_&&_._f?{[o]:_}:_)}))).every(Boolean),!(!g&&!t.isValid)&&W()):g=l=await X(i);return F.state.next({...!se(r)||(w.isValid||E.isValid)&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),a.shouldFocus&&!g&&fe(i,ve,r?f:y.mount),g},je=r=>{const a={...d.mount?u:n};return O(r)?a:se(r)?c(a,r):r.map(l=>c(a,l))},Ke=(r,a)=>({invalid:!!c((a||t).errors,r),isDirty:!!c((a||t).dirtyFields,r),error:c((a||t).errors,r),isValidating:!!c(t.validatingFields,r),isTouched:!!c((a||t).touchedFields,r)}),wt=r=>{r&&z(r).forEach(a=>B(t.errors,a)),F.state.next({errors:r?t.errors:{}})},ze=(r,a,l)=>{const g=(c(i,r,{_f:{}})._f||{}).ref,f=c(t.errors,r)||{},{ref:o,message:_,type:k,...N}=f;C(t.errors,r,{...N,...a,ref:g}),F.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&g&&g.focus&&g.focus()},kt=(r,a)=>te(r)?F.state.subscribe({next:l=>r(L(void 0,a),l)}):L(r,a,!0),Ge=r=>F.state.subscribe({next:a=>{Yt(r.name,a.name,r.exact)&&Gt(a,r.formState||w,Ot,r.reRenderRoot)&&r.callback({values:{...u},...t,...a})}}).unsubscribe,Dt=r=>(d.mount=!0,E={...E,...r.formState},Ge({...r,formState:E})),we=(r,a={})=>{for(const l of r?z(r):y.mount)y.mount.delete(l),y.array.delete(l),a.keepValue||(B(i,l),B(u,l)),!a.keepError&&B(t.errors,l),!a.keepDirty&&B(t.dirtyFields,l),!a.keepTouched&&B(t.touchedFields,l),!a.keepIsValidating&&B(t.validatingFields,l),!s.shouldUnregister&&!a.keepDefaultValue&&B(n,l);F.state.next({values:T(u)}),F.state.next({...t,...a.keepDirty?{isDirty:S()}:{}}),!a.keepIsValid&&W()},Ye=({disabled:r,name:a})=>{(Q(r)&&d.mount||r||y.disabled.has(a))&&(r?y.disabled.add(a):y.disabled.delete(a))},ke=(r,a={})=>{let l=c(i,r);const g=Q(a.disabled)||Q(s.disabled);return C(i,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...a}}),y.mount.add(r),l?Ye({disabled:Q(a.disabled)?a.disabled:s.disabled,name:r}):v(r,!0,a.value),{...g?{disabled:a.disabled||s.disabled}:{},...s.progressive?{required:!!a.required,min:ge(a.min),max:ge(a.max),minLength:ge(a.minLength),maxLength:ge(a.maxLength),pattern:ge(a.pattern)}:{},name:r,onChange:de,onBlur:de,ref:f=>{if(f){ke(r,a),l=c(i,r);const o=O(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,_=qt(o),k=l._f.refs||[];if(_?k.find(N=>N===o):o===l._f.ref)return;C(i,r,{_f:{...l._f,..._?{refs:[...k.filter(Ee),o,...Array.isArray(c(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),v(r,!1,void 0,o)}else l=c(i,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(gt(y.array,r)&&d.action)&&y.unMount.add(r)}}},Je=()=>s.shouldFocusError&&fe(i,ve,y.mount),pt=r=>{Q(r)&&(F.state.next({disabled:r}),fe(i,(a,l)=>{const g=c(i,l);g&&(a.disabled=g._f.disabled||r,Array.isArray(g._f.refs)&&g._f.refs.forEach(f=>{f.disabled=g._f.disabled||r}))},0,!1))},Qe=(r,a)=>async l=>{let g;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let f=T(u);if(F.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:_}=await D();t.errors=o,f=_}else await X(i);if(y.disabled.size)for(const o of y.disabled)C(f,o,void 0);if(B(t.errors,"root"),H(t.errors)){F.state.next({errors:{}});try{await r(f,l)}catch(o){g=o}}else a&&await a({...t.errors},l),Je(),setTimeout(Je);if(F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(t.errors)&&!g,submitCount:t.submitCount+1,errors:t.errors}),g)throw g},Et=(r,a={})=>{c(i,r)&&(O(a.defaultValue)?ae(r,T(c(n,r))):(ae(r,a.defaultValue),C(n,r,T(a.defaultValue))),a.keepTouched||B(t.touchedFields,r),a.keepDirty||(B(t.dirtyFields,r),t.isDirty=a.defaultValue?S(r,T(c(n,r))):S()),a.keepError||(B(t.errors,r),w.isValid&&W()),F.state.next({...t}))},Xe=(r,a={})=>{const l=r?T(r):n,g=T(l),f=H(r),o=f?n:g;if(a.keepDefaultValues||(n=l),!a.keepValues){if(a.keepDirtyValues){const _=new Set([...y.mount,...Object.keys(ye(n,u))]);for(const k of Array.from(_))c(t.dirtyFields,k)?C(o,k,c(u,k)):ae(k,c(o,k))}else{if(We&&O(r))for(const _ of y.mount){const k=c(i,_);if(k&&k._f){const N=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Ae(N)){const q=N.closest("form");if(q){q.reset();break}}}}for(const _ of y.mount)ae(_,c(o,_))}u=T(o),F.array.next({values:{...o}}),F.state.next({values:{...o}})}y={mount:a.keepDirtyValues?y.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!w.isValid||!!a.keepIsValid||!!a.keepDirtyValues,d.watch=!!s.shouldUnregister,F.state.next({submitCount:a.keepSubmitCount?t.submitCount:0,isDirty:f?!1:a.keepDirty?t.isDirty:!!(a.keepDefaultValues&&!le(r,n)),isSubmitted:a.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:f?{}:a.keepDirtyValues?a.keepDefaultValues&&u?ye(n,u):t.dirtyFields:a.keepDefaultValues&&r?ye(n,r):a.keepDirty?t.dirtyFields:{},touchedFields:a.keepTouched?t.touchedFields:{},errors:a.keepErrors?t.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Ze=(r,a)=>Xe(te(r)?r(u):r,a),Ct=(r,a={})=>{const l=c(i,r),g=l&&l._f;if(g){const f=g.refs?g.refs[0]:g.ref;f.focus&&(f.focus(),a.shouldSelect&&te(f.select)&&f.select())}},Ot=r=>{t={...t,...r}},et={control:{register:ke,unregister:we,getFieldState:Ke,handleSubmit:Qe,setError:ze,_subscribe:Ge,_runSchema:D,_getWatch:L,_getDirty:S,_setValid:W,_setFieldArray:Y,_setDisabledField:Ye,_setErrors:M,_getFieldArray:K,_reset:Xe,_resetDefaultValues:()=>te(s.defaultValues)&&s.defaultValues().then(r=>{Ze(r,s.resetOptions),F.state.next({isLoading:!1})}),_removeUnmounted:p,_disableForm:pt,_subjects:F,_proxyFormState:w,get _fields(){return i},get _formValues(){return u},get _state(){return d},set _state(r){d=r},get _defaultValues(){return n},get _names(){return y},set _names(r){y=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r}}},subscribe:Dt,trigger:Se,register:ke,handleSubmit:Qe,watch:kt,setValue:ae,getValues:je,reset:Ze,resetField:Et,clearErrors:wt,unregister:we,setError:ze,setFocus:Ct,getFieldState:Ke};return{...et,formControl:et}}var ne=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const t=(Math.random()*16+e)%16|0;return(s=="x"?t:t&3|8).toString(16)})},Ce=(e,s,t={})=>t.shouldFocus||O(t.shouldFocus)?t.focusName||`${e}.${O(t.focusIndex)?s:t.focusIndex}.`:"",Oe=(e,s)=>[...e,...z(s)],Re=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Te(e,s,t){return[...e.slice(0,s),...z(t),...e.slice(s)]}var Le=(e,s,t)=>Array.isArray(e)?(O(e[t])&&(e[t]=void 0),e.splice(t,0,e.splice(s,1)[0]),e):[],Ue=(e,s)=>[...z(s),...z(e)];function er(e,s){let t=0;const i=[...e];for(const n of s)i.splice(n-t,1),t++;return he(i).length?i:[]}var Me=(e,s)=>O(s)?[]:er(e,z(s).sort((t,i)=>t-i)),Ne=(e,s,t)=>{[e[s],e[t]]=[e[t],e[s]]},ft=(e,s,t)=>(e[s]=t,e);function ir(e){const s=xe(),{control:t=s.control,name:i,keyName:n="id",shouldUnregister:u,rules:d}=e,[y,A]=b.useState(t._getFieldArray(i)),x=b.useRef(t._getFieldArray(i).map(ne)),w=b.useRef(y),E=b.useRef(i),F=b.useRef(!1);E.current=i,w.current=y,t._names.array.add(i),d&&t.register(i,d),b.useEffect(()=>t._subjects.array.subscribe({next:({values:v,name:h})=>{if(h===E.current||!h){const V=c(v,E.current);Array.isArray(V)&&(A(V),x.current=V.map(ne))}}}).unsubscribe,[t]);const R=b.useCallback(v=>{F.current=!0,t._setFieldArray(i,v)},[t,i]),G=(v,h)=>{const V=z(T(v)),D=Oe(t._getFieldArray(i),V);t._names.focus=Ce(i,D.length-1,h),x.current=Oe(x.current,V.map(ne)),R(D),A(D),t._setFieldArray(i,D,Oe,{argA:Re(v)})},I=(v,h)=>{const V=z(T(v)),D=Ue(t._getFieldArray(i),V);t._names.focus=Ce(i,0,h),x.current=Ue(x.current,V.map(ne)),R(D),A(D),t._setFieldArray(i,D,Ue,{argA:Re(v)})},P=v=>{const h=Me(t._getFieldArray(i),v);x.current=Me(x.current,v),R(h),A(h),!Array.isArray(c(t._fields,i))&&C(t._fields,i,void 0),t._setFieldArray(i,h,Me,{argA:v})},W=(v,h,V)=>{const D=z(T(h)),J=Te(t._getFieldArray(i),v,D);t._names.focus=Ce(i,v,V),x.current=Te(x.current,v,D.map(ne)),R(J),A(J),t._setFieldArray(i,J,Te,{argA:v,argB:Re(h)})},m=(v,h)=>{const V=t._getFieldArray(i);Ne(V,v,h),Ne(x.current,v,h),R(V),A(V),t._setFieldArray(i,V,Ne,{argA:v,argB:h},!1)},Y=(v,h)=>{const V=t._getFieldArray(i);Le(V,v,h),Le(x.current,v,h),R(V),A(V),t._setFieldArray(i,V,Le,{argA:v,argB:h},!1)},$=(v,h)=>{const V=T(h),D=ft(t._getFieldArray(i),v,V);x.current=[...D].map((J,X)=>!J||X===v?ne():x.current[X]),R(D),A([...D]),t._setFieldArray(i,D,ft,{argA:v,argB:V},!0,!1)},M=v=>{const h=z(T(v));x.current=h.map(ne),R([...h]),A([...h]),t._setFieldArray(i,[...h],V=>V,{},!0,!1)};return b.useEffect(()=>{if(t._state.action=!1,Ie(i,t._names)&&t._subjects.state.next({...t._formState}),F.current&&(!ce(t._options.mode).isOnSubmit||t._formState.isSubmitted)&&!ce(t._options.reValidateMode).isOnSubmit)if(t._options.resolver)t._runSchema([i]).then(v=>{const h=c(v.errors,i),V=c(t._formState.errors,i);(V?!h&&V.type||h&&(V.type!==h.type||V.message!==h.message):h&&h.type)&&(h?C(t._formState.errors,i,h):B(t._formState.errors,i),t._subjects.state.next({errors:t._formState.errors}))});else{const v=c(t._fields,i);v&&v._f&&!(ce(t._options.reValidateMode).isOnSubmit&&ce(t._options.mode).isOnSubmit)&&Pe(v,t._names.disabled,t._formValues,t._options.criteriaMode===ee.all,t._options.shouldUseNativeValidation,!0).then(h=>!H(h)&&t._subjects.state.next({errors:St(t._formState.errors,h,i)}))}t._subjects.state.next({name:i,values:T(t._formValues)}),t._names.focus&&fe(t._fields,(v,h)=>{if(t._names.focus&&h.startsWith(t._names.focus)&&v.focus)return v.focus(),1}),t._names.focus="",t._setValid(),F.current=!1},[y,i,t]),b.useEffect(()=>(!c(t._formValues,i)&&t._setFieldArray(i),()=>{const v=(h,V)=>{const D=c(t._fields,h);D&&D._f&&(D._f.mount=V)};t._options.shouldUnregister||u?t.unregister(i):v(i,!1)}),[i,t,n,u]),{swap:b.useCallback(m,[R,i,t]),move:b.useCallback(Y,[R,i,t]),prepend:b.useCallback(I,[R,i,t]),append:b.useCallback(G,[R,i,t]),remove:b.useCallback(P,[R,i,t]),insert:b.useCallback(W,[R,i,t]),update:b.useCallback($,[R,i,t]),replace:b.useCallback(M,[R,i,t]),fields:b.useMemo(()=>y.map((v,h)=>({...v,[n]:x.current[h]||ne()})),[y,n])}}function ar(e={}){const s=b.useRef(void 0),t=b.useRef(void 0),[i,n]=b.useState({isDirty:!1,isValidating:!1,isLoading:te(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:te(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...e.formControl?e.formControl:Zt(e),formState:i},e.formControl&&e.defaultValues&&!te(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const u=s.current.control;return u._options=e,b.useLayoutEffect(()=>u._subscribe({formState:u._proxyFormState,callback:()=>n({...u._formState}),reRenderRoot:!0}),[u]),b.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),b.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==i.isDirty&&u._subjects.state.next({isDirty:d})}},[u,i.isDirty]),b.useEffect(()=>{e.values&&!le(e.values,t.current)?(u._reset(e.values,u._options.resetOptions),t.current=e.values,n(d=>({...d}))):u._resetDefaultValues()},[e.values,u]),b.useEffect(()=>{e.errors&&!H(e.errors)&&u._setErrors(e.errors)},[e.errors,u]),b.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),b.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[e.shouldUnregister,u]),s.current.formState=ht(i,u),s.current}export{sr as C,It as a,ir as b,ar as u};
|
|
1
|
+
import{bh as b}from"./index-DR-LzDpz.js";var _e=e=>e.type==="checkbox",ue=e=>e instanceof Date,j=e=>e==null;const dt=e=>typeof e=="object";var U=e=>!j(e)&&!Array.isArray(e)&&dt(e)&&!ue(e),yt=e=>U(e)&&e.target?_e(e.target)?e.target.checked:e.target.value:e,Ut=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,gt=(e,s)=>e.has(Ut(s)),Mt=e=>{const s=e.constructor&&e.constructor.prototype;return U(s)&&s.hasOwnProperty("isPrototypeOf")},We=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function T(e){let s;const t=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(We&&(e instanceof Blob||i))&&(t||U(e)))if(s=t?[]:{},!t&&!Mt(e))s=e;else for(const n in e)e.hasOwnProperty(n)&&(s[n]=T(e[n]));else return e;return s}var he=e=>Array.isArray(e)?e.filter(Boolean):[],O=e=>e===void 0,c=(e,s,t)=>{if(!s||!U(e))return t;const i=he(s.split(/[,[\].]+?/)).reduce((n,u)=>j(n)?n:n[u],e);return O(i)||i===e?O(e[s])?t:e[s]:i},Q=e=>typeof e=="boolean",qe=e=>/^\w*$/.test(e),_t=e=>he(e.replace(/["|']|\]/g,"").split(/\.|\[/)),C=(e,s,t)=>{let i=-1;const n=qe(s)?[s]:_t(s),u=n.length,d=u-1;for(;++i<u;){const y=n[i];let A=t;if(i!==d){const x=e[y];A=U(x)||Array.isArray(x)?x:isNaN(+n[i+1])?{}:[]}if(y==="__proto__"||y==="constructor"||y==="prototype")return;e[y]=A,e=e[y]}};const me={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ee={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ie={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Nt=b.createContext(null),xe=()=>b.useContext(Nt);var ht=(e,s,t,i=!0)=>{const n={defaultValues:s._defaultValues};for(const u in e)Object.defineProperty(n,u,{get:()=>{const d=u;return s._proxyFormState[d]!==ee.all&&(s._proxyFormState[d]=!i||ee.all),t&&(t[d]=!0),e[d]}});return n};function Bt(e){const s=xe(),{control:t=s.control,disabled:i,name:n,exact:u}=e||{},[d,y]=b.useState(t._formState),A=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),x=b.useRef(n);return x.current=n,b.useEffect(()=>t._subscribe({name:x.current,formState:A.current,exact:u,callback:w=>{!i&&y({...t._formState,...w})}}),[t,i,u]),b.useEffect(()=>{A.current.isValid&&t._setValid(!0)},[t]),b.useMemo(()=>ht(d,t,A.current,!1),[d,t])}var se=e=>typeof e=="string",vt=(e,s,t,i,n)=>se(e)?(i&&s.watch.add(e),c(t,e,n)):Array.isArray(e)?e.map(u=>(i&&s.watch.add(u),c(t,u))):(i&&(s.watchAll=!0),t);function It(e){const s=xe(),{control:t=s.control,name:i,defaultValue:n,disabled:u,exact:d}=e||{},y=b.useRef(i),A=b.useRef(n);y.current=i,b.useEffect(()=>t._subscribe({name:y.current,formState:{values:!0},exact:d,callback:E=>!u&&w(vt(y.current,t._names,E.values||t._formValues,!1,A.current))}),[t,u,d]);const[x,w]=b.useState(t._getWatch(i,n));return b.useEffect(()=>t._removeUnmounted()),x}function Pt(e){const s=xe(),{name:t,disabled:i,control:n=s.control,shouldUnregister:u}=e,d=gt(n._names.array,t),y=It({control:n,name:t,defaultValue:c(n._formValues,t,c(n._defaultValues,t,e.defaultValue)),exact:!0}),A=Bt({control:n,name:t,exact:!0}),x=b.useRef(e),w=b.useRef(n.register(t,{...e.rules,value:y,...Q(e.disabled)?{disabled:e.disabled}:{}})),E=b.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(A.errors,t)},isDirty:{enumerable:!0,get:()=>!!c(A.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!c(A.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!c(A.validatingFields,t)},error:{enumerable:!0,get:()=>c(A.errors,t)}}),[A,t]),F=b.useCallback(P=>w.current.onChange({target:{value:yt(P),name:t},type:me.CHANGE}),[t]),R=b.useCallback(()=>w.current.onBlur({target:{value:c(n._formValues,t),name:t},type:me.BLUR}),[t,n._formValues]),G=b.useCallback(P=>{const W=c(n._fields,t);W&&P&&(W._f.ref={focus:()=>P.focus(),select:()=>P.select(),setCustomValidity:m=>P.setCustomValidity(m),reportValidity:()=>P.reportValidity()})},[n._fields,t]),I=b.useMemo(()=>({name:t,value:y,...Q(i)||A.disabled?{disabled:A.disabled||i}:{},onChange:F,onBlur:R,ref:G}),[t,i,A.disabled,F,R,G,y]);return b.useEffect(()=>{const P=n._options.shouldUnregister||u;n.register(t,{...x.current.rules,...Q(x.current.disabled)?{disabled:x.current.disabled}:{}});const W=(m,Y)=>{const $=c(n._fields,m);$&&$._f&&($._f.mount=Y)};if(W(t,!0),P){const m=T(c(n._options.defaultValues,t));C(n._defaultValues,t,m),O(c(n._formValues,t))&&C(n._formValues,t,m)}return!d&&n.register(t),()=>{(d?P&&!n._state.action:P)?n.unregister(t):W(t,!1)}},[t,n,d,u]),b.useEffect(()=>{n._setDisabledField({disabled:i,name:t})},[i,t,n]),b.useMemo(()=>({field:I,formState:A,fieldState:E}),[I,A,E])}const sr=e=>e.render(Pt(e));var Wt=(e,s,t,i,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:n||!0}}:{},z=e=>Array.isArray(e)?e:[e],st=()=>{let e=[];return{get observers(){return e},next:n=>{for(const u of e)u.next&&u.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(u=>u!==n)}}),unsubscribe:()=>{e=[]}}},Be=e=>j(e)||!dt(e);function le(e,s){if(Be(e)||Be(s))return e===s;if(ue(e)&&ue(s))return e.getTime()===s.getTime();const t=Object.keys(e),i=Object.keys(s);if(t.length!==i.length)return!1;for(const n of t){const u=e[n];if(!i.includes(n))return!1;if(n!=="ref"){const d=s[n];if(ue(u)&&ue(d)||U(u)&&U(d)||Array.isArray(u)&&Array.isArray(d)?!le(u,d):u!==d)return!1}}return!0}var H=e=>U(e)&&!Object.keys(e).length,He=e=>e.type==="file",te=e=>typeof e=="function",Ae=e=>{if(!We)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},bt=e=>e.type==="select-multiple",$e=e=>e.type==="radio",qt=e=>$e(e)||_e(e),Ee=e=>Ae(e)&&e.isConnected;function Ht(e,s){const t=s.slice(0,-1).length;let i=0;for(;i<t;)e=O(e)?i++:e[s[i++]];return e}function $t(e){for(const s in e)if(e.hasOwnProperty(s)&&!O(e[s]))return!1;return!0}function B(e,s){const t=Array.isArray(s)?s:qe(s)?[s]:_t(s),i=t.length===1?e:Ht(e,t),n=t.length-1,u=t[n];return i&&delete i[u],n!==0&&(U(i)&&H(i)||Array.isArray(i)&&$t(i))&&B(e,t.slice(0,-1)),e}var mt=e=>{for(const s in e)if(te(e[s]))return!0;return!1};function Fe(e,s={}){const t=Array.isArray(e);if(U(e)||t)for(const i in e)Array.isArray(e[i])||U(e[i])&&!mt(e[i])?(s[i]=Array.isArray(e[i])?[]:{},Fe(e[i],s[i])):j(e[i])||(s[i]=!0);return s}function At(e,s,t){const i=Array.isArray(e);if(U(e)||i)for(const n in e)Array.isArray(e[n])||U(e[n])&&!mt(e[n])?O(s)||Be(t[n])?t[n]=Array.isArray(e[n])?Fe(e[n],[]):{...Fe(e[n])}:At(e[n],j(s)?{}:s[n],t[n]):t[n]=!le(e[n],s[n]);return t}var ye=(e,s)=>At(e,s,Fe(s));const it={value:!1,isValid:!1},at={value:!0,isValid:!0};var Ft=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&&!O(e[0].attributes.value)?O(e[0].value)||e[0].value===""?at:{value:e[0].value,isValid:!0}:at:it}return it},Vt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:i})=>O(e)?e:s?e===""?NaN:e&&+e:t&&se(e)?new Date(e):i?i(e):e;const nt={isValid:!1,value:null};var xt=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,nt):nt;function lt(e){const s=e.ref;return He(s)?s.files:$e(s)?xt(e.refs).value:bt(s)?[...s.selectedOptions].map(({value:t})=>t):_e(s)?Ft(e.refs).value:Vt(O(s.value)?e.ref.value:s.value,e)}var jt=(e,s,t,i)=>{const n={};for(const u of e){const d=c(s,u);d&&C(n,u,d._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},Ve=e=>e instanceof RegExp,ge=e=>O(e)?e:Ve(e)?e.source:U(e)?Ve(e.value)?e.value.source:e.value:e,ce=e=>({isOnSubmit:!e||e===ee.onSubmit,isOnBlur:e===ee.onBlur,isOnChange:e===ee.onChange,isOnAll:e===ee.all,isOnTouch:e===ee.onTouched});const ut="AsyncFunction";var Kt=e=>!!e&&!!e.validate&&!!(te(e.validate)&&e.validate.constructor.name===ut||U(e.validate)&&Object.values(e.validate).find(s=>s.constructor.name===ut)),zt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ie=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fe=(e,s,t,i)=>{for(const n of t||Object.keys(e)){const u=c(e,n);if(u){const{_f:d,...y}=u;if(d){if(d.refs&&d.refs[0]&&s(d.refs[0],n)&&!i)return!0;if(d.ref&&s(d.ref,d.name)&&!i)return!0;if(fe(y,s))break}else if(U(y)&&fe(y,s))break}}};function ot(e,s,t){const i=c(e,t);if(i||qe(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const u=n.join("."),d=c(s,u),y=c(e,u);if(d&&!Array.isArray(d)&&t!==u)return{name:t};if(y&&y.type)return{name:u,error:y};n.pop()}return{name:t}}var Gt=(e,s,t,i)=>{t(e);const{name:n,...u}=e;return H(u)||Object.keys(u).length>=Object.keys(s).length||Object.keys(u).find(d=>s[d]===(!i||ee.all))},Yt=(e,s,t)=>!e||!s||e===s||z(e).some(i=>i&&(t?i===s:i.startsWith(s)||s.startsWith(i))),Jt=(e,s,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Qt=(e,s)=>!he(c(e,s)).length&&B(e,s),St=(e,s,t)=>{const i=z(c(e,t));return C(i,"root",s[t]),C(e,t,i),e},be=e=>se(e);function ct(e,s,t="validate"){if(be(e)||Array.isArray(e)&&e.every(be)||Q(e)&&!e)return{type:t,message:be(e)?e:"",ref:s}}var oe=e=>U(e)&&!Ve(e)?e:{value:e,message:""},Pe=async(e,s,t,i,n,u)=>{const{ref:d,refs:y,required:A,maxLength:x,minLength:w,min:E,max:F,pattern:R,validate:G,name:I,valueAsNumber:P,mount:W}=e._f,m=c(t,I);if(!W||s.has(I))return{};const Y=y?y[0]:d,$=p=>{n&&Y.reportValidity&&(Y.setCustomValidity(Q(p)?"":p||""),Y.reportValidity())},M={},v=$e(d),h=_e(d),V=v||h,D=(P||He(d))&&O(d.value)&&O(m)||Ae(d)&&d.value===""||m===""||Array.isArray(m)&&!m.length,J=Wt.bind(null,I,i,M),X=(p,S,L,K=ie.maxLength,Z=ie.minLength)=>{const re=p?S:L;M[I]={type:p?K:Z,message:re,ref:d,...J(p?K:Z,re)}};if(u?!Array.isArray(m)||!m.length:A&&(!V&&(D||j(m))||Q(m)&&!m||h&&!Ft(y).isValid||v&&!xt(y).isValid)){const{value:p,message:S}=be(A)?{value:!!A,message:A}:oe(A);if(p&&(M[I]={type:ie.required,message:S,ref:Y,...J(ie.required,S)},!i))return $(S),M}if(!D&&(!j(E)||!j(F))){let p,S;const L=oe(F),K=oe(E);if(!j(m)&&!isNaN(m)){const Z=d.valueAsNumber||m&&+m;j(L.value)||(p=Z>L.value),j(K.value)||(S=Z<K.value)}else{const Z=d.valueAsDate||new Date(m),re=ve=>new Date(new Date().toDateString()+" "+ve),ae=d.type=="time",de=d.type=="week";se(L.value)&&m&&(p=ae?re(m)>re(L.value):de?m>L.value:Z>new Date(L.value)),se(K.value)&&m&&(S=ae?re(m)<re(K.value):de?m<K.value:Z<new Date(K.value))}if((p||S)&&(X(!!p,L.message,K.message,ie.max,ie.min),!i))return $(M[I].message),M}if((x||w)&&!D&&(se(m)||u&&Array.isArray(m))){const p=oe(x),S=oe(w),L=!j(p.value)&&m.length>+p.value,K=!j(S.value)&&m.length<+S.value;if((L||K)&&(X(L,p.message,S.message),!i))return $(M[I].message),M}if(R&&!D&&se(m)){const{value:p,message:S}=oe(R);if(Ve(p)&&!m.match(p)&&(M[I]={type:ie.pattern,message:S,ref:d,...J(ie.pattern,S)},!i))return $(S),M}if(G){if(te(G)){const p=await G(m,t),S=ct(p,Y);if(S&&(M[I]={...S,...J(ie.validate,S.message)},!i))return $(S.message),M}else if(U(G)){let p={};for(const S in G){if(!H(p)&&!i)break;const L=ct(await G[S](m,t),Y,S);L&&(p={...L,...J(S,L.message)},$(L.message),i&&(M[I]=p))}if(!H(p)&&(M[I]={ref:Y,...p},!i))return M}}return $(!0),M};const Xt={mode:ee.onSubmit,reValidateMode:ee.onChange,shouldFocusError:!0};function Zt(e={}){let s={...Xt,...e},t={submitCount:0,isDirty:!1,isLoading:te(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1};const i={};let n=U(s.defaultValues)||U(s.values)?T(s.values||s.defaultValues)||{}:{},u=s.shouldUnregister?{}:T(n),d={action:!1,mount:!1,watch:!1},y={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},A,x=0;const w={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let E={...w};const F={array:st(),state:st()},R=ce(s.mode),G=ce(s.reValidateMode),I=s.criteriaMode===ee.all,P=r=>a=>{clearTimeout(x),x=setTimeout(r,a)},W=async r=>{if(!s.disabled&&(w.isValid||E.isValid||r)){const a=s.resolver?H((await D()).errors):await X(i,!0);a!==t.isValid&&F.state.next({isValid:a})}},m=(r,a)=>{!s.disabled&&(w.isValidating||w.validatingFields||E.isValidating||E.validatingFields)&&((r||Array.from(y.mount)).forEach(l=>{l&&(a?C(t.validatingFields,l,a):B(t.validatingFields,l))}),F.state.next({validatingFields:t.validatingFields,isValidating:!H(t.validatingFields)}))},Y=(r,a=[],l,g,f=!0,o=!0)=>{if(g&&l&&!s.disabled){if(d.action=!0,o&&Array.isArray(c(i,r))){const _=l(c(i,r),g.argA,g.argB);f&&C(i,r,_)}if(o&&Array.isArray(c(t.errors,r))){const _=l(c(t.errors,r),g.argA,g.argB);f&&C(t.errors,r,_),Qt(t.errors,r)}if((w.touchedFields||E.touchedFields)&&o&&Array.isArray(c(t.touchedFields,r))){const _=l(c(t.touchedFields,r),g.argA,g.argB);f&&C(t.touchedFields,r,_)}(w.dirtyFields||E.dirtyFields)&&(t.dirtyFields=ye(n,u)),F.state.next({name:r,isDirty:S(r,a),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else C(u,r,a)},$=(r,a)=>{C(t.errors,r,a),F.state.next({errors:t.errors})},M=r=>{t.errors=r,F.state.next({errors:t.errors,isValid:!1})},v=(r,a,l,g)=>{const f=c(i,r);if(f){const o=c(u,r,O(l)?c(n,r):l);O(o)||g&&g.defaultChecked||a?C(u,r,a?o:lt(f._f)):Z(r,o),d.mount&&W()}},h=(r,a,l,g,f)=>{let o=!1,_=!1;const k={name:r};if(!s.disabled){if(!l||g){(w.isDirty||E.isDirty)&&(_=t.isDirty,t.isDirty=k.isDirty=S(),o=_!==k.isDirty);const N=le(c(n,r),a);_=!!c(t.dirtyFields,r),N?B(t.dirtyFields,r):C(t.dirtyFields,r,!0),k.dirtyFields=t.dirtyFields,o=o||(w.dirtyFields||E.dirtyFields)&&_!==!N}if(l){const N=c(t.touchedFields,r);N||(C(t.touchedFields,r,l),k.touchedFields=t.touchedFields,o=o||(w.touchedFields||E.touchedFields)&&N!==l)}o&&f&&F.state.next(k)}return o?k:{}},V=(r,a,l,g)=>{const f=c(t.errors,r),o=(w.isValid||E.isValid)&&Q(a)&&t.isValid!==a;if(s.delayError&&l?(A=P(()=>$(r,l)),A(s.delayError)):(clearTimeout(x),A=null,l?C(t.errors,r,l):B(t.errors,r)),(l?!le(f,l):f)||!H(g)||o){const _={...g,...o&&Q(a)?{isValid:a}:{},errors:t.errors,name:r};t={...t,..._},F.state.next(_)}},D=async r=>{m(r,!0);const a=await s.resolver(u,s.context,jt(r||y.mount,i,s.criteriaMode,s.shouldUseNativeValidation));return m(r),a},J=async r=>{const{errors:a}=await D(r);if(r)for(const l of r){const g=c(a,l);g?C(t.errors,l,g):B(t.errors,l)}else t.errors=a;return a},X=async(r,a,l={valid:!0})=>{for(const g in r){const f=r[g];if(f){const{_f:o,..._}=f;if(o){const k=y.array.has(o.name),N=f._f&&Kt(f._f);N&&w.validatingFields&&m([g],!0);const q=await Pe(f,y.disabled,u,I,s.shouldUseNativeValidation&&!a,k);if(N&&w.validatingFields&&m([g]),q[o.name]&&(l.valid=!1,a))break;!a&&(c(q,o.name)?k?St(t.errors,q,o.name):C(t.errors,o.name,q[o.name]):B(t.errors,o.name))}!H(_)&&await X(_,a,l)}}return l.valid},p=()=>{for(const r of y.unMount){const a=c(i,r);a&&(a._f.refs?a._f.refs.every(l=>!Ee(l)):!Ee(a._f.ref))&&we(r)}y.unMount=new Set},S=(r,a)=>!s.disabled&&(r&&a&&C(u,r,a),!le(je(),n)),L=(r,a,l)=>vt(r,y,{...d.mount?u:O(a)?n:se(r)?{[r]:a}:a},l,a),K=r=>he(c(d.mount?u:n,r,s.shouldUnregister?c(n,r,[]):[])),Z=(r,a,l={})=>{const g=c(i,r);let f=a;if(g){const o=g._f;o&&(!o.disabled&&C(u,r,Vt(a,o)),f=Ae(o.ref)&&j(a)?"":a,bt(o.ref)?[...o.ref.options].forEach(_=>_.selected=f.includes(_.value)):o.refs?_e(o.ref)?o.refs.length>1?o.refs.forEach(_=>(!_.defaultChecked||!_.disabled)&&(_.checked=Array.isArray(f)?!!f.find(k=>k===_.value):f===_.value)):o.refs[0]&&(o.refs[0].checked=!!f):o.refs.forEach(_=>_.checked=_.value===f):He(o.ref)?o.ref.value="":(o.ref.value=f,o.ref.type||F.state.next({name:r,values:T(u)})))}(l.shouldDirty||l.shouldTouch)&&h(r,f,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&Se(r)},re=(r,a,l)=>{for(const g in a){const f=a[g],o=`${r}.${g}`,_=c(i,o);(y.array.has(r)||U(f)||_&&!_._f)&&!ue(f)?re(o,f,l):Z(o,f,l)}},ae=(r,a,l={})=>{const g=c(i,r),f=y.array.has(r),o=T(a);C(u,r,o),f?(F.array.next({name:r,values:T(u)}),(w.isDirty||w.dirtyFields||E.isDirty||E.dirtyFields)&&l.shouldDirty&&F.state.next({name:r,dirtyFields:ye(n,u),isDirty:S(r,o)})):g&&!g._f&&!j(o)?re(r,o,l):Z(r,o,l),Ie(r,y)&&F.state.next({...t}),F.state.next({name:d.mount?r:void 0,values:T(u)})},de=async r=>{d.mount=!0;const a=r.target;let l=a.name,g=!0;const f=c(i,l),o=_=>{g=Number.isNaN(_)||ue(_)&&isNaN(_.getTime())||le(_,c(u,l,_))};if(f){let _,k;const N=a.type?lt(f._f):yt(r),q=r.type===me.BLUR||r.type===me.FOCUS_OUT,Rt=!zt(f._f)&&!s.resolver&&!c(t.errors,l)&&!f._f.deps||Jt(q,c(t.touchedFields,l),t.isSubmitted,G,R),De=Ie(l,y,q);C(u,l,N),q?(f._f.onBlur&&f._f.onBlur(r),A&&A(0)):f._f.onChange&&f._f.onChange(r);const pe=h(l,N,q),Tt=!H(pe)||De;if(!q&&F.state.next({name:l,type:r.type,values:T(u)}),Rt)return(w.isValid||E.isValid)&&(s.mode==="onBlur"?q&&W():q||W()),Tt&&F.state.next({name:l,...De?{}:pe});if(!q&&De&&F.state.next({...t}),s.resolver){const{errors:tt}=await D([l]);if(o(N),g){const Lt=ot(t.errors,i,l),rt=ot(tt,i,Lt.name||l);_=rt.error,l=rt.name,k=H(tt)}}else m([l],!0),_=(await Pe(f,y.disabled,u,I,s.shouldUseNativeValidation))[l],m([l]),o(N),g&&(_?k=!1:(w.isValid||E.isValid)&&(k=await X(i,!0)));g&&(f._f.deps&&Se(f._f.deps),V(l,k,_,pe))}},ve=(r,a)=>{if(c(t.errors,a)&&r.focus)return r.focus(),1},Se=async(r,a={})=>{let l,g;const f=z(r);if(s.resolver){const o=await J(O(r)?r:f);l=H(o),g=r?!f.some(_=>c(o,_)):l}else r?(g=(await Promise.all(f.map(async o=>{const _=c(i,o);return await X(_&&_._f?{[o]:_}:_)}))).every(Boolean),!(!g&&!t.isValid)&&W()):g=l=await X(i);return F.state.next({...!se(r)||(w.isValid||E.isValid)&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),a.shouldFocus&&!g&&fe(i,ve,r?f:y.mount),g},je=r=>{const a={...d.mount?u:n};return O(r)?a:se(r)?c(a,r):r.map(l=>c(a,l))},Ke=(r,a)=>({invalid:!!c((a||t).errors,r),isDirty:!!c((a||t).dirtyFields,r),error:c((a||t).errors,r),isValidating:!!c(t.validatingFields,r),isTouched:!!c((a||t).touchedFields,r)}),wt=r=>{r&&z(r).forEach(a=>B(t.errors,a)),F.state.next({errors:r?t.errors:{}})},ze=(r,a,l)=>{const g=(c(i,r,{_f:{}})._f||{}).ref,f=c(t.errors,r)||{},{ref:o,message:_,type:k,...N}=f;C(t.errors,r,{...N,...a,ref:g}),F.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&g&&g.focus&&g.focus()},kt=(r,a)=>te(r)?F.state.subscribe({next:l=>r(L(void 0,a),l)}):L(r,a,!0),Ge=r=>F.state.subscribe({next:a=>{Yt(r.name,a.name,r.exact)&&Gt(a,r.formState||w,Ot,r.reRenderRoot)&&r.callback({values:{...u},...t,...a})}}).unsubscribe,Dt=r=>(d.mount=!0,E={...E,...r.formState},Ge({...r,formState:E})),we=(r,a={})=>{for(const l of r?z(r):y.mount)y.mount.delete(l),y.array.delete(l),a.keepValue||(B(i,l),B(u,l)),!a.keepError&&B(t.errors,l),!a.keepDirty&&B(t.dirtyFields,l),!a.keepTouched&&B(t.touchedFields,l),!a.keepIsValidating&&B(t.validatingFields,l),!s.shouldUnregister&&!a.keepDefaultValue&&B(n,l);F.state.next({values:T(u)}),F.state.next({...t,...a.keepDirty?{isDirty:S()}:{}}),!a.keepIsValid&&W()},Ye=({disabled:r,name:a})=>{(Q(r)&&d.mount||r||y.disabled.has(a))&&(r?y.disabled.add(a):y.disabled.delete(a))},ke=(r,a={})=>{let l=c(i,r);const g=Q(a.disabled)||Q(s.disabled);return C(i,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...a}}),y.mount.add(r),l?Ye({disabled:Q(a.disabled)?a.disabled:s.disabled,name:r}):v(r,!0,a.value),{...g?{disabled:a.disabled||s.disabled}:{},...s.progressive?{required:!!a.required,min:ge(a.min),max:ge(a.max),minLength:ge(a.minLength),maxLength:ge(a.maxLength),pattern:ge(a.pattern)}:{},name:r,onChange:de,onBlur:de,ref:f=>{if(f){ke(r,a),l=c(i,r);const o=O(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,_=qt(o),k=l._f.refs||[];if(_?k.find(N=>N===o):o===l._f.ref)return;C(i,r,{_f:{...l._f,..._?{refs:[...k.filter(Ee),o,...Array.isArray(c(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),v(r,!1,void 0,o)}else l=c(i,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(gt(y.array,r)&&d.action)&&y.unMount.add(r)}}},Je=()=>s.shouldFocusError&&fe(i,ve,y.mount),pt=r=>{Q(r)&&(F.state.next({disabled:r}),fe(i,(a,l)=>{const g=c(i,l);g&&(a.disabled=g._f.disabled||r,Array.isArray(g._f.refs)&&g._f.refs.forEach(f=>{f.disabled=g._f.disabled||r}))},0,!1))},Qe=(r,a)=>async l=>{let g;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let f=T(u);if(F.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:_}=await D();t.errors=o,f=_}else await X(i);if(y.disabled.size)for(const o of y.disabled)C(f,o,void 0);if(B(t.errors,"root"),H(t.errors)){F.state.next({errors:{}});try{await r(f,l)}catch(o){g=o}}else a&&await a({...t.errors},l),Je(),setTimeout(Je);if(F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(t.errors)&&!g,submitCount:t.submitCount+1,errors:t.errors}),g)throw g},Et=(r,a={})=>{c(i,r)&&(O(a.defaultValue)?ae(r,T(c(n,r))):(ae(r,a.defaultValue),C(n,r,T(a.defaultValue))),a.keepTouched||B(t.touchedFields,r),a.keepDirty||(B(t.dirtyFields,r),t.isDirty=a.defaultValue?S(r,T(c(n,r))):S()),a.keepError||(B(t.errors,r),w.isValid&&W()),F.state.next({...t}))},Xe=(r,a={})=>{const l=r?T(r):n,g=T(l),f=H(r),o=f?n:g;if(a.keepDefaultValues||(n=l),!a.keepValues){if(a.keepDirtyValues){const _=new Set([...y.mount,...Object.keys(ye(n,u))]);for(const k of Array.from(_))c(t.dirtyFields,k)?C(o,k,c(u,k)):ae(k,c(o,k))}else{if(We&&O(r))for(const _ of y.mount){const k=c(i,_);if(k&&k._f){const N=Array.isArray(k._f.refs)?k._f.refs[0]:k._f.ref;if(Ae(N)){const q=N.closest("form");if(q){q.reset();break}}}}for(const _ of y.mount)ae(_,c(o,_))}u=T(o),F.array.next({values:{...o}}),F.state.next({values:{...o}})}y={mount:a.keepDirtyValues?y.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!w.isValid||!!a.keepIsValid||!!a.keepDirtyValues,d.watch=!!s.shouldUnregister,F.state.next({submitCount:a.keepSubmitCount?t.submitCount:0,isDirty:f?!1:a.keepDirty?t.isDirty:!!(a.keepDefaultValues&&!le(r,n)),isSubmitted:a.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:f?{}:a.keepDirtyValues?a.keepDefaultValues&&u?ye(n,u):t.dirtyFields:a.keepDefaultValues&&r?ye(n,r):a.keepDirty?t.dirtyFields:{},touchedFields:a.keepTouched?t.touchedFields:{},errors:a.keepErrors?t.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Ze=(r,a)=>Xe(te(r)?r(u):r,a),Ct=(r,a={})=>{const l=c(i,r),g=l&&l._f;if(g){const f=g.refs?g.refs[0]:g.ref;f.focus&&(f.focus(),a.shouldSelect&&te(f.select)&&f.select())}},Ot=r=>{t={...t,...r}},et={control:{register:ke,unregister:we,getFieldState:Ke,handleSubmit:Qe,setError:ze,_subscribe:Ge,_runSchema:D,_getWatch:L,_getDirty:S,_setValid:W,_setFieldArray:Y,_setDisabledField:Ye,_setErrors:M,_getFieldArray:K,_reset:Xe,_resetDefaultValues:()=>te(s.defaultValues)&&s.defaultValues().then(r=>{Ze(r,s.resetOptions),F.state.next({isLoading:!1})}),_removeUnmounted:p,_disableForm:pt,_subjects:F,_proxyFormState:w,get _fields(){return i},get _formValues(){return u},get _state(){return d},set _state(r){d=r},get _defaultValues(){return n},get _names(){return y},set _names(r){y=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r}}},subscribe:Dt,trigger:Se,register:ke,handleSubmit:Qe,watch:kt,setValue:ae,getValues:je,reset:Ze,resetField:Et,clearErrors:wt,unregister:we,setError:ze,setFocus:Ct,getFieldState:Ke};return{...et,formControl:et}}var ne=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const t=(Math.random()*16+e)%16|0;return(s=="x"?t:t&3|8).toString(16)})},Ce=(e,s,t={})=>t.shouldFocus||O(t.shouldFocus)?t.focusName||`${e}.${O(t.focusIndex)?s:t.focusIndex}.`:"",Oe=(e,s)=>[...e,...z(s)],Re=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Te(e,s,t){return[...e.slice(0,s),...z(t),...e.slice(s)]}var Le=(e,s,t)=>Array.isArray(e)?(O(e[t])&&(e[t]=void 0),e.splice(t,0,e.splice(s,1)[0]),e):[],Ue=(e,s)=>[...z(s),...z(e)];function er(e,s){let t=0;const i=[...e];for(const n of s)i.splice(n-t,1),t++;return he(i).length?i:[]}var Me=(e,s)=>O(s)?[]:er(e,z(s).sort((t,i)=>t-i)),Ne=(e,s,t)=>{[e[s],e[t]]=[e[t],e[s]]},ft=(e,s,t)=>(e[s]=t,e);function ir(e){const s=xe(),{control:t=s.control,name:i,keyName:n="id",shouldUnregister:u,rules:d}=e,[y,A]=b.useState(t._getFieldArray(i)),x=b.useRef(t._getFieldArray(i).map(ne)),w=b.useRef(y),E=b.useRef(i),F=b.useRef(!1);E.current=i,w.current=y,t._names.array.add(i),d&&t.register(i,d),b.useEffect(()=>t._subjects.array.subscribe({next:({values:v,name:h})=>{if(h===E.current||!h){const V=c(v,E.current);Array.isArray(V)&&(A(V),x.current=V.map(ne))}}}).unsubscribe,[t]);const R=b.useCallback(v=>{F.current=!0,t._setFieldArray(i,v)},[t,i]),G=(v,h)=>{const V=z(T(v)),D=Oe(t._getFieldArray(i),V);t._names.focus=Ce(i,D.length-1,h),x.current=Oe(x.current,V.map(ne)),R(D),A(D),t._setFieldArray(i,D,Oe,{argA:Re(v)})},I=(v,h)=>{const V=z(T(v)),D=Ue(t._getFieldArray(i),V);t._names.focus=Ce(i,0,h),x.current=Ue(x.current,V.map(ne)),R(D),A(D),t._setFieldArray(i,D,Ue,{argA:Re(v)})},P=v=>{const h=Me(t._getFieldArray(i),v);x.current=Me(x.current,v),R(h),A(h),!Array.isArray(c(t._fields,i))&&C(t._fields,i,void 0),t._setFieldArray(i,h,Me,{argA:v})},W=(v,h,V)=>{const D=z(T(h)),J=Te(t._getFieldArray(i),v,D);t._names.focus=Ce(i,v,V),x.current=Te(x.current,v,D.map(ne)),R(J),A(J),t._setFieldArray(i,J,Te,{argA:v,argB:Re(h)})},m=(v,h)=>{const V=t._getFieldArray(i);Ne(V,v,h),Ne(x.current,v,h),R(V),A(V),t._setFieldArray(i,V,Ne,{argA:v,argB:h},!1)},Y=(v,h)=>{const V=t._getFieldArray(i);Le(V,v,h),Le(x.current,v,h),R(V),A(V),t._setFieldArray(i,V,Le,{argA:v,argB:h},!1)},$=(v,h)=>{const V=T(h),D=ft(t._getFieldArray(i),v,V);x.current=[...D].map((J,X)=>!J||X===v?ne():x.current[X]),R(D),A([...D]),t._setFieldArray(i,D,ft,{argA:v,argB:V},!0,!1)},M=v=>{const h=z(T(v));x.current=h.map(ne),R([...h]),A([...h]),t._setFieldArray(i,[...h],V=>V,{},!0,!1)};return b.useEffect(()=>{if(t._state.action=!1,Ie(i,t._names)&&t._subjects.state.next({...t._formState}),F.current&&(!ce(t._options.mode).isOnSubmit||t._formState.isSubmitted)&&!ce(t._options.reValidateMode).isOnSubmit)if(t._options.resolver)t._runSchema([i]).then(v=>{const h=c(v.errors,i),V=c(t._formState.errors,i);(V?!h&&V.type||h&&(V.type!==h.type||V.message!==h.message):h&&h.type)&&(h?C(t._formState.errors,i,h):B(t._formState.errors,i),t._subjects.state.next({errors:t._formState.errors}))});else{const v=c(t._fields,i);v&&v._f&&!(ce(t._options.reValidateMode).isOnSubmit&&ce(t._options.mode).isOnSubmit)&&Pe(v,t._names.disabled,t._formValues,t._options.criteriaMode===ee.all,t._options.shouldUseNativeValidation,!0).then(h=>!H(h)&&t._subjects.state.next({errors:St(t._formState.errors,h,i)}))}t._subjects.state.next({name:i,values:T(t._formValues)}),t._names.focus&&fe(t._fields,(v,h)=>{if(t._names.focus&&h.startsWith(t._names.focus)&&v.focus)return v.focus(),1}),t._names.focus="",t._setValid(),F.current=!1},[y,i,t]),b.useEffect(()=>(!c(t._formValues,i)&&t._setFieldArray(i),()=>{const v=(h,V)=>{const D=c(t._fields,h);D&&D._f&&(D._f.mount=V)};t._options.shouldUnregister||u?t.unregister(i):v(i,!1)}),[i,t,n,u]),{swap:b.useCallback(m,[R,i,t]),move:b.useCallback(Y,[R,i,t]),prepend:b.useCallback(I,[R,i,t]),append:b.useCallback(G,[R,i,t]),remove:b.useCallback(P,[R,i,t]),insert:b.useCallback(W,[R,i,t]),update:b.useCallback($,[R,i,t]),replace:b.useCallback(M,[R,i,t]),fields:b.useMemo(()=>y.map((v,h)=>({...v,[n]:x.current[h]||ne()})),[y,n])}}function ar(e={}){const s=b.useRef(void 0),t=b.useRef(void 0),[i,n]=b.useState({isDirty:!1,isValidating:!1,isLoading:te(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:te(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...e.formControl?e.formControl:Zt(e),formState:i},e.formControl&&e.defaultValues&&!te(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const u=s.current.control;return u._options=e,b.useLayoutEffect(()=>u._subscribe({formState:u._proxyFormState,callback:()=>n({...u._formState}),reRenderRoot:!0}),[u]),b.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),b.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==i.isDirty&&u._subjects.state.next({isDirty:d})}},[u,i.isDirty]),b.useEffect(()=>{e.values&&!le(e.values,t.current)?(u._reset(e.values,u._options.resetOptions),t.current=e.values,n(d=>({...d}))):u._resetDefaultValues()},[e.values,u]),b.useEffect(()=>{e.errors&&!H(e.errors)&&u._setErrors(e.errors)},[e.errors,u]),b.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),b.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[e.shouldUnregister,u]),s.current.formState=ht(i,u),s.current}export{sr as C,It as a,ir as b,ar as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as i}from"./codemirror.es-
|
|
1
|
+
import{C as i}from"./codemirror.es-CTXkiUOQ.js";import"./index-fvOlvRD2.js";import"./index-DR-LzDpz.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-
|
|
1
|
+
import{C as h}from"./codemirror.es-CTXkiUOQ.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es-C8psaih6.js";import"./info-addon.es-aGFlpxMB.js";import{Y as A,r as F}from"./index-fvOlvRD2.js";import"./index-DR-LzDpz.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 C,j as u,ff as Gt,d8 as O,fg as qt,b as Ht,K as jt,fh as Kt,a6 as Vt,bh as zt,r as P,a9 as Jt,a4 as Yt,aa as Xt,bm as Qt,bq as Zt,o as kt,m as te,H as ee,W as re,k as ie,t as ne,D as se,B as ft,C as pt,s as oe,V as ae,v as le,bB as ce,X as he}from"./index-NirGJtdP.js";import{W as ue}from"./url-evaluation-CEYtfcX2.js";import{s as St,n as fe}from"./schema-Cb35ZxuZ.js";import{r as pe}from"./cloneDeep-Dx0IDKG5.js";import{I as mt}from"./index-0sbUWWmv.js";import{d as me}from"./Delete-DM0QAMOh.js";import{_ as de}from"./useLocalStorage-CUruJXEg.js";import{A as ge}from"./Autocomplete-C5_M8mFC.js";import{L as ve}from"./ListItemButton-CsAyFEiR.js";import{S as ye,a as be,b as xe}from"./Stepper-CMm5g8HX.js";function je({mode:t,...e}){return t==="development"?u.jsx(ue,{type:"primary",...e,children:"DEV"}):null}je.propTypes={mode:C.string.isRequired};var _t={},lt={exports:{}},Et={exports:{}},Y=Et.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(t){return"file-"+Ct(t)}}},dt={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:Ct};Object.keys(Y).forEach(function(t){Object.keys(dt).forEach(function(e){Y[t][e]||(Y[t][e]=dt[e])}),Y[t].protocols_re=RegExp("^("+Y[t].protocols.map(function(e){return e.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Ct(t){return t.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var wt=Et.exports,gt=wt,K=Object.assign||function(e,r){if(r===null||typeof r!="object")return e;const i=Object.keys(r);let s=i.length;for(;s--;)e[i[s]]=r[i[s]];return e},Se=E;function E(t,e,r,i,s,a,c){var l=this;l.type=t,Object.keys(gt[t]).forEach(function(d){l[d]=gt[t][d]}),l.user=e,l.auth=r,l.project=i,l.committish=s,l.default=a,l.opts=c||{}}E.prototype.hash=function(){return this.committish?"#"+this.committish:""};E.prototype._fill=function(t,e){if(t){var r=K({},e);r.path=r.path?r.path.replace(/^[/]+/g,""):"",e=K(K({},this.opts),e);var i=this;Object.keys(this).forEach(function(h){i[h]!=null&&r[h]==null&&(r[h]=i[h])});var s=r.auth,a=r.committish,c=r.fragment,l=r.path,d=r.project;Object.keys(r).forEach(function(h){var j=r[h];(h==="path"||h==="project")&&typeof j=="string"?r[h]=j.split("/").map(function(m){return encodeURIComponent(m)}).join("/"):h!=="domain"&&(r[h]=encodeURIComponent(j))}),r["auth@"]=s?s+"@":"",r["#fragment"]=c?"#"+this.hashformat(c):"",r.fragment=r.fragment?r.fragment:"",r["#path"]=l?"#"+this.hashformat(l):"",r["/path"]=r.path?"/"+r.path:"",r.projectPath=d.split("/").map(encodeURIComponent).join("/"),e.noCommittish?(r["#committish"]="",r["/tree/committish"]="",r["/committish"]="",r.committish=""):(r["#committish"]=a?"#"+a:"",r["/tree/committish"]=r.committish?"/"+r.treepath+"/"+r.committish:"",r["/committish"]=r.committish?"/"+r.committish:"",r.committish=r.committish||"master");var y=t;return Object.keys(r).forEach(function(h){y=y.replace(new RegExp("[{]"+h+"[}]","g"),r[h])}),e.noGitPlus?y.replace(/^git[+]/,""):y}};E.prototype.ssh=function(t){return this._fill(this.sshtemplate,t)};E.prototype.sshurl=function(t){return this._fill(this.sshurltemplate,t)};E.prototype.browse=function(t,e,r){return typeof t=="string"?(typeof e!="string"&&(r=e,e=null),this._fill(this.browsefiletemplate,K({fragment:e,path:t},r))):this._fill(this.browsetemplate,t)};E.prototype.docs=function(t){return this._fill(this.docstemplate,t)};E.prototype.bugs=function(t){return this._fill(this.bugstemplate,t)};E.prototype.https=function(t){return this._fill(this.httpstemplate,t)};E.prototype.git=function(t){return this._fill(this.gittemplate,t)};E.prototype.shortcut=function(t){return this._fill(this.shortcuttemplate,t)};E.prototype.path=function(t){return this._fill(this.pathtemplate,t)};E.prototype.tarball=function(t){var e=K({},t,{noCommittish:!1});return this._fill(this.tarballtemplate,e)};E.prototype.file=function(t,e){return this._fill(this.filetemplate,K({path:t},e))};E.prototype.getDefaultRepresentation=function(){return this.default};E.prototype.toString=function(t){return this.default&&typeof this[this.default]=="function"?this[this.default](t):this.sshurl(t)};var it,vt;function _e(){return vt||(vt=1,it=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),it}var Ee=p;p.Node=$;p.create=p;function p(t){var e=this;if(e instanceof p||(e=new p),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}p.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};p.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};p.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};p.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)we(this,arguments[t]);return this.length};p.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Ie(this,arguments[t]);return this.length};p.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};p.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};p.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,i=0;r!==null;i++)t.call(e,r.value,i,this),r=r.next};p.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,i=this.length-1;r!==null;i--)t.call(e,r.value,i,this),r=r.prev};p.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};p.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};p.prototype.map=function(t,e){e=e||this;for(var r=new p,i=this.head;i!==null;)r.push(t.call(e,i.value,this)),i=i.next;return r};p.prototype.mapReverse=function(t,e){e=e||this;for(var r=new p,i=this.tail;i!==null;)r.push(t.call(e,i.value,this)),i=i.prev;return r};p.prototype.reduce=function(t,e){var r,i=this.head;if(arguments.length>1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;i!==null;s++)r=t(r,i.value,s),i=i.next;return r};p.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;i!==null;s--)r=t(r,i.value,s),i=i.prev;return r};p.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};p.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};p.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new p;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(;s!==null&&i<e;i++,s=s.next)r.push(s.value);return r};p.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new p;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,s=this.tail;s!==null&&i>e;i--)s=s.prev;for(;s!==null&&i>t;i--,s=s.prev)r.push(s.value);return r};p.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(var a=[],i=0;s&&i<e;i++)a.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var i=0;i<r.length;i++)s=Ce(this,s,r[i]);return a};p.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=e,this.tail=t,this};function Ce(t,e,r){var i=e===t.head?new $(r,null,e,t):new $(r,e,e.next,t);return i.next===null&&(t.tail=i),i.prev===null&&(t.head=i),t.length++,i}function we(t,e){t.tail=new $(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function Ie(t,e){t.head=new $(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function $(t,e,r,i){if(!(this instanceof $))return new $(t,e,r,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{_e()(p)}catch{}const Re=Ee,N=Symbol("max"),L=Symbol("length"),H=Symbol("lengthCalculator"),Q=Symbol("allowStale"),B=Symbol("maxAge"),U=Symbol("dispose"),yt=Symbol("noDisposeOnSet"),S=Symbol("lruList"),R=Symbol("cache"),It=Symbol("updateAgeOnGet"),nt=()=>1;class Ae{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[N]=e.max||1/0;const r=e.length||nt;if(this[H]=typeof r!="function"?nt:r,this[Q]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[B]=e.maxAge||0,this[U]=e.dispose,this[yt]=e.noDisposeOnSet||!1,this[It]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[N]=e||1/0,X(this)}get max(){return this[N]}set allowStale(e){this[Q]=!!e}get allowStale(){return this[Q]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[B]=e,X(this)}get maxAge(){return this[B]}set lengthCalculator(e){typeof e!="function"&&(e=nt),e!==this[H]&&(this[H]=e,this[L]=0,this[S].forEach(r=>{r.length=this[H](r.value,r.key),this[L]+=r.length})),X(this)}get lengthCalculator(){return this[H]}get length(){return this[L]}get itemCount(){return this[S].length}rforEach(e,r){r=r||this;for(let i=this[S].tail;i!==null;){const s=i.prev;bt(this,e,i,r),i=s}}forEach(e,r){r=r||this;for(let i=this[S].head;i!==null;){const s=i.next;bt(this,e,i,r),i=s}}keys(){return this[S].toArray().map(e=>e.key)}values(){return this[S].toArray().map(e=>e.value)}reset(){this[U]&&this[S]&&this[S].length&&this[S].forEach(e=>this[U](e.key,e.value)),this[R]=new Map,this[S]=new Re,this[L]=0}dump(){return this[S].map(e=>Z(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[S]}set(e,r,i){if(i=i||this[B],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const s=i?Date.now():0,a=this[H](r,e);if(this[R].has(e)){if(a>this[N])return V(this,this[R].get(e)),!1;const d=this[R].get(e).value;return this[U]&&(this[yt]||this[U](e,d.value)),d.now=s,d.maxAge=i,d.value=r,this[L]+=a-d.length,d.length=a,this.get(e),X(this),!0}const c=new Oe(e,r,a,s,i);return c.length>this[N]?(this[U]&&this[U](e,r),!1):(this[L]+=c.length,this[S].unshift(c),this[R].set(e,this[S].head),X(this),!0)}has(e){if(!this[R].has(e))return!1;const r=this[R].get(e).value;return!Z(this,r)}get(e){return st(this,e,!0)}peek(e){return st(this,e,!1)}pop(){const e=this[S].tail;return e?(V(this,e),e.value):null}del(e){V(this,this[R].get(e))}load(e){this.reset();const r=Date.now();for(let i=e.length-1;i>=0;i--){const s=e[i],a=s.e||0;if(a===0)this.set(s.k,s.v);else{const c=a-r;c>0&&this.set(s.k,s.v,c)}}}prune(){this[R].forEach((e,r)=>st(this,r,!1))}}const st=(t,e,r)=>{const i=t[R].get(e);if(i){const s=i.value;if(Z(t,s)){if(V(t,i),!t[Q])return}else r&&(t[It]&&(i.value.now=Date.now()),t[S].unshiftNode(i));return s.value}},Z=(t,e)=>{if(!e||!e.maxAge&&!t[B])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[B]&&r>t[B]},X=t=>{if(t[L]>t[N])for(let e=t[S].tail;t[L]>t[N]&&e!==null;){const r=e.prev;V(t,e),e=r}},V=(t,e)=>{if(e){const r=e.value;t[U]&&t[U](r.key,r.value),t[L]-=r.length,t[R].delete(r.key),t[S].removeNode(e)}};class Oe{constructor(e,r,i,s,a){this.key=e,this.value=r,this.length=i,this.now=s,this.maxAge=a||0}}const bt=(t,e,r,i)=>{let s=r.value;Z(t,s)&&(V(t,r),t[Q]||(s=void 0)),s&&e.call(i,s.value,s.key,t)};var Pe=Ae,at=Gt,xt=wt,Ue=lt.exports=Se,Le=Pe,ot=new Le({max:1e3}),Te={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function De(t){return Te[t]||t.slice(0,-1)}var Ne={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};lt.exports.fromUrl=function(t,e){if(typeof t=="string"){var r=t+JSON.stringify(e||{});return ot.has(r)||ot.set(r,Be(t,e)),ot.get(r)}};function Be(t,e){if(!(t==null||t==="")){var r=Me($e(t)?"github:"+t:t),i=Fe(r),s=r.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),a=Object.keys(xt).map(function(c){try{var l=xt[c],d=null;i.auth&&Ne[i.protocol]&&(d=i.auth);var y=i.hash?decodeURIComponent(i.hash.substr(1)):null,h=null,j=null,m=null;if(s&&s[1]===c)h=s[2]&&decodeURIComponent(s[2]),j=decodeURIComponent(s[3].replace(/\.git$/,"")),m="shortcut";else{if(i.host&&i.host!==l.domain&&i.host.replace(/^www[.]/,"")!==l.domain||!l.protocols_re.test(i.protocol)||!i.path)return;var F=l.pathmatch,w=i.path.match(F);if(!w)return;w[1]!==null&&w[1]!==void 0&&(h=decodeURIComponent(w[1].replace(/^:/,""))),j=decodeURIComponent(w[2]),m=De(i.protocol)}return new Ue(c,h,d,j,y,m,e)}catch(I){if(!(I instanceof URIError))throw I}}).filter(function(c){return c});if(a.length===1)return a[0]}}function $e(t){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(t)}function Me(t){var e=at.parse(t);return e.protocol==="gist:"&&e.host&&!e.path?e.protocol+"/"+e.host:t}function Fe(t){var e=t.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!e){var r=at.parse(t);if(r.auth){const s=t.match(/[^@]+@[^:/]+/);if(s){var i=new at.URL(s[0]);r.auth=i.username||"",i.password&&(r.auth+=":"+i.password)}}return r}return{protocol:"git+ssh:",slashes:!0,auth:e[1],host:e[2],port:null,hostname:e[2],hash:e[4],search:null,query:null,pathname:"/"+e[3],path:"/"+e[3],href:"git+ssh://"+e[1]+"@"+e[2]+"/"+e[3]+(e[4]||"")}}var We=lt.exports,M={},A={},Ge=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A,"__esModule",{value:!0});A.setService=A.findService=A.getDefaultServiceConfig=A.getServiceConfig=void 0;const qe=Ge(pe),He=St,Rt={},ct=t=>{Rt[t.name]={validate:t.schema.validate.bind(t.schema),defaultConfig:t.default}};A.setService=ct;ct({name:"auth",schema:He.authConfigSchema,default:{}});const At=t=>{if(!t)throw new Error("service name should not be empty");const e=Rt[t];if(!e)throw new Error(`service ${t} does not exist`);return e},Ot=(t,e,{validate:r}={})=>{const i=At(t),s=(0,qe.default)(e||{}),{value:a,error:c}=i.validate(s);if(r&&c)throw new Error(`Invalid blocklet service config: ${c.details.map(l=>l.message).join(", ")}`);return a};A.getServiceConfig=Ot;const Pt=t=>{const{defaultConfig:e}=At(t);return e};A.getDefaultServiceConfig=Pt;const Ut=(t,e)=>{const r=[e];return(t||[]).find(i=>r.includes(i.name))};A.findService=Ut;A.default={getServiceConfig:Ot,getDefaultServiceConfig:Pt,findService:Ut,setService:ct};Object.defineProperty(M,"__esModule",{value:!0});M.fixAndValidateService=M.validateMeta=void 0;const Ke=St,Ve=A,ze=t=>(!t.interfaces||!t.interfaces.length||t.interfaces.forEach(e=>{e.services&&e.services.length&&e.services.forEach(r=>{r.config=(0,Ve.getServiceConfig)(r.name,r.config,{validate:!0})})}),t);M.fixAndValidateService=ze;const Lt=(t,{ensureFiles:e=!1,ensureDist:r=!1,ensureComponentStore:i=!0,ensureName:s=!1,skipValidateDidName:a=!1,schemaOptions:c={}}={})=>{const l=(0,Ke.createBlockletSchema)(null,{ensureFiles:e,ensureDist:r,ensureComponentStore:i,ensureName:s,skipValidateDidName:a,...c}),{value:d,error:y}=l.validate(t);if(y)throw new Error(`Invalid blocklet meta: ${y.details.map(h=>h.message).join(", ")}`);return d};M.validateMeta=Lt;M.default=Lt;(function(t){var e=O&&O.__createBinding||(Object.create?function(n,o,v,b){b===void 0&&(b=v);var g=Object.getOwnPropertyDescriptor(o,v);(!g||("get"in g?!o.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return o[v]}}),Object.defineProperty(n,b,g)}:function(n,o,v,b){b===void 0&&(b=v),n[b]=o[v]}),r=O&&O.__setModuleDefault||(Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o}),i=O&&O.__importStar||function(){var n=function(o){return n=Object.getOwnPropertyNames||function(v){var b=[];for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(b[b.length]=g);return b},n(o)};return function(o){if(o&&o.__esModule)return o;var v={};if(o!=null)for(var b=n(o),g=0;g<b.length;g++)b[g]!=="default"&&e(v,o,b[g]);return r(v,o),v}}(),s=O&&O.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.fixService=t.fixInterfaces=t.parsePerson=t.formatPerson=t.fixName=t.fixTags=t.fixPerson=t.fixKeywords=t.fixFiles=t.fixRepository=t.fixRequired=void 0;const a=s(qt),c=i(We),l=Ht,d=M;Object.defineProperty(t,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const y=fe,h=(n,o)=>{n.description||(n.description=`Blocklet from ${o}`),n.version||(n.version=l.BLOCKLET_DEFAULT_VERSION)};t.fixRequired=h;const j=n=>{if(n.repository&&(typeof n.repository=="string"&&(n.repository={type:"git",url:n.repository}),n.repository.url)){const o=c.fromUrl(n.repository.url);o&&(n.repository.url=o.getDefaultRepresentation()==="shortcut"?o.https():o.toString())}};t.fixRepository=j;const m=n=>{Array.isArray(n.files)?n.files&&(n.files=n.files.filter(o=>!(!o||typeof o!="string"))):delete n.files};t.fixFiles=m;const F=n=>{typeof n.keywords=="string"&&(n.keywords=n.keywords.split(/,\s+/)),n.keywords&&!Array.isArray(n.keywords)?delete n.keywords:n.keywords&&(n.keywords=n.keywords.filter(o=>!(typeof o!="string"||!o)))};t.fixKeywords=F;const w=n=>{typeof n.tags=="string"&&(n.tags=n.tags.split(/,\s+/)),n.tags&&!Array.isArray(n.tags)?delete n.tags:n.tags&&(n.tags=n.tags.filter(o=>!(typeof o!="string"||!o)))};t.fixTags=w;const I=(n,o)=>(n.author&&(n.author=o(n.author)),["maintainers","contributors"].forEach(v=>{Array.isArray(n[v])&&(n[v]=n[v].map(o))}),n),W=n=>{if(!n)return"";if(typeof n=="string")return n;const o=n.name||"",v=n.url||n.web,b=v?` (${v})`:"",g=n.email||n.mail,x=g?` <${g}>`:"";return o+x+b};t.formatPerson=W;const T=n=>{if(typeof n!="string")return n;const o=n.match(/^([^(<]+)/),v=n.match(/\(([^)]+)\)/),b=n.match(/<([^>]+)>/),g={};return o&&o[0].trim()&&(g.name=o[0].trim()),b&&([,g.email]=b),v&&([,g.url]=v),g};t.parsePerson=T;const G=n=>(I(n,W),I(n,T),n);t.fixPerson=G;const _=(n,o=!0)=>{if(Array.isArray(n.interfaces)||(n.interfaces=[]),n.interfaces.length)return n.interfaces.forEach(x=>{x.type===l.BLOCKLET_INTERFACE_TYPE_WEB&&(x.protocol="http")}),n;const b=(0,a.default)(n,"capabilities.dynamicPathPrefix",!0)?l.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",g=({type:x="web",name:k,path:J="/",protocol:tt="http",port:et=l.BLOCKLET_DEFAULT_PORT_NAME})=>{n.interfaces.push({type:x,name:k,path:J,prefix:b,port:et,protocol:tt})};return[l.BLOCKLET_INTERFACE_PUBLIC].forEach(x=>{n[x]&&g({name:x,path:n[x]})}),Array.isArray(n.exposeServices)&&n.exposeServices.forEach(x=>{g({type:"service",name:x.protocol,protocol:x.protocol,port:{internal:`BLOCKLET_${x.protocol}_PORT`.toUpperCase(),external:x.port}})}),o&&(delete n.publicUrl,delete n.adminUrl,delete n.configUrl,delete n.docUrl,delete n.exposeServices,n.capabilities&&delete n.capabilities.dynamicPathPrefix),n};t.fixInterfaces=_;const z=n=>{const{did:o}=n;try{(0,y.validateNewDid)(o),n.name=o}catch{}return n};t.fixName=z,t.default={fixRequired:h,fixRepository:j,fixFiles:m,fixKeywords:F,fixPerson:G,fixTags:w,fixName:z,formatPerson:W,parsePerson:T,fixInterfaces:_,fixService:d.fixAndValidateService}})(_t);function Tt({owner:t,locale:e}){return u.jsxs(jt,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.fullName,t.did?u.jsx(Kt,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:t.did,compact:!0,size:14,locale:e}):null]})}Tt.propTypes={owner:C.object.isRequired,locale:C.string.isRequired};const Je="install-blocklet-from-URL",Dt=()=>{const[t,e]=de(Je,"[]",{raw:!0}),r=s=>{const a=s.trim(),c=JSON.parse(t),l=c.findIndex(d=>d===a);l!==0&&(l>0&&c.splice(l,1),c.length>=10&&c.splice(9),c.unshift(a),e(JSON.stringify(c)))},i=s=>{if(!s)return;const a=JSON.parse(t),c=s.trim(),l=a.findIndex(d=>d===c);l>-1&&(a.splice(l,1),e(JSON.stringify(a)))};return{urls:t?JSON.parse(t):[],addUrlRecord:r,removeUrlRecord:i}},Ye=Vt(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function ht(t){const{value:e,onValueChange:r,children:i,helperText:s}=t,{urls:a,removeUrlRecord:c}=Dt(),l=(y,h)=>{y.preventDefault(),y.stopPropagation(),c(h)},d=Ye();return u.jsxs(jt,{children:[u.jsx(ge,{freeSolo:!0,options:a,inputValue:e,onInputChange:(y,h)=>{r(h)},disableClearable:!0,popupIcon:null,renderInput:y=>zt.cloneElement(i,{...y}),renderOption:(y,h)=>P.createElement(Jt,{...y,key:h,secondaryAction:u.jsx(Yt,{edge:"end","aria-label":"delete",onClick:j=>l(j,h),children:u.jsx(me,{})})},u.jsx(ve,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:u.jsx(Xt,{primary:h,className:d.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),u.jsx(Qt,{style:{margin:0},children:s})]})}ht.propTypes={onValueChange:C.func,children:C.node,value:C.string,helperText:C.string};ht.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Nt({defaultUrl:t,onCancel:e,onSuccess:r,onError:i,mode:s,handleText:a}){const{api:c}=Zt(),{api:l}=kt(),[d,y]=P.useState(!1),[h,j]=P.useState(""),{t:m,locale:F}=te(),w={dist:{}},[I,W]=P.useState(t),[T,G]=P.useState(t?1:0),[_,z]=P.useState(w),[n,o]=P.useState(!1),[v,b]=P.useState({}),g=s==="component",x=g?!0:!t,{addUrlRecord:k}=Dt(),J=async()=>{z(w),j(null),y(!0);let f=I.trim();!f.startsWith("https://")&&!f.startsWith("http://")&&!f.startsWith("file://")&&(f=`file://${f}`);try{const q=decodeURIComponent(f);try{new URL(q)}catch{throw new Error("Invalid URL")}const{meta:rt,inStore:Ft,registryUrl:Wt}=await c.getBlockletMetaFromUrl({input:{url:q}});z(rt),b({inStore:Ft,registryUrl:Wt,inputUrl:f}),k(f)}catch(q){console.error(q);const rt=`Blocklet Install failed: ${he(q)}`;j(rt),i(q)}finally{y(!1)}},tt=()=>{if(g){r({meta:_,...v}),e();return}y(!0),o(!0)},et=()=>{y(!1),o(!1),r({meta:_,...v}),e()},Bt=()=>{y(!1),o(!1)};P.useEffect(()=>{t&&J()},[t]);const $t=[{name:m("common.name"),value:ee.getDisplayName({meta:_},!0)},{name:m("common.version"),value:_.version},{name:m("common.did"),value:_.did?u.jsx(re,{did:_.did}):null},{name:m("common.author"),value:_.owner?u.jsx(Tt,{owner:_.owner,locale:F}):_t.formatPerson(_.author)},{name:m("blocklet.dist.downloadLink"),value:_.dist.tarball}],Mt=()=>d?u.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:u.jsx(pt,{})}):_.did?u.jsx("div",{style:{paddingLeft:"10%"},children:$t.map(f=>f.name===m("common.did")?u.jsx(mt,{valueComponent:"div",nameWidth:120,name:f.name,nameFormatter:()=>m("common.did"),children:f.value},f.name):u.jsx(mt,{valueComponent:"div",nameWidth:120,name:f.name,children:f.value},f.name))}):null,ut=[{label:m("blocklet.fromUrl.step0"),body:u.jsx(ie,{component:"div",children:u.jsx(ht,{style:{marginBottom:32},value:I,helperText:m("blocklet.fromUrl.description"),onValueChange:f=>{j(null),W(f)},children:u.jsx(ne,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:I,onChange:f=>{j(null),W(f.target.value)},disabled:d,onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),J(),G(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:e,onConfirm:()=>{J(),G(1)}},{label:m("blocklet.fromUrl.step1"),body:Mt(),cancel:m(x?"common.pre":"common.cancel"),confirm:(a==null?void 0:a.confirm)||m("blocklet.fromUrl.confirm"),onCancel:()=>{x?G(f=>f-1):e()},onConfirm:()=>{tt()}}],D=ut[T];return u.jsxs(u.Fragment,{children:[u.jsxs(se,{title:(a==null?void 0:a.title)||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>D.onCancel(),showCloseButton:T===0,disableEscapeKeyDown:!0,open:!0,actions:u.jsxs(u.Fragment,{children:[D.cancel&&u.jsx(ft,{onClick:f=>{f.stopPropagation(),j(null),D.onCancel()},color:"inherit",children:D.cancel||m("common.cancel")}),u.jsxs(ft,{onClick:f=>{f.stopPropagation(),D.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:d||!I||h,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[d&&T===0&&u.jsx(pt,{size:16}),D.confirm]})]}),children:[x&&u.jsx(ye,{alternativeLabel:!0,activeStep:T,children:ut.map(({label:f})=>u.jsx(be,{children:u.jsx(xe,{children:f})},f))}),u.jsx(oe,{component:"div",style:{marginTop:24},children:D.body}),!!h&&u.jsx(ae,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),_&&n&&u.jsx(le,{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:et,extraParams:{title:_.title,wt:ce(_),blockletMetaUrl:decodeURIComponent(I.trim())},messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:Bt})]})}Nt.propTypes={defaultUrl:C.string,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["install","component"]),handleText:C.object};Nt.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};export{je as B,Nt as I,Tt as a,_t as f};
|
|
1
|
+
import{P as C,j as u,fe as Gt,d7 as O,ff as qt,b as Ht,K as jt,fg as Kt,a6 as Vt,bh as zt,r as P,a9 as Jt,a4 as Yt,aa as Xt,bm as Qt,bq as Zt,o as kt,m as te,H as ee,W as re,k as ie,t as ne,D as se,B as ft,C as pt,s as oe,V as ae,v as le,bz as ce,X as he}from"./index-DR-LzDpz.js";import{W as ue}from"./url-evaluation-BXXYRG2X.js";import{s as St,n as fe}from"./schema-ajF7Icmt.js";import{r as pe}from"./cloneDeep-BggEwLYZ.js";import{I as mt}from"./index-8FN_CRrc.js";import{d as me}from"./Delete-55_a7QjD.js";import{_ as de}from"./useLocalStorage-UQyPQgbL.js";import{A as ge}from"./Autocomplete-CR1bdhJ8.js";import{L as ve}from"./ListItemButton-BXWgHblj.js";import{S as ye,a as be,b as xe}from"./Stepper-CZ3vmn4U.js";function je({mode:t,...e}){return t==="development"?u.jsx(ue,{type:"primary",...e,children:"DEV"}):null}je.propTypes={mode:C.string.isRequired};var _t={},lt={exports:{}},Et={exports:{}},Y=Et.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(t){return"file-"+Ct(t)}}},dt={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:Ct};Object.keys(Y).forEach(function(t){Object.keys(dt).forEach(function(e){Y[t][e]||(Y[t][e]=dt[e])}),Y[t].protocols_re=RegExp("^("+Y[t].protocols.map(function(e){return e.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Ct(t){return t.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var wt=Et.exports,gt=wt,K=Object.assign||function(e,r){if(r===null||typeof r!="object")return e;const i=Object.keys(r);let s=i.length;for(;s--;)e[i[s]]=r[i[s]];return e},Se=E;function E(t,e,r,i,s,a,c){var l=this;l.type=t,Object.keys(gt[t]).forEach(function(d){l[d]=gt[t][d]}),l.user=e,l.auth=r,l.project=i,l.committish=s,l.default=a,l.opts=c||{}}E.prototype.hash=function(){return this.committish?"#"+this.committish:""};E.prototype._fill=function(t,e){if(t){var r=K({},e);r.path=r.path?r.path.replace(/^[/]+/g,""):"",e=K(K({},this.opts),e);var i=this;Object.keys(this).forEach(function(h){i[h]!=null&&r[h]==null&&(r[h]=i[h])});var s=r.auth,a=r.committish,c=r.fragment,l=r.path,d=r.project;Object.keys(r).forEach(function(h){var j=r[h];(h==="path"||h==="project")&&typeof j=="string"?r[h]=j.split("/").map(function(m){return encodeURIComponent(m)}).join("/"):h!=="domain"&&(r[h]=encodeURIComponent(j))}),r["auth@"]=s?s+"@":"",r["#fragment"]=c?"#"+this.hashformat(c):"",r.fragment=r.fragment?r.fragment:"",r["#path"]=l?"#"+this.hashformat(l):"",r["/path"]=r.path?"/"+r.path:"",r.projectPath=d.split("/").map(encodeURIComponent).join("/"),e.noCommittish?(r["#committish"]="",r["/tree/committish"]="",r["/committish"]="",r.committish=""):(r["#committish"]=a?"#"+a:"",r["/tree/committish"]=r.committish?"/"+r.treepath+"/"+r.committish:"",r["/committish"]=r.committish?"/"+r.committish:"",r.committish=r.committish||"master");var y=t;return Object.keys(r).forEach(function(h){y=y.replace(new RegExp("[{]"+h+"[}]","g"),r[h])}),e.noGitPlus?y.replace(/^git[+]/,""):y}};E.prototype.ssh=function(t){return this._fill(this.sshtemplate,t)};E.prototype.sshurl=function(t){return this._fill(this.sshurltemplate,t)};E.prototype.browse=function(t,e,r){return typeof t=="string"?(typeof e!="string"&&(r=e,e=null),this._fill(this.browsefiletemplate,K({fragment:e,path:t},r))):this._fill(this.browsetemplate,t)};E.prototype.docs=function(t){return this._fill(this.docstemplate,t)};E.prototype.bugs=function(t){return this._fill(this.bugstemplate,t)};E.prototype.https=function(t){return this._fill(this.httpstemplate,t)};E.prototype.git=function(t){return this._fill(this.gittemplate,t)};E.prototype.shortcut=function(t){return this._fill(this.shortcuttemplate,t)};E.prototype.path=function(t){return this._fill(this.pathtemplate,t)};E.prototype.tarball=function(t){var e=K({},t,{noCommittish:!1});return this._fill(this.tarballtemplate,e)};E.prototype.file=function(t,e){return this._fill(this.filetemplate,K({path:t},e))};E.prototype.getDefaultRepresentation=function(){return this.default};E.prototype.toString=function(t){return this.default&&typeof this[this.default]=="function"?this[this.default](t):this.sshurl(t)};var it,vt;function _e(){return vt||(vt=1,it=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),it}var Ee=p;p.Node=B;p.create=p;function p(t){var e=this;if(e instanceof p||(e=new p),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}p.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};p.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};p.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};p.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)we(this,arguments[t]);return this.length};p.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Ie(this,arguments[t]);return this.length};p.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};p.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};p.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,i=0;r!==null;i++)t.call(e,r.value,i,this),r=r.next};p.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,i=this.length-1;r!==null;i--)t.call(e,r.value,i,this),r=r.prev};p.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};p.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};p.prototype.map=function(t,e){e=e||this;for(var r=new p,i=this.head;i!==null;)r.push(t.call(e,i.value,this)),i=i.next;return r};p.prototype.mapReverse=function(t,e){e=e||this;for(var r=new p,i=this.tail;i!==null;)r.push(t.call(e,i.value,this)),i=i.prev;return r};p.prototype.reduce=function(t,e){var r,i=this.head;if(arguments.length>1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;i!==null;s++)r=t(r,i.value,s),i=i.next;return r};p.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;i!==null;s--)r=t(r,i.value,s),i=i.prev;return r};p.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};p.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};p.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new p;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(;s!==null&&i<e;i++,s=s.next)r.push(s.value);return r};p.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new p;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,s=this.tail;s!==null&&i>e;i--)s=s.prev;for(;s!==null&&i>t;i--,s=s.prev)r.push(s.value);return r};p.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(var a=[],i=0;s&&i<e;i++)a.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var i=0;i<r.length;i++)s=Ce(this,s,r[i]);return a};p.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=e,this.tail=t,this};function Ce(t,e,r){var i=e===t.head?new B(r,null,e,t):new B(r,e,e.next,t);return i.next===null&&(t.tail=i),i.prev===null&&(t.head=i),t.length++,i}function we(t,e){t.tail=new B(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function Ie(t,e){t.head=new B(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function B(t,e,r,i){if(!(this instanceof B))return new B(t,e,r,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{_e()(p)}catch{}const Re=Ee,N=Symbol("max"),L=Symbol("length"),H=Symbol("lengthCalculator"),Q=Symbol("allowStale"),$=Symbol("maxAge"),U=Symbol("dispose"),yt=Symbol("noDisposeOnSet"),S=Symbol("lruList"),R=Symbol("cache"),It=Symbol("updateAgeOnGet"),nt=()=>1;class Ae{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[N]=e.max||1/0;const r=e.length||nt;if(this[H]=typeof r!="function"?nt:r,this[Q]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[$]=e.maxAge||0,this[U]=e.dispose,this[yt]=e.noDisposeOnSet||!1,this[It]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[N]=e||1/0,X(this)}get max(){return this[N]}set allowStale(e){this[Q]=!!e}get allowStale(){return this[Q]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[$]=e,X(this)}get maxAge(){return this[$]}set lengthCalculator(e){typeof e!="function"&&(e=nt),e!==this[H]&&(this[H]=e,this[L]=0,this[S].forEach(r=>{r.length=this[H](r.value,r.key),this[L]+=r.length})),X(this)}get lengthCalculator(){return this[H]}get length(){return this[L]}get itemCount(){return this[S].length}rforEach(e,r){r=r||this;for(let i=this[S].tail;i!==null;){const s=i.prev;bt(this,e,i,r),i=s}}forEach(e,r){r=r||this;for(let i=this[S].head;i!==null;){const s=i.next;bt(this,e,i,r),i=s}}keys(){return this[S].toArray().map(e=>e.key)}values(){return this[S].toArray().map(e=>e.value)}reset(){this[U]&&this[S]&&this[S].length&&this[S].forEach(e=>this[U](e.key,e.value)),this[R]=new Map,this[S]=new Re,this[L]=0}dump(){return this[S].map(e=>Z(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[S]}set(e,r,i){if(i=i||this[$],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const s=i?Date.now():0,a=this[H](r,e);if(this[R].has(e)){if(a>this[N])return V(this,this[R].get(e)),!1;const d=this[R].get(e).value;return this[U]&&(this[yt]||this[U](e,d.value)),d.now=s,d.maxAge=i,d.value=r,this[L]+=a-d.length,d.length=a,this.get(e),X(this),!0}const c=new Oe(e,r,a,s,i);return c.length>this[N]?(this[U]&&this[U](e,r),!1):(this[L]+=c.length,this[S].unshift(c),this[R].set(e,this[S].head),X(this),!0)}has(e){if(!this[R].has(e))return!1;const r=this[R].get(e).value;return!Z(this,r)}get(e){return st(this,e,!0)}peek(e){return st(this,e,!1)}pop(){const e=this[S].tail;return e?(V(this,e),e.value):null}del(e){V(this,this[R].get(e))}load(e){this.reset();const r=Date.now();for(let i=e.length-1;i>=0;i--){const s=e[i],a=s.e||0;if(a===0)this.set(s.k,s.v);else{const c=a-r;c>0&&this.set(s.k,s.v,c)}}}prune(){this[R].forEach((e,r)=>st(this,r,!1))}}const st=(t,e,r)=>{const i=t[R].get(e);if(i){const s=i.value;if(Z(t,s)){if(V(t,i),!t[Q])return}else r&&(t[It]&&(i.value.now=Date.now()),t[S].unshiftNode(i));return s.value}},Z=(t,e)=>{if(!e||!e.maxAge&&!t[$])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[$]&&r>t[$]},X=t=>{if(t[L]>t[N])for(let e=t[S].tail;t[L]>t[N]&&e!==null;){const r=e.prev;V(t,e),e=r}},V=(t,e)=>{if(e){const r=e.value;t[U]&&t[U](r.key,r.value),t[L]-=r.length,t[R].delete(r.key),t[S].removeNode(e)}};class Oe{constructor(e,r,i,s,a){this.key=e,this.value=r,this.length=i,this.now=s,this.maxAge=a||0}}const bt=(t,e,r,i)=>{let s=r.value;Z(t,s)&&(V(t,r),t[Q]||(s=void 0)),s&&e.call(i,s.value,s.key,t)};var Pe=Ae,at=Gt,xt=wt,Ue=lt.exports=Se,Le=Pe,ot=new Le({max:1e3}),Te={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function De(t){return Te[t]||t.slice(0,-1)}var Ne={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};lt.exports.fromUrl=function(t,e){if(typeof t=="string"){var r=t+JSON.stringify(e||{});return ot.has(r)||ot.set(r,$e(t,e)),ot.get(r)}};function $e(t,e){if(!(t==null||t==="")){var r=Me(Be(t)?"github:"+t:t),i=Fe(r),s=r.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),a=Object.keys(xt).map(function(c){try{var l=xt[c],d=null;i.auth&&Ne[i.protocol]&&(d=i.auth);var y=i.hash?decodeURIComponent(i.hash.substr(1)):null,h=null,j=null,m=null;if(s&&s[1]===c)h=s[2]&&decodeURIComponent(s[2]),j=decodeURIComponent(s[3].replace(/\.git$/,"")),m="shortcut";else{if(i.host&&i.host!==l.domain&&i.host.replace(/^www[.]/,"")!==l.domain||!l.protocols_re.test(i.protocol)||!i.path)return;var F=l.pathmatch,w=i.path.match(F);if(!w)return;w[1]!==null&&w[1]!==void 0&&(h=decodeURIComponent(w[1].replace(/^:/,""))),j=decodeURIComponent(w[2]),m=De(i.protocol)}return new Ue(c,h,d,j,y,m,e)}catch(I){if(!(I instanceof URIError))throw I}}).filter(function(c){return c});if(a.length===1)return a[0]}}function Be(t){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(t)}function Me(t){var e=at.parse(t);return e.protocol==="gist:"&&e.host&&!e.path?e.protocol+"/"+e.host:t}function Fe(t){var e=t.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!e){var r=at.parse(t);if(r.auth){const s=t.match(/[^@]+@[^:/]+/);if(s){var i=new at.URL(s[0]);r.auth=i.username||"",i.password&&(r.auth+=":"+i.password)}}return r}return{protocol:"git+ssh:",slashes:!0,auth:e[1],host:e[2],port:null,hostname:e[2],hash:e[4],search:null,query:null,pathname:"/"+e[3],path:"/"+e[3],href:"git+ssh://"+e[1]+"@"+e[2]+"/"+e[3]+(e[4]||"")}}var We=lt.exports,M={},A={},Ge=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A,"__esModule",{value:!0});A.setService=A.findService=A.getDefaultServiceConfig=A.getServiceConfig=void 0;const qe=Ge(pe),He=St,Rt={},ct=t=>{Rt[t.name]={validate:t.schema.validate.bind(t.schema),defaultConfig:t.default}};A.setService=ct;ct({name:"auth",schema:He.authConfigSchema,default:{}});const At=t=>{if(!t)throw new Error("service name should not be empty");const e=Rt[t];if(!e)throw new Error(`service ${t} does not exist`);return e},Ot=(t,e,{validate:r}={})=>{const i=At(t),s=(0,qe.default)(e||{}),{value:a,error:c}=i.validate(s);if(r&&c)throw new Error(`Invalid blocklet service config: ${c.details.map(l=>l.message).join(", ")}`);return a};A.getServiceConfig=Ot;const Pt=t=>{const{defaultConfig:e}=At(t);return e};A.getDefaultServiceConfig=Pt;const Ut=(t,e)=>{const r=[e];return(t||[]).find(i=>r.includes(i.name))};A.findService=Ut;A.default={getServiceConfig:Ot,getDefaultServiceConfig:Pt,findService:Ut,setService:ct};Object.defineProperty(M,"__esModule",{value:!0});M.fixAndValidateService=M.validateMeta=void 0;const Ke=St,Ve=A,ze=t=>(!t.interfaces||!t.interfaces.length||t.interfaces.forEach(e=>{e.services&&e.services.length&&e.services.forEach(r=>{r.config=(0,Ve.getServiceConfig)(r.name,r.config,{validate:!0})})}),t);M.fixAndValidateService=ze;const Lt=(t,{ensureFiles:e=!1,ensureDist:r=!1,ensureComponentStore:i=!0,ensureName:s=!1,skipValidateDidName:a=!1,schemaOptions:c={}}={})=>{const l=(0,Ke.createBlockletSchema)(null,{ensureFiles:e,ensureDist:r,ensureComponentStore:i,ensureName:s,skipValidateDidName:a,...c}),{value:d,error:y}=l.validate(t);if(y)throw new Error(`Invalid blocklet meta: ${y.details.map(h=>h.message).join(", ")}`);return d};M.validateMeta=Lt;M.default=Lt;(function(t){var e=O&&O.__createBinding||(Object.create?function(n,o,v,b){b===void 0&&(b=v);var g=Object.getOwnPropertyDescriptor(o,v);(!g||("get"in g?!o.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return o[v]}}),Object.defineProperty(n,b,g)}:function(n,o,v,b){b===void 0&&(b=v),n[b]=o[v]}),r=O&&O.__setModuleDefault||(Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o}),i=O&&O.__importStar||function(){var n=function(o){return n=Object.getOwnPropertyNames||function(v){var b=[];for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(b[b.length]=g);return b},n(o)};return function(o){if(o&&o.__esModule)return o;var v={};if(o!=null)for(var b=n(o),g=0;g<b.length;g++)b[g]!=="default"&&e(v,o,b[g]);return r(v,o),v}}(),s=O&&O.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.fixService=t.fixInterfaces=t.parsePerson=t.formatPerson=t.fixName=t.fixTags=t.fixPerson=t.fixKeywords=t.fixFiles=t.fixRepository=t.fixRequired=void 0;const a=s(qt),c=i(We),l=Ht,d=M;Object.defineProperty(t,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const y=fe,h=(n,o)=>{n.description||(n.description=`Blocklet from ${o}`),n.version||(n.version=l.BLOCKLET_DEFAULT_VERSION)};t.fixRequired=h;const j=n=>{if(n.repository&&(typeof n.repository=="string"&&(n.repository={type:"git",url:n.repository}),n.repository.url)){const o=c.fromUrl(n.repository.url);o&&(n.repository.url=o.getDefaultRepresentation()==="shortcut"?o.https():o.toString())}};t.fixRepository=j;const m=n=>{Array.isArray(n.files)?n.files&&(n.files=n.files.filter(o=>!(!o||typeof o!="string"))):delete n.files};t.fixFiles=m;const F=n=>{typeof n.keywords=="string"&&(n.keywords=n.keywords.split(/,\s+/)),n.keywords&&!Array.isArray(n.keywords)?delete n.keywords:n.keywords&&(n.keywords=n.keywords.filter(o=>!(typeof o!="string"||!o)))};t.fixKeywords=F;const w=n=>{typeof n.tags=="string"&&(n.tags=n.tags.split(/,\s+/)),n.tags&&!Array.isArray(n.tags)?delete n.tags:n.tags&&(n.tags=n.tags.filter(o=>!(typeof o!="string"||!o)))};t.fixTags=w;const I=(n,o)=>(n.author&&(n.author=o(n.author)),["maintainers","contributors"].forEach(v=>{Array.isArray(n[v])&&(n[v]=n[v].map(o))}),n),W=n=>{if(!n)return"";if(typeof n=="string")return n;const o=n.name||"",v=n.url||n.web,b=v?` (${v})`:"",g=n.email||n.mail,x=g?` <${g}>`:"";return o+x+b};t.formatPerson=W;const T=n=>{if(typeof n!="string")return n;const o=n.match(/^([^(<]+)/),v=n.match(/\(([^)]+)\)/),b=n.match(/<([^>]+)>/),g={};return o&&o[0].trim()&&(g.name=o[0].trim()),b&&([,g.email]=b),v&&([,g.url]=v),g};t.parsePerson=T;const G=n=>(I(n,W),I(n,T),n);t.fixPerson=G;const _=(n,o=!0)=>{if(Array.isArray(n.interfaces)||(n.interfaces=[]),n.interfaces.length)return n.interfaces.forEach(x=>{x.type===l.BLOCKLET_INTERFACE_TYPE_WEB&&(x.protocol="http")}),n;const b=(0,a.default)(n,"capabilities.dynamicPathPrefix",!0)?l.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",g=({type:x="web",name:k,path:J="/",protocol:tt="http",port:et=l.BLOCKLET_DEFAULT_PORT_NAME})=>{n.interfaces.push({type:x,name:k,path:J,prefix:b,port:et,protocol:tt})};return[l.BLOCKLET_INTERFACE_PUBLIC].forEach(x=>{n[x]&&g({name:x,path:n[x]})}),Array.isArray(n.exposeServices)&&n.exposeServices.forEach(x=>{g({type:"service",name:x.protocol,protocol:x.protocol,port:{internal:`BLOCKLET_${x.protocol}_PORT`.toUpperCase(),external:x.port}})}),o&&(delete n.publicUrl,delete n.adminUrl,delete n.configUrl,delete n.docUrl,delete n.exposeServices,n.capabilities&&delete n.capabilities.dynamicPathPrefix),n};t.fixInterfaces=_;const z=n=>{const{did:o}=n;try{(0,y.validateNewDid)(o),n.name=o}catch{}return n};t.fixName=z,t.default={fixRequired:h,fixRepository:j,fixFiles:m,fixKeywords:F,fixPerson:G,fixTags:w,fixName:z,formatPerson:W,parsePerson:T,fixInterfaces:_,fixService:d.fixAndValidateService}})(_t);function Tt({owner:t,locale:e}){return u.jsxs(jt,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.fullName,t.did?u.jsx(Kt,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:t.did,compact:!0,size:14,locale:e}):null]})}Tt.propTypes={owner:C.object.isRequired,locale:C.string.isRequired};const Je="install-blocklet-from-URL",Dt=()=>{const[t,e]=de(Je,"[]",{raw:!0}),r=s=>{const a=s.trim(),c=JSON.parse(t),l=c.findIndex(d=>d===a);l!==0&&(l>0&&c.splice(l,1),c.length>=10&&c.splice(9),c.unshift(a),e(JSON.stringify(c)))},i=s=>{if(!s)return;const a=JSON.parse(t),c=s.trim(),l=a.findIndex(d=>d===c);l>-1&&(a.splice(l,1),e(JSON.stringify(a)))};return{urls:t?JSON.parse(t):[],addUrlRecord:r,removeUrlRecord:i}},Ye=Vt(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function ht(t){const{value:e,onValueChange:r,children:i,helperText:s}=t,{urls:a,removeUrlRecord:c}=Dt(),l=(y,h)=>{y.preventDefault(),y.stopPropagation(),c(h)},d=Ye();return u.jsxs(jt,{children:[u.jsx(ge,{freeSolo:!0,options:a,inputValue:e,onInputChange:(y,h)=>{r(h)},disableClearable:!0,popupIcon:null,renderInput:y=>zt.cloneElement(i,{...y}),renderOption:(y,h)=>P.createElement(Jt,{...y,key:h,secondaryAction:u.jsx(Yt,{edge:"end","aria-label":"delete",onClick:j=>l(j,h),children:u.jsx(me,{})})},u.jsx(ve,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:u.jsx(Xt,{primary:h,className:d.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),u.jsx(Qt,{style:{margin:0},children:s})]})}ht.propTypes={onValueChange:C.func,children:C.node,value:C.string,helperText:C.string};ht.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Nt({defaultUrl:t,onCancel:e,onSuccess:r,onError:i,mode:s,handleText:a}){const{api:c}=Zt(),{api:l}=kt(),[d,y]=P.useState(!1),[h,j]=P.useState(""),{t:m,locale:F}=te(),w={dist:{}},[I,W]=P.useState(t),[T,G]=P.useState(t?1:0),[_,z]=P.useState(w),[n,o]=P.useState(!1),[v,b]=P.useState({}),g=s==="component",x=g?!0:!t,{addUrlRecord:k}=Dt(),J=async()=>{z(w),j(null),y(!0);let f=I.trim();!f.startsWith("https://")&&!f.startsWith("http://")&&!f.startsWith("file://")&&(f=`file://${f}`);try{const q=decodeURIComponent(f);try{new URL(q)}catch{throw new Error("Invalid URL")}const{meta:rt,inStore:Ft,registryUrl:Wt}=await c.getBlockletMetaFromUrl({input:{url:q}});z(rt),b({inStore:Ft,registryUrl:Wt,inputUrl:f}),k(f)}catch(q){console.error(q);const rt=`Blocklet Install failed: ${he(q)}`;j(rt),i(q)}finally{y(!1)}},tt=()=>{if(g){r({meta:_,...v}),e();return}y(!0),o(!0)},et=()=>{y(!1),o(!1),r({meta:_,...v}),e()},$t=()=>{y(!1),o(!1)};P.useEffect(()=>{t&&J()},[t]);const Bt=[{name:m("common.name"),value:ee.getDisplayName({meta:_},!0)},{name:m("common.version"),value:_.version},{name:m("common.did"),value:_.did?u.jsx(re,{did:_.did}):null},{name:m("common.author"),value:_.owner?u.jsx(Tt,{owner:_.owner,locale:F}):_t.formatPerson(_.author)},{name:m("blocklet.dist.downloadLink"),value:_.dist.tarball}],Mt=()=>d?u.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:u.jsx(pt,{})}):_.did?u.jsx("div",{style:{paddingLeft:"10%"},children:Bt.map(f=>f.name===m("common.did")?u.jsx(mt,{valueComponent:"div",nameWidth:120,name:f.name,nameFormatter:()=>m("common.did"),children:f.value},f.name):u.jsx(mt,{valueComponent:"div",nameWidth:120,name:f.name,children:f.value},f.name))}):null,ut=[{label:m("blocklet.fromUrl.step0"),body:u.jsx(ie,{component:"div",children:u.jsx(ht,{style:{marginBottom:32},value:I,helperText:m("blocklet.fromUrl.description"),onValueChange:f=>{j(null),W(f)},children:u.jsx(ne,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:I,onChange:f=>{j(null),W(f.target.value)},disabled:d,onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),J(),G(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:e,onConfirm:()=>{J(),G(1)}},{label:m("blocklet.fromUrl.step1"),body:Mt(),cancel:m(x?"common.pre":"common.cancel"),confirm:(a==null?void 0:a.confirm)||m("blocklet.fromUrl.confirm"),onCancel:()=>{x?G(f=>f-1):e()},onConfirm:()=>{tt()}}],D=ut[T];return u.jsxs(u.Fragment,{children:[u.jsxs(se,{title:(a==null?void 0:a.title)||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>D.onCancel(),showCloseButton:T===0,disableEscapeKeyDown:!0,open:!0,actions:u.jsxs(u.Fragment,{children:[D.cancel&&u.jsx(ft,{onClick:f=>{f.stopPropagation(),j(null),D.onCancel()},color:"inherit",children:D.cancel||m("common.cancel")}),u.jsxs(ft,{onClick:f=>{f.stopPropagation(),D.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:d||!I||h,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[d&&T===0&&u.jsx(pt,{size:16}),D.confirm]})]}),children:[x&&u.jsx(ye,{alternativeLabel:!0,activeStep:T,children:ut.map(({label:f})=>u.jsx(be,{children:u.jsx(xe,{children:f})},f))}),u.jsx(oe,{component:"div",style:{marginTop:24},children:D.body}),!!h&&u.jsx(ae,{severity:"error",style:{width:"100%",marginTop:8},children:h})]}),_&&n&&u.jsx(le,{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:et,extraParams:{title:_.title,wt:ce(_),blockletMetaUrl:decodeURIComponent(I.trim())},messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:$t})]})}Nt.propTypes={defaultUrl:C.string,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["install","component"]),handleText:C.object};Nt.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};export{je as B,Nt as I,Tt as a,_t as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bV as D,j as s,P as r,n as v,r as m,e as A,bi as E,D as H,m as j,o as $,aT as M,cW as q,ct as b,a2 as F,cX as U,A as B,cY as O,cC as Y,cZ as N,c_ as S,av as V,K as L,bc as W,b8 as X,cs as K,C as J}from"./index-DR-LzDpz.js";import{R as Z}from"./index-DESgmXka.js";import{N as G}from"./index-B-OsCFX-.js";import{C as z}from"./index-Doaw7xqe.js";import{b as Q}from"./sdk-C9mSNzSG.js";import{w as ee}from"./wrap-locale-7CaFuwKr.js";const se=D(s.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 P({invitation:e,createPassportSvg:a,passportColor:c}){const[p,o]=m.useState(!1),{t}=m.useContext(A),l=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),u=m.useMemo(()=>a({title:l,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:E(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,l]),x=m.useCallback(()=>{o(!0)},[]),i=m.useCallback(()=>{o(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ie,{children:s.jsxs("div",{className:"invite-passport__card",onClick:x,children:[!!e.display&&s.jsx(G,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&s.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})]})}),s.jsx(H,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:i,children:e.role.permissions&&e.role.permissions.length>0?s.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(n=>s.jsx("li",{style:{listStyle:"circle"},children:n.description},n.name))}):s.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[s.jsx(se,{style:{width:"30px",height:"30px"}}),s.jsx("div",{children:t("invite.emptyPermission")})]})})]})}P.propTypes={invitation:r.object.isRequired,createPassportSvg:r.func.isRequired,passportColor:r.string};P.defaultProps={passportColor:"auto"};const ie=v.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
max-width: 350px;
|
|
4
4
|
margin: 30px auto;
|
|
@@ -39,7 +39,7 @@ import{bX as T,j as s,P as r,n as v,r as m,e as A,bi as $,D as E,m as j,o as H,a
|
|
|
39
39
|
line-height: 18px;
|
|
40
40
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
41
41
|
}
|
|
42
|
-
`;function k({invitation:e,onLogin:a,onReceive:c,inService:p,action:o}){var f;const{t,locale:l}=j(),{connectApi:u}
|
|
42
|
+
`;function k({invitation:e,onLogin:a,onReceive:c,inService:p,action:o}){var f;const{t,locale:l}=j(),{connectApi:u}=$(),{getPassportId:x}=Y();let i;typeof window<"u"&&(i=(f=window==null?void 0:window.blocklet)==null?void 0:f.componentId);const n=M({loading:!1,extraParams:{baseUrl:window.location.origin,componentId:i,sourceAppPid:(e==null?void 0:e.sourceAppPid)||null}});q(async()=>{var g;const d=x();if(d&&(n.extraParams.passportId=d),o==="invite"?n.extraParams.inviteId=e.inviteId:o==="issue-passport"&&(n.extraParams.inviteId=e.inviteId,n.extraParams.id=e.inviteId),p&&((g=e==null?void 0:e.receiver)!=null&&g.did)){n.loading=!0;try{const w=await Q.user.getUserPublicInfo({did:e.receiver.did});w!=null&&w.sourceAppPid&&(n.extraParams.sourceAppPid=w.sourceAppPid)}finally{n.loading=!1}}});const _=b(()=>{u.close()}),h=b((...d)=>{u.close(),a(...d)}),y=b(()=>{var d,g;if(typeof c=="function"){c();return}p?u.open({action:o,className:"connect",forceConnected:((d=e==null?void 0:e.receiver)==null?void 0:d.did)||!1,autoConnect:!1,disableSwitchApp:!0,locale:l,extraParams:{provider:"wallet",...n.extraParams},baseUrl:window.location.origin,prefix:F(window.location.origin,B.WELLKNOWN_SERVICE_PATH_PREFIX,U),messages:{title:t("receive.dialog.title"),scan:t("receive.dialog.scan"),confirm:t("receive.dialog.confirm"),success:t("receive.dialog.success")},onSuccess:h,onClose:_,passkeyBehavior:"both"},{locale:l}):u.open({action:o,className:"connect",forceConnected:((g=e==null?void 0:e.receiver)==null?void 0:g.did)||!1,autoConnect:!1,disableSwitchApp:!0,locale:l,extraParams:n.extraParams,messages:{title:t("receive.dialog.title"),scan:t("receive.dialog.scan"),confirm:t("receive.dialog.confirm"),success:t("receive.dialog.success")},onSuccess:h,onClose:_,passkeyBehavior:"both"})});return s.jsxs(re,{children:[s.jsx(z,{loading:n.loading,size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:y,children:t("invite.receive")}),s.jsxs("div",{className:"invite-receive__until",children:[t("invite.validUntil"),O(e.expireDate,l)]})]})}k.propTypes={invitation:r.object.isRequired,onLogin:r.func,onReceive:r.func,inService:r.bool,action:r.oneOf(["invite","issue-passport"])};k.defaultProps={onLogin:()=>{},onReceive:null,inService:!1,action:"invite"};const re=v.div`
|
|
43
43
|
text-align: center;
|
|
44
44
|
.invite-receive__logo-wrapper {
|
|
45
45
|
display: inline-flex;
|
|
@@ -74,7 +74,7 @@ import{bX as T,j as s,P as r,n as v,r as m,e as A,bi as $,D as E,m as j,o as H,a
|
|
|
74
74
|
.invite-receive__link {
|
|
75
75
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
76
76
|
}
|
|
77
|
-
`;function
|
|
77
|
+
`;function C({onLogin:e}){const{t:a}=j();return s.jsx(te,{children:s.jsx(z,{size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:()=>e(),children:a("common.connect")})})}C.propTypes={onLogin:r.func};C.defaultProps={onLogin:()=>{}};const te=v.div`
|
|
78
78
|
text-align: center;
|
|
79
79
|
.invite-receive__logo-wrapper {
|
|
80
80
|
display: inline-flex;
|
|
@@ -109,7 +109,7 @@ import{bX as T,j as s,P as r,n as v,r as m,e as A,bi as $,D as E,m as j,o as H,a
|
|
|
109
109
|
.invite-receive__link {
|
|
110
110
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
111
111
|
}
|
|
112
|
-
`;function
|
|
112
|
+
`;function T({invitation:e}){const{t:a}=j(),c=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),p=m.useMemo(()=>a("invite.message",{name:"{{name}}",role:c,dapp:"{{dapp}}"}),[a,c]),o=N(e.info.chainHost,e.inviter.did,"account"),t=S(p,{name(){return o?s.jsx("a",{target:"_blank",href:o,className:"invite-user__link",rel:"noreferrer",children:e.inviter.fullName},"name"):e.inviter.fullName},dapp(){return s.jsx("a",{target:"_blank",href:e.info.url,className:"invite-user__link",rel:"noreferrer",children:e.info.name},"dapp")}});return s.jsxs(ne,{children:[s.jsx(V,{did:e.inviter.did,src:encodeURI(e.inviter.avatar),size:80,shape:"circle",variant:"circle"}),s.jsx("div",{className:"invite-user__message",children:t})]})}T.propTypes={invitation:r.object.isRequired};const ne=v.div`
|
|
113
113
|
display: flex;
|
|
114
114
|
flex-direction: column;
|
|
115
115
|
justify-content: center;
|
|
@@ -132,7 +132,7 @@ import{bX as T,j as s,P as r,n as v,r as m,e as A,bi as $,D as E,m as j,o as H,a
|
|
|
132
132
|
.invite-user__link {
|
|
133
133
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
134
134
|
}
|
|
135
|
-
`;function
|
|
135
|
+
`;function R({invitation:e,type:a}){const{t:c}=j(),p=m.useMemo(()=>c("invite.success",{dapp:"{{dapp}}"}),[c]),o=N(e.info.chainHost,e.inviter.did,"account"),t=a==="receiver"?e.receiver:e.inviter,l=S(p,{name(){return o?s.jsx("a",{target:"_blank",href:o,className:"invite-user__link",rel:"noreferrer",children:t.fullName},"name"):t.fullName},dapp(){return s.jsx("a",{target:"_blank",href:e.info.url,className:"invite-user__link",rel:"noreferrer",children:e.info.name},"dapp")}});return s.jsxs(oe,{children:[s.jsx(L,{pt:1,color:"success.main",children:s.jsx(W,{style:{fontSize:80}})}),s.jsx("div",{className:"invite-user__message",children:l})]})}R.propTypes={invitation:r.object.isRequired,type:r.oneOf(["inviter","receiver"])};R.defaultProps={type:"inviter"};const oe=v.div`
|
|
136
136
|
display: flex;
|
|
137
137
|
flex-direction: column;
|
|
138
138
|
justify-content: center;
|
|
@@ -155,7 +155,7 @@ import{bX as T,j as s,P as r,n as v,r as m,e as A,bi as $,D as E,m as j,o as H,a
|
|
|
155
155
|
.invite-user__link {
|
|
156
156
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
157
157
|
}
|
|
158
|
-
`;function I({getDataFn:e,passportColor:a,createPassportSvg:c,onLoginSuccess:p,checkFn:o,onReceive:t,inService:l,action:u,status:x}){var y,f,d;const i=K(e);if(i!=null&&i.loading)return s.jsx(J,{});if(i!=null&&i.error)return s.jsx(Z,{status:"404",title:(f=(y=i==null?void 0:i.error)==null?void 0:y.response)==null?void 0:f.data,description:""});const n=x==="success"||((d=i==null?void 0:i.data)==null?void 0:d.status)==="success",_=n?
|
|
158
|
+
`;function I({getDataFn:e,passportColor:a,createPassportSvg:c,onLoginSuccess:p,checkFn:o,onReceive:t,inService:l,action:u,status:x}){var y,f,d;const i=K(e);if(i!=null&&i.loading)return s.jsx(J,{});if(i!=null&&i.error)return s.jsx(Z,{status:"404",title:(f=(y=i==null?void 0:i.error)==null?void 0:y.response)==null?void 0:f.data,description:""});const n=x==="success"||((d=i==null?void 0:i.data)==null?void 0:d.status)==="success",_=n?R:T,h=n?C:k;return s.jsx(ae,{className:"page-invite__wrapper",children:i!=null&&i.data?s.jsxs(L,{className:"page-invite__card",children:[s.jsx(_,{invitation:i.data}),s.jsx(P,{invitation:i.data,action:u,createPassportSvg:c,passportColor:a}),s.jsx(h,{invitation:i.data,action:u,onLogin:p,checkFn:o,onReceive:t,inService:l})]}):null})}I.propTypes={getDataFn:r.func.isRequired,checkFn:r.func.isRequired,createPassportSvg:r.func.isRequired,onLoginSuccess:r.func,onReceive:r.func,passportColor:r.string,inService:r.bool,action:r.oneOf(["invite","issue-passpor"]),status:r.oneOf(["success",""])};I.defaultProps={onLoginSuccess:()=>{},passportColor:"auto",onReceive:null,inService:!1,action:"invite",status:""};const ae=X("div")`
|
|
159
159
|
max-width: 460px;
|
|
160
160
|
max-height: 650px;
|
|
161
161
|
min-height: 450px;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bl as i,g9 as e}from"./index-DR-LzDpz.js";const a=e;var o=(r,t)=>a(r)===a(t);const P=i(o);export{P as i};
|