@abtnode/blocklet-services 1.17.2 → 1.17.3-beta-20251117-102849-8103f298
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/api/middlewares/check-federated.js +1 -73
- package/api/routes/federated.js +10 -3
- package/api/services/auth/connect/verify-destroy.js +1 -0
- package/dist/assets/{AdapterDayjs-B04P6h7J.js → AdapterDayjs-CSsn7VEX.js} +1 -1
- package/dist/assets/{Google-CqFo2faB.js → Google-C-Ei9n0a.js} +1 -1
- package/dist/assets/{access-control-CjCxQlMu.js → access-control-D0vxk-Ay.js} +1 -1
- package/dist/assets/{actions-DqoNrBDK.js → actions-C0hEY5iN.js} +1 -1
- package/dist/assets/{add-component-core-C2S9QiqL.js → add-component-core-7Qng0h9D.js} +18 -18
- package/dist/assets/{add-resource-CuaLDI6L.js → add-resource-CS6pw4MD.js} +1 -1
- package/dist/assets/{addon-D41X7_Ha.js → addon-B5iZc5zB.js} +2 -2
- package/dist/assets/{advanced-DgrelCY3.js → advanced-QXzUapJI.js} +2 -2
- package/dist/assets/{aigne-Yr1coV9J.js → aigne-CviOmneT.js} +1 -1
- package/dist/assets/api-VWP7Oo6L.js +1 -0
- package/dist/assets/{appearance-DTPu5zPe.js → appearance-CkaT_h9I.js} +1 -1
- package/dist/assets/{arrow-down.svg-BIX16b-P.js → arrow-down.svg-CDi8ywws.js} +1 -1
- package/dist/assets/{audit-logs-ChufMFKS.js → audit-logs-D2VdqDH8.js} +2 -2
- package/dist/assets/{authorize-BvRxf82d.js → authorize-BJr_whxb.js} +1 -1
- package/dist/assets/{base-chart-C-Raz4Q-.js → base-chart-BIsPFns6.js} +1 -1
- package/dist/assets/{base32-CE_1-AN3.js → base32-cypJRki8.js} +1 -1
- package/dist/assets/bind-account-BCP_Ypfy.js +1 -0
- package/dist/assets/{branding-DbQznVYe.js → branding-B7OUNmDC.js} +1 -1
- package/dist/assets/branding-BDdxk2E2.js +1 -0
- package/dist/assets/{branding-C1ye6wGf.js → branding-wKKLyZjs.js} +5 -5
- package/dist/assets/{bundle-avatar-B1050zFo.js → bundle-avatar-Bft1K1fA.js} +1 -1
- package/dist/assets/button-DAumqZoi.js +1 -0
- package/dist/assets/{click-to-copy-BkU88dAD.js → click-to-copy-Kd1YilQn.js} +1 -1
- package/dist/assets/{cloneDeep-C6qewg0C.js → cloneDeep-3LGZOUYL.js} +1 -1
- package/dist/assets/{collapse-BMy0GGFk.js → collapse-Cc8IqFzl.js} +1 -1
- package/dist/assets/{complete-DZVVfX5P.js → complete-FhkNOVEb.js} +1 -1
- package/dist/assets/{component-CfrOI6i5.js → component-YEpcN0PM.js} +30 -30
- package/dist/assets/{config-CkNzsAXv.js → config-ABsyghax.js} +1 -1
- package/dist/assets/{config-D5LRMmb0.js → config-BH7esTqa.js} +1 -1
- package/dist/assets/config-CfZ5vdbi.js +57 -0
- package/dist/assets/{config-navigation-kBAhTt_z.js → config-navigation-C2Cya4Ts.js} +2 -2
- package/dist/assets/{config-space-GWPehdiS.js → config-space-k6_NPjjD.js} +1 -1
- package/dist/assets/{confirm-Cb7UwqYS.js → confirm-BWGQvLZx.js} +1 -1
- package/dist/assets/{connect-BXfNpVtu.js → connect-B1DJAH4e.js} +1 -1
- package/dist/assets/{connect-DL9YrliM.js → connect-DohcTFiY.js} +1 -1
- package/dist/assets/connect-to-BrFtlkBE.js +1 -0
- package/dist/assets/{content-layout-oyz1EqNZ.js → content-layout-DJL10aJT.js} +1 -1
- package/dist/assets/{create-passport-svg--kCsicWA.js → create-passport-svg-aTWV-cva.js} +1 -1
- package/dist/assets/createClass-sKvm4qit.js +1 -0
- package/dist/assets/{dashboard-Blst3P1q.js → dashboard-CuicHcGI.js} +2 -2
- package/dist/assets/{delete-confirm-oFx7NRBG.js → delete-confirm-DgdA8XR6.js} +1 -1
- package/dist/assets/{did-address-BeDbQEgo.js → did-address-B_YPBiI4.js} +1 -1
- package/dist/assets/domain-BeE_hgxW.js +9 -0
- package/dist/assets/domain-action-card-CBIJJCbh.js +28 -0
- package/dist/assets/domains-DgAenuDY.js +1 -0
- package/dist/assets/{email-AE87NO3k.js → email-Bn3hPH00.js} +1 -1
- package/dist/assets/{empty-spinner-DYOzicuy.js → empty-spinner-Dqkt-AHg.js} +1 -1
- package/dist/assets/engine-DH9sKH0j.js +1 -0
- package/dist/assets/{exchange-passport-Chzr6DQN.js → exchange-passport-3kSU2YMT.js} +1 -1
- package/dist/assets/{form-D_b_DG-x.js → form-MjxZB__D.js} +1 -1
- package/dist/assets/{form-text-input-C2U1m5ol.js → form-text-input-BhAqaNAJ.js} +1 -1
- package/dist/assets/{form-wrapper-C8oo_Fdy.js → form-wrapper-SZH1FnTd.js} +1 -1
- package/dist/assets/{fuel-C8FRHxLR.js → fuel-C5ze4Cx7.js} +2 -2
- package/dist/assets/{gen-access-key-DwnkD6OQ.js → gen-access-key-DKzPF3CU.js} +1 -1
- package/dist/assets/{gen-simple-access-key-D5wTuY1t.js → gen-simple-access-key-DTWz63Us.js} +1 -1
- package/dist/assets/get-safe-url-DEmvtN3J.js +1 -0
- package/dist/assets/{home-2prkME-Q.js → home-Bqn3mvqQ.js} +1 -1
- package/dist/assets/{iframe-DqyN02cu.js → iframe-CxCgprun.js} +1 -1
- package/dist/assets/index-B3O5tZNc.js +55 -0
- package/dist/assets/{index-BcWDbRWR.js → index-BCKWe_QR.js} +1 -1
- package/dist/assets/{index-D45OiFud.js → index-BPKZON9n.js} +7 -7
- package/dist/assets/{index-BK6jWBnR.js → index-BTBrooUu.js} +1 -1
- package/dist/assets/{index-D_MyW6is.js → index-BWszlIaS.js} +2 -2
- package/dist/assets/{index-Bkmh68gh.js → index-B_NniBaO.js} +1 -1
- package/dist/assets/{index-CDLNMKDM.js → index-Bero09ZY.js} +128 -126
- package/dist/assets/index-Bth96Xcv.js +7 -0
- package/dist/assets/{index-erLJSqBe.js → index-BwSFbkVa.js} +1 -1
- package/dist/assets/{index-D5TNmV3K.js → index-CAMegfIe.js} +1 -1
- package/dist/assets/{index-BjPh-7kQ.js → index-CI7en2_Z.js} +2 -2
- package/dist/assets/{index-CHnA2nN2.js → index-CNndXmIt.js} +1 -1
- package/dist/assets/{index-CkLEqkuR.js → index-CPJ0NzQN.js} +8 -8
- package/dist/assets/{index-0PQCgggo.js → index-CWQp0vgv.js} +1 -1
- package/dist/assets/{index-CIHjwyhW.js → index-CXA6Z-BW.js} +5 -5
- package/dist/assets/index-CZ4Y1y1j.js +120 -0
- package/dist/assets/{index-CA0pv3Uq.js → index-C_odLDQq.js} +13 -13
- package/dist/assets/{index-Dw-Z7YrL.js → index-CdA2hOvz.js} +1 -1
- package/dist/assets/{index-CiTIvXav.js → index-Clfe99AI.js} +1 -1
- package/dist/assets/{index-Ds523Kr4.js → index-D9bRGwyn.js} +1 -1
- package/dist/assets/{index-De-Vgsb6.js → index-DKuLdlGi.js} +1 -1
- package/dist/assets/{index-DEoXYS44.js → index-DUJ8lwX7.js} +10 -10
- package/dist/assets/index-DUiyqDLR.js +30 -0
- package/dist/assets/{index-DfxScG8C.js → index-Dgk0_7wf.js} +5 -5
- package/dist/assets/{index-DTf1TIHb.js → index-DlPcYWy3.js} +1 -1
- package/dist/assets/{index-BKvI-HQW.js → index-DnJ0ECmd.js} +1 -1
- package/dist/assets/{index-6DYfiGIi.js → index-OAcqMuQz.js} +2 -2
- package/dist/assets/{index-CHmNqpEJ.js → index-PwQ2doS3.js} +1 -1
- package/dist/assets/{index-DVeHusdz.js → index-VyLFO7R7.js} +4 -4
- package/dist/assets/{index-NomqB6Iy.js → index-WzLE1u-g.js} +1 -1
- package/dist/assets/index-bd0w0UHw.js +6 -0
- package/dist/assets/index-hKD4Miak.js +1 -0
- package/dist/assets/index-vci0NXIe.js +1 -0
- package/dist/assets/{invitation-BLXeyB9R.js → invitation-KNbJYWOf.js} +2 -2
- package/dist/assets/{invitations-DAbKE0z_.js → invitations-Di31zIeh.js} +1 -1
- package/dist/assets/{invite-nkH5yAFh.js → invite-Cq1bQR9j.js} +1 -1
- package/dist/assets/{isURL-B8QEuluM.js → isURL-RzSyCgzI.js} +2 -2
- package/dist/assets/{issue-passport-DHA-EFAO.js → issue-passport-DnHvhKR-.js} +1 -1
- package/dist/assets/{item-CjT9qBlP.js → item-DVQ8TUdv.js} +1 -1
- package/dist/assets/{landing-page-4maignTY.js → landing-page-BzztE6uh.js} +1 -1
- package/dist/assets/{launch-result-message-DWeUg9rM.js → launch-result-message-DZJ76kCs.js} +1 -1
- package/dist/assets/{layout-e6DMnPsI.js → layout-D4qCeoWb.js} +1 -1
- package/dist/assets/{list-DG5rE6en.js → list-BIECWQvk.js} +1 -1
- package/dist/assets/list-Dd8HkY3P.js +103 -0
- package/dist/assets/{list-header-BE2kzda_.js → list-header-BNFs7V0b.js} +1 -1
- package/dist/assets/localization-CCBoTGdU.js +1 -0
- package/dist/assets/{log-BUSdWhUD.js → log-Uj0MJfkC.js} +1 -1
- package/dist/assets/logger-D-AxDn18.js +1 -0
- package/dist/assets/login-DWAFC8kE.js +1 -0
- package/dist/assets/{login-oauth-callback-D958pJEU.js → login-oauth-callback-DB_9NuV_.js} +1 -1
- package/dist/assets/{logo-uploader-BBf1tYyb.js → logo-uploader-BaFwvDBA.js} +1 -1
- package/dist/assets/{lost-passport-C0Gat_y8.js → lost-passport-C2SpMW8x.js} +2 -2
- package/dist/assets/{observability-Zow0Sv-X.js → observability-BjKI3tFt.js} +1 -1
- package/dist/assets/{omit-hhiOJGRf.js → omit-BZEryV5a.js} +1 -1
- package/dist/assets/{open-window-BCPyuDbV.js → open-window-CVU9iEs4.js} +1 -1
- package/dist/assets/over-due-invoice-payment-CFwnz6K1.js +1 -0
- package/dist/assets/{overview-DDe_917X.js → overview-DpyqbS6x.js} +2 -2
- package/dist/assets/{page-header-DCvzRay5.js → page-header-xpG0yfsa.js} +1 -1
- package/dist/assets/passport-Bei4Q65O.js +1 -0
- package/dist/assets/{passport-item-CrqI8LZP.js → passport-item-Af9VCIFW.js} +1 -1
- package/dist/assets/{permission-CRiK9UiX.js → permission-bm6ygywx.js} +1 -1
- package/dist/assets/{playground-CAOOFQT1.js → playground-DKMlueFr.js} +1 -1
- package/dist/assets/preferences-lGhRntFn.js +1 -0
- package/dist/assets/profile-embed-JHxbEwL7.js +1 -0
- package/dist/assets/publish-resource-D19FmjtU.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-BsXmsXbi.js → react-beautiful-dnd.esm-aD7p6S7F.js} +1 -1
- package/dist/assets/{react-stripe.esm-Dc9snvfb.js → react-stripe.esm-BV6kfV2w.js} +1 -1
- package/dist/assets/{required-BGaDOGrj.js → required-C9DLcn9T.js} +1 -1
- package/dist/assets/runtime-Kn_kNxXD.js +1 -0
- package/dist/assets/{sanitize-BEqBHa8a.js → sanitize-usZAK6S4.js} +1 -1
- package/dist/assets/sdk-C0BAXQzO.js +1 -0
- package/dist/assets/{section-C75bzkkL.js → section-MSasF4Cx.js} +1 -1
- package/dist/assets/{security-CDnrU-XX.js → security-DbLAyZY0.js} +1 -1
- package/dist/assets/{session-BDmvqOvc.js → session-jDtNo9RS.js} +1 -1
- package/dist/assets/{setup-Cju8Z063.js → setup-C5jTmWDG.js} +1 -1
- package/dist/assets/{shorten-label-RqvHqcC3.js → shorten-label-dRmYvYJ7.js} +1 -1
- package/dist/assets/{simple-select-DWI2SRq6.js → simple-select-CQxVe4SK.js} +1 -1
- package/dist/assets/{spaces-CNXRZTcd.js → spaces-V5-JD9i7.js} +1 -1
- package/dist/assets/{start-BBRJjidX.js → start-6JVejCmJ.js} +1 -1
- package/dist/assets/{starting-progress-D-1aLd8t.js → starting-progress-BYVwnaNc.js} +1 -1
- package/dist/assets/status-C9q9BOVN.js +1 -0
- package/dist/assets/{step-actions-CWp-NtsH.js → step-actions-C1GR4GhW.js} +1 -1
- package/dist/assets/{studio-B1WBQVRk.js → studio-DmcnkjTl.js} +1 -1
- package/dist/assets/{switch-control-BXLt-KrD.js → switch-control-CG7qdize.js} +1 -1
- package/dist/assets/{table-tips-CD2JCnV7.js → table-tips-CdXwFA3X.js} +1 -1
- package/dist/assets/team-PZ1SHeY3.js +146 -0
- package/dist/assets/traffic-Dh35q8G-.js +1 -0
- package/dist/assets/{transfer-8WkD_jUd.js → transfer-D3XcQgCt.js} +1 -1
- package/dist/assets/{unsubscribe-DVeiVKLX.js → unsubscribe-D-eN0zoM.js} +1 -1
- package/dist/assets/{use-app-logo-lNueneHC.js → use-app-logo-CMlvKxYW.js} +1 -1
- package/dist/assets/{use-mobile-DCNBsOlH.js → use-mobile-Bjbo_Gou.js} +1 -1
- package/dist/assets/{use-mobile-maRlSUwU.js → use-mobile-CjZIGfWP.js} +1 -1
- package/dist/assets/{use-server-logo-n_aaKVoZ.js → use-server-logo-uMEEt675.js} +1 -1
- package/dist/assets/use-window-close-Dmw6cTVQ.js +1 -0
- package/dist/assets/{useAsync-BcVLpt2E.js → useAsync-BT7wPXCF.js} +1 -1
- package/dist/assets/{useAsync-cZ_FPf9k.js → useAsync-D25sKCXL.js} +1 -1
- package/dist/assets/{useAsyncRetry-DwwEjrjs.js → useAsyncRetry-D-vTCNcS.js} +1 -1
- package/dist/assets/{useLocalStorage-E5ZXDlU2.js → useLocalStorage-BVI5Gy_v.js} +1 -1
- package/dist/assets/user-center-Cwsrx5yP.js +126 -0
- package/dist/assets/{user-follower-DLzUfaiE.js → user-follower-CaGHj3ZA.js} +1 -1
- package/dist/assets/{util-Bj9Es728.js → util-B-6GuSKY.js} +1 -1
- package/dist/assets/{util-CeZoM_ul.js → util-BsBRHu6F.js} +1 -1
- package/dist/assets/{vendor-arcblock-DrHS8FbJ.js → vendor-arcblock-B0VYnHWE.js} +115 -114
- package/dist/assets/{vendor-hooks-CjESGRlR.js → vendor-hooks-iFsOjihK.js} +1 -1
- package/dist/assets/{vendor-mui-core-CnXrAOs3.js → vendor-mui-core-BPcN1m8_.js} +1 -1
- package/dist/assets/{vendor-mui-x-bJ5idfMH.js → vendor-mui-x-DEgOZXst.js} +1 -1
- package/dist/assets/vendor-utils-D6HS5QsS.js +213 -0
- package/dist/assets/{vendor-ux-CzE32faw.js → vendor-ux-CheVAuK7.js} +10 -10
- package/dist/assets/{wait-connect-ySKEj_Ph.js → wait-connect-DyWyU1dI.js} +1 -1
- package/dist/assets/{wizard-sjepmmF5.js → wizard-CwvOHxpL.js} +1 -1
- package/dist/assets/{wizard-components-B1CGAMtl.js → wizard-components-Cu3iAFug.js} +1 -1
- package/dist/assets/wrap-locale-BLNR9__l.js +1 -0
- package/dist/assets/{zh-CUmZifBZ.js → zh-qs5i9EFZ.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +50 -50
- package/dist/assets/api-Btn0Tp3W.js +0 -1
- package/dist/assets/bind-account-xMtYaPJ7.js +0 -1
- package/dist/assets/branding-C5BV6PKe.js +0 -1
- package/dist/assets/button-9QcssggO.js +0 -1
- package/dist/assets/config-DeWFFWZ4.js +0 -53
- package/dist/assets/connect-to-5xKcFhJq.js +0 -1
- package/dist/assets/createClass-D9-Z7Ng8.js +0 -1
- package/dist/assets/domain-BAz5Jnp3.js +0 -9
- package/dist/assets/domain-action-card-BPIGiyRz.js +0 -28
- package/dist/assets/domains-DzH4E7Ky.js +0 -1
- package/dist/assets/engine-CHbWdoYF.js +0 -1
- package/dist/assets/get-safe-url-mHb8MGmt.js +0 -1
- package/dist/assets/index-BFjPk5rY.js +0 -29
- package/dist/assets/index-C-PaVJtk.js +0 -1
- package/dist/assets/index-CGsJfc7B.js +0 -1
- package/dist/assets/index-CLdviW_b.js +0 -120
- package/dist/assets/index-YZ0yjUWt.js +0 -6
- package/dist/assets/index-dhiRVZZQ.js +0 -55
- package/dist/assets/index-heiIZy8r.js +0 -7
- package/dist/assets/list-B_m0p7sB.js +0 -103
- package/dist/assets/localization-Ds_U2GMW.js +0 -1
- package/dist/assets/logger-BsYh0hGr.js +0 -1
- package/dist/assets/login-ML7YmOtr.js +0 -1
- package/dist/assets/over-due-invoice-payment-BXBLnoyA.js +0 -1
- package/dist/assets/passport-Be2_BAlL.js +0 -1
- package/dist/assets/preferences-B8QM8HJG.js +0 -1
- package/dist/assets/profile-embed-Dkf-JFZx.js +0 -1
- package/dist/assets/publish-resource-DDAEroSI.js +0 -1
- package/dist/assets/runtime-Dx-xN_gK.js +0 -1
- package/dist/assets/sdk-DjGKLOyd.js +0 -1
- package/dist/assets/status-CK9xg7pT.js +0 -1
- package/dist/assets/team-CCbX1N7p.js +0 -146
- package/dist/assets/traffic-Bxkf9fJx.js +0 -1
- package/dist/assets/use-window-close-D8vmtt2d.js +0 -1
- package/dist/assets/user-center-BU_yo3ue.js +0 -126
- package/dist/assets/vendor-utils-cJEl_UEd.js +0 -213
- package/dist/assets/wrap-locale-cNkWnEw5.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{r as z}from"./vendor-react-Dvs43sk9.js";import{j as k,a6 as ce,ak as T,Q as Me,cB as Pe,T as te,W as J,b6 as Ne,a5 as Fe,bD as ze,aX as Je,at as ke,U as Be,b1 as ie,z as Ue,A as Ve,cC as Se,bg as Y,a3 as V,cD as We,am as ge,bf as ye}from"./vendor-mui-core-
|
|
1
|
+
import{r as z}from"./vendor-react-Dvs43sk9.js";import{j as k,a6 as ce,ak as T,Q as Me,cB as Pe,T as te,W as J,b6 as Ne,a5 as Fe,bD as ze,aX as Je,at as ke,U as Be,b1 as ie,z as Ue,A as Ve,cC as Se,bg as Y,a3 as V,cD as We,am as ge,bf as ye}from"./vendor-mui-core-BPcN1m8_.js";import{_ as re,ac as Ke,v as Re,e as He,X as Ge,bb as Ze,o as Ye,bc as Qe,aG as Xe,b5 as H,b6 as et,c as tt,aT as be,B as Oe,a0 as Ae,Y as Z,bd as rt}from"./index-Bero09ZY.js";import{w as ue,P as st}from"./permission-bm6ygywx.js";import{V as le,n as G,H as W,p as Ee,ac as nt,v as ve,q as at}from"./vendor-ux-CheVAuK7.js";import{l as Ce}from"./vendor-hooks-iFsOjihK.js";import{C as me}from"./confirm-BWGQvLZx.js";import{f as oe}from"./index-DBs9Ljax.js";import{u as it}from"./useSetState-DFuQZPPV.js";import{u as De}from"./session-jDtNo9RS.js";import{S as U}from"./section-MSasF4Cx.js";import{C as ot}from"./click-to-copy-Kd1YilQn.js";import{u as Ie}from"./team-PZ1SHeY3.js";import{v as lt,U as ct}from"./vendor-utils-D6HS5QsS.js";import{v as ut}from"./index-DlPcYWy3.js";import{W as ft}from"./did-address-B_YPBiI4.js";import{V as dt}from"./status-C9q9BOVN.js";import{F as _e}from"./form-text-input-BhAqaNAJ.js";import"./vendor-arcblock-B0VYnHWE.js";import"./lottie-web-4koyQiv_.js";import"./required-C9DLcn9T.js";import"./isURL-RzSyCgzI.js";import"./use-app-logo-CMlvKxYW.js";import"./omit-BZEryV5a.js";import"./form-wrapper-SZH1FnTd.js";import"./edit.svg-DycWG9v3.js";const mt=localStorage.getItem("enableDebug")==="true";function ht({teamDid:$,size:q="small",...P}){const{t:C}=le(),{api:j}=re(),[w,p]=z.useState(!1),[o,g]=z.useState(null),m=()=>{p(!1),g(null)},f=async()=>{try{p(!0);const a=await j.clearCache({input:{teamDid:$}});W.success(C("blocklet.config.clearCache.success",{count:a.removed?.length||0}))}catch(a){W.error(oe(a))}finally{p(!1),g(null)}},e={title:C("blocklet.config.clearCache.title"),description:C("blocklet.config.clearCache.description"),confirm:C("common.confirm"),cancel:C("common.cancel"),onConfirm:f,onCancel:m};return k.jsxs("div",{...P,children:[k.jsxs(G,{onClick:()=>g(e),color:"error",variant:"outlined",size:q,children:[w?k.jsx(ce,{size:16,style:{marginRight:5}}):null,C("blocklet.config.clearCache.action")]}),o&&k.jsx(me,{title:o.title,description:o.description,confirm:o.confirm,cancel:o.cancel,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}function Te({onChange:$=()=>{},disabled:q=!1,loading:P=!1,inService:C=!1}){const{t:j}=le(),{api:w,session:p}=De(),{blocklet:o}=Ke(),[g,m]=it({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>m({isConnectOpen:!1}),e=()=>{if(He.isInProgress(o.status)){W.error(j("blocklet.error.isInProgress"));return}m({confirmDialogOpen:!0})};return k.jsxs(k.Fragment,{children:[k.jsx(U,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(Me,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:q||P,onClick:e,children:[k.jsx(Pe,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),k.jsxs(k.Fragment,{children:[g.isConnectOpen&&k.jsx(Re,{popup:!0,open:g.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:w.get,checkTimeout:5*60*1e3,onSuccess:()=>{$(),C&&p.logout(),f()},extraParams:{appDid:o.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),g.confirmDialogOpen&&k.jsx(me,{title:k.jsx(te,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:k.jsx(te,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>m({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>m({confirmDialogOpen:!1})})]})]})}Te.propTypes={onChange:J.func,disabled:J.bool,loading:J.bool,inService:J.bool};function Le({onCancel:$,onSuccess:q,onError:P=()=>{}}){const{api:C}=z.useContext(Ge),[j,w]=z.useState(!1),{t:p,locale:o}=le(),[g,m]=z.useState(""),[f,e]=z.useState(!1),[a,n]=z.useState(0),[r,t]=z.useState(""),{endpoint:l}=Ie(),[s,i]=z.useState(!1),u=c=>{m(null),w(!0);try{t(c.result),n(_.length-1)}catch(h){const b=oe(h);m(b),P(h)}finally{w(!1)}},d=()=>{e(!0),n(1)},y=()=>{e(!1),n(0)},_=[{body:k.jsxs(T,{children:[k.jsx(te,{children:p("team.transferApp.transferDialog.tips.progress")}),k.jsx(te,{sx:{mt:3,mb:2},children:p("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),onCancel:$,onConfirm:d},{cancel:p("common.cancel"),confirm:p("team.transferApp.transferDialog.createTransferLink"),body:()=>k.jsx(Re,{action:"transfer-app-owner",open:f,locale:o,checkFn:C.get,onClose:y,onSuccess:u,checkTimeout:5*60*1e3,extraParams:{},messages:{title:p("team.transferApp.connectDialog.title"),scan:p("team.transferApp.connectDialog.scan"),confirm:p("team.transferApp.connectDialog.confirm"),success:p("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=Ze({transferId:r.transferId,endpoint:l});return k.jsxs(k.Fragment,{children:[k.jsx(T,{component:Q,dangerouslySetInnerHTML:{__html:p("team.transferApp.transferDialog.createSuccessTip1")}}),k.jsx(T,{component:Q,sx:{mt:2},children:k.jsx(Q,{children:p("team.transferApp.transferDialog.createSuccessTip3")})}),k.jsxs(T,{children:[k.jsx(T,{component:Q,sx:{mt:2},children:k.jsx(Q,{children:p("team.transferApp.transferDialog.createSuccessTip2",{expireDate:Ye(r.expireDate,o)})})}),k.jsx(T,{sx:{my:1},children:k.jsx(ot,{children:c})})]}),k.jsx("div",{children:k.jsx(Ne,{value:"end",control:k.jsx(Fe,{checked:s,onChange:h=>i(h.target.checked)}),label:p("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:p("common.confirm"),onConfirm:q}],v=_[a];return k.jsxs(Ee,{title:k.jsx(Q,{className:"title",children:p("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:k.jsxs(k.Fragment,{children:[v.cancel&&k.jsx(G,{onClick:v.onCancel,color:"inherit",children:v.cancel}),k.jsxs(G,{onClick:v.onConfirm,color:"error",disabled:j||a===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&k.jsx(ce,{size:16}),v.confirm]})]}),children:[k.jsx(ze,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!g&&k.jsx(Je,{severity:"error",variant:"icon",children:g})]})}Le.propTypes={onCancel:J.func.isRequired,onSuccess:J.func.isRequired,onError:J.func};const Q=ke.div`
|
|
2
2
|
font-size: 16px;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
&.title {
|
|
5
5
|
font-size: 20px;
|
|
6
6
|
}
|
|
7
|
-
`;var ae={},de={exports:{}},we;function pt(){return we||(we=1,function($,q){(function(P,C){$.exports=C()})(self,()=>{return P={7629:(j,w,p)=>{const o=p(375),g=p(8571),m=p(9474),f=p(1687),e=p(8652),a=p(8160),n=p(3292),r=p(6354),t=p(8901),l=p(9708),s=p(6914),i=p(2294),u=p(6133),d=p(1152),y=p(8863),_=p(2036),v={Base:class{constructor(c){this.type=c,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new i.Ids,this._preferences=null,this._refs=new u.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return o(typeof l.describe=="function","Manifest functionality disabled"),l.describe(this)}allow(...c){return a.verifyFlat(c,"allow"),this._values(c,"_valids")}alter(c){o(c&&typeof c=="object"&&!Array.isArray(c),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const h=this.clone();h.$_terms.alterations=h.$_terms.alterations||[];for(const b in c){const x=c[b];o(typeof x=="function","Alteration adjuster for",b,"must be a function"),h.$_terms.alterations.push({target:b,adjuster:x})}return h.$_temp.ruleset=!1,h}artifact(c){return o(c!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",c)}cast(c){return o(c===!1||typeof c=="string","Invalid to value"),o(c===!1||this._definition.cast[c],"Type",this.type,"does not support casting to",c),this.$_setFlag("cast",c===!1?void 0:c)}default(c,h){return this._default("default",c,h)}description(c){return o(c&&typeof c=="string","Description must be a non-empty string"),this.$_setFlag("description",c)}empty(c){const h=this.clone();return c!==void 0&&(c=h.$_compile(c,{override:!1})),h.$_setFlag("empty",c,{clone:!1})}error(c){return o(c,"Missing error"),o(c instanceof Error||typeof c=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",c)}example(c,h={}){return o(c!==void 0,"Missing example"),a.assertOptions(h,["override"]),this._inner("examples",c,{single:!0,override:h.override})}external(c,h){return typeof c=="object"&&(o(!h,"Cannot combine options with description"),h=c.description,c=c.method),o(typeof c=="function","Method must be a function"),o(h===void 0||h&&typeof h=="string","Description must be a non-empty string"),this._inner("externals",{method:c,description:h},{single:!0})}failover(c,h){return this._default("failover",c,h)}forbidden(){return this.presence("forbidden")}id(c){return c?(o(typeof c=="string","id must be a non-empty string"),o(/^[^\.]+$/.test(c),"id cannot contain period character"),this.$_setFlag("id",c)):this.$_setFlag("id",void 0)}invalid(...c){return this._values(c,"_invalids")}label(c){return o(c&&typeof c=="string","Label name must be a non-empty string"),this.$_setFlag("label",c)}meta(c){return o(c!==void 0,"Meta cannot be undefined"),this._inner("metas",c,{single:!0})}note(...c){o(c.length,"Missing notes");for(const h of c)o(h&&typeof h=="string","Notes must be non-empty strings");return this._inner("notes",c)}only(c=!0){return o(typeof c=="boolean","Invalid mode:",c),this.$_setFlag("only",c)}optional(){return this.presence("optional")}prefs(c){o(c,"Missing preferences"),o(c.context===void 0,"Cannot override context"),o(c.externals===void 0,"Cannot override externals"),o(c.warnings===void 0,"Cannot override warnings"),o(c.debug===void 0,"Cannot override debug"),a.checkPreferences(c);const h=this.clone();return h._preferences=a.preferences(h._preferences,c),h}presence(c){return o(["optional","required","forbidden"].includes(c),"Unknown presence mode",c),this.$_setFlag("presence",c)}raw(c=!0){return this.$_setFlag("result",c?"raw":void 0)}result(c){return o(["raw","strip"].includes(c),"Unknown result mode",c),this.$_setFlag("result",c)}required(){return this.presence("required")}strict(c){const h=this.clone(),b=c!==void 0&&!c;return h._preferences=a.preferences(h._preferences,{convert:b}),h}strip(c=!0){return this.$_setFlag("result",c?"strip":void 0)}tag(...c){o(c.length,"Missing tags");for(const h of c)o(h&&typeof h=="string","Tags must be non-empty strings");return this._inner("tags",c)}unit(c){return o(c&&typeof c=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",c)}valid(...c){a.verifyFlat(c,"valid");const h=this.allow(...c);return h.$_setFlag("only",!!h._valids,{clone:!1}),h}when(c,h){const b=this.clone();b.$_terms.whens||(b.$_terms.whens=[]);const x=n.when(b,c,h);if(!["any","link"].includes(b.type)){const S=x.is?[x]:x.switch;for(const R of S)o(!R.then||R.then.type==="any"||R.then.type===b.type,"Cannot combine",b.type,"with",R.then&&R.then.type),o(!R.otherwise||R.otherwise.type==="any"||R.otherwise.type===b.type,"Cannot combine",b.type,"with",R.otherwise&&R.otherwise.type)}return b.$_terms.whens.push(x),b.$_mutateRebuild()}cache(c){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const h=this.clone();return h._cache=c||e.provider.provision(),h.$_temp.ruleset=!1,h}clone(){const c=Object.create(Object.getPrototypeOf(this));return this._assign(c)}concat(c){o(a.isSchema(c),"Invalid schema object"),o(this.type==="any"||c.type==="any"||c.type===this.type,"Cannot merge type",this.type,"with another type:",c.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!c._inRuleset(),"Cannot concatenate a schema with open ruleset");let h=this.clone();if(this.type==="any"&&c.type!=="any"){const b=c.clone();for(const x of Object.keys(h))x!=="type"&&(b[x]=h[x]);h=b}h._ids.concat(c._ids),h._refs.register(c,u.toSibling),h._preferences=h._preferences?a.preferences(h._preferences,c._preferences):c._preferences,h._valids=_.merge(h._valids,c._valids,c._invalids),h._invalids=_.merge(h._invalids,c._invalids,c._valids);for(const b of c._singleRules.keys())h._singleRules.has(b)&&(h._rules=h._rules.filter(x=>x.keep||x.name!==b),h._singleRules.delete(b));for(const b of c._rules)c._definition.rules[b.method].multi||h._singleRules.set(b.name,b),h._rules.push(b);if(h._flags.empty&&c._flags.empty){h._flags.empty=h._flags.empty.concat(c._flags.empty);const b=Object.assign({},c._flags);delete b.empty,f(h._flags,b)}else if(c._flags.empty){h._flags.empty=c._flags.empty;const b=Object.assign({},c._flags);delete b.empty,f(h._flags,b)}else f(h._flags,c._flags);for(const b in c.$_terms){const x=c.$_terms[b];x?h.$_terms[b]?h.$_terms[b]=h.$_terms[b].concat(x):h.$_terms[b]=x.slice():h.$_terms[b]||(h.$_terms[b]=x)}return this.$_root._tracer&&this.$_root._tracer._combine(h,[this,c]),h.$_mutateRebuild()}extend(c){return o(!c.base,"Cannot extend type with another base"),t.type(this,c)}extract(c){return c=Array.isArray(c)?c:c.split("."),this._ids.reach(c)}fork(c,h){o(!this._inRuleset(),"Cannot fork inside a ruleset");let b=this;for(let x of[].concat(c))x=Array.isArray(x)?x:x.split("."),b=b._ids.fork(x,h,b);return b.$_temp.ruleset=!1,b}rule(c){const h=this._definition;a.assertOptions(c,Object.keys(h.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const b=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(b>=0&&b<this._rules.length,"Cannot apply rules to empty ruleset");const x=this.clone();for(let S=b;S<x._rules.length;++S){const R=x._rules[S],O=g(R);for(const A in c)h.modifiers[A](O,c[A]),o(O.name===R.name,"Cannot change rule name");x._rules[S]=O,x._singleRules.get(O.name)===R&&x._singleRules.set(O.name,O)}return x.$_temp.ruleset=!1,x.$_mutateRebuild()}get ruleset(){o(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const c=this.clone();return c.$_temp.ruleset=c._rules.length,c}get $(){return this.ruleset}tailor(c){c=[].concat(c),o(!this._inRuleset(),"Cannot tailor inside a ruleset");let h=this;if(this.$_terms.alterations)for(const{target:b,adjuster:x}of this.$_terms.alterations)c.includes(b)&&(h=x(h),o(a.isSchema(h),"Alteration adjuster for",b,"failed to return a schema object"));return h=h.$_modify({each:b=>b.tailor(c),ref:!1}),h.$_temp.ruleset=!1,h.$_mutateRebuild()}tracer(){return d.location?d.location(this):this}validate(c,h){return y.entry(c,this,h)}validateAsync(c,h){return y.entryAsync(c,this,h)}$_addRule(c){typeof c=="string"&&(c={name:c}),o(c&&typeof c=="object","Invalid options"),o(c.name&&typeof c.name=="string","Invalid rule name");for(const R in c)o(R[0]!=="_","Cannot set private rule properties");const h=Object.assign({},c);h._resolve=[],h.method=h.method||h.name;const b=this._definition.rules[h.method],x=h.args;o(b,"Unknown rule",h.method);const S=this.clone();if(x){o(Object.keys(x).length===1||Object.keys(x).length===this._definition.rules[h.name].args.length,"Invalid rule definition for",this.type,h.name);for(const R in x){let O=x[R];if(b.argsByName){const A=b.argsByName.get(R);if(A.ref&&a.isResolvable(O))h._resolve.push(R),S.$_mutateRegister(O);else if(A.normalize&&(O=A.normalize(O),x[R]=O),A.assert){const D=a.validateArg(O,R,A);o(!D,D,"or reference")}}O!==void 0?x[R]=O:delete x[R]}}return b.multi||(S._ruleRemove(h.name,{clone:!1}),S._singleRules.set(h.name,h)),S.$_temp.ruleset===!1&&(S.$_temp.ruleset=null),b.priority?S._rules.unshift(h):S._rules.push(h),S}$_compile(c,h){return n.schema(this.$_root,c,h)}$_createError(c,h,b,x,S,R={}){const O=R.flags!==!1?this._flags:{},A=R.messages?s.merge(this._definition.messages,R.messages):this._definition.messages;return new r.Report(c,h,b,O,A,x,S)}$_getFlag(c){return this._flags[c]}$_getRule(c){return this._singleRules.get(c)}$_mapLabels(c){return c=Array.isArray(c)?c:c.split("."),this._ids.labels(c)}$_match(c,h,b,x){(b=Object.assign({},b)).abortEarly=!0,b._externals=!1,h.snapshot();const S=!y.validate(c,this,h,b,x).errors;return h.restore(),S}$_modify(c){return a.assertOptions(c,["each","once","ref","schema"]),i.schema(this,c)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(c,{source:h,name:b,path:x,key:S})=>{const R=this._definition[h][b]&&this._definition[h][b].register;R!==!1&&this.$_mutateRegister(c,{family:R,key:S})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(c,{family:h,key:b}={}){this._refs.register(c,h),this._ids.register(c,{key:b})}$_property(c){return this._definition.properties[c]}$_reach(c){return this._ids.reach(c)}$_rootReferences(){return this._refs.roots()}$_setFlag(c,h,b={}){o(c[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const x=this._definition.flags[c]||{};if(m(h,x.default)&&(h=void 0),m(h,this._flags[c]))return this;const S=b.clone!==!1?this.clone():this;return h!==void 0?(S._flags[c]=h,S.$_mutateRegister(h)):delete S._flags[c],c[0]!=="_"&&(S.$_temp.ruleset=!1),S}$_parent(c,...h){return this[c][a.symbols.parent].call(this,...h)}$_validate(c,h,b){return y.validate(c,this,h,b)}_assign(c){c.type=this.type,c.$_root=this.$_root,c.$_temp=Object.assign({},this.$_temp),c.$_temp.whens={},c._ids=this._ids.clone(),c._preferences=this._preferences,c._valids=this._valids&&this._valids.clone(),c._invalids=this._invalids&&this._invalids.clone(),c._rules=this._rules.slice(),c._singleRules=g(this._singleRules,{shallow:!0}),c._refs=this._refs.clone(),c._flags=Object.assign({},this._flags),c._cache=null,c.$_terms={};for(const h in this.$_terms)c.$_terms[h]=this.$_terms[h]?this.$_terms[h].slice():null;c.$_super={};for(const h in this.$_super)c.$_super[h]=this._super[h].bind(c);return c}_bare(){const c=this.clone();c._reset();const h=c._definition.terms;for(const b in h){const x=h[b];c.$_terms[b]=x.init}return c.$_mutateRebuild()}_default(c,h,b={}){return a.assertOptions(b,"literal"),o(h!==void 0,"Missing",c,"value"),o(typeof h=="function"||!b.literal,"Only function value supports literal option"),typeof h=="function"&&b.literal&&(h={[a.symbols.literal]:!0,literal:h}),this.$_setFlag(c,h)}_generate(c,h,b){if(!this.$_terms.whens)return{schema:this};const x=[],S=[];for(let A=0;A<this.$_terms.whens.length;++A){const D=this.$_terms.whens[A];if(D.concat){x.push(D.concat),S.push(`${A}.concat`);continue}const M=D.ref?D.ref.resolve(c,h,b):c,F=D.is?[D]:D.switch,E=S.length;for(let I=0;I<F.length;++I){const{is:L,then:N,otherwise:B}=F[I],K=`${A}${D.switch?"."+I:""}`;if(L.$_match(M,h.nest(L,`${K}.is`),b)){if(N){const se=h.localize([...h.path,`${K}.then`],h.ancestors,h.schemas),{schema:fe,id:ne}=N._generate(c,se,b);x.push(fe),S.push(`${K}.then${ne?`(${ne})`:""}`);break}}else if(B){const se=h.localize([...h.path,`${K}.otherwise`],h.ancestors,h.schemas),{schema:fe,id:ne}=B._generate(c,se,b);x.push(fe),S.push(`${K}.otherwise${ne?`(${ne})`:""}`);break}}if(D.break&&S.length>E)break}const R=S.join(", ");if(h.mainstay.tracer.debug(h,"rule","when",R),!R)return{schema:this};if(!h.mainstay.tracer.active&&this.$_temp.whens[R])return{schema:this.$_temp.whens[R],id:R};let O=this;this._definition.generate&&(O=this._definition.generate(this,c,h,b));for(const A of x)O=O.concat(A);return this.$_root._tracer&&this.$_root._tracer._combine(O,[this,...x]),this.$_temp.whens[R]=O,{schema:O,id:R}}_inner(c,h,b={}){o(!this._inRuleset(),`Cannot set ${c} inside a ruleset`);const x=this.clone();return x.$_terms[c]&&!b.override||(x.$_terms[c]=[]),b.single?x.$_terms[c].push(h):x.$_terms[c].push(...h),x.$_temp.ruleset=!1,x}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(c,h={}){if(!this._singleRules.has(c))return this;const b=h.clone!==!1?this.clone():this;b._singleRules.delete(c);const x=[];for(let S=0;S<b._rules.length;++S){const R=b._rules[S];R.name!==c||R.keep?x.push(R):b._inRuleset()&&S<b.$_temp.ruleset&&--b.$_temp.ruleset}return b._rules=x,b}_values(c,h){a.verifyFlat(c,h.slice(1,-1));const b=this.clone(),x=c[0]===a.symbols.override;if(x&&(c=c.slice(1)),!b[h]&&c.length?b[h]=new _:x&&(b[h]=c.length?new _:null,b.$_mutateRebuild()),!b[h])return b;x&&b[h].override();for(const S of c){o(S!==void 0,"Cannot call allow/valid/invalid with undefined"),o(S!==a.symbols.override,"Override must be the first value");const R=h==="_invalids"?"_valids":"_invalids";b[R]&&(b[R].remove(S),b[R].length||(o(h==="_valids"||!b._flags.only,"Setting invalid value",S,"leaves schema rejecting all values due to previous valid rule"),b[R]=null)),b[h].add(S,b._refs)}return b}}};v.Base.prototype[a.symbols.any]={version:a.version,compile:n.compile,root:"$_root"},v.Base.prototype.isImmutable=!0,v.Base.prototype.deny=v.Base.prototype.invalid,v.Base.prototype.disallow=v.Base.prototype.invalid,v.Base.prototype.equal=v.Base.prototype.valid,v.Base.prototype.exist=v.Base.prototype.required,v.Base.prototype.not=v.Base.prototype.invalid,v.Base.prototype.options=v.Base.prototype.prefs,v.Base.prototype.preferences=v.Base.prototype.prefs,j.exports=new v.Base},8652:(j,w,p)=>{const o=p(375),g=p(8571),m=p(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};w.provider={provision:e=>new f.Cache(e)},f.Cache=class{constructor(e={}){m.assertOptions(e,["max"]),o(e.max===void 0||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(e,a){if(e!==null&&!f.supported.has(typeof e))return;let n=this._map.get(e);if(n)return n.value=a,void this._list.first(n);n=this._list.unshift({key:e,value:a}),this._map.set(e,n),this._compact()}get(e){const a=this._map.get(e);if(a)return this._list.first(a),g(a.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:a,prev:n}=e;return a.prev=n,n&&(n.next=a),e===this.tail&&(this.tail=a),e.prev=null,e.next=null,e}}},8160:(j,w,p)=>{const o=p(375),g=p(7916),m=p(5934);let f,e;const a={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};w.version=m.version,w.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},w.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},w.assertOptions=function(n,r,t="Options"){o(n&&typeof n=="object"&&!Array.isArray(n),"Options must be of type object");const l=Object.keys(n).filter(s=>!r.includes(s));o(l.length===0,`${t} contain unknown keys: ${l}`)},w.checkPreferences=function(n){e=e||p(3378);const r=e.preferences.validate(n);if(r.error)throw new g([r.error.details[0].message])},w.compare=function(n,r,t){switch(t){case"=":return n===r;case">":return n>r;case"<":return n<r;case">=":return n>=r;case"<=":return n<=r}},w.default=function(n,r){return n===void 0?r:n},w.isIsoDate=function(n){return a.isoDate.test(n)},w.isNumber=function(n){return typeof n=="number"&&!isNaN(n)},w.isResolvable=function(n){return!!n&&(n[w.symbols.ref]||n[w.symbols.template])},w.isSchema=function(n,r={}){const t=n&&n[w.symbols.any];return!!t&&(o(r.legacy||t.version===w.version,"Cannot mix different versions of joi schemas"),!0)},w.isValues=function(n){return n[w.symbols.values]},w.limit=function(n){return Number.isSafeInteger(n)&&n>=0},w.preferences=function(n,r){f=f||p(6914),n=n||{},r=r||{};const t=Object.assign({},n,r);return r.errors&&n.errors&&(t.errors=Object.assign({},n.errors,r.errors),t.errors.wrap=Object.assign({},n.errors.wrap,r.errors.wrap)),r.messages&&(t.messages=f.compile(r.messages,n.messages)),delete t[w.symbols.prefs],t},w.tryWithPath=function(n,r,t={}){try{return n()}catch(l){throw l.path!==void 0?l.path=r+"."+l.path:l.path=r,t.append&&(l.message=`${l.message} (${l.path})`),l}},w.validateArg=function(n,r,{assert:t,message:l}){if(w.isSchema(t)){const s=t.validate(n);return s.error?s.error.message:void 0}if(!t(n))return r?`${r} ${l}`:l},w.verifyFlat=function(n,r){for(const t of n)o(!Array.isArray(t),"Method no longer accepts array arguments:",r)}},3292:(j,w,p)=>{const o=p(375),g=p(8160),m=p(6133),f={};w.schema=function(e,a,n={}){g.assertOptions(n,["appendPath","override"]);try{return f.schema(e,a,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},f.schema=function(e,a,n){o(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(o(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const r=(t,...l)=>n.override!==!1?t.valid(e.override,...l):t.valid(...l);if(f.simple(a))return r(e,a);if(typeof a=="function")return e.custom(a);if(o(typeof a=="object","Invalid schema content:",typeof a),g.isResolvable(a))return r(e,a);if(g.isSchema(a))return a;if(Array.isArray(a)){for(const t of a)if(!f.simple(t))return e.alternatives().try(...a);return r(e,...a)}return a instanceof RegExp?e.string().regex(a):a instanceof Date?r(e.date(),a):(o(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(a))},w.ref=function(e,a){return m.isRef(e)?e:m.create(e,a)},w.compile=function(e,a,n={}){g.assertOptions(n,["legacy"]);const r=a&&a[g.symbols.any];if(r)return o(n.legacy||r.version===g.version,"Cannot mix different versions of joi schemas:",r.version,g.version),a;if(typeof a!="object"||!n.legacy)return w.schema(e,a,{appendPath:!0});const t=f.walk(a);return t?t.compile(t.root,a):w.schema(e,a,{appendPath:!0})},f.walk=function(e){if(typeof e!="object")return null;if(Array.isArray(e)){for(const n of e){const r=f.walk(n);if(r)return r}return null}const a=e[g.symbols.any];if(a)return{root:e[a.root],compile:a.compile};o(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const n in e){const r=f.walk(e[n]);if(r)return r}return null},f.simple=function(e){return e===null||["boolean","string","number"].includes(typeof e)},w.when=function(e,a,n){if(n===void 0&&(o(a&&typeof a=="object","Missing options"),n=a,a=m.create(".")),Array.isArray(n)&&(n={switch:n}),g.assertOptions(n,["is","not","then","otherwise","switch","break"]),g.isSchema(a))return o(n.is===void 0,'"is" can not be used with a schema condition'),o(n.not===void 0,'"not" can not be used with a schema condition'),o(n.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(e,{is:a,then:n.then,otherwise:n.otherwise,break:n.break});if(o(m.isRef(a)||typeof a=="string","Invalid condition:",a),o(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let t=n;n.not!==void 0&&(t={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let l=t.is!==void 0?e.$_compile(t.is):e.$_root.invalid(null,!1,0,"").required();return o(t.then!==void 0||t.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(t.break===void 0||t.then===void 0||t.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is===void 0||m.isRef(n.is)||g.isSchema(n.is)||(l=l.required()),f.condition(e,{ref:w.ref(a),is:l,then:t.then,otherwise:t.otherwise,break:t.break})}o(Array.isArray(n.switch),'"switch" must be an array'),o(n.is===void 0,'Cannot combine "switch" with "is"'),o(n.not===void 0,'Cannot combine "switch" with "not"'),o(n.then===void 0,'Cannot combine "switch" with "then"');const r={ref:w.ref(a),switch:[],break:n.break};for(let t=0;t<n.switch.length;++t){const l=n.switch[t],s=t===n.switch.length-1;g.assertOptions(l,s?["is","then","otherwise"]:["is","then"]),o(l.is!==void 0,'Switch statement missing "is"'),o(l.then!==void 0,'Switch statement missing "then"');const i={is:e.$_compile(l.is),then:e.$_compile(l.then)};if(m.isRef(l.is)||g.isSchema(l.is)||(i.is=i.is.required()),s){o(n.otherwise===void 0||l.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const u=n.otherwise!==void 0?n.otherwise:l.otherwise;u!==void 0&&(o(r.break===void 0,"Cannot specify both otherwise and break"),i.otherwise=e.$_compile(u))}r.switch.push(i)}return r},f.condition=function(e,a){for(const n of["then","otherwise"])a[n]===void 0?delete a[n]:a[n]=e.$_compile(a[n]);return a}},6354:(j,w,p)=>{const o=p(5688),g=p(8160),m=p(3328);w.Report=class{constructor(f,e,a,n,r,t,l){if(this.code=f,this.flags=n,this.messages=r,this.path=t.path,this.prefs=l,this.state=t,this.value=e,this.message=null,this.template=null,this.local=a||{},this.local.label=w.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const s=this.path[this.path.length-1];typeof s!="object"&&(this.local.key=s)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,e){return w.template(this.value,f,e||this.code,this.state,this.prefs)}},w.path=function(f){let e="";for(const a of f)typeof a!="object"&&(typeof a=="string"?(e&&(e+="."),e+=a):e+=`[${a}]`);return e},w.template=function(f,e,a,n,r){if(!e)return;if(m.isTemplate(e))return a!=="root"?e:null;let t=r.errors.language;if(g.isResolvable(t)&&(t=t.resolve(f,n,r)),t&&e[t]){if(e[t][a]!==void 0)return e[t][a];if(e[t]["*"]!==void 0)return e[t]["*"]}return e[a]?e[a]:e["*"]},w.label=function(f,e,a,n){if(!a.errors.label)return"";if(f.label)return f.label;let r=e.path;return a.errors.label==="key"&&e.path.length>1&&(r=e.path.slice(-1)),w.path(r)||w.template(null,a.messages,"root",e,a)||n&&w.template(null,n,"root",e,a)||"value"},w.process=function(f,e,a){if(!f)return null;const{override:n,message:r,details:t}=w.details(f);if(n)return n;if(a.errors.stack)return new w.ValidationError(r,t,e);const l=Error.stackTraceLimit;Error.stackTraceLimit=0;const s=new w.ValidationError(r,t,e);return Error.stackTraceLimit=l,s},w.details=function(f,e={}){let a=[];const n=[];for(const r of f){if(r instanceof Error){if(e.override!==!1)return{override:r};const l=r.toString();a.push(l),n.push({message:l,type:"override",context:{error:r}});continue}const t=r.toString();a.push(t),n.push({message:t,path:r.path.filter(l=>typeof l!="object"),type:r.code,context:r.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:n}},w.ValidationError=class extends Error{constructor(f,e,a){super(f),this._original=a,this.details=e}static isError(f){return f instanceof w.ValidationError}},w.ValidationError.prototype.isJoi=!0,w.ValidationError.prototype.name="ValidationError",w.ValidationError.prototype.annotate=o.error},8901:(j,w,p)=>{const o=p(375),g=p(8571),m=p(8160),f=p(6914),e={};w.type=function(a,n){const r=Object.getPrototypeOf(a),t=g(r),l=a._assign(Object.create(t)),s=Object.assign({},n);delete s.base,t._definition=s;const i=r._definition||{};s.messages=f.merge(i.messages,s.messages),s.properties=Object.assign({},i.properties,s.properties),l.type=s.type,s.flags=Object.assign({},i.flags,s.flags);const u=Object.assign({},i.terms);if(s.terms)for(const v in s.terms){const c=s.terms[v];o(l.$_terms[v]===void 0,"Invalid term override for",s.type,v),l.$_terms[v]=c.init,u[v]=c}s.terms=u,s.args||(s.args=i.args),s.prepare=e.prepare(s.prepare,i.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=e.coerce(s.coerce,i.coerce),s.validate=e.validate(s.validate,i.validate);const d=Object.assign({},i.rules);if(s.rules)for(const v in s.rules){const c=s.rules[v];o(typeof c=="object","Invalid rule definition for",s.type,v);let h=c.method;if(h===void 0&&(h=function(){return this.$_addRule(v)}),h&&(o(!t[v],"Rule conflict in",s.type,v),t[v]=h),o(!d[v],"Rule conflict in",s.type,v),d[v]=c,c.alias){const b=[].concat(c.alias);for(const x of b)t[x]=c.method}c.args&&(c.argsByName=new Map,c.args=c.args.map(b=>(typeof b=="string"&&(b={name:b}),o(!c.argsByName.has(b.name),"Duplicated argument name",b.name),m.isSchema(b.assert)&&(b.assert=b.assert.strict().label(b.name)),c.argsByName.set(b.name,b),b)))}s.rules=d;const y=Object.assign({},i.modifiers);if(s.modifiers)for(const v in s.modifiers){o(!t[v],"Rule conflict in",s.type,v);const c=s.modifiers[v];o(typeof c=="function","Invalid modifier definition for",s.type,v);const h=function(b){return this.rule({[v]:b})};t[v]=h,y[v]=c}if(s.modifiers=y,s.overrides){t._super=r,l.$_super={};for(const v in s.overrides)o(r[v],"Cannot override missing",v),s.overrides[v][m.symbols.parent]=r[v],l.$_super[v]=r[v].bind(l);Object.assign(t,s.overrides)}s.cast=Object.assign({},i.cast,s.cast);const _=Object.assign({},i.manifest,s.manifest);return _.build=e.build(s.manifest&&s.manifest.build,i.manifest&&i.manifest.build),s.manifest=_,s.rebuild=e.rebuild(s.rebuild,i.rebuild),l},e.build=function(a,n){return a&&n?function(r,t){return n(a(r,t),t)}:a||n},e.coerce=function(a,n){return a&&n?{from:a.from&&n.from?[...new Set([...a.from,...n.from])]:null,method(r,t){let l;if((!n.from||n.from.includes(typeof r))&&(l=n.method(r,t),l)){if(l.errors||l.value===void 0)return l;r=l.value}if(!a.from||a.from.includes(typeof r)){const s=a.method(r,t);if(s)return s}return l}}:a||n},e.prepare=function(a,n){return a&&n?function(r,t){const l=a(r,t);if(l){if(l.errors||l.value===void 0)return l;r=l.value}return n(r,t)||l}:a||n},e.rebuild=function(a,n){return a&&n?function(r){n(r),a(r)}:a||n},e.validate=function(a,n){return a&&n?function(r,t){const l=n(r,t);if(l){if(l.errors&&(!Array.isArray(l.errors)||l.errors.length))return l;r=l.value}return a(r,t)||l}:a||n}},5107:(j,w,p)=>{const o=p(375),g=p(8571),m=p(8652),f=p(8160),e=p(3292),a=p(6354),n=p(8901),r=p(9708),t=p(6133),l=p(3328),s=p(1152);let i;const u={types:{alternatives:p(4946),any:p(8068),array:p(546),boolean:p(4937),date:p(7500),function:p(390),link:p(8785),number:p(3832),object:p(8966),string:p(7417),symbol:p(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const d={_types:new Set(Object.keys(u.types))};for(const y of d._types)d[y]=function(..._){return o(!_.length||["alternatives","link","object"].includes(y),"The",y,"type does not allow arguments"),u.generate(this,u.types[y],_)};for(const y of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])d[y]=function(..._){return this.any()[y](..._)};Object.assign(d,u.methods);for(const y in u.aliases){const _=u.aliases[y];d[y]=d[_]}return d.x=d.expression,s.setup&&s.setup(d),d}};u.methods={ValidationError:a.ValidationError,version:f.version,cache:m.provider,assert(d,y,..._){u.assert(d,y,!0,_)},attempt:(d,y,..._)=>u.assert(d,y,!1,_),build(d){return o(typeof r.build=="function","Manifest functionality disabled"),r.build(this,d)},checkPreferences(d){f.checkPreferences(d)},compile(d,y){return e.compile(this,d,y)},defaults(d){o(typeof d=="function","modifier must be a function");const y=Object.assign({},this);for(const _ of y._types){const v=d(y[_]());o(f.isSchema(v),"modifier must return a valid schema object"),y[_]=function(...c){return u.generate(this,v,c)}}return y},expression:(...d)=>new l(...d),extend(...d){f.verifyFlat(d,"extend"),i=i||p(3378),o(d.length,"You need to provide at least one extension"),this.assert(d,i.extensions);const y=Object.assign({},this);y._types=new Set(y._types);for(let _ of d){typeof _=="function"&&(_=_(y)),this.assert(_,i.extension);const v=u.expandExtension(_,y);for(const c of v){o(y[c.type]===void 0||y._types.has(c.type),"Cannot override name",c.type);const h=c.base||this.any(),b=n.type(h,c);y._types.add(c.type),y[c.type]=function(...x){return u.generate(this,b,x)}}}return y},isError:a.ValidationError.isError,isExpression:l.isTemplate,isRef:t.isRef,isSchema:f.isSchema,in:(...d)=>t.in(...d),override:f.symbols.override,ref:(...d)=>t.create(...d),types(){const d={};for(const y of this._types)d[y]=this[y]();for(const y in u.aliases)d[y]=this[y]();return d}},u.assert=function(d,y,_,v){const c=v[0]instanceof Error||typeof v[0]=="string"?v[0]:null,h=c!==null?v[1]:v[0],b=y.validate(d,f.preferences({errors:{stack:!0}},h||{}));let x=b.error;if(!x)return b.value;if(c instanceof Error)throw c;const S=_&&typeof x.annotate=="function"?x.annotate():x.message;throw x instanceof a.ValidationError==0&&(x=g(x)),x.message=c?`${c} ${S}`:S,x},u.generate=function(d,y,_){return o(d,"Must be invoked on a Joi instance."),y.$_root=d,y._definition.args&&_.length?y._definition.args(y,..._):y},u.expandExtension=function(d,y){if(typeof d.type=="string")return[d];const _=[];for(const v of y._types)if(d.type.test(v)){const c=Object.assign({},d);c.type=v,c.base=y[v](),_.push(c)}return _},j.exports=u.root()},6914:(j,w,p)=>{const o=p(375),g=p(8571),m=p(3328);w.compile=function(f,e){if(typeof f=="string")return o(!e,"Cannot set single message string"),new m(f);if(m.isTemplate(f))return o(!e,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),e=e?g(e):{};for(let a in f){const n=f[a];if(a==="root"||m.isTemplate(n)){e[a]=n;continue}if(typeof n=="string"){e[a]=new m(n);continue}o(typeof n=="object"&&!Array.isArray(n),"Invalid message for",a);const r=a;for(a in e[r]=e[r]||{},n){const t=n[a];a==="root"||m.isTemplate(t)?e[r][a]=t:(o(typeof t=="string","Invalid message for",a,"in",r),e[r][a]=new m(t))}}return e},w.decompile=function(f){const e={};for(let a in f){const n=f[a];if(a==="root"){e.root=n;continue}if(m.isTemplate(n)){e[a]=n.describe({compact:!0});continue}const r=a;for(a in e[r]={},n){const t=n[a];a!=="root"?e[r][a]=t.describe({compact:!0}):e[r].root=t}}return e},w.merge=function(f,e){if(!f)return w.compile(e);if(!e)return f;if(typeof e=="string")return new m(e);if(m.isTemplate(e))return e;const a=g(f);for(let n in e){const r=e[n];if(n==="root"||m.isTemplate(r)){a[n]=r;continue}if(typeof r=="string"){a[n]=new m(r);continue}o(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);const t=n;for(n in a[t]=a[t]||{},r){const l=r[n];n==="root"||m.isTemplate(l)?a[t][n]=l:(o(typeof l=="string","Invalid message for",n,"in",t),a[t][n]=new m(l))}}return a}},2294:(j,w,p)=>{const o=p(375),g=p(8160),m=p(6133),f={};w.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new f.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[a,n]of e._byId.entries())o(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,n);for(const[a,n]of e._byKey.entries())o(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,n)}fork(e,a,n){const r=this._collect(e);r.push({schema:n});const t=r.shift();let l={id:t.id,schema:a(t.schema)};o(g.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const s of r)l={id:s.id,schema:f.fork(s.schema,l.id,l.schema)};return l.schema}labels(e,a=[]){const n=e[0],r=this._get(n);if(!r)return[...a,...e].join(".");const t=e.slice(1);return a=[...a,r.schema._flags.label||n],t.length?r.schema._ids.labels(t,a):a.join(".")}reach(e,a=[]){const n=e[0],r=this._get(n);o(r,"Schema does not contain path",[...a,...e].join("."));const t=e.slice(1);return t.length?r.schema._ids.reach(t,[...a,n]):r.schema}register(e,{key:a}={}){if(!e||!g.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const n=e._flags.id;if(n){const r=this._byId.get(n);o(!r||r.schema===e,"Cannot add different schemas with the same id:",n),o(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:e,id:n})}a&&(o(!this._byKey.has(a),"Schema already contains key:",a),o(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:e,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,a=[],n=[]){const r=e[0],t=this._get(r);o(t,"Schema does not contain path",[...a,...e].join(".")),n=[t,...n];const l=e.slice(1);return l.length?t.schema._ids._collect(l,[...a,r],n):n}_get(e){return this._byId.get(e)||this._byKey.get(e)}},f.fork=function(e,a,n){const r=w.schema(e,{each:(t,{key:l})=>{if(a===(t._flags.id||l))return n},ref:!1});return r?r.$_mutateRebuild():e},w.schema=function(e,a){let n;for(const r in e._flags){if(r[0]==="_")continue;const t=f.scan(e._flags[r],{source:"flags",name:r},a);t!==void 0&&(n=n||e.clone(),n._flags[r]=t)}for(let r=0;r<e._rules.length;++r){const t=e._rules[r],l=f.scan(t.args,{source:"rules",name:t.name},a);if(l!==void 0){n=n||e.clone();const s=Object.assign({},t);s.args=l,n._rules[r]=s,n._singleRules.get(t.name)===t&&n._singleRules.set(t.name,s)}}for(const r in e.$_terms){if(r[0]==="_")continue;const t=f.scan(e.$_terms[r],{source:"terms",name:r},a);t!==void 0&&(n=n||e.clone(),n.$_terms[r]=t)}return n},f.scan=function(e,a,n,r,t){const l=r||[];if(e===null||typeof e!="object")return;let s;if(Array.isArray(e)){for(let i=0;i<e.length;++i){const u=a.source==="terms"&&a.name==="keys"&&e[i].key,d=f.scan(e[i],a,n,[i,...l],u);d!==void 0&&(s=s||e.slice(),s[i]=d)}return s}if(n.schema!==!1&&g.isSchema(e)||n.ref!==!1&&m.isRef(e)){const i=n.each(e,{...a,path:l,key:t});return i===e?void 0:i}for(const i in e){if(i[0]==="_")continue;const u=f.scan(e[i],a,n,[i,...l],t);u!==void 0&&(s=s||Object.assign({},e),s[i]=u)}return s}},6133:(j,w,p)=>{const o=p(375),g=p(8571),m=p(9621),f=p(8160);let e;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};w.create=function(n,r={}){o(typeof n=="string","Invalid reference key:",n),f.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const t=Object.assign({},a.defaults,r);delete t.prefix;const l=t.separator,s=a.context(n,l,r.prefix);if(t.type=s.type,n=s.key,t.type==="value")if(s.root&&(o(!l||n[0]!==l,"Cannot specify relative path with root prefix"),t.ancestor="root",n||(n=null)),l&&l===n)n=null,t.ancestor=0;else if(t.ancestor!==void 0)o(!l||!n||n[0]!==l,"Cannot combine prefix with ancestor option");else{const[i,u]=a.ancestor(n,l);u&&(n=n.slice(u))===""&&(n=null),t.ancestor=i}return t.path=l?n===null?[]:n.split(l):[n],new a.Ref(t)},w.in=function(n,r={}){return w.create(n,{...r,in:!0})},w.isRef=function(n){return!!n&&!!n[f.symbols.ref]},a.Ref=class{constructor(n){o(typeof n=="object","Invalid reference construction"),f.assertOptions(n,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(n.separator)||typeof n.separator=="string"&&n.separator.length===1,"Invalid separator"),o(!n.adjust||typeof n.adjust=="function","options.adjust must be a function"),o(!n.map||Array.isArray(n.map),"options.map must be an array"),o(!n.map||!n.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,n),o(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(n,r,t,l,s={}){return o(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(t.context,r,s):this.type==="local"?this._resolve(l,r,s):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,s):(o(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,s)):this._resolve(n,r,s)}_resolve(n,r,t){let l;if(this.type==="value"&&r.mainstay.shadow&&t.shadow!==!1&&(l=r.mainstay.shadow.get(this.absolute(r))),l===void 0&&(l=m(n,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(l=this.adjust(l)),this.map){const s=this.map.get(l);s!==void 0&&(l=s)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,l),l}toString(){return this.display}absolute(n){return[...n.path.slice(0,-this.ancestor),...this.path]}clone(){return new a.Ref(this)}describe(){const n={path:this.path};this.type!=="value"&&(n.type=this.type),this.separator!=="."&&(n.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(n.ancestor=this.ancestor),this.map&&(n.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(n[r]=this[r]);return this.in!==!1&&(n.in=!0),{ref:n}}updateDisplay(){const n=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${n}`);if(!this.separator)return void(this.display=`ref:${n}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${n}`);if(this.ancestor==="root")return void(this.display=`ref:root:${n}`);if(this.ancestor===1)return void(this.display=`ref:${n||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${n||""}`}},a.Ref.prototype[f.symbols.ref]=!0,w.build=function(n){return(n=Object.assign({},a.defaults,n)).type==="value"&&n.ancestor===void 0&&(n.ancestor=1),new a.Ref(n)},a.context=function(n,r,t={}){if(n=n.trim(),t){const l=t.global===void 0?"$":t.global;if(l!==r&&n.startsWith(l))return{key:n.slice(l.length),type:"global"};const s=t.local===void 0?"#":t.local;if(s!==r&&n.startsWith(s))return{key:n.slice(s.length),type:"local"};const i=t.root===void 0?"/":t.root;if(i!==r&&n.startsWith(i))return{key:n.slice(i.length),type:"value",root:!0}}return{key:n,type:"value"}},a.ancestor=function(n,r){if(!r)return[1,0];if(n[0]!==r)return[1,0];if(n[1]!==r)return[0,1];let t=2;for(;n[t]===r;)++t;return[t-1,t]},w.toSibling=0,w.toParent=1,w.Manager=class{constructor(){this.refs=[]}register(n,r){if(n)if(r=r===void 0?w.toParent:r,Array.isArray(n))for(const t of n)this.register(t,r);else if(f.isSchema(n))for(const t of n._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else w.isRef(n)&&n.type==="value"&&n.ancestor-r>=0&&this.refs.push({ancestor:n.ancestor-r,root:n.root}),e=e||p(3328),e.isTemplate(n)&&this.register(n.refs(),r)}get length(){return this.refs.length}clone(){const n=new w.Manager;return n.refs=g(this.refs),n}reset(){this.refs=[]}roots(){return this.refs.filter(n=>!n.ancestor).map(n=>n.root)}}},3378:(j,w,p)=>{const o=p(5107),g={};g.wrap=o.string().min(1).max(2).allow(!1),w.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:g.wrap,array:g.wrap,string:g.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),g.nameRx=/^[a-zA-Z0-9]\w*$/,g.rule=o.object({alias:o.array().items(o.string().pattern(g.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(g.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),w.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(g.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(g.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(g.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(g.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(g.nameRx,g.rule),terms:o.object().pattern(g.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),w.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),g.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},g.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),g.desc.buffer,g.desc.func,g.desc.ref,g.desc.regex,g.desc.special,g.desc.template,g.desc.value,o.link("/")]),g.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.symbol(),g.desc.buffer,g.desc.func,g.desc.override,g.desc.ref,g.desc.regex,g.desc.template,g.desc.value),g.desc.messages=o.object().pattern(/.+/,[o.string(),g.desc.template,o.object().pattern(/.+/,[o.string(),g.desc.template])]),w.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:g.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),g.desc.ref],wrap:{label:g.wrap,array:g.wrap}},externals:o.boolean(),messages:g.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:g.desc.values,invalid:g.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),g.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:g.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(j,w,p)=>{const o=p(8571),g=p(9621),m=p(8160),f={value:Symbol("value")};j.exports=f.State=class{constructor(e,a,n){this.path=e,this.ancestors=a,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(e,a=null,n=null){const r=new f.State(e,a,this);return n&&r.schemas&&(r.schemas=[f.schemas(n),...r.schemas]),r}nest(e,a){const n=new f.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[f.schemas(e),...n.schemas],n.debug=a,n}shadow(e,a){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,e,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(e){return m.isSchema(e)?{schema:e}:e},f.Shadow=class{constructor(){this._values=null}set(e,a,n){if(!e.length||n==="strip"&&typeof e[e.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const l=e[t];let s=r.get(l);s||(s=new Map,r.set(l,s)),r=s}r[f.value]=a}get(e){const a=this.node(e);if(a)return a[f.value]}node(e){if(this._values)return g(this._values,e,{iterables:!0})}override(e,a){if(!this._values)return;const n=e.slice(0,-1),r=e[e.length-1],t=g(this._values,n,{iterables:!0});a?t.set(r,a):t&&t.delete(r)}}},3328:(j,w,p)=>{const o=p(375),g=p(8571),m=p(5277),f=p(1447),e=p(8160),a=p(6354),n=p(6133),r={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};j.exports=r.Template=class{constructor(t,l){if(o(typeof t=="string","Template source must be a string"),o(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,l){const{functions:s,...i}=l;this._settings=Object.keys(i).length?g(i):void 0,this._functions=s,this._functions&&(o(Object.keys(this._functions).every(u=>typeof u=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(u=>typeof u=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const t=r.encode(this.source),l=r.split(t);let s=!1;const i=[],u=l.shift();u&&i.push(u);for(const d of l){const y=d[0]!=="{",_=y?"}":"}}",v=d.indexOf(_);if(v===-1||d[1]==="{"){i.push(`{${r.decode(d)}`);continue}let c=d.slice(y?0:1,v);const h=c[0]===":";h&&(c=c.slice(1));const b=this._ref(r.decode(c),{raw:y,wrapped:h});i.push(b),typeof b!="string"&&(s=!0);const x=d.slice(v+_.length);x&&i.push(r.decode(x))}s?this._template=i:this.rendered=i.join("")}static date(t,l){return r.dateFormat[l.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;const l={template:this.source};return this._settings&&(l.options=this._settings),this._functions&&(l.functions=this._functions),l}static build(t){return new r.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return!!t&&!!t[e.symbols.template]}refs(){if(!this._template)return;const t=[];for(const l of this._template)typeof l!="string"&&t.push(...l.refs);return t}resolve(t,l,s,i){return this._template&&this._template.length===1?this._part(this._template[0],t,l,s,i,{}):this.render(t,l,s,i)}_part(t,...l){return t.ref?t.ref.resolve(...l):t.formula.evaluate(l)}render(t,l,s,i,u={}){if(!this.isDynamic())return this.rendered;const d=[];for(const y of this._template)if(typeof y=="string")d.push(y);else{const _=this._part(y,t,l,s,i,u),v=r.stringify(_,t,l,s,i,u);if(v!==void 0){const c=y.raw||(u.errors&&u.errors.escapeHtml)===!1?v:m(v);d.push(r.wrap(c,y.wrapped&&s.errors.wrap.label))}}return d.join("")}_ref(t,{raw:l,wrapped:s}){const i=[],u=y=>{const _=n.create(y,this._settings);return i.push(_),v=>{const c=_.resolve(...v);return c!==void 0?c:null}};try{const y=this._functions?{...r.functions,...this._functions}:r.functions;var d=new f.Parser(t,{reference:u,functions:y,constants:r.constants})}catch(y){throw y.message=`Invalid template variable "${t}" fails due to: ${y.message}`,y}if(d.single){if(d.single.type==="reference"){const y=i[0];return{ref:y,raw:l,refs:i,wrapped:s||y.type==="local"&&y.key==="label"}}return r.stringify(d.single.value)}return{formula:d,raw:l,refs:i}}toString(){return this.source}},r.Template.prototype[e.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(t){return t.replace(/\\(\{+)/g,(l,s)=>r.opens.slice(0,s.length)).replace(/\\(\}+)/g,(l,s)=>r.closes.slice(0,s.length))},r.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(t){const l=[];let s="";for(let i=0;i<t.length;++i){const u=t[i];if(u==="{"){let d="";for(;i+1<t.length&&t[i+1]==="{";)d+="{",++i;l.push(s),s=d}else s+=u}return l.push(s),l},r.wrap=function(t,l){return l?l.length===1?`${l}${t}${l}`:`${l[0]}${t}${l[1]}`:t},r.stringify=function(t,l,s,i,u,d={}){const y=typeof t,_=i&&i.errors&&i.errors.wrap||{};let v=!1;if(n.isRef(t)&&t.render&&(v=t.in,t=t.resolve(l,s,i,u,{in:t.in,...d})),t===null)return"null";if(y==="string")return r.wrap(t,d.arrayItems&&_.string);if(y==="number"||y==="function"||y==="symbol")return t.toString();if(y!=="object")return JSON.stringify(t);if(t instanceof Date)return r.Template.date(t,i);if(t instanceof Map){const h=[];for(const[b,x]of t.entries())h.push(`${b.toString()} -> ${x.toString()}`);t=h}if(!Array.isArray(t))return t.toString();const c=[];for(const h of t)c.push(r.stringify(h,l,s,i,u,{arrayItems:!0,...d}));return r.wrap(c.join(", "),!v&&_.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(t,l,s)=>t?l:s,length:t=>typeof t=="string"?t.length:t&&typeof t=="object"?Array.isArray(t)?t.length:Object.keys(t).length:null,msg(t){const[l,s,i,u,d]=this,y=d.messages;if(!y)return"";const _=a.template(l,y[0],t,s,i)||a.template(l,y[1],t,s,i);return _?_.render(l,s,i,u,d):""},number:t=>typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}},4946:(j,w,p)=>{const o=p(375),g=p(1687),m=p(8068),f=p(8160),e=p(3292),a=p(6354),n=p(6133),r={};j.exports=m.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:n.toSibling}},args:(t,...l)=>l.length===1&&Array.isArray(l[0])?t.try(...l[0]):t.try(...l),validate(t,l){const{schema:s,error:i,state:u,prefs:d}=l;if(s._flags.match){const _=[],v=[];for(let h=0;h<s.$_terms.matches.length;++h){const b=s.$_terms.matches[h],x=u.nest(b.schema,`match.${h}`);x.snapshot();const S=b.schema.$_validate(t,x,d);S.errors?(v.push(S.errors),x.restore()):(_.push(S.value),x.commit())}if(_.length===0)return{errors:i("alternatives.any",{details:v.map(h=>a.details(h,{override:!1}))})};if(s._flags.match==="one")return _.length===1?{value:_[0]}:{errors:i("alternatives.one")};if(_.length!==s.$_terms.matches.length)return{errors:i("alternatives.all",{details:v.map(h=>a.details(h,{override:!1}))})};const c=h=>h.$_terms.matches.some(b=>b.schema.type==="object"||b.schema.type==="alternatives"&&c(b.schema));return c(s)?{value:_.reduce((h,b)=>g(h,b,{mergeArrays:!1}))}:{value:_[_.length-1]}}const y=[];for(let _=0;_<s.$_terms.matches.length;++_){const v=s.$_terms.matches[_];if(v.schema){const b=u.nest(v.schema,`match.${_}`);b.snapshot();const x=v.schema.$_validate(t,b,d);if(!x.errors)return b.commit(),x;b.restore(),y.push({schema:v.schema,reports:x.errors});continue}const c=v.ref?v.ref.resolve(t,u,d):t,h=v.is?[v]:v.switch;for(let b=0;b<h.length;++b){const x=h[b],{is:S,then:R,otherwise:O}=x,A=`match.${_}${v.switch?"."+b:""}`;if(S.$_match(c,u.nest(S,`${A}.is`),d)){if(R)return R.$_validate(t,u.nest(R,`${A}.then`),d)}else if(O)return O.$_validate(t,u.nest(O,`${A}.otherwise`),d)}}return r.errors(y,l)},rules:{conditional:{method(t,l){o(!this._flags._endedSwitch,"Unreachable condition"),o(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),o(l.break===void 0,"Cannot use break option with alternatives conditional");const s=this.clone(),i=e.when(s,t,l),u=i.is?[i]:i.switch;for(const d of u)if(d.then&&d.otherwise){s.$_setFlag("_endedSwitch",!0,{clone:!1});break}return s.$_terms.matches.push(i),s.$_mutateRebuild()}},match:{method(t){if(o(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(const l of this.$_terms.matches)o(l.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){o(t.length,"Missing alternative schemas"),f.verifyFlat(t,"try"),o(!this._flags._endedSwitch,"Unreachable condition");const l=this.clone();for(const s of t)l.$_terms.matches.push({schema:l.$_compile(s)});return l.$_mutateRebuild()}}},overrides:{label(t){return this.$_parent("label",t).$_modify({each:(l,s)=>s.path[0]!=="is"&&typeof l._flags.label!="string"?l.label(t):void 0,ref:!1})}},rebuild(t){t.$_modify({each:l=>{f.isSchema(l)&&l.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(t,l){if(l.matches)for(const s of l.matches){const{schema:i,ref:u,is:d,not:y,then:_,otherwise:v}=s;t=i?t.try(i):u?t.conditional(u,{is:d,then:_,not:y,otherwise:v,switch:s.switch}):t.conditional(d,{then:_,otherwise:v})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),r.errors=function(t,{error:l,state:s}){if(!t.length)return{errors:l("alternatives.any")};if(t.length===1)return{errors:t[0].reports};const i=new Set,u=[];for(const{reports:d,schema:y}of t){if(d.length>1)return r.unmatched(t,l);const _=d[0];if(_ instanceof a.Report==0)return r.unmatched(t,l);if(_.state.path.length!==s.path.length){u.push({type:y.type,report:_});continue}if(_.code==="any.only"){for(const h of _.local.valids)i.add(h);continue}const[v,c]=_.code.split(".");c!=="base"?u.push({type:y.type,report:_}):_.code==="object.base"?i.add(_.local.type):i.add(v)}return u.length?u.length===1?{errors:u[0].report}:r.unmatched(t,l):{errors:l("alternatives.types",{types:[...i]})}},r.unmatched=function(t,l){const s=[];for(const i of t)s.push(...i.reports);return{errors:l("alternatives.match",a.details(s,{override:!1}))}}},8068:(j,w,p)=>{const o=p(375),g=p(7629),m=p(8160),f=p(6914);j.exports=g.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,a){return o(typeof e=="function","Method must be a function"),o(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:a}})},validate(e,a,{method:n}){try{return n(e,a)}catch(r){return a.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){o(m.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const a=this.clone();return a.$_terms.shared=a.$_terms.shared||[],a.$_terms.shared.push(e),a.$_mutateRegister(e),a}},warning:{method(e,a){return o(e&&typeof e=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:a},warn:!0})},validate:(e,a,{code:n,local:r})=>a.error(n,r),args:["code","local"],multi:!0}},modifiers:{keep(e,a=!0){e.keep=a},message(e,a){e.message=f.compile(a)},warn(e,a=!0){e.warn=a}},manifest:{build(e,a){for(const n in a){const r=a[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const t of r)e=e[n.slice(0,-1)](t);else if(n!=="alterations")if(n!=="whens"){if(n==="shared")for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:l,is:s,not:i,then:u,otherwise:d,concat:y}=t;e=y?e.concat(y):l?e.when(l,{is:s,not:i,then:u,otherwise:d,switch:t.switch,break:t.break}):e.when(s,{then:u,otherwise:d,break:t.break})}else{const t={};for(const{target:l,adjuster:s}of r)t[l]=s;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(j,w,p)=>{const o=p(375),g=p(9474),m=p(9621),f=p(8068),e=p(8160),a=p(3292),n={};j.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(r,{schema:t,state:l,prefs:s}){if(!Array.isArray(r))return;const i=t.$_getRule("sort");return i?n.sort(t,r,i.args.options,l,s):void 0}},validate(r,{schema:t,error:l}){if(!Array.isArray(r)){if(t._flags.single){const s=[r];return s[e.symbols.arraySingle]=!0,{value:s}}return{errors:l("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:r}});return t.$_mutateRegister(r),t},validate(r,{state:t,prefs:l,error:s},{schema:i}){const u=[r,...t.ancestors];for(let y=0;y<r.length;++y){const _=t.localize([...t.path,y],u,i);if(i.$_match(r[y],_,l))return r}const d=i._flags.label;return d?s("array.hasKnown",{patternLabel:d}):s("array.hasUnknown",null)},multi:!0},items:{method(...r){e.verifyFlat(r,"items");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});t.$_terms.items.push(s)}return t.$_mutateRebuild()},validate(r,{schema:t,error:l,state:s,prefs:i,errorsArray:u}){const d=t.$_terms._requireds.slice(),y=t.$_terms.ordered.slice(),_=[...t.$_terms._inclusions,...d],v=!r[e.symbols.arraySingle];delete r[e.symbols.arraySingle];const c=u();let h=r.length;for(let b=0;b<h;++b){const x=r[b];let S=!1,R=!1;const O=v?b:new Number(b),A=[...s.path,O];if(!t._flags.sparse&&x===void 0){if(c.push(l("array.sparse",{key:O,path:A,pos:b,value:void 0},s.localize(A))),i.abortEarly)return c;y.shift();continue}const D=[r,...s.ancestors];for(const I of t.$_terms._exclusions)if(I.$_match(x,s.localize(A,D,I),i,{presence:"ignore"})){if(c.push(l("array.excludes",{pos:b,value:x},s.localize(A))),i.abortEarly)return c;S=!0,y.shift();break}if(S)continue;if(t.$_terms.ordered.length){if(y.length){const I=y.shift(),L=I.$_validate(x,s.localize(A,D,I),i);if(L.errors){if(c.push(...L.errors),i.abortEarly)return c}else if(I._flags.result==="strip")n.fastSplice(r,b),--b,--h;else{if(!t._flags.sparse&&L.value===void 0){if(c.push(l("array.sparse",{key:O,path:A,pos:b,value:void 0},s.localize(A))),i.abortEarly)return c;continue}r[b]=L.value}continue}if(!t.$_terms.items.length){if(c.push(l("array.orderedLength",{pos:b,limit:t.$_terms.ordered.length})),i.abortEarly)return c;break}}const M=[];let F=d.length;for(let I=0;I<F;++I){const L=s.localize(A,D,d[I]);L.snapshot();const N=d[I].$_validate(x,L,i);if(M[I]=N,!N.errors){if(L.commit(),r[b]=N.value,R=!0,n.fastSplice(d,I),--I,--F,!t._flags.sparse&&N.value===void 0&&(c.push(l("array.sparse",{key:O,path:A,pos:b,value:void 0},s.localize(A))),i.abortEarly))return c;break}L.restore()}if(R)continue;const E=i.stripUnknown&&!!i.stripUnknown.arrays||!1;F=_.length;for(const I of _){let L;const N=d.indexOf(I);if(N!==-1)L=M[N];else{const B=s.localize(A,D,I);if(B.snapshot(),L=I.$_validate(x,B,i),!L.errors){B.commit(),I._flags.result==="strip"?(n.fastSplice(r,b),--b,--h):t._flags.sparse||L.value!==void 0?r[b]=L.value:(c.push(l("array.sparse",{key:O,path:A,pos:b,value:void 0},s.localize(A))),S=!0),R=!0;break}B.restore()}if(F===1){if(E){n.fastSplice(r,b),--b,--h,R=!0;break}if(c.push(...L.errors),i.abortEarly)return c;S=!0;break}}if(!S&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!R){if(E){n.fastSplice(r,b),--b,--h;continue}if(c.push(l("array.includes",{pos:b,value:x},s.localize(A))),i.abortEarly)return c}}return d.length&&n.fillMissedErrors(t,c,d,r,s,i),y.length&&(n.fillOrderedErrors(t,c,y,r,s,i),c.length||n.fillDefault(y,r,s,i)),c.length?c:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,t,{limit:l},{name:s,operator:i,args:u})=>e.compare(r.length,l,i)?r:t.error("array."+s,{limit:u.limit,value:r}),args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"}]},max:{method(r){return this.$_addRule({name:"max",method:"length",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"length",args:{limit:r},operator:">="})}},ordered:{method(...r){e.verifyFlat(r,"ordered");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});n.validateSingle(s,t),t.$_mutateRegister(s),t.$_terms.ordered.push(s)}return t.$_mutateRebuild()}},single:{method(r){const t=r===void 0||!!r;return o(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(r={}){e.assertOptions(r,["by","order"]);const t={order:r.order||"ascending"};return r.by&&(t.by=a.ref(r.by,{ancestor:0}),o(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(r,{error:t,state:l,prefs:s,schema:i},{options:u}){const{value:d,errors:y}=n.sort(i,r,u,l,s);if(y)return y;for(let _=0;_<r.length;++_)if(r[_]!==d[_])return t("array.sort",{order:u.order,by:u.by?u.by.key:"value"});return r},convert:!0},sparse:{method(r){const t=r===void 0||!!r;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(r,t={}){o(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),e.assertOptions(t,["ignoreUndefined","separator"]);const l={name:"unique",args:{options:t,comparator:r}};if(r)if(typeof r=="string"){const s=e.default(t.separator,".");l.path=s?r.split(s):[r]}else l.comparator=r;return this.$_addRule(l)},validate(r,{state:t,error:l,schema:s},{comparator:i,options:u},{comparator:d,path:y}){const _={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},v=d||g,c=u.ignoreUndefined;for(let h=0;h<r.length;++h){const b=y?m(r[h],y):r[h],x=d?_.custom:_[typeof b];if(o(x,"Failed to find unique map container for type",typeof b),x instanceof Map){const S=x.entries();let R;for(;!(R=S.next()).done;)if(v(R.value[0],b)){const O=t.localize([...t.path,h],[r,...t.ancestors]),A={pos:h,value:r[h],dupePos:R.value[1],dupeValue:r[R.value[1]]};return y&&(A.path=i),l("array.unique",A,O)}x.set(b,h)}else{if((!c||b!==void 0)&&x[b]!==void 0){const S={pos:h,value:r[h],dupePos:x[b],dupeValue:r[x[b]]};return y&&(S.path=i),l("array.unique",S,t.localize([...t.path,h],[r,...t.ancestors]))}x[b]=h}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,t)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const t of r.$_terms.items)n.validateSingle(t,r),t._flags.presence==="required"?r.$_terms._requireds.push(t):t._flags.presence==="forbidden"?r.$_terms._exclusions.push(t):r.$_terms._inclusions.push(t);for(const t of r.$_terms.ordered)n.validateSingle(t,r)},manifest:{build:(r,t)=>(t.items&&(r=r.items(...t.items)),t.ordered&&(r=r.ordered(...t.ordered)),r)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),n.fillMissedErrors=function(r,t,l,s,i,u){const d=[];let y=0;for(const _ of l){const v=_._flags.label;v?d.push(v):++y}d.length?y?t.push(r.$_createError("array.includesRequiredBoth",s,{knownMisses:d,unknownMisses:y},i,u)):t.push(r.$_createError("array.includesRequiredKnowns",s,{knownMisses:d},i,u)):t.push(r.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:y},i,u))},n.fillOrderedErrors=function(r,t,l,s,i,u){const d=[];for(const y of l)y._flags.presence==="required"&&d.push(y);d.length&&n.fillMissedErrors(r,t,d,s,i,u)},n.fillDefault=function(r,t,l,s){const i=[];let u=!0;for(let d=r.length-1;d>=0;--d){const y=r[d],_=[t,...l.ancestors],v=y.$_validate(void 0,l.localize(l.path,_,y),s).value;if(u){if(v===void 0)continue;u=!1}i.unshift(v)}i.length&&t.push(...i)},n.fastSplice=function(r,t){let l=t;for(;l<r.length;)r[l++]=r[l];--r.length},n.validateSingle=function(r,t){(r.type==="array"||r._flags._arrayItems)&&(o(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},n.sort=function(r,t,l,s,i){const u=l.order==="ascending"?1:-1,d=-1*u,y=u,_=(v,c)=>{let h=n.compare(v,c,d,y);if(h!==null||(l.by&&(v=l.by.resolve(v,s,i),c=l.by.resolve(c,s,i)),h=n.compare(v,c,d,y),h!==null))return h;const b=typeof v;if(b!==typeof c)throw r.$_createError("array.sort.mismatching",t,null,s,i);if(b!=="number"&&b!=="string")throw r.$_createError("array.sort.unsupported",t,{type:b},s,i);return b==="number"?(v-c)*u:v<c?d:y};try{return{value:t.slice().sort(_)}}catch(v){return{errors:v}}},n.compare=function(r,t,l,s){return r===t?0:r===void 0?1:t===void 0?-1:r===null?s:t===null?l:null}},4937:(j,w,p)=>{const o=p(375),g=p(8068),m=p(8160),f=p(2036),e={isBool:function(a){return typeof a=="boolean"}};j.exports=g.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(a,{schema:n}){if(typeof a!="boolean"){if(typeof a=="string"){const r=n._flags.sensitive?a:a.toLowerCase();a=r==="true"||r!=="false"&&a}return typeof a!="boolean"&&(a=n.$_terms.truthy&&n.$_terms.truthy.has(a,null,null,!n._flags.sensitive)||(!n.$_terms.falsy||!n.$_terms.falsy.has(a,null,null,!n._flags.sensitive))&&a),{value:a}}},validate(a,{error:n}){if(typeof a!="boolean")return{value:a,errors:n("boolean.base")}},rules:{truthy:{method(...a){m.verifyFlat(a,"truthy");const n=this.clone();n.$_terms.truthy=n.$_terms.truthy||new f;for(let r=0;r<a.length;++r){const t=a[r];o(t!==void 0,"Cannot call truthy with undefined"),n.$_terms.truthy.add(t)}return n}},falsy:{method(...a){m.verifyFlat(a,"falsy");const n=this.clone();n.$_terms.falsy=n.$_terms.falsy||new f;for(let r=0;r<a.length;++r){const t=a[r];o(t!==void 0,"Cannot call falsy with undefined"),n.$_terms.falsy.add(t)}return n}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:e.isBool,to:(a,n)=>a?1:0},string:{from:e.isBool,to:(a,n)=>a?"true":"false"}},manifest:{build:(a,n)=>(n.truthy&&(a=a.truthy(...n.truthy)),n.falsy&&(a=a.falsy(...n.falsy)),a)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(j,w,p)=>{const o=p(375),g=p(8068),m=p(8160),f=p(3328),e={isDate:function(a){return a instanceof Date}};j.exports=g.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:n})=>({value:e.parse(a,n._flags.format)||a})},validate(a,{schema:n,error:r,prefs:t}){if(a instanceof Date&&!isNaN(a.getTime()))return;const l=n._flags.format;return t.convert&&l&&typeof a=="string"?{value:a,errors:r("date.format",{format:l})}:{value:a,errors:r("date.base")}},rules:{compare:{method:!1,validate(a,n,{date:r},{name:t,operator:l,args:s}){const i=r==="now"?Date.now():r.getTime();return m.compare(a.getTime(),i,l)?a:n.error("date."+t,{limit:s.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:e.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return o(["iso","javascript","unix"].includes(a),"Unknown date format",a),this.$_setFlag("format",a)}},greater:{method(a){return this.$_addRule({name:"greater",method:"compare",args:{date:a},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(a){return this.$_addRule({name:"less",method:"compare",args:{date:a},operator:"<"})}},max:{method(a){return this.$_addRule({name:"max",method:"compare",args:{date:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"compare",args:{date:a},operator:">="})}},timestamp:{method(a="javascript"){return o(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:e.isDate,to:(a,n)=>a.getTime()},string:{from:e.isDate,to:(a,{prefs:n})=>f.date(a,n)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),e.parse=function(a,n){if(a instanceof Date)return a;if(typeof a!="string"&&(isNaN(a)||!isFinite(a))||/^\s*$/.test(a))return null;if(n==="iso")return m.isIsoDate(a)?e.date(a.toString()):null;const r=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),n){if(n==="javascript")return e.date(1*a);if(n==="unix")return e.date(1e3*a);if(typeof r=="string")return null}return e.date(a)},e.date=function(a){const n=new Date(a);return isNaN(n.getTime())?null:n}},390:(j,w,p)=>{const o=p(375),g=p(7824);j.exports=g.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(m){return o(Number.isSafeInteger(m)&&m>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:m}})},validate:(m,f,{n:e})=>m.length===e?m:f.error("function.arity",{n:e})},class:{method(){return this.$_addRule("class")},validate:(m,f)=>/^\s*class\s/.test(m.toString())?m:f.error("function.class",{value:m})},minArity:{method(m){return o(Number.isSafeInteger(m)&&m>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:m}})},validate:(m,f,{n:e})=>m.length>=e?m:f.error("function.minArity",{n:e})},maxArity:{method(m){return o(Number.isSafeInteger(m)&&m>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:m}})},validate:(m,f,{n:e})=>m.length<=e?m:f.error("function.maxArity",{n:e})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(j,w,p)=>{const o=p(978),g=p(375),m=p(8571),f=p(3652),e=p(8068),a=p(8160),n=p(3292),r=p(6354),t=p(6133),l=p(3328),s={renameDefaults:{alias:!1,multiple:!1,override:!1}};j.exports=e.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(i,u)=>i.keys(u),validate(i,{schema:u,error:d,state:y,prefs:_}){if(!i||typeof i!==u.$_property("typeof")||Array.isArray(i))return{value:i,errors:d("object.base",{type:u.$_property("typeof")})};if(!(u.$_terms.renames||u.$_terms.dependencies||u.$_terms.keys||u.$_terms.patterns||u.$_terms.externals))return;i=s.clone(i,_);const v=[];if(u.$_terms.renames&&!s.rename(u,i,y,_,v))return{value:i,errors:v};if(!u.$_terms.keys&&!u.$_terms.patterns&&!u.$_terms.dependencies)return{value:i,errors:v};const c=new Set(Object.keys(i));if(u.$_terms.keys){const h=[i,...y.ancestors];for(const b of u.$_terms.keys){const x=b.key,S=i[x];c.delete(x);const R=y.localize([...y.path,x],h,b),O=b.schema.$_validate(S,R,_);if(O.errors){if(_.abortEarly)return{value:i,errors:O.errors};O.value!==void 0&&(i[x]=O.value),v.push(...O.errors)}else b.schema._flags.result==="strip"||O.value===void 0&&S!==void 0?delete i[x]:O.value!==void 0&&(i[x]=O.value)}}if(c.size||u._flags._hasPatternMatch){const h=s.unknown(u,i,c,v,y,_);if(h)return h}if(u.$_terms.dependencies)for(const h of u.$_terms.dependencies){if(h.key!==null&&s.isPresent(h.options)(h.key.resolve(i,y,_,null,{shadow:!1}))===!1)continue;const b=s.dependencies[h.rel](u,h,i,y,_);if(b){const x=u.$_createError(b.code,i,b.context,y,_);if(_.abortEarly)return{value:i,errors:x};v.push(x)}}return{value:i,errors:v}},rules:{and:{method(...i){return a.verifyFlat(i,"and"),s.dependency(this,"and",null,i)}},append:{method(i){return i==null||Object.keys(i).length===0?this:this.keys(i)}},assert:{method(i,u,d){l.isTemplate(i)||(i=n.ref(i)),g(d===void 0||typeof d=="string","Message must be a string"),u=this.$_compile(u,{appendPath:!0});const y=this.$_addRule({name:"assert",args:{subject:i,schema:u,message:d}});return y.$_mutateRegister(i),y.$_mutateRegister(u),y},validate(i,{error:u,prefs:d,state:y},{subject:_,schema:v,message:c}){const h=_.resolve(i,y,d),b=t.isRef(_)?_.absolute(y):[];return v.$_match(h,y.localize(b,[i,...y.ancestors],v),d)?i:u("object.assert",{subject:_,message:c})},args:["subject","schema","message"],multi:!0},instance:{method(i,u){return g(typeof i=="function","constructor must be a function"),u=u||i.name,this.$_addRule({name:"instance",args:{constructor:i,name:u}})},validate:(i,u,{constructor:d,name:y})=>i instanceof d?i:u.error("object.instance",{type:y,value:i}),args:["constructor","name"]},keys:{method(i){g(i===void 0||typeof i=="object","Object schema must be a valid object"),g(!a.isSchema(i),"Object schema cannot be a joi schema");const u=this.clone();if(i)if(Object.keys(i).length){u.$_terms.keys=u.$_terms.keys?u.$_terms.keys.filter(d=>!i.hasOwnProperty(d.key)):new s.Keys;for(const d in i)a.tryWithPath(()=>u.$_terms.keys.push({key:d,schema:this.$_compile(i[d])}),d)}else u.$_terms.keys=new s.Keys;else u.$_terms.keys=null;return u.$_mutateRebuild()}},length:{method(i){return this.$_addRule({name:"length",args:{limit:i},operator:"="})},validate:(i,u,{limit:d},{name:y,operator:_,args:v})=>a.compare(Object.keys(i).length,d,_)?i:u.error("object."+y,{limit:v.limit,value:i}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(i){return this.$_addRule({name:"max",method:"length",args:{limit:i},operator:"<="})}},min:{method(i){return this.$_addRule({name:"min",method:"length",args:{limit:i},operator:">="})}},nand:{method(...i){return a.verifyFlat(i,"nand"),s.dependency(this,"nand",null,i)}},or:{method(...i){return a.verifyFlat(i,"or"),s.dependency(this,"or",null,i)}},oxor:{method(...i){return s.dependency(this,"oxor",null,i)}},pattern:{method(i,u,d={}){const y=i instanceof RegExp;y||(i=this.$_compile(i,{appendPath:!0})),g(u!==void 0,"Invalid rule"),a.assertOptions(d,["fallthrough","matches"]),y&&g(!i.flags.includes("g")&&!i.flags.includes("y"),"pattern should not use global or sticky mode"),u=this.$_compile(u,{appendPath:!0});const _=this.clone();_.$_terms.patterns=_.$_terms.patterns||[];const v={[y?"regex":"schema"]:i,rule:u};return d.matches&&(v.matches=this.$_compile(d.matches),v.matches.type!=="array"&&(v.matches=v.matches.$_root.array().items(v.matches)),_.$_mutateRegister(v.matches),_.$_setFlag("_hasPatternMatch",!0,{clone:!1})),d.fallthrough&&(v.fallthrough=!0),_.$_terms.patterns.push(v),_.$_mutateRegister(u),_}},ref:{method(){return this.$_addRule("ref")},validate:(i,u)=>t.isRef(i)?i:u.error("object.refType",{value:i})},regex:{method(){return this.$_addRule("regex")},validate:(i,u)=>i instanceof RegExp?i:u.error("object.regex",{value:i})},rename:{method(i,u,d={}){g(typeof i=="string"||i instanceof RegExp,"Rename missing the from argument"),g(typeof u=="string"||u instanceof l,"Invalid rename to argument"),g(u!==i,"Cannot rename key to same name:",i),a.assertOptions(d,["alias","ignoreUndefined","override","multiple"]);const y=this.clone();y.$_terms.renames=y.$_terms.renames||[];for(const _ of y.$_terms.renames)g(_.from!==i,"Cannot rename the same key multiple times");return u instanceof l&&y.$_mutateRegister(u),y.$_terms.renames.push({from:i,to:u,options:o(s.renameDefaults,d)}),y}},schema:{method(i="any"){return this.$_addRule({name:"schema",args:{type:i}})},validate:(i,u,{type:d})=>!a.isSchema(i)||d!=="any"&&i.type!==d?u.error("object.schema",{type:d}):i},unknown:{method(i){return this.$_setFlag("unknown",i!==!1)}},with:{method(i,u,d={}){return s.dependency(this,"with",i,u,d)}},without:{method(i,u,d={}){return s.dependency(this,"without",i,u,d)}},xor:{method(...i){return a.verifyFlat(i,"xor"),s.dependency(this,"xor",null,i)}}},overrides:{default(i,u){return i===void 0&&(i=a.symbols.deepDefault),this.$_parent("default",i,u)}},rebuild(i){if(i.$_terms.keys){const u=new f.Sorter;for(const d of i.$_terms.keys)a.tryWithPath(()=>u.add(d,{after:d.schema.$_rootReferences(),group:d.key}),d.key);i.$_terms.keys=new s.Keys(...u.nodes)}},manifest:{build(i,u){if(u.keys&&(i=i.keys(u.keys)),u.dependencies)for(const{rel:d,key:y=null,peers:_,options:v}of u.dependencies)i=s.dependency(i,d,y,_,v);if(u.patterns)for(const{regex:d,schema:y,rule:_,fallthrough:v,matches:c}of u.patterns)i=i.pattern(d||y,_,{fallthrough:v,matches:c});if(u.renames)for(const{from:d,to:y,options:_}of u.renames)i=i.rename(d,y,_);return i}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),s.clone=function(i,u){if(typeof i=="object"){if(u.nonEnumerables)return m(i,{shallow:!0});const y=Object.create(Object.getPrototypeOf(i));return Object.assign(y,i),y}const d=function(...y){return i.apply(this,y)};return d.prototype=m(i.prototype),Object.defineProperty(d,"name",{value:i.name,writable:!1}),Object.defineProperty(d,"length",{value:i.length,writable:!1}),Object.assign(d,i),d},s.dependency=function(i,u,d,y,_){g(d===null||typeof d=="string",u,"key must be a strings"),_||(_=y.length>1&&typeof y[y.length-1]=="object"?y.pop():{}),a.assertOptions(_,["separator","isPresent"]),y=[].concat(y);const v=a.default(_.separator,"."),c=[];for(const b of y)g(typeof b=="string",u,"peers must be strings"),c.push(n.ref(b,{separator:v,ancestor:0,prefix:!1}));d!==null&&(d=n.ref(d,{separator:v,ancestor:0,prefix:!1}));const h=i.clone();return h.$_terms.dependencies=h.$_terms.dependencies||[],h.$_terms.dependencies.push(new s.Dependency(u,d,c,y,_)),h},s.dependencies={and(i,u,d,y,_){const v=[],c=[],h=u.peers.length,b=s.isPresent(u.options);for(const x of u.peers)b(x.resolve(d,y,_,null,{shadow:!1}))===!1?v.push(x.key):c.push(x.key);if(v.length!==h&&c.length!==h)return{code:"object.and",context:{present:c,presentWithLabels:s.keysToLabels(i,c),missing:v,missingWithLabels:s.keysToLabels(i,v)}}},nand(i,u,d,y,_){const v=[],c=s.isPresent(u.options);for(const x of u.peers)c(x.resolve(d,y,_,null,{shadow:!1}))&&v.push(x.key);if(v.length!==u.peers.length)return;const h=u.paths[0],b=u.paths.slice(1);return{code:"object.nand",context:{main:h,mainWithLabel:s.keysToLabels(i,h),peers:b,peersWithLabels:s.keysToLabels(i,b)}}},or(i,u,d,y,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,y,_,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)}}},oxor(i,u,d,y,_){const v=[],c=s.isPresent(u.options);for(const b of u.peers)c(b.resolve(d,y,_,null,{shadow:!1}))&&v.push(b.key);if(!v.length||v.length===1)return;const h={peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)};return h.present=v,h.presentWithLabels=s.keysToLabels(i,v),{code:"object.oxor",context:h}},with(i,u,d,y,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,y,_,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:u.key.key,mainWithLabel:s.keysToLabels(i,u.key.key),peer:c.key,peerWithLabel:s.keysToLabels(i,c.key)}}},without(i,u,d,y,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,y,_,null,{shadow:!1})))return{code:"object.without",context:{main:u.key.key,mainWithLabel:s.keysToLabels(i,u.key.key),peer:c.key,peerWithLabel:s.keysToLabels(i,c.key)}}},xor(i,u,d,y,_){const v=[],c=s.isPresent(u.options);for(const b of u.peers)c(b.resolve(d,y,_,null,{shadow:!1}))&&v.push(b.key);if(v.length===1)return;const h={peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)};return v.length===0?{code:"object.missing",context:h}:(h.present=v,h.presentWithLabels=s.keysToLabels(i,v),{code:"object.xor",context:h})}},s.keysToLabels=function(i,u){return Array.isArray(u)?u.map(d=>i.$_mapLabels(d)):i.$_mapLabels(u)},s.isPresent=function(i){return typeof i.isPresent=="function"?i.isPresent:u=>u!==void 0},s.rename=function(i,u,d,y,_){const v={};for(const c of i.$_terms.renames){const h=[],b=typeof c.from!="string";if(b)for(const x in u){if(u[x]===void 0&&c.options.ignoreUndefined||x===c.to)continue;const S=c.from.exec(x);S&&h.push({from:x,to:c.to,match:S})}else!Object.prototype.hasOwnProperty.call(u,c.from)||u[c.from]===void 0&&c.options.ignoreUndefined||h.push(c);for(const x of h){const S=x.from;let R=x.to;if(R instanceof l&&(R=R.render(u,d,y,x.match)),S!==R){if(!c.options.multiple&&v[R]&&(_.push(i.$_createError("object.rename.multiple",u,{from:S,to:R,pattern:b},d,y)),y.abortEarly)||Object.prototype.hasOwnProperty.call(u,R)&&!c.options.override&&!v[R]&&(_.push(i.$_createError("object.rename.override",u,{from:S,to:R,pattern:b},d,y)),y.abortEarly))return!1;u[S]===void 0?delete u[R]:u[R]=u[S],v[R]=!0,c.options.alias||delete u[S]}}}return!0},s.unknown=function(i,u,d,y,_,v){if(i.$_terms.patterns){let c=!1;const h=i.$_terms.patterns.map(x=>{if(x.matches)return c=!0,[]}),b=[u,..._.ancestors];for(const x of d){const S=u[x],R=[..._.path,x];for(let O=0;O<i.$_terms.patterns.length;++O){const A=i.$_terms.patterns[O];if(A.regex){const F=A.regex.test(x);if(_.mainstay.tracer.debug(_,"rule",`pattern.${O}`,F?"pass":"error"),!F)continue}else if(!A.schema.$_match(x,_.nest(A.schema,`pattern.${O}`),v))continue;d.delete(x);const D=_.localize(R,b,{schema:A.rule,key:x}),M=A.rule.$_validate(S,D,v);if(M.errors){if(v.abortEarly)return{value:u,errors:M.errors};y.push(...M.errors)}if(A.matches&&h[O].push(x),u[x]=M.value,!A.fallthrough)break}}if(c)for(let x=0;x<h.length;++x){const S=h[x];if(!S)continue;const R=i.$_terms.patterns[x].matches,O=_.localize(_.path,b,R),A=R.$_validate(S,O,v);if(A.errors){const D=r.details(A.errors,{override:!1});D.matches=S;const M=i.$_createError("object.pattern.match",u,D,_,v);if(v.abortEarly)return{value:u,errors:M};y.push(M)}}}if(d.size&&(i.$_terms.keys||i.$_terms.patterns)){if(v.stripUnknown&&i._flags.unknown===void 0||v.skipFunctions){const c=!(!v.stripUnknown||v.stripUnknown!==!0&&!v.stripUnknown.objects);for(const h of d)c?(delete u[h],d.delete(h)):typeof u[h]=="function"&&d.delete(h)}if(!a.default(i._flags.unknown,v.allowUnknown))for(const c of d){const h=_.localize([..._.path,c],[]),b=i.$_createError("object.unknown",u[c],{child:c},h,v,{flags:!1});if(v.abortEarly)return{value:u,errors:b};y.push(b)}}},s.Dependency=class{constructor(i,u,d,y,_){this.rel=i,this.key=u,this.peers=d,this.paths=y,this.options=_}describe(){const i={rel:this.rel,peers:this.paths};return this.key!==null&&(i.key=this.key.key),this.peers[0].separator!=="."&&(i.options={...i.options,separator:this.peers[0].separator}),this.options.isPresent&&(i.options={...i.options,isPresent:this.options.isPresent}),i}},s.Keys=class extends Array{concat(i){const u=this.slice(),d=new Map;for(let y=0;y<u.length;++y)d.set(u[y].key,y);for(const y of i){const _=y.key,v=d.get(_);v!==void 0?u[v]={key:_,schema:u[v].schema.concat(y.schema)}:u.push(y)}return u}}},8785:(j,w,p)=>{const o=p(375),g=p(8068),m=p(8160),f=p(3292),e=p(6354),a={};j.exports=g.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(n,r)=>n.ref(r),validate(n,{schema:r,state:t,prefs:l}){o(r.$_terms.link,"Uninitialized link schema");const s=a.generate(r,n,t,l),i=r.$_terms.link[0].ref;return s.$_validate(n,t.nest(s,`link:${i.display}:${s.type}`),l)},generate:(n,r,t,l)=>a.generate(n,r,t,l),rules:{ref:{method(n){o(!this.$_terms.link,"Cannot reinitialize schema"),n=f.ref(n),o(n.type==="value"||n.type==="local","Invalid reference type:",n.type),o(n.type==="local"||n.ancestor==="root"||n.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:n}],r}},relative:{method(n=!0){return this.$_setFlag("relative",n)}}},overrides:{concat(n){o(this.$_terms.link,"Uninitialized link schema"),o(m.isSchema(n),"Invalid schema object"),o(n.type!=="link","Cannot merge type link with another link");const r=this.clone();return r.$_terms.whens||(r.$_terms.whens=[]),r.$_terms.whens.push({concat:n}),r.$_mutateRebuild()}},manifest:{build:(n,r)=>(o(r.link,"Invalid link description missing link"),n.ref(r.link))}}),a.generate=function(n,r,t,l){let s=t.mainstay.links.get(n);if(s)return s._generate(r,t,l).schema;const i=n.$_terms.link[0].ref,{perspective:u,path:d}=a.perspective(i,t);a.assert(u,"which is outside of schema boundaries",i,n,t,l);try{s=d.length?u.$_reach(d):u}catch{a.assert(!1,"to non-existing schema",i,n,t,l)}return a.assert(s.type!=="link","which is another link",i,n,t,l),n._flags.relative||t.mainstay.links.set(n,s),s._generate(r,t,l).schema},a.perspective=function(n,r){if(n.type==="local"){for(const{schema:t,key:l}of r.schemas){if((t._flags.id||l)===n.path[0])return{perspective:t,path:n.path.slice(1)};if(t.$_terms.shared){for(const s of t.$_terms.shared)if(s._flags.id===n.path[0])return{perspective:s,path:n.path.slice(1)}}}return{perspective:null,path:null}}return n.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:n.path}:{perspective:r.schemas[n.ancestor]&&r.schemas[n.ancestor].schema,path:n.path}},a.assert=function(n,r,t,l,s,i){n||o(!1,`"${e.label(l._flags,s,i)}" contains link reference "${t.display}" ${r}`)}},3832:(j,w,p)=>{const o=p(375),g=p(8068),m=p(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const a=e.toString(),n=a.indexOf("."),r=a.indexOf("e");return(n<0?0:(r<0?a.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(a.slice(r+1))))}};j.exports=g.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:a,error:n}){if(!e.match(f.numberRx))return;e=e.trim();const r={value:parseFloat(e)};if(r.value===0&&(r.value=0),!a._flags.unsafe)if(e.match(/e/i)){if(f.extractSignificantDigits(e)!==f.extractSignificantDigits(String(r.value)))return r.errors=n("number.unsafe"),r}else{const t=r.value.toString();if(t.match(/e/i))return r;if(t!==f.normalizeDecimal(e))return r.errors=n("number.unsafe"),r}return r}},validate(e,{schema:a,error:n,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:n("number.infinity")};if(!m.isNumber(e))return{value:e,errors:n("number.base")};const t={value:e};if(r.convert){const l=a.$_getRule("precision");if(l){const s=Math.pow(10,l.args.limit);t.value=Math.round(t.value*s)/s}}return t.value===0&&(t.value=0),!a._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.errors=n("number.unsafe")),t},rules:{compare:{method:!1,validate:(e,a,{limit:n},{name:r,operator:t,args:l})=>m.compare(e,n,t)?e:a.error("number."+r,{limit:l.limit,value:e}),args:[{name:"limit",ref:!0,assert:m.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,a)=>Math.trunc(e)-e==0?e:a.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){const a=typeof e=="number"?f.decimalPlaces(e):null,n=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:a,pfactor:n}})},validate:(e,a,{base:n,baseDecimalPlace:r,pfactor:t},l)=>f.decimalPlaces(e)>r?a.error("number.multiple",{multiple:l.args.base,value:e}):Math.round(t*e)%Math.round(t*n)==0?e:a.error("number.multiple",{multiple:l.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>typeof e=="number"&&isFinite(e)&&e>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,a)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return o(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,a,{limit:n}){const r=e.toString().match(f.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?e:a.error("number.precision",{limit:n,value:e})},convert:!0},sign:{method(e){return o(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,a,{sign:n})=>n==="negative"&&e<0||n==="positive"&&e>0?e:a.error(`number.${n}`)},unsafe:{method(e=!0){return o(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>typeof e=="number",to:(e,a)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(e){return e.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),e==="-0"?"0":e}},8966:(j,w,p)=>{const o=p(7824);j.exports=o.extend({type:"object",cast:{map:{from:g=>g&&typeof g=="object",to:(g,m)=>new Map(Object.entries(g))}}})},7417:(j,w,p)=>{const o=p(375),g=p(5380),m=p(1745),f=p(9959),e=p(6064),a=p(9926),n=p(5752),r=p(8068),t=p(8160),l={tlds:a instanceof Set&&{tlds:{allow:a,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};j.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(s,{schema:i,state:u,prefs:d}){const y=i.$_getRule("normalize");y&&(s=s.normalize(y.args.form));const _=i.$_getRule("case");_&&(s=_.args.direction==="upper"?s.toLocaleUpperCase():s.toLocaleLowerCase());const v=i.$_getRule("trim");if(v&&v.args.enabled&&(s=s.trim()),i.$_terms.replacements)for(const h of i.$_terms.replacements)s=s.replace(h.pattern,h.replacement);const c=i.$_getRule("hex");if(c&&c.args.options.byteAligned&&s.length%2!=0&&(s=`0${s}`),i.$_getRule("isoDate")){const h=l.isoDate(s);h&&(s=h)}if(i._flags.truncate){const h=i.$_getRule("max");if(h){let b=h.args.limit;if(t.isResolvable(b)&&(b=b.resolve(s,u,d),!t.limit(b)))return{value:s,errors:i.$_createError("any.ref",b,{ref:h.args.limit,arg:"limit",reason:"must be a positive integer"},u,d)};s=s.slice(0,b)}}return{value:s}}},validate(s,{schema:i,error:u}){if(typeof s!="string")return{value:s,errors:u("string.base")};if(s===""){const d=i.$_getRule("min");return d&&d.args.limit===0?void 0:{value:s,errors:u("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(s,i)=>/^[a-zA-Z0-9]+$/.test(s)?s:i.error("string.alphanum")},base64:{method(s={}){return t.assertOptions(s,["paddingRequired","urlSafe"]),s={urlSafe:!1,paddingRequired:!0,...s},o(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof s.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:s}})},validate:(s,i,{options:u})=>l.base64Regex[u.paddingRequired][u.urlSafe].test(s)?s:i.error("string.base64")},case:{method(s){return o(["lower","upper"].includes(s),"Invalid case:",s),this.$_addRule({name:"case",args:{direction:s}})},validate:(s,i,{direction:u})=>u==="lower"&&s===s.toLocaleLowerCase()||u==="upper"&&s===s.toLocaleUpperCase()?s:i.error(`string.${u}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(s,i){let u=s.length,d=0,y=1;for(;u--;){const _=s.charAt(u)*y;d+=_-9*(_>9),y^=3}return d>0&&d%10==0?s:i.error("string.creditCard")}},dataUri:{method(s={}){return t.assertOptions(s,["paddingRequired"]),s={paddingRequired:!0,...s},o(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:s}})},validate(s,i,{options:u}){const d=s.match(l.dataUriRegex);return d&&(!d[2]||d[2]!=="base64"||l.base64Regex[u.paddingRequired].false.test(d[3]))?s:i.error("string.dataUri")}},domain:{method(s){s&&t.assertOptions(s,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const i=l.addressOptions(s);return this.$_addRule({name:"domain",args:{options:s},address:i})},validate:(s,i,u,{address:d})=>g.isValid(s,d)?s:i.error("string.domain")},email:{method(s={}){t.assertOptions(s,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(s.multiple===void 0||typeof s.multiple=="boolean","multiple option must be an boolean");const i=l.addressOptions(s),u=new RegExp(`\\s*[${s.separator?e(s.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:s},regex:u,address:i})},validate(s,i,{options:u},{regex:d,address:y}){const _=u.multiple?s.split(d):[s],v=[];for(const c of _)m.isValid(c,y)||v.push(c);return v.length?i.error("string.email",{value:s,invalids:v}):s}},guid:{alias:"uuid",method(s={}){t.assertOptions(s,["version","separator"]);let i="";if(s.version){const y=[].concat(s.version);o(y.length>=1,"version must have at least 1 valid version specified");const _=new Set;for(let v=0;v<y.length;++v){const c=y[v];o(typeof c=="string","version at position "+v+" must be a string");const h=l.guidVersions[c.toLowerCase()];o(h,"version at position "+v+" must be one of "+Object.keys(l.guidVersions).join(", ")),o(!_.has(h),"version at position "+v+" must not be a duplicate"),i+=h,_.add(h)}}o(l.guidSeparators.has(s.separator),'separator must be one of true, false, "-", or ":"');const u=s.separator===void 0?"[:-]?":s.separator===!0?"[:-]":s.separator===!1?"[]?":`\\${s.separator}`,d=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${u})[0-9A-F]{4}\\2?[${i||"0-9A-F"}][0-9A-F]{3}\\2?[${i?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:s},regex:d})},validate(s,i,u,{regex:d}){const y=d.exec(s);return y?l.guidBrackets[y[1]]!==y[y.length-1]?i.error("string.guid"):s:i.error("string.guid")}},hex:{method(s={}){return t.assertOptions(s,["byteAligned","prefix"]),s={byteAligned:!1,prefix:!1,...s},o(typeof s.byteAligned=="boolean","byteAligned must be boolean"),o(typeof s.prefix=="boolean"||s.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:s}})},validate:(s,i,{options:u})=>(u.prefix==="optional"?l.hexRegex.withOptionalPrefix:u.prefix===!0?l.hexRegex.withPrefix:l.hexRegex.withoutPrefix).test(s)?u.byteAligned&&s.length%2!=0?i.error("string.hexAlign"):s:i.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(s,i)=>g.isValid(s,{minDomainSegments:1})||l.ipRegex.test(s)?s:i.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(s={}){t.assertOptions(s,["cidr","version"]);const{cidr:i,versions:u,regex:d}=f.regex(s),y=s.version?u:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:i,version:y}},regex:d})},validate:(s,i,{options:u},{regex:d})=>d.test(s)?s:u.version?i.error("string.ipVersion",{value:s,cidr:u.cidr,version:u.version}):i.error("string.ip",{value:s,cidr:u.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(s,{error:i})=>l.isoDate(s)?s:i("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(s,i)=>l.isoDurationRegex.test(s)?s:i.error("string.isoDuration")},length:{method(s,i){return l.length(this,"length",s,"=",i)},validate(s,i,{limit:u,encoding:d},{name:y,operator:_,args:v}){const c=!d&&s.length;return t.compare(c,u,_)?s:i.error("string."+y,{limit:v.limit,value:s,encoding:d})},args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(s,i){return l.length(this,"max",s,"<=",i)},args:["limit","encoding"]},min:{method(s,i){return l.length(this,"min",s,">=",i)},args:["limit","encoding"]},normalize:{method(s="NFC"){return o(l.normalizationForms.includes(s),"normalization form must be one of "+l.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:s}})},validate:(s,{error:i},{form:u})=>s===s.normalize(u)?s:i("string.normalize",{value:s,form:u}),convert:!0},pattern:{alias:"regex",method(s,i={}){o(s instanceof RegExp,"regex must be a RegExp"),o(!s.flags.includes("g")&&!s.flags.includes("y"),"regex should not use global or sticky mode"),typeof i=="string"&&(i={name:i}),t.assertOptions(i,["invert","name"]);const u=["string.pattern",i.invert?".invert":"",i.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:s,options:i},errorCode:u})},validate:(s,i,{regex:u,options:d},{errorCode:y})=>u.test(s)^d.invert?s:i.error(y,{name:d.name,regex:u,value:s}),args:["regex","options"],multi:!0},replace:{method(s,i){typeof s=="string"&&(s=new RegExp(e(s),"g")),o(s instanceof RegExp,"pattern must be a RegExp"),o(typeof i=="string","replacement must be a String");const u=this.clone();return u.$_terms.replacements||(u.$_terms.replacements=[]),u.$_terms.replacements.push({pattern:s,replacement:i}),u}},token:{method(){return this.$_addRule("token")},validate:(s,i)=>/^\w+$/.test(s)?s:i.error("string.token")},trim:{method(s=!0){return o(typeof s=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:s}})},validate:(s,i,{enabled:u})=>u&&s!==s.trim()?i.error("string.trim"):s,convert:!0},truncate:{method(s=!0){return o(typeof s=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",s)}},uppercase:{method(){return this.case("upper")}},uri:{method(s={}){t.assertOptions(s,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),s.domain&&t.assertOptions(s.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:i,scheme:u}=n.regex(s),d=s.domain?l.addressOptions(s.domain):null;return this.$_addRule({name:"uri",args:{options:s},regex:i,domain:d,scheme:u})},validate(s,i,{options:u},{regex:d,domain:y,scheme:_}){if(["http:/","https:/"].includes(s))return i.error("string.uri");let v=d.exec(s);if(!v&&i.prefs.convert&&u.encodeUri){const c=encodeURI(s);v=d.exec(c),v&&(s=c)}if(v){const c=v[1]||v[2];return!y||u.allowRelative&&!c||g.isValid(c,y)?s:i.error("string.domain",{value:c})}return u.relativeOnly?i.error("string.uriRelativeOnly"):u.scheme?i.error("string.uriCustomScheme",{scheme:_,value:s}):i.error("string.uri")}}},manifest:{build(s,i){if(i.replacements)for(const{pattern:u,replacement:d}of i.replacements)s=s.replace(u,d);return s}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),l.addressOptions=function(s){if(!s)return l.tlds||s;if(o(s.minDomainSegments===void 0||Number.isSafeInteger(s.minDomainSegments)&&s.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(s.maxDomainSegments===void 0||Number.isSafeInteger(s.maxDomainSegments)&&s.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),s.tlds===!1)return s;if(s.tlds===!0||s.tlds===void 0)return o(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds);o(typeof s.tlds=="object","tlds must be true, false, or an object");const i=s.tlds.deny;if(i)return Array.isArray(i)&&(s=Object.assign({},s,{tlds:{deny:new Set(i)}})),o(s.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!s.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),l.validateTlds(s.tlds.deny,"tlds.deny"),s;const u=s.tlds.allow;return u?u===!0?(o(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds)):(Array.isArray(u)&&(s=Object.assign({},s,{tlds:{allow:new Set(u)}})),o(s.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),l.validateTlds(s.tlds.allow,"tlds.allow"),s):s},l.validateTlds=function(s,i){for(const u of s)o(g.isValid(u,{minDomainSegments:1,maxDomainSegments:1}),`${i} must contain valid top level domain names`)},l.isoDate=function(s){if(!t.isIsoDate(s))return null;/.*T.*[+-]\d\d$/.test(s)&&(s+="00");const i=new Date(s);return isNaN(i.getTime())?null:i.toISOString()},l.length=function(s,i,u,d,y){return o(!y||!1,"Invalid encoding:",y),s.$_addRule({name:i,method:"length",args:{limit:u,encoding:y},operator:d})}},8826:(j,w,p)=>{const o=p(375),g=p(8068),m={};m.Map=class extends Map{slice(){return new m.Map(this)}},j.exports=g.extend({type:"symbol",terms:{map:{init:new m.Map}},coerce:{method(f,{schema:e,error:a}){const n=e.$_terms.map.get(f);return n&&(f=n),e._flags.only&&typeof f!="symbol"?{value:f,errors:a("symbol.map",{map:e.$_terms.map})}:{value:f}}},validate(f,{error:e}){if(typeof f!="symbol")return{value:f,errors:e("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const e=this.clone(),a=[];for(const n of f){o(n&&n[Symbol.iterator],"Entry must be an iterable");const[r,t]=n;o(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),o(typeof t=="symbol","Value must be a Symbol"),e.$_terms.map.set(r,t),a.push(t)}return e.valid(...a)}}},manifest:{build:(f,e)=>(e.map&&(f=f.map(e.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(j,w,p)=>{const o=p(375),g=p(8571),m=p(738),f=p(9621),e=p(8160),a=p(6354),n=p(493),r={result:Symbol("result")};w.entry=function(t,l,s){let i=e.defaults;s&&(o(s.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(s.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),i=e.preferences(e.defaults,s));const u=r.entry(t,l,i);o(!u.mainstay.externals.length,"Schema with external rules must use validateAsync()");const d={value:u.value};return u.error&&(d.error=u.error),u.mainstay.warnings.length&&(d.warning=a.details(u.mainstay.warnings)),u.mainstay.debug&&(d.debug=u.mainstay.debug),u.mainstay.artifacts&&(d.artifacts=u.mainstay.artifacts),d},w.entryAsync=async function(t,l,s){let i=e.defaults;s&&(i=e.preferences(e.defaults,s));const u=r.entry(t,l,i),d=u.mainstay;if(u.error)throw d.debug&&(u.error.debug=d.debug),u.error;if(d.externals.length){let _=u.value;const v=[];for(const c of d.externals){const h=c.state.path,b=c.schema.type==="link"?d.links.get(c.schema):null;let x,S,R=_;const O=h.length?[_]:[],A=h.length?f(t,h):t;if(h.length){x=h[h.length-1];let D=_;for(const M of h.slice(0,-1))D=D[M],O.unshift(D);S=O[0],R=S[x]}try{const D=(F,E)=>(b||c.schema).$_createError(F,R,E,c.state,i),M=await c.method(R,{schema:c.schema,linked:b,state:c.state,prefs:s,original:A,error:D,errorsArray:r.errorsArray,warn:(F,E)=>d.warnings.push((b||c.schema).$_createError(F,R,E,c.state,i)),message:(F,E)=>(b||c.schema).$_createError("external",R,E,c.state,i,{messages:F})});if(M===void 0||M===R)continue;if(M instanceof a.Report){if(d.tracer.log(c.schema,c.state,"rule","external","error"),v.push(M),i.abortEarly)break;continue}if(Array.isArray(M)&&M[e.symbols.errors]){if(d.tracer.log(c.schema,c.state,"rule","external","error"),v.push(...M),i.abortEarly)break;continue}S?(d.tracer.value(c.state,"rule",R,M,"external"),S[x]=M):(d.tracer.value(c.state,"rule",_,M,"external"),_=M)}catch(D){throw i.errors.label&&(D.message+=` (${c.label})`),D}}if(u.value=_,v.length)throw u.error=a.process(v,t,i),d.debug&&(u.error.debug=d.debug),u.error}if(!i.warnings&&!i.debug&&!i.artifacts)return u.value;const y={value:u.value};return d.warnings.length&&(y.warning=a.details(d.warnings)),d.debug&&(y.debug=d.debug),d.artifacts&&(y.artifacts=d.artifacts),y},r.Mainstay=class{constructor(t,l,s){this.externals=[],this.warnings=[],this.tracer=t,this.debug=l,this.links=s,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}},r.entry=function(t,l,s){const{tracer:i,cleanup:u}=r.tracer(l,s),d=s.debug?[]:null,y=l._ids._schemaChain?new Map:null,_=new r.Mainstay(i,d,y),v=l._ids._schemaChain?[{schema:l}]:null,c=new n([],[],{mainstay:_,schemas:v}),h=w.validate(t,l,c,s);u&&l.$_root.untrace();const b=a.process(h.errors,t,s);return{value:h.value,error:b,mainstay:_}},r.tracer=function(t,l){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:l.debug?(o(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:r.ignore}},w.validate=function(t,l,s,i,u={}){if(l.$_terms.whens&&(l=l._generate(t,s,i).schema),l._preferences&&(i=r.prefs(l,i)),l._cache&&i.cache){const b=l._cache.get(t);if(s.mainstay.tracer.debug(s,"validate","cached",!!b),b)return b}const d=(b,x,S)=>l.$_createError(b,t,x,S||s,i),y={original:t,prefs:i,schema:l,state:s,error:d,errorsArray:r.errorsArray,warn:(b,x,S)=>s.mainstay.warnings.push(d(b,x,S)),message:(b,x)=>l.$_createError("custom",t,x,s,i,{messages:b})};s.mainstay.tracer.entry(l,s);const _=l._definition;if(_.prepare&&t!==void 0&&i.convert){const b=_.prepare(t,y);if(b){if(s.mainstay.tracer.value(s,"prepare",t,b.value),b.errors)return r.finalize(b.value,[].concat(b.errors),y);t=b.value}}if(_.coerce&&t!==void 0&&i.convert&&(!_.coerce.from||_.coerce.from.includes(typeof t))){const b=_.coerce.method(t,y);if(b){if(s.mainstay.tracer.value(s,"coerced",t,b.value),b.errors)return r.finalize(b.value,[].concat(b.errors),y);t=b.value}}const v=l._flags.empty;v&&v.$_match(r.trim(t,l),s.nest(v),e.defaults)&&(s.mainstay.tracer.value(s,"empty",t,void 0),t=void 0);const c=u.presence||l._flags.presence||(l._flags._endedSwitch?null:i.presence);if(t===void 0){if(c==="forbidden")return r.finalize(t,null,y);if(c==="required")return r.finalize(t,[l.$_createError("any.required",t,null,s,i)],y);if(c==="optional"){if(l._flags.default!==e.symbols.deepDefault)return r.finalize(t,null,y);s.mainstay.tracer.value(s,"default",t,{}),t={}}}else if(c==="forbidden")return r.finalize(t,[l.$_createError("any.unknown",t,null,s,i)],y);const h=[];if(l._valids){const b=l._valids.get(t,s,i,l._flags.insensitive);if(b)return i.convert&&(s.mainstay.tracer.value(s,"valids",t,b.value),t=b.value),s.mainstay.tracer.filter(l,s,"valid",b),r.finalize(t,null,y);if(l._flags.only){const x=l.$_createError("any.only",t,{valids:l._valids.values({display:!0})},s,i);if(i.abortEarly)return r.finalize(t,[x],y);h.push(x)}}if(l._invalids){const b=l._invalids.get(t,s,i,l._flags.insensitive);if(b){s.mainstay.tracer.filter(l,s,"invalid",b);const x=l.$_createError("any.invalid",t,{invalids:l._invalids.values({display:!0})},s,i);if(i.abortEarly)return r.finalize(t,[x],y);h.push(x)}}if(_.validate){const b=_.validate(t,y);if(b&&(s.mainstay.tracer.value(s,"base",t,b.value),t=b.value,b.errors)){if(!Array.isArray(b.errors))return h.push(b.errors),r.finalize(t,h,y);if(b.errors.length)return h.push(...b.errors),r.finalize(t,h,y)}}return l._rules.length?r.rules(t,h,y):r.finalize(t,h,y)},r.rules=function(t,l,s){const{schema:i,state:u,prefs:d}=s;for(const y of i._rules){const _=i._definition.rules[y.method];if(_.convert&&d.convert){u.mainstay.tracer.log(i,u,"rule",y.name,"full");continue}let v,c=y.args;if(y._resolve.length){c=Object.assign({},c);for(const b of y._resolve){const x=_.argsByName.get(b),S=c[b].resolve(t,u,d),R=x.normalize?x.normalize(S):S,O=e.validateArg(R,null,x);if(O){v=i.$_createError("any.ref",S,{arg:b,ref:c[b],reason:O},u,d);break}c[b]=R}}v=v||_.validate(t,s,c,y);const h=r.rule(v,y);if(h.errors){if(u.mainstay.tracer.log(i,u,"rule",y.name,"error"),y.warn){u.mainstay.warnings.push(...h.errors);continue}if(d.abortEarly)return r.finalize(t,h.errors,s);l.push(...h.errors)}else u.mainstay.tracer.log(i,u,"rule",y.name,"pass"),u.mainstay.tracer.value(u,"rule",t,h.value,y.name),t=h.value}return r.finalize(t,l,s)},r.rule=function(t,l){return t instanceof a.Report?(r.error(t,l),{errors:[t],value:null}):Array.isArray(t)&&t[e.symbols.errors]?(t.forEach(s=>r.error(s,l)),{errors:t,value:null}):{errors:null,value:t}},r.error=function(t,l){return l.message&&t._setTemplate(l.message),t},r.finalize=function(t,l,s){l=l||[];const{schema:i,state:u,prefs:d}=s;if(l.length){const _=r.default("failover",void 0,l,s);_!==void 0&&(u.mainstay.tracer.value(u,"failover",t,_),t=_,l=[])}if(l.length&&i._flags.error)if(typeof i._flags.error=="function"){l=i._flags.error(l),Array.isArray(l)||(l=[l]);for(const _ of l)o(_ instanceof Error||_ instanceof a.Report,"error() must return an Error object")}else l=[i._flags.error];if(t===void 0){const _=r.default("default",t,l,s);u.mainstay.tracer.value(u,"default",t,_),t=_}if(i._flags.cast&&t!==void 0){const _=i._definition.cast[i._flags.cast];if(_.from(t)){const v=_.to(t,s);u.mainstay.tracer.value(u,"cast",t,v,i._flags.cast),t=v}}if(i.$_terms.externals&&d.externals&&d._externals!==!1)for(const{method:_}of i.$_terms.externals)u.mainstay.externals.push({method:_,schema:i,state:u,label:a.label(i._flags,u,d)});const y={value:t,errors:l.length?l:null};return i._flags.result&&(y.value=i._flags.result==="strip"?void 0:s.original,u.mainstay.tracer.value(u,i._flags.result,t,y.value),u.shadow(t,i._flags.result)),i._cache&&d.cache!==!1&&!i._refs.length&&i._cache.set(s.original,y),t===void 0||y.errors||i._flags.artifact===void 0||(u.mainstay.artifacts=u.mainstay.artifacts||new Map,u.mainstay.artifacts.has(i._flags.artifact)||u.mainstay.artifacts.set(i._flags.artifact,[]),u.mainstay.artifacts.get(i._flags.artifact).push(u.path)),y},r.prefs=function(t,l){const s=l===e.defaults;return s&&t._preferences[e.symbols.prefs]?t._preferences[e.symbols.prefs]:(l=e.preferences(l,t._preferences),s&&(t._preferences[e.symbols.prefs]=l),l)},r.default=function(t,l,s,i){const{schema:u,state:d,prefs:y}=i,_=u._flags[t];if(y.noDefaults||_===void 0)return l;if(d.mainstay.tracer.log(u,d,"rule",t,"full"),!_)return _;if(typeof _=="function"){const v=_.length?[g(d.ancestors[0]),i]:[];try{return _(...v)}catch(c){return void s.push(u.$_createError(`any.${t}`,null,{error:c},d,y))}}return typeof _!="object"?_:_[e.symbols.literal]?_.literal:e.isResolvable(_)?_.resolve(l,d,y):g(_)},r.trim=function(t,l){if(typeof t!="string")return t;const s=l.$_getRule("trim");return s&&s.args.enabled?t.trim():t},r.ignore={active:!1,debug:m,entry:m,filter:m,log:m,resolve:m,value:m},r.errorsArray=function(){const t=[];return t[e.symbols.errors]=!0,t}},2036:(j,w,p)=>{const o=p(375),g=p(9474),m=p(8160),f={};j.exports=f.Values=class{constructor(e,a){this._values=new Set(e),this._refs=new Set(a),this._lowercase=f.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,a){m.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),a&&a.register(e)):this.has(e,null,null,!1)||(this._values.add(e),typeof e=="string"&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,a,n){if(e=e||new f.Values,a){if(a._override)return a.clone();for(const r of[...a._values,...a._refs])e.add(r)}if(n)for(const r of[...n._values,...n._refs])e.remove(r);return e.length?e:null}remove(e){m.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),typeof e=="string"&&this._lowercase.delete(e.toLowerCase()))}has(e,a,n,r){return!!this.get(e,a,n,r)}get(e,a,n,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if(typeof e=="string"&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&typeof e!="object")return!1;if(typeof e=="object"){for(const t of this._values)if(g(t,e))return{value:t}}if(a)for(const t of this._refs){const l=t.resolve(e,a,n,null,{in:!0});if(l===void 0)continue;const s=t.in&&typeof l=="object"?Array.isArray(l)?l:Object.keys(l):[l];for(const i of s)if(typeof i==typeof e){if(r&&e&&typeof e=="string"){if(i.toLowerCase()===e.toLowerCase())return{value:i,ref:t}}else if(g(i,e))return{value:i,ref:t}}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const a=[];for(const n of[...this._values,...this._refs])n!==void 0&&a.push(n);return a}return Array.from([...this._values,...this._refs])}clone(){const e=new f.Values(this._values,this._refs);return e._override=this._override,e}concat(e){o(!e._override,"Cannot concat override set of values");const a=new f.Values([...this._values,...e._values],[...this._refs,...e._refs]);return a._override=this._override,a}describe(){const e=[];this._override&&e.push({override:!0});for(const a of this._values.values())e.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())e.push(a.describe());return e}},f.Values.prototype[m.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(e){const a=new Map;if(e)for(const n of e)typeof n=="string"&&a.set(n.toLowerCase(),n);return a}},978:(j,w,p)=>{const o=p(375),g=p(8571),m=p(1687),f=p(9621),e={};j.exports=function(a,n,r={}){if(o(a&&typeof a=="object","Invalid defaults value: must be an object"),o(!n||n===!0||typeof n=="object","Invalid source value: must be true, falsy or an object"),o(typeof r=="object","Invalid options: must be an object"),!n)return null;if(r.shallow)return e.applyToDefaultsWithShallow(a,n,r);const t=g(a);if(n===!0)return t;const l=r.nullOverride!==void 0&&r.nullOverride;return m(t,n,{nullOverride:l,mergeArrays:!1})},e.applyToDefaultsWithShallow=function(a,n,r){const t=r.shallow;o(Array.isArray(t),"Invalid keys");const l=new Map,s=n===!0?null:new Set;for(let d of t){d=Array.isArray(d)?d:d.split(".");const y=f(a,d);y&&typeof y=="object"?l.set(y,s&&f(n,d)||y):s&&s.add(d)}const i=g(a,{},l);if(!s)return i;for(const d of s)e.reachCopy(i,n,d);const u=r.nullOverride!==void 0&&r.nullOverride;return m(i,n,{nullOverride:u,mergeArrays:!1})},e.reachCopy=function(a,n,r){for(const s of r){if(!(s in n))return;const i=n[s];if(typeof i!="object"||i===null)return;n=i}const t=n;let l=a;for(let s=0;s<r.length-1;++s){const i=r[s];typeof l[i]!="object"&&(l[i]={}),l=l[i]}l[r[r.length-1]]=t}},375:(j,w,p)=>{const o=p(7916);j.exports=function(g,...m){if(!g)throw m.length===1&&m[0]instanceof Error?m[0]:new o(m)}},8571:(j,w,p)=>{const o=p(9621),g=p(4277),m=p(7043),f={needsProtoHack:new Set([g.set,g.map,g.weakSet,g.weakMap])};j.exports=f.clone=function(e,a={},n=null){if(typeof e!="object"||e===null)return e;let r=f.clone,t=n;if(a.shallow){if(a.shallow!==!0)return f.cloneWithShallow(e,a);r=u=>u}else if(t){const u=t.get(e);if(u)return u}else t=new Map;const l=g.getInternalProto(e);if(l===g.buffer)return!1;if(l===g.date)return new Date(e.getTime());if(l===g.regex)return new RegExp(e);const s=f.base(e,l,a);if(s===e)return e;if(t&&t.set(e,s),l===g.set)for(const u of e)s.add(r(u,a,t));else if(l===g.map)for(const[u,d]of e)s.set(u,r(d,a,t));const i=m.keys(e,a);for(const u of i){if(u==="__proto__")continue;if(l===g.array&&u==="length"){s.length=e.length;continue}const d=Object.getOwnPropertyDescriptor(e,u);d?d.get||d.set?Object.defineProperty(s,u,d):d.enumerable?s[u]=r(e[u],a,t):Object.defineProperty(s,u,{enumerable:!1,writable:!0,configurable:!0,value:r(e[u],a,t)}):Object.defineProperty(s,u,{enumerable:!0,writable:!0,configurable:!0,value:r(e[u],a,t)})}return s},f.cloneWithShallow=function(e,a){const n=a.shallow;(a=Object.assign({},a)).shallow=!1;const r=new Map;for(const t of n){const l=o(e,t);typeof l!="object"&&typeof l!="function"||r.set(l,l)}return f.clone(e,a,r)},f.base=function(e,a,n){if(n.prototype===!1)return f.needsProtoHack.has(a)?new a.constructor:a===g.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(a===g.array){const t=[];return r!==a&&Object.setPrototypeOf(t,r),t}if(f.needsProtoHack.has(a)){const t=new r.constructor;return r!==a&&Object.setPrototypeOf(t,r),t}return Object.create(r)}},9474:(j,w,p)=>{const o=p(4277),g={mismatched:null};j.exports=function(m,f,e){return e=Object.assign({prototype:!0},e),!!g.isDeepEqual(m,f,e,[])},g.isDeepEqual=function(m,f,e,a){if(m===f)return m!==0||1/m==1/f;const n=typeof m;if(n!==typeof f||m===null||f===null)return!1;if(n==="function"){if(!e.deepFunction||m.toString()!==f.toString())return!1}else if(n!=="object")return m!=m&&f!=f;const r=g.getSharedType(m,f,!!e.prototype);switch(r){case o.buffer:return!1;case o.promise:return m===f;case o.regex:return m.toString()===f.toString();case g.mismatched:return!1}for(let t=a.length-1;t>=0;--t)if(a[t].isSame(m,f))return!0;a.push(new g.SeenEntry(m,f));try{return!!g.isDeepEqualObj(r,m,f,e,a)}finally{a.pop()}},g.getSharedType=function(m,f,e){if(e)return Object.getPrototypeOf(m)!==Object.getPrototypeOf(f)?g.mismatched:o.getInternalProto(m);const a=o.getInternalProto(m);return a!==o.getInternalProto(f)?g.mismatched:a},g.valueOf=function(m){const f=m.valueOf;if(f===void 0)return m;try{return f.call(m)}catch(e){return e}},g.hasOwnEnumerableProperty=function(m,f){return Object.prototype.propertyIsEnumerable.call(m,f)},g.isSetSimpleEqual=function(m,f){for(const e of Set.prototype.values.call(m))if(!Set.prototype.has.call(f,e))return!1;return!0},g.isDeepEqualObj=function(m,f,e,a,n){const{isDeepEqual:r,valueOf:t,hasOwnEnumerableProperty:l}=g,{keys:s,getOwnPropertySymbols:i}=Object;if(m===o.array){if(!a.part){if(f.length!==e.length)return!1;for(let v=0;v<f.length;++v)if(!r(f[v],e[v],a,n))return!1;return!0}for(const v of f)for(const c of e)if(r(v,c,a,n))return!0}else if(m===o.set){if(f.size!==e.size)return!1;if(!g.isSetSimpleEqual(f,e)){const v=new Set(Set.prototype.values.call(e));for(const c of Set.prototype.values.call(f)){if(v.delete(c))continue;let h=!1;for(const b of v)if(r(c,b,a,n)){v.delete(b),h=!0;break}if(!h)return!1}}}else if(m===o.map){if(f.size!==e.size)return!1;for(const[v,c]of Map.prototype.entries.call(f))if(c===void 0&&!Map.prototype.has.call(e,v)||!r(c,Map.prototype.get.call(e,v),a,n))return!1}else if(m===o.error&&(f.name!==e.name||f.message!==e.message))return!1;const u=t(f),d=t(e);if((f!==u||e!==d)&&!r(u,d,a,n))return!1;const y=s(f);if(!a.part&&y.length!==s(e).length&&!a.skip)return!1;let _=0;for(const v of y)if(a.skip&&a.skip.includes(v))e[v]===void 0&&++_;else if(!l(e,v)||!r(f[v],e[v],a,n))return!1;if(!a.part&&y.length-_!==s(e).length)return!1;if(a.symbols!==!1){const v=i(f),c=new Set(i(e));for(const h of v){if(!a.skip||!a.skip.includes(h)){if(l(f,h)){if(!l(e,h)||!r(f[h],e[h],a,n))return!1}else if(l(e,h))return!1}c.delete(h)}for(const h of c)if(l(e,h))return!1}return!0},g.SeenEntry=class{constructor(m,f){this.obj=m,this.ref=f}isSame(m,f){return this.obj===m&&this.ref===f}}},7916:(j,w,p)=>{const o=p(8761);j.exports=class extends Error{constructor(g){super(g.filter(m=>m!=="").map(m=>typeof m=="string"?m:m instanceof Error?m.message:o(m)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,w.assert)}}},5277:j=>{const w={};j.exports=function(p){if(!p)return"";let o="";for(let g=0;g<p.length;++g){const m=p.charCodeAt(g);w.isSafe(m)?o+=p[g]:o+=w.escapeHtmlChar(m)}return o},w.escapeHtmlChar=function(p){return w.namedHtml.get(p)||(p>=256?"&#"+p+";":`&#x${p.toString(16).padStart(2,"0")};`)},w.isSafe=function(p){return w.safeCharCodes.has(p)},w.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),w.safeCharCodes=function(){const p=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&p.add(o);return p}()},6064:j=>{j.exports=function(w){return w.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:j=>{j.exports=function(){}},1687:(j,w,p)=>{const o=p(375),g=p(8571),m=p(7043),f={};j.exports=f.merge=function(e,a,n){if(o(e&&typeof e=="object","Invalid target value: must be an object"),o(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return e;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(a)){o(Array.isArray(e),"Cannot merge array onto an object"),n.mergeArrays||(e.length=0);for(let t=0;t<a.length;++t)e.push(g(a[t],{symbols:n.symbols}));return e}const r=m.keys(a,n);for(let t=0;t<r.length;++t){const l=r[t];if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,l))continue;const s=a[l];if(s&&typeof s=="object"){if(e[l]===s)continue;!e[l]||typeof e[l]!="object"||Array.isArray(e[l])!==Array.isArray(s)||s instanceof Date||s instanceof RegExp?e[l]=g(s,{symbols:n.symbols}):f.merge(e[l],s,n)}else(s!=null||n.nullOverride)&&(e[l]=s)}return e}},9621:(j,w,p)=>{const o=p(375),g={};j.exports=function(m,f,e){if(f===!1||f==null)return m;typeof(e=e||{})=="string"&&(e={separator:e});const a=Array.isArray(f);o(!a||!e.separator,"Separator option is not valid for array-based chain");const n=a?f:f.split(e.separator||".");let r=m;for(let t=0;t<n.length;++t){let l=n[t];const s=e.iterables&&g.iterables(r);if(Array.isArray(r)||s==="set"){const i=Number(l);Number.isInteger(i)&&(l=i<0?r.length+i:i)}if(!r||typeof r=="function"&&e.functions===!1||!s&&r[l]===void 0){o(!e.strict||t+1===n.length,"Missing segment",l,"in reach path ",f),o(typeof r=="object"||e.functions===!0||typeof r!="function","Invalid segment",l,"in reach path ",f),r=e.default;break}r=s?s==="set"?[...r][l]:r.get(l):r[l]}return r},g.iterables=function(m){return m instanceof Set?"set":m instanceof Map?"map":void 0}},8761:j=>{j.exports=function(...w){try{return JSON.stringify(...w)}catch(p){return"[Cannot display object: "+p.message+"]"}}},4277:(j,w)=>{const p={};w=j.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},p.typeMap=new Map([["[object Error]",w.error],["[object Map]",w.map],["[object Promise]",w.promise],["[object Set]",w.set],["[object WeakMap]",w.weakMap],["[object WeakSet]",w.weakSet]]),w.getInternalProto=function(o){if(Array.isArray(o))return w.array;if(o instanceof Date)return w.date;if(o instanceof RegExp)return w.regex;if(o instanceof Error)return w.error;const g=Object.prototype.toString.call(o);return p.typeMap.get(g)||w.generic}},7043:(j,w)=>{w.keys=function(p,o={}){return o.symbols!==!1?Reflect.ownKeys(p):Object.getOwnPropertyNames(p)}},3652:(j,w,p)=>{const o=p(375),g={};w.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(m,f){const e=[].concat((f=f||{}).before||[]),a=[].concat(f.after||[]),n=f.group||"?",r=f.sort||0;o(!e.includes(n),`Item cannot come before itself: ${n}`),o(!e.includes("?"),"Item cannot come before unassociated items"),o(!a.includes(n),`Item cannot come after itself: ${n}`),o(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(m)||(m=[m]);for(const t of m){const l={seq:this._items.length,sort:r,before:e,after:a,group:n,node:t};this._items.push(l)}if(!f.manual){const t=this._sort();o(t,"item",n!=="?"?`added into group ${n}`:"","created a dependencies error")}return this.nodes}merge(m){Array.isArray(m)||(m=[m]);for(const e of m)if(e)for(const a of e._items)this._items.push(Object.assign({},a));this._items.sort(g.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const f=this._sort();return o(f,"merge created a dependencies error"),this.nodes}sort(){const m=this._sort();return o(m,"sort created a dependencies error"),this.nodes}_sort(){const m={},f=Object.create(null),e=Object.create(null);for(const l of this._items){const s=l.seq,i=l.group;e[i]=e[i]||[],e[i].push(s),m[s]=l.before;for(const u of l.after)f[u]=f[u]||[],f[u].push(s)}for(const l in m){const s=[];for(const i in m[l]){const u=m[l][i];e[u]=e[u]||[],s.push(...e[u])}m[l]=s}for(const l in f)if(e[l])for(const s of e[l])m[s].push(...f[l]);const a={};for(const l in m){const s=m[l];for(const i of s)a[i]=a[i]||[],a[i].push(l)}const n={},r=[];for(let l=0;l<this._items.length;++l){let s=l;if(a[l]){s=null;for(let i=0;i<this._items.length;++i){if(n[i]===!0)continue;a[i]||(a[i]=[]);const u=a[i].length;let d=0;for(let y=0;y<u;++y)n[a[i][y]]&&++d;if(d===u){s=i;break}}}s!==null&&(n[s]=!0,r.push(s))}if(r.length!==this._items.length)return!1;const t={};for(const l of this._items)t[l.seq]=l;this._items=[],this.nodes=[];for(const l of r){const s=t[l];this.nodes.push(s.node),this._items.push(s)}return!0}},g.mergeSort=(m,f)=>m.sort===f.sort?0:m.sort<f.sort?-1:1},5380:(j,w,p)=>{const o=p(443),g=p(2178),m={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:o.URL||URL};w.analyze=function(f,e={}){if(!f)return g.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return g.code("DOMAIN_TOO_LONG");if(m.nonAsciiRx.test(f)){if(e.allowUnicode===!1)return g.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(m.domainControlRx.test(f))return g.code("DOMAIN_INVALID_CHARS");f=m.punycode(f),e.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const a=e.minDomainSegments||m.minDomainSegments,n=f.split(".");if(n.length<a)return g.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&n.length>e.maxDomainSegments)return g.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=e.tlds;if(r){const t=n[n.length-1].toLowerCase();if(r.deny&&r.deny.has(t)||r.allow&&!r.allow.has(t))return g.code("DOMAIN_FORBIDDEN_TLDS")}for(let t=0;t<n.length;++t){const l=n[t];if(!l.length)return g.code("DOMAIN_EMPTY_SEGMENT");if(l.length>63)return g.code("DOMAIN_LONG_SEGMENT");if(t<n.length-1){if(!m.domainSegmentRx.test(l))return g.code("DOMAIN_INVALID_CHARS")}else if(!m.tldSegmentRx.test(l))return g.code("DOMAIN_INVALID_TLDS_CHARS")}return null},w.isValid=function(f,e){return!w.analyze(f,e)},m.punycode=function(f){f.includes("%")&&(f=f.replace(/%/g,"%25"));try{return new m.URL(`http://${f}`).host}catch{return f}}},1745:(j,w,p)=>{const o=p(9848),g=p(5380),m=p(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};w.analyze=function(e,a){return f.email(e,a)},w.isValid=function(e,a){return!f.email(e,a)},f.email=function(e,a={}){if(typeof e!="string")throw new Error("Invalid input: email must be a string");if(!e)return m.code("EMPTY_STRING");const n=!f.nonAsciiRx.test(e);if(!n){if(a.allowUnicode===!1)return m.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(r.length!==2)return r.length>2?m.code("MULTIPLE_AT_CHAR"):m.code("MISSING_AT_CHAR");const[t,l]=r;if(!t)return m.code("EMPTY_LOCAL");if(!a.ignoreLength){if(e.length>254)return m.code("ADDRESS_TOO_LONG");if(f.encoder.encode(t).length>64)return m.code("LOCAL_TOO_LONG")}return f.local(t,n)||g.analyze(l,a)},f.local=function(e,a){const n=e.split(".");for(const r of n){if(!r.length)return m.code("EMPTY_LOCAL_SEGMENT");if(a){if(!f.atextRx.test(r))return m.code("INVALID_LOCAL_CHARS")}else for(const t of r){if(f.atextRx.test(t))continue;const l=f.binary(t);if(!f.atomRx.test(l))return m.code("INVALID_LOCAL_CHARS")}}},f.binary=function(e){return Array.from(f.encoder.encode(e)).map(a=>String.fromCharCode(a)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(j,w)=>{w.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},w.code=function(p){return{code:p,error:w.codes[p]}}},9959:(j,w,p)=>{const o=p(375),g=p(5752);w.regex=function(m={}){o(m.cidr===void 0||typeof m.cidr=="string","options.cidr must be a string");const f=m.cidr?m.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(m.version===void 0||typeof m.version=="string"||Array.isArray(m.version),"options.version must be a string or an array of string");let e=m.version||["ipv4","ipv6","ipvfuture"];Array.isArray(e)||(e=[e]),o(e.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<e.length;++r)o(typeof e[r]=="string","options.version must only contain strings"),e[r]=e[r].toLowerCase(),o(["ipv4","ipv6","ipvfuture"].includes(e[r]),"options.version contains unknown version "+e[r]+" - must be one of ipv4, ipv6, ipvfuture");e=Array.from(new Set(e));const a=`(?:${e.map(r=>{if(f==="forbidden")return g.ip[r];const t=`\\/${r==="ipv4"?g.ip.v4Cidr:g.ip.v6Cidr}`;return f==="required"?`${g.ip[r]}${t}`:`${g.ip[r]}(?:${t})?`}).join("|")})`,n=new RegExp(`^${a}$`);return{cidr:f,versions:e,regex:n,raw:a}}},5752:(j,w,p)=>{const o=p(375),g=p(6064),m={generate:function(){const f={},e="\\dA-Fa-f",a="["+e+"]",n="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",t="%"+e,l=n+t+r+":@",s="["+l+"]",i="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+i+"\\.){3}"+i;const u=a+"{1,4}",d="(?:"+u+":"+u+"|"+f.ipv4address+")",y="(?:"+u+":){6}"+d,_="::(?:"+u+":){5}"+d,v="(?:"+u+")?::(?:"+u+":){4}"+d,c="(?:(?:"+u+":){0,1}"+u+")?::(?:"+u+":){3}"+d,h="(?:(?:"+u+":){0,2}"+u+")?::(?:"+u+":){2}"+d,b="(?:(?:"+u+":){0,3}"+u+")?::"+u+":"+d,x="(?:(?:"+u+":){0,4}"+u+")?::"+d,S="(?:(?:"+u+":){0,5}"+u+")?::"+u,R="(?:(?:"+u+":){0,6}"+u+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+y+"|"+_+"|"+v+"|"+c+"|"+h+"|"+b+"|"+x+"|"+S+"|"+R+")",f.ipvFuture="v"+a+"+\\.["+n+r+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const O="["+n+t+r+":]*",A="["+n+t+r+"]{1,255}",D="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+A+")",M="(?:"+O+"@)?"+D+"(?::\\d*)?",F="(?:"+O+"@)?("+D+")(?::\\d*)?",E=s+"*",I=s+"+",L="(?:\\/"+E+")*",N="\\/(?:"+I+L+")?",B=I+L,K="["+n+t+r+"@]+"+L,se="(?:\\/\\/\\/"+E+L+")";return f.hierPart="(?:(?:\\/\\/"+M+L+")|"+N+"|"+B+"|"+se+")",f.hierPartCapture="(?:(?:\\/\\/"+F+L+")|"+N+"|"+B+")",f.relativeRef="(?:(?:\\/\\/"+M+L+")|"+N+"|"+K+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+F+L+")|"+N+"|"+K+"|)",f.query="["+l+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+l+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+l+"\\/\\?]*",f}};m.rfc3986=m.generate(),w.ip={v4Cidr:m.rfc3986.ipv4Cidr,v6Cidr:m.rfc3986.ipv6Cidr,ipv4:m.rfc3986.ipv4address,ipv6:m.rfc3986.ipv6address,ipvfuture:m.rfc3986.ipvFuture},m.createRegex=function(f){const e=m.rfc3986,a="(?:\\?"+(f.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",n=f.domain?e.relativeRefCapture:e.relativeRef;if(f.relativeOnly)return m.wrap(n+a);let r="";if(f.scheme){o(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const s=[].concat(f.scheme);o(s.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let u=0;u<s.length;++u){const d=s[u];o(d instanceof RegExp||typeof d=="string","scheme at position "+u+" must be a RegExp or String"),d instanceof RegExp?i.push(d.source.toString()):(o(e.schemeRegex.test(d),"scheme at position "+u+" must be a valid scheme"),i.push(g(d)))}r=i.join("|")}const t="(?:"+(r?"(?:"+r+")":e.scheme)+":"+(f.domain?e.hierPartCapture:e.hierPart)+")",l=f.allowRelative?"(?:"+t+"|"+n+")":t;return m.wrap(l+a,r)},m.wrap=function(f,e){return{raw:f=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${f}`,regex:new RegExp(`^${f}$`),scheme:e}},m.uriRegex=m.createRegex({}),w.regex=function(f={}){return f.scheme||f.allowRelative||f.relativeOnly||f.allowQuerySquareBrackets||f.domain?m.createRegex(f):m.uriRegex}},1447:(j,w)=>{const p={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};w.Parser=class{constructor(o,g={}){if(!g[p.settings]&&g.constants)for(const m in g.constants){const f=g.constants[m];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${m} contains invalid ${typeof f} value type`)}this.settings=g[p.settings]?g:Object.assign({[p.settings]:!0,constants:{},functions:{}},g),this.single=null,this._parts=null,this._parse(o)}_parse(o){let g=[],m="",f=0,e=!1;const a=r=>{if(f)throw new Error("Formula missing closing parenthesis");const t=g.length?g[g.length-1]:null;if(e||m||r){if(t&&t.type==="reference"&&r===")")return t.type="function",t.value=this._subFormula(m,t.value),void(m="");if(r===")"){const l=new w.Parser(m,this.settings);g.push({type:"segment",value:l})}else if(e){if(e==="]")return g.push({type:"reference",value:m}),void(m="");g.push({type:"literal",value:m})}else if(p.operatorCharacters.includes(m))t&&t.type==="operator"&&p.operators.includes(t.value+m)?t.value+=m:g.push({type:"operator",value:m});else if(m.match(p.numberRx))g.push({type:"constant",value:parseFloat(m)});else if(this.settings.constants[m]!==void 0)g.push({type:"constant",value:this.settings.constants[m]});else{if(!m.match(p.tokenRx))throw new Error(`Formula contains invalid token: ${m}`);g.push({type:"reference",value:m})}m=""}};for(const r of o)e?r===e?(a(),e=!1):m+=r:f?r==="("?(m+=r,++f):r===")"?(--f,f?m+=r:a(r)):m+=r:r in p.literals?e=p.literals[r]:r==="("?(a(),++f):p.operatorCharacters.includes(r)?(a(),m=r,a()):r!==" "?m+=r:a();a(),g=g.map((r,t)=>r.type!=="operator"||r.value!=="-"||t&&g[t-1].type!=="operator"?r:{type:"operator",value:"n"});let n=!1;for(const r of g){if(r.type==="operator"){if(p.operatorsPrefix.includes(r.value))continue;if(!n)throw new Error("Formula contains an operator in invalid position");if(!p.operators.includes(r.value))throw new Error(`Formula contains an unknown operator ${r.value}`)}else if(n)throw new Error("Formula missing expected operator");n=!n}if(!n)throw new Error("Formula contains invalid trailing operator");g.length===1&&["reference","literal","constant"].includes(g[0].type)&&(this.single={type:g[0].type==="reference"?"reference":"value",value:g[0].value}),this._parts=g.map(r=>{if(r.type==="operator")return p.operatorsPrefix.includes(r.value)?r:r.value;if(r.type!=="reference")return r.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(r.value))throw new Error(`Formula contains invalid reference ${r.value}`);return this.settings.reference?this.settings.reference(r.value):p.reference(r.value)})}_subFormula(o,g){const m=this.settings.functions[g];if(typeof m!="function")throw new Error(`Formula contains unknown function ${g}`);let f=[];if(o){let e="",a=0,n=!1;const r=()=>{if(!e)throw new Error(`Formula contains function ${g} with invalid arguments ${o}`);f.push(e),e=""};for(let t=0;t<o.length;++t){const l=o[t];n?(e+=l,l===n&&(n=!1)):l in p.literals&&!a?(e+=l,n=p.literals[l]):l!==","||a?(e+=l,l==="("?++a:l===")"&&--a):r()}r()}return f=f.map(e=>new w.Parser(e,this.settings)),function(e){const a=[];for(const n of f)a.push(n.evaluate(e));return m.call(e,...a)}}evaluate(o){const g=this._parts.slice();for(let m=g.length-2;m>=0;--m){const f=g[m];if(f&&f.type==="operator"){const e=g[m+1];g.splice(m+1,1);const a=p.evaluate(e,o);g[m]=p.single(f.value,a)}}return p.operatorsOrder.forEach(m=>{for(let f=1;f<g.length-1;)if(m.includes(g[f])){const e=g[f],a=p.evaluate(g[f-1],o),n=p.evaluate(g[f+1],o);g.splice(f,2);const r=p.calculate(e,a,n);g[f-1]=r===0?0:r}else f+=2}),p.evaluate(g[0],o)}},w.Parser.prototype[p.symbol]=!0,p.reference=function(o){return function(g){return g&&g[o]!==void 0?g[o]:null}},p.evaluate=function(o,g){return o===null?null:typeof o=="function"?o(g):o[p.symbol]?o.evaluate(g):o},p.single=function(o,g){if(o==="!")return!g;const m=-g;return m===0?0:m},p.calculate=function(o,g,m){if(o==="??")return p.exists(g)?g:m;if(typeof g=="string"||typeof m=="string"){if(o==="+")return(g=p.exists(g)?g:"")+(p.exists(m)?m:"")}else switch(o){case"^":return Math.pow(g,m);case"*":return g*m;case"/":return g/m;case"%":return g%m;case"+":return g+m;case"-":return g-m}switch(o){case"<":return g<m;case"<=":return g<=m;case">":return g>m;case">=":return g>=m;case"==":return g===m;case"!=":return g!==m;case"&&":return g&&m;case"||":return g||m}return null},p.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:j=>{j.exports=JSON.parse('{"version":"17.13.3"}')}},C={},function j(w){var p=C[w];if(p!==void 0)return p.exports;var o=C[w]={exports:{}};return P[w](o,o.exports,j),o.exports}(5107);var P,C})}(de)),de.exports}var X={},xe;function gt(){if(xe)return X;xe=1;var $=X&&X.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(X,"__esModule",{value:!0}),X.BNExtension=P;const q=$(lt());function P(C){return{type:"BN",base:C.any(),messages:{"bn.nan":"{{#label}} is not a big number","bn.max":'{{#label}} needs to be less than or equal to "{{#threshold}}"',"bn.min":'{{#label}} needs to be greater than or equal to "{{#threshold}}"',"bn.less":'{{#label}} needs to be less than "{{#threshold}}"',"bn.greater":'{{#label}} needs to be greater than "{{#threshold}}"',"bn.positive":"{{#label}} needs to be positive","bn.negative":"{{#label}} needs to be negative"},prepare(j,w){try{return{value:new q.default(j)}}catch{return{errors:w.error("bn.nan")}}},coerce(j){return{value:j.toString(10)}},validate(j){return{value:j}},rules:{gt:{args:[{name:"threshold",ref:!0,assert:j=>q.default.isBN(j),message:"must be a big number",normalize:j=>new q.default(j)},{name:"equal",assert:j=>typeof j=="boolean",message:"must be a boolean"}],validate(j,w,p){const o=new q.default(j);return p.equal&&o.lt(p.threshold)?w.error("bn.min",p):!p.equal&&o.lte(p.threshold)?w.error("bn.greater",p):j}},lt:{args:[{name:"threshold",ref:!0,assert:j=>q.default.isBN(j),message:"must be a big number",normalize:j=>new q.default(j)},{name:"equal",assert:j=>typeof j=="boolean",message:"must be a boolean"}],validate(j,w,p){const o=new q.default(j);return p.equal&&o.gt(p.threshold)?w.error("bn.max",p):!p.equal&&o.gte(p.threshold)?w.error("bn.less",p):j}},min:{alias:"gte",method(j){return this.$_addRule({name:"gt",args:{threshold:j,equal:!0}})}},max:{alias:"lte",method(j){return this.$_addRule({name:"lt",args:{threshold:j,equal:!0}})}},greater:{alias:"gt",method(j){return this.$_addRule({name:"gt",args:{threshold:j,equal:!1}})}},less:{alias:"lt",method(j){return this.$_addRule({name:"lt",args:{threshold:j,equal:!1}})}},positive:{method(){return this.$_addRule({name:"gt",args:{threshold:0,equal:!1}})}},negative:{method(){return this.$_addRule({name:"lt",args:{threshold:0,equal:!1}})}}}}}return X}var ee={},$e;function yt(){if($e)return ee;$e=1;var $=ee&&ee.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(ee,"__esModule",{value:!0}),ee.DIDExtension=w;const q=$(rt),P=st(),C=nt(),j={pk:Object.keys(P.types.KeyType),hash:Object.keys(P.types.HashType),role:Object.keys(P.types.RoleType)};function w(p){return{type:"DID",base:p.string().trim(),messages:{"did.empty":"Expect {{#label}} to be non-empty string","did.invalid":"Expect {{#label}} to be valid did","did.wallet":'Expect wallet type of {{#label}} to be "{{#expected}}" wallet',"did.pk":'Expect pk type of {{#label}} to be "{{#expected}}"',"did.hash":'Expect hash type of {{#label}} to be "{{#expected}}"',"did.role":'Expect role type of {{#label}} to be "{{#expected}}"',"did.prefix":'Expect prefix of {{#label}} to be "{{#expected}}"'},validate(o,g){return!o||typeof o!="string"?{errors:g.error("did.empty",{value:o})}:(0,C.isValid)(o)===!1?{errors:g.error("did.invalid",{value:o})}:{value:o}},rules:{type:{args:[{name:"key",ref:!0,assert:o=>Object.keys(j).includes(o),message:`must be one of ${Object.keys(j).join(", ")}`},{name:"expected",assert:o=>Object.keys(j).some(g=>j[g].includes(o)),message:"must be valid type"}],validate(o,g,m){const f=(0,C.toTypeInfoStr)(o);return m.key==="pk"&&f.pk!==m.expected?g.error("did.pk",{...m,actual:f.pk}):m.key==="hash"&&f.hash!==m.expected?g.error("did.hash",{...m,actual:f.hash}):m.key==="role"&&f.role!==m.expected?g.error("did.role",{...m,actual:f.role}):o}},pk:{method(o){return this.$_addRule({name:"type",args:{key:"pk",expected:o}})}},hash:{method(o){return this.$_addRule({name:"type",args:{key:"hash",expected:o}})}},role:{method(o){return this.$_addRule({name:"type",args:{key:"role",expected:o}})}},wallet:{method(o){return this.$_addRule({name:"wallet",args:{type:o}})},args:[{name:"type",ref:!0,assert:o=>["arcblock","ethereum","default","eth","passkey"].includes(o),message:"must be a string",normalize:o=>o.trim()}],validate(o,g,m={}){const f=(0,C.toTypeInfo)(o),e=(0,C.toTypeInfoStr)(o);return["ethereum","eth"].includes(m.type)&&(0,q.default)(f,C.DID_TYPE_ETHEREUM)===!1?g.error("did.wallet",{expected:m.type,actual:JSON.stringify(e)}):["arcblock","default"].includes(m.type)&&(0,q.default)(f,C.DID_TYPE_ARCBLOCK)===!1?g.error("did.wallet",{expected:m.type,actual:JSON.stringify(e)}):["passkey"].includes(m.type)&&(0,q.default)(f,C.DID_TYPE_PASSKEY)===!1?g.error("did.wallet",{expected:m.type,actual:JSON.stringify(e)}):o}},prefix:{method(o=""){return this.$_addRule({name:"prefix",args:{str:o}})},args:[{name:"str",ref:!0,assert:o=>["",C.DID_PREFIX].includes(o),message:"must be a string",normalize:o=>o.trim()}],validate(o,g,m={}){return m.str&&o.startsWith(m.str)===!1?g.error("did.prefix",{expected:m.str}):!m.str&&(0,C.toAddress)(o)!==o?g.error("did.prefix",{expected:m.str}):o}}}}}return ee}var je;function bt(){return je||(je=1,function($){var q=ae&&ae.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty($,"__esModule",{value:!0}),$.patterns=$.schemas=$.Joi=void 0;const P=q(pt()),C=gt(),j=yt();$.Joi=P.default.extend(j.DIDExtension).extend(C.BNExtension);const w=/^(0x)?([A-Fa-f0-9]{64})$/,p=$.Joi.object({genesisTime:$.Joi.date().iso().required().raw(),genesisTx:$.Joi.string().regex(w).required().allow(""),renaissanceTime:$.Joi.date().iso().required().raw(),renaissanceTx:$.Joi.string().regex(w).required().allow("")}),o=$.Joi.object({address:$.Joi.DID().prefix().role("ROLE_TOKEN").required(),value:$.Joi.BN().positive().required()}),g=$.Joi.object({name:$.Joi.string().min(1).max(256).required(),value:$.Joi.string().min(1).max(1024).required(),description:$.Joi.string().min(1).max(256).optional().allow(""),required:$.Joi.boolean().optional().default(!1)}),m=$.Joi.alternatives().try($.Joi.DID().prefix().role("ROLE_ACCOUNT"),$.Joi.DID().prefix().role("ROLE_APPLICATION"),$.Joi.DID().prefix().role("ROLE_BLOCKLET"),$.Joi.DID().prefix().wallet("ethereum"),$.Joi.DID().prefix().wallet("passkey")),f=$.Joi.array().items($.Joi.object({owner:m.required(),tokensList:$.Joi.array().items(o).default([]),assetsList:$.Joi.array().items($.Joi.DID().prefix().role("ROLE_ASSET")).default([])})),e=$.Joi.array().items({signer:$.Joi.DID().prefix().required(),pk:$.Joi.any().required(),signature:$.Joi.any().required(),delegator:$.Joi.DID().prefix().valid("").optional(),data:$.Joi.any().optional()}),a=$.Joi.object({type:$.Joi.string().min(1).max(32).required(),contractAddress:$.Joi.DID().prefix().wallet("ethereum").required(),chainType:$.Joi.string().min(1).max(32).required(),chainName:$.Joi.string().min(1).max(32).required(),chainId:$.Joi.number().positive().required()}),n=$.Joi.object({type:$.Joi.string().valid("svg","url","uri").required(),content:$.Joi.string().when("type",{is:"uri",then:$.Joi.string().max(20480).dataUri().required()}).when("type",{is:"url",then:$.Joi.string().max(2048).uri({scheme:["http","https"]}).required()})}),r=$.Joi.object({id:$.Joi.string().max(2048).uri({scheme:["http","https"]}).required(),scope:$.Joi.string().valid("public","private").default("public")}),t=$.Joi.object({id:$.Joi.DID().prefix().required(),pk:$.Joi.string().required(),name:$.Joi.string().min(1).max(256).required()}),l={address:$.Joi.DID().prefix().role("ROLE_ASSET").required(),moniker:$.Joi.string().min(2).max(255).required(),data:$.Joi.any().required(),readonly:$.Joi.boolean().default(!1),transferrable:$.Joi.boolean().default(!1),ttl:$.Joi.number().min(0).default(0),parent:$.Joi.DID().prefix().optional().allow(""),issuer:$.Joi.DID().prefix().optional().allow(""),endpoint:r.optional().allow(null).default(null),display:n.optional().allow(null).default(null),tags:$.Joi.array().items($.Joi.string().min(1).max(64)).max(4).optional()},s={address:$.Joi.DID().prefix().role("ROLE_FACTORY").required(),name:$.Joi.string().min(2).max(255).required(),description:$.Joi.string().min(2).max(255).required(),settlement:$.Joi.string().valid("instant","periodic").default("instant"),limit:$.Joi.number().integer().min(0).default(0),trustedIssuers:$.Joi.array().items($.Joi.DID().prefix()).max(8).optional(),data:$.Joi.any().optional().allow(null).default(null),display:n.optional().allow(null).default(null),input:$.Joi.object({value:$.Joi.BN().positive().min("0").default("0"),tokens:$.Joi.array().items(o).max(8).optional(),assets:$.Joi.array().items($.Joi.alternatives().try($.Joi.DID().prefix().role("ROLE_ASSET"),$.Joi.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),variables:$.Joi.array().items($.Joi.object({name:$.Joi.string().min(1).max(255).required(),description:$.Joi.string().max(255).optional().allow(""),required:$.Joi.boolean().required()})).optional()}),output:$.Joi.object({moniker:$.Joi.string().min(2).max(255).required(),data:$.Joi.any().required(),readonly:$.Joi.boolean().default(!1),transferrable:$.Joi.boolean().default(!1),ttl:$.Joi.number().min(0).default(0),parent:$.Joi.string().max(255).required(),issuer:$.Joi.string().max(255).required(),endpoint:r.optional(),display:n.optional(),tags:$.Joi.array().items($.Joi.string().min(1).max(64)).max(4).optional()}),hooks:$.Joi.array().items($.Joi.object({name:$.Joi.string().valid("mint","postMint","preMint").required(),type:$.Joi.string().valid("url","contract").required(),hook:$.Joi.string().min(1).max(4096).required(),compiled:$.Joi.array().items($.Joi.object()).optional()})).optional()};$.schemas={context:p,tokenInput:o,multiInput:f,multiSig:e,foreignToken:a,variableInput:g,nftDisplay:n,nftEndpoint:r,nftIssuer:t,tokenHolder:m,assetProps:l,assetSchema:$.Joi.object(l).options({stripUnknown:!0,noDefaults:!1}),factoryProps:s,factorySchema:$.Joi.object(s).options({stripUnknown:!0,noDefaults:!1})},$.patterns={txHash:w}}(ae)),ae}var vt=bt();function qe({onCancel:$,onSuccess:q,blocklet:P}){const{vaults:C=[],appPid:j}=P,{t:w,locale:p}=le(),{connectApi:o}=De(),{api:g}=re(),{teamDid:m}=Ie(),[f,e]=Ce({loading:!1,fetching:!1,error:"",address:"",fetched:[],errored:[]});z.useEffect(()=>{if(!H.isValid(f.address))return;const l=H.toAddress(f.address),s=f.fetched.find(u=>u.address===l),i=f.errored.find(u=>u.address===l);!f.fetching&&!s&&!i&&(e({fetching:!0}),Qe(Xe.MAIN_CHAIN_ENDPOINT).getAccountState({address:l}).then(d=>{d.state?e({fetching:!1,fetched:[...f.fetched.filter(y=>y.address!==l),d.state]}):e({fetching:!1,errored:[...f.errored.filter(y=>y.address!==l),{address:l}]})}).catch(d=>{console.error(d),e({fetching:!1,error:oe(d)})}))},[f.address,f.fetching]),z.useEffect(()=>{if(f.address){const l=H.toAddress(f.address);if(!H.isValid(l)){e({error:w("blocklet.config.vault.error.invalid")});return}if(vt.schemas.tokenHolder.validate(l).error){e({error:w("blocklet.config.vault.error.holder")});return}if(C.find(i=>i.did===l)){e({error:w("blocklet.config.vault.error.duplicate")});return}if(ct([P.appDid,P.appPid,...P.migratedFrom.map(i=>i.appDid)].filter(Boolean)).includes(l)){e({error:w("blocklet.config.vault.error.appDid")});return}}e({error:""})},[f.address]);const a=async()=>{e({loading:!0});try{const l=await g.configVault({input:{teamDid:m,vaultDid:H.toAddress(f.address)}});o.open({locale:p,action:"approve-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:l.sessionId},messages:{title:w("blocklet.config.vault.approve.title"),scan:w(`blocklet.config.vault.approve.${C.length>0?"byLast":"byOwner"}`),confirm:w("blocklet.config.vault.approve.confirm"),success:w("blocklet.config.vault.approve.success")},onSuccess:()=>{o.open({locale:p,action:"config-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:l.sessionId},messages:{title:w("blocklet.config.vault.commit.title"),scan:w("blocklet.config.vault.commit.scan"),confirm:w("blocklet.config.vault.commit.confirm"),success:w("blocklet.config.vault.commit.success")},onSuccess:()=>{e({loading:!1}),q()},onClose:()=>{e({loading:!1}),o.close()}})},onClose:()=>{e({loading:!1}),o.close()}})}catch(l){e({loading:!1,error:oe(l)})}},n=H.toAddress(f.address),r=[];H.isValid(n)&&r.push({key:w("blocklet.config.vault.role"),value:k.jsx(Be,{color:"primary",variant:"outlined",size:"small",label:H.toTypeInfoStr(n).role||"-"})});const t=f.fetched.find(l=>l.address===n);return t&&r.push({key:w("blocklet.config.vault.firstSeen"),value:be(t.context?.genesisTime,"-")},{key:w("blocklet.config.vault.lastSeen"),value:be(t.context?.renaissanceTime,"-")},{key:w("blocklet.config.vault.migratedFrom"),value:t.migratedFrom.length?t.migratedFrom.map(l=>k.jsx(ve,{did:l,showQrcode:!0,compact:!0,size:14,locale:p},l)):"-"},{key:w("blocklet.config.vault.migratedTo"),value:t.migratedTo.length?t.migratedTo.map(l=>k.jsx(ve,{did:l,showQrcode:!0,compact:!0,size:14,locale:p},l)):"-"}),k.jsx(Ee,{open:!0,fullWidth:!0,showCloseButton:!1,onClose:$,title:k.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[k.jsx(Se,{}),w("blocklet.config.vault.title")]}),actions:k.jsxs(k.Fragment,{children:[k.jsx(G,{onClick:$,children:w("common.cancel")}),k.jsx(G,{onClick:a,variant:"contained",disabled:!!f.error||f.loading,children:w("common.confirm")})]}),children:k.jsxs(ie,{direction:"column",spacing:3,children:[k.jsxs(te,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[w("blocklet.config.vault.desc")," ",w("blocklet.config.vault.tip")]}),C.length>0&&k.jsxs(T,{children:[k.jsxs(te,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[w("blocklet.config.vault.current"),":"]}),k.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:.5},children:[k.jsx(ft,{did:C[C.length-1].did,showQrcode:!0,style:{width:"auto"}}),k.jsx(dt,{vaults:C,appPid:j})]})]}),k.jsx(Ue,{fullWidth:!0,"data-cy":"input-factory-address",label:w("blocklet.config.vault.address"),error:!!f.error,helperText:f.error,value:f.address,onChange:l=>{e({address:l.target.value,error:""})},slotProps:{input:{endAdornment:f.fetching?k.jsx(Ve,{position:"end",children:k.jsx(ce,{size:16})}):null}}}),k.jsx(T,{sx:{"& .info-row__name":{fontSize:"14px"},"& .info-row__value":{fontSize:"14px"}},children:r.map(l=>k.jsx(ut,{valueComponent:"div",nameWidth:120,name:l.key,children:l.value},l.key))})]})})}qe.propTypes={onCancel:J.func.isRequired,onSuccess:J.func.isRequired,blocklet:J.object.isRequired};function _t({teamDid:$,size:q="small",...P}){const{t:C}=le(),{api:j}=re(),[w,p]=z.useState(!1),[o,g]=z.useState(null),m=()=>{p(!1),g(null)},f=async()=>{try{p(!0);const a=await j.rotateSessionKey({input:{teamDid:$}});W.success(C("blocklet.config.rotateSessionKey.success",{count:a.removed?.length||0})),setTimeout(()=>{window.location.reload()},1e3)}catch(a){W.error(oe(a))}finally{p(!1),g(null)}},e={title:C("blocklet.config.rotateSessionKey.title"),description:C("blocklet.config.rotateSessionKey.description"),confirm:C("common.confirm"),cancel:C("common.cancel"),onConfirm:f,onCancel:m};return k.jsxs("div",{...P,children:[k.jsxs(G,{onClick:()=>g(e),color:"error",variant:"outlined",size:q,children:[w?k.jsx(ce,{size:16,style:{marginRight:5}}):null,C("blocklet.config.rotateSessionKey.action")]}),o&&k.jsx(me,{title:o.title,description:o.description,confirm:o.confirm,cancel:o.cancel,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}function he({blocklet:$,onUpdate:q=()=>{},hasPermission:P=!1}){const{info:C,api:j,inService:w}=re(),{t:p,locale:o}=z.useContext(at),[g,m]=Ce({loading:!1,showTransferOwner:!1,showConfigVault:!1}),[f,e]=z.useState(()=>$?.settings?.gateway?.wafPolicy?.enabled??!0),[a,n]=z.useState(()=>!!$?.settings?.enableSessionHardening),[r,t]=z.useState(()=>!!$?.settings?.invite?.enabled),[l,s]=z.useState(()=>{const E=$?.settings?.org||{};return{enabled:E.enabled||!1,maxMemberPerOrg:E.maxMemberPerOrg||100,maxOrgPerUser:E.maxOrgPerUser||10}}),i=g.loading||!P,{did:u}=$.meta,d=w?window.env?.gateway?.wafPolicy?.enabled:C?.routing.wafPolicy?.enabled;if(Ae($.status))return null;const y=$.environments.find(E=>E.key===Z.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE),_=!y||y.value==="yes",c=$.environments.find(E=>E.key===Z.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE)?.value||Z.BLOCKLET_TENANT_MODES.SINGLE,h=(E,I)=>async L=>{if(!g.loading){m({loading:!0});try{const{checked:N}=L.target,{blocklet:B}=await j.configBlocklet({input:{did:$.meta.did,configs:[{key:Z.BLOCKLET_CONFIGURABLE_KEY[E],value:I(N)}]}});q(B)}catch(N){W.error(N.message)}finally{m({loading:!1})}}},b=h("BLOCKLET_DELETABLE",E=>E?"no":"yes"),x=h("BLOCKLET_APP_TENANT_MODE",E=>E?Z.BLOCKLET_TENANT_MODES.MULTIPLE:Z.BLOCKLET_TENANT_MODES.SINGLE),S=(E,I)=>async L=>{if(!g.loading){m({loading:!0});try{const N=L.target.checked;await j.updateBlockletSettings({input:E(N)}),I&&I(N)}catch(N){W.error(N.message)}finally{m({loading:!1})}}},R=S(E=>({did:$.meta.did,invite:{enabled:E}}),t),O=S(E=>({did:$.meta.did,org:{enabled:E,maxMemberPerOrg:100,maxOrgPerUser:10}}),E=>{s({...l,enabled:E})}),A=async(E,I)=>{if(!g.loading){m({loading:!0});try{await j.updateBlockletSettings({input:{did:$.meta.did,org:{...l,[E]:I}}}),s({...l,[E]:I})}catch(L){W.error(L.message)}finally{m({loading:!1})}}},D=S(E=>({did:$.meta.did,gateway:{wafPolicy:{enabled:E}}}),e),M=S(E=>({did:$.meta.did,enableSessionHardening:E}),E=>{n(E),et()}),F=async()=>{if(!g.loading){m({loading:!0});try{const{blocklet:E}=await j.getBlocklet({input:{did:$.meta.did}});q(E)}catch(E){W.error(E.message)}finally{m({loading:!1})}}};return k.jsxs(ie,{p:3,sx:{border:"1px solid red",borderRadius:2,p:3},className:"advanced-config",children:[!w&&k.jsxs(k.Fragment,{children:[k.jsx(U,{title:p("blocklet.config.deletable.name"),desc:p(_?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:!_,defaultChecked:!0,onChange:b})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}})]}),k.jsx(Te,{inService:w,disabled:i,loading:g.loading,onChange:F}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),w&&k.jsx(tt,{role:"owner",children:E=>(E||mt)&&k.jsxs(k.Fragment,{children:[k.jsx(U,{title:p("blocklet.config.vault.title"),desc:p("blocklet.config.vault.desc"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(G,{variant:"contained",color:"primary",size:"small","data-cy":"config-vault",onClick:()=>m({showConfigVault:!0}),children:[k.jsx(Se,{style:{fontSize:"1.3em",marginRight:4}}),p("blocklet.config.vault.title")]})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),g.showConfigVault&&k.jsx(qe,{blocklet:$,onCancel:()=>m({showConfigVault:!1}),onSuccess:()=>m({showConfigVault:!1})}),k.jsx(U,{title:p("team.transferApp.name"),desc:p("team.transferApp.description"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(G,{variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"transfer-app",onClick:()=>m({showTransferOwner:!0}),children:[k.jsx(We,{style:{fontSize:"1.3em",marginRight:4}}),p("team.transferApp.name")]})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),g.showTransferOwner&&k.jsx(Le,{onCancel:()=>m({showTransferOwner:!1}),onSuccess:()=>m({showTransferOwner:!1})})]})}),k.jsx(U,{title:p("blocklet.config.clearCache.name"),desc:p("blocklet.config.clearCache.purpose"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(ht,{teamDid:u})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:p("blocklet.config.rotateSessionKey.name"),desc:p("blocklet.config.rotateSessionKey.purpose"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(_t,{style:{whiteSpace:"nowrap"},teamDid:u})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:p("blocklet.config.tenantMode.name"),desc:p(`blocklet.config.tenantMode.${c}`),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:c===Z.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:x})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:p("team.invite.setting"),desc:p(`team.invite.${r?"enabled":"disabled"}`),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:r,onChange:R})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:k.jsxs(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:[p("setting.form.enableSessionHardening.switchLabel"),k.jsx(ge,{title:p("setting.form.enableSessionHardening.switchTips"),children:k.jsx(ye,{sx:{ml:.5,fontSize:"20px"},color:"primary"})})]}),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:a,onChange:M})})}),d&&k.jsxs(k.Fragment,{children:[k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:k.jsxs(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:[p("router.gateway.wafPolicy.title"),k.jsx(ge,{title:k.jsx(T,{sx:{fontSize:"14px",lineHeight:1.5},children:k.jsx(T,{sx:{color:"common.white",ml:.5},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${o}/enable-web-application-firewall`,target:"_blank",rel:"noopener noreferrer",children:p("dashboard.document")})}),children:k.jsx(ye,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]}),desc:p("router.gateway.wafPolicy.switchLabel"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:f,onChange:D})})})]}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:k.jsx(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:p("common.orgs")}),desc:p("team.orgs.explain"),children:k.jsxs(T,{sx:{display:"flex",flexDirection:"column",gap:2,width:"100%",alignSelf:{xs:"flex-start",md:"flex-end"}},children:[k.jsx(Y,{disabled:i,checked:l.enabled,onChange:O}),l.enabled&&k.jsxs(T,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:400,mt:1},children:[k.jsx(_e,{style:{marginTop:0},disabled:i,loading:g.loading,type:"number",min:2,initialValue:l.maxOrgPerUser,label:p("team.orgs.invite.maxOrgs"),placeholder:p("team.orgs.invite.maxOrgs"),onSubmit:E=>A("maxOrgPerUser",E)}),k.jsx(_e,{style:{marginTop:0},disabled:i,loading:g.loading,type:"number",min:2,initialValue:l.maxMemberPerOrg,label:p("team.orgs.invite.maxMembers"),placeholder:p("team.orgs.invite.maxMembers"),onSubmit:E=>A("maxMemberPerOrg",E)})]})]})})]})}const wt=ue(he,"mutate_blocklets"),xt=ue(he,"",Oe);function $t($){const{inService:q}=re();return q?k.jsx(xt,{...$}):k.jsx(wt,{...$})}he.propTypes={blocklet:J.object.isRequired,onUpdate:J.func,hasPermission:J.bool};function pe({blocklet:$,onUpdate:q=()=>{},hasPermission:P=!1}){return Ae($.status)?null:k.jsx(St,{children:k.jsx($t,{blocklet:$,onUpdate:q,hasPermission:P})})}const jt=ue(pe,"mutate_blocklets"),kt=ue(pe,"",Oe);function Xt($){const{inService:q}=re();return q?k.jsx(kt,{...$}):k.jsx(jt,{...$})}pe.propTypes={blocklet:J.object.isRequired,onUpdate:J.func,hasPermission:J.bool};const St=ke(T)`
|
|
7
|
+
`;var ae={},de={exports:{}},we;function pt(){return we||(we=1,function($,q){(function(P,C){$.exports=C()})(self,()=>{return P={7629:(j,w,p)=>{const o=p(375),g=p(8571),m=p(9474),f=p(1687),e=p(8652),a=p(8160),n=p(3292),r=p(6354),t=p(8901),l=p(9708),s=p(6914),i=p(2294),u=p(6133),d=p(1152),y=p(8863),_=p(2036),v={Base:class{constructor(c){this.type=c,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new i.Ids,this._preferences=null,this._refs=new u.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return o(typeof l.describe=="function","Manifest functionality disabled"),l.describe(this)}allow(...c){return a.verifyFlat(c,"allow"),this._values(c,"_valids")}alter(c){o(c&&typeof c=="object"&&!Array.isArray(c),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const h=this.clone();h.$_terms.alterations=h.$_terms.alterations||[];for(const b in c){const x=c[b];o(typeof x=="function","Alteration adjuster for",b,"must be a function"),h.$_terms.alterations.push({target:b,adjuster:x})}return h.$_temp.ruleset=!1,h}artifact(c){return o(c!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",c)}cast(c){return o(c===!1||typeof c=="string","Invalid to value"),o(c===!1||this._definition.cast[c],"Type",this.type,"does not support casting to",c),this.$_setFlag("cast",c===!1?void 0:c)}default(c,h){return this._default("default",c,h)}description(c){return o(c&&typeof c=="string","Description must be a non-empty string"),this.$_setFlag("description",c)}empty(c){const h=this.clone();return c!==void 0&&(c=h.$_compile(c,{override:!1})),h.$_setFlag("empty",c,{clone:!1})}error(c){return o(c,"Missing error"),o(c instanceof Error||typeof c=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",c)}example(c,h={}){return o(c!==void 0,"Missing example"),a.assertOptions(h,["override"]),this._inner("examples",c,{single:!0,override:h.override})}external(c,h){return typeof c=="object"&&(o(!h,"Cannot combine options with description"),h=c.description,c=c.method),o(typeof c=="function","Method must be a function"),o(h===void 0||h&&typeof h=="string","Description must be a non-empty string"),this._inner("externals",{method:c,description:h},{single:!0})}failover(c,h){return this._default("failover",c,h)}forbidden(){return this.presence("forbidden")}id(c){return c?(o(typeof c=="string","id must be a non-empty string"),o(/^[^\.]+$/.test(c),"id cannot contain period character"),this.$_setFlag("id",c)):this.$_setFlag("id",void 0)}invalid(...c){return this._values(c,"_invalids")}label(c){return o(c&&typeof c=="string","Label name must be a non-empty string"),this.$_setFlag("label",c)}meta(c){return o(c!==void 0,"Meta cannot be undefined"),this._inner("metas",c,{single:!0})}note(...c){o(c.length,"Missing notes");for(const h of c)o(h&&typeof h=="string","Notes must be non-empty strings");return this._inner("notes",c)}only(c=!0){return o(typeof c=="boolean","Invalid mode:",c),this.$_setFlag("only",c)}optional(){return this.presence("optional")}prefs(c){o(c,"Missing preferences"),o(c.context===void 0,"Cannot override context"),o(c.externals===void 0,"Cannot override externals"),o(c.warnings===void 0,"Cannot override warnings"),o(c.debug===void 0,"Cannot override debug"),a.checkPreferences(c);const h=this.clone();return h._preferences=a.preferences(h._preferences,c),h}presence(c){return o(["optional","required","forbidden"].includes(c),"Unknown presence mode",c),this.$_setFlag("presence",c)}raw(c=!0){return this.$_setFlag("result",c?"raw":void 0)}result(c){return o(["raw","strip"].includes(c),"Unknown result mode",c),this.$_setFlag("result",c)}required(){return this.presence("required")}strict(c){const h=this.clone(),b=c!==void 0&&!c;return h._preferences=a.preferences(h._preferences,{convert:b}),h}strip(c=!0){return this.$_setFlag("result",c?"strip":void 0)}tag(...c){o(c.length,"Missing tags");for(const h of c)o(h&&typeof h=="string","Tags must be non-empty strings");return this._inner("tags",c)}unit(c){return o(c&&typeof c=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",c)}valid(...c){a.verifyFlat(c,"valid");const h=this.allow(...c);return h.$_setFlag("only",!!h._valids,{clone:!1}),h}when(c,h){const b=this.clone();b.$_terms.whens||(b.$_terms.whens=[]);const x=n.when(b,c,h);if(!["any","link"].includes(b.type)){const S=x.is?[x]:x.switch;for(const R of S)o(!R.then||R.then.type==="any"||R.then.type===b.type,"Cannot combine",b.type,"with",R.then&&R.then.type),o(!R.otherwise||R.otherwise.type==="any"||R.otherwise.type===b.type,"Cannot combine",b.type,"with",R.otherwise&&R.otherwise.type)}return b.$_terms.whens.push(x),b.$_mutateRebuild()}cache(c){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const h=this.clone();return h._cache=c||e.provider.provision(),h.$_temp.ruleset=!1,h}clone(){const c=Object.create(Object.getPrototypeOf(this));return this._assign(c)}concat(c){o(a.isSchema(c),"Invalid schema object"),o(this.type==="any"||c.type==="any"||c.type===this.type,"Cannot merge type",this.type,"with another type:",c.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!c._inRuleset(),"Cannot concatenate a schema with open ruleset");let h=this.clone();if(this.type==="any"&&c.type!=="any"){const b=c.clone();for(const x of Object.keys(h))x!=="type"&&(b[x]=h[x]);h=b}h._ids.concat(c._ids),h._refs.register(c,u.toSibling),h._preferences=h._preferences?a.preferences(h._preferences,c._preferences):c._preferences,h._valids=_.merge(h._valids,c._valids,c._invalids),h._invalids=_.merge(h._invalids,c._invalids,c._valids);for(const b of c._singleRules.keys())h._singleRules.has(b)&&(h._rules=h._rules.filter(x=>x.keep||x.name!==b),h._singleRules.delete(b));for(const b of c._rules)c._definition.rules[b.method].multi||h._singleRules.set(b.name,b),h._rules.push(b);if(h._flags.empty&&c._flags.empty){h._flags.empty=h._flags.empty.concat(c._flags.empty);const b=Object.assign({},c._flags);delete b.empty,f(h._flags,b)}else if(c._flags.empty){h._flags.empty=c._flags.empty;const b=Object.assign({},c._flags);delete b.empty,f(h._flags,b)}else f(h._flags,c._flags);for(const b in c.$_terms){const x=c.$_terms[b];x?h.$_terms[b]?h.$_terms[b]=h.$_terms[b].concat(x):h.$_terms[b]=x.slice():h.$_terms[b]||(h.$_terms[b]=x)}return this.$_root._tracer&&this.$_root._tracer._combine(h,[this,c]),h.$_mutateRebuild()}extend(c){return o(!c.base,"Cannot extend type with another base"),t.type(this,c)}extract(c){return c=Array.isArray(c)?c:c.split("."),this._ids.reach(c)}fork(c,h){o(!this._inRuleset(),"Cannot fork inside a ruleset");let b=this;for(let x of[].concat(c))x=Array.isArray(x)?x:x.split("."),b=b._ids.fork(x,h,b);return b.$_temp.ruleset=!1,b}rule(c){const h=this._definition;a.assertOptions(c,Object.keys(h.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const b=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(b>=0&&b<this._rules.length,"Cannot apply rules to empty ruleset");const x=this.clone();for(let S=b;S<x._rules.length;++S){const R=x._rules[S],O=g(R);for(const A in c)h.modifiers[A](O,c[A]),o(O.name===R.name,"Cannot change rule name");x._rules[S]=O,x._singleRules.get(O.name)===R&&x._singleRules.set(O.name,O)}return x.$_temp.ruleset=!1,x.$_mutateRebuild()}get ruleset(){o(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const c=this.clone();return c.$_temp.ruleset=c._rules.length,c}get $(){return this.ruleset}tailor(c){c=[].concat(c),o(!this._inRuleset(),"Cannot tailor inside a ruleset");let h=this;if(this.$_terms.alterations)for(const{target:b,adjuster:x}of this.$_terms.alterations)c.includes(b)&&(h=x(h),o(a.isSchema(h),"Alteration adjuster for",b,"failed to return a schema object"));return h=h.$_modify({each:b=>b.tailor(c),ref:!1}),h.$_temp.ruleset=!1,h.$_mutateRebuild()}tracer(){return d.location?d.location(this):this}validate(c,h){return y.entry(c,this,h)}validateAsync(c,h){return y.entryAsync(c,this,h)}$_addRule(c){typeof c=="string"&&(c={name:c}),o(c&&typeof c=="object","Invalid options"),o(c.name&&typeof c.name=="string","Invalid rule name");for(const R in c)o(R[0]!=="_","Cannot set private rule properties");const h=Object.assign({},c);h._resolve=[],h.method=h.method||h.name;const b=this._definition.rules[h.method],x=h.args;o(b,"Unknown rule",h.method);const S=this.clone();if(x){o(Object.keys(x).length===1||Object.keys(x).length===this._definition.rules[h.name].args.length,"Invalid rule definition for",this.type,h.name);for(const R in x){let O=x[R];if(b.argsByName){const A=b.argsByName.get(R);if(A.ref&&a.isResolvable(O))h._resolve.push(R),S.$_mutateRegister(O);else if(A.normalize&&(O=A.normalize(O),x[R]=O),A.assert){const D=a.validateArg(O,R,A);o(!D,D,"or reference")}}O!==void 0?x[R]=O:delete x[R]}}return b.multi||(S._ruleRemove(h.name,{clone:!1}),S._singleRules.set(h.name,h)),S.$_temp.ruleset===!1&&(S.$_temp.ruleset=null),b.priority?S._rules.unshift(h):S._rules.push(h),S}$_compile(c,h){return n.schema(this.$_root,c,h)}$_createError(c,h,b,x,S,R={}){const O=R.flags!==!1?this._flags:{},A=R.messages?s.merge(this._definition.messages,R.messages):this._definition.messages;return new r.Report(c,h,b,O,A,x,S)}$_getFlag(c){return this._flags[c]}$_getRule(c){return this._singleRules.get(c)}$_mapLabels(c){return c=Array.isArray(c)?c:c.split("."),this._ids.labels(c)}$_match(c,h,b,x){(b=Object.assign({},b)).abortEarly=!0,b._externals=!1,h.snapshot();const S=!y.validate(c,this,h,b,x).errors;return h.restore(),S}$_modify(c){return a.assertOptions(c,["each","once","ref","schema"]),i.schema(this,c)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(c,{source:h,name:b,path:x,key:S})=>{const R=this._definition[h][b]&&this._definition[h][b].register;R!==!1&&this.$_mutateRegister(c,{family:R,key:S})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(c,{family:h,key:b}={}){this._refs.register(c,h),this._ids.register(c,{key:b})}$_property(c){return this._definition.properties[c]}$_reach(c){return this._ids.reach(c)}$_rootReferences(){return this._refs.roots()}$_setFlag(c,h,b={}){o(c[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const x=this._definition.flags[c]||{};if(m(h,x.default)&&(h=void 0),m(h,this._flags[c]))return this;const S=b.clone!==!1?this.clone():this;return h!==void 0?(S._flags[c]=h,S.$_mutateRegister(h)):delete S._flags[c],c[0]!=="_"&&(S.$_temp.ruleset=!1),S}$_parent(c,...h){return this[c][a.symbols.parent].call(this,...h)}$_validate(c,h,b){return y.validate(c,this,h,b)}_assign(c){c.type=this.type,c.$_root=this.$_root,c.$_temp=Object.assign({},this.$_temp),c.$_temp.whens={},c._ids=this._ids.clone(),c._preferences=this._preferences,c._valids=this._valids&&this._valids.clone(),c._invalids=this._invalids&&this._invalids.clone(),c._rules=this._rules.slice(),c._singleRules=g(this._singleRules,{shallow:!0}),c._refs=this._refs.clone(),c._flags=Object.assign({},this._flags),c._cache=null,c.$_terms={};for(const h in this.$_terms)c.$_terms[h]=this.$_terms[h]?this.$_terms[h].slice():null;c.$_super={};for(const h in this.$_super)c.$_super[h]=this._super[h].bind(c);return c}_bare(){const c=this.clone();c._reset();const h=c._definition.terms;for(const b in h){const x=h[b];c.$_terms[b]=x.init}return c.$_mutateRebuild()}_default(c,h,b={}){return a.assertOptions(b,"literal"),o(h!==void 0,"Missing",c,"value"),o(typeof h=="function"||!b.literal,"Only function value supports literal option"),typeof h=="function"&&b.literal&&(h={[a.symbols.literal]:!0,literal:h}),this.$_setFlag(c,h)}_generate(c,h,b){if(!this.$_terms.whens)return{schema:this};const x=[],S=[];for(let A=0;A<this.$_terms.whens.length;++A){const D=this.$_terms.whens[A];if(D.concat){x.push(D.concat),S.push(`${A}.concat`);continue}const M=D.ref?D.ref.resolve(c,h,b):c,F=D.is?[D]:D.switch,E=S.length;for(let I=0;I<F.length;++I){const{is:L,then:N,otherwise:B}=F[I],K=`${A}${D.switch?"."+I:""}`;if(L.$_match(M,h.nest(L,`${K}.is`),b)){if(N){const se=h.localize([...h.path,`${K}.then`],h.ancestors,h.schemas),{schema:fe,id:ne}=N._generate(c,se,b);x.push(fe),S.push(`${K}.then${ne?`(${ne})`:""}`);break}}else if(B){const se=h.localize([...h.path,`${K}.otherwise`],h.ancestors,h.schemas),{schema:fe,id:ne}=B._generate(c,se,b);x.push(fe),S.push(`${K}.otherwise${ne?`(${ne})`:""}`);break}}if(D.break&&S.length>E)break}const R=S.join(", ");if(h.mainstay.tracer.debug(h,"rule","when",R),!R)return{schema:this};if(!h.mainstay.tracer.active&&this.$_temp.whens[R])return{schema:this.$_temp.whens[R],id:R};let O=this;this._definition.generate&&(O=this._definition.generate(this,c,h,b));for(const A of x)O=O.concat(A);return this.$_root._tracer&&this.$_root._tracer._combine(O,[this,...x]),this.$_temp.whens[R]=O,{schema:O,id:R}}_inner(c,h,b={}){o(!this._inRuleset(),`Cannot set ${c} inside a ruleset`);const x=this.clone();return x.$_terms[c]&&!b.override||(x.$_terms[c]=[]),b.single?x.$_terms[c].push(h):x.$_terms[c].push(...h),x.$_temp.ruleset=!1,x}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(c,h={}){if(!this._singleRules.has(c))return this;const b=h.clone!==!1?this.clone():this;b._singleRules.delete(c);const x=[];for(let S=0;S<b._rules.length;++S){const R=b._rules[S];R.name!==c||R.keep?x.push(R):b._inRuleset()&&S<b.$_temp.ruleset&&--b.$_temp.ruleset}return b._rules=x,b}_values(c,h){a.verifyFlat(c,h.slice(1,-1));const b=this.clone(),x=c[0]===a.symbols.override;if(x&&(c=c.slice(1)),!b[h]&&c.length?b[h]=new _:x&&(b[h]=c.length?new _:null,b.$_mutateRebuild()),!b[h])return b;x&&b[h].override();for(const S of c){o(S!==void 0,"Cannot call allow/valid/invalid with undefined"),o(S!==a.symbols.override,"Override must be the first value");const R=h==="_invalids"?"_valids":"_invalids";b[R]&&(b[R].remove(S),b[R].length||(o(h==="_valids"||!b._flags.only,"Setting invalid value",S,"leaves schema rejecting all values due to previous valid rule"),b[R]=null)),b[h].add(S,b._refs)}return b}}};v.Base.prototype[a.symbols.any]={version:a.version,compile:n.compile,root:"$_root"},v.Base.prototype.isImmutable=!0,v.Base.prototype.deny=v.Base.prototype.invalid,v.Base.prototype.disallow=v.Base.prototype.invalid,v.Base.prototype.equal=v.Base.prototype.valid,v.Base.prototype.exist=v.Base.prototype.required,v.Base.prototype.not=v.Base.prototype.invalid,v.Base.prototype.options=v.Base.prototype.prefs,v.Base.prototype.preferences=v.Base.prototype.prefs,j.exports=new v.Base},8652:(j,w,p)=>{const o=p(375),g=p(8571),m=p(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};w.provider={provision:e=>new f.Cache(e)},f.Cache=class{constructor(e={}){m.assertOptions(e,["max"]),o(e.max===void 0||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(e,a){if(e!==null&&!f.supported.has(typeof e))return;let n=this._map.get(e);if(n)return n.value=a,void this._list.first(n);n=this._list.unshift({key:e,value:a}),this._map.set(e,n),this._compact()}get(e){const a=this._map.get(e);if(a)return this._list.first(a),g(a.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:a,prev:n}=e;return a.prev=n,n&&(n.next=a),e===this.tail&&(this.tail=a),e.prev=null,e.next=null,e}}},8160:(j,w,p)=>{const o=p(375),g=p(7916),m=p(5934);let f,e;const a={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};w.version=m.version,w.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},w.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},w.assertOptions=function(n,r,t="Options"){o(n&&typeof n=="object"&&!Array.isArray(n),"Options must be of type object");const l=Object.keys(n).filter(s=>!r.includes(s));o(l.length===0,`${t} contain unknown keys: ${l}`)},w.checkPreferences=function(n){e=e||p(3378);const r=e.preferences.validate(n);if(r.error)throw new g([r.error.details[0].message])},w.compare=function(n,r,t){switch(t){case"=":return n===r;case">":return n>r;case"<":return n<r;case">=":return n>=r;case"<=":return n<=r}},w.default=function(n,r){return n===void 0?r:n},w.isIsoDate=function(n){return a.isoDate.test(n)},w.isNumber=function(n){return typeof n=="number"&&!isNaN(n)},w.isResolvable=function(n){return!!n&&(n[w.symbols.ref]||n[w.symbols.template])},w.isSchema=function(n,r={}){const t=n&&n[w.symbols.any];return!!t&&(o(r.legacy||t.version===w.version,"Cannot mix different versions of joi schemas"),!0)},w.isValues=function(n){return n[w.symbols.values]},w.limit=function(n){return Number.isSafeInteger(n)&&n>=0},w.preferences=function(n,r){f=f||p(6914),n=n||{},r=r||{};const t=Object.assign({},n,r);return r.errors&&n.errors&&(t.errors=Object.assign({},n.errors,r.errors),t.errors.wrap=Object.assign({},n.errors.wrap,r.errors.wrap)),r.messages&&(t.messages=f.compile(r.messages,n.messages)),delete t[w.symbols.prefs],t},w.tryWithPath=function(n,r,t={}){try{return n()}catch(l){throw l.path!==void 0?l.path=r+"."+l.path:l.path=r,t.append&&(l.message=`${l.message} (${l.path})`),l}},w.validateArg=function(n,r,{assert:t,message:l}){if(w.isSchema(t)){const s=t.validate(n);return s.error?s.error.message:void 0}if(!t(n))return r?`${r} ${l}`:l},w.verifyFlat=function(n,r){for(const t of n)o(!Array.isArray(t),"Method no longer accepts array arguments:",r)}},3292:(j,w,p)=>{const o=p(375),g=p(8160),m=p(6133),f={};w.schema=function(e,a,n={}){g.assertOptions(n,["appendPath","override"]);try{return f.schema(e,a,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},f.schema=function(e,a,n){o(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(o(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const r=(t,...l)=>n.override!==!1?t.valid(e.override,...l):t.valid(...l);if(f.simple(a))return r(e,a);if(typeof a=="function")return e.custom(a);if(o(typeof a=="object","Invalid schema content:",typeof a),g.isResolvable(a))return r(e,a);if(g.isSchema(a))return a;if(Array.isArray(a)){for(const t of a)if(!f.simple(t))return e.alternatives().try(...a);return r(e,...a)}return a instanceof RegExp?e.string().regex(a):a instanceof Date?r(e.date(),a):(o(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(a))},w.ref=function(e,a){return m.isRef(e)?e:m.create(e,a)},w.compile=function(e,a,n={}){g.assertOptions(n,["legacy"]);const r=a&&a[g.symbols.any];if(r)return o(n.legacy||r.version===g.version,"Cannot mix different versions of joi schemas:",r.version,g.version),a;if(typeof a!="object"||!n.legacy)return w.schema(e,a,{appendPath:!0});const t=f.walk(a);return t?t.compile(t.root,a):w.schema(e,a,{appendPath:!0})},f.walk=function(e){if(typeof e!="object")return null;if(Array.isArray(e)){for(const n of e){const r=f.walk(n);if(r)return r}return null}const a=e[g.symbols.any];if(a)return{root:e[a.root],compile:a.compile};o(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const n in e){const r=f.walk(e[n]);if(r)return r}return null},f.simple=function(e){return e===null||["boolean","string","number"].includes(typeof e)},w.when=function(e,a,n){if(n===void 0&&(o(a&&typeof a=="object","Missing options"),n=a,a=m.create(".")),Array.isArray(n)&&(n={switch:n}),g.assertOptions(n,["is","not","then","otherwise","switch","break"]),g.isSchema(a))return o(n.is===void 0,'"is" can not be used with a schema condition'),o(n.not===void 0,'"not" can not be used with a schema condition'),o(n.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(e,{is:a,then:n.then,otherwise:n.otherwise,break:n.break});if(o(m.isRef(a)||typeof a=="string","Invalid condition:",a),o(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let t=n;n.not!==void 0&&(t={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let l=t.is!==void 0?e.$_compile(t.is):e.$_root.invalid(null,!1,0,"").required();return o(t.then!==void 0||t.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(t.break===void 0||t.then===void 0||t.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is===void 0||m.isRef(n.is)||g.isSchema(n.is)||(l=l.required()),f.condition(e,{ref:w.ref(a),is:l,then:t.then,otherwise:t.otherwise,break:t.break})}o(Array.isArray(n.switch),'"switch" must be an array'),o(n.is===void 0,'Cannot combine "switch" with "is"'),o(n.not===void 0,'Cannot combine "switch" with "not"'),o(n.then===void 0,'Cannot combine "switch" with "then"');const r={ref:w.ref(a),switch:[],break:n.break};for(let t=0;t<n.switch.length;++t){const l=n.switch[t],s=t===n.switch.length-1;g.assertOptions(l,s?["is","then","otherwise"]:["is","then"]),o(l.is!==void 0,'Switch statement missing "is"'),o(l.then!==void 0,'Switch statement missing "then"');const i={is:e.$_compile(l.is),then:e.$_compile(l.then)};if(m.isRef(l.is)||g.isSchema(l.is)||(i.is=i.is.required()),s){o(n.otherwise===void 0||l.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const u=n.otherwise!==void 0?n.otherwise:l.otherwise;u!==void 0&&(o(r.break===void 0,"Cannot specify both otherwise and break"),i.otherwise=e.$_compile(u))}r.switch.push(i)}return r},f.condition=function(e,a){for(const n of["then","otherwise"])a[n]===void 0?delete a[n]:a[n]=e.$_compile(a[n]);return a}},6354:(j,w,p)=>{const o=p(5688),g=p(8160),m=p(3328);w.Report=class{constructor(f,e,a,n,r,t,l){if(this.code=f,this.flags=n,this.messages=r,this.path=t.path,this.prefs=l,this.state=t,this.value=e,this.message=null,this.template=null,this.local=a||{},this.local.label=w.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const s=this.path[this.path.length-1];typeof s!="object"&&(this.local.key=s)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,e){return w.template(this.value,f,e||this.code,this.state,this.prefs)}},w.path=function(f){let e="";for(const a of f)typeof a!="object"&&(typeof a=="string"?(e&&(e+="."),e+=a):e+=`[${a}]`);return e},w.template=function(f,e,a,n,r){if(!e)return;if(m.isTemplate(e))return a!=="root"?e:null;let t=r.errors.language;if(g.isResolvable(t)&&(t=t.resolve(f,n,r)),t&&e[t]){if(e[t][a]!==void 0)return e[t][a];if(e[t]["*"]!==void 0)return e[t]["*"]}return e[a]?e[a]:e["*"]},w.label=function(f,e,a,n){if(!a.errors.label)return"";if(f.label)return f.label;let r=e.path;return a.errors.label==="key"&&e.path.length>1&&(r=e.path.slice(-1)),w.path(r)||w.template(null,a.messages,"root",e,a)||n&&w.template(null,n,"root",e,a)||"value"},w.process=function(f,e,a){if(!f)return null;const{override:n,message:r,details:t}=w.details(f);if(n)return n;if(a.errors.stack)return new w.ValidationError(r,t,e);const l=Error.stackTraceLimit;Error.stackTraceLimit=0;const s=new w.ValidationError(r,t,e);return Error.stackTraceLimit=l,s},w.details=function(f,e={}){let a=[];const n=[];for(const r of f){if(r instanceof Error){if(e.override!==!1)return{override:r};const l=r.toString();a.push(l),n.push({message:l,type:"override",context:{error:r}});continue}const t=r.toString();a.push(t),n.push({message:t,path:r.path.filter(l=>typeof l!="object"),type:r.code,context:r.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:n}},w.ValidationError=class extends Error{constructor(f,e,a){super(f),this._original=a,this.details=e}static isError(f){return f instanceof w.ValidationError}},w.ValidationError.prototype.isJoi=!0,w.ValidationError.prototype.name="ValidationError",w.ValidationError.prototype.annotate=o.error},8901:(j,w,p)=>{const o=p(375),g=p(8571),m=p(8160),f=p(6914),e={};w.type=function(a,n){const r=Object.getPrototypeOf(a),t=g(r),l=a._assign(Object.create(t)),s=Object.assign({},n);delete s.base,t._definition=s;const i=r._definition||{};s.messages=f.merge(i.messages,s.messages),s.properties=Object.assign({},i.properties,s.properties),l.type=s.type,s.flags=Object.assign({},i.flags,s.flags);const u=Object.assign({},i.terms);if(s.terms)for(const v in s.terms){const c=s.terms[v];o(l.$_terms[v]===void 0,"Invalid term override for",s.type,v),l.$_terms[v]=c.init,u[v]=c}s.terms=u,s.args||(s.args=i.args),s.prepare=e.prepare(s.prepare,i.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=e.coerce(s.coerce,i.coerce),s.validate=e.validate(s.validate,i.validate);const d=Object.assign({},i.rules);if(s.rules)for(const v in s.rules){const c=s.rules[v];o(typeof c=="object","Invalid rule definition for",s.type,v);let h=c.method;if(h===void 0&&(h=function(){return this.$_addRule(v)}),h&&(o(!t[v],"Rule conflict in",s.type,v),t[v]=h),o(!d[v],"Rule conflict in",s.type,v),d[v]=c,c.alias){const b=[].concat(c.alias);for(const x of b)t[x]=c.method}c.args&&(c.argsByName=new Map,c.args=c.args.map(b=>(typeof b=="string"&&(b={name:b}),o(!c.argsByName.has(b.name),"Duplicated argument name",b.name),m.isSchema(b.assert)&&(b.assert=b.assert.strict().label(b.name)),c.argsByName.set(b.name,b),b)))}s.rules=d;const y=Object.assign({},i.modifiers);if(s.modifiers)for(const v in s.modifiers){o(!t[v],"Rule conflict in",s.type,v);const c=s.modifiers[v];o(typeof c=="function","Invalid modifier definition for",s.type,v);const h=function(b){return this.rule({[v]:b})};t[v]=h,y[v]=c}if(s.modifiers=y,s.overrides){t._super=r,l.$_super={};for(const v in s.overrides)o(r[v],"Cannot override missing",v),s.overrides[v][m.symbols.parent]=r[v],l.$_super[v]=r[v].bind(l);Object.assign(t,s.overrides)}s.cast=Object.assign({},i.cast,s.cast);const _=Object.assign({},i.manifest,s.manifest);return _.build=e.build(s.manifest&&s.manifest.build,i.manifest&&i.manifest.build),s.manifest=_,s.rebuild=e.rebuild(s.rebuild,i.rebuild),l},e.build=function(a,n){return a&&n?function(r,t){return n(a(r,t),t)}:a||n},e.coerce=function(a,n){return a&&n?{from:a.from&&n.from?[...new Set([...a.from,...n.from])]:null,method(r,t){let l;if((!n.from||n.from.includes(typeof r))&&(l=n.method(r,t),l)){if(l.errors||l.value===void 0)return l;r=l.value}if(!a.from||a.from.includes(typeof r)){const s=a.method(r,t);if(s)return s}return l}}:a||n},e.prepare=function(a,n){return a&&n?function(r,t){const l=a(r,t);if(l){if(l.errors||l.value===void 0)return l;r=l.value}return n(r,t)||l}:a||n},e.rebuild=function(a,n){return a&&n?function(r){n(r),a(r)}:a||n},e.validate=function(a,n){return a&&n?function(r,t){const l=n(r,t);if(l){if(l.errors&&(!Array.isArray(l.errors)||l.errors.length))return l;r=l.value}return a(r,t)||l}:a||n}},5107:(j,w,p)=>{const o=p(375),g=p(8571),m=p(8652),f=p(8160),e=p(3292),a=p(6354),n=p(8901),r=p(9708),t=p(6133),l=p(3328),s=p(1152);let i;const u={types:{alternatives:p(4946),any:p(8068),array:p(546),boolean:p(4937),date:p(7500),function:p(390),link:p(8785),number:p(3832),object:p(8966),string:p(7417),symbol:p(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const d={_types:new Set(Object.keys(u.types))};for(const y of d._types)d[y]=function(..._){return o(!_.length||["alternatives","link","object"].includes(y),"The",y,"type does not allow arguments"),u.generate(this,u.types[y],_)};for(const y of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])d[y]=function(..._){return this.any()[y](..._)};Object.assign(d,u.methods);for(const y in u.aliases){const _=u.aliases[y];d[y]=d[_]}return d.x=d.expression,s.setup&&s.setup(d),d}};u.methods={ValidationError:a.ValidationError,version:f.version,cache:m.provider,assert(d,y,..._){u.assert(d,y,!0,_)},attempt:(d,y,..._)=>u.assert(d,y,!1,_),build(d){return o(typeof r.build=="function","Manifest functionality disabled"),r.build(this,d)},checkPreferences(d){f.checkPreferences(d)},compile(d,y){return e.compile(this,d,y)},defaults(d){o(typeof d=="function","modifier must be a function");const y=Object.assign({},this);for(const _ of y._types){const v=d(y[_]());o(f.isSchema(v),"modifier must return a valid schema object"),y[_]=function(...c){return u.generate(this,v,c)}}return y},expression:(...d)=>new l(...d),extend(...d){f.verifyFlat(d,"extend"),i=i||p(3378),o(d.length,"You need to provide at least one extension"),this.assert(d,i.extensions);const y=Object.assign({},this);y._types=new Set(y._types);for(let _ of d){typeof _=="function"&&(_=_(y)),this.assert(_,i.extension);const v=u.expandExtension(_,y);for(const c of v){o(y[c.type]===void 0||y._types.has(c.type),"Cannot override name",c.type);const h=c.base||this.any(),b=n.type(h,c);y._types.add(c.type),y[c.type]=function(...x){return u.generate(this,b,x)}}}return y},isError:a.ValidationError.isError,isExpression:l.isTemplate,isRef:t.isRef,isSchema:f.isSchema,in:(...d)=>t.in(...d),override:f.symbols.override,ref:(...d)=>t.create(...d),types(){const d={};for(const y of this._types)d[y]=this[y]();for(const y in u.aliases)d[y]=this[y]();return d}},u.assert=function(d,y,_,v){const c=v[0]instanceof Error||typeof v[0]=="string"?v[0]:null,h=c!==null?v[1]:v[0],b=y.validate(d,f.preferences({errors:{stack:!0}},h||{}));let x=b.error;if(!x)return b.value;if(c instanceof Error)throw c;const S=_&&typeof x.annotate=="function"?x.annotate():x.message;throw x instanceof a.ValidationError==0&&(x=g(x)),x.message=c?`${c} ${S}`:S,x},u.generate=function(d,y,_){return o(d,"Must be invoked on a Joi instance."),y.$_root=d,y._definition.args&&_.length?y._definition.args(y,..._):y},u.expandExtension=function(d,y){if(typeof d.type=="string")return[d];const _=[];for(const v of y._types)if(d.type.test(v)){const c=Object.assign({},d);c.type=v,c.base=y[v](),_.push(c)}return _},j.exports=u.root()},6914:(j,w,p)=>{const o=p(375),g=p(8571),m=p(3328);w.compile=function(f,e){if(typeof f=="string")return o(!e,"Cannot set single message string"),new m(f);if(m.isTemplate(f))return o(!e,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),e=e?g(e):{};for(let a in f){const n=f[a];if(a==="root"||m.isTemplate(n)){e[a]=n;continue}if(typeof n=="string"){e[a]=new m(n);continue}o(typeof n=="object"&&!Array.isArray(n),"Invalid message for",a);const r=a;for(a in e[r]=e[r]||{},n){const t=n[a];a==="root"||m.isTemplate(t)?e[r][a]=t:(o(typeof t=="string","Invalid message for",a,"in",r),e[r][a]=new m(t))}}return e},w.decompile=function(f){const e={};for(let a in f){const n=f[a];if(a==="root"){e.root=n;continue}if(m.isTemplate(n)){e[a]=n.describe({compact:!0});continue}const r=a;for(a in e[r]={},n){const t=n[a];a!=="root"?e[r][a]=t.describe({compact:!0}):e[r].root=t}}return e},w.merge=function(f,e){if(!f)return w.compile(e);if(!e)return f;if(typeof e=="string")return new m(e);if(m.isTemplate(e))return e;const a=g(f);for(let n in e){const r=e[n];if(n==="root"||m.isTemplate(r)){a[n]=r;continue}if(typeof r=="string"){a[n]=new m(r);continue}o(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);const t=n;for(n in a[t]=a[t]||{},r){const l=r[n];n==="root"||m.isTemplate(l)?a[t][n]=l:(o(typeof l=="string","Invalid message for",n,"in",t),a[t][n]=new m(l))}}return a}},2294:(j,w,p)=>{const o=p(375),g=p(8160),m=p(6133),f={};w.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new f.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[a,n]of e._byId.entries())o(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,n);for(const[a,n]of e._byKey.entries())o(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,n)}fork(e,a,n){const r=this._collect(e);r.push({schema:n});const t=r.shift();let l={id:t.id,schema:a(t.schema)};o(g.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const s of r)l={id:s.id,schema:f.fork(s.schema,l.id,l.schema)};return l.schema}labels(e,a=[]){const n=e[0],r=this._get(n);if(!r)return[...a,...e].join(".");const t=e.slice(1);return a=[...a,r.schema._flags.label||n],t.length?r.schema._ids.labels(t,a):a.join(".")}reach(e,a=[]){const n=e[0],r=this._get(n);o(r,"Schema does not contain path",[...a,...e].join("."));const t=e.slice(1);return t.length?r.schema._ids.reach(t,[...a,n]):r.schema}register(e,{key:a}={}){if(!e||!g.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const n=e._flags.id;if(n){const r=this._byId.get(n);o(!r||r.schema===e,"Cannot add different schemas with the same id:",n),o(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:e,id:n})}a&&(o(!this._byKey.has(a),"Schema already contains key:",a),o(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:e,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,a=[],n=[]){const r=e[0],t=this._get(r);o(t,"Schema does not contain path",[...a,...e].join(".")),n=[t,...n];const l=e.slice(1);return l.length?t.schema._ids._collect(l,[...a,r],n):n}_get(e){return this._byId.get(e)||this._byKey.get(e)}},f.fork=function(e,a,n){const r=w.schema(e,{each:(t,{key:l})=>{if(a===(t._flags.id||l))return n},ref:!1});return r?r.$_mutateRebuild():e},w.schema=function(e,a){let n;for(const r in e._flags){if(r[0]==="_")continue;const t=f.scan(e._flags[r],{source:"flags",name:r},a);t!==void 0&&(n=n||e.clone(),n._flags[r]=t)}for(let r=0;r<e._rules.length;++r){const t=e._rules[r],l=f.scan(t.args,{source:"rules",name:t.name},a);if(l!==void 0){n=n||e.clone();const s=Object.assign({},t);s.args=l,n._rules[r]=s,n._singleRules.get(t.name)===t&&n._singleRules.set(t.name,s)}}for(const r in e.$_terms){if(r[0]==="_")continue;const t=f.scan(e.$_terms[r],{source:"terms",name:r},a);t!==void 0&&(n=n||e.clone(),n.$_terms[r]=t)}return n},f.scan=function(e,a,n,r,t){const l=r||[];if(e===null||typeof e!="object")return;let s;if(Array.isArray(e)){for(let i=0;i<e.length;++i){const u=a.source==="terms"&&a.name==="keys"&&e[i].key,d=f.scan(e[i],a,n,[i,...l],u);d!==void 0&&(s=s||e.slice(),s[i]=d)}return s}if(n.schema!==!1&&g.isSchema(e)||n.ref!==!1&&m.isRef(e)){const i=n.each(e,{...a,path:l,key:t});return i===e?void 0:i}for(const i in e){if(i[0]==="_")continue;const u=f.scan(e[i],a,n,[i,...l],t);u!==void 0&&(s=s||Object.assign({},e),s[i]=u)}return s}},6133:(j,w,p)=>{const o=p(375),g=p(8571),m=p(9621),f=p(8160);let e;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};w.create=function(n,r={}){o(typeof n=="string","Invalid reference key:",n),f.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const t=Object.assign({},a.defaults,r);delete t.prefix;const l=t.separator,s=a.context(n,l,r.prefix);if(t.type=s.type,n=s.key,t.type==="value")if(s.root&&(o(!l||n[0]!==l,"Cannot specify relative path with root prefix"),t.ancestor="root",n||(n=null)),l&&l===n)n=null,t.ancestor=0;else if(t.ancestor!==void 0)o(!l||!n||n[0]!==l,"Cannot combine prefix with ancestor option");else{const[i,u]=a.ancestor(n,l);u&&(n=n.slice(u))===""&&(n=null),t.ancestor=i}return t.path=l?n===null?[]:n.split(l):[n],new a.Ref(t)},w.in=function(n,r={}){return w.create(n,{...r,in:!0})},w.isRef=function(n){return!!n&&!!n[f.symbols.ref]},a.Ref=class{constructor(n){o(typeof n=="object","Invalid reference construction"),f.assertOptions(n,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(n.separator)||typeof n.separator=="string"&&n.separator.length===1,"Invalid separator"),o(!n.adjust||typeof n.adjust=="function","options.adjust must be a function"),o(!n.map||Array.isArray(n.map),"options.map must be an array"),o(!n.map||!n.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,n),o(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(n,r,t,l,s={}){return o(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(t.context,r,s):this.type==="local"?this._resolve(l,r,s):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,s):(o(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,s)):this._resolve(n,r,s)}_resolve(n,r,t){let l;if(this.type==="value"&&r.mainstay.shadow&&t.shadow!==!1&&(l=r.mainstay.shadow.get(this.absolute(r))),l===void 0&&(l=m(n,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(l=this.adjust(l)),this.map){const s=this.map.get(l);s!==void 0&&(l=s)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,l),l}toString(){return this.display}absolute(n){return[...n.path.slice(0,-this.ancestor),...this.path]}clone(){return new a.Ref(this)}describe(){const n={path:this.path};this.type!=="value"&&(n.type=this.type),this.separator!=="."&&(n.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(n.ancestor=this.ancestor),this.map&&(n.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(n[r]=this[r]);return this.in!==!1&&(n.in=!0),{ref:n}}updateDisplay(){const n=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${n}`);if(!this.separator)return void(this.display=`ref:${n}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${n}`);if(this.ancestor==="root")return void(this.display=`ref:root:${n}`);if(this.ancestor===1)return void(this.display=`ref:${n||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${n||""}`}},a.Ref.prototype[f.symbols.ref]=!0,w.build=function(n){return(n=Object.assign({},a.defaults,n)).type==="value"&&n.ancestor===void 0&&(n.ancestor=1),new a.Ref(n)},a.context=function(n,r,t={}){if(n=n.trim(),t){const l=t.global===void 0?"$":t.global;if(l!==r&&n.startsWith(l))return{key:n.slice(l.length),type:"global"};const s=t.local===void 0?"#":t.local;if(s!==r&&n.startsWith(s))return{key:n.slice(s.length),type:"local"};const i=t.root===void 0?"/":t.root;if(i!==r&&n.startsWith(i))return{key:n.slice(i.length),type:"value",root:!0}}return{key:n,type:"value"}},a.ancestor=function(n,r){if(!r)return[1,0];if(n[0]!==r)return[1,0];if(n[1]!==r)return[0,1];let t=2;for(;n[t]===r;)++t;return[t-1,t]},w.toSibling=0,w.toParent=1,w.Manager=class{constructor(){this.refs=[]}register(n,r){if(n)if(r=r===void 0?w.toParent:r,Array.isArray(n))for(const t of n)this.register(t,r);else if(f.isSchema(n))for(const t of n._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else w.isRef(n)&&n.type==="value"&&n.ancestor-r>=0&&this.refs.push({ancestor:n.ancestor-r,root:n.root}),e=e||p(3328),e.isTemplate(n)&&this.register(n.refs(),r)}get length(){return this.refs.length}clone(){const n=new w.Manager;return n.refs=g(this.refs),n}reset(){this.refs=[]}roots(){return this.refs.filter(n=>!n.ancestor).map(n=>n.root)}}},3378:(j,w,p)=>{const o=p(5107),g={};g.wrap=o.string().min(1).max(2).allow(!1),w.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:g.wrap,array:g.wrap,string:g.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),g.nameRx=/^[a-zA-Z0-9]\w*$/,g.rule=o.object({alias:o.array().items(o.string().pattern(g.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(g.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),w.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(g.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(g.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(g.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(g.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(g.nameRx,g.rule),terms:o.object().pattern(g.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),w.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),g.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},g.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),g.desc.buffer,g.desc.func,g.desc.ref,g.desc.regex,g.desc.special,g.desc.template,g.desc.value,o.link("/")]),g.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.symbol(),g.desc.buffer,g.desc.func,g.desc.override,g.desc.ref,g.desc.regex,g.desc.template,g.desc.value),g.desc.messages=o.object().pattern(/.+/,[o.string(),g.desc.template,o.object().pattern(/.+/,[o.string(),g.desc.template])]),w.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:g.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),g.desc.ref],wrap:{label:g.wrap,array:g.wrap}},externals:o.boolean(),messages:g.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:g.desc.values,invalid:g.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),g.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:g.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(j,w,p)=>{const o=p(8571),g=p(9621),m=p(8160),f={value:Symbol("value")};j.exports=f.State=class{constructor(e,a,n){this.path=e,this.ancestors=a,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(e,a=null,n=null){const r=new f.State(e,a,this);return n&&r.schemas&&(r.schemas=[f.schemas(n),...r.schemas]),r}nest(e,a){const n=new f.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[f.schemas(e),...n.schemas],n.debug=a,n}shadow(e,a){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,e,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(e){return m.isSchema(e)?{schema:e}:e},f.Shadow=class{constructor(){this._values=null}set(e,a,n){if(!e.length||n==="strip"&&typeof e[e.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const l=e[t];let s=r.get(l);s||(s=new Map,r.set(l,s)),r=s}r[f.value]=a}get(e){const a=this.node(e);if(a)return a[f.value]}node(e){if(this._values)return g(this._values,e,{iterables:!0})}override(e,a){if(!this._values)return;const n=e.slice(0,-1),r=e[e.length-1],t=g(this._values,n,{iterables:!0});a?t.set(r,a):t&&t.delete(r)}}},3328:(j,w,p)=>{const o=p(375),g=p(8571),m=p(5277),f=p(1447),e=p(8160),a=p(6354),n=p(6133),r={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};j.exports=r.Template=class{constructor(t,l){if(o(typeof t=="string","Template source must be a string"),o(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,l){const{functions:s,...i}=l;this._settings=Object.keys(i).length?g(i):void 0,this._functions=s,this._functions&&(o(Object.keys(this._functions).every(u=>typeof u=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(u=>typeof u=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const t=r.encode(this.source),l=r.split(t);let s=!1;const i=[],u=l.shift();u&&i.push(u);for(const d of l){const y=d[0]!=="{",_=y?"}":"}}",v=d.indexOf(_);if(v===-1||d[1]==="{"){i.push(`{${r.decode(d)}`);continue}let c=d.slice(y?0:1,v);const h=c[0]===":";h&&(c=c.slice(1));const b=this._ref(r.decode(c),{raw:y,wrapped:h});i.push(b),typeof b!="string"&&(s=!0);const x=d.slice(v+_.length);x&&i.push(r.decode(x))}s?this._template=i:this.rendered=i.join("")}static date(t,l){return r.dateFormat[l.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;const l={template:this.source};return this._settings&&(l.options=this._settings),this._functions&&(l.functions=this._functions),l}static build(t){return new r.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return!!t&&!!t[e.symbols.template]}refs(){if(!this._template)return;const t=[];for(const l of this._template)typeof l!="string"&&t.push(...l.refs);return t}resolve(t,l,s,i){return this._template&&this._template.length===1?this._part(this._template[0],t,l,s,i,{}):this.render(t,l,s,i)}_part(t,...l){return t.ref?t.ref.resolve(...l):t.formula.evaluate(l)}render(t,l,s,i,u={}){if(!this.isDynamic())return this.rendered;const d=[];for(const y of this._template)if(typeof y=="string")d.push(y);else{const _=this._part(y,t,l,s,i,u),v=r.stringify(_,t,l,s,i,u);if(v!==void 0){const c=y.raw||(u.errors&&u.errors.escapeHtml)===!1?v:m(v);d.push(r.wrap(c,y.wrapped&&s.errors.wrap.label))}}return d.join("")}_ref(t,{raw:l,wrapped:s}){const i=[],u=y=>{const _=n.create(y,this._settings);return i.push(_),v=>{const c=_.resolve(...v);return c!==void 0?c:null}};try{const y=this._functions?{...r.functions,...this._functions}:r.functions;var d=new f.Parser(t,{reference:u,functions:y,constants:r.constants})}catch(y){throw y.message=`Invalid template variable "${t}" fails due to: ${y.message}`,y}if(d.single){if(d.single.type==="reference"){const y=i[0];return{ref:y,raw:l,refs:i,wrapped:s||y.type==="local"&&y.key==="label"}}return r.stringify(d.single.value)}return{formula:d,raw:l,refs:i}}toString(){return this.source}},r.Template.prototype[e.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(t){return t.replace(/\\(\{+)/g,(l,s)=>r.opens.slice(0,s.length)).replace(/\\(\}+)/g,(l,s)=>r.closes.slice(0,s.length))},r.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(t){const l=[];let s="";for(let i=0;i<t.length;++i){const u=t[i];if(u==="{"){let d="";for(;i+1<t.length&&t[i+1]==="{";)d+="{",++i;l.push(s),s=d}else s+=u}return l.push(s),l},r.wrap=function(t,l){return l?l.length===1?`${l}${t}${l}`:`${l[0]}${t}${l[1]}`:t},r.stringify=function(t,l,s,i,u,d={}){const y=typeof t,_=i&&i.errors&&i.errors.wrap||{};let v=!1;if(n.isRef(t)&&t.render&&(v=t.in,t=t.resolve(l,s,i,u,{in:t.in,...d})),t===null)return"null";if(y==="string")return r.wrap(t,d.arrayItems&&_.string);if(y==="number"||y==="function"||y==="symbol")return t.toString();if(y!=="object")return JSON.stringify(t);if(t instanceof Date)return r.Template.date(t,i);if(t instanceof Map){const h=[];for(const[b,x]of t.entries())h.push(`${b.toString()} -> ${x.toString()}`);t=h}if(!Array.isArray(t))return t.toString();const c=[];for(const h of t)c.push(r.stringify(h,l,s,i,u,{arrayItems:!0,...d}));return r.wrap(c.join(", "),!v&&_.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(t,l,s)=>t?l:s,length:t=>typeof t=="string"?t.length:t&&typeof t=="object"?Array.isArray(t)?t.length:Object.keys(t).length:null,msg(t){const[l,s,i,u,d]=this,y=d.messages;if(!y)return"";const _=a.template(l,y[0],t,s,i)||a.template(l,y[1],t,s,i);return _?_.render(l,s,i,u,d):""},number:t=>typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}},4946:(j,w,p)=>{const o=p(375),g=p(1687),m=p(8068),f=p(8160),e=p(3292),a=p(6354),n=p(6133),r={};j.exports=m.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:n.toSibling}},args:(t,...l)=>l.length===1&&Array.isArray(l[0])?t.try(...l[0]):t.try(...l),validate(t,l){const{schema:s,error:i,state:u,prefs:d}=l;if(s._flags.match){const _=[],v=[];for(let h=0;h<s.$_terms.matches.length;++h){const b=s.$_terms.matches[h],x=u.nest(b.schema,`match.${h}`);x.snapshot();const S=b.schema.$_validate(t,x,d);S.errors?(v.push(S.errors),x.restore()):(_.push(S.value),x.commit())}if(_.length===0)return{errors:i("alternatives.any",{details:v.map(h=>a.details(h,{override:!1}))})};if(s._flags.match==="one")return _.length===1?{value:_[0]}:{errors:i("alternatives.one")};if(_.length!==s.$_terms.matches.length)return{errors:i("alternatives.all",{details:v.map(h=>a.details(h,{override:!1}))})};const c=h=>h.$_terms.matches.some(b=>b.schema.type==="object"||b.schema.type==="alternatives"&&c(b.schema));return c(s)?{value:_.reduce((h,b)=>g(h,b,{mergeArrays:!1}))}:{value:_[_.length-1]}}const y=[];for(let _=0;_<s.$_terms.matches.length;++_){const v=s.$_terms.matches[_];if(v.schema){const b=u.nest(v.schema,`match.${_}`);b.snapshot();const x=v.schema.$_validate(t,b,d);if(!x.errors)return b.commit(),x;b.restore(),y.push({schema:v.schema,reports:x.errors});continue}const c=v.ref?v.ref.resolve(t,u,d):t,h=v.is?[v]:v.switch;for(let b=0;b<h.length;++b){const x=h[b],{is:S,then:R,otherwise:O}=x,A=`match.${_}${v.switch?"."+b:""}`;if(S.$_match(c,u.nest(S,`${A}.is`),d)){if(R)return R.$_validate(t,u.nest(R,`${A}.then`),d)}else if(O)return O.$_validate(t,u.nest(O,`${A}.otherwise`),d)}}return r.errors(y,l)},rules:{conditional:{method(t,l){o(!this._flags._endedSwitch,"Unreachable condition"),o(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),o(l.break===void 0,"Cannot use break option with alternatives conditional");const s=this.clone(),i=e.when(s,t,l),u=i.is?[i]:i.switch;for(const d of u)if(d.then&&d.otherwise){s.$_setFlag("_endedSwitch",!0,{clone:!1});break}return s.$_terms.matches.push(i),s.$_mutateRebuild()}},match:{method(t){if(o(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(const l of this.$_terms.matches)o(l.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){o(t.length,"Missing alternative schemas"),f.verifyFlat(t,"try"),o(!this._flags._endedSwitch,"Unreachable condition");const l=this.clone();for(const s of t)l.$_terms.matches.push({schema:l.$_compile(s)});return l.$_mutateRebuild()}}},overrides:{label(t){return this.$_parent("label",t).$_modify({each:(l,s)=>s.path[0]!=="is"&&typeof l._flags.label!="string"?l.label(t):void 0,ref:!1})}},rebuild(t){t.$_modify({each:l=>{f.isSchema(l)&&l.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(t,l){if(l.matches)for(const s of l.matches){const{schema:i,ref:u,is:d,not:y,then:_,otherwise:v}=s;t=i?t.try(i):u?t.conditional(u,{is:d,then:_,not:y,otherwise:v,switch:s.switch}):t.conditional(d,{then:_,otherwise:v})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),r.errors=function(t,{error:l,state:s}){if(!t.length)return{errors:l("alternatives.any")};if(t.length===1)return{errors:t[0].reports};const i=new Set,u=[];for(const{reports:d,schema:y}of t){if(d.length>1)return r.unmatched(t,l);const _=d[0];if(_ instanceof a.Report==0)return r.unmatched(t,l);if(_.state.path.length!==s.path.length){u.push({type:y.type,report:_});continue}if(_.code==="any.only"){for(const h of _.local.valids)i.add(h);continue}const[v,c]=_.code.split(".");c!=="base"?u.push({type:y.type,report:_}):_.code==="object.base"?i.add(_.local.type):i.add(v)}return u.length?u.length===1?{errors:u[0].report}:r.unmatched(t,l):{errors:l("alternatives.types",{types:[...i]})}},r.unmatched=function(t,l){const s=[];for(const i of t)s.push(...i.reports);return{errors:l("alternatives.match",a.details(s,{override:!1}))}}},8068:(j,w,p)=>{const o=p(375),g=p(7629),m=p(8160),f=p(6914);j.exports=g.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,a){return o(typeof e=="function","Method must be a function"),o(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:a}})},validate(e,a,{method:n}){try{return n(e,a)}catch(r){return a.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){o(m.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const a=this.clone();return a.$_terms.shared=a.$_terms.shared||[],a.$_terms.shared.push(e),a.$_mutateRegister(e),a}},warning:{method(e,a){return o(e&&typeof e=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:a},warn:!0})},validate:(e,a,{code:n,local:r})=>a.error(n,r),args:["code","local"],multi:!0}},modifiers:{keep(e,a=!0){e.keep=a},message(e,a){e.message=f.compile(a)},warn(e,a=!0){e.warn=a}},manifest:{build(e,a){for(const n in a){const r=a[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const t of r)e=e[n.slice(0,-1)](t);else if(n!=="alterations")if(n!=="whens"){if(n==="shared")for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:l,is:s,not:i,then:u,otherwise:d,concat:y}=t;e=y?e.concat(y):l?e.when(l,{is:s,not:i,then:u,otherwise:d,switch:t.switch,break:t.break}):e.when(s,{then:u,otherwise:d,break:t.break})}else{const t={};for(const{target:l,adjuster:s}of r)t[l]=s;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(j,w,p)=>{const o=p(375),g=p(9474),m=p(9621),f=p(8068),e=p(8160),a=p(3292),n={};j.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(r,{schema:t,state:l,prefs:s}){if(!Array.isArray(r))return;const i=t.$_getRule("sort");return i?n.sort(t,r,i.args.options,l,s):void 0}},validate(r,{schema:t,error:l}){if(!Array.isArray(r)){if(t._flags.single){const s=[r];return s[e.symbols.arraySingle]=!0,{value:s}}return{errors:l("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:r}});return t.$_mutateRegister(r),t},validate(r,{state:t,prefs:l,error:s},{schema:i}){const u=[r,...t.ancestors];for(let y=0;y<r.length;++y){const _=t.localize([...t.path,y],u,i);if(i.$_match(r[y],_,l))return r}const d=i._flags.label;return d?s("array.hasKnown",{patternLabel:d}):s("array.hasUnknown",null)},multi:!0},items:{method(...r){e.verifyFlat(r,"items");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});t.$_terms.items.push(s)}return t.$_mutateRebuild()},validate(r,{schema:t,error:l,state:s,prefs:i,errorsArray:u}){const d=t.$_terms._requireds.slice(),y=t.$_terms.ordered.slice(),_=[...t.$_terms._inclusions,...d],v=!r[e.symbols.arraySingle];delete r[e.symbols.arraySingle];const c=u();let h=r.length;for(let b=0;b<h;++b){const x=r[b];let S=!1,R=!1;const O=v?b:new Number(b),A=[...s.path,O];if(!t._flags.sparse&&x===void 0){if(c.push(l("array.sparse",{key:O,path:A,pos:b,value:void 0},s.localize(A))),i.abortEarly)return c;y.shift();continue}const D=[r,...s.ancestors];for(const I of t.$_terms._exclusions)if(I.$_match(x,s.localize(A,D,I),i,{presence:"ignore"})){if(c.push(l("array.excludes",{pos:b,value:x},s.localize(A))),i.abortEarly)return c;S=!0,y.shift();break}if(S)continue;if(t.$_terms.ordered.length){if(y.length){const I=y.shift(),L=I.$_validate(x,s.localize(A,D,I),i);if(L.errors){if(c.push(...L.errors),i.abortEarly)return c}else if(I._flags.result==="strip")n.fastSplice(r,b),--b,--h;else{if(!t._flags.sparse&&L.value===void 0){if(c.push(l("array.sparse",{key:O,path:A,pos:b,value:void 0},s.localize(A))),i.abortEarly)return c;continue}r[b]=L.value}continue}if(!t.$_terms.items.length){if(c.push(l("array.orderedLength",{pos:b,limit:t.$_terms.ordered.length})),i.abortEarly)return c;break}}const M=[];let F=d.length;for(let I=0;I<F;++I){const L=s.localize(A,D,d[I]);L.snapshot();const N=d[I].$_validate(x,L,i);if(M[I]=N,!N.errors){if(L.commit(),r[b]=N.value,R=!0,n.fastSplice(d,I),--I,--F,!t._flags.sparse&&N.value===void 0&&(c.push(l("array.sparse",{key:O,path:A,pos:b,value:void 0},s.localize(A))),i.abortEarly))return c;break}L.restore()}if(R)continue;const E=i.stripUnknown&&!!i.stripUnknown.arrays||!1;F=_.length;for(const I of _){let L;const N=d.indexOf(I);if(N!==-1)L=M[N];else{const B=s.localize(A,D,I);if(B.snapshot(),L=I.$_validate(x,B,i),!L.errors){B.commit(),I._flags.result==="strip"?(n.fastSplice(r,b),--b,--h):t._flags.sparse||L.value!==void 0?r[b]=L.value:(c.push(l("array.sparse",{key:O,path:A,pos:b,value:void 0},s.localize(A))),S=!0),R=!0;break}B.restore()}if(F===1){if(E){n.fastSplice(r,b),--b,--h,R=!0;break}if(c.push(...L.errors),i.abortEarly)return c;S=!0;break}}if(!S&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!R){if(E){n.fastSplice(r,b),--b,--h;continue}if(c.push(l("array.includes",{pos:b,value:x},s.localize(A))),i.abortEarly)return c}}return d.length&&n.fillMissedErrors(t,c,d,r,s,i),y.length&&(n.fillOrderedErrors(t,c,y,r,s,i),c.length||n.fillDefault(y,r,s,i)),c.length?c:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,t,{limit:l},{name:s,operator:i,args:u})=>e.compare(r.length,l,i)?r:t.error("array."+s,{limit:u.limit,value:r}),args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"}]},max:{method(r){return this.$_addRule({name:"max",method:"length",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"length",args:{limit:r},operator:">="})}},ordered:{method(...r){e.verifyFlat(r,"ordered");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});n.validateSingle(s,t),t.$_mutateRegister(s),t.$_terms.ordered.push(s)}return t.$_mutateRebuild()}},single:{method(r){const t=r===void 0||!!r;return o(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(r={}){e.assertOptions(r,["by","order"]);const t={order:r.order||"ascending"};return r.by&&(t.by=a.ref(r.by,{ancestor:0}),o(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(r,{error:t,state:l,prefs:s,schema:i},{options:u}){const{value:d,errors:y}=n.sort(i,r,u,l,s);if(y)return y;for(let _=0;_<r.length;++_)if(r[_]!==d[_])return t("array.sort",{order:u.order,by:u.by?u.by.key:"value"});return r},convert:!0},sparse:{method(r){const t=r===void 0||!!r;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(r,t={}){o(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),e.assertOptions(t,["ignoreUndefined","separator"]);const l={name:"unique",args:{options:t,comparator:r}};if(r)if(typeof r=="string"){const s=e.default(t.separator,".");l.path=s?r.split(s):[r]}else l.comparator=r;return this.$_addRule(l)},validate(r,{state:t,error:l,schema:s},{comparator:i,options:u},{comparator:d,path:y}){const _={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},v=d||g,c=u.ignoreUndefined;for(let h=0;h<r.length;++h){const b=y?m(r[h],y):r[h],x=d?_.custom:_[typeof b];if(o(x,"Failed to find unique map container for type",typeof b),x instanceof Map){const S=x.entries();let R;for(;!(R=S.next()).done;)if(v(R.value[0],b)){const O=t.localize([...t.path,h],[r,...t.ancestors]),A={pos:h,value:r[h],dupePos:R.value[1],dupeValue:r[R.value[1]]};return y&&(A.path=i),l("array.unique",A,O)}x.set(b,h)}else{if((!c||b!==void 0)&&x[b]!==void 0){const S={pos:h,value:r[h],dupePos:x[b],dupeValue:r[x[b]]};return y&&(S.path=i),l("array.unique",S,t.localize([...t.path,h],[r,...t.ancestors]))}x[b]=h}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,t)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const t of r.$_terms.items)n.validateSingle(t,r),t._flags.presence==="required"?r.$_terms._requireds.push(t):t._flags.presence==="forbidden"?r.$_terms._exclusions.push(t):r.$_terms._inclusions.push(t);for(const t of r.$_terms.ordered)n.validateSingle(t,r)},manifest:{build:(r,t)=>(t.items&&(r=r.items(...t.items)),t.ordered&&(r=r.ordered(...t.ordered)),r)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),n.fillMissedErrors=function(r,t,l,s,i,u){const d=[];let y=0;for(const _ of l){const v=_._flags.label;v?d.push(v):++y}d.length?y?t.push(r.$_createError("array.includesRequiredBoth",s,{knownMisses:d,unknownMisses:y},i,u)):t.push(r.$_createError("array.includesRequiredKnowns",s,{knownMisses:d},i,u)):t.push(r.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:y},i,u))},n.fillOrderedErrors=function(r,t,l,s,i,u){const d=[];for(const y of l)y._flags.presence==="required"&&d.push(y);d.length&&n.fillMissedErrors(r,t,d,s,i,u)},n.fillDefault=function(r,t,l,s){const i=[];let u=!0;for(let d=r.length-1;d>=0;--d){const y=r[d],_=[t,...l.ancestors],v=y.$_validate(void 0,l.localize(l.path,_,y),s).value;if(u){if(v===void 0)continue;u=!1}i.unshift(v)}i.length&&t.push(...i)},n.fastSplice=function(r,t){let l=t;for(;l<r.length;)r[l++]=r[l];--r.length},n.validateSingle=function(r,t){(r.type==="array"||r._flags._arrayItems)&&(o(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},n.sort=function(r,t,l,s,i){const u=l.order==="ascending"?1:-1,d=-1*u,y=u,_=(v,c)=>{let h=n.compare(v,c,d,y);if(h!==null||(l.by&&(v=l.by.resolve(v,s,i),c=l.by.resolve(c,s,i)),h=n.compare(v,c,d,y),h!==null))return h;const b=typeof v;if(b!==typeof c)throw r.$_createError("array.sort.mismatching",t,null,s,i);if(b!=="number"&&b!=="string")throw r.$_createError("array.sort.unsupported",t,{type:b},s,i);return b==="number"?(v-c)*u:v<c?d:y};try{return{value:t.slice().sort(_)}}catch(v){return{errors:v}}},n.compare=function(r,t,l,s){return r===t?0:r===void 0?1:t===void 0?-1:r===null?s:t===null?l:null}},4937:(j,w,p)=>{const o=p(375),g=p(8068),m=p(8160),f=p(2036),e={isBool:function(a){return typeof a=="boolean"}};j.exports=g.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(a,{schema:n}){if(typeof a!="boolean"){if(typeof a=="string"){const r=n._flags.sensitive?a:a.toLowerCase();a=r==="true"||r!=="false"&&a}return typeof a!="boolean"&&(a=n.$_terms.truthy&&n.$_terms.truthy.has(a,null,null,!n._flags.sensitive)||(!n.$_terms.falsy||!n.$_terms.falsy.has(a,null,null,!n._flags.sensitive))&&a),{value:a}}},validate(a,{error:n}){if(typeof a!="boolean")return{value:a,errors:n("boolean.base")}},rules:{truthy:{method(...a){m.verifyFlat(a,"truthy");const n=this.clone();n.$_terms.truthy=n.$_terms.truthy||new f;for(let r=0;r<a.length;++r){const t=a[r];o(t!==void 0,"Cannot call truthy with undefined"),n.$_terms.truthy.add(t)}return n}},falsy:{method(...a){m.verifyFlat(a,"falsy");const n=this.clone();n.$_terms.falsy=n.$_terms.falsy||new f;for(let r=0;r<a.length;++r){const t=a[r];o(t!==void 0,"Cannot call falsy with undefined"),n.$_terms.falsy.add(t)}return n}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:e.isBool,to:(a,n)=>a?1:0},string:{from:e.isBool,to:(a,n)=>a?"true":"false"}},manifest:{build:(a,n)=>(n.truthy&&(a=a.truthy(...n.truthy)),n.falsy&&(a=a.falsy(...n.falsy)),a)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(j,w,p)=>{const o=p(375),g=p(8068),m=p(8160),f=p(3328),e={isDate:function(a){return a instanceof Date}};j.exports=g.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:n})=>({value:e.parse(a,n._flags.format)||a})},validate(a,{schema:n,error:r,prefs:t}){if(a instanceof Date&&!isNaN(a.getTime()))return;const l=n._flags.format;return t.convert&&l&&typeof a=="string"?{value:a,errors:r("date.format",{format:l})}:{value:a,errors:r("date.base")}},rules:{compare:{method:!1,validate(a,n,{date:r},{name:t,operator:l,args:s}){const i=r==="now"?Date.now():r.getTime();return m.compare(a.getTime(),i,l)?a:n.error("date."+t,{limit:s.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:e.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return o(["iso","javascript","unix"].includes(a),"Unknown date format",a),this.$_setFlag("format",a)}},greater:{method(a){return this.$_addRule({name:"greater",method:"compare",args:{date:a},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(a){return this.$_addRule({name:"less",method:"compare",args:{date:a},operator:"<"})}},max:{method(a){return this.$_addRule({name:"max",method:"compare",args:{date:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"compare",args:{date:a},operator:">="})}},timestamp:{method(a="javascript"){return o(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:e.isDate,to:(a,n)=>a.getTime()},string:{from:e.isDate,to:(a,{prefs:n})=>f.date(a,n)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),e.parse=function(a,n){if(a instanceof Date)return a;if(typeof a!="string"&&(isNaN(a)||!isFinite(a))||/^\s*$/.test(a))return null;if(n==="iso")return m.isIsoDate(a)?e.date(a.toString()):null;const r=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),n){if(n==="javascript")return e.date(1*a);if(n==="unix")return e.date(1e3*a);if(typeof r=="string")return null}return e.date(a)},e.date=function(a){const n=new Date(a);return isNaN(n.getTime())?null:n}},390:(j,w,p)=>{const o=p(375),g=p(7824);j.exports=g.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(m){return o(Number.isSafeInteger(m)&&m>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:m}})},validate:(m,f,{n:e})=>m.length===e?m:f.error("function.arity",{n:e})},class:{method(){return this.$_addRule("class")},validate:(m,f)=>/^\s*class\s/.test(m.toString())?m:f.error("function.class",{value:m})},minArity:{method(m){return o(Number.isSafeInteger(m)&&m>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:m}})},validate:(m,f,{n:e})=>m.length>=e?m:f.error("function.minArity",{n:e})},maxArity:{method(m){return o(Number.isSafeInteger(m)&&m>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:m}})},validate:(m,f,{n:e})=>m.length<=e?m:f.error("function.maxArity",{n:e})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(j,w,p)=>{const o=p(978),g=p(375),m=p(8571),f=p(3652),e=p(8068),a=p(8160),n=p(3292),r=p(6354),t=p(6133),l=p(3328),s={renameDefaults:{alias:!1,multiple:!1,override:!1}};j.exports=e.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(i,u)=>i.keys(u),validate(i,{schema:u,error:d,state:y,prefs:_}){if(!i||typeof i!==u.$_property("typeof")||Array.isArray(i))return{value:i,errors:d("object.base",{type:u.$_property("typeof")})};if(!(u.$_terms.renames||u.$_terms.dependencies||u.$_terms.keys||u.$_terms.patterns||u.$_terms.externals))return;i=s.clone(i,_);const v=[];if(u.$_terms.renames&&!s.rename(u,i,y,_,v))return{value:i,errors:v};if(!u.$_terms.keys&&!u.$_terms.patterns&&!u.$_terms.dependencies)return{value:i,errors:v};const c=new Set(Object.keys(i));if(u.$_terms.keys){const h=[i,...y.ancestors];for(const b of u.$_terms.keys){const x=b.key,S=i[x];c.delete(x);const R=y.localize([...y.path,x],h,b),O=b.schema.$_validate(S,R,_);if(O.errors){if(_.abortEarly)return{value:i,errors:O.errors};O.value!==void 0&&(i[x]=O.value),v.push(...O.errors)}else b.schema._flags.result==="strip"||O.value===void 0&&S!==void 0?delete i[x]:O.value!==void 0&&(i[x]=O.value)}}if(c.size||u._flags._hasPatternMatch){const h=s.unknown(u,i,c,v,y,_);if(h)return h}if(u.$_terms.dependencies)for(const h of u.$_terms.dependencies){if(h.key!==null&&s.isPresent(h.options)(h.key.resolve(i,y,_,null,{shadow:!1}))===!1)continue;const b=s.dependencies[h.rel](u,h,i,y,_);if(b){const x=u.$_createError(b.code,i,b.context,y,_);if(_.abortEarly)return{value:i,errors:x};v.push(x)}}return{value:i,errors:v}},rules:{and:{method(...i){return a.verifyFlat(i,"and"),s.dependency(this,"and",null,i)}},append:{method(i){return i==null||Object.keys(i).length===0?this:this.keys(i)}},assert:{method(i,u,d){l.isTemplate(i)||(i=n.ref(i)),g(d===void 0||typeof d=="string","Message must be a string"),u=this.$_compile(u,{appendPath:!0});const y=this.$_addRule({name:"assert",args:{subject:i,schema:u,message:d}});return y.$_mutateRegister(i),y.$_mutateRegister(u),y},validate(i,{error:u,prefs:d,state:y},{subject:_,schema:v,message:c}){const h=_.resolve(i,y,d),b=t.isRef(_)?_.absolute(y):[];return v.$_match(h,y.localize(b,[i,...y.ancestors],v),d)?i:u("object.assert",{subject:_,message:c})},args:["subject","schema","message"],multi:!0},instance:{method(i,u){return g(typeof i=="function","constructor must be a function"),u=u||i.name,this.$_addRule({name:"instance",args:{constructor:i,name:u}})},validate:(i,u,{constructor:d,name:y})=>i instanceof d?i:u.error("object.instance",{type:y,value:i}),args:["constructor","name"]},keys:{method(i){g(i===void 0||typeof i=="object","Object schema must be a valid object"),g(!a.isSchema(i),"Object schema cannot be a joi schema");const u=this.clone();if(i)if(Object.keys(i).length){u.$_terms.keys=u.$_terms.keys?u.$_terms.keys.filter(d=>!i.hasOwnProperty(d.key)):new s.Keys;for(const d in i)a.tryWithPath(()=>u.$_terms.keys.push({key:d,schema:this.$_compile(i[d])}),d)}else u.$_terms.keys=new s.Keys;else u.$_terms.keys=null;return u.$_mutateRebuild()}},length:{method(i){return this.$_addRule({name:"length",args:{limit:i},operator:"="})},validate:(i,u,{limit:d},{name:y,operator:_,args:v})=>a.compare(Object.keys(i).length,d,_)?i:u.error("object."+y,{limit:v.limit,value:i}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(i){return this.$_addRule({name:"max",method:"length",args:{limit:i},operator:"<="})}},min:{method(i){return this.$_addRule({name:"min",method:"length",args:{limit:i},operator:">="})}},nand:{method(...i){return a.verifyFlat(i,"nand"),s.dependency(this,"nand",null,i)}},or:{method(...i){return a.verifyFlat(i,"or"),s.dependency(this,"or",null,i)}},oxor:{method(...i){return s.dependency(this,"oxor",null,i)}},pattern:{method(i,u,d={}){const y=i instanceof RegExp;y||(i=this.$_compile(i,{appendPath:!0})),g(u!==void 0,"Invalid rule"),a.assertOptions(d,["fallthrough","matches"]),y&&g(!i.flags.includes("g")&&!i.flags.includes("y"),"pattern should not use global or sticky mode"),u=this.$_compile(u,{appendPath:!0});const _=this.clone();_.$_terms.patterns=_.$_terms.patterns||[];const v={[y?"regex":"schema"]:i,rule:u};return d.matches&&(v.matches=this.$_compile(d.matches),v.matches.type!=="array"&&(v.matches=v.matches.$_root.array().items(v.matches)),_.$_mutateRegister(v.matches),_.$_setFlag("_hasPatternMatch",!0,{clone:!1})),d.fallthrough&&(v.fallthrough=!0),_.$_terms.patterns.push(v),_.$_mutateRegister(u),_}},ref:{method(){return this.$_addRule("ref")},validate:(i,u)=>t.isRef(i)?i:u.error("object.refType",{value:i})},regex:{method(){return this.$_addRule("regex")},validate:(i,u)=>i instanceof RegExp?i:u.error("object.regex",{value:i})},rename:{method(i,u,d={}){g(typeof i=="string"||i instanceof RegExp,"Rename missing the from argument"),g(typeof u=="string"||u instanceof l,"Invalid rename to argument"),g(u!==i,"Cannot rename key to same name:",i),a.assertOptions(d,["alias","ignoreUndefined","override","multiple"]);const y=this.clone();y.$_terms.renames=y.$_terms.renames||[];for(const _ of y.$_terms.renames)g(_.from!==i,"Cannot rename the same key multiple times");return u instanceof l&&y.$_mutateRegister(u),y.$_terms.renames.push({from:i,to:u,options:o(s.renameDefaults,d)}),y}},schema:{method(i="any"){return this.$_addRule({name:"schema",args:{type:i}})},validate:(i,u,{type:d})=>!a.isSchema(i)||d!=="any"&&i.type!==d?u.error("object.schema",{type:d}):i},unknown:{method(i){return this.$_setFlag("unknown",i!==!1)}},with:{method(i,u,d={}){return s.dependency(this,"with",i,u,d)}},without:{method(i,u,d={}){return s.dependency(this,"without",i,u,d)}},xor:{method(...i){return a.verifyFlat(i,"xor"),s.dependency(this,"xor",null,i)}}},overrides:{default(i,u){return i===void 0&&(i=a.symbols.deepDefault),this.$_parent("default",i,u)}},rebuild(i){if(i.$_terms.keys){const u=new f.Sorter;for(const d of i.$_terms.keys)a.tryWithPath(()=>u.add(d,{after:d.schema.$_rootReferences(),group:d.key}),d.key);i.$_terms.keys=new s.Keys(...u.nodes)}},manifest:{build(i,u){if(u.keys&&(i=i.keys(u.keys)),u.dependencies)for(const{rel:d,key:y=null,peers:_,options:v}of u.dependencies)i=s.dependency(i,d,y,_,v);if(u.patterns)for(const{regex:d,schema:y,rule:_,fallthrough:v,matches:c}of u.patterns)i=i.pattern(d||y,_,{fallthrough:v,matches:c});if(u.renames)for(const{from:d,to:y,options:_}of u.renames)i=i.rename(d,y,_);return i}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),s.clone=function(i,u){if(typeof i=="object"){if(u.nonEnumerables)return m(i,{shallow:!0});const y=Object.create(Object.getPrototypeOf(i));return Object.assign(y,i),y}const d=function(...y){return i.apply(this,y)};return d.prototype=m(i.prototype),Object.defineProperty(d,"name",{value:i.name,writable:!1}),Object.defineProperty(d,"length",{value:i.length,writable:!1}),Object.assign(d,i),d},s.dependency=function(i,u,d,y,_){g(d===null||typeof d=="string",u,"key must be a strings"),_||(_=y.length>1&&typeof y[y.length-1]=="object"?y.pop():{}),a.assertOptions(_,["separator","isPresent"]),y=[].concat(y);const v=a.default(_.separator,"."),c=[];for(const b of y)g(typeof b=="string",u,"peers must be strings"),c.push(n.ref(b,{separator:v,ancestor:0,prefix:!1}));d!==null&&(d=n.ref(d,{separator:v,ancestor:0,prefix:!1}));const h=i.clone();return h.$_terms.dependencies=h.$_terms.dependencies||[],h.$_terms.dependencies.push(new s.Dependency(u,d,c,y,_)),h},s.dependencies={and(i,u,d,y,_){const v=[],c=[],h=u.peers.length,b=s.isPresent(u.options);for(const x of u.peers)b(x.resolve(d,y,_,null,{shadow:!1}))===!1?v.push(x.key):c.push(x.key);if(v.length!==h&&c.length!==h)return{code:"object.and",context:{present:c,presentWithLabels:s.keysToLabels(i,c),missing:v,missingWithLabels:s.keysToLabels(i,v)}}},nand(i,u,d,y,_){const v=[],c=s.isPresent(u.options);for(const x of u.peers)c(x.resolve(d,y,_,null,{shadow:!1}))&&v.push(x.key);if(v.length!==u.peers.length)return;const h=u.paths[0],b=u.paths.slice(1);return{code:"object.nand",context:{main:h,mainWithLabel:s.keysToLabels(i,h),peers:b,peersWithLabels:s.keysToLabels(i,b)}}},or(i,u,d,y,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,y,_,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)}}},oxor(i,u,d,y,_){const v=[],c=s.isPresent(u.options);for(const b of u.peers)c(b.resolve(d,y,_,null,{shadow:!1}))&&v.push(b.key);if(!v.length||v.length===1)return;const h={peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)};return h.present=v,h.presentWithLabels=s.keysToLabels(i,v),{code:"object.oxor",context:h}},with(i,u,d,y,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,y,_,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:u.key.key,mainWithLabel:s.keysToLabels(i,u.key.key),peer:c.key,peerWithLabel:s.keysToLabels(i,c.key)}}},without(i,u,d,y,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,y,_,null,{shadow:!1})))return{code:"object.without",context:{main:u.key.key,mainWithLabel:s.keysToLabels(i,u.key.key),peer:c.key,peerWithLabel:s.keysToLabels(i,c.key)}}},xor(i,u,d,y,_){const v=[],c=s.isPresent(u.options);for(const b of u.peers)c(b.resolve(d,y,_,null,{shadow:!1}))&&v.push(b.key);if(v.length===1)return;const h={peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)};return v.length===0?{code:"object.missing",context:h}:(h.present=v,h.presentWithLabels=s.keysToLabels(i,v),{code:"object.xor",context:h})}},s.keysToLabels=function(i,u){return Array.isArray(u)?u.map(d=>i.$_mapLabels(d)):i.$_mapLabels(u)},s.isPresent=function(i){return typeof i.isPresent=="function"?i.isPresent:u=>u!==void 0},s.rename=function(i,u,d,y,_){const v={};for(const c of i.$_terms.renames){const h=[],b=typeof c.from!="string";if(b)for(const x in u){if(u[x]===void 0&&c.options.ignoreUndefined||x===c.to)continue;const S=c.from.exec(x);S&&h.push({from:x,to:c.to,match:S})}else!Object.prototype.hasOwnProperty.call(u,c.from)||u[c.from]===void 0&&c.options.ignoreUndefined||h.push(c);for(const x of h){const S=x.from;let R=x.to;if(R instanceof l&&(R=R.render(u,d,y,x.match)),S!==R){if(!c.options.multiple&&v[R]&&(_.push(i.$_createError("object.rename.multiple",u,{from:S,to:R,pattern:b},d,y)),y.abortEarly)||Object.prototype.hasOwnProperty.call(u,R)&&!c.options.override&&!v[R]&&(_.push(i.$_createError("object.rename.override",u,{from:S,to:R,pattern:b},d,y)),y.abortEarly))return!1;u[S]===void 0?delete u[R]:u[R]=u[S],v[R]=!0,c.options.alias||delete u[S]}}}return!0},s.unknown=function(i,u,d,y,_,v){if(i.$_terms.patterns){let c=!1;const h=i.$_terms.patterns.map(x=>{if(x.matches)return c=!0,[]}),b=[u,..._.ancestors];for(const x of d){const S=u[x],R=[..._.path,x];for(let O=0;O<i.$_terms.patterns.length;++O){const A=i.$_terms.patterns[O];if(A.regex){const F=A.regex.test(x);if(_.mainstay.tracer.debug(_,"rule",`pattern.${O}`,F?"pass":"error"),!F)continue}else if(!A.schema.$_match(x,_.nest(A.schema,`pattern.${O}`),v))continue;d.delete(x);const D=_.localize(R,b,{schema:A.rule,key:x}),M=A.rule.$_validate(S,D,v);if(M.errors){if(v.abortEarly)return{value:u,errors:M.errors};y.push(...M.errors)}if(A.matches&&h[O].push(x),u[x]=M.value,!A.fallthrough)break}}if(c)for(let x=0;x<h.length;++x){const S=h[x];if(!S)continue;const R=i.$_terms.patterns[x].matches,O=_.localize(_.path,b,R),A=R.$_validate(S,O,v);if(A.errors){const D=r.details(A.errors,{override:!1});D.matches=S;const M=i.$_createError("object.pattern.match",u,D,_,v);if(v.abortEarly)return{value:u,errors:M};y.push(M)}}}if(d.size&&(i.$_terms.keys||i.$_terms.patterns)){if(v.stripUnknown&&i._flags.unknown===void 0||v.skipFunctions){const c=!(!v.stripUnknown||v.stripUnknown!==!0&&!v.stripUnknown.objects);for(const h of d)c?(delete u[h],d.delete(h)):typeof u[h]=="function"&&d.delete(h)}if(!a.default(i._flags.unknown,v.allowUnknown))for(const c of d){const h=_.localize([..._.path,c],[]),b=i.$_createError("object.unknown",u[c],{child:c},h,v,{flags:!1});if(v.abortEarly)return{value:u,errors:b};y.push(b)}}},s.Dependency=class{constructor(i,u,d,y,_){this.rel=i,this.key=u,this.peers=d,this.paths=y,this.options=_}describe(){const i={rel:this.rel,peers:this.paths};return this.key!==null&&(i.key=this.key.key),this.peers[0].separator!=="."&&(i.options={...i.options,separator:this.peers[0].separator}),this.options.isPresent&&(i.options={...i.options,isPresent:this.options.isPresent}),i}},s.Keys=class extends Array{concat(i){const u=this.slice(),d=new Map;for(let y=0;y<u.length;++y)d.set(u[y].key,y);for(const y of i){const _=y.key,v=d.get(_);v!==void 0?u[v]={key:_,schema:u[v].schema.concat(y.schema)}:u.push(y)}return u}}},8785:(j,w,p)=>{const o=p(375),g=p(8068),m=p(8160),f=p(3292),e=p(6354),a={};j.exports=g.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(n,r)=>n.ref(r),validate(n,{schema:r,state:t,prefs:l}){o(r.$_terms.link,"Uninitialized link schema");const s=a.generate(r,n,t,l),i=r.$_terms.link[0].ref;return s.$_validate(n,t.nest(s,`link:${i.display}:${s.type}`),l)},generate:(n,r,t,l)=>a.generate(n,r,t,l),rules:{ref:{method(n){o(!this.$_terms.link,"Cannot reinitialize schema"),n=f.ref(n),o(n.type==="value"||n.type==="local","Invalid reference type:",n.type),o(n.type==="local"||n.ancestor==="root"||n.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:n}],r}},relative:{method(n=!0){return this.$_setFlag("relative",n)}}},overrides:{concat(n){o(this.$_terms.link,"Uninitialized link schema"),o(m.isSchema(n),"Invalid schema object"),o(n.type!=="link","Cannot merge type link with another link");const r=this.clone();return r.$_terms.whens||(r.$_terms.whens=[]),r.$_terms.whens.push({concat:n}),r.$_mutateRebuild()}},manifest:{build:(n,r)=>(o(r.link,"Invalid link description missing link"),n.ref(r.link))}}),a.generate=function(n,r,t,l){let s=t.mainstay.links.get(n);if(s)return s._generate(r,t,l).schema;const i=n.$_terms.link[0].ref,{perspective:u,path:d}=a.perspective(i,t);a.assert(u,"which is outside of schema boundaries",i,n,t,l);try{s=d.length?u.$_reach(d):u}catch{a.assert(!1,"to non-existing schema",i,n,t,l)}return a.assert(s.type!=="link","which is another link",i,n,t,l),n._flags.relative||t.mainstay.links.set(n,s),s._generate(r,t,l).schema},a.perspective=function(n,r){if(n.type==="local"){for(const{schema:t,key:l}of r.schemas){if((t._flags.id||l)===n.path[0])return{perspective:t,path:n.path.slice(1)};if(t.$_terms.shared){for(const s of t.$_terms.shared)if(s._flags.id===n.path[0])return{perspective:s,path:n.path.slice(1)}}}return{perspective:null,path:null}}return n.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:n.path}:{perspective:r.schemas[n.ancestor]&&r.schemas[n.ancestor].schema,path:n.path}},a.assert=function(n,r,t,l,s,i){n||o(!1,`"${e.label(l._flags,s,i)}" contains link reference "${t.display}" ${r}`)}},3832:(j,w,p)=>{const o=p(375),g=p(8068),m=p(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const a=e.toString(),n=a.indexOf("."),r=a.indexOf("e");return(n<0?0:(r<0?a.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(a.slice(r+1))))}};j.exports=g.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:a,error:n}){if(!e.match(f.numberRx))return;e=e.trim();const r={value:parseFloat(e)};if(r.value===0&&(r.value=0),!a._flags.unsafe)if(e.match(/e/i)){if(f.extractSignificantDigits(e)!==f.extractSignificantDigits(String(r.value)))return r.errors=n("number.unsafe"),r}else{const t=r.value.toString();if(t.match(/e/i))return r;if(t!==f.normalizeDecimal(e))return r.errors=n("number.unsafe"),r}return r}},validate(e,{schema:a,error:n,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:n("number.infinity")};if(!m.isNumber(e))return{value:e,errors:n("number.base")};const t={value:e};if(r.convert){const l=a.$_getRule("precision");if(l){const s=Math.pow(10,l.args.limit);t.value=Math.round(t.value*s)/s}}return t.value===0&&(t.value=0),!a._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.errors=n("number.unsafe")),t},rules:{compare:{method:!1,validate:(e,a,{limit:n},{name:r,operator:t,args:l})=>m.compare(e,n,t)?e:a.error("number."+r,{limit:l.limit,value:e}),args:[{name:"limit",ref:!0,assert:m.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,a)=>Math.trunc(e)-e==0?e:a.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){const a=typeof e=="number"?f.decimalPlaces(e):null,n=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:a,pfactor:n}})},validate:(e,a,{base:n,baseDecimalPlace:r,pfactor:t},l)=>f.decimalPlaces(e)>r?a.error("number.multiple",{multiple:l.args.base,value:e}):Math.round(t*e)%Math.round(t*n)==0?e:a.error("number.multiple",{multiple:l.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>typeof e=="number"&&isFinite(e)&&e>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,a)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return o(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,a,{limit:n}){const r=e.toString().match(f.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?e:a.error("number.precision",{limit:n,value:e})},convert:!0},sign:{method(e){return o(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,a,{sign:n})=>n==="negative"&&e<0||n==="positive"&&e>0?e:a.error(`number.${n}`)},unsafe:{method(e=!0){return o(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>typeof e=="number",to:(e,a)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(e){return e.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),e==="-0"?"0":e}},8966:(j,w,p)=>{const o=p(7824);j.exports=o.extend({type:"object",cast:{map:{from:g=>g&&typeof g=="object",to:(g,m)=>new Map(Object.entries(g))}}})},7417:(j,w,p)=>{const o=p(375),g=p(5380),m=p(1745),f=p(9959),e=p(6064),a=p(9926),n=p(5752),r=p(8068),t=p(8160),l={tlds:a instanceof Set&&{tlds:{allow:a,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};j.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(s,{schema:i,state:u,prefs:d}){const y=i.$_getRule("normalize");y&&(s=s.normalize(y.args.form));const _=i.$_getRule("case");_&&(s=_.args.direction==="upper"?s.toLocaleUpperCase():s.toLocaleLowerCase());const v=i.$_getRule("trim");if(v&&v.args.enabled&&(s=s.trim()),i.$_terms.replacements)for(const h of i.$_terms.replacements)s=s.replace(h.pattern,h.replacement);const c=i.$_getRule("hex");if(c&&c.args.options.byteAligned&&s.length%2!=0&&(s=`0${s}`),i.$_getRule("isoDate")){const h=l.isoDate(s);h&&(s=h)}if(i._flags.truncate){const h=i.$_getRule("max");if(h){let b=h.args.limit;if(t.isResolvable(b)&&(b=b.resolve(s,u,d),!t.limit(b)))return{value:s,errors:i.$_createError("any.ref",b,{ref:h.args.limit,arg:"limit",reason:"must be a positive integer"},u,d)};s=s.slice(0,b)}}return{value:s}}},validate(s,{schema:i,error:u}){if(typeof s!="string")return{value:s,errors:u("string.base")};if(s===""){const d=i.$_getRule("min");return d&&d.args.limit===0?void 0:{value:s,errors:u("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(s,i)=>/^[a-zA-Z0-9]+$/.test(s)?s:i.error("string.alphanum")},base64:{method(s={}){return t.assertOptions(s,["paddingRequired","urlSafe"]),s={urlSafe:!1,paddingRequired:!0,...s},o(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof s.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:s}})},validate:(s,i,{options:u})=>l.base64Regex[u.paddingRequired][u.urlSafe].test(s)?s:i.error("string.base64")},case:{method(s){return o(["lower","upper"].includes(s),"Invalid case:",s),this.$_addRule({name:"case",args:{direction:s}})},validate:(s,i,{direction:u})=>u==="lower"&&s===s.toLocaleLowerCase()||u==="upper"&&s===s.toLocaleUpperCase()?s:i.error(`string.${u}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(s,i){let u=s.length,d=0,y=1;for(;u--;){const _=s.charAt(u)*y;d+=_-9*(_>9),y^=3}return d>0&&d%10==0?s:i.error("string.creditCard")}},dataUri:{method(s={}){return t.assertOptions(s,["paddingRequired"]),s={paddingRequired:!0,...s},o(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:s}})},validate(s,i,{options:u}){const d=s.match(l.dataUriRegex);return d&&(!d[2]||d[2]!=="base64"||l.base64Regex[u.paddingRequired].false.test(d[3]))?s:i.error("string.dataUri")}},domain:{method(s){s&&t.assertOptions(s,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const i=l.addressOptions(s);return this.$_addRule({name:"domain",args:{options:s},address:i})},validate:(s,i,u,{address:d})=>g.isValid(s,d)?s:i.error("string.domain")},email:{method(s={}){t.assertOptions(s,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(s.multiple===void 0||typeof s.multiple=="boolean","multiple option must be an boolean");const i=l.addressOptions(s),u=new RegExp(`\\s*[${s.separator?e(s.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:s},regex:u,address:i})},validate(s,i,{options:u},{regex:d,address:y}){const _=u.multiple?s.split(d):[s],v=[];for(const c of _)m.isValid(c,y)||v.push(c);return v.length?i.error("string.email",{value:s,invalids:v}):s}},guid:{alias:"uuid",method(s={}){t.assertOptions(s,["version","separator"]);let i="";if(s.version){const y=[].concat(s.version);o(y.length>=1,"version must have at least 1 valid version specified");const _=new Set;for(let v=0;v<y.length;++v){const c=y[v];o(typeof c=="string","version at position "+v+" must be a string");const h=l.guidVersions[c.toLowerCase()];o(h,"version at position "+v+" must be one of "+Object.keys(l.guidVersions).join(", ")),o(!_.has(h),"version at position "+v+" must not be a duplicate"),i+=h,_.add(h)}}o(l.guidSeparators.has(s.separator),'separator must be one of true, false, "-", or ":"');const u=s.separator===void 0?"[:-]?":s.separator===!0?"[:-]":s.separator===!1?"[]?":`\\${s.separator}`,d=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${u})[0-9A-F]{4}\\2?[${i||"0-9A-F"}][0-9A-F]{3}\\2?[${i?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:s},regex:d})},validate(s,i,u,{regex:d}){const y=d.exec(s);return y?l.guidBrackets[y[1]]!==y[y.length-1]?i.error("string.guid"):s:i.error("string.guid")}},hex:{method(s={}){return t.assertOptions(s,["byteAligned","prefix"]),s={byteAligned:!1,prefix:!1,...s},o(typeof s.byteAligned=="boolean","byteAligned must be boolean"),o(typeof s.prefix=="boolean"||s.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:s}})},validate:(s,i,{options:u})=>(u.prefix==="optional"?l.hexRegex.withOptionalPrefix:u.prefix===!0?l.hexRegex.withPrefix:l.hexRegex.withoutPrefix).test(s)?u.byteAligned&&s.length%2!=0?i.error("string.hexAlign"):s:i.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(s,i)=>g.isValid(s,{minDomainSegments:1})||l.ipRegex.test(s)?s:i.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(s={}){t.assertOptions(s,["cidr","version"]);const{cidr:i,versions:u,regex:d}=f.regex(s),y=s.version?u:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:i,version:y}},regex:d})},validate:(s,i,{options:u},{regex:d})=>d.test(s)?s:u.version?i.error("string.ipVersion",{value:s,cidr:u.cidr,version:u.version}):i.error("string.ip",{value:s,cidr:u.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(s,{error:i})=>l.isoDate(s)?s:i("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(s,i)=>l.isoDurationRegex.test(s)?s:i.error("string.isoDuration")},length:{method(s,i){return l.length(this,"length",s,"=",i)},validate(s,i,{limit:u,encoding:d},{name:y,operator:_,args:v}){const c=!d&&s.length;return t.compare(c,u,_)?s:i.error("string."+y,{limit:v.limit,value:s,encoding:d})},args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(s,i){return l.length(this,"max",s,"<=",i)},args:["limit","encoding"]},min:{method(s,i){return l.length(this,"min",s,">=",i)},args:["limit","encoding"]},normalize:{method(s="NFC"){return o(l.normalizationForms.includes(s),"normalization form must be one of "+l.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:s}})},validate:(s,{error:i},{form:u})=>s===s.normalize(u)?s:i("string.normalize",{value:s,form:u}),convert:!0},pattern:{alias:"regex",method(s,i={}){o(s instanceof RegExp,"regex must be a RegExp"),o(!s.flags.includes("g")&&!s.flags.includes("y"),"regex should not use global or sticky mode"),typeof i=="string"&&(i={name:i}),t.assertOptions(i,["invert","name"]);const u=["string.pattern",i.invert?".invert":"",i.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:s,options:i},errorCode:u})},validate:(s,i,{regex:u,options:d},{errorCode:y})=>u.test(s)^d.invert?s:i.error(y,{name:d.name,regex:u,value:s}),args:["regex","options"],multi:!0},replace:{method(s,i){typeof s=="string"&&(s=new RegExp(e(s),"g")),o(s instanceof RegExp,"pattern must be a RegExp"),o(typeof i=="string","replacement must be a String");const u=this.clone();return u.$_terms.replacements||(u.$_terms.replacements=[]),u.$_terms.replacements.push({pattern:s,replacement:i}),u}},token:{method(){return this.$_addRule("token")},validate:(s,i)=>/^\w+$/.test(s)?s:i.error("string.token")},trim:{method(s=!0){return o(typeof s=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:s}})},validate:(s,i,{enabled:u})=>u&&s!==s.trim()?i.error("string.trim"):s,convert:!0},truncate:{method(s=!0){return o(typeof s=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",s)}},uppercase:{method(){return this.case("upper")}},uri:{method(s={}){t.assertOptions(s,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),s.domain&&t.assertOptions(s.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:i,scheme:u}=n.regex(s),d=s.domain?l.addressOptions(s.domain):null;return this.$_addRule({name:"uri",args:{options:s},regex:i,domain:d,scheme:u})},validate(s,i,{options:u},{regex:d,domain:y,scheme:_}){if(["http:/","https:/"].includes(s))return i.error("string.uri");let v=d.exec(s);if(!v&&i.prefs.convert&&u.encodeUri){const c=encodeURI(s);v=d.exec(c),v&&(s=c)}if(v){const c=v[1]||v[2];return!y||u.allowRelative&&!c||g.isValid(c,y)?s:i.error("string.domain",{value:c})}return u.relativeOnly?i.error("string.uriRelativeOnly"):u.scheme?i.error("string.uriCustomScheme",{scheme:_,value:s}):i.error("string.uri")}}},manifest:{build(s,i){if(i.replacements)for(const{pattern:u,replacement:d}of i.replacements)s=s.replace(u,d);return s}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),l.addressOptions=function(s){if(!s)return l.tlds||s;if(o(s.minDomainSegments===void 0||Number.isSafeInteger(s.minDomainSegments)&&s.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(s.maxDomainSegments===void 0||Number.isSafeInteger(s.maxDomainSegments)&&s.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),s.tlds===!1)return s;if(s.tlds===!0||s.tlds===void 0)return o(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds);o(typeof s.tlds=="object","tlds must be true, false, or an object");const i=s.tlds.deny;if(i)return Array.isArray(i)&&(s=Object.assign({},s,{tlds:{deny:new Set(i)}})),o(s.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!s.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),l.validateTlds(s.tlds.deny,"tlds.deny"),s;const u=s.tlds.allow;return u?u===!0?(o(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds)):(Array.isArray(u)&&(s=Object.assign({},s,{tlds:{allow:new Set(u)}})),o(s.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),l.validateTlds(s.tlds.allow,"tlds.allow"),s):s},l.validateTlds=function(s,i){for(const u of s)o(g.isValid(u,{minDomainSegments:1,maxDomainSegments:1}),`${i} must contain valid top level domain names`)},l.isoDate=function(s){if(!t.isIsoDate(s))return null;/.*T.*[+-]\d\d$/.test(s)&&(s+="00");const i=new Date(s);return isNaN(i.getTime())?null:i.toISOString()},l.length=function(s,i,u,d,y){return o(!y||!1,"Invalid encoding:",y),s.$_addRule({name:i,method:"length",args:{limit:u,encoding:y},operator:d})}},8826:(j,w,p)=>{const o=p(375),g=p(8068),m={};m.Map=class extends Map{slice(){return new m.Map(this)}},j.exports=g.extend({type:"symbol",terms:{map:{init:new m.Map}},coerce:{method(f,{schema:e,error:a}){const n=e.$_terms.map.get(f);return n&&(f=n),e._flags.only&&typeof f!="symbol"?{value:f,errors:a("symbol.map",{map:e.$_terms.map})}:{value:f}}},validate(f,{error:e}){if(typeof f!="symbol")return{value:f,errors:e("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const e=this.clone(),a=[];for(const n of f){o(n&&n[Symbol.iterator],"Entry must be an iterable");const[r,t]=n;o(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),o(typeof t=="symbol","Value must be a Symbol"),e.$_terms.map.set(r,t),a.push(t)}return e.valid(...a)}}},manifest:{build:(f,e)=>(e.map&&(f=f.map(e.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(j,w,p)=>{const o=p(375),g=p(8571),m=p(738),f=p(9621),e=p(8160),a=p(6354),n=p(493),r={result:Symbol("result")};w.entry=function(t,l,s){let i=e.defaults;s&&(o(s.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(s.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),i=e.preferences(e.defaults,s));const u=r.entry(t,l,i);o(!u.mainstay.externals.length,"Schema with external rules must use validateAsync()");const d={value:u.value};return u.error&&(d.error=u.error),u.mainstay.warnings.length&&(d.warning=a.details(u.mainstay.warnings)),u.mainstay.debug&&(d.debug=u.mainstay.debug),u.mainstay.artifacts&&(d.artifacts=u.mainstay.artifacts),d},w.entryAsync=async function(t,l,s){let i=e.defaults;s&&(i=e.preferences(e.defaults,s));const u=r.entry(t,l,i),d=u.mainstay;if(u.error)throw d.debug&&(u.error.debug=d.debug),u.error;if(d.externals.length){let _=u.value;const v=[];for(const c of d.externals){const h=c.state.path,b=c.schema.type==="link"?d.links.get(c.schema):null;let x,S,R=_;const O=h.length?[_]:[],A=h.length?f(t,h):t;if(h.length){x=h[h.length-1];let D=_;for(const M of h.slice(0,-1))D=D[M],O.unshift(D);S=O[0],R=S[x]}try{const D=(F,E)=>(b||c.schema).$_createError(F,R,E,c.state,i),M=await c.method(R,{schema:c.schema,linked:b,state:c.state,prefs:s,original:A,error:D,errorsArray:r.errorsArray,warn:(F,E)=>d.warnings.push((b||c.schema).$_createError(F,R,E,c.state,i)),message:(F,E)=>(b||c.schema).$_createError("external",R,E,c.state,i,{messages:F})});if(M===void 0||M===R)continue;if(M instanceof a.Report){if(d.tracer.log(c.schema,c.state,"rule","external","error"),v.push(M),i.abortEarly)break;continue}if(Array.isArray(M)&&M[e.symbols.errors]){if(d.tracer.log(c.schema,c.state,"rule","external","error"),v.push(...M),i.abortEarly)break;continue}S?(d.tracer.value(c.state,"rule",R,M,"external"),S[x]=M):(d.tracer.value(c.state,"rule",_,M,"external"),_=M)}catch(D){throw i.errors.label&&(D.message+=` (${c.label})`),D}}if(u.value=_,v.length)throw u.error=a.process(v,t,i),d.debug&&(u.error.debug=d.debug),u.error}if(!i.warnings&&!i.debug&&!i.artifacts)return u.value;const y={value:u.value};return d.warnings.length&&(y.warning=a.details(d.warnings)),d.debug&&(y.debug=d.debug),d.artifacts&&(y.artifacts=d.artifacts),y},r.Mainstay=class{constructor(t,l,s){this.externals=[],this.warnings=[],this.tracer=t,this.debug=l,this.links=s,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}},r.entry=function(t,l,s){const{tracer:i,cleanup:u}=r.tracer(l,s),d=s.debug?[]:null,y=l._ids._schemaChain?new Map:null,_=new r.Mainstay(i,d,y),v=l._ids._schemaChain?[{schema:l}]:null,c=new n([],[],{mainstay:_,schemas:v}),h=w.validate(t,l,c,s);u&&l.$_root.untrace();const b=a.process(h.errors,t,s);return{value:h.value,error:b,mainstay:_}},r.tracer=function(t,l){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:l.debug?(o(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:r.ignore}},w.validate=function(t,l,s,i,u={}){if(l.$_terms.whens&&(l=l._generate(t,s,i).schema),l._preferences&&(i=r.prefs(l,i)),l._cache&&i.cache){const b=l._cache.get(t);if(s.mainstay.tracer.debug(s,"validate","cached",!!b),b)return b}const d=(b,x,S)=>l.$_createError(b,t,x,S||s,i),y={original:t,prefs:i,schema:l,state:s,error:d,errorsArray:r.errorsArray,warn:(b,x,S)=>s.mainstay.warnings.push(d(b,x,S)),message:(b,x)=>l.$_createError("custom",t,x,s,i,{messages:b})};s.mainstay.tracer.entry(l,s);const _=l._definition;if(_.prepare&&t!==void 0&&i.convert){const b=_.prepare(t,y);if(b){if(s.mainstay.tracer.value(s,"prepare",t,b.value),b.errors)return r.finalize(b.value,[].concat(b.errors),y);t=b.value}}if(_.coerce&&t!==void 0&&i.convert&&(!_.coerce.from||_.coerce.from.includes(typeof t))){const b=_.coerce.method(t,y);if(b){if(s.mainstay.tracer.value(s,"coerced",t,b.value),b.errors)return r.finalize(b.value,[].concat(b.errors),y);t=b.value}}const v=l._flags.empty;v&&v.$_match(r.trim(t,l),s.nest(v),e.defaults)&&(s.mainstay.tracer.value(s,"empty",t,void 0),t=void 0);const c=u.presence||l._flags.presence||(l._flags._endedSwitch?null:i.presence);if(t===void 0){if(c==="forbidden")return r.finalize(t,null,y);if(c==="required")return r.finalize(t,[l.$_createError("any.required",t,null,s,i)],y);if(c==="optional"){if(l._flags.default!==e.symbols.deepDefault)return r.finalize(t,null,y);s.mainstay.tracer.value(s,"default",t,{}),t={}}}else if(c==="forbidden")return r.finalize(t,[l.$_createError("any.unknown",t,null,s,i)],y);const h=[];if(l._valids){const b=l._valids.get(t,s,i,l._flags.insensitive);if(b)return i.convert&&(s.mainstay.tracer.value(s,"valids",t,b.value),t=b.value),s.mainstay.tracer.filter(l,s,"valid",b),r.finalize(t,null,y);if(l._flags.only){const x=l.$_createError("any.only",t,{valids:l._valids.values({display:!0})},s,i);if(i.abortEarly)return r.finalize(t,[x],y);h.push(x)}}if(l._invalids){const b=l._invalids.get(t,s,i,l._flags.insensitive);if(b){s.mainstay.tracer.filter(l,s,"invalid",b);const x=l.$_createError("any.invalid",t,{invalids:l._invalids.values({display:!0})},s,i);if(i.abortEarly)return r.finalize(t,[x],y);h.push(x)}}if(_.validate){const b=_.validate(t,y);if(b&&(s.mainstay.tracer.value(s,"base",t,b.value),t=b.value,b.errors)){if(!Array.isArray(b.errors))return h.push(b.errors),r.finalize(t,h,y);if(b.errors.length)return h.push(...b.errors),r.finalize(t,h,y)}}return l._rules.length?r.rules(t,h,y):r.finalize(t,h,y)},r.rules=function(t,l,s){const{schema:i,state:u,prefs:d}=s;for(const y of i._rules){const _=i._definition.rules[y.method];if(_.convert&&d.convert){u.mainstay.tracer.log(i,u,"rule",y.name,"full");continue}let v,c=y.args;if(y._resolve.length){c=Object.assign({},c);for(const b of y._resolve){const x=_.argsByName.get(b),S=c[b].resolve(t,u,d),R=x.normalize?x.normalize(S):S,O=e.validateArg(R,null,x);if(O){v=i.$_createError("any.ref",S,{arg:b,ref:c[b],reason:O},u,d);break}c[b]=R}}v=v||_.validate(t,s,c,y);const h=r.rule(v,y);if(h.errors){if(u.mainstay.tracer.log(i,u,"rule",y.name,"error"),y.warn){u.mainstay.warnings.push(...h.errors);continue}if(d.abortEarly)return r.finalize(t,h.errors,s);l.push(...h.errors)}else u.mainstay.tracer.log(i,u,"rule",y.name,"pass"),u.mainstay.tracer.value(u,"rule",t,h.value,y.name),t=h.value}return r.finalize(t,l,s)},r.rule=function(t,l){return t instanceof a.Report?(r.error(t,l),{errors:[t],value:null}):Array.isArray(t)&&t[e.symbols.errors]?(t.forEach(s=>r.error(s,l)),{errors:t,value:null}):{errors:null,value:t}},r.error=function(t,l){return l.message&&t._setTemplate(l.message),t},r.finalize=function(t,l,s){l=l||[];const{schema:i,state:u,prefs:d}=s;if(l.length){const _=r.default("failover",void 0,l,s);_!==void 0&&(u.mainstay.tracer.value(u,"failover",t,_),t=_,l=[])}if(l.length&&i._flags.error)if(typeof i._flags.error=="function"){l=i._flags.error(l),Array.isArray(l)||(l=[l]);for(const _ of l)o(_ instanceof Error||_ instanceof a.Report,"error() must return an Error object")}else l=[i._flags.error];if(t===void 0){const _=r.default("default",t,l,s);u.mainstay.tracer.value(u,"default",t,_),t=_}if(i._flags.cast&&t!==void 0){const _=i._definition.cast[i._flags.cast];if(_.from(t)){const v=_.to(t,s);u.mainstay.tracer.value(u,"cast",t,v,i._flags.cast),t=v}}if(i.$_terms.externals&&d.externals&&d._externals!==!1)for(const{method:_}of i.$_terms.externals)u.mainstay.externals.push({method:_,schema:i,state:u,label:a.label(i._flags,u,d)});const y={value:t,errors:l.length?l:null};return i._flags.result&&(y.value=i._flags.result==="strip"?void 0:s.original,u.mainstay.tracer.value(u,i._flags.result,t,y.value),u.shadow(t,i._flags.result)),i._cache&&d.cache!==!1&&!i._refs.length&&i._cache.set(s.original,y),t===void 0||y.errors||i._flags.artifact===void 0||(u.mainstay.artifacts=u.mainstay.artifacts||new Map,u.mainstay.artifacts.has(i._flags.artifact)||u.mainstay.artifacts.set(i._flags.artifact,[]),u.mainstay.artifacts.get(i._flags.artifact).push(u.path)),y},r.prefs=function(t,l){const s=l===e.defaults;return s&&t._preferences[e.symbols.prefs]?t._preferences[e.symbols.prefs]:(l=e.preferences(l,t._preferences),s&&(t._preferences[e.symbols.prefs]=l),l)},r.default=function(t,l,s,i){const{schema:u,state:d,prefs:y}=i,_=u._flags[t];if(y.noDefaults||_===void 0)return l;if(d.mainstay.tracer.log(u,d,"rule",t,"full"),!_)return _;if(typeof _=="function"){const v=_.length?[g(d.ancestors[0]),i]:[];try{return _(...v)}catch(c){return void s.push(u.$_createError(`any.${t}`,null,{error:c},d,y))}}return typeof _!="object"?_:_[e.symbols.literal]?_.literal:e.isResolvable(_)?_.resolve(l,d,y):g(_)},r.trim=function(t,l){if(typeof t!="string")return t;const s=l.$_getRule("trim");return s&&s.args.enabled?t.trim():t},r.ignore={active:!1,debug:m,entry:m,filter:m,log:m,resolve:m,value:m},r.errorsArray=function(){const t=[];return t[e.symbols.errors]=!0,t}},2036:(j,w,p)=>{const o=p(375),g=p(9474),m=p(8160),f={};j.exports=f.Values=class{constructor(e,a){this._values=new Set(e),this._refs=new Set(a),this._lowercase=f.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,a){m.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),a&&a.register(e)):this.has(e,null,null,!1)||(this._values.add(e),typeof e=="string"&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,a,n){if(e=e||new f.Values,a){if(a._override)return a.clone();for(const r of[...a._values,...a._refs])e.add(r)}if(n)for(const r of[...n._values,...n._refs])e.remove(r);return e.length?e:null}remove(e){m.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),typeof e=="string"&&this._lowercase.delete(e.toLowerCase()))}has(e,a,n,r){return!!this.get(e,a,n,r)}get(e,a,n,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if(typeof e=="string"&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&typeof e!="object")return!1;if(typeof e=="object"){for(const t of this._values)if(g(t,e))return{value:t}}if(a)for(const t of this._refs){const l=t.resolve(e,a,n,null,{in:!0});if(l===void 0)continue;const s=t.in&&typeof l=="object"?Array.isArray(l)?l:Object.keys(l):[l];for(const i of s)if(typeof i==typeof e){if(r&&e&&typeof e=="string"){if(i.toLowerCase()===e.toLowerCase())return{value:i,ref:t}}else if(g(i,e))return{value:i,ref:t}}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const a=[];for(const n of[...this._values,...this._refs])n!==void 0&&a.push(n);return a}return Array.from([...this._values,...this._refs])}clone(){const e=new f.Values(this._values,this._refs);return e._override=this._override,e}concat(e){o(!e._override,"Cannot concat override set of values");const a=new f.Values([...this._values,...e._values],[...this._refs,...e._refs]);return a._override=this._override,a}describe(){const e=[];this._override&&e.push({override:!0});for(const a of this._values.values())e.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())e.push(a.describe());return e}},f.Values.prototype[m.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(e){const a=new Map;if(e)for(const n of e)typeof n=="string"&&a.set(n.toLowerCase(),n);return a}},978:(j,w,p)=>{const o=p(375),g=p(8571),m=p(1687),f=p(9621),e={};j.exports=function(a,n,r={}){if(o(a&&typeof a=="object","Invalid defaults value: must be an object"),o(!n||n===!0||typeof n=="object","Invalid source value: must be true, falsy or an object"),o(typeof r=="object","Invalid options: must be an object"),!n)return null;if(r.shallow)return e.applyToDefaultsWithShallow(a,n,r);const t=g(a);if(n===!0)return t;const l=r.nullOverride!==void 0&&r.nullOverride;return m(t,n,{nullOverride:l,mergeArrays:!1})},e.applyToDefaultsWithShallow=function(a,n,r){const t=r.shallow;o(Array.isArray(t),"Invalid keys");const l=new Map,s=n===!0?null:new Set;for(let d of t){d=Array.isArray(d)?d:d.split(".");const y=f(a,d);y&&typeof y=="object"?l.set(y,s&&f(n,d)||y):s&&s.add(d)}const i=g(a,{},l);if(!s)return i;for(const d of s)e.reachCopy(i,n,d);const u=r.nullOverride!==void 0&&r.nullOverride;return m(i,n,{nullOverride:u,mergeArrays:!1})},e.reachCopy=function(a,n,r){for(const s of r){if(!(s in n))return;const i=n[s];if(typeof i!="object"||i===null)return;n=i}const t=n;let l=a;for(let s=0;s<r.length-1;++s){const i=r[s];typeof l[i]!="object"&&(l[i]={}),l=l[i]}l[r[r.length-1]]=t}},375:(j,w,p)=>{const o=p(7916);j.exports=function(g,...m){if(!g)throw m.length===1&&m[0]instanceof Error?m[0]:new o(m)}},8571:(j,w,p)=>{const o=p(9621),g=p(4277),m=p(7043),f={needsProtoHack:new Set([g.set,g.map,g.weakSet,g.weakMap])};j.exports=f.clone=function(e,a={},n=null){if(typeof e!="object"||e===null)return e;let r=f.clone,t=n;if(a.shallow){if(a.shallow!==!0)return f.cloneWithShallow(e,a);r=u=>u}else if(t){const u=t.get(e);if(u)return u}else t=new Map;const l=g.getInternalProto(e);if(l===g.buffer)return!1;if(l===g.date)return new Date(e.getTime());if(l===g.regex)return new RegExp(e);const s=f.base(e,l,a);if(s===e)return e;if(t&&t.set(e,s),l===g.set)for(const u of e)s.add(r(u,a,t));else if(l===g.map)for(const[u,d]of e)s.set(u,r(d,a,t));const i=m.keys(e,a);for(const u of i){if(u==="__proto__")continue;if(l===g.array&&u==="length"){s.length=e.length;continue}const d=Object.getOwnPropertyDescriptor(e,u);d?d.get||d.set?Object.defineProperty(s,u,d):d.enumerable?s[u]=r(e[u],a,t):Object.defineProperty(s,u,{enumerable:!1,writable:!0,configurable:!0,value:r(e[u],a,t)}):Object.defineProperty(s,u,{enumerable:!0,writable:!0,configurable:!0,value:r(e[u],a,t)})}return s},f.cloneWithShallow=function(e,a){const n=a.shallow;(a=Object.assign({},a)).shallow=!1;const r=new Map;for(const t of n){const l=o(e,t);typeof l!="object"&&typeof l!="function"||r.set(l,l)}return f.clone(e,a,r)},f.base=function(e,a,n){if(n.prototype===!1)return f.needsProtoHack.has(a)?new a.constructor:a===g.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(a===g.array){const t=[];return r!==a&&Object.setPrototypeOf(t,r),t}if(f.needsProtoHack.has(a)){const t=new r.constructor;return r!==a&&Object.setPrototypeOf(t,r),t}return Object.create(r)}},9474:(j,w,p)=>{const o=p(4277),g={mismatched:null};j.exports=function(m,f,e){return e=Object.assign({prototype:!0},e),!!g.isDeepEqual(m,f,e,[])},g.isDeepEqual=function(m,f,e,a){if(m===f)return m!==0||1/m==1/f;const n=typeof m;if(n!==typeof f||m===null||f===null)return!1;if(n==="function"){if(!e.deepFunction||m.toString()!==f.toString())return!1}else if(n!=="object")return m!=m&&f!=f;const r=g.getSharedType(m,f,!!e.prototype);switch(r){case o.buffer:return!1;case o.promise:return m===f;case o.regex:return m.toString()===f.toString();case g.mismatched:return!1}for(let t=a.length-1;t>=0;--t)if(a[t].isSame(m,f))return!0;a.push(new g.SeenEntry(m,f));try{return!!g.isDeepEqualObj(r,m,f,e,a)}finally{a.pop()}},g.getSharedType=function(m,f,e){if(e)return Object.getPrototypeOf(m)!==Object.getPrototypeOf(f)?g.mismatched:o.getInternalProto(m);const a=o.getInternalProto(m);return a!==o.getInternalProto(f)?g.mismatched:a},g.valueOf=function(m){const f=m.valueOf;if(f===void 0)return m;try{return f.call(m)}catch(e){return e}},g.hasOwnEnumerableProperty=function(m,f){return Object.prototype.propertyIsEnumerable.call(m,f)},g.isSetSimpleEqual=function(m,f){for(const e of Set.prototype.values.call(m))if(!Set.prototype.has.call(f,e))return!1;return!0},g.isDeepEqualObj=function(m,f,e,a,n){const{isDeepEqual:r,valueOf:t,hasOwnEnumerableProperty:l}=g,{keys:s,getOwnPropertySymbols:i}=Object;if(m===o.array){if(!a.part){if(f.length!==e.length)return!1;for(let v=0;v<f.length;++v)if(!r(f[v],e[v],a,n))return!1;return!0}for(const v of f)for(const c of e)if(r(v,c,a,n))return!0}else if(m===o.set){if(f.size!==e.size)return!1;if(!g.isSetSimpleEqual(f,e)){const v=new Set(Set.prototype.values.call(e));for(const c of Set.prototype.values.call(f)){if(v.delete(c))continue;let h=!1;for(const b of v)if(r(c,b,a,n)){v.delete(b),h=!0;break}if(!h)return!1}}}else if(m===o.map){if(f.size!==e.size)return!1;for(const[v,c]of Map.prototype.entries.call(f))if(c===void 0&&!Map.prototype.has.call(e,v)||!r(c,Map.prototype.get.call(e,v),a,n))return!1}else if(m===o.error&&(f.name!==e.name||f.message!==e.message))return!1;const u=t(f),d=t(e);if((f!==u||e!==d)&&!r(u,d,a,n))return!1;const y=s(f);if(!a.part&&y.length!==s(e).length&&!a.skip)return!1;let _=0;for(const v of y)if(a.skip&&a.skip.includes(v))e[v]===void 0&&++_;else if(!l(e,v)||!r(f[v],e[v],a,n))return!1;if(!a.part&&y.length-_!==s(e).length)return!1;if(a.symbols!==!1){const v=i(f),c=new Set(i(e));for(const h of v){if(!a.skip||!a.skip.includes(h)){if(l(f,h)){if(!l(e,h)||!r(f[h],e[h],a,n))return!1}else if(l(e,h))return!1}c.delete(h)}for(const h of c)if(l(e,h))return!1}return!0},g.SeenEntry=class{constructor(m,f){this.obj=m,this.ref=f}isSame(m,f){return this.obj===m&&this.ref===f}}},7916:(j,w,p)=>{const o=p(8761);j.exports=class extends Error{constructor(g){super(g.filter(m=>m!=="").map(m=>typeof m=="string"?m:m instanceof Error?m.message:o(m)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,w.assert)}}},5277:j=>{const w={};j.exports=function(p){if(!p)return"";let o="";for(let g=0;g<p.length;++g){const m=p.charCodeAt(g);w.isSafe(m)?o+=p[g]:o+=w.escapeHtmlChar(m)}return o},w.escapeHtmlChar=function(p){return w.namedHtml.get(p)||(p>=256?"&#"+p+";":`&#x${p.toString(16).padStart(2,"0")};`)},w.isSafe=function(p){return w.safeCharCodes.has(p)},w.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),w.safeCharCodes=function(){const p=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&p.add(o);return p}()},6064:j=>{j.exports=function(w){return w.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:j=>{j.exports=function(){}},1687:(j,w,p)=>{const o=p(375),g=p(8571),m=p(7043),f={};j.exports=f.merge=function(e,a,n){if(o(e&&typeof e=="object","Invalid target value: must be an object"),o(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return e;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(a)){o(Array.isArray(e),"Cannot merge array onto an object"),n.mergeArrays||(e.length=0);for(let t=0;t<a.length;++t)e.push(g(a[t],{symbols:n.symbols}));return e}const r=m.keys(a,n);for(let t=0;t<r.length;++t){const l=r[t];if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,l))continue;const s=a[l];if(s&&typeof s=="object"){if(e[l]===s)continue;!e[l]||typeof e[l]!="object"||Array.isArray(e[l])!==Array.isArray(s)||s instanceof Date||s instanceof RegExp?e[l]=g(s,{symbols:n.symbols}):f.merge(e[l],s,n)}else(s!=null||n.nullOverride)&&(e[l]=s)}return e}},9621:(j,w,p)=>{const o=p(375),g={};j.exports=function(m,f,e){if(f===!1||f==null)return m;typeof(e=e||{})=="string"&&(e={separator:e});const a=Array.isArray(f);o(!a||!e.separator,"Separator option is not valid for array-based chain");const n=a?f:f.split(e.separator||".");let r=m;for(let t=0;t<n.length;++t){let l=n[t];const s=e.iterables&&g.iterables(r);if(Array.isArray(r)||s==="set"){const i=Number(l);Number.isInteger(i)&&(l=i<0?r.length+i:i)}if(!r||typeof r=="function"&&e.functions===!1||!s&&r[l]===void 0){o(!e.strict||t+1===n.length,"Missing segment",l,"in reach path ",f),o(typeof r=="object"||e.functions===!0||typeof r!="function","Invalid segment",l,"in reach path ",f),r=e.default;break}r=s?s==="set"?[...r][l]:r.get(l):r[l]}return r},g.iterables=function(m){return m instanceof Set?"set":m instanceof Map?"map":void 0}},8761:j=>{j.exports=function(...w){try{return JSON.stringify(...w)}catch(p){return"[Cannot display object: "+p.message+"]"}}},4277:(j,w)=>{const p={};w=j.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},p.typeMap=new Map([["[object Error]",w.error],["[object Map]",w.map],["[object Promise]",w.promise],["[object Set]",w.set],["[object WeakMap]",w.weakMap],["[object WeakSet]",w.weakSet]]),w.getInternalProto=function(o){if(Array.isArray(o))return w.array;if(o instanceof Date)return w.date;if(o instanceof RegExp)return w.regex;if(o instanceof Error)return w.error;const g=Object.prototype.toString.call(o);return p.typeMap.get(g)||w.generic}},7043:(j,w)=>{w.keys=function(p,o={}){return o.symbols!==!1?Reflect.ownKeys(p):Object.getOwnPropertyNames(p)}},3652:(j,w,p)=>{const o=p(375),g={};w.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(m,f){const e=[].concat((f=f||{}).before||[]),a=[].concat(f.after||[]),n=f.group||"?",r=f.sort||0;o(!e.includes(n),`Item cannot come before itself: ${n}`),o(!e.includes("?"),"Item cannot come before unassociated items"),o(!a.includes(n),`Item cannot come after itself: ${n}`),o(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(m)||(m=[m]);for(const t of m){const l={seq:this._items.length,sort:r,before:e,after:a,group:n,node:t};this._items.push(l)}if(!f.manual){const t=this._sort();o(t,"item",n!=="?"?`added into group ${n}`:"","created a dependencies error")}return this.nodes}merge(m){Array.isArray(m)||(m=[m]);for(const e of m)if(e)for(const a of e._items)this._items.push(Object.assign({},a));this._items.sort(g.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const f=this._sort();return o(f,"merge created a dependencies error"),this.nodes}sort(){const m=this._sort();return o(m,"sort created a dependencies error"),this.nodes}_sort(){const m={},f=Object.create(null),e=Object.create(null);for(const l of this._items){const s=l.seq,i=l.group;e[i]=e[i]||[],e[i].push(s),m[s]=l.before;for(const u of l.after)f[u]=f[u]||[],f[u].push(s)}for(const l in m){const s=[];for(const i in m[l]){const u=m[l][i];e[u]=e[u]||[],s.push(...e[u])}m[l]=s}for(const l in f)if(e[l])for(const s of e[l])m[s].push(...f[l]);const a={};for(const l in m){const s=m[l];for(const i of s)a[i]=a[i]||[],a[i].push(l)}const n={},r=[];for(let l=0;l<this._items.length;++l){let s=l;if(a[l]){s=null;for(let i=0;i<this._items.length;++i){if(n[i]===!0)continue;a[i]||(a[i]=[]);const u=a[i].length;let d=0;for(let y=0;y<u;++y)n[a[i][y]]&&++d;if(d===u){s=i;break}}}s!==null&&(n[s]=!0,r.push(s))}if(r.length!==this._items.length)return!1;const t={};for(const l of this._items)t[l.seq]=l;this._items=[],this.nodes=[];for(const l of r){const s=t[l];this.nodes.push(s.node),this._items.push(s)}return!0}},g.mergeSort=(m,f)=>m.sort===f.sort?0:m.sort<f.sort?-1:1},5380:(j,w,p)=>{const o=p(443),g=p(2178),m={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:o.URL||URL};w.analyze=function(f,e={}){if(!f)return g.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return g.code("DOMAIN_TOO_LONG");if(m.nonAsciiRx.test(f)){if(e.allowUnicode===!1)return g.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(m.domainControlRx.test(f))return g.code("DOMAIN_INVALID_CHARS");f=m.punycode(f),e.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const a=e.minDomainSegments||m.minDomainSegments,n=f.split(".");if(n.length<a)return g.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&n.length>e.maxDomainSegments)return g.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=e.tlds;if(r){const t=n[n.length-1].toLowerCase();if(r.deny&&r.deny.has(t)||r.allow&&!r.allow.has(t))return g.code("DOMAIN_FORBIDDEN_TLDS")}for(let t=0;t<n.length;++t){const l=n[t];if(!l.length)return g.code("DOMAIN_EMPTY_SEGMENT");if(l.length>63)return g.code("DOMAIN_LONG_SEGMENT");if(t<n.length-1){if(!m.domainSegmentRx.test(l))return g.code("DOMAIN_INVALID_CHARS")}else if(!m.tldSegmentRx.test(l))return g.code("DOMAIN_INVALID_TLDS_CHARS")}return null},w.isValid=function(f,e){return!w.analyze(f,e)},m.punycode=function(f){f.includes("%")&&(f=f.replace(/%/g,"%25"));try{return new m.URL(`http://${f}`).host}catch{return f}}},1745:(j,w,p)=>{const o=p(9848),g=p(5380),m=p(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};w.analyze=function(e,a){return f.email(e,a)},w.isValid=function(e,a){return!f.email(e,a)},f.email=function(e,a={}){if(typeof e!="string")throw new Error("Invalid input: email must be a string");if(!e)return m.code("EMPTY_STRING");const n=!f.nonAsciiRx.test(e);if(!n){if(a.allowUnicode===!1)return m.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(r.length!==2)return r.length>2?m.code("MULTIPLE_AT_CHAR"):m.code("MISSING_AT_CHAR");const[t,l]=r;if(!t)return m.code("EMPTY_LOCAL");if(!a.ignoreLength){if(e.length>254)return m.code("ADDRESS_TOO_LONG");if(f.encoder.encode(t).length>64)return m.code("LOCAL_TOO_LONG")}return f.local(t,n)||g.analyze(l,a)},f.local=function(e,a){const n=e.split(".");for(const r of n){if(!r.length)return m.code("EMPTY_LOCAL_SEGMENT");if(a){if(!f.atextRx.test(r))return m.code("INVALID_LOCAL_CHARS")}else for(const t of r){if(f.atextRx.test(t))continue;const l=f.binary(t);if(!f.atomRx.test(l))return m.code("INVALID_LOCAL_CHARS")}}},f.binary=function(e){return Array.from(f.encoder.encode(e)).map(a=>String.fromCharCode(a)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(j,w)=>{w.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},w.code=function(p){return{code:p,error:w.codes[p]}}},9959:(j,w,p)=>{const o=p(375),g=p(5752);w.regex=function(m={}){o(m.cidr===void 0||typeof m.cidr=="string","options.cidr must be a string");const f=m.cidr?m.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(m.version===void 0||typeof m.version=="string"||Array.isArray(m.version),"options.version must be a string or an array of string");let e=m.version||["ipv4","ipv6","ipvfuture"];Array.isArray(e)||(e=[e]),o(e.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<e.length;++r)o(typeof e[r]=="string","options.version must only contain strings"),e[r]=e[r].toLowerCase(),o(["ipv4","ipv6","ipvfuture"].includes(e[r]),"options.version contains unknown version "+e[r]+" - must be one of ipv4, ipv6, ipvfuture");e=Array.from(new Set(e));const a=`(?:${e.map(r=>{if(f==="forbidden")return g.ip[r];const t=`\\/${r==="ipv4"?g.ip.v4Cidr:g.ip.v6Cidr}`;return f==="required"?`${g.ip[r]}${t}`:`${g.ip[r]}(?:${t})?`}).join("|")})`,n=new RegExp(`^${a}$`);return{cidr:f,versions:e,regex:n,raw:a}}},5752:(j,w,p)=>{const o=p(375),g=p(6064),m={generate:function(){const f={},e="\\dA-Fa-f",a="["+e+"]",n="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",t="%"+e,l=n+t+r+":@",s="["+l+"]",i="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+i+"\\.){3}"+i;const u=a+"{1,4}",d="(?:"+u+":"+u+"|"+f.ipv4address+")",y="(?:"+u+":){6}"+d,_="::(?:"+u+":){5}"+d,v="(?:"+u+")?::(?:"+u+":){4}"+d,c="(?:(?:"+u+":){0,1}"+u+")?::(?:"+u+":){3}"+d,h="(?:(?:"+u+":){0,2}"+u+")?::(?:"+u+":){2}"+d,b="(?:(?:"+u+":){0,3}"+u+")?::"+u+":"+d,x="(?:(?:"+u+":){0,4}"+u+")?::"+d,S="(?:(?:"+u+":){0,5}"+u+")?::"+u,R="(?:(?:"+u+":){0,6}"+u+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+y+"|"+_+"|"+v+"|"+c+"|"+h+"|"+b+"|"+x+"|"+S+"|"+R+")",f.ipvFuture="v"+a+"+\\.["+n+r+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const O="["+n+t+r+":]*",A="["+n+t+r+"]{1,255}",D="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+A+")",M="(?:"+O+"@)?"+D+"(?::\\d*)?",F="(?:"+O+"@)?("+D+")(?::\\d*)?",E=s+"*",I=s+"+",L="(?:\\/"+E+")*",N="\\/(?:"+I+L+")?",B=I+L,K="["+n+t+r+"@]+"+L,se="(?:\\/\\/\\/"+E+L+")";return f.hierPart="(?:(?:\\/\\/"+M+L+")|"+N+"|"+B+"|"+se+")",f.hierPartCapture="(?:(?:\\/\\/"+F+L+")|"+N+"|"+B+")",f.relativeRef="(?:(?:\\/\\/"+M+L+")|"+N+"|"+K+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+F+L+")|"+N+"|"+K+"|)",f.query="["+l+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+l+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+l+"\\/\\?]*",f}};m.rfc3986=m.generate(),w.ip={v4Cidr:m.rfc3986.ipv4Cidr,v6Cidr:m.rfc3986.ipv6Cidr,ipv4:m.rfc3986.ipv4address,ipv6:m.rfc3986.ipv6address,ipvfuture:m.rfc3986.ipvFuture},m.createRegex=function(f){const e=m.rfc3986,a="(?:\\?"+(f.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",n=f.domain?e.relativeRefCapture:e.relativeRef;if(f.relativeOnly)return m.wrap(n+a);let r="";if(f.scheme){o(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const s=[].concat(f.scheme);o(s.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let u=0;u<s.length;++u){const d=s[u];o(d instanceof RegExp||typeof d=="string","scheme at position "+u+" must be a RegExp or String"),d instanceof RegExp?i.push(d.source.toString()):(o(e.schemeRegex.test(d),"scheme at position "+u+" must be a valid scheme"),i.push(g(d)))}r=i.join("|")}const t="(?:"+(r?"(?:"+r+")":e.scheme)+":"+(f.domain?e.hierPartCapture:e.hierPart)+")",l=f.allowRelative?"(?:"+t+"|"+n+")":t;return m.wrap(l+a,r)},m.wrap=function(f,e){return{raw:f=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${f}`,regex:new RegExp(`^${f}$`),scheme:e}},m.uriRegex=m.createRegex({}),w.regex=function(f={}){return f.scheme||f.allowRelative||f.relativeOnly||f.allowQuerySquareBrackets||f.domain?m.createRegex(f):m.uriRegex}},1447:(j,w)=>{const p={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};w.Parser=class{constructor(o,g={}){if(!g[p.settings]&&g.constants)for(const m in g.constants){const f=g.constants[m];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${m} contains invalid ${typeof f} value type`)}this.settings=g[p.settings]?g:Object.assign({[p.settings]:!0,constants:{},functions:{}},g),this.single=null,this._parts=null,this._parse(o)}_parse(o){let g=[],m="",f=0,e=!1;const a=r=>{if(f)throw new Error("Formula missing closing parenthesis");const t=g.length?g[g.length-1]:null;if(e||m||r){if(t&&t.type==="reference"&&r===")")return t.type="function",t.value=this._subFormula(m,t.value),void(m="");if(r===")"){const l=new w.Parser(m,this.settings);g.push({type:"segment",value:l})}else if(e){if(e==="]")return g.push({type:"reference",value:m}),void(m="");g.push({type:"literal",value:m})}else if(p.operatorCharacters.includes(m))t&&t.type==="operator"&&p.operators.includes(t.value+m)?t.value+=m:g.push({type:"operator",value:m});else if(m.match(p.numberRx))g.push({type:"constant",value:parseFloat(m)});else if(this.settings.constants[m]!==void 0)g.push({type:"constant",value:this.settings.constants[m]});else{if(!m.match(p.tokenRx))throw new Error(`Formula contains invalid token: ${m}`);g.push({type:"reference",value:m})}m=""}};for(const r of o)e?r===e?(a(),e=!1):m+=r:f?r==="("?(m+=r,++f):r===")"?(--f,f?m+=r:a(r)):m+=r:r in p.literals?e=p.literals[r]:r==="("?(a(),++f):p.operatorCharacters.includes(r)?(a(),m=r,a()):r!==" "?m+=r:a();a(),g=g.map((r,t)=>r.type!=="operator"||r.value!=="-"||t&&g[t-1].type!=="operator"?r:{type:"operator",value:"n"});let n=!1;for(const r of g){if(r.type==="operator"){if(p.operatorsPrefix.includes(r.value))continue;if(!n)throw new Error("Formula contains an operator in invalid position");if(!p.operators.includes(r.value))throw new Error(`Formula contains an unknown operator ${r.value}`)}else if(n)throw new Error("Formula missing expected operator");n=!n}if(!n)throw new Error("Formula contains invalid trailing operator");g.length===1&&["reference","literal","constant"].includes(g[0].type)&&(this.single={type:g[0].type==="reference"?"reference":"value",value:g[0].value}),this._parts=g.map(r=>{if(r.type==="operator")return p.operatorsPrefix.includes(r.value)?r:r.value;if(r.type!=="reference")return r.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(r.value))throw new Error(`Formula contains invalid reference ${r.value}`);return this.settings.reference?this.settings.reference(r.value):p.reference(r.value)})}_subFormula(o,g){const m=this.settings.functions[g];if(typeof m!="function")throw new Error(`Formula contains unknown function ${g}`);let f=[];if(o){let e="",a=0,n=!1;const r=()=>{if(!e)throw new Error(`Formula contains function ${g} with invalid arguments ${o}`);f.push(e),e=""};for(let t=0;t<o.length;++t){const l=o[t];n?(e+=l,l===n&&(n=!1)):l in p.literals&&!a?(e+=l,n=p.literals[l]):l!==","||a?(e+=l,l==="("?++a:l===")"&&--a):r()}r()}return f=f.map(e=>new w.Parser(e,this.settings)),function(e){const a=[];for(const n of f)a.push(n.evaluate(e));return m.call(e,...a)}}evaluate(o){const g=this._parts.slice();for(let m=g.length-2;m>=0;--m){const f=g[m];if(f&&f.type==="operator"){const e=g[m+1];g.splice(m+1,1);const a=p.evaluate(e,o);g[m]=p.single(f.value,a)}}return p.operatorsOrder.forEach(m=>{for(let f=1;f<g.length-1;)if(m.includes(g[f])){const e=g[f],a=p.evaluate(g[f-1],o),n=p.evaluate(g[f+1],o);g.splice(f,2);const r=p.calculate(e,a,n);g[f-1]=r===0?0:r}else f+=2}),p.evaluate(g[0],o)}},w.Parser.prototype[p.symbol]=!0,p.reference=function(o){return function(g){return g&&g[o]!==void 0?g[o]:null}},p.evaluate=function(o,g){return o===null?null:typeof o=="function"?o(g):o[p.symbol]?o.evaluate(g):o},p.single=function(o,g){if(o==="!")return!g;const m=-g;return m===0?0:m},p.calculate=function(o,g,m){if(o==="??")return p.exists(g)?g:m;if(typeof g=="string"||typeof m=="string"){if(o==="+")return(g=p.exists(g)?g:"")+(p.exists(m)?m:"")}else switch(o){case"^":return Math.pow(g,m);case"*":return g*m;case"/":return g/m;case"%":return g%m;case"+":return g+m;case"-":return g-m}switch(o){case"<":return g<m;case"<=":return g<=m;case">":return g>m;case">=":return g>=m;case"==":return g===m;case"!=":return g!==m;case"&&":return g&&m;case"||":return g||m}return null},p.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:j=>{j.exports=JSON.parse('{"version":"17.13.3"}')}},C={},function j(w){var p=C[w];if(p!==void 0)return p.exports;var o=C[w]={exports:{}};return P[w](o,o.exports,j),o.exports}(5107);var P,C})}(de)),de.exports}var X={},xe;function gt(){if(xe)return X;xe=1;var $=X&&X.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(X,"__esModule",{value:!0}),X.BNExtension=P;const q=$(lt());function P(C){return{type:"BN",base:C.any(),messages:{"bn.nan":"{{#label}} is not a big number","bn.max":'{{#label}} needs to be less than or equal to "{{#threshold}}"',"bn.min":'{{#label}} needs to be greater than or equal to "{{#threshold}}"',"bn.less":'{{#label}} needs to be less than "{{#threshold}}"',"bn.greater":'{{#label}} needs to be greater than "{{#threshold}}"',"bn.positive":"{{#label}} needs to be positive","bn.negative":"{{#label}} needs to be negative"},prepare(j,w){try{return{value:new q.default(j)}}catch{return{errors:w.error("bn.nan")}}},coerce(j){return{value:j.toString(10)}},validate(j){return{value:j}},rules:{gt:{args:[{name:"threshold",ref:!0,assert:j=>q.default.isBN(j),message:"must be a big number",normalize:j=>new q.default(j)},{name:"equal",assert:j=>typeof j=="boolean",message:"must be a boolean"}],validate(j,w,p){const o=new q.default(j);return p.equal&&o.lt(p.threshold)?w.error("bn.min",p):!p.equal&&o.lte(p.threshold)?w.error("bn.greater",p):j}},lt:{args:[{name:"threshold",ref:!0,assert:j=>q.default.isBN(j),message:"must be a big number",normalize:j=>new q.default(j)},{name:"equal",assert:j=>typeof j=="boolean",message:"must be a boolean"}],validate(j,w,p){const o=new q.default(j);return p.equal&&o.gt(p.threshold)?w.error("bn.max",p):!p.equal&&o.gte(p.threshold)?w.error("bn.less",p):j}},min:{alias:"gte",method(j){return this.$_addRule({name:"gt",args:{threshold:j,equal:!0}})}},max:{alias:"lte",method(j){return this.$_addRule({name:"lt",args:{threshold:j,equal:!0}})}},greater:{alias:"gt",method(j){return this.$_addRule({name:"gt",args:{threshold:j,equal:!1}})}},less:{alias:"lt",method(j){return this.$_addRule({name:"lt",args:{threshold:j,equal:!1}})}},positive:{method(){return this.$_addRule({name:"gt",args:{threshold:0,equal:!1}})}},negative:{method(){return this.$_addRule({name:"lt",args:{threshold:0,equal:!1}})}}}}}return X}var ee={},$e;function yt(){if($e)return ee;$e=1;var $=ee&&ee.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(ee,"__esModule",{value:!0}),ee.DIDExtension=w;const q=$(nt),P=Qe(),C=Xe(),j={pk:Object.keys(P.types.KeyType),hash:Object.keys(P.types.HashType),role:Object.keys(P.types.RoleType)};function w(p){return{type:"DID",base:p.string().trim(),messages:{"did.empty":"Expect {{#label}} to be non-empty string","did.invalid":"Expect {{#label}} to be valid did","did.wallet":'Expect wallet type of {{#label}} to be "{{#expected}}" wallet',"did.pk":'Expect pk type of {{#label}} to be "{{#expected}}"',"did.hash":'Expect hash type of {{#label}} to be "{{#expected}}"',"did.role":'Expect role type of {{#label}} to be "{{#expected}}"',"did.prefix":'Expect prefix of {{#label}} to be "{{#expected}}"'},validate(o,g){return!o||typeof o!="string"?{errors:g.error("did.empty",{value:o})}:(0,C.isValid)(o)===!1?{errors:g.error("did.invalid",{value:o})}:{value:o}},rules:{type:{args:[{name:"key",ref:!0,assert:o=>Object.keys(j).includes(o),message:`must be one of ${Object.keys(j).join(", ")}`},{name:"expected",assert:o=>Object.keys(j).some(g=>j[g].includes(o)),message:"must be valid type"}],validate(o,g,m){const f=(0,C.toTypeInfoStr)(o);return m.key==="pk"&&f.pk!==m.expected?g.error("did.pk",{...m,actual:f.pk}):m.key==="hash"&&f.hash!==m.expected?g.error("did.hash",{...m,actual:f.hash}):m.key==="role"&&f.role!==m.expected?g.error("did.role",{...m,actual:f.role}):o}},pk:{method(o){return this.$_addRule({name:"type",args:{key:"pk",expected:o}})}},hash:{method(o){return this.$_addRule({name:"type",args:{key:"hash",expected:o}})}},role:{method(o){return this.$_addRule({name:"type",args:{key:"role",expected:o}})}},wallet:{method(o){return this.$_addRule({name:"wallet",args:{type:o}})},args:[{name:"type",ref:!0,assert:o=>["arcblock","ethereum","default","eth","passkey"].includes(o),message:"must be a string",normalize:o=>o.trim()}],validate(o,g,m={}){const f=(0,C.toTypeInfo)(o),e=(0,C.toTypeInfoStr)(o);return["ethereum","eth"].includes(m.type)&&(0,q.default)(f,C.DID_TYPE_ETHEREUM)===!1?g.error("did.wallet",{expected:m.type,actual:JSON.stringify(e)}):["arcblock","default"].includes(m.type)&&(0,q.default)(f,C.DID_TYPE_ARCBLOCK)===!1?g.error("did.wallet",{expected:m.type,actual:JSON.stringify(e)}):["passkey"].includes(m.type)&&(0,q.default)(f,C.DID_TYPE_PASSKEY)===!1?g.error("did.wallet",{expected:m.type,actual:JSON.stringify(e)}):o}},prefix:{method(o=""){return this.$_addRule({name:"prefix",args:{str:o}})},args:[{name:"str",ref:!0,assert:o=>["",C.DID_PREFIX].includes(o),message:"must be a string",normalize:o=>o.trim()}],validate(o,g,m={}){return m.str&&o.startsWith(m.str)===!1?g.error("did.prefix",{expected:m.str}):!m.str&&(0,C.toAddress)(o)!==o?g.error("did.prefix",{expected:m.str}):o}}}}}return ee}var je;function bt(){return je||(je=1,function($){var q=ae&&ae.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty($,"__esModule",{value:!0}),$.patterns=$.schemas=$.Joi=void 0;const P=q(pt()),C=gt(),j=yt();$.Joi=P.default.extend(j.DIDExtension).extend(C.BNExtension);const w=/^(0x)?([A-Fa-f0-9]{64})$/,p=$.Joi.object({genesisTime:$.Joi.date().iso().required().raw(),genesisTx:$.Joi.string().regex(w).required().allow(""),renaissanceTime:$.Joi.date().iso().required().raw(),renaissanceTx:$.Joi.string().regex(w).required().allow("")}),o=$.Joi.object({address:$.Joi.DID().prefix().role("ROLE_TOKEN").required(),value:$.Joi.BN().positive().required()}),g=$.Joi.object({name:$.Joi.string().min(1).max(256).required(),value:$.Joi.string().min(1).max(1024).required(),description:$.Joi.string().min(1).max(256).optional().allow(""),required:$.Joi.boolean().optional().default(!1)}),m=$.Joi.alternatives().try($.Joi.DID().prefix().role("ROLE_ACCOUNT"),$.Joi.DID().prefix().role("ROLE_APPLICATION"),$.Joi.DID().prefix().role("ROLE_BLOCKLET"),$.Joi.DID().prefix().wallet("ethereum"),$.Joi.DID().prefix().wallet("passkey")),f=$.Joi.array().items($.Joi.object({owner:m.required(),tokensList:$.Joi.array().items(o).default([]),assetsList:$.Joi.array().items($.Joi.DID().prefix().role("ROLE_ASSET")).default([])})),e=$.Joi.array().items({signer:$.Joi.DID().prefix().required(),pk:$.Joi.any().required(),signature:$.Joi.any().required(),delegator:$.Joi.DID().prefix().valid("").optional(),data:$.Joi.any().optional()}),a=$.Joi.object({type:$.Joi.string().min(1).max(32).required(),contractAddress:$.Joi.DID().prefix().wallet("ethereum").required(),chainType:$.Joi.string().min(1).max(32).required(),chainName:$.Joi.string().min(1).max(32).required(),chainId:$.Joi.number().positive().required()}),n=$.Joi.object({type:$.Joi.string().valid("svg","url","uri").required(),content:$.Joi.string().when("type",{is:"uri",then:$.Joi.string().max(20480).dataUri().required()}).when("type",{is:"url",then:$.Joi.string().max(2048).uri({scheme:["http","https"]}).required()})}),r=$.Joi.object({id:$.Joi.string().max(2048).uri({scheme:["http","https"]}).required(),scope:$.Joi.string().valid("public","private").default("public")}),t=$.Joi.object({id:$.Joi.DID().prefix().required(),pk:$.Joi.string().required(),name:$.Joi.string().min(1).max(256).required()}),l={address:$.Joi.DID().prefix().role("ROLE_ASSET").required(),moniker:$.Joi.string().min(2).max(255).required(),data:$.Joi.any().required(),readonly:$.Joi.boolean().default(!1),transferrable:$.Joi.boolean().default(!1),ttl:$.Joi.number().min(0).default(0),parent:$.Joi.DID().prefix().optional().allow(""),issuer:$.Joi.DID().prefix().optional().allow(""),endpoint:r.optional().allow(null).default(null),display:n.optional().allow(null).default(null),tags:$.Joi.array().items($.Joi.string().min(1).max(64)).max(4).optional()},s={address:$.Joi.DID().prefix().role("ROLE_FACTORY").required(),name:$.Joi.string().min(2).max(255).required(),description:$.Joi.string().min(2).max(255).required(),settlement:$.Joi.string().valid("instant","periodic").default("instant"),limit:$.Joi.number().integer().min(0).default(0),trustedIssuers:$.Joi.array().items($.Joi.DID().prefix()).max(8).optional(),data:$.Joi.any().optional().allow(null).default(null),display:n.optional().allow(null).default(null),input:$.Joi.object({value:$.Joi.BN().positive().min("0").default("0"),tokens:$.Joi.array().items(o).max(8).optional(),assets:$.Joi.array().items($.Joi.alternatives().try($.Joi.DID().prefix().role("ROLE_ASSET"),$.Joi.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),variables:$.Joi.array().items($.Joi.object({name:$.Joi.string().min(1).max(255).required(),description:$.Joi.string().max(255).optional().allow(""),required:$.Joi.boolean().required()})).optional()}),output:$.Joi.object({moniker:$.Joi.string().min(2).max(255).required(),data:$.Joi.any().required(),readonly:$.Joi.boolean().default(!1),transferrable:$.Joi.boolean().default(!1),ttl:$.Joi.number().min(0).default(0),parent:$.Joi.string().max(255).required(),issuer:$.Joi.string().max(255).required(),endpoint:r.optional(),display:n.optional(),tags:$.Joi.array().items($.Joi.string().min(1).max(64)).max(4).optional()}),hooks:$.Joi.array().items($.Joi.object({name:$.Joi.string().valid("mint","postMint","preMint").required(),type:$.Joi.string().valid("url","contract").required(),hook:$.Joi.string().min(1).max(4096).required(),compiled:$.Joi.array().items($.Joi.object()).optional()})).optional()};$.schemas={context:p,tokenInput:o,multiInput:f,multiSig:e,foreignToken:a,variableInput:g,nftDisplay:n,nftEndpoint:r,nftIssuer:t,tokenHolder:m,assetProps:l,assetSchema:$.Joi.object(l).options({stripUnknown:!0,noDefaults:!1}),factoryProps:s,factorySchema:$.Joi.object(s).options({stripUnknown:!0,noDefaults:!1})},$.patterns={txHash:w}}(ae)),ae}var vt=bt();function qe({onCancel:$,onSuccess:q,blocklet:P}){const{vaults:C=[],appPid:j}=P,{t:w,locale:p}=le(),{connectApi:o}=De(),{api:g}=re(),{teamDid:m}=Ie(),[f,e]=Ce({loading:!1,fetching:!1,error:"",address:"",fetched:[],errored:[]});z.useEffect(()=>{if(!H.isValid(f.address))return;const l=H.toAddress(f.address),s=f.fetched.find(u=>u.address===l),i=f.errored.find(u=>u.address===l);!f.fetching&&!s&&!i&&(e({fetching:!0}),et(tt.MAIN_CHAIN_ENDPOINT).getAccountState({address:l}).then(d=>{d.state?e({fetching:!1,fetched:[...f.fetched.filter(y=>y.address!==l),d.state]}):e({fetching:!1,errored:[...f.errored.filter(y=>y.address!==l),{address:l}]})}).catch(d=>{console.error(d),e({fetching:!1,error:oe(d)})}))},[f.address,f.fetching]),z.useEffect(()=>{if(f.address){const l=H.toAddress(f.address);if(!H.isValid(l)){e({error:w("blocklet.config.vault.error.invalid")});return}if(vt.schemas.tokenHolder.validate(l).error){e({error:w("blocklet.config.vault.error.holder")});return}if(C.find(i=>i.did===l)){e({error:w("blocklet.config.vault.error.duplicate")});return}if(ct([P.appDid,P.appPid,...P.migratedFrom.map(i=>i.appDid)].filter(Boolean)).includes(l)){e({error:w("blocklet.config.vault.error.appDid")});return}}e({error:""})},[f.address]);const a=async()=>{e({loading:!0});try{const l=await g.configVault({input:{teamDid:m,vaultDid:H.toAddress(f.address)}});o.open({locale:p,action:"approve-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:l.sessionId},messages:{title:w("blocklet.config.vault.approve.title"),scan:w(`blocklet.config.vault.approve.${C.length>0?"byLast":"byOwner"}`),confirm:w("blocklet.config.vault.approve.confirm"),success:w("blocklet.config.vault.approve.success")},onSuccess:()=>{o.open({locale:p,action:"config-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:l.sessionId},messages:{title:w("blocklet.config.vault.commit.title"),scan:w("blocklet.config.vault.commit.scan"),confirm:w("blocklet.config.vault.commit.confirm"),success:w("blocklet.config.vault.commit.success")},onSuccess:()=>{e({loading:!1}),q()},onClose:()=>{e({loading:!1}),o.close()}})},onClose:()=>{e({loading:!1}),o.close()}})}catch(l){e({loading:!1,error:oe(l)})}},n=H.toAddress(f.address),r=[];H.isValid(n)&&r.push({key:w("blocklet.config.vault.role"),value:k.jsx(Be,{color:"primary",variant:"outlined",size:"small",label:H.toTypeInfoStr(n).role||"-"})});const t=f.fetched.find(l=>l.address===n);return t&&r.push({key:w("blocklet.config.vault.firstSeen"),value:be(t.context?.genesisTime,"-")},{key:w("blocklet.config.vault.lastSeen"),value:be(t.context?.renaissanceTime,"-")},{key:w("blocklet.config.vault.migratedFrom"),value:t.migratedFrom.length?t.migratedFrom.map(l=>k.jsx(ve,{did:l,showQrcode:!0,compact:!0,size:14,locale:p},l)):"-"},{key:w("blocklet.config.vault.migratedTo"),value:t.migratedTo.length?t.migratedTo.map(l=>k.jsx(ve,{did:l,showQrcode:!0,compact:!0,size:14,locale:p},l)):"-"}),k.jsx(Ee,{open:!0,fullWidth:!0,showCloseButton:!1,onClose:$,title:k.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[k.jsx(Se,{}),w("blocklet.config.vault.title")]}),actions:k.jsxs(k.Fragment,{children:[k.jsx(G,{onClick:$,children:w("common.cancel")}),k.jsx(G,{onClick:a,variant:"contained",disabled:!!f.error||f.loading,children:w("common.confirm")})]}),children:k.jsxs(ie,{direction:"column",spacing:3,children:[k.jsxs(te,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[w("blocklet.config.vault.desc")," ",w("blocklet.config.vault.tip")]}),C.length>0&&k.jsxs(T,{children:[k.jsxs(te,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[w("blocklet.config.vault.current"),":"]}),k.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:.5},children:[k.jsx(ft,{did:C[C.length-1].did,showQrcode:!0,style:{width:"auto"}}),k.jsx(dt,{vaults:C,appPid:j})]})]}),k.jsx(Ue,{fullWidth:!0,"data-cy":"input-factory-address",label:w("blocklet.config.vault.address"),error:!!f.error,helperText:f.error,value:f.address,onChange:l=>{e({address:l.target.value,error:""})},slotProps:{input:{endAdornment:f.fetching?k.jsx(Ve,{position:"end",children:k.jsx(ce,{size:16})}):null}}}),k.jsx(T,{sx:{"& .info-row__name":{fontSize:"14px"},"& .info-row__value":{fontSize:"14px"}},children:r.map(l=>k.jsx(ut,{valueComponent:"div",nameWidth:120,name:l.key,children:l.value},l.key))})]})})}qe.propTypes={onCancel:J.func.isRequired,onSuccess:J.func.isRequired,blocklet:J.object.isRequired};function _t({teamDid:$,size:q="small",...P}){const{t:C}=le(),{api:j}=re(),[w,p]=z.useState(!1),[o,g]=z.useState(null),m=()=>{p(!1),g(null)},f=async()=>{try{p(!0);const a=await j.rotateSessionKey({input:{teamDid:$}});W.success(C("blocklet.config.rotateSessionKey.success",{count:a.removed?.length||0})),setTimeout(()=>{window.location.reload()},1e3)}catch(a){W.error(oe(a))}finally{p(!1),g(null)}},e={title:C("blocklet.config.rotateSessionKey.title"),description:C("blocklet.config.rotateSessionKey.description"),confirm:C("common.confirm"),cancel:C("common.cancel"),onConfirm:f,onCancel:m};return k.jsxs("div",{...P,children:[k.jsxs(G,{onClick:()=>g(e),color:"error",variant:"outlined",size:q,children:[w?k.jsx(ce,{size:16,style:{marginRight:5}}):null,C("blocklet.config.rotateSessionKey.action")]}),o&&k.jsx(me,{title:o.title,description:o.description,confirm:o.confirm,cancel:o.cancel,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}function he({blocklet:$,onUpdate:q=()=>{},hasPermission:P=!1}){const{info:C,api:j,inService:w}=re(),{t:p,locale:o}=z.useContext(at),[g,m]=Ce({loading:!1,showTransferOwner:!1,showConfigVault:!1}),[f,e]=z.useState(()=>$?.settings?.gateway?.wafPolicy?.enabled??!0),[a,n]=z.useState(()=>!!$?.settings?.enableSessionHardening),[r,t]=z.useState(()=>!!$?.settings?.invite?.enabled),[l,s]=z.useState(()=>{const E=$?.settings?.org||{};return{enabled:E.enabled||!1,maxMemberPerOrg:E.maxMemberPerOrg||100,maxOrgPerUser:E.maxOrgPerUser||10}}),i=g.loading||!P,{did:u}=$.meta,d=w?window.env?.gateway?.wafPolicy?.enabled:C?.routing.wafPolicy?.enabled;if(Ae($.status))return null;const y=$.environments.find(E=>E.key===Z.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE),_=!y||y.value==="yes",c=$.environments.find(E=>E.key===Z.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE)?.value||Z.BLOCKLET_TENANT_MODES.SINGLE,h=(E,I)=>async L=>{if(!g.loading){m({loading:!0});try{const{checked:N}=L.target,{blocklet:B}=await j.configBlocklet({input:{did:$.meta.did,configs:[{key:Z.BLOCKLET_CONFIGURABLE_KEY[E],value:I(N)}]}});q(B)}catch(N){W.error(N.message)}finally{m({loading:!1})}}},b=h("BLOCKLET_DELETABLE",E=>E?"no":"yes"),x=h("BLOCKLET_APP_TENANT_MODE",E=>E?Z.BLOCKLET_TENANT_MODES.MULTIPLE:Z.BLOCKLET_TENANT_MODES.SINGLE),S=(E,I)=>async L=>{if(!g.loading){m({loading:!0});try{const N=L.target.checked;await j.updateBlockletSettings({input:E(N)}),I&&I(N)}catch(N){W.error(N.message)}finally{m({loading:!1})}}},R=S(E=>({did:$.meta.did,invite:{enabled:E}}),t),O=S(E=>({did:$.meta.did,org:{enabled:E,maxMemberPerOrg:100,maxOrgPerUser:10}}),E=>{s({...l,enabled:E})}),A=async(E,I)=>{if(!g.loading){m({loading:!0});try{await j.updateBlockletSettings({input:{did:$.meta.did,org:{...l,[E]:I}}}),s({...l,[E]:I})}catch(L){W.error(L.message)}finally{m({loading:!1})}}},D=S(E=>({did:$.meta.did,gateway:{wafPolicy:{enabled:E}}}),e),M=S(E=>({did:$.meta.did,enableSessionHardening:E}),E=>{n(E),rt()}),F=async()=>{if(!g.loading){m({loading:!0});try{const{blocklet:E}=await j.getBlocklet({input:{did:$.meta.did}});q(E)}catch(E){W.error(E.message)}finally{m({loading:!1})}}};return k.jsxs(ie,{p:3,sx:{border:"1px solid red",borderRadius:2,p:3},className:"advanced-config",children:[!w&&k.jsxs(k.Fragment,{children:[k.jsx(U,{title:p("blocklet.config.deletable.name"),desc:p(_?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:!_,defaultChecked:!0,onChange:b})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}})]}),k.jsx(Te,{inService:w,disabled:i,loading:g.loading,onChange:F}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),w&&k.jsx(st,{role:"owner",children:E=>(E||mt)&&k.jsxs(k.Fragment,{children:[k.jsx(U,{title:p("blocklet.config.vault.title"),desc:p("blocklet.config.vault.desc"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(G,{variant:"contained",color:"primary",size:"small","data-cy":"config-vault",onClick:()=>m({showConfigVault:!0}),children:[k.jsx(Se,{style:{fontSize:"1.3em",marginRight:4}}),p("blocklet.config.vault.title")]})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),g.showConfigVault&&k.jsx(qe,{blocklet:$,onCancel:()=>m({showConfigVault:!1}),onSuccess:()=>m({showConfigVault:!1})}),k.jsx(U,{title:p("team.transferApp.name"),desc:p("team.transferApp.description"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(G,{variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"transfer-app",onClick:()=>m({showTransferOwner:!0}),children:[k.jsx(We,{style:{fontSize:"1.3em",marginRight:4}}),p("team.transferApp.name")]})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),g.showTransferOwner&&k.jsx(Le,{onCancel:()=>m({showTransferOwner:!1}),onSuccess:()=>m({showTransferOwner:!1})})]})}),k.jsx(U,{title:p("blocklet.config.clearCache.name"),desc:p("blocklet.config.clearCache.purpose"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(ht,{teamDid:u})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:p("blocklet.config.rotateSessionKey.name"),desc:p("blocklet.config.rotateSessionKey.purpose"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(_t,{style:{whiteSpace:"nowrap"},teamDid:u})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:p("blocklet.config.tenantMode.name"),desc:p(`blocklet.config.tenantMode.${c}`),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:c===Z.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:x})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:p("team.invite.setting"),desc:p(`team.invite.${r?"enabled":"disabled"}`),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:r,onChange:R})})}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:k.jsxs(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:[p("setting.form.enableSessionHardening.switchLabel"),k.jsx(ge,{title:p("setting.form.enableSessionHardening.switchTips"),children:k.jsx(ye,{sx:{ml:.5,fontSize:"20px"},color:"primary"})})]}),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:a,onChange:M})})}),d&&k.jsxs(k.Fragment,{children:[k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:k.jsxs(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:[p("router.gateway.wafPolicy.title"),k.jsx(ge,{title:k.jsx(T,{sx:{fontSize:"14px",lineHeight:1.5},children:k.jsx(T,{sx:{color:"common.white",ml:.5},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${o}/enable-web-application-firewall`,target:"_blank",rel:"noopener noreferrer",children:p("dashboard.document")})}),children:k.jsx(ye,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]}),desc:p("router.gateway.wafPolicy.switchLabel"),children:k.jsx(T,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Y,{disabled:i,checked:f,onChange:D})})})]}),k.jsx(T,{className:"config-form",component:V,sx:{my:3}}),k.jsx(U,{title:k.jsx(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:p("common.orgs")}),desc:p("team.orgs.explain"),children:k.jsxs(T,{sx:{display:"flex",flexDirection:"column",gap:2,width:"100%",alignSelf:{xs:"flex-start",md:"flex-end"}},children:[k.jsx(Y,{disabled:i,checked:l.enabled,onChange:O}),l.enabled&&k.jsxs(T,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:400,mt:1},children:[k.jsx(_e,{style:{marginTop:0},disabled:i,loading:g.loading,type:"number",min:2,initialValue:l.maxOrgPerUser,label:p("team.orgs.invite.maxOrgs"),placeholder:p("team.orgs.invite.maxOrgs"),onSubmit:E=>A("maxOrgPerUser",E)}),k.jsx(_e,{style:{marginTop:0},disabled:i,loading:g.loading,type:"number",min:2,initialValue:l.maxMemberPerOrg,label:p("team.orgs.invite.maxMembers"),placeholder:p("team.orgs.invite.maxMembers"),onSubmit:E=>A("maxMemberPerOrg",E)})]})]})})]})}const wt=ue(he,"mutate_blocklets"),xt=ue(he,"",Oe);function $t($){const{inService:q}=re();return q?k.jsx(xt,{...$}):k.jsx(wt,{...$})}he.propTypes={blocklet:J.object.isRequired,onUpdate:J.func,hasPermission:J.bool};function pe({blocklet:$,onUpdate:q=()=>{},hasPermission:P=!1}){return Ae($.status)?null:k.jsx(St,{children:k.jsx($t,{blocklet:$,onUpdate:q,hasPermission:P})})}const jt=ue(pe,"mutate_blocklets"),kt=ue(pe,"",Oe);function Xt($){const{inService:q}=re();return q?k.jsx(kt,{...$}):k.jsx(jt,{...$})}pe.propTypes={blocklet:J.object.isRequired,onUpdate:J.func,hasPermission:J.bool};const St=ke(T)`
|
|
8
8
|
max-width: 1536px;
|
|
9
9
|
|
|
10
10
|
.advanced-config {
|