@abtnode/blocklet-services 1.16.44-beta-20250520-104453-912ed737 → 1.16.44-beta-20250524-065731-c62fd374
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/services/mcp/server.js +18 -3
- package/dist/assets/{AdapterDayjs-Bck9Dv3l.js → AdapterDayjs-DnsMePpQ.js} +1 -1
- package/dist/assets/{ArrowDropDown-BleCy3ti.js → ArrowDropDown-Dzy2X1bv.js} +1 -1
- package/dist/assets/{CheckCircle-XrJDG94y.js → CheckCircle-DA1-Q3VQ.js} +1 -1
- package/dist/assets/{ChevronLeft-BlDLI-Qo.js → ChevronLeft-C7-bj_BM.js} +1 -1
- package/dist/assets/{ChevronRight-DkPaON7R.js → ChevronRight-CA18V4hg.js} +1 -1
- package/dist/assets/{Community-BCL2L7ib.js → Community-BnAsVqMr.js} +1 -1
- package/dist/assets/{DeleteOutline-Cj7UhBbF.js → DeleteOutline-DIXSGJ49.js} +1 -1
- package/dist/assets/{Done-UEZFWnHj.js → Done-BHbsILFJ.js} +1 -1
- package/dist/assets/{Download-CsoZ8yOi.js → Download-CmhNaqwS.js} +1 -1
- package/dist/assets/{Edit-Bj4m2hpD.js → Edit-CNRD5aKM.js} +1 -1
- package/dist/assets/{EditIcon-Dffk7mPL.js → EditIcon-8BXW1OHp.js} +1 -1
- package/dist/assets/{Email-CdSNK0eA.js → Email-BirbvqZ3.js} +1 -1
- package/dist/assets/{Error-BwUoSWOt.js → Error-DDQf7Wzw.js} +1 -1
- package/dist/assets/{ExpandLess-CjIzahHO.js → ExpandLess-D15nWpBQ.js} +1 -1
- package/dist/assets/{Google-BON6upKi.js → Google-BEEvQjkX.js} +1 -1
- package/dist/assets/{Holiday-enHMZqEf.js → Holiday-C4KRd5t6.js} +1 -1
- package/dist/assets/Home-C8za96Ud.js +1 -0
- package/dist/assets/{InfoOutlined-uoMMChNE.js → InfoOutlined-Cxpk0UTX.js} +1 -1
- package/dist/assets/{Launch-rj4Kr2rA.js → Launch-CKr_eo1b.js} +1 -1
- package/dist/assets/{LaunchOutlined-0gUfY-5D.js → LaunchOutlined-Drryv7vp.js} +1 -1
- package/dist/assets/{Location-By12Z3Te.js → Location-DxPzfR_p.js} +1 -1
- package/dist/assets/{LockIcon-98CKEIBe.js → LockIcon-DFb6sSpT.js} +1 -1
- package/dist/assets/{Meeting-CLeFWDkY.js → Meeting-DCL_ygud.js} +1 -1
- package/dist/assets/{MoreHoriz-3SNxR36h.js → MoreHoriz-CKCGMlB8.js} +1 -1
- package/dist/assets/{OffSick-dUm363rs.js → OffSick-DvgkmCUP.js} +1 -1
- package/dist/assets/{Phone--BSu-btI.js → Phone-BkOMNOMO.js} +1 -1
- package/dist/assets/{PlayArrow-BHO_DqT2.js → PlayArrow-CrmMAssx.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-DTf-Tya5.js → QuestionMarkCircle-DTGyWFVS.js} +1 -1
- package/dist/assets/{Timezone-YZ0dMUEr.js → Timezone-D91Of94T.js} +1 -1
- package/dist/assets/{TuneOutlined-BvtfOd23.js → TuneOutlined-Dp4gMD_8.js} +1 -1
- package/dist/assets/{ViewList-BvucdDXZ.js → ViewList-ByzGtByR.js} +1 -1
- package/dist/assets/{WorkingRemotely-BX7rgbEY.js → WorkingRemotely-CpchWcXV.js} +1 -1
- package/dist/assets/{access-control-C9ZsDLlM.js → access-control-CHRw2bbp.js} +1 -1
- package/dist/assets/{actions-BWSNMC_c.js → actions-XNIU_ion.js} +1 -1
- package/dist/assets/{add-component-core-Dd9KPcvp.js → add-component-core-eEjKF53n.js} +33 -33
- package/dist/assets/{add-resource-BHmsfuUO.js → add-resource-W-ML3m5q.js} +1 -1
- package/dist/assets/{addon-CaGk2PdY.js → addon-DGwzoD-f.js} +1 -1
- package/dist/assets/{advanced-DlILcrRl.js → advanced-CPhRkaAJ.js} +2 -2
- package/dist/assets/appearance-Bgtb4-LE.js +1 -0
- package/dist/assets/ar-CHiV3Onz.js +1 -0
- package/dist/assets/{ar-C_INBNFD.js → ar-T0OvMFDJ.js} +2 -2
- package/dist/assets/{audit-logs-DfXh1JQZ.js → audit-logs-DCTnwVQT.js} +3 -3
- package/dist/assets/authorize-0cAl16_K.js +1 -0
- package/dist/assets/base-chart-D6qRW4Yg.js +1 -0
- package/dist/assets/{base32-BnPQ4q4v.js → base32-DEQDAhbh.js} +1 -1
- package/dist/assets/branding-6OsQw5QJ.js +40 -0
- package/dist/assets/{branding-CbgACClH.js → branding-Bv8Tk-Am.js} +1 -1
- package/dist/assets/bundle-avatar-WoSDDX0E.js +1 -0
- package/dist/assets/button-D7WVH4Bm.js +1 -0
- package/dist/assets/click-to-copy-DsH0RQVg.js +1 -0
- package/dist/assets/{collapse-iOiHn4dy.js → collapse-DRHShQoZ.js} +1 -1
- package/dist/assets/complete-BJLGhmnP.js +39 -0
- package/dist/assets/{component-amc-22MQ.js → component-BFi7evus.js} +2 -2
- package/dist/assets/{config-D3UduD_R.js → config-BfjiZ8-q.js} +2 -2
- package/dist/assets/{config-B_jIm01w.js → config-C77UXU2G.js} +1 -1
- package/dist/assets/{config-navigation-PoVJgHNU.js → config-navigation-BkfKynqT.js} +6 -6
- package/dist/assets/config-space-DID86BbB.js +1 -0
- package/dist/assets/{confirm-DaR0Yx39.js → confirm-BnRcXvxs.js} +1 -1
- package/dist/assets/connect-DJCBGsCy.js +1 -0
- package/dist/assets/connect-DyhNsjIB.js +5 -0
- package/dist/assets/connect-to-BYS6M9JU.js +1 -0
- package/dist/assets/{content-layout--sy9JlYZ.js → content-layout-fV4nyVb5.js} +1 -1
- package/dist/assets/dark-animation-DhFa8I7D.js +1 -0
- package/dist/assets/dashboard-RTzIKcnI.js +239 -0
- package/dist/assets/de-BWtUXhCw.js +1 -0
- package/dist/assets/{de-EYXdEi3Y.js → de-WYW4JJdA.js} +2 -2
- package/dist/assets/default-animation-DARmPWCI.js +1 -0
- package/dist/assets/{delete-confirm-DHB0S_Co.js → delete-confirm-2yiel8lV.js} +1 -1
- package/dist/assets/{did-address-mv0Qw7hC.js → did-address-2a_50VlM.js} +1 -1
- package/dist/assets/domain-B7QeQ3KX.js +9 -0
- package/dist/assets/domain-action-card-CLEjpu-P.js +28 -0
- package/dist/assets/domains-Bu0iN_az.js +1 -0
- package/dist/assets/dot-itVN8XTt.js +7 -0
- package/dist/assets/{email-DiuMAA8U.js → email-9sDMxuoB.js} +2 -2
- package/dist/assets/{empty-spinner-BZw_ShnT.js → empty-spinner-BdaCO6xq.js} +1 -1
- package/dist/assets/es-B6GuFK3b.js +1 -0
- package/dist/assets/{es-3jqVamM8.js → es-DaHPJdAX.js} +2 -2
- package/dist/assets/{exchange-passport-Bcw--2wm.js → exchange-passport-CzmhafoN.js} +1 -1
- package/dist/assets/fr-DjhyyiEi.js +1 -0
- package/dist/assets/{fr-CUcR-yNv.js → fr-Sdn9hi8k.js} +2 -2
- package/dist/assets/{fuel-BitXgq2D.js → fuel-D_QIEw1n.js} +1 -1
- package/dist/assets/gen-access-key-BmDWpAif.js +2 -0
- package/dist/assets/get-safe-url-BdFxF8pA.js +1 -0
- package/dist/assets/get-safe-url-DfW-qoLB.js +1 -0
- package/dist/assets/hi-CtKbt1J4.js +1 -0
- package/dist/assets/{hi-DNldhMTl.js → hi-dJuR0lt2.js} +2 -2
- package/dist/assets/{home-jh95SgT7.js → home-DtVAZY8s.js} +1 -1
- package/dist/assets/id-CCuL3FP-.js +1 -0
- package/dist/assets/{id-CmSIFhX-.js → id-DuYS34H0.js} +2 -2
- package/dist/assets/{iframe-BlPuY8Pu.js → iframe-dmrNn49R.js} +1 -1
- package/dist/assets/{index-CleFkLt8.js → index-B4CzEaVv.js} +1 -1
- package/dist/assets/{index-CZOVduSH.js → index-B4rUFDP9.js} +1 -1
- package/dist/assets/{index-YuW8IExe.js → index-B6g_NzxF.js} +22 -22
- package/dist/assets/index-BctwEFbW.js +55 -0
- package/dist/assets/index-Bhwq-PC6.js +284 -0
- package/dist/assets/{index-BdH_4Yfe.js → index-BmXcRfZR.js} +1 -1
- package/dist/assets/index-Bw-rbXJI.js +6 -0
- package/dist/assets/index-C2wxmxz2.js +1 -0
- package/dist/assets/{index-DYlN9Brg.js → index-C5N0NjEs.js} +12 -12
- package/dist/assets/{index-Bv8sds6g.js → index-CBALX7k4.js} +1 -1
- package/dist/assets/{index-Bi-YrbEk.js → index-CGHej0Ek.js} +4 -4
- package/dist/assets/index-CT4keHaK.js +1 -0
- package/dist/assets/index-CtxraYdM.js +113 -0
- package/dist/assets/{index-C849wD9b.js → index-D2uDBC1o.js} +1 -1
- package/dist/assets/{index-CqRVUIz0.js → index-D45FqXMt.js} +3 -3
- package/dist/assets/{index-BWshat_T.js → index-DBBjaba5.js} +7 -7
- package/dist/assets/{index-hjv3dFXZ.js → index-DLdz4ykT.js} +1 -1
- package/dist/assets/{index-Cgdb1aGn.js → index-DdKYu9HL.js} +10 -10
- package/dist/assets/index-Dq_lSUqL.js +1 -0
- package/dist/assets/{index-D3Od1Ju7.js → index-DtsBFtZP.js} +9 -9
- package/dist/assets/{index-C0w1ugDi.js → index-J3Tqz9ZT.js} +1 -1
- package/dist/assets/{index-DbsXFWms.js → index-RsjqbOR7.js} +1 -1
- package/dist/assets/{index-BXkKeWVW.js → index-Z_7QgoWt.js} +2 -2
- package/dist/assets/{index-CmQOzzP8.js → index-iB7JyXwh.js} +1 -1
- package/dist/assets/index-iphP5FWX.js +10 -0
- package/dist/assets/{invitation-BtuI3wbb.js → invitation-DG9MWQbS.js} +5 -5
- package/dist/assets/invite-DLCj8sz9.js +1 -0
- package/dist/assets/{issue-passport-DGinrMdr.js → issue-passport-BWxVIA89.js} +1 -1
- package/dist/assets/item-CUEEdtq7.js +2 -0
- package/dist/assets/ja-ACgKScTi.js +1 -0
- package/dist/assets/{ja-D-vAGmH7.js → ja-Dh60q0r5.js} +2 -2
- package/dist/assets/{ko-DpdamIdS.js → ko-CoqvBZUf.js} +2 -2
- package/dist/assets/ko-gvJH4zFR.js +1 -0
- package/dist/assets/{landing-page-D_TLvQ3s.js → landing-page-DErP-951.js} +1 -1
- package/dist/assets/{launch-result-message-Eea5FZDm.js → launch-result-message-FuvJDCvp.js} +1 -1
- package/dist/assets/{layout-0pbi4f6l.js → layout-BpHPXY7v.js} +1 -1
- package/dist/assets/{list-C_1TcitB.js → list-95F7XaG9.js} +6 -6
- package/dist/assets/list-TUiipUoi.js +2 -0
- package/dist/assets/{list-header-DNFbdM3a.js → list-header-xt282ZMS.js} +1 -1
- package/dist/assets/localization-Dale72UG.js +1 -0
- package/dist/assets/{log-DnUF9orj.js → log-aS7wDHYq.js} +1 -1
- package/dist/assets/logger-DRlJhYNs.js +1 -0
- package/dist/assets/{login-Boq_S2S7.js → login-BEhRbdo1.js} +1 -1
- package/dist/assets/{login-oauth-callback-CuSXnq1m.js → login-oauth-callback-T6cLlJXo.js} +1 -1
- package/dist/assets/{logo-uploader-DtAT8iaJ.js → logo-uploader-CLz5RPTu.js} +5 -5
- package/dist/assets/lost-passport-C2TUuANu.js +168 -0
- package/dist/assets/{open-window-DXP1LoPD.js → open-window-xER4N-kf.js} +1 -1
- package/dist/assets/{overview-DHcHPq6g.js → overview-CSLXBT0F.js} +2 -2
- package/dist/assets/{page-header-PO_g4wSK.js → page-header-IRqa6Qvs.js} +1 -1
- package/dist/assets/{passport-item-NMGbWwTG.js → passport-item-hLzOrz7-.js} +1 -1
- package/dist/assets/{permission-BfddnDBs.js → permission-BkpeOUF9.js} +1 -1
- package/dist/assets/preferences-CaXn4vHX.js +1 -0
- package/dist/assets/profile-embed-DP-NpR-H.js +1 -0
- package/dist/assets/{pt-CEcOQeEC.js → pt-DCcbs0d0.js} +2 -2
- package/dist/assets/pt-DzswFIpl.js +1 -0
- package/dist/assets/publish-resource-BImGOxGu.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-0e7VDGmi.js → react-beautiful-dnd.esm-CXMxXaUW.js} +1 -1
- package/dist/assets/ru-EZJWVu3M.js +1 -0
- package/dist/assets/{ru-83xhwzPD.js → ru-WYTV5VzH.js} +2 -2
- package/dist/assets/runtime-BdS45sOH.js +1 -0
- package/dist/assets/sdk-DeUOtvaE.js +1 -0
- package/dist/assets/{section-C1TPQFRq.js → section-BB6hVmdO.js} +1 -1
- package/dist/assets/{security-BuN2nUoZ.js → security-bFZAakv0.js} +4 -4
- package/dist/assets/{session-DUt5rVEy.js → session-E0e-X6-a.js} +1 -1
- package/dist/assets/setup-DMmxE-ov.js +30 -0
- package/dist/assets/{shorten-label-Bf7YQUd6.js → shorten-label-DPIZ5X7v.js} +1 -1
- package/dist/assets/{simple-select-DwWEI_ZU.js → simple-select-CN3fsa56.js} +1 -1
- package/dist/assets/slicedToArray-DmqXMnHT.js +2 -0
- package/dist/assets/{spaces-MprwX1Iq.js → spaces-BKlIkPYo.js} +1 -1
- package/dist/assets/start-BXBhW0EF.js +187 -0
- package/dist/assets/{starting-progress-BJCVRFkE.js → starting-progress-CyKicFZc.js} +1 -1
- package/dist/assets/{status-Bo92foK0.js → status-CIwF9IiE.js} +1 -1
- package/dist/assets/{step-actions-D__rjlW_.js → step-actions-Cy_Wn9XZ.js} +1 -1
- package/dist/assets/{studio-kVKG7W3n.js → studio-BSiEg8xP.js} +1 -1
- package/dist/assets/{switch-control-BgwZFVCJ.js → switch-control-DzZXz9Ks.js} +1 -1
- package/dist/assets/{table-tips-nPiIcvAy.js → table-tips-BP0JTpDH.js} +1 -1
- package/dist/assets/th-Bn3Ch7SK.js +1 -0
- package/dist/assets/{th-BQLlyW1N.js → th-Da4lMKTX.js} +2 -2
- package/dist/assets/traffic-Bz2-5BjC.js +1 -0
- package/dist/assets/{transfer-U9z5JNMl.js → transfer-CZ88q7e8.js} +1 -1
- package/dist/assets/{unsubscribe-BmAshFCd.js → unsubscribe-Dc0yE6SM.js} +1 -1
- package/dist/assets/{use-blocklet-logo-3VH4RBTr.js → use-blocklet-logo-DeL5Lmpn.js} +1 -1
- package/dist/assets/{use-mobile-JEGQfLZ2.js → use-mobile-BAa0wi8o.js} +1 -1
- package/dist/assets/{use-mobile-ZAS6Si4t.js → use-mobile-C21X4TYN.js} +1 -1
- package/dist/assets/use-server-logo-CxuMvwKh.js +1 -0
- package/dist/assets/useAsync-510ntT1B.js +1 -0
- package/dist/assets/{useLocalStorage-DotMjDUB.js → useLocalStorage-DvcK7KsP.js} +1 -1
- package/dist/assets/{user-center-8aoMSkJ_.js → user-center-3TxDrG6m.js} +15 -14
- package/dist/assets/{util-CiTimo-i.js → util-IzAdTupy.js} +1 -1
- package/dist/assets/{util-CuK9uaNS.js → util-KGAW0YJ4.js} +1 -1
- package/dist/assets/{vendor-arcblock-Ca95GLVH.js → vendor-arcblock-CUb0jDdY.js} +86 -86
- package/dist/assets/{vendor-hooks-DpwFseeF.js → vendor-hooks-BgUTpb6X.js} +1 -1
- package/dist/assets/{vendor-mui-core-Bh-qMRq3.js → vendor-mui-core-BV2FUxWJ.js} +22 -22
- package/dist/assets/{vendor-mui-x-CQTjfcpn.js → vendor-mui-x-Bo-XOtzq.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-D0L9YnHn.js → vendor-ux-did-connect-DprdyYny.js} +148 -148
- package/dist/assets/{vi-DgWAr6FA.js → vi-BxzaqoH9.js} +2 -2
- package/dist/assets/vi-CgnGroV4.js +1 -0
- package/dist/assets/wrap-locale-BjqARXGJ.js +1 -0
- package/dist/assets/zh-BWgwGxeZ.js +1 -0
- package/dist/assets/{zh-BL80PoOh.js → zh-Do6onry4.js} +2 -2
- package/dist/assets/{zh-tw-Dg5z1DFE.js → zh-tw-BNgoHsYW.js} +2 -2
- package/dist/assets/zh-tw-Ciod1pFs.js +1 -0
- package/dist/images/mcp/claude.webp +0 -0
- package/dist/images/mcp/cline.png +0 -0
- package/dist/images/mcp/cursor.png +0 -0
- package/dist/images/mcp/default.png +0 -0
- package/dist/images/mcp/enconvo.png +0 -0
- package/dist/images/mcp/roocline.png +0 -0
- package/dist/images/mcp/windsurf.png +0 -0
- package/dist/images/mcp/witsy.png +0 -0
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +34 -34
- package/dist/assets/ServerLogo-CEsILJl5.js +0 -1
- package/dist/assets/appearance-D1sGjeMk.js +0 -1
- package/dist/assets/ar-BRKjvO8p.js +0 -1
- package/dist/assets/authorize-mEHpiCQH.js +0 -1
- package/dist/assets/branding-BHziMdwk.js +0 -40
- package/dist/assets/bundle-avatar-D7QQIJpo.js +0 -1
- package/dist/assets/button-DXOAf3Np.js +0 -1
- package/dist/assets/click-to-copy-DtGgy9Ua.js +0 -1
- package/dist/assets/complete-CKdswLjZ.js +0 -39
- package/dist/assets/config-space-D-DWHYER.js +0 -1
- package/dist/assets/connect-CVfkW49h.js +0 -1
- package/dist/assets/connect-CvEHPjqh.js +0 -5
- package/dist/assets/connect-to-DrhAN5Nn.js +0 -1
- package/dist/assets/dashboard-B_QqB4aw.js +0 -239
- package/dist/assets/de-D3cg0t9f.js +0 -1
- package/dist/assets/domain-BR9srj-p.js +0 -9
- package/dist/assets/domain-action-card-DtwNOaxH.js +0 -28
- package/dist/assets/domains-Bg_t1pz-.js +0 -1
- package/dist/assets/dot-D3X4DSlo.js +0 -7
- package/dist/assets/es-DPjqApVE.js +0 -1
- package/dist/assets/fr-Dscs9WsP.js +0 -1
- package/dist/assets/gen-access-key-CrHniwdW.js +0 -2
- package/dist/assets/get-safe-url-BRocR2aJ.js +0 -1
- package/dist/assets/get-safe-url-DYtntqqo.js +0 -1
- package/dist/assets/hi-B8D3j6bs.js +0 -1
- package/dist/assets/id-DWMMQI0G.js +0 -1
- package/dist/assets/index-BDcuaL48.js +0 -113
- package/dist/assets/index-BO7CJLK3.js +0 -284
- package/dist/assets/index-B_y3Xcdb.js +0 -55
- package/dist/assets/index-D0TzEmpA.js +0 -6
- package/dist/assets/index-DO4zGWKz.js +0 -1
- package/dist/assets/index-RDZtjGNC.js +0 -1
- package/dist/assets/index-c0hdujdn.js +0 -10
- package/dist/assets/invite-CelTXbxx.js +0 -1
- package/dist/assets/item-BhN-qZd_.js +0 -2
- package/dist/assets/ja-3LoBq68U.js +0 -1
- package/dist/assets/ko-B2dxwXDl.js +0 -1
- package/dist/assets/list-DKIkIMue.js +0 -2
- package/dist/assets/localization-CpjVJ6VE.js +0 -1
- package/dist/assets/logger-jMgD3u5g.js +0 -1
- package/dist/assets/lost-passport-DuJeKcGu.js +0 -168
- package/dist/assets/preferences-Nt4L8Zgv.js +0 -1
- package/dist/assets/profile-embed-C9nHKFrf.js +0 -1
- package/dist/assets/pt-eei1_Z4R.js +0 -1
- package/dist/assets/publish-resource-BL83FldI.js +0 -1
- package/dist/assets/ru-ZKgT6XdU.js +0 -1
- package/dist/assets/runtime-FDEoUn52.js +0 -1
- package/dist/assets/sdk-CytUSheP.js +0 -1
- package/dist/assets/setup-BB0XLqW9.js +0 -30
- package/dist/assets/slicedToArray-BSaY8ui4.js +0 -2
- package/dist/assets/start-C7CIzLBY.js +0 -187
- package/dist/assets/th-CG5eLRZo.js +0 -1
- package/dist/assets/traffic-Cd92p-Xb.js +0 -35
- package/dist/assets/useAsync-CDjYBiwf.js +0 -1
- package/dist/assets/useAsync-dC0jHVWO.js +0 -1
- package/dist/assets/vi-CoZs3B42.js +0 -1
- package/dist/assets/wrap-locale-QBHz1ECC.js +0 -1
- package/dist/assets/zh-CgkeS2I3.js +0 -1
- package/dist/assets/zh-tw-CuakNRcW.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{r as Ee,e as ze}from"./vendor-react-DEoibe3W.js";import{a9 as bt,j as q,ab as We,H as Oe,aa as U,y as hr,T as Be,ah as _t,bs as dr,bR as mr,bx as pr,ak as gr,E as vr,al as er,O as yr,N as br,bt as gt,X as qe}from"./vendor-mui-core-
|
|
1
|
+
import{r as Ee,e as ze}from"./vendor-react-DEoibe3W.js";import{a9 as bt,j as q,ab as We,H as Oe,aa as U,y as hr,T as Be,ah as _t,bs as dr,bR as mr,bx as pr,ak as gr,E as vr,al as er,O as yr,N as br,bt as gt,X as qe}from"./vendor-mui-core-BV2FUxWJ.js";import{D as Je,G as _r,f as wr,aK as xr,n as Mr,aC as $r,z as Yt,W as tr,V as rr}from"./index-B6g_NzxF.js";import{P as kr,w as Ze}from"./permission-BkpeOUF9.js";import{r as wt,a as Ve,B as Le,Z as Te,ao as sr,e as jr,am as nr,bS as Sr,aJ as Rr,h as De,j as Ar,X as Qt,b2 as Or}from"./vendor-ux-did-connect-DprdyYny.js";import{x as ir}from"./vendor-hooks-BgUTpb6X.js";import{c as Ne}from"./vendor-arcblock-CUb0jDdY.js";import{C as xt}from"./confirm-BnRcXvxs.js";import{f as Ue}from"./index-8eXqqyHQ.js";import{_ as Er}from"./useSetState-CWq0AVWn.js";import{u as ar}from"./session-E0e-X6-a.js";import{S as Ie}from"./section-BB6hVmdO.js";import{C as Cr}from"./click-to-copy-DsH0RQVg.js";import{u as or}from"./dashboard-RTzIKcnI.js";import{r as Dr,aL as Ir}from"./vendor-utils-rHXShPKm.js";import{I as Tr}from"./index-CBALX7k4.js";import{W as Lr}from"./did-address-2a_50VlM.js";import{V as qr}from"./status-CIwF9IiE.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DvcK7KsP.js";import"./PlayArrow-CrmMAssx.js";import"./get-safe-url-BdFxF8pA.js";import"./use-blocklet-logo-DeL5Lmpn.js";import"./InfoOutlined-Cxpk0UTX.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./use-mobile-BAa0wi8o.js";import"./omit-D2k92RIF.js";var Mt={},Nr=bt;Object.defineProperty(Mt,"__esModule",{value:!0});var lr=Mt.default=void 0,Pr=Nr(wt()),zr=q;lr=Mt.default=(0,Pr.default)((0,zr.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"}),"VolunteerActivismOutlined");var $t={},Fr=bt;Object.defineProperty($t,"__esModule",{value:!0});var kt=$t.default=void 0,Br=Fr(wt()),Xt=q;kt=$t.default=(0,Br.default)([(0,Xt.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"),(0,Xt.jsx)("circle",{cx:"16",cy:"12",r:"1.5"},"1")],"AccountBalanceWalletOutlined");const Jr=localStorage.getItem("enableDebug")==="true";function Ur({teamDid:I,size:P="small",...B}){const{t:T}=Ve(),{api:L}=Je(),[p,w]=Ee.useState(!1),[l,$]=Ee.useState(null),y=()=>{w(!1),$(null)},m=async()=>{var a;try{w(!0);const i=await L.clearCache({input:{teamDid:I}});Te.success(T("blocklet.config.clearCache.success",{count:((a=i.removed)==null?void 0:a.length)||0}))}catch(i){Te.error(Ue(i))}finally{w(!1),$(null)}},e={title:T("blocklet.config.clearCache.title"),description:T("blocklet.config.clearCache.description"),confirm:T("common.confirm"),cancel:T("common.cancel"),onConfirm:m,onCancel:y};return q.jsxs("div",{...B,children:[q.jsxs(Le,{onClick:()=>$(e),color:"error",variant:"outlined",size:P,children:[p?q.jsx(We,{size:16,style:{marginRight:5}}):null,T("blocklet.config.clearCache.action")]}),l&&q.jsx(xt,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}var jt={},Vr=bt;Object.defineProperty(jt,"__esModule",{value:!0});var cr=jt.default=void 0,Kr=Vr(wt()),Wr=q;cr=jt.default=(0,Kr.default)((0,Wr.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"}),"KeyOutlined");function St({onChange:I,disabled:P,loading:B,inService:T}){const{t:L}=Ve(),{api:p,session:w}=ar(),{blocklet:l}=_r(),[$,y]=Er({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),m=()=>y({isConnectOpen:!1}),e=()=>{if(wr.isInProgress(l.status)){Te.error(L("blocklet.error.isInProgress"));return}y({confirmDialogOpen:!0})};return q.jsxs(q.Fragment,{children:[q.jsx(Ie,{title:L("blocklet.config.migrate.button"),desc:L("blocklet.config.migrate.description"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsxs(hr,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:P||B,onClick:e,children:[q.jsx(cr,{style:{fontSize:"1.3em",marginRight:4}}),L("blocklet.config.migrate.button")]})})}),q.jsxs(q.Fragment,{children:[$.isConnectOpen&&q.jsx(sr,{popup:!0,open:$.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:p.get,checkTimeout:5*60*1e3,onSuccess:()=>{I(),T&&w.logout(),m()},extraParams:{appDid:l.appDid},messages:{title:L("setup.keyPair.title"),scan:L("setup.keyPair.scan"),confirm:L("setup.keyPair.confirm"),success:L("setup.keyPair.success")},onClose:m}),$.confirmDialogOpen&&q.jsx(xt,{title:q.jsx(Be,{sx:{fontSize:"20px",fontWeight:"500"},children:L("blocklet.config.migrate.title")}),description:q.jsx(Be,{sx:{fontSize:"14px",color:"#9397A1"},children:L("blocklet.config.migrate.confirm")}),confirm:L("common.confirm"),cancel:L("common.cancel"),onConfirm:()=>y({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>y({confirmDialogOpen:!1})})]})]})}St.propTypes={onChange:Oe.func,disabled:Oe.bool,loading:Oe.bool,inService:Oe.bool};St.defaultProps={onChange:()=>{},disabled:!1,loading:!1,inService:!1};function Rt({onCancel:I,onSuccess:P,onError:B}){const{api:T}=Ee.useContext(jr),[L,p]=Ee.useState(!1),{t:w,locale:l}=Ve(),[$,y]=Ee.useState(""),[m,e]=Ee.useState(!1),[a,i]=Ee.useState(0),[r,t]=Ee.useState(""),{endpoint:c}=or(),[s,o]=Ee.useState(!1),h=f=>{y(null),p(!0);try{t(f.result),i(j.length-1)}catch(v){const x=Ue(v);y(x),B(v)}finally{p(!1)}},g=()=>{e(!0),i(1)},b=()=>{e(!1),i(0)},j=[{body:q.jsxs(U,{children:[q.jsx(Be,{children:w("team.transferApp.transferDialog.tips.progress")}),q.jsx(Be,{mt:3,mb:2,children:w("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:w("common.cancel"),confirm:w("team.transferApp.transferDialog.createTransferLink"),onCancel:I,onConfirm:g},{cancel:w("common.cancel"),confirm:w("team.transferApp.transferDialog.createTransferLink"),body:()=>q.jsx(sr,{action:"transfer-app-owner",open:m,locale:l,checkFn:T.get,onClose:b,onSuccess:h,checkTimeout:5*60*1e3,extraParams:{},messages:{title:w("team.transferApp.connectDialog.title"),scan:w("team.transferApp.connectDialog.scan"),confirm:w("team.transferApp.connectDialog.confirm"),success:w("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const f=xr({transferId:r.transferId,endpoint:c});return q.jsxs(q.Fragment,{children:[q.jsx(U,{component:Fe,dangerouslySetInnerHTML:{__html:w("team.transferApp.transferDialog.createSuccessTip1")}}),q.jsx(U,{component:Fe,mt:2,children:q.jsx(Fe,{children:w("team.transferApp.transferDialog.createSuccessTip3")})}),q.jsxs(U,{children:[q.jsx(U,{component:Fe,mt:2,children:q.jsx(Fe,{children:w("team.transferApp.transferDialog.createSuccessTip2",{expireDate:Mr(r.expireDate,l)})})}),q.jsx(U,{my:1,children:q.jsx(Cr,{children:f})})]}),q.jsx("div",{children:q.jsx(dr,{value:"end",control:q.jsx(mr,{checked:s,onChange:v=>o(v.target.checked)}),label:w("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:w("common.confirm"),onConfirm:P}],k=j[a];return q.jsxs(nr,{title:q.jsx(Fe,{className:"title",children:w("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:q.jsxs(q.Fragment,{children:[k.cancel&&q.jsx(Le,{onClick:k.onCancel,color:"inherit",children:k.cancel}),q.jsxs(Le,{onClick:k.onConfirm,color:"error",disabled:L||a===j.length-1&&!s,variant:"contained",autoFocus:!0,children:[L&&q.jsx(We,{size:16}),k.confirm]})]}),children:[q.jsx(pr,{component:"div",children:typeof k.body=="function"?k.body():k.body}),!!$&&q.jsx(gr,{severity:"error",variant:"icon",children:$})]})}Rt.propTypes={onCancel:Oe.func.isRequired,onSuccess:Oe.func.isRequired,onError:Oe.func};Rt.defaultProps={onError:()=>{}};const Fe=_t.div`
|
|
2
2
|
font-size: 16px;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
&.title {
|
|
5
5
|
font-size: 20px;
|
|
6
6
|
}
|
|
7
|
-
`;var ur={},fr={exports:{}};(function(I,P){(function(B,T){I.exports=T()})(self,()=>{return B={7629:(L,p,w)=>{const l=w(375),$=w(8571),y=w(9474),m=w(1687),e=w(8652),a=w(8160),i=w(3292),r=w(6354),t=w(8901),c=w(9708),s=w(6914),o=w(2294),h=w(6133),g=w(1152),b=w(8863),j=w(2036),k={Base:class{constructor(f){this.type=f,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new o.Ids,this._preferences=null,this._refs=new h.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 l(typeof c.describe=="function","Manifest functionality disabled"),c.describe(this)}allow(...f){return a.verifyFlat(f,"allow"),this._values(f,"_valids")}alter(f){l(f&&typeof f=="object"&&!Array.isArray(f),"Invalid targets argument"),l(!this._inRuleset(),"Cannot set alterations inside a ruleset");const v=this.clone();v.$_terms.alterations=v.$_terms.alterations||[];for(const x in f){const E=f[x];l(typeof E=="function","Alteration adjuster for",x,"must be a function"),v.$_terms.alterations.push({target:x,adjuster:E})}return v.$_temp.ruleset=!1,v}artifact(f){return l(f!==void 0,"Artifact cannot be undefined"),l(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",f)}cast(f){return l(f===!1||typeof f=="string","Invalid to value"),l(f===!1||this._definition.cast[f],"Type",this.type,"does not support casting to",f),this.$_setFlag("cast",f===!1?void 0:f)}default(f,v){return this._default("default",f,v)}description(f){return l(f&&typeof f=="string","Description must be a non-empty string"),this.$_setFlag("description",f)}empty(f){const v=this.clone();return f!==void 0&&(f=v.$_compile(f,{override:!1})),v.$_setFlag("empty",f,{clone:!1})}error(f){return l(f,"Missing error"),l(f instanceof Error||typeof f=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",f)}example(f,v={}){return l(f!==void 0,"Missing example"),a.assertOptions(v,["override"]),this._inner("examples",f,{single:!0,override:v.override})}external(f,v){return typeof f=="object"&&(l(!v,"Cannot combine options with description"),v=f.description,f=f.method),l(typeof f=="function","Method must be a function"),l(v===void 0||v&&typeof v=="string","Description must be a non-empty string"),this._inner("externals",{method:f,description:v},{single:!0})}failover(f,v){return this._default("failover",f,v)}forbidden(){return this.presence("forbidden")}id(f){return f?(l(typeof f=="string","id must be a non-empty string"),l(/^[^\.]+$/.test(f),"id cannot contain period character"),this.$_setFlag("id",f)):this.$_setFlag("id",void 0)}invalid(...f){return this._values(f,"_invalids")}label(f){return l(f&&typeof f=="string","Label name must be a non-empty string"),this.$_setFlag("label",f)}meta(f){return l(f!==void 0,"Meta cannot be undefined"),this._inner("metas",f,{single:!0})}note(...f){l(f.length,"Missing notes");for(const v of f)l(v&&typeof v=="string","Notes must be non-empty strings");return this._inner("notes",f)}only(f=!0){return l(typeof f=="boolean","Invalid mode:",f),this.$_setFlag("only",f)}optional(){return this.presence("optional")}prefs(f){l(f,"Missing preferences"),l(f.context===void 0,"Cannot override context"),l(f.externals===void 0,"Cannot override externals"),l(f.warnings===void 0,"Cannot override warnings"),l(f.debug===void 0,"Cannot override debug"),a.checkPreferences(f);const v=this.clone();return v._preferences=a.preferences(v._preferences,f),v}presence(f){return l(["optional","required","forbidden"].includes(f),"Unknown presence mode",f),this.$_setFlag("presence",f)}raw(f=!0){return this.$_setFlag("result",f?"raw":void 0)}result(f){return l(["raw","strip"].includes(f),"Unknown result mode",f),this.$_setFlag("result",f)}required(){return this.presence("required")}strict(f){const v=this.clone(),x=f!==void 0&&!f;return v._preferences=a.preferences(v._preferences,{convert:x}),v}strip(f=!0){return this.$_setFlag("result",f?"strip":void 0)}tag(...f){l(f.length,"Missing tags");for(const v of f)l(v&&typeof v=="string","Tags must be non-empty strings");return this._inner("tags",f)}unit(f){return l(f&&typeof f=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",f)}valid(...f){a.verifyFlat(f,"valid");const v=this.allow(...f);return v.$_setFlag("only",!!v._valids,{clone:!1}),v}when(f,v){const x=this.clone();x.$_terms.whens||(x.$_terms.whens=[]);const E=i.when(x,f,v);if(!["any","link"].includes(x.type)){const N=E.is?[E]:E.switch;for(const M of N)l(!M.then||M.then.type==="any"||M.then.type===x.type,"Cannot combine",x.type,"with",M.then&&M.then.type),l(!M.otherwise||M.otherwise.type==="any"||M.otherwise.type===x.type,"Cannot combine",x.type,"with",M.otherwise&&M.otherwise.type)}return x.$_terms.whens.push(E),x.$_mutateRebuild()}cache(f){l(!this._inRuleset(),"Cannot set caching inside a ruleset"),l(!this._cache,"Cannot override schema cache"),l(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const v=this.clone();return v._cache=f||e.provider.provision(),v.$_temp.ruleset=!1,v}clone(){const f=Object.create(Object.getPrototypeOf(this));return this._assign(f)}concat(f){l(a.isSchema(f),"Invalid schema object"),l(this.type==="any"||f.type==="any"||f.type===this.type,"Cannot merge type",this.type,"with another type:",f.type),l(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),l(!f._inRuleset(),"Cannot concatenate a schema with open ruleset");let v=this.clone();if(this.type==="any"&&f.type!=="any"){const x=f.clone();for(const E of Object.keys(v))E!=="type"&&(x[E]=v[E]);v=x}v._ids.concat(f._ids),v._refs.register(f,h.toSibling),v._preferences=v._preferences?a.preferences(v._preferences,f._preferences):f._preferences,v._valids=j.merge(v._valids,f._valids,f._invalids),v._invalids=j.merge(v._invalids,f._invalids,f._valids);for(const x of f._singleRules.keys())v._singleRules.has(x)&&(v._rules=v._rules.filter(E=>E.keep||E.name!==x),v._singleRules.delete(x));for(const x of f._rules)f._definition.rules[x.method].multi||v._singleRules.set(x.name,x),v._rules.push(x);if(v._flags.empty&&f._flags.empty){v._flags.empty=v._flags.empty.concat(f._flags.empty);const x=Object.assign({},f._flags);delete x.empty,m(v._flags,x)}else if(f._flags.empty){v._flags.empty=f._flags.empty;const x=Object.assign({},f._flags);delete x.empty,m(v._flags,x)}else m(v._flags,f._flags);for(const x in f.$_terms){const E=f.$_terms[x];E?v.$_terms[x]?v.$_terms[x]=v.$_terms[x].concat(E):v.$_terms[x]=E.slice():v.$_terms[x]||(v.$_terms[x]=E)}return this.$_root._tracer&&this.$_root._tracer._combine(v,[this,f]),v.$_mutateRebuild()}extend(f){return l(!f.base,"Cannot extend type with another base"),t.type(this,f)}extract(f){return f=Array.isArray(f)?f:f.split("."),this._ids.reach(f)}fork(f,v){l(!this._inRuleset(),"Cannot fork inside a ruleset");let x=this;for(let E of[].concat(f))E=Array.isArray(E)?E:E.split("."),x=x._ids.fork(E,v,x);return x.$_temp.ruleset=!1,x}rule(f){const v=this._definition;a.assertOptions(f,Object.keys(v.modifiers)),l(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const x=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;l(x>=0&&x<this._rules.length,"Cannot apply rules to empty ruleset");const E=this.clone();for(let N=x;N<E._rules.length;++N){const M=E._rules[N],n=$(M);for(const d in f)v.modifiers[d](n,f[d]),l(n.name===M.name,"Cannot change rule name");E._rules[N]=n,E._singleRules.get(n.name)===M&&E._singleRules.set(n.name,n)}return E.$_temp.ruleset=!1,E.$_mutateRebuild()}get ruleset(){l(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const f=this.clone();return f.$_temp.ruleset=f._rules.length,f}get $(){return this.ruleset}tailor(f){f=[].concat(f),l(!this._inRuleset(),"Cannot tailor inside a ruleset");let v=this;if(this.$_terms.alterations)for(const{target:x,adjuster:E}of this.$_terms.alterations)f.includes(x)&&(v=E(v),l(a.isSchema(v),"Alteration adjuster for",x,"failed to return a schema object"));return v=v.$_modify({each:x=>x.tailor(f),ref:!1}),v.$_temp.ruleset=!1,v.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(f,v){return b.entry(f,this,v)}validateAsync(f,v){return b.entryAsync(f,this,v)}$_addRule(f){typeof f=="string"&&(f={name:f}),l(f&&typeof f=="object","Invalid options"),l(f.name&&typeof f.name=="string","Invalid rule name");for(const M in f)l(M[0]!=="_","Cannot set private rule properties");const v=Object.assign({},f);v._resolve=[],v.method=v.method||v.name;const x=this._definition.rules[v.method],E=v.args;l(x,"Unknown rule",v.method);const N=this.clone();if(E){l(Object.keys(E).length===1||Object.keys(E).length===this._definition.rules[v.name].args.length,"Invalid rule definition for",this.type,v.name);for(const M in E){let n=E[M];if(x.argsByName){const d=x.argsByName.get(M);if(d.ref&&a.isResolvable(n))v._resolve.push(M),N.$_mutateRegister(n);else if(d.normalize&&(n=d.normalize(n),E[M]=n),d.assert){const _=a.validateArg(n,M,d);l(!_,_,"or reference")}}n!==void 0?E[M]=n:delete E[M]}}return x.multi||(N._ruleRemove(v.name,{clone:!1}),N._singleRules.set(v.name,v)),N.$_temp.ruleset===!1&&(N.$_temp.ruleset=null),x.priority?N._rules.unshift(v):N._rules.push(v),N}$_compile(f,v){return i.schema(this.$_root,f,v)}$_createError(f,v,x,E,N,M={}){const n=M.flags!==!1?this._flags:{},d=M.messages?s.merge(this._definition.messages,M.messages):this._definition.messages;return new r.Report(f,v,x,n,d,E,N)}$_getFlag(f){return this._flags[f]}$_getRule(f){return this._singleRules.get(f)}$_mapLabels(f){return f=Array.isArray(f)?f:f.split("."),this._ids.labels(f)}$_match(f,v,x,E){(x=Object.assign({},x)).abortEarly=!0,x._externals=!1,v.snapshot();const N=!b.validate(f,this,v,x,E).errors;return v.restore(),N}$_modify(f){return a.assertOptions(f,["each","once","ref","schema"]),o.schema(this,f)||this}$_mutateRebuild(){return l(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(f,{source:v,name:x,path:E,key:N})=>{const M=this._definition[v][x]&&this._definition[v][x].register;M!==!1&&this.$_mutateRegister(f,{family:M,key:N})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(f,{family:v,key:x}={}){this._refs.register(f,v),this._ids.register(f,{key:x})}$_property(f){return this._definition.properties[f]}$_reach(f){return this._ids.reach(f)}$_rootReferences(){return this._refs.roots()}$_setFlag(f,v,x={}){l(f[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const E=this._definition.flags[f]||{};if(y(v,E.default)&&(v=void 0),y(v,this._flags[f]))return this;const N=x.clone!==!1?this.clone():this;return v!==void 0?(N._flags[f]=v,N.$_mutateRegister(v)):delete N._flags[f],f[0]!=="_"&&(N.$_temp.ruleset=!1),N}$_parent(f,...v){return this[f][a.symbols.parent].call(this,...v)}$_validate(f,v,x){return b.validate(f,this,v,x)}_assign(f){f.type=this.type,f.$_root=this.$_root,f.$_temp=Object.assign({},this.$_temp),f.$_temp.whens={},f._ids=this._ids.clone(),f._preferences=this._preferences,f._valids=this._valids&&this._valids.clone(),f._invalids=this._invalids&&this._invalids.clone(),f._rules=this._rules.slice(),f._singleRules=$(this._singleRules,{shallow:!0}),f._refs=this._refs.clone(),f._flags=Object.assign({},this._flags),f._cache=null,f.$_terms={};for(const v in this.$_terms)f.$_terms[v]=this.$_terms[v]?this.$_terms[v].slice():null;f.$_super={};for(const v in this.$_super)f.$_super[v]=this._super[v].bind(f);return f}_bare(){const f=this.clone();f._reset();const v=f._definition.terms;for(const x in v){const E=v[x];f.$_terms[x]=E.init}return f.$_mutateRebuild()}_default(f,v,x={}){return a.assertOptions(x,"literal"),l(v!==void 0,"Missing",f,"value"),l(typeof v=="function"||!x.literal,"Only function value supports literal option"),typeof v=="function"&&x.literal&&(v={[a.symbols.literal]:!0,literal:v}),this.$_setFlag(f,v)}_generate(f,v,x){if(!this.$_terms.whens)return{schema:this};const E=[],N=[];for(let d=0;d<this.$_terms.whens.length;++d){const _=this.$_terms.whens[d];if(_.concat){E.push(_.concat),N.push(`${d}.concat`);continue}const R=_.ref?_.ref.resolve(f,v,x):f,O=_.is?[_]:_.switch,D=N.length;for(let C=0;C<O.length;++C){const{is:S,then:u,otherwise:A}=O[C],z=`${d}${_.switch?"."+C:""}`;if(S.$_match(R,v.nest(S,`${z}.is`),x)){if(u){const F=v.localize([...v.path,`${z}.then`],v.ancestors,v.schemas),{schema:J,id:W}=u._generate(f,F,x);E.push(J),N.push(`${z}.then${W?`(${W})`:""}`);break}}else if(A){const F=v.localize([...v.path,`${z}.otherwise`],v.ancestors,v.schemas),{schema:J,id:W}=A._generate(f,F,x);E.push(J),N.push(`${z}.otherwise${W?`(${W})`:""}`);break}}if(_.break&&N.length>D)break}const M=N.join(", ");if(v.mainstay.tracer.debug(v,"rule","when",M),!M)return{schema:this};if(!v.mainstay.tracer.active&&this.$_temp.whens[M])return{schema:this.$_temp.whens[M],id:M};let n=this;this._definition.generate&&(n=this._definition.generate(this,f,v,x));for(const d of E)n=n.concat(d);return this.$_root._tracer&&this.$_root._tracer._combine(n,[this,...E]),this.$_temp.whens[M]=n,{schema:n,id:M}}_inner(f,v,x={}){l(!this._inRuleset(),`Cannot set ${f} inside a ruleset`);const E=this.clone();return E.$_terms[f]&&!x.override||(E.$_terms[f]=[]),x.single?E.$_terms[f].push(v):E.$_terms[f].push(...v),E.$_temp.ruleset=!1,E}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(f,v={}){if(!this._singleRules.has(f))return this;const x=v.clone!==!1?this.clone():this;x._singleRules.delete(f);const E=[];for(let N=0;N<x._rules.length;++N){const M=x._rules[N];M.name!==f||M.keep?E.push(M):x._inRuleset()&&N<x.$_temp.ruleset&&--x.$_temp.ruleset}return x._rules=E,x}_values(f,v){a.verifyFlat(f,v.slice(1,-1));const x=this.clone(),E=f[0]===a.symbols.override;if(E&&(f=f.slice(1)),!x[v]&&f.length?x[v]=new j:E&&(x[v]=f.length?new j:null,x.$_mutateRebuild()),!x[v])return x;E&&x[v].override();for(const N of f){l(N!==void 0,"Cannot call allow/valid/invalid with undefined"),l(N!==a.symbols.override,"Override must be the first value");const M=v==="_invalids"?"_valids":"_invalids";x[M]&&(x[M].remove(N),x[M].length||(l(v==="_valids"||!x._flags.only,"Setting invalid value",N,"leaves schema rejecting all values due to previous valid rule"),x[M]=null)),x[v].add(N,x._refs)}return x}}};k.Base.prototype[a.symbols.any]={version:a.version,compile:i.compile,root:"$_root"},k.Base.prototype.isImmutable=!0,k.Base.prototype.deny=k.Base.prototype.invalid,k.Base.prototype.disallow=k.Base.prototype.invalid,k.Base.prototype.equal=k.Base.prototype.valid,k.Base.prototype.exist=k.Base.prototype.required,k.Base.prototype.not=k.Base.prototype.invalid,k.Base.prototype.options=k.Base.prototype.prefs,k.Base.prototype.preferences=k.Base.prototype.prefs,L.exports=new k.Base},8652:(L,p,w)=>{const l=w(375),$=w(8571),y=w(8160),m={max:1e3,supported:new Set(["undefined","boolean","number","string"])};p.provider={provision:e=>new m.Cache(e)},m.Cache=class{constructor(e={}){y.assertOptions(e,["max"]),l(e.max===void 0||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||m.max,this._map=new Map,this._list=new m.List}get length(){return this._map.size}set(e,a){if(e!==null&&!m.supported.has(typeof e))return;let i=this._map.get(e);if(i)return i.value=a,void this._list.first(i);i=this._list.unshift({key:e,value:a}),this._map.set(e,i),this._compact()}get(e){const a=this._map.get(e);if(a)return this._list.first(a),$(a.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},m.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:a,prev:i}=e;return a.prev=i,i&&(i.next=a),e===this.tail&&(this.tail=a),e.prev=null,e.next=null,e}}},8160:(L,p,w)=>{const l=w(375),$=w(7916),y=w(5934);let m,e;const a={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};p.version=y.version,p.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},p.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")},p.assertOptions=function(i,r,t="Options"){l(i&&typeof i=="object"&&!Array.isArray(i),"Options must be of type object");const c=Object.keys(i).filter(s=>!r.includes(s));l(c.length===0,`${t} contain unknown keys: ${c}`)},p.checkPreferences=function(i){e=e||w(3378);const r=e.preferences.validate(i);if(r.error)throw new $([r.error.details[0].message])},p.compare=function(i,r,t){switch(t){case"=":return i===r;case">":return i>r;case"<":return i<r;case">=":return i>=r;case"<=":return i<=r}},p.default=function(i,r){return i===void 0?r:i},p.isIsoDate=function(i){return a.isoDate.test(i)},p.isNumber=function(i){return typeof i=="number"&&!isNaN(i)},p.isResolvable=function(i){return!!i&&(i[p.symbols.ref]||i[p.symbols.template])},p.isSchema=function(i,r={}){const t=i&&i[p.symbols.any];return!!t&&(l(r.legacy||t.version===p.version,"Cannot mix different versions of joi schemas"),!0)},p.isValues=function(i){return i[p.symbols.values]},p.limit=function(i){return Number.isSafeInteger(i)&&i>=0},p.preferences=function(i,r){m=m||w(6914),i=i||{},r=r||{};const t=Object.assign({},i,r);return r.errors&&i.errors&&(t.errors=Object.assign({},i.errors,r.errors),t.errors.wrap=Object.assign({},i.errors.wrap,r.errors.wrap)),r.messages&&(t.messages=m.compile(r.messages,i.messages)),delete t[p.symbols.prefs],t},p.tryWithPath=function(i,r,t={}){try{return i()}catch(c){throw c.path!==void 0?c.path=r+"."+c.path:c.path=r,t.append&&(c.message=`${c.message} (${c.path})`),c}},p.validateArg=function(i,r,{assert:t,message:c}){if(p.isSchema(t)){const s=t.validate(i);return s.error?s.error.message:void 0}if(!t(i))return r?`${r} ${c}`:c},p.verifyFlat=function(i,r){for(const t of i)l(!Array.isArray(t),"Method no longer accepts array arguments:",r)}},3292:(L,p,w)=>{const l=w(375),$=w(8160),y=w(6133),m={};p.schema=function(e,a,i={}){$.assertOptions(i,["appendPath","override"]);try{return m.schema(e,a,i)}catch(r){throw i.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},m.schema=function(e,a,i){l(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(l(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const r=(t,...c)=>i.override!==!1?t.valid(e.override,...c):t.valid(...c);if(m.simple(a))return r(e,a);if(typeof a=="function")return e.custom(a);if(l(typeof a=="object","Invalid schema content:",typeof a),$.isResolvable(a))return r(e,a);if($.isSchema(a))return a;if(Array.isArray(a)){for(const t of a)if(!m.simple(t))return e.alternatives().try(...a);return r(e,...a)}return a instanceof RegExp?e.string().regex(a):a instanceof Date?r(e.date(),a):(l(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(a))},p.ref=function(e,a){return y.isRef(e)?e:y.create(e,a)},p.compile=function(e,a,i={}){$.assertOptions(i,["legacy"]);const r=a&&a[$.symbols.any];if(r)return l(i.legacy||r.version===$.version,"Cannot mix different versions of joi schemas:",r.version,$.version),a;if(typeof a!="object"||!i.legacy)return p.schema(e,a,{appendPath:!0});const t=m.walk(a);return t?t.compile(t.root,a):p.schema(e,a,{appendPath:!0})},m.walk=function(e){if(typeof e!="object")return null;if(Array.isArray(e)){for(const i of e){const r=m.walk(i);if(r)return r}return null}const a=e[$.symbols.any];if(a)return{root:e[a.root],compile:a.compile};l(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const i in e){const r=m.walk(e[i]);if(r)return r}return null},m.simple=function(e){return e===null||["boolean","string","number"].includes(typeof e)},p.when=function(e,a,i){if(i===void 0&&(l(a&&typeof a=="object","Missing options"),i=a,a=y.create(".")),Array.isArray(i)&&(i={switch:i}),$.assertOptions(i,["is","not","then","otherwise","switch","break"]),$.isSchema(a))return l(i.is===void 0,'"is" can not be used with a schema condition'),l(i.not===void 0,'"not" can not be used with a schema condition'),l(i.switch===void 0,'"switch" can not be used with a schema condition'),m.condition(e,{is:a,then:i.then,otherwise:i.otherwise,break:i.break});if(l(y.isRef(a)||typeof a=="string","Invalid condition:",a),l(i.not===void 0||i.is===void 0,'Cannot combine "is" with "not"'),i.switch===void 0){let t=i;i.not!==void 0&&(t={is:i.not,then:i.otherwise,otherwise:i.then,break:i.break});let c=t.is!==void 0?e.$_compile(t.is):e.$_root.invalid(null,!1,0,"").required();return l(t.then!==void 0||t.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),l(t.break===void 0||t.then===void 0||t.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),i.is===void 0||y.isRef(i.is)||$.isSchema(i.is)||(c=c.required()),m.condition(e,{ref:p.ref(a),is:c,then:t.then,otherwise:t.otherwise,break:t.break})}l(Array.isArray(i.switch),'"switch" must be an array'),l(i.is===void 0,'Cannot combine "switch" with "is"'),l(i.not===void 0,'Cannot combine "switch" with "not"'),l(i.then===void 0,'Cannot combine "switch" with "then"');const r={ref:p.ref(a),switch:[],break:i.break};for(let t=0;t<i.switch.length;++t){const c=i.switch[t],s=t===i.switch.length-1;$.assertOptions(c,s?["is","then","otherwise"]:["is","then"]),l(c.is!==void 0,'Switch statement missing "is"'),l(c.then!==void 0,'Switch statement missing "then"');const o={is:e.$_compile(c.is),then:e.$_compile(c.then)};if(y.isRef(c.is)||$.isSchema(c.is)||(o.is=o.is.required()),s){l(i.otherwise===void 0||c.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const h=i.otherwise!==void 0?i.otherwise:c.otherwise;h!==void 0&&(l(r.break===void 0,"Cannot specify both otherwise and break"),o.otherwise=e.$_compile(h))}r.switch.push(o)}return r},m.condition=function(e,a){for(const i of["then","otherwise"])a[i]===void 0?delete a[i]:a[i]=e.$_compile(a[i]);return a}},6354:(L,p,w)=>{const l=w(5688),$=w(8160),y=w(3328);p.Report=class{constructor(m,e,a,i,r,t,c){if(this.code=m,this.flags=i,this.messages=r,this.path=t.path,this.prefs=c,this.state=t,this.value=e,this.message=null,this.template=null,this.local=a||{},this.local.label=p.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const s=this.path[this.path.length-1];typeof s!="object"&&(this.local.key=s)}}_setTemplate(m){if(this.template=m,!this.flags.label&&this.path.length===0){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const m=this.code;if(!this.prefs.errors.render)return this.code;const e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${m}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(m,e){return p.template(this.value,m,e||this.code,this.state,this.prefs)}},p.path=function(m){let e="";for(const a of m)typeof a!="object"&&(typeof a=="string"?(e&&(e+="."),e+=a):e+=`[${a}]`);return e},p.template=function(m,e,a,i,r){if(!e)return;if(y.isTemplate(e))return a!=="root"?e:null;let t=r.errors.language;if($.isResolvable(t)&&(t=t.resolve(m,i,r)),t&&e[t]){if(e[t][a]!==void 0)return e[t][a];if(e[t]["*"]!==void 0)return e[t]["*"]}return e[a]?e[a]:e["*"]},p.label=function(m,e,a,i){if(!a.errors.label)return"";if(m.label)return m.label;let r=e.path;return a.errors.label==="key"&&e.path.length>1&&(r=e.path.slice(-1)),p.path(r)||p.template(null,a.messages,"root",e,a)||i&&p.template(null,i,"root",e,a)||"value"},p.process=function(m,e,a){if(!m)return null;const{override:i,message:r,details:t}=p.details(m);if(i)return i;if(a.errors.stack)return new p.ValidationError(r,t,e);const c=Error.stackTraceLimit;Error.stackTraceLimit=0;const s=new p.ValidationError(r,t,e);return Error.stackTraceLimit=c,s},p.details=function(m,e={}){let a=[];const i=[];for(const r of m){if(r instanceof Error){if(e.override!==!1)return{override:r};const c=r.toString();a.push(c),i.push({message:c,type:"override",context:{error:r}});continue}const t=r.toString();a.push(t),i.push({message:t,path:r.path.filter(c=>typeof c!="object"),type:r.code,context:r.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:i}},p.ValidationError=class extends Error{constructor(m,e,a){super(m),this._original=a,this.details=e}static isError(m){return m instanceof p.ValidationError}},p.ValidationError.prototype.isJoi=!0,p.ValidationError.prototype.name="ValidationError",p.ValidationError.prototype.annotate=l.error},8901:(L,p,w)=>{const l=w(375),$=w(8571),y=w(8160),m=w(6914),e={};p.type=function(a,i){const r=Object.getPrototypeOf(a),t=$(r),c=a._assign(Object.create(t)),s=Object.assign({},i);delete s.base,t._definition=s;const o=r._definition||{};s.messages=m.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),c.type=s.type,s.flags=Object.assign({},o.flags,s.flags);const h=Object.assign({},o.terms);if(s.terms)for(const k in s.terms){const f=s.terms[k];l(c.$_terms[k]===void 0,"Invalid term override for",s.type,k),c.$_terms[k]=f.init,h[k]=f}s.terms=h,s.args||(s.args=o.args),s.prepare=e.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=e.coerce(s.coerce,o.coerce),s.validate=e.validate(s.validate,o.validate);const g=Object.assign({},o.rules);if(s.rules)for(const k in s.rules){const f=s.rules[k];l(typeof f=="object","Invalid rule definition for",s.type,k);let v=f.method;if(v===void 0&&(v=function(){return this.$_addRule(k)}),v&&(l(!t[k],"Rule conflict in",s.type,k),t[k]=v),l(!g[k],"Rule conflict in",s.type,k),g[k]=f,f.alias){const x=[].concat(f.alias);for(const E of x)t[E]=f.method}f.args&&(f.argsByName=new Map,f.args=f.args.map(x=>(typeof x=="string"&&(x={name:x}),l(!f.argsByName.has(x.name),"Duplicated argument name",x.name),y.isSchema(x.assert)&&(x.assert=x.assert.strict().label(x.name)),f.argsByName.set(x.name,x),x)))}s.rules=g;const b=Object.assign({},o.modifiers);if(s.modifiers)for(const k in s.modifiers){l(!t[k],"Rule conflict in",s.type,k);const f=s.modifiers[k];l(typeof f=="function","Invalid modifier definition for",s.type,k);const v=function(x){return this.rule({[k]:x})};t[k]=v,b[k]=f}if(s.modifiers=b,s.overrides){t._super=r,c.$_super={};for(const k in s.overrides)l(r[k],"Cannot override missing",k),s.overrides[k][y.symbols.parent]=r[k],c.$_super[k]=r[k].bind(c);Object.assign(t,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);const j=Object.assign({},o.manifest,s.manifest);return j.build=e.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=j,s.rebuild=e.rebuild(s.rebuild,o.rebuild),c},e.build=function(a,i){return a&&i?function(r,t){return i(a(r,t),t)}:a||i},e.coerce=function(a,i){return a&&i?{from:a.from&&i.from?[...new Set([...a.from,...i.from])]:null,method(r,t){let c;if((!i.from||i.from.includes(typeof r))&&(c=i.method(r,t),c)){if(c.errors||c.value===void 0)return c;r=c.value}if(!a.from||a.from.includes(typeof r)){const s=a.method(r,t);if(s)return s}return c}}:a||i},e.prepare=function(a,i){return a&&i?function(r,t){const c=a(r,t);if(c){if(c.errors||c.value===void 0)return c;r=c.value}return i(r,t)||c}:a||i},e.rebuild=function(a,i){return a&&i?function(r){i(r),a(r)}:a||i},e.validate=function(a,i){return a&&i?function(r,t){const c=i(r,t);if(c){if(c.errors&&(!Array.isArray(c.errors)||c.errors.length))return c;r=c.value}return a(r,t)||c}:a||i}},5107:(L,p,w)=>{const l=w(375),$=w(8571),y=w(8652),m=w(8160),e=w(3292),a=w(6354),i=w(8901),r=w(9708),t=w(6133),c=w(3328),s=w(1152);let o;const h={types:{alternatives:w(4946),any:w(8068),array:w(546),boolean:w(4937),date:w(7500),function:w(390),link:w(8785),number:w(3832),object:w(8966),string:w(7417),symbol:w(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const g={_types:new Set(Object.keys(h.types))};for(const b of g._types)g[b]=function(...j){return l(!j.length||["alternatives","link","object"].includes(b),"The",b,"type does not allow arguments"),h.generate(this,h.types[b],j)};for(const b of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])g[b]=function(...j){return this.any()[b](...j)};Object.assign(g,h.methods);for(const b in h.aliases){const j=h.aliases[b];g[b]=g[j]}return g.x=g.expression,s.setup&&s.setup(g),g}};h.methods={ValidationError:a.ValidationError,version:m.version,cache:y.provider,assert(g,b,...j){h.assert(g,b,!0,j)},attempt:(g,b,...j)=>h.assert(g,b,!1,j),build(g){return l(typeof r.build=="function","Manifest functionality disabled"),r.build(this,g)},checkPreferences(g){m.checkPreferences(g)},compile(g,b){return e.compile(this,g,b)},defaults(g){l(typeof g=="function","modifier must be a function");const b=Object.assign({},this);for(const j of b._types){const k=g(b[j]());l(m.isSchema(k),"modifier must return a valid schema object"),b[j]=function(...f){return h.generate(this,k,f)}}return b},expression:(...g)=>new c(...g),extend(...g){m.verifyFlat(g,"extend"),o=o||w(3378),l(g.length,"You need to provide at least one extension"),this.assert(g,o.extensions);const b=Object.assign({},this);b._types=new Set(b._types);for(let j of g){typeof j=="function"&&(j=j(b)),this.assert(j,o.extension);const k=h.expandExtension(j,b);for(const f of k){l(b[f.type]===void 0||b._types.has(f.type),"Cannot override name",f.type);const v=f.base||this.any(),x=i.type(v,f);b._types.add(f.type),b[f.type]=function(...E){return h.generate(this,x,E)}}}return b},isError:a.ValidationError.isError,isExpression:c.isTemplate,isRef:t.isRef,isSchema:m.isSchema,in:(...g)=>t.in(...g),override:m.symbols.override,ref:(...g)=>t.create(...g),types(){const g={};for(const b of this._types)g[b]=this[b]();for(const b in h.aliases)g[b]=this[b]();return g}},h.assert=function(g,b,j,k){const f=k[0]instanceof Error||typeof k[0]=="string"?k[0]:null,v=f!==null?k[1]:k[0],x=b.validate(g,m.preferences({errors:{stack:!0}},v||{}));let E=x.error;if(!E)return x.value;if(f instanceof Error)throw f;const N=j&&typeof E.annotate=="function"?E.annotate():E.message;throw E instanceof a.ValidationError==0&&(E=$(E)),E.message=f?`${f} ${N}`:N,E},h.generate=function(g,b,j){return l(g,"Must be invoked on a Joi instance."),b.$_root=g,b._definition.args&&j.length?b._definition.args(b,...j):b},h.expandExtension=function(g,b){if(typeof g.type=="string")return[g];const j=[];for(const k of b._types)if(g.type.test(k)){const f=Object.assign({},g);f.type=k,f.base=b[k](),j.push(f)}return j},L.exports=h.root()},6914:(L,p,w)=>{const l=w(375),$=w(8571),y=w(3328);p.compile=function(m,e){if(typeof m=="string")return l(!e,"Cannot set single message string"),new y(m);if(y.isTemplate(m))return l(!e,"Cannot set single message template"),m;l(typeof m=="object"&&!Array.isArray(m),"Invalid message options"),e=e?$(e):{};for(let a in m){const i=m[a];if(a==="root"||y.isTemplate(i)){e[a]=i;continue}if(typeof i=="string"){e[a]=new y(i);continue}l(typeof i=="object"&&!Array.isArray(i),"Invalid message for",a);const r=a;for(a in e[r]=e[r]||{},i){const t=i[a];a==="root"||y.isTemplate(t)?e[r][a]=t:(l(typeof t=="string","Invalid message for",a,"in",r),e[r][a]=new y(t))}}return e},p.decompile=function(m){const e={};for(let a in m){const i=m[a];if(a==="root"){e.root=i;continue}if(y.isTemplate(i)){e[a]=i.describe({compact:!0});continue}const r=a;for(a in e[r]={},i){const t=i[a];a!=="root"?e[r][a]=t.describe({compact:!0}):e[r].root=t}}return e},p.merge=function(m,e){if(!m)return p.compile(e);if(!e)return m;if(typeof e=="string")return new y(e);if(y.isTemplate(e))return e;const a=$(m);for(let i in e){const r=e[i];if(i==="root"||y.isTemplate(r)){a[i]=r;continue}if(typeof r=="string"){a[i]=new y(r);continue}l(typeof r=="object"&&!Array.isArray(r),"Invalid message for",i);const t=i;for(i in a[t]=a[t]||{},r){const c=r[i];i==="root"||y.isTemplate(c)?a[t][i]=c:(l(typeof c=="string","Invalid message for",i,"in",t),a[t][i]=new y(c))}}return a}},2294:(L,p,w)=>{const l=w(375),$=w(8160),y=w(6133),m={};p.Ids=m.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new m.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[a,i]of e._byId.entries())l(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,i);for(const[a,i]of e._byKey.entries())l(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,i)}fork(e,a,i){const r=this._collect(e);r.push({schema:i});const t=r.shift();let c={id:t.id,schema:a(t.schema)};l($.isSchema(c.schema),"adjuster function failed to return a joi schema type");for(const s of r)c={id:s.id,schema:m.fork(s.schema,c.id,c.schema)};return c.schema}labels(e,a=[]){const i=e[0],r=this._get(i);if(!r)return[...a,...e].join(".");const t=e.slice(1);return a=[...a,r.schema._flags.label||i],t.length?r.schema._ids.labels(t,a):a.join(".")}reach(e,a=[]){const i=e[0],r=this._get(i);l(r,"Schema does not contain path",[...a,...e].join("."));const t=e.slice(1);return t.length?r.schema._ids.reach(t,[...a,i]):r.schema}register(e,{key:a}={}){if(!e||!$.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const i=e._flags.id;if(i){const r=this._byId.get(i);l(!r||r.schema===e,"Cannot add different schemas with the same id:",i),l(!this._byKey.has(i),"Schema id conflicts with existing key:",i),this._byId.set(i,{schema:e,id:i})}a&&(l(!this._byKey.has(a),"Schema already contains key:",a),l(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:e,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,a=[],i=[]){const r=e[0],t=this._get(r);l(t,"Schema does not contain path",[...a,...e].join(".")),i=[t,...i];const c=e.slice(1);return c.length?t.schema._ids._collect(c,[...a,r],i):i}_get(e){return this._byId.get(e)||this._byKey.get(e)}},m.fork=function(e,a,i){const r=p.schema(e,{each:(t,{key:c})=>{if(a===(t._flags.id||c))return i},ref:!1});return r?r.$_mutateRebuild():e},p.schema=function(e,a){let i;for(const r in e._flags){if(r[0]==="_")continue;const t=m.scan(e._flags[r],{source:"flags",name:r},a);t!==void 0&&(i=i||e.clone(),i._flags[r]=t)}for(let r=0;r<e._rules.length;++r){const t=e._rules[r],c=m.scan(t.args,{source:"rules",name:t.name},a);if(c!==void 0){i=i||e.clone();const s=Object.assign({},t);s.args=c,i._rules[r]=s,i._singleRules.get(t.name)===t&&i._singleRules.set(t.name,s)}}for(const r in e.$_terms){if(r[0]==="_")continue;const t=m.scan(e.$_terms[r],{source:"terms",name:r},a);t!==void 0&&(i=i||e.clone(),i.$_terms[r]=t)}return i},m.scan=function(e,a,i,r,t){const c=r||[];if(e===null||typeof e!="object")return;let s;if(Array.isArray(e)){for(let o=0;o<e.length;++o){const h=a.source==="terms"&&a.name==="keys"&&e[o].key,g=m.scan(e[o],a,i,[o,...c],h);g!==void 0&&(s=s||e.slice(),s[o]=g)}return s}if(i.schema!==!1&&$.isSchema(e)||i.ref!==!1&&y.isRef(e)){const o=i.each(e,{...a,path:c,key:t});return o===e?void 0:o}for(const o in e){if(o[0]==="_")continue;const h=m.scan(e[o],a,i,[o,...c],t);h!==void 0&&(s=s||Object.assign({},e),s[o]=h)}return s}},6133:(L,p,w)=>{const l=w(375),$=w(8571),y=w(9621),m=w(8160);let e;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};p.create=function(i,r={}){l(typeof i=="string","Invalid reference key:",i),m.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),l(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const t=Object.assign({},a.defaults,r);delete t.prefix;const c=t.separator,s=a.context(i,c,r.prefix);if(t.type=s.type,i=s.key,t.type==="value")if(s.root&&(l(!c||i[0]!==c,"Cannot specify relative path with root prefix"),t.ancestor="root",i||(i=null)),c&&c===i)i=null,t.ancestor=0;else if(t.ancestor!==void 0)l(!c||!i||i[0]!==c,"Cannot combine prefix with ancestor option");else{const[o,h]=a.ancestor(i,c);h&&(i=i.slice(h))===""&&(i=null),t.ancestor=o}return t.path=c?i===null?[]:i.split(c):[i],new a.Ref(t)},p.in=function(i,r={}){return p.create(i,{...r,in:!0})},p.isRef=function(i){return!!i&&!!i[m.symbols.ref]},a.Ref=class{constructor(i){l(typeof i=="object","Invalid reference construction"),m.assertOptions(i,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),l([!1,void 0].includes(i.separator)||typeof i.separator=="string"&&i.separator.length===1,"Invalid separator"),l(!i.adjust||typeof i.adjust=="function","options.adjust must be a function"),l(!i.map||Array.isArray(i.map),"options.map must be an array"),l(!i.map||!i.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,i),l(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(i,r,t,c,s={}){return l(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(t.context,r,s):this.type==="local"?this._resolve(c,r,s):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,s):(l(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,s)):this._resolve(i,r,s)}_resolve(i,r,t){let c;if(this.type==="value"&&r.mainstay.shadow&&t.shadow!==!1&&(c=r.mainstay.shadow.get(this.absolute(r))),c===void 0&&(c=y(i,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(c=this.adjust(c)),this.map){const s=this.map.get(c);s!==void 0&&(c=s)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,c),c}toString(){return this.display}absolute(i){return[...i.path.slice(0,-this.ancestor),...this.path]}clone(){return new a.Ref(this)}describe(){const i={path:this.path};this.type!=="value"&&(i.type=this.type),this.separator!=="."&&(i.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(i.ancestor=this.ancestor),this.map&&(i.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(i[r]=this[r]);return this.in!==!1&&(i.in=!0),{ref:i}}updateDisplay(){const i=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${i}`);if(!this.separator)return void(this.display=`ref:${i}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${i}`);if(this.ancestor==="root")return void(this.display=`ref:root:${i}`);if(this.ancestor===1)return void(this.display=`ref:${i||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${i||""}`}},a.Ref.prototype[m.symbols.ref]=!0,p.build=function(i){return(i=Object.assign({},a.defaults,i)).type==="value"&&i.ancestor===void 0&&(i.ancestor=1),new a.Ref(i)},a.context=function(i,r,t={}){if(i=i.trim(),t){const c=t.global===void 0?"$":t.global;if(c!==r&&i.startsWith(c))return{key:i.slice(c.length),type:"global"};const s=t.local===void 0?"#":t.local;if(s!==r&&i.startsWith(s))return{key:i.slice(s.length),type:"local"};const o=t.root===void 0?"/":t.root;if(o!==r&&i.startsWith(o))return{key:i.slice(o.length),type:"value",root:!0}}return{key:i,type:"value"}},a.ancestor=function(i,r){if(!r)return[1,0];if(i[0]!==r)return[1,0];if(i[1]!==r)return[0,1];let t=2;for(;i[t]===r;)++t;return[t-1,t]},p.toSibling=0,p.toParent=1,p.Manager=class{constructor(){this.refs=[]}register(i,r){if(i)if(r=r===void 0?p.toParent:r,Array.isArray(i))for(const t of i)this.register(t,r);else if(m.isSchema(i))for(const t of i._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else p.isRef(i)&&i.type==="value"&&i.ancestor-r>=0&&this.refs.push({ancestor:i.ancestor-r,root:i.root}),e=e||w(3328),e.isTemplate(i)&&this.register(i.refs(),r)}get length(){return this.refs.length}clone(){const i=new p.Manager;return i.refs=$(this.refs),i}reset(){this.refs=[]}roots(){return this.refs.filter(i=>!i.ancestor).map(i=>i.root)}}},3378:(L,p,w)=>{const l=w(5107),$={};$.wrap=l.string().min(1).max(2).allow(!1),p.preferences=l.object({allowUnknown:l.boolean(),abortEarly:l.boolean(),artifacts:l.boolean(),cache:l.boolean(),context:l.object(),convert:l.boolean(),dateFormat:l.valid("date","iso","string","time","utc"),debug:l.boolean(),errors:{escapeHtml:l.boolean(),label:l.valid("path","key",!1),language:[l.string(),l.object().ref()],render:l.boolean(),stack:l.boolean(),wrap:{label:$.wrap,array:$.wrap,string:$.wrap}},externals:l.boolean(),messages:l.object(),noDefaults:l.boolean(),nonEnumerables:l.boolean(),presence:l.valid("required","optional","forbidden"),skipFunctions:l.boolean(),stripUnknown:l.object({arrays:l.boolean(),objects:l.boolean()}).or("arrays","objects").allow(!0,!1),warnings:l.boolean()}).strict(),$.nameRx=/^[a-zA-Z0-9]\w*$/,$.rule=l.object({alias:l.array().items(l.string().pattern($.nameRx)).single(),args:l.array().items(l.string(),l.object({name:l.string().pattern($.nameRx).required(),ref:l.boolean(),assert:l.alternatives([l.function(),l.object().schema()]).conditional("ref",{is:!0,then:l.required()}),normalize:l.function(),message:l.string().when("assert",{is:l.function(),then:l.required()})})),convert:l.boolean(),manifest:l.boolean(),method:l.function().allow(!1),multi:l.boolean(),validate:l.function()}),p.extension=l.object({type:l.alternatives([l.string(),l.object().regex()]).required(),args:l.function(),cast:l.object().pattern($.nameRx,l.object({from:l.function().maxArity(1).required(),to:l.function().minArity(1).maxArity(2).required()})),base:l.object().schema().when("type",{is:l.object().regex(),then:l.forbidden()}),coerce:[l.function().maxArity(3),l.object({method:l.function().maxArity(3).required(),from:l.array().items(l.string()).single()})],flags:l.object().pattern($.nameRx,l.object({setter:l.string(),default:l.any()})),manifest:{build:l.function().arity(2)},messages:[l.object(),l.string()],modifiers:l.object().pattern($.nameRx,l.function().minArity(1).maxArity(2)),overrides:l.object().pattern($.nameRx,l.function()),prepare:l.function().maxArity(3),rebuild:l.function().arity(1),rules:l.object().pattern($.nameRx,$.rule),terms:l.object().pattern($.nameRx,l.object({init:l.array().allow(null).required(),manifest:l.object().pattern(/.+/,[l.valid("schema","single"),l.object({mapped:l.object({from:l.string().required(),to:l.string().required()}).required()})])})),validate:l.function().maxArity(3)}).strict(),p.extensions=l.array().items(l.object(),l.function().arity(1)).strict(),$.desc={buffer:l.object({buffer:l.string()}),func:l.object({function:l.function().required(),options:{literal:!0}}),override:l.object({override:!0}),ref:l.object({ref:l.object({type:l.valid("value","global","local"),path:l.array().required(),separator:l.string().length(1).allow(!1),ancestor:l.number().min(0).integer().allow("root"),map:l.array().items(l.array().length(2)).min(1),adjust:l.function(),iterables:l.boolean(),in:l.boolean(),render:l.boolean()}).required()}),regex:l.object({regex:l.string().min(3)}),special:l.object({special:l.valid("deep").required()}),template:l.object({template:l.string().required(),options:l.object()}),value:l.object({value:l.alternatives([l.object(),l.array()]).required()})},$.desc.entity=l.alternatives([l.array().items(l.link("...")),l.boolean(),l.function(),l.number(),l.string(),$.desc.buffer,$.desc.func,$.desc.ref,$.desc.regex,$.desc.special,$.desc.template,$.desc.value,l.link("/")]),$.desc.values=l.array().items(null,l.boolean(),l.function(),l.number().allow(1/0,-1/0),l.string().allow(""),l.symbol(),$.desc.buffer,$.desc.func,$.desc.override,$.desc.ref,$.desc.regex,$.desc.template,$.desc.value),$.desc.messages=l.object().pattern(/.+/,[l.string(),$.desc.template,l.object().pattern(/.+/,[l.string(),$.desc.template])]),p.description=l.object({type:l.string().required(),flags:l.object({cast:l.string(),default:l.any(),description:l.string(),empty:l.link("/"),failover:$.desc.entity,id:l.string(),label:l.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:l.boolean(),unit:l.string()}).unknown(),preferences:{allowUnknown:l.boolean(),abortEarly:l.boolean(),artifacts:l.boolean(),cache:l.boolean(),convert:l.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:l.boolean(),label:["path","key"],language:[l.string(),$.desc.ref],wrap:{label:$.wrap,array:$.wrap}},externals:l.boolean(),messages:$.desc.messages,noDefaults:l.boolean(),nonEnumerables:l.boolean(),presence:["required","optional","forbidden"],skipFunctions:l.boolean(),stripUnknown:l.object({arrays:l.boolean(),objects:l.boolean()}).or("arrays","objects").allow(!0,!1),warnings:l.boolean()},allow:$.desc.values,invalid:$.desc.values,rules:l.array().min(1).items({name:l.string().required(),args:l.object().min(1),keep:l.boolean(),message:[l.string(),$.desc.messages],warn:l.boolean()}),keys:l.object().pattern(/.*/,l.link("/")),link:$.desc.ref}).pattern(/^[a-z]\w*$/,l.any())},493:(L,p,w)=>{const l=w(8571),$=w(9621),y=w(8160),m={value:Symbol("value")};L.exports=m.State=class{constructor(e,a,i){this.path=e,this.ancestors=a,this.mainstay=i.mainstay,this.schemas=i.schemas,this.debug=null}localize(e,a=null,i=null){const r=new m.State(e,a,this);return i&&r.schemas&&(r.schemas=[m.schemas(i),...r.schemas]),r}nest(e,a){const i=new m.State(this.path,this.ancestors,this);return i.schemas=i.schemas&&[m.schemas(e),...i.schemas],i.debug=a,i}shadow(e,a){this.mainstay.shadow=this.mainstay.shadow||new m.Shadow,this.mainstay.shadow.set(this.path,e,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=l(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()}},m.schemas=function(e){return y.isSchema(e)?{schema:e}:e},m.Shadow=class{constructor(){this._values=null}set(e,a,i){if(!e.length||i==="strip"&&typeof e[e.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const c=e[t];let s=r.get(c);s||(s=new Map,r.set(c,s)),r=s}r[m.value]=a}get(e){const a=this.node(e);if(a)return a[m.value]}node(e){if(this._values)return $(this._values,e,{iterables:!0})}override(e,a){if(!this._values)return;const i=e.slice(0,-1),r=e[e.length-1],t=$(this._values,i,{iterables:!0});a?t.set(r,a):t&&t.delete(r)}}},3328:(L,p,w)=>{const l=w(375),$=w(8571),y=w(5277),m=w(1447),e=w(8160),a=w(6354),i=w(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}};L.exports=r.Template=class{constructor(t,c){if(l(typeof t=="string","Template source must be a string"),l(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,c){const{functions:s,...o}=c;this._settings=Object.keys(o).length?$(o):void 0,this._functions=s,this._functions&&(l(Object.keys(this._functions).every(h=>typeof h=="string"),"Functions keys must be strings"),l(Object.values(this._functions).every(h=>typeof h=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const t=r.encode(this.source),c=r.split(t);let s=!1;const o=[],h=c.shift();h&&o.push(h);for(const g of c){const b=g[0]!=="{",j=b?"}":"}}",k=g.indexOf(j);if(k===-1||g[1]==="{"){o.push(`{${r.decode(g)}`);continue}let f=g.slice(b?0:1,k);const v=f[0]===":";v&&(f=f.slice(1));const x=this._ref(r.decode(f),{raw:b,wrapped:v});o.push(x),typeof x!="string"&&(s=!0);const E=g.slice(k+j.length);E&&o.push(r.decode(E))}s?this._template=o:this.rendered=o.join("")}static date(t,c){return r.dateFormat[c.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.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(t){return new r.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return!!t&&!!t[e.symbols.template]}refs(){if(!this._template)return;const t=[];for(const c of this._template)typeof c!="string"&&t.push(...c.refs);return t}resolve(t,c,s,o){return this._template&&this._template.length===1?this._part(this._template[0],t,c,s,o,{}):this.render(t,c,s,o)}_part(t,...c){return t.ref?t.ref.resolve(...c):t.formula.evaluate(c)}render(t,c,s,o,h={}){if(!this.isDynamic())return this.rendered;const g=[];for(const b of this._template)if(typeof b=="string")g.push(b);else{const j=this._part(b,t,c,s,o,h),k=r.stringify(j,t,c,s,o,h);if(k!==void 0){const f=b.raw||(h.errors&&h.errors.escapeHtml)===!1?k:y(k);g.push(r.wrap(f,b.wrapped&&s.errors.wrap.label))}}return g.join("")}_ref(t,{raw:c,wrapped:s}){const o=[],h=b=>{const j=i.create(b,this._settings);return o.push(j),k=>{const f=j.resolve(...k);return f!==void 0?f:null}};try{const b=this._functions?{...r.functions,...this._functions}:r.functions;var g=new m.Parser(t,{reference:h,functions:b,constants:r.constants})}catch(b){throw b.message=`Invalid template variable "${t}" fails due to: ${b.message}`,b}if(g.single){if(g.single.type==="reference"){const b=o[0];return{ref:b,raw:c,refs:o,wrapped:s||b.type==="local"&&b.key==="label"}}return r.stringify(g.single.value)}return{formula:g,raw:c,refs:o}}toString(){return this.source}},r.Template.prototype[e.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(t){return t.replace(/\\(\{+)/g,(c,s)=>r.opens.slice(0,s.length)).replace(/\\(\}+)/g,(c,s)=>r.closes.slice(0,s.length))},r.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(t){const c=[];let s="";for(let o=0;o<t.length;++o){const h=t[o];if(h==="{"){let g="";for(;o+1<t.length&&t[o+1]==="{";)g+="{",++o;c.push(s),s=g}else s+=h}return c.push(s),c},r.wrap=function(t,c){return c?c.length===1?`${c}${t}${c}`:`${c[0]}${t}${c[1]}`:t},r.stringify=function(t,c,s,o,h,g={}){const b=typeof t,j=o&&o.errors&&o.errors.wrap||{};let k=!1;if(i.isRef(t)&&t.render&&(k=t.in,t=t.resolve(c,s,o,h,{in:t.in,...g})),t===null)return"null";if(b==="string")return r.wrap(t,g.arrayItems&&j.string);if(b==="number"||b==="function"||b==="symbol")return t.toString();if(b!=="object")return JSON.stringify(t);if(t instanceof Date)return r.Template.date(t,o);if(t instanceof Map){const v=[];for(const[x,E]of t.entries())v.push(`${x.toString()} -> ${E.toString()}`);t=v}if(!Array.isArray(t))return t.toString();const f=[];for(const v of t)f.push(r.stringify(v,c,s,o,h,{arrayItems:!0,...g}));return r.wrap(f.join(", "),!k&&j.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(t,c,s)=>t?c:s,length:t=>typeof t=="string"?t.length:t&&typeof t=="object"?Array.isArray(t)?t.length:Object.keys(t).length:null,msg(t){const[c,s,o,h,g]=this,b=g.messages;if(!b)return"";const j=a.template(c,b[0],t,s,o)||a.template(c,b[1],t,s,o);return j?j.render(c,s,o,h,g):""},number:t=>typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}},4946:(L,p,w)=>{const l=w(375),$=w(1687),y=w(8068),m=w(8160),e=w(3292),a=w(6354),i=w(6133),r={};L.exports=y.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:i.toSibling}},args:(t,...c)=>c.length===1&&Array.isArray(c[0])?t.try(...c[0]):t.try(...c),validate(t,c){const{schema:s,error:o,state:h,prefs:g}=c;if(s._flags.match){const j=[],k=[];for(let v=0;v<s.$_terms.matches.length;++v){const x=s.$_terms.matches[v],E=h.nest(x.schema,`match.${v}`);E.snapshot();const N=x.schema.$_validate(t,E,g);N.errors?(k.push(N.errors),E.restore()):(j.push(N.value),E.commit())}if(j.length===0)return{errors:o("alternatives.any",{details:k.map(v=>a.details(v,{override:!1}))})};if(s._flags.match==="one")return j.length===1?{value:j[0]}:{errors:o("alternatives.one")};if(j.length!==s.$_terms.matches.length)return{errors:o("alternatives.all",{details:k.map(v=>a.details(v,{override:!1}))})};const f=v=>v.$_terms.matches.some(x=>x.schema.type==="object"||x.schema.type==="alternatives"&&f(x.schema));return f(s)?{value:j.reduce((v,x)=>$(v,x,{mergeArrays:!1}))}:{value:j[j.length-1]}}const b=[];for(let j=0;j<s.$_terms.matches.length;++j){const k=s.$_terms.matches[j];if(k.schema){const x=h.nest(k.schema,`match.${j}`);x.snapshot();const E=k.schema.$_validate(t,x,g);if(!E.errors)return x.commit(),E;x.restore(),b.push({schema:k.schema,reports:E.errors});continue}const f=k.ref?k.ref.resolve(t,h,g):t,v=k.is?[k]:k.switch;for(let x=0;x<v.length;++x){const E=v[x],{is:N,then:M,otherwise:n}=E,d=`match.${j}${k.switch?"."+x:""}`;if(N.$_match(f,h.nest(N,`${d}.is`),g)){if(M)return M.$_validate(t,h.nest(M,`${d}.then`),g)}else if(n)return n.$_validate(t,h.nest(n,`${d}.otherwise`),g)}}return r.errors(b,c)},rules:{conditional:{method(t,c){l(!this._flags._endedSwitch,"Unreachable condition"),l(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),l(c.break===void 0,"Cannot use break option with alternatives conditional");const s=this.clone(),o=e.when(s,t,c),h=o.is?[o]:o.switch;for(const g of h)if(g.then&&g.otherwise){s.$_setFlag("_endedSwitch",!0,{clone:!1});break}return s.$_terms.matches.push(o),s.$_mutateRebuild()}},match:{method(t){if(l(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(const c of this.$_terms.matches)l(c.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){l(t.length,"Missing alternative schemas"),m.verifyFlat(t,"try"),l(!this._flags._endedSwitch,"Unreachable condition");const c=this.clone();for(const s of t)c.$_terms.matches.push({schema:c.$_compile(s)});return c.$_mutateRebuild()}}},overrides:{label(t){return this.$_parent("label",t).$_modify({each:(c,s)=>s.path[0]!=="is"&&typeof c._flags.label!="string"?c.label(t):void 0,ref:!1})}},rebuild(t){t.$_modify({each:c=>{m.isSchema(c)&&c.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(t,c){if(c.matches)for(const s of c.matches){const{schema:o,ref:h,is:g,not:b,then:j,otherwise:k}=s;t=o?t.try(o):h?t.conditional(h,{is:g,then:j,not:b,otherwise:k,switch:s.switch}):t.conditional(g,{then:j,otherwise:k})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),r.errors=function(t,{error:c,state:s}){if(!t.length)return{errors:c("alternatives.any")};if(t.length===1)return{errors:t[0].reports};const o=new Set,h=[];for(const{reports:g,schema:b}of t){if(g.length>1)return r.unmatched(t,c);const j=g[0];if(j instanceof a.Report==0)return r.unmatched(t,c);if(j.state.path.length!==s.path.length){h.push({type:b.type,report:j});continue}if(j.code==="any.only"){for(const v of j.local.valids)o.add(v);continue}const[k,f]=j.code.split(".");f!=="base"?h.push({type:b.type,report:j}):j.code==="object.base"?o.add(j.local.type):o.add(k)}return h.length?h.length===1?{errors:h[0].report}:r.unmatched(t,c):{errors:c("alternatives.types",{types:[...o]})}},r.unmatched=function(t,c){const s=[];for(const o of t)s.push(...o.reports);return{errors:c("alternatives.match",a.details(s,{override:!1}))}}},8068:(L,p,w)=>{const l=w(375),$=w(7629),y=w(8160),m=w(6914);L.exports=$.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,a){return l(typeof e=="function","Method must be a function"),l(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:a}})},validate(e,a,{method:i}){try{return i(e,a)}catch(r){return a.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){l(y.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const a=this.clone();return a.$_terms.shared=a.$_terms.shared||[],a.$_terms.shared.push(e),a.$_mutateRegister(e),a}},warning:{method(e,a){return l(e&&typeof e=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:a},warn:!0})},validate:(e,a,{code:i,local:r})=>a.error(i,r),args:["code","local"],multi:!0}},modifiers:{keep(e,a=!0){e.keep=a},message(e,a){e.message=m.compile(a)},warn(e,a=!0){e.warn=a}},manifest:{build(e,a){for(const i in a){const r=a[i];if(["examples","externals","metas","notes","tags"].includes(i))for(const t of r)e=e[i.slice(0,-1)](t);else if(i!=="alterations")if(i!=="whens"){if(i==="shared")for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:c,is:s,not:o,then:h,otherwise:g,concat:b}=t;e=b?e.concat(b):c?e.when(c,{is:s,not:o,then:h,otherwise:g,switch:t.switch,break:t.break}):e.when(s,{then:h,otherwise:g,break:t.break})}else{const t={};for(const{target:c,adjuster:s}of r)t[c]=s;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(L,p,w)=>{const l=w(375),$=w(9474),y=w(9621),m=w(8068),e=w(8160),a=w(3292),i={};L.exports=m.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(r,{schema:t,state:c,prefs:s}){if(!Array.isArray(r))return;const o=t.$_getRule("sort");return o?i.sort(t,r,o.args.options,c,s):void 0}},validate(r,{schema:t,error:c}){if(!Array.isArray(r)){if(t._flags.single){const s=[r];return s[e.symbols.arraySingle]=!0,{value:s}}return{errors:c("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:r}});return t.$_mutateRegister(r),t},validate(r,{state:t,prefs:c,error:s},{schema:o}){const h=[r,...t.ancestors];for(let b=0;b<r.length;++b){const j=t.localize([...t.path,b],h,o);if(o.$_match(r[b],j,c))return r}const g=o._flags.label;return g?s("array.hasKnown",{patternLabel:g}):s("array.hasUnknown",null)},multi:!0},items:{method(...r){e.verifyFlat(r,"items");const t=this.$_addRule("items");for(let c=0;c<r.length;++c){const s=e.tryWithPath(()=>this.$_compile(r[c]),c,{append:!0});t.$_terms.items.push(s)}return t.$_mutateRebuild()},validate(r,{schema:t,error:c,state:s,prefs:o,errorsArray:h}){const g=t.$_terms._requireds.slice(),b=t.$_terms.ordered.slice(),j=[...t.$_terms._inclusions,...g],k=!r[e.symbols.arraySingle];delete r[e.symbols.arraySingle];const f=h();let v=r.length;for(let x=0;x<v;++x){const E=r[x];let N=!1,M=!1;const n=k?x:new Number(x),d=[...s.path,n];if(!t._flags.sparse&&E===void 0){if(f.push(c("array.sparse",{key:n,path:d,pos:x,value:void 0},s.localize(d))),o.abortEarly)return f;b.shift();continue}const _=[r,...s.ancestors];for(const C of t.$_terms._exclusions)if(C.$_match(E,s.localize(d,_,C),o,{presence:"ignore"})){if(f.push(c("array.excludes",{pos:x,value:E},s.localize(d))),o.abortEarly)return f;N=!0,b.shift();break}if(N)continue;if(t.$_terms.ordered.length){if(b.length){const C=b.shift(),S=C.$_validate(E,s.localize(d,_,C),o);if(S.errors){if(f.push(...S.errors),o.abortEarly)return f}else if(C._flags.result==="strip")i.fastSplice(r,x),--x,--v;else{if(!t._flags.sparse&&S.value===void 0){if(f.push(c("array.sparse",{key:n,path:d,pos:x,value:void 0},s.localize(d))),o.abortEarly)return f;continue}r[x]=S.value}continue}if(!t.$_terms.items.length){if(f.push(c("array.orderedLength",{pos:x,limit:t.$_terms.ordered.length})),o.abortEarly)return f;break}}const R=[];let O=g.length;for(let C=0;C<O;++C){const S=s.localize(d,_,g[C]);S.snapshot();const u=g[C].$_validate(E,S,o);if(R[C]=u,!u.errors){if(S.commit(),r[x]=u.value,M=!0,i.fastSplice(g,C),--C,--O,!t._flags.sparse&&u.value===void 0&&(f.push(c("array.sparse",{key:n,path:d,pos:x,value:void 0},s.localize(d))),o.abortEarly))return f;break}S.restore()}if(M)continue;const D=o.stripUnknown&&!!o.stripUnknown.arrays||!1;O=j.length;for(const C of j){let S;const u=g.indexOf(C);if(u!==-1)S=R[u];else{const A=s.localize(d,_,C);if(A.snapshot(),S=C.$_validate(E,A,o),!S.errors){A.commit(),C._flags.result==="strip"?(i.fastSplice(r,x),--x,--v):t._flags.sparse||S.value!==void 0?r[x]=S.value:(f.push(c("array.sparse",{key:n,path:d,pos:x,value:void 0},s.localize(d))),N=!0),M=!0;break}A.restore()}if(O===1){if(D){i.fastSplice(r,x),--x,--v,M=!0;break}if(f.push(...S.errors),o.abortEarly)return f;N=!0;break}}if(!N&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!M){if(D){i.fastSplice(r,x),--x,--v;continue}if(f.push(c("array.includes",{pos:x,value:E},s.localize(d))),o.abortEarly)return f}}return g.length&&i.fillMissedErrors(t,f,g,r,s,o),b.length&&(i.fillOrderedErrors(t,f,b,r,s,o),f.length||i.fillDefault(b,r,s,o)),f.length?f:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,t,{limit:c},{name:s,operator:o,args:h})=>e.compare(r.length,c,o)?r:t.error("array."+s,{limit:h.limit,value:r}),args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"}]},max:{method(r){return this.$_addRule({name:"max",method:"length",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"length",args:{limit:r},operator:">="})}},ordered:{method(...r){e.verifyFlat(r,"ordered");const t=this.$_addRule("items");for(let c=0;c<r.length;++c){const s=e.tryWithPath(()=>this.$_compile(r[c]),c,{append:!0});i.validateSingle(s,t),t.$_mutateRegister(s),t.$_terms.ordered.push(s)}return t.$_mutateRebuild()}},single:{method(r){const t=r===void 0||!!r;return l(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(r={}){e.assertOptions(r,["by","order"]);const t={order:r.order||"ascending"};return r.by&&(t.by=a.ref(r.by,{ancestor:0}),l(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(r,{error:t,state:c,prefs:s,schema:o},{options:h}){const{value:g,errors:b}=i.sort(o,r,h,c,s);if(b)return b;for(let j=0;j<r.length;++j)if(r[j]!==g[j])return t("array.sort",{order:h.order,by:h.by?h.by.key:"value"});return r},convert:!0},sparse:{method(r){const t=r===void 0||!!r;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(r,t={}){l(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),e.assertOptions(t,["ignoreUndefined","separator"]);const c={name:"unique",args:{options:t,comparator:r}};if(r)if(typeof r=="string"){const s=e.default(t.separator,".");c.path=s?r.split(s):[r]}else c.comparator=r;return this.$_addRule(c)},validate(r,{state:t,error:c,schema:s},{comparator:o,options:h},{comparator:g,path:b}){const j={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},k=g||$,f=h.ignoreUndefined;for(let v=0;v<r.length;++v){const x=b?y(r[v],b):r[v],E=g?j.custom:j[typeof x];if(l(E,"Failed to find unique map container for type",typeof x),E instanceof Map){const N=E.entries();let M;for(;!(M=N.next()).done;)if(k(M.value[0],x)){const n=t.localize([...t.path,v],[r,...t.ancestors]),d={pos:v,value:r[v],dupePos:M.value[1],dupeValue:r[M.value[1]]};return b&&(d.path=o),c("array.unique",d,n)}E.set(x,v)}else{if((!f||x!==void 0)&&E[x]!==void 0){const N={pos:v,value:r[v],dupePos:E[x],dupeValue:r[E[x]]};return b&&(N.path=o),c("array.unique",N,t.localize([...t.path,v],[r,...t.ancestors]))}E[x]=v}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,t)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const t of r.$_terms.items)i.validateSingle(t,r),t._flags.presence==="required"?r.$_terms._requireds.push(t):t._flags.presence==="forbidden"?r.$_terms._exclusions.push(t):r.$_terms._inclusions.push(t);for(const t of r.$_terms.ordered)i.validateSingle(t,r)},manifest:{build:(r,t)=>(t.items&&(r=r.items(...t.items)),t.ordered&&(r=r.ordered(...t.ordered)),r)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),i.fillMissedErrors=function(r,t,c,s,o,h){const g=[];let b=0;for(const j of c){const k=j._flags.label;k?g.push(k):++b}g.length?b?t.push(r.$_createError("array.includesRequiredBoth",s,{knownMisses:g,unknownMisses:b},o,h)):t.push(r.$_createError("array.includesRequiredKnowns",s,{knownMisses:g},o,h)):t.push(r.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:b},o,h))},i.fillOrderedErrors=function(r,t,c,s,o,h){const g=[];for(const b of c)b._flags.presence==="required"&&g.push(b);g.length&&i.fillMissedErrors(r,t,g,s,o,h)},i.fillDefault=function(r,t,c,s){const o=[];let h=!0;for(let g=r.length-1;g>=0;--g){const b=r[g],j=[t,...c.ancestors],k=b.$_validate(void 0,c.localize(c.path,j,b),s).value;if(h){if(k===void 0)continue;h=!1}o.unshift(k)}o.length&&t.push(...o)},i.fastSplice=function(r,t){let c=t;for(;c<r.length;)r[c++]=r[c];--r.length},i.validateSingle=function(r,t){(r.type==="array"||r._flags._arrayItems)&&(l(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},i.sort=function(r,t,c,s,o){const h=c.order==="ascending"?1:-1,g=-1*h,b=h,j=(k,f)=>{let v=i.compare(k,f,g,b);if(v!==null||(c.by&&(k=c.by.resolve(k,s,o),f=c.by.resolve(f,s,o)),v=i.compare(k,f,g,b),v!==null))return v;const x=typeof k;if(x!==typeof f)throw r.$_createError("array.sort.mismatching",t,null,s,o);if(x!=="number"&&x!=="string")throw r.$_createError("array.sort.unsupported",t,{type:x},s,o);return x==="number"?(k-f)*h:k<f?g:b};try{return{value:t.slice().sort(j)}}catch(k){return{errors:k}}},i.compare=function(r,t,c,s){return r===t?0:r===void 0?1:t===void 0?-1:r===null?s:t===null?c:null}},4937:(L,p,w)=>{const l=w(375),$=w(8068),y=w(8160),m=w(2036),e={isBool:function(a){return typeof a=="boolean"}};L.exports=$.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(a,{schema:i}){if(typeof a!="boolean"){if(typeof a=="string"){const r=i._flags.sensitive?a:a.toLowerCase();a=r==="true"||r!=="false"&&a}return typeof a!="boolean"&&(a=i.$_terms.truthy&&i.$_terms.truthy.has(a,null,null,!i._flags.sensitive)||(!i.$_terms.falsy||!i.$_terms.falsy.has(a,null,null,!i._flags.sensitive))&&a),{value:a}}},validate(a,{error:i}){if(typeof a!="boolean")return{value:a,errors:i("boolean.base")}},rules:{truthy:{method(...a){y.verifyFlat(a,"truthy");const i=this.clone();i.$_terms.truthy=i.$_terms.truthy||new m;for(let r=0;r<a.length;++r){const t=a[r];l(t!==void 0,"Cannot call truthy with undefined"),i.$_terms.truthy.add(t)}return i}},falsy:{method(...a){y.verifyFlat(a,"falsy");const i=this.clone();i.$_terms.falsy=i.$_terms.falsy||new m;for(let r=0;r<a.length;++r){const t=a[r];l(t!==void 0,"Cannot call falsy with undefined"),i.$_terms.falsy.add(t)}return i}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:e.isBool,to:(a,i)=>a?1:0},string:{from:e.isBool,to:(a,i)=>a?"true":"false"}},manifest:{build:(a,i)=>(i.truthy&&(a=a.truthy(...i.truthy)),i.falsy&&(a=a.falsy(...i.falsy)),a)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(L,p,w)=>{const l=w(375),$=w(8068),y=w(8160),m=w(3328),e={isDate:function(a){return a instanceof Date}};L.exports=$.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:i})=>({value:e.parse(a,i._flags.format)||a})},validate(a,{schema:i,error:r,prefs:t}){if(a instanceof Date&&!isNaN(a.getTime()))return;const c=i._flags.format;return t.convert&&c&&typeof a=="string"?{value:a,errors:r("date.format",{format:c})}:{value:a,errors:r("date.base")}},rules:{compare:{method:!1,validate(a,i,{date:r},{name:t,operator:c,args:s}){const o=r==="now"?Date.now():r.getTime();return y.compare(a.getTime(),o,c)?a:i.error("date."+t,{limit:s.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:e.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return l(["iso","javascript","unix"].includes(a),"Unknown date format",a),this.$_setFlag("format",a)}},greater:{method(a){return this.$_addRule({name:"greater",method:"compare",args:{date:a},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(a){return this.$_addRule({name:"less",method:"compare",args:{date:a},operator:"<"})}},max:{method(a){return this.$_addRule({name:"max",method:"compare",args:{date:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"compare",args:{date:a},operator:">="})}},timestamp:{method(a="javascript"){return l(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:e.isDate,to:(a,i)=>a.getTime()},string:{from:e.isDate,to:(a,{prefs:i})=>m.date(a,i)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),e.parse=function(a,i){if(a instanceof Date)return a;if(typeof a!="string"&&(isNaN(a)||!isFinite(a))||/^\s*$/.test(a))return null;if(i==="iso")return y.isIsoDate(a)?e.date(a.toString()):null;const r=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),i){if(i==="javascript")return e.date(1*a);if(i==="unix")return e.date(1e3*a);if(typeof r=="string")return null}return e.date(a)},e.date=function(a){const i=new Date(a);return isNaN(i.getTime())?null:i}},390:(L,p,w)=>{const l=w(375),$=w(7824);L.exports=$.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(y){return l(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:y}})},validate:(y,m,{n:e})=>y.length===e?y:m.error("function.arity",{n:e})},class:{method(){return this.$_addRule("class")},validate:(y,m)=>/^\s*class\s/.test(y.toString())?y:m.error("function.class",{value:y})},minArity:{method(y){return l(Number.isSafeInteger(y)&&y>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:y}})},validate:(y,m,{n:e})=>y.length>=e?y:m.error("function.minArity",{n:e})},maxArity:{method(y){return l(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:y}})},validate:(y,m,{n:e})=>y.length<=e?y:m.error("function.maxArity",{n:e})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(L,p,w)=>{const l=w(978),$=w(375),y=w(8571),m=w(3652),e=w(8068),a=w(8160),i=w(3292),r=w(6354),t=w(6133),c=w(3328),s={renameDefaults:{alias:!1,multiple:!1,override:!1}};L.exports=e.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(o,h)=>o.keys(h),validate(o,{schema:h,error:g,state:b,prefs:j}){if(!o||typeof o!==h.$_property("typeof")||Array.isArray(o))return{value:o,errors:g("object.base",{type:h.$_property("typeof")})};if(!(h.$_terms.renames||h.$_terms.dependencies||h.$_terms.keys||h.$_terms.patterns||h.$_terms.externals))return;o=s.clone(o,j);const k=[];if(h.$_terms.renames&&!s.rename(h,o,b,j,k))return{value:o,errors:k};if(!h.$_terms.keys&&!h.$_terms.patterns&&!h.$_terms.dependencies)return{value:o,errors:k};const f=new Set(Object.keys(o));if(h.$_terms.keys){const v=[o,...b.ancestors];for(const x of h.$_terms.keys){const E=x.key,N=o[E];f.delete(E);const M=b.localize([...b.path,E],v,x),n=x.schema.$_validate(N,M,j);if(n.errors){if(j.abortEarly)return{value:o,errors:n.errors};n.value!==void 0&&(o[E]=n.value),k.push(...n.errors)}else x.schema._flags.result==="strip"||n.value===void 0&&N!==void 0?delete o[E]:n.value!==void 0&&(o[E]=n.value)}}if(f.size||h._flags._hasPatternMatch){const v=s.unknown(h,o,f,k,b,j);if(v)return v}if(h.$_terms.dependencies)for(const v of h.$_terms.dependencies){if(v.key!==null&&s.isPresent(v.options)(v.key.resolve(o,b,j,null,{shadow:!1}))===!1)continue;const x=s.dependencies[v.rel](h,v,o,b,j);if(x){const E=h.$_createError(x.code,o,x.context,b,j);if(j.abortEarly)return{value:o,errors:E};k.push(E)}}return{value:o,errors:k}},rules:{and:{method(...o){return a.verifyFlat(o,"and"),s.dependency(this,"and",null,o)}},append:{method(o){return o==null||Object.keys(o).length===0?this:this.keys(o)}},assert:{method(o,h,g){c.isTemplate(o)||(o=i.ref(o)),$(g===void 0||typeof g=="string","Message must be a string"),h=this.$_compile(h,{appendPath:!0});const b=this.$_addRule({name:"assert",args:{subject:o,schema:h,message:g}});return b.$_mutateRegister(o),b.$_mutateRegister(h),b},validate(o,{error:h,prefs:g,state:b},{subject:j,schema:k,message:f}){const v=j.resolve(o,b,g),x=t.isRef(j)?j.absolute(b):[];return k.$_match(v,b.localize(x,[o,...b.ancestors],k),g)?o:h("object.assert",{subject:j,message:f})},args:["subject","schema","message"],multi:!0},instance:{method(o,h){return $(typeof o=="function","constructor must be a function"),h=h||o.name,this.$_addRule({name:"instance",args:{constructor:o,name:h}})},validate:(o,h,{constructor:g,name:b})=>o instanceof g?o:h.error("object.instance",{type:b,value:o}),args:["constructor","name"]},keys:{method(o){$(o===void 0||typeof o=="object","Object schema must be a valid object"),$(!a.isSchema(o),"Object schema cannot be a joi schema");const h=this.clone();if(o)if(Object.keys(o).length){h.$_terms.keys=h.$_terms.keys?h.$_terms.keys.filter(g=>!o.hasOwnProperty(g.key)):new s.Keys;for(const g in o)a.tryWithPath(()=>h.$_terms.keys.push({key:g,schema:this.$_compile(o[g])}),g)}else h.$_terms.keys=new s.Keys;else h.$_terms.keys=null;return h.$_mutateRebuild()}},length:{method(o){return this.$_addRule({name:"length",args:{limit:o},operator:"="})},validate:(o,h,{limit:g},{name:b,operator:j,args:k})=>a.compare(Object.keys(o).length,g,j)?o:h.error("object."+b,{limit:k.limit,value:o}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(o){return this.$_addRule({name:"max",method:"length",args:{limit:o},operator:"<="})}},min:{method(o){return this.$_addRule({name:"min",method:"length",args:{limit:o},operator:">="})}},nand:{method(...o){return a.verifyFlat(o,"nand"),s.dependency(this,"nand",null,o)}},or:{method(...o){return a.verifyFlat(o,"or"),s.dependency(this,"or",null,o)}},oxor:{method(...o){return s.dependency(this,"oxor",null,o)}},pattern:{method(o,h,g={}){const b=o instanceof RegExp;b||(o=this.$_compile(o,{appendPath:!0})),$(h!==void 0,"Invalid rule"),a.assertOptions(g,["fallthrough","matches"]),b&&$(!o.flags.includes("g")&&!o.flags.includes("y"),"pattern should not use global or sticky mode"),h=this.$_compile(h,{appendPath:!0});const j=this.clone();j.$_terms.patterns=j.$_terms.patterns||[];const k={[b?"regex":"schema"]:o,rule:h};return g.matches&&(k.matches=this.$_compile(g.matches),k.matches.type!=="array"&&(k.matches=k.matches.$_root.array().items(k.matches)),j.$_mutateRegister(k.matches),j.$_setFlag("_hasPatternMatch",!0,{clone:!1})),g.fallthrough&&(k.fallthrough=!0),j.$_terms.patterns.push(k),j.$_mutateRegister(h),j}},ref:{method(){return this.$_addRule("ref")},validate:(o,h)=>t.isRef(o)?o:h.error("object.refType",{value:o})},regex:{method(){return this.$_addRule("regex")},validate:(o,h)=>o instanceof RegExp?o:h.error("object.regex",{value:o})},rename:{method(o,h,g={}){$(typeof o=="string"||o instanceof RegExp,"Rename missing the from argument"),$(typeof h=="string"||h instanceof c,"Invalid rename to argument"),$(h!==o,"Cannot rename key to same name:",o),a.assertOptions(g,["alias","ignoreUndefined","override","multiple"]);const b=this.clone();b.$_terms.renames=b.$_terms.renames||[];for(const j of b.$_terms.renames)$(j.from!==o,"Cannot rename the same key multiple times");return h instanceof c&&b.$_mutateRegister(h),b.$_terms.renames.push({from:o,to:h,options:l(s.renameDefaults,g)}),b}},schema:{method(o="any"){return this.$_addRule({name:"schema",args:{type:o}})},validate:(o,h,{type:g})=>!a.isSchema(o)||g!=="any"&&o.type!==g?h.error("object.schema",{type:g}):o},unknown:{method(o){return this.$_setFlag("unknown",o!==!1)}},with:{method(o,h,g={}){return s.dependency(this,"with",o,h,g)}},without:{method(o,h,g={}){return s.dependency(this,"without",o,h,g)}},xor:{method(...o){return a.verifyFlat(o,"xor"),s.dependency(this,"xor",null,o)}}},overrides:{default(o,h){return o===void 0&&(o=a.symbols.deepDefault),this.$_parent("default",o,h)}},rebuild(o){if(o.$_terms.keys){const h=new m.Sorter;for(const g of o.$_terms.keys)a.tryWithPath(()=>h.add(g,{after:g.schema.$_rootReferences(),group:g.key}),g.key);o.$_terms.keys=new s.Keys(...h.nodes)}},manifest:{build(o,h){if(h.keys&&(o=o.keys(h.keys)),h.dependencies)for(const{rel:g,key:b=null,peers:j,options:k}of h.dependencies)o=s.dependency(o,g,b,j,k);if(h.patterns)for(const{regex:g,schema:b,rule:j,fallthrough:k,matches:f}of h.patterns)o=o.pattern(g||b,j,{fallthrough:k,matches:f});if(h.renames)for(const{from:g,to:b,options:j}of h.renames)o=o.rename(g,b,j);return o}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),s.clone=function(o,h){if(typeof o=="object"){if(h.nonEnumerables)return y(o,{shallow:!0});const b=Object.create(Object.getPrototypeOf(o));return Object.assign(b,o),b}const g=function(...b){return o.apply(this,b)};return g.prototype=y(o.prototype),Object.defineProperty(g,"name",{value:o.name,writable:!1}),Object.defineProperty(g,"length",{value:o.length,writable:!1}),Object.assign(g,o),g},s.dependency=function(o,h,g,b,j){$(g===null||typeof g=="string",h,"key must be a strings"),j||(j=b.length>1&&typeof b[b.length-1]=="object"?b.pop():{}),a.assertOptions(j,["separator","isPresent"]),b=[].concat(b);const k=a.default(j.separator,"."),f=[];for(const x of b)$(typeof x=="string",h,"peers must be strings"),f.push(i.ref(x,{separator:k,ancestor:0,prefix:!1}));g!==null&&(g=i.ref(g,{separator:k,ancestor:0,prefix:!1}));const v=o.clone();return v.$_terms.dependencies=v.$_terms.dependencies||[],v.$_terms.dependencies.push(new s.Dependency(h,g,f,b,j)),v},s.dependencies={and(o,h,g,b,j){const k=[],f=[],v=h.peers.length,x=s.isPresent(h.options);for(const E of h.peers)x(E.resolve(g,b,j,null,{shadow:!1}))===!1?k.push(E.key):f.push(E.key);if(k.length!==v&&f.length!==v)return{code:"object.and",context:{present:f,presentWithLabels:s.keysToLabels(o,f),missing:k,missingWithLabels:s.keysToLabels(o,k)}}},nand(o,h,g,b,j){const k=[],f=s.isPresent(h.options);for(const E of h.peers)f(E.resolve(g,b,j,null,{shadow:!1}))&&k.push(E.key);if(k.length!==h.peers.length)return;const v=h.paths[0],x=h.paths.slice(1);return{code:"object.nand",context:{main:v,mainWithLabel:s.keysToLabels(o,v),peers:x,peersWithLabels:s.keysToLabels(o,x)}}},or(o,h,g,b,j){const k=s.isPresent(h.options);for(const f of h.peers)if(k(f.resolve(g,b,j,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:h.paths,peersWithLabels:s.keysToLabels(o,h.paths)}}},oxor(o,h,g,b,j){const k=[],f=s.isPresent(h.options);for(const x of h.peers)f(x.resolve(g,b,j,null,{shadow:!1}))&&k.push(x.key);if(!k.length||k.length===1)return;const v={peers:h.paths,peersWithLabels:s.keysToLabels(o,h.paths)};return v.present=k,v.presentWithLabels=s.keysToLabels(o,k),{code:"object.oxor",context:v}},with(o,h,g,b,j){const k=s.isPresent(h.options);for(const f of h.peers)if(k(f.resolve(g,b,j,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:h.key.key,mainWithLabel:s.keysToLabels(o,h.key.key),peer:f.key,peerWithLabel:s.keysToLabels(o,f.key)}}},without(o,h,g,b,j){const k=s.isPresent(h.options);for(const f of h.peers)if(k(f.resolve(g,b,j,null,{shadow:!1})))return{code:"object.without",context:{main:h.key.key,mainWithLabel:s.keysToLabels(o,h.key.key),peer:f.key,peerWithLabel:s.keysToLabels(o,f.key)}}},xor(o,h,g,b,j){const k=[],f=s.isPresent(h.options);for(const x of h.peers)f(x.resolve(g,b,j,null,{shadow:!1}))&&k.push(x.key);if(k.length===1)return;const v={peers:h.paths,peersWithLabels:s.keysToLabels(o,h.paths)};return k.length===0?{code:"object.missing",context:v}:(v.present=k,v.presentWithLabels=s.keysToLabels(o,k),{code:"object.xor",context:v})}},s.keysToLabels=function(o,h){return Array.isArray(h)?h.map(g=>o.$_mapLabels(g)):o.$_mapLabels(h)},s.isPresent=function(o){return typeof o.isPresent=="function"?o.isPresent:h=>h!==void 0},s.rename=function(o,h,g,b,j){const k={};for(const f of o.$_terms.renames){const v=[],x=typeof f.from!="string";if(x)for(const E in h){if(h[E]===void 0&&f.options.ignoreUndefined||E===f.to)continue;const N=f.from.exec(E);N&&v.push({from:E,to:f.to,match:N})}else!Object.prototype.hasOwnProperty.call(h,f.from)||h[f.from]===void 0&&f.options.ignoreUndefined||v.push(f);for(const E of v){const N=E.from;let M=E.to;if(M instanceof c&&(M=M.render(h,g,b,E.match)),N!==M){if(!f.options.multiple&&k[M]&&(j.push(o.$_createError("object.rename.multiple",h,{from:N,to:M,pattern:x},g,b)),b.abortEarly)||Object.prototype.hasOwnProperty.call(h,M)&&!f.options.override&&!k[M]&&(j.push(o.$_createError("object.rename.override",h,{from:N,to:M,pattern:x},g,b)),b.abortEarly))return!1;h[N]===void 0?delete h[M]:h[M]=h[N],k[M]=!0,f.options.alias||delete h[N]}}}return!0},s.unknown=function(o,h,g,b,j,k){if(o.$_terms.patterns){let f=!1;const v=o.$_terms.patterns.map(E=>{if(E.matches)return f=!0,[]}),x=[h,...j.ancestors];for(const E of g){const N=h[E],M=[...j.path,E];for(let n=0;n<o.$_terms.patterns.length;++n){const d=o.$_terms.patterns[n];if(d.regex){const O=d.regex.test(E);if(j.mainstay.tracer.debug(j,"rule",`pattern.${n}`,O?"pass":"error"),!O)continue}else if(!d.schema.$_match(E,j.nest(d.schema,`pattern.${n}`),k))continue;g.delete(E);const _=j.localize(M,x,{schema:d.rule,key:E}),R=d.rule.$_validate(N,_,k);if(R.errors){if(k.abortEarly)return{value:h,errors:R.errors};b.push(...R.errors)}if(d.matches&&v[n].push(E),h[E]=R.value,!d.fallthrough)break}}if(f)for(let E=0;E<v.length;++E){const N=v[E];if(!N)continue;const M=o.$_terms.patterns[E].matches,n=j.localize(j.path,x,M),d=M.$_validate(N,n,k);if(d.errors){const _=r.details(d.errors,{override:!1});_.matches=N;const R=o.$_createError("object.pattern.match",h,_,j,k);if(k.abortEarly)return{value:h,errors:R};b.push(R)}}}if(g.size&&(o.$_terms.keys||o.$_terms.patterns)){if(k.stripUnknown&&o._flags.unknown===void 0||k.skipFunctions){const f=!(!k.stripUnknown||k.stripUnknown!==!0&&!k.stripUnknown.objects);for(const v of g)f?(delete h[v],g.delete(v)):typeof h[v]=="function"&&g.delete(v)}if(!a.default(o._flags.unknown,k.allowUnknown))for(const f of g){const v=j.localize([...j.path,f],[]),x=o.$_createError("object.unknown",h[f],{child:f},v,k,{flags:!1});if(k.abortEarly)return{value:h,errors:x};b.push(x)}}},s.Dependency=class{constructor(o,h,g,b,j){this.rel=o,this.key=h,this.peers=g,this.paths=b,this.options=j}describe(){const o={rel:this.rel,peers:this.paths};return this.key!==null&&(o.key=this.key.key),this.peers[0].separator!=="."&&(o.options={...o.options,separator:this.peers[0].separator}),this.options.isPresent&&(o.options={...o.options,isPresent:this.options.isPresent}),o}},s.Keys=class extends Array{concat(o){const h=this.slice(),g=new Map;for(let b=0;b<h.length;++b)g.set(h[b].key,b);for(const b of o){const j=b.key,k=g.get(j);k!==void 0?h[k]={key:j,schema:h[k].schema.concat(b.schema)}:h.push(b)}return h}}},8785:(L,p,w)=>{const l=w(375),$=w(8068),y=w(8160),m=w(3292),e=w(6354),a={};L.exports=$.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(i,r)=>i.ref(r),validate(i,{schema:r,state:t,prefs:c}){l(r.$_terms.link,"Uninitialized link schema");const s=a.generate(r,i,t,c),o=r.$_terms.link[0].ref;return s.$_validate(i,t.nest(s,`link:${o.display}:${s.type}`),c)},generate:(i,r,t,c)=>a.generate(i,r,t,c),rules:{ref:{method(i){l(!this.$_terms.link,"Cannot reinitialize schema"),i=m.ref(i),l(i.type==="value"||i.type==="local","Invalid reference type:",i.type),l(i.type==="local"||i.ancestor==="root"||i.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:i}],r}},relative:{method(i=!0){return this.$_setFlag("relative",i)}}},overrides:{concat(i){l(this.$_terms.link,"Uninitialized link schema"),l(y.isSchema(i),"Invalid schema object"),l(i.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:i}),r.$_mutateRebuild()}},manifest:{build:(i,r)=>(l(r.link,"Invalid link description missing link"),i.ref(r.link))}}),a.generate=function(i,r,t,c){let s=t.mainstay.links.get(i);if(s)return s._generate(r,t,c).schema;const o=i.$_terms.link[0].ref,{perspective:h,path:g}=a.perspective(o,t);a.assert(h,"which is outside of schema boundaries",o,i,t,c);try{s=g.length?h.$_reach(g):h}catch{a.assert(!1,"to non-existing schema",o,i,t,c)}return a.assert(s.type!=="link","which is another link",o,i,t,c),i._flags.relative||t.mainstay.links.set(i,s),s._generate(r,t,c).schema},a.perspective=function(i,r){if(i.type==="local"){for(const{schema:t,key:c}of r.schemas){if((t._flags.id||c)===i.path[0])return{perspective:t,path:i.path.slice(1)};if(t.$_terms.shared){for(const s of t.$_terms.shared)if(s._flags.id===i.path[0])return{perspective:s,path:i.path.slice(1)}}}return{perspective:null,path:null}}return i.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:i.path}:{perspective:r.schemas[i.ancestor]&&r.schemas[i.ancestor].schema,path:i.path}},a.assert=function(i,r,t,c,s,o){i||l(!1,`"${e.label(c._flags,s,o)}" contains link reference "${t.display}" ${r}`)}},3832:(L,p,w)=>{const l=w(375),$=w(8068),y=w(8160),m={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const a=e.toString(),i=a.indexOf("."),r=a.indexOf("e");return(i<0?0:(r<0?a.length:r)-i-1)+(r<0?0:Math.max(0,-parseInt(a.slice(r+1))))}};L.exports=$.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:a,error:i}){if(!e.match(m.numberRx))return;e=e.trim();const r={value:parseFloat(e)};if(r.value===0&&(r.value=0),!a._flags.unsafe)if(e.match(/e/i)){if(m.extractSignificantDigits(e)!==m.extractSignificantDigits(String(r.value)))return r.errors=i("number.unsafe"),r}else{const t=r.value.toString();if(t.match(/e/i))return r;if(t!==m.normalizeDecimal(e))return r.errors=i("number.unsafe"),r}return r}},validate(e,{schema:a,error:i,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:i("number.infinity")};if(!y.isNumber(e))return{value:e,errors:i("number.base")};const t={value:e};if(r.convert){const c=a.$_getRule("precision");if(c){const s=Math.pow(10,c.args.limit);t.value=Math.round(t.value*s)/s}}return t.value===0&&(t.value=0),!a._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.errors=i("number.unsafe")),t},rules:{compare:{method:!1,validate:(e,a,{limit:i},{name:r,operator:t,args:c})=>y.compare(e,i,t)?e:a.error("number."+r,{limit:c.limit,value:e}),args:[{name:"limit",ref:!0,assert:y.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,a)=>Math.trunc(e)-e==0?e:a.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){const a=typeof e=="number"?m.decimalPlaces(e):null,i=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:a,pfactor:i}})},validate:(e,a,{base:i,baseDecimalPlace:r,pfactor:t},c)=>m.decimalPlaces(e)>r?a.error("number.multiple",{multiple:c.args.base,value:e}):Math.round(t*e)%Math.round(t*i)==0?e:a.error("number.multiple",{multiple:c.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>typeof e=="number"&&isFinite(e)&&e>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,a)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return l(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,a,{limit:i}){const r=e.toString().match(m.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=i?e:a.error("number.precision",{limit:i,value:e})},convert:!0},sign:{method(e){return l(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,a,{sign:i})=>i==="negative"&&e<0||i==="positive"&&e>0?e:a.error(`number.${i}`)},unsafe:{method(e=!0){return l(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>typeof e=="number",to:(e,a)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),m.extractSignificantDigits=function(e){return e.replace(m.exponentialPartRegex,"").replace(m.dotRegex,"").replace(m.trailingZerosRegex,"").replace(m.leadingSignAndZerosRegex,"")},m.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),e==="-0"?"0":e}},8966:(L,p,w)=>{const l=w(7824);L.exports=l.extend({type:"object",cast:{map:{from:$=>$&&typeof $=="object",to:($,y)=>new Map(Object.entries($))}}})},7417:(L,p,w)=>{const l=w(375),$=w(5380),y=w(1745),m=w(9959),e=w(6064),a=w(9926),i=w(5752),r=w(8068),t=w(8160),c={tlds:a instanceof Set&&{tlds:{allow:a,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:m.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"]};L.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(s,{schema:o,state:h,prefs:g}){const b=o.$_getRule("normalize");b&&(s=s.normalize(b.args.form));const j=o.$_getRule("case");j&&(s=j.args.direction==="upper"?s.toLocaleUpperCase():s.toLocaleLowerCase());const k=o.$_getRule("trim");if(k&&k.args.enabled&&(s=s.trim()),o.$_terms.replacements)for(const v of o.$_terms.replacements)s=s.replace(v.pattern,v.replacement);const f=o.$_getRule("hex");if(f&&f.args.options.byteAligned&&s.length%2!=0&&(s=`0${s}`),o.$_getRule("isoDate")){const v=c.isoDate(s);v&&(s=v)}if(o._flags.truncate){const v=o.$_getRule("max");if(v){let x=v.args.limit;if(t.isResolvable(x)&&(x=x.resolve(s,h,g),!t.limit(x)))return{value:s,errors:o.$_createError("any.ref",x,{ref:v.args.limit,arg:"limit",reason:"must be a positive integer"},h,g)};s=s.slice(0,x)}}return{value:s}}},validate(s,{schema:o,error:h}){if(typeof s!="string")return{value:s,errors:h("string.base")};if(s===""){const g=o.$_getRule("min");return g&&g.args.limit===0?void 0:{value:s,errors:h("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(s,o)=>/^[a-zA-Z0-9]+$/.test(s)?s:o.error("string.alphanum")},base64:{method(s={}){return t.assertOptions(s,["paddingRequired","urlSafe"]),s={urlSafe:!1,paddingRequired:!0,...s},l(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),l(typeof s.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:s}})},validate:(s,o,{options:h})=>c.base64Regex[h.paddingRequired][h.urlSafe].test(s)?s:o.error("string.base64")},case:{method(s){return l(["lower","upper"].includes(s),"Invalid case:",s),this.$_addRule({name:"case",args:{direction:s}})},validate:(s,o,{direction:h})=>h==="lower"&&s===s.toLocaleLowerCase()||h==="upper"&&s===s.toLocaleUpperCase()?s:o.error(`string.${h}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(s,o){let h=s.length,g=0,b=1;for(;h--;){const j=s.charAt(h)*b;g+=j-9*(j>9),b^=3}return g>0&&g%10==0?s:o.error("string.creditCard")}},dataUri:{method(s={}){return t.assertOptions(s,["paddingRequired"]),s={paddingRequired:!0,...s},l(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:s}})},validate(s,o,{options:h}){const g=s.match(c.dataUriRegex);return g&&(!g[2]||g[2]!=="base64"||c.base64Regex[h.paddingRequired].false.test(g[3]))?s:o.error("string.dataUri")}},domain:{method(s){s&&t.assertOptions(s,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const o=c.addressOptions(s);return this.$_addRule({name:"domain",args:{options:s},address:o})},validate:(s,o,h,{address:g})=>$.isValid(s,g)?s:o.error("string.domain")},email:{method(s={}){t.assertOptions(s,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),l(s.multiple===void 0||typeof s.multiple=="boolean","multiple option must be an boolean");const o=c.addressOptions(s),h=new RegExp(`\\s*[${s.separator?e(s.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:s},regex:h,address:o})},validate(s,o,{options:h},{regex:g,address:b}){const j=h.multiple?s.split(g):[s],k=[];for(const f of j)y.isValid(f,b)||k.push(f);return k.length?o.error("string.email",{value:s,invalids:k}):s}},guid:{alias:"uuid",method(s={}){t.assertOptions(s,["version","separator"]);let o="";if(s.version){const b=[].concat(s.version);l(b.length>=1,"version must have at least 1 valid version specified");const j=new Set;for(let k=0;k<b.length;++k){const f=b[k];l(typeof f=="string","version at position "+k+" must be a string");const v=c.guidVersions[f.toLowerCase()];l(v,"version at position "+k+" must be one of "+Object.keys(c.guidVersions).join(", ")),l(!j.has(v),"version at position "+k+" must not be a duplicate"),o+=v,j.add(v)}}l(c.guidSeparators.has(s.separator),'separator must be one of true, false, "-", or ":"');const h=s.separator===void 0?"[:-]?":s.separator===!0?"[:-]":s.separator===!1?"[]?":`\\${s.separator}`,g=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${h})[0-9A-F]{4}\\2?[${o||"0-9A-F"}][0-9A-F]{3}\\2?[${o?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:s},regex:g})},validate(s,o,h,{regex:g}){const b=g.exec(s);return b?c.guidBrackets[b[1]]!==b[b.length-1]?o.error("string.guid"):s:o.error("string.guid")}},hex:{method(s={}){return t.assertOptions(s,["byteAligned","prefix"]),s={byteAligned:!1,prefix:!1,...s},l(typeof s.byteAligned=="boolean","byteAligned must be boolean"),l(typeof s.prefix=="boolean"||s.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:s}})},validate:(s,o,{options:h})=>(h.prefix==="optional"?c.hexRegex.withOptionalPrefix:h.prefix===!0?c.hexRegex.withPrefix:c.hexRegex.withoutPrefix).test(s)?h.byteAligned&&s.length%2!=0?o.error("string.hexAlign"):s:o.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(s,o)=>$.isValid(s,{minDomainSegments:1})||c.ipRegex.test(s)?s:o.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(s={}){t.assertOptions(s,["cidr","version"]);const{cidr:o,versions:h,regex:g}=m.regex(s),b=s.version?h:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:o,version:b}},regex:g})},validate:(s,o,{options:h},{regex:g})=>g.test(s)?s:h.version?o.error("string.ipVersion",{value:s,cidr:h.cidr,version:h.version}):o.error("string.ip",{value:s,cidr:h.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(s,{error:o})=>c.isoDate(s)?s:o("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(s,o)=>c.isoDurationRegex.test(s)?s:o.error("string.isoDuration")},length:{method(s,o){return c.length(this,"length",s,"=",o)},validate(s,o,{limit:h,encoding:g},{name:b,operator:j,args:k}){const f=!g&&s.length;return t.compare(f,h,j)?s:o.error("string."+b,{limit:k.limit,value:s,encoding:g})},args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(s,o){return c.length(this,"max",s,"<=",o)},args:["limit","encoding"]},min:{method(s,o){return c.length(this,"min",s,">=",o)},args:["limit","encoding"]},normalize:{method(s="NFC"){return l(c.normalizationForms.includes(s),"normalization form must be one of "+c.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:s}})},validate:(s,{error:o},{form:h})=>s===s.normalize(h)?s:o("string.normalize",{value:s,form:h}),convert:!0},pattern:{alias:"regex",method(s,o={}){l(s instanceof RegExp,"regex must be a RegExp"),l(!s.flags.includes("g")&&!s.flags.includes("y"),"regex should not use global or sticky mode"),typeof o=="string"&&(o={name:o}),t.assertOptions(o,["invert","name"]);const h=["string.pattern",o.invert?".invert":"",o.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:s,options:o},errorCode:h})},validate:(s,o,{regex:h,options:g},{errorCode:b})=>h.test(s)^g.invert?s:o.error(b,{name:g.name,regex:h,value:s}),args:["regex","options"],multi:!0},replace:{method(s,o){typeof s=="string"&&(s=new RegExp(e(s),"g")),l(s instanceof RegExp,"pattern must be a RegExp"),l(typeof o=="string","replacement must be a String");const h=this.clone();return h.$_terms.replacements||(h.$_terms.replacements=[]),h.$_terms.replacements.push({pattern:s,replacement:o}),h}},token:{method(){return this.$_addRule("token")},validate:(s,o)=>/^\w+$/.test(s)?s:o.error("string.token")},trim:{method(s=!0){return l(typeof s=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:s}})},validate:(s,o,{enabled:h})=>h&&s!==s.trim()?o.error("string.trim"):s,convert:!0},truncate:{method(s=!0){return l(typeof s=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",s)}},uppercase:{method(){return this.case("upper")}},uri:{method(s={}){t.assertOptions(s,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),s.domain&&t.assertOptions(s.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:o,scheme:h}=i.regex(s),g=s.domain?c.addressOptions(s.domain):null;return this.$_addRule({name:"uri",args:{options:s},regex:o,domain:g,scheme:h})},validate(s,o,{options:h},{regex:g,domain:b,scheme:j}){if(["http:/","https:/"].includes(s))return o.error("string.uri");let k=g.exec(s);if(!k&&o.prefs.convert&&h.encodeUri){const f=encodeURI(s);k=g.exec(f),k&&(s=f)}if(k){const f=k[1]||k[2];return!b||h.allowRelative&&!f||$.isValid(f,b)?s:o.error("string.domain",{value:f})}return h.relativeOnly?o.error("string.uriRelativeOnly"):h.scheme?o.error("string.uriCustomScheme",{scheme:j,value:s}):o.error("string.uri")}}},manifest:{build(s,o){if(o.replacements)for(const{pattern:h,replacement:g}of o.replacements)s=s.replace(h,g);return s}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),c.addressOptions=function(s){if(!s)return c.tlds||s;if(l(s.minDomainSegments===void 0||Number.isSafeInteger(s.minDomainSegments)&&s.minDomainSegments>0,"minDomainSegments must be a positive integer"),l(s.maxDomainSegments===void 0||Number.isSafeInteger(s.maxDomainSegments)&&s.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),s.tlds===!1)return s;if(s.tlds===!0||s.tlds===void 0)return l(c.tlds,"Built-in TLD list disabled"),Object.assign({},s,c.tlds);l(typeof s.tlds=="object","tlds must be true, false, or an object");const o=s.tlds.deny;if(o)return Array.isArray(o)&&(s=Object.assign({},s,{tlds:{deny:new Set(o)}})),l(s.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),l(!s.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),c.validateTlds(s.tlds.deny,"tlds.deny"),s;const h=s.tlds.allow;return h?h===!0?(l(c.tlds,"Built-in TLD list disabled"),Object.assign({},s,c.tlds)):(Array.isArray(h)&&(s=Object.assign({},s,{tlds:{allow:new Set(h)}})),l(s.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),c.validateTlds(s.tlds.allow,"tlds.allow"),s):s},c.validateTlds=function(s,o){for(const h of s)l($.isValid(h,{minDomainSegments:1,maxDomainSegments:1}),`${o} must contain valid top level domain names`)},c.isoDate=function(s){if(!t.isIsoDate(s))return null;/.*T.*[+-]\d\d$/.test(s)&&(s+="00");const o=new Date(s);return isNaN(o.getTime())?null:o.toISOString()},c.length=function(s,o,h,g,b){return l(!b||!1,"Invalid encoding:",b),s.$_addRule({name:o,method:"length",args:{limit:h,encoding:b},operator:g})}},8826:(L,p,w)=>{const l=w(375),$=w(8068),y={};y.Map=class extends Map{slice(){return new y.Map(this)}},L.exports=$.extend({type:"symbol",terms:{map:{init:new y.Map}},coerce:{method(m,{schema:e,error:a}){const i=e.$_terms.map.get(m);return i&&(m=i),e._flags.only&&typeof m!="symbol"?{value:m,errors:a("symbol.map",{map:e.$_terms.map})}:{value:m}}},validate(m,{error:e}){if(typeof m!="symbol")return{value:m,errors:e("symbol.base")}},rules:{map:{method(m){m&&!m[Symbol.iterator]&&typeof m=="object"&&(m=Object.entries(m)),l(m&&m[Symbol.iterator],"Iterable must be an iterable or object");const e=this.clone(),a=[];for(const i of m){l(i&&i[Symbol.iterator],"Entry must be an iterable");const[r,t]=i;l(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),l(typeof t=="symbol","Value must be a Symbol"),e.$_terms.map.set(r,t),a.push(t)}return e.valid(...a)}}},manifest:{build:(m,e)=>(e.map&&(m=m.map(e.map)),m)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(L,p,w)=>{const l=w(375),$=w(8571),y=w(738),m=w(9621),e=w(8160),a=w(6354),i=w(493),r={result:Symbol("result")};p.entry=function(t,c,s){let o=e.defaults;s&&(l(s.warnings===void 0,"Cannot override warnings preference in synchronous validation"),l(s.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),o=e.preferences(e.defaults,s));const h=r.entry(t,c,o);l(!h.mainstay.externals.length,"Schema with external rules must use validateAsync()");const g={value:h.value};return h.error&&(g.error=h.error),h.mainstay.warnings.length&&(g.warning=a.details(h.mainstay.warnings)),h.mainstay.debug&&(g.debug=h.mainstay.debug),h.mainstay.artifacts&&(g.artifacts=h.mainstay.artifacts),g},p.entryAsync=async function(t,c,s){let o=e.defaults;s&&(o=e.preferences(e.defaults,s));const h=r.entry(t,c,o),g=h.mainstay;if(h.error)throw g.debug&&(h.error.debug=g.debug),h.error;if(g.externals.length){let j=h.value;const k=[];for(const f of g.externals){const v=f.state.path,x=f.schema.type==="link"?g.links.get(f.schema):null;let E,N,M=j;const n=v.length?[j]:[],d=v.length?m(t,v):t;if(v.length){E=v[v.length-1];let _=j;for(const R of v.slice(0,-1))_=_[R],n.unshift(_);N=n[0],M=N[E]}try{const _=(O,D)=>(x||f.schema).$_createError(O,M,D,f.state,o),R=await f.method(M,{schema:f.schema,linked:x,state:f.state,prefs:s,original:d,error:_,errorsArray:r.errorsArray,warn:(O,D)=>g.warnings.push((x||f.schema).$_createError(O,M,D,f.state,o)),message:(O,D)=>(x||f.schema).$_createError("external",M,D,f.state,o,{messages:O})});if(R===void 0||R===M)continue;if(R instanceof a.Report){if(g.tracer.log(f.schema,f.state,"rule","external","error"),k.push(R),o.abortEarly)break;continue}if(Array.isArray(R)&&R[e.symbols.errors]){if(g.tracer.log(f.schema,f.state,"rule","external","error"),k.push(...R),o.abortEarly)break;continue}N?(g.tracer.value(f.state,"rule",M,R,"external"),N[E]=R):(g.tracer.value(f.state,"rule",j,R,"external"),j=R)}catch(_){throw o.errors.label&&(_.message+=` (${f.label})`),_}}if(h.value=j,k.length)throw h.error=a.process(k,t,o),g.debug&&(h.error.debug=g.debug),h.error}if(!o.warnings&&!o.debug&&!o.artifacts)return h.value;const b={value:h.value};return g.warnings.length&&(b.warning=a.details(g.warnings)),g.debug&&(b.debug=g.debug),g.artifacts&&(b.artifacts=g.artifacts),b},r.Mainstay=class{constructor(t,c,s){this.externals=[],this.warnings=[],this.tracer=t,this.debug=c,this.links=s,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}},r.entry=function(t,c,s){const{tracer:o,cleanup:h}=r.tracer(c,s),g=s.debug?[]:null,b=c._ids._schemaChain?new Map:null,j=new r.Mainstay(o,g,b),k=c._ids._schemaChain?[{schema:c}]:null,f=new i([],[],{mainstay:j,schemas:k}),v=p.validate(t,c,f,s);h&&c.$_root.untrace();const x=a.process(v.errors,t,s);return{value:v.value,error:x,mainstay:j}},r.tracer=function(t,c){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:c.debug?(l(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:r.ignore}},p.validate=function(t,c,s,o,h={}){if(c.$_terms.whens&&(c=c._generate(t,s,o).schema),c._preferences&&(o=r.prefs(c,o)),c._cache&&o.cache){const x=c._cache.get(t);if(s.mainstay.tracer.debug(s,"validate","cached",!!x),x)return x}const g=(x,E,N)=>c.$_createError(x,t,E,N||s,o),b={original:t,prefs:o,schema:c,state:s,error:g,errorsArray:r.errorsArray,warn:(x,E,N)=>s.mainstay.warnings.push(g(x,E,N)),message:(x,E)=>c.$_createError("custom",t,E,s,o,{messages:x})};s.mainstay.tracer.entry(c,s);const j=c._definition;if(j.prepare&&t!==void 0&&o.convert){const x=j.prepare(t,b);if(x){if(s.mainstay.tracer.value(s,"prepare",t,x.value),x.errors)return r.finalize(x.value,[].concat(x.errors),b);t=x.value}}if(j.coerce&&t!==void 0&&o.convert&&(!j.coerce.from||j.coerce.from.includes(typeof t))){const x=j.coerce.method(t,b);if(x){if(s.mainstay.tracer.value(s,"coerced",t,x.value),x.errors)return r.finalize(x.value,[].concat(x.errors),b);t=x.value}}const k=c._flags.empty;k&&k.$_match(r.trim(t,c),s.nest(k),e.defaults)&&(s.mainstay.tracer.value(s,"empty",t,void 0),t=void 0);const f=h.presence||c._flags.presence||(c._flags._endedSwitch?null:o.presence);if(t===void 0){if(f==="forbidden")return r.finalize(t,null,b);if(f==="required")return r.finalize(t,[c.$_createError("any.required",t,null,s,o)],b);if(f==="optional"){if(c._flags.default!==e.symbols.deepDefault)return r.finalize(t,null,b);s.mainstay.tracer.value(s,"default",t,{}),t={}}}else if(f==="forbidden")return r.finalize(t,[c.$_createError("any.unknown",t,null,s,o)],b);const v=[];if(c._valids){const x=c._valids.get(t,s,o,c._flags.insensitive);if(x)return o.convert&&(s.mainstay.tracer.value(s,"valids",t,x.value),t=x.value),s.mainstay.tracer.filter(c,s,"valid",x),r.finalize(t,null,b);if(c._flags.only){const E=c.$_createError("any.only",t,{valids:c._valids.values({display:!0})},s,o);if(o.abortEarly)return r.finalize(t,[E],b);v.push(E)}}if(c._invalids){const x=c._invalids.get(t,s,o,c._flags.insensitive);if(x){s.mainstay.tracer.filter(c,s,"invalid",x);const E=c.$_createError("any.invalid",t,{invalids:c._invalids.values({display:!0})},s,o);if(o.abortEarly)return r.finalize(t,[E],b);v.push(E)}}if(j.validate){const x=j.validate(t,b);if(x&&(s.mainstay.tracer.value(s,"base",t,x.value),t=x.value,x.errors)){if(!Array.isArray(x.errors))return v.push(x.errors),r.finalize(t,v,b);if(x.errors.length)return v.push(...x.errors),r.finalize(t,v,b)}}return c._rules.length?r.rules(t,v,b):r.finalize(t,v,b)},r.rules=function(t,c,s){const{schema:o,state:h,prefs:g}=s;for(const b of o._rules){const j=o._definition.rules[b.method];if(j.convert&&g.convert){h.mainstay.tracer.log(o,h,"rule",b.name,"full");continue}let k,f=b.args;if(b._resolve.length){f=Object.assign({},f);for(const x of b._resolve){const E=j.argsByName.get(x),N=f[x].resolve(t,h,g),M=E.normalize?E.normalize(N):N,n=e.validateArg(M,null,E);if(n){k=o.$_createError("any.ref",N,{arg:x,ref:f[x],reason:n},h,g);break}f[x]=M}}k=k||j.validate(t,s,f,b);const v=r.rule(k,b);if(v.errors){if(h.mainstay.tracer.log(o,h,"rule",b.name,"error"),b.warn){h.mainstay.warnings.push(...v.errors);continue}if(g.abortEarly)return r.finalize(t,v.errors,s);c.push(...v.errors)}else h.mainstay.tracer.log(o,h,"rule",b.name,"pass"),h.mainstay.tracer.value(h,"rule",t,v.value,b.name),t=v.value}return r.finalize(t,c,s)},r.rule=function(t,c){return t instanceof a.Report?(r.error(t,c),{errors:[t],value:null}):Array.isArray(t)&&t[e.symbols.errors]?(t.forEach(s=>r.error(s,c)),{errors:t,value:null}):{errors:null,value:t}},r.error=function(t,c){return c.message&&t._setTemplate(c.message),t},r.finalize=function(t,c,s){c=c||[];const{schema:o,state:h,prefs:g}=s;if(c.length){const j=r.default("failover",void 0,c,s);j!==void 0&&(h.mainstay.tracer.value(h,"failover",t,j),t=j,c=[])}if(c.length&&o._flags.error)if(typeof o._flags.error=="function"){c=o._flags.error(c),Array.isArray(c)||(c=[c]);for(const j of c)l(j instanceof Error||j instanceof a.Report,"error() must return an Error object")}else c=[o._flags.error];if(t===void 0){const j=r.default("default",t,c,s);h.mainstay.tracer.value(h,"default",t,j),t=j}if(o._flags.cast&&t!==void 0){const j=o._definition.cast[o._flags.cast];if(j.from(t)){const k=j.to(t,s);h.mainstay.tracer.value(h,"cast",t,k,o._flags.cast),t=k}}if(o.$_terms.externals&&g.externals&&g._externals!==!1)for(const{method:j}of o.$_terms.externals)h.mainstay.externals.push({method:j,schema:o,state:h,label:a.label(o._flags,h,g)});const b={value:t,errors:c.length?c:null};return o._flags.result&&(b.value=o._flags.result==="strip"?void 0:s.original,h.mainstay.tracer.value(h,o._flags.result,t,b.value),h.shadow(t,o._flags.result)),o._cache&&g.cache!==!1&&!o._refs.length&&o._cache.set(s.original,b),t===void 0||b.errors||o._flags.artifact===void 0||(h.mainstay.artifacts=h.mainstay.artifacts||new Map,h.mainstay.artifacts.has(o._flags.artifact)||h.mainstay.artifacts.set(o._flags.artifact,[]),h.mainstay.artifacts.get(o._flags.artifact).push(h.path)),b},r.prefs=function(t,c){const s=c===e.defaults;return s&&t._preferences[e.symbols.prefs]?t._preferences[e.symbols.prefs]:(c=e.preferences(c,t._preferences),s&&(t._preferences[e.symbols.prefs]=c),c)},r.default=function(t,c,s,o){const{schema:h,state:g,prefs:b}=o,j=h._flags[t];if(b.noDefaults||j===void 0)return c;if(g.mainstay.tracer.log(h,g,"rule",t,"full"),!j)return j;if(typeof j=="function"){const k=j.length?[$(g.ancestors[0]),o]:[];try{return j(...k)}catch(f){return void s.push(h.$_createError(`any.${t}`,null,{error:f},g,b))}}return typeof j!="object"?j:j[e.symbols.literal]?j.literal:e.isResolvable(j)?j.resolve(c,g,b):$(j)},r.trim=function(t,c){if(typeof t!="string")return t;const s=c.$_getRule("trim");return s&&s.args.enabled?t.trim():t},r.ignore={active:!1,debug:y,entry:y,filter:y,log:y,resolve:y,value:y},r.errorsArray=function(){const t=[];return t[e.symbols.errors]=!0,t}},2036:(L,p,w)=>{const l=w(375),$=w(9474),y=w(8160),m={};L.exports=m.Values=class{constructor(e,a){this._values=new Set(e),this._refs=new Set(a),this._lowercase=m.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,a){y.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),a&&a.register(e)):this.has(e,null,null,!1)||(this._values.add(e),typeof e=="string"&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,a,i){if(e=e||new m.Values,a){if(a._override)return a.clone();for(const r of[...a._values,...a._refs])e.add(r)}if(i)for(const r of[...i._values,...i._refs])e.remove(r);return e.length?e:null}remove(e){y.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),typeof e=="string"&&this._lowercase.delete(e.toLowerCase()))}has(e,a,i,r){return!!this.get(e,a,i,r)}get(e,a,i,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if(typeof e=="string"&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&typeof e!="object")return!1;if(typeof e=="object"){for(const t of this._values)if($(t,e))return{value:t}}if(a)for(const t of this._refs){const c=t.resolve(e,a,i,null,{in:!0});if(c===void 0)continue;const s=t.in&&typeof c=="object"?Array.isArray(c)?c:Object.keys(c):[c];for(const o of s)if(typeof o==typeof e){if(r&&e&&typeof e=="string"){if(o.toLowerCase()===e.toLowerCase())return{value:o,ref:t}}else if($(o,e))return{value:o,ref:t}}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const a=[];for(const i of[...this._values,...this._refs])i!==void 0&&a.push(i);return a}return Array.from([...this._values,...this._refs])}clone(){const e=new m.Values(this._values,this._refs);return e._override=this._override,e}concat(e){l(!e._override,"Cannot concat override set of values");const a=new m.Values([...this._values,...e._values],[...this._refs,...e._refs]);return a._override=this._override,a}describe(){const e=[];this._override&&e.push({override:!0});for(const a of this._values.values())e.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())e.push(a.describe());return e}},m.Values.prototype[y.symbols.values]=!0,m.Values.prototype.slice=m.Values.prototype.clone,m.lowercases=function(e){const a=new Map;if(e)for(const i of e)typeof i=="string"&&a.set(i.toLowerCase(),i);return a}},978:(L,p,w)=>{const l=w(375),$=w(8571),y=w(1687),m=w(9621),e={};L.exports=function(a,i,r={}){if(l(a&&typeof a=="object","Invalid defaults value: must be an object"),l(!i||i===!0||typeof i=="object","Invalid source value: must be true, falsy or an object"),l(typeof r=="object","Invalid options: must be an object"),!i)return null;if(r.shallow)return e.applyToDefaultsWithShallow(a,i,r);const t=$(a);if(i===!0)return t;const c=r.nullOverride!==void 0&&r.nullOverride;return y(t,i,{nullOverride:c,mergeArrays:!1})},e.applyToDefaultsWithShallow=function(a,i,r){const t=r.shallow;l(Array.isArray(t),"Invalid keys");const c=new Map,s=i===!0?null:new Set;for(let g of t){g=Array.isArray(g)?g:g.split(".");const b=m(a,g);b&&typeof b=="object"?c.set(b,s&&m(i,g)||b):s&&s.add(g)}const o=$(a,{},c);if(!s)return o;for(const g of s)e.reachCopy(o,i,g);const h=r.nullOverride!==void 0&&r.nullOverride;return y(o,i,{nullOverride:h,mergeArrays:!1})},e.reachCopy=function(a,i,r){for(const s of r){if(!(s in i))return;const o=i[s];if(typeof o!="object"||o===null)return;i=o}const t=i;let c=a;for(let s=0;s<r.length-1;++s){const o=r[s];typeof c[o]!="object"&&(c[o]={}),c=c[o]}c[r[r.length-1]]=t}},375:(L,p,w)=>{const l=w(7916);L.exports=function($,...y){if(!$)throw y.length===1&&y[0]instanceof Error?y[0]:new l(y)}},8571:(L,p,w)=>{const l=w(9621),$=w(4277),y=w(7043),m={needsProtoHack:new Set([$.set,$.map,$.weakSet,$.weakMap])};L.exports=m.clone=function(e,a={},i=null){if(typeof e!="object"||e===null)return e;let r=m.clone,t=i;if(a.shallow){if(a.shallow!==!0)return m.cloneWithShallow(e,a);r=h=>h}else if(t){const h=t.get(e);if(h)return h}else t=new Map;const c=$.getInternalProto(e);if(c===$.buffer)return!1;if(c===$.date)return new Date(e.getTime());if(c===$.regex)return new RegExp(e);const s=m.base(e,c,a);if(s===e)return e;if(t&&t.set(e,s),c===$.set)for(const h of e)s.add(r(h,a,t));else if(c===$.map)for(const[h,g]of e)s.set(h,r(g,a,t));const o=y.keys(e,a);for(const h of o){if(h==="__proto__")continue;if(c===$.array&&h==="length"){s.length=e.length;continue}const g=Object.getOwnPropertyDescriptor(e,h);g?g.get||g.set?Object.defineProperty(s,h,g):g.enumerable?s[h]=r(e[h],a,t):Object.defineProperty(s,h,{enumerable:!1,writable:!0,configurable:!0,value:r(e[h],a,t)}):Object.defineProperty(s,h,{enumerable:!0,writable:!0,configurable:!0,value:r(e[h],a,t)})}return s},m.cloneWithShallow=function(e,a){const i=a.shallow;(a=Object.assign({},a)).shallow=!1;const r=new Map;for(const t of i){const c=l(e,t);typeof c!="object"&&typeof c!="function"||r.set(c,c)}return m.clone(e,a,r)},m.base=function(e,a,i){if(i.prototype===!1)return m.needsProtoHack.has(a)?new a.constructor:a===$.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(a===$.array){const t=[];return r!==a&&Object.setPrototypeOf(t,r),t}if(m.needsProtoHack.has(a)){const t=new r.constructor;return r!==a&&Object.setPrototypeOf(t,r),t}return Object.create(r)}},9474:(L,p,w)=>{const l=w(4277),$={mismatched:null};L.exports=function(y,m,e){return e=Object.assign({prototype:!0},e),!!$.isDeepEqual(y,m,e,[])},$.isDeepEqual=function(y,m,e,a){if(y===m)return y!==0||1/y==1/m;const i=typeof y;if(i!==typeof m||y===null||m===null)return!1;if(i==="function"){if(!e.deepFunction||y.toString()!==m.toString())return!1}else if(i!=="object")return y!=y&&m!=m;const r=$.getSharedType(y,m,!!e.prototype);switch(r){case l.buffer:return!1;case l.promise:return y===m;case l.regex:return y.toString()===m.toString();case $.mismatched:return!1}for(let t=a.length-1;t>=0;--t)if(a[t].isSame(y,m))return!0;a.push(new $.SeenEntry(y,m));try{return!!$.isDeepEqualObj(r,y,m,e,a)}finally{a.pop()}},$.getSharedType=function(y,m,e){if(e)return Object.getPrototypeOf(y)!==Object.getPrototypeOf(m)?$.mismatched:l.getInternalProto(y);const a=l.getInternalProto(y);return a!==l.getInternalProto(m)?$.mismatched:a},$.valueOf=function(y){const m=y.valueOf;if(m===void 0)return y;try{return m.call(y)}catch(e){return e}},$.hasOwnEnumerableProperty=function(y,m){return Object.prototype.propertyIsEnumerable.call(y,m)},$.isSetSimpleEqual=function(y,m){for(const e of Set.prototype.values.call(y))if(!Set.prototype.has.call(m,e))return!1;return!0},$.isDeepEqualObj=function(y,m,e,a,i){const{isDeepEqual:r,valueOf:t,hasOwnEnumerableProperty:c}=$,{keys:s,getOwnPropertySymbols:o}=Object;if(y===l.array){if(!a.part){if(m.length!==e.length)return!1;for(let k=0;k<m.length;++k)if(!r(m[k],e[k],a,i))return!1;return!0}for(const k of m)for(const f of e)if(r(k,f,a,i))return!0}else if(y===l.set){if(m.size!==e.size)return!1;if(!$.isSetSimpleEqual(m,e)){const k=new Set(Set.prototype.values.call(e));for(const f of Set.prototype.values.call(m)){if(k.delete(f))continue;let v=!1;for(const x of k)if(r(f,x,a,i)){k.delete(x),v=!0;break}if(!v)return!1}}}else if(y===l.map){if(m.size!==e.size)return!1;for(const[k,f]of Map.prototype.entries.call(m))if(f===void 0&&!Map.prototype.has.call(e,k)||!r(f,Map.prototype.get.call(e,k),a,i))return!1}else if(y===l.error&&(m.name!==e.name||m.message!==e.message))return!1;const h=t(m),g=t(e);if((m!==h||e!==g)&&!r(h,g,a,i))return!1;const b=s(m);if(!a.part&&b.length!==s(e).length&&!a.skip)return!1;let j=0;for(const k of b)if(a.skip&&a.skip.includes(k))e[k]===void 0&&++j;else if(!c(e,k)||!r(m[k],e[k],a,i))return!1;if(!a.part&&b.length-j!==s(e).length)return!1;if(a.symbols!==!1){const k=o(m),f=new Set(o(e));for(const v of k){if(!a.skip||!a.skip.includes(v)){if(c(m,v)){if(!c(e,v)||!r(m[v],e[v],a,i))return!1}else if(c(e,v))return!1}f.delete(v)}for(const v of f)if(c(e,v))return!1}return!0},$.SeenEntry=class{constructor(y,m){this.obj=y,this.ref=m}isSame(y,m){return this.obj===y&&this.ref===m}}},7916:(L,p,w)=>{const l=w(8761);L.exports=class extends Error{constructor($){super($.filter(y=>y!=="").map(y=>typeof y=="string"?y:y instanceof Error?y.message:l(y)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,p.assert)}}},5277:L=>{const p={};L.exports=function(w){if(!w)return"";let l="";for(let $=0;$<w.length;++$){const y=w.charCodeAt($);p.isSafe(y)?l+=w[$]:l+=p.escapeHtmlChar(y)}return l},p.escapeHtmlChar=function(w){return p.namedHtml.get(w)||(w>=256?"&#"+w+";":`&#x${w.toString(16).padStart(2,"0")};`)},p.isSafe=function(w){return p.safeCharCodes.has(w)},p.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),p.safeCharCodes=function(){const w=new Set;for(let l=32;l<123;++l)(l>=97||l>=65&&l<=90||l>=48&&l<=57||l===32||l===46||l===44||l===45||l===58||l===95)&&w.add(l);return w}()},6064:L=>{L.exports=function(p){return p.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:L=>{L.exports=function(){}},1687:(L,p,w)=>{const l=w(375),$=w(8571),y=w(7043),m={};L.exports=m.merge=function(e,a,i){if(l(e&&typeof e=="object","Invalid target value: must be an object"),l(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return e;if(i=Object.assign({nullOverride:!0,mergeArrays:!0},i),Array.isArray(a)){l(Array.isArray(e),"Cannot merge array onto an object"),i.mergeArrays||(e.length=0);for(let t=0;t<a.length;++t)e.push($(a[t],{symbols:i.symbols}));return e}const r=y.keys(a,i);for(let t=0;t<r.length;++t){const c=r[t];if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,c))continue;const s=a[c];if(s&&typeof s=="object"){if(e[c]===s)continue;!e[c]||typeof e[c]!="object"||Array.isArray(e[c])!==Array.isArray(s)||s instanceof Date||s instanceof RegExp?e[c]=$(s,{symbols:i.symbols}):m.merge(e[c],s,i)}else(s!=null||i.nullOverride)&&(e[c]=s)}return e}},9621:(L,p,w)=>{const l=w(375),$={};L.exports=function(y,m,e){if(m===!1||m==null)return y;typeof(e=e||{})=="string"&&(e={separator:e});const a=Array.isArray(m);l(!a||!e.separator,"Separator option is not valid for array-based chain");const i=a?m:m.split(e.separator||".");let r=y;for(let t=0;t<i.length;++t){let c=i[t];const s=e.iterables&&$.iterables(r);if(Array.isArray(r)||s==="set"){const o=Number(c);Number.isInteger(o)&&(c=o<0?r.length+o:o)}if(!r||typeof r=="function"&&e.functions===!1||!s&&r[c]===void 0){l(!e.strict||t+1===i.length,"Missing segment",c,"in reach path ",m),l(typeof r=="object"||e.functions===!0||typeof r!="function","Invalid segment",c,"in reach path ",m),r=e.default;break}r=s?s==="set"?[...r][c]:r.get(c):r[c]}return r},$.iterables=function(y){return y instanceof Set?"set":y instanceof Map?"map":void 0}},8761:L=>{L.exports=function(...p){try{return JSON.stringify(...p)}catch(w){return"[Cannot display object: "+w.message+"]"}}},4277:(L,p)=>{const w={};p=L.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},w.typeMap=new Map([["[object Error]",p.error],["[object Map]",p.map],["[object Promise]",p.promise],["[object Set]",p.set],["[object WeakMap]",p.weakMap],["[object WeakSet]",p.weakSet]]),p.getInternalProto=function(l){if(Array.isArray(l))return p.array;if(l instanceof Date)return p.date;if(l instanceof RegExp)return p.regex;if(l instanceof Error)return p.error;const $=Object.prototype.toString.call(l);return w.typeMap.get($)||p.generic}},7043:(L,p)=>{p.keys=function(w,l={}){return l.symbols!==!1?Reflect.ownKeys(w):Object.getOwnPropertyNames(w)}},3652:(L,p,w)=>{const l=w(375),$={};p.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(y,m){const e=[].concat((m=m||{}).before||[]),a=[].concat(m.after||[]),i=m.group||"?",r=m.sort||0;l(!e.includes(i),`Item cannot come before itself: ${i}`),l(!e.includes("?"),"Item cannot come before unassociated items"),l(!a.includes(i),`Item cannot come after itself: ${i}`),l(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(y)||(y=[y]);for(const t of y){const c={seq:this._items.length,sort:r,before:e,after:a,group:i,node:t};this._items.push(c)}if(!m.manual){const t=this._sort();l(t,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(y){Array.isArray(y)||(y=[y]);for(const e of y)if(e)for(const a of e._items)this._items.push(Object.assign({},a));this._items.sort($.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const m=this._sort();return l(m,"merge created a dependencies error"),this.nodes}sort(){const y=this._sort();return l(y,"sort created a dependencies error"),this.nodes}_sort(){const y={},m=Object.create(null),e=Object.create(null);for(const c of this._items){const s=c.seq,o=c.group;e[o]=e[o]||[],e[o].push(s),y[s]=c.before;for(const h of c.after)m[h]=m[h]||[],m[h].push(s)}for(const c in y){const s=[];for(const o in y[c]){const h=y[c][o];e[h]=e[h]||[],s.push(...e[h])}y[c]=s}for(const c in m)if(e[c])for(const s of e[c])y[s].push(...m[c]);const a={};for(const c in y){const s=y[c];for(const o of s)a[o]=a[o]||[],a[o].push(c)}const i={},r=[];for(let c=0;c<this._items.length;++c){let s=c;if(a[c]){s=null;for(let o=0;o<this._items.length;++o){if(i[o]===!0)continue;a[o]||(a[o]=[]);const h=a[o].length;let g=0;for(let b=0;b<h;++b)i[a[o][b]]&&++g;if(g===h){s=o;break}}}s!==null&&(i[s]=!0,r.push(s))}if(r.length!==this._items.length)return!1;const t={};for(const c of this._items)t[c.seq]=c;this._items=[],this.nodes=[];for(const c of r){const s=t[c];this.nodes.push(s.node),this._items.push(s)}return!0}},$.mergeSort=(y,m)=>y.sort===m.sort?0:y.sort<m.sort?-1:1},5380:(L,p,w)=>{const l=w(443),$=w(2178),y={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:l.URL||URL};p.analyze=function(m,e={}){if(!m)return $.code("DOMAIN_NON_EMPTY_STRING");if(typeof m!="string")throw new Error("Invalid input: domain must be a string");if(m.length>256)return $.code("DOMAIN_TOO_LONG");if(y.nonAsciiRx.test(m)){if(e.allowUnicode===!1)return $.code("DOMAIN_INVALID_UNICODE_CHARS");m=m.normalize("NFC")}if(y.domainControlRx.test(m))return $.code("DOMAIN_INVALID_CHARS");m=y.punycode(m),e.allowFullyQualified&&m[m.length-1]==="."&&(m=m.slice(0,-1));const a=e.minDomainSegments||y.minDomainSegments,i=m.split(".");if(i.length<a)return $.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return $.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=e.tlds;if(r){const t=i[i.length-1].toLowerCase();if(r.deny&&r.deny.has(t)||r.allow&&!r.allow.has(t))return $.code("DOMAIN_FORBIDDEN_TLDS")}for(let t=0;t<i.length;++t){const c=i[t];if(!c.length)return $.code("DOMAIN_EMPTY_SEGMENT");if(c.length>63)return $.code("DOMAIN_LONG_SEGMENT");if(t<i.length-1){if(!y.domainSegmentRx.test(c))return $.code("DOMAIN_INVALID_CHARS")}else if(!y.tldSegmentRx.test(c))return $.code("DOMAIN_INVALID_TLDS_CHARS")}return null},p.isValid=function(m,e){return!p.analyze(m,e)},y.punycode=function(m){m.includes("%")&&(m=m.replace(/%/g,"%25"));try{return new y.URL(`http://${m}`).host}catch{return m}}},1745:(L,p,w)=>{const l=w(9848),$=w(5380),y=w(2178),m={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(l.TextEncoder||TextEncoder)};p.analyze=function(e,a){return m.email(e,a)},p.isValid=function(e,a){return!m.email(e,a)},m.email=function(e,a={}){if(typeof e!="string")throw new Error("Invalid input: email must be a string");if(!e)return y.code("EMPTY_STRING");const i=!m.nonAsciiRx.test(e);if(!i){if(a.allowUnicode===!1)return y.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(r.length!==2)return r.length>2?y.code("MULTIPLE_AT_CHAR"):y.code("MISSING_AT_CHAR");const[t,c]=r;if(!t)return y.code("EMPTY_LOCAL");if(!a.ignoreLength){if(e.length>254)return y.code("ADDRESS_TOO_LONG");if(m.encoder.encode(t).length>64)return y.code("LOCAL_TOO_LONG")}return m.local(t,i)||$.analyze(c,a)},m.local=function(e,a){const i=e.split(".");for(const r of i){if(!r.length)return y.code("EMPTY_LOCAL_SEGMENT");if(a){if(!m.atextRx.test(r))return y.code("INVALID_LOCAL_CHARS")}else for(const t of r){if(m.atextRx.test(t))continue;const c=m.binary(t);if(!m.atomRx.test(c))return y.code("INVALID_LOCAL_CHARS")}}},m.binary=function(e){return Array.from(m.encoder.encode(e)).map(a=>String.fromCharCode(a)).join("")},m.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,m.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:(L,p)=>{p.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"},p.code=function(w){return{code:w,error:p.codes[w]}}},9959:(L,p,w)=>{const l=w(375),$=w(5752);p.regex=function(y={}){l(y.cidr===void 0||typeof y.cidr=="string","options.cidr must be a string");const m=y.cidr?y.cidr.toLowerCase():"optional";l(["required","optional","forbidden"].includes(m),"options.cidr must be one of required, optional, forbidden"),l(y.version===void 0||typeof y.version=="string"||Array.isArray(y.version),"options.version must be a string or an array of string");let e=y.version||["ipv4","ipv6","ipvfuture"];Array.isArray(e)||(e=[e]),l(e.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<e.length;++r)l(typeof e[r]=="string","options.version must only contain strings"),e[r]=e[r].toLowerCase(),l(["ipv4","ipv6","ipvfuture"].includes(e[r]),"options.version contains unknown version "+e[r]+" - must be one of ipv4, ipv6, ipvfuture");e=Array.from(new Set(e));const a=`(?:${e.map(r=>{if(m==="forbidden")return $.ip[r];const t=`\\/${r==="ipv4"?$.ip.v4Cidr:$.ip.v6Cidr}`;return m==="required"?`${$.ip[r]}${t}`:`${$.ip[r]}(?:${t})?`}).join("|")})`,i=new RegExp(`^${a}$`);return{cidr:m,versions:e,regex:i,raw:a}}},5752:(L,p,w)=>{const l=w(375),$=w(6064),y={generate:function(){const m={},e="\\dA-Fa-f",a="["+e+"]",i="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",t="%"+e,c=i+t+r+":@",s="["+c+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";m.ipv4address="(?:"+o+"\\.){3}"+o;const h=a+"{1,4}",g="(?:"+h+":"+h+"|"+m.ipv4address+")",b="(?:"+h+":){6}"+g,j="::(?:"+h+":){5}"+g,k="(?:"+h+")?::(?:"+h+":){4}"+g,f="(?:(?:"+h+":){0,1}"+h+")?::(?:"+h+":){3}"+g,v="(?:(?:"+h+":){0,2}"+h+")?::(?:"+h+":){2}"+g,x="(?:(?:"+h+":){0,3}"+h+")?::"+h+":"+g,E="(?:(?:"+h+":){0,4}"+h+")?::"+g,N="(?:(?:"+h+":){0,5}"+h+")?::"+h,M="(?:(?:"+h+":){0,6}"+h+")?::";m.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",m.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",m.ipv6address="(?:"+b+"|"+j+"|"+k+"|"+f+"|"+v+"|"+x+"|"+E+"|"+N+"|"+M+")",m.ipvFuture="v"+a+"+\\.["+i+r+":]+",m.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",m.schemeRegex=new RegExp(m.scheme);const n="["+i+t+r+":]*",d="["+i+t+r+"]{1,255}",_="(?:\\[(?:"+m.ipv6address+"|"+m.ipvFuture+")\\]|"+m.ipv4address+"|"+d+")",R="(?:"+n+"@)?"+_+"(?::\\d*)?",O="(?:"+n+"@)?("+_+")(?::\\d*)?",D=s+"*",C=s+"+",S="(?:\\/"+D+")*",u="\\/(?:"+C+S+")?",A=C+S,z="["+i+t+r+"@]+"+S,F="(?:\\/\\/\\/"+D+S+")";return m.hierPart="(?:(?:\\/\\/"+R+S+")|"+u+"|"+A+"|"+F+")",m.hierPartCapture="(?:(?:\\/\\/"+O+S+")|"+u+"|"+A+")",m.relativeRef="(?:(?:\\/\\/"+R+S+")|"+u+"|"+z+"|)",m.relativeRefCapture="(?:(?:\\/\\/"+O+S+")|"+u+"|"+z+"|)",m.query="["+c+"\\/\\?]*(?=#|$)",m.queryWithSquareBrackets="["+c+"\\[\\]\\/\\?]*(?=#|$)",m.fragment="["+c+"\\/\\?]*",m}};y.rfc3986=y.generate(),p.ip={v4Cidr:y.rfc3986.ipv4Cidr,v6Cidr:y.rfc3986.ipv6Cidr,ipv4:y.rfc3986.ipv4address,ipv6:y.rfc3986.ipv6address,ipvfuture:y.rfc3986.ipvFuture},y.createRegex=function(m){const e=y.rfc3986,a="(?:\\?"+(m.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=m.domain?e.relativeRefCapture:e.relativeRef;if(m.relativeOnly)return y.wrap(i+a);let r="";if(m.scheme){l(m.scheme instanceof RegExp||typeof m.scheme=="string"||Array.isArray(m.scheme),"scheme must be a RegExp, String, or Array");const s=[].concat(m.scheme);l(s.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let h=0;h<s.length;++h){const g=s[h];l(g instanceof RegExp||typeof g=="string","scheme at position "+h+" must be a RegExp or String"),g instanceof RegExp?o.push(g.source.toString()):(l(e.schemeRegex.test(g),"scheme at position "+h+" must be a valid scheme"),o.push($(g)))}r=o.join("|")}const t="(?:"+(r?"(?:"+r+")":e.scheme)+":"+(m.domain?e.hierPartCapture:e.hierPart)+")",c=m.allowRelative?"(?:"+t+"|"+i+")":t;return y.wrap(c+a,r)},y.wrap=function(m,e){return{raw:m=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${m}`,regex:new RegExp(`^${m}$`),scheme:e}},y.uriRegex=y.createRegex({}),p.regex=function(m={}){return m.scheme||m.allowRelative||m.relativeOnly||m.allowQuerySquareBrackets||m.domain?y.createRegex(m):y.uriRegex}},1447:(L,p)=>{const w={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};p.Parser=class{constructor(l,$={}){if(!$[w.settings]&&$.constants)for(const y in $.constants){const m=$.constants[y];if(m!==null&&!["boolean","number","string"].includes(typeof m))throw new Error(`Formula constant ${y} contains invalid ${typeof m} value type`)}this.settings=$[w.settings]?$:Object.assign({[w.settings]:!0,constants:{},functions:{}},$),this.single=null,this._parts=null,this._parse(l)}_parse(l){let $=[],y="",m=0,e=!1;const a=r=>{if(m)throw new Error("Formula missing closing parenthesis");const t=$.length?$[$.length-1]:null;if(e||y||r){if(t&&t.type==="reference"&&r===")")return t.type="function",t.value=this._subFormula(y,t.value),void(y="");if(r===")"){const c=new p.Parser(y,this.settings);$.push({type:"segment",value:c})}else if(e){if(e==="]")return $.push({type:"reference",value:y}),void(y="");$.push({type:"literal",value:y})}else if(w.operatorCharacters.includes(y))t&&t.type==="operator"&&w.operators.includes(t.value+y)?t.value+=y:$.push({type:"operator",value:y});else if(y.match(w.numberRx))$.push({type:"constant",value:parseFloat(y)});else if(this.settings.constants[y]!==void 0)$.push({type:"constant",value:this.settings.constants[y]});else{if(!y.match(w.tokenRx))throw new Error(`Formula contains invalid token: ${y}`);$.push({type:"reference",value:y})}y=""}};for(const r of l)e?r===e?(a(),e=!1):y+=r:m?r==="("?(y+=r,++m):r===")"?(--m,m?y+=r:a(r)):y+=r:r in w.literals?e=w.literals[r]:r==="("?(a(),++m):w.operatorCharacters.includes(r)?(a(),y=r,a()):r!==" "?y+=r:a();a(),$=$.map((r,t)=>r.type!=="operator"||r.value!=="-"||t&&$[t-1].type!=="operator"?r:{type:"operator",value:"n"});let i=!1;for(const r of $){if(r.type==="operator"){if(w.operatorsPrefix.includes(r.value))continue;if(!i)throw new Error("Formula contains an operator in invalid position");if(!w.operators.includes(r.value))throw new Error(`Formula contains an unknown operator ${r.value}`)}else if(i)throw new Error("Formula missing expected operator");i=!i}if(!i)throw new Error("Formula contains invalid trailing operator");$.length===1&&["reference","literal","constant"].includes($[0].type)&&(this.single={type:$[0].type==="reference"?"reference":"value",value:$[0].value}),this._parts=$.map(r=>{if(r.type==="operator")return w.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):w.reference(r.value)})}_subFormula(l,$){const y=this.settings.functions[$];if(typeof y!="function")throw new Error(`Formula contains unknown function ${$}`);let m=[];if(l){let e="",a=0,i=!1;const r=()=>{if(!e)throw new Error(`Formula contains function ${$} with invalid arguments ${l}`);m.push(e),e=""};for(let t=0;t<l.length;++t){const c=l[t];i?(e+=c,c===i&&(i=!1)):c in w.literals&&!a?(e+=c,i=w.literals[c]):c!==","||a?(e+=c,c==="("?++a:c===")"&&--a):r()}r()}return m=m.map(e=>new p.Parser(e,this.settings)),function(e){const a=[];for(const i of m)a.push(i.evaluate(e));return y.call(e,...a)}}evaluate(l){const $=this._parts.slice();for(let y=$.length-2;y>=0;--y){const m=$[y];if(m&&m.type==="operator"){const e=$[y+1];$.splice(y+1,1);const a=w.evaluate(e,l);$[y]=w.single(m.value,a)}}return w.operatorsOrder.forEach(y=>{for(let m=1;m<$.length-1;)if(y.includes($[m])){const e=$[m],a=w.evaluate($[m-1],l),i=w.evaluate($[m+1],l);$.splice(m,2);const r=w.calculate(e,a,i);$[m-1]=r===0?0:r}else m+=2}),w.evaluate($[0],l)}},p.Parser.prototype[w.symbol]=!0,w.reference=function(l){return function($){return $&&$[l]!==void 0?$[l]:null}},w.evaluate=function(l,$){return l===null?null:typeof l=="function"?l($):l[w.symbol]?l.evaluate($):l},w.single=function(l,$){if(l==="!")return!$;const y=-$;return y===0?0:y},w.calculate=function(l,$,y){if(l==="??")return w.exists($)?$:y;if(typeof $=="string"||typeof y=="string"){if(l==="+")return($=w.exists($)?$:"")+(w.exists(y)?y:"")}else switch(l){case"^":return Math.pow($,y);case"*":return $*y;case"/":return $/y;case"%":return $%y;case"+":return $+y;case"-":return $-y}switch(l){case"<":return $<y;case"<=":return $<=y;case">":return $>y;case">=":return $>=y;case"==":return $===y;case"!=":return $!==y;case"&&":return $&&y;case"||":return $||y}return null},w.exists=function(l){return l!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:L=>{L.exports=JSON.parse('{"version":"17.13.3"}')}},T={},function L(p){var w=T[p];if(w!==void 0)return w.exports;var l=T[p]={exports:{}};return B[p](l,l.exports,L),l.exports}(5107);var B,T})})(fr);var Zr=fr.exports,At={},Ot={exports:{}};Ot.exports;(function(I){(function(P,B){function T(M,n){if(!M)throw new Error(n||"Assertion failed")}function L(M,n){M.super_=n;var d=function(){};d.prototype=n.prototype,M.prototype=new d,M.prototype.constructor=M}function p(M,n,d){if(p.isBN(M))return M;this.negative=0,this.words=null,this.length=0,this.red=null,M!==null&&((n==="le"||n==="be")&&(d=n,n=10),this._init(M||0,n||10,d||"be"))}typeof P=="object"?P.exports=p:B.BN=p,p.BN=p,p.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=Cr.Buffer}catch{}p.isBN=function(n){return n instanceof p?!0:n!==null&&typeof n=="object"&&n.constructor.wordSize===p.wordSize&&Array.isArray(n.words)},p.max=function(n,d){return n.cmp(d)>0?n:d},p.min=function(n,d){return n.cmp(d)<0?n:d},p.prototype._init=function(n,d,_){if(typeof n=="number")return this._initNumber(n,d,_);if(typeof n=="object")return this._initArray(n,d,_);d==="hex"&&(d=16),T(d===(d|0)&&d>=2&&d<=36),n=n.toString().replace(/\s+/g,"");var R=0;n[0]==="-"&&(R++,this.negative=1),R<n.length&&(d===16?this._parseHex(n,R,_):(this._parseBase(n,d,R),_==="le"&&this._initArray(this.toArray(),d,_)))},p.prototype._initNumber=function(n,d,_){n<0&&(this.negative=1,n=-n),n<67108864?(this.words=[n&67108863],this.length=1):n<4503599627370496?(this.words=[n&67108863,n/67108864&67108863],this.length=2):(T(n<9007199254740992),this.words=[n&67108863,n/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),d,_)},p.prototype._initArray=function(n,d,_){if(T(typeof n.length=="number"),n.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(n.length/3),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var O,D,C=0;if(_==="be")for(R=n.length-1,O=0;R>=0;R-=3)D=n[R]|n[R-1]<<8|n[R-2]<<16,this.words[O]|=D<<C&67108863,this.words[O+1]=D>>>26-C&67108863,C+=24,C>=26&&(C-=26,O++);else if(_==="le")for(R=0,O=0;R<n.length;R+=3)D=n[R]|n[R+1]<<8|n[R+2]<<16,this.words[O]|=D<<C&67108863,this.words[O+1]=D>>>26-C&67108863,C+=24,C>=26&&(C-=26,O++);return this._strip()};function l(M,n){var d=M.charCodeAt(n);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;T(!1,"Invalid character in "+M)}function $(M,n,d){var _=l(M,d);return d-1>=n&&(_|=l(M,d-1)<<4),_}p.prototype._parseHex=function(n,d,_){this.length=Math.ceil((n.length-d)/6),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var O=0,D=0,C;if(_==="be")for(R=n.length-1;R>=d;R-=2)C=$(n,d,R)<<O,this.words[D]|=C&67108863,O>=18?(O-=18,D+=1,this.words[D]|=C>>>26):O+=8;else{var S=n.length-d;for(R=S%2===0?d+1:d;R<n.length;R+=2)C=$(n,d,R)<<O,this.words[D]|=C&67108863,O>=18?(O-=18,D+=1,this.words[D]|=C>>>26):O+=8}this._strip()};function y(M,n,d,_){for(var R=0,O=0,D=Math.min(M.length,d),C=n;C<D;C++){var S=M.charCodeAt(C)-48;R*=_,S>=49?O=S-49+10:S>=17?O=S-17+10:O=S,T(S>=0&&O<_,"Invalid character"),R+=O}return R}p.prototype._parseBase=function(n,d,_){this.words=[0],this.length=1;for(var R=0,O=1;O<=67108863;O*=d)R++;R--,O=O/d|0;for(var D=n.length-_,C=D%R,S=Math.min(D,D-C)+_,u=0,A=_;A<S;A+=R)u=y(n,A,A+R,d),this.imuln(O),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(C!==0){var z=1;for(u=y(n,A,n.length,d),A=0;A<C;A++)z*=d;this.imuln(z),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},p.prototype.copy=function(n){n.words=new Array(this.length);for(var d=0;d<this.length;d++)n.words[d]=this.words[d];n.length=this.length,n.negative=this.negative,n.red=this.red};function m(M,n){M.words=n.words,M.length=n.length,M.negative=n.negative,M.red=n.red}if(p.prototype._move=function(n){m(n,this)},p.prototype.clone=function(){var n=new p(null);return this.copy(n),n},p.prototype._expand=function(n){for(;this.length<n;)this.words[this.length++]=0;return this},p.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},p.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{p.prototype[Symbol.for("nodejs.util.inspect.custom")]=e}catch{p.prototype.inspect=e}else p.prototype.inspect=e;function e(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],i=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],r=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];p.prototype.toString=function(n,d){n=n||10,d=d|0||1;var _;if(n===16||n==="hex"){_="";for(var R=0,O=0,D=0;D<this.length;D++){var C=this.words[D],S=((C<<R|O)&16777215).toString(16);O=C>>>24-R&16777215,R+=2,R>=26&&(R-=26,D--),O!==0||D!==this.length-1?_=a[6-S.length]+S+_:_=S+_}for(O!==0&&(_=O.toString(16)+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(n===(n|0)&&n>=2&&n<=36){var u=i[n],A=r[n];_="";var z=this.clone();for(z.negative=0;!z.isZero();){var F=z.modrn(A).toString(n);z=z.idivn(A),z.isZero()?_=F+_:_=a[u-F.length]+F+_}for(this.isZero()&&(_="0"+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}T(!1,"Base should be between 2 and 36")},p.prototype.toNumber=function(){var n=this.words[0];return this.length===2?n+=this.words[1]*67108864:this.length===3&&this.words[2]===1?n+=4503599627370496+this.words[1]*67108864:this.length>2&&T(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-n:n},p.prototype.toJSON=function(){return this.toString(16,2)},w&&(p.prototype.toBuffer=function(n,d){return this.toArrayLike(w,n,d)}),p.prototype.toArray=function(n,d){return this.toArrayLike(Array,n,d)};var t=function(n,d){return n.allocUnsafe?n.allocUnsafe(d):new n(d)};p.prototype.toArrayLike=function(n,d,_){this._strip();var R=this.byteLength(),O=_||Math.max(1,R);T(R<=O,"byte array longer than desired length"),T(O>0,"Requested array length <= 0");var D=t(n,O),C=d==="le"?"LE":"BE";return this["_toArrayLike"+C](D,R),D},p.prototype._toArrayLikeLE=function(n,d){for(var _=0,R=0,O=0,D=0;O<this.length;O++){var C=this.words[O]<<D|R;n[_++]=C&255,_<n.length&&(n[_++]=C>>8&255),_<n.length&&(n[_++]=C>>16&255),D===6?(_<n.length&&(n[_++]=C>>24&255),R=0,D=0):(R=C>>>24,D+=2)}if(_<n.length)for(n[_++]=R;_<n.length;)n[_++]=0},p.prototype._toArrayLikeBE=function(n,d){for(var _=n.length-1,R=0,O=0,D=0;O<this.length;O++){var C=this.words[O]<<D|R;n[_--]=C&255,_>=0&&(n[_--]=C>>8&255),_>=0&&(n[_--]=C>>16&255),D===6?(_>=0&&(n[_--]=C>>24&255),R=0,D=0):(R=C>>>24,D+=2)}if(_>=0)for(n[_--]=R;_>=0;)n[_--]=0},Math.clz32?p.prototype._countBits=function(n){return 32-Math.clz32(n)}:p.prototype._countBits=function(n){var d=n,_=0;return d>=4096&&(_+=13,d>>>=13),d>=64&&(_+=7,d>>>=7),d>=8&&(_+=4,d>>>=4),d>=2&&(_+=2,d>>>=2),_+d},p.prototype._zeroBits=function(n){if(n===0)return 26;var d=n,_=0;return d&8191||(_+=13,d>>>=13),d&127||(_+=7,d>>>=7),d&15||(_+=4,d>>>=4),d&3||(_+=2,d>>>=2),d&1||_++,_},p.prototype.bitLength=function(){var n=this.words[this.length-1],d=this._countBits(n);return(this.length-1)*26+d};function c(M){for(var n=new Array(M.bitLength()),d=0;d<n.length;d++){var _=d/26|0,R=d%26;n[d]=M.words[_]>>>R&1}return n}p.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,d=0;d<this.length;d++){var _=this._zeroBits(this.words[d]);if(n+=_,_!==26)break}return n},p.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},p.prototype.toTwos=function(n){return this.negative!==0?this.abs().inotn(n).iaddn(1):this.clone()},p.prototype.fromTwos=function(n){return this.testn(n-1)?this.notn(n).iaddn(1).ineg():this.clone()},p.prototype.isNeg=function(){return this.negative!==0},p.prototype.neg=function(){return this.clone().ineg()},p.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},p.prototype.iuor=function(n){for(;this.length<n.length;)this.words[this.length++]=0;for(var d=0;d<n.length;d++)this.words[d]=this.words[d]|n.words[d];return this._strip()},p.prototype.ior=function(n){return T((this.negative|n.negative)===0),this.iuor(n)},p.prototype.or=function(n){return this.length>n.length?this.clone().ior(n):n.clone().ior(this)},p.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},p.prototype.iuand=function(n){var d;this.length>n.length?d=n:d=this;for(var _=0;_<d.length;_++)this.words[_]=this.words[_]&n.words[_];return this.length=d.length,this._strip()},p.prototype.iand=function(n){return T((this.negative|n.negative)===0),this.iuand(n)},p.prototype.and=function(n){return this.length>n.length?this.clone().iand(n):n.clone().iand(this)},p.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},p.prototype.iuxor=function(n){var d,_;this.length>n.length?(d=this,_=n):(d=n,_=this);for(var R=0;R<_.length;R++)this.words[R]=d.words[R]^_.words[R];if(this!==d)for(;R<d.length;R++)this.words[R]=d.words[R];return this.length=d.length,this._strip()},p.prototype.ixor=function(n){return T((this.negative|n.negative)===0),this.iuxor(n)},p.prototype.xor=function(n){return this.length>n.length?this.clone().ixor(n):n.clone().ixor(this)},p.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},p.prototype.inotn=function(n){T(typeof n=="number"&&n>=0);var d=Math.ceil(n/26)|0,_=n%26;this._expand(d),_>0&&d--;for(var R=0;R<d;R++)this.words[R]=~this.words[R]&67108863;return _>0&&(this.words[R]=~this.words[R]&67108863>>26-_),this._strip()},p.prototype.notn=function(n){return this.clone().inotn(n)},p.prototype.setn=function(n,d){T(typeof n=="number"&&n>=0);var _=n/26|0,R=n%26;return this._expand(_+1),d?this.words[_]=this.words[_]|1<<R:this.words[_]=this.words[_]&~(1<<R),this._strip()},p.prototype.iadd=function(n){var d;if(this.negative!==0&&n.negative===0)return this.negative=0,d=this.isub(n),this.negative^=1,this._normSign();if(this.negative===0&&n.negative!==0)return n.negative=0,d=this.isub(n),n.negative=1,d._normSign();var _,R;this.length>n.length?(_=this,R=n):(_=n,R=this);for(var O=0,D=0;D<R.length;D++)d=(_.words[D]|0)+(R.words[D]|0)+O,this.words[D]=d&67108863,O=d>>>26;for(;O!==0&&D<_.length;D++)d=(_.words[D]|0)+O,this.words[D]=d&67108863,O=d>>>26;if(this.length=_.length,O!==0)this.words[this.length]=O,this.length++;else if(_!==this)for(;D<_.length;D++)this.words[D]=_.words[D];return this},p.prototype.add=function(n){var d;return n.negative!==0&&this.negative===0?(n.negative=0,d=this.sub(n),n.negative^=1,d):n.negative===0&&this.negative!==0?(this.negative=0,d=n.sub(this),this.negative=1,d):this.length>n.length?this.clone().iadd(n):n.clone().iadd(this)},p.prototype.isub=function(n){if(n.negative!==0){n.negative=0;var d=this.iadd(n);return n.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var _=this.cmp(n);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var R,O;_>0?(R=this,O=n):(R=n,O=this);for(var D=0,C=0;C<O.length;C++)d=(R.words[C]|0)-(O.words[C]|0)+D,D=d>>26,this.words[C]=d&67108863;for(;D!==0&&C<R.length;C++)d=(R.words[C]|0)+D,D=d>>26,this.words[C]=d&67108863;if(D===0&&C<R.length&&R!==this)for(;C<R.length;C++)this.words[C]=R.words[C];return this.length=Math.max(this.length,C),R!==this&&(this.negative=1),this._strip()},p.prototype.sub=function(n){return this.clone().isub(n)};function s(M,n,d){d.negative=n.negative^M.negative;var _=M.length+n.length|0;d.length=_,_=_-1|0;var R=M.words[0]|0,O=n.words[0]|0,D=R*O,C=D&67108863,S=D/67108864|0;d.words[0]=C;for(var u=1;u<_;u++){for(var A=S>>>26,z=S&67108863,F=Math.min(u,n.length-1),J=Math.max(0,u-M.length+1);J<=F;J++){var W=u-J|0;R=M.words[W]|0,O=n.words[J]|0,D=R*O+z,A+=D/67108864|0,z=D&67108863}d.words[u]=z|0,S=A|0}return S!==0?d.words[u]=S|0:d.length--,d._strip()}var o=function(n,d,_){var R=n.words,O=d.words,D=_.words,C=0,S,u,A,z=R[0]|0,F=z&8191,J=z>>>13,W=R[1]|0,V=W&8191,K=W>>>13,Ct=R[2]|0,Z=Ct&8191,H=Ct>>>13,It=R[3]|0,G=It&8191,Y=It>>>13,Tt=R[4]|0,Q=Tt&8191,X=Tt>>>13,Lt=R[5]|0,ee=Lt&8191,te=Lt>>>13,qt=R[6]|0,re=qt&8191,se=qt>>>13,Nt=R[7]|0,ne=Nt&8191,ie=Nt>>>13,Pt=R[8]|0,ae=Pt&8191,oe=Pt>>>13,zt=R[9]|0,le=zt&8191,ce=zt>>>13,Ft=O[0]|0,ue=Ft&8191,fe=Ft>>>13,Bt=O[1]|0,he=Bt&8191,de=Bt>>>13,Jt=O[2]|0,me=Jt&8191,pe=Jt>>>13,Ut=O[3]|0,ge=Ut&8191,ve=Ut>>>13,Vt=O[4]|0,ye=Vt&8191,be=Vt>>>13,Kt=O[5]|0,_e=Kt&8191,we=Kt>>>13,Wt=O[6]|0,xe=Wt&8191,Me=Wt>>>13,Zt=O[7]|0,$e=Zt&8191,ke=Zt>>>13,Ht=O[8]|0,je=Ht&8191,Se=Ht>>>13,Gt=O[9]|0,Re=Gt&8191,Ae=Gt>>>13;_.negative=n.negative^d.negative,_.length=19,S=Math.imul(F,ue),u=Math.imul(F,fe),u=u+Math.imul(J,ue)|0,A=Math.imul(J,fe);var Ye=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,S=Math.imul(V,ue),u=Math.imul(V,fe),u=u+Math.imul(K,ue)|0,A=Math.imul(K,fe),S=S+Math.imul(F,he)|0,u=u+Math.imul(F,de)|0,u=u+Math.imul(J,he)|0,A=A+Math.imul(J,de)|0;var Qe=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,S=Math.imul(Z,ue),u=Math.imul(Z,fe),u=u+Math.imul(H,ue)|0,A=Math.imul(H,fe),S=S+Math.imul(V,he)|0,u=u+Math.imul(V,de)|0,u=u+Math.imul(K,he)|0,A=A+Math.imul(K,de)|0,S=S+Math.imul(F,me)|0,u=u+Math.imul(F,pe)|0,u=u+Math.imul(J,me)|0,A=A+Math.imul(J,pe)|0;var Xe=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,S=Math.imul(G,ue),u=Math.imul(G,fe),u=u+Math.imul(Y,ue)|0,A=Math.imul(Y,fe),S=S+Math.imul(Z,he)|0,u=u+Math.imul(Z,de)|0,u=u+Math.imul(H,he)|0,A=A+Math.imul(H,de)|0,S=S+Math.imul(V,me)|0,u=u+Math.imul(V,pe)|0,u=u+Math.imul(K,me)|0,A=A+Math.imul(K,pe)|0,S=S+Math.imul(F,ge)|0,u=u+Math.imul(F,ve)|0,u=u+Math.imul(J,ge)|0,A=A+Math.imul(J,ve)|0;var et=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(et>>>26)|0,et&=67108863,S=Math.imul(Q,ue),u=Math.imul(Q,fe),u=u+Math.imul(X,ue)|0,A=Math.imul(X,fe),S=S+Math.imul(G,he)|0,u=u+Math.imul(G,de)|0,u=u+Math.imul(Y,he)|0,A=A+Math.imul(Y,de)|0,S=S+Math.imul(Z,me)|0,u=u+Math.imul(Z,pe)|0,u=u+Math.imul(H,me)|0,A=A+Math.imul(H,pe)|0,S=S+Math.imul(V,ge)|0,u=u+Math.imul(V,ve)|0,u=u+Math.imul(K,ge)|0,A=A+Math.imul(K,ve)|0,S=S+Math.imul(F,ye)|0,u=u+Math.imul(F,be)|0,u=u+Math.imul(J,ye)|0,A=A+Math.imul(J,be)|0;var tt=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(tt>>>26)|0,tt&=67108863,S=Math.imul(ee,ue),u=Math.imul(ee,fe),u=u+Math.imul(te,ue)|0,A=Math.imul(te,fe),S=S+Math.imul(Q,he)|0,u=u+Math.imul(Q,de)|0,u=u+Math.imul(X,he)|0,A=A+Math.imul(X,de)|0,S=S+Math.imul(G,me)|0,u=u+Math.imul(G,pe)|0,u=u+Math.imul(Y,me)|0,A=A+Math.imul(Y,pe)|0,S=S+Math.imul(Z,ge)|0,u=u+Math.imul(Z,ve)|0,u=u+Math.imul(H,ge)|0,A=A+Math.imul(H,ve)|0,S=S+Math.imul(V,ye)|0,u=u+Math.imul(V,be)|0,u=u+Math.imul(K,ye)|0,A=A+Math.imul(K,be)|0,S=S+Math.imul(F,_e)|0,u=u+Math.imul(F,we)|0,u=u+Math.imul(J,_e)|0,A=A+Math.imul(J,we)|0;var rt=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(rt>>>26)|0,rt&=67108863,S=Math.imul(re,ue),u=Math.imul(re,fe),u=u+Math.imul(se,ue)|0,A=Math.imul(se,fe),S=S+Math.imul(ee,he)|0,u=u+Math.imul(ee,de)|0,u=u+Math.imul(te,he)|0,A=A+Math.imul(te,de)|0,S=S+Math.imul(Q,me)|0,u=u+Math.imul(Q,pe)|0,u=u+Math.imul(X,me)|0,A=A+Math.imul(X,pe)|0,S=S+Math.imul(G,ge)|0,u=u+Math.imul(G,ve)|0,u=u+Math.imul(Y,ge)|0,A=A+Math.imul(Y,ve)|0,S=S+Math.imul(Z,ye)|0,u=u+Math.imul(Z,be)|0,u=u+Math.imul(H,ye)|0,A=A+Math.imul(H,be)|0,S=S+Math.imul(V,_e)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(K,_e)|0,A=A+Math.imul(K,we)|0,S=S+Math.imul(F,xe)|0,u=u+Math.imul(F,Me)|0,u=u+Math.imul(J,xe)|0,A=A+Math.imul(J,Me)|0;var st=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(st>>>26)|0,st&=67108863,S=Math.imul(ne,ue),u=Math.imul(ne,fe),u=u+Math.imul(ie,ue)|0,A=Math.imul(ie,fe),S=S+Math.imul(re,he)|0,u=u+Math.imul(re,de)|0,u=u+Math.imul(se,he)|0,A=A+Math.imul(se,de)|0,S=S+Math.imul(ee,me)|0,u=u+Math.imul(ee,pe)|0,u=u+Math.imul(te,me)|0,A=A+Math.imul(te,pe)|0,S=S+Math.imul(Q,ge)|0,u=u+Math.imul(Q,ve)|0,u=u+Math.imul(X,ge)|0,A=A+Math.imul(X,ve)|0,S=S+Math.imul(G,ye)|0,u=u+Math.imul(G,be)|0,u=u+Math.imul(Y,ye)|0,A=A+Math.imul(Y,be)|0,S=S+Math.imul(Z,_e)|0,u=u+Math.imul(Z,we)|0,u=u+Math.imul(H,_e)|0,A=A+Math.imul(H,we)|0,S=S+Math.imul(V,xe)|0,u=u+Math.imul(V,Me)|0,u=u+Math.imul(K,xe)|0,A=A+Math.imul(K,Me)|0,S=S+Math.imul(F,$e)|0,u=u+Math.imul(F,ke)|0,u=u+Math.imul(J,$e)|0,A=A+Math.imul(J,ke)|0;var nt=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(nt>>>26)|0,nt&=67108863,S=Math.imul(ae,ue),u=Math.imul(ae,fe),u=u+Math.imul(oe,ue)|0,A=Math.imul(oe,fe),S=S+Math.imul(ne,he)|0,u=u+Math.imul(ne,de)|0,u=u+Math.imul(ie,he)|0,A=A+Math.imul(ie,de)|0,S=S+Math.imul(re,me)|0,u=u+Math.imul(re,pe)|0,u=u+Math.imul(se,me)|0,A=A+Math.imul(se,pe)|0,S=S+Math.imul(ee,ge)|0,u=u+Math.imul(ee,ve)|0,u=u+Math.imul(te,ge)|0,A=A+Math.imul(te,ve)|0,S=S+Math.imul(Q,ye)|0,u=u+Math.imul(Q,be)|0,u=u+Math.imul(X,ye)|0,A=A+Math.imul(X,be)|0,S=S+Math.imul(G,_e)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,_e)|0,A=A+Math.imul(Y,we)|0,S=S+Math.imul(Z,xe)|0,u=u+Math.imul(Z,Me)|0,u=u+Math.imul(H,xe)|0,A=A+Math.imul(H,Me)|0,S=S+Math.imul(V,$e)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(K,$e)|0,A=A+Math.imul(K,ke)|0,S=S+Math.imul(F,je)|0,u=u+Math.imul(F,Se)|0,u=u+Math.imul(J,je)|0,A=A+Math.imul(J,Se)|0;var it=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(it>>>26)|0,it&=67108863,S=Math.imul(le,ue),u=Math.imul(le,fe),u=u+Math.imul(ce,ue)|0,A=Math.imul(ce,fe),S=S+Math.imul(ae,he)|0,u=u+Math.imul(ae,de)|0,u=u+Math.imul(oe,he)|0,A=A+Math.imul(oe,de)|0,S=S+Math.imul(ne,me)|0,u=u+Math.imul(ne,pe)|0,u=u+Math.imul(ie,me)|0,A=A+Math.imul(ie,pe)|0,S=S+Math.imul(re,ge)|0,u=u+Math.imul(re,ve)|0,u=u+Math.imul(se,ge)|0,A=A+Math.imul(se,ve)|0,S=S+Math.imul(ee,ye)|0,u=u+Math.imul(ee,be)|0,u=u+Math.imul(te,ye)|0,A=A+Math.imul(te,be)|0,S=S+Math.imul(Q,_e)|0,u=u+Math.imul(Q,we)|0,u=u+Math.imul(X,_e)|0,A=A+Math.imul(X,we)|0,S=S+Math.imul(G,xe)|0,u=u+Math.imul(G,Me)|0,u=u+Math.imul(Y,xe)|0,A=A+Math.imul(Y,Me)|0,S=S+Math.imul(Z,$e)|0,u=u+Math.imul(Z,ke)|0,u=u+Math.imul(H,$e)|0,A=A+Math.imul(H,ke)|0,S=S+Math.imul(V,je)|0,u=u+Math.imul(V,Se)|0,u=u+Math.imul(K,je)|0,A=A+Math.imul(K,Se)|0,S=S+Math.imul(F,Re)|0,u=u+Math.imul(F,Ae)|0,u=u+Math.imul(J,Re)|0,A=A+Math.imul(J,Ae)|0;var at=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(at>>>26)|0,at&=67108863,S=Math.imul(le,he),u=Math.imul(le,de),u=u+Math.imul(ce,he)|0,A=Math.imul(ce,de),S=S+Math.imul(ae,me)|0,u=u+Math.imul(ae,pe)|0,u=u+Math.imul(oe,me)|0,A=A+Math.imul(oe,pe)|0,S=S+Math.imul(ne,ge)|0,u=u+Math.imul(ne,ve)|0,u=u+Math.imul(ie,ge)|0,A=A+Math.imul(ie,ve)|0,S=S+Math.imul(re,ye)|0,u=u+Math.imul(re,be)|0,u=u+Math.imul(se,ye)|0,A=A+Math.imul(se,be)|0,S=S+Math.imul(ee,_e)|0,u=u+Math.imul(ee,we)|0,u=u+Math.imul(te,_e)|0,A=A+Math.imul(te,we)|0,S=S+Math.imul(Q,xe)|0,u=u+Math.imul(Q,Me)|0,u=u+Math.imul(X,xe)|0,A=A+Math.imul(X,Me)|0,S=S+Math.imul(G,$e)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,$e)|0,A=A+Math.imul(Y,ke)|0,S=S+Math.imul(Z,je)|0,u=u+Math.imul(Z,Se)|0,u=u+Math.imul(H,je)|0,A=A+Math.imul(H,Se)|0,S=S+Math.imul(V,Re)|0,u=u+Math.imul(V,Ae)|0,u=u+Math.imul(K,Re)|0,A=A+Math.imul(K,Ae)|0;var ot=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(ot>>>26)|0,ot&=67108863,S=Math.imul(le,me),u=Math.imul(le,pe),u=u+Math.imul(ce,me)|0,A=Math.imul(ce,pe),S=S+Math.imul(ae,ge)|0,u=u+Math.imul(ae,ve)|0,u=u+Math.imul(oe,ge)|0,A=A+Math.imul(oe,ve)|0,S=S+Math.imul(ne,ye)|0,u=u+Math.imul(ne,be)|0,u=u+Math.imul(ie,ye)|0,A=A+Math.imul(ie,be)|0,S=S+Math.imul(re,_e)|0,u=u+Math.imul(re,we)|0,u=u+Math.imul(se,_e)|0,A=A+Math.imul(se,we)|0,S=S+Math.imul(ee,xe)|0,u=u+Math.imul(ee,Me)|0,u=u+Math.imul(te,xe)|0,A=A+Math.imul(te,Me)|0,S=S+Math.imul(Q,$e)|0,u=u+Math.imul(Q,ke)|0,u=u+Math.imul(X,$e)|0,A=A+Math.imul(X,ke)|0,S=S+Math.imul(G,je)|0,u=u+Math.imul(G,Se)|0,u=u+Math.imul(Y,je)|0,A=A+Math.imul(Y,Se)|0,S=S+Math.imul(Z,Re)|0,u=u+Math.imul(Z,Ae)|0,u=u+Math.imul(H,Re)|0,A=A+Math.imul(H,Ae)|0;var lt=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(lt>>>26)|0,lt&=67108863,S=Math.imul(le,ge),u=Math.imul(le,ve),u=u+Math.imul(ce,ge)|0,A=Math.imul(ce,ve),S=S+Math.imul(ae,ye)|0,u=u+Math.imul(ae,be)|0,u=u+Math.imul(oe,ye)|0,A=A+Math.imul(oe,be)|0,S=S+Math.imul(ne,_e)|0,u=u+Math.imul(ne,we)|0,u=u+Math.imul(ie,_e)|0,A=A+Math.imul(ie,we)|0,S=S+Math.imul(re,xe)|0,u=u+Math.imul(re,Me)|0,u=u+Math.imul(se,xe)|0,A=A+Math.imul(se,Me)|0,S=S+Math.imul(ee,$e)|0,u=u+Math.imul(ee,ke)|0,u=u+Math.imul(te,$e)|0,A=A+Math.imul(te,ke)|0,S=S+Math.imul(Q,je)|0,u=u+Math.imul(Q,Se)|0,u=u+Math.imul(X,je)|0,A=A+Math.imul(X,Se)|0,S=S+Math.imul(G,Re)|0,u=u+Math.imul(G,Ae)|0,u=u+Math.imul(Y,Re)|0,A=A+Math.imul(Y,Ae)|0;var ct=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(ct>>>26)|0,ct&=67108863,S=Math.imul(le,ye),u=Math.imul(le,be),u=u+Math.imul(ce,ye)|0,A=Math.imul(ce,be),S=S+Math.imul(ae,_e)|0,u=u+Math.imul(ae,we)|0,u=u+Math.imul(oe,_e)|0,A=A+Math.imul(oe,we)|0,S=S+Math.imul(ne,xe)|0,u=u+Math.imul(ne,Me)|0,u=u+Math.imul(ie,xe)|0,A=A+Math.imul(ie,Me)|0,S=S+Math.imul(re,$e)|0,u=u+Math.imul(re,ke)|0,u=u+Math.imul(se,$e)|0,A=A+Math.imul(se,ke)|0,S=S+Math.imul(ee,je)|0,u=u+Math.imul(ee,Se)|0,u=u+Math.imul(te,je)|0,A=A+Math.imul(te,Se)|0,S=S+Math.imul(Q,Re)|0,u=u+Math.imul(Q,Ae)|0,u=u+Math.imul(X,Re)|0,A=A+Math.imul(X,Ae)|0;var ut=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(ut>>>26)|0,ut&=67108863,S=Math.imul(le,_e),u=Math.imul(le,we),u=u+Math.imul(ce,_e)|0,A=Math.imul(ce,we),S=S+Math.imul(ae,xe)|0,u=u+Math.imul(ae,Me)|0,u=u+Math.imul(oe,xe)|0,A=A+Math.imul(oe,Me)|0,S=S+Math.imul(ne,$e)|0,u=u+Math.imul(ne,ke)|0,u=u+Math.imul(ie,$e)|0,A=A+Math.imul(ie,ke)|0,S=S+Math.imul(re,je)|0,u=u+Math.imul(re,Se)|0,u=u+Math.imul(se,je)|0,A=A+Math.imul(se,Se)|0,S=S+Math.imul(ee,Re)|0,u=u+Math.imul(ee,Ae)|0,u=u+Math.imul(te,Re)|0,A=A+Math.imul(te,Ae)|0;var ft=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(ft>>>26)|0,ft&=67108863,S=Math.imul(le,xe),u=Math.imul(le,Me),u=u+Math.imul(ce,xe)|0,A=Math.imul(ce,Me),S=S+Math.imul(ae,$e)|0,u=u+Math.imul(ae,ke)|0,u=u+Math.imul(oe,$e)|0,A=A+Math.imul(oe,ke)|0,S=S+Math.imul(ne,je)|0,u=u+Math.imul(ne,Se)|0,u=u+Math.imul(ie,je)|0,A=A+Math.imul(ie,Se)|0,S=S+Math.imul(re,Re)|0,u=u+Math.imul(re,Ae)|0,u=u+Math.imul(se,Re)|0,A=A+Math.imul(se,Ae)|0;var ht=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(ht>>>26)|0,ht&=67108863,S=Math.imul(le,$e),u=Math.imul(le,ke),u=u+Math.imul(ce,$e)|0,A=Math.imul(ce,ke),S=S+Math.imul(ae,je)|0,u=u+Math.imul(ae,Se)|0,u=u+Math.imul(oe,je)|0,A=A+Math.imul(oe,Se)|0,S=S+Math.imul(ne,Re)|0,u=u+Math.imul(ne,Ae)|0,u=u+Math.imul(ie,Re)|0,A=A+Math.imul(ie,Ae)|0;var dt=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(dt>>>26)|0,dt&=67108863,S=Math.imul(le,je),u=Math.imul(le,Se),u=u+Math.imul(ce,je)|0,A=Math.imul(ce,Se),S=S+Math.imul(ae,Re)|0,u=u+Math.imul(ae,Ae)|0,u=u+Math.imul(oe,Re)|0,A=A+Math.imul(oe,Ae)|0;var mt=(C+S|0)+((u&8191)<<13)|0;C=(A+(u>>>13)|0)+(mt>>>26)|0,mt&=67108863,S=Math.imul(le,Re),u=Math.imul(le,Ae),u=u+Math.imul(ce,Re)|0,A=Math.imul(ce,Ae);var pt=(C+S|0)+((u&8191)<<13)|0;return C=(A+(u>>>13)|0)+(pt>>>26)|0,pt&=67108863,D[0]=Ye,D[1]=Qe,D[2]=Xe,D[3]=et,D[4]=tt,D[5]=rt,D[6]=st,D[7]=nt,D[8]=it,D[9]=at,D[10]=ot,D[11]=lt,D[12]=ct,D[13]=ut,D[14]=ft,D[15]=ht,D[16]=dt,D[17]=mt,D[18]=pt,C!==0&&(D[19]=C,_.length++),_};Math.imul||(o=s);function h(M,n,d){d.negative=n.negative^M.negative,d.length=M.length+n.length;for(var _=0,R=0,O=0;O<d.length-1;O++){var D=R;R=0;for(var C=_&67108863,S=Math.min(O,n.length-1),u=Math.max(0,O-M.length+1);u<=S;u++){var A=O-u,z=M.words[A]|0,F=n.words[u]|0,J=z*F,W=J&67108863;D=D+(J/67108864|0)|0,W=W+C|0,C=W&67108863,D=D+(W>>>26)|0,R+=D>>>26,D&=67108863}d.words[O]=C,_=D,D=R}return _!==0?d.words[O]=_:d.length--,d._strip()}function g(M,n,d){return h(M,n,d)}p.prototype.mulTo=function(n,d){var _,R=this.length+n.length;return this.length===10&&n.length===10?_=o(this,n,d):R<63?_=s(this,n,d):R<1024?_=h(this,n,d):_=g(this,n,d),_},p.prototype.mul=function(n){var d=new p(null);return d.words=new Array(this.length+n.length),this.mulTo(n,d)},p.prototype.mulf=function(n){var d=new p(null);return d.words=new Array(this.length+n.length),g(this,n,d)},p.prototype.imul=function(n){return this.clone().mulTo(n,this)},p.prototype.imuln=function(n){var d=n<0;d&&(n=-n),T(typeof n=="number"),T(n<67108864);for(var _=0,R=0;R<this.length;R++){var O=(this.words[R]|0)*n,D=(O&67108863)+(_&67108863);_>>=26,_+=O/67108864|0,_+=D>>>26,this.words[R]=D&67108863}return _!==0&&(this.words[R]=_,this.length++),d?this.ineg():this},p.prototype.muln=function(n){return this.clone().imuln(n)},p.prototype.sqr=function(){return this.mul(this)},p.prototype.isqr=function(){return this.imul(this.clone())},p.prototype.pow=function(n){var d=c(n);if(d.length===0)return new p(1);for(var _=this,R=0;R<d.length&&d[R]===0;R++,_=_.sqr());if(++R<d.length)for(var O=_.sqr();R<d.length;R++,O=O.sqr())d[R]!==0&&(_=_.mul(O));return _},p.prototype.iushln=function(n){T(typeof n=="number"&&n>=0);var d=n%26,_=(n-d)/26,R=67108863>>>26-d<<26-d,O;if(d!==0){var D=0;for(O=0;O<this.length;O++){var C=this.words[O]&R,S=(this.words[O]|0)-C<<d;this.words[O]=S|D,D=C>>>26-d}D&&(this.words[O]=D,this.length++)}if(_!==0){for(O=this.length-1;O>=0;O--)this.words[O+_]=this.words[O];for(O=0;O<_;O++)this.words[O]=0;this.length+=_}return this._strip()},p.prototype.ishln=function(n){return T(this.negative===0),this.iushln(n)},p.prototype.iushrn=function(n,d,_){T(typeof n=="number"&&n>=0);var R;d?R=(d-d%26)/26:R=0;var O=n%26,D=Math.min((n-O)/26,this.length),C=67108863^67108863>>>O<<O,S=_;if(R-=D,R=Math.max(0,R),S){for(var u=0;u<D;u++)S.words[u]=this.words[u];S.length=D}if(D!==0)if(this.length>D)for(this.length-=D,u=0;u<this.length;u++)this.words[u]=this.words[u+D];else this.words[0]=0,this.length=1;var A=0;for(u=this.length-1;u>=0&&(A!==0||u>=R);u--){var z=this.words[u]|0;this.words[u]=A<<26-O|z>>>O,A=z&C}return S&&A!==0&&(S.words[S.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},p.prototype.ishrn=function(n,d,_){return T(this.negative===0),this.iushrn(n,d,_)},p.prototype.shln=function(n){return this.clone().ishln(n)},p.prototype.ushln=function(n){return this.clone().iushln(n)},p.prototype.shrn=function(n){return this.clone().ishrn(n)},p.prototype.ushrn=function(n){return this.clone().iushrn(n)},p.prototype.testn=function(n){T(typeof n=="number"&&n>=0);var d=n%26,_=(n-d)/26,R=1<<d;if(this.length<=_)return!1;var O=this.words[_];return!!(O&R)},p.prototype.imaskn=function(n){T(typeof n=="number"&&n>=0);var d=n%26,_=(n-d)/26;if(T(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(d!==0&&_++,this.length=Math.min(_,this.length),d!==0){var R=67108863^67108863>>>d<<d;this.words[this.length-1]&=R}return this._strip()},p.prototype.maskn=function(n){return this.clone().imaskn(n)},p.prototype.iaddn=function(n){return T(typeof n=="number"),T(n<67108864),n<0?this.isubn(-n):this.negative!==0?this.length===1&&(this.words[0]|0)<=n?(this.words[0]=n-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(n),this.negative=1,this):this._iaddn(n)},p.prototype._iaddn=function(n){this.words[0]+=n;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},p.prototype.isubn=function(n){if(T(typeof n=="number"),T(n<67108864),n<0)return this.iaddn(-n);if(this.negative!==0)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},p.prototype.addn=function(n){return this.clone().iaddn(n)},p.prototype.subn=function(n){return this.clone().isubn(n)},p.prototype.iabs=function(){return this.negative=0,this},p.prototype.abs=function(){return this.clone().iabs()},p.prototype._ishlnsubmul=function(n,d,_){var R=n.length+_,O;this._expand(R);var D,C=0;for(O=0;O<n.length;O++){D=(this.words[O+_]|0)+C;var S=(n.words[O]|0)*d;D-=S&67108863,C=(D>>26)-(S/67108864|0),this.words[O+_]=D&67108863}for(;O<this.length-_;O++)D=(this.words[O+_]|0)+C,C=D>>26,this.words[O+_]=D&67108863;if(C===0)return this._strip();for(T(C===-1),C=0,O=0;O<this.length;O++)D=-(this.words[O]|0)+C,C=D>>26,this.words[O]=D&67108863;return this.negative=1,this._strip()},p.prototype._wordDiv=function(n,d){var _=this.length-n.length,R=this.clone(),O=n,D=O.words[O.length-1]|0,C=this._countBits(D);_=26-C,_!==0&&(O=O.ushln(_),R.iushln(_),D=O.words[O.length-1]|0);var S=R.length-O.length,u;if(d!=="mod"){u=new p(null),u.length=S+1,u.words=new Array(u.length);for(var A=0;A<u.length;A++)u.words[A]=0}var z=R.clone()._ishlnsubmul(O,1,S);z.negative===0&&(R=z,u&&(u.words[S]=1));for(var F=S-1;F>=0;F--){var J=(R.words[O.length+F]|0)*67108864+(R.words[O.length+F-1]|0);for(J=Math.min(J/D|0,67108863),R._ishlnsubmul(O,J,F);R.negative!==0;)J--,R.negative=0,R._ishlnsubmul(O,1,F),R.isZero()||(R.negative^=1);u&&(u.words[F]=J)}return u&&u._strip(),R._strip(),d!=="div"&&_!==0&&R.iushrn(_),{div:u||null,mod:R}},p.prototype.divmod=function(n,d,_){if(T(!n.isZero()),this.isZero())return{div:new p(0),mod:new p(0)};var R,O,D;return this.negative!==0&&n.negative===0?(D=this.neg().divmod(n,d),d!=="mod"&&(R=D.div.neg()),d!=="div"&&(O=D.mod.neg(),_&&O.negative!==0&&O.iadd(n)),{div:R,mod:O}):this.negative===0&&n.negative!==0?(D=this.divmod(n.neg(),d),d!=="mod"&&(R=D.div.neg()),{div:R,mod:D.mod}):this.negative&n.negative?(D=this.neg().divmod(n.neg(),d),d!=="div"&&(O=D.mod.neg(),_&&O.negative!==0&&O.isub(n)),{div:D.div,mod:O}):n.length>this.length||this.cmp(n)<0?{div:new p(0),mod:this}:n.length===1?d==="div"?{div:this.divn(n.words[0]),mod:null}:d==="mod"?{div:null,mod:new p(this.modrn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new p(this.modrn(n.words[0]))}:this._wordDiv(n,d)},p.prototype.div=function(n){return this.divmod(n,"div",!1).div},p.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},p.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},p.prototype.divRound=function(n){var d=this.divmod(n);if(d.mod.isZero())return d.div;var _=d.div.negative!==0?d.mod.isub(n):d.mod,R=n.ushrn(1),O=n.andln(1),D=_.cmp(R);return D<0||O===1&&D===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},p.prototype.modrn=function(n){var d=n<0;d&&(n=-n),T(n<=67108863);for(var _=(1<<26)%n,R=0,O=this.length-1;O>=0;O--)R=(_*R+(this.words[O]|0))%n;return d?-R:R},p.prototype.modn=function(n){return this.modrn(n)},p.prototype.idivn=function(n){var d=n<0;d&&(n=-n),T(n<=67108863);for(var _=0,R=this.length-1;R>=0;R--){var O=(this.words[R]|0)+_*67108864;this.words[R]=O/n|0,_=O%n}return this._strip(),d?this.ineg():this},p.prototype.divn=function(n){return this.clone().idivn(n)},p.prototype.egcd=function(n){T(n.negative===0),T(!n.isZero());var d=this,_=n.clone();d.negative!==0?d=d.umod(n):d=d.clone();for(var R=new p(1),O=new p(0),D=new p(0),C=new p(1),S=0;d.isEven()&&_.isEven();)d.iushrn(1),_.iushrn(1),++S;for(var u=_.clone(),A=d.clone();!d.isZero();){for(var z=0,F=1;!(d.words[0]&F)&&z<26;++z,F<<=1);if(z>0)for(d.iushrn(z);z-- >0;)(R.isOdd()||O.isOdd())&&(R.iadd(u),O.isub(A)),R.iushrn(1),O.iushrn(1);for(var J=0,W=1;!(_.words[0]&W)&&J<26;++J,W<<=1);if(J>0)for(_.iushrn(J);J-- >0;)(D.isOdd()||C.isOdd())&&(D.iadd(u),C.isub(A)),D.iushrn(1),C.iushrn(1);d.cmp(_)>=0?(d.isub(_),R.isub(D),O.isub(C)):(_.isub(d),D.isub(R),C.isub(O))}return{a:D,b:C,gcd:_.iushln(S)}},p.prototype._invmp=function(n){T(n.negative===0),T(!n.isZero());var d=this,_=n.clone();d.negative!==0?d=d.umod(n):d=d.clone();for(var R=new p(1),O=new p(0),D=_.clone();d.cmpn(1)>0&&_.cmpn(1)>0;){for(var C=0,S=1;!(d.words[0]&S)&&C<26;++C,S<<=1);if(C>0)for(d.iushrn(C);C-- >0;)R.isOdd()&&R.iadd(D),R.iushrn(1);for(var u=0,A=1;!(_.words[0]&A)&&u<26;++u,A<<=1);if(u>0)for(_.iushrn(u);u-- >0;)O.isOdd()&&O.iadd(D),O.iushrn(1);d.cmp(_)>=0?(d.isub(_),R.isub(O)):(_.isub(d),O.isub(R))}var z;return d.cmpn(1)===0?z=R:z=O,z.cmpn(0)<0&&z.iadd(n),z},p.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var d=this.clone(),_=n.clone();d.negative=0,_.negative=0;for(var R=0;d.isEven()&&_.isEven();R++)d.iushrn(1),_.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;_.isEven();)_.iushrn(1);var O=d.cmp(_);if(O<0){var D=d;d=_,_=D}else if(O===0||_.cmpn(1)===0)break;d.isub(_)}while(!0);return _.iushln(R)},p.prototype.invm=function(n){return this.egcd(n).a.umod(n)},p.prototype.isEven=function(){return(this.words[0]&1)===0},p.prototype.isOdd=function(){return(this.words[0]&1)===1},p.prototype.andln=function(n){return this.words[0]&n},p.prototype.bincn=function(n){T(typeof n=="number");var d=n%26,_=(n-d)/26,R=1<<d;if(this.length<=_)return this._expand(_+1),this.words[_]|=R,this;for(var O=R,D=_;O!==0&&D<this.length;D++){var C=this.words[D]|0;C+=O,O=C>>>26,C&=67108863,this.words[D]=C}return O!==0&&(this.words[D]=O,this.length++),this},p.prototype.isZero=function(){return this.length===1&&this.words[0]===0},p.prototype.cmpn=function(n){var d=n<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var _;if(this.length>1)_=1;else{d&&(n=-n),T(n<=67108863,"Number is too big");var R=this.words[0]|0;_=R===n?0:R<n?-1:1}return this.negative!==0?-_|0:_},p.prototype.cmp=function(n){if(this.negative!==0&&n.negative===0)return-1;if(this.negative===0&&n.negative!==0)return 1;var d=this.ucmp(n);return this.negative!==0?-d|0:d},p.prototype.ucmp=function(n){if(this.length>n.length)return 1;if(this.length<n.length)return-1;for(var d=0,_=this.length-1;_>=0;_--){var R=this.words[_]|0,O=n.words[_]|0;if(R!==O){R<O?d=-1:R>O&&(d=1);break}}return d},p.prototype.gtn=function(n){return this.cmpn(n)===1},p.prototype.gt=function(n){return this.cmp(n)===1},p.prototype.gten=function(n){return this.cmpn(n)>=0},p.prototype.gte=function(n){return this.cmp(n)>=0},p.prototype.ltn=function(n){return this.cmpn(n)===-1},p.prototype.lt=function(n){return this.cmp(n)===-1},p.prototype.lten=function(n){return this.cmpn(n)<=0},p.prototype.lte=function(n){return this.cmp(n)<=0},p.prototype.eqn=function(n){return this.cmpn(n)===0},p.prototype.eq=function(n){return this.cmp(n)===0},p.red=function(n){return new E(n)},p.prototype.toRed=function(n){return T(!this.red,"Already a number in reduction context"),T(this.negative===0,"red works only with positives"),n.convertTo(this)._forceRed(n)},p.prototype.fromRed=function(){return T(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},p.prototype._forceRed=function(n){return this.red=n,this},p.prototype.forceRed=function(n){return T(!this.red,"Already a number in reduction context"),this._forceRed(n)},p.prototype.redAdd=function(n){return T(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},p.prototype.redIAdd=function(n){return T(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},p.prototype.redSub=function(n){return T(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},p.prototype.redISub=function(n){return T(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},p.prototype.redShl=function(n){return T(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},p.prototype.redMul=function(n){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},p.prototype.redIMul=function(n){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},p.prototype.redSqr=function(){return T(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},p.prototype.redISqr=function(){return T(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},p.prototype.redSqrt=function(){return T(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},p.prototype.redInvm=function(){return T(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},p.prototype.redNeg=function(){return T(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},p.prototype.redPow=function(n){return T(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var b={k256:null,p224:null,p192:null,p25519:null};function j(M,n){this.name=M,this.p=new p(n,16),this.n=this.p.bitLength(),this.k=new p(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}j.prototype._tmp=function(){var n=new p(null);return n.words=new Array(Math.ceil(this.n/13)),n},j.prototype.ireduce=function(n){var d=n,_;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),_=d.bitLength();while(_>this.n);var R=_<this.n?-1:d.ucmp(this.p);return R===0?(d.words[0]=0,d.length=1):R>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},j.prototype.split=function(n,d){n.iushrn(this.n,0,d)},j.prototype.imulK=function(n){return n.imul(this.k)};function k(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}L(k,j),k.prototype.split=function(n,d){for(var _=4194303,R=Math.min(n.length,9),O=0;O<R;O++)d.words[O]=n.words[O];if(d.length=R,n.length<=9){n.words[0]=0,n.length=1;return}var D=n.words[9];for(d.words[d.length++]=D&_,O=10;O<n.length;O++){var C=n.words[O]|0;n.words[O-10]=(C&_)<<4|D>>>22,D=C}D>>>=22,n.words[O-10]=D,D===0&&n.length>10?n.length-=10:n.length-=9},k.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var d=0,_=0;_<n.length;_++){var R=n.words[_]|0;d+=R*977,n.words[_]=d&67108863,d=R*64+(d/67108864|0)}return n.words[n.length-1]===0&&(n.length--,n.words[n.length-1]===0&&n.length--),n};function f(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}L(f,j);function v(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}L(v,j);function x(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}L(x,j),x.prototype.imulK=function(n){for(var d=0,_=0;_<n.length;_++){var R=(n.words[_]|0)*19+d,O=R&67108863;R>>>=26,n.words[_]=O,d=R}return d!==0&&(n.words[n.length++]=d),n},p._prime=function(n){if(b[n])return b[n];var d;if(n==="k256")d=new k;else if(n==="p224")d=new f;else if(n==="p192")d=new v;else if(n==="p25519")d=new x;else throw new Error("Unknown prime "+n);return b[n]=d,d};function E(M){if(typeof M=="string"){var n=p._prime(M);this.m=n.p,this.prime=n}else T(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}E.prototype._verify1=function(n){T(n.negative===0,"red works only with positives"),T(n.red,"red works only with red numbers")},E.prototype._verify2=function(n,d){T((n.negative|d.negative)===0,"red works only with positives"),T(n.red&&n.red===d.red,"red works only with red numbers")},E.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):(m(n,n.umod(this.m)._forceRed(this)),n)},E.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},E.prototype.add=function(n,d){this._verify2(n,d);var _=n.add(d);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},E.prototype.iadd=function(n,d){this._verify2(n,d);var _=n.iadd(d);return _.cmp(this.m)>=0&&_.isub(this.m),_},E.prototype.sub=function(n,d){this._verify2(n,d);var _=n.sub(d);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},E.prototype.isub=function(n,d){this._verify2(n,d);var _=n.isub(d);return _.cmpn(0)<0&&_.iadd(this.m),_},E.prototype.shl=function(n,d){return this._verify1(n),this.imod(n.ushln(d))},E.prototype.imul=function(n,d){return this._verify2(n,d),this.imod(n.imul(d))},E.prototype.mul=function(n,d){return this._verify2(n,d),this.imod(n.mul(d))},E.prototype.isqr=function(n){return this.imul(n,n.clone())},E.prototype.sqr=function(n){return this.mul(n,n)},E.prototype.sqrt=function(n){if(n.isZero())return n.clone();var d=this.m.andln(3);if(T(d%2===1),d===3){var _=this.m.add(new p(1)).iushrn(2);return this.pow(n,_)}for(var R=this.m.subn(1),O=0;!R.isZero()&&R.andln(1)===0;)O++,R.iushrn(1);T(!R.isZero());var D=new p(1).toRed(this),C=D.redNeg(),S=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new p(2*u*u).toRed(this);this.pow(u,S).cmp(C)!==0;)u.redIAdd(C);for(var A=this.pow(u,R),z=this.pow(n,R.addn(1).iushrn(1)),F=this.pow(n,R),J=O;F.cmp(D)!==0;){for(var W=F,V=0;W.cmp(D)!==0;V++)W=W.redSqr();T(V<J);var K=this.pow(A,new p(1).iushln(J-V-1));z=z.redMul(K),A=K.redSqr(),F=F.redMul(A),J=V}return z},E.prototype.invm=function(n){var d=n._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},E.prototype.pow=function(n,d){if(d.isZero())return new p(1).toRed(this);if(d.cmpn(1)===0)return n.clone();var _=4,R=new Array(1<<_);R[0]=new p(1).toRed(this),R[1]=n;for(var O=2;O<R.length;O++)R[O]=this.mul(R[O-1],n);var D=R[0],C=0,S=0,u=d.bitLength()%26;for(u===0&&(u=26),O=d.length-1;O>=0;O--){for(var A=d.words[O],z=u-1;z>=0;z--){var F=A>>z&1;if(D!==R[0]&&(D=this.sqr(D)),F===0&&C===0){S=0;continue}C<<=1,C|=F,S++,!(S!==_&&(O!==0||z!==0))&&(D=this.mul(D,R[C]),S=0,C=0)}u=26}return D},E.prototype.convertTo=function(n){var d=n.umod(this.m);return d===n?d.clone():d},E.prototype.convertFrom=function(n){var d=n.clone();return d.red=null,d},p.mont=function(n){return new N(n)};function N(M){E.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new p(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}L(N,E),N.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},N.prototype.convertFrom=function(n){var d=this.imod(n.mul(this.rinv));return d.red=null,d},N.prototype.imul=function(n,d){if(n.isZero()||d.isZero())return n.words[0]=0,n.length=1,n;var _=n.imul(d),R=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=_.isub(R).iushrn(this.shift),D=O;return O.cmp(this.m)>=0?D=O.isub(this.m):O.cmpn(0)<0&&(D=O.iadd(this.m)),D._forceRed(this)},N.prototype.mul=function(n,d){if(n.isZero()||d.isZero())return new p(0)._forceRed(this);var _=n.mul(d),R=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=_.isub(R).iushrn(this.shift),D=O;return O.cmp(this.m)>=0?D=O.isub(this.m):O.cmpn(0)<0&&(D=O.iadd(this.m)),D._forceRed(this)},N.prototype.invm=function(n){var d=this.imod(n._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(I,ze)})(Ot);var Hr=Ot.exports,Gr=ze&&ze.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(At,"__esModule",{value:!0});At.BNExtension=Yr;const Pe=Gr(Hr);function Yr(I){return{type:"BN",base:I.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(P,B){try{return{value:new Pe.default(P)}}catch{return{errors:B.error("bn.nan")}}},coerce(P){return{value:P.toString(10)}},validate(P){return{value:P}},rules:{gt:{args:[{name:"threshold",ref:!0,assert:P=>Pe.default.isBN(P),message:"must be a big number",normalize:P=>new Pe.default(P)},{name:"equal",assert:P=>typeof P=="boolean",message:"must be a boolean"}],validate(P,B,T){const L=new Pe.default(P);return T.equal&&L.lt(T.threshold)?B.error("bn.min",T):!T.equal&&L.lte(T.threshold)?B.error("bn.greater",T):P}},lt:{args:[{name:"threshold",ref:!0,assert:P=>Pe.default.isBN(P),message:"must be a big number",normalize:P=>new Pe.default(P)},{name:"equal",assert:P=>typeof P=="boolean",message:"must be a boolean"}],validate(P,B,T){const L=new Pe.default(P);return T.equal&&L.gt(T.threshold)?B.error("bn.max",T):!T.equal&&L.gte(T.threshold)?B.error("bn.less",T):P}},min:{alias:"gte",method(P){return this.$_addRule({name:"gt",args:{threshold:P,equal:!0}})}},max:{alias:"lte",method(P){return this.$_addRule({name:"lt",args:{threshold:P,equal:!0}})}},greater:{alias:"gt",method(P){return this.$_addRule({name:"gt",args:{threshold:P,equal:!1}})}},less:{alias:"lt",method(P){return this.$_addRule({name:"lt",args:{threshold:P,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}})}}}}}var Et={},Qr=ze&&ze.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(Et,"__esModule",{value:!0});Et.DIDExtension=Xr;const vt=Qr(Sr),yt=Rr,De=Ce,Ke={pk:Object.keys(yt.types.KeyType),hash:Object.keys(yt.types.HashType),role:Object.keys(yt.types.RoleType)};function Xr(I){return{type:"DID",base:I.string().trim(),messages:{"did.empty":'Expect {{#label}} to be non-empty string, got "{{#value}}"',"did.invalid":'Expect {{#label}} to be valid did, got "{{#value}}"',"did.wallet":'Expect wallet type of {{#label}} to be "{{#expected}}" wallet, got "{{#actual}}"',"did.pk":'Expect pk type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.hash":'Expect hash type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.role":'Expect role type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.prefix":'Expect prefix of {{#label}} to be "{{#expected}}"'},validate(P,B){return!P||typeof P!="string"?{errors:B.error("did.empty",{value:P})}:(0,De.isValid)(P)===!1?{errors:B.error("did.invalid",{value:P})}:{value:P}},rules:{type:{args:[{name:"key",ref:!0,assert:P=>Object.keys(Ke).includes(P),message:`must be one of ${Object.keys(Ke).join(", ")}`},{name:"expected",assert:P=>Object.keys(Ke).some(B=>Ke[B].includes(P)),message:"must be valid type"}],validate(P,B,T){const L=(0,De.toTypeInfoStr)(P);return T.key==="pk"&&L.pk!==T.expected?B.error("did.pk",{...T,actual:L.pk}):T.key==="hash"&&L.hash!==T.expected?B.error("did.hash",{...T,actual:L.hash}):T.key==="role"&&L.role!==T.expected?B.error("did.role",{...T,actual:L.role}):P}},pk:{method(P){return this.$_addRule({name:"type",args:{key:"pk",expected:P}})}},hash:{method(P){return this.$_addRule({name:"type",args:{key:"hash",expected:P}})}},role:{method(P){return this.$_addRule({name:"type",args:{key:"role",expected:P}})}},wallet:{method(P){return this.$_addRule({name:"wallet",args:{type:P}})},args:[{name:"type",ref:!0,assert:P=>["arcblock","ethereum","default","eth","passkey"].includes(P),message:"must be a string",normalize:P=>P.trim()}],validate(P,B,T={}){const L=(0,De.toTypeInfo)(P),p=(0,De.toTypeInfoStr)(P);return["ethereum","eth"].includes(T.type)&&(0,vt.default)(L,De.DID_TYPE_ETHEREUM)===!1?B.error("did.wallet",{expected:T.type,actual:JSON.stringify(p)}):["arcblock","default"].includes(T.type)&&(0,vt.default)(L,De.DID_TYPE_ARCBLOCK)===!1?B.error("did.wallet",{expected:T.type,actual:JSON.stringify(p)}):["passkey"].includes(T.type)&&(0,vt.default)(L,De.DID_TYPE_PASSKEY)===!1?B.error("did.wallet",{expected:T.type,actual:JSON.stringify(p)}):P}},prefix:{method(P=""){return this.$_addRule({name:"prefix",args:{str:P}})},args:[{name:"str",ref:!0,assert:P=>["",De.DID_PREFIX].includes(P),message:"must be a string",normalize:P=>P.trim()}],validate(P,B,T={}){return T.str&&P.startsWith(T.str)===!1?B.error("did.prefix",{expected:T.str}):!T.str&&(0,De.toAddress)(P)!==P?B.error("did.prefix",{expected:T.str}):P}}}}}(function(I){var P=ze&&ze.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(I,"__esModule",{value:!0}),I.patterns=I.schemas=I.Joi=void 0;const B=P(Zr),T=At,L=Et;I.Joi=B.default.extend(L.DIDExtension).extend(T.BNExtension);const p=/^(0x)?([A-Fa-f0-9]{64})$/,w=I.Joi.object({genesisTime:I.Joi.date().iso().required().raw(),genesisTx:I.Joi.string().regex(p).required().allow(""),renaissanceTime:I.Joi.date().iso().required().raw(),renaissanceTx:I.Joi.string().regex(p).required().allow("")}),l=I.Joi.object({address:I.Joi.DID().prefix().role("ROLE_TOKEN").required(),value:I.Joi.BN().positive().required()}),$=I.Joi.object({name:I.Joi.string().min(1).max(256).required(),value:I.Joi.string().min(1).max(1024).required(),description:I.Joi.string().min(1).max(256).optional().allow(""),required:I.Joi.boolean().optional().default(!1)}),y=I.Joi.alternatives().try(I.Joi.DID().prefix().role("ROLE_ACCOUNT"),I.Joi.DID().prefix().role("ROLE_APPLICATION"),I.Joi.DID().prefix().role("ROLE_BLOCKLET"),I.Joi.DID().prefix().wallet("ethereum"),I.Joi.DID().prefix().wallet("passkey")),m=I.Joi.array().items(I.Joi.object({owner:y.required(),tokensList:I.Joi.array().items(l).default([]),assetsList:I.Joi.array().items(I.Joi.DID().prefix().role("ROLE_ASSET")).default([])})),e=I.Joi.array().items({signer:I.Joi.DID().prefix().required(),pk:I.Joi.any().required(),signature:I.Joi.any().required(),delegator:I.Joi.DID().prefix().valid("").optional(),data:I.Joi.any().optional()}),a=I.Joi.object({type:I.Joi.string().min(1).max(32).required(),contractAddress:I.Joi.DID().prefix().wallet("ethereum").required(),chainType:I.Joi.string().min(1).max(32).required(),chainName:I.Joi.string().min(1).max(32).required(),chainId:I.Joi.number().positive().required()}),i=I.Joi.object({type:I.Joi.string().valid("svg","url","uri").required(),content:I.Joi.string().when("type",{is:"uri",then:I.Joi.string().max(20480).dataUri().required()}).when("type",{is:"url",then:I.Joi.string().max(2048).uri({scheme:["http","https"]}).required()})}),r=I.Joi.object({id:I.Joi.string().max(2048).uri({scheme:["http","https"]}).required(),scope:I.Joi.string().valid("public","private").default("public")}),t=I.Joi.object({id:I.Joi.DID().prefix().required(),pk:I.Joi.string().required(),name:I.Joi.string().min(1).max(256).required()}),c={address:I.Joi.DID().prefix().role("ROLE_ASSET").required(),moniker:I.Joi.string().min(2).max(255).required(),data:I.Joi.any().required(),readonly:I.Joi.boolean().default(!1),transferrable:I.Joi.boolean().default(!1),ttl:I.Joi.number().min(0).default(0),parent:I.Joi.DID().prefix().optional().allow(""),issuer:I.Joi.DID().prefix().optional().allow(""),endpoint:r.optional().allow(null).default(null),display:i.optional().allow(null).default(null),tags:I.Joi.array().items(I.Joi.string().min(1).max(64)).max(4).optional()},s={address:I.Joi.DID().prefix().role("ROLE_FACTORY").required(),name:I.Joi.string().min(2).max(255).required(),description:I.Joi.string().min(2).max(255).required(),settlement:I.Joi.string().valid("instant","periodic").default("instant"),limit:I.Joi.number().integer().min(0).default(0),trustedIssuers:I.Joi.array().items(I.Joi.DID().prefix()).max(8).optional(),data:I.Joi.any().optional().allow(null).default(null),display:i.optional().allow(null).default(null),input:I.Joi.object({value:I.Joi.BN().positive().min("0").default("0"),tokens:I.Joi.array().items(l).max(8).optional(),assets:I.Joi.array().items(I.Joi.alternatives().try(I.Joi.DID().prefix().role("ROLE_ASSET"),I.Joi.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),variables:I.Joi.array().items(I.Joi.object({name:I.Joi.string().min(1).max(255).required(),description:I.Joi.string().max(255).optional().allow(""),required:I.Joi.boolean().required()})).optional()}),output:I.Joi.object({moniker:I.Joi.string().min(2).max(255).required(),data:I.Joi.any().required(),readonly:I.Joi.boolean().default(!1),transferrable:I.Joi.boolean().default(!1),ttl:I.Joi.number().min(0).default(0),parent:I.Joi.string().max(255).required(),issuer:I.Joi.string().max(255).required(),endpoint:r.optional(),display:i.optional(),tags:I.Joi.array().items(I.Joi.string().min(1).max(64)).max(4).optional()}),hooks:I.Joi.array().items(I.Joi.object({name:I.Joi.string().valid("mint","postMint","preMint").required(),type:I.Joi.string().valid("url","contract").required(),hook:I.Joi.string().min(1).max(4096).required(),compiled:I.Joi.array().items(I.Joi.object()).optional()})).optional()};I.schemas={context:w,tokenInput:l,multiInput:m,multiSig:e,foreignToken:a,variableInput:$,nftDisplay:i,nftEndpoint:r,nftIssuer:t,tokenHolder:y,assetProps:c,assetSchema:I.Joi.object(c).options({stripUnknown:!0,noDefaults:!1}),factoryProps:s,factorySchema:I.Joi.object(s).options({stripUnknown:!0,noDefaults:!1})},I.patterns={txHash:p}})(ur);function Dt({onCancel:I,onSuccess:P,blocklet:B}){var c,s;const{vaults:T=[],appPid:L}=B,{t:p,locale:w}=Ve(),{connectApi:l}=ar(),{api:$}=Je(),{teamDid:y}=or(),[m,e]=ir({loading:!1,fetching:!1,error:"",address:"",fetched:[],errored:[]});Ee.useEffect(()=>{if(!Ce.isValid(m.address))return;const o=Ce.toAddress(m.address),h=m.fetched.find(b=>b.address===o),g=m.errored.find(b=>b.address===o);!m.fetching&&!h&&!g&&(e({fetching:!0}),$r(Ar.MAIN_CHAIN_ENDPOINT).getAccountState({address:o}).then(j=>{j.state?e({fetching:!1,fetched:[...m.fetched.filter(k=>k.address!==o),j.state]}):e({fetching:!1,errored:[...m.errored.filter(k=>k.address!==o),{address:o}]})}).catch(j=>{console.error(j),e({fetching:!1,error:Ue(j)})}))},[m.address,m.fetching]),Ee.useEffect(()=>{if(m.address){const o=Ce.toAddress(m.address);if(!Ce.isValid(o)){e({error:p("blocklet.config.vault.error.invalid")});return}if(ur.schemas.tokenHolder.validate(o).error){e({error:p("blocklet.config.vault.error.holder")});return}if(T.find(g=>g.did===o)){e({error:p("blocklet.config.vault.error.duplicate")});return}if(Ir([B.appDid,B.appPid,...B.migratedFrom.map(g=>g.appDid)].filter(Boolean)).includes(o)){e({error:p("blocklet.config.vault.error.appDid")});return}}e({error:""})},[m.address]);const a=async()=>{e({loading:!0});try{const o=await $.configVault({input:{teamDid:y,vaultDid:Ce.toAddress(m.address)}});l.open({locale:w,action:"approve-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:o.sessionId},messages:{title:p("blocklet.config.vault.approve.title"),scan:p(`blocklet.config.vault.approve.${T.length>0?"byLast":"byOwner"}`),confirm:p("blocklet.config.vault.approve.confirm"),success:p("blocklet.config.vault.approve.success")},onSuccess:()=>{l.open({locale:w,action:"config-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:o.sessionId},messages:{title:p("blocklet.config.vault.commit.title"),scan:p("blocklet.config.vault.commit.scan"),confirm:p("blocklet.config.vault.commit.confirm"),success:p("blocklet.config.vault.commit.success")},onSuccess:()=>{e({loading:!1}),P()},onClose:()=>{e({loading:!1}),l.close()}})},onClose:()=>{e({loading:!1}),l.close()}})}catch(o){e({loading:!1,error:Ue(o)})}},i=Ce.toAddress(m.address),r=[];Ce.isValid(i)&&r.push({key:p("blocklet.config.vault.role"),value:q.jsx(vr,{color:"primary",variant:"outlined",size:"small",label:Ce.toTypeInfoStr(i).role||"-"})});const t=m.fetched.find(o=>o.address===i);return t&&r.push({key:p("blocklet.config.vault.firstSeen"),value:Yt((c=t.context)==null?void 0:c.genesisTime,"-")},{key:p("blocklet.config.vault.lastSeen"),value:Yt((s=t.context)==null?void 0:s.renaissanceTime,"-")},{key:p("blocklet.config.vault.migratedFrom"),value:t.migratedFrom.length?t.migratedFrom.map(o=>q.jsx(Qt,{did:o,showQrcode:!0,compact:!0,size:14,locale:w},o)):"-"},{key:p("blocklet.config.vault.migratedTo"),value:t.migratedTo.length?t.migratedTo.map(o=>q.jsx(Qt,{did:o,showQrcode:!0,compact:!0,size:14,locale:w},o)):"-"}),q.jsx(nr,{open:!0,fullWidth:!0,showCloseButton:!1,onClose:I,title:q.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:1},children:[q.jsx(kt,{}),p("blocklet.config.vault.title")]}),actions:q.jsxs(q.Fragment,{children:[q.jsx(Le,{onClick:I,children:p("common.cancel")}),q.jsx(Le,{onClick:a,variant:"contained",disabled:!!m.error||m.loading,children:p("common.confirm")})]}),children:q.jsxs(er,{direction:"column",spacing:3,children:[q.jsxs(Be,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:[p("blocklet.config.vault.desc")," ",p("blocklet.config.vault.tip")]}),T.length>0&&q.jsxs(U,{children:[q.jsxs(Be,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:[p("blocklet.config.vault.current"),":"]}),q.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:.5},children:[q.jsx(Lr,{did:T[T.length-1].did,showQrcode:!0,style:{width:"auto"}}),q.jsx(qr,{vaults:T,appPid:L})]})]}),q.jsx(yr,{fullWidth:!0,"data-cy":"input-factory-address",label:p("blocklet.config.vault.address"),error:!!m.error,helperText:m.error,value:m.address,InputProps:{endAdornment:m.fetching?q.jsx(br,{position:"end",children:q.jsx(We,{size:16})}):null},onChange:o=>{e({address:o.target.value,error:""})}}),q.jsx(U,{sx:{"& .info-row__name":{fontSize:"14px"},"& .info-row__value":{fontSize:"14px"}},children:r.map(o=>q.jsx(Tr,{valueComponent:"div",nameWidth:120,name:o.key,children:o.value},o.key))})]})})}Dt.propTypes={onCancel:Oe.func.isRequired,onSuccess:Oe.func.isRequired,blocklet:Oe.object.isRequired};Dt.defaultProps={};function es({teamDid:I,size:P="small",...B}){const{t:T}=Ve(),{api:L}=Je(),[p,w]=Ee.useState(!1),[l,$]=Ee.useState(null),y=()=>{w(!1),$(null)},m=async()=>{var a;try{w(!0);const i=await L.rotateSessionKey({input:{teamDid:I}});Te.success(T("blocklet.config.rotateSessionKey.success",{count:((a=i.removed)==null?void 0:a.length)||0})),setTimeout(()=>{window.location.reload()},1e3)}catch(i){Te.error(Ue(i))}finally{w(!1),$(null)}},e={title:T("blocklet.config.rotateSessionKey.title"),description:T("blocklet.config.rotateSessionKey.description"),confirm:T("common.confirm"),cancel:T("common.cancel"),onConfirm:m,onCancel:y};return q.jsxs("div",{...B,children:[q.jsxs(Le,{onClick:()=>$(e),color:"error",variant:"outlined",size:P,children:[p?q.jsx(We,{size:16,style:{marginRight:5}}):null,T("blocklet.config.rotateSessionKey.action")]}),l&&q.jsx(xt,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}function He({blocklet:I,onUpdate:P,hasPermission:B}){var g,b;const{api:T,inService:L}=Je(),{t:p}=Ee.useContext(Or),[w,l]=ir({loading:!1,showTransferOwner:!1,showConfigVault:!1}),$=!!((b=(g=I==null?void 0:I.settings)==null?void 0:g.invite)!=null&&b.enabled),y=w.loading||!B,{did:m}=I.meta;if(tr(I.status))return null;const e=I.environments.find(j=>j.key===Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE),a=!e||e.value==="yes",i=I.environments.find(j=>j.key===Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE),r=(i==null?void 0:i.value)||Ne.BLOCKLET_TENANT_MODES.SINGLE,t=(j,k)=>async f=>{if(!w.loading){l({loading:!0});try{const{checked:v}=f.target,{blocklet:x}=await T.configBlocklet({input:{did:I.meta.did,configs:[{key:Ne.BLOCKLET_CONFIGURABLE_KEY[j],value:k(v)}]}});P(x)}catch(v){Te.error(v.message)}finally{l({loading:!1})}}},c=t("BLOCKLET_DELETABLE",j=>j?"no":"yes"),s=t("BLOCKLET_APP_TENANT_MODE",j=>j?Ne.BLOCKLET_TENANT_MODES.MULTIPLE:Ne.BLOCKLET_TENANT_MODES.SINGLE),o=async j=>{if(!w.loading){l({loading:!0});try{await T.updateInviteSettings({input:{did:I.meta.did,invite:{enabled:j.target.checked}}})}catch(k){Te.error(k.message)}finally{l({loading:!1})}}},h=async()=>{if(!w.loading){l({loading:!0});try{const{blocklet:j}=await T.getBlocklet({input:{did:I.meta.did}});P(j)}catch(j){Te.error(j.message)}finally{l({loading:!1})}}};return q.jsxs(ns,{p:3,sx:{border:"1px solid red",borderRadius:2},className:"advanced-config",children:[!L&&q.jsxs(q.Fragment,{children:[q.jsx(Ie,{title:p("blocklet.config.deletable.name"),desc:p(a?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(gt,{disabled:y,checked:!a,defaultChecked:!0,onChange:c})})}),q.jsx(U,{className:"config-form",component:qe,my:3})]}),q.jsx(St,{inService:L,disabled:y,loading:w.loading,onChange:h}),q.jsx(U,{className:"config-form",component:qe,my:3}),L&&q.jsx(kr,{role:"owner",children:j=>(j||Jr)&&q.jsxs(q.Fragment,{children:[q.jsx(Ie,{title:p("blocklet.config.vault.title"),desc:p("blocklet.config.vault.desc"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsxs(Le,{variant:"contained",color:"primary",size:"small","data-cy":"config-vault",onClick:()=>l({showConfigVault:!0}),children:[q.jsx(kt,{style:{fontSize:"1.3em",marginRight:4}}),p("blocklet.config.vault.title")]})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),w.showConfigVault&&q.jsx(Dt,{blocklet:I,onCancel:()=>l({showConfigVault:!1}),onSuccess:()=>l({showConfigVault:!1})}),q.jsx(Ie,{title:p("team.transferApp.name"),desc:p("team.transferApp.description"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsxs(Le,{variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"transfer-app",onClick:()=>l({showTransferOwner:!0}),children:[q.jsx(lr,{style:{fontSize:"1.3em",marginRight:4}}),p("team.transferApp.name")]})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),w.showTransferOwner&&q.jsx(Rt,{onCancel:()=>l({showTransferOwner:!1}),onSuccess:()=>l({showTransferOwner:!1})})]})}),q.jsx(Ie,{title:p("blocklet.config.clearCache.name"),desc:p("blocklet.config.clearCache.purpose"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(Ur,{teamDid:m})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),q.jsx(Ie,{title:p("blocklet.config.rotateSessionKey.name"),desc:p("blocklet.config.rotateSessionKey.purpose"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(es,{style:{whiteSpace:"nowrap"},teamDid:m})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),q.jsx(Ie,{title:p("blocklet.config.tenantMode.name"),desc:p(`blocklet.config.tenantMode.${r}`),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(gt,{disabled:y,checked:r===Ne.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:s})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),q.jsx(Ie,{title:p("team.invite.setting"),desc:p(`team.invite.${$?"enabled":"disabled"}`),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(gt,{disabled:y,checked:$,onChange:o})})})]})}const ts=Ze(He,"mutate_blocklets"),rs=Ze(He,"",rr);function ss(I){const{inService:P}=Je();return P?q.jsx(rs,{...I}):q.jsx(ts,{...I})}He.propTypes={blocklet:Oe.object.isRequired,onUpdate:Oe.func,hasPermission:Oe.bool};He.defaultProps={onUpdate:()=>{},hasPermission:!1};const ns=_t(er)``;function Ge({blocklet:I,onUpdate:P,hasPermission:B}){return tr(I.status)?null:q.jsx(os,{children:q.jsx(ss,{blocklet:I,onUpdate:P,hasPermission:B})})}const is=Ze(Ge,"mutate_blocklets"),as=Ze(Ge,"",rr);function Ls(I){const{inService:P}=Je();return P?q.jsx(as,{...I}):q.jsx(is,{...I})}Ge.propTypes={blocklet:Oe.object.isRequired,onUpdate:Oe.func,hasPermission:Oe.bool};Ge.defaultProps={onUpdate:()=>{},hasPermission:!1};const os=_t(U)`
|
|
7
|
+
`;var ur={},fr={exports:{}};(function(I,P){(function(B,T){I.exports=T()})(self,()=>{return B={7629:(L,p,w)=>{const l=w(375),$=w(8571),y=w(9474),m=w(1687),e=w(8652),a=w(8160),i=w(3292),r=w(6354),t=w(8901),c=w(9708),s=w(6914),o=w(2294),h=w(6133),g=w(1152),b=w(8863),j=w(2036),k={Base:class{constructor(f){this.type=f,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new o.Ids,this._preferences=null,this._refs=new h.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 l(typeof c.describe=="function","Manifest functionality disabled"),c.describe(this)}allow(...f){return a.verifyFlat(f,"allow"),this._values(f,"_valids")}alter(f){l(f&&typeof f=="object"&&!Array.isArray(f),"Invalid targets argument"),l(!this._inRuleset(),"Cannot set alterations inside a ruleset");const v=this.clone();v.$_terms.alterations=v.$_terms.alterations||[];for(const x in f){const E=f[x];l(typeof E=="function","Alteration adjuster for",x,"must be a function"),v.$_terms.alterations.push({target:x,adjuster:E})}return v.$_temp.ruleset=!1,v}artifact(f){return l(f!==void 0,"Artifact cannot be undefined"),l(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",f)}cast(f){return l(f===!1||typeof f=="string","Invalid to value"),l(f===!1||this._definition.cast[f],"Type",this.type,"does not support casting to",f),this.$_setFlag("cast",f===!1?void 0:f)}default(f,v){return this._default("default",f,v)}description(f){return l(f&&typeof f=="string","Description must be a non-empty string"),this.$_setFlag("description",f)}empty(f){const v=this.clone();return f!==void 0&&(f=v.$_compile(f,{override:!1})),v.$_setFlag("empty",f,{clone:!1})}error(f){return l(f,"Missing error"),l(f instanceof Error||typeof f=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",f)}example(f,v={}){return l(f!==void 0,"Missing example"),a.assertOptions(v,["override"]),this._inner("examples",f,{single:!0,override:v.override})}external(f,v){return typeof f=="object"&&(l(!v,"Cannot combine options with description"),v=f.description,f=f.method),l(typeof f=="function","Method must be a function"),l(v===void 0||v&&typeof v=="string","Description must be a non-empty string"),this._inner("externals",{method:f,description:v},{single:!0})}failover(f,v){return this._default("failover",f,v)}forbidden(){return this.presence("forbidden")}id(f){return f?(l(typeof f=="string","id must be a non-empty string"),l(/^[^\.]+$/.test(f),"id cannot contain period character"),this.$_setFlag("id",f)):this.$_setFlag("id",void 0)}invalid(...f){return this._values(f,"_invalids")}label(f){return l(f&&typeof f=="string","Label name must be a non-empty string"),this.$_setFlag("label",f)}meta(f){return l(f!==void 0,"Meta cannot be undefined"),this._inner("metas",f,{single:!0})}note(...f){l(f.length,"Missing notes");for(const v of f)l(v&&typeof v=="string","Notes must be non-empty strings");return this._inner("notes",f)}only(f=!0){return l(typeof f=="boolean","Invalid mode:",f),this.$_setFlag("only",f)}optional(){return this.presence("optional")}prefs(f){l(f,"Missing preferences"),l(f.context===void 0,"Cannot override context"),l(f.externals===void 0,"Cannot override externals"),l(f.warnings===void 0,"Cannot override warnings"),l(f.debug===void 0,"Cannot override debug"),a.checkPreferences(f);const v=this.clone();return v._preferences=a.preferences(v._preferences,f),v}presence(f){return l(["optional","required","forbidden"].includes(f),"Unknown presence mode",f),this.$_setFlag("presence",f)}raw(f=!0){return this.$_setFlag("result",f?"raw":void 0)}result(f){return l(["raw","strip"].includes(f),"Unknown result mode",f),this.$_setFlag("result",f)}required(){return this.presence("required")}strict(f){const v=this.clone(),x=f!==void 0&&!f;return v._preferences=a.preferences(v._preferences,{convert:x}),v}strip(f=!0){return this.$_setFlag("result",f?"strip":void 0)}tag(...f){l(f.length,"Missing tags");for(const v of f)l(v&&typeof v=="string","Tags must be non-empty strings");return this._inner("tags",f)}unit(f){return l(f&&typeof f=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",f)}valid(...f){a.verifyFlat(f,"valid");const v=this.allow(...f);return v.$_setFlag("only",!!v._valids,{clone:!1}),v}when(f,v){const x=this.clone();x.$_terms.whens||(x.$_terms.whens=[]);const E=i.when(x,f,v);if(!["any","link"].includes(x.type)){const N=E.is?[E]:E.switch;for(const M of N)l(!M.then||M.then.type==="any"||M.then.type===x.type,"Cannot combine",x.type,"with",M.then&&M.then.type),l(!M.otherwise||M.otherwise.type==="any"||M.otherwise.type===x.type,"Cannot combine",x.type,"with",M.otherwise&&M.otherwise.type)}return x.$_terms.whens.push(E),x.$_mutateRebuild()}cache(f){l(!this._inRuleset(),"Cannot set caching inside a ruleset"),l(!this._cache,"Cannot override schema cache"),l(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const v=this.clone();return v._cache=f||e.provider.provision(),v.$_temp.ruleset=!1,v}clone(){const f=Object.create(Object.getPrototypeOf(this));return this._assign(f)}concat(f){l(a.isSchema(f),"Invalid schema object"),l(this.type==="any"||f.type==="any"||f.type===this.type,"Cannot merge type",this.type,"with another type:",f.type),l(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),l(!f._inRuleset(),"Cannot concatenate a schema with open ruleset");let v=this.clone();if(this.type==="any"&&f.type!=="any"){const x=f.clone();for(const E of Object.keys(v))E!=="type"&&(x[E]=v[E]);v=x}v._ids.concat(f._ids),v._refs.register(f,h.toSibling),v._preferences=v._preferences?a.preferences(v._preferences,f._preferences):f._preferences,v._valids=j.merge(v._valids,f._valids,f._invalids),v._invalids=j.merge(v._invalids,f._invalids,f._valids);for(const x of f._singleRules.keys())v._singleRules.has(x)&&(v._rules=v._rules.filter(E=>E.keep||E.name!==x),v._singleRules.delete(x));for(const x of f._rules)f._definition.rules[x.method].multi||v._singleRules.set(x.name,x),v._rules.push(x);if(v._flags.empty&&f._flags.empty){v._flags.empty=v._flags.empty.concat(f._flags.empty);const x=Object.assign({},f._flags);delete x.empty,m(v._flags,x)}else if(f._flags.empty){v._flags.empty=f._flags.empty;const x=Object.assign({},f._flags);delete x.empty,m(v._flags,x)}else m(v._flags,f._flags);for(const x in f.$_terms){const E=f.$_terms[x];E?v.$_terms[x]?v.$_terms[x]=v.$_terms[x].concat(E):v.$_terms[x]=E.slice():v.$_terms[x]||(v.$_terms[x]=E)}return this.$_root._tracer&&this.$_root._tracer._combine(v,[this,f]),v.$_mutateRebuild()}extend(f){return l(!f.base,"Cannot extend type with another base"),t.type(this,f)}extract(f){return f=Array.isArray(f)?f:f.split("."),this._ids.reach(f)}fork(f,v){l(!this._inRuleset(),"Cannot fork inside a ruleset");let x=this;for(let E of[].concat(f))E=Array.isArray(E)?E:E.split("."),x=x._ids.fork(E,v,x);return x.$_temp.ruleset=!1,x}rule(f){const v=this._definition;a.assertOptions(f,Object.keys(v.modifiers)),l(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const x=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;l(x>=0&&x<this._rules.length,"Cannot apply rules to empty ruleset");const E=this.clone();for(let N=x;N<E._rules.length;++N){const M=E._rules[N],n=$(M);for(const d in f)v.modifiers[d](n,f[d]),l(n.name===M.name,"Cannot change rule name");E._rules[N]=n,E._singleRules.get(n.name)===M&&E._singleRules.set(n.name,n)}return E.$_temp.ruleset=!1,E.$_mutateRebuild()}get ruleset(){l(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const f=this.clone();return f.$_temp.ruleset=f._rules.length,f}get $(){return this.ruleset}tailor(f){f=[].concat(f),l(!this._inRuleset(),"Cannot tailor inside a ruleset");let v=this;if(this.$_terms.alterations)for(const{target:x,adjuster:E}of this.$_terms.alterations)f.includes(x)&&(v=E(v),l(a.isSchema(v),"Alteration adjuster for",x,"failed to return a schema object"));return v=v.$_modify({each:x=>x.tailor(f),ref:!1}),v.$_temp.ruleset=!1,v.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(f,v){return b.entry(f,this,v)}validateAsync(f,v){return b.entryAsync(f,this,v)}$_addRule(f){typeof f=="string"&&(f={name:f}),l(f&&typeof f=="object","Invalid options"),l(f.name&&typeof f.name=="string","Invalid rule name");for(const M in f)l(M[0]!=="_","Cannot set private rule properties");const v=Object.assign({},f);v._resolve=[],v.method=v.method||v.name;const x=this._definition.rules[v.method],E=v.args;l(x,"Unknown rule",v.method);const N=this.clone();if(E){l(Object.keys(E).length===1||Object.keys(E).length===this._definition.rules[v.name].args.length,"Invalid rule definition for",this.type,v.name);for(const M in E){let n=E[M];if(x.argsByName){const d=x.argsByName.get(M);if(d.ref&&a.isResolvable(n))v._resolve.push(M),N.$_mutateRegister(n);else if(d.normalize&&(n=d.normalize(n),E[M]=n),d.assert){const _=a.validateArg(n,M,d);l(!_,_,"or reference")}}n!==void 0?E[M]=n:delete E[M]}}return x.multi||(N._ruleRemove(v.name,{clone:!1}),N._singleRules.set(v.name,v)),N.$_temp.ruleset===!1&&(N.$_temp.ruleset=null),x.priority?N._rules.unshift(v):N._rules.push(v),N}$_compile(f,v){return i.schema(this.$_root,f,v)}$_createError(f,v,x,E,N,M={}){const n=M.flags!==!1?this._flags:{},d=M.messages?s.merge(this._definition.messages,M.messages):this._definition.messages;return new r.Report(f,v,x,n,d,E,N)}$_getFlag(f){return this._flags[f]}$_getRule(f){return this._singleRules.get(f)}$_mapLabels(f){return f=Array.isArray(f)?f:f.split("."),this._ids.labels(f)}$_match(f,v,x,E){(x=Object.assign({},x)).abortEarly=!0,x._externals=!1,v.snapshot();const N=!b.validate(f,this,v,x,E).errors;return v.restore(),N}$_modify(f){return a.assertOptions(f,["each","once","ref","schema"]),o.schema(this,f)||this}$_mutateRebuild(){return l(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(f,{source:v,name:x,path:E,key:N})=>{const M=this._definition[v][x]&&this._definition[v][x].register;M!==!1&&this.$_mutateRegister(f,{family:M,key:N})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(f,{family:v,key:x}={}){this._refs.register(f,v),this._ids.register(f,{key:x})}$_property(f){return this._definition.properties[f]}$_reach(f){return this._ids.reach(f)}$_rootReferences(){return this._refs.roots()}$_setFlag(f,v,x={}){l(f[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const E=this._definition.flags[f]||{};if(y(v,E.default)&&(v=void 0),y(v,this._flags[f]))return this;const N=x.clone!==!1?this.clone():this;return v!==void 0?(N._flags[f]=v,N.$_mutateRegister(v)):delete N._flags[f],f[0]!=="_"&&(N.$_temp.ruleset=!1),N}$_parent(f,...v){return this[f][a.symbols.parent].call(this,...v)}$_validate(f,v,x){return b.validate(f,this,v,x)}_assign(f){f.type=this.type,f.$_root=this.$_root,f.$_temp=Object.assign({},this.$_temp),f.$_temp.whens={},f._ids=this._ids.clone(),f._preferences=this._preferences,f._valids=this._valids&&this._valids.clone(),f._invalids=this._invalids&&this._invalids.clone(),f._rules=this._rules.slice(),f._singleRules=$(this._singleRules,{shallow:!0}),f._refs=this._refs.clone(),f._flags=Object.assign({},this._flags),f._cache=null,f.$_terms={};for(const v in this.$_terms)f.$_terms[v]=this.$_terms[v]?this.$_terms[v].slice():null;f.$_super={};for(const v in this.$_super)f.$_super[v]=this._super[v].bind(f);return f}_bare(){const f=this.clone();f._reset();const v=f._definition.terms;for(const x in v){const E=v[x];f.$_terms[x]=E.init}return f.$_mutateRebuild()}_default(f,v,x={}){return a.assertOptions(x,"literal"),l(v!==void 0,"Missing",f,"value"),l(typeof v=="function"||!x.literal,"Only function value supports literal option"),typeof v=="function"&&x.literal&&(v={[a.symbols.literal]:!0,literal:v}),this.$_setFlag(f,v)}_generate(f,v,x){if(!this.$_terms.whens)return{schema:this};const E=[],N=[];for(let d=0;d<this.$_terms.whens.length;++d){const _=this.$_terms.whens[d];if(_.concat){E.push(_.concat),N.push(`${d}.concat`);continue}const R=_.ref?_.ref.resolve(f,v,x):f,O=_.is?[_]:_.switch,C=N.length;for(let D=0;D<O.length;++D){const{is:S,then:u,otherwise:A}=O[D],z=`${d}${_.switch?"."+D:""}`;if(S.$_match(R,v.nest(S,`${z}.is`),x)){if(u){const F=v.localize([...v.path,`${z}.then`],v.ancestors,v.schemas),{schema:J,id:W}=u._generate(f,F,x);E.push(J),N.push(`${z}.then${W?`(${W})`:""}`);break}}else if(A){const F=v.localize([...v.path,`${z}.otherwise`],v.ancestors,v.schemas),{schema:J,id:W}=A._generate(f,F,x);E.push(J),N.push(`${z}.otherwise${W?`(${W})`:""}`);break}}if(_.break&&N.length>C)break}const M=N.join(", ");if(v.mainstay.tracer.debug(v,"rule","when",M),!M)return{schema:this};if(!v.mainstay.tracer.active&&this.$_temp.whens[M])return{schema:this.$_temp.whens[M],id:M};let n=this;this._definition.generate&&(n=this._definition.generate(this,f,v,x));for(const d of E)n=n.concat(d);return this.$_root._tracer&&this.$_root._tracer._combine(n,[this,...E]),this.$_temp.whens[M]=n,{schema:n,id:M}}_inner(f,v,x={}){l(!this._inRuleset(),`Cannot set ${f} inside a ruleset`);const E=this.clone();return E.$_terms[f]&&!x.override||(E.$_terms[f]=[]),x.single?E.$_terms[f].push(v):E.$_terms[f].push(...v),E.$_temp.ruleset=!1,E}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(f,v={}){if(!this._singleRules.has(f))return this;const x=v.clone!==!1?this.clone():this;x._singleRules.delete(f);const E=[];for(let N=0;N<x._rules.length;++N){const M=x._rules[N];M.name!==f||M.keep?E.push(M):x._inRuleset()&&N<x.$_temp.ruleset&&--x.$_temp.ruleset}return x._rules=E,x}_values(f,v){a.verifyFlat(f,v.slice(1,-1));const x=this.clone(),E=f[0]===a.symbols.override;if(E&&(f=f.slice(1)),!x[v]&&f.length?x[v]=new j:E&&(x[v]=f.length?new j:null,x.$_mutateRebuild()),!x[v])return x;E&&x[v].override();for(const N of f){l(N!==void 0,"Cannot call allow/valid/invalid with undefined"),l(N!==a.symbols.override,"Override must be the first value");const M=v==="_invalids"?"_valids":"_invalids";x[M]&&(x[M].remove(N),x[M].length||(l(v==="_valids"||!x._flags.only,"Setting invalid value",N,"leaves schema rejecting all values due to previous valid rule"),x[M]=null)),x[v].add(N,x._refs)}return x}}};k.Base.prototype[a.symbols.any]={version:a.version,compile:i.compile,root:"$_root"},k.Base.prototype.isImmutable=!0,k.Base.prototype.deny=k.Base.prototype.invalid,k.Base.prototype.disallow=k.Base.prototype.invalid,k.Base.prototype.equal=k.Base.prototype.valid,k.Base.prototype.exist=k.Base.prototype.required,k.Base.prototype.not=k.Base.prototype.invalid,k.Base.prototype.options=k.Base.prototype.prefs,k.Base.prototype.preferences=k.Base.prototype.prefs,L.exports=new k.Base},8652:(L,p,w)=>{const l=w(375),$=w(8571),y=w(8160),m={max:1e3,supported:new Set(["undefined","boolean","number","string"])};p.provider={provision:e=>new m.Cache(e)},m.Cache=class{constructor(e={}){y.assertOptions(e,["max"]),l(e.max===void 0||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||m.max,this._map=new Map,this._list=new m.List}get length(){return this._map.size}set(e,a){if(e!==null&&!m.supported.has(typeof e))return;let i=this._map.get(e);if(i)return i.value=a,void this._list.first(i);i=this._list.unshift({key:e,value:a}),this._map.set(e,i),this._compact()}get(e){const a=this._map.get(e);if(a)return this._list.first(a),$(a.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},m.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:a,prev:i}=e;return a.prev=i,i&&(i.next=a),e===this.tail&&(this.tail=a),e.prev=null,e.next=null,e}}},8160:(L,p,w)=>{const l=w(375),$=w(7916),y=w(5934);let m,e;const a={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};p.version=y.version,p.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},p.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")},p.assertOptions=function(i,r,t="Options"){l(i&&typeof i=="object"&&!Array.isArray(i),"Options must be of type object");const c=Object.keys(i).filter(s=>!r.includes(s));l(c.length===0,`${t} contain unknown keys: ${c}`)},p.checkPreferences=function(i){e=e||w(3378);const r=e.preferences.validate(i);if(r.error)throw new $([r.error.details[0].message])},p.compare=function(i,r,t){switch(t){case"=":return i===r;case">":return i>r;case"<":return i<r;case">=":return i>=r;case"<=":return i<=r}},p.default=function(i,r){return i===void 0?r:i},p.isIsoDate=function(i){return a.isoDate.test(i)},p.isNumber=function(i){return typeof i=="number"&&!isNaN(i)},p.isResolvable=function(i){return!!i&&(i[p.symbols.ref]||i[p.symbols.template])},p.isSchema=function(i,r={}){const t=i&&i[p.symbols.any];return!!t&&(l(r.legacy||t.version===p.version,"Cannot mix different versions of joi schemas"),!0)},p.isValues=function(i){return i[p.symbols.values]},p.limit=function(i){return Number.isSafeInteger(i)&&i>=0},p.preferences=function(i,r){m=m||w(6914),i=i||{},r=r||{};const t=Object.assign({},i,r);return r.errors&&i.errors&&(t.errors=Object.assign({},i.errors,r.errors),t.errors.wrap=Object.assign({},i.errors.wrap,r.errors.wrap)),r.messages&&(t.messages=m.compile(r.messages,i.messages)),delete t[p.symbols.prefs],t},p.tryWithPath=function(i,r,t={}){try{return i()}catch(c){throw c.path!==void 0?c.path=r+"."+c.path:c.path=r,t.append&&(c.message=`${c.message} (${c.path})`),c}},p.validateArg=function(i,r,{assert:t,message:c}){if(p.isSchema(t)){const s=t.validate(i);return s.error?s.error.message:void 0}if(!t(i))return r?`${r} ${c}`:c},p.verifyFlat=function(i,r){for(const t of i)l(!Array.isArray(t),"Method no longer accepts array arguments:",r)}},3292:(L,p,w)=>{const l=w(375),$=w(8160),y=w(6133),m={};p.schema=function(e,a,i={}){$.assertOptions(i,["appendPath","override"]);try{return m.schema(e,a,i)}catch(r){throw i.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},m.schema=function(e,a,i){l(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(l(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const r=(t,...c)=>i.override!==!1?t.valid(e.override,...c):t.valid(...c);if(m.simple(a))return r(e,a);if(typeof a=="function")return e.custom(a);if(l(typeof a=="object","Invalid schema content:",typeof a),$.isResolvable(a))return r(e,a);if($.isSchema(a))return a;if(Array.isArray(a)){for(const t of a)if(!m.simple(t))return e.alternatives().try(...a);return r(e,...a)}return a instanceof RegExp?e.string().regex(a):a instanceof Date?r(e.date(),a):(l(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(a))},p.ref=function(e,a){return y.isRef(e)?e:y.create(e,a)},p.compile=function(e,a,i={}){$.assertOptions(i,["legacy"]);const r=a&&a[$.symbols.any];if(r)return l(i.legacy||r.version===$.version,"Cannot mix different versions of joi schemas:",r.version,$.version),a;if(typeof a!="object"||!i.legacy)return p.schema(e,a,{appendPath:!0});const t=m.walk(a);return t?t.compile(t.root,a):p.schema(e,a,{appendPath:!0})},m.walk=function(e){if(typeof e!="object")return null;if(Array.isArray(e)){for(const i of e){const r=m.walk(i);if(r)return r}return null}const a=e[$.symbols.any];if(a)return{root:e[a.root],compile:a.compile};l(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const i in e){const r=m.walk(e[i]);if(r)return r}return null},m.simple=function(e){return e===null||["boolean","string","number"].includes(typeof e)},p.when=function(e,a,i){if(i===void 0&&(l(a&&typeof a=="object","Missing options"),i=a,a=y.create(".")),Array.isArray(i)&&(i={switch:i}),$.assertOptions(i,["is","not","then","otherwise","switch","break"]),$.isSchema(a))return l(i.is===void 0,'"is" can not be used with a schema condition'),l(i.not===void 0,'"not" can not be used with a schema condition'),l(i.switch===void 0,'"switch" can not be used with a schema condition'),m.condition(e,{is:a,then:i.then,otherwise:i.otherwise,break:i.break});if(l(y.isRef(a)||typeof a=="string","Invalid condition:",a),l(i.not===void 0||i.is===void 0,'Cannot combine "is" with "not"'),i.switch===void 0){let t=i;i.not!==void 0&&(t={is:i.not,then:i.otherwise,otherwise:i.then,break:i.break});let c=t.is!==void 0?e.$_compile(t.is):e.$_root.invalid(null,!1,0,"").required();return l(t.then!==void 0||t.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),l(t.break===void 0||t.then===void 0||t.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),i.is===void 0||y.isRef(i.is)||$.isSchema(i.is)||(c=c.required()),m.condition(e,{ref:p.ref(a),is:c,then:t.then,otherwise:t.otherwise,break:t.break})}l(Array.isArray(i.switch),'"switch" must be an array'),l(i.is===void 0,'Cannot combine "switch" with "is"'),l(i.not===void 0,'Cannot combine "switch" with "not"'),l(i.then===void 0,'Cannot combine "switch" with "then"');const r={ref:p.ref(a),switch:[],break:i.break};for(let t=0;t<i.switch.length;++t){const c=i.switch[t],s=t===i.switch.length-1;$.assertOptions(c,s?["is","then","otherwise"]:["is","then"]),l(c.is!==void 0,'Switch statement missing "is"'),l(c.then!==void 0,'Switch statement missing "then"');const o={is:e.$_compile(c.is),then:e.$_compile(c.then)};if(y.isRef(c.is)||$.isSchema(c.is)||(o.is=o.is.required()),s){l(i.otherwise===void 0||c.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const h=i.otherwise!==void 0?i.otherwise:c.otherwise;h!==void 0&&(l(r.break===void 0,"Cannot specify both otherwise and break"),o.otherwise=e.$_compile(h))}r.switch.push(o)}return r},m.condition=function(e,a){for(const i of["then","otherwise"])a[i]===void 0?delete a[i]:a[i]=e.$_compile(a[i]);return a}},6354:(L,p,w)=>{const l=w(5688),$=w(8160),y=w(3328);p.Report=class{constructor(m,e,a,i,r,t,c){if(this.code=m,this.flags=i,this.messages=r,this.path=t.path,this.prefs=c,this.state=t,this.value=e,this.message=null,this.template=null,this.local=a||{},this.local.label=p.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const s=this.path[this.path.length-1];typeof s!="object"&&(this.local.key=s)}}_setTemplate(m){if(this.template=m,!this.flags.label&&this.path.length===0){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const m=this.code;if(!this.prefs.errors.render)return this.code;const e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${m}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(m,e){return p.template(this.value,m,e||this.code,this.state,this.prefs)}},p.path=function(m){let e="";for(const a of m)typeof a!="object"&&(typeof a=="string"?(e&&(e+="."),e+=a):e+=`[${a}]`);return e},p.template=function(m,e,a,i,r){if(!e)return;if(y.isTemplate(e))return a!=="root"?e:null;let t=r.errors.language;if($.isResolvable(t)&&(t=t.resolve(m,i,r)),t&&e[t]){if(e[t][a]!==void 0)return e[t][a];if(e[t]["*"]!==void 0)return e[t]["*"]}return e[a]?e[a]:e["*"]},p.label=function(m,e,a,i){if(!a.errors.label)return"";if(m.label)return m.label;let r=e.path;return a.errors.label==="key"&&e.path.length>1&&(r=e.path.slice(-1)),p.path(r)||p.template(null,a.messages,"root",e,a)||i&&p.template(null,i,"root",e,a)||"value"},p.process=function(m,e,a){if(!m)return null;const{override:i,message:r,details:t}=p.details(m);if(i)return i;if(a.errors.stack)return new p.ValidationError(r,t,e);const c=Error.stackTraceLimit;Error.stackTraceLimit=0;const s=new p.ValidationError(r,t,e);return Error.stackTraceLimit=c,s},p.details=function(m,e={}){let a=[];const i=[];for(const r of m){if(r instanceof Error){if(e.override!==!1)return{override:r};const c=r.toString();a.push(c),i.push({message:c,type:"override",context:{error:r}});continue}const t=r.toString();a.push(t),i.push({message:t,path:r.path.filter(c=>typeof c!="object"),type:r.code,context:r.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:i}},p.ValidationError=class extends Error{constructor(m,e,a){super(m),this._original=a,this.details=e}static isError(m){return m instanceof p.ValidationError}},p.ValidationError.prototype.isJoi=!0,p.ValidationError.prototype.name="ValidationError",p.ValidationError.prototype.annotate=l.error},8901:(L,p,w)=>{const l=w(375),$=w(8571),y=w(8160),m=w(6914),e={};p.type=function(a,i){const r=Object.getPrototypeOf(a),t=$(r),c=a._assign(Object.create(t)),s=Object.assign({},i);delete s.base,t._definition=s;const o=r._definition||{};s.messages=m.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),c.type=s.type,s.flags=Object.assign({},o.flags,s.flags);const h=Object.assign({},o.terms);if(s.terms)for(const k in s.terms){const f=s.terms[k];l(c.$_terms[k]===void 0,"Invalid term override for",s.type,k),c.$_terms[k]=f.init,h[k]=f}s.terms=h,s.args||(s.args=o.args),s.prepare=e.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=e.coerce(s.coerce,o.coerce),s.validate=e.validate(s.validate,o.validate);const g=Object.assign({},o.rules);if(s.rules)for(const k in s.rules){const f=s.rules[k];l(typeof f=="object","Invalid rule definition for",s.type,k);let v=f.method;if(v===void 0&&(v=function(){return this.$_addRule(k)}),v&&(l(!t[k],"Rule conflict in",s.type,k),t[k]=v),l(!g[k],"Rule conflict in",s.type,k),g[k]=f,f.alias){const x=[].concat(f.alias);for(const E of x)t[E]=f.method}f.args&&(f.argsByName=new Map,f.args=f.args.map(x=>(typeof x=="string"&&(x={name:x}),l(!f.argsByName.has(x.name),"Duplicated argument name",x.name),y.isSchema(x.assert)&&(x.assert=x.assert.strict().label(x.name)),f.argsByName.set(x.name,x),x)))}s.rules=g;const b=Object.assign({},o.modifiers);if(s.modifiers)for(const k in s.modifiers){l(!t[k],"Rule conflict in",s.type,k);const f=s.modifiers[k];l(typeof f=="function","Invalid modifier definition for",s.type,k);const v=function(x){return this.rule({[k]:x})};t[k]=v,b[k]=f}if(s.modifiers=b,s.overrides){t._super=r,c.$_super={};for(const k in s.overrides)l(r[k],"Cannot override missing",k),s.overrides[k][y.symbols.parent]=r[k],c.$_super[k]=r[k].bind(c);Object.assign(t,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);const j=Object.assign({},o.manifest,s.manifest);return j.build=e.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=j,s.rebuild=e.rebuild(s.rebuild,o.rebuild),c},e.build=function(a,i){return a&&i?function(r,t){return i(a(r,t),t)}:a||i},e.coerce=function(a,i){return a&&i?{from:a.from&&i.from?[...new Set([...a.from,...i.from])]:null,method(r,t){let c;if((!i.from||i.from.includes(typeof r))&&(c=i.method(r,t),c)){if(c.errors||c.value===void 0)return c;r=c.value}if(!a.from||a.from.includes(typeof r)){const s=a.method(r,t);if(s)return s}return c}}:a||i},e.prepare=function(a,i){return a&&i?function(r,t){const c=a(r,t);if(c){if(c.errors||c.value===void 0)return c;r=c.value}return i(r,t)||c}:a||i},e.rebuild=function(a,i){return a&&i?function(r){i(r),a(r)}:a||i},e.validate=function(a,i){return a&&i?function(r,t){const c=i(r,t);if(c){if(c.errors&&(!Array.isArray(c.errors)||c.errors.length))return c;r=c.value}return a(r,t)||c}:a||i}},5107:(L,p,w)=>{const l=w(375),$=w(8571),y=w(8652),m=w(8160),e=w(3292),a=w(6354),i=w(8901),r=w(9708),t=w(6133),c=w(3328),s=w(1152);let o;const h={types:{alternatives:w(4946),any:w(8068),array:w(546),boolean:w(4937),date:w(7500),function:w(390),link:w(8785),number:w(3832),object:w(8966),string:w(7417),symbol:w(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const g={_types:new Set(Object.keys(h.types))};for(const b of g._types)g[b]=function(...j){return l(!j.length||["alternatives","link","object"].includes(b),"The",b,"type does not allow arguments"),h.generate(this,h.types[b],j)};for(const b of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])g[b]=function(...j){return this.any()[b](...j)};Object.assign(g,h.methods);for(const b in h.aliases){const j=h.aliases[b];g[b]=g[j]}return g.x=g.expression,s.setup&&s.setup(g),g}};h.methods={ValidationError:a.ValidationError,version:m.version,cache:y.provider,assert(g,b,...j){h.assert(g,b,!0,j)},attempt:(g,b,...j)=>h.assert(g,b,!1,j),build(g){return l(typeof r.build=="function","Manifest functionality disabled"),r.build(this,g)},checkPreferences(g){m.checkPreferences(g)},compile(g,b){return e.compile(this,g,b)},defaults(g){l(typeof g=="function","modifier must be a function");const b=Object.assign({},this);for(const j of b._types){const k=g(b[j]());l(m.isSchema(k),"modifier must return a valid schema object"),b[j]=function(...f){return h.generate(this,k,f)}}return b},expression:(...g)=>new c(...g),extend(...g){m.verifyFlat(g,"extend"),o=o||w(3378),l(g.length,"You need to provide at least one extension"),this.assert(g,o.extensions);const b=Object.assign({},this);b._types=new Set(b._types);for(let j of g){typeof j=="function"&&(j=j(b)),this.assert(j,o.extension);const k=h.expandExtension(j,b);for(const f of k){l(b[f.type]===void 0||b._types.has(f.type),"Cannot override name",f.type);const v=f.base||this.any(),x=i.type(v,f);b._types.add(f.type),b[f.type]=function(...E){return h.generate(this,x,E)}}}return b},isError:a.ValidationError.isError,isExpression:c.isTemplate,isRef:t.isRef,isSchema:m.isSchema,in:(...g)=>t.in(...g),override:m.symbols.override,ref:(...g)=>t.create(...g),types(){const g={};for(const b of this._types)g[b]=this[b]();for(const b in h.aliases)g[b]=this[b]();return g}},h.assert=function(g,b,j,k){const f=k[0]instanceof Error||typeof k[0]=="string"?k[0]:null,v=f!==null?k[1]:k[0],x=b.validate(g,m.preferences({errors:{stack:!0}},v||{}));let E=x.error;if(!E)return x.value;if(f instanceof Error)throw f;const N=j&&typeof E.annotate=="function"?E.annotate():E.message;throw E instanceof a.ValidationError==0&&(E=$(E)),E.message=f?`${f} ${N}`:N,E},h.generate=function(g,b,j){return l(g,"Must be invoked on a Joi instance."),b.$_root=g,b._definition.args&&j.length?b._definition.args(b,...j):b},h.expandExtension=function(g,b){if(typeof g.type=="string")return[g];const j=[];for(const k of b._types)if(g.type.test(k)){const f=Object.assign({},g);f.type=k,f.base=b[k](),j.push(f)}return j},L.exports=h.root()},6914:(L,p,w)=>{const l=w(375),$=w(8571),y=w(3328);p.compile=function(m,e){if(typeof m=="string")return l(!e,"Cannot set single message string"),new y(m);if(y.isTemplate(m))return l(!e,"Cannot set single message template"),m;l(typeof m=="object"&&!Array.isArray(m),"Invalid message options"),e=e?$(e):{};for(let a in m){const i=m[a];if(a==="root"||y.isTemplate(i)){e[a]=i;continue}if(typeof i=="string"){e[a]=new y(i);continue}l(typeof i=="object"&&!Array.isArray(i),"Invalid message for",a);const r=a;for(a in e[r]=e[r]||{},i){const t=i[a];a==="root"||y.isTemplate(t)?e[r][a]=t:(l(typeof t=="string","Invalid message for",a,"in",r),e[r][a]=new y(t))}}return e},p.decompile=function(m){const e={};for(let a in m){const i=m[a];if(a==="root"){e.root=i;continue}if(y.isTemplate(i)){e[a]=i.describe({compact:!0});continue}const r=a;for(a in e[r]={},i){const t=i[a];a!=="root"?e[r][a]=t.describe({compact:!0}):e[r].root=t}}return e},p.merge=function(m,e){if(!m)return p.compile(e);if(!e)return m;if(typeof e=="string")return new y(e);if(y.isTemplate(e))return e;const a=$(m);for(let i in e){const r=e[i];if(i==="root"||y.isTemplate(r)){a[i]=r;continue}if(typeof r=="string"){a[i]=new y(r);continue}l(typeof r=="object"&&!Array.isArray(r),"Invalid message for",i);const t=i;for(i in a[t]=a[t]||{},r){const c=r[i];i==="root"||y.isTemplate(c)?a[t][i]=c:(l(typeof c=="string","Invalid message for",i,"in",t),a[t][i]=new y(c))}}return a}},2294:(L,p,w)=>{const l=w(375),$=w(8160),y=w(6133),m={};p.Ids=m.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new m.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[a,i]of e._byId.entries())l(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,i);for(const[a,i]of e._byKey.entries())l(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,i)}fork(e,a,i){const r=this._collect(e);r.push({schema:i});const t=r.shift();let c={id:t.id,schema:a(t.schema)};l($.isSchema(c.schema),"adjuster function failed to return a joi schema type");for(const s of r)c={id:s.id,schema:m.fork(s.schema,c.id,c.schema)};return c.schema}labels(e,a=[]){const i=e[0],r=this._get(i);if(!r)return[...a,...e].join(".");const t=e.slice(1);return a=[...a,r.schema._flags.label||i],t.length?r.schema._ids.labels(t,a):a.join(".")}reach(e,a=[]){const i=e[0],r=this._get(i);l(r,"Schema does not contain path",[...a,...e].join("."));const t=e.slice(1);return t.length?r.schema._ids.reach(t,[...a,i]):r.schema}register(e,{key:a}={}){if(!e||!$.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const i=e._flags.id;if(i){const r=this._byId.get(i);l(!r||r.schema===e,"Cannot add different schemas with the same id:",i),l(!this._byKey.has(i),"Schema id conflicts with existing key:",i),this._byId.set(i,{schema:e,id:i})}a&&(l(!this._byKey.has(a),"Schema already contains key:",a),l(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:e,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,a=[],i=[]){const r=e[0],t=this._get(r);l(t,"Schema does not contain path",[...a,...e].join(".")),i=[t,...i];const c=e.slice(1);return c.length?t.schema._ids._collect(c,[...a,r],i):i}_get(e){return this._byId.get(e)||this._byKey.get(e)}},m.fork=function(e,a,i){const r=p.schema(e,{each:(t,{key:c})=>{if(a===(t._flags.id||c))return i},ref:!1});return r?r.$_mutateRebuild():e},p.schema=function(e,a){let i;for(const r in e._flags){if(r[0]==="_")continue;const t=m.scan(e._flags[r],{source:"flags",name:r},a);t!==void 0&&(i=i||e.clone(),i._flags[r]=t)}for(let r=0;r<e._rules.length;++r){const t=e._rules[r],c=m.scan(t.args,{source:"rules",name:t.name},a);if(c!==void 0){i=i||e.clone();const s=Object.assign({},t);s.args=c,i._rules[r]=s,i._singleRules.get(t.name)===t&&i._singleRules.set(t.name,s)}}for(const r in e.$_terms){if(r[0]==="_")continue;const t=m.scan(e.$_terms[r],{source:"terms",name:r},a);t!==void 0&&(i=i||e.clone(),i.$_terms[r]=t)}return i},m.scan=function(e,a,i,r,t){const c=r||[];if(e===null||typeof e!="object")return;let s;if(Array.isArray(e)){for(let o=0;o<e.length;++o){const h=a.source==="terms"&&a.name==="keys"&&e[o].key,g=m.scan(e[o],a,i,[o,...c],h);g!==void 0&&(s=s||e.slice(),s[o]=g)}return s}if(i.schema!==!1&&$.isSchema(e)||i.ref!==!1&&y.isRef(e)){const o=i.each(e,{...a,path:c,key:t});return o===e?void 0:o}for(const o in e){if(o[0]==="_")continue;const h=m.scan(e[o],a,i,[o,...c],t);h!==void 0&&(s=s||Object.assign({},e),s[o]=h)}return s}},6133:(L,p,w)=>{const l=w(375),$=w(8571),y=w(9621),m=w(8160);let e;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};p.create=function(i,r={}){l(typeof i=="string","Invalid reference key:",i),m.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),l(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const t=Object.assign({},a.defaults,r);delete t.prefix;const c=t.separator,s=a.context(i,c,r.prefix);if(t.type=s.type,i=s.key,t.type==="value")if(s.root&&(l(!c||i[0]!==c,"Cannot specify relative path with root prefix"),t.ancestor="root",i||(i=null)),c&&c===i)i=null,t.ancestor=0;else if(t.ancestor!==void 0)l(!c||!i||i[0]!==c,"Cannot combine prefix with ancestor option");else{const[o,h]=a.ancestor(i,c);h&&(i=i.slice(h))===""&&(i=null),t.ancestor=o}return t.path=c?i===null?[]:i.split(c):[i],new a.Ref(t)},p.in=function(i,r={}){return p.create(i,{...r,in:!0})},p.isRef=function(i){return!!i&&!!i[m.symbols.ref]},a.Ref=class{constructor(i){l(typeof i=="object","Invalid reference construction"),m.assertOptions(i,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),l([!1,void 0].includes(i.separator)||typeof i.separator=="string"&&i.separator.length===1,"Invalid separator"),l(!i.adjust||typeof i.adjust=="function","options.adjust must be a function"),l(!i.map||Array.isArray(i.map),"options.map must be an array"),l(!i.map||!i.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,i),l(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(i,r,t,c,s={}){return l(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(t.context,r,s):this.type==="local"?this._resolve(c,r,s):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,s):(l(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,s)):this._resolve(i,r,s)}_resolve(i,r,t){let c;if(this.type==="value"&&r.mainstay.shadow&&t.shadow!==!1&&(c=r.mainstay.shadow.get(this.absolute(r))),c===void 0&&(c=y(i,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(c=this.adjust(c)),this.map){const s=this.map.get(c);s!==void 0&&(c=s)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,c),c}toString(){return this.display}absolute(i){return[...i.path.slice(0,-this.ancestor),...this.path]}clone(){return new a.Ref(this)}describe(){const i={path:this.path};this.type!=="value"&&(i.type=this.type),this.separator!=="."&&(i.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(i.ancestor=this.ancestor),this.map&&(i.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(i[r]=this[r]);return this.in!==!1&&(i.in=!0),{ref:i}}updateDisplay(){const i=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${i}`);if(!this.separator)return void(this.display=`ref:${i}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${i}`);if(this.ancestor==="root")return void(this.display=`ref:root:${i}`);if(this.ancestor===1)return void(this.display=`ref:${i||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${i||""}`}},a.Ref.prototype[m.symbols.ref]=!0,p.build=function(i){return(i=Object.assign({},a.defaults,i)).type==="value"&&i.ancestor===void 0&&(i.ancestor=1),new a.Ref(i)},a.context=function(i,r,t={}){if(i=i.trim(),t){const c=t.global===void 0?"$":t.global;if(c!==r&&i.startsWith(c))return{key:i.slice(c.length),type:"global"};const s=t.local===void 0?"#":t.local;if(s!==r&&i.startsWith(s))return{key:i.slice(s.length),type:"local"};const o=t.root===void 0?"/":t.root;if(o!==r&&i.startsWith(o))return{key:i.slice(o.length),type:"value",root:!0}}return{key:i,type:"value"}},a.ancestor=function(i,r){if(!r)return[1,0];if(i[0]!==r)return[1,0];if(i[1]!==r)return[0,1];let t=2;for(;i[t]===r;)++t;return[t-1,t]},p.toSibling=0,p.toParent=1,p.Manager=class{constructor(){this.refs=[]}register(i,r){if(i)if(r=r===void 0?p.toParent:r,Array.isArray(i))for(const t of i)this.register(t,r);else if(m.isSchema(i))for(const t of i._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else p.isRef(i)&&i.type==="value"&&i.ancestor-r>=0&&this.refs.push({ancestor:i.ancestor-r,root:i.root}),e=e||w(3328),e.isTemplate(i)&&this.register(i.refs(),r)}get length(){return this.refs.length}clone(){const i=new p.Manager;return i.refs=$(this.refs),i}reset(){this.refs=[]}roots(){return this.refs.filter(i=>!i.ancestor).map(i=>i.root)}}},3378:(L,p,w)=>{const l=w(5107),$={};$.wrap=l.string().min(1).max(2).allow(!1),p.preferences=l.object({allowUnknown:l.boolean(),abortEarly:l.boolean(),artifacts:l.boolean(),cache:l.boolean(),context:l.object(),convert:l.boolean(),dateFormat:l.valid("date","iso","string","time","utc"),debug:l.boolean(),errors:{escapeHtml:l.boolean(),label:l.valid("path","key",!1),language:[l.string(),l.object().ref()],render:l.boolean(),stack:l.boolean(),wrap:{label:$.wrap,array:$.wrap,string:$.wrap}},externals:l.boolean(),messages:l.object(),noDefaults:l.boolean(),nonEnumerables:l.boolean(),presence:l.valid("required","optional","forbidden"),skipFunctions:l.boolean(),stripUnknown:l.object({arrays:l.boolean(),objects:l.boolean()}).or("arrays","objects").allow(!0,!1),warnings:l.boolean()}).strict(),$.nameRx=/^[a-zA-Z0-9]\w*$/,$.rule=l.object({alias:l.array().items(l.string().pattern($.nameRx)).single(),args:l.array().items(l.string(),l.object({name:l.string().pattern($.nameRx).required(),ref:l.boolean(),assert:l.alternatives([l.function(),l.object().schema()]).conditional("ref",{is:!0,then:l.required()}),normalize:l.function(),message:l.string().when("assert",{is:l.function(),then:l.required()})})),convert:l.boolean(),manifest:l.boolean(),method:l.function().allow(!1),multi:l.boolean(),validate:l.function()}),p.extension=l.object({type:l.alternatives([l.string(),l.object().regex()]).required(),args:l.function(),cast:l.object().pattern($.nameRx,l.object({from:l.function().maxArity(1).required(),to:l.function().minArity(1).maxArity(2).required()})),base:l.object().schema().when("type",{is:l.object().regex(),then:l.forbidden()}),coerce:[l.function().maxArity(3),l.object({method:l.function().maxArity(3).required(),from:l.array().items(l.string()).single()})],flags:l.object().pattern($.nameRx,l.object({setter:l.string(),default:l.any()})),manifest:{build:l.function().arity(2)},messages:[l.object(),l.string()],modifiers:l.object().pattern($.nameRx,l.function().minArity(1).maxArity(2)),overrides:l.object().pattern($.nameRx,l.function()),prepare:l.function().maxArity(3),rebuild:l.function().arity(1),rules:l.object().pattern($.nameRx,$.rule),terms:l.object().pattern($.nameRx,l.object({init:l.array().allow(null).required(),manifest:l.object().pattern(/.+/,[l.valid("schema","single"),l.object({mapped:l.object({from:l.string().required(),to:l.string().required()}).required()})])})),validate:l.function().maxArity(3)}).strict(),p.extensions=l.array().items(l.object(),l.function().arity(1)).strict(),$.desc={buffer:l.object({buffer:l.string()}),func:l.object({function:l.function().required(),options:{literal:!0}}),override:l.object({override:!0}),ref:l.object({ref:l.object({type:l.valid("value","global","local"),path:l.array().required(),separator:l.string().length(1).allow(!1),ancestor:l.number().min(0).integer().allow("root"),map:l.array().items(l.array().length(2)).min(1),adjust:l.function(),iterables:l.boolean(),in:l.boolean(),render:l.boolean()}).required()}),regex:l.object({regex:l.string().min(3)}),special:l.object({special:l.valid("deep").required()}),template:l.object({template:l.string().required(),options:l.object()}),value:l.object({value:l.alternatives([l.object(),l.array()]).required()})},$.desc.entity=l.alternatives([l.array().items(l.link("...")),l.boolean(),l.function(),l.number(),l.string(),$.desc.buffer,$.desc.func,$.desc.ref,$.desc.regex,$.desc.special,$.desc.template,$.desc.value,l.link("/")]),$.desc.values=l.array().items(null,l.boolean(),l.function(),l.number().allow(1/0,-1/0),l.string().allow(""),l.symbol(),$.desc.buffer,$.desc.func,$.desc.override,$.desc.ref,$.desc.regex,$.desc.template,$.desc.value),$.desc.messages=l.object().pattern(/.+/,[l.string(),$.desc.template,l.object().pattern(/.+/,[l.string(),$.desc.template])]),p.description=l.object({type:l.string().required(),flags:l.object({cast:l.string(),default:l.any(),description:l.string(),empty:l.link("/"),failover:$.desc.entity,id:l.string(),label:l.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:l.boolean(),unit:l.string()}).unknown(),preferences:{allowUnknown:l.boolean(),abortEarly:l.boolean(),artifacts:l.boolean(),cache:l.boolean(),convert:l.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:l.boolean(),label:["path","key"],language:[l.string(),$.desc.ref],wrap:{label:$.wrap,array:$.wrap}},externals:l.boolean(),messages:$.desc.messages,noDefaults:l.boolean(),nonEnumerables:l.boolean(),presence:["required","optional","forbidden"],skipFunctions:l.boolean(),stripUnknown:l.object({arrays:l.boolean(),objects:l.boolean()}).or("arrays","objects").allow(!0,!1),warnings:l.boolean()},allow:$.desc.values,invalid:$.desc.values,rules:l.array().min(1).items({name:l.string().required(),args:l.object().min(1),keep:l.boolean(),message:[l.string(),$.desc.messages],warn:l.boolean()}),keys:l.object().pattern(/.*/,l.link("/")),link:$.desc.ref}).pattern(/^[a-z]\w*$/,l.any())},493:(L,p,w)=>{const l=w(8571),$=w(9621),y=w(8160),m={value:Symbol("value")};L.exports=m.State=class{constructor(e,a,i){this.path=e,this.ancestors=a,this.mainstay=i.mainstay,this.schemas=i.schemas,this.debug=null}localize(e,a=null,i=null){const r=new m.State(e,a,this);return i&&r.schemas&&(r.schemas=[m.schemas(i),...r.schemas]),r}nest(e,a){const i=new m.State(this.path,this.ancestors,this);return i.schemas=i.schemas&&[m.schemas(e),...i.schemas],i.debug=a,i}shadow(e,a){this.mainstay.shadow=this.mainstay.shadow||new m.Shadow,this.mainstay.shadow.set(this.path,e,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=l(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()}},m.schemas=function(e){return y.isSchema(e)?{schema:e}:e},m.Shadow=class{constructor(){this._values=null}set(e,a,i){if(!e.length||i==="strip"&&typeof e[e.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const c=e[t];let s=r.get(c);s||(s=new Map,r.set(c,s)),r=s}r[m.value]=a}get(e){const a=this.node(e);if(a)return a[m.value]}node(e){if(this._values)return $(this._values,e,{iterables:!0})}override(e,a){if(!this._values)return;const i=e.slice(0,-1),r=e[e.length-1],t=$(this._values,i,{iterables:!0});a?t.set(r,a):t&&t.delete(r)}}},3328:(L,p,w)=>{const l=w(375),$=w(8571),y=w(5277),m=w(1447),e=w(8160),a=w(6354),i=w(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}};L.exports=r.Template=class{constructor(t,c){if(l(typeof t=="string","Template source must be a string"),l(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,c){const{functions:s,...o}=c;this._settings=Object.keys(o).length?$(o):void 0,this._functions=s,this._functions&&(l(Object.keys(this._functions).every(h=>typeof h=="string"),"Functions keys must be strings"),l(Object.values(this._functions).every(h=>typeof h=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const t=r.encode(this.source),c=r.split(t);let s=!1;const o=[],h=c.shift();h&&o.push(h);for(const g of c){const b=g[0]!=="{",j=b?"}":"}}",k=g.indexOf(j);if(k===-1||g[1]==="{"){o.push(`{${r.decode(g)}`);continue}let f=g.slice(b?0:1,k);const v=f[0]===":";v&&(f=f.slice(1));const x=this._ref(r.decode(f),{raw:b,wrapped:v});o.push(x),typeof x!="string"&&(s=!0);const E=g.slice(k+j.length);E&&o.push(r.decode(E))}s?this._template=o:this.rendered=o.join("")}static date(t,c){return r.dateFormat[c.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.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(t){return new r.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return!!t&&!!t[e.symbols.template]}refs(){if(!this._template)return;const t=[];for(const c of this._template)typeof c!="string"&&t.push(...c.refs);return t}resolve(t,c,s,o){return this._template&&this._template.length===1?this._part(this._template[0],t,c,s,o,{}):this.render(t,c,s,o)}_part(t,...c){return t.ref?t.ref.resolve(...c):t.formula.evaluate(c)}render(t,c,s,o,h={}){if(!this.isDynamic())return this.rendered;const g=[];for(const b of this._template)if(typeof b=="string")g.push(b);else{const j=this._part(b,t,c,s,o,h),k=r.stringify(j,t,c,s,o,h);if(k!==void 0){const f=b.raw||(h.errors&&h.errors.escapeHtml)===!1?k:y(k);g.push(r.wrap(f,b.wrapped&&s.errors.wrap.label))}}return g.join("")}_ref(t,{raw:c,wrapped:s}){const o=[],h=b=>{const j=i.create(b,this._settings);return o.push(j),k=>{const f=j.resolve(...k);return f!==void 0?f:null}};try{const b=this._functions?{...r.functions,...this._functions}:r.functions;var g=new m.Parser(t,{reference:h,functions:b,constants:r.constants})}catch(b){throw b.message=`Invalid template variable "${t}" fails due to: ${b.message}`,b}if(g.single){if(g.single.type==="reference"){const b=o[0];return{ref:b,raw:c,refs:o,wrapped:s||b.type==="local"&&b.key==="label"}}return r.stringify(g.single.value)}return{formula:g,raw:c,refs:o}}toString(){return this.source}},r.Template.prototype[e.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(t){return t.replace(/\\(\{+)/g,(c,s)=>r.opens.slice(0,s.length)).replace(/\\(\}+)/g,(c,s)=>r.closes.slice(0,s.length))},r.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(t){const c=[];let s="";for(let o=0;o<t.length;++o){const h=t[o];if(h==="{"){let g="";for(;o+1<t.length&&t[o+1]==="{";)g+="{",++o;c.push(s),s=g}else s+=h}return c.push(s),c},r.wrap=function(t,c){return c?c.length===1?`${c}${t}${c}`:`${c[0]}${t}${c[1]}`:t},r.stringify=function(t,c,s,o,h,g={}){const b=typeof t,j=o&&o.errors&&o.errors.wrap||{};let k=!1;if(i.isRef(t)&&t.render&&(k=t.in,t=t.resolve(c,s,o,h,{in:t.in,...g})),t===null)return"null";if(b==="string")return r.wrap(t,g.arrayItems&&j.string);if(b==="number"||b==="function"||b==="symbol")return t.toString();if(b!=="object")return JSON.stringify(t);if(t instanceof Date)return r.Template.date(t,o);if(t instanceof Map){const v=[];for(const[x,E]of t.entries())v.push(`${x.toString()} -> ${E.toString()}`);t=v}if(!Array.isArray(t))return t.toString();const f=[];for(const v of t)f.push(r.stringify(v,c,s,o,h,{arrayItems:!0,...g}));return r.wrap(f.join(", "),!k&&j.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(t,c,s)=>t?c:s,length:t=>typeof t=="string"?t.length:t&&typeof t=="object"?Array.isArray(t)?t.length:Object.keys(t).length:null,msg(t){const[c,s,o,h,g]=this,b=g.messages;if(!b)return"";const j=a.template(c,b[0],t,s,o)||a.template(c,b[1],t,s,o);return j?j.render(c,s,o,h,g):""},number:t=>typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}},4946:(L,p,w)=>{const l=w(375),$=w(1687),y=w(8068),m=w(8160),e=w(3292),a=w(6354),i=w(6133),r={};L.exports=y.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:i.toSibling}},args:(t,...c)=>c.length===1&&Array.isArray(c[0])?t.try(...c[0]):t.try(...c),validate(t,c){const{schema:s,error:o,state:h,prefs:g}=c;if(s._flags.match){const j=[],k=[];for(let v=0;v<s.$_terms.matches.length;++v){const x=s.$_terms.matches[v],E=h.nest(x.schema,`match.${v}`);E.snapshot();const N=x.schema.$_validate(t,E,g);N.errors?(k.push(N.errors),E.restore()):(j.push(N.value),E.commit())}if(j.length===0)return{errors:o("alternatives.any",{details:k.map(v=>a.details(v,{override:!1}))})};if(s._flags.match==="one")return j.length===1?{value:j[0]}:{errors:o("alternatives.one")};if(j.length!==s.$_terms.matches.length)return{errors:o("alternatives.all",{details:k.map(v=>a.details(v,{override:!1}))})};const f=v=>v.$_terms.matches.some(x=>x.schema.type==="object"||x.schema.type==="alternatives"&&f(x.schema));return f(s)?{value:j.reduce((v,x)=>$(v,x,{mergeArrays:!1}))}:{value:j[j.length-1]}}const b=[];for(let j=0;j<s.$_terms.matches.length;++j){const k=s.$_terms.matches[j];if(k.schema){const x=h.nest(k.schema,`match.${j}`);x.snapshot();const E=k.schema.$_validate(t,x,g);if(!E.errors)return x.commit(),E;x.restore(),b.push({schema:k.schema,reports:E.errors});continue}const f=k.ref?k.ref.resolve(t,h,g):t,v=k.is?[k]:k.switch;for(let x=0;x<v.length;++x){const E=v[x],{is:N,then:M,otherwise:n}=E,d=`match.${j}${k.switch?"."+x:""}`;if(N.$_match(f,h.nest(N,`${d}.is`),g)){if(M)return M.$_validate(t,h.nest(M,`${d}.then`),g)}else if(n)return n.$_validate(t,h.nest(n,`${d}.otherwise`),g)}}return r.errors(b,c)},rules:{conditional:{method(t,c){l(!this._flags._endedSwitch,"Unreachable condition"),l(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),l(c.break===void 0,"Cannot use break option with alternatives conditional");const s=this.clone(),o=e.when(s,t,c),h=o.is?[o]:o.switch;for(const g of h)if(g.then&&g.otherwise){s.$_setFlag("_endedSwitch",!0,{clone:!1});break}return s.$_terms.matches.push(o),s.$_mutateRebuild()}},match:{method(t){if(l(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(const c of this.$_terms.matches)l(c.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){l(t.length,"Missing alternative schemas"),m.verifyFlat(t,"try"),l(!this._flags._endedSwitch,"Unreachable condition");const c=this.clone();for(const s of t)c.$_terms.matches.push({schema:c.$_compile(s)});return c.$_mutateRebuild()}}},overrides:{label(t){return this.$_parent("label",t).$_modify({each:(c,s)=>s.path[0]!=="is"&&typeof c._flags.label!="string"?c.label(t):void 0,ref:!1})}},rebuild(t){t.$_modify({each:c=>{m.isSchema(c)&&c.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(t,c){if(c.matches)for(const s of c.matches){const{schema:o,ref:h,is:g,not:b,then:j,otherwise:k}=s;t=o?t.try(o):h?t.conditional(h,{is:g,then:j,not:b,otherwise:k,switch:s.switch}):t.conditional(g,{then:j,otherwise:k})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),r.errors=function(t,{error:c,state:s}){if(!t.length)return{errors:c("alternatives.any")};if(t.length===1)return{errors:t[0].reports};const o=new Set,h=[];for(const{reports:g,schema:b}of t){if(g.length>1)return r.unmatched(t,c);const j=g[0];if(j instanceof a.Report==0)return r.unmatched(t,c);if(j.state.path.length!==s.path.length){h.push({type:b.type,report:j});continue}if(j.code==="any.only"){for(const v of j.local.valids)o.add(v);continue}const[k,f]=j.code.split(".");f!=="base"?h.push({type:b.type,report:j}):j.code==="object.base"?o.add(j.local.type):o.add(k)}return h.length?h.length===1?{errors:h[0].report}:r.unmatched(t,c):{errors:c("alternatives.types",{types:[...o]})}},r.unmatched=function(t,c){const s=[];for(const o of t)s.push(...o.reports);return{errors:c("alternatives.match",a.details(s,{override:!1}))}}},8068:(L,p,w)=>{const l=w(375),$=w(7629),y=w(8160),m=w(6914);L.exports=$.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,a){return l(typeof e=="function","Method must be a function"),l(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:a}})},validate(e,a,{method:i}){try{return i(e,a)}catch(r){return a.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){l(y.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const a=this.clone();return a.$_terms.shared=a.$_terms.shared||[],a.$_terms.shared.push(e),a.$_mutateRegister(e),a}},warning:{method(e,a){return l(e&&typeof e=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:a},warn:!0})},validate:(e,a,{code:i,local:r})=>a.error(i,r),args:["code","local"],multi:!0}},modifiers:{keep(e,a=!0){e.keep=a},message(e,a){e.message=m.compile(a)},warn(e,a=!0){e.warn=a}},manifest:{build(e,a){for(const i in a){const r=a[i];if(["examples","externals","metas","notes","tags"].includes(i))for(const t of r)e=e[i.slice(0,-1)](t);else if(i!=="alterations")if(i!=="whens"){if(i==="shared")for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:c,is:s,not:o,then:h,otherwise:g,concat:b}=t;e=b?e.concat(b):c?e.when(c,{is:s,not:o,then:h,otherwise:g,switch:t.switch,break:t.break}):e.when(s,{then:h,otherwise:g,break:t.break})}else{const t={};for(const{target:c,adjuster:s}of r)t[c]=s;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(L,p,w)=>{const l=w(375),$=w(9474),y=w(9621),m=w(8068),e=w(8160),a=w(3292),i={};L.exports=m.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(r,{schema:t,state:c,prefs:s}){if(!Array.isArray(r))return;const o=t.$_getRule("sort");return o?i.sort(t,r,o.args.options,c,s):void 0}},validate(r,{schema:t,error:c}){if(!Array.isArray(r)){if(t._flags.single){const s=[r];return s[e.symbols.arraySingle]=!0,{value:s}}return{errors:c("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:r}});return t.$_mutateRegister(r),t},validate(r,{state:t,prefs:c,error:s},{schema:o}){const h=[r,...t.ancestors];for(let b=0;b<r.length;++b){const j=t.localize([...t.path,b],h,o);if(o.$_match(r[b],j,c))return r}const g=o._flags.label;return g?s("array.hasKnown",{patternLabel:g}):s("array.hasUnknown",null)},multi:!0},items:{method(...r){e.verifyFlat(r,"items");const t=this.$_addRule("items");for(let c=0;c<r.length;++c){const s=e.tryWithPath(()=>this.$_compile(r[c]),c,{append:!0});t.$_terms.items.push(s)}return t.$_mutateRebuild()},validate(r,{schema:t,error:c,state:s,prefs:o,errorsArray:h}){const g=t.$_terms._requireds.slice(),b=t.$_terms.ordered.slice(),j=[...t.$_terms._inclusions,...g],k=!r[e.symbols.arraySingle];delete r[e.symbols.arraySingle];const f=h();let v=r.length;for(let x=0;x<v;++x){const E=r[x];let N=!1,M=!1;const n=k?x:new Number(x),d=[...s.path,n];if(!t._flags.sparse&&E===void 0){if(f.push(c("array.sparse",{key:n,path:d,pos:x,value:void 0},s.localize(d))),o.abortEarly)return f;b.shift();continue}const _=[r,...s.ancestors];for(const D of t.$_terms._exclusions)if(D.$_match(E,s.localize(d,_,D),o,{presence:"ignore"})){if(f.push(c("array.excludes",{pos:x,value:E},s.localize(d))),o.abortEarly)return f;N=!0,b.shift();break}if(N)continue;if(t.$_terms.ordered.length){if(b.length){const D=b.shift(),S=D.$_validate(E,s.localize(d,_,D),o);if(S.errors){if(f.push(...S.errors),o.abortEarly)return f}else if(D._flags.result==="strip")i.fastSplice(r,x),--x,--v;else{if(!t._flags.sparse&&S.value===void 0){if(f.push(c("array.sparse",{key:n,path:d,pos:x,value:void 0},s.localize(d))),o.abortEarly)return f;continue}r[x]=S.value}continue}if(!t.$_terms.items.length){if(f.push(c("array.orderedLength",{pos:x,limit:t.$_terms.ordered.length})),o.abortEarly)return f;break}}const R=[];let O=g.length;for(let D=0;D<O;++D){const S=s.localize(d,_,g[D]);S.snapshot();const u=g[D].$_validate(E,S,o);if(R[D]=u,!u.errors){if(S.commit(),r[x]=u.value,M=!0,i.fastSplice(g,D),--D,--O,!t._flags.sparse&&u.value===void 0&&(f.push(c("array.sparse",{key:n,path:d,pos:x,value:void 0},s.localize(d))),o.abortEarly))return f;break}S.restore()}if(M)continue;const C=o.stripUnknown&&!!o.stripUnknown.arrays||!1;O=j.length;for(const D of j){let S;const u=g.indexOf(D);if(u!==-1)S=R[u];else{const A=s.localize(d,_,D);if(A.snapshot(),S=D.$_validate(E,A,o),!S.errors){A.commit(),D._flags.result==="strip"?(i.fastSplice(r,x),--x,--v):t._flags.sparse||S.value!==void 0?r[x]=S.value:(f.push(c("array.sparse",{key:n,path:d,pos:x,value:void 0},s.localize(d))),N=!0),M=!0;break}A.restore()}if(O===1){if(C){i.fastSplice(r,x),--x,--v,M=!0;break}if(f.push(...S.errors),o.abortEarly)return f;N=!0;break}}if(!N&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!M){if(C){i.fastSplice(r,x),--x,--v;continue}if(f.push(c("array.includes",{pos:x,value:E},s.localize(d))),o.abortEarly)return f}}return g.length&&i.fillMissedErrors(t,f,g,r,s,o),b.length&&(i.fillOrderedErrors(t,f,b,r,s,o),f.length||i.fillDefault(b,r,s,o)),f.length?f:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,t,{limit:c},{name:s,operator:o,args:h})=>e.compare(r.length,c,o)?r:t.error("array."+s,{limit:h.limit,value:r}),args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"}]},max:{method(r){return this.$_addRule({name:"max",method:"length",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"length",args:{limit:r},operator:">="})}},ordered:{method(...r){e.verifyFlat(r,"ordered");const t=this.$_addRule("items");for(let c=0;c<r.length;++c){const s=e.tryWithPath(()=>this.$_compile(r[c]),c,{append:!0});i.validateSingle(s,t),t.$_mutateRegister(s),t.$_terms.ordered.push(s)}return t.$_mutateRebuild()}},single:{method(r){const t=r===void 0||!!r;return l(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(r={}){e.assertOptions(r,["by","order"]);const t={order:r.order||"ascending"};return r.by&&(t.by=a.ref(r.by,{ancestor:0}),l(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(r,{error:t,state:c,prefs:s,schema:o},{options:h}){const{value:g,errors:b}=i.sort(o,r,h,c,s);if(b)return b;for(let j=0;j<r.length;++j)if(r[j]!==g[j])return t("array.sort",{order:h.order,by:h.by?h.by.key:"value"});return r},convert:!0},sparse:{method(r){const t=r===void 0||!!r;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(r,t={}){l(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),e.assertOptions(t,["ignoreUndefined","separator"]);const c={name:"unique",args:{options:t,comparator:r}};if(r)if(typeof r=="string"){const s=e.default(t.separator,".");c.path=s?r.split(s):[r]}else c.comparator=r;return this.$_addRule(c)},validate(r,{state:t,error:c,schema:s},{comparator:o,options:h},{comparator:g,path:b}){const j={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},k=g||$,f=h.ignoreUndefined;for(let v=0;v<r.length;++v){const x=b?y(r[v],b):r[v],E=g?j.custom:j[typeof x];if(l(E,"Failed to find unique map container for type",typeof x),E instanceof Map){const N=E.entries();let M;for(;!(M=N.next()).done;)if(k(M.value[0],x)){const n=t.localize([...t.path,v],[r,...t.ancestors]),d={pos:v,value:r[v],dupePos:M.value[1],dupeValue:r[M.value[1]]};return b&&(d.path=o),c("array.unique",d,n)}E.set(x,v)}else{if((!f||x!==void 0)&&E[x]!==void 0){const N={pos:v,value:r[v],dupePos:E[x],dupeValue:r[E[x]]};return b&&(N.path=o),c("array.unique",N,t.localize([...t.path,v],[r,...t.ancestors]))}E[x]=v}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,t)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const t of r.$_terms.items)i.validateSingle(t,r),t._flags.presence==="required"?r.$_terms._requireds.push(t):t._flags.presence==="forbidden"?r.$_terms._exclusions.push(t):r.$_terms._inclusions.push(t);for(const t of r.$_terms.ordered)i.validateSingle(t,r)},manifest:{build:(r,t)=>(t.items&&(r=r.items(...t.items)),t.ordered&&(r=r.ordered(...t.ordered)),r)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),i.fillMissedErrors=function(r,t,c,s,o,h){const g=[];let b=0;for(const j of c){const k=j._flags.label;k?g.push(k):++b}g.length?b?t.push(r.$_createError("array.includesRequiredBoth",s,{knownMisses:g,unknownMisses:b},o,h)):t.push(r.$_createError("array.includesRequiredKnowns",s,{knownMisses:g},o,h)):t.push(r.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:b},o,h))},i.fillOrderedErrors=function(r,t,c,s,o,h){const g=[];for(const b of c)b._flags.presence==="required"&&g.push(b);g.length&&i.fillMissedErrors(r,t,g,s,o,h)},i.fillDefault=function(r,t,c,s){const o=[];let h=!0;for(let g=r.length-1;g>=0;--g){const b=r[g],j=[t,...c.ancestors],k=b.$_validate(void 0,c.localize(c.path,j,b),s).value;if(h){if(k===void 0)continue;h=!1}o.unshift(k)}o.length&&t.push(...o)},i.fastSplice=function(r,t){let c=t;for(;c<r.length;)r[c++]=r[c];--r.length},i.validateSingle=function(r,t){(r.type==="array"||r._flags._arrayItems)&&(l(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},i.sort=function(r,t,c,s,o){const h=c.order==="ascending"?1:-1,g=-1*h,b=h,j=(k,f)=>{let v=i.compare(k,f,g,b);if(v!==null||(c.by&&(k=c.by.resolve(k,s,o),f=c.by.resolve(f,s,o)),v=i.compare(k,f,g,b),v!==null))return v;const x=typeof k;if(x!==typeof f)throw r.$_createError("array.sort.mismatching",t,null,s,o);if(x!=="number"&&x!=="string")throw r.$_createError("array.sort.unsupported",t,{type:x},s,o);return x==="number"?(k-f)*h:k<f?g:b};try{return{value:t.slice().sort(j)}}catch(k){return{errors:k}}},i.compare=function(r,t,c,s){return r===t?0:r===void 0?1:t===void 0?-1:r===null?s:t===null?c:null}},4937:(L,p,w)=>{const l=w(375),$=w(8068),y=w(8160),m=w(2036),e={isBool:function(a){return typeof a=="boolean"}};L.exports=$.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(a,{schema:i}){if(typeof a!="boolean"){if(typeof a=="string"){const r=i._flags.sensitive?a:a.toLowerCase();a=r==="true"||r!=="false"&&a}return typeof a!="boolean"&&(a=i.$_terms.truthy&&i.$_terms.truthy.has(a,null,null,!i._flags.sensitive)||(!i.$_terms.falsy||!i.$_terms.falsy.has(a,null,null,!i._flags.sensitive))&&a),{value:a}}},validate(a,{error:i}){if(typeof a!="boolean")return{value:a,errors:i("boolean.base")}},rules:{truthy:{method(...a){y.verifyFlat(a,"truthy");const i=this.clone();i.$_terms.truthy=i.$_terms.truthy||new m;for(let r=0;r<a.length;++r){const t=a[r];l(t!==void 0,"Cannot call truthy with undefined"),i.$_terms.truthy.add(t)}return i}},falsy:{method(...a){y.verifyFlat(a,"falsy");const i=this.clone();i.$_terms.falsy=i.$_terms.falsy||new m;for(let r=0;r<a.length;++r){const t=a[r];l(t!==void 0,"Cannot call falsy with undefined"),i.$_terms.falsy.add(t)}return i}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:e.isBool,to:(a,i)=>a?1:0},string:{from:e.isBool,to:(a,i)=>a?"true":"false"}},manifest:{build:(a,i)=>(i.truthy&&(a=a.truthy(...i.truthy)),i.falsy&&(a=a.falsy(...i.falsy)),a)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(L,p,w)=>{const l=w(375),$=w(8068),y=w(8160),m=w(3328),e={isDate:function(a){return a instanceof Date}};L.exports=$.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:i})=>({value:e.parse(a,i._flags.format)||a})},validate(a,{schema:i,error:r,prefs:t}){if(a instanceof Date&&!isNaN(a.getTime()))return;const c=i._flags.format;return t.convert&&c&&typeof a=="string"?{value:a,errors:r("date.format",{format:c})}:{value:a,errors:r("date.base")}},rules:{compare:{method:!1,validate(a,i,{date:r},{name:t,operator:c,args:s}){const o=r==="now"?Date.now():r.getTime();return y.compare(a.getTime(),o,c)?a:i.error("date."+t,{limit:s.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:e.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return l(["iso","javascript","unix"].includes(a),"Unknown date format",a),this.$_setFlag("format",a)}},greater:{method(a){return this.$_addRule({name:"greater",method:"compare",args:{date:a},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(a){return this.$_addRule({name:"less",method:"compare",args:{date:a},operator:"<"})}},max:{method(a){return this.$_addRule({name:"max",method:"compare",args:{date:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"compare",args:{date:a},operator:">="})}},timestamp:{method(a="javascript"){return l(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:e.isDate,to:(a,i)=>a.getTime()},string:{from:e.isDate,to:(a,{prefs:i})=>m.date(a,i)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),e.parse=function(a,i){if(a instanceof Date)return a;if(typeof a!="string"&&(isNaN(a)||!isFinite(a))||/^\s*$/.test(a))return null;if(i==="iso")return y.isIsoDate(a)?e.date(a.toString()):null;const r=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),i){if(i==="javascript")return e.date(1*a);if(i==="unix")return e.date(1e3*a);if(typeof r=="string")return null}return e.date(a)},e.date=function(a){const i=new Date(a);return isNaN(i.getTime())?null:i}},390:(L,p,w)=>{const l=w(375),$=w(7824);L.exports=$.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(y){return l(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:y}})},validate:(y,m,{n:e})=>y.length===e?y:m.error("function.arity",{n:e})},class:{method(){return this.$_addRule("class")},validate:(y,m)=>/^\s*class\s/.test(y.toString())?y:m.error("function.class",{value:y})},minArity:{method(y){return l(Number.isSafeInteger(y)&&y>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:y}})},validate:(y,m,{n:e})=>y.length>=e?y:m.error("function.minArity",{n:e})},maxArity:{method(y){return l(Number.isSafeInteger(y)&&y>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:y}})},validate:(y,m,{n:e})=>y.length<=e?y:m.error("function.maxArity",{n:e})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(L,p,w)=>{const l=w(978),$=w(375),y=w(8571),m=w(3652),e=w(8068),a=w(8160),i=w(3292),r=w(6354),t=w(6133),c=w(3328),s={renameDefaults:{alias:!1,multiple:!1,override:!1}};L.exports=e.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(o,h)=>o.keys(h),validate(o,{schema:h,error:g,state:b,prefs:j}){if(!o||typeof o!==h.$_property("typeof")||Array.isArray(o))return{value:o,errors:g("object.base",{type:h.$_property("typeof")})};if(!(h.$_terms.renames||h.$_terms.dependencies||h.$_terms.keys||h.$_terms.patterns||h.$_terms.externals))return;o=s.clone(o,j);const k=[];if(h.$_terms.renames&&!s.rename(h,o,b,j,k))return{value:o,errors:k};if(!h.$_terms.keys&&!h.$_terms.patterns&&!h.$_terms.dependencies)return{value:o,errors:k};const f=new Set(Object.keys(o));if(h.$_terms.keys){const v=[o,...b.ancestors];for(const x of h.$_terms.keys){const E=x.key,N=o[E];f.delete(E);const M=b.localize([...b.path,E],v,x),n=x.schema.$_validate(N,M,j);if(n.errors){if(j.abortEarly)return{value:o,errors:n.errors};n.value!==void 0&&(o[E]=n.value),k.push(...n.errors)}else x.schema._flags.result==="strip"||n.value===void 0&&N!==void 0?delete o[E]:n.value!==void 0&&(o[E]=n.value)}}if(f.size||h._flags._hasPatternMatch){const v=s.unknown(h,o,f,k,b,j);if(v)return v}if(h.$_terms.dependencies)for(const v of h.$_terms.dependencies){if(v.key!==null&&s.isPresent(v.options)(v.key.resolve(o,b,j,null,{shadow:!1}))===!1)continue;const x=s.dependencies[v.rel](h,v,o,b,j);if(x){const E=h.$_createError(x.code,o,x.context,b,j);if(j.abortEarly)return{value:o,errors:E};k.push(E)}}return{value:o,errors:k}},rules:{and:{method(...o){return a.verifyFlat(o,"and"),s.dependency(this,"and",null,o)}},append:{method(o){return o==null||Object.keys(o).length===0?this:this.keys(o)}},assert:{method(o,h,g){c.isTemplate(o)||(o=i.ref(o)),$(g===void 0||typeof g=="string","Message must be a string"),h=this.$_compile(h,{appendPath:!0});const b=this.$_addRule({name:"assert",args:{subject:o,schema:h,message:g}});return b.$_mutateRegister(o),b.$_mutateRegister(h),b},validate(o,{error:h,prefs:g,state:b},{subject:j,schema:k,message:f}){const v=j.resolve(o,b,g),x=t.isRef(j)?j.absolute(b):[];return k.$_match(v,b.localize(x,[o,...b.ancestors],k),g)?o:h("object.assert",{subject:j,message:f})},args:["subject","schema","message"],multi:!0},instance:{method(o,h){return $(typeof o=="function","constructor must be a function"),h=h||o.name,this.$_addRule({name:"instance",args:{constructor:o,name:h}})},validate:(o,h,{constructor:g,name:b})=>o instanceof g?o:h.error("object.instance",{type:b,value:o}),args:["constructor","name"]},keys:{method(o){$(o===void 0||typeof o=="object","Object schema must be a valid object"),$(!a.isSchema(o),"Object schema cannot be a joi schema");const h=this.clone();if(o)if(Object.keys(o).length){h.$_terms.keys=h.$_terms.keys?h.$_terms.keys.filter(g=>!o.hasOwnProperty(g.key)):new s.Keys;for(const g in o)a.tryWithPath(()=>h.$_terms.keys.push({key:g,schema:this.$_compile(o[g])}),g)}else h.$_terms.keys=new s.Keys;else h.$_terms.keys=null;return h.$_mutateRebuild()}},length:{method(o){return this.$_addRule({name:"length",args:{limit:o},operator:"="})},validate:(o,h,{limit:g},{name:b,operator:j,args:k})=>a.compare(Object.keys(o).length,g,j)?o:h.error("object."+b,{limit:k.limit,value:o}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(o){return this.$_addRule({name:"max",method:"length",args:{limit:o},operator:"<="})}},min:{method(o){return this.$_addRule({name:"min",method:"length",args:{limit:o},operator:">="})}},nand:{method(...o){return a.verifyFlat(o,"nand"),s.dependency(this,"nand",null,o)}},or:{method(...o){return a.verifyFlat(o,"or"),s.dependency(this,"or",null,o)}},oxor:{method(...o){return s.dependency(this,"oxor",null,o)}},pattern:{method(o,h,g={}){const b=o instanceof RegExp;b||(o=this.$_compile(o,{appendPath:!0})),$(h!==void 0,"Invalid rule"),a.assertOptions(g,["fallthrough","matches"]),b&&$(!o.flags.includes("g")&&!o.flags.includes("y"),"pattern should not use global or sticky mode"),h=this.$_compile(h,{appendPath:!0});const j=this.clone();j.$_terms.patterns=j.$_terms.patterns||[];const k={[b?"regex":"schema"]:o,rule:h};return g.matches&&(k.matches=this.$_compile(g.matches),k.matches.type!=="array"&&(k.matches=k.matches.$_root.array().items(k.matches)),j.$_mutateRegister(k.matches),j.$_setFlag("_hasPatternMatch",!0,{clone:!1})),g.fallthrough&&(k.fallthrough=!0),j.$_terms.patterns.push(k),j.$_mutateRegister(h),j}},ref:{method(){return this.$_addRule("ref")},validate:(o,h)=>t.isRef(o)?o:h.error("object.refType",{value:o})},regex:{method(){return this.$_addRule("regex")},validate:(o,h)=>o instanceof RegExp?o:h.error("object.regex",{value:o})},rename:{method(o,h,g={}){$(typeof o=="string"||o instanceof RegExp,"Rename missing the from argument"),$(typeof h=="string"||h instanceof c,"Invalid rename to argument"),$(h!==o,"Cannot rename key to same name:",o),a.assertOptions(g,["alias","ignoreUndefined","override","multiple"]);const b=this.clone();b.$_terms.renames=b.$_terms.renames||[];for(const j of b.$_terms.renames)$(j.from!==o,"Cannot rename the same key multiple times");return h instanceof c&&b.$_mutateRegister(h),b.$_terms.renames.push({from:o,to:h,options:l(s.renameDefaults,g)}),b}},schema:{method(o="any"){return this.$_addRule({name:"schema",args:{type:o}})},validate:(o,h,{type:g})=>!a.isSchema(o)||g!=="any"&&o.type!==g?h.error("object.schema",{type:g}):o},unknown:{method(o){return this.$_setFlag("unknown",o!==!1)}},with:{method(o,h,g={}){return s.dependency(this,"with",o,h,g)}},without:{method(o,h,g={}){return s.dependency(this,"without",o,h,g)}},xor:{method(...o){return a.verifyFlat(o,"xor"),s.dependency(this,"xor",null,o)}}},overrides:{default(o,h){return o===void 0&&(o=a.symbols.deepDefault),this.$_parent("default",o,h)}},rebuild(o){if(o.$_terms.keys){const h=new m.Sorter;for(const g of o.$_terms.keys)a.tryWithPath(()=>h.add(g,{after:g.schema.$_rootReferences(),group:g.key}),g.key);o.$_terms.keys=new s.Keys(...h.nodes)}},manifest:{build(o,h){if(h.keys&&(o=o.keys(h.keys)),h.dependencies)for(const{rel:g,key:b=null,peers:j,options:k}of h.dependencies)o=s.dependency(o,g,b,j,k);if(h.patterns)for(const{regex:g,schema:b,rule:j,fallthrough:k,matches:f}of h.patterns)o=o.pattern(g||b,j,{fallthrough:k,matches:f});if(h.renames)for(const{from:g,to:b,options:j}of h.renames)o=o.rename(g,b,j);return o}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),s.clone=function(o,h){if(typeof o=="object"){if(h.nonEnumerables)return y(o,{shallow:!0});const b=Object.create(Object.getPrototypeOf(o));return Object.assign(b,o),b}const g=function(...b){return o.apply(this,b)};return g.prototype=y(o.prototype),Object.defineProperty(g,"name",{value:o.name,writable:!1}),Object.defineProperty(g,"length",{value:o.length,writable:!1}),Object.assign(g,o),g},s.dependency=function(o,h,g,b,j){$(g===null||typeof g=="string",h,"key must be a strings"),j||(j=b.length>1&&typeof b[b.length-1]=="object"?b.pop():{}),a.assertOptions(j,["separator","isPresent"]),b=[].concat(b);const k=a.default(j.separator,"."),f=[];for(const x of b)$(typeof x=="string",h,"peers must be strings"),f.push(i.ref(x,{separator:k,ancestor:0,prefix:!1}));g!==null&&(g=i.ref(g,{separator:k,ancestor:0,prefix:!1}));const v=o.clone();return v.$_terms.dependencies=v.$_terms.dependencies||[],v.$_terms.dependencies.push(new s.Dependency(h,g,f,b,j)),v},s.dependencies={and(o,h,g,b,j){const k=[],f=[],v=h.peers.length,x=s.isPresent(h.options);for(const E of h.peers)x(E.resolve(g,b,j,null,{shadow:!1}))===!1?k.push(E.key):f.push(E.key);if(k.length!==v&&f.length!==v)return{code:"object.and",context:{present:f,presentWithLabels:s.keysToLabels(o,f),missing:k,missingWithLabels:s.keysToLabels(o,k)}}},nand(o,h,g,b,j){const k=[],f=s.isPresent(h.options);for(const E of h.peers)f(E.resolve(g,b,j,null,{shadow:!1}))&&k.push(E.key);if(k.length!==h.peers.length)return;const v=h.paths[0],x=h.paths.slice(1);return{code:"object.nand",context:{main:v,mainWithLabel:s.keysToLabels(o,v),peers:x,peersWithLabels:s.keysToLabels(o,x)}}},or(o,h,g,b,j){const k=s.isPresent(h.options);for(const f of h.peers)if(k(f.resolve(g,b,j,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:h.paths,peersWithLabels:s.keysToLabels(o,h.paths)}}},oxor(o,h,g,b,j){const k=[],f=s.isPresent(h.options);for(const x of h.peers)f(x.resolve(g,b,j,null,{shadow:!1}))&&k.push(x.key);if(!k.length||k.length===1)return;const v={peers:h.paths,peersWithLabels:s.keysToLabels(o,h.paths)};return v.present=k,v.presentWithLabels=s.keysToLabels(o,k),{code:"object.oxor",context:v}},with(o,h,g,b,j){const k=s.isPresent(h.options);for(const f of h.peers)if(k(f.resolve(g,b,j,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:h.key.key,mainWithLabel:s.keysToLabels(o,h.key.key),peer:f.key,peerWithLabel:s.keysToLabels(o,f.key)}}},without(o,h,g,b,j){const k=s.isPresent(h.options);for(const f of h.peers)if(k(f.resolve(g,b,j,null,{shadow:!1})))return{code:"object.without",context:{main:h.key.key,mainWithLabel:s.keysToLabels(o,h.key.key),peer:f.key,peerWithLabel:s.keysToLabels(o,f.key)}}},xor(o,h,g,b,j){const k=[],f=s.isPresent(h.options);for(const x of h.peers)f(x.resolve(g,b,j,null,{shadow:!1}))&&k.push(x.key);if(k.length===1)return;const v={peers:h.paths,peersWithLabels:s.keysToLabels(o,h.paths)};return k.length===0?{code:"object.missing",context:v}:(v.present=k,v.presentWithLabels=s.keysToLabels(o,k),{code:"object.xor",context:v})}},s.keysToLabels=function(o,h){return Array.isArray(h)?h.map(g=>o.$_mapLabels(g)):o.$_mapLabels(h)},s.isPresent=function(o){return typeof o.isPresent=="function"?o.isPresent:h=>h!==void 0},s.rename=function(o,h,g,b,j){const k={};for(const f of o.$_terms.renames){const v=[],x=typeof f.from!="string";if(x)for(const E in h){if(h[E]===void 0&&f.options.ignoreUndefined||E===f.to)continue;const N=f.from.exec(E);N&&v.push({from:E,to:f.to,match:N})}else!Object.prototype.hasOwnProperty.call(h,f.from)||h[f.from]===void 0&&f.options.ignoreUndefined||v.push(f);for(const E of v){const N=E.from;let M=E.to;if(M instanceof c&&(M=M.render(h,g,b,E.match)),N!==M){if(!f.options.multiple&&k[M]&&(j.push(o.$_createError("object.rename.multiple",h,{from:N,to:M,pattern:x},g,b)),b.abortEarly)||Object.prototype.hasOwnProperty.call(h,M)&&!f.options.override&&!k[M]&&(j.push(o.$_createError("object.rename.override",h,{from:N,to:M,pattern:x},g,b)),b.abortEarly))return!1;h[N]===void 0?delete h[M]:h[M]=h[N],k[M]=!0,f.options.alias||delete h[N]}}}return!0},s.unknown=function(o,h,g,b,j,k){if(o.$_terms.patterns){let f=!1;const v=o.$_terms.patterns.map(E=>{if(E.matches)return f=!0,[]}),x=[h,...j.ancestors];for(const E of g){const N=h[E],M=[...j.path,E];for(let n=0;n<o.$_terms.patterns.length;++n){const d=o.$_terms.patterns[n];if(d.regex){const O=d.regex.test(E);if(j.mainstay.tracer.debug(j,"rule",`pattern.${n}`,O?"pass":"error"),!O)continue}else if(!d.schema.$_match(E,j.nest(d.schema,`pattern.${n}`),k))continue;g.delete(E);const _=j.localize(M,x,{schema:d.rule,key:E}),R=d.rule.$_validate(N,_,k);if(R.errors){if(k.abortEarly)return{value:h,errors:R.errors};b.push(...R.errors)}if(d.matches&&v[n].push(E),h[E]=R.value,!d.fallthrough)break}}if(f)for(let E=0;E<v.length;++E){const N=v[E];if(!N)continue;const M=o.$_terms.patterns[E].matches,n=j.localize(j.path,x,M),d=M.$_validate(N,n,k);if(d.errors){const _=r.details(d.errors,{override:!1});_.matches=N;const R=o.$_createError("object.pattern.match",h,_,j,k);if(k.abortEarly)return{value:h,errors:R};b.push(R)}}}if(g.size&&(o.$_terms.keys||o.$_terms.patterns)){if(k.stripUnknown&&o._flags.unknown===void 0||k.skipFunctions){const f=!(!k.stripUnknown||k.stripUnknown!==!0&&!k.stripUnknown.objects);for(const v of g)f?(delete h[v],g.delete(v)):typeof h[v]=="function"&&g.delete(v)}if(!a.default(o._flags.unknown,k.allowUnknown))for(const f of g){const v=j.localize([...j.path,f],[]),x=o.$_createError("object.unknown",h[f],{child:f},v,k,{flags:!1});if(k.abortEarly)return{value:h,errors:x};b.push(x)}}},s.Dependency=class{constructor(o,h,g,b,j){this.rel=o,this.key=h,this.peers=g,this.paths=b,this.options=j}describe(){const o={rel:this.rel,peers:this.paths};return this.key!==null&&(o.key=this.key.key),this.peers[0].separator!=="."&&(o.options={...o.options,separator:this.peers[0].separator}),this.options.isPresent&&(o.options={...o.options,isPresent:this.options.isPresent}),o}},s.Keys=class extends Array{concat(o){const h=this.slice(),g=new Map;for(let b=0;b<h.length;++b)g.set(h[b].key,b);for(const b of o){const j=b.key,k=g.get(j);k!==void 0?h[k]={key:j,schema:h[k].schema.concat(b.schema)}:h.push(b)}return h}}},8785:(L,p,w)=>{const l=w(375),$=w(8068),y=w(8160),m=w(3292),e=w(6354),a={};L.exports=$.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(i,r)=>i.ref(r),validate(i,{schema:r,state:t,prefs:c}){l(r.$_terms.link,"Uninitialized link schema");const s=a.generate(r,i,t,c),o=r.$_terms.link[0].ref;return s.$_validate(i,t.nest(s,`link:${o.display}:${s.type}`),c)},generate:(i,r,t,c)=>a.generate(i,r,t,c),rules:{ref:{method(i){l(!this.$_terms.link,"Cannot reinitialize schema"),i=m.ref(i),l(i.type==="value"||i.type==="local","Invalid reference type:",i.type),l(i.type==="local"||i.ancestor==="root"||i.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:i}],r}},relative:{method(i=!0){return this.$_setFlag("relative",i)}}},overrides:{concat(i){l(this.$_terms.link,"Uninitialized link schema"),l(y.isSchema(i),"Invalid schema object"),l(i.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:i}),r.$_mutateRebuild()}},manifest:{build:(i,r)=>(l(r.link,"Invalid link description missing link"),i.ref(r.link))}}),a.generate=function(i,r,t,c){let s=t.mainstay.links.get(i);if(s)return s._generate(r,t,c).schema;const o=i.$_terms.link[0].ref,{perspective:h,path:g}=a.perspective(o,t);a.assert(h,"which is outside of schema boundaries",o,i,t,c);try{s=g.length?h.$_reach(g):h}catch{a.assert(!1,"to non-existing schema",o,i,t,c)}return a.assert(s.type!=="link","which is another link",o,i,t,c),i._flags.relative||t.mainstay.links.set(i,s),s._generate(r,t,c).schema},a.perspective=function(i,r){if(i.type==="local"){for(const{schema:t,key:c}of r.schemas){if((t._flags.id||c)===i.path[0])return{perspective:t,path:i.path.slice(1)};if(t.$_terms.shared){for(const s of t.$_terms.shared)if(s._flags.id===i.path[0])return{perspective:s,path:i.path.slice(1)}}}return{perspective:null,path:null}}return i.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:i.path}:{perspective:r.schemas[i.ancestor]&&r.schemas[i.ancestor].schema,path:i.path}},a.assert=function(i,r,t,c,s,o){i||l(!1,`"${e.label(c._flags,s,o)}" contains link reference "${t.display}" ${r}`)}},3832:(L,p,w)=>{const l=w(375),$=w(8068),y=w(8160),m={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const a=e.toString(),i=a.indexOf("."),r=a.indexOf("e");return(i<0?0:(r<0?a.length:r)-i-1)+(r<0?0:Math.max(0,-parseInt(a.slice(r+1))))}};L.exports=$.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:a,error:i}){if(!e.match(m.numberRx))return;e=e.trim();const r={value:parseFloat(e)};if(r.value===0&&(r.value=0),!a._flags.unsafe)if(e.match(/e/i)){if(m.extractSignificantDigits(e)!==m.extractSignificantDigits(String(r.value)))return r.errors=i("number.unsafe"),r}else{const t=r.value.toString();if(t.match(/e/i))return r;if(t!==m.normalizeDecimal(e))return r.errors=i("number.unsafe"),r}return r}},validate(e,{schema:a,error:i,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:i("number.infinity")};if(!y.isNumber(e))return{value:e,errors:i("number.base")};const t={value:e};if(r.convert){const c=a.$_getRule("precision");if(c){const s=Math.pow(10,c.args.limit);t.value=Math.round(t.value*s)/s}}return t.value===0&&(t.value=0),!a._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.errors=i("number.unsafe")),t},rules:{compare:{method:!1,validate:(e,a,{limit:i},{name:r,operator:t,args:c})=>y.compare(e,i,t)?e:a.error("number."+r,{limit:c.limit,value:e}),args:[{name:"limit",ref:!0,assert:y.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,a)=>Math.trunc(e)-e==0?e:a.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){const a=typeof e=="number"?m.decimalPlaces(e):null,i=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:a,pfactor:i}})},validate:(e,a,{base:i,baseDecimalPlace:r,pfactor:t},c)=>m.decimalPlaces(e)>r?a.error("number.multiple",{multiple:c.args.base,value:e}):Math.round(t*e)%Math.round(t*i)==0?e:a.error("number.multiple",{multiple:c.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>typeof e=="number"&&isFinite(e)&&e>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,a)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return l(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,a,{limit:i}){const r=e.toString().match(m.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=i?e:a.error("number.precision",{limit:i,value:e})},convert:!0},sign:{method(e){return l(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,a,{sign:i})=>i==="negative"&&e<0||i==="positive"&&e>0?e:a.error(`number.${i}`)},unsafe:{method(e=!0){return l(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>typeof e=="number",to:(e,a)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),m.extractSignificantDigits=function(e){return e.replace(m.exponentialPartRegex,"").replace(m.dotRegex,"").replace(m.trailingZerosRegex,"").replace(m.leadingSignAndZerosRegex,"")},m.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),e==="-0"?"0":e}},8966:(L,p,w)=>{const l=w(7824);L.exports=l.extend({type:"object",cast:{map:{from:$=>$&&typeof $=="object",to:($,y)=>new Map(Object.entries($))}}})},7417:(L,p,w)=>{const l=w(375),$=w(5380),y=w(1745),m=w(9959),e=w(6064),a=w(9926),i=w(5752),r=w(8068),t=w(8160),c={tlds:a instanceof Set&&{tlds:{allow:a,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:m.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"]};L.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(s,{schema:o,state:h,prefs:g}){const b=o.$_getRule("normalize");b&&(s=s.normalize(b.args.form));const j=o.$_getRule("case");j&&(s=j.args.direction==="upper"?s.toLocaleUpperCase():s.toLocaleLowerCase());const k=o.$_getRule("trim");if(k&&k.args.enabled&&(s=s.trim()),o.$_terms.replacements)for(const v of o.$_terms.replacements)s=s.replace(v.pattern,v.replacement);const f=o.$_getRule("hex");if(f&&f.args.options.byteAligned&&s.length%2!=0&&(s=`0${s}`),o.$_getRule("isoDate")){const v=c.isoDate(s);v&&(s=v)}if(o._flags.truncate){const v=o.$_getRule("max");if(v){let x=v.args.limit;if(t.isResolvable(x)&&(x=x.resolve(s,h,g),!t.limit(x)))return{value:s,errors:o.$_createError("any.ref",x,{ref:v.args.limit,arg:"limit",reason:"must be a positive integer"},h,g)};s=s.slice(0,x)}}return{value:s}}},validate(s,{schema:o,error:h}){if(typeof s!="string")return{value:s,errors:h("string.base")};if(s===""){const g=o.$_getRule("min");return g&&g.args.limit===0?void 0:{value:s,errors:h("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(s,o)=>/^[a-zA-Z0-9]+$/.test(s)?s:o.error("string.alphanum")},base64:{method(s={}){return t.assertOptions(s,["paddingRequired","urlSafe"]),s={urlSafe:!1,paddingRequired:!0,...s},l(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),l(typeof s.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:s}})},validate:(s,o,{options:h})=>c.base64Regex[h.paddingRequired][h.urlSafe].test(s)?s:o.error("string.base64")},case:{method(s){return l(["lower","upper"].includes(s),"Invalid case:",s),this.$_addRule({name:"case",args:{direction:s}})},validate:(s,o,{direction:h})=>h==="lower"&&s===s.toLocaleLowerCase()||h==="upper"&&s===s.toLocaleUpperCase()?s:o.error(`string.${h}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(s,o){let h=s.length,g=0,b=1;for(;h--;){const j=s.charAt(h)*b;g+=j-9*(j>9),b^=3}return g>0&&g%10==0?s:o.error("string.creditCard")}},dataUri:{method(s={}){return t.assertOptions(s,["paddingRequired"]),s={paddingRequired:!0,...s},l(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:s}})},validate(s,o,{options:h}){const g=s.match(c.dataUriRegex);return g&&(!g[2]||g[2]!=="base64"||c.base64Regex[h.paddingRequired].false.test(g[3]))?s:o.error("string.dataUri")}},domain:{method(s){s&&t.assertOptions(s,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const o=c.addressOptions(s);return this.$_addRule({name:"domain",args:{options:s},address:o})},validate:(s,o,h,{address:g})=>$.isValid(s,g)?s:o.error("string.domain")},email:{method(s={}){t.assertOptions(s,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),l(s.multiple===void 0||typeof s.multiple=="boolean","multiple option must be an boolean");const o=c.addressOptions(s),h=new RegExp(`\\s*[${s.separator?e(s.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:s},regex:h,address:o})},validate(s,o,{options:h},{regex:g,address:b}){const j=h.multiple?s.split(g):[s],k=[];for(const f of j)y.isValid(f,b)||k.push(f);return k.length?o.error("string.email",{value:s,invalids:k}):s}},guid:{alias:"uuid",method(s={}){t.assertOptions(s,["version","separator"]);let o="";if(s.version){const b=[].concat(s.version);l(b.length>=1,"version must have at least 1 valid version specified");const j=new Set;for(let k=0;k<b.length;++k){const f=b[k];l(typeof f=="string","version at position "+k+" must be a string");const v=c.guidVersions[f.toLowerCase()];l(v,"version at position "+k+" must be one of "+Object.keys(c.guidVersions).join(", ")),l(!j.has(v),"version at position "+k+" must not be a duplicate"),o+=v,j.add(v)}}l(c.guidSeparators.has(s.separator),'separator must be one of true, false, "-", or ":"');const h=s.separator===void 0?"[:-]?":s.separator===!0?"[:-]":s.separator===!1?"[]?":`\\${s.separator}`,g=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${h})[0-9A-F]{4}\\2?[${o||"0-9A-F"}][0-9A-F]{3}\\2?[${o?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:s},regex:g})},validate(s,o,h,{regex:g}){const b=g.exec(s);return b?c.guidBrackets[b[1]]!==b[b.length-1]?o.error("string.guid"):s:o.error("string.guid")}},hex:{method(s={}){return t.assertOptions(s,["byteAligned","prefix"]),s={byteAligned:!1,prefix:!1,...s},l(typeof s.byteAligned=="boolean","byteAligned must be boolean"),l(typeof s.prefix=="boolean"||s.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:s}})},validate:(s,o,{options:h})=>(h.prefix==="optional"?c.hexRegex.withOptionalPrefix:h.prefix===!0?c.hexRegex.withPrefix:c.hexRegex.withoutPrefix).test(s)?h.byteAligned&&s.length%2!=0?o.error("string.hexAlign"):s:o.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(s,o)=>$.isValid(s,{minDomainSegments:1})||c.ipRegex.test(s)?s:o.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(s={}){t.assertOptions(s,["cidr","version"]);const{cidr:o,versions:h,regex:g}=m.regex(s),b=s.version?h:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:o,version:b}},regex:g})},validate:(s,o,{options:h},{regex:g})=>g.test(s)?s:h.version?o.error("string.ipVersion",{value:s,cidr:h.cidr,version:h.version}):o.error("string.ip",{value:s,cidr:h.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(s,{error:o})=>c.isoDate(s)?s:o("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(s,o)=>c.isoDurationRegex.test(s)?s:o.error("string.isoDuration")},length:{method(s,o){return c.length(this,"length",s,"=",o)},validate(s,o,{limit:h,encoding:g},{name:b,operator:j,args:k}){const f=!g&&s.length;return t.compare(f,h,j)?s:o.error("string."+b,{limit:k.limit,value:s,encoding:g})},args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(s,o){return c.length(this,"max",s,"<=",o)},args:["limit","encoding"]},min:{method(s,o){return c.length(this,"min",s,">=",o)},args:["limit","encoding"]},normalize:{method(s="NFC"){return l(c.normalizationForms.includes(s),"normalization form must be one of "+c.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:s}})},validate:(s,{error:o},{form:h})=>s===s.normalize(h)?s:o("string.normalize",{value:s,form:h}),convert:!0},pattern:{alias:"regex",method(s,o={}){l(s instanceof RegExp,"regex must be a RegExp"),l(!s.flags.includes("g")&&!s.flags.includes("y"),"regex should not use global or sticky mode"),typeof o=="string"&&(o={name:o}),t.assertOptions(o,["invert","name"]);const h=["string.pattern",o.invert?".invert":"",o.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:s,options:o},errorCode:h})},validate:(s,o,{regex:h,options:g},{errorCode:b})=>h.test(s)^g.invert?s:o.error(b,{name:g.name,regex:h,value:s}),args:["regex","options"],multi:!0},replace:{method(s,o){typeof s=="string"&&(s=new RegExp(e(s),"g")),l(s instanceof RegExp,"pattern must be a RegExp"),l(typeof o=="string","replacement must be a String");const h=this.clone();return h.$_terms.replacements||(h.$_terms.replacements=[]),h.$_terms.replacements.push({pattern:s,replacement:o}),h}},token:{method(){return this.$_addRule("token")},validate:(s,o)=>/^\w+$/.test(s)?s:o.error("string.token")},trim:{method(s=!0){return l(typeof s=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:s}})},validate:(s,o,{enabled:h})=>h&&s!==s.trim()?o.error("string.trim"):s,convert:!0},truncate:{method(s=!0){return l(typeof s=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",s)}},uppercase:{method(){return this.case("upper")}},uri:{method(s={}){t.assertOptions(s,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),s.domain&&t.assertOptions(s.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:o,scheme:h}=i.regex(s),g=s.domain?c.addressOptions(s.domain):null;return this.$_addRule({name:"uri",args:{options:s},regex:o,domain:g,scheme:h})},validate(s,o,{options:h},{regex:g,domain:b,scheme:j}){if(["http:/","https:/"].includes(s))return o.error("string.uri");let k=g.exec(s);if(!k&&o.prefs.convert&&h.encodeUri){const f=encodeURI(s);k=g.exec(f),k&&(s=f)}if(k){const f=k[1]||k[2];return!b||h.allowRelative&&!f||$.isValid(f,b)?s:o.error("string.domain",{value:f})}return h.relativeOnly?o.error("string.uriRelativeOnly"):h.scheme?o.error("string.uriCustomScheme",{scheme:j,value:s}):o.error("string.uri")}}},manifest:{build(s,o){if(o.replacements)for(const{pattern:h,replacement:g}of o.replacements)s=s.replace(h,g);return s}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),c.addressOptions=function(s){if(!s)return c.tlds||s;if(l(s.minDomainSegments===void 0||Number.isSafeInteger(s.minDomainSegments)&&s.minDomainSegments>0,"minDomainSegments must be a positive integer"),l(s.maxDomainSegments===void 0||Number.isSafeInteger(s.maxDomainSegments)&&s.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),s.tlds===!1)return s;if(s.tlds===!0||s.tlds===void 0)return l(c.tlds,"Built-in TLD list disabled"),Object.assign({},s,c.tlds);l(typeof s.tlds=="object","tlds must be true, false, or an object");const o=s.tlds.deny;if(o)return Array.isArray(o)&&(s=Object.assign({},s,{tlds:{deny:new Set(o)}})),l(s.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),l(!s.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),c.validateTlds(s.tlds.deny,"tlds.deny"),s;const h=s.tlds.allow;return h?h===!0?(l(c.tlds,"Built-in TLD list disabled"),Object.assign({},s,c.tlds)):(Array.isArray(h)&&(s=Object.assign({},s,{tlds:{allow:new Set(h)}})),l(s.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),c.validateTlds(s.tlds.allow,"tlds.allow"),s):s},c.validateTlds=function(s,o){for(const h of s)l($.isValid(h,{minDomainSegments:1,maxDomainSegments:1}),`${o} must contain valid top level domain names`)},c.isoDate=function(s){if(!t.isIsoDate(s))return null;/.*T.*[+-]\d\d$/.test(s)&&(s+="00");const o=new Date(s);return isNaN(o.getTime())?null:o.toISOString()},c.length=function(s,o,h,g,b){return l(!b||!1,"Invalid encoding:",b),s.$_addRule({name:o,method:"length",args:{limit:h,encoding:b},operator:g})}},8826:(L,p,w)=>{const l=w(375),$=w(8068),y={};y.Map=class extends Map{slice(){return new y.Map(this)}},L.exports=$.extend({type:"symbol",terms:{map:{init:new y.Map}},coerce:{method(m,{schema:e,error:a}){const i=e.$_terms.map.get(m);return i&&(m=i),e._flags.only&&typeof m!="symbol"?{value:m,errors:a("symbol.map",{map:e.$_terms.map})}:{value:m}}},validate(m,{error:e}){if(typeof m!="symbol")return{value:m,errors:e("symbol.base")}},rules:{map:{method(m){m&&!m[Symbol.iterator]&&typeof m=="object"&&(m=Object.entries(m)),l(m&&m[Symbol.iterator],"Iterable must be an iterable or object");const e=this.clone(),a=[];for(const i of m){l(i&&i[Symbol.iterator],"Entry must be an iterable");const[r,t]=i;l(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),l(typeof t=="symbol","Value must be a Symbol"),e.$_terms.map.set(r,t),a.push(t)}return e.valid(...a)}}},manifest:{build:(m,e)=>(e.map&&(m=m.map(e.map)),m)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(L,p,w)=>{const l=w(375),$=w(8571),y=w(738),m=w(9621),e=w(8160),a=w(6354),i=w(493),r={result:Symbol("result")};p.entry=function(t,c,s){let o=e.defaults;s&&(l(s.warnings===void 0,"Cannot override warnings preference in synchronous validation"),l(s.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),o=e.preferences(e.defaults,s));const h=r.entry(t,c,o);l(!h.mainstay.externals.length,"Schema with external rules must use validateAsync()");const g={value:h.value};return h.error&&(g.error=h.error),h.mainstay.warnings.length&&(g.warning=a.details(h.mainstay.warnings)),h.mainstay.debug&&(g.debug=h.mainstay.debug),h.mainstay.artifacts&&(g.artifacts=h.mainstay.artifacts),g},p.entryAsync=async function(t,c,s){let o=e.defaults;s&&(o=e.preferences(e.defaults,s));const h=r.entry(t,c,o),g=h.mainstay;if(h.error)throw g.debug&&(h.error.debug=g.debug),h.error;if(g.externals.length){let j=h.value;const k=[];for(const f of g.externals){const v=f.state.path,x=f.schema.type==="link"?g.links.get(f.schema):null;let E,N,M=j;const n=v.length?[j]:[],d=v.length?m(t,v):t;if(v.length){E=v[v.length-1];let _=j;for(const R of v.slice(0,-1))_=_[R],n.unshift(_);N=n[0],M=N[E]}try{const _=(O,C)=>(x||f.schema).$_createError(O,M,C,f.state,o),R=await f.method(M,{schema:f.schema,linked:x,state:f.state,prefs:s,original:d,error:_,errorsArray:r.errorsArray,warn:(O,C)=>g.warnings.push((x||f.schema).$_createError(O,M,C,f.state,o)),message:(O,C)=>(x||f.schema).$_createError("external",M,C,f.state,o,{messages:O})});if(R===void 0||R===M)continue;if(R instanceof a.Report){if(g.tracer.log(f.schema,f.state,"rule","external","error"),k.push(R),o.abortEarly)break;continue}if(Array.isArray(R)&&R[e.symbols.errors]){if(g.tracer.log(f.schema,f.state,"rule","external","error"),k.push(...R),o.abortEarly)break;continue}N?(g.tracer.value(f.state,"rule",M,R,"external"),N[E]=R):(g.tracer.value(f.state,"rule",j,R,"external"),j=R)}catch(_){throw o.errors.label&&(_.message+=` (${f.label})`),_}}if(h.value=j,k.length)throw h.error=a.process(k,t,o),g.debug&&(h.error.debug=g.debug),h.error}if(!o.warnings&&!o.debug&&!o.artifacts)return h.value;const b={value:h.value};return g.warnings.length&&(b.warning=a.details(g.warnings)),g.debug&&(b.debug=g.debug),g.artifacts&&(b.artifacts=g.artifacts),b},r.Mainstay=class{constructor(t,c,s){this.externals=[],this.warnings=[],this.tracer=t,this.debug=c,this.links=s,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}},r.entry=function(t,c,s){const{tracer:o,cleanup:h}=r.tracer(c,s),g=s.debug?[]:null,b=c._ids._schemaChain?new Map:null,j=new r.Mainstay(o,g,b),k=c._ids._schemaChain?[{schema:c}]:null,f=new i([],[],{mainstay:j,schemas:k}),v=p.validate(t,c,f,s);h&&c.$_root.untrace();const x=a.process(v.errors,t,s);return{value:v.value,error:x,mainstay:j}},r.tracer=function(t,c){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:c.debug?(l(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:r.ignore}},p.validate=function(t,c,s,o,h={}){if(c.$_terms.whens&&(c=c._generate(t,s,o).schema),c._preferences&&(o=r.prefs(c,o)),c._cache&&o.cache){const x=c._cache.get(t);if(s.mainstay.tracer.debug(s,"validate","cached",!!x),x)return x}const g=(x,E,N)=>c.$_createError(x,t,E,N||s,o),b={original:t,prefs:o,schema:c,state:s,error:g,errorsArray:r.errorsArray,warn:(x,E,N)=>s.mainstay.warnings.push(g(x,E,N)),message:(x,E)=>c.$_createError("custom",t,E,s,o,{messages:x})};s.mainstay.tracer.entry(c,s);const j=c._definition;if(j.prepare&&t!==void 0&&o.convert){const x=j.prepare(t,b);if(x){if(s.mainstay.tracer.value(s,"prepare",t,x.value),x.errors)return r.finalize(x.value,[].concat(x.errors),b);t=x.value}}if(j.coerce&&t!==void 0&&o.convert&&(!j.coerce.from||j.coerce.from.includes(typeof t))){const x=j.coerce.method(t,b);if(x){if(s.mainstay.tracer.value(s,"coerced",t,x.value),x.errors)return r.finalize(x.value,[].concat(x.errors),b);t=x.value}}const k=c._flags.empty;k&&k.$_match(r.trim(t,c),s.nest(k),e.defaults)&&(s.mainstay.tracer.value(s,"empty",t,void 0),t=void 0);const f=h.presence||c._flags.presence||(c._flags._endedSwitch?null:o.presence);if(t===void 0){if(f==="forbidden")return r.finalize(t,null,b);if(f==="required")return r.finalize(t,[c.$_createError("any.required",t,null,s,o)],b);if(f==="optional"){if(c._flags.default!==e.symbols.deepDefault)return r.finalize(t,null,b);s.mainstay.tracer.value(s,"default",t,{}),t={}}}else if(f==="forbidden")return r.finalize(t,[c.$_createError("any.unknown",t,null,s,o)],b);const v=[];if(c._valids){const x=c._valids.get(t,s,o,c._flags.insensitive);if(x)return o.convert&&(s.mainstay.tracer.value(s,"valids",t,x.value),t=x.value),s.mainstay.tracer.filter(c,s,"valid",x),r.finalize(t,null,b);if(c._flags.only){const E=c.$_createError("any.only",t,{valids:c._valids.values({display:!0})},s,o);if(o.abortEarly)return r.finalize(t,[E],b);v.push(E)}}if(c._invalids){const x=c._invalids.get(t,s,o,c._flags.insensitive);if(x){s.mainstay.tracer.filter(c,s,"invalid",x);const E=c.$_createError("any.invalid",t,{invalids:c._invalids.values({display:!0})},s,o);if(o.abortEarly)return r.finalize(t,[E],b);v.push(E)}}if(j.validate){const x=j.validate(t,b);if(x&&(s.mainstay.tracer.value(s,"base",t,x.value),t=x.value,x.errors)){if(!Array.isArray(x.errors))return v.push(x.errors),r.finalize(t,v,b);if(x.errors.length)return v.push(...x.errors),r.finalize(t,v,b)}}return c._rules.length?r.rules(t,v,b):r.finalize(t,v,b)},r.rules=function(t,c,s){const{schema:o,state:h,prefs:g}=s;for(const b of o._rules){const j=o._definition.rules[b.method];if(j.convert&&g.convert){h.mainstay.tracer.log(o,h,"rule",b.name,"full");continue}let k,f=b.args;if(b._resolve.length){f=Object.assign({},f);for(const x of b._resolve){const E=j.argsByName.get(x),N=f[x].resolve(t,h,g),M=E.normalize?E.normalize(N):N,n=e.validateArg(M,null,E);if(n){k=o.$_createError("any.ref",N,{arg:x,ref:f[x],reason:n},h,g);break}f[x]=M}}k=k||j.validate(t,s,f,b);const v=r.rule(k,b);if(v.errors){if(h.mainstay.tracer.log(o,h,"rule",b.name,"error"),b.warn){h.mainstay.warnings.push(...v.errors);continue}if(g.abortEarly)return r.finalize(t,v.errors,s);c.push(...v.errors)}else h.mainstay.tracer.log(o,h,"rule",b.name,"pass"),h.mainstay.tracer.value(h,"rule",t,v.value,b.name),t=v.value}return r.finalize(t,c,s)},r.rule=function(t,c){return t instanceof a.Report?(r.error(t,c),{errors:[t],value:null}):Array.isArray(t)&&t[e.symbols.errors]?(t.forEach(s=>r.error(s,c)),{errors:t,value:null}):{errors:null,value:t}},r.error=function(t,c){return c.message&&t._setTemplate(c.message),t},r.finalize=function(t,c,s){c=c||[];const{schema:o,state:h,prefs:g}=s;if(c.length){const j=r.default("failover",void 0,c,s);j!==void 0&&(h.mainstay.tracer.value(h,"failover",t,j),t=j,c=[])}if(c.length&&o._flags.error)if(typeof o._flags.error=="function"){c=o._flags.error(c),Array.isArray(c)||(c=[c]);for(const j of c)l(j instanceof Error||j instanceof a.Report,"error() must return an Error object")}else c=[o._flags.error];if(t===void 0){const j=r.default("default",t,c,s);h.mainstay.tracer.value(h,"default",t,j),t=j}if(o._flags.cast&&t!==void 0){const j=o._definition.cast[o._flags.cast];if(j.from(t)){const k=j.to(t,s);h.mainstay.tracer.value(h,"cast",t,k,o._flags.cast),t=k}}if(o.$_terms.externals&&g.externals&&g._externals!==!1)for(const{method:j}of o.$_terms.externals)h.mainstay.externals.push({method:j,schema:o,state:h,label:a.label(o._flags,h,g)});const b={value:t,errors:c.length?c:null};return o._flags.result&&(b.value=o._flags.result==="strip"?void 0:s.original,h.mainstay.tracer.value(h,o._flags.result,t,b.value),h.shadow(t,o._flags.result)),o._cache&&g.cache!==!1&&!o._refs.length&&o._cache.set(s.original,b),t===void 0||b.errors||o._flags.artifact===void 0||(h.mainstay.artifacts=h.mainstay.artifacts||new Map,h.mainstay.artifacts.has(o._flags.artifact)||h.mainstay.artifacts.set(o._flags.artifact,[]),h.mainstay.artifacts.get(o._flags.artifact).push(h.path)),b},r.prefs=function(t,c){const s=c===e.defaults;return s&&t._preferences[e.symbols.prefs]?t._preferences[e.symbols.prefs]:(c=e.preferences(c,t._preferences),s&&(t._preferences[e.symbols.prefs]=c),c)},r.default=function(t,c,s,o){const{schema:h,state:g,prefs:b}=o,j=h._flags[t];if(b.noDefaults||j===void 0)return c;if(g.mainstay.tracer.log(h,g,"rule",t,"full"),!j)return j;if(typeof j=="function"){const k=j.length?[$(g.ancestors[0]),o]:[];try{return j(...k)}catch(f){return void s.push(h.$_createError(`any.${t}`,null,{error:f},g,b))}}return typeof j!="object"?j:j[e.symbols.literal]?j.literal:e.isResolvable(j)?j.resolve(c,g,b):$(j)},r.trim=function(t,c){if(typeof t!="string")return t;const s=c.$_getRule("trim");return s&&s.args.enabled?t.trim():t},r.ignore={active:!1,debug:y,entry:y,filter:y,log:y,resolve:y,value:y},r.errorsArray=function(){const t=[];return t[e.symbols.errors]=!0,t}},2036:(L,p,w)=>{const l=w(375),$=w(9474),y=w(8160),m={};L.exports=m.Values=class{constructor(e,a){this._values=new Set(e),this._refs=new Set(a),this._lowercase=m.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,a){y.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),a&&a.register(e)):this.has(e,null,null,!1)||(this._values.add(e),typeof e=="string"&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,a,i){if(e=e||new m.Values,a){if(a._override)return a.clone();for(const r of[...a._values,...a._refs])e.add(r)}if(i)for(const r of[...i._values,...i._refs])e.remove(r);return e.length?e:null}remove(e){y.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),typeof e=="string"&&this._lowercase.delete(e.toLowerCase()))}has(e,a,i,r){return!!this.get(e,a,i,r)}get(e,a,i,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if(typeof e=="string"&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&typeof e!="object")return!1;if(typeof e=="object"){for(const t of this._values)if($(t,e))return{value:t}}if(a)for(const t of this._refs){const c=t.resolve(e,a,i,null,{in:!0});if(c===void 0)continue;const s=t.in&&typeof c=="object"?Array.isArray(c)?c:Object.keys(c):[c];for(const o of s)if(typeof o==typeof e){if(r&&e&&typeof e=="string"){if(o.toLowerCase()===e.toLowerCase())return{value:o,ref:t}}else if($(o,e))return{value:o,ref:t}}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const a=[];for(const i of[...this._values,...this._refs])i!==void 0&&a.push(i);return a}return Array.from([...this._values,...this._refs])}clone(){const e=new m.Values(this._values,this._refs);return e._override=this._override,e}concat(e){l(!e._override,"Cannot concat override set of values");const a=new m.Values([...this._values,...e._values],[...this._refs,...e._refs]);return a._override=this._override,a}describe(){const e=[];this._override&&e.push({override:!0});for(const a of this._values.values())e.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())e.push(a.describe());return e}},m.Values.prototype[y.symbols.values]=!0,m.Values.prototype.slice=m.Values.prototype.clone,m.lowercases=function(e){const a=new Map;if(e)for(const i of e)typeof i=="string"&&a.set(i.toLowerCase(),i);return a}},978:(L,p,w)=>{const l=w(375),$=w(8571),y=w(1687),m=w(9621),e={};L.exports=function(a,i,r={}){if(l(a&&typeof a=="object","Invalid defaults value: must be an object"),l(!i||i===!0||typeof i=="object","Invalid source value: must be true, falsy or an object"),l(typeof r=="object","Invalid options: must be an object"),!i)return null;if(r.shallow)return e.applyToDefaultsWithShallow(a,i,r);const t=$(a);if(i===!0)return t;const c=r.nullOverride!==void 0&&r.nullOverride;return y(t,i,{nullOverride:c,mergeArrays:!1})},e.applyToDefaultsWithShallow=function(a,i,r){const t=r.shallow;l(Array.isArray(t),"Invalid keys");const c=new Map,s=i===!0?null:new Set;for(let g of t){g=Array.isArray(g)?g:g.split(".");const b=m(a,g);b&&typeof b=="object"?c.set(b,s&&m(i,g)||b):s&&s.add(g)}const o=$(a,{},c);if(!s)return o;for(const g of s)e.reachCopy(o,i,g);const h=r.nullOverride!==void 0&&r.nullOverride;return y(o,i,{nullOverride:h,mergeArrays:!1})},e.reachCopy=function(a,i,r){for(const s of r){if(!(s in i))return;const o=i[s];if(typeof o!="object"||o===null)return;i=o}const t=i;let c=a;for(let s=0;s<r.length-1;++s){const o=r[s];typeof c[o]!="object"&&(c[o]={}),c=c[o]}c[r[r.length-1]]=t}},375:(L,p,w)=>{const l=w(7916);L.exports=function($,...y){if(!$)throw y.length===1&&y[0]instanceof Error?y[0]:new l(y)}},8571:(L,p,w)=>{const l=w(9621),$=w(4277),y=w(7043),m={needsProtoHack:new Set([$.set,$.map,$.weakSet,$.weakMap])};L.exports=m.clone=function(e,a={},i=null){if(typeof e!="object"||e===null)return e;let r=m.clone,t=i;if(a.shallow){if(a.shallow!==!0)return m.cloneWithShallow(e,a);r=h=>h}else if(t){const h=t.get(e);if(h)return h}else t=new Map;const c=$.getInternalProto(e);if(c===$.buffer)return!1;if(c===$.date)return new Date(e.getTime());if(c===$.regex)return new RegExp(e);const s=m.base(e,c,a);if(s===e)return e;if(t&&t.set(e,s),c===$.set)for(const h of e)s.add(r(h,a,t));else if(c===$.map)for(const[h,g]of e)s.set(h,r(g,a,t));const o=y.keys(e,a);for(const h of o){if(h==="__proto__")continue;if(c===$.array&&h==="length"){s.length=e.length;continue}const g=Object.getOwnPropertyDescriptor(e,h);g?g.get||g.set?Object.defineProperty(s,h,g):g.enumerable?s[h]=r(e[h],a,t):Object.defineProperty(s,h,{enumerable:!1,writable:!0,configurable:!0,value:r(e[h],a,t)}):Object.defineProperty(s,h,{enumerable:!0,writable:!0,configurable:!0,value:r(e[h],a,t)})}return s},m.cloneWithShallow=function(e,a){const i=a.shallow;(a=Object.assign({},a)).shallow=!1;const r=new Map;for(const t of i){const c=l(e,t);typeof c!="object"&&typeof c!="function"||r.set(c,c)}return m.clone(e,a,r)},m.base=function(e,a,i){if(i.prototype===!1)return m.needsProtoHack.has(a)?new a.constructor:a===$.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(a===$.array){const t=[];return r!==a&&Object.setPrototypeOf(t,r),t}if(m.needsProtoHack.has(a)){const t=new r.constructor;return r!==a&&Object.setPrototypeOf(t,r),t}return Object.create(r)}},9474:(L,p,w)=>{const l=w(4277),$={mismatched:null};L.exports=function(y,m,e){return e=Object.assign({prototype:!0},e),!!$.isDeepEqual(y,m,e,[])},$.isDeepEqual=function(y,m,e,a){if(y===m)return y!==0||1/y==1/m;const i=typeof y;if(i!==typeof m||y===null||m===null)return!1;if(i==="function"){if(!e.deepFunction||y.toString()!==m.toString())return!1}else if(i!=="object")return y!=y&&m!=m;const r=$.getSharedType(y,m,!!e.prototype);switch(r){case l.buffer:return!1;case l.promise:return y===m;case l.regex:return y.toString()===m.toString();case $.mismatched:return!1}for(let t=a.length-1;t>=0;--t)if(a[t].isSame(y,m))return!0;a.push(new $.SeenEntry(y,m));try{return!!$.isDeepEqualObj(r,y,m,e,a)}finally{a.pop()}},$.getSharedType=function(y,m,e){if(e)return Object.getPrototypeOf(y)!==Object.getPrototypeOf(m)?$.mismatched:l.getInternalProto(y);const a=l.getInternalProto(y);return a!==l.getInternalProto(m)?$.mismatched:a},$.valueOf=function(y){const m=y.valueOf;if(m===void 0)return y;try{return m.call(y)}catch(e){return e}},$.hasOwnEnumerableProperty=function(y,m){return Object.prototype.propertyIsEnumerable.call(y,m)},$.isSetSimpleEqual=function(y,m){for(const e of Set.prototype.values.call(y))if(!Set.prototype.has.call(m,e))return!1;return!0},$.isDeepEqualObj=function(y,m,e,a,i){const{isDeepEqual:r,valueOf:t,hasOwnEnumerableProperty:c}=$,{keys:s,getOwnPropertySymbols:o}=Object;if(y===l.array){if(!a.part){if(m.length!==e.length)return!1;for(let k=0;k<m.length;++k)if(!r(m[k],e[k],a,i))return!1;return!0}for(const k of m)for(const f of e)if(r(k,f,a,i))return!0}else if(y===l.set){if(m.size!==e.size)return!1;if(!$.isSetSimpleEqual(m,e)){const k=new Set(Set.prototype.values.call(e));for(const f of Set.prototype.values.call(m)){if(k.delete(f))continue;let v=!1;for(const x of k)if(r(f,x,a,i)){k.delete(x),v=!0;break}if(!v)return!1}}}else if(y===l.map){if(m.size!==e.size)return!1;for(const[k,f]of Map.prototype.entries.call(m))if(f===void 0&&!Map.prototype.has.call(e,k)||!r(f,Map.prototype.get.call(e,k),a,i))return!1}else if(y===l.error&&(m.name!==e.name||m.message!==e.message))return!1;const h=t(m),g=t(e);if((m!==h||e!==g)&&!r(h,g,a,i))return!1;const b=s(m);if(!a.part&&b.length!==s(e).length&&!a.skip)return!1;let j=0;for(const k of b)if(a.skip&&a.skip.includes(k))e[k]===void 0&&++j;else if(!c(e,k)||!r(m[k],e[k],a,i))return!1;if(!a.part&&b.length-j!==s(e).length)return!1;if(a.symbols!==!1){const k=o(m),f=new Set(o(e));for(const v of k){if(!a.skip||!a.skip.includes(v)){if(c(m,v)){if(!c(e,v)||!r(m[v],e[v],a,i))return!1}else if(c(e,v))return!1}f.delete(v)}for(const v of f)if(c(e,v))return!1}return!0},$.SeenEntry=class{constructor(y,m){this.obj=y,this.ref=m}isSame(y,m){return this.obj===y&&this.ref===m}}},7916:(L,p,w)=>{const l=w(8761);L.exports=class extends Error{constructor($){super($.filter(y=>y!=="").map(y=>typeof y=="string"?y:y instanceof Error?y.message:l(y)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,p.assert)}}},5277:L=>{const p={};L.exports=function(w){if(!w)return"";let l="";for(let $=0;$<w.length;++$){const y=w.charCodeAt($);p.isSafe(y)?l+=w[$]:l+=p.escapeHtmlChar(y)}return l},p.escapeHtmlChar=function(w){return p.namedHtml.get(w)||(w>=256?"&#"+w+";":`&#x${w.toString(16).padStart(2,"0")};`)},p.isSafe=function(w){return p.safeCharCodes.has(w)},p.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),p.safeCharCodes=function(){const w=new Set;for(let l=32;l<123;++l)(l>=97||l>=65&&l<=90||l>=48&&l<=57||l===32||l===46||l===44||l===45||l===58||l===95)&&w.add(l);return w}()},6064:L=>{L.exports=function(p){return p.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:L=>{L.exports=function(){}},1687:(L,p,w)=>{const l=w(375),$=w(8571),y=w(7043),m={};L.exports=m.merge=function(e,a,i){if(l(e&&typeof e=="object","Invalid target value: must be an object"),l(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return e;if(i=Object.assign({nullOverride:!0,mergeArrays:!0},i),Array.isArray(a)){l(Array.isArray(e),"Cannot merge array onto an object"),i.mergeArrays||(e.length=0);for(let t=0;t<a.length;++t)e.push($(a[t],{symbols:i.symbols}));return e}const r=y.keys(a,i);for(let t=0;t<r.length;++t){const c=r[t];if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,c))continue;const s=a[c];if(s&&typeof s=="object"){if(e[c]===s)continue;!e[c]||typeof e[c]!="object"||Array.isArray(e[c])!==Array.isArray(s)||s instanceof Date||s instanceof RegExp?e[c]=$(s,{symbols:i.symbols}):m.merge(e[c],s,i)}else(s!=null||i.nullOverride)&&(e[c]=s)}return e}},9621:(L,p,w)=>{const l=w(375),$={};L.exports=function(y,m,e){if(m===!1||m==null)return y;typeof(e=e||{})=="string"&&(e={separator:e});const a=Array.isArray(m);l(!a||!e.separator,"Separator option is not valid for array-based chain");const i=a?m:m.split(e.separator||".");let r=y;for(let t=0;t<i.length;++t){let c=i[t];const s=e.iterables&&$.iterables(r);if(Array.isArray(r)||s==="set"){const o=Number(c);Number.isInteger(o)&&(c=o<0?r.length+o:o)}if(!r||typeof r=="function"&&e.functions===!1||!s&&r[c]===void 0){l(!e.strict||t+1===i.length,"Missing segment",c,"in reach path ",m),l(typeof r=="object"||e.functions===!0||typeof r!="function","Invalid segment",c,"in reach path ",m),r=e.default;break}r=s?s==="set"?[...r][c]:r.get(c):r[c]}return r},$.iterables=function(y){return y instanceof Set?"set":y instanceof Map?"map":void 0}},8761:L=>{L.exports=function(...p){try{return JSON.stringify(...p)}catch(w){return"[Cannot display object: "+w.message+"]"}}},4277:(L,p)=>{const w={};p=L.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},w.typeMap=new Map([["[object Error]",p.error],["[object Map]",p.map],["[object Promise]",p.promise],["[object Set]",p.set],["[object WeakMap]",p.weakMap],["[object WeakSet]",p.weakSet]]),p.getInternalProto=function(l){if(Array.isArray(l))return p.array;if(l instanceof Date)return p.date;if(l instanceof RegExp)return p.regex;if(l instanceof Error)return p.error;const $=Object.prototype.toString.call(l);return w.typeMap.get($)||p.generic}},7043:(L,p)=>{p.keys=function(w,l={}){return l.symbols!==!1?Reflect.ownKeys(w):Object.getOwnPropertyNames(w)}},3652:(L,p,w)=>{const l=w(375),$={};p.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(y,m){const e=[].concat((m=m||{}).before||[]),a=[].concat(m.after||[]),i=m.group||"?",r=m.sort||0;l(!e.includes(i),`Item cannot come before itself: ${i}`),l(!e.includes("?"),"Item cannot come before unassociated items"),l(!a.includes(i),`Item cannot come after itself: ${i}`),l(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(y)||(y=[y]);for(const t of y){const c={seq:this._items.length,sort:r,before:e,after:a,group:i,node:t};this._items.push(c)}if(!m.manual){const t=this._sort();l(t,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(y){Array.isArray(y)||(y=[y]);for(const e of y)if(e)for(const a of e._items)this._items.push(Object.assign({},a));this._items.sort($.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const m=this._sort();return l(m,"merge created a dependencies error"),this.nodes}sort(){const y=this._sort();return l(y,"sort created a dependencies error"),this.nodes}_sort(){const y={},m=Object.create(null),e=Object.create(null);for(const c of this._items){const s=c.seq,o=c.group;e[o]=e[o]||[],e[o].push(s),y[s]=c.before;for(const h of c.after)m[h]=m[h]||[],m[h].push(s)}for(const c in y){const s=[];for(const o in y[c]){const h=y[c][o];e[h]=e[h]||[],s.push(...e[h])}y[c]=s}for(const c in m)if(e[c])for(const s of e[c])y[s].push(...m[c]);const a={};for(const c in y){const s=y[c];for(const o of s)a[o]=a[o]||[],a[o].push(c)}const i={},r=[];for(let c=0;c<this._items.length;++c){let s=c;if(a[c]){s=null;for(let o=0;o<this._items.length;++o){if(i[o]===!0)continue;a[o]||(a[o]=[]);const h=a[o].length;let g=0;for(let b=0;b<h;++b)i[a[o][b]]&&++g;if(g===h){s=o;break}}}s!==null&&(i[s]=!0,r.push(s))}if(r.length!==this._items.length)return!1;const t={};for(const c of this._items)t[c.seq]=c;this._items=[],this.nodes=[];for(const c of r){const s=t[c];this.nodes.push(s.node),this._items.push(s)}return!0}},$.mergeSort=(y,m)=>y.sort===m.sort?0:y.sort<m.sort?-1:1},5380:(L,p,w)=>{const l=w(443),$=w(2178),y={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:l.URL||URL};p.analyze=function(m,e={}){if(!m)return $.code("DOMAIN_NON_EMPTY_STRING");if(typeof m!="string")throw new Error("Invalid input: domain must be a string");if(m.length>256)return $.code("DOMAIN_TOO_LONG");if(y.nonAsciiRx.test(m)){if(e.allowUnicode===!1)return $.code("DOMAIN_INVALID_UNICODE_CHARS");m=m.normalize("NFC")}if(y.domainControlRx.test(m))return $.code("DOMAIN_INVALID_CHARS");m=y.punycode(m),e.allowFullyQualified&&m[m.length-1]==="."&&(m=m.slice(0,-1));const a=e.minDomainSegments||y.minDomainSegments,i=m.split(".");if(i.length<a)return $.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return $.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=e.tlds;if(r){const t=i[i.length-1].toLowerCase();if(r.deny&&r.deny.has(t)||r.allow&&!r.allow.has(t))return $.code("DOMAIN_FORBIDDEN_TLDS")}for(let t=0;t<i.length;++t){const c=i[t];if(!c.length)return $.code("DOMAIN_EMPTY_SEGMENT");if(c.length>63)return $.code("DOMAIN_LONG_SEGMENT");if(t<i.length-1){if(!y.domainSegmentRx.test(c))return $.code("DOMAIN_INVALID_CHARS")}else if(!y.tldSegmentRx.test(c))return $.code("DOMAIN_INVALID_TLDS_CHARS")}return null},p.isValid=function(m,e){return!p.analyze(m,e)},y.punycode=function(m){m.includes("%")&&(m=m.replace(/%/g,"%25"));try{return new y.URL(`http://${m}`).host}catch{return m}}},1745:(L,p,w)=>{const l=w(9848),$=w(5380),y=w(2178),m={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(l.TextEncoder||TextEncoder)};p.analyze=function(e,a){return m.email(e,a)},p.isValid=function(e,a){return!m.email(e,a)},m.email=function(e,a={}){if(typeof e!="string")throw new Error("Invalid input: email must be a string");if(!e)return y.code("EMPTY_STRING");const i=!m.nonAsciiRx.test(e);if(!i){if(a.allowUnicode===!1)return y.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(r.length!==2)return r.length>2?y.code("MULTIPLE_AT_CHAR"):y.code("MISSING_AT_CHAR");const[t,c]=r;if(!t)return y.code("EMPTY_LOCAL");if(!a.ignoreLength){if(e.length>254)return y.code("ADDRESS_TOO_LONG");if(m.encoder.encode(t).length>64)return y.code("LOCAL_TOO_LONG")}return m.local(t,i)||$.analyze(c,a)},m.local=function(e,a){const i=e.split(".");for(const r of i){if(!r.length)return y.code("EMPTY_LOCAL_SEGMENT");if(a){if(!m.atextRx.test(r))return y.code("INVALID_LOCAL_CHARS")}else for(const t of r){if(m.atextRx.test(t))continue;const c=m.binary(t);if(!m.atomRx.test(c))return y.code("INVALID_LOCAL_CHARS")}}},m.binary=function(e){return Array.from(m.encoder.encode(e)).map(a=>String.fromCharCode(a)).join("")},m.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,m.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:(L,p)=>{p.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"},p.code=function(w){return{code:w,error:p.codes[w]}}},9959:(L,p,w)=>{const l=w(375),$=w(5752);p.regex=function(y={}){l(y.cidr===void 0||typeof y.cidr=="string","options.cidr must be a string");const m=y.cidr?y.cidr.toLowerCase():"optional";l(["required","optional","forbidden"].includes(m),"options.cidr must be one of required, optional, forbidden"),l(y.version===void 0||typeof y.version=="string"||Array.isArray(y.version),"options.version must be a string or an array of string");let e=y.version||["ipv4","ipv6","ipvfuture"];Array.isArray(e)||(e=[e]),l(e.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<e.length;++r)l(typeof e[r]=="string","options.version must only contain strings"),e[r]=e[r].toLowerCase(),l(["ipv4","ipv6","ipvfuture"].includes(e[r]),"options.version contains unknown version "+e[r]+" - must be one of ipv4, ipv6, ipvfuture");e=Array.from(new Set(e));const a=`(?:${e.map(r=>{if(m==="forbidden")return $.ip[r];const t=`\\/${r==="ipv4"?$.ip.v4Cidr:$.ip.v6Cidr}`;return m==="required"?`${$.ip[r]}${t}`:`${$.ip[r]}(?:${t})?`}).join("|")})`,i=new RegExp(`^${a}$`);return{cidr:m,versions:e,regex:i,raw:a}}},5752:(L,p,w)=>{const l=w(375),$=w(6064),y={generate:function(){const m={},e="\\dA-Fa-f",a="["+e+"]",i="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",t="%"+e,c=i+t+r+":@",s="["+c+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";m.ipv4address="(?:"+o+"\\.){3}"+o;const h=a+"{1,4}",g="(?:"+h+":"+h+"|"+m.ipv4address+")",b="(?:"+h+":){6}"+g,j="::(?:"+h+":){5}"+g,k="(?:"+h+")?::(?:"+h+":){4}"+g,f="(?:(?:"+h+":){0,1}"+h+")?::(?:"+h+":){3}"+g,v="(?:(?:"+h+":){0,2}"+h+")?::(?:"+h+":){2}"+g,x="(?:(?:"+h+":){0,3}"+h+")?::"+h+":"+g,E="(?:(?:"+h+":){0,4}"+h+")?::"+g,N="(?:(?:"+h+":){0,5}"+h+")?::"+h,M="(?:(?:"+h+":){0,6}"+h+")?::";m.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",m.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",m.ipv6address="(?:"+b+"|"+j+"|"+k+"|"+f+"|"+v+"|"+x+"|"+E+"|"+N+"|"+M+")",m.ipvFuture="v"+a+"+\\.["+i+r+":]+",m.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",m.schemeRegex=new RegExp(m.scheme);const n="["+i+t+r+":]*",d="["+i+t+r+"]{1,255}",_="(?:\\[(?:"+m.ipv6address+"|"+m.ipvFuture+")\\]|"+m.ipv4address+"|"+d+")",R="(?:"+n+"@)?"+_+"(?::\\d*)?",O="(?:"+n+"@)?("+_+")(?::\\d*)?",C=s+"*",D=s+"+",S="(?:\\/"+C+")*",u="\\/(?:"+D+S+")?",A=D+S,z="["+i+t+r+"@]+"+S,F="(?:\\/\\/\\/"+C+S+")";return m.hierPart="(?:(?:\\/\\/"+R+S+")|"+u+"|"+A+"|"+F+")",m.hierPartCapture="(?:(?:\\/\\/"+O+S+")|"+u+"|"+A+")",m.relativeRef="(?:(?:\\/\\/"+R+S+")|"+u+"|"+z+"|)",m.relativeRefCapture="(?:(?:\\/\\/"+O+S+")|"+u+"|"+z+"|)",m.query="["+c+"\\/\\?]*(?=#|$)",m.queryWithSquareBrackets="["+c+"\\[\\]\\/\\?]*(?=#|$)",m.fragment="["+c+"\\/\\?]*",m}};y.rfc3986=y.generate(),p.ip={v4Cidr:y.rfc3986.ipv4Cidr,v6Cidr:y.rfc3986.ipv6Cidr,ipv4:y.rfc3986.ipv4address,ipv6:y.rfc3986.ipv6address,ipvfuture:y.rfc3986.ipvFuture},y.createRegex=function(m){const e=y.rfc3986,a="(?:\\?"+(m.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=m.domain?e.relativeRefCapture:e.relativeRef;if(m.relativeOnly)return y.wrap(i+a);let r="";if(m.scheme){l(m.scheme instanceof RegExp||typeof m.scheme=="string"||Array.isArray(m.scheme),"scheme must be a RegExp, String, or Array");const s=[].concat(m.scheme);l(s.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let h=0;h<s.length;++h){const g=s[h];l(g instanceof RegExp||typeof g=="string","scheme at position "+h+" must be a RegExp or String"),g instanceof RegExp?o.push(g.source.toString()):(l(e.schemeRegex.test(g),"scheme at position "+h+" must be a valid scheme"),o.push($(g)))}r=o.join("|")}const t="(?:"+(r?"(?:"+r+")":e.scheme)+":"+(m.domain?e.hierPartCapture:e.hierPart)+")",c=m.allowRelative?"(?:"+t+"|"+i+")":t;return y.wrap(c+a,r)},y.wrap=function(m,e){return{raw:m=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${m}`,regex:new RegExp(`^${m}$`),scheme:e}},y.uriRegex=y.createRegex({}),p.regex=function(m={}){return m.scheme||m.allowRelative||m.relativeOnly||m.allowQuerySquareBrackets||m.domain?y.createRegex(m):y.uriRegex}},1447:(L,p)=>{const w={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};p.Parser=class{constructor(l,$={}){if(!$[w.settings]&&$.constants)for(const y in $.constants){const m=$.constants[y];if(m!==null&&!["boolean","number","string"].includes(typeof m))throw new Error(`Formula constant ${y} contains invalid ${typeof m} value type`)}this.settings=$[w.settings]?$:Object.assign({[w.settings]:!0,constants:{},functions:{}},$),this.single=null,this._parts=null,this._parse(l)}_parse(l){let $=[],y="",m=0,e=!1;const a=r=>{if(m)throw new Error("Formula missing closing parenthesis");const t=$.length?$[$.length-1]:null;if(e||y||r){if(t&&t.type==="reference"&&r===")")return t.type="function",t.value=this._subFormula(y,t.value),void(y="");if(r===")"){const c=new p.Parser(y,this.settings);$.push({type:"segment",value:c})}else if(e){if(e==="]")return $.push({type:"reference",value:y}),void(y="");$.push({type:"literal",value:y})}else if(w.operatorCharacters.includes(y))t&&t.type==="operator"&&w.operators.includes(t.value+y)?t.value+=y:$.push({type:"operator",value:y});else if(y.match(w.numberRx))$.push({type:"constant",value:parseFloat(y)});else if(this.settings.constants[y]!==void 0)$.push({type:"constant",value:this.settings.constants[y]});else{if(!y.match(w.tokenRx))throw new Error(`Formula contains invalid token: ${y}`);$.push({type:"reference",value:y})}y=""}};for(const r of l)e?r===e?(a(),e=!1):y+=r:m?r==="("?(y+=r,++m):r===")"?(--m,m?y+=r:a(r)):y+=r:r in w.literals?e=w.literals[r]:r==="("?(a(),++m):w.operatorCharacters.includes(r)?(a(),y=r,a()):r!==" "?y+=r:a();a(),$=$.map((r,t)=>r.type!=="operator"||r.value!=="-"||t&&$[t-1].type!=="operator"?r:{type:"operator",value:"n"});let i=!1;for(const r of $){if(r.type==="operator"){if(w.operatorsPrefix.includes(r.value))continue;if(!i)throw new Error("Formula contains an operator in invalid position");if(!w.operators.includes(r.value))throw new Error(`Formula contains an unknown operator ${r.value}`)}else if(i)throw new Error("Formula missing expected operator");i=!i}if(!i)throw new Error("Formula contains invalid trailing operator");$.length===1&&["reference","literal","constant"].includes($[0].type)&&(this.single={type:$[0].type==="reference"?"reference":"value",value:$[0].value}),this._parts=$.map(r=>{if(r.type==="operator")return w.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):w.reference(r.value)})}_subFormula(l,$){const y=this.settings.functions[$];if(typeof y!="function")throw new Error(`Formula contains unknown function ${$}`);let m=[];if(l){let e="",a=0,i=!1;const r=()=>{if(!e)throw new Error(`Formula contains function ${$} with invalid arguments ${l}`);m.push(e),e=""};for(let t=0;t<l.length;++t){const c=l[t];i?(e+=c,c===i&&(i=!1)):c in w.literals&&!a?(e+=c,i=w.literals[c]):c!==","||a?(e+=c,c==="("?++a:c===")"&&--a):r()}r()}return m=m.map(e=>new p.Parser(e,this.settings)),function(e){const a=[];for(const i of m)a.push(i.evaluate(e));return y.call(e,...a)}}evaluate(l){const $=this._parts.slice();for(let y=$.length-2;y>=0;--y){const m=$[y];if(m&&m.type==="operator"){const e=$[y+1];$.splice(y+1,1);const a=w.evaluate(e,l);$[y]=w.single(m.value,a)}}return w.operatorsOrder.forEach(y=>{for(let m=1;m<$.length-1;)if(y.includes($[m])){const e=$[m],a=w.evaluate($[m-1],l),i=w.evaluate($[m+1],l);$.splice(m,2);const r=w.calculate(e,a,i);$[m-1]=r===0?0:r}else m+=2}),w.evaluate($[0],l)}},p.Parser.prototype[w.symbol]=!0,w.reference=function(l){return function($){return $&&$[l]!==void 0?$[l]:null}},w.evaluate=function(l,$){return l===null?null:typeof l=="function"?l($):l[w.symbol]?l.evaluate($):l},w.single=function(l,$){if(l==="!")return!$;const y=-$;return y===0?0:y},w.calculate=function(l,$,y){if(l==="??")return w.exists($)?$:y;if(typeof $=="string"||typeof y=="string"){if(l==="+")return($=w.exists($)?$:"")+(w.exists(y)?y:"")}else switch(l){case"^":return Math.pow($,y);case"*":return $*y;case"/":return $/y;case"%":return $%y;case"+":return $+y;case"-":return $-y}switch(l){case"<":return $<y;case"<=":return $<=y;case">":return $>y;case">=":return $>=y;case"==":return $===y;case"!=":return $!==y;case"&&":return $&&y;case"||":return $||y}return null},w.exists=function(l){return l!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:L=>{L.exports=JSON.parse('{"version":"17.13.3"}')}},T={},function L(p){var w=T[p];if(w!==void 0)return w.exports;var l=T[p]={exports:{}};return B[p](l,l.exports,L),l.exports}(5107);var B,T})})(fr);var Zr=fr.exports,At={},Ot={exports:{}};Ot.exports;(function(I){(function(P,B){function T(M,n){if(!M)throw new Error(n||"Assertion failed")}function L(M,n){M.super_=n;var d=function(){};d.prototype=n.prototype,M.prototype=new d,M.prototype.constructor=M}function p(M,n,d){if(p.isBN(M))return M;this.negative=0,this.words=null,this.length=0,this.red=null,M!==null&&((n==="le"||n==="be")&&(d=n,n=10),this._init(M||0,n||10,d||"be"))}typeof P=="object"?P.exports=p:B.BN=p,p.BN=p,p.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=Dr.Buffer}catch{}p.isBN=function(n){return n instanceof p?!0:n!==null&&typeof n=="object"&&n.constructor.wordSize===p.wordSize&&Array.isArray(n.words)},p.max=function(n,d){return n.cmp(d)>0?n:d},p.min=function(n,d){return n.cmp(d)<0?n:d},p.prototype._init=function(n,d,_){if(typeof n=="number")return this._initNumber(n,d,_);if(typeof n=="object")return this._initArray(n,d,_);d==="hex"&&(d=16),T(d===(d|0)&&d>=2&&d<=36),n=n.toString().replace(/\s+/g,"");var R=0;n[0]==="-"&&(R++,this.negative=1),R<n.length&&(d===16?this._parseHex(n,R,_):(this._parseBase(n,d,R),_==="le"&&this._initArray(this.toArray(),d,_)))},p.prototype._initNumber=function(n,d,_){n<0&&(this.negative=1,n=-n),n<67108864?(this.words=[n&67108863],this.length=1):n<4503599627370496?(this.words=[n&67108863,n/67108864&67108863],this.length=2):(T(n<9007199254740992),this.words=[n&67108863,n/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),d,_)},p.prototype._initArray=function(n,d,_){if(T(typeof n.length=="number"),n.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(n.length/3),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var O,C,D=0;if(_==="be")for(R=n.length-1,O=0;R>=0;R-=3)C=n[R]|n[R-1]<<8|n[R-2]<<16,this.words[O]|=C<<D&67108863,this.words[O+1]=C>>>26-D&67108863,D+=24,D>=26&&(D-=26,O++);else if(_==="le")for(R=0,O=0;R<n.length;R+=3)C=n[R]|n[R+1]<<8|n[R+2]<<16,this.words[O]|=C<<D&67108863,this.words[O+1]=C>>>26-D&67108863,D+=24,D>=26&&(D-=26,O++);return this._strip()};function l(M,n){var d=M.charCodeAt(n);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;T(!1,"Invalid character in "+M)}function $(M,n,d){var _=l(M,d);return d-1>=n&&(_|=l(M,d-1)<<4),_}p.prototype._parseHex=function(n,d,_){this.length=Math.ceil((n.length-d)/6),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var O=0,C=0,D;if(_==="be")for(R=n.length-1;R>=d;R-=2)D=$(n,d,R)<<O,this.words[C]|=D&67108863,O>=18?(O-=18,C+=1,this.words[C]|=D>>>26):O+=8;else{var S=n.length-d;for(R=S%2===0?d+1:d;R<n.length;R+=2)D=$(n,d,R)<<O,this.words[C]|=D&67108863,O>=18?(O-=18,C+=1,this.words[C]|=D>>>26):O+=8}this._strip()};function y(M,n,d,_){for(var R=0,O=0,C=Math.min(M.length,d),D=n;D<C;D++){var S=M.charCodeAt(D)-48;R*=_,S>=49?O=S-49+10:S>=17?O=S-17+10:O=S,T(S>=0&&O<_,"Invalid character"),R+=O}return R}p.prototype._parseBase=function(n,d,_){this.words=[0],this.length=1;for(var R=0,O=1;O<=67108863;O*=d)R++;R--,O=O/d|0;for(var C=n.length-_,D=C%R,S=Math.min(C,C-D)+_,u=0,A=_;A<S;A+=R)u=y(n,A,A+R,d),this.imuln(O),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(D!==0){var z=1;for(u=y(n,A,n.length,d),A=0;A<D;A++)z*=d;this.imuln(z),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},p.prototype.copy=function(n){n.words=new Array(this.length);for(var d=0;d<this.length;d++)n.words[d]=this.words[d];n.length=this.length,n.negative=this.negative,n.red=this.red};function m(M,n){M.words=n.words,M.length=n.length,M.negative=n.negative,M.red=n.red}if(p.prototype._move=function(n){m(n,this)},p.prototype.clone=function(){var n=new p(null);return this.copy(n),n},p.prototype._expand=function(n){for(;this.length<n;)this.words[this.length++]=0;return this},p.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},p.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{p.prototype[Symbol.for("nodejs.util.inspect.custom")]=e}catch{p.prototype.inspect=e}else p.prototype.inspect=e;function e(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],i=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],r=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];p.prototype.toString=function(n,d){n=n||10,d=d|0||1;var _;if(n===16||n==="hex"){_="";for(var R=0,O=0,C=0;C<this.length;C++){var D=this.words[C],S=((D<<R|O)&16777215).toString(16);O=D>>>24-R&16777215,R+=2,R>=26&&(R-=26,C--),O!==0||C!==this.length-1?_=a[6-S.length]+S+_:_=S+_}for(O!==0&&(_=O.toString(16)+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(n===(n|0)&&n>=2&&n<=36){var u=i[n],A=r[n];_="";var z=this.clone();for(z.negative=0;!z.isZero();){var F=z.modrn(A).toString(n);z=z.idivn(A),z.isZero()?_=F+_:_=a[u-F.length]+F+_}for(this.isZero()&&(_="0"+_);_.length%d!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}T(!1,"Base should be between 2 and 36")},p.prototype.toNumber=function(){var n=this.words[0];return this.length===2?n+=this.words[1]*67108864:this.length===3&&this.words[2]===1?n+=4503599627370496+this.words[1]*67108864:this.length>2&&T(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-n:n},p.prototype.toJSON=function(){return this.toString(16,2)},w&&(p.prototype.toBuffer=function(n,d){return this.toArrayLike(w,n,d)}),p.prototype.toArray=function(n,d){return this.toArrayLike(Array,n,d)};var t=function(n,d){return n.allocUnsafe?n.allocUnsafe(d):new n(d)};p.prototype.toArrayLike=function(n,d,_){this._strip();var R=this.byteLength(),O=_||Math.max(1,R);T(R<=O,"byte array longer than desired length"),T(O>0,"Requested array length <= 0");var C=t(n,O),D=d==="le"?"LE":"BE";return this["_toArrayLike"+D](C,R),C},p.prototype._toArrayLikeLE=function(n,d){for(var _=0,R=0,O=0,C=0;O<this.length;O++){var D=this.words[O]<<C|R;n[_++]=D&255,_<n.length&&(n[_++]=D>>8&255),_<n.length&&(n[_++]=D>>16&255),C===6?(_<n.length&&(n[_++]=D>>24&255),R=0,C=0):(R=D>>>24,C+=2)}if(_<n.length)for(n[_++]=R;_<n.length;)n[_++]=0},p.prototype._toArrayLikeBE=function(n,d){for(var _=n.length-1,R=0,O=0,C=0;O<this.length;O++){var D=this.words[O]<<C|R;n[_--]=D&255,_>=0&&(n[_--]=D>>8&255),_>=0&&(n[_--]=D>>16&255),C===6?(_>=0&&(n[_--]=D>>24&255),R=0,C=0):(R=D>>>24,C+=2)}if(_>=0)for(n[_--]=R;_>=0;)n[_--]=0},Math.clz32?p.prototype._countBits=function(n){return 32-Math.clz32(n)}:p.prototype._countBits=function(n){var d=n,_=0;return d>=4096&&(_+=13,d>>>=13),d>=64&&(_+=7,d>>>=7),d>=8&&(_+=4,d>>>=4),d>=2&&(_+=2,d>>>=2),_+d},p.prototype._zeroBits=function(n){if(n===0)return 26;var d=n,_=0;return d&8191||(_+=13,d>>>=13),d&127||(_+=7,d>>>=7),d&15||(_+=4,d>>>=4),d&3||(_+=2,d>>>=2),d&1||_++,_},p.prototype.bitLength=function(){var n=this.words[this.length-1],d=this._countBits(n);return(this.length-1)*26+d};function c(M){for(var n=new Array(M.bitLength()),d=0;d<n.length;d++){var _=d/26|0,R=d%26;n[d]=M.words[_]>>>R&1}return n}p.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,d=0;d<this.length;d++){var _=this._zeroBits(this.words[d]);if(n+=_,_!==26)break}return n},p.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},p.prototype.toTwos=function(n){return this.negative!==0?this.abs().inotn(n).iaddn(1):this.clone()},p.prototype.fromTwos=function(n){return this.testn(n-1)?this.notn(n).iaddn(1).ineg():this.clone()},p.prototype.isNeg=function(){return this.negative!==0},p.prototype.neg=function(){return this.clone().ineg()},p.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},p.prototype.iuor=function(n){for(;this.length<n.length;)this.words[this.length++]=0;for(var d=0;d<n.length;d++)this.words[d]=this.words[d]|n.words[d];return this._strip()},p.prototype.ior=function(n){return T((this.negative|n.negative)===0),this.iuor(n)},p.prototype.or=function(n){return this.length>n.length?this.clone().ior(n):n.clone().ior(this)},p.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},p.prototype.iuand=function(n){var d;this.length>n.length?d=n:d=this;for(var _=0;_<d.length;_++)this.words[_]=this.words[_]&n.words[_];return this.length=d.length,this._strip()},p.prototype.iand=function(n){return T((this.negative|n.negative)===0),this.iuand(n)},p.prototype.and=function(n){return this.length>n.length?this.clone().iand(n):n.clone().iand(this)},p.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},p.prototype.iuxor=function(n){var d,_;this.length>n.length?(d=this,_=n):(d=n,_=this);for(var R=0;R<_.length;R++)this.words[R]=d.words[R]^_.words[R];if(this!==d)for(;R<d.length;R++)this.words[R]=d.words[R];return this.length=d.length,this._strip()},p.prototype.ixor=function(n){return T((this.negative|n.negative)===0),this.iuxor(n)},p.prototype.xor=function(n){return this.length>n.length?this.clone().ixor(n):n.clone().ixor(this)},p.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},p.prototype.inotn=function(n){T(typeof n=="number"&&n>=0);var d=Math.ceil(n/26)|0,_=n%26;this._expand(d),_>0&&d--;for(var R=0;R<d;R++)this.words[R]=~this.words[R]&67108863;return _>0&&(this.words[R]=~this.words[R]&67108863>>26-_),this._strip()},p.prototype.notn=function(n){return this.clone().inotn(n)},p.prototype.setn=function(n,d){T(typeof n=="number"&&n>=0);var _=n/26|0,R=n%26;return this._expand(_+1),d?this.words[_]=this.words[_]|1<<R:this.words[_]=this.words[_]&~(1<<R),this._strip()},p.prototype.iadd=function(n){var d;if(this.negative!==0&&n.negative===0)return this.negative=0,d=this.isub(n),this.negative^=1,this._normSign();if(this.negative===0&&n.negative!==0)return n.negative=0,d=this.isub(n),n.negative=1,d._normSign();var _,R;this.length>n.length?(_=this,R=n):(_=n,R=this);for(var O=0,C=0;C<R.length;C++)d=(_.words[C]|0)+(R.words[C]|0)+O,this.words[C]=d&67108863,O=d>>>26;for(;O!==0&&C<_.length;C++)d=(_.words[C]|0)+O,this.words[C]=d&67108863,O=d>>>26;if(this.length=_.length,O!==0)this.words[this.length]=O,this.length++;else if(_!==this)for(;C<_.length;C++)this.words[C]=_.words[C];return this},p.prototype.add=function(n){var d;return n.negative!==0&&this.negative===0?(n.negative=0,d=this.sub(n),n.negative^=1,d):n.negative===0&&this.negative!==0?(this.negative=0,d=n.sub(this),this.negative=1,d):this.length>n.length?this.clone().iadd(n):n.clone().iadd(this)},p.prototype.isub=function(n){if(n.negative!==0){n.negative=0;var d=this.iadd(n);return n.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var _=this.cmp(n);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var R,O;_>0?(R=this,O=n):(R=n,O=this);for(var C=0,D=0;D<O.length;D++)d=(R.words[D]|0)-(O.words[D]|0)+C,C=d>>26,this.words[D]=d&67108863;for(;C!==0&&D<R.length;D++)d=(R.words[D]|0)+C,C=d>>26,this.words[D]=d&67108863;if(C===0&&D<R.length&&R!==this)for(;D<R.length;D++)this.words[D]=R.words[D];return this.length=Math.max(this.length,D),R!==this&&(this.negative=1),this._strip()},p.prototype.sub=function(n){return this.clone().isub(n)};function s(M,n,d){d.negative=n.negative^M.negative;var _=M.length+n.length|0;d.length=_,_=_-1|0;var R=M.words[0]|0,O=n.words[0]|0,C=R*O,D=C&67108863,S=C/67108864|0;d.words[0]=D;for(var u=1;u<_;u++){for(var A=S>>>26,z=S&67108863,F=Math.min(u,n.length-1),J=Math.max(0,u-M.length+1);J<=F;J++){var W=u-J|0;R=M.words[W]|0,O=n.words[J]|0,C=R*O+z,A+=C/67108864|0,z=C&67108863}d.words[u]=z|0,S=A|0}return S!==0?d.words[u]=S|0:d.length--,d._strip()}var o=function(n,d,_){var R=n.words,O=d.words,C=_.words,D=0,S,u,A,z=R[0]|0,F=z&8191,J=z>>>13,W=R[1]|0,V=W&8191,K=W>>>13,Dt=R[2]|0,Z=Dt&8191,H=Dt>>>13,It=R[3]|0,G=It&8191,Y=It>>>13,Tt=R[4]|0,Q=Tt&8191,X=Tt>>>13,Lt=R[5]|0,ee=Lt&8191,te=Lt>>>13,qt=R[6]|0,re=qt&8191,se=qt>>>13,Nt=R[7]|0,ne=Nt&8191,ie=Nt>>>13,Pt=R[8]|0,ae=Pt&8191,oe=Pt>>>13,zt=R[9]|0,le=zt&8191,ce=zt>>>13,Ft=O[0]|0,ue=Ft&8191,fe=Ft>>>13,Bt=O[1]|0,he=Bt&8191,de=Bt>>>13,Jt=O[2]|0,me=Jt&8191,pe=Jt>>>13,Ut=O[3]|0,ge=Ut&8191,ve=Ut>>>13,Vt=O[4]|0,ye=Vt&8191,be=Vt>>>13,Kt=O[5]|0,_e=Kt&8191,we=Kt>>>13,Wt=O[6]|0,xe=Wt&8191,Me=Wt>>>13,Zt=O[7]|0,$e=Zt&8191,ke=Zt>>>13,Ht=O[8]|0,je=Ht&8191,Se=Ht>>>13,Gt=O[9]|0,Re=Gt&8191,Ae=Gt>>>13;_.negative=n.negative^d.negative,_.length=19,S=Math.imul(F,ue),u=Math.imul(F,fe),u=u+Math.imul(J,ue)|0,A=Math.imul(J,fe);var Ye=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,S=Math.imul(V,ue),u=Math.imul(V,fe),u=u+Math.imul(K,ue)|0,A=Math.imul(K,fe),S=S+Math.imul(F,he)|0,u=u+Math.imul(F,de)|0,u=u+Math.imul(J,he)|0,A=A+Math.imul(J,de)|0;var Qe=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,S=Math.imul(Z,ue),u=Math.imul(Z,fe),u=u+Math.imul(H,ue)|0,A=Math.imul(H,fe),S=S+Math.imul(V,he)|0,u=u+Math.imul(V,de)|0,u=u+Math.imul(K,he)|0,A=A+Math.imul(K,de)|0,S=S+Math.imul(F,me)|0,u=u+Math.imul(F,pe)|0,u=u+Math.imul(J,me)|0,A=A+Math.imul(J,pe)|0;var Xe=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,S=Math.imul(G,ue),u=Math.imul(G,fe),u=u+Math.imul(Y,ue)|0,A=Math.imul(Y,fe),S=S+Math.imul(Z,he)|0,u=u+Math.imul(Z,de)|0,u=u+Math.imul(H,he)|0,A=A+Math.imul(H,de)|0,S=S+Math.imul(V,me)|0,u=u+Math.imul(V,pe)|0,u=u+Math.imul(K,me)|0,A=A+Math.imul(K,pe)|0,S=S+Math.imul(F,ge)|0,u=u+Math.imul(F,ve)|0,u=u+Math.imul(J,ge)|0,A=A+Math.imul(J,ve)|0;var et=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(et>>>26)|0,et&=67108863,S=Math.imul(Q,ue),u=Math.imul(Q,fe),u=u+Math.imul(X,ue)|0,A=Math.imul(X,fe),S=S+Math.imul(G,he)|0,u=u+Math.imul(G,de)|0,u=u+Math.imul(Y,he)|0,A=A+Math.imul(Y,de)|0,S=S+Math.imul(Z,me)|0,u=u+Math.imul(Z,pe)|0,u=u+Math.imul(H,me)|0,A=A+Math.imul(H,pe)|0,S=S+Math.imul(V,ge)|0,u=u+Math.imul(V,ve)|0,u=u+Math.imul(K,ge)|0,A=A+Math.imul(K,ve)|0,S=S+Math.imul(F,ye)|0,u=u+Math.imul(F,be)|0,u=u+Math.imul(J,ye)|0,A=A+Math.imul(J,be)|0;var tt=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(tt>>>26)|0,tt&=67108863,S=Math.imul(ee,ue),u=Math.imul(ee,fe),u=u+Math.imul(te,ue)|0,A=Math.imul(te,fe),S=S+Math.imul(Q,he)|0,u=u+Math.imul(Q,de)|0,u=u+Math.imul(X,he)|0,A=A+Math.imul(X,de)|0,S=S+Math.imul(G,me)|0,u=u+Math.imul(G,pe)|0,u=u+Math.imul(Y,me)|0,A=A+Math.imul(Y,pe)|0,S=S+Math.imul(Z,ge)|0,u=u+Math.imul(Z,ve)|0,u=u+Math.imul(H,ge)|0,A=A+Math.imul(H,ve)|0,S=S+Math.imul(V,ye)|0,u=u+Math.imul(V,be)|0,u=u+Math.imul(K,ye)|0,A=A+Math.imul(K,be)|0,S=S+Math.imul(F,_e)|0,u=u+Math.imul(F,we)|0,u=u+Math.imul(J,_e)|0,A=A+Math.imul(J,we)|0;var rt=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(rt>>>26)|0,rt&=67108863,S=Math.imul(re,ue),u=Math.imul(re,fe),u=u+Math.imul(se,ue)|0,A=Math.imul(se,fe),S=S+Math.imul(ee,he)|0,u=u+Math.imul(ee,de)|0,u=u+Math.imul(te,he)|0,A=A+Math.imul(te,de)|0,S=S+Math.imul(Q,me)|0,u=u+Math.imul(Q,pe)|0,u=u+Math.imul(X,me)|0,A=A+Math.imul(X,pe)|0,S=S+Math.imul(G,ge)|0,u=u+Math.imul(G,ve)|0,u=u+Math.imul(Y,ge)|0,A=A+Math.imul(Y,ve)|0,S=S+Math.imul(Z,ye)|0,u=u+Math.imul(Z,be)|0,u=u+Math.imul(H,ye)|0,A=A+Math.imul(H,be)|0,S=S+Math.imul(V,_e)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(K,_e)|0,A=A+Math.imul(K,we)|0,S=S+Math.imul(F,xe)|0,u=u+Math.imul(F,Me)|0,u=u+Math.imul(J,xe)|0,A=A+Math.imul(J,Me)|0;var st=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(st>>>26)|0,st&=67108863,S=Math.imul(ne,ue),u=Math.imul(ne,fe),u=u+Math.imul(ie,ue)|0,A=Math.imul(ie,fe),S=S+Math.imul(re,he)|0,u=u+Math.imul(re,de)|0,u=u+Math.imul(se,he)|0,A=A+Math.imul(se,de)|0,S=S+Math.imul(ee,me)|0,u=u+Math.imul(ee,pe)|0,u=u+Math.imul(te,me)|0,A=A+Math.imul(te,pe)|0,S=S+Math.imul(Q,ge)|0,u=u+Math.imul(Q,ve)|0,u=u+Math.imul(X,ge)|0,A=A+Math.imul(X,ve)|0,S=S+Math.imul(G,ye)|0,u=u+Math.imul(G,be)|0,u=u+Math.imul(Y,ye)|0,A=A+Math.imul(Y,be)|0,S=S+Math.imul(Z,_e)|0,u=u+Math.imul(Z,we)|0,u=u+Math.imul(H,_e)|0,A=A+Math.imul(H,we)|0,S=S+Math.imul(V,xe)|0,u=u+Math.imul(V,Me)|0,u=u+Math.imul(K,xe)|0,A=A+Math.imul(K,Me)|0,S=S+Math.imul(F,$e)|0,u=u+Math.imul(F,ke)|0,u=u+Math.imul(J,$e)|0,A=A+Math.imul(J,ke)|0;var nt=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(nt>>>26)|0,nt&=67108863,S=Math.imul(ae,ue),u=Math.imul(ae,fe),u=u+Math.imul(oe,ue)|0,A=Math.imul(oe,fe),S=S+Math.imul(ne,he)|0,u=u+Math.imul(ne,de)|0,u=u+Math.imul(ie,he)|0,A=A+Math.imul(ie,de)|0,S=S+Math.imul(re,me)|0,u=u+Math.imul(re,pe)|0,u=u+Math.imul(se,me)|0,A=A+Math.imul(se,pe)|0,S=S+Math.imul(ee,ge)|0,u=u+Math.imul(ee,ve)|0,u=u+Math.imul(te,ge)|0,A=A+Math.imul(te,ve)|0,S=S+Math.imul(Q,ye)|0,u=u+Math.imul(Q,be)|0,u=u+Math.imul(X,ye)|0,A=A+Math.imul(X,be)|0,S=S+Math.imul(G,_e)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,_e)|0,A=A+Math.imul(Y,we)|0,S=S+Math.imul(Z,xe)|0,u=u+Math.imul(Z,Me)|0,u=u+Math.imul(H,xe)|0,A=A+Math.imul(H,Me)|0,S=S+Math.imul(V,$e)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(K,$e)|0,A=A+Math.imul(K,ke)|0,S=S+Math.imul(F,je)|0,u=u+Math.imul(F,Se)|0,u=u+Math.imul(J,je)|0,A=A+Math.imul(J,Se)|0;var it=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(it>>>26)|0,it&=67108863,S=Math.imul(le,ue),u=Math.imul(le,fe),u=u+Math.imul(ce,ue)|0,A=Math.imul(ce,fe),S=S+Math.imul(ae,he)|0,u=u+Math.imul(ae,de)|0,u=u+Math.imul(oe,he)|0,A=A+Math.imul(oe,de)|0,S=S+Math.imul(ne,me)|0,u=u+Math.imul(ne,pe)|0,u=u+Math.imul(ie,me)|0,A=A+Math.imul(ie,pe)|0,S=S+Math.imul(re,ge)|0,u=u+Math.imul(re,ve)|0,u=u+Math.imul(se,ge)|0,A=A+Math.imul(se,ve)|0,S=S+Math.imul(ee,ye)|0,u=u+Math.imul(ee,be)|0,u=u+Math.imul(te,ye)|0,A=A+Math.imul(te,be)|0,S=S+Math.imul(Q,_e)|0,u=u+Math.imul(Q,we)|0,u=u+Math.imul(X,_e)|0,A=A+Math.imul(X,we)|0,S=S+Math.imul(G,xe)|0,u=u+Math.imul(G,Me)|0,u=u+Math.imul(Y,xe)|0,A=A+Math.imul(Y,Me)|0,S=S+Math.imul(Z,$e)|0,u=u+Math.imul(Z,ke)|0,u=u+Math.imul(H,$e)|0,A=A+Math.imul(H,ke)|0,S=S+Math.imul(V,je)|0,u=u+Math.imul(V,Se)|0,u=u+Math.imul(K,je)|0,A=A+Math.imul(K,Se)|0,S=S+Math.imul(F,Re)|0,u=u+Math.imul(F,Ae)|0,u=u+Math.imul(J,Re)|0,A=A+Math.imul(J,Ae)|0;var at=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(at>>>26)|0,at&=67108863,S=Math.imul(le,he),u=Math.imul(le,de),u=u+Math.imul(ce,he)|0,A=Math.imul(ce,de),S=S+Math.imul(ae,me)|0,u=u+Math.imul(ae,pe)|0,u=u+Math.imul(oe,me)|0,A=A+Math.imul(oe,pe)|0,S=S+Math.imul(ne,ge)|0,u=u+Math.imul(ne,ve)|0,u=u+Math.imul(ie,ge)|0,A=A+Math.imul(ie,ve)|0,S=S+Math.imul(re,ye)|0,u=u+Math.imul(re,be)|0,u=u+Math.imul(se,ye)|0,A=A+Math.imul(se,be)|0,S=S+Math.imul(ee,_e)|0,u=u+Math.imul(ee,we)|0,u=u+Math.imul(te,_e)|0,A=A+Math.imul(te,we)|0,S=S+Math.imul(Q,xe)|0,u=u+Math.imul(Q,Me)|0,u=u+Math.imul(X,xe)|0,A=A+Math.imul(X,Me)|0,S=S+Math.imul(G,$e)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,$e)|0,A=A+Math.imul(Y,ke)|0,S=S+Math.imul(Z,je)|0,u=u+Math.imul(Z,Se)|0,u=u+Math.imul(H,je)|0,A=A+Math.imul(H,Se)|0,S=S+Math.imul(V,Re)|0,u=u+Math.imul(V,Ae)|0,u=u+Math.imul(K,Re)|0,A=A+Math.imul(K,Ae)|0;var ot=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(ot>>>26)|0,ot&=67108863,S=Math.imul(le,me),u=Math.imul(le,pe),u=u+Math.imul(ce,me)|0,A=Math.imul(ce,pe),S=S+Math.imul(ae,ge)|0,u=u+Math.imul(ae,ve)|0,u=u+Math.imul(oe,ge)|0,A=A+Math.imul(oe,ve)|0,S=S+Math.imul(ne,ye)|0,u=u+Math.imul(ne,be)|0,u=u+Math.imul(ie,ye)|0,A=A+Math.imul(ie,be)|0,S=S+Math.imul(re,_e)|0,u=u+Math.imul(re,we)|0,u=u+Math.imul(se,_e)|0,A=A+Math.imul(se,we)|0,S=S+Math.imul(ee,xe)|0,u=u+Math.imul(ee,Me)|0,u=u+Math.imul(te,xe)|0,A=A+Math.imul(te,Me)|0,S=S+Math.imul(Q,$e)|0,u=u+Math.imul(Q,ke)|0,u=u+Math.imul(X,$e)|0,A=A+Math.imul(X,ke)|0,S=S+Math.imul(G,je)|0,u=u+Math.imul(G,Se)|0,u=u+Math.imul(Y,je)|0,A=A+Math.imul(Y,Se)|0,S=S+Math.imul(Z,Re)|0,u=u+Math.imul(Z,Ae)|0,u=u+Math.imul(H,Re)|0,A=A+Math.imul(H,Ae)|0;var lt=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(lt>>>26)|0,lt&=67108863,S=Math.imul(le,ge),u=Math.imul(le,ve),u=u+Math.imul(ce,ge)|0,A=Math.imul(ce,ve),S=S+Math.imul(ae,ye)|0,u=u+Math.imul(ae,be)|0,u=u+Math.imul(oe,ye)|0,A=A+Math.imul(oe,be)|0,S=S+Math.imul(ne,_e)|0,u=u+Math.imul(ne,we)|0,u=u+Math.imul(ie,_e)|0,A=A+Math.imul(ie,we)|0,S=S+Math.imul(re,xe)|0,u=u+Math.imul(re,Me)|0,u=u+Math.imul(se,xe)|0,A=A+Math.imul(se,Me)|0,S=S+Math.imul(ee,$e)|0,u=u+Math.imul(ee,ke)|0,u=u+Math.imul(te,$e)|0,A=A+Math.imul(te,ke)|0,S=S+Math.imul(Q,je)|0,u=u+Math.imul(Q,Se)|0,u=u+Math.imul(X,je)|0,A=A+Math.imul(X,Se)|0,S=S+Math.imul(G,Re)|0,u=u+Math.imul(G,Ae)|0,u=u+Math.imul(Y,Re)|0,A=A+Math.imul(Y,Ae)|0;var ct=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(ct>>>26)|0,ct&=67108863,S=Math.imul(le,ye),u=Math.imul(le,be),u=u+Math.imul(ce,ye)|0,A=Math.imul(ce,be),S=S+Math.imul(ae,_e)|0,u=u+Math.imul(ae,we)|0,u=u+Math.imul(oe,_e)|0,A=A+Math.imul(oe,we)|0,S=S+Math.imul(ne,xe)|0,u=u+Math.imul(ne,Me)|0,u=u+Math.imul(ie,xe)|0,A=A+Math.imul(ie,Me)|0,S=S+Math.imul(re,$e)|0,u=u+Math.imul(re,ke)|0,u=u+Math.imul(se,$e)|0,A=A+Math.imul(se,ke)|0,S=S+Math.imul(ee,je)|0,u=u+Math.imul(ee,Se)|0,u=u+Math.imul(te,je)|0,A=A+Math.imul(te,Se)|0,S=S+Math.imul(Q,Re)|0,u=u+Math.imul(Q,Ae)|0,u=u+Math.imul(X,Re)|0,A=A+Math.imul(X,Ae)|0;var ut=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(ut>>>26)|0,ut&=67108863,S=Math.imul(le,_e),u=Math.imul(le,we),u=u+Math.imul(ce,_e)|0,A=Math.imul(ce,we),S=S+Math.imul(ae,xe)|0,u=u+Math.imul(ae,Me)|0,u=u+Math.imul(oe,xe)|0,A=A+Math.imul(oe,Me)|0,S=S+Math.imul(ne,$e)|0,u=u+Math.imul(ne,ke)|0,u=u+Math.imul(ie,$e)|0,A=A+Math.imul(ie,ke)|0,S=S+Math.imul(re,je)|0,u=u+Math.imul(re,Se)|0,u=u+Math.imul(se,je)|0,A=A+Math.imul(se,Se)|0,S=S+Math.imul(ee,Re)|0,u=u+Math.imul(ee,Ae)|0,u=u+Math.imul(te,Re)|0,A=A+Math.imul(te,Ae)|0;var ft=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(ft>>>26)|0,ft&=67108863,S=Math.imul(le,xe),u=Math.imul(le,Me),u=u+Math.imul(ce,xe)|0,A=Math.imul(ce,Me),S=S+Math.imul(ae,$e)|0,u=u+Math.imul(ae,ke)|0,u=u+Math.imul(oe,$e)|0,A=A+Math.imul(oe,ke)|0,S=S+Math.imul(ne,je)|0,u=u+Math.imul(ne,Se)|0,u=u+Math.imul(ie,je)|0,A=A+Math.imul(ie,Se)|0,S=S+Math.imul(re,Re)|0,u=u+Math.imul(re,Ae)|0,u=u+Math.imul(se,Re)|0,A=A+Math.imul(se,Ae)|0;var ht=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(ht>>>26)|0,ht&=67108863,S=Math.imul(le,$e),u=Math.imul(le,ke),u=u+Math.imul(ce,$e)|0,A=Math.imul(ce,ke),S=S+Math.imul(ae,je)|0,u=u+Math.imul(ae,Se)|0,u=u+Math.imul(oe,je)|0,A=A+Math.imul(oe,Se)|0,S=S+Math.imul(ne,Re)|0,u=u+Math.imul(ne,Ae)|0,u=u+Math.imul(ie,Re)|0,A=A+Math.imul(ie,Ae)|0;var dt=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(dt>>>26)|0,dt&=67108863,S=Math.imul(le,je),u=Math.imul(le,Se),u=u+Math.imul(ce,je)|0,A=Math.imul(ce,Se),S=S+Math.imul(ae,Re)|0,u=u+Math.imul(ae,Ae)|0,u=u+Math.imul(oe,Re)|0,A=A+Math.imul(oe,Ae)|0;var mt=(D+S|0)+((u&8191)<<13)|0;D=(A+(u>>>13)|0)+(mt>>>26)|0,mt&=67108863,S=Math.imul(le,Re),u=Math.imul(le,Ae),u=u+Math.imul(ce,Re)|0,A=Math.imul(ce,Ae);var pt=(D+S|0)+((u&8191)<<13)|0;return D=(A+(u>>>13)|0)+(pt>>>26)|0,pt&=67108863,C[0]=Ye,C[1]=Qe,C[2]=Xe,C[3]=et,C[4]=tt,C[5]=rt,C[6]=st,C[7]=nt,C[8]=it,C[9]=at,C[10]=ot,C[11]=lt,C[12]=ct,C[13]=ut,C[14]=ft,C[15]=ht,C[16]=dt,C[17]=mt,C[18]=pt,D!==0&&(C[19]=D,_.length++),_};Math.imul||(o=s);function h(M,n,d){d.negative=n.negative^M.negative,d.length=M.length+n.length;for(var _=0,R=0,O=0;O<d.length-1;O++){var C=R;R=0;for(var D=_&67108863,S=Math.min(O,n.length-1),u=Math.max(0,O-M.length+1);u<=S;u++){var A=O-u,z=M.words[A]|0,F=n.words[u]|0,J=z*F,W=J&67108863;C=C+(J/67108864|0)|0,W=W+D|0,D=W&67108863,C=C+(W>>>26)|0,R+=C>>>26,C&=67108863}d.words[O]=D,_=C,C=R}return _!==0?d.words[O]=_:d.length--,d._strip()}function g(M,n,d){return h(M,n,d)}p.prototype.mulTo=function(n,d){var _,R=this.length+n.length;return this.length===10&&n.length===10?_=o(this,n,d):R<63?_=s(this,n,d):R<1024?_=h(this,n,d):_=g(this,n,d),_},p.prototype.mul=function(n){var d=new p(null);return d.words=new Array(this.length+n.length),this.mulTo(n,d)},p.prototype.mulf=function(n){var d=new p(null);return d.words=new Array(this.length+n.length),g(this,n,d)},p.prototype.imul=function(n){return this.clone().mulTo(n,this)},p.prototype.imuln=function(n){var d=n<0;d&&(n=-n),T(typeof n=="number"),T(n<67108864);for(var _=0,R=0;R<this.length;R++){var O=(this.words[R]|0)*n,C=(O&67108863)+(_&67108863);_>>=26,_+=O/67108864|0,_+=C>>>26,this.words[R]=C&67108863}return _!==0&&(this.words[R]=_,this.length++),d?this.ineg():this},p.prototype.muln=function(n){return this.clone().imuln(n)},p.prototype.sqr=function(){return this.mul(this)},p.prototype.isqr=function(){return this.imul(this.clone())},p.prototype.pow=function(n){var d=c(n);if(d.length===0)return new p(1);for(var _=this,R=0;R<d.length&&d[R]===0;R++,_=_.sqr());if(++R<d.length)for(var O=_.sqr();R<d.length;R++,O=O.sqr())d[R]!==0&&(_=_.mul(O));return _},p.prototype.iushln=function(n){T(typeof n=="number"&&n>=0);var d=n%26,_=(n-d)/26,R=67108863>>>26-d<<26-d,O;if(d!==0){var C=0;for(O=0;O<this.length;O++){var D=this.words[O]&R,S=(this.words[O]|0)-D<<d;this.words[O]=S|C,C=D>>>26-d}C&&(this.words[O]=C,this.length++)}if(_!==0){for(O=this.length-1;O>=0;O--)this.words[O+_]=this.words[O];for(O=0;O<_;O++)this.words[O]=0;this.length+=_}return this._strip()},p.prototype.ishln=function(n){return T(this.negative===0),this.iushln(n)},p.prototype.iushrn=function(n,d,_){T(typeof n=="number"&&n>=0);var R;d?R=(d-d%26)/26:R=0;var O=n%26,C=Math.min((n-O)/26,this.length),D=67108863^67108863>>>O<<O,S=_;if(R-=C,R=Math.max(0,R),S){for(var u=0;u<C;u++)S.words[u]=this.words[u];S.length=C}if(C!==0)if(this.length>C)for(this.length-=C,u=0;u<this.length;u++)this.words[u]=this.words[u+C];else this.words[0]=0,this.length=1;var A=0;for(u=this.length-1;u>=0&&(A!==0||u>=R);u--){var z=this.words[u]|0;this.words[u]=A<<26-O|z>>>O,A=z&D}return S&&A!==0&&(S.words[S.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},p.prototype.ishrn=function(n,d,_){return T(this.negative===0),this.iushrn(n,d,_)},p.prototype.shln=function(n){return this.clone().ishln(n)},p.prototype.ushln=function(n){return this.clone().iushln(n)},p.prototype.shrn=function(n){return this.clone().ishrn(n)},p.prototype.ushrn=function(n){return this.clone().iushrn(n)},p.prototype.testn=function(n){T(typeof n=="number"&&n>=0);var d=n%26,_=(n-d)/26,R=1<<d;if(this.length<=_)return!1;var O=this.words[_];return!!(O&R)},p.prototype.imaskn=function(n){T(typeof n=="number"&&n>=0);var d=n%26,_=(n-d)/26;if(T(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(d!==0&&_++,this.length=Math.min(_,this.length),d!==0){var R=67108863^67108863>>>d<<d;this.words[this.length-1]&=R}return this._strip()},p.prototype.maskn=function(n){return this.clone().imaskn(n)},p.prototype.iaddn=function(n){return T(typeof n=="number"),T(n<67108864),n<0?this.isubn(-n):this.negative!==0?this.length===1&&(this.words[0]|0)<=n?(this.words[0]=n-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(n),this.negative=1,this):this._iaddn(n)},p.prototype._iaddn=function(n){this.words[0]+=n;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},p.prototype.isubn=function(n){if(T(typeof n=="number"),T(n<67108864),n<0)return this.iaddn(-n);if(this.negative!==0)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},p.prototype.addn=function(n){return this.clone().iaddn(n)},p.prototype.subn=function(n){return this.clone().isubn(n)},p.prototype.iabs=function(){return this.negative=0,this},p.prototype.abs=function(){return this.clone().iabs()},p.prototype._ishlnsubmul=function(n,d,_){var R=n.length+_,O;this._expand(R);var C,D=0;for(O=0;O<n.length;O++){C=(this.words[O+_]|0)+D;var S=(n.words[O]|0)*d;C-=S&67108863,D=(C>>26)-(S/67108864|0),this.words[O+_]=C&67108863}for(;O<this.length-_;O++)C=(this.words[O+_]|0)+D,D=C>>26,this.words[O+_]=C&67108863;if(D===0)return this._strip();for(T(D===-1),D=0,O=0;O<this.length;O++)C=-(this.words[O]|0)+D,D=C>>26,this.words[O]=C&67108863;return this.negative=1,this._strip()},p.prototype._wordDiv=function(n,d){var _=this.length-n.length,R=this.clone(),O=n,C=O.words[O.length-1]|0,D=this._countBits(C);_=26-D,_!==0&&(O=O.ushln(_),R.iushln(_),C=O.words[O.length-1]|0);var S=R.length-O.length,u;if(d!=="mod"){u=new p(null),u.length=S+1,u.words=new Array(u.length);for(var A=0;A<u.length;A++)u.words[A]=0}var z=R.clone()._ishlnsubmul(O,1,S);z.negative===0&&(R=z,u&&(u.words[S]=1));for(var F=S-1;F>=0;F--){var J=(R.words[O.length+F]|0)*67108864+(R.words[O.length+F-1]|0);for(J=Math.min(J/C|0,67108863),R._ishlnsubmul(O,J,F);R.negative!==0;)J--,R.negative=0,R._ishlnsubmul(O,1,F),R.isZero()||(R.negative^=1);u&&(u.words[F]=J)}return u&&u._strip(),R._strip(),d!=="div"&&_!==0&&R.iushrn(_),{div:u||null,mod:R}},p.prototype.divmod=function(n,d,_){if(T(!n.isZero()),this.isZero())return{div:new p(0),mod:new p(0)};var R,O,C;return this.negative!==0&&n.negative===0?(C=this.neg().divmod(n,d),d!=="mod"&&(R=C.div.neg()),d!=="div"&&(O=C.mod.neg(),_&&O.negative!==0&&O.iadd(n)),{div:R,mod:O}):this.negative===0&&n.negative!==0?(C=this.divmod(n.neg(),d),d!=="mod"&&(R=C.div.neg()),{div:R,mod:C.mod}):this.negative&n.negative?(C=this.neg().divmod(n.neg(),d),d!=="div"&&(O=C.mod.neg(),_&&O.negative!==0&&O.isub(n)),{div:C.div,mod:O}):n.length>this.length||this.cmp(n)<0?{div:new p(0),mod:this}:n.length===1?d==="div"?{div:this.divn(n.words[0]),mod:null}:d==="mod"?{div:null,mod:new p(this.modrn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new p(this.modrn(n.words[0]))}:this._wordDiv(n,d)},p.prototype.div=function(n){return this.divmod(n,"div",!1).div},p.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},p.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},p.prototype.divRound=function(n){var d=this.divmod(n);if(d.mod.isZero())return d.div;var _=d.div.negative!==0?d.mod.isub(n):d.mod,R=n.ushrn(1),O=n.andln(1),C=_.cmp(R);return C<0||O===1&&C===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},p.prototype.modrn=function(n){var d=n<0;d&&(n=-n),T(n<=67108863);for(var _=(1<<26)%n,R=0,O=this.length-1;O>=0;O--)R=(_*R+(this.words[O]|0))%n;return d?-R:R},p.prototype.modn=function(n){return this.modrn(n)},p.prototype.idivn=function(n){var d=n<0;d&&(n=-n),T(n<=67108863);for(var _=0,R=this.length-1;R>=0;R--){var O=(this.words[R]|0)+_*67108864;this.words[R]=O/n|0,_=O%n}return this._strip(),d?this.ineg():this},p.prototype.divn=function(n){return this.clone().idivn(n)},p.prototype.egcd=function(n){T(n.negative===0),T(!n.isZero());var d=this,_=n.clone();d.negative!==0?d=d.umod(n):d=d.clone();for(var R=new p(1),O=new p(0),C=new p(0),D=new p(1),S=0;d.isEven()&&_.isEven();)d.iushrn(1),_.iushrn(1),++S;for(var u=_.clone(),A=d.clone();!d.isZero();){for(var z=0,F=1;!(d.words[0]&F)&&z<26;++z,F<<=1);if(z>0)for(d.iushrn(z);z-- >0;)(R.isOdd()||O.isOdd())&&(R.iadd(u),O.isub(A)),R.iushrn(1),O.iushrn(1);for(var J=0,W=1;!(_.words[0]&W)&&J<26;++J,W<<=1);if(J>0)for(_.iushrn(J);J-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(u),D.isub(A)),C.iushrn(1),D.iushrn(1);d.cmp(_)>=0?(d.isub(_),R.isub(C),O.isub(D)):(_.isub(d),C.isub(R),D.isub(O))}return{a:C,b:D,gcd:_.iushln(S)}},p.prototype._invmp=function(n){T(n.negative===0),T(!n.isZero());var d=this,_=n.clone();d.negative!==0?d=d.umod(n):d=d.clone();for(var R=new p(1),O=new p(0),C=_.clone();d.cmpn(1)>0&&_.cmpn(1)>0;){for(var D=0,S=1;!(d.words[0]&S)&&D<26;++D,S<<=1);if(D>0)for(d.iushrn(D);D-- >0;)R.isOdd()&&R.iadd(C),R.iushrn(1);for(var u=0,A=1;!(_.words[0]&A)&&u<26;++u,A<<=1);if(u>0)for(_.iushrn(u);u-- >0;)O.isOdd()&&O.iadd(C),O.iushrn(1);d.cmp(_)>=0?(d.isub(_),R.isub(O)):(_.isub(d),O.isub(R))}var z;return d.cmpn(1)===0?z=R:z=O,z.cmpn(0)<0&&z.iadd(n),z},p.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var d=this.clone(),_=n.clone();d.negative=0,_.negative=0;for(var R=0;d.isEven()&&_.isEven();R++)d.iushrn(1),_.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;_.isEven();)_.iushrn(1);var O=d.cmp(_);if(O<0){var C=d;d=_,_=C}else if(O===0||_.cmpn(1)===0)break;d.isub(_)}while(!0);return _.iushln(R)},p.prototype.invm=function(n){return this.egcd(n).a.umod(n)},p.prototype.isEven=function(){return(this.words[0]&1)===0},p.prototype.isOdd=function(){return(this.words[0]&1)===1},p.prototype.andln=function(n){return this.words[0]&n},p.prototype.bincn=function(n){T(typeof n=="number");var d=n%26,_=(n-d)/26,R=1<<d;if(this.length<=_)return this._expand(_+1),this.words[_]|=R,this;for(var O=R,C=_;O!==0&&C<this.length;C++){var D=this.words[C]|0;D+=O,O=D>>>26,D&=67108863,this.words[C]=D}return O!==0&&(this.words[C]=O,this.length++),this},p.prototype.isZero=function(){return this.length===1&&this.words[0]===0},p.prototype.cmpn=function(n){var d=n<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var _;if(this.length>1)_=1;else{d&&(n=-n),T(n<=67108863,"Number is too big");var R=this.words[0]|0;_=R===n?0:R<n?-1:1}return this.negative!==0?-_|0:_},p.prototype.cmp=function(n){if(this.negative!==0&&n.negative===0)return-1;if(this.negative===0&&n.negative!==0)return 1;var d=this.ucmp(n);return this.negative!==0?-d|0:d},p.prototype.ucmp=function(n){if(this.length>n.length)return 1;if(this.length<n.length)return-1;for(var d=0,_=this.length-1;_>=0;_--){var R=this.words[_]|0,O=n.words[_]|0;if(R!==O){R<O?d=-1:R>O&&(d=1);break}}return d},p.prototype.gtn=function(n){return this.cmpn(n)===1},p.prototype.gt=function(n){return this.cmp(n)===1},p.prototype.gten=function(n){return this.cmpn(n)>=0},p.prototype.gte=function(n){return this.cmp(n)>=0},p.prototype.ltn=function(n){return this.cmpn(n)===-1},p.prototype.lt=function(n){return this.cmp(n)===-1},p.prototype.lten=function(n){return this.cmpn(n)<=0},p.prototype.lte=function(n){return this.cmp(n)<=0},p.prototype.eqn=function(n){return this.cmpn(n)===0},p.prototype.eq=function(n){return this.cmp(n)===0},p.red=function(n){return new E(n)},p.prototype.toRed=function(n){return T(!this.red,"Already a number in reduction context"),T(this.negative===0,"red works only with positives"),n.convertTo(this)._forceRed(n)},p.prototype.fromRed=function(){return T(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},p.prototype._forceRed=function(n){return this.red=n,this},p.prototype.forceRed=function(n){return T(!this.red,"Already a number in reduction context"),this._forceRed(n)},p.prototype.redAdd=function(n){return T(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},p.prototype.redIAdd=function(n){return T(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},p.prototype.redSub=function(n){return T(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},p.prototype.redISub=function(n){return T(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},p.prototype.redShl=function(n){return T(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},p.prototype.redMul=function(n){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},p.prototype.redIMul=function(n){return T(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},p.prototype.redSqr=function(){return T(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},p.prototype.redISqr=function(){return T(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},p.prototype.redSqrt=function(){return T(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},p.prototype.redInvm=function(){return T(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},p.prototype.redNeg=function(){return T(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},p.prototype.redPow=function(n){return T(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var b={k256:null,p224:null,p192:null,p25519:null};function j(M,n){this.name=M,this.p=new p(n,16),this.n=this.p.bitLength(),this.k=new p(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}j.prototype._tmp=function(){var n=new p(null);return n.words=new Array(Math.ceil(this.n/13)),n},j.prototype.ireduce=function(n){var d=n,_;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),_=d.bitLength();while(_>this.n);var R=_<this.n?-1:d.ucmp(this.p);return R===0?(d.words[0]=0,d.length=1):R>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},j.prototype.split=function(n,d){n.iushrn(this.n,0,d)},j.prototype.imulK=function(n){return n.imul(this.k)};function k(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}L(k,j),k.prototype.split=function(n,d){for(var _=4194303,R=Math.min(n.length,9),O=0;O<R;O++)d.words[O]=n.words[O];if(d.length=R,n.length<=9){n.words[0]=0,n.length=1;return}var C=n.words[9];for(d.words[d.length++]=C&_,O=10;O<n.length;O++){var D=n.words[O]|0;n.words[O-10]=(D&_)<<4|C>>>22,C=D}C>>>=22,n.words[O-10]=C,C===0&&n.length>10?n.length-=10:n.length-=9},k.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var d=0,_=0;_<n.length;_++){var R=n.words[_]|0;d+=R*977,n.words[_]=d&67108863,d=R*64+(d/67108864|0)}return n.words[n.length-1]===0&&(n.length--,n.words[n.length-1]===0&&n.length--),n};function f(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}L(f,j);function v(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}L(v,j);function x(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}L(x,j),x.prototype.imulK=function(n){for(var d=0,_=0;_<n.length;_++){var R=(n.words[_]|0)*19+d,O=R&67108863;R>>>=26,n.words[_]=O,d=R}return d!==0&&(n.words[n.length++]=d),n},p._prime=function(n){if(b[n])return b[n];var d;if(n==="k256")d=new k;else if(n==="p224")d=new f;else if(n==="p192")d=new v;else if(n==="p25519")d=new x;else throw new Error("Unknown prime "+n);return b[n]=d,d};function E(M){if(typeof M=="string"){var n=p._prime(M);this.m=n.p,this.prime=n}else T(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}E.prototype._verify1=function(n){T(n.negative===0,"red works only with positives"),T(n.red,"red works only with red numbers")},E.prototype._verify2=function(n,d){T((n.negative|d.negative)===0,"red works only with positives"),T(n.red&&n.red===d.red,"red works only with red numbers")},E.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):(m(n,n.umod(this.m)._forceRed(this)),n)},E.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},E.prototype.add=function(n,d){this._verify2(n,d);var _=n.add(d);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},E.prototype.iadd=function(n,d){this._verify2(n,d);var _=n.iadd(d);return _.cmp(this.m)>=0&&_.isub(this.m),_},E.prototype.sub=function(n,d){this._verify2(n,d);var _=n.sub(d);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},E.prototype.isub=function(n,d){this._verify2(n,d);var _=n.isub(d);return _.cmpn(0)<0&&_.iadd(this.m),_},E.prototype.shl=function(n,d){return this._verify1(n),this.imod(n.ushln(d))},E.prototype.imul=function(n,d){return this._verify2(n,d),this.imod(n.imul(d))},E.prototype.mul=function(n,d){return this._verify2(n,d),this.imod(n.mul(d))},E.prototype.isqr=function(n){return this.imul(n,n.clone())},E.prototype.sqr=function(n){return this.mul(n,n)},E.prototype.sqrt=function(n){if(n.isZero())return n.clone();var d=this.m.andln(3);if(T(d%2===1),d===3){var _=this.m.add(new p(1)).iushrn(2);return this.pow(n,_)}for(var R=this.m.subn(1),O=0;!R.isZero()&&R.andln(1)===0;)O++,R.iushrn(1);T(!R.isZero());var C=new p(1).toRed(this),D=C.redNeg(),S=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new p(2*u*u).toRed(this);this.pow(u,S).cmp(D)!==0;)u.redIAdd(D);for(var A=this.pow(u,R),z=this.pow(n,R.addn(1).iushrn(1)),F=this.pow(n,R),J=O;F.cmp(C)!==0;){for(var W=F,V=0;W.cmp(C)!==0;V++)W=W.redSqr();T(V<J);var K=this.pow(A,new p(1).iushln(J-V-1));z=z.redMul(K),A=K.redSqr(),F=F.redMul(A),J=V}return z},E.prototype.invm=function(n){var d=n._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},E.prototype.pow=function(n,d){if(d.isZero())return new p(1).toRed(this);if(d.cmpn(1)===0)return n.clone();var _=4,R=new Array(1<<_);R[0]=new p(1).toRed(this),R[1]=n;for(var O=2;O<R.length;O++)R[O]=this.mul(R[O-1],n);var C=R[0],D=0,S=0,u=d.bitLength()%26;for(u===0&&(u=26),O=d.length-1;O>=0;O--){for(var A=d.words[O],z=u-1;z>=0;z--){var F=A>>z&1;if(C!==R[0]&&(C=this.sqr(C)),F===0&&D===0){S=0;continue}D<<=1,D|=F,S++,!(S!==_&&(O!==0||z!==0))&&(C=this.mul(C,R[D]),S=0,D=0)}u=26}return C},E.prototype.convertTo=function(n){var d=n.umod(this.m);return d===n?d.clone():d},E.prototype.convertFrom=function(n){var d=n.clone();return d.red=null,d},p.mont=function(n){return new N(n)};function N(M){E.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new p(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}L(N,E),N.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},N.prototype.convertFrom=function(n){var d=this.imod(n.mul(this.rinv));return d.red=null,d},N.prototype.imul=function(n,d){if(n.isZero()||d.isZero())return n.words[0]=0,n.length=1,n;var _=n.imul(d),R=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=_.isub(R).iushrn(this.shift),C=O;return O.cmp(this.m)>=0?C=O.isub(this.m):O.cmpn(0)<0&&(C=O.iadd(this.m)),C._forceRed(this)},N.prototype.mul=function(n,d){if(n.isZero()||d.isZero())return new p(0)._forceRed(this);var _=n.mul(d),R=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=_.isub(R).iushrn(this.shift),C=O;return O.cmp(this.m)>=0?C=O.isub(this.m):O.cmpn(0)<0&&(C=O.iadd(this.m)),C._forceRed(this)},N.prototype.invm=function(n){var d=this.imod(n._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(I,ze)})(Ot);var Hr=Ot.exports,Gr=ze&&ze.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(At,"__esModule",{value:!0});At.BNExtension=Yr;const Pe=Gr(Hr);function Yr(I){return{type:"BN",base:I.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(P,B){try{return{value:new Pe.default(P)}}catch{return{errors:B.error("bn.nan")}}},coerce(P){return{value:P.toString(10)}},validate(P){return{value:P}},rules:{gt:{args:[{name:"threshold",ref:!0,assert:P=>Pe.default.isBN(P),message:"must be a big number",normalize:P=>new Pe.default(P)},{name:"equal",assert:P=>typeof P=="boolean",message:"must be a boolean"}],validate(P,B,T){const L=new Pe.default(P);return T.equal&&L.lt(T.threshold)?B.error("bn.min",T):!T.equal&&L.lte(T.threshold)?B.error("bn.greater",T):P}},lt:{args:[{name:"threshold",ref:!0,assert:P=>Pe.default.isBN(P),message:"must be a big number",normalize:P=>new Pe.default(P)},{name:"equal",assert:P=>typeof P=="boolean",message:"must be a boolean"}],validate(P,B,T){const L=new Pe.default(P);return T.equal&&L.gt(T.threshold)?B.error("bn.max",T):!T.equal&&L.gte(T.threshold)?B.error("bn.less",T):P}},min:{alias:"gte",method(P){return this.$_addRule({name:"gt",args:{threshold:P,equal:!0}})}},max:{alias:"lte",method(P){return this.$_addRule({name:"lt",args:{threshold:P,equal:!0}})}},greater:{alias:"gt",method(P){return this.$_addRule({name:"gt",args:{threshold:P,equal:!1}})}},less:{alias:"lt",method(P){return this.$_addRule({name:"lt",args:{threshold:P,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}})}}}}}var Et={},Qr=ze&&ze.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(Et,"__esModule",{value:!0});Et.DIDExtension=Xr;const vt=Qr(Sr),yt=Rr,Ce=De,Ke={pk:Object.keys(yt.types.KeyType),hash:Object.keys(yt.types.HashType),role:Object.keys(yt.types.RoleType)};function Xr(I){return{type:"DID",base:I.string().trim(),messages:{"did.empty":'Expect {{#label}} to be non-empty string, got "{{#value}}"',"did.invalid":'Expect {{#label}} to be valid did, got "{{#value}}"',"did.wallet":'Expect wallet type of {{#label}} to be "{{#expected}}" wallet, got "{{#actual}}"',"did.pk":'Expect pk type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.hash":'Expect hash type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.role":'Expect role type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.prefix":'Expect prefix of {{#label}} to be "{{#expected}}"'},validate(P,B){return!P||typeof P!="string"?{errors:B.error("did.empty",{value:P})}:(0,Ce.isValid)(P)===!1?{errors:B.error("did.invalid",{value:P})}:{value:P}},rules:{type:{args:[{name:"key",ref:!0,assert:P=>Object.keys(Ke).includes(P),message:`must be one of ${Object.keys(Ke).join(", ")}`},{name:"expected",assert:P=>Object.keys(Ke).some(B=>Ke[B].includes(P)),message:"must be valid type"}],validate(P,B,T){const L=(0,Ce.toTypeInfoStr)(P);return T.key==="pk"&&L.pk!==T.expected?B.error("did.pk",{...T,actual:L.pk}):T.key==="hash"&&L.hash!==T.expected?B.error("did.hash",{...T,actual:L.hash}):T.key==="role"&&L.role!==T.expected?B.error("did.role",{...T,actual:L.role}):P}},pk:{method(P){return this.$_addRule({name:"type",args:{key:"pk",expected:P}})}},hash:{method(P){return this.$_addRule({name:"type",args:{key:"hash",expected:P}})}},role:{method(P){return this.$_addRule({name:"type",args:{key:"role",expected:P}})}},wallet:{method(P){return this.$_addRule({name:"wallet",args:{type:P}})},args:[{name:"type",ref:!0,assert:P=>["arcblock","ethereum","default","eth","passkey"].includes(P),message:"must be a string",normalize:P=>P.trim()}],validate(P,B,T={}){const L=(0,Ce.toTypeInfo)(P),p=(0,Ce.toTypeInfoStr)(P);return["ethereum","eth"].includes(T.type)&&(0,vt.default)(L,Ce.DID_TYPE_ETHEREUM)===!1?B.error("did.wallet",{expected:T.type,actual:JSON.stringify(p)}):["arcblock","default"].includes(T.type)&&(0,vt.default)(L,Ce.DID_TYPE_ARCBLOCK)===!1?B.error("did.wallet",{expected:T.type,actual:JSON.stringify(p)}):["passkey"].includes(T.type)&&(0,vt.default)(L,Ce.DID_TYPE_PASSKEY)===!1?B.error("did.wallet",{expected:T.type,actual:JSON.stringify(p)}):P}},prefix:{method(P=""){return this.$_addRule({name:"prefix",args:{str:P}})},args:[{name:"str",ref:!0,assert:P=>["",Ce.DID_PREFIX].includes(P),message:"must be a string",normalize:P=>P.trim()}],validate(P,B,T={}){return T.str&&P.startsWith(T.str)===!1?B.error("did.prefix",{expected:T.str}):!T.str&&(0,Ce.toAddress)(P)!==P?B.error("did.prefix",{expected:T.str}):P}}}}}(function(I){var P=ze&&ze.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(I,"__esModule",{value:!0}),I.patterns=I.schemas=I.Joi=void 0;const B=P(Zr),T=At,L=Et;I.Joi=B.default.extend(L.DIDExtension).extend(T.BNExtension);const p=/^(0x)?([A-Fa-f0-9]{64})$/,w=I.Joi.object({genesisTime:I.Joi.date().iso().required().raw(),genesisTx:I.Joi.string().regex(p).required().allow(""),renaissanceTime:I.Joi.date().iso().required().raw(),renaissanceTx:I.Joi.string().regex(p).required().allow("")}),l=I.Joi.object({address:I.Joi.DID().prefix().role("ROLE_TOKEN").required(),value:I.Joi.BN().positive().required()}),$=I.Joi.object({name:I.Joi.string().min(1).max(256).required(),value:I.Joi.string().min(1).max(1024).required(),description:I.Joi.string().min(1).max(256).optional().allow(""),required:I.Joi.boolean().optional().default(!1)}),y=I.Joi.alternatives().try(I.Joi.DID().prefix().role("ROLE_ACCOUNT"),I.Joi.DID().prefix().role("ROLE_APPLICATION"),I.Joi.DID().prefix().role("ROLE_BLOCKLET"),I.Joi.DID().prefix().wallet("ethereum"),I.Joi.DID().prefix().wallet("passkey")),m=I.Joi.array().items(I.Joi.object({owner:y.required(),tokensList:I.Joi.array().items(l).default([]),assetsList:I.Joi.array().items(I.Joi.DID().prefix().role("ROLE_ASSET")).default([])})),e=I.Joi.array().items({signer:I.Joi.DID().prefix().required(),pk:I.Joi.any().required(),signature:I.Joi.any().required(),delegator:I.Joi.DID().prefix().valid("").optional(),data:I.Joi.any().optional()}),a=I.Joi.object({type:I.Joi.string().min(1).max(32).required(),contractAddress:I.Joi.DID().prefix().wallet("ethereum").required(),chainType:I.Joi.string().min(1).max(32).required(),chainName:I.Joi.string().min(1).max(32).required(),chainId:I.Joi.number().positive().required()}),i=I.Joi.object({type:I.Joi.string().valid("svg","url","uri").required(),content:I.Joi.string().when("type",{is:"uri",then:I.Joi.string().max(20480).dataUri().required()}).when("type",{is:"url",then:I.Joi.string().max(2048).uri({scheme:["http","https"]}).required()})}),r=I.Joi.object({id:I.Joi.string().max(2048).uri({scheme:["http","https"]}).required(),scope:I.Joi.string().valid("public","private").default("public")}),t=I.Joi.object({id:I.Joi.DID().prefix().required(),pk:I.Joi.string().required(),name:I.Joi.string().min(1).max(256).required()}),c={address:I.Joi.DID().prefix().role("ROLE_ASSET").required(),moniker:I.Joi.string().min(2).max(255).required(),data:I.Joi.any().required(),readonly:I.Joi.boolean().default(!1),transferrable:I.Joi.boolean().default(!1),ttl:I.Joi.number().min(0).default(0),parent:I.Joi.DID().prefix().optional().allow(""),issuer:I.Joi.DID().prefix().optional().allow(""),endpoint:r.optional().allow(null).default(null),display:i.optional().allow(null).default(null),tags:I.Joi.array().items(I.Joi.string().min(1).max(64)).max(4).optional()},s={address:I.Joi.DID().prefix().role("ROLE_FACTORY").required(),name:I.Joi.string().min(2).max(255).required(),description:I.Joi.string().min(2).max(255).required(),settlement:I.Joi.string().valid("instant","periodic").default("instant"),limit:I.Joi.number().integer().min(0).default(0),trustedIssuers:I.Joi.array().items(I.Joi.DID().prefix()).max(8).optional(),data:I.Joi.any().optional().allow(null).default(null),display:i.optional().allow(null).default(null),input:I.Joi.object({value:I.Joi.BN().positive().min("0").default("0"),tokens:I.Joi.array().items(l).max(8).optional(),assets:I.Joi.array().items(I.Joi.alternatives().try(I.Joi.DID().prefix().role("ROLE_ASSET"),I.Joi.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),variables:I.Joi.array().items(I.Joi.object({name:I.Joi.string().min(1).max(255).required(),description:I.Joi.string().max(255).optional().allow(""),required:I.Joi.boolean().required()})).optional()}),output:I.Joi.object({moniker:I.Joi.string().min(2).max(255).required(),data:I.Joi.any().required(),readonly:I.Joi.boolean().default(!1),transferrable:I.Joi.boolean().default(!1),ttl:I.Joi.number().min(0).default(0),parent:I.Joi.string().max(255).required(),issuer:I.Joi.string().max(255).required(),endpoint:r.optional(),display:i.optional(),tags:I.Joi.array().items(I.Joi.string().min(1).max(64)).max(4).optional()}),hooks:I.Joi.array().items(I.Joi.object({name:I.Joi.string().valid("mint","postMint","preMint").required(),type:I.Joi.string().valid("url","contract").required(),hook:I.Joi.string().min(1).max(4096).required(),compiled:I.Joi.array().items(I.Joi.object()).optional()})).optional()};I.schemas={context:w,tokenInput:l,multiInput:m,multiSig:e,foreignToken:a,variableInput:$,nftDisplay:i,nftEndpoint:r,nftIssuer:t,tokenHolder:y,assetProps:c,assetSchema:I.Joi.object(c).options({stripUnknown:!0,noDefaults:!1}),factoryProps:s,factorySchema:I.Joi.object(s).options({stripUnknown:!0,noDefaults:!1})},I.patterns={txHash:p}})(ur);function Ct({onCancel:I,onSuccess:P,blocklet:B}){var c,s;const{vaults:T=[],appPid:L}=B,{t:p,locale:w}=Ve(),{connectApi:l}=ar(),{api:$}=Je(),{teamDid:y}=or(),[m,e]=ir({loading:!1,fetching:!1,error:"",address:"",fetched:[],errored:[]});Ee.useEffect(()=>{if(!De.isValid(m.address))return;const o=De.toAddress(m.address),h=m.fetched.find(b=>b.address===o),g=m.errored.find(b=>b.address===o);!m.fetching&&!h&&!g&&(e({fetching:!0}),$r(Ar.MAIN_CHAIN_ENDPOINT).getAccountState({address:o}).then(j=>{j.state?e({fetching:!1,fetched:[...m.fetched.filter(k=>k.address!==o),j.state]}):e({fetching:!1,errored:[...m.errored.filter(k=>k.address!==o),{address:o}]})}).catch(j=>{console.error(j),e({fetching:!1,error:Ue(j)})}))},[m.address,m.fetching]),Ee.useEffect(()=>{if(m.address){const o=De.toAddress(m.address);if(!De.isValid(o)){e({error:p("blocklet.config.vault.error.invalid")});return}if(ur.schemas.tokenHolder.validate(o).error){e({error:p("blocklet.config.vault.error.holder")});return}if(T.find(g=>g.did===o)){e({error:p("blocklet.config.vault.error.duplicate")});return}if(Ir([B.appDid,B.appPid,...B.migratedFrom.map(g=>g.appDid)].filter(Boolean)).includes(o)){e({error:p("blocklet.config.vault.error.appDid")});return}}e({error:""})},[m.address]);const a=async()=>{e({loading:!0});try{const o=await $.configVault({input:{teamDid:y,vaultDid:De.toAddress(m.address)}});l.open({locale:w,action:"approve-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:o.sessionId},messages:{title:p("blocklet.config.vault.approve.title"),scan:p(`blocklet.config.vault.approve.${T.length>0?"byLast":"byOwner"}`),confirm:p("blocklet.config.vault.approve.confirm"),success:p("blocklet.config.vault.approve.success")},onSuccess:()=>{l.open({locale:w,action:"config-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:o.sessionId},messages:{title:p("blocklet.config.vault.commit.title"),scan:p("blocklet.config.vault.commit.scan"),confirm:p("blocklet.config.vault.commit.confirm"),success:p("blocklet.config.vault.commit.success")},onSuccess:()=>{e({loading:!1}),P()},onClose:()=>{e({loading:!1}),l.close()}})},onClose:()=>{e({loading:!1}),l.close()}})}catch(o){e({loading:!1,error:Ue(o)})}},i=De.toAddress(m.address),r=[];De.isValid(i)&&r.push({key:p("blocklet.config.vault.role"),value:q.jsx(vr,{color:"primary",variant:"outlined",size:"small",label:De.toTypeInfoStr(i).role||"-"})});const t=m.fetched.find(o=>o.address===i);return t&&r.push({key:p("blocklet.config.vault.firstSeen"),value:Yt((c=t.context)==null?void 0:c.genesisTime,"-")},{key:p("blocklet.config.vault.lastSeen"),value:Yt((s=t.context)==null?void 0:s.renaissanceTime,"-")},{key:p("blocklet.config.vault.migratedFrom"),value:t.migratedFrom.length?t.migratedFrom.map(o=>q.jsx(Qt,{did:o,showQrcode:!0,compact:!0,size:14,locale:w},o)):"-"},{key:p("blocklet.config.vault.migratedTo"),value:t.migratedTo.length?t.migratedTo.map(o=>q.jsx(Qt,{did:o,showQrcode:!0,compact:!0,size:14,locale:w},o)):"-"}),q.jsx(nr,{open:!0,fullWidth:!0,showCloseButton:!1,onClose:I,title:q.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:1},children:[q.jsx(kt,{}),p("blocklet.config.vault.title")]}),actions:q.jsxs(q.Fragment,{children:[q.jsx(Le,{onClick:I,children:p("common.cancel")}),q.jsx(Le,{onClick:a,variant:"contained",disabled:!!m.error||m.loading,children:p("common.confirm")})]}),children:q.jsxs(er,{direction:"column",spacing:3,children:[q.jsxs(Be,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:[p("blocklet.config.vault.desc")," ",p("blocklet.config.vault.tip")]}),T.length>0&&q.jsxs(U,{children:[q.jsxs(Be,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:[p("blocklet.config.vault.current"),":"]}),q.jsxs(U,{sx:{display:"flex",alignItems:"center",gap:.5},children:[q.jsx(Lr,{did:T[T.length-1].did,showQrcode:!0,style:{width:"auto"}}),q.jsx(qr,{vaults:T,appPid:L})]})]}),q.jsx(yr,{fullWidth:!0,"data-cy":"input-factory-address",label:p("blocklet.config.vault.address"),error:!!m.error,helperText:m.error,value:m.address,InputProps:{endAdornment:m.fetching?q.jsx(br,{position:"end",children:q.jsx(We,{size:16})}):null},onChange:o=>{e({address:o.target.value,error:""})}}),q.jsx(U,{sx:{"& .info-row__name":{fontSize:"14px"},"& .info-row__value":{fontSize:"14px"}},children:r.map(o=>q.jsx(Tr,{valueComponent:"div",nameWidth:120,name:o.key,children:o.value},o.key))})]})})}Ct.propTypes={onCancel:Oe.func.isRequired,onSuccess:Oe.func.isRequired,blocklet:Oe.object.isRequired};Ct.defaultProps={};function es({teamDid:I,size:P="small",...B}){const{t:T}=Ve(),{api:L}=Je(),[p,w]=Ee.useState(!1),[l,$]=Ee.useState(null),y=()=>{w(!1),$(null)},m=async()=>{var a;try{w(!0);const i=await L.rotateSessionKey({input:{teamDid:I}});Te.success(T("blocklet.config.rotateSessionKey.success",{count:((a=i.removed)==null?void 0:a.length)||0})),setTimeout(()=>{window.location.reload()},1e3)}catch(i){Te.error(Ue(i))}finally{w(!1),$(null)}},e={title:T("blocklet.config.rotateSessionKey.title"),description:T("blocklet.config.rotateSessionKey.description"),confirm:T("common.confirm"),cancel:T("common.cancel"),onConfirm:m,onCancel:y};return q.jsxs("div",{...B,children:[q.jsxs(Le,{onClick:()=>$(e),color:"error",variant:"outlined",size:P,children:[p?q.jsx(We,{size:16,style:{marginRight:5}}):null,T("blocklet.config.rotateSessionKey.action")]}),l&&q.jsx(xt,{title:l.title,description:l.description,confirm:l.confirm,cancel:l.cancel,onConfirm:l.onConfirm,onCancel:l.onCancel})]})}function He({blocklet:I,onUpdate:P,hasPermission:B}){var g,b;const{api:T,inService:L}=Je(),{t:p}=Ee.useContext(Or),[w,l]=ir({loading:!1,showTransferOwner:!1,showConfigVault:!1}),$=!!((b=(g=I==null?void 0:I.settings)==null?void 0:g.invite)!=null&&b.enabled),y=w.loading||!B,{did:m}=I.meta;if(tr(I.status))return null;const e=I.environments.find(j=>j.key===Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE),a=!e||e.value==="yes",i=I.environments.find(j=>j.key===Ne.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE),r=(i==null?void 0:i.value)||Ne.BLOCKLET_TENANT_MODES.SINGLE,t=(j,k)=>async f=>{if(!w.loading){l({loading:!0});try{const{checked:v}=f.target,{blocklet:x}=await T.configBlocklet({input:{did:I.meta.did,configs:[{key:Ne.BLOCKLET_CONFIGURABLE_KEY[j],value:k(v)}]}});P(x)}catch(v){Te.error(v.message)}finally{l({loading:!1})}}},c=t("BLOCKLET_DELETABLE",j=>j?"no":"yes"),s=t("BLOCKLET_APP_TENANT_MODE",j=>j?Ne.BLOCKLET_TENANT_MODES.MULTIPLE:Ne.BLOCKLET_TENANT_MODES.SINGLE),o=async j=>{if(!w.loading){l({loading:!0});try{await T.updateInviteSettings({input:{did:I.meta.did,invite:{enabled:j.target.checked}}})}catch(k){Te.error(k.message)}finally{l({loading:!1})}}},h=async()=>{if(!w.loading){l({loading:!0});try{const{blocklet:j}=await T.getBlocklet({input:{did:I.meta.did}});P(j)}catch(j){Te.error(j.message)}finally{l({loading:!1})}}};return q.jsxs(ns,{p:3,sx:{border:"1px solid red",borderRadius:2},className:"advanced-config",children:[!L&&q.jsxs(q.Fragment,{children:[q.jsx(Ie,{title:p("blocklet.config.deletable.name"),desc:p(a?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(gt,{disabled:y,checked:!a,defaultChecked:!0,onChange:c})})}),q.jsx(U,{className:"config-form",component:qe,my:3})]}),q.jsx(St,{inService:L,disabled:y,loading:w.loading,onChange:h}),q.jsx(U,{className:"config-form",component:qe,my:3}),L&&q.jsx(kr,{role:"owner",children:j=>(j||Jr)&&q.jsxs(q.Fragment,{children:[q.jsx(Ie,{title:p("blocklet.config.vault.title"),desc:p("blocklet.config.vault.desc"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsxs(Le,{variant:"contained",color:"primary",size:"small","data-cy":"config-vault",onClick:()=>l({showConfigVault:!0}),children:[q.jsx(kt,{style:{fontSize:"1.3em",marginRight:4}}),p("blocklet.config.vault.title")]})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),w.showConfigVault&&q.jsx(Ct,{blocklet:I,onCancel:()=>l({showConfigVault:!1}),onSuccess:()=>l({showConfigVault:!1})}),q.jsx(Ie,{title:p("team.transferApp.name"),desc:p("team.transferApp.description"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsxs(Le,{variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"transfer-app",onClick:()=>l({showTransferOwner:!0}),children:[q.jsx(lr,{style:{fontSize:"1.3em",marginRight:4}}),p("team.transferApp.name")]})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),w.showTransferOwner&&q.jsx(Rt,{onCancel:()=>l({showTransferOwner:!1}),onSuccess:()=>l({showTransferOwner:!1})})]})}),q.jsx(Ie,{title:p("blocklet.config.clearCache.name"),desc:p("blocklet.config.clearCache.purpose"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(Ur,{teamDid:m})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),q.jsx(Ie,{title:p("blocklet.config.rotateSessionKey.name"),desc:p("blocklet.config.rotateSessionKey.purpose"),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(es,{style:{whiteSpace:"nowrap"},teamDid:m})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),q.jsx(Ie,{title:p("blocklet.config.tenantMode.name"),desc:p(`blocklet.config.tenantMode.${r}`),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(gt,{disabled:y,checked:r===Ne.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:s})})}),q.jsx(U,{className:"config-form",component:qe,my:3}),q.jsx(Ie,{title:p("team.invite.setting"),desc:p(`team.invite.${$?"enabled":"disabled"}`),children:q.jsx(U,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:q.jsx(gt,{disabled:y,checked:$,onChange:o})})})]})}const ts=Ze(He,"mutate_blocklets"),rs=Ze(He,"",rr);function ss(I){const{inService:P}=Je();return P?q.jsx(rs,{...I}):q.jsx(ts,{...I})}He.propTypes={blocklet:Oe.object.isRequired,onUpdate:Oe.func,hasPermission:Oe.bool};He.defaultProps={onUpdate:()=>{},hasPermission:!1};const ns=_t(er)``;function Ge({blocklet:I,onUpdate:P,hasPermission:B}){return tr(I.status)?null:q.jsx(os,{children:q.jsx(ss,{blocklet:I,onUpdate:P,hasPermission:B})})}const is=Ze(Ge,"mutate_blocklets"),as=Ze(Ge,"",rr);function Ls(I){const{inService:P}=Je();return P?q.jsx(as,{...I}):q.jsx(is,{...I})}Ge.propTypes={blocklet:Oe.object.isRequired,onUpdate:Oe.func,hasPermission:Oe.bool};Ge.defaultProps={onUpdate:()=>{},hasPermission:!1};const os=_t(U)`
|
|
8
8
|
max-width: 1536px;
|
|
9
9
|
|
|
10
10
|
.advanced-config {
|