@abtnode/webapp 1.17.3-beta-20251125-042047-1bcefd39 → 1.17.3-beta-20251126-121502-d0926972
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-CgY38Owx.js → AdapterDayjs-BjSFvDvr.js} +1 -1
- package/dist/assets/{Add-DU5X_U2u.js → Add-BmZCIl-_.js} +1 -1
- package/dist/assets/ArrowDropDown-DAMbspww.js +1 -0
- package/dist/assets/{Autocomplete-_Fi6RPLW.js → Autocomplete-kBTyvXut.js} +1 -1
- package/dist/assets/{Breadcrumbs-j-PFfWF-.js → Breadcrumbs-DbJOP5vy.js} +1 -1
- package/dist/assets/{ButtonGroup-CWskS5fX.js → ButtonGroup-BlhSVfK3.js} +1 -1
- package/dist/assets/{CSSTransition--8a6z16w.js → CSSTransition-Cyc7snYy.js} +1 -1
- package/dist/assets/{CallMerge-BctXRdfR.js → CallMerge-CKPqdgb2.js} +1 -1
- package/dist/assets/{CardContent-DndNB2JX.js → CardContent-CJq0LG9T.js} +1 -1
- package/dist/assets/{ChevronLeft-RMIqzDHo.js → ChevronLeft-B42HGuyE.js} +1 -1
- package/dist/assets/{ChevronRight-mJNKmafe.js → ChevronRight-BLRImDEd.js} +1 -1
- package/dist/assets/{Clear-fLYWFWL3.js → Clear-BoRiznJI.js} +1 -1
- package/dist/assets/{DeleteOutline-Cs7CwDmK.js → DeleteOutline-_XfCv5J6.js} +1 -1
- package/dist/assets/{Done-LNwStO12.js → Done-b5-rnBrk.js} +1 -1
- package/dist/assets/{Edit-B1GrIrSa.js → Edit-DGAlfiQv.js} +1 -1
- package/dist/assets/{ErrorOutline-BY5CE57a.js → ErrorOutline-DevVxMhb.js} +1 -1
- package/dist/assets/{FilterList-tULWsV25.js → FilterList-tXxMVwM9.js} +1 -1
- package/dist/assets/{Google-CIjch33x.js → Google-MSCLr2Nf.js} +1 -1
- package/dist/assets/{HelpOutline-BawFpv_o.js → HelpOutline-DIH3coQJ.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-BmB8rdeY.js → KeyboardArrowDown-DDe3llHj.js} +1 -1
- package/dist/assets/{Launch-BEFLp-Pq.js → Launch-DZ6lDDzp.js} +1 -1
- package/dist/assets/{Link-CqPr_lAs.js → Link-CQj5KcJh.js} +1 -1
- package/dist/assets/{ListItemButton-C2dnsniA.js → ListItemButton-BJq_k_rp.js} +1 -1
- package/dist/assets/{ListSubheader-h3BvbTVV.js → ListSubheader-BO55OpFe.js} +1 -1
- package/dist/assets/{LoadingButton-DWsLKlrN.js → LoadingButton-Bw73z7Kp.js} +1 -1
- package/dist/assets/{MoreVert-De86Jj5O.js → MoreVert-CykMlsrj.js} +1 -1
- package/dist/assets/{OpenInNew-v1P9Awcb.js → OpenInNew-D8CczU9i.js} +1 -1
- package/dist/assets/{Refresh-emKClqFh.js → Refresh-BClPDZOR.js} +1 -1
- package/dist/assets/{Search-CDBu3YFg.js → Search-BrXfrk6s.js} +1 -1
- package/dist/assets/{Stepper-B1C2rtyE.js → Stepper-Clv2yUpj.js} +1 -1
- package/dist/assets/{Switch-CXwsdwa6.js → Switch-btQlV2VF.js} +1 -1
- package/dist/assets/{TableSearch-DJUhNasJ.js → TableSearch-BkWoZDH8.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-Bhk9MfTF.js → ToggleButtonGroup-BBbP2Jx0.js} +1 -1
- package/dist/assets/{UnfoldMore-D7ekduSe.js → UnfoldMore-RJlxkooV.js} +1 -1
- package/dist/assets/{Verified-xgJHnpUk.js → Verified-l0Y44mJl.js} +1 -1
- package/dist/assets/{VerifiedUser-B37gvaNQ.js → VerifiedUser-agBH4B6_.js} +1 -1
- package/dist/assets/{ViewList-DT6Xma-B.js → ViewList-DqVhCHtG.js} +1 -1
- package/dist/assets/{_createAggregator-B_bnZt9V.js → _createAggregator-D2uXgg5x.js} +1 -1
- package/dist/assets/{actions-CHcHbGcd.js → actions-BPQhtNul.js} +1 -1
- package/dist/assets/{actions-Btu6FPrP.js → actions-DOkacRyd.js} +1 -1
- package/dist/assets/{agreement-DoGeoSaC.js → agreement-peew__AK.js} +1 -1
- package/dist/assets/api-BEwC7jzb.js +1 -0
- package/dist/assets/{appearance-BUnht7zz.js → appearance-Nhx9Kmv1.js} +1 -1
- package/dist/assets/{audit-logs-CC3WeM0a.js → audit-logs-BlbUuwN_.js} +2 -2
- package/dist/assets/{base-chart-B1Ea4iJX.js → base-chart-CzLW1tBo.js} +1 -1
- package/dist/assets/{blocklet-DUEr9aGB.js → blocklet-DooKd_sI.js} +1 -1
- package/dist/assets/chain-EI4hm_8e.js +6 -0
- package/dist/assets/{click-to-copy-DGNMr8_O.js → click-to-copy-BYLhYz_K.js} +1 -1
- package/dist/assets/cloneDeep-F6LuuTz3.js +1 -0
- package/dist/assets/{collapse-NDwnMlXJ.js → collapse-CmeTRdrT.js} +1 -1
- package/dist/assets/{config-navigation-CYZxYkkI.js → config-navigation-SDiPbeiK.js} +46 -46
- package/dist/assets/connect-to-DxqW5HVH.js +30 -0
- package/dist/assets/{cssMode-AsqjUU2P.js → cssMode-U50M1_i-.js} +1 -1
- package/dist/assets/{delete-confirm-CdJmwhZX.js → delete-confirm-B_mXlLTh.js} +1 -1
- package/dist/assets/{depsEqual-DAfwc8aQ.js → depsEqual-CI7FeWZW.js} +1 -1
- package/dist/assets/{detail-DUlX22Z7.js → detail-B_ewDRP9.js} +3 -3
- package/dist/assets/{domains-1zIb6OO7.js → domains-DWWQ8C3v.js} +1 -1
- package/dist/assets/{download-lpyBGgYu.js → download-Jmt9jl6E.js} +1 -1
- package/dist/assets/{edit.svg-ngwj-dRr.js → edit.svg-DOKf0NKv.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-CKIgFJwY.js +1 -0
- package/dist/assets/engine-PA5Hlqhs.js +1 -0
- package/dist/assets/{freemarker2-BHcZs438.js → freemarker2-wCdJg_1P.js} +1 -1
- package/dist/assets/{get-safe-url-BMekWjUF.js → get-safe-url-mJazyUZj.js} +1 -1
- package/dist/assets/getValidReactChildren-C2GpPG5h.js +1 -0
- package/dist/assets/{graphqlMode-Blty3FUi.js → graphqlMode-r_xp5vcq.js} +2 -2
- package/dist/assets/{handlebars-P_-ZrIMo.js → handlebars-CmQCPbdG.js} +1 -1
- package/dist/assets/{html-DZ9KUnKS.js → html-DYkdCzxq.js} +1 -1
- package/dist/assets/{html-title-CuUyumLv.js → html-title-x1db95S1.js} +1 -1
- package/dist/assets/{htmlMode-DNFF7c_R.js → htmlMode-B2_nCAdZ.js} +1 -1
- package/dist/assets/{iframe-BV4Ixa0I.js → iframe-BBrwuPrb.js} +1 -1
- package/dist/assets/{index-CKGWqho1.js → index-8dobedE4.js} +1 -1
- package/dist/assets/{index-BJpkw0kk.js → index-9oTGqHiK.js} +9 -9
- package/dist/assets/{index-DFRPJXRn.js → index-B1zRPZ23.js} +1 -1
- package/dist/assets/{index-CGExJ6WC.js → index-B3mxPYvg.js} +1 -1
- package/dist/assets/{index-yegNPitx.js → index-B6WuMj55.js} +1 -1
- package/dist/assets/{index-BW0jEb7j.js → index-B7vOpBED.js} +9 -9
- package/dist/assets/index-B8pH5JDj.js +1 -0
- package/dist/assets/{index-BvvTPBRG.js → index-BD7DDM8N.js} +1 -1
- package/dist/assets/{index-CNtIWgAU.js → index-BDfVLYgm.js} +1 -1
- package/dist/assets/{index-C9xtFMCg.js → index-BGAQvWoz.js} +1 -1
- package/dist/assets/{index-CzDbEKCJ.js → index-BJY_2WX8.js} +1 -1
- package/dist/assets/{index-CxpPzbzU.js → index-BKe-qavD.js} +1 -1
- package/dist/assets/{index-CryNIWPN.js → index-BNYZMueI.js} +1 -1
- package/dist/assets/{index-oWQ0GvMY.js → index-BX3e3-Yl.js} +1 -1
- package/dist/assets/{index-HPB83hLa.js → index-Bexo5RVe.js} +1 -1
- package/dist/assets/{index-B0tPxfVp.js → index-Bf9Tsnzp.js} +1 -1
- package/dist/assets/{index-DMaZpwN2.js → index-Bge0nxkS.js} +1 -1
- package/dist/assets/{index-Cd_-SbMU.js → index-Bsv4O26i.js} +3 -3
- package/dist/assets/{index-BSGIXp_c.js → index-BvQcTKRh.js} +1 -1
- package/dist/assets/{index-CYFoxs1Y.js → index-BwyiJPiC.js} +1 -1
- package/dist/assets/{index-D1mWL3Mq.js → index-C6cKgXcg.js} +1 -1
- package/dist/assets/{index-CeD2kMCb.js → index-C6nj_8zr.js} +1 -1
- package/dist/assets/{index-Dq9MRDpG.js → index-CCR0588i.js} +1 -1
- package/dist/assets/{index-qhLKGkS9.js → index-CMGLmPFR.js} +2 -2
- package/dist/assets/{index-D7wYq8SN.js → index-CNWl5k-n.js} +1 -1
- package/dist/assets/{index-DZUjuntv.js → index-Ca1VB0fP.js} +1 -1
- package/dist/assets/{index-yVOJY6ja.js → index-Cs2sn0We.js} +2 -2
- package/dist/assets/{index-BDvhl7ec.js → index-CsRtSmIh.js} +1 -1
- package/dist/assets/{index-65SOJ0fZ.js → index-CvM9vyEK.js} +1 -1
- package/dist/assets/{index-B-sx2QPw.js → index-D0h_Lxum.js} +1 -1
- package/dist/assets/{index-DQ6s_u3-.js → index-D1rJ129A.js} +1 -1
- package/dist/assets/{index-BFekFnd_.js → index-DMGtaArc.js} +3 -3
- package/dist/assets/{index-BDxQWtbP.js → index-DSwwhtGQ.js} +1 -1
- package/dist/assets/{index-C1oHtzbL.js → index-DWhhB9Hi.js} +1 -1
- package/dist/assets/{index-C0P3b1dO.js → index-DYWrZZLV.js} +1 -1
- package/dist/assets/{index-IMPlmWux.js → index-DlRSxwJY.js} +3 -3
- package/dist/assets/{index-Cb729u8O.js → index-MQfB--7g.js} +1 -1
- package/dist/assets/{index-CDw7N5Gd.js → index-Q3-b6N6x.js} +1 -1
- package/dist/assets/{index-DA4oOkNZ.js → index-bHYz6L_6.js} +4 -4
- package/dist/assets/{index-myUoEhyU.js → index-cW_e6AnH.js} +3 -3
- package/dist/assets/{index-skgicgrb.js → index-ccBUb-g_.js} +1 -1
- package/dist/assets/{index-Plq6hllo.js → index-eIb8MZiw.js} +1 -1
- package/dist/assets/{index-D4eQE_TP.js → index-l0ejZk6e.js} +160 -157
- package/dist/assets/{index-BmjI4F3z.js → index-m0BJnU58.js} +1 -1
- package/dist/assets/{index-Qxi4GaAT.js → index-sHP8LVQG.js} +1 -1
- package/dist/assets/{index-Dpp1uA9I.js → index-tY4NTQdt.js} +1 -1
- package/dist/assets/{index.esm-B212pqxD.js → index.esm-CmfVZ8uo.js} +1 -1
- package/dist/assets/{install-from-url-BrXq_et3.js → install-from-url-DKaI4Rhw.js} +1 -1
- package/dist/assets/{invitation-BlTRS5NJ.js → invitation-BP2qXMkU.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-BTcooLCb.js → is-path-prefix-equal-D367I16F.js} +1 -1
- package/dist/assets/{item-77htjPC1.js → item-C6-NqxXS.js} +9 -9
- package/dist/assets/{javascript-DVl6BEgG.js → javascript-C8IdANXc.js} +1 -1
- package/dist/assets/{jsonMode-lOVw6OHX.js → jsonMode-7RTtLpT6.js} +1 -1
- package/dist/assets/{liquid-CoIMStan.js → liquid-CF0mRQ0b.js} +1 -1
- package/dist/assets/{list-header-DjUyvNHI.js → list-header-DnPG8RQK.js} +1 -1
- package/dist/assets/{lock.svg-C6rQW6kT.js → lock.svg-DIpUz3_T.js} +1 -1
- package/dist/assets/{log-CyacwvH_.js → log-CLLKDcVS.js} +1 -1
- package/dist/assets/{lottie-react.esm-D7Avvqe0.js → lottie-react.esm-BzADuacJ.js} +1 -1
- package/dist/assets/{mdx-j6fQ0EW5.js → mdx-393D49gD.js} +1 -1
- package/dist/assets/{memory-CU2dLX_q.js → memory-BiZfGzaA.js} +1 -1
- package/dist/assets/{metric-CwOFVXko.js → metric-DQF3F8Ee.js} +1 -1
- package/dist/assets/omit-B8z6Iws2.js +1 -0
- package/dist/assets/{overview-Dk15eBBT.js → overview-CCLYGiqE.js} +1 -1
- package/dist/assets/{permission-Cz1FrvyA.js → permission-CB_zs2G4.js} +1 -1
- package/dist/assets/{preference-DRzlCnd7.js → preference-2qHeMKaE.js} +3 -3
- package/dist/assets/{python-dv24zJs8.js → python-DeXJ9-sq.js} +1 -1
- package/dist/assets/{raf-schd.esm-87_LVzHH.js → raf-schd.esm-gP-_XKJP.js} +1 -1
- package/dist/assets/{razor-CiKBeh3A.js → razor-D15rTZli.js} +1 -1
- package/dist/assets/{rotate-session-key-CQn2_oC_.js → rotate-session-key-BqAzAxv_.js} +1 -1
- package/dist/assets/{runtime-Cx7NItmc.js → runtime-Cf5aBcfV.js} +1 -1
- package/dist/assets/schema-DVKja_3K.js +1 -0
- package/dist/assets/sdk-D_BY3a8P.js +1 -0
- package/dist/assets/{service-CLHLbp46.js → service-pECpZ6Fv.js} +1 -1
- package/dist/assets/{shorten-label-DzbGUwvK.js → shorten-label-5tBjSQXq.js} +1 -1
- package/dist/assets/{simple-select-iTytEDuc.js → simple-select-DCNot1u5.js} +1 -1
- package/dist/assets/{spaces-DzMB31Xh.js → spaces-1p_UMor_.js} +1 -1
- package/dist/assets/{status-D-ZIPxa7.js → status-DyTELFmb.js} +1 -1
- package/dist/assets/{status-Dq7L2hV9.js → status-Xk2ZLYz1.js} +1 -1
- package/dist/assets/{switch-control-CCKcQUfl.js → switch-control-DBKg8KSu.js} +1 -1
- package/dist/assets/{table-icons-B5tZ-KhN.js → table-icons-DfjWu9CY.js} +1 -1
- package/dist/assets/{team-BPm7GXr3.js → team-DHZ07Mee.js} +1 -1
- package/dist/assets/{toLower-C95AADHW.js → toLower-ylIkvfVr.js} +1 -1
- package/dist/assets/toUpper-D9lAXG2I.js +1 -0
- package/dist/assets/{traffic-DAxOlVXW.js → traffic-BlWSHfOP.js} +1 -1
- package/dist/assets/{tsMode-nE4RZ7wQ.js → tsMode-BbObiMoD.js} +1 -1
- package/dist/assets/{typescript-NOJwlSsu.js → typescript-Cuj7nGhN.js} +1 -1
- package/dist/assets/{url-evaluation-DvSlLCr5.js → url-evaluation-DAoEPnuZ.js} +1 -1
- package/dist/assets/{url-join-rOUTvo2k.js → url-join-CNIVoOP5.js} +1 -1
- package/dist/assets/{use-mobile-6YLRE80V.js → use-mobile-B06ZsBLv.js} +1 -1
- package/dist/assets/{use-mobile-ChXXfLYV.js → use-mobile-DRLSkCfk.js} +1 -1
- package/dist/assets/{useAsync-nf1n7R3_.js → useAsync-C_IdsZLT.js} +1 -1
- package/dist/assets/{useAsyncRetry-CTTkpKwa.js → useAsyncRetry-AD_J4c2Y.js} +1 -1
- package/dist/assets/{useLocalStorage-UJQc3CLl.js → useLocalStorage-CaDSR1Wc.js} +1 -1
- package/dist/assets/{useThemeProps-D4mtFn43.js → useThemeProps-DAtqRnvX.js} +1 -1
- package/dist/assets/{util-Bx0XmXdP.js → util-B5JRPt0_.js} +1 -1
- package/dist/assets/{wait-container-BxEpeinl.js → wait-container-D08poArP.js} +1 -1
- package/dist/assets/{without-wallet-DWK4OSvH.js → without-wallet-Cq0jHe0-.js} +1 -1
- package/dist/assets/wrap-locale-fe2iWyZX.js +1 -0
- package/dist/assets/{xml-D7cTPSOE.js → xml-yaEsWuy9.js} +1 -1
- package/dist/assets/{yaml-C0QOrWzZ.js → yaml-B2xGL9-8.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-DqMXZ-fs.js +0 -1
- package/dist/assets/api-DTkN6iVV.js +0 -1
- package/dist/assets/chain-XyhYd1VW.js +0 -6
- package/dist/assets/cloneDeep-DhmluxJ2.js +0 -1
- package/dist/assets/connect-to-C0afsBPH.js +0 -29
- package/dist/assets/emotion-cache.browser.esm-Cb-LUV2D.js +0 -1
- package/dist/assets/engine-95e7OnEQ.js +0 -1
- package/dist/assets/getValidReactChildren-DzxCosZj.js +0 -1
- package/dist/assets/index-Cfe94TcH.js +0 -1
- package/dist/assets/omit-Ce6CSFtW.js +0 -1
- package/dist/assets/schema-BH4XUhoi.js +0 -1
- package/dist/assets/sdk-C_3i0CyM.js +0 -1
- package/dist/assets/toUpper-B8mr08qG.js +0 -1
- package/dist/assets/wrap-locale-mBa-2cN-.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as de,j as e,hh as Es,hi as Is,bP as Ds,r as q,s as xe,K as $,f5 as kt,t as U,eO as ft,a3 as ae,C as Ee,bi as Bt,dL as Ls,o as T,hj as qs,b2 as Ht,cA as Ms,cT as zs,dp as Bs,T as Y,dG as it,bn as ne,bD as mt,p as ue,hk as Hs,bE as pt,b as W,bg as G,dI as ee,H as Z,aV as ie,V as oe,n as Nt,q as Ns,w as Ft,ac as Fs,i as Zt,gd as Zs,hl as Vs,at as Us,aU as X,R as Te,$ as ke,D as Ws,U as Js,v as re,X as at,hm as Ks,hn as Gs,eA as Ys,eC as Xs,F as je,aH as J,g2 as Qs,c$ as St,W as er,fn as Vt,ay as te,aR as Ct,ho as tr,f9 as Re,cv as E,bC as ge,aD as se,O as Q,aP as ye,hp as qe,a1 as sr,hq as Je,c6 as Ce,eD as rr,hr as nr,dH as ce,f as Oe,y as Ut,bz as ot,M as ir,cH as Wt,bs as ar,gj as Ze,hs as or,b9 as lr,L as cr,cu as ze,aK as He,ht as dr,Q as ur,bp as hr,af as Rt,a2 as Jt,bj as Ne,hu as Kt,b6 as fr,gD as we,fa as Gt,cZ as Yt,B as mr,b5 as Ot,fc as pr,fh as gr,G as Ke,J as yr,bx as xr}from"./index-D4eQE_TP.js";import{F as vr,a as lt,s as br,L as _e,S as jr,B as _r}from"./preference-DRzlCnd7.js";import{N as $t}from"./ChevronRight-mJNKmafe.js";import{T as Fe}from"./html-title-CuUyumLv.js";import{w as Ie,P as wr}from"./permission-Cz1FrvyA.js";import{u as gt}from"./index-Cfe94TcH.js";import{D as kr}from"./Done-LNwStO12.js";import{R as Sr,S as M}from"./collapse-NDwnMlXJ.js";import{A as Cr,a as At}from"./Autocomplete-_Fi6RPLW.js";import{C as Rr,R as Or,S as $r,P as Ar}from"./rotate-session-key-CQn2_oC_.js";import{u as le}from"./blocklet-DUEr9aGB.js";import{C as Xt}from"./click-to-copy-DGNMr8_O.js";import{u as Ve}from"./team-BPm7GXr3.js";import{v as Qt}from"./index-65SOJ0fZ.js";import{g as Pr}from"./chain-XyhYd1VW.js";import{V as Tr,d as Er}from"./status-Dq7L2hV9.js";import{S as pe}from"./Switch-CXwsdwa6.js";import{B as Ir}from"./index-BmjI4F3z.js";import{y as Dr}from"./index-DFRPJXRn.js";import{I as Lr,J as qr,K as Mr,L as zr}from"./index-CYFoxs1Y.js";import{u as ve,C as H,b as Pt}from"./index.esm-B212pqxD.js";import{S as Be,u as Br}from"./switch-control-CCKcQUfl.js";import{D as Tt,R as es,a as ts}from"./url-evaluation-DvSlLCr5.js";import{A as Et}from"./Add-DU5X_U2u.js";import{H as Ue}from"./index-CxpPzbzU.js";import{u as ss}from"./use-mobile-6YLRE80V.js";import{S as Ge}from"./simple-select-iTytEDuc.js";import{G as Hr}from"./actions-Btu6FPrP.js";import{C as Nr}from"./CardContent-DndNB2JX.js";import"./omit-Ce6CSFtW.js";import"./index-BvvTPBRG.js";import"./edit.svg-ngwj-dRr.js";import"./ArrowDropDown-DqMXZ-fs.js";import"./ButtonGroup-CWskS5fX.js";import"./getValidReactChildren-DzxCosZj.js";import"./index-C9xtFMCg.js";import"./iframe-BV4Ixa0I.js";import"./ListSubheader-h3BvbTVV.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-BY5CE57a.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-tULWsV25.js";import"./CSSTransition--8a6z16w.js";import"./emotion-cache.browser.esm-Cb-LUV2D.js";import"./depsEqual-DAfwc8aQ.js";import"./TableSearch-DJUhNasJ.js";import"./Search-CDBu3YFg.js";import"./Clear-fLYWFWL3.js";import"./MoreVert-De86Jj5O.js";import"./useLocalStorage-UJQc3CLl.js";import"./get-safe-url-BMekWjUF.js";const rs=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Fr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Zr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Vr=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Ur=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),ct=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Jr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Kr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Gr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),ns=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Yr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Xr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var Qr=Array.prototype,It=Qr.splice;function en(v,R,O,C){var _=Is,j=-1,p=R.length,i=v;for(v===R&&(R=Es(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(i,h,m))>-1;)i!==v&&It.call(i,m,1),It.call(v,m,1);return v}function tn(v,R){return v&&v.length&&R&&R.length?en(v,R):v}var sn=Ds(tn);const rn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function is({label:v="",disabled:R=!1,required:O=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:i=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,a]=q.useState(!1),[u,g]=q.useState(!1),[y,k]=q.useState(""),w=q.useRef(null),[d,x]=q.useState(C),[b,S]=q.useState(d),A=q.useMemo(()=>{if(!m)return{};const B={};return m.forEach(I=>{B[I.code]=I}),B},[m]),P=()=>{if(!m)return[];if(!y)return m.map(I=>I.code);const B=new RegExp(y.toLowerCase());return m.filter(I=>{for(let z=0;z<r.length;z++){const F=r[z];if(B.test(I[F]?.toLowerCase()))return!0}return!1}).map(I=>I.code)},L=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),x(C)):(S(b),x(b))}catch{S(d)}finally{g(!1),a(!1)}},D=(B,I)=>{if(!Array.isArray(I)){S([]),_([]);return}const z=I.filter(F=>A[F]);if(!z.length){S([]),_([]);return}S(z),_(z)},N=B=>{B.stopPropagation(),a(!0),setTimeout(()=>{if(w.current){const I=w.current.querySelector("input");I&&I.focus()}},500)},V=n?e.jsx(Cr,{ref:w,options:m,value:b,onChange:D,inputValue:y,onInputChange:(B,I)=>{k(I)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:B=>A[B]?.name,renderInput:B=>e.jsx(U,{...B,label:"",placeholder:t}),renderOption:(B,I)=>{const z=b.indexOf(I)!==-1;return q.createElement(nn,{component:"li",...B,key:I},l(A[I]||{}),e.jsx($,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:z?"700":"normal"},children:o(I,A[I])||A[I]?.name}),e.jsx($,{component:kt,sx:{opacity:.5,width:18,height:18},style:{visibility:z?"visible":"hidden"}}))},...c,slots:{popper:an}}):e.jsx($,{className:"form-item-input slot",onClick:N,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(B=>m.some(I=>I.code===B)).map(B=>e.jsx(ft,{label:m.find(I=>I.code===B).name,style:{marginRight:8},size:"small"},B))});return e.jsx(vr,{className:"form",style:j,children:e.jsxs($,{className:"form-item",children:[e.jsxs($,{className:"form-item-label",children:[v,O&&e.jsx(Sr,{})]}),e.jsxs($,{className:"form-item-body",children:[e.jsx($,{className:"form-item-input",children:V}),n?e.jsx($,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ae,{"data-cy":"schema-form-item-confirm",onClick:L,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(kr,{})}),e.jsx(ae,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),a(!1)},disabled:R||u,size:"large",children:e.jsx(kt,{})})]})}):null]}),n&&h&&e.jsx(Bt,{children:h})]})})}is.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const nn=xe.div`
|
|
1
|
+
import{aF as de,j as e,hi as Es,hj as Is,bP as Ds,r as q,s as xe,K as $,f5 as kt,t as U,eO as ft,a3 as ae,C as Ee,bi as Bt,dL as Ls,o as T,hk as qs,b2 as Ht,cA as Ms,cT as zs,dp as Bs,T as Y,dG as it,bn as ne,bD as mt,p as ue,hl as Hs,bE as pt,b as W,bg as G,dI as ee,H as Z,aV as ie,V as oe,n as Nt,q as Ns,w as Ft,ac as Fs,i as Zt,ge as Zs,hm as Vs,at as Us,aU as X,R as Te,$ as ke,D as Ws,U as Js,v as re,X as at,hn as Ks,ho as Gs,eA as Ys,eC as Xs,F as je,aH as J,g3 as Qs,c$ as St,W as er,fo as Vt,ay as te,aR as Ct,hp as tr,fa as Re,cv as E,bC as ge,aD as se,O as Q,aP as ye,hq as qe,a1 as sr,hr as Je,c6 as Ce,eD as rr,hs as nr,dH as ce,f as Oe,y as Ut,bz as ot,M as ir,cH as Wt,bs as ar,gk as Ze,ht as or,b9 as lr,L as cr,cu as ze,aK as He,hu as dr,Q as ur,bp as hr,af as Rt,a2 as Jt,bj as Ne,hv as Kt,b6 as fr,gE as we,fb as Gt,cZ as Yt,B as mr,b5 as Ot,fd as pr,fi as gr,G as Ke,J as yr,bx as xr}from"./index-l0ejZk6e.js";import{F as vr,a as lt,s as br,L as _e,S as jr,B as _r}from"./preference-2qHeMKaE.js";import{N as $t}from"./ChevronRight-BLRImDEd.js";import{T as Fe}from"./html-title-x1db95S1.js";import{w as Ie,P as wr}from"./permission-CB_zs2G4.js";import{u as gt}from"./index-B8pH5JDj.js";import{D as kr}from"./Done-b5-rnBrk.js";import{R as Sr,S as M}from"./collapse-CmeTRdrT.js";import{A as Cr,a as At}from"./Autocomplete-kBTyvXut.js";import{C as Rr,R as Or,S as $r,P as Ar}from"./rotate-session-key-BqAzAxv_.js";import{u as le}from"./blocklet-DooKd_sI.js";import{C as Xt}from"./click-to-copy-BYLhYz_K.js";import{u as Ve}from"./team-DHZ07Mee.js";import{v as Qt}from"./index-CvM9vyEK.js";import{g as Pr}from"./chain-EI4hm_8e.js";import{V as Tr,d as Er}from"./status-Xk2ZLYz1.js";import{S as pe}from"./Switch-btQlV2VF.js";import{B as Ir}from"./index-m0BJnU58.js";import{y as Dr}from"./index-B1zRPZ23.js";import{I as Lr,J as qr,K as Mr,L as zr}from"./index-BwyiJPiC.js";import{u as ve,C as H,b as Pt}from"./index.esm-CmfVZ8uo.js";import{S as Be,u as Br}from"./switch-control-DBKg8KSu.js";import{D as Tt,R as es,a as ts}from"./url-evaluation-DAoEPnuZ.js";import{A as Et}from"./Add-BmZCIl-_.js";import{H as Ue}from"./index-BKe-qavD.js";import{u as ss}from"./use-mobile-B06ZsBLv.js";import{S as Ge}from"./simple-select-DCNot1u5.js";import{G as Hr}from"./actions-DOkacRyd.js";import{C as Nr}from"./CardContent-CJq0LG9T.js";import"./omit-B8z6Iws2.js";import"./index-BD7DDM8N.js";import"./edit.svg-DOKf0NKv.js";import"./ArrowDropDown-DAMbspww.js";import"./ButtonGroup-BlhSVfK3.js";import"./getValidReactChildren-C2GpPG5h.js";import"./index-BGAQvWoz.js";import"./iframe-BBrwuPrb.js";import"./ListSubheader-BO55OpFe.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-DevVxMhb.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-tXxMVwM9.js";import"./CSSTransition-Cyc7snYy.js";import"./emotion-cache.browser.esm-CKIgFJwY.js";import"./depsEqual-CI7FeWZW.js";import"./TableSearch-BkWoZDH8.js";import"./Search-BrXfrk6s.js";import"./Clear-BoRiznJI.js";import"./MoreVert-CykMlsrj.js";import"./useLocalStorage-CaDSR1Wc.js";import"./get-safe-url-mJazyUZj.js";const rs=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Fr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Zr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Vr=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Ur=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),ct=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Jr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Kr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Gr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),ns=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Yr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Xr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var Qr=Array.prototype,It=Qr.splice;function en(v,R,O,C){var _=Is,j=-1,p=R.length,i=v;for(v===R&&(R=Es(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(i,h,m))>-1;)i!==v&&It.call(i,m,1),It.call(v,m,1);return v}function tn(v,R){return v&&v.length&&R&&R.length?en(v,R):v}var sn=Ds(tn);const rn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function is({label:v="",disabled:R=!1,required:O=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:i=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,a]=q.useState(!1),[u,g]=q.useState(!1),[y,k]=q.useState(""),w=q.useRef(null),[d,x]=q.useState(C),[b,S]=q.useState(d),A=q.useMemo(()=>{if(!m)return{};const B={};return m.forEach(I=>{B[I.code]=I}),B},[m]),P=()=>{if(!m)return[];if(!y)return m.map(I=>I.code);const B=new RegExp(y.toLowerCase());return m.filter(I=>{for(let z=0;z<r.length;z++){const F=r[z];if(B.test(I[F]?.toLowerCase()))return!0}return!1}).map(I=>I.code)},L=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),x(C)):(S(b),x(b))}catch{S(d)}finally{g(!1),a(!1)}},D=(B,I)=>{if(!Array.isArray(I)){S([]),_([]);return}const z=I.filter(F=>A[F]);if(!z.length){S([]),_([]);return}S(z),_(z)},N=B=>{B.stopPropagation(),a(!0),setTimeout(()=>{if(w.current){const I=w.current.querySelector("input");I&&I.focus()}},500)},V=n?e.jsx(Cr,{ref:w,options:m,value:b,onChange:D,inputValue:y,onInputChange:(B,I)=>{k(I)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:B=>A[B]?.name,renderInput:B=>e.jsx(U,{...B,label:"",placeholder:t}),renderOption:(B,I)=>{const z=b.indexOf(I)!==-1;return q.createElement(nn,{component:"li",...B,key:I},l(A[I]||{}),e.jsx($,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:z?"700":"normal"},children:o(I,A[I])||A[I]?.name}),e.jsx($,{component:kt,sx:{opacity:.5,width:18,height:18},style:{visibility:z?"visible":"hidden"}}))},...c,slots:{popper:an}}):e.jsx($,{className:"form-item-input slot",onClick:N,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(B=>m.some(I=>I.code===B)).map(B=>e.jsx(ft,{label:m.find(I=>I.code===B).name,style:{marginRight:8},size:"small"},B))});return e.jsx(vr,{className:"form",style:j,children:e.jsxs($,{className:"form-item",children:[e.jsxs($,{className:"form-item-label",children:[v,O&&e.jsx(Sr,{})]}),e.jsxs($,{className:"form-item-body",children:[e.jsx($,{className:"form-item-input",children:V}),n?e.jsx($,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ae,{"data-cy":"schema-form-item-confirm",onClick:L,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(kr,{})}),e.jsx(ae,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),a(!1)},disabled:R||u,size:"large",children:e.jsx(kt,{})})]})}):null]}),n&&h&&e.jsx(Bt,{children:h})]})})}is.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const nn=xe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -47,7 +47,7 @@ ${m("blocklet.config.logoDesc",{width:512,height:512,maxSize:5})}`,children:e.js
|
|
|
47
47
|
&.title {
|
|
48
48
|
font-size: 20px;
|
|
49
49
|
}
|
|
50
|
-
`;var Me={},Ye={exports:{}},Dt;function pn(){return Dt||(Dt=1,function(v,R){(function(O,C){v.exports=C()})(self,()=>{return O={7629:(_,j,p)=>{const i=p(375),m=p(8571),f=p(9474),h=p(1687),t=p(8652),l=p(8160),o=p(3292),r=p(6354),s=p(8901),c=p(9708),n=p(6914),a=p(2294),u=p(6133),g=p(1152),y=p(8863),k=p(2036),w={Base:class{constructor(d){this.type=d,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new a.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 i(typeof c.describe=="function","Manifest functionality disabled"),c.describe(this)}allow(...d){return l.verifyFlat(d,"allow"),this._values(d,"_valids")}alter(d){i(d&&typeof d=="object"&&!Array.isArray(d),"Invalid targets argument"),i(!this._inRuleset(),"Cannot set alterations inside a ruleset");const x=this.clone();x.$_terms.alterations=x.$_terms.alterations||[];for(const b in d){const S=d[b];i(typeof S=="function","Alteration adjuster for",b,"must be a function"),x.$_terms.alterations.push({target:b,adjuster:S})}return x.$_temp.ruleset=!1,x}artifact(d){return i(d!==void 0,"Artifact cannot be undefined"),i(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",d)}cast(d){return i(d===!1||typeof d=="string","Invalid to value"),i(d===!1||this._definition.cast[d],"Type",this.type,"does not support casting to",d),this.$_setFlag("cast",d===!1?void 0:d)}default(d,x){return this._default("default",d,x)}description(d){return i(d&&typeof d=="string","Description must be a non-empty string"),this.$_setFlag("description",d)}empty(d){const x=this.clone();return d!==void 0&&(d=x.$_compile(d,{override:!1})),x.$_setFlag("empty",d,{clone:!1})}error(d){return i(d,"Missing error"),i(d instanceof Error||typeof d=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",d)}example(d,x={}){return i(d!==void 0,"Missing example"),l.assertOptions(x,["override"]),this._inner("examples",d,{single:!0,override:x.override})}external(d,x){return typeof d=="object"&&(i(!x,"Cannot combine options with description"),x=d.description,d=d.method),i(typeof d=="function","Method must be a function"),i(x===void 0||x&&typeof x=="string","Description must be a non-empty string"),this._inner("externals",{method:d,description:x},{single:!0})}failover(d,x){return this._default("failover",d,x)}forbidden(){return this.presence("forbidden")}id(d){return d?(i(typeof d=="string","id must be a non-empty string"),i(/^[^\.]+$/.test(d),"id cannot contain period character"),this.$_setFlag("id",d)):this.$_setFlag("id",void 0)}invalid(...d){return this._values(d,"_invalids")}label(d){return i(d&&typeof d=="string","Label name must be a non-empty string"),this.$_setFlag("label",d)}meta(d){return i(d!==void 0,"Meta cannot be undefined"),this._inner("metas",d,{single:!0})}note(...d){i(d.length,"Missing notes");for(const x of d)i(x&&typeof x=="string","Notes must be non-empty strings");return this._inner("notes",d)}only(d=!0){return i(typeof d=="boolean","Invalid mode:",d),this.$_setFlag("only",d)}optional(){return this.presence("optional")}prefs(d){i(d,"Missing preferences"),i(d.context===void 0,"Cannot override context"),i(d.externals===void 0,"Cannot override externals"),i(d.warnings===void 0,"Cannot override warnings"),i(d.debug===void 0,"Cannot override debug"),l.checkPreferences(d);const x=this.clone();return x._preferences=l.preferences(x._preferences,d),x}presence(d){return i(["optional","required","forbidden"].includes(d),"Unknown presence mode",d),this.$_setFlag("presence",d)}raw(d=!0){return this.$_setFlag("result",d?"raw":void 0)}result(d){return i(["raw","strip"].includes(d),"Unknown result mode",d),this.$_setFlag("result",d)}required(){return this.presence("required")}strict(d){const x=this.clone(),b=d!==void 0&&!d;return x._preferences=l.preferences(x._preferences,{convert:b}),x}strip(d=!0){return this.$_setFlag("result",d?"strip":void 0)}tag(...d){i(d.length,"Missing tags");for(const x of d)i(x&&typeof x=="string","Tags must be non-empty strings");return this._inner("tags",d)}unit(d){return i(d&&typeof d=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",d)}valid(...d){l.verifyFlat(d,"valid");const x=this.allow(...d);return x.$_setFlag("only",!!x._valids,{clone:!1}),x}when(d,x){const b=this.clone();b.$_terms.whens||(b.$_terms.whens=[]);const S=o.when(b,d,x);if(!["any","link"].includes(b.type)){const A=S.is?[S]:S.switch;for(const P of A)i(!P.then||P.then.type==="any"||P.then.type===b.type,"Cannot combine",b.type,"with",P.then&&P.then.type),i(!P.otherwise||P.otherwise.type==="any"||P.otherwise.type===b.type,"Cannot combine",b.type,"with",P.otherwise&&P.otherwise.type)}return b.$_terms.whens.push(S),b.$_mutateRebuild()}cache(d){i(!this._inRuleset(),"Cannot set caching inside a ruleset"),i(!this._cache,"Cannot override schema cache"),i(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const x=this.clone();return x._cache=d||t.provider.provision(),x.$_temp.ruleset=!1,x}clone(){const d=Object.create(Object.getPrototypeOf(this));return this._assign(d)}concat(d){i(l.isSchema(d),"Invalid schema object"),i(this.type==="any"||d.type==="any"||d.type===this.type,"Cannot merge type",this.type,"with another type:",d.type),i(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),i(!d._inRuleset(),"Cannot concatenate a schema with open ruleset");let x=this.clone();if(this.type==="any"&&d.type!=="any"){const b=d.clone();for(const S of Object.keys(x))S!=="type"&&(b[S]=x[S]);x=b}x._ids.concat(d._ids),x._refs.register(d,u.toSibling),x._preferences=x._preferences?l.preferences(x._preferences,d._preferences):d._preferences,x._valids=k.merge(x._valids,d._valids,d._invalids),x._invalids=k.merge(x._invalids,d._invalids,d._valids);for(const b of d._singleRules.keys())x._singleRules.has(b)&&(x._rules=x._rules.filter(S=>S.keep||S.name!==b),x._singleRules.delete(b));for(const b of d._rules)d._definition.rules[b.method].multi||x._singleRules.set(b.name,b),x._rules.push(b);if(x._flags.empty&&d._flags.empty){x._flags.empty=x._flags.empty.concat(d._flags.empty);const b=Object.assign({},d._flags);delete b.empty,h(x._flags,b)}else if(d._flags.empty){x._flags.empty=d._flags.empty;const b=Object.assign({},d._flags);delete b.empty,h(x._flags,b)}else h(x._flags,d._flags);for(const b in d.$_terms){const S=d.$_terms[b];S?x.$_terms[b]?x.$_terms[b]=x.$_terms[b].concat(S):x.$_terms[b]=S.slice():x.$_terms[b]||(x.$_terms[b]=S)}return this.$_root._tracer&&this.$_root._tracer._combine(x,[this,d]),x.$_mutateRebuild()}extend(d){return i(!d.base,"Cannot extend type with another base"),s.type(this,d)}extract(d){return d=Array.isArray(d)?d:d.split("."),this._ids.reach(d)}fork(d,x){i(!this._inRuleset(),"Cannot fork inside a ruleset");let b=this;for(let S of[].concat(d))S=Array.isArray(S)?S:S.split("."),b=b._ids.fork(S,x,b);return b.$_temp.ruleset=!1,b}rule(d){const x=this._definition;l.assertOptions(d,Object.keys(x.modifiers)),i(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;i(b>=0&&b<this._rules.length,"Cannot apply rules to empty ruleset");const S=this.clone();for(let A=b;A<S._rules.length;++A){const P=S._rules[A],L=m(P);for(const D in d)x.modifiers[D](L,d[D]),i(L.name===P.name,"Cannot change rule name");S._rules[A]=L,S._singleRules.get(L.name)===P&&S._singleRules.set(L.name,L)}return S.$_temp.ruleset=!1,S.$_mutateRebuild()}get ruleset(){i(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const d=this.clone();return d.$_temp.ruleset=d._rules.length,d}get $(){return this.ruleset}tailor(d){d=[].concat(d),i(!this._inRuleset(),"Cannot tailor inside a ruleset");let x=this;if(this.$_terms.alterations)for(const{target:b,adjuster:S}of this.$_terms.alterations)d.includes(b)&&(x=S(x),i(l.isSchema(x),"Alteration adjuster for",b,"failed to return a schema object"));return x=x.$_modify({each:b=>b.tailor(d),ref:!1}),x.$_temp.ruleset=!1,x.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(d,x){return y.entry(d,this,x)}validateAsync(d,x){return y.entryAsync(d,this,x)}$_addRule(d){typeof d=="string"&&(d={name:d}),i(d&&typeof d=="object","Invalid options"),i(d.name&&typeof d.name=="string","Invalid rule name");for(const P in d)i(P[0]!=="_","Cannot set private rule properties");const x=Object.assign({},d);x._resolve=[],x.method=x.method||x.name;const b=this._definition.rules[x.method],S=x.args;i(b,"Unknown rule",x.method);const A=this.clone();if(S){i(Object.keys(S).length===1||Object.keys(S).length===this._definition.rules[x.name].args.length,"Invalid rule definition for",this.type,x.name);for(const P in S){let L=S[P];if(b.argsByName){const D=b.argsByName.get(P);if(D.ref&&l.isResolvable(L))x._resolve.push(P),A.$_mutateRegister(L);else if(D.normalize&&(L=D.normalize(L),S[P]=L),D.assert){const N=l.validateArg(L,P,D);i(!N,N,"or reference")}}L!==void 0?S[P]=L:delete S[P]}}return b.multi||(A._ruleRemove(x.name,{clone:!1}),A._singleRules.set(x.name,x)),A.$_temp.ruleset===!1&&(A.$_temp.ruleset=null),b.priority?A._rules.unshift(x):A._rules.push(x),A}$_compile(d,x){return o.schema(this.$_root,d,x)}$_createError(d,x,b,S,A,P={}){const L=P.flags!==!1?this._flags:{},D=P.messages?n.merge(this._definition.messages,P.messages):this._definition.messages;return new r.Report(d,x,b,L,D,S,A)}$_getFlag(d){return this._flags[d]}$_getRule(d){return this._singleRules.get(d)}$_mapLabels(d){return d=Array.isArray(d)?d:d.split("."),this._ids.labels(d)}$_match(d,x,b,S){(b=Object.assign({},b)).abortEarly=!0,b._externals=!1,x.snapshot();const A=!y.validate(d,this,x,b,S).errors;return x.restore(),A}$_modify(d){return l.assertOptions(d,["each","once","ref","schema"]),a.schema(this,d)||this}$_mutateRebuild(){return i(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(d,{source:x,name:b,path:S,key:A})=>{const P=this._definition[x][b]&&this._definition[x][b].register;P!==!1&&this.$_mutateRegister(d,{family:P,key:A})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(d,{family:x,key:b}={}){this._refs.register(d,x),this._ids.register(d,{key:b})}$_property(d){return this._definition.properties[d]}$_reach(d){return this._ids.reach(d)}$_rootReferences(){return this._refs.roots()}$_setFlag(d,x,b={}){i(d[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const S=this._definition.flags[d]||{};if(f(x,S.default)&&(x=void 0),f(x,this._flags[d]))return this;const A=b.clone!==!1?this.clone():this;return x!==void 0?(A._flags[d]=x,A.$_mutateRegister(x)):delete A._flags[d],d[0]!=="_"&&(A.$_temp.ruleset=!1),A}$_parent(d,...x){return this[d][l.symbols.parent].call(this,...x)}$_validate(d,x,b){return y.validate(d,this,x,b)}_assign(d){d.type=this.type,d.$_root=this.$_root,d.$_temp=Object.assign({},this.$_temp),d.$_temp.whens={},d._ids=this._ids.clone(),d._preferences=this._preferences,d._valids=this._valids&&this._valids.clone(),d._invalids=this._invalids&&this._invalids.clone(),d._rules=this._rules.slice(),d._singleRules=m(this._singleRules,{shallow:!0}),d._refs=this._refs.clone(),d._flags=Object.assign({},this._flags),d._cache=null,d.$_terms={};for(const x in this.$_terms)d.$_terms[x]=this.$_terms[x]?this.$_terms[x].slice():null;d.$_super={};for(const x in this.$_super)d.$_super[x]=this._super[x].bind(d);return d}_bare(){const d=this.clone();d._reset();const x=d._definition.terms;for(const b in x){const S=x[b];d.$_terms[b]=S.init}return d.$_mutateRebuild()}_default(d,x,b={}){return l.assertOptions(b,"literal"),i(x!==void 0,"Missing",d,"value"),i(typeof x=="function"||!b.literal,"Only function value supports literal option"),typeof x=="function"&&b.literal&&(x={[l.symbols.literal]:!0,literal:x}),this.$_setFlag(d,x)}_generate(d,x,b){if(!this.$_terms.whens)return{schema:this};const S=[],A=[];for(let D=0;D<this.$_terms.whens.length;++D){const N=this.$_terms.whens[D];if(N.concat){S.push(N.concat),A.push(`${D}.concat`);continue}const V=N.ref?N.ref.resolve(d,x,b):d,B=N.is?[N]:N.switch,I=A.length;for(let z=0;z<B.length;++z){const{is:F,then:K,otherwise:he}=B[z],be=`${D}${N.switch?"."+z:""}`;if(F.$_match(V,x.nest(F,`${be}.is`),b)){if(K){const De=x.localize([...x.path,`${be}.then`],x.ancestors,x.schemas),{schema:We,id:Le}=K._generate(d,De,b);S.push(We),A.push(`${be}.then${Le?`(${Le})`:""}`);break}}else if(he){const De=x.localize([...x.path,`${be}.otherwise`],x.ancestors,x.schemas),{schema:We,id:Le}=he._generate(d,De,b);S.push(We),A.push(`${be}.otherwise${Le?`(${Le})`:""}`);break}}if(N.break&&A.length>I)break}const P=A.join(", ");if(x.mainstay.tracer.debug(x,"rule","when",P),!P)return{schema:this};if(!x.mainstay.tracer.active&&this.$_temp.whens[P])return{schema:this.$_temp.whens[P],id:P};let L=this;this._definition.generate&&(L=this._definition.generate(this,d,x,b));for(const D of S)L=L.concat(D);return this.$_root._tracer&&this.$_root._tracer._combine(L,[this,...S]),this.$_temp.whens[P]=L,{schema:L,id:P}}_inner(d,x,b={}){i(!this._inRuleset(),`Cannot set ${d} inside a ruleset`);const S=this.clone();return S.$_terms[d]&&!b.override||(S.$_terms[d]=[]),b.single?S.$_terms[d].push(x):S.$_terms[d].push(...x),S.$_temp.ruleset=!1,S}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(d,x={}){if(!this._singleRules.has(d))return this;const b=x.clone!==!1?this.clone():this;b._singleRules.delete(d);const S=[];for(let A=0;A<b._rules.length;++A){const P=b._rules[A];P.name!==d||P.keep?S.push(P):b._inRuleset()&&A<b.$_temp.ruleset&&--b.$_temp.ruleset}return b._rules=S,b}_values(d,x){l.verifyFlat(d,x.slice(1,-1));const b=this.clone(),S=d[0]===l.symbols.override;if(S&&(d=d.slice(1)),!b[x]&&d.length?b[x]=new k:S&&(b[x]=d.length?new k:null,b.$_mutateRebuild()),!b[x])return b;S&&b[x].override();for(const A of d){i(A!==void 0,"Cannot call allow/valid/invalid with undefined"),i(A!==l.symbols.override,"Override must be the first value");const P=x==="_invalids"?"_valids":"_invalids";b[P]&&(b[P].remove(A),b[P].length||(i(x==="_valids"||!b._flags.only,"Setting invalid value",A,"leaves schema rejecting all values due to previous valid rule"),b[P]=null)),b[x].add(A,b._refs)}return b}}};w.Base.prototype[l.symbols.any]={version:l.version,compile:o.compile,root:"$_root"},w.Base.prototype.isImmutable=!0,w.Base.prototype.deny=w.Base.prototype.invalid,w.Base.prototype.disallow=w.Base.prototype.invalid,w.Base.prototype.equal=w.Base.prototype.valid,w.Base.prototype.exist=w.Base.prototype.required,w.Base.prototype.not=w.Base.prototype.invalid,w.Base.prototype.options=w.Base.prototype.prefs,w.Base.prototype.preferences=w.Base.prototype.prefs,_.exports=new w.Base},8652:(_,j,p)=>{const i=p(375),m=p(8571),f=p(8160),h={max:1e3,supported:new Set(["undefined","boolean","number","string"])};j.provider={provision:t=>new h.Cache(t)},h.Cache=class{constructor(t={}){f.assertOptions(t,["max"]),i(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||h.max,this._map=new Map,this._list=new h.List}get length(){return this._map.size}set(t,l){if(t!==null&&!h.supported.has(typeof t))return;let o=this._map.get(t);if(o)return o.value=l,void this._list.first(o);o=this._list.unshift({key:t,value:l}),this._map.set(t,o),this._compact()}get(t){const l=this._map.get(t);if(l)return this._list.first(l),m(l.value)}_compact(){if(this._map.size>this._max){const t=this._list.pop();this._map.delete(t.key)}}},h.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){const{next:l,prev:o}=t;return l.prev=o,o&&(o.next=l),t===this.tail&&(this.tail=l),t.prev=null,t.next=null,t}}},8160:(_,j,p)=>{const i=p(375),m=p(7916),f=p(5934);let h,t;const l={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)?)?)?)?$/};j.version=f.version,j.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},j.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")},j.assertOptions=function(o,r,s="Options"){i(o&&typeof o=="object"&&!Array.isArray(o),"Options must be of type object");const c=Object.keys(o).filter(n=>!r.includes(n));i(c.length===0,`${s} contain unknown keys: ${c}`)},j.checkPreferences=function(o){t=t||p(3378);const r=t.preferences.validate(o);if(r.error)throw new m([r.error.details[0].message])},j.compare=function(o,r,s){switch(s){case"=":return o===r;case">":return o>r;case"<":return o<r;case">=":return o>=r;case"<=":return o<=r}},j.default=function(o,r){return o===void 0?r:o},j.isIsoDate=function(o){return l.isoDate.test(o)},j.isNumber=function(o){return typeof o=="number"&&!isNaN(o)},j.isResolvable=function(o){return!!o&&(o[j.symbols.ref]||o[j.symbols.template])},j.isSchema=function(o,r={}){const s=o&&o[j.symbols.any];return!!s&&(i(r.legacy||s.version===j.version,"Cannot mix different versions of joi schemas"),!0)},j.isValues=function(o){return o[j.symbols.values]},j.limit=function(o){return Number.isSafeInteger(o)&&o>=0},j.preferences=function(o,r){h=h||p(6914),o=o||{},r=r||{};const s=Object.assign({},o,r);return r.errors&&o.errors&&(s.errors=Object.assign({},o.errors,r.errors),s.errors.wrap=Object.assign({},o.errors.wrap,r.errors.wrap)),r.messages&&(s.messages=h.compile(r.messages,o.messages)),delete s[j.symbols.prefs],s},j.tryWithPath=function(o,r,s={}){try{return o()}catch(c){throw c.path!==void 0?c.path=r+"."+c.path:c.path=r,s.append&&(c.message=`${c.message} (${c.path})`),c}},j.validateArg=function(o,r,{assert:s,message:c}){if(j.isSchema(s)){const n=s.validate(o);return n.error?n.error.message:void 0}if(!s(o))return r?`${r} ${c}`:c},j.verifyFlat=function(o,r){for(const s of o)i(!Array.isArray(s),"Method no longer accepts array arguments:",r)}},3292:(_,j,p)=>{const i=p(375),m=p(8160),f=p(6133),h={};j.schema=function(t,l,o={}){m.assertOptions(o,["appendPath","override"]);try{return h.schema(t,l,o)}catch(r){throw o.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},h.schema=function(t,l,o){i(l!==void 0,"Invalid undefined schema"),Array.isArray(l)&&(i(l.length,"Invalid empty array schema"),l.length===1&&(l=l[0]));const r=(s,...c)=>o.override!==!1?s.valid(t.override,...c):s.valid(...c);if(h.simple(l))return r(t,l);if(typeof l=="function")return t.custom(l);if(i(typeof l=="object","Invalid schema content:",typeof l),m.isResolvable(l))return r(t,l);if(m.isSchema(l))return l;if(Array.isArray(l)){for(const s of l)if(!h.simple(s))return t.alternatives().try(...l);return r(t,...l)}return l instanceof RegExp?t.string().regex(l):l instanceof Date?r(t.date(),l):(i(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(l))},j.ref=function(t,l){return f.isRef(t)?t:f.create(t,l)},j.compile=function(t,l,o={}){m.assertOptions(o,["legacy"]);const r=l&&l[m.symbols.any];if(r)return i(o.legacy||r.version===m.version,"Cannot mix different versions of joi schemas:",r.version,m.version),l;if(typeof l!="object"||!o.legacy)return j.schema(t,l,{appendPath:!0});const s=h.walk(l);return s?s.compile(s.root,l):j.schema(t,l,{appendPath:!0})},h.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(const o of t){const r=h.walk(o);if(r)return r}return null}const l=t[m.symbols.any];if(l)return{root:t[l.root],compile:l.compile};i(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const o in t){const r=h.walk(t[o]);if(r)return r}return null},h.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)},j.when=function(t,l,o){if(o===void 0&&(i(l&&typeof l=="object","Missing options"),o=l,l=f.create(".")),Array.isArray(o)&&(o={switch:o}),m.assertOptions(o,["is","not","then","otherwise","switch","break"]),m.isSchema(l))return i(o.is===void 0,'"is" can not be used with a schema condition'),i(o.not===void 0,'"not" can not be used with a schema condition'),i(o.switch===void 0,'"switch" can not be used with a schema condition'),h.condition(t,{is:l,then:o.then,otherwise:o.otherwise,break:o.break});if(i(f.isRef(l)||typeof l=="string","Invalid condition:",l),i(o.not===void 0||o.is===void 0,'Cannot combine "is" with "not"'),o.switch===void 0){let s=o;o.not!==void 0&&(s={is:o.not,then:o.otherwise,otherwise:o.then,break:o.break});let c=s.is!==void 0?t.$_compile(s.is):t.$_root.invalid(null,!1,0,"").required();return i(s.then!==void 0||s.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),i(s.break===void 0||s.then===void 0||s.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),o.is===void 0||f.isRef(o.is)||m.isSchema(o.is)||(c=c.required()),h.condition(t,{ref:j.ref(l),is:c,then:s.then,otherwise:s.otherwise,break:s.break})}i(Array.isArray(o.switch),'"switch" must be an array'),i(o.is===void 0,'Cannot combine "switch" with "is"'),i(o.not===void 0,'Cannot combine "switch" with "not"'),i(o.then===void 0,'Cannot combine "switch" with "then"');const r={ref:j.ref(l),switch:[],break:o.break};for(let s=0;s<o.switch.length;++s){const c=o.switch[s],n=s===o.switch.length-1;m.assertOptions(c,n?["is","then","otherwise"]:["is","then"]),i(c.is!==void 0,'Switch statement missing "is"'),i(c.then!==void 0,'Switch statement missing "then"');const a={is:t.$_compile(c.is),then:t.$_compile(c.then)};if(f.isRef(c.is)||m.isSchema(c.is)||(a.is=a.is.required()),n){i(o.otherwise===void 0||c.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const u=o.otherwise!==void 0?o.otherwise:c.otherwise;u!==void 0&&(i(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r},h.condition=function(t,l){for(const o of["then","otherwise"])l[o]===void 0?delete l[o]:l[o]=t.$_compile(l[o]);return l}},6354:(_,j,p)=>{const i=p(5688),m=p(8160),f=p(3328);j.Report=class{constructor(h,t,l,o,r,s,c){if(this.code=h,this.flags=o,this.messages=r,this.path=s.path,this.prefs=c,this.state=s,this.value=t,this.message=null,this.template=null,this.local=l||{},this.local.label=j.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 n=this.path[this.path.length-1];typeof n!="object"&&(this.local.key=n)}}_setTemplate(h){if(this.template=h,!this.flags.label&&this.path.length===0){const t=this._template(this.template,"root");t&&(this.local.label=t)}}toString(){if(this.message)return this.message;const h=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return t===void 0?`Error code "${h}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.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(h,t){return j.template(this.value,h,t||this.code,this.state,this.prefs)}},j.path=function(h){let t="";for(const l of h)typeof l!="object"&&(typeof l=="string"?(t&&(t+="."),t+=l):t+=`[${l}]`);return t},j.template=function(h,t,l,o,r){if(!t)return;if(f.isTemplate(t))return l!=="root"?t:null;let s=r.errors.language;if(m.isResolvable(s)&&(s=s.resolve(h,o,r)),s&&t[s]){if(t[s][l]!==void 0)return t[s][l];if(t[s]["*"]!==void 0)return t[s]["*"]}return t[l]?t[l]:t["*"]},j.label=function(h,t,l,o){if(!l.errors.label)return"";if(h.label)return h.label;let r=t.path;return l.errors.label==="key"&&t.path.length>1&&(r=t.path.slice(-1)),j.path(r)||j.template(null,l.messages,"root",t,l)||o&&j.template(null,o,"root",t,l)||"value"},j.process=function(h,t,l){if(!h)return null;const{override:o,message:r,details:s}=j.details(h);if(o)return o;if(l.errors.stack)return new j.ValidationError(r,s,t);const c=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new j.ValidationError(r,s,t);return Error.stackTraceLimit=c,n},j.details=function(h,t={}){let l=[];const o=[];for(const r of h){if(r instanceof Error){if(t.override!==!1)return{override:r};const c=r.toString();l.push(c),o.push({message:c,type:"override",context:{error:r}});continue}const s=r.toString();l.push(s),o.push({message:s,path:r.path.filter(c=>typeof c!="object"),type:r.code,context:r.local})}return l.length>1&&(l=[...new Set(l)]),{message:l.join(". "),details:o}},j.ValidationError=class extends Error{constructor(h,t,l){super(h),this._original=l,this.details=t}static isError(h){return h instanceof j.ValidationError}},j.ValidationError.prototype.isJoi=!0,j.ValidationError.prototype.name="ValidationError",j.ValidationError.prototype.annotate=i.error},8901:(_,j,p)=>{const i=p(375),m=p(8571),f=p(8160),h=p(6914),t={};j.type=function(l,o){const r=Object.getPrototypeOf(l),s=m(r),c=l._assign(Object.create(s)),n=Object.assign({},o);delete n.base,s._definition=n;const a=r._definition||{};n.messages=h.merge(a.messages,n.messages),n.properties=Object.assign({},a.properties,n.properties),c.type=n.type,n.flags=Object.assign({},a.flags,n.flags);const u=Object.assign({},a.terms);if(n.terms)for(const w in n.terms){const d=n.terms[w];i(c.$_terms[w]===void 0,"Invalid term override for",n.type,w),c.$_terms[w]=d.init,u[w]=d}n.terms=u,n.args||(n.args=a.args),n.prepare=t.prepare(n.prepare,a.prepare),n.coerce&&(typeof n.coerce=="function"&&(n.coerce={method:n.coerce}),n.coerce.from&&!Array.isArray(n.coerce.from)&&(n.coerce={method:n.coerce.method,from:[].concat(n.coerce.from)})),n.coerce=t.coerce(n.coerce,a.coerce),n.validate=t.validate(n.validate,a.validate);const g=Object.assign({},a.rules);if(n.rules)for(const w in n.rules){const d=n.rules[w];i(typeof d=="object","Invalid rule definition for",n.type,w);let x=d.method;if(x===void 0&&(x=function(){return this.$_addRule(w)}),x&&(i(!s[w],"Rule conflict in",n.type,w),s[w]=x),i(!g[w],"Rule conflict in",n.type,w),g[w]=d,d.alias){const b=[].concat(d.alias);for(const S of b)s[S]=d.method}d.args&&(d.argsByName=new Map,d.args=d.args.map(b=>(typeof b=="string"&&(b={name:b}),i(!d.argsByName.has(b.name),"Duplicated argument name",b.name),f.isSchema(b.assert)&&(b.assert=b.assert.strict().label(b.name)),d.argsByName.set(b.name,b),b)))}n.rules=g;const y=Object.assign({},a.modifiers);if(n.modifiers)for(const w in n.modifiers){i(!s[w],"Rule conflict in",n.type,w);const d=n.modifiers[w];i(typeof d=="function","Invalid modifier definition for",n.type,w);const x=function(b){return this.rule({[w]:b})};s[w]=x,y[w]=d}if(n.modifiers=y,n.overrides){s._super=r,c.$_super={};for(const w in n.overrides)i(r[w],"Cannot override missing",w),n.overrides[w][f.symbols.parent]=r[w],c.$_super[w]=r[w].bind(c);Object.assign(s,n.overrides)}n.cast=Object.assign({},a.cast,n.cast);const k=Object.assign({},a.manifest,n.manifest);return k.build=t.build(n.manifest&&n.manifest.build,a.manifest&&a.manifest.build),n.manifest=k,n.rebuild=t.rebuild(n.rebuild,a.rebuild),c},t.build=function(l,o){return l&&o?function(r,s){return o(l(r,s),s)}:l||o},t.coerce=function(l,o){return l&&o?{from:l.from&&o.from?[...new Set([...l.from,...o.from])]:null,method(r,s){let c;if((!o.from||o.from.includes(typeof r))&&(c=o.method(r,s),c)){if(c.errors||c.value===void 0)return c;r=c.value}if(!l.from||l.from.includes(typeof r)){const n=l.method(r,s);if(n)return n}return c}}:l||o},t.prepare=function(l,o){return l&&o?function(r,s){const c=l(r,s);if(c){if(c.errors||c.value===void 0)return c;r=c.value}return o(r,s)||c}:l||o},t.rebuild=function(l,o){return l&&o?function(r){o(r),l(r)}:l||o},t.validate=function(l,o){return l&&o?function(r,s){const c=o(r,s);if(c){if(c.errors&&(!Array.isArray(c.errors)||c.errors.length))return c;r=c.value}return l(r,s)||c}:l||o}},5107:(_,j,p)=>{const i=p(375),m=p(8571),f=p(8652),h=p(8160),t=p(3292),l=p(6354),o=p(8901),r=p(9708),s=p(6133),c=p(3328),n=p(1152);let a;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 g={_types:new Set(Object.keys(u.types))};for(const y of g._types)g[y]=function(...k){return i(!k.length||["alternatives","link","object"].includes(y),"The",y,"type does not allow arguments"),u.generate(this,u.types[y],k)};for(const y of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])g[y]=function(...k){return this.any()[y](...k)};Object.assign(g,u.methods);for(const y in u.aliases){const k=u.aliases[y];g[y]=g[k]}return g.x=g.expression,n.setup&&n.setup(g),g}};u.methods={ValidationError:l.ValidationError,version:h.version,cache:f.provider,assert(g,y,...k){u.assert(g,y,!0,k)},attempt:(g,y,...k)=>u.assert(g,y,!1,k),build(g){return i(typeof r.build=="function","Manifest functionality disabled"),r.build(this,g)},checkPreferences(g){h.checkPreferences(g)},compile(g,y){return t.compile(this,g,y)},defaults(g){i(typeof g=="function","modifier must be a function");const y=Object.assign({},this);for(const k of y._types){const w=g(y[k]());i(h.isSchema(w),"modifier must return a valid schema object"),y[k]=function(...d){return u.generate(this,w,d)}}return y},expression:(...g)=>new c(...g),extend(...g){h.verifyFlat(g,"extend"),a=a||p(3378),i(g.length,"You need to provide at least one extension"),this.assert(g,a.extensions);const y=Object.assign({},this);y._types=new Set(y._types);for(let k of g){typeof k=="function"&&(k=k(y)),this.assert(k,a.extension);const w=u.expandExtension(k,y);for(const d of w){i(y[d.type]===void 0||y._types.has(d.type),"Cannot override name",d.type);const x=d.base||this.any(),b=o.type(x,d);y._types.add(d.type),y[d.type]=function(...S){return u.generate(this,b,S)}}}return y},isError:l.ValidationError.isError,isExpression:c.isTemplate,isRef:s.isRef,isSchema:h.isSchema,in:(...g)=>s.in(...g),override:h.symbols.override,ref:(...g)=>s.create(...g),types(){const g={};for(const y of this._types)g[y]=this[y]();for(const y in u.aliases)g[y]=this[y]();return g}},u.assert=function(g,y,k,w){const d=w[0]instanceof Error||typeof w[0]=="string"?w[0]:null,x=d!==null?w[1]:w[0],b=y.validate(g,h.preferences({errors:{stack:!0}},x||{}));let S=b.error;if(!S)return b.value;if(d instanceof Error)throw d;const A=k&&typeof S.annotate=="function"?S.annotate():S.message;throw S instanceof l.ValidationError==0&&(S=m(S)),S.message=d?`${d} ${A}`:A,S},u.generate=function(g,y,k){return i(g,"Must be invoked on a Joi instance."),y.$_root=g,y._definition.args&&k.length?y._definition.args(y,...k):y},u.expandExtension=function(g,y){if(typeof g.type=="string")return[g];const k=[];for(const w of y._types)if(g.type.test(w)){const d=Object.assign({},g);d.type=w,d.base=y[w](),k.push(d)}return k},_.exports=u.root()},6914:(_,j,p)=>{const i=p(375),m=p(8571),f=p(3328);j.compile=function(h,t){if(typeof h=="string")return i(!t,"Cannot set single message string"),new f(h);if(f.isTemplate(h))return i(!t,"Cannot set single message template"),h;i(typeof h=="object"&&!Array.isArray(h),"Invalid message options"),t=t?m(t):{};for(let l in h){const o=h[l];if(l==="root"||f.isTemplate(o)){t[l]=o;continue}if(typeof o=="string"){t[l]=new f(o);continue}i(typeof o=="object"&&!Array.isArray(o),"Invalid message for",l);const r=l;for(l in t[r]=t[r]||{},o){const s=o[l];l==="root"||f.isTemplate(s)?t[r][l]=s:(i(typeof s=="string","Invalid message for",l,"in",r),t[r][l]=new f(s))}}return t},j.decompile=function(h){const t={};for(let l in h){const o=h[l];if(l==="root"){t.root=o;continue}if(f.isTemplate(o)){t[l]=o.describe({compact:!0});continue}const r=l;for(l in t[r]={},o){const s=o[l];l!=="root"?t[r][l]=s.describe({compact:!0}):t[r].root=s}}return t},j.merge=function(h,t){if(!h)return j.compile(t);if(!t)return h;if(typeof t=="string")return new f(t);if(f.isTemplate(t))return t;const l=m(h);for(let o in t){const r=t[o];if(o==="root"||f.isTemplate(r)){l[o]=r;continue}if(typeof r=="string"){l[o]=new f(r);continue}i(typeof r=="object"&&!Array.isArray(r),"Invalid message for",o);const s=o;for(o in l[s]=l[s]||{},r){const c=r[o];o==="root"||f.isTemplate(c)?l[s][o]=c:(i(typeof c=="string","Invalid message for",o,"in",s),l[s][o]=new f(c))}}return l}},2294:(_,j,p)=>{const i=p(375),m=p(8160),f=p(6133),h={};j.Ids=h.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const t=new h.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(const[l,o]of t._byId.entries())i(!this._byKey.has(l),"Schema id conflicts with existing key:",l),this._byId.set(l,o);for(const[l,o]of t._byKey.entries())i(!this._byId.has(l),"Schema key conflicts with existing id:",l),this._byKey.set(l,o)}fork(t,l,o){const r=this._collect(t);r.push({schema:o});const s=r.shift();let c={id:s.id,schema:l(s.schema)};i(m.isSchema(c.schema),"adjuster function failed to return a joi schema type");for(const n of r)c={id:n.id,schema:h.fork(n.schema,c.id,c.schema)};return c.schema}labels(t,l=[]){const o=t[0],r=this._get(o);if(!r)return[...l,...t].join(".");const s=t.slice(1);return l=[...l,r.schema._flags.label||o],s.length?r.schema._ids.labels(s,l):l.join(".")}reach(t,l=[]){const o=t[0],r=this._get(o);i(r,"Schema does not contain path",[...l,...t].join("."));const s=t.slice(1);return s.length?r.schema._ids.reach(s,[...l,o]):r.schema}register(t,{key:l}={}){if(!t||!m.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);const o=t._flags.id;if(o){const r=this._byId.get(o);i(!r||r.schema===t,"Cannot add different schemas with the same id:",o),i(!this._byKey.has(o),"Schema id conflicts with existing key:",o),this._byId.set(o,{schema:t,id:o})}l&&(i(!this._byKey.has(l),"Schema already contains key:",l),i(!this._byId.has(l),"Schema key conflicts with existing id:",l),this._byKey.set(l,{schema:t,id:l}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,l=[],o=[]){const r=t[0],s=this._get(r);i(s,"Schema does not contain path",[...l,...t].join(".")),o=[s,...o];const c=t.slice(1);return c.length?s.schema._ids._collect(c,[...l,r],o):o}_get(t){return this._byId.get(t)||this._byKey.get(t)}},h.fork=function(t,l,o){const r=j.schema(t,{each:(s,{key:c})=>{if(l===(s._flags.id||c))return o},ref:!1});return r?r.$_mutateRebuild():t},j.schema=function(t,l){let o;for(const r in t._flags){if(r[0]==="_")continue;const s=h.scan(t._flags[r],{source:"flags",name:r},l);s!==void 0&&(o=o||t.clone(),o._flags[r]=s)}for(let r=0;r<t._rules.length;++r){const s=t._rules[r],c=h.scan(s.args,{source:"rules",name:s.name},l);if(c!==void 0){o=o||t.clone();const n=Object.assign({},s);n.args=c,o._rules[r]=n,o._singleRules.get(s.name)===s&&o._singleRules.set(s.name,n)}}for(const r in t.$_terms){if(r[0]==="_")continue;const s=h.scan(t.$_terms[r],{source:"terms",name:r},l);s!==void 0&&(o=o||t.clone(),o.$_terms[r]=s)}return o},h.scan=function(t,l,o,r,s){const c=r||[];if(t===null||typeof t!="object")return;let n;if(Array.isArray(t)){for(let a=0;a<t.length;++a){const u=l.source==="terms"&&l.name==="keys"&&t[a].key,g=h.scan(t[a],l,o,[a,...c],u);g!==void 0&&(n=n||t.slice(),n[a]=g)}return n}if(o.schema!==!1&&m.isSchema(t)||o.ref!==!1&&f.isRef(t)){const a=o.each(t,{...l,path:c,key:s});return a===t?void 0:a}for(const a in t){if(a[0]==="_")continue;const u=h.scan(t[a],l,o,[a,...c],s);u!==void 0&&(n=n||Object.assign({},t),n[a]=u)}return n}},6133:(_,j,p)=>{const i=p(375),m=p(8571),f=p(9621),h=p(8160);let t;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};j.create=function(o,r={}){i(typeof o=="string","Invalid reference key:",o),h.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),i(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const s=Object.assign({},l.defaults,r);delete s.prefix;const c=s.separator,n=l.context(o,c,r.prefix);if(s.type=n.type,o=n.key,s.type==="value")if(n.root&&(i(!c||o[0]!==c,"Cannot specify relative path with root prefix"),s.ancestor="root",o||(o=null)),c&&c===o)o=null,s.ancestor=0;else if(s.ancestor!==void 0)i(!c||!o||o[0]!==c,"Cannot combine prefix with ancestor option");else{const[a,u]=l.ancestor(o,c);u&&(o=o.slice(u))===""&&(o=null),s.ancestor=a}return s.path=c?o===null?[]:o.split(c):[o],new l.Ref(s)},j.in=function(o,r={}){return j.create(o,{...r,in:!0})},j.isRef=function(o){return!!o&&!!o[h.symbols.ref]},l.Ref=class{constructor(o){i(typeof o=="object","Invalid reference construction"),h.assertOptions(o,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),i([!1,void 0].includes(o.separator)||typeof o.separator=="string"&&o.separator.length===1,"Invalid separator"),i(!o.adjust||typeof o.adjust=="function","options.adjust must be a function"),i(!o.map||Array.isArray(o.map),"options.map must be an array"),i(!o.map||!o.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,o),i(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(o,r,s,c,n={}){return i(!this.in||n.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(s.context,r,n):this.type==="local"?this._resolve(c,r,n):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,n):(i(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,n)):this._resolve(o,r,n)}_resolve(o,r,s){let c;if(this.type==="value"&&r.mainstay.shadow&&s.shadow!==!1&&(c=r.mainstay.shadow.get(this.absolute(r))),c===void 0&&(c=f(o,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(c=this.adjust(c)),this.map){const n=this.map.get(c);n!==void 0&&(c=n)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,c),c}toString(){return this.display}absolute(o){return[...o.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const o={path:this.path};this.type!=="value"&&(o.type=this.type),this.separator!=="."&&(o.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(o.ancestor=this.ancestor),this.map&&(o.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(o[r]=this[r]);return this.in!==!1&&(o.in=!0),{ref:o}}updateDisplay(){const o=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${o}`);if(!this.separator)return void(this.display=`ref:${o}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${o}`);if(this.ancestor==="root")return void(this.display=`ref:root:${o}`);if(this.ancestor===1)return void(this.display=`ref:${o||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${o||""}`}},l.Ref.prototype[h.symbols.ref]=!0,j.build=function(o){return(o=Object.assign({},l.defaults,o)).type==="value"&&o.ancestor===void 0&&(o.ancestor=1),new l.Ref(o)},l.context=function(o,r,s={}){if(o=o.trim(),s){const c=s.global===void 0?"$":s.global;if(c!==r&&o.startsWith(c))return{key:o.slice(c.length),type:"global"};const n=s.local===void 0?"#":s.local;if(n!==r&&o.startsWith(n))return{key:o.slice(n.length),type:"local"};const a=s.root===void 0?"/":s.root;if(a!==r&&o.startsWith(a))return{key:o.slice(a.length),type:"value",root:!0}}return{key:o,type:"value"}},l.ancestor=function(o,r){if(!r)return[1,0];if(o[0]!==r)return[1,0];if(o[1]!==r)return[0,1];let s=2;for(;o[s]===r;)++s;return[s-1,s]},j.toSibling=0,j.toParent=1,j.Manager=class{constructor(){this.refs=[]}register(o,r){if(o)if(r=r===void 0?j.toParent:r,Array.isArray(o))for(const s of o)this.register(s,r);else if(h.isSchema(o))for(const s of o._refs.refs)s.ancestor-r>=0&&this.refs.push({ancestor:s.ancestor-r,root:s.root});else j.isRef(o)&&o.type==="value"&&o.ancestor-r>=0&&this.refs.push({ancestor:o.ancestor-r,root:o.root}),t=t||p(3328),t.isTemplate(o)&&this.register(o.refs(),r)}get length(){return this.refs.length}clone(){const o=new j.Manager;return o.refs=m(this.refs),o}reset(){this.refs=[]}roots(){return this.refs.filter(o=>!o.ancestor).map(o=>o.root)}}},3378:(_,j,p)=>{const i=p(5107),m={};m.wrap=i.string().min(1).max(2).allow(!1),j.preferences=i.object({allowUnknown:i.boolean(),abortEarly:i.boolean(),artifacts:i.boolean(),cache:i.boolean(),context:i.object(),convert:i.boolean(),dateFormat:i.valid("date","iso","string","time","utc"),debug:i.boolean(),errors:{escapeHtml:i.boolean(),label:i.valid("path","key",!1),language:[i.string(),i.object().ref()],render:i.boolean(),stack:i.boolean(),wrap:{label:m.wrap,array:m.wrap,string:m.wrap}},externals:i.boolean(),messages:i.object(),noDefaults:i.boolean(),nonEnumerables:i.boolean(),presence:i.valid("required","optional","forbidden"),skipFunctions:i.boolean(),stripUnknown:i.object({arrays:i.boolean(),objects:i.boolean()}).or("arrays","objects").allow(!0,!1),warnings:i.boolean()}).strict(),m.nameRx=/^[a-zA-Z0-9]\w*$/,m.rule=i.object({alias:i.array().items(i.string().pattern(m.nameRx)).single(),args:i.array().items(i.string(),i.object({name:i.string().pattern(m.nameRx).required(),ref:i.boolean(),assert:i.alternatives([i.function(),i.object().schema()]).conditional("ref",{is:!0,then:i.required()}),normalize:i.function(),message:i.string().when("assert",{is:i.function(),then:i.required()})})),convert:i.boolean(),manifest:i.boolean(),method:i.function().allow(!1),multi:i.boolean(),validate:i.function()}),j.extension=i.object({type:i.alternatives([i.string(),i.object().regex()]).required(),args:i.function(),cast:i.object().pattern(m.nameRx,i.object({from:i.function().maxArity(1).required(),to:i.function().minArity(1).maxArity(2).required()})),base:i.object().schema().when("type",{is:i.object().regex(),then:i.forbidden()}),coerce:[i.function().maxArity(3),i.object({method:i.function().maxArity(3).required(),from:i.array().items(i.string()).single()})],flags:i.object().pattern(m.nameRx,i.object({setter:i.string(),default:i.any()})),manifest:{build:i.function().arity(2)},messages:[i.object(),i.string()],modifiers:i.object().pattern(m.nameRx,i.function().minArity(1).maxArity(2)),overrides:i.object().pattern(m.nameRx,i.function()),prepare:i.function().maxArity(3),rebuild:i.function().arity(1),rules:i.object().pattern(m.nameRx,m.rule),terms:i.object().pattern(m.nameRx,i.object({init:i.array().allow(null).required(),manifest:i.object().pattern(/.+/,[i.valid("schema","single"),i.object({mapped:i.object({from:i.string().required(),to:i.string().required()}).required()})])})),validate:i.function().maxArity(3)}).strict(),j.extensions=i.array().items(i.object(),i.function().arity(1)).strict(),m.desc={buffer:i.object({buffer:i.string()}),func:i.object({function:i.function().required(),options:{literal:!0}}),override:i.object({override:!0}),ref:i.object({ref:i.object({type:i.valid("value","global","local"),path:i.array().required(),separator:i.string().length(1).allow(!1),ancestor:i.number().min(0).integer().allow("root"),map:i.array().items(i.array().length(2)).min(1),adjust:i.function(),iterables:i.boolean(),in:i.boolean(),render:i.boolean()}).required()}),regex:i.object({regex:i.string().min(3)}),special:i.object({special:i.valid("deep").required()}),template:i.object({template:i.string().required(),options:i.object()}),value:i.object({value:i.alternatives([i.object(),i.array()]).required()})},m.desc.entity=i.alternatives([i.array().items(i.link("...")),i.boolean(),i.function(),i.number(),i.string(),m.desc.buffer,m.desc.func,m.desc.ref,m.desc.regex,m.desc.special,m.desc.template,m.desc.value,i.link("/")]),m.desc.values=i.array().items(null,i.boolean(),i.function(),i.number().allow(1/0,-1/0),i.string().allow(""),i.symbol(),m.desc.buffer,m.desc.func,m.desc.override,m.desc.ref,m.desc.regex,m.desc.template,m.desc.value),m.desc.messages=i.object().pattern(/.+/,[i.string(),m.desc.template,i.object().pattern(/.+/,[i.string(),m.desc.template])]),j.description=i.object({type:i.string().required(),flags:i.object({cast:i.string(),default:i.any(),description:i.string(),empty:i.link("/"),failover:m.desc.entity,id:i.string(),label:i.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:i.boolean(),unit:i.string()}).unknown(),preferences:{allowUnknown:i.boolean(),abortEarly:i.boolean(),artifacts:i.boolean(),cache:i.boolean(),convert:i.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:i.boolean(),label:["path","key"],language:[i.string(),m.desc.ref],wrap:{label:m.wrap,array:m.wrap}},externals:i.boolean(),messages:m.desc.messages,noDefaults:i.boolean(),nonEnumerables:i.boolean(),presence:["required","optional","forbidden"],skipFunctions:i.boolean(),stripUnknown:i.object({arrays:i.boolean(),objects:i.boolean()}).or("arrays","objects").allow(!0,!1),warnings:i.boolean()},allow:m.desc.values,invalid:m.desc.values,rules:i.array().min(1).items({name:i.string().required(),args:i.object().min(1),keep:i.boolean(),message:[i.string(),m.desc.messages],warn:i.boolean()}),keys:i.object().pattern(/.*/,i.link("/")),link:m.desc.ref}).pattern(/^[a-z]\w*$/,i.any())},493:(_,j,p)=>{const i=p(8571),m=p(9621),f=p(8160),h={value:Symbol("value")};_.exports=h.State=class{constructor(t,l,o){this.path=t,this.ancestors=l,this.mainstay=o.mainstay,this.schemas=o.schemas,this.debug=null}localize(t,l=null,o=null){const r=new h.State(t,l,this);return o&&r.schemas&&(r.schemas=[h.schemas(o),...r.schemas]),r}nest(t,l){const o=new h.State(this.path,this.ancestors,this);return o.schemas=o.schemas&&[h.schemas(t),...o.schemas],o.debug=l,o}shadow(t,l){this.mainstay.shadow=this.mainstay.shadow||new h.Shadow,this.mainstay.shadow.set(this.path,t,l)}snapshot(){this.mainstay.shadow&&(this._snapshot=i(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()}},h.schemas=function(t){return f.isSchema(t)?{schema:t}:t},h.Shadow=class{constructor(){this._values=null}set(t,l,o){if(!t.length||o==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let s=0;s<t.length;++s){const c=t[s];let n=r.get(c);n||(n=new Map,r.set(c,n)),r=n}r[h.value]=l}get(t){const l=this.node(t);if(l)return l[h.value]}node(t){if(this._values)return m(this._values,t,{iterables:!0})}override(t,l){if(!this._values)return;const o=t.slice(0,-1),r=t[t.length-1],s=m(this._values,o,{iterables:!0});l?s.set(r,l):s&&s.delete(r)}}},3328:(_,j,p)=>{const i=p(375),m=p(8571),f=p(5277),h=p(1447),t=p(8160),l=p(6354),o=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}};_.exports=r.Template=class{constructor(s,c){if(i(typeof s=="string","Template source must be a string"),i(!s.includes("\0")&&!s.includes(""),"Template source cannot contain reserved control characters"),this.source=s,this.rendered=s,this._template=null,c){const{functions:n,...a}=c;this._settings=Object.keys(a).length?m(a):void 0,this._functions=n,this._functions&&(i(Object.keys(this._functions).every(u=>typeof u=="string"),"Functions keys must be strings"),i(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 s=r.encode(this.source),c=r.split(s);let n=!1;const a=[],u=c.shift();u&&a.push(u);for(const g of c){const y=g[0]!=="{",k=y?"}":"}}",w=g.indexOf(k);if(w===-1||g[1]==="{"){a.push(`{${r.decode(g)}`);continue}let d=g.slice(y?0:1,w);const x=d[0]===":";x&&(d=d.slice(1));const b=this._ref(r.decode(d),{raw:y,wrapped:x});a.push(b),typeof b!="string"&&(n=!0);const S=g.slice(w+k.length);S&&a.push(r.decode(S))}n?this._template=a:this.rendered=a.join("")}static date(s,c){return r.dateFormat[c.dateFormat].call(s)}describe(s={}){if(!this._settings&&s.compact)return this.source;const c={template:this.source};return this._settings&&(c.options=this._settings),this._functions&&(c.functions=this._functions),c}static build(s){return new r.Template(s.template,s.options||s.functions?{...s.options,functions:s.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(s){return!!s&&!!s[t.symbols.template]}refs(){if(!this._template)return;const s=[];for(const c of this._template)typeof c!="string"&&s.push(...c.refs);return s}resolve(s,c,n,a){return this._template&&this._template.length===1?this._part(this._template[0],s,c,n,a,{}):this.render(s,c,n,a)}_part(s,...c){return s.ref?s.ref.resolve(...c):s.formula.evaluate(c)}render(s,c,n,a,u={}){if(!this.isDynamic())return this.rendered;const g=[];for(const y of this._template)if(typeof y=="string")g.push(y);else{const k=this._part(y,s,c,n,a,u),w=r.stringify(k,s,c,n,a,u);if(w!==void 0){const d=y.raw||(u.errors&&u.errors.escapeHtml)===!1?w:f(w);g.push(r.wrap(d,y.wrapped&&n.errors.wrap.label))}}return g.join("")}_ref(s,{raw:c,wrapped:n}){const a=[],u=y=>{const k=o.create(y,this._settings);return a.push(k),w=>{const d=k.resolve(...w);return d!==void 0?d:null}};try{const y=this._functions?{...r.functions,...this._functions}:r.functions;var g=new h.Parser(s,{reference:u,functions:y,constants:r.constants})}catch(y){throw y.message=`Invalid template variable "${s}" fails due to: ${y.message}`,y}if(g.single){if(g.single.type==="reference"){const y=a[0];return{ref:y,raw:c,refs:a,wrapped:n||y.type==="local"&&y.key==="label"}}return r.stringify(g.single.value)}return{formula:g,raw:c,refs:a}}toString(){return this.source}},r.Template.prototype[t.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(s){return s.replace(/\\(\{+)/g,(c,n)=>r.opens.slice(0,n.length)).replace(/\\(\}+)/g,(c,n)=>r.closes.slice(0,n.length))},r.decode=function(s){return s.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(s){const c=[];let n="";for(let a=0;a<s.length;++a){const u=s[a];if(u==="{"){let g="";for(;a+1<s.length&&s[a+1]==="{";)g+="{",++a;c.push(n),n=g}else n+=u}return c.push(n),c},r.wrap=function(s,c){return c?c.length===1?`${c}${s}${c}`:`${c[0]}${s}${c[1]}`:s},r.stringify=function(s,c,n,a,u,g={}){const y=typeof s,k=a&&a.errors&&a.errors.wrap||{};let w=!1;if(o.isRef(s)&&s.render&&(w=s.in,s=s.resolve(c,n,a,u,{in:s.in,...g})),s===null)return"null";if(y==="string")return r.wrap(s,g.arrayItems&&k.string);if(y==="number"||y==="function"||y==="symbol")return s.toString();if(y!=="object")return JSON.stringify(s);if(s instanceof Date)return r.Template.date(s,a);if(s instanceof Map){const x=[];for(const[b,S]of s.entries())x.push(`${b.toString()} -> ${S.toString()}`);s=x}if(!Array.isArray(s))return s.toString();const d=[];for(const x of s)d.push(r.stringify(x,c,n,a,u,{arrayItems:!0,...g}));return r.wrap(d.join(", "),!w&&k.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(s,c,n)=>s?c:n,length:s=>typeof s=="string"?s.length:s&&typeof s=="object"?Array.isArray(s)?s.length:Object.keys(s).length:null,msg(s){const[c,n,a,u,g]=this,y=g.messages;if(!y)return"";const k=l.template(c,y[0],s,n,a)||l.template(c,y[1],s,n,a);return k?k.render(c,n,a,u,g):""},number:s=>typeof s=="number"?s:typeof s=="string"?parseFloat(s):typeof s=="boolean"?s?1:0:s instanceof Date?s.getTime():null}},4946:(_,j,p)=>{const i=p(375),m=p(1687),f=p(8068),h=p(8160),t=p(3292),l=p(6354),o=p(6133),r={};_.exports=f.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:o.toSibling}},args:(s,...c)=>c.length===1&&Array.isArray(c[0])?s.try(...c[0]):s.try(...c),validate(s,c){const{schema:n,error:a,state:u,prefs:g}=c;if(n._flags.match){const k=[],w=[];for(let x=0;x<n.$_terms.matches.length;++x){const b=n.$_terms.matches[x],S=u.nest(b.schema,`match.${x}`);S.snapshot();const A=b.schema.$_validate(s,S,g);A.errors?(w.push(A.errors),S.restore()):(k.push(A.value),S.commit())}if(k.length===0)return{errors:a("alternatives.any",{details:w.map(x=>l.details(x,{override:!1}))})};if(n._flags.match==="one")return k.length===1?{value:k[0]}:{errors:a("alternatives.one")};if(k.length!==n.$_terms.matches.length)return{errors:a("alternatives.all",{details:w.map(x=>l.details(x,{override:!1}))})};const d=x=>x.$_terms.matches.some(b=>b.schema.type==="object"||b.schema.type==="alternatives"&&d(b.schema));return d(n)?{value:k.reduce((x,b)=>m(x,b,{mergeArrays:!1}))}:{value:k[k.length-1]}}const y=[];for(let k=0;k<n.$_terms.matches.length;++k){const w=n.$_terms.matches[k];if(w.schema){const b=u.nest(w.schema,`match.${k}`);b.snapshot();const S=w.schema.$_validate(s,b,g);if(!S.errors)return b.commit(),S;b.restore(),y.push({schema:w.schema,reports:S.errors});continue}const d=w.ref?w.ref.resolve(s,u,g):s,x=w.is?[w]:w.switch;for(let b=0;b<x.length;++b){const S=x[b],{is:A,then:P,otherwise:L}=S,D=`match.${k}${w.switch?"."+b:""}`;if(A.$_match(d,u.nest(A,`${D}.is`),g)){if(P)return P.$_validate(s,u.nest(P,`${D}.then`),g)}else if(L)return L.$_validate(s,u.nest(L,`${D}.otherwise`),g)}}return r.errors(y,c)},rules:{conditional:{method(s,c){i(!this._flags._endedSwitch,"Unreachable condition"),i(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),i(c.break===void 0,"Cannot use break option with alternatives conditional");const n=this.clone(),a=t.when(n,s,c),u=a.is?[a]:a.switch;for(const g of u)if(g.then&&g.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(a),n.$_mutateRebuild()}},match:{method(s){if(i(["any","one","all"].includes(s),"Invalid alternatives match mode",s),s!=="any")for(const c of this.$_terms.matches)i(c.schema,"Cannot combine match mode",s,"with conditional rules");return this.$_setFlag("match",s)}},try:{method(...s){i(s.length,"Missing alternative schemas"),h.verifyFlat(s,"try"),i(!this._flags._endedSwitch,"Unreachable condition");const c=this.clone();for(const n of s)c.$_terms.matches.push({schema:c.$_compile(n)});return c.$_mutateRebuild()}}},overrides:{label(s){return this.$_parent("label",s).$_modify({each:(c,n)=>n.path[0]!=="is"&&typeof c._flags.label!="string"?c.label(s):void 0,ref:!1})}},rebuild(s){s.$_modify({each:c=>{h.isSchema(c)&&c.type==="array"&&s.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(s,c){if(c.matches)for(const n of c.matches){const{schema:a,ref:u,is:g,not:y,then:k,otherwise:w}=n;s=a?s.try(a):u?s.conditional(u,{is:g,then:k,not:y,otherwise:w,switch:n.switch}):s.conditional(g,{then:k,otherwise:w})}return s}},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(s,{error:c,state:n}){if(!s.length)return{errors:c("alternatives.any")};if(s.length===1)return{errors:s[0].reports};const a=new Set,u=[];for(const{reports:g,schema:y}of s){if(g.length>1)return r.unmatched(s,c);const k=g[0];if(k instanceof l.Report==0)return r.unmatched(s,c);if(k.state.path.length!==n.path.length){u.push({type:y.type,report:k});continue}if(k.code==="any.only"){for(const x of k.local.valids)a.add(x);continue}const[w,d]=k.code.split(".");d!=="base"?u.push({type:y.type,report:k}):k.code==="object.base"?a.add(k.local.type):a.add(w)}return u.length?u.length===1?{errors:u[0].report}:r.unmatched(s,c):{errors:c("alternatives.types",{types:[...a]})}},r.unmatched=function(s,c){const n=[];for(const a of s)n.push(...a.reports);return{errors:c("alternatives.match",l.details(n,{override:!1}))}}},8068:(_,j,p)=>{const i=p(375),m=p(7629),f=p(8160),h=p(6914);_.exports=m.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(t,l){return i(typeof t=="function","Method must be a function"),i(l===void 0||l&&typeof l=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:l}})},validate(t,l,{method:o}){try{return o(t,l)}catch(r){return l.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){i(f.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");const l=this.clone();return l.$_terms.shared=l.$_terms.shared||[],l.$_terms.shared.push(t),l.$_mutateRegister(t),l}},warning:{method(t,l){return i(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:l},warn:!0})},validate:(t,l,{code:o,local:r})=>l.error(o,r),args:["code","local"],multi:!0}},modifiers:{keep(t,l=!0){t.keep=l},message(t,l){t.message=h.compile(l)},warn(t,l=!0){t.warn=l}},manifest:{build(t,l){for(const o in l){const r=l[o];if(["examples","externals","metas","notes","tags"].includes(o))for(const s of r)t=t[o.slice(0,-1)](s);else if(o!=="alterations")if(o!=="whens"){if(o==="shared")for(const s of r)t=t.shared(s)}else for(const s of r){const{ref:c,is:n,not:a,then:u,otherwise:g,concat:y}=s;t=y?t.concat(y):c?t.when(c,{is:n,not:a,then:u,otherwise:g,switch:s.switch,break:s.break}):t.when(n,{then:u,otherwise:g,break:s.break})}else{const s={};for(const{target:c,adjuster:n}of r)s[c]=n;t=t.alter(s)}}return t}},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,p)=>{const i=p(375),m=p(9474),f=p(9621),h=p(8068),t=p(8160),l=p(3292),o={};_.exports=h.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:s,state:c,prefs:n}){if(!Array.isArray(r))return;const a=s.$_getRule("sort");return a?o.sort(s,r,a.args.options,c,n):void 0}},validate(r,{schema:s,error:c}){if(!Array.isArray(r)){if(s._flags.single){const n=[r];return n[t.symbols.arraySingle]=!0,{value:n}}return{errors:c("array.base")}}if(s.$_getRule("items")||s.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const s=this.$_addRule({name:"has",args:{schema:r}});return s.$_mutateRegister(r),s},validate(r,{state:s,prefs:c,error:n},{schema:a}){const u=[r,...s.ancestors];for(let y=0;y<r.length;++y){const k=s.localize([...s.path,y],u,a);if(a.$_match(r[y],k,c))return r}const g=a._flags.label;return g?n("array.hasKnown",{patternLabel:g}):n("array.hasUnknown",null)},multi:!0},items:{method(...r){t.verifyFlat(r,"items");const s=this.$_addRule("items");for(let c=0;c<r.length;++c){const n=t.tryWithPath(()=>this.$_compile(r[c]),c,{append:!0});s.$_terms.items.push(n)}return s.$_mutateRebuild()},validate(r,{schema:s,error:c,state:n,prefs:a,errorsArray:u}){const g=s.$_terms._requireds.slice(),y=s.$_terms.ordered.slice(),k=[...s.$_terms._inclusions,...g],w=!r[t.symbols.arraySingle];delete r[t.symbols.arraySingle];const d=u();let x=r.length;for(let b=0;b<x;++b){const S=r[b];let A=!1,P=!1;const L=w?b:new Number(b),D=[...n.path,L];if(!s._flags.sparse&&S===void 0){if(d.push(c("array.sparse",{key:L,path:D,pos:b,value:void 0},n.localize(D))),a.abortEarly)return d;y.shift();continue}const N=[r,...n.ancestors];for(const z of s.$_terms._exclusions)if(z.$_match(S,n.localize(D,N,z),a,{presence:"ignore"})){if(d.push(c("array.excludes",{pos:b,value:S},n.localize(D))),a.abortEarly)return d;A=!0,y.shift();break}if(A)continue;if(s.$_terms.ordered.length){if(y.length){const z=y.shift(),F=z.$_validate(S,n.localize(D,N,z),a);if(F.errors){if(d.push(...F.errors),a.abortEarly)return d}else if(z._flags.result==="strip")o.fastSplice(r,b),--b,--x;else{if(!s._flags.sparse&&F.value===void 0){if(d.push(c("array.sparse",{key:L,path:D,pos:b,value:void 0},n.localize(D))),a.abortEarly)return d;continue}r[b]=F.value}continue}if(!s.$_terms.items.length){if(d.push(c("array.orderedLength",{pos:b,limit:s.$_terms.ordered.length})),a.abortEarly)return d;break}}const V=[];let B=g.length;for(let z=0;z<B;++z){const F=n.localize(D,N,g[z]);F.snapshot();const K=g[z].$_validate(S,F,a);if(V[z]=K,!K.errors){if(F.commit(),r[b]=K.value,P=!0,o.fastSplice(g,z),--z,--B,!s._flags.sparse&&K.value===void 0&&(d.push(c("array.sparse",{key:L,path:D,pos:b,value:void 0},n.localize(D))),a.abortEarly))return d;break}F.restore()}if(P)continue;const I=a.stripUnknown&&!!a.stripUnknown.arrays||!1;B=k.length;for(const z of k){let F;const K=g.indexOf(z);if(K!==-1)F=V[K];else{const he=n.localize(D,N,z);if(he.snapshot(),F=z.$_validate(S,he,a),!F.errors){he.commit(),z._flags.result==="strip"?(o.fastSplice(r,b),--b,--x):s._flags.sparse||F.value!==void 0?r[b]=F.value:(d.push(c("array.sparse",{key:L,path:D,pos:b,value:void 0},n.localize(D))),A=!0),P=!0;break}he.restore()}if(B===1){if(I){o.fastSplice(r,b),--b,--x,P=!0;break}if(d.push(...F.errors),a.abortEarly)return d;A=!0;break}}if(!A&&(s.$_terms._inclusions.length||s.$_terms._requireds.length)&&!P){if(I){o.fastSplice(r,b),--b,--x;continue}if(d.push(c("array.includes",{pos:b,value:S},n.localize(D))),a.abortEarly)return d}}return g.length&&o.fillMissedErrors(s,d,g,r,n,a),y.length&&(o.fillOrderedErrors(s,d,y,r,n,a),d.length||o.fillDefault(y,r,n,a)),d.length?d:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,s,{limit:c},{name:n,operator:a,args:u})=>t.compare(r.length,c,a)?r:s.error("array."+n,{limit:u.limit,value:r}),args:[{name:"limit",ref:!0,assert:t.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){t.verifyFlat(r,"ordered");const s=this.$_addRule("items");for(let c=0;c<r.length;++c){const n=t.tryWithPath(()=>this.$_compile(r[c]),c,{append:!0});o.validateSingle(n,s),s.$_mutateRegister(n),s.$_terms.ordered.push(n)}return s.$_mutateRebuild()}},single:{method(r){const s=r===void 0||!!r;return i(!s||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",s)}},sort:{method(r={}){t.assertOptions(r,["by","order"]);const s={order:r.order||"ascending"};return r.by&&(s.by=l.ref(r.by,{ancestor:0}),i(!s.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:s}})},validate(r,{error:s,state:c,prefs:n,schema:a},{options:u}){const{value:g,errors:y}=o.sort(a,r,u,c,n);if(y)return y;for(let k=0;k<r.length;++k)if(r[k]!==g[k])return s("array.sort",{order:u.order,by:u.by?u.by.key:"value"});return r},convert:!0},sparse:{method(r){const s=r===void 0||!!r;return this._flags.sparse===s?this:(s?this.clone():this.$_addRule("items")).$_setFlag("sparse",s,{clone:!1})}},unique:{method(r,s={}){i(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),t.assertOptions(s,["ignoreUndefined","separator"]);const c={name:"unique",args:{options:s,comparator:r}};if(r)if(typeof r=="string"){const n=t.default(s.separator,".");c.path=n?r.split(n):[r]}else c.comparator=r;return this.$_addRule(c)},validate(r,{state:s,error:c,schema:n},{comparator:a,options:u},{comparator:g,path:y}){const k={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},w=g||m,d=u.ignoreUndefined;for(let x=0;x<r.length;++x){const b=y?f(r[x],y):r[x],S=g?k.custom:k[typeof b];if(i(S,"Failed to find unique map container for type",typeof b),S instanceof Map){const A=S.entries();let P;for(;!(P=A.next()).done;)if(w(P.value[0],b)){const L=s.localize([...s.path,x],[r,...s.ancestors]),D={pos:x,value:r[x],dupePos:P.value[1],dupeValue:r[P.value[1]]};return y&&(D.path=a),c("array.unique",D,L)}S.set(b,x)}else{if((!d||b!==void 0)&&S[b]!==void 0){const A={pos:x,value:r[x],dupePos:S[b],dupeValue:r[S[b]]};return y&&(A.path=a),c("array.unique",A,s.localize([...s.path,x],[r,...s.ancestors]))}S[b]=x}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,s)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const s of r.$_terms.items)o.validateSingle(s,r),s._flags.presence==="required"?r.$_terms._requireds.push(s):s._flags.presence==="forbidden"?r.$_terms._exclusions.push(s):r.$_terms._inclusions.push(s);for(const s of r.$_terms.ordered)o.validateSingle(s,r)},manifest:{build:(r,s)=>(s.items&&(r=r.items(...s.items)),s.ordered&&(r=r.ordered(...s.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"}}),o.fillMissedErrors=function(r,s,c,n,a,u){const g=[];let y=0;for(const k of c){const w=k._flags.label;w?g.push(w):++y}g.length?y?s.push(r.$_createError("array.includesRequiredBoth",n,{knownMisses:g,unknownMisses:y},a,u)):s.push(r.$_createError("array.includesRequiredKnowns",n,{knownMisses:g},a,u)):s.push(r.$_createError("array.includesRequiredUnknowns",n,{unknownMisses:y},a,u))},o.fillOrderedErrors=function(r,s,c,n,a,u){const g=[];for(const y of c)y._flags.presence==="required"&&g.push(y);g.length&&o.fillMissedErrors(r,s,g,n,a,u)},o.fillDefault=function(r,s,c,n){const a=[];let u=!0;for(let g=r.length-1;g>=0;--g){const y=r[g],k=[s,...c.ancestors],w=y.$_validate(void 0,c.localize(c.path,k,y),n).value;if(u){if(w===void 0)continue;u=!1}a.unshift(w)}a.length&&s.push(...a)},o.fastSplice=function(r,s){let c=s;for(;c<r.length;)r[c++]=r[c];--r.length},o.validateSingle=function(r,s){(r.type==="array"||r._flags._arrayItems)&&(i(!s._flags.single,"Cannot specify array item with single rule enabled"),s.$_setFlag("_arrayItems",!0,{clone:!1}))},o.sort=function(r,s,c,n,a){const u=c.order==="ascending"?1:-1,g=-1*u,y=u,k=(w,d)=>{let x=o.compare(w,d,g,y);if(x!==null||(c.by&&(w=c.by.resolve(w,n,a),d=c.by.resolve(d,n,a)),x=o.compare(w,d,g,y),x!==null))return x;const b=typeof w;if(b!==typeof d)throw r.$_createError("array.sort.mismatching",s,null,n,a);if(b!=="number"&&b!=="string")throw r.$_createError("array.sort.unsupported",s,{type:b},n,a);return b==="number"?(w-d)*u:w<d?g:y};try{return{value:s.slice().sort(k)}}catch(w){return{errors:w}}},o.compare=function(r,s,c,n){return r===s?0:r===void 0?1:s===void 0?-1:r===null?n:s===null?c:null}},4937:(_,j,p)=>{const i=p(375),m=p(8068),f=p(8160),h=p(2036),t={isBool:function(l){return typeof l=="boolean"}};_.exports=m.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(l,{schema:o}){if(typeof l!="boolean"){if(typeof l=="string"){const r=o._flags.sensitive?l:l.toLowerCase();l=r==="true"||r!=="false"&&l}return typeof l!="boolean"&&(l=o.$_terms.truthy&&o.$_terms.truthy.has(l,null,null,!o._flags.sensitive)||(!o.$_terms.falsy||!o.$_terms.falsy.has(l,null,null,!o._flags.sensitive))&&l),{value:l}}},validate(l,{error:o}){if(typeof l!="boolean")return{value:l,errors:o("boolean.base")}},rules:{truthy:{method(...l){f.verifyFlat(l,"truthy");const o=this.clone();o.$_terms.truthy=o.$_terms.truthy||new h;for(let r=0;r<l.length;++r){const s=l[r];i(s!==void 0,"Cannot call truthy with undefined"),o.$_terms.truthy.add(s)}return o}},falsy:{method(...l){f.verifyFlat(l,"falsy");const o=this.clone();o.$_terms.falsy=o.$_terms.falsy||new h;for(let r=0;r<l.length;++r){const s=l[r];i(s!==void 0,"Cannot call falsy with undefined"),o.$_terms.falsy.add(s)}return o}},sensitive:{method(l=!0){return this.$_setFlag("sensitive",l)}}},cast:{number:{from:t.isBool,to:(l,o)=>l?1:0},string:{from:t.isBool,to:(l,o)=>l?"true":"false"}},manifest:{build:(l,o)=>(o.truthy&&(l=l.truthy(...o.truthy)),o.falsy&&(l=l.falsy(...o.falsy)),l)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(_,j,p)=>{const i=p(375),m=p(8068),f=p(8160),h=p(3328),t={isDate:function(l){return l instanceof Date}};_.exports=m.extend({type:"date",coerce:{from:["number","string"],method:(l,{schema:o})=>({value:t.parse(l,o._flags.format)||l})},validate(l,{schema:o,error:r,prefs:s}){if(l instanceof Date&&!isNaN(l.getTime()))return;const c=o._flags.format;return s.convert&&c&&typeof l=="string"?{value:l,errors:r("date.format",{format:c})}:{value:l,errors:r("date.base")}},rules:{compare:{method:!1,validate(l,o,{date:r},{name:s,operator:c,args:n}){const a=r==="now"?Date.now():r.getTime();return f.compare(l.getTime(),a,c)?l:o.error("date."+s,{limit:n.date,value:l})},args:[{name:"date",ref:!0,normalize:l=>l==="now"?l:t.parse(l),assert:l=>l!==null,message:"must have a valid date format"}]},format:{method(l){return i(["iso","javascript","unix"].includes(l),"Unknown date format",l),this.$_setFlag("format",l)}},greater:{method(l){return this.$_addRule({name:"greater",method:"compare",args:{date:l},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(l){return this.$_addRule({name:"less",method:"compare",args:{date:l},operator:"<"})}},max:{method(l){return this.$_addRule({name:"max",method:"compare",args:{date:l},operator:"<="})}},min:{method(l){return this.$_addRule({name:"min",method:"compare",args:{date:l},operator:">="})}},timestamp:{method(l="javascript"){return i(["javascript","unix"].includes(l),'"type" must be one of "javascript, unix"'),this.format(l)}}},cast:{number:{from:t.isDate,to:(l,o)=>l.getTime()},string:{from:t.isDate,to:(l,{prefs:o})=>h.date(l,o)}},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"}}),t.parse=function(l,o){if(l instanceof Date)return l;if(typeof l!="string"&&(isNaN(l)||!isFinite(l))||/^\s*$/.test(l))return null;if(o==="iso")return f.isIsoDate(l)?t.date(l.toString()):null;const r=l;if(typeof l=="string"&&/^[+-]?\d+(\.\d+)?$/.test(l)&&(l=parseFloat(l)),o){if(o==="javascript")return t.date(1*l);if(o==="unix")return t.date(1e3*l);if(typeof r=="string")return null}return t.date(l)},t.date=function(l){const o=new Date(l);return isNaN(o.getTime())?null:o}},390:(_,j,p)=>{const i=p(375),m=p(7824);_.exports=m.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(f){return i(Number.isSafeInteger(f)&&f>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:f}})},validate:(f,h,{n:t})=>f.length===t?f:h.error("function.arity",{n:t})},class:{method(){return this.$_addRule("class")},validate:(f,h)=>/^\s*class\s/.test(f.toString())?f:h.error("function.class",{value:f})},minArity:{method(f){return i(Number.isSafeInteger(f)&&f>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:f}})},validate:(f,h,{n:t})=>f.length>=t?f:h.error("function.minArity",{n:t})},maxArity:{method(f){return i(Number.isSafeInteger(f)&&f>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:f}})},validate:(f,h,{n:t})=>f.length<=t?f:h.error("function.maxArity",{n:t})}},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,p)=>{const i=p(978),m=p(375),f=p(8571),h=p(3652),t=p(8068),l=p(8160),o=p(3292),r=p(6354),s=p(6133),c=p(3328),n={renameDefaults:{alias:!1,multiple:!1,override:!1}};_.exports=t.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:(a,u)=>a.keys(u),validate(a,{schema:u,error:g,state:y,prefs:k}){if(!a||typeof a!==u.$_property("typeof")||Array.isArray(a))return{value:a,errors:g("object.base",{type:u.$_property("typeof")})};if(!(u.$_terms.renames||u.$_terms.dependencies||u.$_terms.keys||u.$_terms.patterns||u.$_terms.externals))return;a=n.clone(a,k);const w=[];if(u.$_terms.renames&&!n.rename(u,a,y,k,w))return{value:a,errors:w};if(!u.$_terms.keys&&!u.$_terms.patterns&&!u.$_terms.dependencies)return{value:a,errors:w};const d=new Set(Object.keys(a));if(u.$_terms.keys){const x=[a,...y.ancestors];for(const b of u.$_terms.keys){const S=b.key,A=a[S];d.delete(S);const P=y.localize([...y.path,S],x,b),L=b.schema.$_validate(A,P,k);if(L.errors){if(k.abortEarly)return{value:a,errors:L.errors};L.value!==void 0&&(a[S]=L.value),w.push(...L.errors)}else b.schema._flags.result==="strip"||L.value===void 0&&A!==void 0?delete a[S]:L.value!==void 0&&(a[S]=L.value)}}if(d.size||u._flags._hasPatternMatch){const x=n.unknown(u,a,d,w,y,k);if(x)return x}if(u.$_terms.dependencies)for(const x of u.$_terms.dependencies){if(x.key!==null&&n.isPresent(x.options)(x.key.resolve(a,y,k,null,{shadow:!1}))===!1)continue;const b=n.dependencies[x.rel](u,x,a,y,k);if(b){const S=u.$_createError(b.code,a,b.context,y,k);if(k.abortEarly)return{value:a,errors:S};w.push(S)}}return{value:a,errors:w}},rules:{and:{method(...a){return l.verifyFlat(a,"and"),n.dependency(this,"and",null,a)}},append:{method(a){return a==null||Object.keys(a).length===0?this:this.keys(a)}},assert:{method(a,u,g){c.isTemplate(a)||(a=o.ref(a)),m(g===void 0||typeof g=="string","Message must be a string"),u=this.$_compile(u,{appendPath:!0});const y=this.$_addRule({name:"assert",args:{subject:a,schema:u,message:g}});return y.$_mutateRegister(a),y.$_mutateRegister(u),y},validate(a,{error:u,prefs:g,state:y},{subject:k,schema:w,message:d}){const x=k.resolve(a,y,g),b=s.isRef(k)?k.absolute(y):[];return w.$_match(x,y.localize(b,[a,...y.ancestors],w),g)?a:u("object.assert",{subject:k,message:d})},args:["subject","schema","message"],multi:!0},instance:{method(a,u){return m(typeof a=="function","constructor must be a function"),u=u||a.name,this.$_addRule({name:"instance",args:{constructor:a,name:u}})},validate:(a,u,{constructor:g,name:y})=>a instanceof g?a:u.error("object.instance",{type:y,value:a}),args:["constructor","name"]},keys:{method(a){m(a===void 0||typeof a=="object","Object schema must be a valid object"),m(!l.isSchema(a),"Object schema cannot be a joi schema");const u=this.clone();if(a)if(Object.keys(a).length){u.$_terms.keys=u.$_terms.keys?u.$_terms.keys.filter(g=>!a.hasOwnProperty(g.key)):new n.Keys;for(const g in a)l.tryWithPath(()=>u.$_terms.keys.push({key:g,schema:this.$_compile(a[g])}),g)}else u.$_terms.keys=new n.Keys;else u.$_terms.keys=null;return u.$_mutateRebuild()}},length:{method(a){return this.$_addRule({name:"length",args:{limit:a},operator:"="})},validate:(a,u,{limit:g},{name:y,operator:k,args:w})=>l.compare(Object.keys(a).length,g,k)?a:u.error("object."+y,{limit:w.limit,value:a}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(a){return this.$_addRule({name:"max",method:"length",args:{limit:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"length",args:{limit:a},operator:">="})}},nand:{method(...a){return l.verifyFlat(a,"nand"),n.dependency(this,"nand",null,a)}},or:{method(...a){return l.verifyFlat(a,"or"),n.dependency(this,"or",null,a)}},oxor:{method(...a){return n.dependency(this,"oxor",null,a)}},pattern:{method(a,u,g={}){const y=a instanceof RegExp;y||(a=this.$_compile(a,{appendPath:!0})),m(u!==void 0,"Invalid rule"),l.assertOptions(g,["fallthrough","matches"]),y&&m(!a.flags.includes("g")&&!a.flags.includes("y"),"pattern should not use global or sticky mode"),u=this.$_compile(u,{appendPath:!0});const k=this.clone();k.$_terms.patterns=k.$_terms.patterns||[];const w={[y?"regex":"schema"]:a,rule:u};return g.matches&&(w.matches=this.$_compile(g.matches),w.matches.type!=="array"&&(w.matches=w.matches.$_root.array().items(w.matches)),k.$_mutateRegister(w.matches),k.$_setFlag("_hasPatternMatch",!0,{clone:!1})),g.fallthrough&&(w.fallthrough=!0),k.$_terms.patterns.push(w),k.$_mutateRegister(u),k}},ref:{method(){return this.$_addRule("ref")},validate:(a,u)=>s.isRef(a)?a:u.error("object.refType",{value:a})},regex:{method(){return this.$_addRule("regex")},validate:(a,u)=>a instanceof RegExp?a:u.error("object.regex",{value:a})},rename:{method(a,u,g={}){m(typeof a=="string"||a instanceof RegExp,"Rename missing the from argument"),m(typeof u=="string"||u instanceof c,"Invalid rename to argument"),m(u!==a,"Cannot rename key to same name:",a),l.assertOptions(g,["alias","ignoreUndefined","override","multiple"]);const y=this.clone();y.$_terms.renames=y.$_terms.renames||[];for(const k of y.$_terms.renames)m(k.from!==a,"Cannot rename the same key multiple times");return u instanceof c&&y.$_mutateRegister(u),y.$_terms.renames.push({from:a,to:u,options:i(n.renameDefaults,g)}),y}},schema:{method(a="any"){return this.$_addRule({name:"schema",args:{type:a}})},validate:(a,u,{type:g})=>!l.isSchema(a)||g!=="any"&&a.type!==g?u.error("object.schema",{type:g}):a},unknown:{method(a){return this.$_setFlag("unknown",a!==!1)}},with:{method(a,u,g={}){return n.dependency(this,"with",a,u,g)}},without:{method(a,u,g={}){return n.dependency(this,"without",a,u,g)}},xor:{method(...a){return l.verifyFlat(a,"xor"),n.dependency(this,"xor",null,a)}}},overrides:{default(a,u){return a===void 0&&(a=l.symbols.deepDefault),this.$_parent("default",a,u)}},rebuild(a){if(a.$_terms.keys){const u=new h.Sorter;for(const g of a.$_terms.keys)l.tryWithPath(()=>u.add(g,{after:g.schema.$_rootReferences(),group:g.key}),g.key);a.$_terms.keys=new n.Keys(...u.nodes)}},manifest:{build(a,u){if(u.keys&&(a=a.keys(u.keys)),u.dependencies)for(const{rel:g,key:y=null,peers:k,options:w}of u.dependencies)a=n.dependency(a,g,y,k,w);if(u.patterns)for(const{regex:g,schema:y,rule:k,fallthrough:w,matches:d}of u.patterns)a=a.pattern(g||y,k,{fallthrough:w,matches:d});if(u.renames)for(const{from:g,to:y,options:k}of u.renames)a=a.rename(g,y,k);return a}},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}}"}}),n.clone=function(a,u){if(typeof a=="object"){if(u.nonEnumerables)return f(a,{shallow:!0});const y=Object.create(Object.getPrototypeOf(a));return Object.assign(y,a),y}const g=function(...y){return a.apply(this,y)};return g.prototype=f(a.prototype),Object.defineProperty(g,"name",{value:a.name,writable:!1}),Object.defineProperty(g,"length",{value:a.length,writable:!1}),Object.assign(g,a),g},n.dependency=function(a,u,g,y,k){m(g===null||typeof g=="string",u,"key must be a strings"),k||(k=y.length>1&&typeof y[y.length-1]=="object"?y.pop():{}),l.assertOptions(k,["separator","isPresent"]),y=[].concat(y);const w=l.default(k.separator,"."),d=[];for(const b of y)m(typeof b=="string",u,"peers must be strings"),d.push(o.ref(b,{separator:w,ancestor:0,prefix:!1}));g!==null&&(g=o.ref(g,{separator:w,ancestor:0,prefix:!1}));const x=a.clone();return x.$_terms.dependencies=x.$_terms.dependencies||[],x.$_terms.dependencies.push(new n.Dependency(u,g,d,y,k)),x},n.dependencies={and(a,u,g,y,k){const w=[],d=[],x=u.peers.length,b=n.isPresent(u.options);for(const S of u.peers)b(S.resolve(g,y,k,null,{shadow:!1}))===!1?w.push(S.key):d.push(S.key);if(w.length!==x&&d.length!==x)return{code:"object.and",context:{present:d,presentWithLabels:n.keysToLabels(a,d),missing:w,missingWithLabels:n.keysToLabels(a,w)}}},nand(a,u,g,y,k){const w=[],d=n.isPresent(u.options);for(const S of u.peers)d(S.resolve(g,y,k,null,{shadow:!1}))&&w.push(S.key);if(w.length!==u.peers.length)return;const x=u.paths[0],b=u.paths.slice(1);return{code:"object.nand",context:{main:x,mainWithLabel:n.keysToLabels(a,x),peers:b,peersWithLabels:n.keysToLabels(a,b)}}},or(a,u,g,y,k){const w=n.isPresent(u.options);for(const d of u.peers)if(w(d.resolve(g,y,k,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:u.paths,peersWithLabels:n.keysToLabels(a,u.paths)}}},oxor(a,u,g,y,k){const w=[],d=n.isPresent(u.options);for(const b of u.peers)d(b.resolve(g,y,k,null,{shadow:!1}))&&w.push(b.key);if(!w.length||w.length===1)return;const x={peers:u.paths,peersWithLabels:n.keysToLabels(a,u.paths)};return x.present=w,x.presentWithLabels=n.keysToLabels(a,w),{code:"object.oxor",context:x}},with(a,u,g,y,k){const w=n.isPresent(u.options);for(const d of u.peers)if(w(d.resolve(g,y,k,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:u.key.key,mainWithLabel:n.keysToLabels(a,u.key.key),peer:d.key,peerWithLabel:n.keysToLabels(a,d.key)}}},without(a,u,g,y,k){const w=n.isPresent(u.options);for(const d of u.peers)if(w(d.resolve(g,y,k,null,{shadow:!1})))return{code:"object.without",context:{main:u.key.key,mainWithLabel:n.keysToLabels(a,u.key.key),peer:d.key,peerWithLabel:n.keysToLabels(a,d.key)}}},xor(a,u,g,y,k){const w=[],d=n.isPresent(u.options);for(const b of u.peers)d(b.resolve(g,y,k,null,{shadow:!1}))&&w.push(b.key);if(w.length===1)return;const x={peers:u.paths,peersWithLabels:n.keysToLabels(a,u.paths)};return w.length===0?{code:"object.missing",context:x}:(x.present=w,x.presentWithLabels=n.keysToLabels(a,w),{code:"object.xor",context:x})}},n.keysToLabels=function(a,u){return Array.isArray(u)?u.map(g=>a.$_mapLabels(g)):a.$_mapLabels(u)},n.isPresent=function(a){return typeof a.isPresent=="function"?a.isPresent:u=>u!==void 0},n.rename=function(a,u,g,y,k){const w={};for(const d of a.$_terms.renames){const x=[],b=typeof d.from!="string";if(b)for(const S in u){if(u[S]===void 0&&d.options.ignoreUndefined||S===d.to)continue;const A=d.from.exec(S);A&&x.push({from:S,to:d.to,match:A})}else!Object.prototype.hasOwnProperty.call(u,d.from)||u[d.from]===void 0&&d.options.ignoreUndefined||x.push(d);for(const S of x){const A=S.from;let P=S.to;if(P instanceof c&&(P=P.render(u,g,y,S.match)),A!==P){if(!d.options.multiple&&w[P]&&(k.push(a.$_createError("object.rename.multiple",u,{from:A,to:P,pattern:b},g,y)),y.abortEarly)||Object.prototype.hasOwnProperty.call(u,P)&&!d.options.override&&!w[P]&&(k.push(a.$_createError("object.rename.override",u,{from:A,to:P,pattern:b},g,y)),y.abortEarly))return!1;u[A]===void 0?delete u[P]:u[P]=u[A],w[P]=!0,d.options.alias||delete u[A]}}}return!0},n.unknown=function(a,u,g,y,k,w){if(a.$_terms.patterns){let d=!1;const x=a.$_terms.patterns.map(S=>{if(S.matches)return d=!0,[]}),b=[u,...k.ancestors];for(const S of g){const A=u[S],P=[...k.path,S];for(let L=0;L<a.$_terms.patterns.length;++L){const D=a.$_terms.patterns[L];if(D.regex){const B=D.regex.test(S);if(k.mainstay.tracer.debug(k,"rule",`pattern.${L}`,B?"pass":"error"),!B)continue}else if(!D.schema.$_match(S,k.nest(D.schema,`pattern.${L}`),w))continue;g.delete(S);const N=k.localize(P,b,{schema:D.rule,key:S}),V=D.rule.$_validate(A,N,w);if(V.errors){if(w.abortEarly)return{value:u,errors:V.errors};y.push(...V.errors)}if(D.matches&&x[L].push(S),u[S]=V.value,!D.fallthrough)break}}if(d)for(let S=0;S<x.length;++S){const A=x[S];if(!A)continue;const P=a.$_terms.patterns[S].matches,L=k.localize(k.path,b,P),D=P.$_validate(A,L,w);if(D.errors){const N=r.details(D.errors,{override:!1});N.matches=A;const V=a.$_createError("object.pattern.match",u,N,k,w);if(w.abortEarly)return{value:u,errors:V};y.push(V)}}}if(g.size&&(a.$_terms.keys||a.$_terms.patterns)){if(w.stripUnknown&&a._flags.unknown===void 0||w.skipFunctions){const d=!(!w.stripUnknown||w.stripUnknown!==!0&&!w.stripUnknown.objects);for(const x of g)d?(delete u[x],g.delete(x)):typeof u[x]=="function"&&g.delete(x)}if(!l.default(a._flags.unknown,w.allowUnknown))for(const d of g){const x=k.localize([...k.path,d],[]),b=a.$_createError("object.unknown",u[d],{child:d},x,w,{flags:!1});if(w.abortEarly)return{value:u,errors:b};y.push(b)}}},n.Dependency=class{constructor(a,u,g,y,k){this.rel=a,this.key=u,this.peers=g,this.paths=y,this.options=k}describe(){const a={rel:this.rel,peers:this.paths};return this.key!==null&&(a.key=this.key.key),this.peers[0].separator!=="."&&(a.options={...a.options,separator:this.peers[0].separator}),this.options.isPresent&&(a.options={...a.options,isPresent:this.options.isPresent}),a}},n.Keys=class extends Array{concat(a){const u=this.slice(),g=new Map;for(let y=0;y<u.length;++y)g.set(u[y].key,y);for(const y of a){const k=y.key,w=g.get(k);w!==void 0?u[w]={key:k,schema:u[w].schema.concat(y.schema)}:u.push(y)}return u}}},8785:(_,j,p)=>{const i=p(375),m=p(8068),f=p(8160),h=p(3292),t=p(6354),l={};_.exports=m.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(o,r)=>o.ref(r),validate(o,{schema:r,state:s,prefs:c}){i(r.$_terms.link,"Uninitialized link schema");const n=l.generate(r,o,s,c),a=r.$_terms.link[0].ref;return n.$_validate(o,s.nest(n,`link:${a.display}:${n.type}`),c)},generate:(o,r,s,c)=>l.generate(o,r,s,c),rules:{ref:{method(o){i(!this.$_terms.link,"Cannot reinitialize schema"),o=h.ref(o),i(o.type==="value"||o.type==="local","Invalid reference type:",o.type),i(o.type==="local"||o.ancestor==="root"||o.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:o}],r}},relative:{method(o=!0){return this.$_setFlag("relative",o)}}},overrides:{concat(o){i(this.$_terms.link,"Uninitialized link schema"),i(f.isSchema(o),"Invalid schema object"),i(o.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:o}),r.$_mutateRebuild()}},manifest:{build:(o,r)=>(i(r.link,"Invalid link description missing link"),o.ref(r.link))}}),l.generate=function(o,r,s,c){let n=s.mainstay.links.get(o);if(n)return n._generate(r,s,c).schema;const a=o.$_terms.link[0].ref,{perspective:u,path:g}=l.perspective(a,s);l.assert(u,"which is outside of schema boundaries",a,o,s,c);try{n=g.length?u.$_reach(g):u}catch{l.assert(!1,"to non-existing schema",a,o,s,c)}return l.assert(n.type!=="link","which is another link",a,o,s,c),o._flags.relative||s.mainstay.links.set(o,n),n._generate(r,s,c).schema},l.perspective=function(o,r){if(o.type==="local"){for(const{schema:s,key:c}of r.schemas){if((s._flags.id||c)===o.path[0])return{perspective:s,path:o.path.slice(1)};if(s.$_terms.shared){for(const n of s.$_terms.shared)if(n._flags.id===o.path[0])return{perspective:n,path:o.path.slice(1)}}}return{perspective:null,path:null}}return o.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:o.path}:{perspective:r.schemas[o.ancestor]&&r.schemas[o.ancestor].schema,path:o.path}},l.assert=function(o,r,s,c,n,a){o||i(!1,`"${t.label(c._flags,n,a)}" contains link reference "${s.display}" ${r}`)}},3832:(_,j,p)=>{const i=p(375),m=p(8068),f=p(8160),h={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){const l=t.toString(),o=l.indexOf("."),r=l.indexOf("e");return(o<0?0:(r<0?l.length:r)-o-1)+(r<0?0:Math.max(0,-parseInt(l.slice(r+1))))}};_.exports=m.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:l,error:o}){if(!t.match(h.numberRx))return;t=t.trim();const r={value:parseFloat(t)};if(r.value===0&&(r.value=0),!l._flags.unsafe)if(t.match(/e/i)){if(h.extractSignificantDigits(t)!==h.extractSignificantDigits(String(r.value)))return r.errors=o("number.unsafe"),r}else{const s=r.value.toString();if(s.match(/e/i))return r;if(s!==h.normalizeDecimal(t))return r.errors=o("number.unsafe"),r}return r}},validate(t,{schema:l,error:o,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:o("number.infinity")};if(!f.isNumber(t))return{value:t,errors:o("number.base")};const s={value:t};if(r.convert){const c=l.$_getRule("precision");if(c){const n=Math.pow(10,c.args.limit);s.value=Math.round(s.value*n)/n}}return s.value===0&&(s.value=0),!l._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(s.errors=o("number.unsafe")),s},rules:{compare:{method:!1,validate:(t,l,{limit:o},{name:r,operator:s,args:c})=>f.compare(t,o,s)?t:l.error("number."+r,{limit:c.limit,value:t}),args:[{name:"limit",ref:!0,assert:f.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(t,l)=>Math.trunc(t)-t==0?t:l.error("number.integer")},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){const l=typeof t=="number"?h.decimalPlaces(t):null,o=Math.pow(10,l);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:l,pfactor:o}})},validate:(t,l,{base:o,baseDecimalPlace:r,pfactor:s},c)=>h.decimalPlaces(t)>r?l.error("number.multiple",{multiple:c.args.base,value:t}):Math.round(s*t)%Math.round(s*o)==0?t:l.error("number.multiple",{multiple:c.args.base,value:t}),args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(t,l)=>Number.isSafeInteger(t)&&t>=0&&t<=65535?t:l.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(t){return i(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,l,{limit:o}){const r=t.toString().match(h.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=o?t:l.error("number.precision",{limit:o,value:t})},convert:!0},sign:{method(t){return i(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate:(t,l,{sign:o})=>o==="negative"&&t<0||o==="positive"&&t>0?t:l.error(`number.${o}`)},unsafe:{method(t=!0){return i(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to:(t,l)=>t.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"}}),h.extractSignificantDigits=function(t){return t.replace(h.exponentialPartRegex,"").replace(h.dotRegex,"").replace(h.trailingZerosRegex,"").replace(h.leadingSignAndZerosRegex,"")},h.normalizeDecimal=function(t){return(t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}},8966:(_,j,p)=>{const i=p(7824);_.exports=i.extend({type:"object",cast:{map:{from:m=>m&&typeof m=="object",to:(m,f)=>new Map(Object.entries(m))}}})},7417:(_,j,p)=>{const i=p(375),m=p(5380),f=p(1745),h=p(9959),t=p(6064),l=p(9926),o=p(5752),r=p(8068),s=p(8160),c={tlds:l instanceof Set&&{tlds:{allow:l,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:h.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"]};_.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(n,{schema:a,state:u,prefs:g}){const y=a.$_getRule("normalize");y&&(n=n.normalize(y.args.form));const k=a.$_getRule("case");k&&(n=k.args.direction==="upper"?n.toLocaleUpperCase():n.toLocaleLowerCase());const w=a.$_getRule("trim");if(w&&w.args.enabled&&(n=n.trim()),a.$_terms.replacements)for(const x of a.$_terms.replacements)n=n.replace(x.pattern,x.replacement);const d=a.$_getRule("hex");if(d&&d.args.options.byteAligned&&n.length%2!=0&&(n=`0${n}`),a.$_getRule("isoDate")){const x=c.isoDate(n);x&&(n=x)}if(a._flags.truncate){const x=a.$_getRule("max");if(x){let b=x.args.limit;if(s.isResolvable(b)&&(b=b.resolve(n,u,g),!s.limit(b)))return{value:n,errors:a.$_createError("any.ref",b,{ref:x.args.limit,arg:"limit",reason:"must be a positive integer"},u,g)};n=n.slice(0,b)}}return{value:n}}},validate(n,{schema:a,error:u}){if(typeof n!="string")return{value:n,errors:u("string.base")};if(n===""){const g=a.$_getRule("min");return g&&g.args.limit===0?void 0:{value:n,errors:u("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(n,a)=>/^[a-zA-Z0-9]+$/.test(n)?n:a.error("string.alphanum")},base64:{method(n={}){return s.assertOptions(n,["paddingRequired","urlSafe"]),n={urlSafe:!1,paddingRequired:!0,...n},i(typeof n.paddingRequired=="boolean","paddingRequired must be boolean"),i(typeof n.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:n}})},validate:(n,a,{options:u})=>c.base64Regex[u.paddingRequired][u.urlSafe].test(n)?n:a.error("string.base64")},case:{method(n){return i(["lower","upper"].includes(n),"Invalid case:",n),this.$_addRule({name:"case",args:{direction:n}})},validate:(n,a,{direction:u})=>u==="lower"&&n===n.toLocaleLowerCase()||u==="upper"&&n===n.toLocaleUpperCase()?n:a.error(`string.${u}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(n,a){let u=n.length,g=0,y=1;for(;u--;){const k=n.charAt(u)*y;g+=k-9*(k>9),y^=3}return g>0&&g%10==0?n:a.error("string.creditCard")}},dataUri:{method(n={}){return s.assertOptions(n,["paddingRequired"]),n={paddingRequired:!0,...n},i(typeof n.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:n}})},validate(n,a,{options:u}){const g=n.match(c.dataUriRegex);return g&&(!g[2]||g[2]!=="base64"||c.base64Regex[u.paddingRequired].false.test(g[3]))?n:a.error("string.dataUri")}},domain:{method(n){n&&s.assertOptions(n,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const a=c.addressOptions(n);return this.$_addRule({name:"domain",args:{options:n},address:a})},validate:(n,a,u,{address:g})=>m.isValid(n,g)?n:a.error("string.domain")},email:{method(n={}){s.assertOptions(n,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),i(n.multiple===void 0||typeof n.multiple=="boolean","multiple option must be an boolean");const a=c.addressOptions(n),u=new RegExp(`\\s*[${n.separator?t(n.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:n},regex:u,address:a})},validate(n,a,{options:u},{regex:g,address:y}){const k=u.multiple?n.split(g):[n],w=[];for(const d of k)f.isValid(d,y)||w.push(d);return w.length?a.error("string.email",{value:n,invalids:w}):n}},guid:{alias:"uuid",method(n={}){s.assertOptions(n,["version","separator"]);let a="";if(n.version){const y=[].concat(n.version);i(y.length>=1,"version must have at least 1 valid version specified");const k=new Set;for(let w=0;w<y.length;++w){const d=y[w];i(typeof d=="string","version at position "+w+" must be a string");const x=c.guidVersions[d.toLowerCase()];i(x,"version at position "+w+" must be one of "+Object.keys(c.guidVersions).join(", ")),i(!k.has(x),"version at position "+w+" must not be a duplicate"),a+=x,k.add(x)}}i(c.guidSeparators.has(n.separator),'separator must be one of true, false, "-", or ":"');const u=n.separator===void 0?"[:-]?":n.separator===!0?"[:-]":n.separator===!1?"[]?":`\\${n.separator}`,g=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${u})[0-9A-F]{4}\\2?[${a||"0-9A-F"}][0-9A-F]{3}\\2?[${a?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:n},regex:g})},validate(n,a,u,{regex:g}){const y=g.exec(n);return y?c.guidBrackets[y[1]]!==y[y.length-1]?a.error("string.guid"):n:a.error("string.guid")}},hex:{method(n={}){return s.assertOptions(n,["byteAligned","prefix"]),n={byteAligned:!1,prefix:!1,...n},i(typeof n.byteAligned=="boolean","byteAligned must be boolean"),i(typeof n.prefix=="boolean"||n.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:n}})},validate:(n,a,{options:u})=>(u.prefix==="optional"?c.hexRegex.withOptionalPrefix:u.prefix===!0?c.hexRegex.withPrefix:c.hexRegex.withoutPrefix).test(n)?u.byteAligned&&n.length%2!=0?a.error("string.hexAlign"):n:a.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(n,a)=>m.isValid(n,{minDomainSegments:1})||c.ipRegex.test(n)?n:a.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(n={}){s.assertOptions(n,["cidr","version"]);const{cidr:a,versions:u,regex:g}=h.regex(n),y=n.version?u:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:a,version:y}},regex:g})},validate:(n,a,{options:u},{regex:g})=>g.test(n)?n:u.version?a.error("string.ipVersion",{value:n,cidr:u.cidr,version:u.version}):a.error("string.ip",{value:n,cidr:u.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(n,{error:a})=>c.isoDate(n)?n:a("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(n,a)=>c.isoDurationRegex.test(n)?n:a.error("string.isoDuration")},length:{method(n,a){return c.length(this,"length",n,"=",a)},validate(n,a,{limit:u,encoding:g},{name:y,operator:k,args:w}){const d=!g&&n.length;return s.compare(d,u,k)?n:a.error("string."+y,{limit:w.limit,value:n,encoding:g})},args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(n,a){return c.length(this,"max",n,"<=",a)},args:["limit","encoding"]},min:{method(n,a){return c.length(this,"min",n,">=",a)},args:["limit","encoding"]},normalize:{method(n="NFC"){return i(c.normalizationForms.includes(n),"normalization form must be one of "+c.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:n}})},validate:(n,{error:a},{form:u})=>n===n.normalize(u)?n:a("string.normalize",{value:n,form:u}),convert:!0},pattern:{alias:"regex",method(n,a={}){i(n instanceof RegExp,"regex must be a RegExp"),i(!n.flags.includes("g")&&!n.flags.includes("y"),"regex should not use global or sticky mode"),typeof a=="string"&&(a={name:a}),s.assertOptions(a,["invert","name"]);const u=["string.pattern",a.invert?".invert":"",a.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:n,options:a},errorCode:u})},validate:(n,a,{regex:u,options:g},{errorCode:y})=>u.test(n)^g.invert?n:a.error(y,{name:g.name,regex:u,value:n}),args:["regex","options"],multi:!0},replace:{method(n,a){typeof n=="string"&&(n=new RegExp(t(n),"g")),i(n instanceof RegExp,"pattern must be a RegExp"),i(typeof a=="string","replacement must be a String");const u=this.clone();return u.$_terms.replacements||(u.$_terms.replacements=[]),u.$_terms.replacements.push({pattern:n,replacement:a}),u}},token:{method(){return this.$_addRule("token")},validate:(n,a)=>/^\w+$/.test(n)?n:a.error("string.token")},trim:{method(n=!0){return i(typeof n=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:n}})},validate:(n,a,{enabled:u})=>u&&n!==n.trim()?a.error("string.trim"):n,convert:!0},truncate:{method(n=!0){return i(typeof n=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",n)}},uppercase:{method(){return this.case("upper")}},uri:{method(n={}){s.assertOptions(n,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),n.domain&&s.assertOptions(n.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:a,scheme:u}=o.regex(n),g=n.domain?c.addressOptions(n.domain):null;return this.$_addRule({name:"uri",args:{options:n},regex:a,domain:g,scheme:u})},validate(n,a,{options:u},{regex:g,domain:y,scheme:k}){if(["http:/","https:/"].includes(n))return a.error("string.uri");let w=g.exec(n);if(!w&&a.prefs.convert&&u.encodeUri){const d=encodeURI(n);w=g.exec(d),w&&(n=d)}if(w){const d=w[1]||w[2];return!y||u.allowRelative&&!d||m.isValid(d,y)?n:a.error("string.domain",{value:d})}return u.relativeOnly?a.error("string.uriRelativeOnly"):u.scheme?a.error("string.uriCustomScheme",{scheme:k,value:n}):a.error("string.uri")}}},manifest:{build(n,a){if(a.replacements)for(const{pattern:u,replacement:g}of a.replacements)n=n.replace(u,g);return n}},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"}}),c.addressOptions=function(n){if(!n)return c.tlds||n;if(i(n.minDomainSegments===void 0||Number.isSafeInteger(n.minDomainSegments)&&n.minDomainSegments>0,"minDomainSegments must be a positive integer"),i(n.maxDomainSegments===void 0||Number.isSafeInteger(n.maxDomainSegments)&&n.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),n.tlds===!1)return n;if(n.tlds===!0||n.tlds===void 0)return i(c.tlds,"Built-in TLD list disabled"),Object.assign({},n,c.tlds);i(typeof n.tlds=="object","tlds must be true, false, or an object");const a=n.tlds.deny;if(a)return Array.isArray(a)&&(n=Object.assign({},n,{tlds:{deny:new Set(a)}})),i(n.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),i(!n.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),c.validateTlds(n.tlds.deny,"tlds.deny"),n;const u=n.tlds.allow;return u?u===!0?(i(c.tlds,"Built-in TLD list disabled"),Object.assign({},n,c.tlds)):(Array.isArray(u)&&(n=Object.assign({},n,{tlds:{allow:new Set(u)}})),i(n.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),c.validateTlds(n.tlds.allow,"tlds.allow"),n):n},c.validateTlds=function(n,a){for(const u of n)i(m.isValid(u,{minDomainSegments:1,maxDomainSegments:1}),`${a} must contain valid top level domain names`)},c.isoDate=function(n){if(!s.isIsoDate(n))return null;/.*T.*[+-]\d\d$/.test(n)&&(n+="00");const a=new Date(n);return isNaN(a.getTime())?null:a.toISOString()},c.length=function(n,a,u,g,y){return i(!y||!1,"Invalid encoding:",y),n.$_addRule({name:a,method:"length",args:{limit:u,encoding:y},operator:g})}},8826:(_,j,p)=>{const i=p(375),m=p(8068),f={};f.Map=class extends Map{slice(){return new f.Map(this)}},_.exports=m.extend({type:"symbol",terms:{map:{init:new f.Map}},coerce:{method(h,{schema:t,error:l}){const o=t.$_terms.map.get(h);return o&&(h=o),t._flags.only&&typeof h!="symbol"?{value:h,errors:l("symbol.map",{map:t.$_terms.map})}:{value:h}}},validate(h,{error:t}){if(typeof h!="symbol")return{value:h,errors:t("symbol.base")}},rules:{map:{method(h){h&&!h[Symbol.iterator]&&typeof h=="object"&&(h=Object.entries(h)),i(h&&h[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),l=[];for(const o of h){i(o&&o[Symbol.iterator],"Entry must be an iterable");const[r,s]=o;i(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),i(typeof s=="symbol","Value must be a Symbol"),t.$_terms.map.set(r,s),l.push(s)}return t.valid(...l)}}},manifest:{build:(h,t)=>(t.map&&(h=h.map(t.map)),h)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(_,j,p)=>{const i=p(375),m=p(8571),f=p(738),h=p(9621),t=p(8160),l=p(6354),o=p(493),r={result:Symbol("result")};j.entry=function(s,c,n){let a=t.defaults;n&&(i(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),i(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),a=t.preferences(t.defaults,n));const u=r.entry(s,c,a);i(!u.mainstay.externals.length,"Schema with external rules must use validateAsync()");const g={value:u.value};return u.error&&(g.error=u.error),u.mainstay.warnings.length&&(g.warning=l.details(u.mainstay.warnings)),u.mainstay.debug&&(g.debug=u.mainstay.debug),u.mainstay.artifacts&&(g.artifacts=u.mainstay.artifacts),g},j.entryAsync=async function(s,c,n){let a=t.defaults;n&&(a=t.preferences(t.defaults,n));const u=r.entry(s,c,a),g=u.mainstay;if(u.error)throw g.debug&&(u.error.debug=g.debug),u.error;if(g.externals.length){let k=u.value;const w=[];for(const d of g.externals){const x=d.state.path,b=d.schema.type==="link"?g.links.get(d.schema):null;let S,A,P=k;const L=x.length?[k]:[],D=x.length?h(s,x):s;if(x.length){S=x[x.length-1];let N=k;for(const V of x.slice(0,-1))N=N[V],L.unshift(N);A=L[0],P=A[S]}try{const N=(B,I)=>(b||d.schema).$_createError(B,P,I,d.state,a),V=await d.method(P,{schema:d.schema,linked:b,state:d.state,prefs:n,original:D,error:N,errorsArray:r.errorsArray,warn:(B,I)=>g.warnings.push((b||d.schema).$_createError(B,P,I,d.state,a)),message:(B,I)=>(b||d.schema).$_createError("external",P,I,d.state,a,{messages:B})});if(V===void 0||V===P)continue;if(V instanceof l.Report){if(g.tracer.log(d.schema,d.state,"rule","external","error"),w.push(V),a.abortEarly)break;continue}if(Array.isArray(V)&&V[t.symbols.errors]){if(g.tracer.log(d.schema,d.state,"rule","external","error"),w.push(...V),a.abortEarly)break;continue}A?(g.tracer.value(d.state,"rule",P,V,"external"),A[S]=V):(g.tracer.value(d.state,"rule",k,V,"external"),k=V)}catch(N){throw a.errors.label&&(N.message+=` (${d.label})`),N}}if(u.value=k,w.length)throw u.error=l.process(w,s,a),g.debug&&(u.error.debug=g.debug),u.error}if(!a.warnings&&!a.debug&&!a.artifacts)return u.value;const y={value:u.value};return g.warnings.length&&(y.warning=l.details(g.warnings)),g.debug&&(y.debug=g.debug),g.artifacts&&(y.artifacts=g.artifacts),y},r.Mainstay=class{constructor(s,c,n){this.externals=[],this.warnings=[],this.tracer=s,this.debug=c,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const s=this._snapshots.pop();this.externals=s.externals,this.warnings=s.warnings}commit(){this._snapshots.pop()}},r.entry=function(s,c,n){const{tracer:a,cleanup:u}=r.tracer(c,n),g=n.debug?[]:null,y=c._ids._schemaChain?new Map:null,k=new r.Mainstay(a,g,y),w=c._ids._schemaChain?[{schema:c}]:null,d=new o([],[],{mainstay:k,schemas:w}),x=j.validate(s,c,d,n);u&&c.$_root.untrace();const b=l.process(x.errors,s,n);return{value:x.value,error:b,mainstay:k}},r.tracer=function(s,c){return s.$_root._tracer?{tracer:s.$_root._tracer._register(s)}:c.debug?(i(s.$_root.trace,"Debug mode not supported"),{tracer:s.$_root.trace()._register(s),cleanup:!0}):{tracer:r.ignore}},j.validate=function(s,c,n,a,u={}){if(c.$_terms.whens&&(c=c._generate(s,n,a).schema),c._preferences&&(a=r.prefs(c,a)),c._cache&&a.cache){const b=c._cache.get(s);if(n.mainstay.tracer.debug(n,"validate","cached",!!b),b)return b}const g=(b,S,A)=>c.$_createError(b,s,S,A||n,a),y={original:s,prefs:a,schema:c,state:n,error:g,errorsArray:r.errorsArray,warn:(b,S,A)=>n.mainstay.warnings.push(g(b,S,A)),message:(b,S)=>c.$_createError("custom",s,S,n,a,{messages:b})};n.mainstay.tracer.entry(c,n);const k=c._definition;if(k.prepare&&s!==void 0&&a.convert){const b=k.prepare(s,y);if(b){if(n.mainstay.tracer.value(n,"prepare",s,b.value),b.errors)return r.finalize(b.value,[].concat(b.errors),y);s=b.value}}if(k.coerce&&s!==void 0&&a.convert&&(!k.coerce.from||k.coerce.from.includes(typeof s))){const b=k.coerce.method(s,y);if(b){if(n.mainstay.tracer.value(n,"coerced",s,b.value),b.errors)return r.finalize(b.value,[].concat(b.errors),y);s=b.value}}const w=c._flags.empty;w&&w.$_match(r.trim(s,c),n.nest(w),t.defaults)&&(n.mainstay.tracer.value(n,"empty",s,void 0),s=void 0);const d=u.presence||c._flags.presence||(c._flags._endedSwitch?null:a.presence);if(s===void 0){if(d==="forbidden")return r.finalize(s,null,y);if(d==="required")return r.finalize(s,[c.$_createError("any.required",s,null,n,a)],y);if(d==="optional"){if(c._flags.default!==t.symbols.deepDefault)return r.finalize(s,null,y);n.mainstay.tracer.value(n,"default",s,{}),s={}}}else if(d==="forbidden")return r.finalize(s,[c.$_createError("any.unknown",s,null,n,a)],y);const x=[];if(c._valids){const b=c._valids.get(s,n,a,c._flags.insensitive);if(b)return a.convert&&(n.mainstay.tracer.value(n,"valids",s,b.value),s=b.value),n.mainstay.tracer.filter(c,n,"valid",b),r.finalize(s,null,y);if(c._flags.only){const S=c.$_createError("any.only",s,{valids:c._valids.values({display:!0})},n,a);if(a.abortEarly)return r.finalize(s,[S],y);x.push(S)}}if(c._invalids){const b=c._invalids.get(s,n,a,c._flags.insensitive);if(b){n.mainstay.tracer.filter(c,n,"invalid",b);const S=c.$_createError("any.invalid",s,{invalids:c._invalids.values({display:!0})},n,a);if(a.abortEarly)return r.finalize(s,[S],y);x.push(S)}}if(k.validate){const b=k.validate(s,y);if(b&&(n.mainstay.tracer.value(n,"base",s,b.value),s=b.value,b.errors)){if(!Array.isArray(b.errors))return x.push(b.errors),r.finalize(s,x,y);if(b.errors.length)return x.push(...b.errors),r.finalize(s,x,y)}}return c._rules.length?r.rules(s,x,y):r.finalize(s,x,y)},r.rules=function(s,c,n){const{schema:a,state:u,prefs:g}=n;for(const y of a._rules){const k=a._definition.rules[y.method];if(k.convert&&g.convert){u.mainstay.tracer.log(a,u,"rule",y.name,"full");continue}let w,d=y.args;if(y._resolve.length){d=Object.assign({},d);for(const b of y._resolve){const S=k.argsByName.get(b),A=d[b].resolve(s,u,g),P=S.normalize?S.normalize(A):A,L=t.validateArg(P,null,S);if(L){w=a.$_createError("any.ref",A,{arg:b,ref:d[b],reason:L},u,g);break}d[b]=P}}w=w||k.validate(s,n,d,y);const x=r.rule(w,y);if(x.errors){if(u.mainstay.tracer.log(a,u,"rule",y.name,"error"),y.warn){u.mainstay.warnings.push(...x.errors);continue}if(g.abortEarly)return r.finalize(s,x.errors,n);c.push(...x.errors)}else u.mainstay.tracer.log(a,u,"rule",y.name,"pass"),u.mainstay.tracer.value(u,"rule",s,x.value,y.name),s=x.value}return r.finalize(s,c,n)},r.rule=function(s,c){return s instanceof l.Report?(r.error(s,c),{errors:[s],value:null}):Array.isArray(s)&&s[t.symbols.errors]?(s.forEach(n=>r.error(n,c)),{errors:s,value:null}):{errors:null,value:s}},r.error=function(s,c){return c.message&&s._setTemplate(c.message),s},r.finalize=function(s,c,n){c=c||[];const{schema:a,state:u,prefs:g}=n;if(c.length){const k=r.default("failover",void 0,c,n);k!==void 0&&(u.mainstay.tracer.value(u,"failover",s,k),s=k,c=[])}if(c.length&&a._flags.error)if(typeof a._flags.error=="function"){c=a._flags.error(c),Array.isArray(c)||(c=[c]);for(const k of c)i(k instanceof Error||k instanceof l.Report,"error() must return an Error object")}else c=[a._flags.error];if(s===void 0){const k=r.default("default",s,c,n);u.mainstay.tracer.value(u,"default",s,k),s=k}if(a._flags.cast&&s!==void 0){const k=a._definition.cast[a._flags.cast];if(k.from(s)){const w=k.to(s,n);u.mainstay.tracer.value(u,"cast",s,w,a._flags.cast),s=w}}if(a.$_terms.externals&&g.externals&&g._externals!==!1)for(const{method:k}of a.$_terms.externals)u.mainstay.externals.push({method:k,schema:a,state:u,label:l.label(a._flags,u,g)});const y={value:s,errors:c.length?c:null};return a._flags.result&&(y.value=a._flags.result==="strip"?void 0:n.original,u.mainstay.tracer.value(u,a._flags.result,s,y.value),u.shadow(s,a._flags.result)),a._cache&&g.cache!==!1&&!a._refs.length&&a._cache.set(n.original,y),s===void 0||y.errors||a._flags.artifact===void 0||(u.mainstay.artifacts=u.mainstay.artifacts||new Map,u.mainstay.artifacts.has(a._flags.artifact)||u.mainstay.artifacts.set(a._flags.artifact,[]),u.mainstay.artifacts.get(a._flags.artifact).push(u.path)),y},r.prefs=function(s,c){const n=c===t.defaults;return n&&s._preferences[t.symbols.prefs]?s._preferences[t.symbols.prefs]:(c=t.preferences(c,s._preferences),n&&(s._preferences[t.symbols.prefs]=c),c)},r.default=function(s,c,n,a){const{schema:u,state:g,prefs:y}=a,k=u._flags[s];if(y.noDefaults||k===void 0)return c;if(g.mainstay.tracer.log(u,g,"rule",s,"full"),!k)return k;if(typeof k=="function"){const w=k.length?[m(g.ancestors[0]),a]:[];try{return k(...w)}catch(d){return void n.push(u.$_createError(`any.${s}`,null,{error:d},g,y))}}return typeof k!="object"?k:k[t.symbols.literal]?k.literal:t.isResolvable(k)?k.resolve(c,g,y):m(k)},r.trim=function(s,c){if(typeof s!="string")return s;const n=c.$_getRule("trim");return n&&n.args.enabled?s.trim():s},r.ignore={active:!1,debug:f,entry:f,filter:f,log:f,resolve:f,value:f},r.errorsArray=function(){const s=[];return s[t.symbols.errors]=!0,s}},2036:(_,j,p)=>{const i=p(375),m=p(9474),f=p(8160),h={};_.exports=h.Values=class{constructor(t,l){this._values=new Set(t),this._refs=new Set(l),this._lowercase=h.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,l){f.isResolvable(t)?this._refs.has(t)||(this._refs.add(t),l&&l.register(t)):this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,l,o){if(t=t||new h.Values,l){if(l._override)return l.clone();for(const r of[...l._values,...l._refs])t.add(r)}if(o)for(const r of[...o._values,...o._refs])t.remove(r);return t.length?t:null}remove(t){f.isResolvable(t)?this._refs.delete(t):(this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase()))}has(t,l,o,r){return!!this.get(t,l,o,r)}get(t,l,o,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){const s=this._lowercase.get(t.toLowerCase());if(s)return{value:s}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(const s of this._values)if(m(s,t))return{value:s}}if(l)for(const s of this._refs){const c=s.resolve(t,l,o,null,{in:!0});if(c===void 0)continue;const n=s.in&&typeof c=="object"?Array.isArray(c)?c:Object.keys(c):[c];for(const a of n)if(typeof a==typeof t){if(r&&t&&typeof t=="string"){if(a.toLowerCase()===t.toLowerCase())return{value:a,ref:s}}else if(m(a,t))return{value:a,ref:s}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){const l=[];for(const o of[...this._values,...this._refs])o!==void 0&&l.push(o);return l}return Array.from([...this._values,...this._refs])}clone(){const t=new h.Values(this._values,this._refs);return t._override=this._override,t}concat(t){i(!t._override,"Cannot concat override set of values");const l=new h.Values([...this._values,...t._values],[...this._refs,...t._refs]);return l._override=this._override,l}describe(){const t=[];this._override&&t.push({override:!0});for(const l of this._values.values())t.push(l&&typeof l=="object"?{value:l}:l);for(const l of this._refs.values())t.push(l.describe());return t}},h.Values.prototype[f.symbols.values]=!0,h.Values.prototype.slice=h.Values.prototype.clone,h.lowercases=function(t){const l=new Map;if(t)for(const o of t)typeof o=="string"&&l.set(o.toLowerCase(),o);return l}},978:(_,j,p)=>{const i=p(375),m=p(8571),f=p(1687),h=p(9621),t={};_.exports=function(l,o,r={}){if(i(l&&typeof l=="object","Invalid defaults value: must be an object"),i(!o||o===!0||typeof o=="object","Invalid source value: must be true, falsy or an object"),i(typeof r=="object","Invalid options: must be an object"),!o)return null;if(r.shallow)return t.applyToDefaultsWithShallow(l,o,r);const s=m(l);if(o===!0)return s;const c=r.nullOverride!==void 0&&r.nullOverride;return f(s,o,{nullOverride:c,mergeArrays:!1})},t.applyToDefaultsWithShallow=function(l,o,r){const s=r.shallow;i(Array.isArray(s),"Invalid keys");const c=new Map,n=o===!0?null:new Set;for(let g of s){g=Array.isArray(g)?g:g.split(".");const y=h(l,g);y&&typeof y=="object"?c.set(y,n&&h(o,g)||y):n&&n.add(g)}const a=m(l,{},c);if(!n)return a;for(const g of n)t.reachCopy(a,o,g);const u=r.nullOverride!==void 0&&r.nullOverride;return f(a,o,{nullOverride:u,mergeArrays:!1})},t.reachCopy=function(l,o,r){for(const n of r){if(!(n in o))return;const a=o[n];if(typeof a!="object"||a===null)return;o=a}const s=o;let c=l;for(let n=0;n<r.length-1;++n){const a=r[n];typeof c[a]!="object"&&(c[a]={}),c=c[a]}c[r[r.length-1]]=s}},375:(_,j,p)=>{const i=p(7916);_.exports=function(m,...f){if(!m)throw f.length===1&&f[0]instanceof Error?f[0]:new i(f)}},8571:(_,j,p)=>{const i=p(9621),m=p(4277),f=p(7043),h={needsProtoHack:new Set([m.set,m.map,m.weakSet,m.weakMap])};_.exports=h.clone=function(t,l={},o=null){if(typeof t!="object"||t===null)return t;let r=h.clone,s=o;if(l.shallow){if(l.shallow!==!0)return h.cloneWithShallow(t,l);r=u=>u}else if(s){const u=s.get(t);if(u)return u}else s=new Map;const c=m.getInternalProto(t);if(c===m.buffer)return!1;if(c===m.date)return new Date(t.getTime());if(c===m.regex)return new RegExp(t);const n=h.base(t,c,l);if(n===t)return t;if(s&&s.set(t,n),c===m.set)for(const u of t)n.add(r(u,l,s));else if(c===m.map)for(const[u,g]of t)n.set(u,r(g,l,s));const a=f.keys(t,l);for(const u of a){if(u==="__proto__")continue;if(c===m.array&&u==="length"){n.length=t.length;continue}const g=Object.getOwnPropertyDescriptor(t,u);g?g.get||g.set?Object.defineProperty(n,u,g):g.enumerable?n[u]=r(t[u],l,s):Object.defineProperty(n,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],l,s)}):Object.defineProperty(n,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],l,s)})}return n},h.cloneWithShallow=function(t,l){const o=l.shallow;(l=Object.assign({},l)).shallow=!1;const r=new Map;for(const s of o){const c=i(t,s);typeof c!="object"&&typeof c!="function"||r.set(c,c)}return h.clone(t,l,r)},h.base=function(t,l,o){if(o.prototype===!1)return h.needsProtoHack.has(l)?new l.constructor:l===m.array?[]:{};const r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(l===m.array){const s=[];return r!==l&&Object.setPrototypeOf(s,r),s}if(h.needsProtoHack.has(l)){const s=new r.constructor;return r!==l&&Object.setPrototypeOf(s,r),s}return Object.create(r)}},9474:(_,j,p)=>{const i=p(4277),m={mismatched:null};_.exports=function(f,h,t){return t=Object.assign({prototype:!0},t),!!m.isDeepEqual(f,h,t,[])},m.isDeepEqual=function(f,h,t,l){if(f===h)return f!==0||1/f==1/h;const o=typeof f;if(o!==typeof h||f===null||h===null)return!1;if(o==="function"){if(!t.deepFunction||f.toString()!==h.toString())return!1}else if(o!=="object")return f!=f&&h!=h;const r=m.getSharedType(f,h,!!t.prototype);switch(r){case i.buffer:return!1;case i.promise:return f===h;case i.regex:return f.toString()===h.toString();case m.mismatched:return!1}for(let s=l.length-1;s>=0;--s)if(l[s].isSame(f,h))return!0;l.push(new m.SeenEntry(f,h));try{return!!m.isDeepEqualObj(r,f,h,t,l)}finally{l.pop()}},m.getSharedType=function(f,h,t){if(t)return Object.getPrototypeOf(f)!==Object.getPrototypeOf(h)?m.mismatched:i.getInternalProto(f);const l=i.getInternalProto(f);return l!==i.getInternalProto(h)?m.mismatched:l},m.valueOf=function(f){const h=f.valueOf;if(h===void 0)return f;try{return h.call(f)}catch(t){return t}},m.hasOwnEnumerableProperty=function(f,h){return Object.prototype.propertyIsEnumerable.call(f,h)},m.isSetSimpleEqual=function(f,h){for(const t of Set.prototype.values.call(f))if(!Set.prototype.has.call(h,t))return!1;return!0},m.isDeepEqualObj=function(f,h,t,l,o){const{isDeepEqual:r,valueOf:s,hasOwnEnumerableProperty:c}=m,{keys:n,getOwnPropertySymbols:a}=Object;if(f===i.array){if(!l.part){if(h.length!==t.length)return!1;for(let w=0;w<h.length;++w)if(!r(h[w],t[w],l,o))return!1;return!0}for(const w of h)for(const d of t)if(r(w,d,l,o))return!0}else if(f===i.set){if(h.size!==t.size)return!1;if(!m.isSetSimpleEqual(h,t)){const w=new Set(Set.prototype.values.call(t));for(const d of Set.prototype.values.call(h)){if(w.delete(d))continue;let x=!1;for(const b of w)if(r(d,b,l,o)){w.delete(b),x=!0;break}if(!x)return!1}}}else if(f===i.map){if(h.size!==t.size)return!1;for(const[w,d]of Map.prototype.entries.call(h))if(d===void 0&&!Map.prototype.has.call(t,w)||!r(d,Map.prototype.get.call(t,w),l,o))return!1}else if(f===i.error&&(h.name!==t.name||h.message!==t.message))return!1;const u=s(h),g=s(t);if((h!==u||t!==g)&&!r(u,g,l,o))return!1;const y=n(h);if(!l.part&&y.length!==n(t).length&&!l.skip)return!1;let k=0;for(const w of y)if(l.skip&&l.skip.includes(w))t[w]===void 0&&++k;else if(!c(t,w)||!r(h[w],t[w],l,o))return!1;if(!l.part&&y.length-k!==n(t).length)return!1;if(l.symbols!==!1){const w=a(h),d=new Set(a(t));for(const x of w){if(!l.skip||!l.skip.includes(x)){if(c(h,x)){if(!c(t,x)||!r(h[x],t[x],l,o))return!1}else if(c(t,x))return!1}d.delete(x)}for(const x of d)if(c(t,x))return!1}return!0},m.SeenEntry=class{constructor(f,h){this.obj=f,this.ref=h}isSame(f,h){return this.obj===f&&this.ref===h}}},7916:(_,j,p)=>{const i=p(8761);_.exports=class extends Error{constructor(m){super(m.filter(f=>f!=="").map(f=>typeof f=="string"?f:f instanceof Error?f.message:i(f)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,j.assert)}}},5277:_=>{const j={};_.exports=function(p){if(!p)return"";let i="";for(let m=0;m<p.length;++m){const f=p.charCodeAt(m);j.isSafe(f)?i+=p[m]:i+=j.escapeHtmlChar(f)}return i},j.escapeHtmlChar=function(p){return j.namedHtml.get(p)||(p>=256?"&#"+p+";":`&#x${p.toString(16).padStart(2,"0")};`)},j.isSafe=function(p){return j.safeCharCodes.has(p)},j.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),j.safeCharCodes=function(){const p=new Set;for(let i=32;i<123;++i)(i>=97||i>=65&&i<=90||i>=48&&i<=57||i===32||i===46||i===44||i===45||i===58||i===95)&&p.add(i);return p}()},6064:_=>{_.exports=function(j){return j.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:_=>{_.exports=function(){}},1687:(_,j,p)=>{const i=p(375),m=p(8571),f=p(7043),h={};_.exports=h.merge=function(t,l,o){if(i(t&&typeof t=="object","Invalid target value: must be an object"),i(l==null||typeof l=="object","Invalid source value: must be null, undefined, or an object"),!l)return t;if(o=Object.assign({nullOverride:!0,mergeArrays:!0},o),Array.isArray(l)){i(Array.isArray(t),"Cannot merge array onto an object"),o.mergeArrays||(t.length=0);for(let s=0;s<l.length;++s)t.push(m(l[s],{symbols:o.symbols}));return t}const r=f.keys(l,o);for(let s=0;s<r.length;++s){const c=r[s];if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(l,c))continue;const n=l[c];if(n&&typeof n=="object"){if(t[c]===n)continue;!t[c]||typeof t[c]!="object"||Array.isArray(t[c])!==Array.isArray(n)||n instanceof Date||n instanceof RegExp?t[c]=m(n,{symbols:o.symbols}):h.merge(t[c],n,o)}else(n!=null||o.nullOverride)&&(t[c]=n)}return t}},9621:(_,j,p)=>{const i=p(375),m={};_.exports=function(f,h,t){if(h===!1||h==null)return f;typeof(t=t||{})=="string"&&(t={separator:t});const l=Array.isArray(h);i(!l||!t.separator,"Separator option is not valid for array-based chain");const o=l?h:h.split(t.separator||".");let r=f;for(let s=0;s<o.length;++s){let c=o[s];const n=t.iterables&&m.iterables(r);if(Array.isArray(r)||n==="set"){const a=Number(c);Number.isInteger(a)&&(c=a<0?r.length+a:a)}if(!r||typeof r=="function"&&t.functions===!1||!n&&r[c]===void 0){i(!t.strict||s+1===o.length,"Missing segment",c,"in reach path ",h),i(typeof r=="object"||t.functions===!0||typeof r!="function","Invalid segment",c,"in reach path ",h),r=t.default;break}r=n?n==="set"?[...r][c]:r.get(c):r[c]}return r},m.iterables=function(f){return f instanceof Set?"set":f instanceof Map?"map":void 0}},8761:_=>{_.exports=function(...j){try{return JSON.stringify(...j)}catch(p){return"[Cannot display object: "+p.message+"]"}}},4277:(_,j)=>{const p={};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]",j.error],["[object Map]",j.map],["[object Promise]",j.promise],["[object Set]",j.set],["[object WeakMap]",j.weakMap],["[object WeakSet]",j.weakSet]]),j.getInternalProto=function(i){if(Array.isArray(i))return j.array;if(i instanceof Date)return j.date;if(i instanceof RegExp)return j.regex;if(i instanceof Error)return j.error;const m=Object.prototype.toString.call(i);return p.typeMap.get(m)||j.generic}},7043:(_,j)=>{j.keys=function(p,i={}){return i.symbols!==!1?Reflect.ownKeys(p):Object.getOwnPropertyNames(p)}},3652:(_,j,p)=>{const i=p(375),m={};j.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(f,h){const t=[].concat((h=h||{}).before||[]),l=[].concat(h.after||[]),o=h.group||"?",r=h.sort||0;i(!t.includes(o),`Item cannot come before itself: ${o}`),i(!t.includes("?"),"Item cannot come before unassociated items"),i(!l.includes(o),`Item cannot come after itself: ${o}`),i(!l.includes("?"),"Item cannot come after unassociated items"),Array.isArray(f)||(f=[f]);for(const s of f){const c={seq:this._items.length,sort:r,before:t,after:l,group:o,node:s};this._items.push(c)}if(!h.manual){const s=this._sort();i(s,"item",o!=="?"?`added into group ${o}`:"","created a dependencies error")}return this.nodes}merge(f){Array.isArray(f)||(f=[f]);for(const t of f)if(t)for(const l of t._items)this._items.push(Object.assign({},l));this._items.sort(m.mergeSort);for(let t=0;t<this._items.length;++t)this._items[t].seq=t;const h=this._sort();return i(h,"merge created a dependencies error"),this.nodes}sort(){const f=this._sort();return i(f,"sort created a dependencies error"),this.nodes}_sort(){const f={},h=Object.create(null),t=Object.create(null);for(const c of this._items){const n=c.seq,a=c.group;t[a]=t[a]||[],t[a].push(n),f[n]=c.before;for(const u of c.after)h[u]=h[u]||[],h[u].push(n)}for(const c in f){const n=[];for(const a in f[c]){const u=f[c][a];t[u]=t[u]||[],n.push(...t[u])}f[c]=n}for(const c in h)if(t[c])for(const n of t[c])f[n].push(...h[c]);const l={};for(const c in f){const n=f[c];for(const a of n)l[a]=l[a]||[],l[a].push(c)}const o={},r=[];for(let c=0;c<this._items.length;++c){let n=c;if(l[c]){n=null;for(let a=0;a<this._items.length;++a){if(o[a]===!0)continue;l[a]||(l[a]=[]);const u=l[a].length;let g=0;for(let y=0;y<u;++y)o[l[a][y]]&&++g;if(g===u){n=a;break}}}n!==null&&(o[n]=!0,r.push(n))}if(r.length!==this._items.length)return!1;const s={};for(const c of this._items)s[c.seq]=c;this._items=[],this.nodes=[];for(const c of r){const n=s[c];this.nodes.push(n.node),this._items.push(n)}return!0}},m.mergeSort=(f,h)=>f.sort===h.sort?0:f.sort<h.sort?-1:1},5380:(_,j,p)=>{const i=p(443),m=p(2178),f={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:i.URL||URL};j.analyze=function(h,t={}){if(!h)return m.code("DOMAIN_NON_EMPTY_STRING");if(typeof h!="string")throw new Error("Invalid input: domain must be a string");if(h.length>256)return m.code("DOMAIN_TOO_LONG");if(f.nonAsciiRx.test(h)){if(t.allowUnicode===!1)return m.code("DOMAIN_INVALID_UNICODE_CHARS");h=h.normalize("NFC")}if(f.domainControlRx.test(h))return m.code("DOMAIN_INVALID_CHARS");h=f.punycode(h),t.allowFullyQualified&&h[h.length-1]==="."&&(h=h.slice(0,-1));const l=t.minDomainSegments||f.minDomainSegments,o=h.split(".");if(o.length<l)return m.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&o.length>t.maxDomainSegments)return m.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=t.tlds;if(r){const s=o[o.length-1].toLowerCase();if(r.deny&&r.deny.has(s)||r.allow&&!r.allow.has(s))return m.code("DOMAIN_FORBIDDEN_TLDS")}for(let s=0;s<o.length;++s){const c=o[s];if(!c.length)return m.code("DOMAIN_EMPTY_SEGMENT");if(c.length>63)return m.code("DOMAIN_LONG_SEGMENT");if(s<o.length-1){if(!f.domainSegmentRx.test(c))return m.code("DOMAIN_INVALID_CHARS")}else if(!f.tldSegmentRx.test(c))return m.code("DOMAIN_INVALID_TLDS_CHARS")}return null},j.isValid=function(h,t){return!j.analyze(h,t)},f.punycode=function(h){h.includes("%")&&(h=h.replace(/%/g,"%25"));try{return new f.URL(`http://${h}`).host}catch{return h}}},1745:(_,j,p)=>{const i=p(9848),m=p(5380),f=p(2178),h={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(i.TextEncoder||TextEncoder)};j.analyze=function(t,l){return h.email(t,l)},j.isValid=function(t,l){return!h.email(t,l)},h.email=function(t,l={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return f.code("EMPTY_STRING");const o=!h.nonAsciiRx.test(t);if(!o){if(l.allowUnicode===!1)return f.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}const r=t.split("@");if(r.length!==2)return r.length>2?f.code("MULTIPLE_AT_CHAR"):f.code("MISSING_AT_CHAR");const[s,c]=r;if(!s)return f.code("EMPTY_LOCAL");if(!l.ignoreLength){if(t.length>254)return f.code("ADDRESS_TOO_LONG");if(h.encoder.encode(s).length>64)return f.code("LOCAL_TOO_LONG")}return h.local(s,o)||m.analyze(c,l)},h.local=function(t,l){const o=t.split(".");for(const r of o){if(!r.length)return f.code("EMPTY_LOCAL_SEGMENT");if(l){if(!h.atextRx.test(r))return f.code("INVALID_LOCAL_CHARS")}else for(const s of r){if(h.atextRx.test(s))continue;const c=h.binary(s);if(!h.atomRx.test(c))return f.code("INVALID_LOCAL_CHARS")}}},h.binary=function(t){return Array.from(h.encoder.encode(t)).map(l=>String.fromCharCode(l)).join("")},h.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,h.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)=>{j.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"},j.code=function(p){return{code:p,error:j.codes[p]}}},9959:(_,j,p)=>{const i=p(375),m=p(5752);j.regex=function(f={}){i(f.cidr===void 0||typeof f.cidr=="string","options.cidr must be a string");const h=f.cidr?f.cidr.toLowerCase():"optional";i(["required","optional","forbidden"].includes(h),"options.cidr must be one of required, optional, forbidden"),i(f.version===void 0||typeof f.version=="string"||Array.isArray(f.version),"options.version must be a string or an array of string");let t=f.version||["ipv4","ipv6","ipvfuture"];Array.isArray(t)||(t=[t]),i(t.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<t.length;++r)i(typeof t[r]=="string","options.version must only contain strings"),t[r]=t[r].toLowerCase(),i(["ipv4","ipv6","ipvfuture"].includes(t[r]),"options.version contains unknown version "+t[r]+" - must be one of ipv4, ipv6, ipvfuture");t=Array.from(new Set(t));const l=`(?:${t.map(r=>{if(h==="forbidden")return m.ip[r];const s=`\\/${r==="ipv4"?m.ip.v4Cidr:m.ip.v6Cidr}`;return h==="required"?`${m.ip[r]}${s}`:`${m.ip[r]}(?:${s})?`}).join("|")})`,o=new RegExp(`^${l}$`);return{cidr:h,versions:t,regex:o,raw:l}}},5752:(_,j,p)=>{const i=p(375),m=p(6064),f={generate:function(){const h={},t="\\dA-Fa-f",l="["+t+"]",o="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",s="%"+t,c=o+s+r+":@",n="["+c+"]",a="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";h.ipv4address="(?:"+a+"\\.){3}"+a;const u=l+"{1,4}",g="(?:"+u+":"+u+"|"+h.ipv4address+")",y="(?:"+u+":){6}"+g,k="::(?:"+u+":){5}"+g,w="(?:"+u+")?::(?:"+u+":){4}"+g,d="(?:(?:"+u+":){0,1}"+u+")?::(?:"+u+":){3}"+g,x="(?:(?:"+u+":){0,2}"+u+")?::(?:"+u+":){2}"+g,b="(?:(?:"+u+":){0,3}"+u+")?::"+u+":"+g,S="(?:(?:"+u+":){0,4}"+u+")?::"+g,A="(?:(?:"+u+":){0,5}"+u+")?::"+u,P="(?:(?:"+u+":){0,6}"+u+")?::";h.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",h.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",h.ipv6address="(?:"+y+"|"+k+"|"+w+"|"+d+"|"+x+"|"+b+"|"+S+"|"+A+"|"+P+")",h.ipvFuture="v"+l+"+\\.["+o+r+":]+",h.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",h.schemeRegex=new RegExp(h.scheme);const L="["+o+s+r+":]*",D="["+o+s+r+"]{1,255}",N="(?:\\[(?:"+h.ipv6address+"|"+h.ipvFuture+")\\]|"+h.ipv4address+"|"+D+")",V="(?:"+L+"@)?"+N+"(?::\\d*)?",B="(?:"+L+"@)?("+N+")(?::\\d*)?",I=n+"*",z=n+"+",F="(?:\\/"+I+")*",K="\\/(?:"+z+F+")?",he=z+F,be="["+o+s+r+"@]+"+F,De="(?:\\/\\/\\/"+I+F+")";return h.hierPart="(?:(?:\\/\\/"+V+F+")|"+K+"|"+he+"|"+De+")",h.hierPartCapture="(?:(?:\\/\\/"+B+F+")|"+K+"|"+he+")",h.relativeRef="(?:(?:\\/\\/"+V+F+")|"+K+"|"+be+"|)",h.relativeRefCapture="(?:(?:\\/\\/"+B+F+")|"+K+"|"+be+"|)",h.query="["+c+"\\/\\?]*(?=#|$)",h.queryWithSquareBrackets="["+c+"\\[\\]\\/\\?]*(?=#|$)",h.fragment="["+c+"\\/\\?]*",h}};f.rfc3986=f.generate(),j.ip={v4Cidr:f.rfc3986.ipv4Cidr,v6Cidr:f.rfc3986.ipv6Cidr,ipv4:f.rfc3986.ipv4address,ipv6:f.rfc3986.ipv6address,ipvfuture:f.rfc3986.ipvFuture},f.createRegex=function(h){const t=f.rfc3986,l="(?:\\?"+(h.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",o=h.domain?t.relativeRefCapture:t.relativeRef;if(h.relativeOnly)return f.wrap(o+l);let r="";if(h.scheme){i(h.scheme instanceof RegExp||typeof h.scheme=="string"||Array.isArray(h.scheme),"scheme must be a RegExp, String, or Array");const n=[].concat(h.scheme);i(n.length>=1,"scheme must have at least 1 scheme specified");const a=[];for(let u=0;u<n.length;++u){const g=n[u];i(g instanceof RegExp||typeof g=="string","scheme at position "+u+" must be a RegExp or String"),g instanceof RegExp?a.push(g.source.toString()):(i(t.schemeRegex.test(g),"scheme at position "+u+" must be a valid scheme"),a.push(m(g)))}r=a.join("|")}const s="(?:"+(r?"(?:"+r+")":t.scheme)+":"+(h.domain?t.hierPartCapture:t.hierPart)+")",c=h.allowRelative?"(?:"+s+"|"+o+")":s;return f.wrap(c+l,r)},f.wrap=function(h,t){return{raw:h=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${h}`,regex:new RegExp(`^${h}$`),scheme:t}},f.uriRegex=f.createRegex({}),j.regex=function(h={}){return h.scheme||h.allowRelative||h.relativeOnly||h.allowQuerySquareBrackets||h.domain?f.createRegex(h):f.uriRegex}},1447:(_,j)=>{const p={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};j.Parser=class{constructor(i,m={}){if(!m[p.settings]&&m.constants)for(const f in m.constants){const h=m.constants[f];if(h!==null&&!["boolean","number","string"].includes(typeof h))throw new Error(`Formula constant ${f} contains invalid ${typeof h} value type`)}this.settings=m[p.settings]?m:Object.assign({[p.settings]:!0,constants:{},functions:{}},m),this.single=null,this._parts=null,this._parse(i)}_parse(i){let m=[],f="",h=0,t=!1;const l=r=>{if(h)throw new Error("Formula missing closing parenthesis");const s=m.length?m[m.length-1]:null;if(t||f||r){if(s&&s.type==="reference"&&r===")")return s.type="function",s.value=this._subFormula(f,s.value),void(f="");if(r===")"){const c=new j.Parser(f,this.settings);m.push({type:"segment",value:c})}else if(t){if(t==="]")return m.push({type:"reference",value:f}),void(f="");m.push({type:"literal",value:f})}else if(p.operatorCharacters.includes(f))s&&s.type==="operator"&&p.operators.includes(s.value+f)?s.value+=f:m.push({type:"operator",value:f});else if(f.match(p.numberRx))m.push({type:"constant",value:parseFloat(f)});else if(this.settings.constants[f]!==void 0)m.push({type:"constant",value:this.settings.constants[f]});else{if(!f.match(p.tokenRx))throw new Error(`Formula contains invalid token: ${f}`);m.push({type:"reference",value:f})}f=""}};for(const r of i)t?r===t?(l(),t=!1):f+=r:h?r==="("?(f+=r,++h):r===")"?(--h,h?f+=r:l(r)):f+=r:r in p.literals?t=p.literals[r]:r==="("?(l(),++h):p.operatorCharacters.includes(r)?(l(),f=r,l()):r!==" "?f+=r:l();l(),m=m.map((r,s)=>r.type!=="operator"||r.value!=="-"||s&&m[s-1].type!=="operator"?r:{type:"operator",value:"n"});let o=!1;for(const r of m){if(r.type==="operator"){if(p.operatorsPrefix.includes(r.value))continue;if(!o)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(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");m.length===1&&["reference","literal","constant"].includes(m[0].type)&&(this.single={type:m[0].type==="reference"?"reference":"value",value:m[0].value}),this._parts=m.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(i,m){const f=this.settings.functions[m];if(typeof f!="function")throw new Error(`Formula contains unknown function ${m}`);let h=[];if(i){let t="",l=0,o=!1;const r=()=>{if(!t)throw new Error(`Formula contains function ${m} with invalid arguments ${i}`);h.push(t),t=""};for(let s=0;s<i.length;++s){const c=i[s];o?(t+=c,c===o&&(o=!1)):c in p.literals&&!l?(t+=c,o=p.literals[c]):c!==","||l?(t+=c,c==="("?++l:c===")"&&--l):r()}r()}return h=h.map(t=>new j.Parser(t,this.settings)),function(t){const l=[];for(const o of h)l.push(o.evaluate(t));return f.call(t,...l)}}evaluate(i){const m=this._parts.slice();for(let f=m.length-2;f>=0;--f){const h=m[f];if(h&&h.type==="operator"){const t=m[f+1];m.splice(f+1,1);const l=p.evaluate(t,i);m[f]=p.single(h.value,l)}}return p.operatorsOrder.forEach(f=>{for(let h=1;h<m.length-1;)if(f.includes(m[h])){const t=m[h],l=p.evaluate(m[h-1],i),o=p.evaluate(m[h+1],i);m.splice(h,2);const r=p.calculate(t,l,o);m[h-1]=r===0?0:r}else h+=2}),p.evaluate(m[0],i)}},j.Parser.prototype[p.symbol]=!0,p.reference=function(i){return function(m){return m&&m[i]!==void 0?m[i]:null}},p.evaluate=function(i,m){return i===null?null:typeof i=="function"?i(m):i[p.symbol]?i.evaluate(m):i},p.single=function(i,m){if(i==="!")return!m;const f=-m;return f===0?0:f},p.calculate=function(i,m,f){if(i==="??")return p.exists(m)?m:f;if(typeof m=="string"||typeof f=="string"){if(i==="+")return(m=p.exists(m)?m:"")+(p.exists(f)?f:"")}else switch(i){case"^":return Math.pow(m,f);case"*":return m*f;case"/":return m/f;case"%":return m%f;case"+":return m+f;case"-":return m-f}switch(i){case"<":return m<f;case"<=":return m<=f;case">":return m>f;case">=":return m>=f;case"==":return m===f;case"!=":return m!==f;case"&&":return m&&f;case"||":return m||f}return null},p.exists=function(i){return i!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:_=>{_.exports=JSON.parse('{"version":"17.13.3"}')}},C={},function _(j){var p=C[j];if(p!==void 0)return p.exports;var i=C[j]={exports:{}};return O[j](i,i.exports,_),i.exports}(5107);var O,C})}(Ye)),Ye.exports}var Ae={},Lt;function gn(){if(Lt)return Ae;Lt=1;var v=Ae&&Ae.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.BNExtension=O;const R=v(Ks());function O(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){try{return{value:new R.default(_)}}catch{return{errors:j.error("bn.nan")}}},coerce(_){return{value:_.toString(10)}},validate(_){return{value:_}},rules:{gt:{args:[{name:"threshold",ref:!0,assert:_=>R.default.isBN(_),message:"must be a big number",normalize:_=>new R.default(_)},{name:"equal",assert:_=>typeof _=="boolean",message:"must be a boolean"}],validate(_,j,p){const i=new R.default(_);return p.equal&&i.lt(p.threshold)?j.error("bn.min",p):!p.equal&&i.lte(p.threshold)?j.error("bn.greater",p):_}},lt:{args:[{name:"threshold",ref:!0,assert:_=>R.default.isBN(_),message:"must be a big number",normalize:_=>new R.default(_)},{name:"equal",assert:_=>typeof _=="boolean",message:"must be a boolean"}],validate(_,j,p){const i=new R.default(_);return p.equal&&i.gt(p.threshold)?j.error("bn.max",p):!p.equal&&i.gte(p.threshold)?j.error("bn.less",p):_}},min:{alias:"gte",method(_){return this.$_addRule({name:"gt",args:{threshold:_,equal:!0}})}},max:{alias:"lte",method(_){return this.$_addRule({name:"lt",args:{threshold:_,equal:!0}})}},greater:{alias:"gt",method(_){return this.$_addRule({name:"gt",args:{threshold:_,equal:!1}})}},less:{alias:"lt",method(_){return this.$_addRule({name:"lt",args:{threshold:_,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 Ae}var Pe={},qt;function yn(){if(qt)return Pe;qt=1;var v=Pe&&Pe.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.DIDExtension=j;const R=v(Gs),O=Ys(),C=Xs(),_={pk:Object.keys(O.types.KeyType),hash:Object.keys(O.types.HashType),role:Object.keys(O.types.RoleType)};function j(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(i,m){return!i||typeof i!="string"?{errors:m.error("did.empty",{value:i})}:(0,C.isValid)(i)===!1?{errors:m.error("did.invalid",{value:i})}:{value:i}},rules:{type:{args:[{name:"key",ref:!0,assert:i=>Object.keys(_).includes(i),message:`must be one of ${Object.keys(_).join(", ")}`},{name:"expected",assert:i=>Object.keys(_).some(m=>_[m].includes(i)),message:"must be valid type"}],validate(i,m,f){const h=(0,C.toTypeInfoStr)(i);return f.key==="pk"&&h.pk!==f.expected?m.error("did.pk",{...f,actual:h.pk}):f.key==="hash"&&h.hash!==f.expected?m.error("did.hash",{...f,actual:h.hash}):f.key==="role"&&h.role!==f.expected?m.error("did.role",{...f,actual:h.role}):i}},pk:{method(i){return this.$_addRule({name:"type",args:{key:"pk",expected:i}})}},hash:{method(i){return this.$_addRule({name:"type",args:{key:"hash",expected:i}})}},role:{method(i){return this.$_addRule({name:"type",args:{key:"role",expected:i}})}},wallet:{method(i){return this.$_addRule({name:"wallet",args:{type:i}})},args:[{name:"type",ref:!0,assert:i=>["arcblock","ethereum","default","eth","passkey"].includes(i),message:"must be a string",normalize:i=>i.trim()}],validate(i,m,f={}){const h=(0,C.toTypeInfo)(i),t=(0,C.toTypeInfoStr)(i);return["ethereum","eth"].includes(f.type)&&(0,R.default)(h,C.DID_TYPE_ETHEREUM)===!1?m.error("did.wallet",{expected:f.type,actual:JSON.stringify(t)}):["arcblock","default"].includes(f.type)&&(0,R.default)(h,C.DID_TYPE_ARCBLOCK)===!1?m.error("did.wallet",{expected:f.type,actual:JSON.stringify(t)}):["passkey"].includes(f.type)&&(0,R.default)(h,C.DID_TYPE_PASSKEY)===!1?m.error("did.wallet",{expected:f.type,actual:JSON.stringify(t)}):i}},prefix:{method(i=""){return this.$_addRule({name:"prefix",args:{str:i}})},args:[{name:"str",ref:!0,assert:i=>["",C.DID_PREFIX].includes(i),message:"must be a string",normalize:i=>i.trim()}],validate(i,m,f={}){return f.str&&i.startsWith(f.str)===!1?m.error("did.prefix",{expected:f.str}):!f.str&&(0,C.toAddress)(i)!==i?m.error("did.prefix",{expected:f.str}):i}}}}}return Pe}var Mt;function xn(){return Mt||(Mt=1,function(v){var R=Me&&Me.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(v,"__esModule",{value:!0}),v.patterns=v.schemas=v.Joi=void 0;const O=R(pn()),C=gn(),_=yn();v.Joi=O.default.extend(_.DIDExtension).extend(C.BNExtension);const j=/^(0x)?([A-Fa-f0-9]{64})$/,p=v.Joi.object({genesisTime:v.Joi.date().iso().required().raw(),genesisTx:v.Joi.string().regex(j).required().allow(""),renaissanceTime:v.Joi.date().iso().required().raw(),renaissanceTx:v.Joi.string().regex(j).required().allow("")}),i=v.Joi.object({address:v.Joi.DID().prefix().role("ROLE_TOKEN").required(),value:v.Joi.BN().positive().required()}),m=v.Joi.object({name:v.Joi.string().min(1).max(256).required(),value:v.Joi.string().min(1).max(1024).required(),description:v.Joi.string().min(1).max(256).optional().allow(""),required:v.Joi.boolean().optional().default(!1)}),f=v.Joi.alternatives().try(v.Joi.DID().prefix().role("ROLE_ACCOUNT"),v.Joi.DID().prefix().role("ROLE_APPLICATION"),v.Joi.DID().prefix().role("ROLE_BLOCKLET"),v.Joi.DID().prefix().wallet("ethereum"),v.Joi.DID().prefix().wallet("passkey")),h=v.Joi.array().items(v.Joi.object({owner:f.required(),tokensList:v.Joi.array().items(i).default([]),assetsList:v.Joi.array().items(v.Joi.DID().prefix().role("ROLE_ASSET")).default([])})),t=v.Joi.array().items({signer:v.Joi.DID().prefix().required(),pk:v.Joi.any().required(),signature:v.Joi.any().required(),delegator:v.Joi.DID().prefix().valid("").optional(),data:v.Joi.any().optional()}),l=v.Joi.object({type:v.Joi.string().min(1).max(32).required(),contractAddress:v.Joi.DID().prefix().wallet("ethereum").required(),chainType:v.Joi.string().min(1).max(32).required(),chainName:v.Joi.string().min(1).max(32).required(),chainId:v.Joi.number().positive().required()}),o=v.Joi.object({type:v.Joi.string().valid("svg","url","uri").required(),content:v.Joi.string().when("type",{is:"uri",then:v.Joi.string().max(20480).dataUri().required()}).when("type",{is:"url",then:v.Joi.string().max(2048).uri({scheme:["http","https"]}).required()})}),r=v.Joi.object({id:v.Joi.string().max(2048).uri({scheme:["http","https"]}).required(),scope:v.Joi.string().valid("public","private").default("public")}),s=v.Joi.object({id:v.Joi.DID().prefix().required(),pk:v.Joi.string().required(),name:v.Joi.string().min(1).max(256).required()}),c={address:v.Joi.DID().prefix().role("ROLE_ASSET").required(),moniker:v.Joi.string().min(2).max(255).required(),data:v.Joi.any().required(),readonly:v.Joi.boolean().default(!1),transferrable:v.Joi.boolean().default(!1),ttl:v.Joi.number().min(0).default(0),parent:v.Joi.DID().prefix().optional().allow(""),issuer:v.Joi.DID().prefix().optional().allow(""),endpoint:r.optional().allow(null).default(null),display:o.optional().allow(null).default(null),tags:v.Joi.array().items(v.Joi.string().min(1).max(64)).max(4).optional()},n={address:v.Joi.DID().prefix().role("ROLE_FACTORY").required(),name:v.Joi.string().min(2).max(255).required(),description:v.Joi.string().min(2).max(255).required(),settlement:v.Joi.string().valid("instant","periodic").default("instant"),limit:v.Joi.number().integer().min(0).default(0),trustedIssuers:v.Joi.array().items(v.Joi.DID().prefix()).max(8).optional(),data:v.Joi.any().optional().allow(null).default(null),display:o.optional().allow(null).default(null),input:v.Joi.object({value:v.Joi.BN().positive().min("0").default("0"),tokens:v.Joi.array().items(i).max(8).optional(),assets:v.Joi.array().items(v.Joi.alternatives().try(v.Joi.DID().prefix().role("ROLE_ASSET"),v.Joi.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),variables:v.Joi.array().items(v.Joi.object({name:v.Joi.string().min(1).max(255).required(),description:v.Joi.string().max(255).optional().allow(""),required:v.Joi.boolean().required()})).optional()}),output:v.Joi.object({moniker:v.Joi.string().min(2).max(255).required(),data:v.Joi.any().required(),readonly:v.Joi.boolean().default(!1),transferrable:v.Joi.boolean().default(!1),ttl:v.Joi.number().min(0).default(0),parent:v.Joi.string().max(255).required(),issuer:v.Joi.string().max(255).required(),endpoint:r.optional(),display:o.optional(),tags:v.Joi.array().items(v.Joi.string().min(1).max(64)).max(4).optional()}),hooks:v.Joi.array().items(v.Joi.object({name:v.Joi.string().valid("mint","postMint","preMint").required(),type:v.Joi.string().valid("url","contract").required(),hook:v.Joi.string().min(1).max(4096).required(),compiled:v.Joi.array().items(v.Joi.object()).optional()})).optional()};v.schemas={context:p,tokenInput:i,multiInput:h,multiSig:t,foreignToken:l,variableInput:m,nftDisplay:o,nftEndpoint:r,nftIssuer:s,tokenHolder:f,assetProps:c,assetSchema:v.Joi.object(c).options({stripUnknown:!0,noDefaults:!1}),factoryProps:n,factorySchema:v.Joi.object(n).options({stripUnknown:!0,noDefaults:!1})},v.patterns={txHash:j}}(Me)),Me}var vn=xn();function fs({onCancel:v,onSuccess:R,blocklet:O}){const{vaults:C=[],appPid:_}=O,{t:j,locale:p}=oe(),{connectApi:i}=Nt(),{api:m}=ne(),{teamDid:f}=Ve(),[h,t]=gt({loading:!1,fetching:!1,error:"",address:"",fetched:[],errored:[]});q.useEffect(()=>{if(!je.isValid(h.address))return;const c=je.toAddress(h.address),n=h.fetched.find(u=>u.address===c),a=h.errored.find(u=>u.address===c);!h.fetching&&!n&&!a&&(t({fetching:!0}),Pr(J.MAIN_CHAIN_ENDPOINT).getAccountState({address:c}).then(g=>{g.state?t({fetching:!1,fetched:[...h.fetched.filter(y=>y.address!==c),g.state]}):t({fetching:!1,errored:[...h.errored.filter(y=>y.address!==c),{address:c}]})}).catch(g=>{console.error(g),t({fetching:!1,error:at(g)})}))},[h.address,h.fetching]),q.useEffect(()=>{if(h.address){const c=je.toAddress(h.address);if(!je.isValid(c)){t({error:j("blocklet.config.vault.error.invalid")});return}if(vn.schemas.tokenHolder.validate(c).error){t({error:j("blocklet.config.vault.error.holder")});return}if(C.find(a=>a.did===c)){t({error:j("blocklet.config.vault.error.duplicate")});return}if(Qs([O.appDid,O.appPid,...O.migratedFrom.map(a=>a.appDid)].filter(Boolean)).includes(c)){t({error:j("blocklet.config.vault.error.appDid")});return}}t({error:""})},[h.address]);const l=async()=>{t({loading:!0});try{const c=await m.configVault({input:{teamDid:f,vaultDid:je.toAddress(h.address)}});i.open({locale:p,action:"approve-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:c.sessionId},messages:{title:j("blocklet.config.vault.approve.title"),scan:j(`blocklet.config.vault.approve.${C.length>0?"byLast":"byOwner"}`),confirm:j("blocklet.config.vault.approve.confirm"),success:j("blocklet.config.vault.approve.success")},onSuccess:()=>{i.open({locale:p,action:"config-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:c.sessionId},messages:{title:j("blocklet.config.vault.commit.title"),scan:j("blocklet.config.vault.commit.scan"),confirm:j("blocklet.config.vault.commit.confirm"),success:j("blocklet.config.vault.commit.success")},onSuccess:()=>{t({loading:!1}),R()},onClose:()=>{t({loading:!1}),i.close()}})},onClose:()=>{t({loading:!1}),i.close()}})}catch(c){t({loading:!1,error:at(c)})}},o=je.toAddress(h.address),r=[];je.isValid(o)&&r.push({key:j("blocklet.config.vault.role"),value:e.jsx(ft,{color:"primary",variant:"outlined",size:"small",label:je.toTypeInfoStr(o).role||"-"})});const s=h.fetched.find(c=>c.address===o);return s&&r.push({key:j("blocklet.config.vault.firstSeen"),value:St(s.context?.genesisTime,"-")},{key:j("blocklet.config.vault.lastSeen"),value:St(s.context?.renaissanceTime,"-")},{key:j("blocklet.config.vault.migratedFrom"),value:s.migratedFrom.length?s.migratedFrom.map(c=>e.jsx(it,{did:c,showQrcode:!0,compact:!0,size:14,locale:p},c)):"-"},{key:j("blocklet.config.vault.migratedTo"),value:s.migratedTo.length?s.migratedTo.map(c=>e.jsx(it,{did:c,showQrcode:!0,compact:!0,size:14,locale:p},c)):"-"}),e.jsx(ke,{open:!0,fullWidth:!0,showCloseButton:!1,onClose:v,title:e.jsxs($,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(rs,{}),j("blocklet.config.vault.title")]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(re,{onClick:v,children:j("common.cancel")}),e.jsx(re,{onClick:l,variant:"contained",disabled:!!h.error||h.loading,children:j("common.confirm")})]}),children:e.jsxs(ie,{direction:"column",spacing:3,children:[e.jsxs(Y,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[j("blocklet.config.vault.desc")," ",j("blocklet.config.vault.tip")]}),C.length>0&&e.jsxs($,{children:[e.jsxs(Y,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[j("blocklet.config.vault.current"),":"]}),e.jsxs($,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(er,{did:C[C.length-1].did,showQrcode:!0,style:{width:"auto"}}),e.jsx(Tr,{vaults:C,appPid:_})]})]}),e.jsx(U,{fullWidth:!0,"data-cy":"input-factory-address",label:j("blocklet.config.vault.address"),error:!!h.error,helperText:h.error,value:h.address,onChange:c=>{t({address:c.target.value,error:""})},slotProps:{input:{endAdornment:h.fetching?e.jsx(Vt,{position:"end",children:e.jsx(Ee,{size:16})}):null}}}),e.jsx($,{sx:{"& .info-row__name":{fontSize:"14px"},"& .info-row__value":{fontSize:"14px"}},children:r.map(c=>e.jsx(Qt,{valueComponent:"div",nameWidth:120,name:c.key,children:c.value},c.key))})]})})}fs.propTypes={onCancel:T.func.isRequired,onSuccess:T.func.isRequired,blocklet:T.object.isRequired};function xt({blocklet:v,onUpdate:R=()=>{},hasPermission:O=!1}){const{info:C,api:_,inService:j}=ne(),{t:p,locale:i}=q.useContext(ue),[m,f]=gt({loading:!1,showTransferOwner:!1,showConfigVault:!1}),[h,t]=q.useState(()=>v?.settings?.gateway?.wafPolicy?.enabled??!0),[l,o]=q.useState(()=>!!v?.settings?.enableSessionHardening),[r,s]=q.useState(()=>!!v?.settings?.invite?.enabled),[c,n]=q.useState(()=>{const I=v?.settings?.org||{};return{enabled:I.enabled||!1,maxMemberPerOrg:I.maxMemberPerOrg||100,maxOrgPerUser:I.maxOrgPerUser||10}}),a=m.loading||!O,{did:u}=v.meta,g=j?window.env?.gateway?.wafPolicy?.enabled:C?.routing.wafPolicy?.enabled;if(pt(v.status))return null;const y=v.environments.find(I=>I.key===W.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE),k=!y||y.value==="yes",d=v.environments.find(I=>I.key===W.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE)?.value||W.BLOCKLET_TENANT_MODES.SINGLE,x=(I,z)=>async F=>{if(!m.loading){f({loading:!0});try{const{checked:K}=F.target,{blocklet:he}=await _.configBlocklet({input:{did:v.meta.did,configs:[{key:W.BLOCKLET_CONFIGURABLE_KEY[I],value:z(K)}]}});R(he)}catch(K){Z.error(K.message)}finally{f({loading:!1})}}},b=x("BLOCKLET_DELETABLE",I=>I?"no":"yes"),S=x("BLOCKLET_APP_TENANT_MODE",I=>I?W.BLOCKLET_TENANT_MODES.MULTIPLE:W.BLOCKLET_TENANT_MODES.SINGLE),A=(I,z)=>async F=>{if(!m.loading){f({loading:!0});try{const K=F.target.checked;await _.updateBlockletSettings({input:I(K)}),z&&z(K)}catch(K){Z.error(K.message)}finally{f({loading:!1})}}},P=A(I=>({did:v.meta.did,invite:{enabled:I}}),s),L=A(I=>({did:v.meta.did,org:{enabled:I,maxMemberPerOrg:100,maxOrgPerUser:10}}),I=>{n({...c,enabled:I})}),D=async(I,z)=>{if(!m.loading){f({loading:!0});try{await _.updateBlockletSettings({input:{did:v.meta.did,org:{...c,[I]:z}}}),n({...c,[I]:z})}catch(F){Z.error(F.message)}finally{f({loading:!1})}}},N=A(I=>({did:v.meta.did,gateway:{wafPolicy:{enabled:I}}}),t),V=A(I=>({did:v.meta.did,enableSessionHardening:I}),I=>{o(I),tr()}),B=async()=>{if(!m.loading){f({loading:!0});try{const{blocklet:I}=await _.getBlocklet({input:{did:v.meta.did}});R(I)}catch(I){Z.error(I.message)}finally{f({loading:!1})}}};return e.jsxs(ie,{p:3,sx:{border:"1px solid red",borderRadius:2,p:3},className:"advanced-config",children:[!j&&e.jsxs(e.Fragment,{children:[e.jsx(M,{title:p("blocklet.config.deletable.name"),desc:p(k?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:!k,defaultChecked:!0,onChange:b})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}})]}),e.jsx(us,{inService:j,disabled:a,loading:m.loading,onChange:B}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),j&&e.jsx(wr,{role:"owner",children:I=>(I||mn)&&e.jsxs(e.Fragment,{children:[e.jsx(M,{title:p("blocklet.config.vault.title"),desc:p("blocklet.config.vault.desc"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsxs(re,{variant:"contained",color:"primary",size:"small","data-cy":"config-vault",onClick:()=>f({showConfigVault:!0}),children:[e.jsx(rs,{style:{fontSize:"1.3em",marginRight:4}}),p("blocklet.config.vault.title")]})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),m.showConfigVault&&e.jsx(fs,{blocklet:v,onCancel:()=>f({showConfigVault:!1}),onSuccess:()=>f({showConfigVault:!1})}),e.jsx(M,{title:p("team.transferApp.name"),desc:p("team.transferApp.description"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsxs(re,{variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"transfer-app",onClick:()=>f({showTransferOwner:!0}),children:[e.jsx(Xr,{style:{fontSize:"1.3em",marginRight:4}}),p("team.transferApp.name")]})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),m.showTransferOwner&&e.jsx(hs,{onCancel:()=>f({showTransferOwner:!1}),onSuccess:()=>f({showTransferOwner:!1})})]})}),e.jsx(M,{title:p("blocklet.config.clearCache.name"),desc:p("blocklet.config.clearCache.purpose"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(Rr,{teamDid:u})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:p("blocklet.config.rotateSessionKey.name"),desc:p("blocklet.config.rotateSessionKey.purpose"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(Or,{style:{whiteSpace:"nowrap"},teamDid:u})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:p("blocklet.config.tenantMode.name"),desc:p(`blocklet.config.tenantMode.${d}`),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:d===W.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:S})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:p("team.invite.setting"),desc:p(`team.invite.${r?"enabled":"disabled"}`),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:r,onChange:P})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:e.jsxs(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:[p("setting.form.enableSessionHardening.switchLabel"),e.jsx(te,{title:p("setting.form.enableSessionHardening.switchTips"),children:e.jsx(Ct,{sx:{ml:.5,fontSize:"20px"},color:"primary"})})]}),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:l,onChange:V})})}),g&&e.jsxs(e.Fragment,{children:[e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:e.jsxs(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:[p("router.gateway.wafPolicy.title"),e.jsx(te,{title:e.jsx($,{sx:{fontSize:"14px",lineHeight:1.5},children:e.jsx($,{sx:{color:"common.white",ml:.5},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${i}/enable-web-application-firewall`,target:"_blank",rel:"noopener noreferrer",children:p("dashboard.document")})}),children:e.jsx(Ct,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]}),desc:p("router.gateway.wafPolicy.switchLabel"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:h,onChange:N})})})]}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:e.jsx(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:p("common.orgs")}),desc:p("team.orgs.explain"),children:e.jsxs($,{sx:{display:"flex",flexDirection:"column",gap:2,width:"100%",alignSelf:{xs:"flex-start",md:"flex-end"}},children:[e.jsx(pe,{disabled:a,checked:c.enabled,onChange:L}),c.enabled&&e.jsxs($,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:400,mt:1},children:[e.jsx(lt,{style:{marginTop:0},disabled:a,loading:m.loading,type:"number",min:2,initialValue:c.maxOrgPerUser,label:p("team.orgs.invite.maxOrgs"),placeholder:p("team.orgs.invite.maxOrgs"),onSubmit:I=>D("maxOrgPerUser",I)}),e.jsx(lt,{style:{marginTop:0},disabled:a,loading:m.loading,type:"number",min:2,initialValue:c.maxMemberPerOrg,label:p("team.orgs.invite.maxMembers"),placeholder:p("team.orgs.invite.maxMembers"),onSubmit:I=>D("maxMemberPerOrg",I)})]})]})})]})}const bn=Ie(xt,"mutate_blocklets"),jn=Ie(xt,"",mt);function _n(v){const{inService:R}=ne();return R?e.jsx(jn,{...v}):e.jsx(bn,{...v})}xt.propTypes={blocklet:T.object.isRequired,onUpdate:T.func,hasPermission:T.bool};function vt({blocklet:v,onUpdate:R=()=>{},hasPermission:O=!1,...C}){const{t:_}=q.useContext(ue);return pt(v.status)?null:e.jsxs(Cn,{...C,children:[e.jsx(un,{blocklet:v,onUpdate:R,hasPermission:O}),e.jsx($,{sx:{mt:6},children:e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:_("blocklet.config.dangerZone")})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx($,{sx:{maxWidth:1536},children:e.jsx(_n,{blocklet:v,onUpdate:R,hasPermission:O})})]})}const wn=Ie(vt,"mutate_blocklets"),kn=Ie(vt,"",mt);function Sn(v){const{inService:R}=ne();return R?e.jsx(kn,{...v}):e.jsx(wn,{...v})}vt.propTypes={blocklet:T.object.isRequired,onUpdate:T.func,hasPermission:T.bool};const Cn=xe($)`
|
|
50
|
+
`;var Me={},Ye={exports:{}},Dt;function pn(){return Dt||(Dt=1,function(v,R){(function(O,C){v.exports=C()})(self,()=>{return O={7629:(_,j,p)=>{const i=p(375),m=p(8571),f=p(9474),h=p(1687),t=p(8652),l=p(8160),o=p(3292),r=p(6354),s=p(8901),c=p(9708),n=p(6914),a=p(2294),u=p(6133),g=p(1152),y=p(8863),k=p(2036),w={Base:class{constructor(d){this.type=d,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new a.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 i(typeof c.describe=="function","Manifest functionality disabled"),c.describe(this)}allow(...d){return l.verifyFlat(d,"allow"),this._values(d,"_valids")}alter(d){i(d&&typeof d=="object"&&!Array.isArray(d),"Invalid targets argument"),i(!this._inRuleset(),"Cannot set alterations inside a ruleset");const x=this.clone();x.$_terms.alterations=x.$_terms.alterations||[];for(const b in d){const S=d[b];i(typeof S=="function","Alteration adjuster for",b,"must be a function"),x.$_terms.alterations.push({target:b,adjuster:S})}return x.$_temp.ruleset=!1,x}artifact(d){return i(d!==void 0,"Artifact cannot be undefined"),i(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",d)}cast(d){return i(d===!1||typeof d=="string","Invalid to value"),i(d===!1||this._definition.cast[d],"Type",this.type,"does not support casting to",d),this.$_setFlag("cast",d===!1?void 0:d)}default(d,x){return this._default("default",d,x)}description(d){return i(d&&typeof d=="string","Description must be a non-empty string"),this.$_setFlag("description",d)}empty(d){const x=this.clone();return d!==void 0&&(d=x.$_compile(d,{override:!1})),x.$_setFlag("empty",d,{clone:!1})}error(d){return i(d,"Missing error"),i(d instanceof Error||typeof d=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",d)}example(d,x={}){return i(d!==void 0,"Missing example"),l.assertOptions(x,["override"]),this._inner("examples",d,{single:!0,override:x.override})}external(d,x){return typeof d=="object"&&(i(!x,"Cannot combine options with description"),x=d.description,d=d.method),i(typeof d=="function","Method must be a function"),i(x===void 0||x&&typeof x=="string","Description must be a non-empty string"),this._inner("externals",{method:d,description:x},{single:!0})}failover(d,x){return this._default("failover",d,x)}forbidden(){return this.presence("forbidden")}id(d){return d?(i(typeof d=="string","id must be a non-empty string"),i(/^[^\.]+$/.test(d),"id cannot contain period character"),this.$_setFlag("id",d)):this.$_setFlag("id",void 0)}invalid(...d){return this._values(d,"_invalids")}label(d){return i(d&&typeof d=="string","Label name must be a non-empty string"),this.$_setFlag("label",d)}meta(d){return i(d!==void 0,"Meta cannot be undefined"),this._inner("metas",d,{single:!0})}note(...d){i(d.length,"Missing notes");for(const x of d)i(x&&typeof x=="string","Notes must be non-empty strings");return this._inner("notes",d)}only(d=!0){return i(typeof d=="boolean","Invalid mode:",d),this.$_setFlag("only",d)}optional(){return this.presence("optional")}prefs(d){i(d,"Missing preferences"),i(d.context===void 0,"Cannot override context"),i(d.externals===void 0,"Cannot override externals"),i(d.warnings===void 0,"Cannot override warnings"),i(d.debug===void 0,"Cannot override debug"),l.checkPreferences(d);const x=this.clone();return x._preferences=l.preferences(x._preferences,d),x}presence(d){return i(["optional","required","forbidden"].includes(d),"Unknown presence mode",d),this.$_setFlag("presence",d)}raw(d=!0){return this.$_setFlag("result",d?"raw":void 0)}result(d){return i(["raw","strip"].includes(d),"Unknown result mode",d),this.$_setFlag("result",d)}required(){return this.presence("required")}strict(d){const x=this.clone(),b=d!==void 0&&!d;return x._preferences=l.preferences(x._preferences,{convert:b}),x}strip(d=!0){return this.$_setFlag("result",d?"strip":void 0)}tag(...d){i(d.length,"Missing tags");for(const x of d)i(x&&typeof x=="string","Tags must be non-empty strings");return this._inner("tags",d)}unit(d){return i(d&&typeof d=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",d)}valid(...d){l.verifyFlat(d,"valid");const x=this.allow(...d);return x.$_setFlag("only",!!x._valids,{clone:!1}),x}when(d,x){const b=this.clone();b.$_terms.whens||(b.$_terms.whens=[]);const S=o.when(b,d,x);if(!["any","link"].includes(b.type)){const A=S.is?[S]:S.switch;for(const P of A)i(!P.then||P.then.type==="any"||P.then.type===b.type,"Cannot combine",b.type,"with",P.then&&P.then.type),i(!P.otherwise||P.otherwise.type==="any"||P.otherwise.type===b.type,"Cannot combine",b.type,"with",P.otherwise&&P.otherwise.type)}return b.$_terms.whens.push(S),b.$_mutateRebuild()}cache(d){i(!this._inRuleset(),"Cannot set caching inside a ruleset"),i(!this._cache,"Cannot override schema cache"),i(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const x=this.clone();return x._cache=d||t.provider.provision(),x.$_temp.ruleset=!1,x}clone(){const d=Object.create(Object.getPrototypeOf(this));return this._assign(d)}concat(d){i(l.isSchema(d),"Invalid schema object"),i(this.type==="any"||d.type==="any"||d.type===this.type,"Cannot merge type",this.type,"with another type:",d.type),i(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),i(!d._inRuleset(),"Cannot concatenate a schema with open ruleset");let x=this.clone();if(this.type==="any"&&d.type!=="any"){const b=d.clone();for(const S of Object.keys(x))S!=="type"&&(b[S]=x[S]);x=b}x._ids.concat(d._ids),x._refs.register(d,u.toSibling),x._preferences=x._preferences?l.preferences(x._preferences,d._preferences):d._preferences,x._valids=k.merge(x._valids,d._valids,d._invalids),x._invalids=k.merge(x._invalids,d._invalids,d._valids);for(const b of d._singleRules.keys())x._singleRules.has(b)&&(x._rules=x._rules.filter(S=>S.keep||S.name!==b),x._singleRules.delete(b));for(const b of d._rules)d._definition.rules[b.method].multi||x._singleRules.set(b.name,b),x._rules.push(b);if(x._flags.empty&&d._flags.empty){x._flags.empty=x._flags.empty.concat(d._flags.empty);const b=Object.assign({},d._flags);delete b.empty,h(x._flags,b)}else if(d._flags.empty){x._flags.empty=d._flags.empty;const b=Object.assign({},d._flags);delete b.empty,h(x._flags,b)}else h(x._flags,d._flags);for(const b in d.$_terms){const S=d.$_terms[b];S?x.$_terms[b]?x.$_terms[b]=x.$_terms[b].concat(S):x.$_terms[b]=S.slice():x.$_terms[b]||(x.$_terms[b]=S)}return this.$_root._tracer&&this.$_root._tracer._combine(x,[this,d]),x.$_mutateRebuild()}extend(d){return i(!d.base,"Cannot extend type with another base"),s.type(this,d)}extract(d){return d=Array.isArray(d)?d:d.split("."),this._ids.reach(d)}fork(d,x){i(!this._inRuleset(),"Cannot fork inside a ruleset");let b=this;for(let S of[].concat(d))S=Array.isArray(S)?S:S.split("."),b=b._ids.fork(S,x,b);return b.$_temp.ruleset=!1,b}rule(d){const x=this._definition;l.assertOptions(d,Object.keys(x.modifiers)),i(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;i(b>=0&&b<this._rules.length,"Cannot apply rules to empty ruleset");const S=this.clone();for(let A=b;A<S._rules.length;++A){const P=S._rules[A],L=m(P);for(const D in d)x.modifiers[D](L,d[D]),i(L.name===P.name,"Cannot change rule name");S._rules[A]=L,S._singleRules.get(L.name)===P&&S._singleRules.set(L.name,L)}return S.$_temp.ruleset=!1,S.$_mutateRebuild()}get ruleset(){i(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const d=this.clone();return d.$_temp.ruleset=d._rules.length,d}get $(){return this.ruleset}tailor(d){d=[].concat(d),i(!this._inRuleset(),"Cannot tailor inside a ruleset");let x=this;if(this.$_terms.alterations)for(const{target:b,adjuster:S}of this.$_terms.alterations)d.includes(b)&&(x=S(x),i(l.isSchema(x),"Alteration adjuster for",b,"failed to return a schema object"));return x=x.$_modify({each:b=>b.tailor(d),ref:!1}),x.$_temp.ruleset=!1,x.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(d,x){return y.entry(d,this,x)}validateAsync(d,x){return y.entryAsync(d,this,x)}$_addRule(d){typeof d=="string"&&(d={name:d}),i(d&&typeof d=="object","Invalid options"),i(d.name&&typeof d.name=="string","Invalid rule name");for(const P in d)i(P[0]!=="_","Cannot set private rule properties");const x=Object.assign({},d);x._resolve=[],x.method=x.method||x.name;const b=this._definition.rules[x.method],S=x.args;i(b,"Unknown rule",x.method);const A=this.clone();if(S){i(Object.keys(S).length===1||Object.keys(S).length===this._definition.rules[x.name].args.length,"Invalid rule definition for",this.type,x.name);for(const P in S){let L=S[P];if(b.argsByName){const D=b.argsByName.get(P);if(D.ref&&l.isResolvable(L))x._resolve.push(P),A.$_mutateRegister(L);else if(D.normalize&&(L=D.normalize(L),S[P]=L),D.assert){const N=l.validateArg(L,P,D);i(!N,N,"or reference")}}L!==void 0?S[P]=L:delete S[P]}}return b.multi||(A._ruleRemove(x.name,{clone:!1}),A._singleRules.set(x.name,x)),A.$_temp.ruleset===!1&&(A.$_temp.ruleset=null),b.priority?A._rules.unshift(x):A._rules.push(x),A}$_compile(d,x){return o.schema(this.$_root,d,x)}$_createError(d,x,b,S,A,P={}){const L=P.flags!==!1?this._flags:{},D=P.messages?n.merge(this._definition.messages,P.messages):this._definition.messages;return new r.Report(d,x,b,L,D,S,A)}$_getFlag(d){return this._flags[d]}$_getRule(d){return this._singleRules.get(d)}$_mapLabels(d){return d=Array.isArray(d)?d:d.split("."),this._ids.labels(d)}$_match(d,x,b,S){(b=Object.assign({},b)).abortEarly=!0,b._externals=!1,x.snapshot();const A=!y.validate(d,this,x,b,S).errors;return x.restore(),A}$_modify(d){return l.assertOptions(d,["each","once","ref","schema"]),a.schema(this,d)||this}$_mutateRebuild(){return i(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(d,{source:x,name:b,path:S,key:A})=>{const P=this._definition[x][b]&&this._definition[x][b].register;P!==!1&&this.$_mutateRegister(d,{family:P,key:A})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(d,{family:x,key:b}={}){this._refs.register(d,x),this._ids.register(d,{key:b})}$_property(d){return this._definition.properties[d]}$_reach(d){return this._ids.reach(d)}$_rootReferences(){return this._refs.roots()}$_setFlag(d,x,b={}){i(d[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const S=this._definition.flags[d]||{};if(f(x,S.default)&&(x=void 0),f(x,this._flags[d]))return this;const A=b.clone!==!1?this.clone():this;return x!==void 0?(A._flags[d]=x,A.$_mutateRegister(x)):delete A._flags[d],d[0]!=="_"&&(A.$_temp.ruleset=!1),A}$_parent(d,...x){return this[d][l.symbols.parent].call(this,...x)}$_validate(d,x,b){return y.validate(d,this,x,b)}_assign(d){d.type=this.type,d.$_root=this.$_root,d.$_temp=Object.assign({},this.$_temp),d.$_temp.whens={},d._ids=this._ids.clone(),d._preferences=this._preferences,d._valids=this._valids&&this._valids.clone(),d._invalids=this._invalids&&this._invalids.clone(),d._rules=this._rules.slice(),d._singleRules=m(this._singleRules,{shallow:!0}),d._refs=this._refs.clone(),d._flags=Object.assign({},this._flags),d._cache=null,d.$_terms={};for(const x in this.$_terms)d.$_terms[x]=this.$_terms[x]?this.$_terms[x].slice():null;d.$_super={};for(const x in this.$_super)d.$_super[x]=this._super[x].bind(d);return d}_bare(){const d=this.clone();d._reset();const x=d._definition.terms;for(const b in x){const S=x[b];d.$_terms[b]=S.init}return d.$_mutateRebuild()}_default(d,x,b={}){return l.assertOptions(b,"literal"),i(x!==void 0,"Missing",d,"value"),i(typeof x=="function"||!b.literal,"Only function value supports literal option"),typeof x=="function"&&b.literal&&(x={[l.symbols.literal]:!0,literal:x}),this.$_setFlag(d,x)}_generate(d,x,b){if(!this.$_terms.whens)return{schema:this};const S=[],A=[];for(let D=0;D<this.$_terms.whens.length;++D){const N=this.$_terms.whens[D];if(N.concat){S.push(N.concat),A.push(`${D}.concat`);continue}const V=N.ref?N.ref.resolve(d,x,b):d,B=N.is?[N]:N.switch,I=A.length;for(let z=0;z<B.length;++z){const{is:F,then:K,otherwise:he}=B[z],be=`${D}${N.switch?"."+z:""}`;if(F.$_match(V,x.nest(F,`${be}.is`),b)){if(K){const De=x.localize([...x.path,`${be}.then`],x.ancestors,x.schemas),{schema:We,id:Le}=K._generate(d,De,b);S.push(We),A.push(`${be}.then${Le?`(${Le})`:""}`);break}}else if(he){const De=x.localize([...x.path,`${be}.otherwise`],x.ancestors,x.schemas),{schema:We,id:Le}=he._generate(d,De,b);S.push(We),A.push(`${be}.otherwise${Le?`(${Le})`:""}`);break}}if(N.break&&A.length>I)break}const P=A.join(", ");if(x.mainstay.tracer.debug(x,"rule","when",P),!P)return{schema:this};if(!x.mainstay.tracer.active&&this.$_temp.whens[P])return{schema:this.$_temp.whens[P],id:P};let L=this;this._definition.generate&&(L=this._definition.generate(this,d,x,b));for(const D of S)L=L.concat(D);return this.$_root._tracer&&this.$_root._tracer._combine(L,[this,...S]),this.$_temp.whens[P]=L,{schema:L,id:P}}_inner(d,x,b={}){i(!this._inRuleset(),`Cannot set ${d} inside a ruleset`);const S=this.clone();return S.$_terms[d]&&!b.override||(S.$_terms[d]=[]),b.single?S.$_terms[d].push(x):S.$_terms[d].push(...x),S.$_temp.ruleset=!1,S}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(d,x={}){if(!this._singleRules.has(d))return this;const b=x.clone!==!1?this.clone():this;b._singleRules.delete(d);const S=[];for(let A=0;A<b._rules.length;++A){const P=b._rules[A];P.name!==d||P.keep?S.push(P):b._inRuleset()&&A<b.$_temp.ruleset&&--b.$_temp.ruleset}return b._rules=S,b}_values(d,x){l.verifyFlat(d,x.slice(1,-1));const b=this.clone(),S=d[0]===l.symbols.override;if(S&&(d=d.slice(1)),!b[x]&&d.length?b[x]=new k:S&&(b[x]=d.length?new k:null,b.$_mutateRebuild()),!b[x])return b;S&&b[x].override();for(const A of d){i(A!==void 0,"Cannot call allow/valid/invalid with undefined"),i(A!==l.symbols.override,"Override must be the first value");const P=x==="_invalids"?"_valids":"_invalids";b[P]&&(b[P].remove(A),b[P].length||(i(x==="_valids"||!b._flags.only,"Setting invalid value",A,"leaves schema rejecting all values due to previous valid rule"),b[P]=null)),b[x].add(A,b._refs)}return b}}};w.Base.prototype[l.symbols.any]={version:l.version,compile:o.compile,root:"$_root"},w.Base.prototype.isImmutable=!0,w.Base.prototype.deny=w.Base.prototype.invalid,w.Base.prototype.disallow=w.Base.prototype.invalid,w.Base.prototype.equal=w.Base.prototype.valid,w.Base.prototype.exist=w.Base.prototype.required,w.Base.prototype.not=w.Base.prototype.invalid,w.Base.prototype.options=w.Base.prototype.prefs,w.Base.prototype.preferences=w.Base.prototype.prefs,_.exports=new w.Base},8652:(_,j,p)=>{const i=p(375),m=p(8571),f=p(8160),h={max:1e3,supported:new Set(["undefined","boolean","number","string"])};j.provider={provision:t=>new h.Cache(t)},h.Cache=class{constructor(t={}){f.assertOptions(t,["max"]),i(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||h.max,this._map=new Map,this._list=new h.List}get length(){return this._map.size}set(t,l){if(t!==null&&!h.supported.has(typeof t))return;let o=this._map.get(t);if(o)return o.value=l,void this._list.first(o);o=this._list.unshift({key:t,value:l}),this._map.set(t,o),this._compact()}get(t){const l=this._map.get(t);if(l)return this._list.first(l),m(l.value)}_compact(){if(this._map.size>this._max){const t=this._list.pop();this._map.delete(t.key)}}},h.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){const{next:l,prev:o}=t;return l.prev=o,o&&(o.next=l),t===this.tail&&(this.tail=l),t.prev=null,t.next=null,t}}},8160:(_,j,p)=>{const i=p(375),m=p(7916),f=p(5934);let h,t;const l={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)?)?)?)?$/};j.version=f.version,j.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},j.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")},j.assertOptions=function(o,r,s="Options"){i(o&&typeof o=="object"&&!Array.isArray(o),"Options must be of type object");const c=Object.keys(o).filter(n=>!r.includes(n));i(c.length===0,`${s} contain unknown keys: ${c}`)},j.checkPreferences=function(o){t=t||p(3378);const r=t.preferences.validate(o);if(r.error)throw new m([r.error.details[0].message])},j.compare=function(o,r,s){switch(s){case"=":return o===r;case">":return o>r;case"<":return o<r;case">=":return o>=r;case"<=":return o<=r}},j.default=function(o,r){return o===void 0?r:o},j.isIsoDate=function(o){return l.isoDate.test(o)},j.isNumber=function(o){return typeof o=="number"&&!isNaN(o)},j.isResolvable=function(o){return!!o&&(o[j.symbols.ref]||o[j.symbols.template])},j.isSchema=function(o,r={}){const s=o&&o[j.symbols.any];return!!s&&(i(r.legacy||s.version===j.version,"Cannot mix different versions of joi schemas"),!0)},j.isValues=function(o){return o[j.symbols.values]},j.limit=function(o){return Number.isSafeInteger(o)&&o>=0},j.preferences=function(o,r){h=h||p(6914),o=o||{},r=r||{};const s=Object.assign({},o,r);return r.errors&&o.errors&&(s.errors=Object.assign({},o.errors,r.errors),s.errors.wrap=Object.assign({},o.errors.wrap,r.errors.wrap)),r.messages&&(s.messages=h.compile(r.messages,o.messages)),delete s[j.symbols.prefs],s},j.tryWithPath=function(o,r,s={}){try{return o()}catch(c){throw c.path!==void 0?c.path=r+"."+c.path:c.path=r,s.append&&(c.message=`${c.message} (${c.path})`),c}},j.validateArg=function(o,r,{assert:s,message:c}){if(j.isSchema(s)){const n=s.validate(o);return n.error?n.error.message:void 0}if(!s(o))return r?`${r} ${c}`:c},j.verifyFlat=function(o,r){for(const s of o)i(!Array.isArray(s),"Method no longer accepts array arguments:",r)}},3292:(_,j,p)=>{const i=p(375),m=p(8160),f=p(6133),h={};j.schema=function(t,l,o={}){m.assertOptions(o,["appendPath","override"]);try{return h.schema(t,l,o)}catch(r){throw o.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},h.schema=function(t,l,o){i(l!==void 0,"Invalid undefined schema"),Array.isArray(l)&&(i(l.length,"Invalid empty array schema"),l.length===1&&(l=l[0]));const r=(s,...c)=>o.override!==!1?s.valid(t.override,...c):s.valid(...c);if(h.simple(l))return r(t,l);if(typeof l=="function")return t.custom(l);if(i(typeof l=="object","Invalid schema content:",typeof l),m.isResolvable(l))return r(t,l);if(m.isSchema(l))return l;if(Array.isArray(l)){for(const s of l)if(!h.simple(s))return t.alternatives().try(...l);return r(t,...l)}return l instanceof RegExp?t.string().regex(l):l instanceof Date?r(t.date(),l):(i(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(l))},j.ref=function(t,l){return f.isRef(t)?t:f.create(t,l)},j.compile=function(t,l,o={}){m.assertOptions(o,["legacy"]);const r=l&&l[m.symbols.any];if(r)return i(o.legacy||r.version===m.version,"Cannot mix different versions of joi schemas:",r.version,m.version),l;if(typeof l!="object"||!o.legacy)return j.schema(t,l,{appendPath:!0});const s=h.walk(l);return s?s.compile(s.root,l):j.schema(t,l,{appendPath:!0})},h.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(const o of t){const r=h.walk(o);if(r)return r}return null}const l=t[m.symbols.any];if(l)return{root:t[l.root],compile:l.compile};i(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const o in t){const r=h.walk(t[o]);if(r)return r}return null},h.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)},j.when=function(t,l,o){if(o===void 0&&(i(l&&typeof l=="object","Missing options"),o=l,l=f.create(".")),Array.isArray(o)&&(o={switch:o}),m.assertOptions(o,["is","not","then","otherwise","switch","break"]),m.isSchema(l))return i(o.is===void 0,'"is" can not be used with a schema condition'),i(o.not===void 0,'"not" can not be used with a schema condition'),i(o.switch===void 0,'"switch" can not be used with a schema condition'),h.condition(t,{is:l,then:o.then,otherwise:o.otherwise,break:o.break});if(i(f.isRef(l)||typeof l=="string","Invalid condition:",l),i(o.not===void 0||o.is===void 0,'Cannot combine "is" with "not"'),o.switch===void 0){let s=o;o.not!==void 0&&(s={is:o.not,then:o.otherwise,otherwise:o.then,break:o.break});let c=s.is!==void 0?t.$_compile(s.is):t.$_root.invalid(null,!1,0,"").required();return i(s.then!==void 0||s.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),i(s.break===void 0||s.then===void 0||s.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),o.is===void 0||f.isRef(o.is)||m.isSchema(o.is)||(c=c.required()),h.condition(t,{ref:j.ref(l),is:c,then:s.then,otherwise:s.otherwise,break:s.break})}i(Array.isArray(o.switch),'"switch" must be an array'),i(o.is===void 0,'Cannot combine "switch" with "is"'),i(o.not===void 0,'Cannot combine "switch" with "not"'),i(o.then===void 0,'Cannot combine "switch" with "then"');const r={ref:j.ref(l),switch:[],break:o.break};for(let s=0;s<o.switch.length;++s){const c=o.switch[s],n=s===o.switch.length-1;m.assertOptions(c,n?["is","then","otherwise"]:["is","then"]),i(c.is!==void 0,'Switch statement missing "is"'),i(c.then!==void 0,'Switch statement missing "then"');const a={is:t.$_compile(c.is),then:t.$_compile(c.then)};if(f.isRef(c.is)||m.isSchema(c.is)||(a.is=a.is.required()),n){i(o.otherwise===void 0||c.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const u=o.otherwise!==void 0?o.otherwise:c.otherwise;u!==void 0&&(i(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r},h.condition=function(t,l){for(const o of["then","otherwise"])l[o]===void 0?delete l[o]:l[o]=t.$_compile(l[o]);return l}},6354:(_,j,p)=>{const i=p(5688),m=p(8160),f=p(3328);j.Report=class{constructor(h,t,l,o,r,s,c){if(this.code=h,this.flags=o,this.messages=r,this.path=s.path,this.prefs=c,this.state=s,this.value=t,this.message=null,this.template=null,this.local=l||{},this.local.label=j.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 n=this.path[this.path.length-1];typeof n!="object"&&(this.local.key=n)}}_setTemplate(h){if(this.template=h,!this.flags.label&&this.path.length===0){const t=this._template(this.template,"root");t&&(this.local.label=t)}}toString(){if(this.message)return this.message;const h=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return t===void 0?`Error code "${h}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.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(h,t){return j.template(this.value,h,t||this.code,this.state,this.prefs)}},j.path=function(h){let t="";for(const l of h)typeof l!="object"&&(typeof l=="string"?(t&&(t+="."),t+=l):t+=`[${l}]`);return t},j.template=function(h,t,l,o,r){if(!t)return;if(f.isTemplate(t))return l!=="root"?t:null;let s=r.errors.language;if(m.isResolvable(s)&&(s=s.resolve(h,o,r)),s&&t[s]){if(t[s][l]!==void 0)return t[s][l];if(t[s]["*"]!==void 0)return t[s]["*"]}return t[l]?t[l]:t["*"]},j.label=function(h,t,l,o){if(!l.errors.label)return"";if(h.label)return h.label;let r=t.path;return l.errors.label==="key"&&t.path.length>1&&(r=t.path.slice(-1)),j.path(r)||j.template(null,l.messages,"root",t,l)||o&&j.template(null,o,"root",t,l)||"value"},j.process=function(h,t,l){if(!h)return null;const{override:o,message:r,details:s}=j.details(h);if(o)return o;if(l.errors.stack)return new j.ValidationError(r,s,t);const c=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new j.ValidationError(r,s,t);return Error.stackTraceLimit=c,n},j.details=function(h,t={}){let l=[];const o=[];for(const r of h){if(r instanceof Error){if(t.override!==!1)return{override:r};const c=r.toString();l.push(c),o.push({message:c,type:"override",context:{error:r}});continue}const s=r.toString();l.push(s),o.push({message:s,path:r.path.filter(c=>typeof c!="object"),type:r.code,context:r.local})}return l.length>1&&(l=[...new Set(l)]),{message:l.join(". "),details:o}},j.ValidationError=class extends Error{constructor(h,t,l){super(h),this._original=l,this.details=t}static isError(h){return h instanceof j.ValidationError}},j.ValidationError.prototype.isJoi=!0,j.ValidationError.prototype.name="ValidationError",j.ValidationError.prototype.annotate=i.error},8901:(_,j,p)=>{const i=p(375),m=p(8571),f=p(8160),h=p(6914),t={};j.type=function(l,o){const r=Object.getPrototypeOf(l),s=m(r),c=l._assign(Object.create(s)),n=Object.assign({},o);delete n.base,s._definition=n;const a=r._definition||{};n.messages=h.merge(a.messages,n.messages),n.properties=Object.assign({},a.properties,n.properties),c.type=n.type,n.flags=Object.assign({},a.flags,n.flags);const u=Object.assign({},a.terms);if(n.terms)for(const w in n.terms){const d=n.terms[w];i(c.$_terms[w]===void 0,"Invalid term override for",n.type,w),c.$_terms[w]=d.init,u[w]=d}n.terms=u,n.args||(n.args=a.args),n.prepare=t.prepare(n.prepare,a.prepare),n.coerce&&(typeof n.coerce=="function"&&(n.coerce={method:n.coerce}),n.coerce.from&&!Array.isArray(n.coerce.from)&&(n.coerce={method:n.coerce.method,from:[].concat(n.coerce.from)})),n.coerce=t.coerce(n.coerce,a.coerce),n.validate=t.validate(n.validate,a.validate);const g=Object.assign({},a.rules);if(n.rules)for(const w in n.rules){const d=n.rules[w];i(typeof d=="object","Invalid rule definition for",n.type,w);let x=d.method;if(x===void 0&&(x=function(){return this.$_addRule(w)}),x&&(i(!s[w],"Rule conflict in",n.type,w),s[w]=x),i(!g[w],"Rule conflict in",n.type,w),g[w]=d,d.alias){const b=[].concat(d.alias);for(const S of b)s[S]=d.method}d.args&&(d.argsByName=new Map,d.args=d.args.map(b=>(typeof b=="string"&&(b={name:b}),i(!d.argsByName.has(b.name),"Duplicated argument name",b.name),f.isSchema(b.assert)&&(b.assert=b.assert.strict().label(b.name)),d.argsByName.set(b.name,b),b)))}n.rules=g;const y=Object.assign({},a.modifiers);if(n.modifiers)for(const w in n.modifiers){i(!s[w],"Rule conflict in",n.type,w);const d=n.modifiers[w];i(typeof d=="function","Invalid modifier definition for",n.type,w);const x=function(b){return this.rule({[w]:b})};s[w]=x,y[w]=d}if(n.modifiers=y,n.overrides){s._super=r,c.$_super={};for(const w in n.overrides)i(r[w],"Cannot override missing",w),n.overrides[w][f.symbols.parent]=r[w],c.$_super[w]=r[w].bind(c);Object.assign(s,n.overrides)}n.cast=Object.assign({},a.cast,n.cast);const k=Object.assign({},a.manifest,n.manifest);return k.build=t.build(n.manifest&&n.manifest.build,a.manifest&&a.manifest.build),n.manifest=k,n.rebuild=t.rebuild(n.rebuild,a.rebuild),c},t.build=function(l,o){return l&&o?function(r,s){return o(l(r,s),s)}:l||o},t.coerce=function(l,o){return l&&o?{from:l.from&&o.from?[...new Set([...l.from,...o.from])]:null,method(r,s){let c;if((!o.from||o.from.includes(typeof r))&&(c=o.method(r,s),c)){if(c.errors||c.value===void 0)return c;r=c.value}if(!l.from||l.from.includes(typeof r)){const n=l.method(r,s);if(n)return n}return c}}:l||o},t.prepare=function(l,o){return l&&o?function(r,s){const c=l(r,s);if(c){if(c.errors||c.value===void 0)return c;r=c.value}return o(r,s)||c}:l||o},t.rebuild=function(l,o){return l&&o?function(r){o(r),l(r)}:l||o},t.validate=function(l,o){return l&&o?function(r,s){const c=o(r,s);if(c){if(c.errors&&(!Array.isArray(c.errors)||c.errors.length))return c;r=c.value}return l(r,s)||c}:l||o}},5107:(_,j,p)=>{const i=p(375),m=p(8571),f=p(8652),h=p(8160),t=p(3292),l=p(6354),o=p(8901),r=p(9708),s=p(6133),c=p(3328),n=p(1152);let a;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 g={_types:new Set(Object.keys(u.types))};for(const y of g._types)g[y]=function(...k){return i(!k.length||["alternatives","link","object"].includes(y),"The",y,"type does not allow arguments"),u.generate(this,u.types[y],k)};for(const y of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])g[y]=function(...k){return this.any()[y](...k)};Object.assign(g,u.methods);for(const y in u.aliases){const k=u.aliases[y];g[y]=g[k]}return g.x=g.expression,n.setup&&n.setup(g),g}};u.methods={ValidationError:l.ValidationError,version:h.version,cache:f.provider,assert(g,y,...k){u.assert(g,y,!0,k)},attempt:(g,y,...k)=>u.assert(g,y,!1,k),build(g){return i(typeof r.build=="function","Manifest functionality disabled"),r.build(this,g)},checkPreferences(g){h.checkPreferences(g)},compile(g,y){return t.compile(this,g,y)},defaults(g){i(typeof g=="function","modifier must be a function");const y=Object.assign({},this);for(const k of y._types){const w=g(y[k]());i(h.isSchema(w),"modifier must return a valid schema object"),y[k]=function(...d){return u.generate(this,w,d)}}return y},expression:(...g)=>new c(...g),extend(...g){h.verifyFlat(g,"extend"),a=a||p(3378),i(g.length,"You need to provide at least one extension"),this.assert(g,a.extensions);const y=Object.assign({},this);y._types=new Set(y._types);for(let k of g){typeof k=="function"&&(k=k(y)),this.assert(k,a.extension);const w=u.expandExtension(k,y);for(const d of w){i(y[d.type]===void 0||y._types.has(d.type),"Cannot override name",d.type);const x=d.base||this.any(),b=o.type(x,d);y._types.add(d.type),y[d.type]=function(...S){return u.generate(this,b,S)}}}return y},isError:l.ValidationError.isError,isExpression:c.isTemplate,isRef:s.isRef,isSchema:h.isSchema,in:(...g)=>s.in(...g),override:h.symbols.override,ref:(...g)=>s.create(...g),types(){const g={};for(const y of this._types)g[y]=this[y]();for(const y in u.aliases)g[y]=this[y]();return g}},u.assert=function(g,y,k,w){const d=w[0]instanceof Error||typeof w[0]=="string"?w[0]:null,x=d!==null?w[1]:w[0],b=y.validate(g,h.preferences({errors:{stack:!0}},x||{}));let S=b.error;if(!S)return b.value;if(d instanceof Error)throw d;const A=k&&typeof S.annotate=="function"?S.annotate():S.message;throw S instanceof l.ValidationError==0&&(S=m(S)),S.message=d?`${d} ${A}`:A,S},u.generate=function(g,y,k){return i(g,"Must be invoked on a Joi instance."),y.$_root=g,y._definition.args&&k.length?y._definition.args(y,...k):y},u.expandExtension=function(g,y){if(typeof g.type=="string")return[g];const k=[];for(const w of y._types)if(g.type.test(w)){const d=Object.assign({},g);d.type=w,d.base=y[w](),k.push(d)}return k},_.exports=u.root()},6914:(_,j,p)=>{const i=p(375),m=p(8571),f=p(3328);j.compile=function(h,t){if(typeof h=="string")return i(!t,"Cannot set single message string"),new f(h);if(f.isTemplate(h))return i(!t,"Cannot set single message template"),h;i(typeof h=="object"&&!Array.isArray(h),"Invalid message options"),t=t?m(t):{};for(let l in h){const o=h[l];if(l==="root"||f.isTemplate(o)){t[l]=o;continue}if(typeof o=="string"){t[l]=new f(o);continue}i(typeof o=="object"&&!Array.isArray(o),"Invalid message for",l);const r=l;for(l in t[r]=t[r]||{},o){const s=o[l];l==="root"||f.isTemplate(s)?t[r][l]=s:(i(typeof s=="string","Invalid message for",l,"in",r),t[r][l]=new f(s))}}return t},j.decompile=function(h){const t={};for(let l in h){const o=h[l];if(l==="root"){t.root=o;continue}if(f.isTemplate(o)){t[l]=o.describe({compact:!0});continue}const r=l;for(l in t[r]={},o){const s=o[l];l!=="root"?t[r][l]=s.describe({compact:!0}):t[r].root=s}}return t},j.merge=function(h,t){if(!h)return j.compile(t);if(!t)return h;if(typeof t=="string")return new f(t);if(f.isTemplate(t))return t;const l=m(h);for(let o in t){const r=t[o];if(o==="root"||f.isTemplate(r)){l[o]=r;continue}if(typeof r=="string"){l[o]=new f(r);continue}i(typeof r=="object"&&!Array.isArray(r),"Invalid message for",o);const s=o;for(o in l[s]=l[s]||{},r){const c=r[o];o==="root"||f.isTemplate(c)?l[s][o]=c:(i(typeof c=="string","Invalid message for",o,"in",s),l[s][o]=new f(c))}}return l}},2294:(_,j,p)=>{const i=p(375),m=p(8160),f=p(6133),h={};j.Ids=h.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const t=new h.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(const[l,o]of t._byId.entries())i(!this._byKey.has(l),"Schema id conflicts with existing key:",l),this._byId.set(l,o);for(const[l,o]of t._byKey.entries())i(!this._byId.has(l),"Schema key conflicts with existing id:",l),this._byKey.set(l,o)}fork(t,l,o){const r=this._collect(t);r.push({schema:o});const s=r.shift();let c={id:s.id,schema:l(s.schema)};i(m.isSchema(c.schema),"adjuster function failed to return a joi schema type");for(const n of r)c={id:n.id,schema:h.fork(n.schema,c.id,c.schema)};return c.schema}labels(t,l=[]){const o=t[0],r=this._get(o);if(!r)return[...l,...t].join(".");const s=t.slice(1);return l=[...l,r.schema._flags.label||o],s.length?r.schema._ids.labels(s,l):l.join(".")}reach(t,l=[]){const o=t[0],r=this._get(o);i(r,"Schema does not contain path",[...l,...t].join("."));const s=t.slice(1);return s.length?r.schema._ids.reach(s,[...l,o]):r.schema}register(t,{key:l}={}){if(!t||!m.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);const o=t._flags.id;if(o){const r=this._byId.get(o);i(!r||r.schema===t,"Cannot add different schemas with the same id:",o),i(!this._byKey.has(o),"Schema id conflicts with existing key:",o),this._byId.set(o,{schema:t,id:o})}l&&(i(!this._byKey.has(l),"Schema already contains key:",l),i(!this._byId.has(l),"Schema key conflicts with existing id:",l),this._byKey.set(l,{schema:t,id:l}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,l=[],o=[]){const r=t[0],s=this._get(r);i(s,"Schema does not contain path",[...l,...t].join(".")),o=[s,...o];const c=t.slice(1);return c.length?s.schema._ids._collect(c,[...l,r],o):o}_get(t){return this._byId.get(t)||this._byKey.get(t)}},h.fork=function(t,l,o){const r=j.schema(t,{each:(s,{key:c})=>{if(l===(s._flags.id||c))return o},ref:!1});return r?r.$_mutateRebuild():t},j.schema=function(t,l){let o;for(const r in t._flags){if(r[0]==="_")continue;const s=h.scan(t._flags[r],{source:"flags",name:r},l);s!==void 0&&(o=o||t.clone(),o._flags[r]=s)}for(let r=0;r<t._rules.length;++r){const s=t._rules[r],c=h.scan(s.args,{source:"rules",name:s.name},l);if(c!==void 0){o=o||t.clone();const n=Object.assign({},s);n.args=c,o._rules[r]=n,o._singleRules.get(s.name)===s&&o._singleRules.set(s.name,n)}}for(const r in t.$_terms){if(r[0]==="_")continue;const s=h.scan(t.$_terms[r],{source:"terms",name:r},l);s!==void 0&&(o=o||t.clone(),o.$_terms[r]=s)}return o},h.scan=function(t,l,o,r,s){const c=r||[];if(t===null||typeof t!="object")return;let n;if(Array.isArray(t)){for(let a=0;a<t.length;++a){const u=l.source==="terms"&&l.name==="keys"&&t[a].key,g=h.scan(t[a],l,o,[a,...c],u);g!==void 0&&(n=n||t.slice(),n[a]=g)}return n}if(o.schema!==!1&&m.isSchema(t)||o.ref!==!1&&f.isRef(t)){const a=o.each(t,{...l,path:c,key:s});return a===t?void 0:a}for(const a in t){if(a[0]==="_")continue;const u=h.scan(t[a],l,o,[a,...c],s);u!==void 0&&(n=n||Object.assign({},t),n[a]=u)}return n}},6133:(_,j,p)=>{const i=p(375),m=p(8571),f=p(9621),h=p(8160);let t;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};j.create=function(o,r={}){i(typeof o=="string","Invalid reference key:",o),h.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),i(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const s=Object.assign({},l.defaults,r);delete s.prefix;const c=s.separator,n=l.context(o,c,r.prefix);if(s.type=n.type,o=n.key,s.type==="value")if(n.root&&(i(!c||o[0]!==c,"Cannot specify relative path with root prefix"),s.ancestor="root",o||(o=null)),c&&c===o)o=null,s.ancestor=0;else if(s.ancestor!==void 0)i(!c||!o||o[0]!==c,"Cannot combine prefix with ancestor option");else{const[a,u]=l.ancestor(o,c);u&&(o=o.slice(u))===""&&(o=null),s.ancestor=a}return s.path=c?o===null?[]:o.split(c):[o],new l.Ref(s)},j.in=function(o,r={}){return j.create(o,{...r,in:!0})},j.isRef=function(o){return!!o&&!!o[h.symbols.ref]},l.Ref=class{constructor(o){i(typeof o=="object","Invalid reference construction"),h.assertOptions(o,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),i([!1,void 0].includes(o.separator)||typeof o.separator=="string"&&o.separator.length===1,"Invalid separator"),i(!o.adjust||typeof o.adjust=="function","options.adjust must be a function"),i(!o.map||Array.isArray(o.map),"options.map must be an array"),i(!o.map||!o.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,o),i(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(o,r,s,c,n={}){return i(!this.in||n.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(s.context,r,n):this.type==="local"?this._resolve(c,r,n):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,n):(i(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,n)):this._resolve(o,r,n)}_resolve(o,r,s){let c;if(this.type==="value"&&r.mainstay.shadow&&s.shadow!==!1&&(c=r.mainstay.shadow.get(this.absolute(r))),c===void 0&&(c=f(o,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(c=this.adjust(c)),this.map){const n=this.map.get(c);n!==void 0&&(c=n)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,c),c}toString(){return this.display}absolute(o){return[...o.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const o={path:this.path};this.type!=="value"&&(o.type=this.type),this.separator!=="."&&(o.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(o.ancestor=this.ancestor),this.map&&(o.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(o[r]=this[r]);return this.in!==!1&&(o.in=!0),{ref:o}}updateDisplay(){const o=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${o}`);if(!this.separator)return void(this.display=`ref:${o}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${o}`);if(this.ancestor==="root")return void(this.display=`ref:root:${o}`);if(this.ancestor===1)return void(this.display=`ref:${o||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${o||""}`}},l.Ref.prototype[h.symbols.ref]=!0,j.build=function(o){return(o=Object.assign({},l.defaults,o)).type==="value"&&o.ancestor===void 0&&(o.ancestor=1),new l.Ref(o)},l.context=function(o,r,s={}){if(o=o.trim(),s){const c=s.global===void 0?"$":s.global;if(c!==r&&o.startsWith(c))return{key:o.slice(c.length),type:"global"};const n=s.local===void 0?"#":s.local;if(n!==r&&o.startsWith(n))return{key:o.slice(n.length),type:"local"};const a=s.root===void 0?"/":s.root;if(a!==r&&o.startsWith(a))return{key:o.slice(a.length),type:"value",root:!0}}return{key:o,type:"value"}},l.ancestor=function(o,r){if(!r)return[1,0];if(o[0]!==r)return[1,0];if(o[1]!==r)return[0,1];let s=2;for(;o[s]===r;)++s;return[s-1,s]},j.toSibling=0,j.toParent=1,j.Manager=class{constructor(){this.refs=[]}register(o,r){if(o)if(r=r===void 0?j.toParent:r,Array.isArray(o))for(const s of o)this.register(s,r);else if(h.isSchema(o))for(const s of o._refs.refs)s.ancestor-r>=0&&this.refs.push({ancestor:s.ancestor-r,root:s.root});else j.isRef(o)&&o.type==="value"&&o.ancestor-r>=0&&this.refs.push({ancestor:o.ancestor-r,root:o.root}),t=t||p(3328),t.isTemplate(o)&&this.register(o.refs(),r)}get length(){return this.refs.length}clone(){const o=new j.Manager;return o.refs=m(this.refs),o}reset(){this.refs=[]}roots(){return this.refs.filter(o=>!o.ancestor).map(o=>o.root)}}},3378:(_,j,p)=>{const i=p(5107),m={};m.wrap=i.string().min(1).max(2).allow(!1),j.preferences=i.object({allowUnknown:i.boolean(),abortEarly:i.boolean(),artifacts:i.boolean(),cache:i.boolean(),context:i.object(),convert:i.boolean(),dateFormat:i.valid("date","iso","string","time","utc"),debug:i.boolean(),errors:{escapeHtml:i.boolean(),label:i.valid("path","key",!1),language:[i.string(),i.object().ref()],render:i.boolean(),stack:i.boolean(),wrap:{label:m.wrap,array:m.wrap,string:m.wrap}},externals:i.boolean(),messages:i.object(),noDefaults:i.boolean(),nonEnumerables:i.boolean(),presence:i.valid("required","optional","forbidden"),skipFunctions:i.boolean(),stripUnknown:i.object({arrays:i.boolean(),objects:i.boolean()}).or("arrays","objects").allow(!0,!1),warnings:i.boolean()}).strict(),m.nameRx=/^[a-zA-Z0-9]\w*$/,m.rule=i.object({alias:i.array().items(i.string().pattern(m.nameRx)).single(),args:i.array().items(i.string(),i.object({name:i.string().pattern(m.nameRx).required(),ref:i.boolean(),assert:i.alternatives([i.function(),i.object().schema()]).conditional("ref",{is:!0,then:i.required()}),normalize:i.function(),message:i.string().when("assert",{is:i.function(),then:i.required()})})),convert:i.boolean(),manifest:i.boolean(),method:i.function().allow(!1),multi:i.boolean(),validate:i.function()}),j.extension=i.object({type:i.alternatives([i.string(),i.object().regex()]).required(),args:i.function(),cast:i.object().pattern(m.nameRx,i.object({from:i.function().maxArity(1).required(),to:i.function().minArity(1).maxArity(2).required()})),base:i.object().schema().when("type",{is:i.object().regex(),then:i.forbidden()}),coerce:[i.function().maxArity(3),i.object({method:i.function().maxArity(3).required(),from:i.array().items(i.string()).single()})],flags:i.object().pattern(m.nameRx,i.object({setter:i.string(),default:i.any()})),manifest:{build:i.function().arity(2)},messages:[i.object(),i.string()],modifiers:i.object().pattern(m.nameRx,i.function().minArity(1).maxArity(2)),overrides:i.object().pattern(m.nameRx,i.function()),prepare:i.function().maxArity(3),rebuild:i.function().arity(1),rules:i.object().pattern(m.nameRx,m.rule),terms:i.object().pattern(m.nameRx,i.object({init:i.array().allow(null).required(),manifest:i.object().pattern(/.+/,[i.valid("schema","single"),i.object({mapped:i.object({from:i.string().required(),to:i.string().required()}).required()})])})),validate:i.function().maxArity(3)}).strict(),j.extensions=i.array().items(i.object(),i.function().arity(1)).strict(),m.desc={buffer:i.object({buffer:i.string()}),func:i.object({function:i.function().required(),options:{literal:!0}}),override:i.object({override:!0}),ref:i.object({ref:i.object({type:i.valid("value","global","local"),path:i.array().required(),separator:i.string().length(1).allow(!1),ancestor:i.number().min(0).integer().allow("root"),map:i.array().items(i.array().length(2)).min(1),adjust:i.function(),iterables:i.boolean(),in:i.boolean(),render:i.boolean()}).required()}),regex:i.object({regex:i.string().min(3)}),special:i.object({special:i.valid("deep").required()}),template:i.object({template:i.string().required(),options:i.object()}),value:i.object({value:i.alternatives([i.object(),i.array()]).required()})},m.desc.entity=i.alternatives([i.array().items(i.link("...")),i.boolean(),i.function(),i.number(),i.string(),m.desc.buffer,m.desc.func,m.desc.ref,m.desc.regex,m.desc.special,m.desc.template,m.desc.value,i.link("/")]),m.desc.values=i.array().items(null,i.boolean(),i.function(),i.number().allow(1/0,-1/0),i.string().allow(""),i.symbol(),m.desc.buffer,m.desc.func,m.desc.override,m.desc.ref,m.desc.regex,m.desc.template,m.desc.value),m.desc.messages=i.object().pattern(/.+/,[i.string(),m.desc.template,i.object().pattern(/.+/,[i.string(),m.desc.template])]),j.description=i.object({type:i.string().required(),flags:i.object({cast:i.string(),default:i.any(),description:i.string(),empty:i.link("/"),failover:m.desc.entity,id:i.string(),label:i.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:i.boolean(),unit:i.string()}).unknown(),preferences:{allowUnknown:i.boolean(),abortEarly:i.boolean(),artifacts:i.boolean(),cache:i.boolean(),convert:i.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:i.boolean(),label:["path","key"],language:[i.string(),m.desc.ref],wrap:{label:m.wrap,array:m.wrap}},externals:i.boolean(),messages:m.desc.messages,noDefaults:i.boolean(),nonEnumerables:i.boolean(),presence:["required","optional","forbidden"],skipFunctions:i.boolean(),stripUnknown:i.object({arrays:i.boolean(),objects:i.boolean()}).or("arrays","objects").allow(!0,!1),warnings:i.boolean()},allow:m.desc.values,invalid:m.desc.values,rules:i.array().min(1).items({name:i.string().required(),args:i.object().min(1),keep:i.boolean(),message:[i.string(),m.desc.messages],warn:i.boolean()}),keys:i.object().pattern(/.*/,i.link("/")),link:m.desc.ref}).pattern(/^[a-z]\w*$/,i.any())},493:(_,j,p)=>{const i=p(8571),m=p(9621),f=p(8160),h={value:Symbol("value")};_.exports=h.State=class{constructor(t,l,o){this.path=t,this.ancestors=l,this.mainstay=o.mainstay,this.schemas=o.schemas,this.debug=null}localize(t,l=null,o=null){const r=new h.State(t,l,this);return o&&r.schemas&&(r.schemas=[h.schemas(o),...r.schemas]),r}nest(t,l){const o=new h.State(this.path,this.ancestors,this);return o.schemas=o.schemas&&[h.schemas(t),...o.schemas],o.debug=l,o}shadow(t,l){this.mainstay.shadow=this.mainstay.shadow||new h.Shadow,this.mainstay.shadow.set(this.path,t,l)}snapshot(){this.mainstay.shadow&&(this._snapshot=i(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()}},h.schemas=function(t){return f.isSchema(t)?{schema:t}:t},h.Shadow=class{constructor(){this._values=null}set(t,l,o){if(!t.length||o==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let s=0;s<t.length;++s){const c=t[s];let n=r.get(c);n||(n=new Map,r.set(c,n)),r=n}r[h.value]=l}get(t){const l=this.node(t);if(l)return l[h.value]}node(t){if(this._values)return m(this._values,t,{iterables:!0})}override(t,l){if(!this._values)return;const o=t.slice(0,-1),r=t[t.length-1],s=m(this._values,o,{iterables:!0});l?s.set(r,l):s&&s.delete(r)}}},3328:(_,j,p)=>{const i=p(375),m=p(8571),f=p(5277),h=p(1447),t=p(8160),l=p(6354),o=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}};_.exports=r.Template=class{constructor(s,c){if(i(typeof s=="string","Template source must be a string"),i(!s.includes("\0")&&!s.includes(""),"Template source cannot contain reserved control characters"),this.source=s,this.rendered=s,this._template=null,c){const{functions:n,...a}=c;this._settings=Object.keys(a).length?m(a):void 0,this._functions=n,this._functions&&(i(Object.keys(this._functions).every(u=>typeof u=="string"),"Functions keys must be strings"),i(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 s=r.encode(this.source),c=r.split(s);let n=!1;const a=[],u=c.shift();u&&a.push(u);for(const g of c){const y=g[0]!=="{",k=y?"}":"}}",w=g.indexOf(k);if(w===-1||g[1]==="{"){a.push(`{${r.decode(g)}`);continue}let d=g.slice(y?0:1,w);const x=d[0]===":";x&&(d=d.slice(1));const b=this._ref(r.decode(d),{raw:y,wrapped:x});a.push(b),typeof b!="string"&&(n=!0);const S=g.slice(w+k.length);S&&a.push(r.decode(S))}n?this._template=a:this.rendered=a.join("")}static date(s,c){return r.dateFormat[c.dateFormat].call(s)}describe(s={}){if(!this._settings&&s.compact)return this.source;const c={template:this.source};return this._settings&&(c.options=this._settings),this._functions&&(c.functions=this._functions),c}static build(s){return new r.Template(s.template,s.options||s.functions?{...s.options,functions:s.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(s){return!!s&&!!s[t.symbols.template]}refs(){if(!this._template)return;const s=[];for(const c of this._template)typeof c!="string"&&s.push(...c.refs);return s}resolve(s,c,n,a){return this._template&&this._template.length===1?this._part(this._template[0],s,c,n,a,{}):this.render(s,c,n,a)}_part(s,...c){return s.ref?s.ref.resolve(...c):s.formula.evaluate(c)}render(s,c,n,a,u={}){if(!this.isDynamic())return this.rendered;const g=[];for(const y of this._template)if(typeof y=="string")g.push(y);else{const k=this._part(y,s,c,n,a,u),w=r.stringify(k,s,c,n,a,u);if(w!==void 0){const d=y.raw||(u.errors&&u.errors.escapeHtml)===!1?w:f(w);g.push(r.wrap(d,y.wrapped&&n.errors.wrap.label))}}return g.join("")}_ref(s,{raw:c,wrapped:n}){const a=[],u=y=>{const k=o.create(y,this._settings);return a.push(k),w=>{const d=k.resolve(...w);return d!==void 0?d:null}};try{const y=this._functions?{...r.functions,...this._functions}:r.functions;var g=new h.Parser(s,{reference:u,functions:y,constants:r.constants})}catch(y){throw y.message=`Invalid template variable "${s}" fails due to: ${y.message}`,y}if(g.single){if(g.single.type==="reference"){const y=a[0];return{ref:y,raw:c,refs:a,wrapped:n||y.type==="local"&&y.key==="label"}}return r.stringify(g.single.value)}return{formula:g,raw:c,refs:a}}toString(){return this.source}},r.Template.prototype[t.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(s){return s.replace(/\\(\{+)/g,(c,n)=>r.opens.slice(0,n.length)).replace(/\\(\}+)/g,(c,n)=>r.closes.slice(0,n.length))},r.decode=function(s){return s.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(s){const c=[];let n="";for(let a=0;a<s.length;++a){const u=s[a];if(u==="{"){let g="";for(;a+1<s.length&&s[a+1]==="{";)g+="{",++a;c.push(n),n=g}else n+=u}return c.push(n),c},r.wrap=function(s,c){return c?c.length===1?`${c}${s}${c}`:`${c[0]}${s}${c[1]}`:s},r.stringify=function(s,c,n,a,u,g={}){const y=typeof s,k=a&&a.errors&&a.errors.wrap||{};let w=!1;if(o.isRef(s)&&s.render&&(w=s.in,s=s.resolve(c,n,a,u,{in:s.in,...g})),s===null)return"null";if(y==="string")return r.wrap(s,g.arrayItems&&k.string);if(y==="number"||y==="function"||y==="symbol")return s.toString();if(y!=="object")return JSON.stringify(s);if(s instanceof Date)return r.Template.date(s,a);if(s instanceof Map){const x=[];for(const[b,S]of s.entries())x.push(`${b.toString()} -> ${S.toString()}`);s=x}if(!Array.isArray(s))return s.toString();const d=[];for(const x of s)d.push(r.stringify(x,c,n,a,u,{arrayItems:!0,...g}));return r.wrap(d.join(", "),!w&&k.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(s,c,n)=>s?c:n,length:s=>typeof s=="string"?s.length:s&&typeof s=="object"?Array.isArray(s)?s.length:Object.keys(s).length:null,msg(s){const[c,n,a,u,g]=this,y=g.messages;if(!y)return"";const k=l.template(c,y[0],s,n,a)||l.template(c,y[1],s,n,a);return k?k.render(c,n,a,u,g):""},number:s=>typeof s=="number"?s:typeof s=="string"?parseFloat(s):typeof s=="boolean"?s?1:0:s instanceof Date?s.getTime():null}},4946:(_,j,p)=>{const i=p(375),m=p(1687),f=p(8068),h=p(8160),t=p(3292),l=p(6354),o=p(6133),r={};_.exports=f.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:o.toSibling}},args:(s,...c)=>c.length===1&&Array.isArray(c[0])?s.try(...c[0]):s.try(...c),validate(s,c){const{schema:n,error:a,state:u,prefs:g}=c;if(n._flags.match){const k=[],w=[];for(let x=0;x<n.$_terms.matches.length;++x){const b=n.$_terms.matches[x],S=u.nest(b.schema,`match.${x}`);S.snapshot();const A=b.schema.$_validate(s,S,g);A.errors?(w.push(A.errors),S.restore()):(k.push(A.value),S.commit())}if(k.length===0)return{errors:a("alternatives.any",{details:w.map(x=>l.details(x,{override:!1}))})};if(n._flags.match==="one")return k.length===1?{value:k[0]}:{errors:a("alternatives.one")};if(k.length!==n.$_terms.matches.length)return{errors:a("alternatives.all",{details:w.map(x=>l.details(x,{override:!1}))})};const d=x=>x.$_terms.matches.some(b=>b.schema.type==="object"||b.schema.type==="alternatives"&&d(b.schema));return d(n)?{value:k.reduce((x,b)=>m(x,b,{mergeArrays:!1}))}:{value:k[k.length-1]}}const y=[];for(let k=0;k<n.$_terms.matches.length;++k){const w=n.$_terms.matches[k];if(w.schema){const b=u.nest(w.schema,`match.${k}`);b.snapshot();const S=w.schema.$_validate(s,b,g);if(!S.errors)return b.commit(),S;b.restore(),y.push({schema:w.schema,reports:S.errors});continue}const d=w.ref?w.ref.resolve(s,u,g):s,x=w.is?[w]:w.switch;for(let b=0;b<x.length;++b){const S=x[b],{is:A,then:P,otherwise:L}=S,D=`match.${k}${w.switch?"."+b:""}`;if(A.$_match(d,u.nest(A,`${D}.is`),g)){if(P)return P.$_validate(s,u.nest(P,`${D}.then`),g)}else if(L)return L.$_validate(s,u.nest(L,`${D}.otherwise`),g)}}return r.errors(y,c)},rules:{conditional:{method(s,c){i(!this._flags._endedSwitch,"Unreachable condition"),i(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),i(c.break===void 0,"Cannot use break option with alternatives conditional");const n=this.clone(),a=t.when(n,s,c),u=a.is?[a]:a.switch;for(const g of u)if(g.then&&g.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(a),n.$_mutateRebuild()}},match:{method(s){if(i(["any","one","all"].includes(s),"Invalid alternatives match mode",s),s!=="any")for(const c of this.$_terms.matches)i(c.schema,"Cannot combine match mode",s,"with conditional rules");return this.$_setFlag("match",s)}},try:{method(...s){i(s.length,"Missing alternative schemas"),h.verifyFlat(s,"try"),i(!this._flags._endedSwitch,"Unreachable condition");const c=this.clone();for(const n of s)c.$_terms.matches.push({schema:c.$_compile(n)});return c.$_mutateRebuild()}}},overrides:{label(s){return this.$_parent("label",s).$_modify({each:(c,n)=>n.path[0]!=="is"&&typeof c._flags.label!="string"?c.label(s):void 0,ref:!1})}},rebuild(s){s.$_modify({each:c=>{h.isSchema(c)&&c.type==="array"&&s.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(s,c){if(c.matches)for(const n of c.matches){const{schema:a,ref:u,is:g,not:y,then:k,otherwise:w}=n;s=a?s.try(a):u?s.conditional(u,{is:g,then:k,not:y,otherwise:w,switch:n.switch}):s.conditional(g,{then:k,otherwise:w})}return s}},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(s,{error:c,state:n}){if(!s.length)return{errors:c("alternatives.any")};if(s.length===1)return{errors:s[0].reports};const a=new Set,u=[];for(const{reports:g,schema:y}of s){if(g.length>1)return r.unmatched(s,c);const k=g[0];if(k instanceof l.Report==0)return r.unmatched(s,c);if(k.state.path.length!==n.path.length){u.push({type:y.type,report:k});continue}if(k.code==="any.only"){for(const x of k.local.valids)a.add(x);continue}const[w,d]=k.code.split(".");d!=="base"?u.push({type:y.type,report:k}):k.code==="object.base"?a.add(k.local.type):a.add(w)}return u.length?u.length===1?{errors:u[0].report}:r.unmatched(s,c):{errors:c("alternatives.types",{types:[...a]})}},r.unmatched=function(s,c){const n=[];for(const a of s)n.push(...a.reports);return{errors:c("alternatives.match",l.details(n,{override:!1}))}}},8068:(_,j,p)=>{const i=p(375),m=p(7629),f=p(8160),h=p(6914);_.exports=m.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(t,l){return i(typeof t=="function","Method must be a function"),i(l===void 0||l&&typeof l=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:l}})},validate(t,l,{method:o}){try{return o(t,l)}catch(r){return l.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){i(f.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");const l=this.clone();return l.$_terms.shared=l.$_terms.shared||[],l.$_terms.shared.push(t),l.$_mutateRegister(t),l}},warning:{method(t,l){return i(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:l},warn:!0})},validate:(t,l,{code:o,local:r})=>l.error(o,r),args:["code","local"],multi:!0}},modifiers:{keep(t,l=!0){t.keep=l},message(t,l){t.message=h.compile(l)},warn(t,l=!0){t.warn=l}},manifest:{build(t,l){for(const o in l){const r=l[o];if(["examples","externals","metas","notes","tags"].includes(o))for(const s of r)t=t[o.slice(0,-1)](s);else if(o!=="alterations")if(o!=="whens"){if(o==="shared")for(const s of r)t=t.shared(s)}else for(const s of r){const{ref:c,is:n,not:a,then:u,otherwise:g,concat:y}=s;t=y?t.concat(y):c?t.when(c,{is:n,not:a,then:u,otherwise:g,switch:s.switch,break:s.break}):t.when(n,{then:u,otherwise:g,break:s.break})}else{const s={};for(const{target:c,adjuster:n}of r)s[c]=n;t=t.alter(s)}}return t}},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,p)=>{const i=p(375),m=p(9474),f=p(9621),h=p(8068),t=p(8160),l=p(3292),o={};_.exports=h.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:s,state:c,prefs:n}){if(!Array.isArray(r))return;const a=s.$_getRule("sort");return a?o.sort(s,r,a.args.options,c,n):void 0}},validate(r,{schema:s,error:c}){if(!Array.isArray(r)){if(s._flags.single){const n=[r];return n[t.symbols.arraySingle]=!0,{value:n}}return{errors:c("array.base")}}if(s.$_getRule("items")||s.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const s=this.$_addRule({name:"has",args:{schema:r}});return s.$_mutateRegister(r),s},validate(r,{state:s,prefs:c,error:n},{schema:a}){const u=[r,...s.ancestors];for(let y=0;y<r.length;++y){const k=s.localize([...s.path,y],u,a);if(a.$_match(r[y],k,c))return r}const g=a._flags.label;return g?n("array.hasKnown",{patternLabel:g}):n("array.hasUnknown",null)},multi:!0},items:{method(...r){t.verifyFlat(r,"items");const s=this.$_addRule("items");for(let c=0;c<r.length;++c){const n=t.tryWithPath(()=>this.$_compile(r[c]),c,{append:!0});s.$_terms.items.push(n)}return s.$_mutateRebuild()},validate(r,{schema:s,error:c,state:n,prefs:a,errorsArray:u}){const g=s.$_terms._requireds.slice(),y=s.$_terms.ordered.slice(),k=[...s.$_terms._inclusions,...g],w=!r[t.symbols.arraySingle];delete r[t.symbols.arraySingle];const d=u();let x=r.length;for(let b=0;b<x;++b){const S=r[b];let A=!1,P=!1;const L=w?b:new Number(b),D=[...n.path,L];if(!s._flags.sparse&&S===void 0){if(d.push(c("array.sparse",{key:L,path:D,pos:b,value:void 0},n.localize(D))),a.abortEarly)return d;y.shift();continue}const N=[r,...n.ancestors];for(const z of s.$_terms._exclusions)if(z.$_match(S,n.localize(D,N,z),a,{presence:"ignore"})){if(d.push(c("array.excludes",{pos:b,value:S},n.localize(D))),a.abortEarly)return d;A=!0,y.shift();break}if(A)continue;if(s.$_terms.ordered.length){if(y.length){const z=y.shift(),F=z.$_validate(S,n.localize(D,N,z),a);if(F.errors){if(d.push(...F.errors),a.abortEarly)return d}else if(z._flags.result==="strip")o.fastSplice(r,b),--b,--x;else{if(!s._flags.sparse&&F.value===void 0){if(d.push(c("array.sparse",{key:L,path:D,pos:b,value:void 0},n.localize(D))),a.abortEarly)return d;continue}r[b]=F.value}continue}if(!s.$_terms.items.length){if(d.push(c("array.orderedLength",{pos:b,limit:s.$_terms.ordered.length})),a.abortEarly)return d;break}}const V=[];let B=g.length;for(let z=0;z<B;++z){const F=n.localize(D,N,g[z]);F.snapshot();const K=g[z].$_validate(S,F,a);if(V[z]=K,!K.errors){if(F.commit(),r[b]=K.value,P=!0,o.fastSplice(g,z),--z,--B,!s._flags.sparse&&K.value===void 0&&(d.push(c("array.sparse",{key:L,path:D,pos:b,value:void 0},n.localize(D))),a.abortEarly))return d;break}F.restore()}if(P)continue;const I=a.stripUnknown&&!!a.stripUnknown.arrays||!1;B=k.length;for(const z of k){let F;const K=g.indexOf(z);if(K!==-1)F=V[K];else{const he=n.localize(D,N,z);if(he.snapshot(),F=z.$_validate(S,he,a),!F.errors){he.commit(),z._flags.result==="strip"?(o.fastSplice(r,b),--b,--x):s._flags.sparse||F.value!==void 0?r[b]=F.value:(d.push(c("array.sparse",{key:L,path:D,pos:b,value:void 0},n.localize(D))),A=!0),P=!0;break}he.restore()}if(B===1){if(I){o.fastSplice(r,b),--b,--x,P=!0;break}if(d.push(...F.errors),a.abortEarly)return d;A=!0;break}}if(!A&&(s.$_terms._inclusions.length||s.$_terms._requireds.length)&&!P){if(I){o.fastSplice(r,b),--b,--x;continue}if(d.push(c("array.includes",{pos:b,value:S},n.localize(D))),a.abortEarly)return d}}return g.length&&o.fillMissedErrors(s,d,g,r,n,a),y.length&&(o.fillOrderedErrors(s,d,y,r,n,a),d.length||o.fillDefault(y,r,n,a)),d.length?d:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,s,{limit:c},{name:n,operator:a,args:u})=>t.compare(r.length,c,a)?r:s.error("array."+n,{limit:u.limit,value:r}),args:[{name:"limit",ref:!0,assert:t.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){t.verifyFlat(r,"ordered");const s=this.$_addRule("items");for(let c=0;c<r.length;++c){const n=t.tryWithPath(()=>this.$_compile(r[c]),c,{append:!0});o.validateSingle(n,s),s.$_mutateRegister(n),s.$_terms.ordered.push(n)}return s.$_mutateRebuild()}},single:{method(r){const s=r===void 0||!!r;return i(!s||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",s)}},sort:{method(r={}){t.assertOptions(r,["by","order"]);const s={order:r.order||"ascending"};return r.by&&(s.by=l.ref(r.by,{ancestor:0}),i(!s.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:s}})},validate(r,{error:s,state:c,prefs:n,schema:a},{options:u}){const{value:g,errors:y}=o.sort(a,r,u,c,n);if(y)return y;for(let k=0;k<r.length;++k)if(r[k]!==g[k])return s("array.sort",{order:u.order,by:u.by?u.by.key:"value"});return r},convert:!0},sparse:{method(r){const s=r===void 0||!!r;return this._flags.sparse===s?this:(s?this.clone():this.$_addRule("items")).$_setFlag("sparse",s,{clone:!1})}},unique:{method(r,s={}){i(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),t.assertOptions(s,["ignoreUndefined","separator"]);const c={name:"unique",args:{options:s,comparator:r}};if(r)if(typeof r=="string"){const n=t.default(s.separator,".");c.path=n?r.split(n):[r]}else c.comparator=r;return this.$_addRule(c)},validate(r,{state:s,error:c,schema:n},{comparator:a,options:u},{comparator:g,path:y}){const k={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},w=g||m,d=u.ignoreUndefined;for(let x=0;x<r.length;++x){const b=y?f(r[x],y):r[x],S=g?k.custom:k[typeof b];if(i(S,"Failed to find unique map container for type",typeof b),S instanceof Map){const A=S.entries();let P;for(;!(P=A.next()).done;)if(w(P.value[0],b)){const L=s.localize([...s.path,x],[r,...s.ancestors]),D={pos:x,value:r[x],dupePos:P.value[1],dupeValue:r[P.value[1]]};return y&&(D.path=a),c("array.unique",D,L)}S.set(b,x)}else{if((!d||b!==void 0)&&S[b]!==void 0){const A={pos:x,value:r[x],dupePos:S[b],dupeValue:r[S[b]]};return y&&(A.path=a),c("array.unique",A,s.localize([...s.path,x],[r,...s.ancestors]))}S[b]=x}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,s)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const s of r.$_terms.items)o.validateSingle(s,r),s._flags.presence==="required"?r.$_terms._requireds.push(s):s._flags.presence==="forbidden"?r.$_terms._exclusions.push(s):r.$_terms._inclusions.push(s);for(const s of r.$_terms.ordered)o.validateSingle(s,r)},manifest:{build:(r,s)=>(s.items&&(r=r.items(...s.items)),s.ordered&&(r=r.ordered(...s.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"}}),o.fillMissedErrors=function(r,s,c,n,a,u){const g=[];let y=0;for(const k of c){const w=k._flags.label;w?g.push(w):++y}g.length?y?s.push(r.$_createError("array.includesRequiredBoth",n,{knownMisses:g,unknownMisses:y},a,u)):s.push(r.$_createError("array.includesRequiredKnowns",n,{knownMisses:g},a,u)):s.push(r.$_createError("array.includesRequiredUnknowns",n,{unknownMisses:y},a,u))},o.fillOrderedErrors=function(r,s,c,n,a,u){const g=[];for(const y of c)y._flags.presence==="required"&&g.push(y);g.length&&o.fillMissedErrors(r,s,g,n,a,u)},o.fillDefault=function(r,s,c,n){const a=[];let u=!0;for(let g=r.length-1;g>=0;--g){const y=r[g],k=[s,...c.ancestors],w=y.$_validate(void 0,c.localize(c.path,k,y),n).value;if(u){if(w===void 0)continue;u=!1}a.unshift(w)}a.length&&s.push(...a)},o.fastSplice=function(r,s){let c=s;for(;c<r.length;)r[c++]=r[c];--r.length},o.validateSingle=function(r,s){(r.type==="array"||r._flags._arrayItems)&&(i(!s._flags.single,"Cannot specify array item with single rule enabled"),s.$_setFlag("_arrayItems",!0,{clone:!1}))},o.sort=function(r,s,c,n,a){const u=c.order==="ascending"?1:-1,g=-1*u,y=u,k=(w,d)=>{let x=o.compare(w,d,g,y);if(x!==null||(c.by&&(w=c.by.resolve(w,n,a),d=c.by.resolve(d,n,a)),x=o.compare(w,d,g,y),x!==null))return x;const b=typeof w;if(b!==typeof d)throw r.$_createError("array.sort.mismatching",s,null,n,a);if(b!=="number"&&b!=="string")throw r.$_createError("array.sort.unsupported",s,{type:b},n,a);return b==="number"?(w-d)*u:w<d?g:y};try{return{value:s.slice().sort(k)}}catch(w){return{errors:w}}},o.compare=function(r,s,c,n){return r===s?0:r===void 0?1:s===void 0?-1:r===null?n:s===null?c:null}},4937:(_,j,p)=>{const i=p(375),m=p(8068),f=p(8160),h=p(2036),t={isBool:function(l){return typeof l=="boolean"}};_.exports=m.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(l,{schema:o}){if(typeof l!="boolean"){if(typeof l=="string"){const r=o._flags.sensitive?l:l.toLowerCase();l=r==="true"||r!=="false"&&l}return typeof l!="boolean"&&(l=o.$_terms.truthy&&o.$_terms.truthy.has(l,null,null,!o._flags.sensitive)||(!o.$_terms.falsy||!o.$_terms.falsy.has(l,null,null,!o._flags.sensitive))&&l),{value:l}}},validate(l,{error:o}){if(typeof l!="boolean")return{value:l,errors:o("boolean.base")}},rules:{truthy:{method(...l){f.verifyFlat(l,"truthy");const o=this.clone();o.$_terms.truthy=o.$_terms.truthy||new h;for(let r=0;r<l.length;++r){const s=l[r];i(s!==void 0,"Cannot call truthy with undefined"),o.$_terms.truthy.add(s)}return o}},falsy:{method(...l){f.verifyFlat(l,"falsy");const o=this.clone();o.$_terms.falsy=o.$_terms.falsy||new h;for(let r=0;r<l.length;++r){const s=l[r];i(s!==void 0,"Cannot call falsy with undefined"),o.$_terms.falsy.add(s)}return o}},sensitive:{method(l=!0){return this.$_setFlag("sensitive",l)}}},cast:{number:{from:t.isBool,to:(l,o)=>l?1:0},string:{from:t.isBool,to:(l,o)=>l?"true":"false"}},manifest:{build:(l,o)=>(o.truthy&&(l=l.truthy(...o.truthy)),o.falsy&&(l=l.falsy(...o.falsy)),l)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(_,j,p)=>{const i=p(375),m=p(8068),f=p(8160),h=p(3328),t={isDate:function(l){return l instanceof Date}};_.exports=m.extend({type:"date",coerce:{from:["number","string"],method:(l,{schema:o})=>({value:t.parse(l,o._flags.format)||l})},validate(l,{schema:o,error:r,prefs:s}){if(l instanceof Date&&!isNaN(l.getTime()))return;const c=o._flags.format;return s.convert&&c&&typeof l=="string"?{value:l,errors:r("date.format",{format:c})}:{value:l,errors:r("date.base")}},rules:{compare:{method:!1,validate(l,o,{date:r},{name:s,operator:c,args:n}){const a=r==="now"?Date.now():r.getTime();return f.compare(l.getTime(),a,c)?l:o.error("date."+s,{limit:n.date,value:l})},args:[{name:"date",ref:!0,normalize:l=>l==="now"?l:t.parse(l),assert:l=>l!==null,message:"must have a valid date format"}]},format:{method(l){return i(["iso","javascript","unix"].includes(l),"Unknown date format",l),this.$_setFlag("format",l)}},greater:{method(l){return this.$_addRule({name:"greater",method:"compare",args:{date:l},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(l){return this.$_addRule({name:"less",method:"compare",args:{date:l},operator:"<"})}},max:{method(l){return this.$_addRule({name:"max",method:"compare",args:{date:l},operator:"<="})}},min:{method(l){return this.$_addRule({name:"min",method:"compare",args:{date:l},operator:">="})}},timestamp:{method(l="javascript"){return i(["javascript","unix"].includes(l),'"type" must be one of "javascript, unix"'),this.format(l)}}},cast:{number:{from:t.isDate,to:(l,o)=>l.getTime()},string:{from:t.isDate,to:(l,{prefs:o})=>h.date(l,o)}},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"}}),t.parse=function(l,o){if(l instanceof Date)return l;if(typeof l!="string"&&(isNaN(l)||!isFinite(l))||/^\s*$/.test(l))return null;if(o==="iso")return f.isIsoDate(l)?t.date(l.toString()):null;const r=l;if(typeof l=="string"&&/^[+-]?\d+(\.\d+)?$/.test(l)&&(l=parseFloat(l)),o){if(o==="javascript")return t.date(1*l);if(o==="unix")return t.date(1e3*l);if(typeof r=="string")return null}return t.date(l)},t.date=function(l){const o=new Date(l);return isNaN(o.getTime())?null:o}},390:(_,j,p)=>{const i=p(375),m=p(7824);_.exports=m.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(f){return i(Number.isSafeInteger(f)&&f>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:f}})},validate:(f,h,{n:t})=>f.length===t?f:h.error("function.arity",{n:t})},class:{method(){return this.$_addRule("class")},validate:(f,h)=>/^\s*class\s/.test(f.toString())?f:h.error("function.class",{value:f})},minArity:{method(f){return i(Number.isSafeInteger(f)&&f>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:f}})},validate:(f,h,{n:t})=>f.length>=t?f:h.error("function.minArity",{n:t})},maxArity:{method(f){return i(Number.isSafeInteger(f)&&f>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:f}})},validate:(f,h,{n:t})=>f.length<=t?f:h.error("function.maxArity",{n:t})}},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,p)=>{const i=p(978),m=p(375),f=p(8571),h=p(3652),t=p(8068),l=p(8160),o=p(3292),r=p(6354),s=p(6133),c=p(3328),n={renameDefaults:{alias:!1,multiple:!1,override:!1}};_.exports=t.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:(a,u)=>a.keys(u),validate(a,{schema:u,error:g,state:y,prefs:k}){if(!a||typeof a!==u.$_property("typeof")||Array.isArray(a))return{value:a,errors:g("object.base",{type:u.$_property("typeof")})};if(!(u.$_terms.renames||u.$_terms.dependencies||u.$_terms.keys||u.$_terms.patterns||u.$_terms.externals))return;a=n.clone(a,k);const w=[];if(u.$_terms.renames&&!n.rename(u,a,y,k,w))return{value:a,errors:w};if(!u.$_terms.keys&&!u.$_terms.patterns&&!u.$_terms.dependencies)return{value:a,errors:w};const d=new Set(Object.keys(a));if(u.$_terms.keys){const x=[a,...y.ancestors];for(const b of u.$_terms.keys){const S=b.key,A=a[S];d.delete(S);const P=y.localize([...y.path,S],x,b),L=b.schema.$_validate(A,P,k);if(L.errors){if(k.abortEarly)return{value:a,errors:L.errors};L.value!==void 0&&(a[S]=L.value),w.push(...L.errors)}else b.schema._flags.result==="strip"||L.value===void 0&&A!==void 0?delete a[S]:L.value!==void 0&&(a[S]=L.value)}}if(d.size||u._flags._hasPatternMatch){const x=n.unknown(u,a,d,w,y,k);if(x)return x}if(u.$_terms.dependencies)for(const x of u.$_terms.dependencies){if(x.key!==null&&n.isPresent(x.options)(x.key.resolve(a,y,k,null,{shadow:!1}))===!1)continue;const b=n.dependencies[x.rel](u,x,a,y,k);if(b){const S=u.$_createError(b.code,a,b.context,y,k);if(k.abortEarly)return{value:a,errors:S};w.push(S)}}return{value:a,errors:w}},rules:{and:{method(...a){return l.verifyFlat(a,"and"),n.dependency(this,"and",null,a)}},append:{method(a){return a==null||Object.keys(a).length===0?this:this.keys(a)}},assert:{method(a,u,g){c.isTemplate(a)||(a=o.ref(a)),m(g===void 0||typeof g=="string","Message must be a string"),u=this.$_compile(u,{appendPath:!0});const y=this.$_addRule({name:"assert",args:{subject:a,schema:u,message:g}});return y.$_mutateRegister(a),y.$_mutateRegister(u),y},validate(a,{error:u,prefs:g,state:y},{subject:k,schema:w,message:d}){const x=k.resolve(a,y,g),b=s.isRef(k)?k.absolute(y):[];return w.$_match(x,y.localize(b,[a,...y.ancestors],w),g)?a:u("object.assert",{subject:k,message:d})},args:["subject","schema","message"],multi:!0},instance:{method(a,u){return m(typeof a=="function","constructor must be a function"),u=u||a.name,this.$_addRule({name:"instance",args:{constructor:a,name:u}})},validate:(a,u,{constructor:g,name:y})=>a instanceof g?a:u.error("object.instance",{type:y,value:a}),args:["constructor","name"]},keys:{method(a){m(a===void 0||typeof a=="object","Object schema must be a valid object"),m(!l.isSchema(a),"Object schema cannot be a joi schema");const u=this.clone();if(a)if(Object.keys(a).length){u.$_terms.keys=u.$_terms.keys?u.$_terms.keys.filter(g=>!a.hasOwnProperty(g.key)):new n.Keys;for(const g in a)l.tryWithPath(()=>u.$_terms.keys.push({key:g,schema:this.$_compile(a[g])}),g)}else u.$_terms.keys=new n.Keys;else u.$_terms.keys=null;return u.$_mutateRebuild()}},length:{method(a){return this.$_addRule({name:"length",args:{limit:a},operator:"="})},validate:(a,u,{limit:g},{name:y,operator:k,args:w})=>l.compare(Object.keys(a).length,g,k)?a:u.error("object."+y,{limit:w.limit,value:a}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(a){return this.$_addRule({name:"max",method:"length",args:{limit:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"length",args:{limit:a},operator:">="})}},nand:{method(...a){return l.verifyFlat(a,"nand"),n.dependency(this,"nand",null,a)}},or:{method(...a){return l.verifyFlat(a,"or"),n.dependency(this,"or",null,a)}},oxor:{method(...a){return n.dependency(this,"oxor",null,a)}},pattern:{method(a,u,g={}){const y=a instanceof RegExp;y||(a=this.$_compile(a,{appendPath:!0})),m(u!==void 0,"Invalid rule"),l.assertOptions(g,["fallthrough","matches"]),y&&m(!a.flags.includes("g")&&!a.flags.includes("y"),"pattern should not use global or sticky mode"),u=this.$_compile(u,{appendPath:!0});const k=this.clone();k.$_terms.patterns=k.$_terms.patterns||[];const w={[y?"regex":"schema"]:a,rule:u};return g.matches&&(w.matches=this.$_compile(g.matches),w.matches.type!=="array"&&(w.matches=w.matches.$_root.array().items(w.matches)),k.$_mutateRegister(w.matches),k.$_setFlag("_hasPatternMatch",!0,{clone:!1})),g.fallthrough&&(w.fallthrough=!0),k.$_terms.patterns.push(w),k.$_mutateRegister(u),k}},ref:{method(){return this.$_addRule("ref")},validate:(a,u)=>s.isRef(a)?a:u.error("object.refType",{value:a})},regex:{method(){return this.$_addRule("regex")},validate:(a,u)=>a instanceof RegExp?a:u.error("object.regex",{value:a})},rename:{method(a,u,g={}){m(typeof a=="string"||a instanceof RegExp,"Rename missing the from argument"),m(typeof u=="string"||u instanceof c,"Invalid rename to argument"),m(u!==a,"Cannot rename key to same name:",a),l.assertOptions(g,["alias","ignoreUndefined","override","multiple"]);const y=this.clone();y.$_terms.renames=y.$_terms.renames||[];for(const k of y.$_terms.renames)m(k.from!==a,"Cannot rename the same key multiple times");return u instanceof c&&y.$_mutateRegister(u),y.$_terms.renames.push({from:a,to:u,options:i(n.renameDefaults,g)}),y}},schema:{method(a="any"){return this.$_addRule({name:"schema",args:{type:a}})},validate:(a,u,{type:g})=>!l.isSchema(a)||g!=="any"&&a.type!==g?u.error("object.schema",{type:g}):a},unknown:{method(a){return this.$_setFlag("unknown",a!==!1)}},with:{method(a,u,g={}){return n.dependency(this,"with",a,u,g)}},without:{method(a,u,g={}){return n.dependency(this,"without",a,u,g)}},xor:{method(...a){return l.verifyFlat(a,"xor"),n.dependency(this,"xor",null,a)}}},overrides:{default(a,u){return a===void 0&&(a=l.symbols.deepDefault),this.$_parent("default",a,u)}},rebuild(a){if(a.$_terms.keys){const u=new h.Sorter;for(const g of a.$_terms.keys)l.tryWithPath(()=>u.add(g,{after:g.schema.$_rootReferences(),group:g.key}),g.key);a.$_terms.keys=new n.Keys(...u.nodes)}},manifest:{build(a,u){if(u.keys&&(a=a.keys(u.keys)),u.dependencies)for(const{rel:g,key:y=null,peers:k,options:w}of u.dependencies)a=n.dependency(a,g,y,k,w);if(u.patterns)for(const{regex:g,schema:y,rule:k,fallthrough:w,matches:d}of u.patterns)a=a.pattern(g||y,k,{fallthrough:w,matches:d});if(u.renames)for(const{from:g,to:y,options:k}of u.renames)a=a.rename(g,y,k);return a}},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}}"}}),n.clone=function(a,u){if(typeof a=="object"){if(u.nonEnumerables)return f(a,{shallow:!0});const y=Object.create(Object.getPrototypeOf(a));return Object.assign(y,a),y}const g=function(...y){return a.apply(this,y)};return g.prototype=f(a.prototype),Object.defineProperty(g,"name",{value:a.name,writable:!1}),Object.defineProperty(g,"length",{value:a.length,writable:!1}),Object.assign(g,a),g},n.dependency=function(a,u,g,y,k){m(g===null||typeof g=="string",u,"key must be a strings"),k||(k=y.length>1&&typeof y[y.length-1]=="object"?y.pop():{}),l.assertOptions(k,["separator","isPresent"]),y=[].concat(y);const w=l.default(k.separator,"."),d=[];for(const b of y)m(typeof b=="string",u,"peers must be strings"),d.push(o.ref(b,{separator:w,ancestor:0,prefix:!1}));g!==null&&(g=o.ref(g,{separator:w,ancestor:0,prefix:!1}));const x=a.clone();return x.$_terms.dependencies=x.$_terms.dependencies||[],x.$_terms.dependencies.push(new n.Dependency(u,g,d,y,k)),x},n.dependencies={and(a,u,g,y,k){const w=[],d=[],x=u.peers.length,b=n.isPresent(u.options);for(const S of u.peers)b(S.resolve(g,y,k,null,{shadow:!1}))===!1?w.push(S.key):d.push(S.key);if(w.length!==x&&d.length!==x)return{code:"object.and",context:{present:d,presentWithLabels:n.keysToLabels(a,d),missing:w,missingWithLabels:n.keysToLabels(a,w)}}},nand(a,u,g,y,k){const w=[],d=n.isPresent(u.options);for(const S of u.peers)d(S.resolve(g,y,k,null,{shadow:!1}))&&w.push(S.key);if(w.length!==u.peers.length)return;const x=u.paths[0],b=u.paths.slice(1);return{code:"object.nand",context:{main:x,mainWithLabel:n.keysToLabels(a,x),peers:b,peersWithLabels:n.keysToLabels(a,b)}}},or(a,u,g,y,k){const w=n.isPresent(u.options);for(const d of u.peers)if(w(d.resolve(g,y,k,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:u.paths,peersWithLabels:n.keysToLabels(a,u.paths)}}},oxor(a,u,g,y,k){const w=[],d=n.isPresent(u.options);for(const b of u.peers)d(b.resolve(g,y,k,null,{shadow:!1}))&&w.push(b.key);if(!w.length||w.length===1)return;const x={peers:u.paths,peersWithLabels:n.keysToLabels(a,u.paths)};return x.present=w,x.presentWithLabels=n.keysToLabels(a,w),{code:"object.oxor",context:x}},with(a,u,g,y,k){const w=n.isPresent(u.options);for(const d of u.peers)if(w(d.resolve(g,y,k,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:u.key.key,mainWithLabel:n.keysToLabels(a,u.key.key),peer:d.key,peerWithLabel:n.keysToLabels(a,d.key)}}},without(a,u,g,y,k){const w=n.isPresent(u.options);for(const d of u.peers)if(w(d.resolve(g,y,k,null,{shadow:!1})))return{code:"object.without",context:{main:u.key.key,mainWithLabel:n.keysToLabels(a,u.key.key),peer:d.key,peerWithLabel:n.keysToLabels(a,d.key)}}},xor(a,u,g,y,k){const w=[],d=n.isPresent(u.options);for(const b of u.peers)d(b.resolve(g,y,k,null,{shadow:!1}))&&w.push(b.key);if(w.length===1)return;const x={peers:u.paths,peersWithLabels:n.keysToLabels(a,u.paths)};return w.length===0?{code:"object.missing",context:x}:(x.present=w,x.presentWithLabels=n.keysToLabels(a,w),{code:"object.xor",context:x})}},n.keysToLabels=function(a,u){return Array.isArray(u)?u.map(g=>a.$_mapLabels(g)):a.$_mapLabels(u)},n.isPresent=function(a){return typeof a.isPresent=="function"?a.isPresent:u=>u!==void 0},n.rename=function(a,u,g,y,k){const w={};for(const d of a.$_terms.renames){const x=[],b=typeof d.from!="string";if(b)for(const S in u){if(u[S]===void 0&&d.options.ignoreUndefined||S===d.to)continue;const A=d.from.exec(S);A&&x.push({from:S,to:d.to,match:A})}else!Object.prototype.hasOwnProperty.call(u,d.from)||u[d.from]===void 0&&d.options.ignoreUndefined||x.push(d);for(const S of x){const A=S.from;let P=S.to;if(P instanceof c&&(P=P.render(u,g,y,S.match)),A!==P){if(!d.options.multiple&&w[P]&&(k.push(a.$_createError("object.rename.multiple",u,{from:A,to:P,pattern:b},g,y)),y.abortEarly)||Object.prototype.hasOwnProperty.call(u,P)&&!d.options.override&&!w[P]&&(k.push(a.$_createError("object.rename.override",u,{from:A,to:P,pattern:b},g,y)),y.abortEarly))return!1;u[A]===void 0?delete u[P]:u[P]=u[A],w[P]=!0,d.options.alias||delete u[A]}}}return!0},n.unknown=function(a,u,g,y,k,w){if(a.$_terms.patterns){let d=!1;const x=a.$_terms.patterns.map(S=>{if(S.matches)return d=!0,[]}),b=[u,...k.ancestors];for(const S of g){const A=u[S],P=[...k.path,S];for(let L=0;L<a.$_terms.patterns.length;++L){const D=a.$_terms.patterns[L];if(D.regex){const B=D.regex.test(S);if(k.mainstay.tracer.debug(k,"rule",`pattern.${L}`,B?"pass":"error"),!B)continue}else if(!D.schema.$_match(S,k.nest(D.schema,`pattern.${L}`),w))continue;g.delete(S);const N=k.localize(P,b,{schema:D.rule,key:S}),V=D.rule.$_validate(A,N,w);if(V.errors){if(w.abortEarly)return{value:u,errors:V.errors};y.push(...V.errors)}if(D.matches&&x[L].push(S),u[S]=V.value,!D.fallthrough)break}}if(d)for(let S=0;S<x.length;++S){const A=x[S];if(!A)continue;const P=a.$_terms.patterns[S].matches,L=k.localize(k.path,b,P),D=P.$_validate(A,L,w);if(D.errors){const N=r.details(D.errors,{override:!1});N.matches=A;const V=a.$_createError("object.pattern.match",u,N,k,w);if(w.abortEarly)return{value:u,errors:V};y.push(V)}}}if(g.size&&(a.$_terms.keys||a.$_terms.patterns)){if(w.stripUnknown&&a._flags.unknown===void 0||w.skipFunctions){const d=!(!w.stripUnknown||w.stripUnknown!==!0&&!w.stripUnknown.objects);for(const x of g)d?(delete u[x],g.delete(x)):typeof u[x]=="function"&&g.delete(x)}if(!l.default(a._flags.unknown,w.allowUnknown))for(const d of g){const x=k.localize([...k.path,d],[]),b=a.$_createError("object.unknown",u[d],{child:d},x,w,{flags:!1});if(w.abortEarly)return{value:u,errors:b};y.push(b)}}},n.Dependency=class{constructor(a,u,g,y,k){this.rel=a,this.key=u,this.peers=g,this.paths=y,this.options=k}describe(){const a={rel:this.rel,peers:this.paths};return this.key!==null&&(a.key=this.key.key),this.peers[0].separator!=="."&&(a.options={...a.options,separator:this.peers[0].separator}),this.options.isPresent&&(a.options={...a.options,isPresent:this.options.isPresent}),a}},n.Keys=class extends Array{concat(a){const u=this.slice(),g=new Map;for(let y=0;y<u.length;++y)g.set(u[y].key,y);for(const y of a){const k=y.key,w=g.get(k);w!==void 0?u[w]={key:k,schema:u[w].schema.concat(y.schema)}:u.push(y)}return u}}},8785:(_,j,p)=>{const i=p(375),m=p(8068),f=p(8160),h=p(3292),t=p(6354),l={};_.exports=m.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(o,r)=>o.ref(r),validate(o,{schema:r,state:s,prefs:c}){i(r.$_terms.link,"Uninitialized link schema");const n=l.generate(r,o,s,c),a=r.$_terms.link[0].ref;return n.$_validate(o,s.nest(n,`link:${a.display}:${n.type}`),c)},generate:(o,r,s,c)=>l.generate(o,r,s,c),rules:{ref:{method(o){i(!this.$_terms.link,"Cannot reinitialize schema"),o=h.ref(o),i(o.type==="value"||o.type==="local","Invalid reference type:",o.type),i(o.type==="local"||o.ancestor==="root"||o.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:o}],r}},relative:{method(o=!0){return this.$_setFlag("relative",o)}}},overrides:{concat(o){i(this.$_terms.link,"Uninitialized link schema"),i(f.isSchema(o),"Invalid schema object"),i(o.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:o}),r.$_mutateRebuild()}},manifest:{build:(o,r)=>(i(r.link,"Invalid link description missing link"),o.ref(r.link))}}),l.generate=function(o,r,s,c){let n=s.mainstay.links.get(o);if(n)return n._generate(r,s,c).schema;const a=o.$_terms.link[0].ref,{perspective:u,path:g}=l.perspective(a,s);l.assert(u,"which is outside of schema boundaries",a,o,s,c);try{n=g.length?u.$_reach(g):u}catch{l.assert(!1,"to non-existing schema",a,o,s,c)}return l.assert(n.type!=="link","which is another link",a,o,s,c),o._flags.relative||s.mainstay.links.set(o,n),n._generate(r,s,c).schema},l.perspective=function(o,r){if(o.type==="local"){for(const{schema:s,key:c}of r.schemas){if((s._flags.id||c)===o.path[0])return{perspective:s,path:o.path.slice(1)};if(s.$_terms.shared){for(const n of s.$_terms.shared)if(n._flags.id===o.path[0])return{perspective:n,path:o.path.slice(1)}}}return{perspective:null,path:null}}return o.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:o.path}:{perspective:r.schemas[o.ancestor]&&r.schemas[o.ancestor].schema,path:o.path}},l.assert=function(o,r,s,c,n,a){o||i(!1,`"${t.label(c._flags,n,a)}" contains link reference "${s.display}" ${r}`)}},3832:(_,j,p)=>{const i=p(375),m=p(8068),f=p(8160),h={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){const l=t.toString(),o=l.indexOf("."),r=l.indexOf("e");return(o<0?0:(r<0?l.length:r)-o-1)+(r<0?0:Math.max(0,-parseInt(l.slice(r+1))))}};_.exports=m.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:l,error:o}){if(!t.match(h.numberRx))return;t=t.trim();const r={value:parseFloat(t)};if(r.value===0&&(r.value=0),!l._flags.unsafe)if(t.match(/e/i)){if(h.extractSignificantDigits(t)!==h.extractSignificantDigits(String(r.value)))return r.errors=o("number.unsafe"),r}else{const s=r.value.toString();if(s.match(/e/i))return r;if(s!==h.normalizeDecimal(t))return r.errors=o("number.unsafe"),r}return r}},validate(t,{schema:l,error:o,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:o("number.infinity")};if(!f.isNumber(t))return{value:t,errors:o("number.base")};const s={value:t};if(r.convert){const c=l.$_getRule("precision");if(c){const n=Math.pow(10,c.args.limit);s.value=Math.round(s.value*n)/n}}return s.value===0&&(s.value=0),!l._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(s.errors=o("number.unsafe")),s},rules:{compare:{method:!1,validate:(t,l,{limit:o},{name:r,operator:s,args:c})=>f.compare(t,o,s)?t:l.error("number."+r,{limit:c.limit,value:t}),args:[{name:"limit",ref:!0,assert:f.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(t,l)=>Math.trunc(t)-t==0?t:l.error("number.integer")},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){const l=typeof t=="number"?h.decimalPlaces(t):null,o=Math.pow(10,l);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:l,pfactor:o}})},validate:(t,l,{base:o,baseDecimalPlace:r,pfactor:s},c)=>h.decimalPlaces(t)>r?l.error("number.multiple",{multiple:c.args.base,value:t}):Math.round(s*t)%Math.round(s*o)==0?t:l.error("number.multiple",{multiple:c.args.base,value:t}),args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(t,l)=>Number.isSafeInteger(t)&&t>=0&&t<=65535?t:l.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(t){return i(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,l,{limit:o}){const r=t.toString().match(h.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=o?t:l.error("number.precision",{limit:o,value:t})},convert:!0},sign:{method(t){return i(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate:(t,l,{sign:o})=>o==="negative"&&t<0||o==="positive"&&t>0?t:l.error(`number.${o}`)},unsafe:{method(t=!0){return i(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to:(t,l)=>t.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"}}),h.extractSignificantDigits=function(t){return t.replace(h.exponentialPartRegex,"").replace(h.dotRegex,"").replace(h.trailingZerosRegex,"").replace(h.leadingSignAndZerosRegex,"")},h.normalizeDecimal=function(t){return(t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}},8966:(_,j,p)=>{const i=p(7824);_.exports=i.extend({type:"object",cast:{map:{from:m=>m&&typeof m=="object",to:(m,f)=>new Map(Object.entries(m))}}})},7417:(_,j,p)=>{const i=p(375),m=p(5380),f=p(1745),h=p(9959),t=p(6064),l=p(9926),o=p(5752),r=p(8068),s=p(8160),c={tlds:l instanceof Set&&{tlds:{allow:l,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:h.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"]};_.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(n,{schema:a,state:u,prefs:g}){const y=a.$_getRule("normalize");y&&(n=n.normalize(y.args.form));const k=a.$_getRule("case");k&&(n=k.args.direction==="upper"?n.toLocaleUpperCase():n.toLocaleLowerCase());const w=a.$_getRule("trim");if(w&&w.args.enabled&&(n=n.trim()),a.$_terms.replacements)for(const x of a.$_terms.replacements)n=n.replace(x.pattern,x.replacement);const d=a.$_getRule("hex");if(d&&d.args.options.byteAligned&&n.length%2!=0&&(n=`0${n}`),a.$_getRule("isoDate")){const x=c.isoDate(n);x&&(n=x)}if(a._flags.truncate){const x=a.$_getRule("max");if(x){let b=x.args.limit;if(s.isResolvable(b)&&(b=b.resolve(n,u,g),!s.limit(b)))return{value:n,errors:a.$_createError("any.ref",b,{ref:x.args.limit,arg:"limit",reason:"must be a positive integer"},u,g)};n=n.slice(0,b)}}return{value:n}}},validate(n,{schema:a,error:u}){if(typeof n!="string")return{value:n,errors:u("string.base")};if(n===""){const g=a.$_getRule("min");return g&&g.args.limit===0?void 0:{value:n,errors:u("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(n,a)=>/^[a-zA-Z0-9]+$/.test(n)?n:a.error("string.alphanum")},base64:{method(n={}){return s.assertOptions(n,["paddingRequired","urlSafe"]),n={urlSafe:!1,paddingRequired:!0,...n},i(typeof n.paddingRequired=="boolean","paddingRequired must be boolean"),i(typeof n.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:n}})},validate:(n,a,{options:u})=>c.base64Regex[u.paddingRequired][u.urlSafe].test(n)?n:a.error("string.base64")},case:{method(n){return i(["lower","upper"].includes(n),"Invalid case:",n),this.$_addRule({name:"case",args:{direction:n}})},validate:(n,a,{direction:u})=>u==="lower"&&n===n.toLocaleLowerCase()||u==="upper"&&n===n.toLocaleUpperCase()?n:a.error(`string.${u}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(n,a){let u=n.length,g=0,y=1;for(;u--;){const k=n.charAt(u)*y;g+=k-9*(k>9),y^=3}return g>0&&g%10==0?n:a.error("string.creditCard")}},dataUri:{method(n={}){return s.assertOptions(n,["paddingRequired"]),n={paddingRequired:!0,...n},i(typeof n.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:n}})},validate(n,a,{options:u}){const g=n.match(c.dataUriRegex);return g&&(!g[2]||g[2]!=="base64"||c.base64Regex[u.paddingRequired].false.test(g[3]))?n:a.error("string.dataUri")}},domain:{method(n){n&&s.assertOptions(n,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const a=c.addressOptions(n);return this.$_addRule({name:"domain",args:{options:n},address:a})},validate:(n,a,u,{address:g})=>m.isValid(n,g)?n:a.error("string.domain")},email:{method(n={}){s.assertOptions(n,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),i(n.multiple===void 0||typeof n.multiple=="boolean","multiple option must be an boolean");const a=c.addressOptions(n),u=new RegExp(`\\s*[${n.separator?t(n.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:n},regex:u,address:a})},validate(n,a,{options:u},{regex:g,address:y}){const k=u.multiple?n.split(g):[n],w=[];for(const d of k)f.isValid(d,y)||w.push(d);return w.length?a.error("string.email",{value:n,invalids:w}):n}},guid:{alias:"uuid",method(n={}){s.assertOptions(n,["version","separator"]);let a="";if(n.version){const y=[].concat(n.version);i(y.length>=1,"version must have at least 1 valid version specified");const k=new Set;for(let w=0;w<y.length;++w){const d=y[w];i(typeof d=="string","version at position "+w+" must be a string");const x=c.guidVersions[d.toLowerCase()];i(x,"version at position "+w+" must be one of "+Object.keys(c.guidVersions).join(", ")),i(!k.has(x),"version at position "+w+" must not be a duplicate"),a+=x,k.add(x)}}i(c.guidSeparators.has(n.separator),'separator must be one of true, false, "-", or ":"');const u=n.separator===void 0?"[:-]?":n.separator===!0?"[:-]":n.separator===!1?"[]?":`\\${n.separator}`,g=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${u})[0-9A-F]{4}\\2?[${a||"0-9A-F"}][0-9A-F]{3}\\2?[${a?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:n},regex:g})},validate(n,a,u,{regex:g}){const y=g.exec(n);return y?c.guidBrackets[y[1]]!==y[y.length-1]?a.error("string.guid"):n:a.error("string.guid")}},hex:{method(n={}){return s.assertOptions(n,["byteAligned","prefix"]),n={byteAligned:!1,prefix:!1,...n},i(typeof n.byteAligned=="boolean","byteAligned must be boolean"),i(typeof n.prefix=="boolean"||n.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:n}})},validate:(n,a,{options:u})=>(u.prefix==="optional"?c.hexRegex.withOptionalPrefix:u.prefix===!0?c.hexRegex.withPrefix:c.hexRegex.withoutPrefix).test(n)?u.byteAligned&&n.length%2!=0?a.error("string.hexAlign"):n:a.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(n,a)=>m.isValid(n,{minDomainSegments:1})||c.ipRegex.test(n)?n:a.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(n={}){s.assertOptions(n,["cidr","version"]);const{cidr:a,versions:u,regex:g}=h.regex(n),y=n.version?u:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:a,version:y}},regex:g})},validate:(n,a,{options:u},{regex:g})=>g.test(n)?n:u.version?a.error("string.ipVersion",{value:n,cidr:u.cidr,version:u.version}):a.error("string.ip",{value:n,cidr:u.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(n,{error:a})=>c.isoDate(n)?n:a("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(n,a)=>c.isoDurationRegex.test(n)?n:a.error("string.isoDuration")},length:{method(n,a){return c.length(this,"length",n,"=",a)},validate(n,a,{limit:u,encoding:g},{name:y,operator:k,args:w}){const d=!g&&n.length;return s.compare(d,u,k)?n:a.error("string."+y,{limit:w.limit,value:n,encoding:g})},args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(n,a){return c.length(this,"max",n,"<=",a)},args:["limit","encoding"]},min:{method(n,a){return c.length(this,"min",n,">=",a)},args:["limit","encoding"]},normalize:{method(n="NFC"){return i(c.normalizationForms.includes(n),"normalization form must be one of "+c.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:n}})},validate:(n,{error:a},{form:u})=>n===n.normalize(u)?n:a("string.normalize",{value:n,form:u}),convert:!0},pattern:{alias:"regex",method(n,a={}){i(n instanceof RegExp,"regex must be a RegExp"),i(!n.flags.includes("g")&&!n.flags.includes("y"),"regex should not use global or sticky mode"),typeof a=="string"&&(a={name:a}),s.assertOptions(a,["invert","name"]);const u=["string.pattern",a.invert?".invert":"",a.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:n,options:a},errorCode:u})},validate:(n,a,{regex:u,options:g},{errorCode:y})=>u.test(n)^g.invert?n:a.error(y,{name:g.name,regex:u,value:n}),args:["regex","options"],multi:!0},replace:{method(n,a){typeof n=="string"&&(n=new RegExp(t(n),"g")),i(n instanceof RegExp,"pattern must be a RegExp"),i(typeof a=="string","replacement must be a String");const u=this.clone();return u.$_terms.replacements||(u.$_terms.replacements=[]),u.$_terms.replacements.push({pattern:n,replacement:a}),u}},token:{method(){return this.$_addRule("token")},validate:(n,a)=>/^\w+$/.test(n)?n:a.error("string.token")},trim:{method(n=!0){return i(typeof n=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:n}})},validate:(n,a,{enabled:u})=>u&&n!==n.trim()?a.error("string.trim"):n,convert:!0},truncate:{method(n=!0){return i(typeof n=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",n)}},uppercase:{method(){return this.case("upper")}},uri:{method(n={}){s.assertOptions(n,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),n.domain&&s.assertOptions(n.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:a,scheme:u}=o.regex(n),g=n.domain?c.addressOptions(n.domain):null;return this.$_addRule({name:"uri",args:{options:n},regex:a,domain:g,scheme:u})},validate(n,a,{options:u},{regex:g,domain:y,scheme:k}){if(["http:/","https:/"].includes(n))return a.error("string.uri");let w=g.exec(n);if(!w&&a.prefs.convert&&u.encodeUri){const d=encodeURI(n);w=g.exec(d),w&&(n=d)}if(w){const d=w[1]||w[2];return!y||u.allowRelative&&!d||m.isValid(d,y)?n:a.error("string.domain",{value:d})}return u.relativeOnly?a.error("string.uriRelativeOnly"):u.scheme?a.error("string.uriCustomScheme",{scheme:k,value:n}):a.error("string.uri")}}},manifest:{build(n,a){if(a.replacements)for(const{pattern:u,replacement:g}of a.replacements)n=n.replace(u,g);return n}},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"}}),c.addressOptions=function(n){if(!n)return c.tlds||n;if(i(n.minDomainSegments===void 0||Number.isSafeInteger(n.minDomainSegments)&&n.minDomainSegments>0,"minDomainSegments must be a positive integer"),i(n.maxDomainSegments===void 0||Number.isSafeInteger(n.maxDomainSegments)&&n.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),n.tlds===!1)return n;if(n.tlds===!0||n.tlds===void 0)return i(c.tlds,"Built-in TLD list disabled"),Object.assign({},n,c.tlds);i(typeof n.tlds=="object","tlds must be true, false, or an object");const a=n.tlds.deny;if(a)return Array.isArray(a)&&(n=Object.assign({},n,{tlds:{deny:new Set(a)}})),i(n.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),i(!n.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),c.validateTlds(n.tlds.deny,"tlds.deny"),n;const u=n.tlds.allow;return u?u===!0?(i(c.tlds,"Built-in TLD list disabled"),Object.assign({},n,c.tlds)):(Array.isArray(u)&&(n=Object.assign({},n,{tlds:{allow:new Set(u)}})),i(n.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),c.validateTlds(n.tlds.allow,"tlds.allow"),n):n},c.validateTlds=function(n,a){for(const u of n)i(m.isValid(u,{minDomainSegments:1,maxDomainSegments:1}),`${a} must contain valid top level domain names`)},c.isoDate=function(n){if(!s.isIsoDate(n))return null;/.*T.*[+-]\d\d$/.test(n)&&(n+="00");const a=new Date(n);return isNaN(a.getTime())?null:a.toISOString()},c.length=function(n,a,u,g,y){return i(!y||!1,"Invalid encoding:",y),n.$_addRule({name:a,method:"length",args:{limit:u,encoding:y},operator:g})}},8826:(_,j,p)=>{const i=p(375),m=p(8068),f={};f.Map=class extends Map{slice(){return new f.Map(this)}},_.exports=m.extend({type:"symbol",terms:{map:{init:new f.Map}},coerce:{method(h,{schema:t,error:l}){const o=t.$_terms.map.get(h);return o&&(h=o),t._flags.only&&typeof h!="symbol"?{value:h,errors:l("symbol.map",{map:t.$_terms.map})}:{value:h}}},validate(h,{error:t}){if(typeof h!="symbol")return{value:h,errors:t("symbol.base")}},rules:{map:{method(h){h&&!h[Symbol.iterator]&&typeof h=="object"&&(h=Object.entries(h)),i(h&&h[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),l=[];for(const o of h){i(o&&o[Symbol.iterator],"Entry must be an iterable");const[r,s]=o;i(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),i(typeof s=="symbol","Value must be a Symbol"),t.$_terms.map.set(r,s),l.push(s)}return t.valid(...l)}}},manifest:{build:(h,t)=>(t.map&&(h=h.map(t.map)),h)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(_,j,p)=>{const i=p(375),m=p(8571),f=p(738),h=p(9621),t=p(8160),l=p(6354),o=p(493),r={result:Symbol("result")};j.entry=function(s,c,n){let a=t.defaults;n&&(i(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),i(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),a=t.preferences(t.defaults,n));const u=r.entry(s,c,a);i(!u.mainstay.externals.length,"Schema with external rules must use validateAsync()");const g={value:u.value};return u.error&&(g.error=u.error),u.mainstay.warnings.length&&(g.warning=l.details(u.mainstay.warnings)),u.mainstay.debug&&(g.debug=u.mainstay.debug),u.mainstay.artifacts&&(g.artifacts=u.mainstay.artifacts),g},j.entryAsync=async function(s,c,n){let a=t.defaults;n&&(a=t.preferences(t.defaults,n));const u=r.entry(s,c,a),g=u.mainstay;if(u.error)throw g.debug&&(u.error.debug=g.debug),u.error;if(g.externals.length){let k=u.value;const w=[];for(const d of g.externals){const x=d.state.path,b=d.schema.type==="link"?g.links.get(d.schema):null;let S,A,P=k;const L=x.length?[k]:[],D=x.length?h(s,x):s;if(x.length){S=x[x.length-1];let N=k;for(const V of x.slice(0,-1))N=N[V],L.unshift(N);A=L[0],P=A[S]}try{const N=(B,I)=>(b||d.schema).$_createError(B,P,I,d.state,a),V=await d.method(P,{schema:d.schema,linked:b,state:d.state,prefs:n,original:D,error:N,errorsArray:r.errorsArray,warn:(B,I)=>g.warnings.push((b||d.schema).$_createError(B,P,I,d.state,a)),message:(B,I)=>(b||d.schema).$_createError("external",P,I,d.state,a,{messages:B})});if(V===void 0||V===P)continue;if(V instanceof l.Report){if(g.tracer.log(d.schema,d.state,"rule","external","error"),w.push(V),a.abortEarly)break;continue}if(Array.isArray(V)&&V[t.symbols.errors]){if(g.tracer.log(d.schema,d.state,"rule","external","error"),w.push(...V),a.abortEarly)break;continue}A?(g.tracer.value(d.state,"rule",P,V,"external"),A[S]=V):(g.tracer.value(d.state,"rule",k,V,"external"),k=V)}catch(N){throw a.errors.label&&(N.message+=` (${d.label})`),N}}if(u.value=k,w.length)throw u.error=l.process(w,s,a),g.debug&&(u.error.debug=g.debug),u.error}if(!a.warnings&&!a.debug&&!a.artifacts)return u.value;const y={value:u.value};return g.warnings.length&&(y.warning=l.details(g.warnings)),g.debug&&(y.debug=g.debug),g.artifacts&&(y.artifacts=g.artifacts),y},r.Mainstay=class{constructor(s,c,n){this.externals=[],this.warnings=[],this.tracer=s,this.debug=c,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const s=this._snapshots.pop();this.externals=s.externals,this.warnings=s.warnings}commit(){this._snapshots.pop()}},r.entry=function(s,c,n){const{tracer:a,cleanup:u}=r.tracer(c,n),g=n.debug?[]:null,y=c._ids._schemaChain?new Map:null,k=new r.Mainstay(a,g,y),w=c._ids._schemaChain?[{schema:c}]:null,d=new o([],[],{mainstay:k,schemas:w}),x=j.validate(s,c,d,n);u&&c.$_root.untrace();const b=l.process(x.errors,s,n);return{value:x.value,error:b,mainstay:k}},r.tracer=function(s,c){return s.$_root._tracer?{tracer:s.$_root._tracer._register(s)}:c.debug?(i(s.$_root.trace,"Debug mode not supported"),{tracer:s.$_root.trace()._register(s),cleanup:!0}):{tracer:r.ignore}},j.validate=function(s,c,n,a,u={}){if(c.$_terms.whens&&(c=c._generate(s,n,a).schema),c._preferences&&(a=r.prefs(c,a)),c._cache&&a.cache){const b=c._cache.get(s);if(n.mainstay.tracer.debug(n,"validate","cached",!!b),b)return b}const g=(b,S,A)=>c.$_createError(b,s,S,A||n,a),y={original:s,prefs:a,schema:c,state:n,error:g,errorsArray:r.errorsArray,warn:(b,S,A)=>n.mainstay.warnings.push(g(b,S,A)),message:(b,S)=>c.$_createError("custom",s,S,n,a,{messages:b})};n.mainstay.tracer.entry(c,n);const k=c._definition;if(k.prepare&&s!==void 0&&a.convert){const b=k.prepare(s,y);if(b){if(n.mainstay.tracer.value(n,"prepare",s,b.value),b.errors)return r.finalize(b.value,[].concat(b.errors),y);s=b.value}}if(k.coerce&&s!==void 0&&a.convert&&(!k.coerce.from||k.coerce.from.includes(typeof s))){const b=k.coerce.method(s,y);if(b){if(n.mainstay.tracer.value(n,"coerced",s,b.value),b.errors)return r.finalize(b.value,[].concat(b.errors),y);s=b.value}}const w=c._flags.empty;w&&w.$_match(r.trim(s,c),n.nest(w),t.defaults)&&(n.mainstay.tracer.value(n,"empty",s,void 0),s=void 0);const d=u.presence||c._flags.presence||(c._flags._endedSwitch?null:a.presence);if(s===void 0){if(d==="forbidden")return r.finalize(s,null,y);if(d==="required")return r.finalize(s,[c.$_createError("any.required",s,null,n,a)],y);if(d==="optional"){if(c._flags.default!==t.symbols.deepDefault)return r.finalize(s,null,y);n.mainstay.tracer.value(n,"default",s,{}),s={}}}else if(d==="forbidden")return r.finalize(s,[c.$_createError("any.unknown",s,null,n,a)],y);const x=[];if(c._valids){const b=c._valids.get(s,n,a,c._flags.insensitive);if(b)return a.convert&&(n.mainstay.tracer.value(n,"valids",s,b.value),s=b.value),n.mainstay.tracer.filter(c,n,"valid",b),r.finalize(s,null,y);if(c._flags.only){const S=c.$_createError("any.only",s,{valids:c._valids.values({display:!0})},n,a);if(a.abortEarly)return r.finalize(s,[S],y);x.push(S)}}if(c._invalids){const b=c._invalids.get(s,n,a,c._flags.insensitive);if(b){n.mainstay.tracer.filter(c,n,"invalid",b);const S=c.$_createError("any.invalid",s,{invalids:c._invalids.values({display:!0})},n,a);if(a.abortEarly)return r.finalize(s,[S],y);x.push(S)}}if(k.validate){const b=k.validate(s,y);if(b&&(n.mainstay.tracer.value(n,"base",s,b.value),s=b.value,b.errors)){if(!Array.isArray(b.errors))return x.push(b.errors),r.finalize(s,x,y);if(b.errors.length)return x.push(...b.errors),r.finalize(s,x,y)}}return c._rules.length?r.rules(s,x,y):r.finalize(s,x,y)},r.rules=function(s,c,n){const{schema:a,state:u,prefs:g}=n;for(const y of a._rules){const k=a._definition.rules[y.method];if(k.convert&&g.convert){u.mainstay.tracer.log(a,u,"rule",y.name,"full");continue}let w,d=y.args;if(y._resolve.length){d=Object.assign({},d);for(const b of y._resolve){const S=k.argsByName.get(b),A=d[b].resolve(s,u,g),P=S.normalize?S.normalize(A):A,L=t.validateArg(P,null,S);if(L){w=a.$_createError("any.ref",A,{arg:b,ref:d[b],reason:L},u,g);break}d[b]=P}}w=w||k.validate(s,n,d,y);const x=r.rule(w,y);if(x.errors){if(u.mainstay.tracer.log(a,u,"rule",y.name,"error"),y.warn){u.mainstay.warnings.push(...x.errors);continue}if(g.abortEarly)return r.finalize(s,x.errors,n);c.push(...x.errors)}else u.mainstay.tracer.log(a,u,"rule",y.name,"pass"),u.mainstay.tracer.value(u,"rule",s,x.value,y.name),s=x.value}return r.finalize(s,c,n)},r.rule=function(s,c){return s instanceof l.Report?(r.error(s,c),{errors:[s],value:null}):Array.isArray(s)&&s[t.symbols.errors]?(s.forEach(n=>r.error(n,c)),{errors:s,value:null}):{errors:null,value:s}},r.error=function(s,c){return c.message&&s._setTemplate(c.message),s},r.finalize=function(s,c,n){c=c||[];const{schema:a,state:u,prefs:g}=n;if(c.length){const k=r.default("failover",void 0,c,n);k!==void 0&&(u.mainstay.tracer.value(u,"failover",s,k),s=k,c=[])}if(c.length&&a._flags.error)if(typeof a._flags.error=="function"){c=a._flags.error(c),Array.isArray(c)||(c=[c]);for(const k of c)i(k instanceof Error||k instanceof l.Report,"error() must return an Error object")}else c=[a._flags.error];if(s===void 0){const k=r.default("default",s,c,n);u.mainstay.tracer.value(u,"default",s,k),s=k}if(a._flags.cast&&s!==void 0){const k=a._definition.cast[a._flags.cast];if(k.from(s)){const w=k.to(s,n);u.mainstay.tracer.value(u,"cast",s,w,a._flags.cast),s=w}}if(a.$_terms.externals&&g.externals&&g._externals!==!1)for(const{method:k}of a.$_terms.externals)u.mainstay.externals.push({method:k,schema:a,state:u,label:l.label(a._flags,u,g)});const y={value:s,errors:c.length?c:null};return a._flags.result&&(y.value=a._flags.result==="strip"?void 0:n.original,u.mainstay.tracer.value(u,a._flags.result,s,y.value),u.shadow(s,a._flags.result)),a._cache&&g.cache!==!1&&!a._refs.length&&a._cache.set(n.original,y),s===void 0||y.errors||a._flags.artifact===void 0||(u.mainstay.artifacts=u.mainstay.artifacts||new Map,u.mainstay.artifacts.has(a._flags.artifact)||u.mainstay.artifacts.set(a._flags.artifact,[]),u.mainstay.artifacts.get(a._flags.artifact).push(u.path)),y},r.prefs=function(s,c){const n=c===t.defaults;return n&&s._preferences[t.symbols.prefs]?s._preferences[t.symbols.prefs]:(c=t.preferences(c,s._preferences),n&&(s._preferences[t.symbols.prefs]=c),c)},r.default=function(s,c,n,a){const{schema:u,state:g,prefs:y}=a,k=u._flags[s];if(y.noDefaults||k===void 0)return c;if(g.mainstay.tracer.log(u,g,"rule",s,"full"),!k)return k;if(typeof k=="function"){const w=k.length?[m(g.ancestors[0]),a]:[];try{return k(...w)}catch(d){return void n.push(u.$_createError(`any.${s}`,null,{error:d},g,y))}}return typeof k!="object"?k:k[t.symbols.literal]?k.literal:t.isResolvable(k)?k.resolve(c,g,y):m(k)},r.trim=function(s,c){if(typeof s!="string")return s;const n=c.$_getRule("trim");return n&&n.args.enabled?s.trim():s},r.ignore={active:!1,debug:f,entry:f,filter:f,log:f,resolve:f,value:f},r.errorsArray=function(){const s=[];return s[t.symbols.errors]=!0,s}},2036:(_,j,p)=>{const i=p(375),m=p(9474),f=p(8160),h={};_.exports=h.Values=class{constructor(t,l){this._values=new Set(t),this._refs=new Set(l),this._lowercase=h.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,l){f.isResolvable(t)?this._refs.has(t)||(this._refs.add(t),l&&l.register(t)):this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,l,o){if(t=t||new h.Values,l){if(l._override)return l.clone();for(const r of[...l._values,...l._refs])t.add(r)}if(o)for(const r of[...o._values,...o._refs])t.remove(r);return t.length?t:null}remove(t){f.isResolvable(t)?this._refs.delete(t):(this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase()))}has(t,l,o,r){return!!this.get(t,l,o,r)}get(t,l,o,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){const s=this._lowercase.get(t.toLowerCase());if(s)return{value:s}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(const s of this._values)if(m(s,t))return{value:s}}if(l)for(const s of this._refs){const c=s.resolve(t,l,o,null,{in:!0});if(c===void 0)continue;const n=s.in&&typeof c=="object"?Array.isArray(c)?c:Object.keys(c):[c];for(const a of n)if(typeof a==typeof t){if(r&&t&&typeof t=="string"){if(a.toLowerCase()===t.toLowerCase())return{value:a,ref:s}}else if(m(a,t))return{value:a,ref:s}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){const l=[];for(const o of[...this._values,...this._refs])o!==void 0&&l.push(o);return l}return Array.from([...this._values,...this._refs])}clone(){const t=new h.Values(this._values,this._refs);return t._override=this._override,t}concat(t){i(!t._override,"Cannot concat override set of values");const l=new h.Values([...this._values,...t._values],[...this._refs,...t._refs]);return l._override=this._override,l}describe(){const t=[];this._override&&t.push({override:!0});for(const l of this._values.values())t.push(l&&typeof l=="object"?{value:l}:l);for(const l of this._refs.values())t.push(l.describe());return t}},h.Values.prototype[f.symbols.values]=!0,h.Values.prototype.slice=h.Values.prototype.clone,h.lowercases=function(t){const l=new Map;if(t)for(const o of t)typeof o=="string"&&l.set(o.toLowerCase(),o);return l}},978:(_,j,p)=>{const i=p(375),m=p(8571),f=p(1687),h=p(9621),t={};_.exports=function(l,o,r={}){if(i(l&&typeof l=="object","Invalid defaults value: must be an object"),i(!o||o===!0||typeof o=="object","Invalid source value: must be true, falsy or an object"),i(typeof r=="object","Invalid options: must be an object"),!o)return null;if(r.shallow)return t.applyToDefaultsWithShallow(l,o,r);const s=m(l);if(o===!0)return s;const c=r.nullOverride!==void 0&&r.nullOverride;return f(s,o,{nullOverride:c,mergeArrays:!1})},t.applyToDefaultsWithShallow=function(l,o,r){const s=r.shallow;i(Array.isArray(s),"Invalid keys");const c=new Map,n=o===!0?null:new Set;for(let g of s){g=Array.isArray(g)?g:g.split(".");const y=h(l,g);y&&typeof y=="object"?c.set(y,n&&h(o,g)||y):n&&n.add(g)}const a=m(l,{},c);if(!n)return a;for(const g of n)t.reachCopy(a,o,g);const u=r.nullOverride!==void 0&&r.nullOverride;return f(a,o,{nullOverride:u,mergeArrays:!1})},t.reachCopy=function(l,o,r){for(const n of r){if(!(n in o))return;const a=o[n];if(typeof a!="object"||a===null)return;o=a}const s=o;let c=l;for(let n=0;n<r.length-1;++n){const a=r[n];typeof c[a]!="object"&&(c[a]={}),c=c[a]}c[r[r.length-1]]=s}},375:(_,j,p)=>{const i=p(7916);_.exports=function(m,...f){if(!m)throw f.length===1&&f[0]instanceof Error?f[0]:new i(f)}},8571:(_,j,p)=>{const i=p(9621),m=p(4277),f=p(7043),h={needsProtoHack:new Set([m.set,m.map,m.weakSet,m.weakMap])};_.exports=h.clone=function(t,l={},o=null){if(typeof t!="object"||t===null)return t;let r=h.clone,s=o;if(l.shallow){if(l.shallow!==!0)return h.cloneWithShallow(t,l);r=u=>u}else if(s){const u=s.get(t);if(u)return u}else s=new Map;const c=m.getInternalProto(t);if(c===m.buffer)return!1;if(c===m.date)return new Date(t.getTime());if(c===m.regex)return new RegExp(t);const n=h.base(t,c,l);if(n===t)return t;if(s&&s.set(t,n),c===m.set)for(const u of t)n.add(r(u,l,s));else if(c===m.map)for(const[u,g]of t)n.set(u,r(g,l,s));const a=f.keys(t,l);for(const u of a){if(u==="__proto__")continue;if(c===m.array&&u==="length"){n.length=t.length;continue}const g=Object.getOwnPropertyDescriptor(t,u);g?g.get||g.set?Object.defineProperty(n,u,g):g.enumerable?n[u]=r(t[u],l,s):Object.defineProperty(n,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],l,s)}):Object.defineProperty(n,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],l,s)})}return n},h.cloneWithShallow=function(t,l){const o=l.shallow;(l=Object.assign({},l)).shallow=!1;const r=new Map;for(const s of o){const c=i(t,s);typeof c!="object"&&typeof c!="function"||r.set(c,c)}return h.clone(t,l,r)},h.base=function(t,l,o){if(o.prototype===!1)return h.needsProtoHack.has(l)?new l.constructor:l===m.array?[]:{};const r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(l===m.array){const s=[];return r!==l&&Object.setPrototypeOf(s,r),s}if(h.needsProtoHack.has(l)){const s=new r.constructor;return r!==l&&Object.setPrototypeOf(s,r),s}return Object.create(r)}},9474:(_,j,p)=>{const i=p(4277),m={mismatched:null};_.exports=function(f,h,t){return t=Object.assign({prototype:!0},t),!!m.isDeepEqual(f,h,t,[])},m.isDeepEqual=function(f,h,t,l){if(f===h)return f!==0||1/f==1/h;const o=typeof f;if(o!==typeof h||f===null||h===null)return!1;if(o==="function"){if(!t.deepFunction||f.toString()!==h.toString())return!1}else if(o!=="object")return f!=f&&h!=h;const r=m.getSharedType(f,h,!!t.prototype);switch(r){case i.buffer:return!1;case i.promise:return f===h;case i.regex:return f.toString()===h.toString();case m.mismatched:return!1}for(let s=l.length-1;s>=0;--s)if(l[s].isSame(f,h))return!0;l.push(new m.SeenEntry(f,h));try{return!!m.isDeepEqualObj(r,f,h,t,l)}finally{l.pop()}},m.getSharedType=function(f,h,t){if(t)return Object.getPrototypeOf(f)!==Object.getPrototypeOf(h)?m.mismatched:i.getInternalProto(f);const l=i.getInternalProto(f);return l!==i.getInternalProto(h)?m.mismatched:l},m.valueOf=function(f){const h=f.valueOf;if(h===void 0)return f;try{return h.call(f)}catch(t){return t}},m.hasOwnEnumerableProperty=function(f,h){return Object.prototype.propertyIsEnumerable.call(f,h)},m.isSetSimpleEqual=function(f,h){for(const t of Set.prototype.values.call(f))if(!Set.prototype.has.call(h,t))return!1;return!0},m.isDeepEqualObj=function(f,h,t,l,o){const{isDeepEqual:r,valueOf:s,hasOwnEnumerableProperty:c}=m,{keys:n,getOwnPropertySymbols:a}=Object;if(f===i.array){if(!l.part){if(h.length!==t.length)return!1;for(let w=0;w<h.length;++w)if(!r(h[w],t[w],l,o))return!1;return!0}for(const w of h)for(const d of t)if(r(w,d,l,o))return!0}else if(f===i.set){if(h.size!==t.size)return!1;if(!m.isSetSimpleEqual(h,t)){const w=new Set(Set.prototype.values.call(t));for(const d of Set.prototype.values.call(h)){if(w.delete(d))continue;let x=!1;for(const b of w)if(r(d,b,l,o)){w.delete(b),x=!0;break}if(!x)return!1}}}else if(f===i.map){if(h.size!==t.size)return!1;for(const[w,d]of Map.prototype.entries.call(h))if(d===void 0&&!Map.prototype.has.call(t,w)||!r(d,Map.prototype.get.call(t,w),l,o))return!1}else if(f===i.error&&(h.name!==t.name||h.message!==t.message))return!1;const u=s(h),g=s(t);if((h!==u||t!==g)&&!r(u,g,l,o))return!1;const y=n(h);if(!l.part&&y.length!==n(t).length&&!l.skip)return!1;let k=0;for(const w of y)if(l.skip&&l.skip.includes(w))t[w]===void 0&&++k;else if(!c(t,w)||!r(h[w],t[w],l,o))return!1;if(!l.part&&y.length-k!==n(t).length)return!1;if(l.symbols!==!1){const w=a(h),d=new Set(a(t));for(const x of w){if(!l.skip||!l.skip.includes(x)){if(c(h,x)){if(!c(t,x)||!r(h[x],t[x],l,o))return!1}else if(c(t,x))return!1}d.delete(x)}for(const x of d)if(c(t,x))return!1}return!0},m.SeenEntry=class{constructor(f,h){this.obj=f,this.ref=h}isSame(f,h){return this.obj===f&&this.ref===h}}},7916:(_,j,p)=>{const i=p(8761);_.exports=class extends Error{constructor(m){super(m.filter(f=>f!=="").map(f=>typeof f=="string"?f:f instanceof Error?f.message:i(f)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,j.assert)}}},5277:_=>{const j={};_.exports=function(p){if(!p)return"";let i="";for(let m=0;m<p.length;++m){const f=p.charCodeAt(m);j.isSafe(f)?i+=p[m]:i+=j.escapeHtmlChar(f)}return i},j.escapeHtmlChar=function(p){return j.namedHtml.get(p)||(p>=256?"&#"+p+";":`&#x${p.toString(16).padStart(2,"0")};`)},j.isSafe=function(p){return j.safeCharCodes.has(p)},j.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),j.safeCharCodes=function(){const p=new Set;for(let i=32;i<123;++i)(i>=97||i>=65&&i<=90||i>=48&&i<=57||i===32||i===46||i===44||i===45||i===58||i===95)&&p.add(i);return p}()},6064:_=>{_.exports=function(j){return j.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:_=>{_.exports=function(){}},1687:(_,j,p)=>{const i=p(375),m=p(8571),f=p(7043),h={};_.exports=h.merge=function(t,l,o){if(i(t&&typeof t=="object","Invalid target value: must be an object"),i(l==null||typeof l=="object","Invalid source value: must be null, undefined, or an object"),!l)return t;if(o=Object.assign({nullOverride:!0,mergeArrays:!0},o),Array.isArray(l)){i(Array.isArray(t),"Cannot merge array onto an object"),o.mergeArrays||(t.length=0);for(let s=0;s<l.length;++s)t.push(m(l[s],{symbols:o.symbols}));return t}const r=f.keys(l,o);for(let s=0;s<r.length;++s){const c=r[s];if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(l,c))continue;const n=l[c];if(n&&typeof n=="object"){if(t[c]===n)continue;!t[c]||typeof t[c]!="object"||Array.isArray(t[c])!==Array.isArray(n)||n instanceof Date||n instanceof RegExp?t[c]=m(n,{symbols:o.symbols}):h.merge(t[c],n,o)}else(n!=null||o.nullOverride)&&(t[c]=n)}return t}},9621:(_,j,p)=>{const i=p(375),m={};_.exports=function(f,h,t){if(h===!1||h==null)return f;typeof(t=t||{})=="string"&&(t={separator:t});const l=Array.isArray(h);i(!l||!t.separator,"Separator option is not valid for array-based chain");const o=l?h:h.split(t.separator||".");let r=f;for(let s=0;s<o.length;++s){let c=o[s];const n=t.iterables&&m.iterables(r);if(Array.isArray(r)||n==="set"){const a=Number(c);Number.isInteger(a)&&(c=a<0?r.length+a:a)}if(!r||typeof r=="function"&&t.functions===!1||!n&&r[c]===void 0){i(!t.strict||s+1===o.length,"Missing segment",c,"in reach path ",h),i(typeof r=="object"||t.functions===!0||typeof r!="function","Invalid segment",c,"in reach path ",h),r=t.default;break}r=n?n==="set"?[...r][c]:r.get(c):r[c]}return r},m.iterables=function(f){return f instanceof Set?"set":f instanceof Map?"map":void 0}},8761:_=>{_.exports=function(...j){try{return JSON.stringify(...j)}catch(p){return"[Cannot display object: "+p.message+"]"}}},4277:(_,j)=>{const p={};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]",j.error],["[object Map]",j.map],["[object Promise]",j.promise],["[object Set]",j.set],["[object WeakMap]",j.weakMap],["[object WeakSet]",j.weakSet]]),j.getInternalProto=function(i){if(Array.isArray(i))return j.array;if(i instanceof Date)return j.date;if(i instanceof RegExp)return j.regex;if(i instanceof Error)return j.error;const m=Object.prototype.toString.call(i);return p.typeMap.get(m)||j.generic}},7043:(_,j)=>{j.keys=function(p,i={}){return i.symbols!==!1?Reflect.ownKeys(p):Object.getOwnPropertyNames(p)}},3652:(_,j,p)=>{const i=p(375),m={};j.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(f,h){const t=[].concat((h=h||{}).before||[]),l=[].concat(h.after||[]),o=h.group||"?",r=h.sort||0;i(!t.includes(o),`Item cannot come before itself: ${o}`),i(!t.includes("?"),"Item cannot come before unassociated items"),i(!l.includes(o),`Item cannot come after itself: ${o}`),i(!l.includes("?"),"Item cannot come after unassociated items"),Array.isArray(f)||(f=[f]);for(const s of f){const c={seq:this._items.length,sort:r,before:t,after:l,group:o,node:s};this._items.push(c)}if(!h.manual){const s=this._sort();i(s,"item",o!=="?"?`added into group ${o}`:"","created a dependencies error")}return this.nodes}merge(f){Array.isArray(f)||(f=[f]);for(const t of f)if(t)for(const l of t._items)this._items.push(Object.assign({},l));this._items.sort(m.mergeSort);for(let t=0;t<this._items.length;++t)this._items[t].seq=t;const h=this._sort();return i(h,"merge created a dependencies error"),this.nodes}sort(){const f=this._sort();return i(f,"sort created a dependencies error"),this.nodes}_sort(){const f={},h=Object.create(null),t=Object.create(null);for(const c of this._items){const n=c.seq,a=c.group;t[a]=t[a]||[],t[a].push(n),f[n]=c.before;for(const u of c.after)h[u]=h[u]||[],h[u].push(n)}for(const c in f){const n=[];for(const a in f[c]){const u=f[c][a];t[u]=t[u]||[],n.push(...t[u])}f[c]=n}for(const c in h)if(t[c])for(const n of t[c])f[n].push(...h[c]);const l={};for(const c in f){const n=f[c];for(const a of n)l[a]=l[a]||[],l[a].push(c)}const o={},r=[];for(let c=0;c<this._items.length;++c){let n=c;if(l[c]){n=null;for(let a=0;a<this._items.length;++a){if(o[a]===!0)continue;l[a]||(l[a]=[]);const u=l[a].length;let g=0;for(let y=0;y<u;++y)o[l[a][y]]&&++g;if(g===u){n=a;break}}}n!==null&&(o[n]=!0,r.push(n))}if(r.length!==this._items.length)return!1;const s={};for(const c of this._items)s[c.seq]=c;this._items=[],this.nodes=[];for(const c of r){const n=s[c];this.nodes.push(n.node),this._items.push(n)}return!0}},m.mergeSort=(f,h)=>f.sort===h.sort?0:f.sort<h.sort?-1:1},5380:(_,j,p)=>{const i=p(443),m=p(2178),f={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:i.URL||URL};j.analyze=function(h,t={}){if(!h)return m.code("DOMAIN_NON_EMPTY_STRING");if(typeof h!="string")throw new Error("Invalid input: domain must be a string");if(h.length>256)return m.code("DOMAIN_TOO_LONG");if(f.nonAsciiRx.test(h)){if(t.allowUnicode===!1)return m.code("DOMAIN_INVALID_UNICODE_CHARS");h=h.normalize("NFC")}if(f.domainControlRx.test(h))return m.code("DOMAIN_INVALID_CHARS");h=f.punycode(h),t.allowFullyQualified&&h[h.length-1]==="."&&(h=h.slice(0,-1));const l=t.minDomainSegments||f.minDomainSegments,o=h.split(".");if(o.length<l)return m.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&o.length>t.maxDomainSegments)return m.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=t.tlds;if(r){const s=o[o.length-1].toLowerCase();if(r.deny&&r.deny.has(s)||r.allow&&!r.allow.has(s))return m.code("DOMAIN_FORBIDDEN_TLDS")}for(let s=0;s<o.length;++s){const c=o[s];if(!c.length)return m.code("DOMAIN_EMPTY_SEGMENT");if(c.length>63)return m.code("DOMAIN_LONG_SEGMENT");if(s<o.length-1){if(!f.domainSegmentRx.test(c))return m.code("DOMAIN_INVALID_CHARS")}else if(!f.tldSegmentRx.test(c))return m.code("DOMAIN_INVALID_TLDS_CHARS")}return null},j.isValid=function(h,t){return!j.analyze(h,t)},f.punycode=function(h){h.includes("%")&&(h=h.replace(/%/g,"%25"));try{return new f.URL(`http://${h}`).host}catch{return h}}},1745:(_,j,p)=>{const i=p(9848),m=p(5380),f=p(2178),h={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(i.TextEncoder||TextEncoder)};j.analyze=function(t,l){return h.email(t,l)},j.isValid=function(t,l){return!h.email(t,l)},h.email=function(t,l={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return f.code("EMPTY_STRING");const o=!h.nonAsciiRx.test(t);if(!o){if(l.allowUnicode===!1)return f.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}const r=t.split("@");if(r.length!==2)return r.length>2?f.code("MULTIPLE_AT_CHAR"):f.code("MISSING_AT_CHAR");const[s,c]=r;if(!s)return f.code("EMPTY_LOCAL");if(!l.ignoreLength){if(t.length>254)return f.code("ADDRESS_TOO_LONG");if(h.encoder.encode(s).length>64)return f.code("LOCAL_TOO_LONG")}return h.local(s,o)||m.analyze(c,l)},h.local=function(t,l){const o=t.split(".");for(const r of o){if(!r.length)return f.code("EMPTY_LOCAL_SEGMENT");if(l){if(!h.atextRx.test(r))return f.code("INVALID_LOCAL_CHARS")}else for(const s of r){if(h.atextRx.test(s))continue;const c=h.binary(s);if(!h.atomRx.test(c))return f.code("INVALID_LOCAL_CHARS")}}},h.binary=function(t){return Array.from(h.encoder.encode(t)).map(l=>String.fromCharCode(l)).join("")},h.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,h.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)=>{j.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"},j.code=function(p){return{code:p,error:j.codes[p]}}},9959:(_,j,p)=>{const i=p(375),m=p(5752);j.regex=function(f={}){i(f.cidr===void 0||typeof f.cidr=="string","options.cidr must be a string");const h=f.cidr?f.cidr.toLowerCase():"optional";i(["required","optional","forbidden"].includes(h),"options.cidr must be one of required, optional, forbidden"),i(f.version===void 0||typeof f.version=="string"||Array.isArray(f.version),"options.version must be a string or an array of string");let t=f.version||["ipv4","ipv6","ipvfuture"];Array.isArray(t)||(t=[t]),i(t.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<t.length;++r)i(typeof t[r]=="string","options.version must only contain strings"),t[r]=t[r].toLowerCase(),i(["ipv4","ipv6","ipvfuture"].includes(t[r]),"options.version contains unknown version "+t[r]+" - must be one of ipv4, ipv6, ipvfuture");t=Array.from(new Set(t));const l=`(?:${t.map(r=>{if(h==="forbidden")return m.ip[r];const s=`\\/${r==="ipv4"?m.ip.v4Cidr:m.ip.v6Cidr}`;return h==="required"?`${m.ip[r]}${s}`:`${m.ip[r]}(?:${s})?`}).join("|")})`,o=new RegExp(`^${l}$`);return{cidr:h,versions:t,regex:o,raw:l}}},5752:(_,j,p)=>{const i=p(375),m=p(6064),f={generate:function(){const h={},t="\\dA-Fa-f",l="["+t+"]",o="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",s="%"+t,c=o+s+r+":@",n="["+c+"]",a="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";h.ipv4address="(?:"+a+"\\.){3}"+a;const u=l+"{1,4}",g="(?:"+u+":"+u+"|"+h.ipv4address+")",y="(?:"+u+":){6}"+g,k="::(?:"+u+":){5}"+g,w="(?:"+u+")?::(?:"+u+":){4}"+g,d="(?:(?:"+u+":){0,1}"+u+")?::(?:"+u+":){3}"+g,x="(?:(?:"+u+":){0,2}"+u+")?::(?:"+u+":){2}"+g,b="(?:(?:"+u+":){0,3}"+u+")?::"+u+":"+g,S="(?:(?:"+u+":){0,4}"+u+")?::"+g,A="(?:(?:"+u+":){0,5}"+u+")?::"+u,P="(?:(?:"+u+":){0,6}"+u+")?::";h.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",h.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",h.ipv6address="(?:"+y+"|"+k+"|"+w+"|"+d+"|"+x+"|"+b+"|"+S+"|"+A+"|"+P+")",h.ipvFuture="v"+l+"+\\.["+o+r+":]+",h.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",h.schemeRegex=new RegExp(h.scheme);const L="["+o+s+r+":]*",D="["+o+s+r+"]{1,255}",N="(?:\\[(?:"+h.ipv6address+"|"+h.ipvFuture+")\\]|"+h.ipv4address+"|"+D+")",V="(?:"+L+"@)?"+N+"(?::\\d*)?",B="(?:"+L+"@)?("+N+")(?::\\d*)?",I=n+"*",z=n+"+",F="(?:\\/"+I+")*",K="\\/(?:"+z+F+")?",he=z+F,be="["+o+s+r+"@]+"+F,De="(?:\\/\\/\\/"+I+F+")";return h.hierPart="(?:(?:\\/\\/"+V+F+")|"+K+"|"+he+"|"+De+")",h.hierPartCapture="(?:(?:\\/\\/"+B+F+")|"+K+"|"+he+")",h.relativeRef="(?:(?:\\/\\/"+V+F+")|"+K+"|"+be+"|)",h.relativeRefCapture="(?:(?:\\/\\/"+B+F+")|"+K+"|"+be+"|)",h.query="["+c+"\\/\\?]*(?=#|$)",h.queryWithSquareBrackets="["+c+"\\[\\]\\/\\?]*(?=#|$)",h.fragment="["+c+"\\/\\?]*",h}};f.rfc3986=f.generate(),j.ip={v4Cidr:f.rfc3986.ipv4Cidr,v6Cidr:f.rfc3986.ipv6Cidr,ipv4:f.rfc3986.ipv4address,ipv6:f.rfc3986.ipv6address,ipvfuture:f.rfc3986.ipvFuture},f.createRegex=function(h){const t=f.rfc3986,l="(?:\\?"+(h.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",o=h.domain?t.relativeRefCapture:t.relativeRef;if(h.relativeOnly)return f.wrap(o+l);let r="";if(h.scheme){i(h.scheme instanceof RegExp||typeof h.scheme=="string"||Array.isArray(h.scheme),"scheme must be a RegExp, String, or Array");const n=[].concat(h.scheme);i(n.length>=1,"scheme must have at least 1 scheme specified");const a=[];for(let u=0;u<n.length;++u){const g=n[u];i(g instanceof RegExp||typeof g=="string","scheme at position "+u+" must be a RegExp or String"),g instanceof RegExp?a.push(g.source.toString()):(i(t.schemeRegex.test(g),"scheme at position "+u+" must be a valid scheme"),a.push(m(g)))}r=a.join("|")}const s="(?:"+(r?"(?:"+r+")":t.scheme)+":"+(h.domain?t.hierPartCapture:t.hierPart)+")",c=h.allowRelative?"(?:"+s+"|"+o+")":s;return f.wrap(c+l,r)},f.wrap=function(h,t){return{raw:h=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${h}`,regex:new RegExp(`^${h}$`),scheme:t}},f.uriRegex=f.createRegex({}),j.regex=function(h={}){return h.scheme||h.allowRelative||h.relativeOnly||h.allowQuerySquareBrackets||h.domain?f.createRegex(h):f.uriRegex}},1447:(_,j)=>{const p={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};j.Parser=class{constructor(i,m={}){if(!m[p.settings]&&m.constants)for(const f in m.constants){const h=m.constants[f];if(h!==null&&!["boolean","number","string"].includes(typeof h))throw new Error(`Formula constant ${f} contains invalid ${typeof h} value type`)}this.settings=m[p.settings]?m:Object.assign({[p.settings]:!0,constants:{},functions:{}},m),this.single=null,this._parts=null,this._parse(i)}_parse(i){let m=[],f="",h=0,t=!1;const l=r=>{if(h)throw new Error("Formula missing closing parenthesis");const s=m.length?m[m.length-1]:null;if(t||f||r){if(s&&s.type==="reference"&&r===")")return s.type="function",s.value=this._subFormula(f,s.value),void(f="");if(r===")"){const c=new j.Parser(f,this.settings);m.push({type:"segment",value:c})}else if(t){if(t==="]")return m.push({type:"reference",value:f}),void(f="");m.push({type:"literal",value:f})}else if(p.operatorCharacters.includes(f))s&&s.type==="operator"&&p.operators.includes(s.value+f)?s.value+=f:m.push({type:"operator",value:f});else if(f.match(p.numberRx))m.push({type:"constant",value:parseFloat(f)});else if(this.settings.constants[f]!==void 0)m.push({type:"constant",value:this.settings.constants[f]});else{if(!f.match(p.tokenRx))throw new Error(`Formula contains invalid token: ${f}`);m.push({type:"reference",value:f})}f=""}};for(const r of i)t?r===t?(l(),t=!1):f+=r:h?r==="("?(f+=r,++h):r===")"?(--h,h?f+=r:l(r)):f+=r:r in p.literals?t=p.literals[r]:r==="("?(l(),++h):p.operatorCharacters.includes(r)?(l(),f=r,l()):r!==" "?f+=r:l();l(),m=m.map((r,s)=>r.type!=="operator"||r.value!=="-"||s&&m[s-1].type!=="operator"?r:{type:"operator",value:"n"});let o=!1;for(const r of m){if(r.type==="operator"){if(p.operatorsPrefix.includes(r.value))continue;if(!o)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(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");m.length===1&&["reference","literal","constant"].includes(m[0].type)&&(this.single={type:m[0].type==="reference"?"reference":"value",value:m[0].value}),this._parts=m.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(i,m){const f=this.settings.functions[m];if(typeof f!="function")throw new Error(`Formula contains unknown function ${m}`);let h=[];if(i){let t="",l=0,o=!1;const r=()=>{if(!t)throw new Error(`Formula contains function ${m} with invalid arguments ${i}`);h.push(t),t=""};for(let s=0;s<i.length;++s){const c=i[s];o?(t+=c,c===o&&(o=!1)):c in p.literals&&!l?(t+=c,o=p.literals[c]):c!==","||l?(t+=c,c==="("?++l:c===")"&&--l):r()}r()}return h=h.map(t=>new j.Parser(t,this.settings)),function(t){const l=[];for(const o of h)l.push(o.evaluate(t));return f.call(t,...l)}}evaluate(i){const m=this._parts.slice();for(let f=m.length-2;f>=0;--f){const h=m[f];if(h&&h.type==="operator"){const t=m[f+1];m.splice(f+1,1);const l=p.evaluate(t,i);m[f]=p.single(h.value,l)}}return p.operatorsOrder.forEach(f=>{for(let h=1;h<m.length-1;)if(f.includes(m[h])){const t=m[h],l=p.evaluate(m[h-1],i),o=p.evaluate(m[h+1],i);m.splice(h,2);const r=p.calculate(t,l,o);m[h-1]=r===0?0:r}else h+=2}),p.evaluate(m[0],i)}},j.Parser.prototype[p.symbol]=!0,p.reference=function(i){return function(m){return m&&m[i]!==void 0?m[i]:null}},p.evaluate=function(i,m){return i===null?null:typeof i=="function"?i(m):i[p.symbol]?i.evaluate(m):i},p.single=function(i,m){if(i==="!")return!m;const f=-m;return f===0?0:f},p.calculate=function(i,m,f){if(i==="??")return p.exists(m)?m:f;if(typeof m=="string"||typeof f=="string"){if(i==="+")return(m=p.exists(m)?m:"")+(p.exists(f)?f:"")}else switch(i){case"^":return Math.pow(m,f);case"*":return m*f;case"/":return m/f;case"%":return m%f;case"+":return m+f;case"-":return m-f}switch(i){case"<":return m<f;case"<=":return m<=f;case">":return m>f;case">=":return m>=f;case"==":return m===f;case"!=":return m!==f;case"&&":return m&&f;case"||":return m||f}return null},p.exists=function(i){return i!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:_=>{_.exports=JSON.parse('{"version":"17.13.3"}')}},C={},function _(j){var p=C[j];if(p!==void 0)return p.exports;var i=C[j]={exports:{}};return O[j](i,i.exports,_),i.exports}(5107);var O,C})}(Ye)),Ye.exports}var Ae={},Lt;function gn(){if(Lt)return Ae;Lt=1;var v=Ae&&Ae.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.BNExtension=O;const R=v(Ks());function O(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){try{return{value:new R.default(_)}}catch{return{errors:j.error("bn.nan")}}},coerce(_){return{value:_.toString(10)}},validate(_){return{value:_}},rules:{gt:{args:[{name:"threshold",ref:!0,assert:_=>R.default.isBN(_),message:"must be a big number",normalize:_=>new R.default(_)},{name:"equal",assert:_=>typeof _=="boolean",message:"must be a boolean"}],validate(_,j,p){const i=new R.default(_);return p.equal&&i.lt(p.threshold)?j.error("bn.min",p):!p.equal&&i.lte(p.threshold)?j.error("bn.greater",p):_}},lt:{args:[{name:"threshold",ref:!0,assert:_=>R.default.isBN(_),message:"must be a big number",normalize:_=>new R.default(_)},{name:"equal",assert:_=>typeof _=="boolean",message:"must be a boolean"}],validate(_,j,p){const i=new R.default(_);return p.equal&&i.gt(p.threshold)?j.error("bn.max",p):!p.equal&&i.gte(p.threshold)?j.error("bn.less",p):_}},min:{alias:"gte",method(_){return this.$_addRule({name:"gt",args:{threshold:_,equal:!0}})}},max:{alias:"lte",method(_){return this.$_addRule({name:"lt",args:{threshold:_,equal:!0}})}},greater:{alias:"gt",method(_){return this.$_addRule({name:"gt",args:{threshold:_,equal:!1}})}},less:{alias:"lt",method(_){return this.$_addRule({name:"lt",args:{threshold:_,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 Ae}var Pe={},qt;function yn(){if(qt)return Pe;qt=1;var v=Pe&&Pe.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.DIDExtension=j;const R=v(Gs),O=Ys(),C=Xs(),_={pk:Object.keys(O.types.KeyType),hash:Object.keys(O.types.HashType),role:Object.keys(O.types.RoleType)};function j(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(i,m){return!i||typeof i!="string"?{errors:m.error("did.empty",{value:i})}:(0,C.isValid)(i)===!1?{errors:m.error("did.invalid",{value:i})}:{value:i}},rules:{type:{args:[{name:"key",ref:!0,assert:i=>Object.keys(_).includes(i),message:`must be one of ${Object.keys(_).join(", ")}`},{name:"expected",assert:i=>Object.keys(_).some(m=>_[m].includes(i)),message:"must be valid type"}],validate(i,m,f){const h=(0,C.toTypeInfoStr)(i);return f.key==="pk"&&h.pk!==f.expected?m.error("did.pk",{...f,actual:h.pk}):f.key==="hash"&&h.hash!==f.expected?m.error("did.hash",{...f,actual:h.hash}):f.key==="role"&&h.role!==f.expected?m.error("did.role",{...f,actual:h.role}):i}},pk:{method(i){return this.$_addRule({name:"type",args:{key:"pk",expected:i}})}},hash:{method(i){return this.$_addRule({name:"type",args:{key:"hash",expected:i}})}},role:{method(i){return this.$_addRule({name:"type",args:{key:"role",expected:i}})}},wallet:{method(i){return this.$_addRule({name:"wallet",args:{type:i}})},args:[{name:"type",ref:!0,assert:i=>["arcblock","ethereum","default","eth","passkey"].includes(i),message:"must be a string",normalize:i=>i.trim()}],validate(i,m,f={}){const h=(0,C.toTypeInfo)(i),t=(0,C.toTypeInfoStr)(i);return["ethereum","eth"].includes(f.type)&&(0,R.default)(h,C.DID_TYPE_ETHEREUM)===!1?m.error("did.wallet",{expected:f.type,actual:JSON.stringify(t)}):["arcblock","default"].includes(f.type)&&(0,R.default)(h,C.DID_TYPE_ARCBLOCK)===!1?m.error("did.wallet",{expected:f.type,actual:JSON.stringify(t)}):["passkey"].includes(f.type)&&(0,R.default)(h,C.DID_TYPE_PASSKEY)===!1?m.error("did.wallet",{expected:f.type,actual:JSON.stringify(t)}):i}},prefix:{method(i=""){return this.$_addRule({name:"prefix",args:{str:i}})},args:[{name:"str",ref:!0,assert:i=>["",C.DID_PREFIX].includes(i),message:"must be a string",normalize:i=>i.trim()}],validate(i,m,f={}){return f.str&&i.startsWith(f.str)===!1?m.error("did.prefix",{expected:f.str}):!f.str&&(0,C.toAddress)(i)!==i?m.error("did.prefix",{expected:f.str}):i}}}}}return Pe}var Mt;function xn(){return Mt||(Mt=1,function(v){var R=Me&&Me.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(v,"__esModule",{value:!0}),v.patterns=v.schemas=v.Joi=void 0;const O=R(pn()),C=gn(),_=yn();v.Joi=O.default.extend(_.DIDExtension).extend(C.BNExtension);const j=/^(0x)?([A-Fa-f0-9]{64})$/,p=v.Joi.object({genesisTime:v.Joi.date().iso().required().raw(),genesisTx:v.Joi.string().regex(j).required().allow(""),renaissanceTime:v.Joi.date().iso().required().raw(),renaissanceTx:v.Joi.string().regex(j).required().allow("")}),i=v.Joi.object({address:v.Joi.DID().prefix().role("ROLE_TOKEN").required(),value:v.Joi.BN().min(0).required()}),m=v.Joi.object({name:v.Joi.string().min(1).max(256).required(),value:v.Joi.string().min(1).max(1024).required(),description:v.Joi.string().min(1).max(256).optional().allow(""),required:v.Joi.boolean().optional().default(!1)}),f=v.Joi.alternatives().try(v.Joi.DID().prefix().role("ROLE_ACCOUNT"),v.Joi.DID().prefix().role("ROLE_APPLICATION"),v.Joi.DID().prefix().role("ROLE_BLOCKLET"),v.Joi.DID().prefix().wallet("ethereum"),v.Joi.DID().prefix().wallet("passkey")),h=v.Joi.array().items(v.Joi.object({owner:f.required(),tokensList:v.Joi.array().items(i).default([]),assetsList:v.Joi.array().items(v.Joi.DID().prefix().role("ROLE_ASSET")).default([])})),t=v.Joi.array().items({signer:v.Joi.DID().prefix().required(),pk:v.Joi.any().required(),signature:v.Joi.any().required(),delegator:v.Joi.DID().prefix().valid("").optional(),data:v.Joi.any().optional()}),l=v.Joi.object({type:v.Joi.string().min(1).max(32).required(),contractAddress:v.Joi.DID().prefix().wallet("ethereum").required(),chainType:v.Joi.string().min(1).max(32).required(),chainName:v.Joi.string().min(1).max(32).required(),chainId:v.Joi.number().positive().required()}),o=v.Joi.object({type:v.Joi.string().valid("svg","url","uri").required(),content:v.Joi.string().when("type",{is:"uri",then:v.Joi.string().max(20480).dataUri().required()}).when("type",{is:"url",then:v.Joi.string().max(2048).uri({scheme:["http","https"]}).required()})}),r=v.Joi.object({id:v.Joi.string().max(2048).uri({scheme:["http","https"]}).required(),scope:v.Joi.string().valid("public","private").default("public")}),s=v.Joi.object({id:v.Joi.DID().prefix().required(),pk:v.Joi.string().required(),name:v.Joi.string().min(1).max(256).required()}),c={address:v.Joi.DID().prefix().role("ROLE_ASSET").required(),moniker:v.Joi.string().min(2).max(255).required(),data:v.Joi.any().required(),readonly:v.Joi.boolean().default(!1),transferrable:v.Joi.boolean().default(!1),ttl:v.Joi.number().min(0).default(0),parent:v.Joi.DID().prefix().optional().allow(""),issuer:v.Joi.DID().prefix().optional().allow(""),endpoint:r.optional().allow(null).default(null),display:o.optional().allow(null).default(null),tags:v.Joi.array().items(v.Joi.string().min(1).max(64)).max(4).optional()},n={address:v.Joi.DID().prefix().role("ROLE_FACTORY").required(),name:v.Joi.string().min(2).max(255).required(),description:v.Joi.string().min(2).max(255).required(),settlement:v.Joi.string().valid("instant","periodic").default("instant"),limit:v.Joi.number().integer().min(0).default(0),trustedIssuers:v.Joi.array().items(v.Joi.DID().prefix()).max(8).optional(),data:v.Joi.any().optional().allow(null).default(null),display:o.optional().allow(null).default(null),input:v.Joi.object({value:v.Joi.BN().positive().min("0").default("0"),tokens:v.Joi.array().items(i).max(8).optional(),assets:v.Joi.array().items(v.Joi.alternatives().try(v.Joi.DID().prefix().role("ROLE_ASSET"),v.Joi.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),variables:v.Joi.array().items(v.Joi.object({name:v.Joi.string().min(1).max(255).required(),description:v.Joi.string().max(255).optional().allow(""),required:v.Joi.boolean().required()})).optional()}),output:v.Joi.object({moniker:v.Joi.string().min(2).max(255).required(),data:v.Joi.any().required(),readonly:v.Joi.boolean().default(!1),transferrable:v.Joi.boolean().default(!1),ttl:v.Joi.number().min(0).default(0),parent:v.Joi.string().max(255).required(),issuer:v.Joi.string().max(255).required(),endpoint:r.optional(),display:o.optional(),tags:v.Joi.array().items(v.Joi.string().min(1).max(64)).max(4).optional()}),hooks:v.Joi.array().items(v.Joi.object({name:v.Joi.string().valid("mint","postMint","preMint").required(),type:v.Joi.string().valid("url","contract").required(),hook:v.Joi.string().min(1).max(4096).required(),compiled:v.Joi.array().items(v.Joi.object()).optional()})).optional()};v.schemas={context:p,tokenInput:i,multiInput:h,multiSig:t,foreignToken:l,variableInput:m,nftDisplay:o,nftEndpoint:r,nftIssuer:s,tokenHolder:f,assetProps:c,assetSchema:v.Joi.object(c).options({stripUnknown:!0,noDefaults:!1}),factoryProps:n,factorySchema:v.Joi.object(n).options({stripUnknown:!0,noDefaults:!1})},v.patterns={txHash:j}}(Me)),Me}var vn=xn();function fs({onCancel:v,onSuccess:R,blocklet:O}){const{vaults:C=[],appPid:_}=O,{t:j,locale:p}=oe(),{connectApi:i}=Nt(),{api:m}=ne(),{teamDid:f}=Ve(),[h,t]=gt({loading:!1,fetching:!1,error:"",address:"",fetched:[],errored:[]});q.useEffect(()=>{if(!je.isValid(h.address))return;const c=je.toAddress(h.address),n=h.fetched.find(u=>u.address===c),a=h.errored.find(u=>u.address===c);!h.fetching&&!n&&!a&&(t({fetching:!0}),Pr(J.MAIN_CHAIN_ENDPOINT).getAccountState({address:c}).then(g=>{g.state?t({fetching:!1,fetched:[...h.fetched.filter(y=>y.address!==c),g.state]}):t({fetching:!1,errored:[...h.errored.filter(y=>y.address!==c),{address:c}]})}).catch(g=>{console.error(g),t({fetching:!1,error:at(g)})}))},[h.address,h.fetching]),q.useEffect(()=>{if(h.address){const c=je.toAddress(h.address);if(!je.isValid(c)){t({error:j("blocklet.config.vault.error.invalid")});return}if(vn.schemas.tokenHolder.validate(c).error){t({error:j("blocklet.config.vault.error.holder")});return}if(C.find(a=>a.did===c)){t({error:j("blocklet.config.vault.error.duplicate")});return}if(Qs([O.appDid,O.appPid,...O.migratedFrom.map(a=>a.appDid)].filter(Boolean)).includes(c)){t({error:j("blocklet.config.vault.error.appDid")});return}}t({error:""})},[h.address]);const l=async()=>{t({loading:!0});try{const c=await m.configVault({input:{teamDid:f,vaultDid:je.toAddress(h.address)}});i.open({locale:p,action:"approve-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:c.sessionId},messages:{title:j("blocklet.config.vault.approve.title"),scan:j(`blocklet.config.vault.approve.${C.length>0?"byLast":"byOwner"}`),confirm:j("blocklet.config.vault.approve.confirm"),success:j("blocklet.config.vault.approve.success")},onSuccess:()=>{i.open({locale:p,action:"config-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:c.sessionId},messages:{title:j("blocklet.config.vault.commit.title"),scan:j("blocklet.config.vault.commit.scan"),confirm:j("blocklet.config.vault.commit.confirm"),success:j("blocklet.config.vault.commit.success")},onSuccess:()=>{t({loading:!1}),R()},onClose:()=>{t({loading:!1}),i.close()}})},onClose:()=>{t({loading:!1}),i.close()}})}catch(c){t({loading:!1,error:at(c)})}},o=je.toAddress(h.address),r=[];je.isValid(o)&&r.push({key:j("blocklet.config.vault.role"),value:e.jsx(ft,{color:"primary",variant:"outlined",size:"small",label:je.toTypeInfoStr(o).role||"-"})});const s=h.fetched.find(c=>c.address===o);return s&&r.push({key:j("blocklet.config.vault.firstSeen"),value:St(s.context?.genesisTime,"-")},{key:j("blocklet.config.vault.lastSeen"),value:St(s.context?.renaissanceTime,"-")},{key:j("blocklet.config.vault.migratedFrom"),value:s.migratedFrom.length?s.migratedFrom.map(c=>e.jsx(it,{did:c,showQrcode:!0,compact:!0,size:14,locale:p},c)):"-"},{key:j("blocklet.config.vault.migratedTo"),value:s.migratedTo.length?s.migratedTo.map(c=>e.jsx(it,{did:c,showQrcode:!0,compact:!0,size:14,locale:p},c)):"-"}),e.jsx(ke,{open:!0,fullWidth:!0,showCloseButton:!1,onClose:v,title:e.jsxs($,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(rs,{}),j("blocklet.config.vault.title")]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(re,{onClick:v,children:j("common.cancel")}),e.jsx(re,{onClick:l,variant:"contained",disabled:!!h.error||h.loading,children:j("common.confirm")})]}),children:e.jsxs(ie,{direction:"column",spacing:3,children:[e.jsxs(Y,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[j("blocklet.config.vault.desc")," ",j("blocklet.config.vault.tip")]}),C.length>0&&e.jsxs($,{children:[e.jsxs(Y,{variant:"body1",gutterBottom:!0,sx:{color:"text.secondary"},children:[j("blocklet.config.vault.current"),":"]}),e.jsxs($,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(er,{did:C[C.length-1].did,showQrcode:!0,style:{width:"auto"}}),e.jsx(Tr,{vaults:C,appPid:_})]})]}),e.jsx(U,{fullWidth:!0,"data-cy":"input-factory-address",label:j("blocklet.config.vault.address"),error:!!h.error,helperText:h.error,value:h.address,onChange:c=>{t({address:c.target.value,error:""})},slotProps:{input:{endAdornment:h.fetching?e.jsx(Vt,{position:"end",children:e.jsx(Ee,{size:16})}):null}}}),e.jsx($,{sx:{"& .info-row__name":{fontSize:"14px"},"& .info-row__value":{fontSize:"14px"}},children:r.map(c=>e.jsx(Qt,{valueComponent:"div",nameWidth:120,name:c.key,children:c.value},c.key))})]})})}fs.propTypes={onCancel:T.func.isRequired,onSuccess:T.func.isRequired,blocklet:T.object.isRequired};function xt({blocklet:v,onUpdate:R=()=>{},hasPermission:O=!1}){const{info:C,api:_,inService:j}=ne(),{t:p,locale:i}=q.useContext(ue),[m,f]=gt({loading:!1,showTransferOwner:!1,showConfigVault:!1}),[h,t]=q.useState(()=>v?.settings?.gateway?.wafPolicy?.enabled??!0),[l,o]=q.useState(()=>!!v?.settings?.enableSessionHardening),[r,s]=q.useState(()=>!!v?.settings?.invite?.enabled),[c,n]=q.useState(()=>{const I=v?.settings?.org||{};return{enabled:I.enabled||!1,maxMemberPerOrg:I.maxMemberPerOrg||100,maxOrgPerUser:I.maxOrgPerUser||10}}),a=m.loading||!O,{did:u}=v.meta,g=j?window.env?.gateway?.wafPolicy?.enabled:C?.routing.wafPolicy?.enabled;if(pt(v.status))return null;const y=v.environments.find(I=>I.key===W.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE),k=!y||y.value==="yes",d=v.environments.find(I=>I.key===W.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE)?.value||W.BLOCKLET_TENANT_MODES.SINGLE,x=(I,z)=>async F=>{if(!m.loading){f({loading:!0});try{const{checked:K}=F.target,{blocklet:he}=await _.configBlocklet({input:{did:v.meta.did,configs:[{key:W.BLOCKLET_CONFIGURABLE_KEY[I],value:z(K)}]}});R(he)}catch(K){Z.error(K.message)}finally{f({loading:!1})}}},b=x("BLOCKLET_DELETABLE",I=>I?"no":"yes"),S=x("BLOCKLET_APP_TENANT_MODE",I=>I?W.BLOCKLET_TENANT_MODES.MULTIPLE:W.BLOCKLET_TENANT_MODES.SINGLE),A=(I,z)=>async F=>{if(!m.loading){f({loading:!0});try{const K=F.target.checked;await _.updateBlockletSettings({input:I(K)}),z&&z(K)}catch(K){Z.error(K.message)}finally{f({loading:!1})}}},P=A(I=>({did:v.meta.did,invite:{enabled:I}}),s),L=A(I=>({did:v.meta.did,org:{enabled:I,maxMemberPerOrg:100,maxOrgPerUser:10}}),I=>{n({...c,enabled:I})}),D=async(I,z)=>{if(!m.loading){f({loading:!0});try{await _.updateBlockletSettings({input:{did:v.meta.did,org:{...c,[I]:z}}}),n({...c,[I]:z})}catch(F){Z.error(F.message)}finally{f({loading:!1})}}},N=A(I=>({did:v.meta.did,gateway:{wafPolicy:{enabled:I}}}),t),V=A(I=>({did:v.meta.did,enableSessionHardening:I}),I=>{o(I),tr()}),B=async()=>{if(!m.loading){f({loading:!0});try{const{blocklet:I}=await _.getBlocklet({input:{did:v.meta.did}});R(I)}catch(I){Z.error(I.message)}finally{f({loading:!1})}}};return e.jsxs(ie,{p:3,sx:{border:"1px solid red",borderRadius:2,p:3},className:"advanced-config",children:[!j&&e.jsxs(e.Fragment,{children:[e.jsx(M,{title:p("blocklet.config.deletable.name"),desc:p(k?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:!k,defaultChecked:!0,onChange:b})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}})]}),e.jsx(us,{inService:j,disabled:a,loading:m.loading,onChange:B}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),j&&e.jsx(wr,{role:"owner",children:I=>(I||mn)&&e.jsxs(e.Fragment,{children:[e.jsx(M,{title:p("blocklet.config.vault.title"),desc:p("blocklet.config.vault.desc"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsxs(re,{variant:"contained",color:"primary",size:"small","data-cy":"config-vault",onClick:()=>f({showConfigVault:!0}),children:[e.jsx(rs,{style:{fontSize:"1.3em",marginRight:4}}),p("blocklet.config.vault.title")]})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),m.showConfigVault&&e.jsx(fs,{blocklet:v,onCancel:()=>f({showConfigVault:!1}),onSuccess:()=>f({showConfigVault:!1})}),e.jsx(M,{title:p("team.transferApp.name"),desc:p("team.transferApp.description"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsxs(re,{variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"transfer-app",onClick:()=>f({showTransferOwner:!0}),children:[e.jsx(Xr,{style:{fontSize:"1.3em",marginRight:4}}),p("team.transferApp.name")]})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),m.showTransferOwner&&e.jsx(hs,{onCancel:()=>f({showTransferOwner:!1}),onSuccess:()=>f({showTransferOwner:!1})})]})}),e.jsx(M,{title:p("blocklet.config.clearCache.name"),desc:p("blocklet.config.clearCache.purpose"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(Rr,{teamDid:u})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:p("blocklet.config.rotateSessionKey.name"),desc:p("blocklet.config.rotateSessionKey.purpose"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(Or,{style:{whiteSpace:"nowrap"},teamDid:u})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:p("blocklet.config.tenantMode.name"),desc:p(`blocklet.config.tenantMode.${d}`),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:d===W.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:S})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:p("team.invite.setting"),desc:p(`team.invite.${r?"enabled":"disabled"}`),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:r,onChange:P})})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:e.jsxs(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:[p("setting.form.enableSessionHardening.switchLabel"),e.jsx(te,{title:p("setting.form.enableSessionHardening.switchTips"),children:e.jsx(Ct,{sx:{ml:.5,fontSize:"20px"},color:"primary"})})]}),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:l,onChange:V})})}),g&&e.jsxs(e.Fragment,{children:[e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:e.jsxs(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:[p("router.gateway.wafPolicy.title"),e.jsx(te,{title:e.jsx($,{sx:{fontSize:"14px",lineHeight:1.5},children:e.jsx($,{sx:{color:"common.white",ml:.5},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${i}/enable-web-application-firewall`,target:"_blank",rel:"noopener noreferrer",children:p("dashboard.document")})}),children:e.jsx(Ct,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]}),desc:p("router.gateway.wafPolicy.switchLabel"),children:e.jsx($,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:e.jsx(pe,{disabled:a,checked:h,onChange:N})})})]}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx(M,{title:e.jsx(ie,{direction:"row",sx:{alignItems:"center",gap:1},children:p("common.orgs")}),desc:p("team.orgs.explain"),children:e.jsxs($,{sx:{display:"flex",flexDirection:"column",gap:2,width:"100%",alignSelf:{xs:"flex-start",md:"flex-end"}},children:[e.jsx(pe,{disabled:a,checked:c.enabled,onChange:L}),c.enabled&&e.jsxs($,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:400,mt:1},children:[e.jsx(lt,{style:{marginTop:0},disabled:a,loading:m.loading,type:"number",min:2,initialValue:c.maxOrgPerUser,label:p("team.orgs.invite.maxOrgs"),placeholder:p("team.orgs.invite.maxOrgs"),onSubmit:I=>D("maxOrgPerUser",I)}),e.jsx(lt,{style:{marginTop:0},disabled:a,loading:m.loading,type:"number",min:2,initialValue:c.maxMemberPerOrg,label:p("team.orgs.invite.maxMembers"),placeholder:p("team.orgs.invite.maxMembers"),onSubmit:I=>D("maxMemberPerOrg",I)})]})]})})]})}const bn=Ie(xt,"mutate_blocklets"),jn=Ie(xt,"",mt);function _n(v){const{inService:R}=ne();return R?e.jsx(jn,{...v}):e.jsx(bn,{...v})}xt.propTypes={blocklet:T.object.isRequired,onUpdate:T.func,hasPermission:T.bool};function vt({blocklet:v,onUpdate:R=()=>{},hasPermission:O=!1,...C}){const{t:_}=q.useContext(ue);return pt(v.status)?null:e.jsxs(Cn,{...C,children:[e.jsx(un,{blocklet:v,onUpdate:R,hasPermission:O}),e.jsx($,{sx:{mt:6},children:e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:_("blocklet.config.dangerZone")})}),e.jsx($,{className:"config-form",component:G,sx:{my:3}}),e.jsx($,{sx:{maxWidth:1536},children:e.jsx(_n,{blocklet:v,onUpdate:R,hasPermission:O})})]})}const wn=Ie(vt,"mutate_blocklets"),kn=Ie(vt,"",mt);function Sn(v){const{inService:R}=ne();return R?e.jsx(kn,{...v}):e.jsx(wn,{...v})}vt.propTypes={blocklet:T.object.isRequired,onUpdate:T.func,hasPermission:T.bool};const Cn=xe($)`
|
|
51
51
|
.config-form {
|
|
52
52
|
flex-grow: 1;
|
|
53
53
|
overflow-y: auto;
|