From 1428a240281211b8c6fbdf89425dc56a182d11e0 Mon Sep 17 00:00:00 2001 From: SamueleA Date: Wed, 8 May 2024 17:53:49 +0000 Subject: [PATCH] Build: (d3ddb41) Merge pull request #39 from 0xsequence/nft-checkout-placeholder Nft checkout placeholder --- ...owser-external_commonjs-proxy-C7LGirr0.js} | 2 +- assets/{ccip-BF4Lsffy.js => ccip-CtMuIB2P.js} | 2 +- .../{index-dY-7UIE-.js => index-BUNEaHbj.js} | 234 +- ...{index-DRneY2rd.css => index-BY3QI6Mi.css} | 67 +- .../{index-DzVkZDWS.js => index-Bbl90F7t.js} | 4 +- .../{index-DxKizXZQ.js => index-CJ5MvQ2C.js} | 6 +- .../{index-D4BjuBLS.js => index-DyR0sOyw.js} | 738 +- ...ex.es-DnHUvTmI.js => index.es-BKuNVN6W.js} | 7788 ++++++++--------- index.html | 4 +- 9 files changed, 4137 insertions(+), 4708 deletions(-) rename assets/{___vite-browser-external_commonjs-proxy-Cp_JekuJ.js => ___vite-browser-external_commonjs-proxy-C7LGirr0.js} (99%) rename assets/{ccip-BF4Lsffy.js => ccip-CtMuIB2P.js} (99%) rename assets/{index-dY-7UIE-.js => index-BUNEaHbj.js} (99%) rename assets/{index-DRneY2rd.css => index-BY3QI6Mi.css} (99%) rename assets/{index-DzVkZDWS.js => index-Bbl90F7t.js} (99%) rename assets/{index-DxKizXZQ.js => index-CJ5MvQ2C.js} (98%) rename assets/{index-D4BjuBLS.js => index-DyR0sOyw.js} (97%) rename assets/{index.es-DnHUvTmI.js => index.es-BKuNVN6W.js} (68%) diff --git a/assets/___vite-browser-external_commonjs-proxy-Cp_JekuJ.js b/assets/___vite-browser-external_commonjs-proxy-C7LGirr0.js similarity index 99% rename from assets/___vite-browser-external_commonjs-proxy-Cp_JekuJ.js rename to assets/___vite-browser-external_commonjs-proxy-C7LGirr0.js index 8b18b492..9d2dc6a9 100644 --- a/assets/___vite-browser-external_commonjs-proxy-Cp_JekuJ.js +++ b/assets/___vite-browser-external_commonjs-proxy-C7LGirr0.js @@ -1,4 +1,4 @@ -import { b as getDefaultExportFromCjs, a as getAugmentedNamespace } from "./index-dY-7UIE-.js"; +import { b as getDefaultExportFromCjs, a as getAugmentedNamespace } from "./index-BUNEaHbj.js"; var events = { exports: {} }; var R = typeof Reflect === "object" ? Reflect : null; var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) { diff --git a/assets/ccip-BF4Lsffy.js b/assets/ccip-CtMuIB2P.js similarity index 99% rename from assets/ccip-BF4Lsffy.js rename to assets/ccip-CtMuIB2P.js index bbadf09b..c7e16d28 100644 --- a/assets/ccip-BF4Lsffy.js +++ b/assets/ccip-CtMuIB2P.js @@ -1,4 +1,4 @@ -import { h as BaseError, j as getUrl, s as stringify, k as isAddress, I as InvalidAddressError, l as decodeErrorResult, m as call, n as concat, o as encodeAbiParameters, H as HttpRequestError, q as isHex } from "./index-dY-7UIE-.js"; +import { h as BaseError, j as getUrl, s as stringify, k as isAddress, I as InvalidAddressError, l as decodeErrorResult, m as call, n as concat, o as encodeAbiParameters, H as HttpRequestError, q as isHex } from "./index-BUNEaHbj.js"; class OffchainLookupError extends BaseError { constructor({ callbackSelector, cause, data, extraData, sender, urls }) { var _a; diff --git a/assets/index-dY-7UIE-.js b/assets/index-BUNEaHbj.js similarity index 99% rename from assets/index-dY-7UIE-.js rename to assets/index-BUNEaHbj.js index 755d90ef..7494c377 100644 --- a/assets/index-dY-7UIE-.js +++ b/assets/index-BUNEaHbj.js @@ -1,4 +1,4 @@ -const __vite__fileDeps=["./index-D4BjuBLS.js","./___vite-browser-external_commonjs-proxy-Cp_JekuJ.js","./index.es-DnHUvTmI.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +const __vite__fileDeps=["./index-DyR0sOyw.js","./___vite-browser-external_commonjs-proxy-C7LGirr0.js","./index.es-BKuNVN6W.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); var __defProp = Object.defineProperty; var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; var __publicField = (obj, key2, value) => { @@ -14892,7 +14892,7 @@ const Text = reactExports.forwardRef( ); } ); -var buttonVariants = createRuntimeFn({ defaultClassName: "_140wn8ni _140wn8n0 fyvr11ls fyvr11m8 fyvr11n9 fyvr11ko fyvr12o1 fyvr11n2 fyvr11h0", variantClassNames: { variant: { base: "_140wn8nj _140wn8n1 fyvr11od fyvr12s1", ghost: "_140wn8nk _140wn8n2 fyvr11od fyvr12s1", feature: "_140wn8nl _140wn8n3 fyvr11pj fyvr12od", primary: "_140wn8nm _140wn8n4 fyvr11pd fyvr12od", glass: "_140wn8nn _140wn8n5 fyvr11tv fyvr12s1", emphasis: "_140wn8no _140wn8n6 fyvr11u1 fyvr12s1", raised: "_140wn8np _140wn8n7 fyvr11tp fyvr12s1", danger: "_140wn8nq _140wn8n8 fyvr11op fyvr12od", text: "_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _140wn8n9 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11od fyvr12sd" }, shape: { circle: "_140wn8ns _140wn8na fyvr11dc fyvr11e0 fyvr11c0 fyvr11co", square: "_140wn8nt _140wn8nb fyvr11d0 fyvr11do fyvr11bo fyvr11cc" }, disabled: { true: "_140wn8nu _140wn8nc fyvr12v1 fyvr12vp", false: "_140wn8nv _140wn8nd fyvr12v7 fyvr12w1 fyvr12vz" }, size: { xs: "_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _140wn8ne fyvr1ws fyvr1yo", sm: "_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nf fyvr1ww fyvr1ys", md: "_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8ng fyvr1x0 fyvr1yw", lg: "_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nh fyvr1x0 fyvr1yw" }, iconOnly: { true: "_140wn8n10" }, hasLeftIcon: { true: "_140wn8n11" }, hasRightIcon: { true: "_140wn8n12" }, activeOutline: { light: "_140wn8n13", bold: "_140wn8n14" } }, defaultVariants: {}, compoundVariants: [[{ iconOnly: true, size: "xs" }, "_140wn8n15"], [{ iconOnly: true, size: "sm" }, "_140wn8n16"], [{ iconOnly: true, size: "md" }, "_140wn8n17"], [{ iconOnly: true, size: "lg" }, "_140wn8n18"], [{ iconOnly: false, hasLeftIcon: true, size: "xs" }, "_140wn8n19"], [{ iconOnly: false, hasLeftIcon: true, size: "sm" }, "_140wn8n1a"], [{ iconOnly: false, hasLeftIcon: true, size: "md" }, "_140wn8n1b"], [{ iconOnly: false, hasRightIcon: true, size: "xs" }, "_140wn8n1c"], [{ iconOnly: false, hasRightIcon: true, size: "sm" }, "_140wn8n1d"], [{ iconOnly: false, hasRightIcon: true, size: "md" }, "_140wn8n1e"]] }); +var buttonVariants = createRuntimeFn({ defaultClassName: "_140wn8ni _140wn8n0 fyvr11ls fyvr11m8 fyvr11n9 fyvr11ko fyvr12o1 fyvr11n2 fyvr11h0 _4efw240", variantClassNames: { variant: { base: "_140wn8nj _140wn8n1 fyvr11od fyvr12s1", ghost: "_140wn8nk _140wn8n2 fyvr11od fyvr12s1", feature: "_140wn8nl _140wn8n3 fyvr11pj fyvr12od", primary: "_140wn8nm _140wn8n4 fyvr11pd fyvr12od", glass: "_140wn8nn _140wn8n5 fyvr11tv fyvr12s1", emphasis: "_140wn8no _140wn8n6 fyvr11u1 fyvr12s1", raised: "_140wn8np _140wn8n7 fyvr11tp fyvr12s1", danger: "_140wn8nq _140wn8n8 fyvr11op fyvr12od", text: "_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _140wn8n9 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11od fyvr12sd" }, shape: { circle: "_140wn8ns _140wn8na fyvr11dc fyvr11e0 fyvr11c0 fyvr11co", square: "_140wn8nt _140wn8nb fyvr11d0 fyvr11do fyvr11bo fyvr11cc" }, disabled: { true: "_140wn8nu _140wn8nc fyvr12v1 fyvr12vp", false: "_140wn8nv _140wn8nd fyvr12v7 fyvr12w1 fyvr12vz" }, size: { xs: "_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _140wn8ne fyvr1ws fyvr1yo", sm: "_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nf fyvr1ww fyvr1ys", md: "_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8ng fyvr1x0 fyvr1yw", lg: "_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nh fyvr1x0 fyvr1yw" }, iconOnly: { true: "_140wn8n10" }, hasLeftIcon: { true: "_140wn8n11" }, hasRightIcon: { true: "_140wn8n12" }, activeOutline: { light: "_140wn8n13", bold: "_140wn8n14" } }, defaultVariants: {}, compoundVariants: [[{ iconOnly: true, size: "xs" }, "_140wn8n15"], [{ iconOnly: true, size: "sm" }, "_140wn8n16"], [{ iconOnly: true, size: "md" }, "_140wn8n17"], [{ iconOnly: true, size: "lg" }, "_140wn8n18"], [{ iconOnly: false, hasLeftIcon: true, size: "xs" }, "_140wn8n19"], [{ iconOnly: false, hasLeftIcon: true, size: "sm" }, "_140wn8n1a"], [{ iconOnly: false, hasLeftIcon: true, size: "md" }, "_140wn8n1b"], [{ iconOnly: false, hasRightIcon: true, size: "xs" }, "_140wn8n1c"], [{ iconOnly: false, hasRightIcon: true, size: "sm" }, "_140wn8n1d"], [{ iconOnly: false, hasRightIcon: true, size: "md" }, "_140wn8n1e"]] }); const Button = reactExports.forwardRef( (props, ref) => { const { @@ -14970,7 +14970,7 @@ const Button = reactExports.forwardRef( ); } ); -var cardVariants = createRuntimeFn({ defaultClassName: "rhmai63", variantClassNames: { clickable: { true: "rhmai64 rhmai60 fyvr12vz fyvr12v7" }, disabled: { true: "rhmai65" }, outlined: { true: "rhmai66 rhmai61 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12nj fyvr12g7 fyvr121j fyvr128v" }, blur: { true: "rhmai67 rhmai62 fyvr11ms" } }, defaultVariants: {}, compoundVariants: [] }); +var cardVariants = createRuntimeFn({ defaultClassName: "rhmai63", variantClassNames: { clickable: { true: "rhmai64 rhmai60 fyvr11a4 fyvr11ag fyvr11as fyvr11b4 fyvr12vz fyvr12v7 _4efw240" }, disabled: { true: "rhmai65" }, outlined: { true: "rhmai66 rhmai61 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12nj fyvr12g7 fyvr121j fyvr128v" }, blur: { true: "rhmai67 rhmai62 fyvr11ms" } }, defaultVariants: {}, compoundVariants: [] }); const Card = reactExports.forwardRef( (props, ref) => { const { @@ -15505,9 +15505,9 @@ const $e698a72e93240346$export$48513f6b9f8ce62d = /* @__PURE__ */ reactExports.f reactExports.useEffect(() => { const form = button === null || button === void 0 ? void 0 : button.form; if (form) { - const reset = () => setChecked(initialCheckedStateRef.current); - form.addEventListener("reset", reset); - return () => form.removeEventListener("reset", reset); + const reset2 = () => setChecked(initialCheckedStateRef.current); + form.addEventListener("reset", reset2); + return () => form.removeEventListener("reset", reset2); } }, [ button, @@ -16331,7 +16331,7 @@ const SvgTransactionIcon = ({ size: size2 = "sm", ...props }) => /* @__PURE__ */ ...props } ); -var checkboxVariants = createRuntimeFn({ defaultClassName: "_1c9x66f1 _1c9x66f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11h0 fyvr11ko fyvr11jg fyvr11od fyvr12w1 fyvr12vz fyvr12vr fyvr12v7 fyvr12v3", variantClassNames: { size: { sm: "_1c9x66f2", lg: "_1c9x66f3" } }, defaultVariants: {}, compoundVariants: [] }); +var checkboxVariants = createRuntimeFn({ defaultClassName: "_1c9x66f1 _1c9x66f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11h0 fyvr11ko fyvr11jg fyvr11od fyvr12w1 fyvr12vz fyvr12vr fyvr12v7 fyvr12v3 _4efw240", variantClassNames: { size: { sm: "_1c9x66f2", lg: "_1c9x66f3" } }, defaultVariants: {}, compoundVariants: [] }); var indicator$1 = "_1c9x66f4 fyvr12s1 fyvr11h0 fyvr11ko fyvr11jg fyvr128 fyvr15o"; const Indicator = ({ size: size2 = "sm" }) => /* @__PURE__ */ jsxRuntimeExports.jsx($e698a72e93240346$export$adb584737d712b70, { className: indicator$1, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgCheckmarkIcon, { size: size2 === "lg" ? "sm" : "xs" }) }); reactExports.forwardRef( @@ -16509,7 +16509,7 @@ const $409067139f391064$export$41fb9f06171c75f4 = $409067139f391064$export$c135d const $409067139f391064$export$7c6e2c02157bb7d2 = $409067139f391064$export$aadde00976f34151; var COLLAPSED_HEIGHT = "64px"; var root$3 = "_4j62fl0"; -var trigger$1 = "_4j62fl2 _4j62fl1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11h0 fyvr11ko fyvr11od fyvr128 fyvr12v7 fyvr11n4"; +var trigger$1 = "_4j62fl2 _4j62fl1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11h0 fyvr11ko fyvr11od fyvr128 fyvr12v7 fyvr11n4 _4efw240"; var content$3 = "_4j62fl4 _4j62fl3 fyvr1ww fyvr1ys fyvr1so fyvr1v0 fyvr128"; var icon = "_4j62fl5"; const Collapsible = (props) => { @@ -17379,7 +17379,7 @@ const computePosition$1$1 = async (reference, floating, config2) => { x: nextX, y: nextY, data, - reset + reset: reset2 } = await fn({ x, y: y2, @@ -17403,18 +17403,18 @@ const computePosition$1$1 = async (reference, floating, config2) => { ...data } }; - if (reset && resetCount <= 50) { + if (reset2 && resetCount <= 50) { resetCount++; - if (typeof reset === "object") { - if (reset.placement) { - statefulPlacement = reset.placement; + if (typeof reset2 === "object") { + if (reset2.placement) { + statefulPlacement = reset2.placement; } - if (reset.rects) { - rects = reset.rects === true ? await platform2.getElementRects({ + if (reset2.rects) { + rects = reset2.rects === true ? await platform2.getElementRects({ reference, floating, strategy - }) : reset.rects; + }) : reset2.rects; } ({ x, @@ -20096,7 +20096,6 @@ var ReactRemoveScroll$1 = reactExports.forwardRef(function(props, ref) { return reactExports.createElement(RemoveScroll$1, __assign$3({}, props, { ref, sideCar: SideCar$2 })); }); ReactRemoveScroll$1.classNames = RemoveScroll$1.classNames; -const $01b9c$RemoveScroll = ReactRemoveScroll$1; const $6cc32821e9371a1c$var$SELECTION_KEYS = [ "Enter", " " @@ -20415,7 +20414,7 @@ reactExports.forwardRef( labelLocation = "hidden", name: name2, onValueChange, - placeholder: placeholder2 = "Upload a file", + placeholder = "Upload a file", validExtensions, ...rest } = props; @@ -20463,7 +20462,7 @@ reactExports.forwardRef( fileData.size.toFixed(2), " kb" ] }) - ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { ellipsis: true, children: placeholder2 }), + ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { ellipsis: true, children: placeholder }), /* @__PURE__ */ jsxRuntimeExports.jsx( Box, { @@ -20755,7 +20754,7 @@ const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /* @__PURE__ */ reactExports.for return ( // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` // ie. when `Overlay` and `Content` are siblings - /* @__PURE__ */ reactExports.createElement($01b9c$RemoveScroll, { + /* @__PURE__ */ reactExports.createElement(ReactRemoveScroll$1, { as: $5e63c961fc1ce211$export$8c6ed5c666ac1360$1, allowPinchZoom: true, shards: [ @@ -21218,7 +21217,7 @@ function escapeRegExp(string) { } const NumericInput = reactExports.forwardRef( (props, ref) => { - const { name: name2 = "amount", placeholder: placeholder2, onChange, onBlur, ...rest } = props; + const { name: name2 = "amount", placeholder, onChange, onBlur, ...rest } = props; const handleChange = (ev) => { let { value } = ev.target; value = value.replace(/,/g, "."); @@ -21260,7 +21259,7 @@ const NumericInput = reactExports.forwardRef( autoCorrect: "off", type: "text", pattern: "^[0-9]*[.,]?[0-9]*$", - placeholder: placeholder2 || "0", + placeholder: placeholder || "0", minLength: 1, maxLength: 79, spellCheck: "false", @@ -21271,7 +21270,7 @@ const NumericInput = reactExports.forwardRef( ); } ); -createRuntimeFn({ defaultClassName: "dtv8gt1", variantClassNames: { size: { sm: "dtv8gt2", normal: "dtv8gt3", md: "dtv8gt4", lg: "dtv8gt5", xl: "dtv8gt6" } }, defaultVariants: {}, compoundVariants: [] }); +createRuntimeFn({ defaultClassName: "_1jujggt1", variantClassNames: { size: { sm: "_1jujggt2", normal: "_1jujggt3", md: "_1jujggt4", lg: "_1jujggt5", xl: "_1jujggt6" } }, defaultVariants: {}, compoundVariants: [] }); const $67824d98245208a0$var$PROGRESS_NAME = "Progress"; const $67824d98245208a0$var$DEFAULT_MAX = 100; const [$67824d98245208a0$var$createProgressContext, $67824d98245208a0$export$388eb2d8f6d3261f] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($67824d98245208a0$var$PROGRESS_NAME); @@ -21548,7 +21547,7 @@ const $f99a8c78507165f7$export$5fb54c671a65c88 = /* @__PURE__ */ reactExports.fo const $f99a8c78507165f7$export$be92b6f5f03c0fe9 = $f99a8c78507165f7$export$a98f0dcb43a68a25; const $f99a8c78507165f7$export$6d08773d2e66f8f2 = $f99a8c78507165f7$export$9f866c100ef519e4; const $f99a8c78507165f7$export$adb584737d712b70 = $f99a8c78507165f7$export$5fb54c671a65c88; -var radioItemVariants = createRuntimeFn({ defaultClassName: "io59uy3 io59uy0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1so fyvr1uk fyvr1wg fyvr1yc fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11od fyvr12v7 fyvr12v3 fyvr12vz fyvr12vr", variantClassNames: { size: { sm: "io59uy4 io59uy1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8", lg: "io59uy5 io59uy2 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc" } }, defaultVariants: {}, compoundVariants: [] }); +var radioItemVariants = createRuntimeFn({ defaultClassName: "io59uy3 io59uy0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1so fyvr1uk fyvr1wg fyvr1yc fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11od fyvr12v7 fyvr12v3 fyvr12vz fyvr12vr _4efw240", variantClassNames: { size: { sm: "io59uy4 io59uy1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8", lg: "io59uy5 io59uy2 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc" } }, defaultVariants: {}, compoundVariants: [] }); var indicatorVariants = createRuntimeFn({ defaultClassName: "io59uy8 io59uy7 io59uy6 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12s1", variantClassNames: { size: { sm: "io59uy9", lg: "io59uya" } }, defaultVariants: {}, compoundVariants: [] }); const RadioOption = (props) => { const { id: id2, label, size: size2 = "sm", value, disabled } = props; @@ -21782,7 +21781,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /* @__PURE__ */ reactExports.fo }); const $cc7e05a45900e73f$var$VALUE_NAME = "SelectValue"; const $cc7e05a45900e73f$export$e288731fd71264f0 = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => { - const { __scopeSelect, className, style: style2, children, placeholder: placeholder2 = "", ...valueProps } = props; + const { __scopeSelect, className, style: style2, children, placeholder = "", ...valueProps } = props; const context2 = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect); const { onValueNodeHasChildrenChange } = context2; const hasChildren = children !== void 0; @@ -21798,7 +21797,7 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /* @__PURE__ */ reactExports.f style: { pointerEvents: "none" } - }), $cc7e05a45900e73f$var$shouldShowPlaceholder(context2.value) ? /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, placeholder2) : children); + }), $cc7e05a45900e73f$var$shouldShowPlaceholder(context2.value) ? /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, placeholder) : children); }); const $cc7e05a45900e73f$export$99b400cabb58c515 = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => { const { __scopeSelect, children, ...iconProps } = props; @@ -22027,7 +22026,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /* @__PURE__ */ reactExports.for position, isPositioned, searchRef - }, /* @__PURE__ */ reactExports.createElement($01b9c$RemoveScroll, { + }, /* @__PURE__ */ reactExports.createElement(ReactRemoveScroll$1, { as: $5e63c961fc1ce211$export$8c6ed5c666ac1360$1, allowPinchZoom: true }, /* @__PURE__ */ reactExports.createElement($d3863c46a17e8a28$export$20e40289641fbbb6$1, { @@ -22598,7 +22597,7 @@ reactExports.forwardRef( labelLocation = "hidden", name: name2, options, - placeholder: placeholder2, + placeholder, ...rest } = props; return /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -22619,7 +22618,7 @@ reactExports.forwardRef( className: clsx$1(triggerStyle, triggerVariants({ borderRadius })), ref, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx($cc7e05a45900e73f$export$4c8d1a57a761ef94, { placeholder: placeholder2 }), + /* @__PURE__ */ jsxRuntimeExports.jsx($cc7e05a45900e73f$export$4c8d1a57a761ef94, { placeholder }), /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { as: $cc7e05a45900e73f$export$f04a61298a47a40f, display: "inline-flex", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgChevronDownIcon, {}) }) ] } @@ -22635,7 +22634,7 @@ reactExports.forwardRef( const { controls, onChange, - placeholder: placeholder2 = "Search", + placeholder = "Search", name: name2 = "search", value, ...rest @@ -22657,7 +22656,7 @@ reactExports.forwardRef( name: name2, leftIcon: SvgSearchIcon, controls: controls || defaultClearButton, - placeholder: placeholder2, + placeholder, value, onChange: (ev) => onChange == null ? void 0 : onChange(ev), ...rest @@ -22843,7 +22842,7 @@ function $6be4966fd9bbc698$var$getState(checked) { } const $6be4966fd9bbc698$export$be92b6f5f03c0fe9 = $6be4966fd9bbc698$export$b5d5cf8927ab7262; const $6be4966fd9bbc698$export$6521433ed15a34db = $6be4966fd9bbc698$export$4d07bf653ea69106; -var root$1 = "_1lp2u8e1 _1lp2u8e0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1ss fyvr1uo fyvr1wk fyvr1yg fyvr11t1 fyvr11hw fyvr12v7 fyvr12o1"; +var root$1 = "_1lp2u8e1 _1lp2u8e0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1ss fyvr1uo fyvr1wk fyvr1yg fyvr11t1 fyvr11hw fyvr12v7 fyvr12o1 _4efw240"; var thumb = "_1lp2u8e3 _1lp2u8e2 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ho fyvr1ko fyvr1oo fyvr1k fyvr140 fyvr11o1"; const Switch = (props) => { const { @@ -66607,7 +66606,7 @@ function GoogleLogin({ onSuccess, onError, useOneTap, promptMomentNotification, ]); return React.createElement("div", { ...containerProps, ref: btnContainerRef, style: { height: containerHeightMap[size2], ...containerProps === null || containerProps === void 0 ? void 0 : containerProps.style } }); } -const version$4 = "2.9.29"; +const version$4 = "2.10.2"; const getContractAddress = (address) => address; const getUrl = (url) => url; const getVersion$2 = () => `viem@${version$4}`; @@ -71634,7 +71633,7 @@ async function call(client2, args) { return { data: response }; } catch (err) { const data2 = getRevertErrorData(err); - const { offchainLookup, offchainLookupSignature } = await __vitePreload(() => import("./ccip-BF4Lsffy.js"), true ? [] : void 0, import.meta.url); + const { offchainLookup, offchainLookupSignature } = await __vitePreload(() => import("./ccip-CtMuIB2P.js"), true ? [] : void 0, import.meta.url); if (client2.ccipRead !== false && (data2 == null ? void 0 : data2.slice(0, 10)) === offchainLookupSignature && to) return { data: await offchainLookup(client2, { data: data2, to }) }; throw getCallError(err, { @@ -75706,7 +75705,7 @@ const secp256k1 = createCurve({ }, sha256$1); BigInt(0); secp256k1.ProjectivePoint; -function signatureToHex({ r: r2, s: s2, v: v3, yParity }) { +function serializeSignature({ r: r2, s: s2, v: v3, yParity }) { const yParity_ = (() => { if (yParity === 0 || yParity === 1) return yParity; @@ -75721,7 +75720,7 @@ async function verifyHash(client2, { address, hash: hash2, signature: signature2 if (isHex(signature2)) return signature2; if (typeof signature2 === "object" && "r" in signature2 && "s" in signature2) - return signatureToHex(signature2); + return serializeSignature(signature2); return bytesToHex$1(signature2); })(); try { @@ -76903,7 +76902,7 @@ const noopStorage = { function createConnector(createConnectorFn) { return createConnectorFn; } -const version$3 = "2.8.1"; +const version$3 = "2.9.1"; const getVersion$1 = () => `@wagmi/core@${version$3}`; var __classPrivateFieldGet$1 = function(receiver, state, kind, f2) { if (kind === "a" && !f2) @@ -78144,9 +78143,10 @@ async function sendTransaction(config2, parameters) { client2 = await getConnectorClient(config2, { account: account2, chainId, connector }); const { connector: activeConnector } = getAccount(config2); const gas = await (async () => { + var _a2; if (!("data" in parameters) || !parameters.data) return void 0; - if (activeConnector == null ? void 0 : activeConnector.supportsSimulation) + if ((_a2 = connector ?? activeConnector) == null ? void 0 : _a2.supportsSimulation) return void 0; if (gas_ === null) return void 0; @@ -78274,6 +78274,7 @@ async function writeContract(config2, parameters) { } mock$1.type = "mock"; function mock$1(parameters) { + const transactionCache = /* @__PURE__ */ new Map(); const features = parameters.features ?? {}; let connected = false; let connectedChainId; @@ -78300,7 +78301,10 @@ function mock$1(parameters) { currentChainId = chain.id; } connected = true; - return { accounts, chainId: currentChainId }; + return { + accounts: accounts.map((x) => getAddress(x)), + chainId: currentChainId + }; }, async disconnect() { connected = false; @@ -78377,6 +78381,79 @@ function mock$1(parameters) { this.onChainChanged(connectedChainId.toString()); return; } + if (method === "wallet_getCapabilities") + return { + "0x2105": { + paymasterService: { + supported: params[0] === "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + }, + sessionKeys: { + supported: true + } + }, + "0x14A34": { + paymasterService: { + supported: params[0] === "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + } + } + }; + if (method === "wallet_sendCalls") { + const hashes = []; + const calls = params[0].calls; + for (const call2 of calls) { + const { result: result2, error: error2 } = await rpc.http(url, { + body: { + method: "eth_sendTransaction", + params: [call2] + } + }); + if (error2) + throw new RpcRequestError({ + body: { method, params }, + error: error2, + url + }); + hashes.push(result2); + } + const id2 = keccak256(stringToHex(JSON.stringify(calls))); + transactionCache.set(id2, hashes); + return id2; + } + if (method === "wallet_getCallsStatus") { + const hashes = transactionCache.get(params[0]); + if (!hashes) + return null; + const receipts = await Promise.all(hashes.map(async (hash2) => { + const { result: result2, error: error2 } = await rpc.http(url, { + body: { + method: "eth_getTransactionReceipt", + params: [hash2], + id: 0 + } + }); + if (error2) + throw new RpcRequestError({ + body: { method, params }, + error: error2, + url + }); + if (!result2) + return null; + return { + blockHash: result2.blockHash, + blockNumber: result2.blockNumber, + gasUsed: result2.gasUsed, + logs: result2.logs, + status: result2.status, + transactionHash: result2.transactionHash + }; + })); + if (receipts.some((x) => !x)) + return { status: "PENDING", receipts: [] }; + return { status: "CONFIRMED", receipts }; + } + if (method === "wallet_showCallsStatus") + return; if (method === "personal_sign") { if (features.signMessageError) { if (typeof features.signMessageError === "boolean") @@ -78452,7 +78529,7 @@ function WagmiProvider(parameters) { const props = { value: config2 }; return reactExports.createElement(Hydrate, parameters, reactExports.createElement(WagmiContext.Provider, props, children)); } -const version$2 = "2.7.1"; +const version$2 = "2.8.1"; const getVersion = () => `wagmi@${version$2}`; class BaseError3 extends BaseError$1 { constructor() { @@ -78617,7 +78694,7 @@ function replaceEqualDeep(a2, b2) { let equalItems = 0; for (let i2 = 0; i2 < bSize; i2++) { const key2 = array ? i2 : bItems[i2]; - if (!array && a2[key2] === void 0 && b2[key2] === void 0 && aItems.includes(key2)) { + if ((!array && aItems.includes(key2) || array) && a2[key2] === void 0 && b2[key2] === void 0) { copy2[key2] = void 0; equalItems++; } else { @@ -78660,6 +78737,9 @@ function isPlainObject$2(o2) { if (!prot.hasOwnProperty("isPrototypeOf")) { return false; } + if (Object.getPrototypeOf(o2) !== Object.prototype) { + return false; + } return true; } function hasObjectPrototype$1(o2) { @@ -89438,10 +89518,10 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar }); } const topLayerSelectors = [":popover-open", ":modal"]; -function isTopLayer(floating) { +function isTopLayer(element) { return topLayerSelectors.some((selector2) => { try { - return floating.matches(selector2); + return element.matches(selector2); } catch (e2) { return false; } @@ -89607,7 +89687,7 @@ function getClippingRect(_ref) { rootBoundary, strategy } = _ref; - const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary); + const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { @@ -89666,6 +89746,9 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) { height: rect.height }; } +function isStaticPositioned(element) { + return getComputedStyle$1(element).position === "static"; +} function getTrueOffsetParent(element, polyfill2) { if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") { return null; @@ -89676,18 +89759,28 @@ function getTrueOffsetParent(element, polyfill2) { return element.offsetParent; } function getOffsetParent(element, polyfill2) { - const window2 = getWindow(element); - if (!isHTMLElement(element) || isTopLayer(element)) { - return window2; + const win = getWindow(element); + if (isTopLayer(element)) { + return win; + } + if (!isHTMLElement(element)) { + let svgOffsetParent = getParentNode(element); + while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { + if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { + return svgOffsetParent; + } + svgOffsetParent = getParentNode(svgOffsetParent); + } + return win; } let offsetParent = getTrueOffsetParent(element, polyfill2); - while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") { + while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { offsetParent = getTrueOffsetParent(offsetParent, polyfill2); } - if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) { - return window2; + if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { + return win; } - return offsetParent || getContainingBlock(element) || window2; + return offsetParent || getContainingBlock(element) || win; } const getElementRects = async function(data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; @@ -98970,7 +99063,7 @@ const fetchSardineClientToken = async (order, isDev, projectAccessKey2, tokenMet default: order.defaultPaymentMethodType }, name: (tokenMetadata == null ? void 0 : tokenMetadata.name) || "Unknown", - imageUrl: (tokenMetadata == null ? void 0 : tokenMetadata.image) || "", + imageUrl: (tokenMetadata == null ? void 0 : tokenMetadata.image) || "https://www.sequence.market/images/placeholder.png", network: networks[order.chainId].name, recipientAddress: order.recipientAddress, platform: "horizon", @@ -104419,7 +104512,7 @@ const commonParams = { }; const name = "@aws-sdk/client-cognito-identity-provider"; const description = "AWS SDK for JavaScript Cognito Identity Provider Client for Node.js, Browser and React Native"; -const version = "3.565.0"; +const version = "3.569.0"; const scripts = { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "node ../../scripts/compilation/inline client-cognito-identity-provider", @@ -104438,17 +104531,19 @@ const sideEffects = false; const dependencies = { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/core": "3.556.0", - "@aws-sdk/credential-provider-node": "3.565.0", - "@aws-sdk/middleware-host-header": "3.535.0", - "@aws-sdk/middleware-logger": "3.535.0", - "@aws-sdk/middleware-recursion-detection": "3.535.0", - "@aws-sdk/middleware-user-agent": "3.540.0", - "@aws-sdk/region-config-resolver": "3.535.0", - "@aws-sdk/types": "3.535.0", - "@aws-sdk/util-endpoints": "3.540.0", - "@aws-sdk/util-user-agent-browser": "3.535.0", - "@aws-sdk/util-user-agent-node": "3.535.0", + "@aws-sdk/client-sso-oidc": "3.569.0", + "@aws-sdk/client-sts": "3.569.0", + "@aws-sdk/core": "3.567.0", + "@aws-sdk/credential-provider-node": "3.569.0", + "@aws-sdk/middleware-host-header": "3.567.0", + "@aws-sdk/middleware-logger": "3.568.0", + "@aws-sdk/middleware-recursion-detection": "3.567.0", + "@aws-sdk/middleware-user-agent": "3.567.0", + "@aws-sdk/region-config-resolver": "3.567.0", + "@aws-sdk/types": "3.567.0", + "@aws-sdk/util-endpoints": "3.567.0", + "@aws-sdk/util-user-agent-browser": "3.567.0", + "@aws-sdk/util-user-agent-node": "3.568.0", "@smithy/config-resolver": "^2.2.0", "@smithy/core": "^1.4.2", "@smithy/fetch-http-handler": "^2.5.0", @@ -104477,16 +104572,15 @@ const dependencies = { tslib: "^2.6.2" }; const devDependencies = { - "@smithy/service-client-documentation-generator": "^2.2.0", - "@tsconfig/node14": "1.0.3", - "@types/node": "^14.14.31", + "@tsconfig/node16": "16.1.3", + "@types/node": "^16.18.96", concurrently: "7.0.0", "downlevel-dts": "0.10.1", rimraf: "3.0.2", typescript: "~4.9.5" }; const engines = { - node: ">=14.0.0" + node: ">=16.0.0" }; const typesVersions = { "<4.0": { @@ -111040,7 +111134,7 @@ function coinbaseWallet$1(parameters) { async getProvider() { var _a2; if (!walletProvider) { - const { default: CoinbaseWalletSDK } = await __vitePreload(() => import("./index-D4BjuBLS.js").then((n2) => n2.i), true ? __vite__mapDeps([0,1]) : void 0, import.meta.url); + const { default: CoinbaseWalletSDK } = await __vitePreload(() => import("./index-DyR0sOyw.js").then((n2) => n2.i), true ? __vite__mapDeps([0,1]) : void 0, import.meta.url); let SDK; if (typeof CoinbaseWalletSDK !== "function" && typeof CoinbaseWalletSDK.default === "function") SDK = CoinbaseWalletSDK.default; @@ -111226,7 +111320,7 @@ function walletConnect$1(parameters) { const optionalChains = config2.chains.map((x) => x.id); if (!optionalChains.length) return; - const { EthereumProvider } = await __vitePreload(() => import("./index.es-DnHUvTmI.js"), true ? __vite__mapDeps([2,1]) : void 0, import.meta.url); + const { EthereumProvider } = await __vitePreload(() => import("./index.es-BKuNVN6W.js"), true ? __vite__mapDeps([2,1]) : void 0, import.meta.url); return await EthereumProvider.init({ ...parameters, disableProviderPing: true, diff --git a/assets/index-DRneY2rd.css b/assets/index-BY3QI6Mi.css similarity index 99% rename from assets/index-DRneY2rd.css rename to assets/index-BY3QI6Mi.css index 1891a22c..7a173875 100644 --- a/assets/index-DRneY2rd.css +++ b/assets/index-BY3QI6Mi.css @@ -11537,6 +11537,13 @@ code { .fyvr11mr { visibility: visible; } +}._4efw240:focus { + outline: none; +} +._4efw240:focus-visible { + outline: none; + box-shadow: 0 0 0 var(--seq-border-widths-thick) var(--seq-colors-border-focus) inset; + border-color: transparent; }._1qxj1ibj { font-style: italic; } @@ -11561,14 +11568,7 @@ code { width: 1px; }._2q9vfj7 { font-weight: var(--seq-font-weights-normal); -}._140wn8ni:focus { - outline: none; -} -._140wn8ni:focus-visible { - outline: none; - box-shadow: 0 0 0 var(--seq-border-widths-thick) var(--seq-colors-border-focus) inset; -} -._140wn8nl { +}._140wn8nl { outline: 2px solid rgba(255, 255, 255, 0.1); outline-offset: -2px; } @@ -11667,15 +11667,7 @@ code { ._1dizidw5 { height: var(--seq-line-heights-9); width: var(--seq-line-heights-9); -}._1c9x66f1:focus { - outline: none; -} -._1c9x66f1:focus-visible { - outline: none; - box-shadow: 0 0 0 var(--seq-border-widths-thick) var(--seq-colors-border-focus) inset; - border-color: transparent; -} -._1c9x66f2 { +}._1c9x66f2 { height: 20px; width: 20px; } @@ -11890,14 +11882,7 @@ code { } .y5zf971:hover:not(.y5zf971:disabled) { border-color: var(--seq-colors-border-focus); -} -.y5zf971:focus { - outline: none; -} -.y5zf971:focus-visible { - outline: none; - box-shadow: 0 0 0 var(--seq-border-widths-thick) var(--seq-colors-border-focus) inset; -}@keyframes dtv8gt0 { +}@keyframes _1jujggt0 { 0% { background-position: 0% 50%; } @@ -11908,40 +11893,32 @@ code { background-position: 0% 50%; } } -.dtv8gt1 { +._1jujggt1 { background-image: linear-gradient(-45deg, transparent, var(--seq-colors-background-secondary), transparent); background-size: 400% 400%; background-repeat: no-repeat; - animation: dtv8gt0 1s ease infinite; + animation: _1jujggt0 1s ease infinite; } -.dtv8gt2 { +._1jujggt2 { width: 96px; height: var(--seq-line-heights-4); } -.dtv8gt3 { +._1jujggt3 { width: 100px; height: var(--seq-line-heights-5); } -.dtv8gt4 { +._1jujggt4 { width: 124px; height: var(--seq-line-heights-6); } -.dtv8gt5 { +._1jujggt5 { width: 124px; height: var(--seq-line-heights-7); } -.dtv8gt6 { +._1jujggt6 { width: 148px; height: var(--seq-line-heights-9); -}.io59uy3:focus { - outline: none; -} -.io59uy3:focus-visible { - outline: none; - box-shadow: 0 0 0 var(--seq-border-widths-thick) var(--seq-colors-border-focus) inset; - border-color: transparent; -} -.io59uy4 { +}.io59uy4 { height: 20px; width: 20px; } @@ -12023,13 +12000,6 @@ code { cursor: default; opacity: 0.5; } -._1lp2u8e1:focus { - outline: none; -} -._1lp2u8e1:focus-visible { - outline: none; - box-shadow: 0 0 0 var(--seq-border-widths-thick) var(--seq-colors-border-focus) inset; -} ._1lp2u8e3 { transition: transform 100ms ease-out, background 100ms ease-out; transform: translateX(0); @@ -12044,6 +12014,7 @@ code { font-size: 0.625rem; letter-spacing: 0.8px; }._10c8o0n1:has(:focus-visible) { + outline: none; box-shadow: 0 0 0 var(--seq-border-widths-thick) var(--seq-colors-border-focus) inset; } ._10c8o0n3 { diff --git a/assets/index-DzVkZDWS.js b/assets/index-Bbl90F7t.js similarity index 99% rename from assets/index-DzVkZDWS.js rename to assets/index-Bbl90F7t.js index 013a19b9..420d88f2 100644 --- a/assets/index-DzVkZDWS.js +++ b/assets/index-Bbl90F7t.js @@ -1,5 +1,5 @@ -import { n as ne$1, s as se$1, T as T$2, t as te$1, a as a$2, o as oe$1, R as R$1, p as p$1, y as y$1 } from "./index-DxKizXZQ.js"; -import "./index-dY-7UIE-.js"; +import { n as ne$1, s as se$1, T as T$2, t as te$1, a as a$2, o as oe$1, R as R$1, p as p$1, y as y$1 } from "./index-CJ5MvQ2C.js"; +import "./index-BUNEaHbj.js"; function addUniqueItem(array, item) { array.indexOf(item) === -1 && array.push(item); } diff --git a/assets/index-DxKizXZQ.js b/assets/index-CJ5MvQ2C.js similarity index 98% rename from assets/index-DxKizXZQ.js rename to assets/index-CJ5MvQ2C.js index 49f7e48f..3566abfe 100644 --- a/assets/index-DxKizXZQ.js +++ b/assets/index-CJ5MvQ2C.js @@ -1,5 +1,5 @@ -const __vite__fileDeps=["./index-DzVkZDWS.js","./index-dY-7UIE-.js","./index-DRneY2rd.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); -import { _ as __vitePreload } from "./index-dY-7UIE-.js"; +const __vite__fileDeps=["./index-Bbl90F7t.js","./index-BUNEaHbj.js","./index-BY3QI6Mi.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import { _ as __vitePreload } from "./index-BUNEaHbj.js"; const t = Symbol(); const s = Object.getPrototypeOf, c$1 = /* @__PURE__ */ new WeakMap(), l = (e) => e && (c$1.has(e) ? c$1.get(e) : s(e) === Object.prototype || s(e) === Array.prototype), y$1 = (e) => l(e) && e[t] || null, h = (e, t2 = true) => { c$1.set(e, t2); @@ -487,7 +487,7 @@ class d { } async initUi() { if (typeof window < "u") { - await __vitePreload(() => import("./index-DzVkZDWS.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url); + await __vitePreload(() => import("./index-Bbl90F7t.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url); const e = document.createElement("wcm-modal"); document.body.insertAdjacentElement("beforeend", e), p.setIsUiLoaded(true); } diff --git a/assets/index-D4BjuBLS.js b/assets/index-DyR0sOyw.js similarity index 97% rename from assets/index-D4BjuBLS.js rename to assets/index-DyR0sOyw.js index 2e49ce42..d5cf0743 100644 --- a/assets/index-D4BjuBLS.js +++ b/assets/index-DyR0sOyw.js @@ -1,5 +1,5 @@ -import { c as commonjsGlobal, d as bnExports, B as Buffer$7, e as require$$2$1, i as inherits_browserExports, a as getAugmentedNamespace, p as process$1, t as tslib_es6, f as eventemitter3Exports, b as getDefaultExportFromCjs } from "./index-dY-7UIE-.js"; -import { e as eventsExports, r as require$$1$2 } from "./___vite-browser-external_commonjs-proxy-Cp_JekuJ.js"; +import { c as commonjsGlobal, d as bnExports, B as Buffer$7, e as require$$2$1, i as inherits_browserExports, a as getAugmentedNamespace, p as process$1, t as tslib_es6, f as eventemitter3Exports, b as getDefaultExportFromCjs } from "./index-BUNEaHbj.js"; +import { e as eventsExports, r as require$$1$2 } from "./___vite-browser-external_commonjs-proxy-C7LGirr0.js"; function _mergeNamespaces(n2, m2) { for (var i = 0; i < m2.length; i++) { const e2 = m2[i]; @@ -5535,7 +5535,7 @@ function requireBuffer_list() { } _createClass(BufferList, [{ key: "push", - value: function push2(v2) { + value: function push(v2) { var entry = { data: v2, next: null @@ -5549,7 +5549,7 @@ function requireBuffer_list() { } }, { key: "unshift", - value: function unshift2(v2) { + value: function unshift(v2) { var entry = { data: v2, next: this.head @@ -6147,7 +6147,7 @@ function require_stream_writable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._writableState && this._writableState.getBuffer(); } }); @@ -6162,7 +6162,7 @@ function require_stream_writable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._writableState.highWaterMark; } }); @@ -6343,7 +6343,7 @@ function require_stream_writable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._writableState.length; } }); @@ -6418,7 +6418,7 @@ function require_stream_writable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { if (this._writableState === void 0) { return false; } @@ -6484,7 +6484,7 @@ function require_stream_duplex() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._writableState.highWaterMark; } }); @@ -6493,7 +6493,7 @@ function require_stream_duplex() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._writableState && this._writableState.getBuffer(); } }); @@ -6502,7 +6502,7 @@ function require_stream_duplex() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._writableState.length; } }); @@ -6519,7 +6519,7 @@ function require_stream_duplex() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { if (this._readableState === void 0 || this._writableState === void 0) { return false; } @@ -7018,7 +7018,7 @@ function requireAsync_iterator() { }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) { var _Object$create; - var iterator2 = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream, writable: true }), _defineProperty(_Object$create, kLastResolve, { @@ -7035,43 +7035,43 @@ function requireAsync_iterator() { writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { - var data = iterator2[kStream].read(); + var data = iterator[kStream].read(); if (data) { - iterator2[kLastPromise] = null; - iterator2[kLastResolve] = null; - iterator2[kLastReject] = null; + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; resolve(createIterResult(data, false)); } else { - iterator2[kLastResolve] = resolve; - iterator2[kLastReject] = reject; + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); - iterator2[kLastPromise] = null; + iterator[kLastPromise] = null; finished(stream, function(err) { if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { - var reject = iterator2[kLastReject]; + var reject = iterator[kLastReject]; if (reject !== null) { - iterator2[kLastPromise] = null; - iterator2[kLastResolve] = null; - iterator2[kLastReject] = null; + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; reject(err); } - iterator2[kError] = err; + iterator[kError] = err; return; } - var resolve = iterator2[kLastResolve]; + var resolve = iterator[kLastResolve]; if (resolve !== null) { - iterator2[kLastPromise] = null; - iterator2[kLastResolve] = null; - iterator2[kLastReject] = null; + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; resolve(createIterResult(void 0, true)); } - iterator2[kEnded] = true; + iterator[kEnded] = true; }); - stream.on("readable", onReadable.bind(null, iterator2)); - return iterator2; + stream.on("readable", onReadable.bind(null, iterator)); + return iterator; }; async_iterator = createReadableStreamAsyncIterator; return async_iterator; @@ -7196,7 +7196,7 @@ function require_stream_readable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { if (this._readableState === void 0) { return false; } @@ -7784,7 +7784,7 @@ function require_stream_readable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._readableState.highWaterMark; } }); @@ -7793,7 +7793,7 @@ function require_stream_readable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._readableState && this._readableState.buffer; } }); @@ -7802,7 +7802,7 @@ function require_stream_readable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._readableState.flowing; }, set: function set2(state2) { @@ -7817,7 +7817,7 @@ function require_stream_readable() { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get2() { + get: function get() { return this._readableState.length; } }); @@ -10795,8 +10795,8 @@ var json = {}; ]); exports2.JsonStruct = (0, superstruct_12.define)("Json", (value, context) => { function checkStruct(innerValue, struct2) { - const iterator2 = struct2.validator(innerValue, context); - const errors2 = [...iterator2]; + const iterator = struct2.validator(innerValue, context); + const errors2 = [...iterator]; if (errors2.length > 0) { return errors2; } @@ -11781,7 +11781,7 @@ let SemVer$d = class SemVer { do { const a2 = this.build[i]; const b2 = other.build[i]; - debug("prerelease compare", i, a2, b2); + debug("build compare", i, a2, b2); if (a2 === void 0 && b2 === void 0) { return 0; } else if (b2 === void 0) { @@ -12111,646 +12111,42 @@ const coerce$1 = (version2, options) => { return parse$1(`${major2}.${minor2}.${patch2}${prerelease2}${build}`, options); }; var coerce_1 = coerce$1; -var iterator; -var hasRequiredIterator; -function requireIterator() { - if (hasRequiredIterator) - return iterator; - hasRequiredIterator = 1; - iterator = function(Yallist2) { - Yallist2.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value; - } - }; - }; - return iterator; -} -var yallist = Yallist$1; -Yallist$1.Node = Node; -Yallist$1.create = Yallist$1; -function Yallist$1(list) { - var self2 = this; - if (!(self2 instanceof Yallist$1)) { - self2 = new Yallist$1(); - } - self2.tail = null; - self2.head = null; - self2.length = 0; - if (list && typeof list.forEach === "function") { - list.forEach(function(item) { - self2.push(item); - }); - } else if (arguments.length > 0) { - for (var i = 0, l2 = arguments.length; i < l2; i++) { - self2.push(arguments[i]); - } - } - return self2; -} -Yallist$1.prototype.removeNode = function(node) { - if (node.list !== this) { - throw new Error("removing node which does not belong to this list"); - } - var next = node.next; - var prev = node.prev; - if (next) { - next.prev = prev; - } - if (prev) { - prev.next = next; - } - if (node === this.head) { - this.head = next; - } - if (node === this.tail) { - this.tail = prev; - } - node.list.length--; - node.next = null; - node.prev = null; - node.list = null; - return next; -}; -Yallist$1.prototype.unshiftNode = function(node) { - if (node === this.head) { - return; - } - if (node.list) { - node.list.removeNode(node); - } - var head = this.head; - node.list = this; - node.next = head; - if (head) { - head.prev = node; - } - this.head = node; - if (!this.tail) { - this.tail = node; - } - this.length++; -}; -Yallist$1.prototype.pushNode = function(node) { - if (node === this.tail) { - return; - } - if (node.list) { - node.list.removeNode(node); - } - var tail = this.tail; - node.list = this; - node.prev = tail; - if (tail) { - tail.next = node; - } - this.tail = node; - if (!this.head) { - this.head = node; - } - this.length++; -}; -Yallist$1.prototype.push = function() { - for (var i = 0, l2 = arguments.length; i < l2; i++) { - push(this, arguments[i]); - } - return this.length; -}; -Yallist$1.prototype.unshift = function() { - for (var i = 0, l2 = arguments.length; i < l2; i++) { - unshift(this, arguments[i]); - } - return this.length; -}; -Yallist$1.prototype.pop = function() { - if (!this.tail) { - return void 0; - } - var res = this.tail.value; - this.tail = this.tail.prev; - if (this.tail) { - this.tail.next = null; - } else { - this.head = null; - } - this.length--; - return res; -}; -Yallist$1.prototype.shift = function() { - if (!this.head) { - return void 0; - } - var res = this.head.value; - this.head = this.head.next; - if (this.head) { - this.head.prev = null; - } else { - this.tail = null; - } - this.length--; - return res; -}; -Yallist$1.prototype.forEach = function(fn, thisp) { - thisp = thisp || this; - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this); - walker = walker.next; - } -}; -Yallist$1.prototype.forEachReverse = function(fn, thisp) { - thisp = thisp || this; - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this); - walker = walker.prev; - } -}; -Yallist$1.prototype.get = function(n2) { - for (var i = 0, walker = this.head; walker !== null && i < n2; i++) { - walker = walker.next; - } - if (i === n2 && walker !== null) { - return walker.value; - } -}; -Yallist$1.prototype.getReverse = function(n2) { - for (var i = 0, walker = this.tail; walker !== null && i < n2; i++) { - walker = walker.prev; - } - if (i === n2 && walker !== null) { - return walker.value; - } -}; -Yallist$1.prototype.map = function(fn, thisp) { - thisp = thisp || this; - var res = new Yallist$1(); - for (var walker = this.head; walker !== null; ) { - res.push(fn.call(thisp, walker.value, this)); - walker = walker.next; - } - return res; -}; -Yallist$1.prototype.mapReverse = function(fn, thisp) { - thisp = thisp || this; - var res = new Yallist$1(); - for (var walker = this.tail; walker !== null; ) { - res.push(fn.call(thisp, walker.value, this)); - walker = walker.prev; - } - return res; -}; -Yallist$1.prototype.reduce = function(fn, initial) { - var acc; - var walker = this.head; - if (arguments.length > 1) { - acc = initial; - } else if (this.head) { - walker = this.head.next; - acc = this.head.value; - } else { - throw new TypeError("Reduce of empty list with no initial value"); - } - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i); - walker = walker.next; - } - return acc; -}; -Yallist$1.prototype.reduceReverse = function(fn, initial) { - var acc; - var walker = this.tail; - if (arguments.length > 1) { - acc = initial; - } else if (this.tail) { - walker = this.tail.prev; - acc = this.tail.value; - } else { - throw new TypeError("Reduce of empty list with no initial value"); - } - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i); - walker = walker.prev; - } - return acc; -}; -Yallist$1.prototype.toArray = function() { - var arr2 = new Array(this.length); - for (var i = 0, walker = this.head; walker !== null; i++) { - arr2[i] = walker.value; - walker = walker.next; - } - return arr2; -}; -Yallist$1.prototype.toArrayReverse = function() { - var arr2 = new Array(this.length); - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr2[i] = walker.value; - walker = walker.prev; - } - return arr2; -}; -Yallist$1.prototype.slice = function(from, to) { - to = to || this.length; - if (to < 0) { - to += this.length; - } - from = from || 0; - if (from < 0) { - from += this.length; - } - var ret = new Yallist$1(); - if (to < from || to < 0) { - return ret; - } - if (from < 0) { - from = 0; - } - if (to > this.length) { - to = this.length; - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next; - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value); - } - return ret; -}; -Yallist$1.prototype.sliceReverse = function(from, to) { - to = to || this.length; - if (to < 0) { - to += this.length; - } - from = from || 0; - if (from < 0) { - from += this.length; - } - var ret = new Yallist$1(); - if (to < from || to < 0) { - return ret; - } - if (from < 0) { - from = 0; - } - if (to > this.length) { - to = this.length; - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev; - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value); - } - return ret; -}; -Yallist$1.prototype.splice = function(start, deleteCount, ...nodes) { - if (start > this.length) { - start = this.length - 1; - } - if (start < 0) { - start = this.length + start; - } - for (var i = 0, walker = this.head; walker !== null && i < start; i++) { - walker = walker.next; - } - var ret = []; - for (var i = 0; walker && i < deleteCount; i++) { - ret.push(walker.value); - walker = this.removeNode(walker); - } - if (walker === null) { - walker = this.tail; - } - if (walker !== this.head && walker !== this.tail) { - walker = walker.prev; - } - for (var i = 0; i < nodes.length; i++) { - walker = insert(this, walker, nodes[i]); - } - return ret; -}; -Yallist$1.prototype.reverse = function() { - var head = this.head; - var tail = this.tail; - for (var walker = head; walker !== null; walker = walker.prev) { - var p2 = walker.prev; - walker.prev = walker.next; - walker.next = p2; - } - this.head = tail; - this.tail = head; - return this; -}; -function insert(self2, node, value) { - var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2); - if (inserted.next === null) { - self2.tail = inserted; - } - if (inserted.prev === null) { - self2.head = inserted; - } - self2.length++; - return inserted; -} -function push(self2, item) { - self2.tail = new Node(item, self2.tail, null, self2); - if (!self2.head) { - self2.head = self2.tail; - } - self2.length++; -} -function unshift(self2, item) { - self2.head = new Node(item, null, self2.head, self2); - if (!self2.tail) { - self2.tail = self2.head; - } - self2.length++; -} -function Node(value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list); - } - this.list = list; - this.value = value; - if (prev) { - prev.next = this; - this.prev = prev; - } else { - this.prev = null; - } - if (next) { - next.prev = this; - this.next = next; - } else { - this.next = null; - } -} -try { - requireIterator()(Yallist$1); -} catch (er) { -} -const Yallist = yallist; -const MAX$1 = Symbol("max"); -const LENGTH = Symbol("length"); -const LENGTH_CALCULATOR = Symbol("lengthCalculator"); -const ALLOW_STALE = Symbol("allowStale"); -const MAX_AGE = Symbol("maxAge"); -const DISPOSE = Symbol("dispose"); -const NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet"); -const LRU_LIST = Symbol("lruList"); -const CACHE = Symbol("cache"); -const UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet"); -const naiveLength = () => 1; class LRUCache { - constructor(options) { - if (typeof options === "number") - options = { max: options }; - if (!options) - options = {}; - if (options.max && (typeof options.max !== "number" || options.max < 0)) - throw new TypeError("max must be a non-negative number"); - this[MAX$1] = options.max || Infinity; - const lc = options.length || naiveLength; - this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc; - this[ALLOW_STALE] = options.stale || false; - if (options.maxAge && typeof options.maxAge !== "number") - throw new TypeError("maxAge must be a number"); - this[MAX_AGE] = options.maxAge || 0; - this[DISPOSE] = options.dispose; - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false; - this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false; - this.reset(); - } - // resize the cache when the max changes. - set max(mL) { - if (typeof mL !== "number" || mL < 0) - throw new TypeError("max must be a non-negative number"); - this[MAX$1] = mL || Infinity; - trim(this); - } - get max() { - return this[MAX$1]; - } - set allowStale(allowStale) { - this[ALLOW_STALE] = !!allowStale; - } - get allowStale() { - return this[ALLOW_STALE]; - } - set maxAge(mA) { - if (typeof mA !== "number") - throw new TypeError("maxAge must be a non-negative number"); - this[MAX_AGE] = mA; - trim(this); - } - get maxAge() { - return this[MAX_AGE]; - } - // resize the cache when the lengthCalculator changes. - set lengthCalculator(lC) { - if (typeof lC !== "function") - lC = naiveLength; - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC; - this[LENGTH] = 0; - this[LRU_LIST].forEach((hit) => { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key); - this[LENGTH] += hit.length; - }); - } - trim(this); - } - get lengthCalculator() { - return this[LENGTH_CALCULATOR]; - } - get length() { - return this[LENGTH]; - } - get itemCount() { - return this[LRU_LIST].length; - } - rforEach(fn, thisp) { - thisp = thisp || this; - for (let walker = this[LRU_LIST].tail; walker !== null; ) { - const prev = walker.prev; - forEachStep(this, fn, walker, thisp); - walker = prev; - } + constructor() { + this.max = 1e3; + this.map = /* @__PURE__ */ new Map(); } - forEach(fn, thisp) { - thisp = thisp || this; - for (let walker = this[LRU_LIST].head; walker !== null; ) { - const next = walker.next; - forEachStep(this, fn, walker, thisp); - walker = next; + get(key) { + const value = this.map.get(key); + if (value === void 0) { + return void 0; + } else { + this.map.delete(key); + this.map.set(key, value); + return value; } } - keys() { - return this[LRU_LIST].toArray().map((k2) => k2.key); - } - values() { - return this[LRU_LIST].toArray().map((k2) => k2.value); - } - reset() { - if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { - this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value)); - } - this[CACHE] = /* @__PURE__ */ new Map(); - this[LRU_LIST] = new Yallist(); - this[LENGTH] = 0; - } - dump() { - return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }).toArray().filter((h2) => h2); - } - dumpLru() { - return this[LRU_LIST]; - } - set(key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE]; - if (maxAge && typeof maxAge !== "number") - throw new TypeError("maxAge must be a number"); - const now = maxAge ? Date.now() : 0; - const len = this[LENGTH_CALCULATOR](value, key); - if (this[CACHE].has(key)) { - if (len > this[MAX$1]) { - del(this, this[CACHE].get(key)); - return false; - } - const node = this[CACHE].get(key); - const item = node.value; - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) - this[DISPOSE](key, item.value); - } - item.now = now; - item.maxAge = maxAge; - item.value = value; - this[LENGTH] += len - item.length; - item.length = len; - this.get(key); - trim(this); + delete(key) { + if (this.map.has(key)) { + this.map.delete(key); return true; - } - const hit = new Entry(key, value, len, now, maxAge); - if (hit.length > this[MAX$1]) { - if (this[DISPOSE]) - this[DISPOSE](key, value); + } else { return false; } - this[LENGTH] += hit.length; - this[LRU_LIST].unshift(hit); - this[CACHE].set(key, this[LRU_LIST].head); - trim(this); - return true; - } - has(key) { - if (!this[CACHE].has(key)) - return false; - const hit = this[CACHE].get(key).value; - return !isStale(this, hit); - } - get(key) { - return get(this, key, true); - } - peek(key) { - return get(this, key, false); } - pop() { - const node = this[LRU_LIST].tail; - if (!node) - return null; - del(this, node); - return node.value; - } - del(key) { - del(this, this[CACHE].get(key)); - } - load(arr2) { - this.reset(); - const now = Date.now(); - for (let l2 = arr2.length - 1; l2 >= 0; l2--) { - const hit = arr2[l2]; - const expiresAt = hit.e || 0; - if (expiresAt === 0) - this.set(hit.k, hit.v); - else { - const maxAge = expiresAt - now; - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge); - } + set(key, value) { + const deleted = this.delete(key); + if (!deleted && value !== void 0) { + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value; + this.delete(firstKey); } + this.map.set(key, value); } - } - prune() { - this[CACHE].forEach((value, key) => get(this, key, false)); + return this; } } -const get = (self2, key, doUse) => { - const node = self2[CACHE].get(key); - if (node) { - const hit = node.value; - if (isStale(self2, hit)) { - del(self2, node); - if (!self2[ALLOW_STALE]) - return void 0; - } else { - if (doUse) { - if (self2[UPDATE_AGE_ON_GET]) - node.value.now = Date.now(); - self2[LRU_LIST].unshiftNode(node); - } - } - return hit.value; - } -}; -const isStale = (self2, hit) => { - if (!hit || !hit.maxAge && !self2[MAX_AGE]) - return false; - const diff2 = Date.now() - hit.now; - return hit.maxAge ? diff2 > hit.maxAge : self2[MAX_AGE] && diff2 > self2[MAX_AGE]; -}; -const trim = (self2) => { - if (self2[LENGTH] > self2[MAX$1]) { - for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX$1] && walker !== null; ) { - const prev = walker.prev; - del(self2, walker); - walker = prev; - } - } -}; -const del = (self2, node) => { - if (node) { - const hit = node.value; - if (self2[DISPOSE]) - self2[DISPOSE](hit.key, hit.value); - self2[LENGTH] -= hit.length; - self2[CACHE].delete(hit.key); - self2[LRU_LIST].removeNode(node); - } -}; -class Entry { - constructor(key, value, length, now, maxAge) { - this.key = key; - this.value = value; - this.length = length; - this.now = now; - this.maxAge = maxAge || 0; - } -} -const forEachStep = (self2, fn, node, thisp) => { - let hit = node.value; - if (isStale(self2, hit)) { - del(self2, node); - if (!self2[ALLOW_STALE]) - hit = void 0; - } - if (hit) - fn.call(thisp, hit.value, hit.key, self2); -}; -var lruCache = LRUCache; +var lrucache = LRUCache; var range; var hasRequiredRange; function requireRange() { @@ -12879,8 +12275,8 @@ function requireRange() { } } range = Range2; - const LRU = lruCache; - const cache = new LRU({ max: 1e3 }); + const LRU = lrucache; + const cache = new LRU(); const parseOptions2 = parseOptions_1; const Comparator2 = requireComparator(); const debug2 = debug_1; @@ -13058,7 +12454,7 @@ function requireRange() { debug2("replaceGTE0", comp, options); return comp.trim().replace(re2[options.includePrerelease ? t2.GTE0PRE : t2.GTE0], ""); }; - const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { + const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { if (isX(fM)) { from = ""; } else if (isX(fm)) { diff --git a/assets/index.es-DnHUvTmI.js b/assets/index.es-BKuNVN6W.js similarity index 68% rename from assets/index.es-DnHUvTmI.js rename to assets/index.es-BKuNVN6W.js index 35e4ca91..ae5b95c4 100644 --- a/assets/index.es-DnHUvTmI.js +++ b/assets/index.es-BKuNVN6W.js @@ -1,6 +1,6 @@ -const __vite__fileDeps=["./index-DxKizXZQ.js","./index-dY-7UIE-.js","./index-DRneY2rd.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); -import { p as process$1, r as require$$0$2, g as global, B as Buffer, a as getAugmentedNamespace, b as getDefaultExportFromCjs, c as commonjsGlobal, _ as __vitePreload } from "./index-dY-7UIE-.js"; -import { r as require$$1, e as eventsExports, U as Ug } from "./___vite-browser-external_commonjs-proxy-Cp_JekuJ.js"; +const __vite__fileDeps=["./index-CJ5MvQ2C.js","./index-BUNEaHbj.js","./index-BY3QI6Mi.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import { p as process$1, r as require$$0$2, g as global, B as Buffer, a as getAugmentedNamespace, b as getDefaultExportFromCjs, c as commonjsGlobal, _ as __vitePreload } from "./index-BUNEaHbj.js"; +import { r as require$$1, e as eventsExports, U as Ug } from "./___vite-browser-external_commonjs-proxy-C7LGirr0.js"; var chacha20poly1305 = {}; var chacha = {}; var binary = {}; @@ -21,21 +21,21 @@ var int = {}; return a3 - b3 | 0; } exports.sub = sub; - function rotl(x2, n2) { - return x2 << n2 | x2 >>> 32 - n2; + function rotl(x2, n3) { + return x2 << n3 | x2 >>> 32 - n3; } exports.rotl = rotl; - function rotr(x2, n2) { - return x2 << 32 - n2 | x2 >>> n2; + function rotr(x2, n3) { + return x2 << 32 - n3 | x2 >>> n3; } exports.rotr = rotr; - function isIntegerShim(n2) { - return typeof n2 === "number" && isFinite(n2) && Math.floor(n2) === n2; + function isIntegerShim(n3) { + return typeof n3 === "number" && isFinite(n3) && Math.floor(n3) === n3; } exports.isInteger = Number.isInteger || isIntegerShim; exports.MAX_SAFE_INTEGER = 9007199254740991; - exports.isSafeInteger = function(n2) { - return exports.isInteger(n2) && (n2 >= -exports.MAX_SAFE_INTEGER && n2 <= exports.MAX_SAFE_INTEGER); + exports.isSafeInteger = function(n3) { + return exports.isInteger(n3) && (n3 >= -exports.MAX_SAFE_INTEGER && n3 <= exports.MAX_SAFE_INTEGER); }; })(int); Object.defineProperty(binary, "__esModule", { value: true }); @@ -723,21 +723,21 @@ constantTime.equal = equal; d1 += h9 * (5 * r2); c2 += d1 >>> 13; d1 &= 8191; - var d2 = c2; - d2 += h0 * r2; - d2 += h1 * r1; - d2 += h22 * r0; - d2 += h32 * (5 * r9); - d2 += h4 * (5 * r8); - c2 = d2 >>> 13; - d2 &= 8191; - d2 += h5 * (5 * r7); - d2 += h6 * (5 * r6); - d2 += h7 * (5 * r5); - d2 += h8 * (5 * r4); - d2 += h9 * (5 * r3); - c2 += d2 >>> 13; - d2 &= 8191; + var d22 = c2; + d22 += h0 * r2; + d22 += h1 * r1; + d22 += h22 * r0; + d22 += h32 * (5 * r9); + d22 += h4 * (5 * r8); + c2 = d22 >>> 13; + d22 &= 8191; + d22 += h5 * (5 * r7); + d22 += h6 * (5 * r6); + d22 += h7 * (5 * r5); + d22 += h8 * (5 * r4); + d22 += h9 * (5 * r3); + c2 += d22 >>> 13; + d22 &= 8191; var d3 = c2; d3 += h0 * r3; d3 += h1 * r2; @@ -850,7 +850,7 @@ constantTime.equal = equal; d1 += c2; h0 = d0; h1 = d1; - h22 = d2; + h22 = d22; h32 = d3; h4 = d4; h5 = d5; @@ -879,7 +879,7 @@ constantTime.equal = equal; var g3 = new Uint16Array(10); var c2; var mask; - var f3; + var f4; var i2; if (this._leftover) { i2 = this._leftover; @@ -929,11 +929,11 @@ constantTime.equal = equal; this._h[5] = (this._h[6] >>> 2 | this._h[7] << 11) & 65535; this._h[6] = (this._h[7] >>> 5 | this._h[8] << 8) & 65535; this._h[7] = (this._h[8] >>> 8 | this._h[9] << 5) & 65535; - f3 = this._h[0] + this._pad[0]; - this._h[0] = f3 & 65535; + f4 = this._h[0] + this._pad[0]; + this._h[0] = f4 & 65535; for (i2 = 1; i2 < 8; i2++) { - f3 = (this._h[i2] + this._pad[i2] | 0) + (f3 >>> 16) | 0; - this._h[i2] = f3 & 65535; + f4 = (this._h[i2] + this._pad[i2] | 0) + (f4 >>> 16) | 0; + this._h[i2] = f4 & 65535; } mac[macpos + 0] = this._h[0] >>> 0; mac[macpos + 1] = this._h[0] >>> 8; @@ -1652,9 +1652,9 @@ var sha256 = {}; var a3 = v3[0]; var b3 = v3[1]; var c2 = v3[2]; - var d2 = v3[3]; - var e = v3[4]; - var f3 = v3[5]; + var d3 = v3[3]; + var e2 = v3[4]; + var f4 = v3[5]; var g3 = v3[6]; var h4 = v3[7]; for (var i2 = 0; i2 < 16; i2++) { @@ -1669,13 +1669,13 @@ var sha256 = {}; w3[i2] = (t1 + w3[i2 - 7] | 0) + (t2 + w3[i2 - 16] | 0); } for (var i2 = 0; i2 < 64; i2++) { - var t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f3 ^ ~e & g3) | 0) + (h4 + (K2[i2] + w3[i2] | 0) | 0) | 0; + var t1 = (((e2 >>> 6 | e2 << 32 - 6) ^ (e2 >>> 11 | e2 << 32 - 11) ^ (e2 >>> 25 | e2 << 32 - 25)) + (e2 & f4 ^ ~e2 & g3) | 0) + (h4 + (K2[i2] + w3[i2] | 0) | 0) | 0; var t2 = ((a3 >>> 2 | a3 << 32 - 2) ^ (a3 >>> 13 | a3 << 32 - 13) ^ (a3 >>> 22 | a3 << 32 - 22)) + (a3 & b3 ^ a3 & c2 ^ b3 & c2) | 0; h4 = g3; - g3 = f3; - f3 = e; - e = d2 + t1 | 0; - d2 = c2; + g3 = f4; + f4 = e2; + e2 = d3 + t1 | 0; + d3 = c2; c2 = b3; b3 = a3; a3 = t1 + t2 | 0; @@ -1683,9 +1683,9 @@ var sha256 = {}; v3[0] += a3; v3[1] += b3; v3[2] += c2; - v3[3] += d2; - v3[4] += e; - v3[5] += f3; + v3[3] += d3; + v3[4] += e2; + v3[5] += f4; v3[6] += g3; v3[7] += h4; pos += 64; @@ -1712,25 +1712,25 @@ var x25519 = {}; exports.SECRET_KEY_LENGTH = 32; exports.SHARED_KEY_LENGTH = 32; function gf(init) { - const r = new Float64Array(16); + const r2 = new Float64Array(16); if (init) { for (let i2 = 0; i2 < init.length; i2++) { - r[i2] = init[i2]; + r2[i2] = init[i2]; } } - return r; + return r2; } const _9 = new Uint8Array(32); _9[0] = 9; const _121665 = gf([56129, 1]); - function car25519(o) { + function car25519(o2) { let c2 = 1; for (let i2 = 0; i2 < 16; i2++) { - let v3 = o[i2] + c2 + 65535; + let v3 = o2[i2] + c2 + 65535; c2 = Math.floor(v3 / 65536); - o[i2] = v3 - c2 * 65536; + o2[i2] = v3 - c2 * 65536; } - o[0] += c2 - 1 + 37 * (c2 - 1); + o2[0] += c2 - 1 + 37 * (c2 - 1); } function sel25519(p3, q2, b3) { const c2 = ~(b3 - 1); @@ -1740,11 +1740,11 @@ var x25519 = {}; q2[i2] ^= t; } } - function pack25519(o, n2) { + function pack25519(o2, n3) { const m2 = gf(); const t = gf(); for (let i2 = 0; i2 < 16; i2++) { - t[i2] = n2[i2]; + t[i2] = n3[i2]; } car25519(t); car25519(t); @@ -1761,27 +1761,27 @@ var x25519 = {}; sel25519(t, m2, 1 - b3); } for (let i2 = 0; i2 < 16; i2++) { - o[2 * i2] = t[i2] & 255; - o[2 * i2 + 1] = t[i2] >> 8; + o2[2 * i2] = t[i2] & 255; + o2[2 * i2 + 1] = t[i2] >> 8; } } - function unpack25519(o, n2) { + function unpack25519(o2, n3) { for (let i2 = 0; i2 < 16; i2++) { - o[i2] = n2[2 * i2] + (n2[2 * i2 + 1] << 8); + o2[i2] = n3[2 * i2] + (n3[2 * i2 + 1] << 8); } - o[15] &= 32767; + o2[15] &= 32767; } - function add(o, a3, b3) { + function add(o2, a3, b3) { for (let i2 = 0; i2 < 16; i2++) { - o[i2] = a3[i2] + b3[i2]; + o2[i2] = a3[i2] + b3[i2]; } } - function sub(o, a3, b3) { + function sub(o2, a3, b3) { for (let i2 = 0; i2 < 16; i2++) { - o[i2] = a3[i2] - b3[i2]; + o2[i2] = a3[i2] - b3[i2]; } } - function mul(o, a3, b3) { + function mul(o2, a3, b3) { let v3, c2, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b3[0], b1 = b3[1], b22 = b3[2], b32 = b3[3], b4 = b3[4], b5 = b3[5], b6 = b3[6], b7 = b3[7], b8 = b3[8], b9 = b3[9], b10 = b3[10], b11 = b3[11], b12 = b3[12], b13 = b3[13], b14 = b3[14], b15 = b3[15]; v3 = a3[0]; t0 += v3 * b0; @@ -2170,27 +2170,27 @@ var x25519 = {}; c2 = Math.floor(v3 / 65536); t15 = v3 - c2 * 65536; t0 += c2 - 1 + 37 * (c2 - 1); - o[0] = t0; - o[1] = t1; - o[2] = t2; - o[3] = t3; - o[4] = t4; - o[5] = t5; - o[6] = t6; - o[7] = t7; - o[8] = t8; - o[9] = t9; - o[10] = t10; - o[11] = t11; - o[12] = t12; - o[13] = t13; - o[14] = t14; - o[15] = t15; - } - function square(o, a3) { - mul(o, a3, a3); - } - function inv25519(o, inp) { + o2[0] = t0; + o2[1] = t1; + o2[2] = t2; + o2[3] = t3; + o2[4] = t4; + o2[5] = t5; + o2[6] = t6; + o2[7] = t7; + o2[8] = t8; + o2[9] = t9; + o2[10] = t10; + o2[11] = t11; + o2[12] = t12; + o2[13] = t13; + o2[14] = t14; + o2[15] = t15; + } + function square(o2, a3) { + mul(o2, a3, a3); + } + function inv25519(o2, inp) { const c2 = gf(); for (let i2 = 0; i2 < 16; i2++) { c2[i2] = inp[i2]; @@ -2202,53 +2202,53 @@ var x25519 = {}; } } for (let i2 = 0; i2 < 16; i2++) { - o[i2] = c2[i2]; + o2[i2] = c2[i2]; } } - function scalarMult(n2, p3) { + function scalarMult(n3, p3) { const z2 = new Uint8Array(32); const x2 = new Float64Array(80); - const a3 = gf(), b3 = gf(), c2 = gf(), d2 = gf(), e = gf(), f3 = gf(); + const a3 = gf(), b3 = gf(), c2 = gf(), d3 = gf(), e2 = gf(), f4 = gf(); for (let i2 = 0; i2 < 31; i2++) { - z2[i2] = n2[i2]; + z2[i2] = n3[i2]; } - z2[31] = n2[31] & 127 | 64; + z2[31] = n3[31] & 127 | 64; z2[0] &= 248; unpack25519(x2, p3); for (let i2 = 0; i2 < 16; i2++) { b3[i2] = x2[i2]; } - a3[0] = d2[0] = 1; + a3[0] = d3[0] = 1; for (let i2 = 254; i2 >= 0; --i2) { - const r = z2[i2 >>> 3] >>> (i2 & 7) & 1; - sel25519(a3, b3, r); - sel25519(c2, d2, r); - add(e, a3, c2); + const r2 = z2[i2 >>> 3] >>> (i2 & 7) & 1; + sel25519(a3, b3, r2); + sel25519(c2, d3, r2); + add(e2, a3, c2); sub(a3, a3, c2); - add(c2, b3, d2); - sub(b3, b3, d2); - square(d2, e); - square(f3, a3); + add(c2, b3, d3); + sub(b3, b3, d3); + square(d3, e2); + square(f4, a3); mul(a3, c2, a3); - mul(c2, b3, e); - add(e, a3, c2); + mul(c2, b3, e2); + add(e2, a3, c2); sub(a3, a3, c2); square(b3, a3); - sub(c2, d2, f3); + sub(c2, d3, f4); mul(a3, c2, _121665); - add(a3, a3, d2); + add(a3, a3, d3); mul(c2, c2, a3); - mul(a3, d2, f3); - mul(d2, b3, x2); - square(b3, e); - sel25519(a3, b3, r); - sel25519(c2, d2, r); + mul(a3, d3, f4); + mul(d3, b3, x2); + square(b3, e2); + sel25519(a3, b3, r2); + sel25519(c2, d3, r2); } for (let i2 = 0; i2 < 16; i2++) { x2[i2 + 16] = a3[i2]; x2[i2 + 32] = c2[i2]; x2[i2 + 48] = b3[i2]; - x2[i2 + 64] = d2[i2]; + x2[i2 + 64] = d3[i2]; } const x32 = x2.subarray(32); const x16 = x2.subarray(16); @@ -2259,8 +2259,8 @@ var x25519 = {}; return q2; } exports.scalarMult = scalarMult; - function scalarMultBase(n2) { - return scalarMult(n2, _9); + function scalarMultBase(n3) { + return scalarMult(n3, _9); } exports.scalarMultBase = scalarMultBase; function generateKeyPairFromSeed(seed) { @@ -2460,13 +2460,13 @@ function base(ALPHABET, name) { } var src = base; var _brrp__multiformats_scope_baseX = src; -const coerce = (o) => { - if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") - return o; - if (o instanceof ArrayBuffer) - return new Uint8Array(o); - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); +const coerce = (o2) => { + if (o2 instanceof Uint8Array && o2.constructor.name === "Uint8Array") + return o2; + if (o2 instanceof ArrayBuffer) + return new Uint8Array(o2); + if (ArrayBuffer.isView(o2)) { + return new Uint8Array(o2.buffer, o2.byteOffset, o2.byteLength); } throw new Error("Unknown type, must be binary type"); }; @@ -3388,7 +3388,7 @@ function getWindowMetadata() { try { doc = window_getters_1.getDocumentOrThrow(); loc = window_getters_1.getLocationOrThrow(); - } catch (e) { + } catch (e2) { return null; } function getIcons() { @@ -3911,103 +3911,103 @@ var filterObj = function(obj, predicate) { })(queryString); const C = { waku: { publish: "waku_publish", batchPublish: "waku_batchPublish", subscribe: "waku_subscribe", batchSubscribe: "waku_batchSubscribe", subscription: "waku_subscription", unsubscribe: "waku_unsubscribe", batchUnsubscribe: "waku_batchUnsubscribe", batchFetchMessages: "waku_batchFetchMessages" }, irn: { publish: "irn_publish", batchPublish: "irn_batchPublish", subscribe: "irn_subscribe", batchSubscribe: "irn_batchSubscribe", subscription: "irn_subscription", unsubscribe: "irn_unsubscribe", batchUnsubscribe: "irn_batchUnsubscribe", batchFetchMessages: "irn_batchFetchMessages" }, iridium: { publish: "iridium_publish", batchPublish: "iridium_batchPublish", subscribe: "iridium_subscribe", batchSubscribe: "iridium_batchSubscribe", subscription: "iridium_subscription", unsubscribe: "iridium_unsubscribe", batchUnsubscribe: "iridium_batchUnsubscribe", batchFetchMessages: "iridium_batchFetchMessages" } }; const K$1 = ":"; -function ve(e) { - const [n2, t] = e.split(K$1); - return { namespace: n2, reference: t }; +function ve(e2) { + const [n3, t] = e2.split(K$1); + return { namespace: n3, reference: t }; } -function Un(e, n2 = []) { +function Un(e2, n3 = []) { const t = []; - return Object.keys(e).forEach((r) => { - if (n2.length && !n2.includes(r)) + return Object.keys(e2).forEach((r2) => { + if (n3.length && !n3.includes(r2)) return; - const o = e[r]; - t.push(...o.accounts); + const o2 = e2[r2]; + t.push(...o2.accounts); }), t; } -function L$2(e, n2) { - return e.includes(":") ? [e] : n2.chains || []; +function L$3(e2, n3) { + return e2.includes(":") ? [e2] : n3.chains || []; } -const J$1 = "base10", p$3 = "base16", F$2 = "base64pad", H$1 = "utf8", Q$3 = 0, _$3 = 1, Dn = 0, Te = 1, Z$1 = 12, X$1 = 32; +const J$1 = "base10", p$4 = "base16", F$2 = "base64pad", H$1 = "utf8", Q$3 = 0, _$3 = 1, Dn = 0, Te = 1, Z$1 = 12, X$1 = 32; function kn() { - const e = x25519.generateKeyPair(); - return { privateKey: toString(e.secretKey, p$3), publicKey: toString(e.publicKey, p$3) }; + const e2 = x25519.generateKeyPair(); + return { privateKey: toString(e2.secretKey, p$4), publicKey: toString(e2.publicKey, p$4) }; } function Vn$1() { - const e = random.randomBytes(X$1); - return toString(e, p$3); + const e2 = random.randomBytes(X$1); + return toString(e2, p$4); } -function Mn(e, n2) { - const t = x25519.sharedKey(fromString(e, p$3), fromString(n2, p$3), true), r = new HKDF_1(sha256.SHA256, t).expand(X$1); - return toString(r, p$3); +function Mn(e2, n3) { + const t = x25519.sharedKey(fromString(e2, p$4), fromString(n3, p$4), true), r2 = new HKDF_1(sha256.SHA256, t).expand(X$1); + return toString(r2, p$4); } -function Kn(e) { - const n2 = sha256.hash(fromString(e, p$3)); - return toString(n2, p$3); +function Kn(e2) { + const n3 = sha256.hash(fromString(e2, p$4)); + return toString(n3, p$4); } -function Ln(e) { - const n2 = sha256.hash(fromString(e, H$1)); - return toString(n2, p$3); +function Ln(e2) { + const n3 = sha256.hash(fromString(e2, H$1)); + return toString(n3, p$4); } -function Pe(e) { - return fromString(`${e}`, J$1); +function Pe(e2) { + return fromString(`${e2}`, J$1); } -function j$2(e) { - return Number(toString(e, J$1)); +function j$3(e2) { + return Number(toString(e2, J$1)); } -function xn(e) { - const n2 = Pe(typeof e.type < "u" ? e.type : Q$3); - if (j$2(n2) === _$3 && typeof e.senderPublicKey > "u") +function xn(e2) { + const n3 = Pe(typeof e2.type < "u" ? e2.type : Q$3); + if (j$3(n3) === _$3 && typeof e2.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope"); - const t = typeof e.senderPublicKey < "u" ? fromString(e.senderPublicKey, p$3) : void 0, r = typeof e.iv < "u" ? fromString(e.iv, p$3) : random.randomBytes(Z$1), o = new chacha20poly1305.ChaCha20Poly1305(fromString(e.symKey, p$3)).seal(r, fromString(e.message, H$1)); - return Re({ type: n2, sealed: o, iv: r, senderPublicKey: t }); + const t = typeof e2.senderPublicKey < "u" ? fromString(e2.senderPublicKey, p$4) : void 0, r2 = typeof e2.iv < "u" ? fromString(e2.iv, p$4) : random.randomBytes(Z$1), o2 = new chacha20poly1305.ChaCha20Poly1305(fromString(e2.symKey, p$4)).seal(r2, fromString(e2.message, H$1)); + return Re({ type: n3, sealed: o2, iv: r2, senderPublicKey: t }); } -function Fn(e) { - const n2 = new chacha20poly1305.ChaCha20Poly1305(fromString(e.symKey, p$3)), { sealed: t, iv: r } = ee$1(e.encoded), o = n2.open(r, t); - if (o === null) +function Fn(e2) { + const n3 = new chacha20poly1305.ChaCha20Poly1305(fromString(e2.symKey, p$4)), { sealed: t, iv: r2 } = ee$1(e2.encoded), o2 = n3.open(r2, t); + if (o2 === null) throw new Error("Failed to decrypt"); - return toString(o, H$1); + return toString(o2, H$1); } -function Re(e) { - if (j$2(e.type) === _$3) { - if (typeof e.senderPublicKey > "u") +function Re(e2) { + if (j$3(e2.type) === _$3) { + if (typeof e2.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope"); - return toString(concat([e.type, e.senderPublicKey, e.iv, e.sealed]), F$2); + return toString(concat([e2.type, e2.senderPublicKey, e2.iv, e2.sealed]), F$2); } - return toString(concat([e.type, e.iv, e.sealed]), F$2); + return toString(concat([e2.type, e2.iv, e2.sealed]), F$2); } -function ee$1(e) { - const n2 = fromString(e, F$2), t = n2.slice(Dn, Te), r = Te; - if (j$2(t) === _$3) { - const d2 = r + X$1, l2 = d2 + Z$1, c2 = n2.slice(r, d2), u3 = n2.slice(d2, l2), a3 = n2.slice(l2); +function ee$1(e2) { + const n3 = fromString(e2, F$2), t = n3.slice(Dn, Te), r2 = Te; + if (j$3(t) === _$3) { + const d3 = r2 + X$1, l2 = d3 + Z$1, c2 = n3.slice(r2, d3), u3 = n3.slice(d3, l2), a3 = n3.slice(l2); return { type: t, sealed: a3, iv: u3, senderPublicKey: c2 }; } - const o = r + Z$1, s = n2.slice(r, o), i2 = n2.slice(o); + const o2 = r2 + Z$1, s = n3.slice(r2, o2), i2 = n3.slice(o2); return { type: t, sealed: i2, iv: s }; } -function Hn(e, n2) { - const t = ee$1(e); - return Ae({ type: j$2(t.type), senderPublicKey: typeof t.senderPublicKey < "u" ? toString(t.senderPublicKey, p$3) : void 0, receiverPublicKey: n2 == null ? void 0 : n2.receiverPublicKey }); +function Hn(e2, n3) { + const t = ee$1(e2); + return Ae({ type: j$3(t.type), senderPublicKey: typeof t.senderPublicKey < "u" ? toString(t.senderPublicKey, p$4) : void 0, receiverPublicKey: n3 == null ? void 0 : n3.receiverPublicKey }); } -function Ae(e) { - const n2 = (e == null ? void 0 : e.type) || Q$3; - if (n2 === _$3) { - if (typeof (e == null ? void 0 : e.senderPublicKey) > "u") +function Ae(e2) { + const n3 = (e2 == null ? void 0 : e2.type) || Q$3; + if (n3 === _$3) { + if (typeof (e2 == null ? void 0 : e2.senderPublicKey) > "u") throw new Error("missing sender public key"); - if (typeof (e == null ? void 0 : e.receiverPublicKey) > "u") + if (typeof (e2 == null ? void 0 : e2.receiverPublicKey) > "u") throw new Error("missing receiver public key"); } - return { type: n2, senderPublicKey: e == null ? void 0 : e.senderPublicKey, receiverPublicKey: e == null ? void 0 : e.receiverPublicKey }; + return { type: n3, senderPublicKey: e2 == null ? void 0 : e2.senderPublicKey, receiverPublicKey: e2 == null ? void 0 : e2.receiverPublicKey }; } -function qn(e) { - return e.type === _$3 && typeof e.senderPublicKey == "string" && typeof e.receiverPublicKey == "string"; +function qn(e2) { + return e2.type === _$3 && typeof e2.senderPublicKey == "string" && typeof e2.receiverPublicKey == "string"; } -var Bn = Object.defineProperty, Ue$1 = Object.getOwnPropertySymbols, Gn = Object.prototype.hasOwnProperty, Wn = Object.prototype.propertyIsEnumerable, _e = (e, n2, t) => n2 in e ? Bn(e, n2, { enumerable: true, configurable: true, writable: true, value: t }) : e[n2] = t, $e$1 = (e, n2) => { - for (var t in n2 || (n2 = {})) - Gn.call(n2, t) && _e(e, t, n2[t]); +var Bn = Object.defineProperty, Ue$1 = Object.getOwnPropertySymbols, Gn = Object.prototype.hasOwnProperty, Wn = Object.prototype.propertyIsEnumerable, _e = (e2, n3, t) => n3 in e2 ? Bn(e2, n3, { enumerable: true, configurable: true, writable: true, value: t }) : e2[n3] = t, $e$1 = (e2, n3) => { + for (var t in n3 || (n3 = {})) + Gn.call(n3, t) && _e(e2, t, n3[t]); if (Ue$1) - for (var t of Ue$1(n2)) - Wn.call(n2, t) && _e(e, t, n2[t]); - return e; + for (var t of Ue$1(n3)) + Wn.call(n3, t) && _e(e2, t, n3[t]); + return e2; }; const Ce = "ReactNative", m$1 = { reactNative: "react-native", node: "node", browser: "browser", unknown: "unknown" }, De$1 = "js"; function te$1() { @@ -4023,449 +4023,449 @@ function R$2() { return $$2() ? m$1.reactNative : te$1() ? m$1.node : D$4() ? m$1.browser : m$1.unknown; } function Jn() { - var e; + var e2; try { - return $$2() && typeof global < "u" && typeof (global == null ? void 0 : global.Application) < "u" ? (e = global.Application) == null ? void 0 : e.applicationId : void 0; + return $$2() && typeof global < "u" && typeof (global == null ? void 0 : global.Application) < "u" ? (e2 = global.Application) == null ? void 0 : e2.applicationId : void 0; } catch { return; } } -function ke$1(e, n2) { - let t = queryString.parse(e); - return t = $e$1($e$1({}, t), n2), e = queryString.stringify(t), e; +function ke$1(e2, n3) { + let t = queryString.parse(e2); + return t = $e$1($e$1({}, t), n3), e2 = queryString.stringify(t), e2; } function Qn() { return getWindowMetadata_1() || { name: "", description: "", url: "", icons: [""] }; } function Ve$1() { if (R$2() === m$1.reactNative && typeof global < "u" && typeof (global == null ? void 0 : global.Platform) < "u") { - const { OS: t, Version: r } = global.Platform; - return [t, r].join("-"); + const { OS: t, Version: r2 } = global.Platform; + return [t, r2].join("-"); } - const e = detect(); - if (e === null) + const e2 = detect(); + if (e2 === null) return "unknown"; - const n2 = e.os ? e.os.replace(" ", "").toLowerCase() : "unknown"; - return e.type === "browser" ? [n2, e.name, e.version].join("-") : [n2, e.version].join("-"); + const n3 = e2.os ? e2.os.replace(" ", "").toLowerCase() : "unknown"; + return e2.type === "browser" ? [n3, e2.name, e2.version].join("-") : [n3, e2.version].join("-"); } function Me$1() { - var e; - const n2 = R$2(); - return n2 === m$1.browser ? [n2, ((e = getLocation_1()) == null ? void 0 : e.host) || "unknown"].join(":") : n2; + var e2; + const n3 = R$2(); + return n3 === m$1.browser ? [n3, ((e2 = getLocation_1()) == null ? void 0 : e2.host) || "unknown"].join(":") : n3; } -function Ke$1(e, n2, t) { - const r = Ve$1(), o = Me$1(); - return [[e, n2].join("-"), [De$1, t].join("-"), r, o].join("/"); +function Ke$1(e2, n3, t) { + const r2 = Ve$1(), o2 = Me$1(); + return [[e2, n3].join("-"), [De$1, t].join("-"), r2, o2].join("/"); } -function Xn({ protocol: e, version: n2, relayUrl: t, sdkVersion: r, auth: o, projectId: s, useOnCloseEvent: i2, bundleId: d2 }) { - const l2 = t.split("?"), c2 = Ke$1(e, n2, r), u3 = { auth: o, ua: c2, projectId: s, useOnCloseEvent: i2 || void 0, origin: d2 || void 0 }, a3 = ke$1(l2[1] || "", u3); +function Xn({ protocol: e2, version: n3, relayUrl: t, sdkVersion: r2, auth: o2, projectId: s, useOnCloseEvent: i2, bundleId: d3 }) { + const l2 = t.split("?"), c2 = Ke$1(e2, n3, r2), u3 = { auth: o2, ua: c2, projectId: s, useOnCloseEvent: i2 || void 0, origin: d3 || void 0 }, a3 = ke$1(l2[1] || "", u3); return l2[0] + "?" + a3; } -function O$3(e, n2) { - return e.filter((t) => n2.includes(t)).length === e.length; +function O$4(e2, n3) { + return e2.filter((t) => n3.includes(t)).length === e2.length; } -function rt$1(e) { - return Object.fromEntries(e.entries()); +function rt$1(e2) { + return Object.fromEntries(e2.entries()); } -function ot$1(e) { - return new Map(Object.entries(e)); +function ot$1(e2) { + return new Map(Object.entries(e2)); } -function at$1(e = cjs$4.FIVE_MINUTES, n2) { - const t = cjs$4.toMiliseconds(e || cjs$4.FIVE_MINUTES); - let r, o, s; +function at$1(e2 = cjs$4.FIVE_MINUTES, n3) { + const t = cjs$4.toMiliseconds(e2 || cjs$4.FIVE_MINUTES); + let r2, o2, s; return { resolve: (i2) => { - s && r && (clearTimeout(s), r(i2)); + s && r2 && (clearTimeout(s), r2(i2)); }, reject: (i2) => { - s && o && (clearTimeout(s), o(i2)); - }, done: () => new Promise((i2, d2) => { + s && o2 && (clearTimeout(s), o2(i2)); + }, done: () => new Promise((i2, d3) => { s = setTimeout(() => { - d2(new Error(n2)); - }, t), r = i2, o = d2; + d3(new Error(n3)); + }, t), r2 = i2, o2 = d3; }) }; } -function ut$1(e, n2, t) { - return new Promise(async (r, o) => { - const s = setTimeout(() => o(new Error(t)), n2); +function ut$1(e2, n3, t) { + return new Promise(async (r2, o2) => { + const s = setTimeout(() => o2(new Error(t)), n3); try { - const i2 = await e; - r(i2); + const i2 = await e2; + r2(i2); } catch (i2) { - o(i2); + o2(i2); } clearTimeout(s); }); } -function re(e, n2) { - if (typeof n2 == "string" && n2.startsWith(`${e}:`)) - return n2; - if (e.toLowerCase() === "topic") { - if (typeof n2 != "string") +function re(e2, n3) { + if (typeof n3 == "string" && n3.startsWith(`${e2}:`)) + return n3; + if (e2.toLowerCase() === "topic") { + if (typeof n3 != "string") throw new Error('Value must be "string" for expirer target type: topic'); - return `topic:${n2}`; - } else if (e.toLowerCase() === "id") { - if (typeof n2 != "number") + return `topic:${n3}`; + } else if (e2.toLowerCase() === "id") { + if (typeof n3 != "number") throw new Error('Value must be "number" for expirer target type: id'); - return `id:${n2}`; + return `id:${n3}`; } - throw new Error(`Unknown expirer target type: ${e}`); + throw new Error(`Unknown expirer target type: ${e2}`); } -function lt$1(e) { - return re("topic", e); +function lt$1(e2) { + return re("topic", e2); } -function dt$1(e) { - return re("id", e); +function dt$1(e2) { + return re("id", e2); } -function ft$2(e) { - const [n2, t] = e.split(":"), r = { id: void 0, topic: void 0 }; - if (n2 === "topic" && typeof t == "string") - r.topic = t; - else if (n2 === "id" && Number.isInteger(Number(t))) - r.id = Number(t); +function ft$2(e2) { + const [n3, t] = e2.split(":"), r2 = { id: void 0, topic: void 0 }; + if (n3 === "topic" && typeof t == "string") + r2.topic = t; + else if (n3 === "id" && Number.isInteger(Number(t))) + r2.id = Number(t); else - throw new Error(`Invalid target, expected id:number or topic:string, got ${n2}:${t}`); - return r; + throw new Error(`Invalid target, expected id:number or topic:string, got ${n3}:${t}`); + return r2; } -function pt$1(e, n2) { - return cjs$4.fromMiliseconds(Date.now() + cjs$4.toMiliseconds(e)); +function pt$1(e2, n3) { + return cjs$4.fromMiliseconds(Date.now() + cjs$4.toMiliseconds(e2)); } -function mt$1(e) { - return Date.now() >= cjs$4.toMiliseconds(e); +function mt$1(e2) { + return Date.now() >= cjs$4.toMiliseconds(e2); } -function yt$1(e, n2) { - return `${e}${n2 ? `:${n2}` : ""}`; +function yt$1(e2, n3) { + return `${e2}${n3 ? `:${n3}` : ""}`; } -function S$3(e = [], n2 = []) { - return [.../* @__PURE__ */ new Set([...e, ...n2])]; +function S$3(e2 = [], n3 = []) { + return [.../* @__PURE__ */ new Set([...e2, ...n3])]; } -async function gt$1({ id: e, topic: n2, wcDeepLink: t }) { +async function gt$1({ id: e2, topic: n3, wcDeepLink: t }) { try { if (!t) return; - const r = typeof t == "string" ? JSON.parse(t) : t; - let o = r == null ? void 0 : r.href; - if (typeof o != "string") + const r2 = typeof t == "string" ? JSON.parse(t) : t; + let o2 = r2 == null ? void 0 : r2.href; + if (typeof o2 != "string") return; - o.endsWith("/") && (o = o.slice(0, -1)); - const s = `${o}/wc?requestId=${e}&sessionTopic=${n2}`, i2 = R$2(); + o2.endsWith("/") && (o2 = o2.slice(0, -1)); + const s = `${o2}/wc?requestId=${e2}&sessionTopic=${n3}`, i2 = R$2(); i2 === m$1.browser ? s.startsWith("https://") ? window.open(s, "_blank", "noreferrer noopener") : window.open(s, "_self", "noreferrer noopener") : i2 === m$1.reactNative && typeof (global == null ? void 0 : global.Linking) < "u" && await global.Linking.openURL(s); - } catch (r) { - console.error(r); + } catch (r2) { + console.error(r2); } } -async function ht$1(e, n2) { +async function ht$1(e2, n3) { try { - return await e.getItem(n2) || (D$4() ? localStorage.getItem(n2) : void 0); + return await e2.getItem(n3) || (D$4() ? localStorage.getItem(n3) : void 0); } catch (t) { console.error(t); } } const He$1 = "irn"; -function vt$1(e) { - return (e == null ? void 0 : e.relay) || { protocol: He$1 }; -} -function Et$1(e) { - const n2 = C[e]; - if (typeof n2 > "u") - throw new Error(`Relay Protocol not supported: ${e}`); - return n2; -} -var bt$1 = Object.defineProperty, Nt$1 = Object.defineProperties, Ot$1 = Object.getOwnPropertyDescriptors, qe$1 = Object.getOwnPropertySymbols, St$1 = Object.prototype.hasOwnProperty, wt$1 = Object.prototype.propertyIsEnumerable, Be$1 = (e, n2, t) => n2 in e ? bt$1(e, n2, { enumerable: true, configurable: true, writable: true, value: t }) : e[n2] = t, It$1 = (e, n2) => { - for (var t in n2 || (n2 = {})) - St$1.call(n2, t) && Be$1(e, t, n2[t]); +function vt$1(e2) { + return (e2 == null ? void 0 : e2.relay) || { protocol: He$1 }; +} +function Et$1(e2) { + const n3 = C[e2]; + if (typeof n3 > "u") + throw new Error(`Relay Protocol not supported: ${e2}`); + return n3; +} +var bt$1 = Object.defineProperty, Nt$1 = Object.defineProperties, Ot$1 = Object.getOwnPropertyDescriptors, qe$1 = Object.getOwnPropertySymbols, St$1 = Object.prototype.hasOwnProperty, wt$1 = Object.prototype.propertyIsEnumerable, Be$1 = (e2, n3, t) => n3 in e2 ? bt$1(e2, n3, { enumerable: true, configurable: true, writable: true, value: t }) : e2[n3] = t, It$1 = (e2, n3) => { + for (var t in n3 || (n3 = {})) + St$1.call(n3, t) && Be$1(e2, t, n3[t]); if (qe$1) - for (var t of qe$1(n2)) - wt$1.call(n2, t) && Be$1(e, t, n2[t]); - return e; -}, Tt$1 = (e, n2) => Nt$1(e, Ot$1(n2)); -function Ge$1(e, n2 = "-") { - const t = {}, r = "relay" + n2; - return Object.keys(e).forEach((o) => { - if (o.startsWith(r)) { - const s = o.replace(r, ""), i2 = e[o]; + for (var t of qe$1(n3)) + wt$1.call(n3, t) && Be$1(e2, t, n3[t]); + return e2; +}, Tt$1 = (e2, n3) => Nt$1(e2, Ot$1(n3)); +function Ge$1(e2, n3 = "-") { + const t = {}, r2 = "relay" + n3; + return Object.keys(e2).forEach((o2) => { + if (o2.startsWith(r2)) { + const s = o2.replace(r2, ""), i2 = e2[o2]; t[s] = i2; } }), t; } -function Pt$1(e) { - e = e.includes("wc://") ? e.replace("wc://", "") : e, e = e.includes("wc:") ? e.replace("wc:", "") : e; - const n2 = e.indexOf(":"), t = e.indexOf("?") !== -1 ? e.indexOf("?") : void 0, r = e.substring(0, n2), o = e.substring(n2 + 1, t).split("@"), s = typeof t < "u" ? e.substring(t) : "", i2 = queryString.parse(s); - return { protocol: r, topic: We$1(o[0]), version: parseInt(o[1], 10), symKey: i2.symKey, relay: Ge$1(i2), expiryTimestamp: i2.expiryTimestamp ? parseInt(i2.expiryTimestamp, 10) : void 0 }; -} -function We$1(e) { - return e.startsWith("//") ? e.substring(2) : e; -} -function ze(e, n2 = "-") { - const t = "relay", r = {}; - return Object.keys(e).forEach((o) => { - const s = t + n2 + o; - e[o] && (r[s] = e[o]); - }), r; -} -function Rt$1(e) { - return `${e.protocol}:${e.topic}@${e.version}?` + queryString.stringify(Tt$1(It$1({ symKey: e.symKey }, ze(e.relay)), { expiryTimestamp: e.expiryTimestamp })); -} -function A(e) { - const n2 = []; - return e.forEach((t) => { - const [r, o] = t.split(":"); - n2.push(`${r}:${o}`); - }), n2; -} -function Qe$1(e) { - const n2 = []; - return Object.values(e).forEach((t) => { - n2.push(...A(t.accounts)); - }), n2; -} -function Ze$1(e, n2) { +function Pt$1(e2) { + e2 = e2.includes("wc://") ? e2.replace("wc://", "") : e2, e2 = e2.includes("wc:") ? e2.replace("wc:", "") : e2; + const n3 = e2.indexOf(":"), t = e2.indexOf("?") !== -1 ? e2.indexOf("?") : void 0, r2 = e2.substring(0, n3), o2 = e2.substring(n3 + 1, t).split("@"), s = typeof t < "u" ? e2.substring(t) : "", i2 = queryString.parse(s); + return { protocol: r2, topic: We$1(o2[0]), version: parseInt(o2[1], 10), symKey: i2.symKey, relay: Ge$1(i2), expiryTimestamp: i2.expiryTimestamp ? parseInt(i2.expiryTimestamp, 10) : void 0 }; +} +function We$1(e2) { + return e2.startsWith("//") ? e2.substring(2) : e2; +} +function ze(e2, n3 = "-") { + const t = "relay", r2 = {}; + return Object.keys(e2).forEach((o2) => { + const s = t + n3 + o2; + e2[o2] && (r2[s] = e2[o2]); + }), r2; +} +function Rt$1(e2) { + return `${e2.protocol}:${e2.topic}@${e2.version}?` + queryString.stringify(Tt$1(It$1({ symKey: e2.symKey }, ze(e2.relay)), { expiryTimestamp: e2.expiryTimestamp })); +} +function A(e2) { + const n3 = []; + return e2.forEach((t) => { + const [r2, o2] = t.split(":"); + n3.push(`${r2}:${o2}`); + }), n3; +} +function Qe$1(e2) { + const n3 = []; + return Object.values(e2).forEach((t) => { + n3.push(...A(t.accounts)); + }), n3; +} +function Ze$1(e2, n3) { const t = []; - return Object.values(e).forEach((r) => { - A(r.accounts).includes(n2) && t.push(...r.methods); + return Object.values(e2).forEach((r2) => { + A(r2.accounts).includes(n3) && t.push(...r2.methods); }), t; } -function Xe$1(e, n2) { +function Xe$1(e2, n3) { const t = []; - return Object.values(e).forEach((r) => { - A(r.accounts).includes(n2) && t.push(...r.events); + return Object.values(e2).forEach((r2) => { + A(r2.accounts).includes(n3) && t.push(...r2.events); }), t; } -function oe$1(e) { - return e.includes(":"); +function oe$1(e2) { + return e2.includes(":"); } -function en(e) { - return oe$1(e) ? e.split(":")[0] : e; +function en(e2) { + return oe$1(e2) ? e2.split(":")[0] : e2; } const nn = { INVALID_METHOD: { message: "Invalid method.", code: 1001 }, INVALID_EVENT: { message: "Invalid event.", code: 1002 }, INVALID_UPDATE_REQUEST: { message: "Invalid update request.", code: 1003 }, INVALID_EXTEND_REQUEST: { message: "Invalid extend request.", code: 1004 }, INVALID_SESSION_SETTLE_REQUEST: { message: "Invalid session settle request.", code: 1005 }, UNAUTHORIZED_METHOD: { message: "Unauthorized method.", code: 3001 }, UNAUTHORIZED_EVENT: { message: "Unauthorized event.", code: 3002 }, UNAUTHORIZED_UPDATE_REQUEST: { message: "Unauthorized update request.", code: 3003 }, UNAUTHORIZED_EXTEND_REQUEST: { message: "Unauthorized extend request.", code: 3004 }, USER_REJECTED: { message: "User rejected.", code: 5e3 }, USER_REJECTED_CHAINS: { message: "User rejected chains.", code: 5001 }, USER_REJECTED_METHODS: { message: "User rejected methods.", code: 5002 }, USER_REJECTED_EVENTS: { message: "User rejected events.", code: 5003 }, UNSUPPORTED_CHAINS: { message: "Unsupported chains.", code: 5100 }, UNSUPPORTED_METHODS: { message: "Unsupported methods.", code: 5101 }, UNSUPPORTED_EVENTS: { message: "Unsupported events.", code: 5102 }, UNSUPPORTED_ACCOUNTS: { message: "Unsupported accounts.", code: 5103 }, UNSUPPORTED_NAMESPACE_KEY: { message: "Unsupported namespace key.", code: 5104 }, USER_DISCONNECTED: { message: "User disconnected.", code: 6e3 }, SESSION_SETTLEMENT_FAILED: { message: "Session settlement failed.", code: 7e3 }, WC_METHOD_UNSUPPORTED: { message: "Unsupported wc_ method.", code: 10001 } }, tn = { NOT_INITIALIZED: { message: "Not initialized.", code: 1 }, NO_MATCHING_KEY: { message: "No matching key.", code: 2 }, RESTORE_WILL_OVERRIDE: { message: "Restore will override.", code: 3 }, RESUBSCRIBED: { message: "Resubscribed.", code: 4 }, MISSING_OR_INVALID: { message: "Missing or invalid.", code: 5 }, EXPIRED: { message: "Expired.", code: 6 }, UNKNOWN_TYPE: { message: "Unknown type.", code: 7 }, MISMATCHED_TOPIC: { message: "Mismatched topic.", code: 8 }, NON_CONFORMING_NAMESPACES: { message: "Non conforming namespaces.", code: 9 } }; -function N$2(e, n2) { - const { message: t, code: r } = tn[e]; - return { message: n2 ? `${t} ${n2}` : t, code: r }; +function N$2(e2, n3) { + const { message: t, code: r2 } = tn[e2]; + return { message: n3 ? `${t} ${n3}` : t, code: r2 }; } -function U$2(e, n2) { - const { message: t, code: r } = nn[e]; - return { message: n2 ? `${t} ${n2}` : t, code: r }; +function U$2(e2, n3) { + const { message: t, code: r2 } = nn[e2]; + return { message: n3 ? `${t} ${n3}` : t, code: r2 }; } -function k$2(e, n2) { - return Array.isArray(e) ? true : false; +function k$2(e2, n3) { + return Array.isArray(e2) ? true : false; } -function B$1(e) { - return Object.getPrototypeOf(e) === Object.prototype && Object.keys(e).length; +function B$1(e2) { + return Object.getPrototypeOf(e2) === Object.prototype && Object.keys(e2).length; } -function w$4(e) { - return typeof e > "u"; +function w$5(e2) { + return typeof e2 > "u"; } -function g$5(e, n2) { - return n2 && w$4(e) ? true : typeof e == "string" && !!e.trim().length; +function g$6(e2, n3) { + return n3 && w$5(e2) ? true : typeof e2 == "string" && !!e2.trim().length; } -function G$2(e, n2) { - return typeof e == "number" && !isNaN(e); +function G$2(e2, n3) { + return typeof e2 == "number" && !isNaN(e2); } -function Mt$1(e, n2) { - const { requiredNamespaces: t } = n2, r = Object.keys(e.namespaces), o = Object.keys(t); +function Mt$1(e2, n3) { + const { requiredNamespaces: t } = n3, r2 = Object.keys(e2.namespaces), o2 = Object.keys(t); let s = true; - return O$3(o, r) ? (r.forEach((i2) => { - const { accounts: d2, methods: l2, events: c2 } = e.namespaces[i2], u3 = A(d2), a3 = t[i2]; - (!O$3(L$2(i2, a3), u3) || !O$3(a3.methods, l2) || !O$3(a3.events, c2)) && (s = false); + return O$4(o2, r2) ? (r2.forEach((i2) => { + const { accounts: d3, methods: l2, events: c2 } = e2.namespaces[i2], u3 = A(d3), a3 = t[i2]; + (!O$4(L$3(i2, a3), u3) || !O$4(a3.methods, l2) || !O$4(a3.events, c2)) && (s = false); }), s) : false; } -function V$1(e) { - return g$5(e, false) && e.includes(":") ? e.split(":").length === 2 : false; +function V$1(e2) { + return g$6(e2, false) && e2.includes(":") ? e2.split(":").length === 2 : false; } -function rn(e) { - if (g$5(e, false) && e.includes(":")) { - const n2 = e.split(":"); - if (n2.length === 3) { - const t = n2[0] + ":" + n2[1]; - return !!n2[2] && V$1(t); +function rn(e2) { + if (g$6(e2, false) && e2.includes(":")) { + const n3 = e2.split(":"); + if (n3.length === 3) { + const t = n3[0] + ":" + n3[1]; + return !!n3[2] && V$1(t); } } return false; } -function Kt$1(e) { - if (g$5(e, false)) +function Kt$1(e2) { + if (g$6(e2, false)) try { - return typeof new URL(e) < "u"; + return typeof new URL(e2) < "u"; } catch { return false; } return false; } -function Lt$1(e) { - var n2; - return (n2 = e == null ? void 0 : e.proposer) == null ? void 0 : n2.publicKey; +function Lt$1(e2) { + var n3; + return (n3 = e2 == null ? void 0 : e2.proposer) == null ? void 0 : n3.publicKey; } -function xt$1(e) { - return e == null ? void 0 : e.topic; +function xt$1(e2) { + return e2 == null ? void 0 : e2.topic; } -function Ft$1(e, n2) { +function Ft$1(e2, n3) { let t = null; - return g$5(e == null ? void 0 : e.publicKey, false) || (t = N$2("MISSING_OR_INVALID", `${n2} controller public key should be a string`)), t; -} -function ie(e) { - let n2 = true; - return k$2(e) ? e.length && (n2 = e.every((t) => g$5(t, false))) : n2 = false, n2; -} -function on(e, n2, t) { - let r = null; - return k$2(n2) && n2.length ? n2.forEach((o) => { - r || V$1(o) || (r = U$2("UNSUPPORTED_CHAINS", `${t}, chain ${o} should be a string and conform to "namespace:chainId" format`)); - }) : V$1(e) || (r = U$2("UNSUPPORTED_CHAINS", `${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)), r; -} -function sn(e, n2, t) { - let r = null; - return Object.entries(e).forEach(([o, s]) => { - if (r) + return g$6(e2 == null ? void 0 : e2.publicKey, false) || (t = N$2("MISSING_OR_INVALID", `${n3} controller public key should be a string`)), t; +} +function ie(e2) { + let n3 = true; + return k$2(e2) ? e2.length && (n3 = e2.every((t) => g$6(t, false))) : n3 = false, n3; +} +function on(e2, n3, t) { + let r2 = null; + return k$2(n3) && n3.length ? n3.forEach((o2) => { + r2 || V$1(o2) || (r2 = U$2("UNSUPPORTED_CHAINS", `${t}, chain ${o2} should be a string and conform to "namespace:chainId" format`)); + }) : V$1(e2) || (r2 = U$2("UNSUPPORTED_CHAINS", `${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)), r2; +} +function sn(e2, n3, t) { + let r2 = null; + return Object.entries(e2).forEach(([o2, s]) => { + if (r2) return; - const i2 = on(o, L$2(o, s), `${n2} ${t}`); - i2 && (r = i2); - }), r; + const i2 = on(o2, L$3(o2, s), `${n3} ${t}`); + i2 && (r2 = i2); + }), r2; } -function cn(e, n2) { +function cn(e2, n3) { let t = null; - return k$2(e) ? e.forEach((r) => { - t || rn(r) || (t = U$2("UNSUPPORTED_ACCOUNTS", `${n2}, account ${r} should be a string and conform to "namespace:chainId:address" format`)); - }) : t = U$2("UNSUPPORTED_ACCOUNTS", `${n2}, accounts should be an array of strings conforming to "namespace:chainId:address" format`), t; + return k$2(e2) ? e2.forEach((r2) => { + t || rn(r2) || (t = U$2("UNSUPPORTED_ACCOUNTS", `${n3}, account ${r2} should be a string and conform to "namespace:chainId:address" format`)); + }) : t = U$2("UNSUPPORTED_ACCOUNTS", `${n3}, accounts should be an array of strings conforming to "namespace:chainId:address" format`), t; } -function an(e, n2) { +function an(e2, n3) { let t = null; - return Object.values(e).forEach((r) => { + return Object.values(e2).forEach((r2) => { if (t) return; - const o = cn(r == null ? void 0 : r.accounts, `${n2} namespace`); - o && (t = o); + const o2 = cn(r2 == null ? void 0 : r2.accounts, `${n3} namespace`); + o2 && (t = o2); }), t; } -function un(e, n2) { +function un(e2, n3) { let t = null; - return ie(e == null ? void 0 : e.methods) ? ie(e == null ? void 0 : e.events) || (t = U$2("UNSUPPORTED_EVENTS", `${n2}, events should be an array of strings or empty array for no events`)) : t = U$2("UNSUPPORTED_METHODS", `${n2}, methods should be an array of strings or empty array for no methods`), t; + return ie(e2 == null ? void 0 : e2.methods) ? ie(e2 == null ? void 0 : e2.events) || (t = U$2("UNSUPPORTED_EVENTS", `${n3}, events should be an array of strings or empty array for no events`)) : t = U$2("UNSUPPORTED_METHODS", `${n3}, methods should be an array of strings or empty array for no methods`), t; } -function ce$2(e, n2) { +function ce$2(e2, n3) { let t = null; - return Object.values(e).forEach((r) => { + return Object.values(e2).forEach((r2) => { if (t) return; - const o = un(r, `${n2}, namespace`); - o && (t = o); + const o2 = un(r2, `${n3}, namespace`); + o2 && (t = o2); }), t; } -function Ht$1(e, n2, t) { - let r = null; - if (e && B$1(e)) { - const o = ce$2(e, n2); - o && (r = o); - const s = sn(e, n2, t); - s && (r = s); +function Ht$1(e2, n3, t) { + let r2 = null; + if (e2 && B$1(e2)) { + const o2 = ce$2(e2, n3); + o2 && (r2 = o2); + const s = sn(e2, n3, t); + s && (r2 = s); } else - r = N$2("MISSING_OR_INVALID", `${n2}, ${t} should be an object with data`); - return r; + r2 = N$2("MISSING_OR_INVALID", `${n3}, ${t} should be an object with data`); + return r2; } -function ln(e, n2) { +function ln(e2, n3) { let t = null; - if (e && B$1(e)) { - const r = ce$2(e, n2); - r && (t = r); - const o = an(e, n2); - o && (t = o); + if (e2 && B$1(e2)) { + const r2 = ce$2(e2, n3); + r2 && (t = r2); + const o2 = an(e2, n3); + o2 && (t = o2); } else - t = N$2("MISSING_OR_INVALID", `${n2}, namespaces should be an object with data`); + t = N$2("MISSING_OR_INVALID", `${n3}, namespaces should be an object with data`); return t; } -function dn(e) { - return g$5(e.protocol, true); +function dn(e2) { + return g$6(e2.protocol, true); } -function qt$1(e, n2) { +function qt$1(e2, n3) { let t = false; - return !e ? t = true : e && k$2(e) && e.length && e.forEach((r) => { - t = dn(r); + return !e2 ? t = true : e2 && k$2(e2) && e2.length && e2.forEach((r2) => { + t = dn(r2); }), t; } -function Bt$1(e) { - return typeof e == "number"; +function Bt$1(e2) { + return typeof e2 == "number"; } -function Gt$1(e) { - return typeof e < "u" && typeof e !== null; +function Gt$1(e2) { + return typeof e2 < "u" && typeof e2 !== null; } -function Wt(e) { - return !(!e || typeof e != "object" || !e.code || !G$2(e.code) || !e.message || !g$5(e.message, false)); +function Wt(e2) { + return !(!e2 || typeof e2 != "object" || !e2.code || !G$2(e2.code) || !e2.message || !g$6(e2.message, false)); } -function zt$1(e) { - return !(w$4(e) || !g$5(e.method, false)); +function zt$1(e2) { + return !(w$5(e2) || !g$6(e2.method, false)); } -function Yt$1(e) { - return !(w$4(e) || w$4(e.result) && w$4(e.error) || !G$2(e.id) || !g$5(e.jsonrpc, false)); +function Yt$1(e2) { + return !(w$5(e2) || w$5(e2.result) && w$5(e2.error) || !G$2(e2.id) || !g$6(e2.jsonrpc, false)); } -function Jt$1(e) { - return !(w$4(e) || !g$5(e.name, false)); +function Jt$1(e2) { + return !(w$5(e2) || !g$6(e2.name, false)); } -function Qt(e, n2) { - return !(!V$1(n2) || !Qe$1(e).includes(n2)); +function Qt(e2, n3) { + return !(!V$1(n3) || !Qe$1(e2).includes(n3)); } -function Zt(e, n2, t) { - return g$5(t, false) ? Ze$1(e, n2).includes(t) : false; +function Zt(e2, n3, t) { + return g$6(t, false) ? Ze$1(e2, n3).includes(t) : false; } -function Xt(e, n2, t) { - return g$5(t, false) ? Xe$1(e, n2).includes(t) : false; +function Xt(e2, n3, t) { + return g$6(t, false) ? Xe$1(e2, n3).includes(t) : false; } -function fn(e, n2, t) { - let r = null; - const o = er$1(e), s = nr$1(n2), i2 = Object.keys(o), d2 = Object.keys(s), l2 = pn(Object.keys(e)), c2 = pn(Object.keys(n2)), u3 = l2.filter((a3) => !c2.includes(a3)); - return u3.length && (r = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces keys don't satisfy requiredNamespaces. +function fn(e2, n3, t) { + let r2 = null; + const o2 = er$1(e2), s = nr$1(n3), i2 = Object.keys(o2), d3 = Object.keys(s), l2 = pn(Object.keys(e2)), c2 = pn(Object.keys(n3)), u3 = l2.filter((a3) => !c2.includes(a3)); + return u3.length && (r2 = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces keys don't satisfy requiredNamespaces. Required: ${u3.toString()} - Received: ${Object.keys(n2).toString()}`)), O$3(i2, d2) || (r = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces chains don't satisfy required namespaces. + Received: ${Object.keys(n3).toString()}`)), O$4(i2, d3) || (r2 = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces chains don't satisfy required namespaces. Required: ${i2.toString()} - Approved: ${d2.toString()}`)), Object.keys(n2).forEach((a3) => { - if (!a3.includes(":") || r) + Approved: ${d3.toString()}`)), Object.keys(n3).forEach((a3) => { + if (!a3.includes(":") || r2) return; - const b3 = A(n2[a3].accounts); - b3.includes(a3) || (r = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces accounts don't satisfy namespace accounts for ${a3} + const b3 = A(n3[a3].accounts); + b3.includes(a3) || (r2 = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces accounts don't satisfy namespace accounts for ${a3} Required: ${a3} Approved: ${b3.toString()}`)); }), i2.forEach((a3) => { - r || (O$3(o[a3].methods, s[a3].methods) ? O$3(o[a3].events, s[a3].events) || (r = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces events don't satisfy namespace events for ${a3}`)) : r = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces methods don't satisfy namespace methods for ${a3}`)); - }), r; -} -function er$1(e) { - const n2 = {}; - return Object.keys(e).forEach((t) => { - var r; - t.includes(":") ? n2[t] = e[t] : (r = e[t].chains) == null || r.forEach((o) => { - n2[o] = { methods: e[t].methods, events: e[t].events }; + r2 || (O$4(o2[a3].methods, s[a3].methods) ? O$4(o2[a3].events, s[a3].events) || (r2 = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces events don't satisfy namespace events for ${a3}`)) : r2 = N$2("NON_CONFORMING_NAMESPACES", `${t} namespaces methods don't satisfy namespace methods for ${a3}`)); + }), r2; +} +function er$1(e2) { + const n3 = {}; + return Object.keys(e2).forEach((t) => { + var r2; + t.includes(":") ? n3[t] = e2[t] : (r2 = e2[t].chains) == null || r2.forEach((o2) => { + n3[o2] = { methods: e2[t].methods, events: e2[t].events }; }); - }), n2; + }), n3; } -function pn(e) { - return [...new Set(e.map((n2) => n2.includes(":") ? n2.split(":")[0] : n2))]; +function pn(e2) { + return [...new Set(e2.map((n3) => n3.includes(":") ? n3.split(":")[0] : n3))]; } -function nr$1(e) { - const n2 = {}; - return Object.keys(e).forEach((t) => { +function nr$1(e2) { + const n3 = {}; + return Object.keys(e2).forEach((t) => { if (t.includes(":")) - n2[t] = e[t]; + n3[t] = e2[t]; else { - const r = A(e[t].accounts); - r == null ? void 0 : r.forEach((o) => { - n2[o] = { accounts: e[t].accounts.filter((s) => s.includes(`${o}:`)), methods: e[t].methods, events: e[t].events }; + const r2 = A(e2[t].accounts); + r2 == null ? void 0 : r2.forEach((o2) => { + n3[o2] = { accounts: e2[t].accounts.filter((s) => s.includes(`${o2}:`)), methods: e2[t].methods, events: e2[t].events }; }); } - }), n2; + }), n3; } -function tr$1(e, n2) { - return G$2(e) && e <= n2.max && e >= n2.min; +function tr$1(e2, n3) { + return G$2(e2) && e2 <= n3.max && e2 >= n3.min; } function rr$1() { - const e = R$2(); - return new Promise((n2) => { - switch (e) { + const e2 = R$2(); + return new Promise((n3) => { + switch (e2) { case m$1.browser: - n2(mn()); + n3(mn()); break; case m$1.reactNative: - n2(yn()); + n3(yn()); break; case m$1.node: - n2(gn()); + n3(gn()); break; default: - n2(true); + n3(true); } }); } @@ -4474,41 +4474,41 @@ function mn() { } async function yn() { if ($$2() && typeof global < "u" && global != null && global.NetInfo) { - const e = await (global == null ? void 0 : global.NetInfo.fetch()); - return e == null ? void 0 : e.isConnected; + const e2 = await (global == null ? void 0 : global.NetInfo.fetch()); + return e2 == null ? void 0 : e2.isConnected; } return true; } function gn() { return true; } -function or$1(e) { +function or$1(e2) { switch (R$2()) { case m$1.browser: - hn(e); + hn(e2); break; case m$1.reactNative: - vn(e); + vn(e2); break; } } -function hn(e) { - !$$2() && D$4() && (window.addEventListener("online", () => e(true)), window.addEventListener("offline", () => e(false))); +function hn(e2) { + !$$2() && D$4() && (window.addEventListener("online", () => e2(true)), window.addEventListener("offline", () => e2(false))); } -function vn(e) { +function vn(e2) { var _a; - $$2() && typeof global < "u" && global != null && global.NetInfo && ((_a = global) == null ? void 0 : _a.NetInfo.addEventListener((n2) => e(n2 == null ? void 0 : n2.isConnected))); + $$2() && typeof global < "u" && global != null && global.NetInfo && ((_a = global) == null ? void 0 : _a.NetInfo.addEventListener((n3) => e2(n3 == null ? void 0 : n3.isConnected))); } const ae$1 = {}; let sr$1 = class sr { - static get(n2) { - return ae$1[n2]; + static get(n3) { + return ae$1[n3]; } - static set(n2, t) { - ae$1[n2] = t; + static set(n3, t) { + ae$1[n3] = t; } - static delete(n2) { - delete ae$1[n2]; + static delete(n3) { + delete ae$1[n3]; } }; const suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/; @@ -4781,7 +4781,7 @@ function createStorage(options = {}) { }); } return Promise.all([...batches.values()].map((batch) => cb(batch))).then( - (r) => r.flat() + (r2) => r2.flat() ); }; const storage = { @@ -4809,7 +4809,7 @@ function createStorage(options = {}) { })), commonOptions ).then( - (r) => r.map((item) => ({ + (r2) => r2.map((item) => ({ key: joinKeys(batch.base, item.key), value: destr(item.value) })) @@ -5154,26 +5154,26 @@ function safeJsonStringify(value) { } const x$1 = "idb-keyval"; var z$2 = (i2 = {}) => { - const t = i2.base && i2.base.length > 0 ? `${i2.base}:` : "", e = (s) => t + s; - let n2; - return i2.dbName && i2.storeName && (n2 = createStore(i2.dbName, i2.storeName)), { name: x$1, options: i2, async hasItem(s) { - return !(typeof await get(e(s), n2) > "u"); + const t = i2.base && i2.base.length > 0 ? `${i2.base}:` : "", e2 = (s) => t + s; + let n3; + return i2.dbName && i2.storeName && (n3 = createStore(i2.dbName, i2.storeName)), { name: x$1, options: i2, async hasItem(s) { + return !(typeof await get(e2(s), n3) > "u"); }, async getItem(s) { - return await get(e(s), n2) ?? null; + return await get(e2(s), n3) ?? null; }, setItem(s, a3) { - return set$1(e(s), a3, n2); + return set$1(e2(s), a3, n3); }, removeItem(s) { - return del(e(s), n2); + return del(e2(s), n3); }, getKeys() { - return keys(n2); + return keys(n3); }, clear() { - return clear(n2); + return clear(n3); } }; }; -const D$3 = "WALLET_CONNECT_V2_INDEXED_DB", E$3 = "keyvaluestorage"; +const D$3 = "WALLET_CONNECT_V2_INDEXED_DB", E$4 = "keyvaluestorage"; let _$2 = class _ { constructor() { - this.indexedDb = createStorage({ driver: z$2({ dbName: D$3, storeName: E$3 }) }); + this.indexedDb = createStorage({ driver: z$2({ dbName: D$3, storeName: E$4 }) }); } async getKeys() { return this.indexedDb.getKeys(); @@ -5182,38 +5182,38 @@ let _$2 = class _ { return (await this.indexedDb.getItems(await this.indexedDb.getKeys())).map((t) => [t.key, t.value]); } async getItem(t) { - const e = await this.indexedDb.getItem(t); - if (e !== null) - return e; + const e2 = await this.indexedDb.getItem(t); + if (e2 !== null) + return e2; } - async setItem(t, e) { - await this.indexedDb.setItem(t, safeJsonStringify(e)); + async setItem(t, e2) { + await this.indexedDb.setItem(t, safeJsonStringify(e2)); } async removeItem(t) { await this.indexedDb.removeItem(t); } }; -var l = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, c$1 = { exports: {} }; +var l$1 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, c$2 = { exports: {} }; (function() { let i2; function t() { } - i2 = t, i2.prototype.getItem = function(e) { - return this.hasOwnProperty(e) ? String(this[e]) : null; - }, i2.prototype.setItem = function(e, n2) { - this[e] = String(n2); - }, i2.prototype.removeItem = function(e) { - delete this[e]; + i2 = t, i2.prototype.getItem = function(e2) { + return this.hasOwnProperty(e2) ? String(this[e2]) : null; + }, i2.prototype.setItem = function(e2, n3) { + this[e2] = String(n3); + }, i2.prototype.removeItem = function(e2) { + delete this[e2]; }, i2.prototype.clear = function() { - const e = this; - Object.keys(e).forEach(function(n2) { - e[n2] = void 0, delete e[n2]; + const e2 = this; + Object.keys(e2).forEach(function(n3) { + e2[n3] = void 0, delete e2[n3]; }); - }, i2.prototype.key = function(e) { - return e = e || 0, Object.keys(this)[e]; + }, i2.prototype.key = function(e2) { + return e2 = e2 || 0, Object.keys(this)[e2]; }, i2.prototype.__defineGetter__("length", function() { return Object.keys(this).length; - }), typeof l < "u" && l.localStorage ? c$1.exports = l.localStorage : typeof window < "u" && window.localStorage ? c$1.exports = window.localStorage : c$1.exports = new t(); + }), typeof l$1 < "u" && l$1.localStorage ? c$2.exports = l$1.localStorage : typeof window < "u" && window.localStorage ? c$2.exports = window.localStorage : c$2.exports = new t(); })(); function k$1(i2) { var t; @@ -5221,7 +5221,7 @@ function k$1(i2) { } class K { constructor() { - this.localStorage = c$1.exports; + this.localStorage = c$2.exports; } async getKeys() { return Object.keys(this.localStorage); @@ -5230,55 +5230,55 @@ class K { return Object.entries(this.localStorage).map(k$1); } async getItem(t) { - const e = this.localStorage.getItem(t); - if (e !== null) - return safeJsonParse(e); + const e2 = this.localStorage.getItem(t); + if (e2 !== null) + return safeJsonParse(e2); } - async setItem(t, e) { - this.localStorage.setItem(t, safeJsonStringify(e)); + async setItem(t, e2) { + this.localStorage.setItem(t, safeJsonStringify(e2)); } async removeItem(t) { this.localStorage.removeItem(t); } } -const N$1 = "wc_storage_version", y$3 = 1, O$2 = async (i2, t, e) => { - const n2 = N$1, s = await t.getItem(n2); +const N$1 = "wc_storage_version", y$3 = 1, O$3 = async (i2, t, e2) => { + const n3 = N$1, s = await t.getItem(n3); if (s && s >= y$3) { - e(t); + e2(t); return; } const a3 = await i2.getKeys(); if (!a3.length) { - e(t); + e2(t); return; } const m2 = []; for (; a3.length; ) { - const r = a3.shift(); - if (!r) + const r2 = a3.shift(); + if (!r2) continue; - const o = r.toLowerCase(); - if (o.includes("wc@") || o.includes("walletconnect") || o.includes("wc_") || o.includes("wallet_connect")) { - const f3 = await i2.getItem(r); - await t.setItem(r, f3), m2.push(r); + const o2 = r2.toLowerCase(); + if (o2.includes("wc@") || o2.includes("walletconnect") || o2.includes("wc_") || o2.includes("wallet_connect")) { + const f4 = await i2.getItem(r2); + await t.setItem(r2, f4), m2.push(r2); } } - await t.setItem(n2, y$3), e(t), j$1(i2, m2); -}, j$1 = async (i2, t) => { - t.length && t.forEach(async (e) => { - await i2.removeItem(e); + await t.setItem(n3, y$3), e2(t), j$2(i2, m2); +}, j$2 = async (i2, t) => { + t.length && t.forEach(async (e2) => { + await i2.removeItem(e2); }); }; let h$2 = class h { constructor() { - this.initialized = false, this.setInitialized = (e) => { - this.storage = e, this.initialized = true; + this.initialized = false, this.setInitialized = (e2) => { + this.storage = e2, this.initialized = true; }; const t = new K(); this.storage = t; try { - const e = new _$2(); - O$2(t, e, this.setInitialized); + const e2 = new _$2(); + O$3(t, e2, this.setInitialized); } catch { this.initialized = true; } @@ -5292,16 +5292,16 @@ let h$2 = class h { async getItem(t) { return await this.initialize(), this.storage.getItem(t); } - async setItem(t, e) { - return await this.initialize(), this.storage.setItem(t, e); + async setItem(t, e2) { + return await this.initialize(), this.storage.setItem(t, e2); } async removeItem(t) { return await this.initialize(), this.storage.removeItem(t); } async initialize() { this.initialized || await new Promise((t) => { - const e = setInterval(() => { - this.initialized && (clearInterval(e), t()); + const e2 = setInterval(() => { + this.initialized && (clearInterval(e2), t()); }, 20); }); } @@ -5310,11 +5310,11 @@ var cjs$1 = {}; var heartbeat$2 = {}; var types = {}; var heartbeat$1 = {}; -let IEvents$1 = class IEvents { -}; +class IEvents { +} const esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, - IEvents: IEvents$1 + IEvents }, Symbol.toStringTag, { value: "Module" })); const require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(esm); var hasRequiredHeartbeat$2; @@ -5438,42 +5438,42 @@ function requireHeartbeat() { tslib_1.__exportStar(requireTypes(), exports); tslib_1.__exportStar(requireConstants(), exports); })(cjs$1); -function tryStringify(o) { +function tryStringify(o2) { try { - return JSON.stringify(o); - } catch (e) { + return JSON.stringify(o2); + } catch (e2) { return '"[Circular]"'; } } var quickFormatUnescaped = format$1; -function format$1(f3, args, opts) { +function format$1(f4, args, opts) { var ss2 = opts && opts.stringify || tryStringify; var offset = 1; - if (typeof f3 === "object" && f3 !== null) { + if (typeof f4 === "object" && f4 !== null) { var len = args.length + offset; if (len === 1) - return f3; + return f4; var objects = new Array(len); - objects[0] = ss2(f3); + objects[0] = ss2(f4); for (var index = 1; index < len; index++) { objects[index] = ss2(args[index]); } return objects.join(" "); } - if (typeof f3 !== "string") { - return f3; + if (typeof f4 !== "string") { + return f4; } var argLen = args.length; if (argLen === 0) - return f3; + return f4; var str = ""; var a3 = 1 - offset; var lastPos = -1; - var flen = f3 && f3.length || 0; + var flen = f4 && f4.length || 0; for (var i2 = 0; i2 < flen; ) { - if (f3.charCodeAt(i2) === 37 && i2 + 1 < flen) { + if (f4.charCodeAt(i2) === 37 && i2 + 1 < flen) { lastPos = lastPos > -1 ? lastPos : 0; - switch (f3.charCodeAt(i2 + 1)) { + switch (f4.charCodeAt(i2 + 1)) { case 100: case 102: if (a3 >= argLen) @@ -5481,7 +5481,7 @@ function format$1(f3, args, opts) { if (args[a3] == null) break; if (lastPos < i2) - str += f3.slice(lastPos, i2); + str += f4.slice(lastPos, i2); str += Number(args[a3]); lastPos = i2 + 2; i2++; @@ -5492,7 +5492,7 @@ function format$1(f3, args, opts) { if (args[a3] == null) break; if (lastPos < i2) - str += f3.slice(lastPos, i2); + str += f4.slice(lastPos, i2); str += Math.floor(Number(args[a3])); lastPos = i2 + 2; i2++; @@ -5505,7 +5505,7 @@ function format$1(f3, args, opts) { if (args[a3] === void 0) break; if (lastPos < i2) - str += f3.slice(lastPos, i2); + str += f4.slice(lastPos, i2); var type = typeof args[a3]; if (type === "string") { str += "'" + args[a3] + "'"; @@ -5527,14 +5527,14 @@ function format$1(f3, args, opts) { if (a3 >= argLen) break; if (lastPos < i2) - str += f3.slice(lastPos, i2); + str += f4.slice(lastPos, i2); str += String(args[a3]); lastPos = i2 + 2; i2++; break; case 37: if (lastPos < i2) - str += f3.slice(lastPos, i2); + str += f4.slice(lastPos, i2); str += "%"; lastPos = i2 + 2; i2++; @@ -5546,9 +5546,9 @@ function format$1(f3, args, opts) { ++i2; } if (lastPos === -1) - return f3; + return f4; else if (lastPos < flen) { - str += f3.slice(lastPos); + str += f4.slice(lastPos); } return str; } @@ -5746,24 +5746,24 @@ function asObject(logger, level, args, ts2) { applySerializers(args, logger._serialize, logger.serializers, logger._stdErrSerialize); const argsCloned = args.slice(); let msg = argsCloned[0]; - const o = {}; + const o2 = {}; if (ts2) { - o.time = ts2; + o2.time = ts2; } - o.level = pino.levels.values[level]; + o2.level = pino.levels.values[level]; let lvl = (logger._childLevel | 0) + 1; if (lvl < 1) lvl = 1; if (msg !== null && typeof msg === "object") { while (lvl-- && typeof argsCloned[0] === "object") { - Object.assign(o, argsCloned.shift()); + Object.assign(o2, argsCloned.shift()); } msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : void 0; } else if (typeof msg === "string") msg = format(argsCloned.shift(), argsCloned); if (msg !== void 0) - o.msg = msg; - return o; + o2.msg = msg; + return o2; } function applySerializers(args, serialize, serializers, stdErrSerialize) { for (const i2 in args) { @@ -5861,8 +5861,8 @@ function isoTime() { return new Date(Date.now()).toISOString(); } function pfGlobalThisOrFallback() { - function defd(o) { - return typeof o !== "undefined" && o; + function defd(o2) { + return typeof o2 !== "undefined" && o2; } try { if (typeof globalThis !== "undefined") @@ -5875,47 +5875,47 @@ function pfGlobalThisOrFallback() { configurable: true }); return globalThis; - } catch (e) { + } catch (e2) { return defd(self) || defd(window) || defd(this) || {}; } } const Hg = /* @__PURE__ */ getDefaultExportFromCjs(browser$1); -const c = { level: "info" }, n$1 = "custom_context"; -var x = Object.defineProperty, S$2 = Object.defineProperties, _$1 = Object.getOwnPropertyDescriptors, p$2 = Object.getOwnPropertySymbols, T = Object.prototype.hasOwnProperty, z$1 = Object.prototype.propertyIsEnumerable, f$2 = (r, e, t) => e in r ? x(r, e, { enumerable: true, configurable: true, writable: true, value: t }) : r[e] = t, i = (r, e) => { - for (var t in e || (e = {})) - T.call(e, t) && f$2(r, t, e[t]); - if (p$2) - for (var t of p$2(e)) - z$1.call(e, t) && f$2(r, t, e[t]); - return r; -}, g$4 = (r, e) => S$2(r, _$1(e)); -function k(r) { - return g$4(i({}, r), { level: (r == null ? void 0 : r.level) || c.level }); -} -function v$3(r, e = n$1) { - return r[e] || ""; -} -function b$2(r, e, t = n$1) { - return r[t] = e, r; -} -function y$2(r, e = n$1) { +const c$1 = { level: "info" }, n$2 = "custom_context"; +var x = Object.defineProperty, S$2 = Object.defineProperties, _$1 = Object.getOwnPropertyDescriptors, p$3 = Object.getOwnPropertySymbols, T$1 = Object.prototype.hasOwnProperty, z$1 = Object.prototype.propertyIsEnumerable, f$3 = (r2, e2, t) => e2 in r2 ? x(r2, e2, { enumerable: true, configurable: true, writable: true, value: t }) : r2[e2] = t, i = (r2, e2) => { + for (var t in e2 || (e2 = {})) + T$1.call(e2, t) && f$3(r2, t, e2[t]); + if (p$3) + for (var t of p$3(e2)) + z$1.call(e2, t) && f$3(r2, t, e2[t]); + return r2; +}, g$5 = (r2, e2) => S$2(r2, _$1(e2)); +function k(r2) { + return g$5(i({}, r2), { level: (r2 == null ? void 0 : r2.level) || c$1.level }); +} +function v$4(r2, e2 = n$2) { + return r2[e2] || ""; +} +function b$2(r2, e2, t = n$2) { + return r2[t] = e2, r2; +} +function y$2(r2, e2 = n$2) { let t = ""; - return typeof r.bindings > "u" ? t = v$3(r, e) : t = r.bindings().context || "", t; + return typeof r2.bindings > "u" ? t = v$4(r2, e2) : t = r2.bindings().context || "", t; } -function w$3(r, e, t = n$1) { - const o = y$2(r, t); - return o.trim() ? `${o}/${e}` : e; +function w$4(r2, e2, t = n$2) { + const o2 = y$2(r2, t); + return o2.trim() ? `${o2}/${e2}` : e2; } -function E$2(r, e, t = n$1) { - const o = w$3(r, e, t), a3 = r.child({ context: o }); - return b$2(a3, o, t); +function E$3(r2, e2, t = n$2) { + const o2 = w$4(r2, e2, t), a3 = r2.child({ context: o2 }); + return b$2(a3, o2, t); } -class n extends IEvents$1 { +let n$1 = class n extends IEvents { constructor(s) { super(), this.opts = s, this.protocol = "wc", this.version = 2; } -} -let h$1 = class h2 extends IEvents$1 { +}; +let h$1 = class h2 extends IEvents { constructor(s, t) { super(), this.core = s, this.logger = t, this.records = /* @__PURE__ */ new Map(); } @@ -5925,27 +5925,27 @@ let a$1 = class a { this.logger = s, this.core = t; } }; -let u$1 = class u extends IEvents$1 { +let u$1 = class u extends IEvents { constructor(s, t) { super(), this.relayer = s, this.logger = t; } }; -let g$3 = class g extends IEvents$1 { +let g$4 = class g extends IEvents { constructor(s) { super(); } }; -let p$1 = class p { - constructor(s, t, o, M2) { - this.core = s, this.logger = t, this.name = o; +let p$2 = class p { + constructor(s, t, o2, M2) { + this.core = s, this.logger = t, this.name = o2; } }; -class d extends IEvents$1 { +let d$1 = class d extends IEvents { constructor(s, t) { super(), this.relayer = s, this.logger = t; } -} -let E$1 = class E extends IEvents$1 { +}; +let E$2 = class E extends IEvents { constructor(s, t) { super(), this.core = s, this.logger = t; } @@ -5955,7 +5955,7 @@ let y$1 = class y { this.projectId = s, this.logger = t; } }; -let v$2 = class v { +let v$3 = class v { constructor(s, t) { this.projectId = s, this.logger = t; } @@ -5965,7 +5965,7 @@ let b$1 = class b { this.opts = s, this.protocol = "wc", this.version = 2; } }; -let w$2 = class w { +let w$3 = class w { constructor(s) { this.client = s; } @@ -6283,7 +6283,7 @@ var sha512 = {}; var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; var h4, l2; var th, tl; - var a3, b3, c2, d2; + var a3, b3, c2, d3; while (len >= 128) { for (var i2 = 0; i2 < 16; i2++) { var j2 = 8 * i2 + pos; @@ -6312,75 +6312,75 @@ var sha512 = {}; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); l2 = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; h4 = ah4 & ah5 ^ ~ah4 & ah6; l2 = al4 & al5 ^ ~al4 & al6; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; h4 = K2[i2 * 2]; l2 = K2[i2 * 2 + 1]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; h4 = wh[i2 % 16]; l2 = wl[i2 % 16]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - th = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + th = c2 & 65535 | d3 << 16; tl = a3 & 65535 | b3 << 16; h4 = th; l2 = tl; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); l2 = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; h4 = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; l2 = al0 & al1 ^ al0 & al2 ^ al1 & al2; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - bh7 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + bh7 = c2 & 65535 | d3 << 16; bl7 = a3 & 65535 | b3 << 16; h4 = bh3; l2 = bl3; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = th; l2 = tl; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - bh3 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + bh3 = c2 & 65535 | d3 << 16; bl3 = a3 & 65535 | b3 << 16; ah1 = bh0; ah2 = bh1; @@ -6405,13 +6405,13 @@ var sha512 = {}; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = wh[(j2 + 9) % 16]; l2 = wl[(j2 + 9) % 16]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; th = wh[(j2 + 1) % 16]; tl = wl[(j2 + 1) % 16]; h4 = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; @@ -6419,7 +6419,7 @@ var sha512 = {}; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; th = wh[(j2 + 14) % 16]; tl = wl[(j2 + 14) % 16]; h4 = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; @@ -6427,11 +6427,11 @@ var sha512 = {}; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - wh[j2] = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + wh[j2] = c2 & 65535 | d3 << 16; wl[j2] = a3 & 65535 | b3 << 16; } } @@ -6441,136 +6441,136 @@ var sha512 = {}; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = hh[0]; l2 = hl[0]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - hh[0] = ah0 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + hh[0] = ah0 = c2 & 65535 | d3 << 16; hl[0] = al0 = a3 & 65535 | b3 << 16; h4 = ah1; l2 = al1; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = hh[1]; l2 = hl[1]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - hh[1] = ah1 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + hh[1] = ah1 = c2 & 65535 | d3 << 16; hl[1] = al1 = a3 & 65535 | b3 << 16; h4 = ah2; l2 = al2; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = hh[2]; l2 = hl[2]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - hh[2] = ah2 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + hh[2] = ah2 = c2 & 65535 | d3 << 16; hl[2] = al2 = a3 & 65535 | b3 << 16; h4 = ah3; l2 = al3; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = hh[3]; l2 = hl[3]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - hh[3] = ah3 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + hh[3] = ah3 = c2 & 65535 | d3 << 16; hl[3] = al3 = a3 & 65535 | b3 << 16; h4 = ah4; l2 = al4; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = hh[4]; l2 = hl[4]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - hh[4] = ah4 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + hh[4] = ah4 = c2 & 65535 | d3 << 16; hl[4] = al4 = a3 & 65535 | b3 << 16; h4 = ah5; l2 = al5; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = hh[5]; l2 = hl[5]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - hh[5] = ah5 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + hh[5] = ah5 = c2 & 65535 | d3 << 16; hl[5] = al5 = a3 & 65535 | b3 << 16; h4 = ah6; l2 = al6; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = hh[6]; l2 = hl[6]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - hh[6] = ah6 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + hh[6] = ah6 = c2 & 65535 | d3 << 16; hl[6] = al6 = a3 & 65535 | b3 << 16; h4 = ah7; l2 = al7; a3 = l2 & 65535; b3 = l2 >>> 16; c2 = h4 & 65535; - d2 = h4 >>> 16; + d3 = h4 >>> 16; h4 = hh[7]; l2 = hl[7]; a3 += l2 & 65535; b3 += l2 >>> 16; c2 += h4 & 65535; - d2 += h4 >>> 16; + d3 += h4 >>> 16; b3 += a3 >>> 16; c2 += b3 >>> 16; - d2 += c2 >>> 16; - hh[7] = ah7 = c2 & 65535 | d2 << 16; + d3 += c2 >>> 16; + hh[7] = ah7 = c2 & 65535 | d3 << 16; hl[7] = al7 = a3 & 65535 | b3 << 16; pos += 128; len -= 128; @@ -6597,13 +6597,13 @@ var sha512 = {}; exports.SECRET_KEY_LENGTH = 64; exports.SEED_LENGTH = 32; function gf(init) { - const r = new Float64Array(16); + const r2 = new Float64Array(16); if (init) { for (let i2 = 0; i2 < init.length; i2++) { - r[i2] = init[i2]; + r2[i2] = init[i2]; } } - return r; + return r2; } const _9 = new Uint8Array(32); _9[0] = 9; @@ -6699,19 +6699,19 @@ var sha512 = {}; 9344, 11139 ]); - function set25519(r, a3) { + function set25519(r2, a3) { for (let i2 = 0; i2 < 16; i2++) { - r[i2] = a3[i2] | 0; + r2[i2] = a3[i2] | 0; } } - function car25519(o) { + function car25519(o2) { let c2 = 1; for (let i2 = 0; i2 < 16; i2++) { - let v3 = o[i2] + c2 + 65535; + let v3 = o2[i2] + c2 + 65535; c2 = Math.floor(v3 / 65536); - o[i2] = v3 - c2 * 65536; + o2[i2] = v3 - c2 * 65536; } - o[0] += c2 - 1 + 37 * (c2 - 1); + o2[0] += c2 - 1 + 37 * (c2 - 1); } function sel25519(p3, q2, b3) { const c2 = ~(b3 - 1); @@ -6721,11 +6721,11 @@ var sha512 = {}; q2[i2] ^= t; } } - function pack25519(o, n2) { + function pack25519(o2, n3) { const m2 = gf(); const t = gf(); for (let i2 = 0; i2 < 16; i2++) { - t[i2] = n2[i2]; + t[i2] = n3[i2]; } car25519(t); car25519(t); @@ -6742,46 +6742,46 @@ var sha512 = {}; sel25519(t, m2, 1 - b3); } for (let i2 = 0; i2 < 16; i2++) { - o[2 * i2] = t[i2] & 255; - o[2 * i2 + 1] = t[i2] >> 8; + o2[2 * i2] = t[i2] & 255; + o2[2 * i2 + 1] = t[i2] >> 8; } } function verify32(x2, y3) { - let d2 = 0; + let d3 = 0; for (let i2 = 0; i2 < 32; i2++) { - d2 |= x2[i2] ^ y3[i2]; + d3 |= x2[i2] ^ y3[i2]; } - return (1 & d2 - 1 >>> 8) - 1; + return (1 & d3 - 1 >>> 8) - 1; } function neq25519(a3, b3) { const c2 = new Uint8Array(32); - const d2 = new Uint8Array(32); + const d3 = new Uint8Array(32); pack25519(c2, a3); - pack25519(d2, b3); - return verify32(c2, d2); + pack25519(d3, b3); + return verify32(c2, d3); } function par25519(a3) { - const d2 = new Uint8Array(32); - pack25519(d2, a3); - return d2[0] & 1; + const d3 = new Uint8Array(32); + pack25519(d3, a3); + return d3[0] & 1; } - function unpack25519(o, n2) { + function unpack25519(o2, n3) { for (let i2 = 0; i2 < 16; i2++) { - o[i2] = n2[2 * i2] + (n2[2 * i2 + 1] << 8); + o2[i2] = n3[2 * i2] + (n3[2 * i2 + 1] << 8); } - o[15] &= 32767; + o2[15] &= 32767; } - function add(o, a3, b3) { + function add(o2, a3, b3) { for (let i2 = 0; i2 < 16; i2++) { - o[i2] = a3[i2] + b3[i2]; + o2[i2] = a3[i2] + b3[i2]; } } - function sub(o, a3, b3) { + function sub(o2, a3, b3) { for (let i2 = 0; i2 < 16; i2++) { - o[i2] = a3[i2] - b3[i2]; + o2[i2] = a3[i2] - b3[i2]; } } - function mul(o, a3, b3) { + function mul(o2, a3, b3) { let v3, c2, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b3[0], b1 = b3[1], b22 = b3[2], b32 = b3[3], b4 = b3[4], b5 = b3[5], b6 = b3[6], b7 = b3[7], b8 = b3[8], b9 = b3[9], b10 = b3[10], b11 = b3[11], b12 = b3[12], b13 = b3[13], b14 = b3[14], b15 = b3[15]; v3 = a3[0]; t0 += v3 * b0; @@ -7170,27 +7170,27 @@ var sha512 = {}; c2 = Math.floor(v3 / 65536); t15 = v3 - c2 * 65536; t0 += c2 - 1 + 37 * (c2 - 1); - o[0] = t0; - o[1] = t1; - o[2] = t2; - o[3] = t3; - o[4] = t4; - o[5] = t5; - o[6] = t6; - o[7] = t7; - o[8] = t8; - o[9] = t9; - o[10] = t10; - o[11] = t11; - o[12] = t12; - o[13] = t13; - o[14] = t14; - o[15] = t15; - } - function square(o, a3) { - mul(o, a3, a3); - } - function inv25519(o, i2) { + o2[0] = t0; + o2[1] = t1; + o2[2] = t2; + o2[3] = t3; + o2[4] = t4; + o2[5] = t5; + o2[6] = t6; + o2[7] = t7; + o2[8] = t8; + o2[9] = t9; + o2[10] = t10; + o2[11] = t11; + o2[12] = t12; + o2[13] = t13; + o2[14] = t14; + o2[15] = t15; + } + function square(o2, a3) { + mul(o2, a3, a3); + } + function inv25519(o2, i2) { const c2 = gf(); let a3; for (a3 = 0; a3 < 16; a3++) { @@ -7203,10 +7203,10 @@ var sha512 = {}; } } for (a3 = 0; a3 < 16; a3++) { - o[a3] = c2[a3]; + o2[a3] = c2[a3]; } } - function pow2523(o, i2) { + function pow2523(o2, i2) { const c2 = gf(); let a3; for (a3 = 0; a3 < 16; a3++) { @@ -7219,11 +7219,11 @@ var sha512 = {}; } } for (a3 = 0; a3 < 16; a3++) { - o[a3] = c2[a3]; + o2[a3] = c2[a3]; } } function edadd(p3, q2) { - const a3 = gf(), b3 = gf(), c2 = gf(), d2 = gf(), e = gf(), f3 = gf(), g3 = gf(), h4 = gf(), t = gf(); + const a3 = gf(), b3 = gf(), c2 = gf(), d3 = gf(), e2 = gf(), f4 = gf(), g3 = gf(), h4 = gf(), t = gf(); sub(a3, p3[1], p3[0]); sub(t, q2[1], q2[0]); mul(a3, a3, t); @@ -7232,29 +7232,29 @@ var sha512 = {}; mul(b3, b3, t); mul(c2, p3[3], q2[3]); mul(c2, c2, D22); - mul(d2, p3[2], q2[2]); - add(d2, d2, d2); - sub(e, b3, a3); - sub(f3, d2, c2); - add(g3, d2, c2); + mul(d3, p3[2], q2[2]); + add(d3, d3, d3); + sub(e2, b3, a3); + sub(f4, d3, c2); + add(g3, d3, c2); add(h4, b3, a3); - mul(p3[0], e, f3); + mul(p3[0], e2, f4); mul(p3[1], h4, g3); - mul(p3[2], g3, f3); - mul(p3[3], e, h4); + mul(p3[2], g3, f4); + mul(p3[3], e2, h4); } function cswap(p3, q2, b3) { for (let i2 = 0; i2 < 4; i2++) { sel25519(p3[i2], q2[i2], b3); } } - function pack(r, p3) { + function pack(r2, p3) { const tx = gf(), ty = gf(), zi = gf(); inv25519(zi, p3[2]); mul(tx, p3[0], zi); mul(ty, p3[1], zi); - pack25519(r, ty); - r[31] ^= par25519(tx) << 7; + pack25519(r2, ty); + r2[31] ^= par25519(tx) << 7; } function scalarmult(p3, q2, s) { set25519(p3[0], gf0); @@ -7281,13 +7281,13 @@ var sha512 = {}; if (seed.length !== exports.SEED_LENGTH) { throw new Error(`ed25519: seed must be ${exports.SEED_LENGTH} bytes`); } - const d2 = (0, sha512_1.hash)(seed); - d2[0] &= 248; - d2[31] &= 127; - d2[31] |= 64; + const d3 = (0, sha512_1.hash)(seed); + d3[0] &= 248; + d3[31] &= 127; + d3[31] |= 64; const publicKey = new Uint8Array(32); const p3 = [gf(), gf(), gf(), gf()]; - scalarbase(p3, d2); + scalarbase(p3, d3); pack(publicKey, p3); const secretKey = new Uint8Array(64); secretKey.set(seed); @@ -7346,7 +7346,7 @@ var sha512 = {}; 0, 16 ]); - function modL(r, x2) { + function modL(r2, x2) { let carry; let i2; let j2; @@ -7372,35 +7372,35 @@ var sha512 = {}; } for (i2 = 0; i2 < 32; i2++) { x2[i2 + 1] += x2[i2] >> 8; - r[i2] = x2[i2] & 255; + r2[i2] = x2[i2] & 255; } } - function reduce(r) { + function reduce(r2) { const x2 = new Float64Array(64); for (let i2 = 0; i2 < 64; i2++) { - x2[i2] = r[i2]; + x2[i2] = r2[i2]; } for (let i2 = 0; i2 < 64; i2++) { - r[i2] = 0; + r2[i2] = 0; } - modL(r, x2); + modL(r2, x2); } function sign(secretKey, message) { const x2 = new Float64Array(64); const p3 = [gf(), gf(), gf(), gf()]; - const d2 = (0, sha512_1.hash)(secretKey.subarray(0, 32)); - d2[0] &= 248; - d2[31] &= 127; - d2[31] |= 64; + const d3 = (0, sha512_1.hash)(secretKey.subarray(0, 32)); + d3[0] &= 248; + d3[31] &= 127; + d3[31] |= 64; const signature = new Uint8Array(64); - signature.set(d2.subarray(32), 32); + signature.set(d3.subarray(32), 32); const hs2 = new sha512_1.SHA512(); hs2.update(signature.subarray(32)); hs2.update(message); - const r = hs2.digest(); + const r2 = hs2.digest(); hs2.clean(); - reduce(r); - scalarbase(p3, r); + reduce(r2); + scalarbase(p3, r2); pack(signature, p3); hs2.reset(); hs2.update(signature.subarray(0, 32)); @@ -7409,25 +7409,25 @@ var sha512 = {}; const h4 = hs2.digest(); reduce(h4); for (let i2 = 0; i2 < 32; i2++) { - x2[i2] = r[i2]; + x2[i2] = r2[i2]; } for (let i2 = 0; i2 < 32; i2++) { for (let j2 = 0; j2 < 32; j2++) { - x2[i2 + j2] += h4[i2] * d2[j2]; + x2[i2 + j2] += h4[i2] * d3[j2]; } } modL(signature.subarray(32), x2); return signature; } exports.sign = sign; - function unpackneg(r, p3) { + function unpackneg(r2, p3) { const t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); - set25519(r[2], gf1); - unpack25519(r[1], p3); - square(num, r[1]); + set25519(r2[2], gf1); + unpack25519(r2[1], p3); + square(num, r2[1]); mul(den, num, D2); - sub(num, num, r[2]); - add(den, r[2], den); + sub(num, num, r2[2]); + add(den, r2[2], den); square(den2, den); square(den4, den2); mul(den6, den4, den2); @@ -7437,21 +7437,21 @@ var sha512 = {}; mul(t, t, num); mul(t, t, den); mul(t, t, den); - mul(r[0], t, den); - square(chk, r[0]); + mul(r2[0], t, den); + square(chk, r2[0]); mul(chk, chk, den); if (neq25519(chk, num)) { - mul(r[0], r[0], I2); + mul(r2[0], r2[0], I2); } - square(chk, r[0]); + square(chk, r2[0]); mul(chk, chk, den); if (neq25519(chk, num)) { return -1; } - if (par25519(r[0]) === p3[31] >> 7) { - sub(r[0], gf0, r[0]); + if (par25519(r2[0]) === p3[31] >> 7) { + sub(r2[0], gf0, r2[0]); } - mul(r[3], r[0], r[1]); + mul(r2[3], r2[0], r2[1]); return 0; } function verify(publicKey, message, signature) { @@ -7498,13 +7498,13 @@ var sha512 = {}; } exports.convertPublicKeyToX25519 = convertPublicKeyToX25519; function convertSecretKeyToX25519(secretKey) { - const d2 = (0, sha512_1.hash)(secretKey.subarray(0, 32)); - d2[0] &= 248; - d2[31] &= 127; - d2[31] |= 64; - const o = new Uint8Array(d2.subarray(0, 32)); - (0, wipe_12.wipe)(d2); - return o; + const d3 = (0, sha512_1.hash)(secretKey.subarray(0, 32)); + d3[0] &= 248; + d3[31] &= 127; + d3[31] |= 64; + const o2 = new Uint8Array(d3.subarray(0, 32)); + (0, wipe_12.wipe)(d3); + return o2; } exports.convertSecretKeyToX25519 = convertSecretKeyToX25519; })(ed25519); @@ -7580,14 +7580,14 @@ function getError(type) { return STANDARD_ERROR_MAP[type]; } function getErrorByCode(code) { - const match = Object.values(STANDARD_ERROR_MAP).find((e) => e.code === code); + const match = Object.values(STANDARD_ERROR_MAP).find((e2) => e2.code === code); if (!match) { return STANDARD_ERROR_MAP[DEFAULT_ERROR]; } return match; } -function parseConnectionError(e, url, type) { - return e.message.includes("getaddrinfo ENOTFOUND") || e.message.includes("connect ECONNREFUSED") ? new Error(`Unavailable ${type} RPC url at ${url}`) : e; +function parseConnectionError(e2, url, type) { + return e2.message.includes("getaddrinfo ENOTFOUND") || e2.message.includes("connect ECONNREFUSED") ? new Error(`Unavailable ${type} RPC url at ${url}`) : e2; } var cjs = {}; var crypto$1 = {}; @@ -7683,15 +7683,15 @@ function formatErrorMessage(error, data) { } return error; } -class IEvents2 { +class e { } -class IBaseJsonRpcProvider extends IEvents2 { +class n2 extends e { constructor() { super(); } } -class IJsonRpcProvider extends IBaseJsonRpcProvider { - constructor(connection) { +class r extends n2 { + constructor(c2) { super(); } } @@ -7733,7 +7733,7 @@ function isJsonRpcResult(payload) { function isJsonRpcError(payload) { return "error" in payload; } -class JsonRpcProvider extends IJsonRpcProvider { +class JsonRpcProvider extends r { constructor(connection) { super(connection); this.events = new eventsExports.EventEmitter(); @@ -7769,8 +7769,8 @@ class JsonRpcProvider extends IJsonRpcProvider { if (!this.connection.connected) { try { await this.open(); - } catch (e) { - reject(e); + } catch (e2) { + reject(e2); } } this.events.on(`${request.id}`, (response) => { @@ -7782,8 +7782,8 @@ class JsonRpcProvider extends IJsonRpcProvider { }); try { await this.connection.send(request, context); - } catch (e) { - reject(e); + } catch (e2) { + reject(e2); } }); } @@ -7834,12 +7834,12 @@ class JsonRpcProvider extends IJsonRpcProvider { this.hasRegisteredEventListeners = true; } } -const w$1 = () => typeof WebSocket < "u" ? WebSocket : typeof global < "u" && typeof global.WebSocket < "u" ? global.WebSocket : typeof window < "u" && typeof window.WebSocket < "u" ? window.WebSocket : typeof self < "u" && typeof self.WebSocket < "u" ? self.WebSocket : require("ws"), b2 = () => typeof WebSocket < "u" || typeof global < "u" && typeof global.WebSocket < "u" || typeof window < "u" && typeof window.WebSocket < "u" || typeof self < "u" && typeof self.WebSocket < "u", a2 = (c2) => c2.split("?")[0], h3 = 10, S$1 = w$1(); -let f$1 = class f { - constructor(e) { - if (this.url = e, this.events = new eventsExports.EventEmitter(), this.registering = false, !isWsUrl(e)) - throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`); - this.url = e; +const w$2 = () => typeof WebSocket < "u" ? WebSocket : typeof global < "u" && typeof global.WebSocket < "u" ? global.WebSocket : typeof window < "u" && typeof window.WebSocket < "u" ? window.WebSocket : typeof self < "u" && typeof self.WebSocket < "u" ? self.WebSocket : require("ws"), b2 = () => typeof WebSocket < "u" || typeof global < "u" && typeof global.WebSocket < "u" || typeof window < "u" && typeof window.WebSocket < "u" || typeof self < "u" && typeof self.WebSocket < "u", a2 = (c2) => c2.split("?")[0], h3 = 10, S$1 = w$2(); +let f$2 = class f { + constructor(e2) { + if (this.url = e2, this.events = new eventsExports.EventEmitter(), this.registering = false, !isWsUrl(e2)) + throw new Error(`Provided URL is not compatible with WebSocket connection: ${e2}`); + this.url = e2; } get connected() { return typeof this.socket < "u"; @@ -7847,91 +7847,91 @@ let f$1 = class f { get connecting() { return this.registering; } - on(e, t) { - this.events.on(e, t); + on(e2, t) { + this.events.on(e2, t); } - once(e, t) { - this.events.once(e, t); + once(e2, t) { + this.events.once(e2, t); } - off(e, t) { - this.events.off(e, t); + off(e2, t) { + this.events.off(e2, t); } - removeListener(e, t) { - this.events.removeListener(e, t); + removeListener(e2, t) { + this.events.removeListener(e2, t); } - async open(e = this.url) { - await this.register(e); + async open(e2 = this.url) { + await this.register(e2); } async close() { - return new Promise((e, t) => { + return new Promise((e2, t) => { if (typeof this.socket > "u") { t(new Error("Connection already closed")); return; } - this.socket.onclose = (n2) => { - this.onClose(n2), e(); + this.socket.onclose = (n3) => { + this.onClose(n3), e2(); }, this.socket.close(); }); } - async send(e) { + async send(e2) { typeof this.socket > "u" && (this.socket = await this.register()); try { - this.socket.send(safeJsonStringify(e)); + this.socket.send(safeJsonStringify(e2)); } catch (t) { - this.onError(e.id, t); + this.onError(e2.id, t); } } - register(e = this.url) { - if (!isWsUrl(e)) - throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`); + register(e2 = this.url) { + if (!isWsUrl(e2)) + throw new Error(`Provided URL is not compatible with WebSocket connection: ${e2}`); if (this.registering) { const t = this.events.getMaxListeners(); - return (this.events.listenerCount("register_error") >= t || this.events.listenerCount("open") >= t) && this.events.setMaxListeners(t + 1), new Promise((n2, o) => { + return (this.events.listenerCount("register_error") >= t || this.events.listenerCount("open") >= t) && this.events.setMaxListeners(t + 1), new Promise((n3, o2) => { this.events.once("register_error", (s) => { - this.resetMaxListeners(), o(s); + this.resetMaxListeners(), o2(s); }), this.events.once("open", () => { if (this.resetMaxListeners(), typeof this.socket > "u") - return o(new Error("WebSocket connection is missing or invalid")); - n2(this.socket); + return o2(new Error("WebSocket connection is missing or invalid")); + n3(this.socket); }); }); } - return this.url = e, this.registering = true, new Promise((t, n2) => { - const o = new URLSearchParams(e).get("origin"), s = cjs.isReactNative() ? { headers: { origin: o } } : { rejectUnauthorized: !isLocalhostUrl(e) }, i2 = new S$1(e, [], s); - b2() ? i2.onerror = (r) => { - const l2 = r; - n2(this.emitError(l2.error)); - } : i2.on("error", (r) => { - n2(this.emitError(r)); + return this.url = e2, this.registering = true, new Promise((t, n3) => { + const o2 = new URLSearchParams(e2).get("origin"), s = cjs.isReactNative() ? { headers: { origin: o2 } } : { rejectUnauthorized: !isLocalhostUrl(e2) }, i2 = new S$1(e2, [], s); + b2() ? i2.onerror = (r2) => { + const l2 = r2; + n3(this.emitError(l2.error)); + } : i2.on("error", (r2) => { + n3(this.emitError(r2)); }), i2.onopen = () => { this.onOpen(i2), t(i2); }; }); } - onOpen(e) { - e.onmessage = (t) => this.onPayload(t), e.onclose = (t) => this.onClose(t), this.socket = e, this.registering = false, this.events.emit("open"); + onOpen(e2) { + e2.onmessage = (t) => this.onPayload(t), e2.onclose = (t) => this.onClose(t), this.socket = e2, this.registering = false, this.events.emit("open"); } - onClose(e) { - this.socket = void 0, this.registering = false, this.events.emit("close", e); + onClose(e2) { + this.socket = void 0, this.registering = false, this.events.emit("close", e2); } - onPayload(e) { - if (typeof e.data > "u") + onPayload(e2) { + if (typeof e2.data > "u") return; - const t = typeof e.data == "string" ? safeJsonParse(e.data) : e.data; + const t = typeof e2.data == "string" ? safeJsonParse(e2.data) : e2.data; this.events.emit("payload", t); } - onError(e, t) { - const n2 = this.parseError(t), o = n2.message || n2.toString(), s = formatJsonRpcError(e, o); + onError(e2, t) { + const n3 = this.parseError(t), o2 = n3.message || n3.toString(), s = formatJsonRpcError(e2, o2); this.events.emit("payload", s); } - parseError(e, t = this.url) { - return parseConnectionError(e, a2(t), "WS"); + parseError(e2, t = this.url) { + return parseConnectionError(e2, a2(t), "WS"); } resetMaxListeners() { this.events.getMaxListeners() > h3 && this.events.setMaxListeners(h3); } - emitError(e) { - const t = this.parseError(new Error((e == null ? void 0 : e.message) || `WebSocket connection failed for host: ${a2(this.url)}`)); + emitError(e2) { + const t = this.parseError(new Error((e2 == null ? void 0 : e2.message) || `WebSocket connection failed for host: ${a2(this.url)}`)); return this.events.emit("register_error", t), t; } }; @@ -7960,7 +7960,7 @@ lodash_isequal.exports; var nodeUtil = function() { try { return freeProcess && freeProcess.binding && freeProcess.binding("util"); - } catch (e) { + } catch (e2) { } }(); var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; @@ -7990,9 +7990,9 @@ lodash_isequal.exports; } return false; } - function baseTimes(n2, iteratee) { - var index = -1, result = Array(n2); - while (++index < n2) { + function baseTimes(n3, iteratee) { + var index = -1, result = Array(n3); + while (++index < n3) { result[index] = iteratee(index); } return result; @@ -8467,7 +8467,7 @@ lodash_isequal.exports; try { value[symToStringTag] = void 0; var unmasked = true; - } catch (e) { + } catch (e2) { } var result = nativeObjectToString.call(value); if (unmasked) { @@ -8531,11 +8531,11 @@ lodash_isequal.exports; if (func != null) { try { return funcToString.call(func); - } catch (e) { + } catch (e2) { } try { return func + ""; - } catch (e) { + } catch (e2) { } } return ""; @@ -8587,9 +8587,9 @@ lodash_isequal.exports; })(lodash_isequal, lodash_isequal.exports); var lodash_isequalExports = lodash_isequal.exports; const Gi = /* @__PURE__ */ getDefaultExportFromCjs(lodash_isequalExports); -function unfetch_module(e, n2) { - return n2 = n2 || {}, new Promise(function(t, r) { - var s = new XMLHttpRequest(), o = [], u3 = [], i2 = {}, a3 = function() { +function unfetch_module(e2, n3) { + return n3 = n3 || {}, new Promise(function(t, r2) { + var s = new XMLHttpRequest(), o2 = [], u3 = [], i2 = {}, a3 = function() { return { ok: 2 == (s.status / 100 | 0), statusText: s.statusText, status: s.status, url: s.responseURL, text: function() { return Promise.resolve(s.responseText); }, json: function() { @@ -8597,22 +8597,22 @@ function unfetch_module(e, n2) { }, blob: function() { return Promise.resolve(new Blob([s.response])); }, clone: a3, headers: { keys: function() { - return o; + return o2; }, entries: function() { return u3; - }, get: function(e2) { - return i2[e2.toLowerCase()]; - }, has: function(e2) { - return e2.toLowerCase() in i2; + }, get: function(e3) { + return i2[e3.toLowerCase()]; + }, has: function(e3) { + return e3.toLowerCase() in i2; } } }; }; - for (var l2 in s.open(n2.method || "get", e, true), s.onload = function() { - s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(e2, n3, t2) { - o.push(n3 = n3.toLowerCase()), u3.push([n3, t2]), i2[n3] = i2[n3] ? i2[n3] + "," + t2 : t2; + for (var l2 in s.open(n3.method || "get", e2, true), s.onload = function() { + s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(e3, n4, t2) { + o2.push(n4 = n4.toLowerCase()), u3.push([n4, t2]), i2[n4] = i2[n4] ? i2[n4] + "," + t2 : t2; }), t(a3()); - }, s.onerror = r, s.withCredentials = "include" == n2.credentials, n2.headers) - s.setRequestHeader(l2, n2.headers[l2]); - s.send(n2.body || null); + }, s.onerror = r2, s.withCredentials = "include" == n3.credentials, n3.headers) + s.setRequestHeader(l2, n3.headers[l2]); + s.send(n3.body || null); }); } const unfetch_module$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ @@ -8623,18 +8623,18 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(unfetch_module$1); var browser = self.fetch || (self.fetch = require$$0.default || require$$0); const Yi = /* @__PURE__ */ getDefaultExportFromCjs(browser); var define_process_env_default = {}; -function Hi(n2, e) { - if (n2.length >= 255) +function Hi(n3, e2) { + if (n3.length >= 255) throw new TypeError("Alphabet too long"); for (var t = new Uint8Array(256), i2 = 0; i2 < t.length; i2++) t[i2] = 255; - for (var s = 0; s < n2.length; s++) { - var r = n2.charAt(s), o = r.charCodeAt(0); - if (t[o] !== 255) - throw new TypeError(r + " is ambiguous"); - t[o] = s; + for (var s = 0; s < n3.length; s++) { + var r2 = n3.charAt(s), o2 = r2.charCodeAt(0); + if (t[o2] !== 255) + throw new TypeError(r2 + " is ambiguous"); + t[o2] = s; } - var a3 = n2.length, h4 = n2.charAt(0), l2 = Math.log(a3) / Math.log(256), d2 = Math.log(256) / Math.log(a3); + var a3 = n3.length, h4 = n3.charAt(0), l2 = Math.log(a3) / Math.log(256), d3 = Math.log(256) / Math.log(a3); function p3(u3) { if (u3 instanceof Uint8Array || (ArrayBuffer.isView(u3) ? u3 = new Uint8Array(u3.buffer, u3.byteOffset, u3.byteLength) : Array.isArray(u3) && (u3 = Uint8Array.from(u3))), !(u3 instanceof Uint8Array)) throw new TypeError("Expected Uint8Array"); @@ -8642,17 +8642,17 @@ function Hi(n2, e) { return ""; for (var m2 = 0, z2 = 0, I2 = 0, _3 = u3.length; I2 !== _3 && u3[I2] === 0; ) I2++, m2++; - for (var T2 = (_3 - I2) * d2 + 1 >>> 0, f3 = new Uint8Array(T2); I2 !== _3; ) { + for (var T2 = (_3 - I2) * d3 + 1 >>> 0, f4 = new Uint8Array(T2); I2 !== _3; ) { for (var S2 = u3[I2], A2 = 0, C2 = T2 - 1; (S2 !== 0 || A2 < z2) && C2 !== -1; C2--, A2++) - S2 += 256 * f3[C2] >>> 0, f3[C2] = S2 % a3 >>> 0, S2 = S2 / a3 >>> 0; + S2 += 256 * f4[C2] >>> 0, f4[C2] = S2 % a3 >>> 0, S2 = S2 / a3 >>> 0; if (S2 !== 0) throw new Error("Non-zero carry"); z2 = A2, I2++; } - for (var x2 = T2 - z2; x2 !== T2 && f3[x2] === 0; ) + for (var x2 = T2 - z2; x2 !== T2 && f4[x2] === 0; ) x2++; for (var j2 = h4.repeat(m2); x2 < T2; ++x2) - j2 += n2.charAt(f3[x2]); + j2 += n3.charAt(f4[x2]); return j2; } function y3(u3) { @@ -8665,12 +8665,12 @@ function Hi(n2, e) { for (var z2 = 0, I2 = 0; u3[m2] === h4; ) z2++, m2++; for (var _3 = (u3.length - m2) * l2 + 1 >>> 0, T2 = new Uint8Array(_3); u3[m2]; ) { - var f3 = t[u3.charCodeAt(m2)]; - if (f3 === 255) + var f4 = t[u3.charCodeAt(m2)]; + if (f4 === 255) return; - for (var S2 = 0, A2 = _3 - 1; (f3 !== 0 || S2 < I2) && A2 !== -1; A2--, S2++) - f3 += a3 * T2[A2] >>> 0, T2[A2] = f3 % 256 >>> 0, f3 = f3 / 256 >>> 0; - if (f3 !== 0) + for (var S2 = 0, A2 = _3 - 1; (f4 !== 0 || S2 < I2) && A2 !== -1; A2--, S2++) + f4 += a3 * T2[A2] >>> 0, T2[A2] = f4 % 256 >>> 0, f4 = f4 / 256 >>> 0; + if (f4 !== 0) throw new Error("Non-zero carry"); I2 = S2, m2++; } @@ -8687,224 +8687,224 @@ function Hi(n2, e) { var m2 = y3(u3); if (m2) return m2; - throw new Error(`Non-${e} character`); + throw new Error(`Non-${e2} character`); } return { encode: p3, decodeUnsafe: y3, decode: M2 }; } var Ji = Hi, Xi = Ji; -const Ne = (n2) => { - if (n2 instanceof Uint8Array && n2.constructor.name === "Uint8Array") - return n2; - if (n2 instanceof ArrayBuffer) - return new Uint8Array(n2); - if (ArrayBuffer.isView(n2)) - return new Uint8Array(n2.buffer, n2.byteOffset, n2.byteLength); +const Ne = (n3) => { + if (n3 instanceof Uint8Array && n3.constructor.name === "Uint8Array") + return n3; + if (n3 instanceof ArrayBuffer) + return new Uint8Array(n3); + if (ArrayBuffer.isView(n3)) + return new Uint8Array(n3.buffer, n3.byteOffset, n3.byteLength); throw new Error("Unknown type, must be binary type"); -}, Wi$1 = (n2) => new TextEncoder().encode(n2), Qi = (n2) => new TextDecoder().decode(n2); +}, Wi$1 = (n3) => new TextEncoder().encode(n3), Qi = (n3) => new TextDecoder().decode(n3); class Zi { - constructor(e, t, i2) { - this.name = e, this.prefix = t, this.baseEncode = i2; + constructor(e2, t, i2) { + this.name = e2, this.prefix = t, this.baseEncode = i2; } - encode(e) { - if (e instanceof Uint8Array) - return `${this.prefix}${this.baseEncode(e)}`; + encode(e2) { + if (e2 instanceof Uint8Array) + return `${this.prefix}${this.baseEncode(e2)}`; throw Error("Unknown type, must be binary type"); } } class es { - constructor(e, t, i2) { - if (this.name = e, this.prefix = t, t.codePointAt(0) === void 0) + constructor(e2, t, i2) { + if (this.name = e2, this.prefix = t, t.codePointAt(0) === void 0) throw new Error("Invalid prefix character"); this.prefixCodePoint = t.codePointAt(0), this.baseDecode = i2; } - decode(e) { - if (typeof e == "string") { - if (e.codePointAt(0) !== this.prefixCodePoint) - throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); - return this.baseDecode(e.slice(this.prefix.length)); + decode(e2) { + if (typeof e2 == "string") { + if (e2.codePointAt(0) !== this.prefixCodePoint) + throw Error(`Unable to decode multibase string ${JSON.stringify(e2)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + return this.baseDecode(e2.slice(this.prefix.length)); } else throw Error("Can only multibase decode strings"); } - or(e) { - return Ue(this, e); + or(e2) { + return Ue(this, e2); } } class ts { - constructor(e) { - this.decoders = e; + constructor(e2) { + this.decoders = e2; } - or(e) { - return Ue(this, e); + or(e2) { + return Ue(this, e2); } - decode(e) { - const t = e[0], i2 = this.decoders[t]; + decode(e2) { + const t = e2[0], i2 = this.decoders[t]; if (i2) - return i2.decode(e); - throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + return i2.decode(e2); + throw RangeError(`Unable to decode multibase string ${JSON.stringify(e2)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); } } -const Ue = (n2, e) => new ts({ ...n2.decoders || { [n2.prefix]: n2 }, ...e.decoders || { [e.prefix]: e } }); +const Ue = (n3, e2) => new ts({ ...n3.decoders || { [n3.prefix]: n3 }, ...e2.decoders || { [e2.prefix]: e2 } }); class is { - constructor(e, t, i2, s) { - this.name = e, this.prefix = t, this.baseEncode = i2, this.baseDecode = s, this.encoder = new Zi(e, t, i2), this.decoder = new es(e, t, s); + constructor(e2, t, i2, s) { + this.name = e2, this.prefix = t, this.baseEncode = i2, this.baseDecode = s, this.encoder = new Zi(e2, t, i2), this.decoder = new es(e2, t, s); } - encode(e) { - return this.encoder.encode(e); + encode(e2) { + return this.encoder.encode(e2); } - decode(e) { - return this.decoder.decode(e); + decode(e2) { + return this.decoder.decode(e2); } } -const W = ({ name: n2, prefix: e, encode: t, decode: i2 }) => new is(n2, e, t, i2), B = ({ prefix: n2, name: e, alphabet: t }) => { - const { encode: i2, decode: s } = Xi(t, e); - return W({ prefix: n2, name: e, encode: i2, decode: (r) => Ne(s(r)) }); -}, ss = (n2, e, t, i2) => { +const W = ({ name: n3, prefix: e2, encode: t, decode: i2 }) => new is(n3, e2, t, i2), B = ({ prefix: n3, name: e2, alphabet: t }) => { + const { encode: i2, decode: s } = Xi(t, e2); + return W({ prefix: n3, name: e2, encode: i2, decode: (r2) => Ne(s(r2)) }); +}, ss = (n3, e2, t, i2) => { const s = {}; - for (let d2 = 0; d2 < e.length; ++d2) - s[e[d2]] = d2; - let r = n2.length; - for (; n2[r - 1] === "="; ) - --r; - const o = new Uint8Array(r * t / 8 | 0); + for (let d3 = 0; d3 < e2.length; ++d3) + s[e2[d3]] = d3; + let r2 = n3.length; + for (; n3[r2 - 1] === "="; ) + --r2; + const o2 = new Uint8Array(r2 * t / 8 | 0); let a3 = 0, h4 = 0, l2 = 0; - for (let d2 = 0; d2 < r; ++d2) { - const p3 = s[n2[d2]]; + for (let d3 = 0; d3 < r2; ++d3) { + const p3 = s[n3[d3]]; if (p3 === void 0) throw new SyntaxError(`Non-${i2} character`); - h4 = h4 << t | p3, a3 += t, a3 >= 8 && (a3 -= 8, o[l2++] = 255 & h4 >> a3); + h4 = h4 << t | p3, a3 += t, a3 >= 8 && (a3 -= 8, o2[l2++] = 255 & h4 >> a3); } if (a3 >= t || 255 & h4 << 8 - a3) throw new SyntaxError("Unexpected end of data"); - return o; -}, rs = (n2, e, t) => { - const i2 = e[e.length - 1] === "=", s = (1 << t) - 1; - let r = "", o = 0, a3 = 0; - for (let h4 = 0; h4 < n2.length; ++h4) - for (a3 = a3 << 8 | n2[h4], o += 8; o > t; ) - o -= t, r += e[s & a3 >> o]; - if (o && (r += e[s & a3 << t - o]), i2) - for (; r.length * t & 7; ) - r += "="; - return r; -}, g$2 = ({ name: n2, prefix: e, bitsPerChar: t, alphabet: i2 }) => W({ prefix: e, name: n2, encode(s) { + return o2; +}, rs = (n3, e2, t) => { + const i2 = e2[e2.length - 1] === "=", s = (1 << t) - 1; + let r2 = "", o2 = 0, a3 = 0; + for (let h4 = 0; h4 < n3.length; ++h4) + for (a3 = a3 << 8 | n3[h4], o2 += 8; o2 > t; ) + o2 -= t, r2 += e2[s & a3 >> o2]; + if (o2 && (r2 += e2[s & a3 << t - o2]), i2) + for (; r2.length * t & 7; ) + r2 += "="; + return r2; +}, g$3 = ({ name: n3, prefix: e2, bitsPerChar: t, alphabet: i2 }) => W({ prefix: e2, name: n3, encode(s) { return rs(s, i2, t); }, decode(s) { - return ss(s, i2, t, n2); -} }), ns = W({ prefix: "\0", name: "identity", encode: (n2) => Qi(n2), decode: (n2) => Wi$1(n2) }); + return ss(s, i2, t, n3); +} }), ns = W({ prefix: "\0", name: "identity", encode: (n3) => Qi(n3), decode: (n3) => Wi$1(n3) }); var os = Object.freeze({ __proto__: null, identity: ns }); -const as$1 = g$2({ prefix: "0", name: "base2", alphabet: "01", bitsPerChar: 1 }); +const as$1 = g$3({ prefix: "0", name: "base2", alphabet: "01", bitsPerChar: 1 }); var hs$1 = Object.freeze({ __proto__: null, base2: as$1 }); -const cs$1 = g$2({ prefix: "7", name: "base8", alphabet: "01234567", bitsPerChar: 3 }); +const cs$1 = g$3({ prefix: "7", name: "base8", alphabet: "01234567", bitsPerChar: 3 }); var us$1 = Object.freeze({ __proto__: null, base8: cs$1 }); const ls$1 = B({ prefix: "9", name: "base10", alphabet: "0123456789" }); var ds$1 = Object.freeze({ __proto__: null, base10: ls$1 }); -const gs$1 = g$2({ prefix: "f", name: "base16", alphabet: "0123456789abcdef", bitsPerChar: 4 }), ps$1 = g$2({ prefix: "F", name: "base16upper", alphabet: "0123456789ABCDEF", bitsPerChar: 4 }); +const gs$1 = g$3({ prefix: "f", name: "base16", alphabet: "0123456789abcdef", bitsPerChar: 4 }), ps$1 = g$3({ prefix: "F", name: "base16upper", alphabet: "0123456789ABCDEF", bitsPerChar: 4 }); var Ds = Object.freeze({ __proto__: null, base16: gs$1, base16upper: ps$1 }); -const ys = g$2({ prefix: "b", name: "base32", alphabet: "abcdefghijklmnopqrstuvwxyz234567", bitsPerChar: 5 }), ms = g$2({ prefix: "B", name: "base32upper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", bitsPerChar: 5 }), bs = g$2({ prefix: "c", name: "base32pad", alphabet: "abcdefghijklmnopqrstuvwxyz234567=", bitsPerChar: 5 }), fs = g$2({ prefix: "C", name: "base32padupper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", bitsPerChar: 5 }), Es = g$2({ prefix: "v", name: "base32hex", alphabet: "0123456789abcdefghijklmnopqrstuv", bitsPerChar: 5 }), ws = g$2({ prefix: "V", name: "base32hexupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", bitsPerChar: 5 }), vs = g$2({ prefix: "t", name: "base32hexpad", alphabet: "0123456789abcdefghijklmnopqrstuv=", bitsPerChar: 5 }), Is = g$2({ prefix: "T", name: "base32hexpadupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", bitsPerChar: 5 }), Cs = g$2({ prefix: "h", name: "base32z", alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", bitsPerChar: 5 }); +const ys = g$3({ prefix: "b", name: "base32", alphabet: "abcdefghijklmnopqrstuvwxyz234567", bitsPerChar: 5 }), ms = g$3({ prefix: "B", name: "base32upper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", bitsPerChar: 5 }), bs = g$3({ prefix: "c", name: "base32pad", alphabet: "abcdefghijklmnopqrstuvwxyz234567=", bitsPerChar: 5 }), fs = g$3({ prefix: "C", name: "base32padupper", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", bitsPerChar: 5 }), Es = g$3({ prefix: "v", name: "base32hex", alphabet: "0123456789abcdefghijklmnopqrstuv", bitsPerChar: 5 }), ws = g$3({ prefix: "V", name: "base32hexupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", bitsPerChar: 5 }), vs = g$3({ prefix: "t", name: "base32hexpad", alphabet: "0123456789abcdefghijklmnopqrstuv=", bitsPerChar: 5 }), Is = g$3({ prefix: "T", name: "base32hexpadupper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", bitsPerChar: 5 }), Cs = g$3({ prefix: "h", name: "base32z", alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", bitsPerChar: 5 }); var Rs = Object.freeze({ __proto__: null, base32: ys, base32upper: ms, base32pad: bs, base32padupper: fs, base32hex: Es, base32hexupper: ws, base32hexpad: vs, base32hexpadupper: Is, base32z: Cs }); const _s = B({ prefix: "k", name: "base36", alphabet: "0123456789abcdefghijklmnopqrstuvwxyz" }), Ts = B({ prefix: "K", name: "base36upper", alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" }); var Ss = Object.freeze({ __proto__: null, base36: _s, base36upper: Ts }); const Ps = B({ name: "base58btc", prefix: "z", alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" }), xs = B({ name: "base58flickr", prefix: "Z", alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" }); var Os = Object.freeze({ __proto__: null, base58btc: Ps, base58flickr: xs }); -const As = g$2({ prefix: "m", name: "base64", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", bitsPerChar: 6 }), zs = g$2({ prefix: "M", name: "base64pad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", bitsPerChar: 6 }), Ns = g$2({ prefix: "u", name: "base64url", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", bitsPerChar: 6 }), Us = g$2({ prefix: "U", name: "base64urlpad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=", bitsPerChar: 6 }); +const As = g$3({ prefix: "m", name: "base64", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", bitsPerChar: 6 }), zs = g$3({ prefix: "M", name: "base64pad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", bitsPerChar: 6 }), Ns = g$3({ prefix: "u", name: "base64url", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", bitsPerChar: 6 }), Us = g$3({ prefix: "U", name: "base64urlpad", alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=", bitsPerChar: 6 }); var Ls = Object.freeze({ __proto__: null, base64: As, base64pad: zs, base64url: Ns, base64urlpad: Us }); -const Le = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"), $s = Le.reduce((n2, e, t) => (n2[t] = e, n2), []), Fs = Le.reduce((n2, e, t) => (n2[e.codePointAt(0)] = t, n2), []); -function Ms(n2) { - return n2.reduce((e, t) => (e += $s[t], e), ""); +const Le = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"), $s = Le.reduce((n3, e2, t) => (n3[t] = e2, n3), []), Fs = Le.reduce((n3, e2, t) => (n3[e2.codePointAt(0)] = t, n3), []); +function Ms(n3) { + return n3.reduce((e2, t) => (e2 += $s[t], e2), ""); } -function ks(n2) { - const e = []; - for (const t of n2) { +function ks(n3) { + const e2 = []; + for (const t of n3) { const i2 = Fs[t.codePointAt(0)]; if (i2 === void 0) throw new Error(`Non-base256emoji character: ${t}`); - e.push(i2); + e2.push(i2); } - return new Uint8Array(e); + return new Uint8Array(e2); } const Ks = W({ prefix: "🚀", name: "base256emoji", encode: Ms, decode: ks }); var Bs = Object.freeze({ __proto__: null, base256emoji: Ks }), Vs = Fe, $e = 128, qs = 127, js = ~qs, Gs = Math.pow(2, 31); -function Fe(n2, e, t) { - e = e || [], t = t || 0; - for (var i2 = t; n2 >= Gs; ) - e[t++] = n2 & 255 | $e, n2 /= 128; - for (; n2 & js; ) - e[t++] = n2 & 255 | $e, n2 >>>= 7; - return e[t] = n2 | 0, Fe.bytes = t - i2 + 1, e; +function Fe(n3, e2, t) { + e2 = e2 || [], t = t || 0; + for (var i2 = t; n3 >= Gs; ) + e2[t++] = n3 & 255 | $e, n3 /= 128; + for (; n3 & js; ) + e2[t++] = n3 & 255 | $e, n3 >>>= 7; + return e2[t] = n3 | 0, Fe.bytes = t - i2 + 1, e2; } var Ys = he$1, Hs = 128, Me = 127; -function he$1(n2, i2) { - var t = 0, i2 = i2 || 0, s = 0, r = i2, o, a3 = n2.length; +function he$1(n3, i2) { + var t = 0, i2 = i2 || 0, s = 0, r2 = i2, o2, a3 = n3.length; do { - if (r >= a3) + if (r2 >= a3) throw he$1.bytes = 0, new RangeError("Could not decode varint"); - o = n2[r++], t += s < 28 ? (o & Me) << s : (o & Me) * Math.pow(2, s), s += 7; - } while (o >= Hs); - return he$1.bytes = r - i2, t; + o2 = n3[r2++], t += s < 28 ? (o2 & Me) << s : (o2 & Me) * Math.pow(2, s), s += 7; + } while (o2 >= Hs); + return he$1.bytes = r2 - i2, t; } -var Js = Math.pow(2, 7), Xs = Math.pow(2, 14), Ws = Math.pow(2, 21), Qs = Math.pow(2, 28), Zs = Math.pow(2, 35), er = Math.pow(2, 42), tr = Math.pow(2, 49), ir = Math.pow(2, 56), sr2 = Math.pow(2, 63), rr = function(n2) { - return n2 < Js ? 1 : n2 < Xs ? 2 : n2 < Ws ? 3 : n2 < Qs ? 4 : n2 < Zs ? 5 : n2 < er ? 6 : n2 < tr ? 7 : n2 < ir ? 8 : n2 < sr2 ? 9 : 10; +var Js = Math.pow(2, 7), Xs = Math.pow(2, 14), Ws = Math.pow(2, 21), Qs = Math.pow(2, 28), Zs = Math.pow(2, 35), er = Math.pow(2, 42), tr = Math.pow(2, 49), ir = Math.pow(2, 56), sr2 = Math.pow(2, 63), rr = function(n3) { + return n3 < Js ? 1 : n3 < Xs ? 2 : n3 < Ws ? 3 : n3 < Qs ? 4 : n3 < Zs ? 5 : n3 < er ? 6 : n3 < tr ? 7 : n3 < ir ? 8 : n3 < sr2 ? 9 : 10; }, nr = { encode: Vs, decode: Ys, encodingLength: rr }, ke = nr; -const Ke = (n2, e, t = 0) => (ke.encode(n2, e, t), e), Be = (n2) => ke.encodingLength(n2), ce$1 = (n2, e) => { - const t = e.byteLength, i2 = Be(n2), s = i2 + Be(t), r = new Uint8Array(s + t); - return Ke(n2, r, 0), Ke(t, r, i2), r.set(e, s), new or(n2, t, e, r); +const Ke = (n3, e2, t = 0) => (ke.encode(n3, e2, t), e2), Be = (n3) => ke.encodingLength(n3), ce$1 = (n3, e2) => { + const t = e2.byteLength, i2 = Be(n3), s = i2 + Be(t), r2 = new Uint8Array(s + t); + return Ke(n3, r2, 0), Ke(t, r2, i2), r2.set(e2, s), new or(n3, t, e2, r2); }; class or { - constructor(e, t, i2, s) { - this.code = e, this.size = t, this.digest = i2, this.bytes = s; + constructor(e2, t, i2, s) { + this.code = e2, this.size = t, this.digest = i2, this.bytes = s; } } -const Ve = ({ name: n2, code: e, encode: t }) => new ar(n2, e, t); +const Ve = ({ name: n3, code: e2, encode: t }) => new ar(n3, e2, t); class ar { - constructor(e, t, i2) { - this.name = e, this.code = t, this.encode = i2; + constructor(e2, t, i2) { + this.name = e2, this.code = t, this.encode = i2; } - digest(e) { - if (e instanceof Uint8Array) { - const t = this.encode(e); + digest(e2) { + if (e2 instanceof Uint8Array) { + const t = this.encode(e2); return t instanceof Uint8Array ? ce$1(this.code, t) : t.then((i2) => ce$1(this.code, i2)); } else throw Error("Unknown type, must be binary type"); } } -const qe = (n2) => async (e) => new Uint8Array(await crypto.subtle.digest(n2, e)), hr$1 = Ve({ name: "sha2-256", code: 18, encode: qe("SHA-256") }), cr$1 = Ve({ name: "sha2-512", code: 19, encode: qe("SHA-512") }); +const qe = (n3) => async (e2) => new Uint8Array(await crypto.subtle.digest(n3, e2)), hr$1 = Ve({ name: "sha2-256", code: 18, encode: qe("SHA-256") }), cr$1 = Ve({ name: "sha2-512", code: 19, encode: qe("SHA-512") }); var ur = Object.freeze({ __proto__: null, sha256: hr$1, sha512: cr$1 }); -const je = 0, lr$1 = "identity", Ge = Ne, dr = (n2) => ce$1(je, Ge(n2)), gr = { code: je, name: lr$1, encode: Ge, digest: dr }; +const je = 0, lr$1 = "identity", Ge = Ne, dr = (n3) => ce$1(je, Ge(n3)), gr = { code: je, name: lr$1, encode: Ge, digest: dr }; var pr = Object.freeze({ __proto__: null, identity: gr }); new TextEncoder(), new TextDecoder(); const Ye = { ...os, ...hs$1, ...us$1, ...ds$1, ...Ds, ...Rs, ...Ss, ...Os, ...Ls, ...Bs }; ({ ...ur, ...pr }); -function He(n2) { - return globalThis.Buffer != null ? new Uint8Array(n2.buffer, n2.byteOffset, n2.byteLength) : n2; -} -function Dr(n2 = 0) { - return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? He(globalThis.Buffer.allocUnsafe(n2)) : new Uint8Array(n2); -} -function Je(n2, e, t, i2) { - return { name: n2, prefix: e, encoder: { name: n2, prefix: e, encode: t }, decoder: { decode: i2 } }; -} -const Xe = Je("utf8", "u", (n2) => "u" + new TextDecoder("utf8").decode(n2), (n2) => new TextEncoder().encode(n2.substring(1))), ue$1 = Je("ascii", "a", (n2) => { - let e = "a"; - for (let t = 0; t < n2.length; t++) - e += String.fromCharCode(n2[t]); - return e; -}, (n2) => { - n2 = n2.substring(1); - const e = Dr(n2.length); - for (let t = 0; t < n2.length; t++) - e[t] = n2.charCodeAt(t); - return e; +function He(n3) { + return globalThis.Buffer != null ? new Uint8Array(n3.buffer, n3.byteOffset, n3.byteLength) : n3; +} +function Dr(n3 = 0) { + return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? He(globalThis.Buffer.allocUnsafe(n3)) : new Uint8Array(n3); +} +function Je(n3, e2, t, i2) { + return { name: n3, prefix: e2, encoder: { name: n3, prefix: e2, encode: t }, decoder: { decode: i2 } }; +} +const Xe = Je("utf8", "u", (n3) => "u" + new TextDecoder("utf8").decode(n3), (n3) => new TextEncoder().encode(n3.substring(1))), ue$1 = Je("ascii", "a", (n3) => { + let e2 = "a"; + for (let t = 0; t < n3.length; t++) + e2 += String.fromCharCode(n3[t]); + return e2; +}, (n3) => { + n3 = n3.substring(1); + const e2 = Dr(n3.length); + for (let t = 0; t < n3.length; t++) + e2[t] = n3.charCodeAt(t); + return e2; }), yr = { utf8: Xe, "utf-8": Xe, hex: Ye.base16, latin1: ue$1, ascii: ue$1, binary: ue$1, ...Ye }; -function mr(n2, e = "utf8") { - const t = yr[e]; +function mr(n3, e2 = "utf8") { + const t = yr[e2]; if (!t) - throw new Error(`Unsupported encoding "${e}"`); - return (e === "utf8" || e === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? He(globalThis.Buffer.from(n2, "utf-8")) : t.decoder.decode(`${t.prefix}${n2}`); + throw new Error(`Unsupported encoding "${e2}"`); + return (e2 === "utf8" || e2 === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? He(globalThis.Buffer.from(n3, "utf-8")) : t.decoder.decode(`${t.prefix}${n3}`); } -const le$1 = "wc", We = 2, Q$2 = "core", O$1 = `${le$1}@2:${Q$2}:`, Qe = { name: Q$2, logger: "error" }, Ze = { database: ":memory:" }, et = "crypto", de$1 = "client_ed25519_seed", tt = cjs$4.ONE_DAY, it = "keychain", st = "0.3", rt = "messages", nt = "0.3", ot = cjs$4.SIX_HOURS, at = "publisher", ht = "irn", ct = "error", ge$2 = "wss://relay.walletconnect.com", pe$1 = "wss://relay.walletconnect.org", ut = "relayer", D$2 = { message: "relayer_message", message_ack: "relayer_message_ack", connect: "relayer_connect", disconnect: "relayer_disconnect", error: "relayer_error", connection_stalled: "relayer_connection_stalled", transport_closed: "relayer_transport_closed", publish: "relayer_publish" }, lt = "_subscription", P$1 = { payload: "payload", connect: "connect", disconnect: "disconnect", error: "error" }, dt = cjs$4.ONE_SECOND, gt = "2.11.2", pt = 1e4, Dt = "0.3", yt = "WALLETCONNECT_CLIENT_ID", w2 = { created: "subscription_created", deleted: "subscription_deleted", expired: "subscription_expired", disabled: "subscription_disabled", sync: "subscription_sync", resubscribed: "subscription_resubscribed" }, mt = "subscription", bt = "0.3", ft$1 = cjs$4.FIVE_SECONDS * 1e3, Et = "pairing", wt = "0.3", $$1 = { wc_pairingDelete: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1e3 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1001 } }, wc_pairingPing: { req: { ttl: cjs$4.THIRTY_SECONDS, prompt: false, tag: 1002 }, res: { ttl: cjs$4.THIRTY_SECONDS, prompt: false, tag: 1003 } }, unregistered_method: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 0 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 0 } } }, V = { create: "pairing_create", expire: "pairing_expire", delete: "pairing_delete", ping: "pairing_ping" }, R$1 = { created: "history_created", updated: "history_updated", deleted: "history_deleted", sync: "history_sync" }, vt = "history", It = "0.3", Ct$1 = "expirer", v$1 = { created: "expirer_created", deleted: "expirer_deleted", expired: "expirer_expired", sync: "expirer_sync" }, Rt = "0.3", Z = "verify-api", F$1 = "https://verify.walletconnect.com", ee = "https://verify.walletconnect.org", _t = [F$1, ee], Tt = "echo", St = "https://echo.walletconnect.com"; +const le$1 = "wc", We = 2, Q$2 = "core", O$2 = `${le$1}@2:${Q$2}:`, Qe = { name: Q$2, logger: "error" }, Ze = { database: ":memory:" }, et = "crypto", de$1 = "client_ed25519_seed", tt = cjs$4.ONE_DAY, it = "keychain", st = "0.3", rt = "messages", nt = "0.3", ot = cjs$4.SIX_HOURS, at = "publisher", ht = "irn", ct = "error", ge$2 = "wss://relay.walletconnect.com", pe$1 = "wss://relay.walletconnect.org", ut = "relayer", D$2 = { message: "relayer_message", message_ack: "relayer_message_ack", connect: "relayer_connect", disconnect: "relayer_disconnect", error: "relayer_error", connection_stalled: "relayer_connection_stalled", transport_closed: "relayer_transport_closed", publish: "relayer_publish" }, lt = "_subscription", P$2 = { payload: "payload", connect: "connect", disconnect: "disconnect", error: "error" }, dt = cjs$4.ONE_SECOND, gt = "2.11.2", pt = 1e4, Dt = "0.3", yt = "WALLETCONNECT_CLIENT_ID", w$1 = { created: "subscription_created", deleted: "subscription_deleted", expired: "subscription_expired", disabled: "subscription_disabled", sync: "subscription_sync", resubscribed: "subscription_resubscribed" }, mt = "subscription", bt = "0.3", ft$1 = cjs$4.FIVE_SECONDS * 1e3, Et = "pairing", wt = "0.3", $$1 = { wc_pairingDelete: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1e3 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1001 } }, wc_pairingPing: { req: { ttl: cjs$4.THIRTY_SECONDS, prompt: false, tag: 1002 }, res: { ttl: cjs$4.THIRTY_SECONDS, prompt: false, tag: 1003 } }, unregistered_method: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 0 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 0 } } }, V = { create: "pairing_create", expire: "pairing_expire", delete: "pairing_delete", ping: "pairing_ping" }, R$1 = { created: "history_created", updated: "history_updated", deleted: "history_deleted", sync: "history_sync" }, vt = "history", It = "0.3", Ct$1 = "expirer", v$2 = { created: "expirer_created", deleted: "expirer_deleted", expired: "expirer_expired", sync: "expirer_sync" }, Rt = "0.3", Z = "verify-api", F$1 = "https://verify.walletconnect.com", ee = "https://verify.walletconnect.org", _t = [F$1, ee], Tt = "echo", St = "https://echo.walletconnect.com"; class Pt { - constructor(e, t) { - this.core = e, this.logger = t, this.keychain = /* @__PURE__ */ new Map(), this.name = it, this.version = st, this.initialized = false, this.storagePrefix = O$1, this.init = async () => { + constructor(e2, t) { + this.core = e2, this.logger = t, this.keychain = /* @__PURE__ */ new Map(), this.name = it, this.version = st, this.initialized = false, this.storagePrefix = O$2, this.init = async () => { if (!this.initialized) { const i2 = await this.getKeyChain(); typeof i2 < "u" && (this.keychain = i2), this.initialized = true; @@ -8915,13 +8915,13 @@ class Pt { this.isInitialized(); const s = this.keychain.get(i2); if (typeof s > "u") { - const { message: r } = N$2("NO_MATCHING_KEY", `${this.name}: ${i2}`); - throw new Error(r); + const { message: r2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${i2}`); + throw new Error(r2); } return s; }, this.del = async (i2) => { this.isInitialized(), this.keychain.delete(i2), await this.persist(); - }, this.core = e, this.logger = E$2(t, this.name); + }, this.core = e2, this.logger = E$3(t, this.name); } get context() { return y$2(this.logger); @@ -8929,112 +8929,112 @@ class Pt { get storageKey() { return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; } - async setKeyChain(e) { - await this.core.storage.setItem(this.storageKey, rt$1(e)); + async setKeyChain(e2) { + await this.core.storage.setItem(this.storageKey, rt$1(e2)); } async getKeyChain() { - const e = await this.core.storage.getItem(this.storageKey); - return typeof e < "u" ? ot$1(e) : void 0; + const e2 = await this.core.storage.getItem(this.storageKey); + return typeof e2 < "u" ? ot$1(e2) : void 0; } async persist() { await this.setKeyChain(this.keychain); } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } } class xt { - constructor(e, t, i2) { - this.core = e, this.logger = t, this.name = et, this.initialized = false, this.init = async () => { + constructor(e2, t, i2) { + this.core = e2, this.logger = t, this.name = et, this.initialized = false, this.init = async () => { this.initialized || (await this.keychain.init(), this.initialized = true); }, this.hasKeys = (s) => (this.isInitialized(), this.keychain.has(s)), this.getClientId = async () => { this.isInitialized(); - const s = await this.getClientSeed(), r = generateKeyPair(s); - return encodeIss(r.publicKey); + const s = await this.getClientSeed(), r2 = generateKeyPair(s); + return encodeIss(r2.publicKey); }, this.generateKeyPair = () => { this.isInitialized(); const s = kn(); return this.setPrivateKey(s.publicKey, s.privateKey); }, this.signJWT = async (s) => { this.isInitialized(); - const r = await this.getClientSeed(), o = generateKeyPair(r), a3 = Vn$1(), h4 = tt; - return await signJWT(a3, s, h4, o); - }, this.generateSharedKey = (s, r, o) => { + const r2 = await this.getClientSeed(), o2 = generateKeyPair(r2), a3 = Vn$1(), h4 = tt; + return await signJWT(a3, s, h4, o2); + }, this.generateSharedKey = (s, r2, o2) => { this.isInitialized(); - const a3 = this.getPrivateKey(s), h4 = Mn(a3, r); - return this.setSymKey(h4, o); - }, this.setSymKey = async (s, r) => { + const a3 = this.getPrivateKey(s), h4 = Mn(a3, r2); + return this.setSymKey(h4, o2); + }, this.setSymKey = async (s, r2) => { this.isInitialized(); - const o = r || Kn(s); - return await this.keychain.set(o, s), o; + const o2 = r2 || Kn(s); + return await this.keychain.set(o2, s), o2; }, this.deleteKeyPair = async (s) => { this.isInitialized(), await this.keychain.del(s); }, this.deleteSymKey = async (s) => { this.isInitialized(), await this.keychain.del(s); - }, this.encode = async (s, r, o) => { + }, this.encode = async (s, r2, o2) => { this.isInitialized(); - const a3 = Ae(o), h4 = safeJsonStringify(r); + const a3 = Ae(o2), h4 = safeJsonStringify(r2); if (qn(a3)) { const y3 = a3.senderPublicKey, M2 = a3.receiverPublicKey; s = await this.generateSharedKey(y3, M2); } - const l2 = this.getSymKey(s), { type: d2, senderPublicKey: p3 } = a3; - return xn({ type: d2, symKey: l2, message: h4, senderPublicKey: p3 }); - }, this.decode = async (s, r, o) => { + const l2 = this.getSymKey(s), { type: d3, senderPublicKey: p3 } = a3; + return xn({ type: d3, symKey: l2, message: h4, senderPublicKey: p3 }); + }, this.decode = async (s, r2, o2) => { this.isInitialized(); - const a3 = Hn(r, o); + const a3 = Hn(r2, o2); if (qn(a3)) { const h4 = a3.receiverPublicKey, l2 = a3.senderPublicKey; s = await this.generateSharedKey(h4, l2); } try { - const h4 = this.getSymKey(s), l2 = Fn({ symKey: h4, encoded: r }); + const h4 = this.getSymKey(s), l2 = Fn({ symKey: h4, encoded: r2 }); return safeJsonParse(l2); } catch (h4) { this.logger.error(`Failed to decode message from topic: '${s}', clientId: '${await this.getClientId()}'`), this.logger.error(h4); } }, this.getPayloadType = (s) => { - const r = ee$1(s); - return j$2(r.type); + const r2 = ee$1(s); + return j$3(r2.type); }, this.getPayloadSenderPublicKey = (s) => { - const r = ee$1(s); - return r.senderPublicKey ? toString(r.senderPublicKey, p$3) : void 0; - }, this.core = e, this.logger = E$2(t, this.name), this.keychain = i2 || new Pt(this.core, this.logger); + const r2 = ee$1(s); + return r2.senderPublicKey ? toString(r2.senderPublicKey, p$4) : void 0; + }, this.core = e2, this.logger = E$3(t, this.name), this.keychain = i2 || new Pt(this.core, this.logger); } get context() { return y$2(this.logger); } - async setPrivateKey(e, t) { - return await this.keychain.set(e, t), e; + async setPrivateKey(e2, t) { + return await this.keychain.set(e2, t), e2; } - getPrivateKey(e) { - return this.keychain.get(e); + getPrivateKey(e2) { + return this.keychain.get(e2); } async getClientSeed() { - let e = ""; + let e2 = ""; try { - e = this.keychain.get(de$1); + e2 = this.keychain.get(de$1); } catch { - e = Vn$1(), await this.keychain.set(de$1, e); + e2 = Vn$1(), await this.keychain.set(de$1, e2); } - return mr(e, "base16"); + return mr(e2, "base16"); } - getSymKey(e) { - return this.keychain.get(e); + getSymKey(e2) { + return this.keychain.get(e2); } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } } class Ot extends a$1 { - constructor(e, t) { - super(e, t), this.logger = e, this.core = t, this.messages = /* @__PURE__ */ new Map(), this.name = rt, this.version = nt, this.initialized = false, this.storagePrefix = O$1, this.init = async () => { + constructor(e2, t) { + super(e2, t), this.logger = e2, this.core = t, this.messages = /* @__PURE__ */ new Map(), this.name = rt, this.version = nt, this.initialized = false, this.storagePrefix = O$2, this.init = async () => { if (!this.initialized) { this.logger.trace("Initialized"); try { @@ -9048,20 +9048,20 @@ class Ot extends a$1 { } }, this.set = async (i2, s) => { this.isInitialized(); - const r = Ln(s); - let o = this.messages.get(i2); - return typeof o > "u" && (o = {}), typeof o[r] < "u" || (o[r] = s, this.messages.set(i2, o), await this.persist()), r; + const r2 = Ln(s); + let o2 = this.messages.get(i2); + return typeof o2 > "u" && (o2 = {}), typeof o2[r2] < "u" || (o2[r2] = s, this.messages.set(i2, o2), await this.persist()), r2; }, this.get = (i2) => { this.isInitialized(); let s = this.messages.get(i2); return typeof s > "u" && (s = {}), s; }, this.has = (i2, s) => { this.isInitialized(); - const r = this.get(i2), o = Ln(s); - return typeof r[o] < "u"; + const r2 = this.get(i2), o2 = Ln(s); + return typeof r2[o2] < "u"; }, this.del = async (i2) => { this.isInitialized(), this.messages.delete(i2), await this.persist(); - }, this.logger = E$2(e, this.name), this.core = t; + }, this.logger = E$3(e2, this.name), this.core = t; } get context() { return y$2(this.logger); @@ -9069,40 +9069,40 @@ class Ot extends a$1 { get storageKey() { return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name; } - async setRelayerMessages(e) { - await this.core.storage.setItem(this.storageKey, rt$1(e)); + async setRelayerMessages(e2) { + await this.core.storage.setItem(this.storageKey, rt$1(e2)); } async getRelayerMessages() { - const e = await this.core.storage.getItem(this.storageKey); - return typeof e < "u" ? ot$1(e) : void 0; + const e2 = await this.core.storage.getItem(this.storageKey); + return typeof e2 < "u" ? ot$1(e2) : void 0; } async persist() { await this.setRelayerMessages(this.messages); } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } } class vr extends u$1 { - constructor(e, t) { - super(e, t), this.relayer = e, this.logger = t, this.events = new eventsExports.EventEmitter(), this.name = at, this.queue = /* @__PURE__ */ new Map(), this.publishTimeout = cjs$4.toMiliseconds(cjs$4.TEN_SECONDS * 2), this.needsTransportRestart = false, this.publish = async (i2, s, r) => { - var o; - this.logger.debug("Publishing Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: i2, message: s, opts: r } }); + constructor(e2, t) { + super(e2, t), this.relayer = e2, this.logger = t, this.events = new eventsExports.EventEmitter(), this.name = at, this.queue = /* @__PURE__ */ new Map(), this.publishTimeout = cjs$4.toMiliseconds(cjs$4.TEN_SECONDS * 2), this.needsTransportRestart = false, this.publish = async (i2, s, r2) => { + var o2; + this.logger.debug("Publishing Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: i2, message: s, opts: r2 } }); try { - const a3 = (r == null ? void 0 : r.ttl) || ot, h4 = vt$1(r), l2 = (r == null ? void 0 : r.prompt) || false, d2 = (r == null ? void 0 : r.tag) || 0, p3 = (r == null ? void 0 : r.id) || getBigIntRpcId().toString(), y3 = { topic: i2, message: s, opts: { ttl: a3, relay: h4, prompt: l2, tag: d2, id: p3 } }, M2 = setTimeout(() => this.queue.set(p3, y3), this.publishTimeout); + const a3 = (r2 == null ? void 0 : r2.ttl) || ot, h4 = vt$1(r2), l2 = (r2 == null ? void 0 : r2.prompt) || false, d3 = (r2 == null ? void 0 : r2.tag) || 0, p3 = (r2 == null ? void 0 : r2.id) || getBigIntRpcId().toString(), y3 = { topic: i2, message: s, opts: { ttl: a3, relay: h4, prompt: l2, tag: d3, id: p3 } }, M2 = setTimeout(() => this.queue.set(p3, y3), this.publishTimeout); try { - await await ut$1(this.rpcPublish(i2, s, a3, h4, l2, d2, p3), this.publishTimeout, `Failed to publish payload, please try again. id:${p3} tag:${d2}`), this.removeRequestFromQueue(p3), this.relayer.events.emit(D$2.publish, y3); + await await ut$1(this.rpcPublish(i2, s, a3, h4, l2, d3, p3), this.publishTimeout, `Failed to publish payload, please try again. id:${p3} tag:${d3}`), this.removeRequestFromQueue(p3), this.relayer.events.emit(D$2.publish, y3); } catch (u3) { - if (this.logger.debug("Publishing Payload stalled"), this.needsTransportRestart = true, (o = r == null ? void 0 : r.internal) != null && o.throwOnFailedPublish) + if (this.logger.debug("Publishing Payload stalled"), this.needsTransportRestart = true, (o2 = r2 == null ? void 0 : r2.internal) != null && o2.throwOnFailedPublish) throw this.removeRequestFromQueue(p3), u3; return; } finally { clearTimeout(M2); } - this.logger.debug("Successfully Published Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: i2, message: s, opts: r } }); + this.logger.debug("Successfully Published Payload"), this.logger.trace({ type: "method", method: "publish", params: { topic: i2, message: s, opts: r2 } }); } catch (a3) { throw this.logger.debug("Failed to Publish Payload"), this.logger.error(a3), a3; } @@ -9114,22 +9114,22 @@ class vr extends u$1 { this.events.off(i2, s); }, this.removeListener = (i2, s) => { this.events.removeListener(i2, s); - }, this.relayer = e, this.logger = E$2(t, this.name), this.registerEventListeners(); + }, this.relayer = e2, this.logger = E$3(t, this.name), this.registerEventListeners(); } get context() { return y$2(this.logger); } - rpcPublish(e, t, i2, s, r, o, a3) { - var h4, l2, d2, p3; - const y3 = { method: Et$1(s.protocol).publish, params: { topic: e, message: t, ttl: i2, prompt: r, tag: o }, id: a3 }; - return w$4((h4 = y3.params) == null ? void 0 : h4.prompt) && ((l2 = y3.params) == null || delete l2.prompt), w$4((d2 = y3.params) == null ? void 0 : d2.tag) && ((p3 = y3.params) == null || delete p3.tag), this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "message", direction: "outgoing", request: y3 }), this.relayer.request(y3); + rpcPublish(e2, t, i2, s, r2, o2, a3) { + var h4, l2, d3, p3; + const y3 = { method: Et$1(s.protocol).publish, params: { topic: e2, message: t, ttl: i2, prompt: r2, tag: o2 }, id: a3 }; + return w$5((h4 = y3.params) == null ? void 0 : h4.prompt) && ((l2 = y3.params) == null || delete l2.prompt), w$5((d3 = y3.params) == null ? void 0 : d3.tag) && ((p3 = y3.params) == null || delete p3.tag), this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "message", direction: "outgoing", request: y3 }), this.relayer.request(y3); } - removeRequestFromQueue(e) { - this.queue.delete(e); + removeRequestFromQueue(e2) { + this.queue.delete(e2); } checkQueue() { - this.queue.forEach(async (e) => { - const { topic: t, message: i2, opts: s } = e; + this.queue.forEach(async (e2) => { + const { topic: t, message: i2, opts: s } = e2; await this.publish(t, i2, s); }); } @@ -9140,32 +9140,32 @@ class vr extends u$1 { return; } this.checkQueue(); - }), this.relayer.on(D$2.message_ack, (e) => { - this.removeRequestFromQueue(e.id.toString()); + }), this.relayer.on(D$2.message_ack, (e2) => { + this.removeRequestFromQueue(e2.id.toString()); }); } } class Ir { constructor() { - this.map = /* @__PURE__ */ new Map(), this.set = (e, t) => { - const i2 = this.get(e); - this.exists(e, t) || this.map.set(e, [...i2, t]); - }, this.get = (e) => this.map.get(e) || [], this.exists = (e, t) => this.get(e).includes(t), this.delete = (e, t) => { + this.map = /* @__PURE__ */ new Map(), this.set = (e2, t) => { + const i2 = this.get(e2); + this.exists(e2, t) || this.map.set(e2, [...i2, t]); + }, this.get = (e2) => this.map.get(e2) || [], this.exists = (e2, t) => this.get(e2).includes(t), this.delete = (e2, t) => { if (typeof t > "u") { - this.map.delete(e); + this.map.delete(e2); return; } - if (!this.map.has(e)) + if (!this.map.has(e2)) return; - const i2 = this.get(e); - if (!this.exists(e, t)) + const i2 = this.get(e2); + if (!this.exists(e2, t)) return; - const s = i2.filter((r) => r !== t); + const s = i2.filter((r2) => r2 !== t); if (!s.length) { - this.map.delete(e); + this.map.delete(e2); return; } - this.map.set(e, s); + this.map.set(e2, s); }, this.clear = () => { this.map.clear(); }; @@ -9174,27 +9174,27 @@ class Ir { return Array.from(this.map.keys()); } } -var Cr = Object.defineProperty, Rr = Object.defineProperties, _r = Object.getOwnPropertyDescriptors, At = Object.getOwnPropertySymbols, Tr = Object.prototype.hasOwnProperty, Sr = Object.prototype.propertyIsEnumerable, zt = (n2, e, t) => e in n2 ? Cr(n2, e, { enumerable: true, configurable: true, writable: true, value: t }) : n2[e] = t, q$1 = (n2, e) => { - for (var t in e || (e = {})) - Tr.call(e, t) && zt(n2, t, e[t]); +var Cr = Object.defineProperty, Rr = Object.defineProperties, _r = Object.getOwnPropertyDescriptors, At = Object.getOwnPropertySymbols, Tr = Object.prototype.hasOwnProperty, Sr = Object.prototype.propertyIsEnumerable, zt = (n3, e2, t) => e2 in n3 ? Cr(n3, e2, { enumerable: true, configurable: true, writable: true, value: t }) : n3[e2] = t, q$1 = (n3, e2) => { + for (var t in e2 || (e2 = {})) + Tr.call(e2, t) && zt(n3, t, e2[t]); if (At) - for (var t of At(e)) - Sr.call(e, t) && zt(n2, t, e[t]); - return n2; -}, De = (n2, e) => Rr(n2, _r(e)); -class Nt extends d { - constructor(e, t) { - super(e, t), this.relayer = e, this.logger = t, this.subscriptions = /* @__PURE__ */ new Map(), this.topicMap = new Ir(), this.events = new eventsExports.EventEmitter(), this.name = mt, this.version = bt, this.pending = /* @__PURE__ */ new Map(), this.cached = [], this.initialized = false, this.pendingSubscriptionWatchLabel = "pending_sub_watch_label", this.pollingInterval = 20, this.storagePrefix = O$1, this.subscribeTimeout = 1e4, this.restartInProgress = false, this.batchSubscribeTopicsLimit = 500, this.init = async () => { + for (var t of At(e2)) + Sr.call(e2, t) && zt(n3, t, e2[t]); + return n3; +}, De = (n3, e2) => Rr(n3, _r(e2)); +class Nt extends d$1 { + constructor(e2, t) { + super(e2, t), this.relayer = e2, this.logger = t, this.subscriptions = /* @__PURE__ */ new Map(), this.topicMap = new Ir(), this.events = new eventsExports.EventEmitter(), this.name = mt, this.version = bt, this.pending = /* @__PURE__ */ new Map(), this.cached = [], this.initialized = false, this.pendingSubscriptionWatchLabel = "pending_sub_watch_label", this.pollingInterval = 20, this.storagePrefix = O$2, this.subscribeTimeout = 1e4, this.restartInProgress = false, this.batchSubscribeTopicsLimit = 500, this.init = async () => { this.initialized || (this.logger.trace("Initialized"), this.registerEventListeners(), this.clientId = await this.relayer.core.crypto.getClientId()); }, this.subscribe = async (i2, s) => { await this.restartToComplete(), this.isInitialized(), this.logger.debug("Subscribing Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: i2, opts: s } }); try { - const r = vt$1(s), o = { topic: i2, relay: r }; - this.pending.set(i2, o); - const a3 = await this.rpcSubscribe(i2, r); - return this.onSubscribe(a3, o), this.logger.debug("Successfully Subscribed Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: i2, opts: s } }), a3; - } catch (r) { - throw this.logger.debug("Failed to Subscribe Topic"), this.logger.error(r), r; + const r2 = vt$1(s), o2 = { topic: i2, relay: r2 }; + this.pending.set(i2, o2); + const a3 = await this.rpcSubscribe(i2, r2); + return this.onSubscribe(a3, o2), this.logger.debug("Successfully Subscribed Topic"), this.logger.trace({ type: "method", method: "subscribe", params: { topic: i2, opts: s } }), a3; + } catch (r2) { + throw this.logger.debug("Failed to Subscribe Topic"), this.logger.error(r2), r2; } }, this.unsubscribe = async (i2, s) => { await this.restartToComplete(), this.isInitialized(), typeof (s == null ? void 0 : s.id) < "u" ? await this.unsubscribeById(i2, s.id, s) : await this.unsubscribeByTopic(i2, s); @@ -9202,11 +9202,11 @@ class Nt extends d { if (this.topics.includes(i2)) return true; const s = `${this.pendingSubscriptionWatchLabel}_${i2}`; - return await new Promise((r, o) => { + return await new Promise((r2, o2) => { const a3 = new cjs$4.Watch(); a3.start(s); const h4 = setInterval(() => { - !this.pending.has(i2) && this.topics.includes(i2) && (clearInterval(h4), a3.stop(s), r(true)), a3.elapsed(s) >= ft$1 && (clearInterval(h4), a3.stop(s), o(new Error("Subscription resolution timeout"))); + !this.pending.has(i2) && this.topics.includes(i2) && (clearInterval(h4), a3.stop(s), r2(true)), a3.elapsed(s) >= ft$1 && (clearInterval(h4), a3.stop(s), o2(new Error("Subscription resolution timeout"))); }, this.pollingInterval); }).catch(() => false); }, this.on = (i2, s) => { @@ -9219,7 +9219,7 @@ class Nt extends d { this.events.removeListener(i2, s); }, this.restart = async () => { this.restartInProgress = true, await this.restore(), await this.reset(), this.restartInProgress = false; - }, this.relayer = e, this.logger = E$2(t, this.name), this.clientId = ""; + }, this.relayer = e2, this.logger = E$3(t, this.name), this.clientId = ""; } get context() { return y$2(this.logger); @@ -9239,10 +9239,10 @@ class Nt extends d { get topics() { return this.topicMap.topics; } - hasSubscription(e, t) { + hasSubscription(e2, t) { let i2 = false; try { - i2 = this.getSubscription(e).topic === t; + i2 = this.getSubscription(e2).topic === t; } catch { } return i2; @@ -9253,35 +9253,35 @@ class Nt extends d { onDisable() { this.cached = this.values, this.subscriptions.clear(), this.topicMap.clear(); } - async unsubscribeByTopic(e, t) { - const i2 = this.topicMap.get(e); - await Promise.all(i2.map(async (s) => await this.unsubscribeById(e, s, t))); + async unsubscribeByTopic(e2, t) { + const i2 = this.topicMap.get(e2); + await Promise.all(i2.map(async (s) => await this.unsubscribeById(e2, s, t))); } - async unsubscribeById(e, t, i2) { - this.logger.debug("Unsubscribing Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e, id: t, opts: i2 } }); + async unsubscribeById(e2, t, i2) { + this.logger.debug("Unsubscribing Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e2, id: t, opts: i2 } }); try { const s = vt$1(i2); - await this.rpcUnsubscribe(e, t, s); - const r = U$2("USER_DISCONNECTED", `${this.name}, ${e}`); - await this.onUnsubscribe(e, t, r), this.logger.debug("Successfully Unsubscribed Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e, id: t, opts: i2 } }); + await this.rpcUnsubscribe(e2, t, s); + const r2 = U$2("USER_DISCONNECTED", `${this.name}, ${e2}`); + await this.onUnsubscribe(e2, t, r2), this.logger.debug("Successfully Unsubscribed Topic"), this.logger.trace({ type: "method", method: "unsubscribe", params: { topic: e2, id: t, opts: i2 } }); } catch (s) { throw this.logger.debug("Failed to Unsubscribe Topic"), this.logger.error(s), s; } } - async rpcSubscribe(e, t) { - const i2 = { method: Et$1(t.protocol).subscribe, params: { topic: e } }; + async rpcSubscribe(e2, t) { + const i2 = { method: Et$1(t.protocol).subscribe, params: { topic: e2 } }; this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i2 }); try { await await ut$1(this.relayer.request(i2), this.subscribeTimeout); } catch { this.logger.debug("Outgoing Relay Subscribe Payload stalled"), this.relayer.events.emit(D$2.connection_stalled); } - return Ln(e + this.clientId); + return Ln(e2 + this.clientId); } - async rpcBatchSubscribe(e) { - if (!e.length) + async rpcBatchSubscribe(e2) { + if (!e2.length) return; - const t = e[0].relay, i2 = { method: Et$1(t.protocol).batchSubscribe, params: { topics: e.map((s) => s.topic) } }; + const t = e2[0].relay, i2 = { method: Et$1(t.protocol).batchSubscribe, params: { topics: e2.map((s) => s.topic) } }; this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: i2 }); try { return await await ut$1(this.relayer.request(i2), this.subscribeTimeout); @@ -9289,79 +9289,79 @@ class Nt extends d { this.logger.debug("Outgoing Relay Payload stalled"), this.relayer.events.emit(D$2.connection_stalled); } } - rpcUnsubscribe(e, t, i2) { - const s = { method: Et$1(i2.protocol).unsubscribe, params: { topic: e, id: t } }; + rpcUnsubscribe(e2, t, i2) { + const s = { method: Et$1(i2.protocol).unsubscribe, params: { topic: e2, id: t } }; return this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "payload", direction: "outgoing", request: s }), this.relayer.request(s); } - onSubscribe(e, t) { - this.setSubscription(e, De(q$1({}, t), { id: e })), this.pending.delete(t.topic); + onSubscribe(e2, t) { + this.setSubscription(e2, De(q$1({}, t), { id: e2 })), this.pending.delete(t.topic); } - onBatchSubscribe(e) { - e.length && e.forEach((t) => { + onBatchSubscribe(e2) { + e2.length && e2.forEach((t) => { this.setSubscription(t.id, q$1({}, t)), this.pending.delete(t.topic); }); } - async onUnsubscribe(e, t, i2) { - this.events.removeAllListeners(t), this.hasSubscription(t, e) && this.deleteSubscription(t, i2), await this.relayer.messages.del(e); + async onUnsubscribe(e2, t, i2) { + this.events.removeAllListeners(t), this.hasSubscription(t, e2) && this.deleteSubscription(t, i2), await this.relayer.messages.del(e2); } - async setRelayerSubscriptions(e) { - await this.relayer.core.storage.setItem(this.storageKey, e); + async setRelayerSubscriptions(e2) { + await this.relayer.core.storage.setItem(this.storageKey, e2); } async getRelayerSubscriptions() { return await this.relayer.core.storage.getItem(this.storageKey); } - setSubscription(e, t) { - this.subscriptions.has(e) || (this.logger.debug("Setting subscription"), this.logger.trace({ type: "method", method: "setSubscription", id: e, subscription: t }), this.addSubscription(e, t)); + setSubscription(e2, t) { + this.subscriptions.has(e2) || (this.logger.debug("Setting subscription"), this.logger.trace({ type: "method", method: "setSubscription", id: e2, subscription: t }), this.addSubscription(e2, t)); } - addSubscription(e, t) { - this.subscriptions.set(e, q$1({}, t)), this.topicMap.set(t.topic, e), this.events.emit(w2.created, t); + addSubscription(e2, t) { + this.subscriptions.set(e2, q$1({}, t)), this.topicMap.set(t.topic, e2), this.events.emit(w$1.created, t); } - getSubscription(e) { - this.logger.debug("Getting subscription"), this.logger.trace({ type: "method", method: "getSubscription", id: e }); - const t = this.subscriptions.get(e); + getSubscription(e2) { + this.logger.debug("Getting subscription"), this.logger.trace({ type: "method", method: "getSubscription", id: e2 }); + const t = this.subscriptions.get(e2); if (!t) { - const { message: i2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${e}`); + const { message: i2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${e2}`); throw new Error(i2); } return t; } - deleteSubscription(e, t) { - this.logger.debug("Deleting subscription"), this.logger.trace({ type: "method", method: "deleteSubscription", id: e, reason: t }); - const i2 = this.getSubscription(e); - this.subscriptions.delete(e), this.topicMap.delete(i2.topic, e), this.events.emit(w2.deleted, De(q$1({}, i2), { reason: t })); + deleteSubscription(e2, t) { + this.logger.debug("Deleting subscription"), this.logger.trace({ type: "method", method: "deleteSubscription", id: e2, reason: t }); + const i2 = this.getSubscription(e2); + this.subscriptions.delete(e2), this.topicMap.delete(i2.topic, e2), this.events.emit(w$1.deleted, De(q$1({}, i2), { reason: t })); } async persist() { - await this.setRelayerSubscriptions(this.values), this.events.emit(w2.sync); + await this.setRelayerSubscriptions(this.values), this.events.emit(w$1.sync); } async reset() { if (this.cached.length) { - const e = Math.ceil(this.cached.length / this.batchSubscribeTopicsLimit); - for (let t = 0; t < e; t++) { + const e2 = Math.ceil(this.cached.length / this.batchSubscribeTopicsLimit); + for (let t = 0; t < e2; t++) { const i2 = this.cached.splice(0, this.batchSubscribeTopicsLimit); await this.batchSubscribe(i2); } } - this.events.emit(w2.resubscribed); + this.events.emit(w$1.resubscribed); } async restore() { try { - const e = await this.getRelayerSubscriptions(); - if (typeof e > "u" || !e.length) + const e2 = await this.getRelayerSubscriptions(); + if (typeof e2 > "u" || !e2.length) return; if (this.subscriptions.size) { const { message: t } = N$2("RESTORE_WILL_OVERRIDE", this.name); throw this.logger.error(t), this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`), new Error(t); } - this.cached = e, this.logger.debug(`Successfully Restored subscriptions for ${this.name}`), this.logger.trace({ type: "method", method: "restore", subscriptions: this.values }); - } catch (e) { - this.logger.debug(`Failed to Restore subscriptions for ${this.name}`), this.logger.error(e); + this.cached = e2, this.logger.debug(`Successfully Restored subscriptions for ${this.name}`), this.logger.trace({ type: "method", method: "restore", subscriptions: this.values }); + } catch (e2) { + this.logger.debug(`Failed to Restore subscriptions for ${this.name}`), this.logger.error(e2); } } - async batchSubscribe(e) { - if (!e.length) + async batchSubscribe(e2) { + if (!e2.length) return; - const t = await this.rpcBatchSubscribe(e); - k$2(t) && this.onBatchSubscribe(t.map((i2, s) => De(q$1({}, e[s]), { id: i2 }))); + const t = await this.rpcBatchSubscribe(e2); + k$2(t) && this.onBatchSubscribe(t.map((i2, s) => De(q$1({}, e2[s]), { id: i2 }))); } async onConnect() { this.restartInProgress || (await this.restart(), this.onEnable()); @@ -9372,10 +9372,10 @@ class Nt extends d { async checkPending() { if (!this.initialized || this.relayer.transportExplicitlyClosed) return; - const e = []; + const e2 = []; this.pending.forEach((t) => { - e.push(t); - }), await this.batchSubscribe(e); + e2.push(t); + }), await this.batchSubscribe(e2); } registerEventListeners() { this.relayer.core.heartbeat.on(cjs$1.HEARTBEAT_EVENTS.pulse, async () => { @@ -9384,39 +9384,39 @@ class Nt extends d { await this.onConnect(); }), this.relayer.on(D$2.disconnect, () => { this.onDisconnect(); - }), this.events.on(w2.created, async (e) => { - const t = w2.created; - this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), await this.persist(); - }), this.events.on(w2.deleted, async (e) => { - const t = w2.deleted; - this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), await this.persist(); + }), this.events.on(w$1.created, async (e2) => { + const t = w$1.created; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e2 }), await this.persist(); + }), this.events.on(w$1.deleted, async (e2) => { + const t = w$1.deleted; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e2 }), await this.persist(); }); } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } async restartToComplete() { - this.restartInProgress && await new Promise((e) => { + this.restartInProgress && await new Promise((e2) => { const t = setInterval(() => { - this.restartInProgress || (clearInterval(t), e()); + this.restartInProgress || (clearInterval(t), e2()); }, this.pollingInterval); }); } } -var Pr = Object.defineProperty, Ut = Object.getOwnPropertySymbols, xr = Object.prototype.hasOwnProperty, Or = Object.prototype.propertyIsEnumerable, Lt = (n2, e, t) => e in n2 ? Pr(n2, e, { enumerable: true, configurable: true, writable: true, value: t }) : n2[e] = t, Ar = (n2, e) => { - for (var t in e || (e = {})) - xr.call(e, t) && Lt(n2, t, e[t]); +var Pr = Object.defineProperty, Ut = Object.getOwnPropertySymbols, xr = Object.prototype.hasOwnProperty, Or = Object.prototype.propertyIsEnumerable, Lt = (n3, e2, t) => e2 in n3 ? Pr(n3, e2, { enumerable: true, configurable: true, writable: true, value: t }) : n3[e2] = t, Ar = (n3, e2) => { + for (var t in e2 || (e2 = {})) + xr.call(e2, t) && Lt(n3, t, e2[t]); if (Ut) - for (var t of Ut(e)) - Or.call(e, t) && Lt(n2, t, e[t]); - return n2; + for (var t of Ut(e2)) + Or.call(e2, t) && Lt(n3, t, e2[t]); + return n3; }; -class $t extends g$3 { - constructor(e) { - super(e), this.protocol = "wc", this.version = 2, this.events = new eventsExports.EventEmitter(), this.name = ut, this.transportExplicitlyClosed = false, this.initialized = false, this.connectionAttemptInProgress = false, this.connectionStatusPollingInterval = 20, this.staleConnectionErrors = ["socket hang up", "socket stalled"], this.hasExperiencedNetworkDisruption = false, this.requestsInFlight = /* @__PURE__ */ new Map(), this.request = async (t) => { +class $t extends g$4 { + constructor(e2) { + super(e2), this.protocol = "wc", this.version = 2, this.events = new eventsExports.EventEmitter(), this.name = ut, this.transportExplicitlyClosed = false, this.initialized = false, this.connectionAttemptInProgress = false, this.connectionStatusPollingInterval = 20, this.staleConnectionErrors = ["socket hang up", "socket stalled"], this.hasExperiencedNetworkDisruption = false, this.requestsInFlight = /* @__PURE__ */ new Map(), this.request = async (t) => { this.logger.debug("Publishing Request Payload"); const i2 = t.id; try { @@ -9437,8 +9437,8 @@ class $t extends g$3 { }, this.onProviderErrorHandler = (t) => { this.logger.error(t), this.events.emit(D$2.error, t), this.logger.info("Fatal socket error received, closing transport"), this.transportClose(); }, this.registerProviderListeners = () => { - this.provider.on(P$1.payload, this.onPayloadHandler), this.provider.on(P$1.connect, this.onConnectHandler), this.provider.on(P$1.disconnect, this.onDisconnectHandler), this.provider.on(P$1.error, this.onProviderErrorHandler); - }, this.core = e.core, this.logger = typeof e.logger < "u" && typeof e.logger != "string" ? E$2(e.logger, this.name) : Hg(k({ level: e.logger || ct })), this.messages = new Ot(this.logger, e.core), this.subscriber = new Nt(this, this.logger), this.publisher = new vr(this, this.logger), this.relayUrl = (e == null ? void 0 : e.relayUrl) || ge$2, this.projectId = e.projectId, this.bundleId = Jn(), this.provider = {}; + this.provider.on(P$2.payload, this.onPayloadHandler), this.provider.on(P$2.connect, this.onConnectHandler), this.provider.on(P$2.disconnect, this.onDisconnectHandler), this.provider.on(P$2.error, this.onProviderErrorHandler); + }, this.core = e2.core, this.logger = typeof e2.logger < "u" && typeof e2.logger != "string" ? E$3(e2.logger, this.name) : Hg(k({ level: e2.logger || ct })), this.messages = new Ot(this.logger, e2.core), this.subscriber = new Nt(this, this.logger), this.publisher = new vr(this, this.logger), this.relayUrl = (e2 == null ? void 0 : e2.relayUrl) || ge$2, this.projectId = e2.projectId, this.bundleId = Jn(), this.provider = {}; } async init() { this.logger.trace("Initialized"), this.registerEventListeners(), await this.createProvider(), await Promise.all([this.messages.init(), this.subscriber.init()]); @@ -9460,53 +9460,53 @@ class $t extends g$3 { get connecting() { return this.provider.connection.connecting; } - async publish(e, t, i2) { - this.isInitialized(), await this.publisher.publish(e, t, i2), await this.recordMessageEvent({ topic: e, message: t, publishedAt: Date.now() }); + async publish(e2, t, i2) { + this.isInitialized(), await this.publisher.publish(e2, t, i2), await this.recordMessageEvent({ topic: e2, message: t, publishedAt: Date.now() }); } - async subscribe(e, t) { + async subscribe(e2, t) { var i2; this.isInitialized(); - let s = ((i2 = this.subscriber.topicMap.get(e)) == null ? void 0 : i2[0]) || ""; + let s = ((i2 = this.subscriber.topicMap.get(e2)) == null ? void 0 : i2[0]) || ""; if (s) return s; - let r; - const o = (a3) => { - a3.topic === e && (this.subscriber.off(w2.created, o), r()); + let r2; + const o2 = (a3) => { + a3.topic === e2 && (this.subscriber.off(w$1.created, o2), r2()); }; return await Promise.all([new Promise((a3) => { - r = a3, this.subscriber.on(w2.created, o); + r2 = a3, this.subscriber.on(w$1.created, o2); }), new Promise(async (a3) => { - s = await this.subscriber.subscribe(e, t), a3(); + s = await this.subscriber.subscribe(e2, t), a3(); })]), s; } - async unsubscribe(e, t) { - this.isInitialized(), await this.subscriber.unsubscribe(e, t); + async unsubscribe(e2, t) { + this.isInitialized(), await this.subscriber.unsubscribe(e2, t); } - on(e, t) { - this.events.on(e, t); + on(e2, t) { + this.events.on(e2, t); } - once(e, t) { - this.events.once(e, t); + once(e2, t) { + this.events.once(e2, t); } - off(e, t) { - this.events.off(e, t); + off(e2, t) { + this.events.off(e2, t); } - removeListener(e, t) { - this.events.removeListener(e, t); + removeListener(e2, t) { + this.events.removeListener(e2, t); } async transportClose() { - this.requestsInFlight.size > 0 && (this.logger.debug("Waiting for all in-flight requests to finish before closing transport..."), this.requestsInFlight.forEach(async (e) => { - await e.promise; + this.requestsInFlight.size > 0 && (this.logger.debug("Waiting for all in-flight requests to finish before closing transport..."), this.requestsInFlight.forEach(async (e2) => { + await e2.promise; })), this.transportExplicitlyClosed = true, this.hasExperiencedNetworkDisruption && this.connected ? await ut$1(this.provider.disconnect(), 1e3, "provider.disconnect()").catch(() => this.onProviderDisconnect()) : this.connected && await this.provider.disconnect(); } - async transportOpen(e) { + async transportOpen(e2) { if (this.transportExplicitlyClosed = false, await this.confirmOnlineStateOrThrow(), !this.connectionAttemptInProgress) { - e && e !== this.relayUrl && (this.relayUrl = e, await this.transportClose(), await this.createProvider()), this.connectionAttemptInProgress = true; + e2 && e2 !== this.relayUrl && (this.relayUrl = e2, await this.transportClose(), await this.createProvider()), this.connectionAttemptInProgress = true; try { await Promise.all([new Promise((t) => { if (!this.initialized) return t(); - this.subscriber.once(w2.resubscribed, () => { + this.subscriber.once(w$1.resubscribed, () => { t(); }); }), new Promise(async (t, i2) => { @@ -9523,33 +9523,33 @@ class $t extends g$3 { const i2 = t; if (!this.isConnectionStalled(i2.message)) throw t; - this.provider.events.emit(P$1.disconnect); + this.provider.events.emit(P$2.disconnect); } finally { this.connectionAttemptInProgress = false, this.hasExperiencedNetworkDisruption = false; } } } - async restartTransport(e) { - await this.confirmOnlineStateOrThrow(), !this.connectionAttemptInProgress && (this.relayUrl = e || this.relayUrl, await this.transportClose(), await this.createProvider(), await this.transportOpen()); + async restartTransport(e2) { + await this.confirmOnlineStateOrThrow(), !this.connectionAttemptInProgress && (this.relayUrl = e2 || this.relayUrl, await this.transportClose(), await this.createProvider(), await this.transportOpen()); } async confirmOnlineStateOrThrow() { if (!await rr$1()) throw new Error("No internet connection detected. Please restart your network and try again."); } - isConnectionStalled(e) { - return this.staleConnectionErrors.some((t) => e.includes(t)); + isConnectionStalled(e2) { + return this.staleConnectionErrors.some((t) => e2.includes(t)); } async createProvider() { this.provider.connection && this.unregisterProviderListeners(); - const e = await this.core.crypto.signJWT(this.relayUrl); - this.provider = new JsonRpcProvider(new f$1(Xn({ sdkVersion: gt, protocol: this.protocol, version: this.version, relayUrl: this.relayUrl, projectId: this.projectId, auth: e, useOnCloseEvent: true, bundleId: this.bundleId }))), this.registerProviderListeners(); + const e2 = await this.core.crypto.signJWT(this.relayUrl); + this.provider = new JsonRpcProvider(new f$2(Xn({ sdkVersion: gt, protocol: this.protocol, version: this.version, relayUrl: this.relayUrl, projectId: this.projectId, auth: e2, useOnCloseEvent: true, bundleId: this.bundleId }))), this.registerProviderListeners(); } - async recordMessageEvent(e) { - const { topic: t, message: i2 } = e; + async recordMessageEvent(e2) { + const { topic: t, message: i2 } = e2; await this.messages.set(t, i2); } - async shouldIgnoreMessageEvent(e) { - const { topic: t, message: i2 } = e; + async shouldIgnoreMessageEvent(e2) { + const { topic: t, message: i2 } = e2; if (!i2 || i2.length === 0) return this.logger.debug(`Ignoring invalid/empty message: ${i2}`), true; if (!await this.subscriber.isSubscribed(t)) @@ -9557,32 +9557,32 @@ class $t extends g$3 { const s = this.messages.has(t, i2); return s && this.logger.debug(`Ignoring duplicate message: ${i2}`), s; } - async onProviderPayload(e) { - if (this.logger.debug("Incoming Relay Payload"), this.logger.trace({ type: "payload", direction: "incoming", payload: e }), isJsonRpcRequest(e)) { - if (!e.method.endsWith(lt)) + async onProviderPayload(e2) { + if (this.logger.debug("Incoming Relay Payload"), this.logger.trace({ type: "payload", direction: "incoming", payload: e2 }), isJsonRpcRequest(e2)) { + if (!e2.method.endsWith(lt)) return; - const t = e.params, { topic: i2, message: s, publishedAt: r } = t.data, o = { topic: i2, message: s, publishedAt: r }; - this.logger.debug("Emitting Relayer Payload"), this.logger.trace(Ar({ type: "event", event: t.id }, o)), this.events.emit(t.id, o), await this.acknowledgePayload(e), await this.onMessageEvent(o); + const t = e2.params, { topic: i2, message: s, publishedAt: r2 } = t.data, o2 = { topic: i2, message: s, publishedAt: r2 }; + this.logger.debug("Emitting Relayer Payload"), this.logger.trace(Ar({ type: "event", event: t.id }, o2)), this.events.emit(t.id, o2), await this.acknowledgePayload(e2), await this.onMessageEvent(o2); } else - isJsonRpcResponse(e) && this.events.emit(D$2.message_ack, e); + isJsonRpcResponse(e2) && this.events.emit(D$2.message_ack, e2); } - async onMessageEvent(e) { - await this.shouldIgnoreMessageEvent(e) || (this.events.emit(D$2.message, e), await this.recordMessageEvent(e)); + async onMessageEvent(e2) { + await this.shouldIgnoreMessageEvent(e2) || (this.events.emit(D$2.message, e2), await this.recordMessageEvent(e2)); } - async acknowledgePayload(e) { - const t = formatJsonRpcResult(e.id, true); + async acknowledgePayload(e2) { + const t = formatJsonRpcResult(e2.id, true); await this.provider.connection.send(t); } unregisterProviderListeners() { - this.provider.off(P$1.payload, this.onPayloadHandler), this.provider.off(P$1.connect, this.onConnectHandler), this.provider.off(P$1.disconnect, this.onDisconnectHandler), this.provider.off(P$1.error, this.onProviderErrorHandler); + this.provider.off(P$2.payload, this.onPayloadHandler), this.provider.off(P$2.connect, this.onConnectHandler), this.provider.off(P$2.disconnect, this.onDisconnectHandler), this.provider.off(P$2.error, this.onProviderErrorHandler); } async registerEventListeners() { this.events.on(D$2.connection_stalled, () => { this.restartTransport().catch((t) => this.logger.error(t)); }); - let e = await rr$1(); + let e2 = await rr$1(); or$1(async (t) => { - this.initialized && e !== t && (e = t, t ? await this.restartTransport().catch((i2) => this.logger.error(i2)) : (this.hasExperiencedNetworkDisruption = true, await this.transportClose().catch((i2) => this.logger.error(i2)))); + this.initialized && e2 !== t && (e2 = t, t ? await this.restartTransport().catch((i2) => this.logger.error(i2)) : (this.hasExperiencedNetworkDisruption = true, await this.transportClose().catch((i2) => this.logger.error(i2)))); }); } onProviderDisconnect() { @@ -9590,50 +9590,50 @@ class $t extends g$3 { } attemptToReconnect() { this.transportExplicitlyClosed || (this.logger.info("attemptToReconnect called. Connecting..."), setTimeout(async () => { - await this.restartTransport().catch((e) => this.logger.error(e)); + await this.restartTransport().catch((e2) => this.logger.error(e2)); }, cjs$4.toMiliseconds(dt))); } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } async toEstablishConnection() { if (await this.confirmOnlineStateOrThrow(), !this.connected) { if (this.connectionAttemptInProgress) - return await new Promise((e) => { + return await new Promise((e2) => { const t = setInterval(() => { - this.connected && (clearInterval(t), e()); + this.connected && (clearInterval(t), e2()); }, this.connectionStatusPollingInterval); }); await this.restartTransport(); } } } -var zr = Object.defineProperty, Ft = Object.getOwnPropertySymbols, Nr = Object.prototype.hasOwnProperty, Ur = Object.prototype.propertyIsEnumerable, Mt = (n2, e, t) => e in n2 ? zr(n2, e, { enumerable: true, configurable: true, writable: true, value: t }) : n2[e] = t, kt = (n2, e) => { - for (var t in e || (e = {})) - Nr.call(e, t) && Mt(n2, t, e[t]); +var zr = Object.defineProperty, Ft = Object.getOwnPropertySymbols, Nr = Object.prototype.hasOwnProperty, Ur = Object.prototype.propertyIsEnumerable, Mt = (n3, e2, t) => e2 in n3 ? zr(n3, e2, { enumerable: true, configurable: true, writable: true, value: t }) : n3[e2] = t, kt = (n3, e2) => { + for (var t in e2 || (e2 = {})) + Nr.call(e2, t) && Mt(n3, t, e2[t]); if (Ft) - for (var t of Ft(e)) - Ur.call(e, t) && Mt(n2, t, e[t]); - return n2; + for (var t of Ft(e2)) + Ur.call(e2, t) && Mt(n3, t, e2[t]); + return n3; }; -class Kt extends p$1 { - constructor(e, t, i2, s = O$1, r = void 0) { - super(e, t, i2, s), this.core = e, this.logger = t, this.name = i2, this.map = /* @__PURE__ */ new Map(), this.version = Dt, this.cached = [], this.initialized = false, this.storagePrefix = O$1, this.init = async () => { - this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((o) => { - this.getKey && o !== null && !w$4(o) ? this.map.set(this.getKey(o), o) : Lt$1(o) ? this.map.set(o.id, o) : xt$1(o) && this.map.set(o.topic, o); +class Kt extends p$2 { + constructor(e2, t, i2, s = O$2, r2 = void 0) { + super(e2, t, i2, s), this.core = e2, this.logger = t, this.name = i2, this.map = /* @__PURE__ */ new Map(), this.version = Dt, this.cached = [], this.initialized = false, this.storagePrefix = O$2, this.init = async () => { + this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((o2) => { + this.getKey && o2 !== null && !w$5(o2) ? this.map.set(this.getKey(o2), o2) : Lt$1(o2) ? this.map.set(o2.id, o2) : xt$1(o2) && this.map.set(o2.topic, o2); }), this.cached = [], this.initialized = true); - }, this.set = async (o, a3) => { - this.isInitialized(), this.map.has(o) ? await this.update(o, a3) : (this.logger.debug("Setting value"), this.logger.trace({ type: "method", method: "set", key: o, value: a3 }), this.map.set(o, a3), await this.persist()); - }, this.get = (o) => (this.isInitialized(), this.logger.debug("Getting value"), this.logger.trace({ type: "method", method: "get", key: o }), this.getData(o)), this.getAll = (o) => (this.isInitialized(), o ? this.values.filter((a3) => Object.keys(o).every((h4) => Gi(a3[h4], o[h4]))) : this.values), this.update = async (o, a3) => { - this.isInitialized(), this.logger.debug("Updating value"), this.logger.trace({ type: "method", method: "update", key: o, update: a3 }); - const h4 = kt(kt({}, this.getData(o)), a3); - this.map.set(o, h4), await this.persist(); - }, this.delete = async (o, a3) => { - this.isInitialized(), this.map.has(o) && (this.logger.debug("Deleting value"), this.logger.trace({ type: "method", method: "delete", key: o, reason: a3 }), this.map.delete(o), await this.persist()); - }, this.logger = E$2(t, this.name), this.storagePrefix = s, this.getKey = r; + }, this.set = async (o2, a3) => { + this.isInitialized(), this.map.has(o2) ? await this.update(o2, a3) : (this.logger.debug("Setting value"), this.logger.trace({ type: "method", method: "set", key: o2, value: a3 }), this.map.set(o2, a3), await this.persist()); + }, this.get = (o2) => (this.isInitialized(), this.logger.debug("Getting value"), this.logger.trace({ type: "method", method: "get", key: o2 }), this.getData(o2)), this.getAll = (o2) => (this.isInitialized(), o2 ? this.values.filter((a3) => Object.keys(o2).every((h4) => Gi(a3[h4], o2[h4]))) : this.values), this.update = async (o2, a3) => { + this.isInitialized(), this.logger.debug("Updating value"), this.logger.trace({ type: "method", method: "update", key: o2, update: a3 }); + const h4 = kt(kt({}, this.getData(o2)), a3); + this.map.set(o2, h4), await this.persist(); + }, this.delete = async (o2, a3) => { + this.isInitialized(), this.map.has(o2) && (this.logger.debug("Deleting value"), this.logger.trace({ type: "method", method: "delete", key: o2, reason: a3 }), this.map.delete(o2), await this.persist()); + }, this.logger = E$3(t, this.name), this.storagePrefix = s, this.getKey = r2; } get context() { return y$2(this.logger); @@ -9650,16 +9650,16 @@ class Kt extends p$1 { get values() { return Array.from(this.map.values()); } - async setDataStore(e) { - await this.core.storage.setItem(this.storageKey, e); + async setDataStore(e2) { + await this.core.storage.setItem(this.storageKey, e2); } async getDataStore() { return await this.core.storage.getItem(this.storageKey); } - getData(e) { - const t = this.map.get(e); + getData(e2) { + const t = this.map.get(e2); if (!t) { - const { message: i2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${e}`); + const { message: i2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${e2}`); throw this.logger.error(i2), new Error(i2); } return t; @@ -9669,43 +9669,43 @@ class Kt extends p$1 { } async restore() { try { - const e = await this.getDataStore(); - if (typeof e > "u" || !e.length) + const e2 = await this.getDataStore(); + if (typeof e2 > "u" || !e2.length) return; if (this.map.size) { const { message: t } = N$2("RESTORE_WILL_OVERRIDE", this.name); throw this.logger.error(t), new Error(t); } - this.cached = e, this.logger.debug(`Successfully Restored value for ${this.name}`), this.logger.trace({ type: "method", method: "restore", value: this.values }); - } catch (e) { - this.logger.debug(`Failed to Restore value for ${this.name}`), this.logger.error(e); + this.cached = e2, this.logger.debug(`Successfully Restored value for ${this.name}`), this.logger.trace({ type: "method", method: "restore", value: this.values }); + } catch (e2) { + this.logger.debug(`Failed to Restore value for ${this.name}`), this.logger.error(e2); } } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } } class Bt { - constructor(e, t) { - this.core = e, this.logger = t, this.name = Et, this.version = wt, this.events = new Ug(), this.initialized = false, this.storagePrefix = O$1, this.ignoredPayloadTypes = [_$3], this.registeredMethods = [], this.init = async () => { + constructor(e2, t) { + this.core = e2, this.logger = t, this.name = Et, this.version = wt, this.events = new Ug(), this.initialized = false, this.storagePrefix = O$2, this.ignoredPayloadTypes = [_$3], this.registeredMethods = [], this.init = async () => { this.initialized || (await this.pairings.init(), await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.initialized = true, this.logger.trace("Initialized")); }, this.register = ({ methods: i2 }) => { this.isInitialized(), this.registeredMethods = [.../* @__PURE__ */ new Set([...this.registeredMethods, ...i2])]; }, this.create = async () => { this.isInitialized(); - const i2 = Vn$1(), s = await this.core.crypto.setSymKey(i2), r = pt$1(cjs$4.FIVE_MINUTES), o = { protocol: ht }, a3 = { topic: s, expiry: r, relay: o, active: false }, h4 = Rt$1({ protocol: this.core.protocol, version: this.core.version, topic: s, symKey: i2, relay: o, expiryTimestamp: r }); - return await this.pairings.set(s, a3), await this.core.relayer.subscribe(s), this.core.expirer.set(s, r), { topic: s, uri: h4 }; + const i2 = Vn$1(), s = await this.core.crypto.setSymKey(i2), r2 = pt$1(cjs$4.FIVE_MINUTES), o2 = { protocol: ht }, a3 = { topic: s, expiry: r2, relay: o2, active: false }, h4 = Rt$1({ protocol: this.core.protocol, version: this.core.version, topic: s, symKey: i2, relay: o2, expiryTimestamp: r2 }); + return await this.pairings.set(s, a3), await this.core.relayer.subscribe(s), this.core.expirer.set(s, r2), { topic: s, uri: h4 }; }, this.pair = async (i2) => { this.isInitialized(), this.isValidPair(i2); - const { topic: s, symKey: r, relay: o, expiryTimestamp: a3 } = Pt$1(i2.uri); + const { topic: s, symKey: r2, relay: o2, expiryTimestamp: a3 } = Pt$1(i2.uri); let h4; if (this.pairings.keys.includes(s) && (h4 = this.pairings.get(s), h4.active)) throw new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`); - const l2 = a3 || pt$1(cjs$4.FIVE_MINUTES), d2 = { topic: s, relay: o, expiry: l2, active: false }; - return await this.pairings.set(s, d2), this.core.expirer.set(s, l2), i2.activatePairing && await this.activate({ topic: s }), this.events.emit(V.create, d2), this.core.crypto.keychain.has(s) || (await this.core.crypto.setSymKey(r, s), await this.core.relayer.subscribe(s, { relay: o })), d2; + const l2 = a3 || pt$1(cjs$4.FIVE_MINUTES), d3 = { topic: s, relay: o2, expiry: l2, active: false }; + return await this.pairings.set(s, d3), this.core.expirer.set(s, l2), i2.activatePairing && await this.activate({ topic: s }), this.events.emit(V.create, d3), this.core.crypto.keychain.has(s) || (await this.core.crypto.setSymKey(r2, s), await this.core.relayer.subscribe(s, { relay: o2 })), d3; }, this.activate = async ({ topic: i2 }) => { this.isInitialized(); const s = pt$1(cjs$4.THIRTY_DAYS); @@ -9714,10 +9714,10 @@ class Bt { this.isInitialized(), await this.isValidPing(i2); const { topic: s } = i2; if (this.pairings.keys.includes(s)) { - const r = await this.sendRequest(s, "wc_pairingPing", {}), { done: o, resolve: a3, reject: h4 } = at$1(); - this.events.once(yt$1("pairing_ping", r), ({ error: l2 }) => { + const r2 = await this.sendRequest(s, "wc_pairingPing", {}), { done: o2, resolve: a3, reject: h4 } = at$1(); + this.events.once(yt$1("pairing_ping", r2), ({ error: l2 }) => { l2 ? h4(l2) : a3(); - }), await o(); + }), await o2(); } }, this.updateExpiry = async ({ topic: i2, expiry: s }) => { this.isInitialized(), await this.pairings.update(i2, { expiry: s }); @@ -9727,108 +9727,108 @@ class Bt { this.isInitialized(), await this.isValidDisconnect(i2); const { topic: s } = i2; this.pairings.keys.includes(s) && (await this.sendRequest(s, "wc_pairingDelete", U$2("USER_DISCONNECTED")), await this.deletePairing(s)); - }, this.sendRequest = async (i2, s, r) => { - const o = formatJsonRpcRequest(s, r), a3 = await this.core.crypto.encode(i2, o), h4 = $$1[s].req; - return this.core.history.set(i2, o), this.core.relayer.publish(i2, a3, h4), o.id; - }, this.sendResult = async (i2, s, r) => { - const o = formatJsonRpcResult(i2, r), a3 = await this.core.crypto.encode(s, o), h4 = await this.core.history.get(s, i2), l2 = $$1[h4.request.method].res; - await this.core.relayer.publish(s, a3, l2), await this.core.history.resolve(o); - }, this.sendError = async (i2, s, r) => { - const o = formatJsonRpcError(i2, r), a3 = await this.core.crypto.encode(s, o), h4 = await this.core.history.get(s, i2), l2 = $$1[h4.request.method] ? $$1[h4.request.method].res : $$1.unregistered_method.res; - await this.core.relayer.publish(s, a3, l2), await this.core.history.resolve(o); + }, this.sendRequest = async (i2, s, r2) => { + const o2 = formatJsonRpcRequest(s, r2), a3 = await this.core.crypto.encode(i2, o2), h4 = $$1[s].req; + return this.core.history.set(i2, o2), this.core.relayer.publish(i2, a3, h4), o2.id; + }, this.sendResult = async (i2, s, r2) => { + const o2 = formatJsonRpcResult(i2, r2), a3 = await this.core.crypto.encode(s, o2), h4 = await this.core.history.get(s, i2), l2 = $$1[h4.request.method].res; + await this.core.relayer.publish(s, a3, l2), await this.core.history.resolve(o2); + }, this.sendError = async (i2, s, r2) => { + const o2 = formatJsonRpcError(i2, r2), a3 = await this.core.crypto.encode(s, o2), h4 = await this.core.history.get(s, i2), l2 = $$1[h4.request.method] ? $$1[h4.request.method].res : $$1.unregistered_method.res; + await this.core.relayer.publish(s, a3, l2), await this.core.history.resolve(o2); }, this.deletePairing = async (i2, s) => { await this.core.relayer.unsubscribe(i2), await Promise.all([this.pairings.delete(i2, U$2("USER_DISCONNECTED")), this.core.crypto.deleteSymKey(i2), s ? Promise.resolve() : this.core.expirer.del(i2)]); }, this.cleanup = async () => { const i2 = this.pairings.getAll().filter((s) => mt$1(s.expiry)); await Promise.all(i2.map((s) => this.deletePairing(s.topic))); }, this.onRelayEventRequest = (i2) => { - const { topic: s, payload: r } = i2; - switch (r.method) { + const { topic: s, payload: r2 } = i2; + switch (r2.method) { case "wc_pairingPing": - return this.onPairingPingRequest(s, r); + return this.onPairingPingRequest(s, r2); case "wc_pairingDelete": - return this.onPairingDeleteRequest(s, r); + return this.onPairingDeleteRequest(s, r2); default: - return this.onUnknownRpcMethodRequest(s, r); + return this.onUnknownRpcMethodRequest(s, r2); } }, this.onRelayEventResponse = async (i2) => { - const { topic: s, payload: r } = i2, o = (await this.core.history.get(s, r.id)).request.method; - switch (o) { + const { topic: s, payload: r2 } = i2, o2 = (await this.core.history.get(s, r2.id)).request.method; + switch (o2) { case "wc_pairingPing": - return this.onPairingPingResponse(s, r); + return this.onPairingPingResponse(s, r2); default: - return this.onUnknownRpcMethodResponse(o); + return this.onUnknownRpcMethodResponse(o2); } }, this.onPairingPingRequest = async (i2, s) => { - const { id: r } = s; + const { id: r2 } = s; try { - this.isValidPing({ topic: i2 }), await this.sendResult(r, i2, true), this.events.emit(V.ping, { id: r, topic: i2 }); - } catch (o) { - await this.sendError(r, i2, o), this.logger.error(o); + this.isValidPing({ topic: i2 }), await this.sendResult(r2, i2, true), this.events.emit(V.ping, { id: r2, topic: i2 }); + } catch (o2) { + await this.sendError(r2, i2, o2), this.logger.error(o2); } }, this.onPairingPingResponse = (i2, s) => { - const { id: r } = s; + const { id: r2 } = s; setTimeout(() => { - isJsonRpcResult(s) ? this.events.emit(yt$1("pairing_ping", r), {}) : isJsonRpcError(s) && this.events.emit(yt$1("pairing_ping", r), { error: s.error }); + isJsonRpcResult(s) ? this.events.emit(yt$1("pairing_ping", r2), {}) : isJsonRpcError(s) && this.events.emit(yt$1("pairing_ping", r2), { error: s.error }); }, 500); }, this.onPairingDeleteRequest = async (i2, s) => { - const { id: r } = s; + const { id: r2 } = s; try { - this.isValidDisconnect({ topic: i2 }), await this.deletePairing(i2), this.events.emit(V.delete, { id: r, topic: i2 }); - } catch (o) { - await this.sendError(r, i2, o), this.logger.error(o); + this.isValidDisconnect({ topic: i2 }), await this.deletePairing(i2), this.events.emit(V.delete, { id: r2, topic: i2 }); + } catch (o2) { + await this.sendError(r2, i2, o2), this.logger.error(o2); } }, this.onUnknownRpcMethodRequest = async (i2, s) => { - const { id: r, method: o } = s; + const { id: r2, method: o2 } = s; try { - if (this.registeredMethods.includes(o)) + if (this.registeredMethods.includes(o2)) return; - const a3 = U$2("WC_METHOD_UNSUPPORTED", o); - await this.sendError(r, i2, a3), this.logger.error(a3); + const a3 = U$2("WC_METHOD_UNSUPPORTED", o2); + await this.sendError(r2, i2, a3), this.logger.error(a3); } catch (a3) { - await this.sendError(r, i2, a3), this.logger.error(a3); + await this.sendError(r2, i2, a3), this.logger.error(a3); } }, this.onUnknownRpcMethodResponse = (i2) => { this.registeredMethods.includes(i2) || this.logger.error(U$2("WC_METHOD_UNSUPPORTED", i2)); }, this.isValidPair = (i2) => { var s; if (!Gt$1(i2)) { - const { message: o } = N$2("MISSING_OR_INVALID", `pair() params: ${i2}`); - throw new Error(o); + const { message: o2 } = N$2("MISSING_OR_INVALID", `pair() params: ${i2}`); + throw new Error(o2); } if (!Kt$1(i2.uri)) { - const { message: o } = N$2("MISSING_OR_INVALID", `pair() uri: ${i2.uri}`); - throw new Error(o); + const { message: o2 } = N$2("MISSING_OR_INVALID", `pair() uri: ${i2.uri}`); + throw new Error(o2); } - const r = Pt$1(i2.uri); - if (!((s = r == null ? void 0 : r.relay) != null && s.protocol)) { - const { message: o } = N$2("MISSING_OR_INVALID", "pair() uri#relay-protocol"); - throw new Error(o); + const r2 = Pt$1(i2.uri); + if (!((s = r2 == null ? void 0 : r2.relay) != null && s.protocol)) { + const { message: o2 } = N$2("MISSING_OR_INVALID", "pair() uri#relay-protocol"); + throw new Error(o2); } - if (!(r != null && r.symKey)) { - const { message: o } = N$2("MISSING_OR_INVALID", "pair() uri#symKey"); - throw new Error(o); + if (!(r2 != null && r2.symKey)) { + const { message: o2 } = N$2("MISSING_OR_INVALID", "pair() uri#symKey"); + throw new Error(o2); } - if (r != null && r.expiryTimestamp && cjs$4.toMiliseconds(r == null ? void 0 : r.expiryTimestamp) < Date.now()) { - const { message: o } = N$2("EXPIRED", "pair() URI has expired. Please try again with a new connection URI."); - throw new Error(o); + if (r2 != null && r2.expiryTimestamp && cjs$4.toMiliseconds(r2 == null ? void 0 : r2.expiryTimestamp) < Date.now()) { + const { message: o2 } = N$2("EXPIRED", "pair() URI has expired. Please try again with a new connection URI."); + throw new Error(o2); } }, this.isValidPing = async (i2) => { if (!Gt$1(i2)) { - const { message: r } = N$2("MISSING_OR_INVALID", `ping() params: ${i2}`); - throw new Error(r); + const { message: r2 } = N$2("MISSING_OR_INVALID", `ping() params: ${i2}`); + throw new Error(r2); } const { topic: s } = i2; await this.isValidPairingTopic(s); }, this.isValidDisconnect = async (i2) => { if (!Gt$1(i2)) { - const { message: r } = N$2("MISSING_OR_INVALID", `disconnect() params: ${i2}`); - throw new Error(r); + const { message: r2 } = N$2("MISSING_OR_INVALID", `disconnect() params: ${i2}`); + throw new Error(r2); } const { topic: s } = i2; await this.isValidPairingTopic(s); }, this.isValidPairingTopic = async (i2) => { - if (!g$5(i2, false)) { + if (!g$6(i2, false)) { const { message: s } = N$2("MISSING_OR_INVALID", `pairing topic should be a string: ${i2}`); throw new Error(s); } @@ -9841,57 +9841,57 @@ class Bt { const { message: s } = N$2("EXPIRED", `pairing topic: ${i2}`); throw new Error(s); } - }, this.core = e, this.logger = E$2(t, this.name), this.pairings = new Kt(this.core, this.logger, this.name, this.storagePrefix); + }, this.core = e2, this.logger = E$3(t, this.name), this.pairings = new Kt(this.core, this.logger, this.name, this.storagePrefix); } get context() { return y$2(this.logger); } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } registerRelayerEvents() { - this.core.relayer.on(D$2.message, async (e) => { - const { topic: t, message: i2 } = e; + this.core.relayer.on(D$2.message, async (e2) => { + const { topic: t, message: i2 } = e2; if (!this.pairings.keys.includes(t) || this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i2))) return; const s = await this.core.crypto.decode(t, i2); try { isJsonRpcRequest(s) ? (this.core.history.set(t, s), this.onRelayEventRequest({ topic: t, payload: s })) : isJsonRpcResponse(s) && (await this.core.history.resolve(s), await this.onRelayEventResponse({ topic: t, payload: s }), this.core.history.delete(t, s.id)); - } catch (r) { - this.logger.error(r); + } catch (r2) { + this.logger.error(r2); } }); } registerExpirerEvents() { - this.core.expirer.on(v$1.expired, async (e) => { - const { topic: t } = ft$2(e.target); + this.core.expirer.on(v$2.expired, async (e2) => { + const { topic: t } = ft$2(e2.target); t && this.pairings.keys.includes(t) && (await this.deletePairing(t, true), this.events.emit(V.expire, { topic: t })); }); } } class Vt extends h$1 { - constructor(e, t) { - super(e, t), this.core = e, this.logger = t, this.records = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = vt, this.version = It, this.cached = [], this.initialized = false, this.storagePrefix = O$1, this.init = async () => { + constructor(e2, t) { + super(e2, t), this.core = e2, this.logger = t, this.records = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = vt, this.version = It, this.cached = [], this.initialized = false, this.storagePrefix = O$2, this.init = async () => { this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((i2) => this.records.set(i2.id, i2)), this.cached = [], this.registerEventListeners(), this.initialized = true); - }, this.set = (i2, s, r) => { - if (this.isInitialized(), this.logger.debug("Setting JSON-RPC request history record"), this.logger.trace({ type: "method", method: "set", topic: i2, request: s, chainId: r }), this.records.has(s.id)) + }, this.set = (i2, s, r2) => { + if (this.isInitialized(), this.logger.debug("Setting JSON-RPC request history record"), this.logger.trace({ type: "method", method: "set", topic: i2, request: s, chainId: r2 }), this.records.has(s.id)) return; - const o = { id: s.id, topic: i2, request: { method: s.method, params: s.params || null }, chainId: r, expiry: pt$1(cjs$4.THIRTY_DAYS) }; - this.records.set(o.id, o), this.events.emit(R$1.created, o); + const o2 = { id: s.id, topic: i2, request: { method: s.method, params: s.params || null }, chainId: r2, expiry: pt$1(cjs$4.THIRTY_DAYS) }; + this.records.set(o2.id, o2), this.events.emit(R$1.created, o2); }, this.resolve = async (i2) => { if (this.isInitialized(), this.logger.debug("Updating JSON-RPC response history record"), this.logger.trace({ type: "method", method: "update", response: i2 }), !this.records.has(i2.id)) return; const s = await this.getRecord(i2.id); typeof s.response > "u" && (s.response = isJsonRpcError(i2) ? { error: i2.error } : { result: i2.result }, this.records.set(s.id, s), this.events.emit(R$1.updated, s)); }, this.get = async (i2, s) => (this.isInitialized(), this.logger.debug("Getting record"), this.logger.trace({ type: "method", method: "get", topic: i2, id: s }), await this.getRecord(s)), this.delete = (i2, s) => { - this.isInitialized(), this.logger.debug("Deleting record"), this.logger.trace({ type: "method", method: "delete", id: s }), this.values.forEach((r) => { - if (r.topic === i2) { - if (typeof s < "u" && r.id !== s) + this.isInitialized(), this.logger.debug("Deleting record"), this.logger.trace({ type: "method", method: "delete", id: s }), this.values.forEach((r2) => { + if (r2.topic === i2) { + if (typeof s < "u" && r2.id !== s) return; - this.records.delete(r.id), this.events.emit(R$1.deleted, r); + this.records.delete(r2.id), this.events.emit(R$1.deleted, r2); } }); }, this.exists = async (i2, s) => (this.isInitialized(), this.records.has(s) ? (await this.getRecord(s)).topic === i2 : false), this.on = (i2, s) => { @@ -9902,7 +9902,7 @@ class Vt extends h$1 { this.events.off(i2, s); }, this.removeListener = (i2, s) => { this.events.removeListener(i2, s); - }, this.logger = E$2(t, this.name); + }, this.logger = E$3(t, this.name); } get context() { return y$2(this.logger); @@ -9920,25 +9920,25 @@ class Vt extends h$1 { return Array.from(this.records.values()); } get pending() { - const e = []; + const e2 = []; return this.values.forEach((t) => { if (typeof t.response < "u") return; const i2 = { topic: t.topic, request: formatJsonRpcRequest(t.request.method, t.request.params, t.id), chainId: t.chainId }; - return e.push(i2); - }), e; + return e2.push(i2); + }), e2; } - async setJsonRpcRecords(e) { - await this.core.storage.setItem(this.storageKey, e); + async setJsonRpcRecords(e2) { + await this.core.storage.setItem(this.storageKey, e2); } async getJsonRpcRecords() { return await this.core.storage.getItem(this.storageKey); } - getRecord(e) { + getRecord(e2) { this.isInitialized(); - const t = this.records.get(e); + const t = this.records.get(e2); if (!t) { - const { message: i2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${e}`); + const { message: i2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${e2}`); throw new Error(i2); } return t; @@ -9948,51 +9948,51 @@ class Vt extends h$1 { } async restore() { try { - const e = await this.getJsonRpcRecords(); - if (typeof e > "u" || !e.length) + const e2 = await this.getJsonRpcRecords(); + if (typeof e2 > "u" || !e2.length) return; if (this.records.size) { const { message: t } = N$2("RESTORE_WILL_OVERRIDE", this.name); throw this.logger.error(t), new Error(t); } - this.cached = e, this.logger.debug(`Successfully Restored records for ${this.name}`), this.logger.trace({ type: "method", method: "restore", records: this.values }); - } catch (e) { - this.logger.debug(`Failed to Restore records for ${this.name}`), this.logger.error(e); + this.cached = e2, this.logger.debug(`Successfully Restored records for ${this.name}`), this.logger.trace({ type: "method", method: "restore", records: this.values }); + } catch (e2) { + this.logger.debug(`Failed to Restore records for ${this.name}`), this.logger.error(e2); } } registerEventListeners() { - this.events.on(R$1.created, (e) => { + this.events.on(R$1.created, (e2) => { const t = R$1.created; - this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e }), this.persist(); - }), this.events.on(R$1.updated, (e) => { + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e2 }), this.persist(); + }), this.events.on(R$1.updated, (e2) => { const t = R$1.updated; - this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e }), this.persist(); - }), this.events.on(R$1.deleted, (e) => { + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e2 }), this.persist(); + }), this.events.on(R$1.deleted, (e2) => { const t = R$1.deleted; - this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e }), this.persist(); + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, record: e2 }), this.persist(); }), this.core.heartbeat.on(cjs$1.HEARTBEAT_EVENTS.pulse, () => { this.cleanup(); }); } cleanup() { try { - this.records.forEach((e) => { - cjs$4.toMiliseconds(e.expiry || 0) - Date.now() <= 0 && (this.logger.info(`Deleting expired history log: ${e.id}`), this.delete(e.topic, e.id)); + this.records.forEach((e2) => { + cjs$4.toMiliseconds(e2.expiry || 0) - Date.now() <= 0 && (this.logger.info(`Deleting expired history log: ${e2.id}`), this.delete(e2.topic, e2.id)); }); - } catch (e) { - this.logger.warn(e); + } catch (e2) { + this.logger.warn(e2); } } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } } -class qt extends E$1 { - constructor(e, t) { - super(e, t), this.core = e, this.logger = t, this.expirations = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = Ct$1, this.version = Rt, this.cached = [], this.initialized = false, this.storagePrefix = O$1, this.init = async () => { +class qt extends E$2 { + constructor(e2, t) { + super(e2, t), this.core = e2, this.logger = t, this.expirations = /* @__PURE__ */ new Map(), this.events = new eventsExports.EventEmitter(), this.name = Ct$1, this.version = Rt, this.cached = [], this.initialized = false, this.storagePrefix = O$2, this.init = async () => { this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach((i2) => this.expirations.set(i2.target, i2)), this.cached = [], this.registerEventListeners(), this.initialized = true); }, this.has = (i2) => { try { @@ -10003,16 +10003,16 @@ class qt extends E$1 { } }, this.set = (i2, s) => { this.isInitialized(); - const r = this.formatTarget(i2), o = { target: r, expiry: s }; - this.expirations.set(r, o), this.checkExpiry(r, o), this.events.emit(v$1.created, { target: r, expiration: o }); + const r2 = this.formatTarget(i2), o2 = { target: r2, expiry: s }; + this.expirations.set(r2, o2), this.checkExpiry(r2, o2), this.events.emit(v$2.created, { target: r2, expiration: o2 }); }, this.get = (i2) => { this.isInitialized(); const s = this.formatTarget(i2); return this.getExpiration(s); }, this.del = (i2) => { if (this.isInitialized(), this.has(i2)) { - const s = this.formatTarget(i2), r = this.getExpiration(s); - this.expirations.delete(s), this.events.emit(v$1.deleted, { target: s, expiration: r }); + const s = this.formatTarget(i2), r2 = this.getExpiration(s); + this.expirations.delete(s), this.events.emit(v$2.deleted, { target: s, expiration: r2 }); } }, this.on = (i2, s) => { this.events.on(i2, s); @@ -10022,7 +10022,7 @@ class qt extends E$1 { this.events.off(i2, s); }, this.removeListener = (i2, s) => { this.events.removeListener(i2, s); - }, this.logger = E$2(t, this.name); + }, this.logger = E$3(t, this.name); } get context() { return y$2(this.logger); @@ -10039,92 +10039,92 @@ class qt extends E$1 { get values() { return Array.from(this.expirations.values()); } - formatTarget(e) { - if (typeof e == "string") - return lt$1(e); - if (typeof e == "number") - return dt$1(e); - const { message: t } = N$2("UNKNOWN_TYPE", `Target type: ${typeof e}`); + formatTarget(e2) { + if (typeof e2 == "string") + return lt$1(e2); + if (typeof e2 == "number") + return dt$1(e2); + const { message: t } = N$2("UNKNOWN_TYPE", `Target type: ${typeof e2}`); throw new Error(t); } - async setExpirations(e) { - await this.core.storage.setItem(this.storageKey, e); + async setExpirations(e2) { + await this.core.storage.setItem(this.storageKey, e2); } async getExpirations() { return await this.core.storage.getItem(this.storageKey); } async persist() { - await this.setExpirations(this.values), this.events.emit(v$1.sync); + await this.setExpirations(this.values), this.events.emit(v$2.sync); } async restore() { try { - const e = await this.getExpirations(); - if (typeof e > "u" || !e.length) + const e2 = await this.getExpirations(); + if (typeof e2 > "u" || !e2.length) return; if (this.expirations.size) { const { message: t } = N$2("RESTORE_WILL_OVERRIDE", this.name); throw this.logger.error(t), new Error(t); } - this.cached = e, this.logger.debug(`Successfully Restored expirations for ${this.name}`), this.logger.trace({ type: "method", method: "restore", expirations: this.values }); - } catch (e) { - this.logger.debug(`Failed to Restore expirations for ${this.name}`), this.logger.error(e); + this.cached = e2, this.logger.debug(`Successfully Restored expirations for ${this.name}`), this.logger.trace({ type: "method", method: "restore", expirations: this.values }); + } catch (e2) { + this.logger.debug(`Failed to Restore expirations for ${this.name}`), this.logger.error(e2); } } - getExpiration(e) { - const t = this.expirations.get(e); + getExpiration(e2) { + const t = this.expirations.get(e2); if (!t) { - const { message: i2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${e}`); + const { message: i2 } = N$2("NO_MATCHING_KEY", `${this.name}: ${e2}`); throw this.logger.error(i2), new Error(i2); } return t; } - checkExpiry(e, t) { + checkExpiry(e2, t) { const { expiry: i2 } = t; - cjs$4.toMiliseconds(i2) - Date.now() <= 0 && this.expire(e, t); + cjs$4.toMiliseconds(i2) - Date.now() <= 0 && this.expire(e2, t); } - expire(e, t) { - this.expirations.delete(e), this.events.emit(v$1.expired, { target: e, expiration: t }); + expire(e2, t) { + this.expirations.delete(e2), this.events.emit(v$2.expired, { target: e2, expiration: t }); } checkExpirations() { - this.core.relayer.connected && this.expirations.forEach((e, t) => this.checkExpiry(t, e)); + this.core.relayer.connected && this.expirations.forEach((e2, t) => this.checkExpiry(t, e2)); } registerEventListeners() { - this.core.heartbeat.on(cjs$1.HEARTBEAT_EVENTS.pulse, () => this.checkExpirations()), this.events.on(v$1.created, (e) => { - const t = v$1.created; - this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), this.persist(); - }), this.events.on(v$1.expired, (e) => { - const t = v$1.expired; - this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), this.persist(); - }), this.events.on(v$1.deleted, (e) => { - const t = v$1.deleted; - this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e }), this.persist(); + this.core.heartbeat.on(cjs$1.HEARTBEAT_EVENTS.pulse, () => this.checkExpirations()), this.events.on(v$2.created, (e2) => { + const t = v$2.created; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e2 }), this.persist(); + }), this.events.on(v$2.expired, (e2) => { + const t = v$2.expired; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e2 }), this.persist(); + }), this.events.on(v$2.deleted, (e2) => { + const t = v$2.deleted; + this.logger.info(`Emitting ${t}`), this.logger.debug({ type: "event", event: t, data: e2 }), this.persist(); }); } isInitialized() { if (!this.initialized) { - const { message: e } = N$2("NOT_INITIALIZED", this.name); - throw new Error(e); + const { message: e2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(e2); } } } class jt extends y$1 { - constructor(e, t) { - super(e, t), this.projectId = e, this.logger = t, this.name = Z, this.initialized = false, this.queue = [], this.verifyDisabled = false, this.init = async (i2) => { + constructor(e2, t) { + super(e2, t), this.projectId = e2, this.logger = t, this.name = Z, this.initialized = false, this.queue = [], this.verifyDisabled = false, this.init = async (i2) => { if (this.verifyDisabled || $$2() || !D$4()) return; const s = this.getVerifyUrl(i2 == null ? void 0 : i2.verifyUrl); this.verifyUrl !== s && this.removeIframe(), this.verifyUrl = s; try { await this.createIframe(); - } catch (r) { - this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`), this.logger.info(r); + } catch (r2) { + this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`), this.logger.info(r2); } if (!this.initialized) { this.removeIframe(), this.verifyUrl = ee; try { await this.createIframe(); - } catch (r) { - this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`), this.logger.info(r), this.verifyDisabled = true; + } catch (r2) { + this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`), this.logger.info(r2), this.verifyDisabled = true; } } }, this.register = async (i2) => { @@ -10133,17 +10133,17 @@ class jt extends y$1 { if (this.isDevEnv) return ""; const s = this.getVerifyUrl(i2 == null ? void 0 : i2.verifyUrl); - let r; + let r2; try { - r = await this.fetchAttestation(i2.attestationId, s); - } catch (o) { - this.logger.info(`failed to resolve attestation: ${i2.attestationId} from url: ${s}`), this.logger.info(o), r = await this.fetchAttestation(i2.attestationId, ee); + r2 = await this.fetchAttestation(i2.attestationId, s); + } catch (o2) { + this.logger.info(`failed to resolve attestation: ${i2.attestationId} from url: ${s}`), this.logger.info(o2), r2 = await this.fetchAttestation(i2.attestationId, ee); } - return r; + return r2; }, this.fetchAttestation = async (i2, s) => { this.logger.info(`resolving attestation: ${i2} from url: ${s}`); - const r = this.startAbortTimer(cjs$4.ONE_SECOND * 2), o = await fetch(`${s}/attestation/${i2}`, { signal: this.abortController.signal }); - return clearTimeout(r), o.status === 200 ? await o.json() : void 0; + const r2 = this.startAbortTimer(cjs$4.ONE_SECOND * 2), o2 = await fetch(`${s}/attestation/${i2}`, { signal: this.abortController.signal }); + return clearTimeout(r2), o2.status === 200 ? await o2.json() : void 0; }, this.addToQueue = (i2) => { this.queue.push(i2); }, this.processQueue = () => { @@ -10158,56 +10158,56 @@ class jt extends y$1 { } }, this.createIframe = async () => { let i2; - const s = (r) => { - r.data === "verify_ready" && (this.initialized = true, this.processQueue(), window.removeEventListener("message", s), i2()); + const s = (r2) => { + r2.data === "verify_ready" && (this.initialized = true, this.processQueue(), window.removeEventListener("message", s), i2()); }; - await Promise.race([new Promise((r) => { + await Promise.race([new Promise((r2) => { if (document.getElementById(Z)) - return r(); + return r2(); window.addEventListener("message", s); - const o = document.createElement("iframe"); - o.id = Z, o.src = `${this.verifyUrl}/${this.projectId}`, o.style.display = "none", document.body.append(o), this.iframe = o, i2 = r; - }), new Promise((r, o) => setTimeout(() => { - window.removeEventListener("message", s), o("verify iframe load timeout"); + const o2 = document.createElement("iframe"); + o2.id = Z, o2.src = `${this.verifyUrl}/${this.projectId}`, o2.style.display = "none", document.body.append(o2), this.iframe = o2, i2 = r2; + }), new Promise((r2, o2) => setTimeout(() => { + window.removeEventListener("message", s), o2("verify iframe load timeout"); }, cjs$4.toMiliseconds(cjs$4.FIVE_SECONDS)))]); }, this.removeIframe = () => { this.iframe && (this.iframe.remove(), this.iframe = void 0, this.initialized = false); }, this.getVerifyUrl = (i2) => { let s = i2 || F$1; return _t.includes(s) || (this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${F$1}`), s = F$1), s; - }, this.logger = E$2(t, this.name), this.verifyUrl = F$1, this.abortController = new AbortController(), this.isDevEnv = te$1() && define_process_env_default.IS_VITEST; + }, this.logger = E$3(t, this.name), this.verifyUrl = F$1, this.abortController = new AbortController(), this.isDevEnv = te$1() && define_process_env_default.IS_VITEST; } get context() { return y$2(this.logger); } - startAbortTimer(e) { - return this.abortController = new AbortController(), setTimeout(() => this.abortController.abort(), cjs$4.toMiliseconds(e)); + startAbortTimer(e2) { + return this.abortController = new AbortController(), setTimeout(() => this.abortController.abort(), cjs$4.toMiliseconds(e2)); } } -class Gt extends v$2 { - constructor(e, t) { - super(e, t), this.projectId = e, this.logger = t, this.context = Tt, this.registerDeviceToken = async (i2) => { - const { clientId: s, token: r, notificationType: o, enableEncrypted: a3 = false } = i2, h4 = `${St}/${this.projectId}/clients`; - await Yi(h4, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client_id: s, type: o, token: r, always_raw: a3 }) }); - }, this.logger = E$2(t, this.context); +class Gt extends v$3 { + constructor(e2, t) { + super(e2, t), this.projectId = e2, this.logger = t, this.context = Tt, this.registerDeviceToken = async (i2) => { + const { clientId: s, token: r2, notificationType: o2, enableEncrypted: a3 = false } = i2, h4 = `${St}/${this.projectId}/clients`; + await Yi(h4, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client_id: s, type: o2, token: r2, always_raw: a3 }) }); + }, this.logger = E$3(t, this.context); } } -var Lr = Object.defineProperty, Yt = Object.getOwnPropertySymbols, $r = Object.prototype.hasOwnProperty, Fr = Object.prototype.propertyIsEnumerable, Ht = (n2, e, t) => e in n2 ? Lr(n2, e, { enumerable: true, configurable: true, writable: true, value: t }) : n2[e] = t, Jt = (n2, e) => { - for (var t in e || (e = {})) - $r.call(e, t) && Ht(n2, t, e[t]); +var Lr = Object.defineProperty, Yt = Object.getOwnPropertySymbols, $r = Object.prototype.hasOwnProperty, Fr = Object.prototype.propertyIsEnumerable, Ht = (n3, e2, t) => e2 in n3 ? Lr(n3, e2, { enumerable: true, configurable: true, writable: true, value: t }) : n3[e2] = t, Jt = (n3, e2) => { + for (var t in e2 || (e2 = {})) + $r.call(e2, t) && Ht(n3, t, e2[t]); if (Yt) - for (var t of Yt(e)) - Fr.call(e, t) && Ht(n2, t, e[t]); - return n2; + for (var t of Yt(e2)) + Fr.call(e2, t) && Ht(n3, t, e2[t]); + return n3; }; -class te extends n { - constructor(e) { - super(e), this.protocol = le$1, this.version = We, this.name = Q$2, this.events = new eventsExports.EventEmitter(), this.initialized = false, this.on = (i2, s) => this.events.on(i2, s), this.once = (i2, s) => this.events.once(i2, s), this.off = (i2, s) => this.events.off(i2, s), this.removeListener = (i2, s) => this.events.removeListener(i2, s), this.projectId = e == null ? void 0 : e.projectId, this.relayUrl = (e == null ? void 0 : e.relayUrl) || ge$2, this.customStoragePrefix = e != null && e.customStoragePrefix ? `:${e.customStoragePrefix}` : ""; - const t = typeof (e == null ? void 0 : e.logger) < "u" && typeof (e == null ? void 0 : e.logger) != "string" ? e.logger : Hg(k({ level: (e == null ? void 0 : e.logger) || Qe.logger })); - this.logger = E$2(t, this.name), this.heartbeat = new cjs$1.HeartBeat(), this.crypto = new xt(this, this.logger, e == null ? void 0 : e.keychain), this.history = new Vt(this, this.logger), this.expirer = new qt(this, this.logger), this.storage = e != null && e.storage ? e.storage : new h$2(Jt(Jt({}, Ze), e == null ? void 0 : e.storageOptions)), this.relayer = new $t({ core: this, logger: this.logger, relayUrl: this.relayUrl, projectId: this.projectId }), this.pairing = new Bt(this, this.logger), this.verify = new jt(this.projectId || "", this.logger), this.echoClient = new Gt(this.projectId || "", this.logger); - } - static async init(e) { - const t = new te(e); +class te extends n$1 { + constructor(e2) { + super(e2), this.protocol = le$1, this.version = We, this.name = Q$2, this.events = new eventsExports.EventEmitter(), this.initialized = false, this.on = (i2, s) => this.events.on(i2, s), this.once = (i2, s) => this.events.once(i2, s), this.off = (i2, s) => this.events.off(i2, s), this.removeListener = (i2, s) => this.events.removeListener(i2, s), this.projectId = e2 == null ? void 0 : e2.projectId, this.relayUrl = (e2 == null ? void 0 : e2.relayUrl) || ge$2, this.customStoragePrefix = e2 != null && e2.customStoragePrefix ? `:${e2.customStoragePrefix}` : ""; + const t = typeof (e2 == null ? void 0 : e2.logger) < "u" && typeof (e2 == null ? void 0 : e2.logger) != "string" ? e2.logger : Hg(k({ level: (e2 == null ? void 0 : e2.logger) || Qe.logger })); + this.logger = E$3(t, this.name), this.heartbeat = new cjs$1.HeartBeat(), this.crypto = new xt(this, this.logger, e2 == null ? void 0 : e2.keychain), this.history = new Vt(this, this.logger), this.expirer = new qt(this, this.logger), this.storage = e2 != null && e2.storage ? e2.storage : new h$2(Jt(Jt({}, Ze), e2 == null ? void 0 : e2.storageOptions)), this.relayer = new $t({ core: this, logger: this.logger, relayUrl: this.relayUrl, projectId: this.projectId }), this.pairing = new Bt(this, this.logger), this.verify = new jt(this.projectId || "", this.logger), this.echoClient = new Gt(this.projectId || "", this.logger); + } + static async init(e2) { + const t = new te(e2); await t.initialize(); const i2 = await t.crypto.getClientId(); return await t.storage.setItem(yt, i2), t; @@ -10222,117 +10222,117 @@ class te extends n { this.logger.trace("Initialized"); try { await this.crypto.init(), await this.history.init(), await this.expirer.init(), await this.relayer.init(), await this.heartbeat.init(), await this.pairing.init(), this.initialized = true, this.logger.info("Core Initialization Success"); - } catch (e) { - throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`, e), this.logger.error(e.message), e; + } catch (e2) { + throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`, e2), this.logger.error(e2.message), e2; } } } const Mr = te; -const J = "wc", F = 2, X = "client", G$1 = `${J}@${F}:${X}:`, M$1 = { name: X, logger: "error", controller: false, relayUrl: "wss://relay.walletconnect.com" }, H = "WALLETCONNECT_DEEPLINK_CHOICE", oe = "proposal", ae = "Proposal expired", ce = "session", L$1 = cjs$4.SEVEN_DAYS, le = "engine", R = { wc_sessionPropose: { req: { ttl: cjs$4.FIVE_MINUTES, prompt: true, tag: 1100 }, res: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1101 } }, wc_sessionSettle: { req: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1102 }, res: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1103 } }, wc_sessionUpdate: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1104 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1105 } }, wc_sessionExtend: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1106 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1107 } }, wc_sessionRequest: { req: { ttl: cjs$4.FIVE_MINUTES, prompt: true, tag: 1108 }, res: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1109 } }, wc_sessionEvent: { req: { ttl: cjs$4.FIVE_MINUTES, prompt: true, tag: 1110 }, res: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1111 } }, wc_sessionDelete: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1112 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1113 } }, wc_sessionPing: { req: { ttl: cjs$4.THIRTY_SECONDS, prompt: false, tag: 1114 }, res: { ttl: cjs$4.THIRTY_SECONDS, prompt: false, tag: 1115 } } }, U$1 = { min: cjs$4.FIVE_MINUTES, max: cjs$4.SEVEN_DAYS }, I = { idle: "IDLE", active: "ACTIVE" }, pe = "request", he = ["wc_sessionPropose", "wc_sessionRequest", "wc_authRequest"]; -var as = Object.defineProperty, cs = Object.defineProperties, ls = Object.getOwnPropertyDescriptors, de = Object.getOwnPropertySymbols, ps = Object.prototype.hasOwnProperty, hs = Object.prototype.propertyIsEnumerable, ue = (w3, r, e) => r in w3 ? as(w3, r, { enumerable: true, configurable: true, writable: true, value: e }) : w3[r] = e, g$1 = (w3, r) => { - for (var e in r || (r = {})) - ps.call(r, e) && ue(w3, e, r[e]); +const J = "wc", F = 2, X = "client", G$1 = `${J}@${F}:${X}:`, M$1 = { name: X, logger: "error", controller: false, relayUrl: "wss://relay.walletconnect.com" }, H = "WALLETCONNECT_DEEPLINK_CHOICE", oe = "proposal", ae = "Proposal expired", ce = "session", L$2 = cjs$4.SEVEN_DAYS, le = "engine", R = { wc_sessionPropose: { req: { ttl: cjs$4.FIVE_MINUTES, prompt: true, tag: 1100 }, res: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1101 } }, wc_sessionSettle: { req: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1102 }, res: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1103 } }, wc_sessionUpdate: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1104 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1105 } }, wc_sessionExtend: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1106 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1107 } }, wc_sessionRequest: { req: { ttl: cjs$4.FIVE_MINUTES, prompt: true, tag: 1108 }, res: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1109 } }, wc_sessionEvent: { req: { ttl: cjs$4.FIVE_MINUTES, prompt: true, tag: 1110 }, res: { ttl: cjs$4.FIVE_MINUTES, prompt: false, tag: 1111 } }, wc_sessionDelete: { req: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1112 }, res: { ttl: cjs$4.ONE_DAY, prompt: false, tag: 1113 } }, wc_sessionPing: { req: { ttl: cjs$4.THIRTY_SECONDS, prompt: false, tag: 1114 }, res: { ttl: cjs$4.THIRTY_SECONDS, prompt: false, tag: 1115 } } }, U$1 = { min: cjs$4.FIVE_MINUTES, max: cjs$4.SEVEN_DAYS }, I = { idle: "IDLE", active: "ACTIVE" }, pe = "request", he = ["wc_sessionPropose", "wc_sessionRequest", "wc_authRequest"]; +var as = Object.defineProperty, cs = Object.defineProperties, ls = Object.getOwnPropertyDescriptors, de = Object.getOwnPropertySymbols, ps = Object.prototype.hasOwnProperty, hs = Object.prototype.propertyIsEnumerable, ue = (w3, r2, e2) => r2 in w3 ? as(w3, r2, { enumerable: true, configurable: true, writable: true, value: e2 }) : w3[r2] = e2, g$2 = (w3, r2) => { + for (var e2 in r2 || (r2 = {})) + ps.call(r2, e2) && ue(w3, e2, r2[e2]); if (de) - for (var e of de(r)) - hs.call(r, e) && ue(w3, e, r[e]); + for (var e2 of de(r2)) + hs.call(r2, e2) && ue(w3, e2, r2[e2]); return w3; -}, D$1 = (w3, r) => cs(w3, ls(r)); -class ds extends w$2 { - constructor(r) { - super(r), this.name = le, this.events = new Ug(), this.initialized = false, this.ignoredPayloadTypes = [_$3], this.requestQueue = { state: I.idle, queue: [] }, this.sessionRequestQueue = { state: I.idle, queue: [] }, this.requestQueueDelay = cjs$4.ONE_SECOND, this.init = async () => { +}, D$1 = (w3, r2) => cs(w3, ls(r2)); +class ds extends w$3 { + constructor(r2) { + super(r2), this.name = le, this.events = new Ug(), this.initialized = false, this.ignoredPayloadTypes = [_$3], this.requestQueue = { state: I.idle, queue: [] }, this.sessionRequestQueue = { state: I.idle, queue: [] }, this.requestQueueDelay = cjs$4.ONE_SECOND, this.init = async () => { this.initialized || (await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.registerPairingEvents(), this.client.core.pairing.register({ methods: Object.keys(R) }), this.initialized = true, setTimeout(() => { this.sessionRequestQueue.queue = this.getPendingSessionRequests(), this.processSessionRequestQueue(); }, cjs$4.toMiliseconds(this.requestQueueDelay))); - }, this.connect = async (e) => { + }, this.connect = async (e2) => { await this.isInitialized(); - const s = D$1(g$1({}, e), { requiredNamespaces: e.requiredNamespaces || {}, optionalNamespaces: e.optionalNamespaces || {} }); + const s = D$1(g$2({}, e2), { requiredNamespaces: e2.requiredNamespaces || {}, optionalNamespaces: e2.optionalNamespaces || {} }); await this.isValidConnect(s); - const { pairingTopic: t, requiredNamespaces: i2, optionalNamespaces: n2, sessionProperties: o, relays: a3 } = s; - let c2 = t, p3, d2 = false; - if (c2 && (d2 = this.client.core.pairing.pairings.get(c2).active), !c2 || !d2) { + const { pairingTopic: t, requiredNamespaces: i2, optionalNamespaces: n3, sessionProperties: o2, relays: a3 } = s; + let c2 = t, p3, d3 = false; + if (c2 && (d3 = this.client.core.pairing.pairings.get(c2).active), !c2 || !d3) { const { topic: T2, uri: _3 } = await this.client.core.pairing.create(); c2 = T2, p3 = _3; } - const h4 = await this.client.core.crypto.generateKeyPair(), N2 = R.wc_sessionPropose.req.ttl || cjs$4.FIVE_MINUTES, m2 = pt$1(N2), f3 = g$1({ requiredNamespaces: i2, optionalNamespaces: n2, relays: a3 ?? [{ protocol: ht }], proposer: { publicKey: h4, metadata: this.client.metadata }, expiryTimestamp: m2 }, o && { sessionProperties: o }), { reject: k2, resolve: O2, done: we } = at$1(N2, ae); + const h4 = await this.client.core.crypto.generateKeyPair(), N2 = R.wc_sessionPropose.req.ttl || cjs$4.FIVE_MINUTES, m2 = pt$1(N2), f4 = g$2({ requiredNamespaces: i2, optionalNamespaces: n3, relays: a3 ?? [{ protocol: ht }], proposer: { publicKey: h4, metadata: this.client.metadata }, expiryTimestamp: m2 }, o2 && { sessionProperties: o2 }), { reject: k2, resolve: O2, done: we } = at$1(N2, ae); if (this.events.once(yt$1("session_connect"), async ({ error: T2, session: _3 }) => { if (T2) k2(T2); else if (_3) { _3.self.publicKey = h4; - const B2 = D$1(g$1({}, _3), { requiredNamespaces: f3.requiredNamespaces, optionalNamespaces: f3.optionalNamespaces }); + const B2 = D$1(g$2({}, _3), { requiredNamespaces: f4.requiredNamespaces, optionalNamespaces: f4.optionalNamespaces }); await this.client.session.set(_3.topic, B2), await this.setExpiry(_3.topic, _3.expiry), c2 && await this.client.core.pairing.updateMetadata({ topic: c2, metadata: _3.peer.metadata }), O2(B2); } }), !c2) { const { message: T2 } = N$2("NO_MATCHING_KEY", `connect() pairing topic: ${c2}`); throw new Error(T2); } - const W2 = await this.sendRequest({ topic: c2, method: "wc_sessionPropose", params: f3, throwOnFailedPublish: true }); - return await this.setProposal(W2, g$1({ id: W2 }, f3)), { uri: p3, approval: we }; - }, this.pair = async (e) => (await this.isInitialized(), await this.client.core.pairing.pair(e)), this.approve = async (e) => { - await this.isInitialized(), await this.isValidApprove(e); - const { id: s, relayProtocol: t, namespaces: i2, sessionProperties: n2 } = e, o = this.client.proposal.get(s); - let { pairingTopic: a3, proposer: c2, requiredNamespaces: p3, optionalNamespaces: d2 } = o; + const W2 = await this.sendRequest({ topic: c2, method: "wc_sessionPropose", params: f4, throwOnFailedPublish: true }); + return await this.setProposal(W2, g$2({ id: W2 }, f4)), { uri: p3, approval: we }; + }, this.pair = async (e2) => (await this.isInitialized(), await this.client.core.pairing.pair(e2)), this.approve = async (e2) => { + await this.isInitialized(), await this.isValidApprove(e2); + const { id: s, relayProtocol: t, namespaces: i2, sessionProperties: n3 } = e2, o2 = this.client.proposal.get(s); + let { pairingTopic: a3, proposer: c2, requiredNamespaces: p3, optionalNamespaces: d3 } = o2; a3 = a3 || ""; const h4 = await this.client.core.crypto.generateKeyPair(), N2 = c2.publicKey, m2 = await this.client.core.crypto.generateSharedKey(h4, N2); a3 && s && (await this.client.core.pairing.updateMetadata({ topic: a3, metadata: c2.metadata }), await this.sendResult({ id: s, topic: a3, result: { relay: { protocol: t ?? "irn" }, responderPublicKey: h4 } }), await this.client.proposal.delete(s, U$2("USER_DISCONNECTED")), await this.client.core.pairing.activate({ topic: a3 })); - const f3 = g$1({ relay: { protocol: t ?? "irn" }, namespaces: i2, pairingTopic: a3, controller: { publicKey: h4, metadata: this.client.metadata }, expiry: pt$1(L$1) }, n2 && { sessionProperties: n2 }); + const f4 = g$2({ relay: { protocol: t ?? "irn" }, namespaces: i2, pairingTopic: a3, controller: { publicKey: h4, metadata: this.client.metadata }, expiry: pt$1(L$2) }, n3 && { sessionProperties: n3 }); await this.client.core.relayer.subscribe(m2); - const k2 = D$1(g$1({}, f3), { topic: m2, requiredNamespaces: p3, optionalNamespaces: d2, pairingTopic: a3, acknowledged: false, self: f3.controller, peer: { publicKey: c2.publicKey, metadata: c2.metadata }, controller: h4 }); + const k2 = D$1(g$2({}, f4), { topic: m2, requiredNamespaces: p3, optionalNamespaces: d3, pairingTopic: a3, acknowledged: false, self: f4.controller, peer: { publicKey: c2.publicKey, metadata: c2.metadata }, controller: h4 }); await this.client.session.set(m2, k2); try { - await this.sendRequest({ topic: m2, method: "wc_sessionSettle", params: f3, throwOnFailedPublish: true }); + await this.sendRequest({ topic: m2, method: "wc_sessionSettle", params: f4, throwOnFailedPublish: true }); } catch (O2) { throw this.client.logger.error(O2), this.client.session.delete(m2, U$2("USER_DISCONNECTED")), await this.client.core.relayer.unsubscribe(m2), O2; } - return await this.setExpiry(m2, pt$1(L$1)), { topic: m2, acknowledged: () => new Promise((O2) => setTimeout(() => O2(this.client.session.get(m2)), 500)) }; - }, this.reject = async (e) => { - await this.isInitialized(), await this.isValidReject(e); - const { id: s, reason: t } = e, { pairingTopic: i2 } = this.client.proposal.get(s); + return await this.setExpiry(m2, pt$1(L$2)), { topic: m2, acknowledged: () => new Promise((O2) => setTimeout(() => O2(this.client.session.get(m2)), 500)) }; + }, this.reject = async (e2) => { + await this.isInitialized(), await this.isValidReject(e2); + const { id: s, reason: t } = e2, { pairingTopic: i2 } = this.client.proposal.get(s); i2 && (await this.sendError(s, i2, t), await this.client.proposal.delete(s, U$2("USER_DISCONNECTED"))); - }, this.update = async (e) => { - await this.isInitialized(), await this.isValidUpdate(e); - const { topic: s, namespaces: t } = e, i2 = await this.sendRequest({ topic: s, method: "wc_sessionUpdate", params: { namespaces: t } }), { done: n2, resolve: o, reject: a3 } = at$1(); + }, this.update = async (e2) => { + await this.isInitialized(), await this.isValidUpdate(e2); + const { topic: s, namespaces: t } = e2, i2 = await this.sendRequest({ topic: s, method: "wc_sessionUpdate", params: { namespaces: t } }), { done: n3, resolve: o2, reject: a3 } = at$1(); return this.events.once(yt$1("session_update", i2), ({ error: c2 }) => { - c2 ? a3(c2) : o(); - }), await this.client.session.update(s, { namespaces: t }), { acknowledged: n2 }; - }, this.extend = async (e) => { - await this.isInitialized(), await this.isValidExtend(e); - const { topic: s } = e, t = await this.sendRequest({ topic: s, method: "wc_sessionExtend", params: {} }), { done: i2, resolve: n2, reject: o } = at$1(); + c2 ? a3(c2) : o2(); + }), await this.client.session.update(s, { namespaces: t }), { acknowledged: n3 }; + }, this.extend = async (e2) => { + await this.isInitialized(), await this.isValidExtend(e2); + const { topic: s } = e2, t = await this.sendRequest({ topic: s, method: "wc_sessionExtend", params: {} }), { done: i2, resolve: n3, reject: o2 } = at$1(); return this.events.once(yt$1("session_extend", t), ({ error: a3 }) => { - a3 ? o(a3) : n2(); - }), await this.setExpiry(s, pt$1(L$1)), { acknowledged: i2 }; - }, this.request = async (e) => { - await this.isInitialized(), await this.isValidRequest(e); - const { chainId: s, request: t, topic: i2, expiry: n2 = R.wc_sessionRequest.req.ttl } = e, o = payloadId(), { done: a3, resolve: c2, reject: p3 } = at$1(n2, "Request expired. Please try again."); - return this.events.once(yt$1("session_request", o), ({ error: d2, result: h4 }) => { - d2 ? p3(d2) : c2(h4); - }), await Promise.all([new Promise(async (d2) => { - await this.sendRequest({ clientRpcId: o, topic: i2, method: "wc_sessionRequest", params: { request: D$1(g$1({}, t), { expiryTimestamp: pt$1(n2) }), chainId: s }, expiry: n2, throwOnFailedPublish: true }).catch((h4) => p3(h4)), this.client.events.emit("session_request_sent", { topic: i2, request: t, chainId: s, id: o }), d2(); - }), new Promise(async (d2) => { + a3 ? o2(a3) : n3(); + }), await this.setExpiry(s, pt$1(L$2)), { acknowledged: i2 }; + }, this.request = async (e2) => { + await this.isInitialized(), await this.isValidRequest(e2); + const { chainId: s, request: t, topic: i2, expiry: n3 = R.wc_sessionRequest.req.ttl } = e2, o2 = payloadId(), { done: a3, resolve: c2, reject: p3 } = at$1(n3, "Request expired. Please try again."); + return this.events.once(yt$1("session_request", o2), ({ error: d3, result: h4 }) => { + d3 ? p3(d3) : c2(h4); + }), await Promise.all([new Promise(async (d3) => { + await this.sendRequest({ clientRpcId: o2, topic: i2, method: "wc_sessionRequest", params: { request: D$1(g$2({}, t), { expiryTimestamp: pt$1(n3) }), chainId: s }, expiry: n3, throwOnFailedPublish: true }).catch((h4) => p3(h4)), this.client.events.emit("session_request_sent", { topic: i2, request: t, chainId: s, id: o2 }), d3(); + }), new Promise(async (d3) => { const h4 = await ht$1(this.client.core.storage, H); - gt$1({ id: o, topic: i2, wcDeepLink: h4 }), d2(); - }), a3()]).then((d2) => d2[2]); - }, this.respond = async (e) => { - await this.isInitialized(), await this.isValidRespond(e); - const { topic: s, response: t } = e, { id: i2 } = t; - isJsonRpcResult(t) ? await this.sendResult({ id: i2, topic: s, result: t.result, throwOnFailedPublish: true }) : isJsonRpcError(t) && await this.sendError(i2, s, t.error), this.cleanupAfterResponse(e); - }, this.ping = async (e) => { - await this.isInitialized(), await this.isValidPing(e); - const { topic: s } = e; + gt$1({ id: o2, topic: i2, wcDeepLink: h4 }), d3(); + }), a3()]).then((d3) => d3[2]); + }, this.respond = async (e2) => { + await this.isInitialized(), await this.isValidRespond(e2); + const { topic: s, response: t } = e2, { id: i2 } = t; + isJsonRpcResult(t) ? await this.sendResult({ id: i2, topic: s, result: t.result, throwOnFailedPublish: true }) : isJsonRpcError(t) && await this.sendError(i2, s, t.error), this.cleanupAfterResponse(e2); + }, this.ping = async (e2) => { + await this.isInitialized(), await this.isValidPing(e2); + const { topic: s } = e2; if (this.client.session.keys.includes(s)) { - const t = await this.sendRequest({ topic: s, method: "wc_sessionPing", params: {} }), { done: i2, resolve: n2, reject: o } = at$1(); + const t = await this.sendRequest({ topic: s, method: "wc_sessionPing", params: {} }), { done: i2, resolve: n3, reject: o2 } = at$1(); this.events.once(yt$1("session_ping", t), ({ error: a3 }) => { - a3 ? o(a3) : n2(); + a3 ? o2(a3) : n3(); }), await i2(); } else this.client.core.pairing.pairings.keys.includes(s) && await this.client.core.pairing.ping({ topic: s }); - }, this.emit = async (e) => { - await this.isInitialized(), await this.isValidEmit(e); - const { topic: s, event: t, chainId: i2 } = e; + }, this.emit = async (e2) => { + await this.isInitialized(), await this.isValidEmit(e2); + const { topic: s, event: t, chainId: i2 } = e2; await this.sendRequest({ topic: s, method: "wc_sessionEvent", params: { event: t, chainId: i2 } }); - }, this.disconnect = async (e) => { - await this.isInitialized(), await this.isValidDisconnect(e); - const { topic: s } = e; + }, this.disconnect = async (e2) => { + await this.isInitialized(), await this.isValidDisconnect(e2); + const { topic: s } = e2; if (this.client.session.keys.includes(s)) await this.sendRequest({ topic: s, method: "wc_sessionDelete", params: U$2("USER_DISCONNECTED"), throwOnFailedPublish: true }), await this.deleteSession({ topic: s, emitEvent: false }); else if (this.client.core.pairing.pairings.keys.includes(s)) @@ -10341,12 +10341,12 @@ class ds extends w$2 { const { message: t } = N$2("MISMATCHED_TOPIC", `Session or pairing topic not found: ${s}`); throw new Error(t); } - }, this.find = (e) => (this.isInitialized(), this.client.session.getAll().filter((s) => Mt$1(s, e))), this.getPendingSessionRequests = () => this.client.pendingRequest.getAll(), this.cleanupDuplicatePairings = async (e) => { - if (e.pairingTopic) + }, this.find = (e2) => (this.isInitialized(), this.client.session.getAll().filter((s) => Mt$1(s, e2))), this.getPendingSessionRequests = () => this.client.pendingRequest.getAll(), this.cleanupDuplicatePairings = async (e2) => { + if (e2.pairingTopic) try { - const s = this.client.core.pairing.pairings.get(e.pairingTopic), t = this.client.core.pairing.pairings.getAll().filter((i2) => { - var n2, o; - return ((n2 = i2.peerMetadata) == null ? void 0 : n2.url) && ((o = i2.peerMetadata) == null ? void 0 : o.url) === e.peer.metadata.url && i2.topic && i2.topic !== s.topic; + const s = this.client.core.pairing.pairings.get(e2.pairingTopic), t = this.client.core.pairing.pairings.getAll().filter((i2) => { + var n3, o2; + return ((n3 = i2.peerMetadata) == null ? void 0 : n3.url) && ((o2 = i2.peerMetadata) == null ? void 0 : o2.url) === e2.peer.metadata.url && i2.topic && i2.topic !== s.topic; }); if (t.length === 0) return; @@ -10354,46 +10354,46 @@ class ds extends w$2 { } catch (s) { this.client.logger.error(s); } - }, this.deleteSession = async (e) => { - const { topic: s, expirerHasDeleted: t = false, emitEvent: i2 = true, id: n2 = 0 } = e, { self: o } = this.client.session.get(s); - await this.client.core.relayer.unsubscribe(s), await this.client.session.delete(s, U$2("USER_DISCONNECTED")), this.client.core.crypto.keychain.has(o.publicKey) && await this.client.core.crypto.deleteKeyPair(o.publicKey), this.client.core.crypto.keychain.has(s) && await this.client.core.crypto.deleteSymKey(s), t || this.client.core.expirer.del(s), this.client.core.storage.removeItem(H).catch((a3) => this.client.logger.warn(a3)), this.getPendingSessionRequests().forEach((a3) => { + }, this.deleteSession = async (e2) => { + const { topic: s, expirerHasDeleted: t = false, emitEvent: i2 = true, id: n3 = 0 } = e2, { self: o2 } = this.client.session.get(s); + await this.client.core.relayer.unsubscribe(s), await this.client.session.delete(s, U$2("USER_DISCONNECTED")), this.client.core.crypto.keychain.has(o2.publicKey) && await this.client.core.crypto.deleteKeyPair(o2.publicKey), this.client.core.crypto.keychain.has(s) && await this.client.core.crypto.deleteSymKey(s), t || this.client.core.expirer.del(s), this.client.core.storage.removeItem(H).catch((a3) => this.client.logger.warn(a3)), this.getPendingSessionRequests().forEach((a3) => { a3.topic === s && this.deletePendingSessionRequest(a3.id, U$2("USER_DISCONNECTED")); - }), i2 && this.client.events.emit("session_delete", { id: n2, topic: s }); - }, this.deleteProposal = async (e, s) => { - await Promise.all([this.client.proposal.delete(e, U$2("USER_DISCONNECTED")), s ? Promise.resolve() : this.client.core.expirer.del(e)]); - }, this.deletePendingSessionRequest = async (e, s, t = false) => { - await Promise.all([this.client.pendingRequest.delete(e, s), t ? Promise.resolve() : this.client.core.expirer.del(e)]), this.sessionRequestQueue.queue = this.sessionRequestQueue.queue.filter((i2) => i2.id !== e), t && (this.sessionRequestQueue.state = I.idle, this.client.events.emit("session_request_expire", { id: e })); - }, this.setExpiry = async (e, s) => { - this.client.session.keys.includes(e) && await this.client.session.update(e, { expiry: s }), this.client.core.expirer.set(e, s); - }, this.setProposal = async (e, s) => { - await this.client.proposal.set(e, s), this.client.core.expirer.set(e, pt$1(R.wc_sessionPropose.req.ttl)); - }, this.setPendingSessionRequest = async (e) => { - const { id: s, topic: t, params: i2, verifyContext: n2 } = e, o = i2.request.expiryTimestamp || pt$1(R.wc_sessionRequest.req.ttl); - await this.client.pendingRequest.set(s, { id: s, topic: t, params: i2, verifyContext: n2 }), o && this.client.core.expirer.set(s, o); - }, this.sendRequest = async (e) => { - const { topic: s, method: t, params: i2, expiry: n2, relayRpcId: o, clientRpcId: a3, throwOnFailedPublish: c2 } = e, p3 = formatJsonRpcRequest(t, i2, a3); + }), i2 && this.client.events.emit("session_delete", { id: n3, topic: s }); + }, this.deleteProposal = async (e2, s) => { + await Promise.all([this.client.proposal.delete(e2, U$2("USER_DISCONNECTED")), s ? Promise.resolve() : this.client.core.expirer.del(e2)]); + }, this.deletePendingSessionRequest = async (e2, s, t = false) => { + await Promise.all([this.client.pendingRequest.delete(e2, s), t ? Promise.resolve() : this.client.core.expirer.del(e2)]), this.sessionRequestQueue.queue = this.sessionRequestQueue.queue.filter((i2) => i2.id !== e2), t && (this.sessionRequestQueue.state = I.idle, this.client.events.emit("session_request_expire", { id: e2 })); + }, this.setExpiry = async (e2, s) => { + this.client.session.keys.includes(e2) && await this.client.session.update(e2, { expiry: s }), this.client.core.expirer.set(e2, s); + }, this.setProposal = async (e2, s) => { + await this.client.proposal.set(e2, s), this.client.core.expirer.set(e2, pt$1(R.wc_sessionPropose.req.ttl)); + }, this.setPendingSessionRequest = async (e2) => { + const { id: s, topic: t, params: i2, verifyContext: n3 } = e2, o2 = i2.request.expiryTimestamp || pt$1(R.wc_sessionRequest.req.ttl); + await this.client.pendingRequest.set(s, { id: s, topic: t, params: i2, verifyContext: n3 }), o2 && this.client.core.expirer.set(s, o2); + }, this.sendRequest = async (e2) => { + const { topic: s, method: t, params: i2, expiry: n3, relayRpcId: o2, clientRpcId: a3, throwOnFailedPublish: c2 } = e2, p3 = formatJsonRpcRequest(t, i2, a3); if (D$4() && he.includes(t)) { const N2 = Ln(JSON.stringify(p3)); this.client.core.verify.register({ attestationId: N2 }); } - const d2 = await this.client.core.crypto.encode(s, p3), h4 = R[t].req; - return n2 && (h4.ttl = n2), o && (h4.id = o), this.client.core.history.set(s, p3), c2 ? (h4.internal = D$1(g$1({}, h4.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(s, d2, h4)) : this.client.core.relayer.publish(s, d2, h4).catch((N2) => this.client.logger.error(N2)), p3.id; - }, this.sendResult = async (e) => { - const { id: s, topic: t, result: i2, throwOnFailedPublish: n2 } = e, o = formatJsonRpcResult(s, i2), a3 = await this.client.core.crypto.encode(t, o), c2 = await this.client.core.history.get(t, s), p3 = R[c2.request.method].res; - n2 ? (p3.internal = D$1(g$1({}, p3.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(t, a3, p3)) : this.client.core.relayer.publish(t, a3, p3).catch((d2) => this.client.logger.error(d2)), await this.client.core.history.resolve(o); - }, this.sendError = async (e, s, t) => { - const i2 = formatJsonRpcError(e, t), n2 = await this.client.core.crypto.encode(s, i2), o = await this.client.core.history.get(s, e), a3 = R[o.request.method].res; - this.client.core.relayer.publish(s, n2, a3), await this.client.core.history.resolve(i2); + const d3 = await this.client.core.crypto.encode(s, p3), h4 = R[t].req; + return n3 && (h4.ttl = n3), o2 && (h4.id = o2), this.client.core.history.set(s, p3), c2 ? (h4.internal = D$1(g$2({}, h4.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(s, d3, h4)) : this.client.core.relayer.publish(s, d3, h4).catch((N2) => this.client.logger.error(N2)), p3.id; + }, this.sendResult = async (e2) => { + const { id: s, topic: t, result: i2, throwOnFailedPublish: n3 } = e2, o2 = formatJsonRpcResult(s, i2), a3 = await this.client.core.crypto.encode(t, o2), c2 = await this.client.core.history.get(t, s), p3 = R[c2.request.method].res; + n3 ? (p3.internal = D$1(g$2({}, p3.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(t, a3, p3)) : this.client.core.relayer.publish(t, a3, p3).catch((d3) => this.client.logger.error(d3)), await this.client.core.history.resolve(o2); + }, this.sendError = async (e2, s, t) => { + const i2 = formatJsonRpcError(e2, t), n3 = await this.client.core.crypto.encode(s, i2), o2 = await this.client.core.history.get(s, e2), a3 = R[o2.request.method].res; + this.client.core.relayer.publish(s, n3, a3), await this.client.core.history.resolve(i2); }, this.cleanup = async () => { - const e = [], s = []; + const e2 = [], s = []; this.client.session.getAll().forEach((t) => { let i2 = false; - mt$1(t.expiry) && (i2 = true), this.client.core.crypto.keychain.has(t.topic) || (i2 = true), i2 && e.push(t.topic); + mt$1(t.expiry) && (i2 = true), this.client.core.crypto.keychain.has(t.topic) || (i2 = true), i2 && e2.push(t.topic); }), this.client.proposal.getAll().forEach((t) => { mt$1(t.expiryTimestamp) && s.push(t.id); - }), await Promise.all([...e.map((t) => this.deleteSession({ topic: t })), ...s.map((t) => this.deleteProposal(t))]); - }, this.onRelayEventRequest = async (e) => { - this.requestQueue.queue.push(e), await this.processRequestsQueue(); + }), await Promise.all([...e2.map((t) => this.deleteSession({ topic: t })), ...s.map((t) => this.deleteProposal(t))]); + }, this.onRelayEventRequest = async (e2) => { + this.requestQueue.queue.push(e2), await this.processRequestsQueue(); }, this.processRequestsQueue = async () => { if (this.requestQueue.state === I.active) { this.client.logger.info("Request queue already active, skipping..."); @@ -10401,17 +10401,17 @@ class ds extends w$2 { } for (this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`); this.requestQueue.queue.length > 0; ) { this.requestQueue.state = I.active; - const e = this.requestQueue.queue.shift(); - if (e) + const e2 = this.requestQueue.queue.shift(); + if (e2) try { - this.processRequest(e), await new Promise((s) => setTimeout(s, 300)); + this.processRequest(e2), await new Promise((s) => setTimeout(s, 300)); } catch (s) { this.client.logger.warn(s); } } this.requestQueue.state = I.idle; - }, this.processRequest = (e) => { - const { topic: s, payload: t } = e, i2 = t.method; + }, this.processRequest = (e2) => { + const { topic: s, payload: t } = e2, i2 = t.method; switch (i2) { case "wc_sessionPropose": return this.onSessionProposeRequest(s, t); @@ -10432,8 +10432,8 @@ class ds extends w$2 { default: return this.client.logger.info(`Unsupported request method ${i2}`); } - }, this.onRelayEventResponse = async (e) => { - const { topic: s, payload: t } = e, i2 = (await this.client.core.history.get(s, t.id)).request.method; + }, this.onRelayEventResponse = async (e2) => { + const { topic: s, payload: t } = e2, i2 = (await this.client.core.history.get(s, t.id)).request.method; switch (i2) { case "wc_sessionPropose": return this.onSessionProposeResponse(s, t); @@ -10450,130 +10450,130 @@ class ds extends w$2 { default: return this.client.logger.info(`Unsupported response method ${i2}`); } - }, this.onRelayEventUnknownPayload = (e) => { - const { topic: s } = e, { message: t } = N$2("MISSING_OR_INVALID", `Decoded payload on topic ${s} is not identifiable as a JSON-RPC request or a response.`); + }, this.onRelayEventUnknownPayload = (e2) => { + const { topic: s } = e2, { message: t } = N$2("MISSING_OR_INVALID", `Decoded payload on topic ${s} is not identifiable as a JSON-RPC request or a response.`); throw new Error(t); - }, this.onSessionProposeRequest = async (e, s) => { + }, this.onSessionProposeRequest = async (e2, s) => { const { params: t, id: i2 } = s; try { - this.isValidConnect(g$1({}, s.params)); - const n2 = t.expiryTimestamp || pt$1(R.wc_sessionPropose.req.ttl), o = g$1({ id: i2, pairingTopic: e, expiryTimestamp: n2 }, t); - await this.setProposal(i2, o); - const a3 = Ln(JSON.stringify(s)), c2 = await this.getVerifyContext(a3, o.proposer.metadata); - this.client.events.emit("session_proposal", { id: i2, params: o, verifyContext: c2 }); - } catch (n2) { - await this.sendError(i2, e, n2), this.client.logger.error(n2); - } - }, this.onSessionProposeResponse = async (e, s) => { + this.isValidConnect(g$2({}, s.params)); + const n3 = t.expiryTimestamp || pt$1(R.wc_sessionPropose.req.ttl), o2 = g$2({ id: i2, pairingTopic: e2, expiryTimestamp: n3 }, t); + await this.setProposal(i2, o2); + const a3 = Ln(JSON.stringify(s)), c2 = await this.getVerifyContext(a3, o2.proposer.metadata); + this.client.events.emit("session_proposal", { id: i2, params: o2, verifyContext: c2 }); + } catch (n3) { + await this.sendError(i2, e2, n3), this.client.logger.error(n3); + } + }, this.onSessionProposeResponse = async (e2, s) => { const { id: t } = s; if (isJsonRpcResult(s)) { const { result: i2 } = s; this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", result: i2 }); - const n2 = this.client.proposal.get(t); - this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", proposal: n2 }); - const o = n2.proposer.publicKey; - this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", selfPublicKey: o }); + const n3 = this.client.proposal.get(t); + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", proposal: n3 }); + const o2 = n3.proposer.publicKey; + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", selfPublicKey: o2 }); const a3 = i2.responderPublicKey; this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", peerPublicKey: a3 }); - const c2 = await this.client.core.crypto.generateSharedKey(o, a3); + const c2 = await this.client.core.crypto.generateSharedKey(o2, a3); this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", sessionTopic: c2 }); const p3 = await this.client.core.relayer.subscribe(c2); - this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", subscriptionId: p3 }), await this.client.core.pairing.activate({ topic: e }); + this.client.logger.trace({ type: "method", method: "onSessionProposeResponse", subscriptionId: p3 }), await this.client.core.pairing.activate({ topic: e2 }); } else isJsonRpcError(s) && (await this.client.proposal.delete(t, U$2("USER_DISCONNECTED")), this.events.emit(yt$1("session_connect"), { error: s.error })); - }, this.onSessionSettleRequest = async (e, s) => { + }, this.onSessionSettleRequest = async (e2, s) => { const { id: t, params: i2 } = s; try { this.isValidSessionSettleRequest(i2); - const { relay: n2, controller: o, expiry: a3, namespaces: c2, sessionProperties: p3, pairingTopic: d2 } = s.params, h4 = g$1({ topic: e, relay: n2, expiry: a3, namespaces: c2, acknowledged: true, pairingTopic: d2, requiredNamespaces: {}, optionalNamespaces: {}, controller: o.publicKey, self: { publicKey: "", metadata: this.client.metadata }, peer: { publicKey: o.publicKey, metadata: o.metadata } }, p3 && { sessionProperties: p3 }); - await this.sendResult({ id: s.id, topic: e, result: true }), this.events.emit(yt$1("session_connect"), { session: h4 }), this.cleanupDuplicatePairings(h4); - } catch (n2) { - await this.sendError(t, e, n2), this.client.logger.error(n2); + const { relay: n3, controller: o2, expiry: a3, namespaces: c2, sessionProperties: p3, pairingTopic: d3 } = s.params, h4 = g$2({ topic: e2, relay: n3, expiry: a3, namespaces: c2, acknowledged: true, pairingTopic: d3, requiredNamespaces: {}, optionalNamespaces: {}, controller: o2.publicKey, self: { publicKey: "", metadata: this.client.metadata }, peer: { publicKey: o2.publicKey, metadata: o2.metadata } }, p3 && { sessionProperties: p3 }); + await this.sendResult({ id: s.id, topic: e2, result: true }), this.events.emit(yt$1("session_connect"), { session: h4 }), this.cleanupDuplicatePairings(h4); + } catch (n3) { + await this.sendError(t, e2, n3), this.client.logger.error(n3); } - }, this.onSessionSettleResponse = async (e, s) => { + }, this.onSessionSettleResponse = async (e2, s) => { const { id: t } = s; - isJsonRpcResult(s) ? (await this.client.session.update(e, { acknowledged: true }), this.events.emit(yt$1("session_approve", t), {})) : isJsonRpcError(s) && (await this.client.session.delete(e, U$2("USER_DISCONNECTED")), this.events.emit(yt$1("session_approve", t), { error: s.error })); - }, this.onSessionUpdateRequest = async (e, s) => { + isJsonRpcResult(s) ? (await this.client.session.update(e2, { acknowledged: true }), this.events.emit(yt$1("session_approve", t), {})) : isJsonRpcError(s) && (await this.client.session.delete(e2, U$2("USER_DISCONNECTED")), this.events.emit(yt$1("session_approve", t), { error: s.error })); + }, this.onSessionUpdateRequest = async (e2, s) => { const { params: t, id: i2 } = s; try { - const n2 = `${e}_session_update`, o = sr$1.get(n2); - if (o && this.isRequestOutOfSync(o, i2)) { + const n3 = `${e2}_session_update`, o2 = sr$1.get(n3); + if (o2 && this.isRequestOutOfSync(o2, i2)) { this.client.logger.info(`Discarding out of sync request - ${i2}`); return; } - this.isValidUpdate(g$1({ topic: e }, t)), await this.client.session.update(e, { namespaces: t.namespaces }), await this.sendResult({ id: i2, topic: e, result: true }), this.client.events.emit("session_update", { id: i2, topic: e, params: t }), sr$1.set(n2, i2); - } catch (n2) { - await this.sendError(i2, e, n2), this.client.logger.error(n2); + this.isValidUpdate(g$2({ topic: e2 }, t)), await this.client.session.update(e2, { namespaces: t.namespaces }), await this.sendResult({ id: i2, topic: e2, result: true }), this.client.events.emit("session_update", { id: i2, topic: e2, params: t }), sr$1.set(n3, i2); + } catch (n3) { + await this.sendError(i2, e2, n3), this.client.logger.error(n3); } - }, this.isRequestOutOfSync = (e, s) => parseInt(s.toString().slice(0, -3)) <= parseInt(e.toString().slice(0, -3)), this.onSessionUpdateResponse = (e, s) => { + }, this.isRequestOutOfSync = (e2, s) => parseInt(s.toString().slice(0, -3)) <= parseInt(e2.toString().slice(0, -3)), this.onSessionUpdateResponse = (e2, s) => { const { id: t } = s; isJsonRpcResult(s) ? this.events.emit(yt$1("session_update", t), {}) : isJsonRpcError(s) && this.events.emit(yt$1("session_update", t), { error: s.error }); - }, this.onSessionExtendRequest = async (e, s) => { + }, this.onSessionExtendRequest = async (e2, s) => { const { id: t } = s; try { - this.isValidExtend({ topic: e }), await this.setExpiry(e, pt$1(L$1)), await this.sendResult({ id: t, topic: e, result: true }), this.client.events.emit("session_extend", { id: t, topic: e }); + this.isValidExtend({ topic: e2 }), await this.setExpiry(e2, pt$1(L$2)), await this.sendResult({ id: t, topic: e2, result: true }), this.client.events.emit("session_extend", { id: t, topic: e2 }); } catch (i2) { - await this.sendError(t, e, i2), this.client.logger.error(i2); + await this.sendError(t, e2, i2), this.client.logger.error(i2); } - }, this.onSessionExtendResponse = (e, s) => { + }, this.onSessionExtendResponse = (e2, s) => { const { id: t } = s; isJsonRpcResult(s) ? this.events.emit(yt$1("session_extend", t), {}) : isJsonRpcError(s) && this.events.emit(yt$1("session_extend", t), { error: s.error }); - }, this.onSessionPingRequest = async (e, s) => { + }, this.onSessionPingRequest = async (e2, s) => { const { id: t } = s; try { - this.isValidPing({ topic: e }), await this.sendResult({ id: t, topic: e, result: true }), this.client.events.emit("session_ping", { id: t, topic: e }); + this.isValidPing({ topic: e2 }), await this.sendResult({ id: t, topic: e2, result: true }), this.client.events.emit("session_ping", { id: t, topic: e2 }); } catch (i2) { - await this.sendError(t, e, i2), this.client.logger.error(i2); + await this.sendError(t, e2, i2), this.client.logger.error(i2); } - }, this.onSessionPingResponse = (e, s) => { + }, this.onSessionPingResponse = (e2, s) => { const { id: t } = s; setTimeout(() => { isJsonRpcResult(s) ? this.events.emit(yt$1("session_ping", t), {}) : isJsonRpcError(s) && this.events.emit(yt$1("session_ping", t), { error: s.error }); }, 500); - }, this.onSessionDeleteRequest = async (e, s) => { + }, this.onSessionDeleteRequest = async (e2, s) => { const { id: t } = s; try { - this.isValidDisconnect({ topic: e, reason: s.params }), await Promise.all([new Promise((i2) => { + this.isValidDisconnect({ topic: e2, reason: s.params }), await Promise.all([new Promise((i2) => { this.client.core.relayer.once(D$2.publish, async () => { - i2(await this.deleteSession({ topic: e, id: t })); + i2(await this.deleteSession({ topic: e2, id: t })); }); - }), this.sendResult({ id: t, topic: e, result: true }), this.cleanupPendingSentRequestsForTopic({ topic: e, error: U$2("USER_DISCONNECTED") })]); + }), this.sendResult({ id: t, topic: e2, result: true }), this.cleanupPendingSentRequestsForTopic({ topic: e2, error: U$2("USER_DISCONNECTED") })]); } catch (i2) { this.client.logger.error(i2); } - }, this.onSessionRequest = async (e, s) => { + }, this.onSessionRequest = async (e2, s) => { const { id: t, params: i2 } = s; try { - this.isValidRequest(g$1({ topic: e }, i2)); - const n2 = Ln(JSON.stringify(formatJsonRpcRequest("wc_sessionRequest", i2, t))), o = this.client.session.get(e), a3 = await this.getVerifyContext(n2, o.peer.metadata), c2 = { id: t, topic: e, params: i2, verifyContext: a3 }; + this.isValidRequest(g$2({ topic: e2 }, i2)); + const n3 = Ln(JSON.stringify(formatJsonRpcRequest("wc_sessionRequest", i2, t))), o2 = this.client.session.get(e2), a3 = await this.getVerifyContext(n3, o2.peer.metadata), c2 = { id: t, topic: e2, params: i2, verifyContext: a3 }; await this.setPendingSessionRequest(c2), this.addSessionRequestToSessionRequestQueue(c2), this.processSessionRequestQueue(); - } catch (n2) { - await this.sendError(t, e, n2), this.client.logger.error(n2); + } catch (n3) { + await this.sendError(t, e2, n3), this.client.logger.error(n3); } - }, this.onSessionRequestResponse = (e, s) => { + }, this.onSessionRequestResponse = (e2, s) => { const { id: t } = s; isJsonRpcResult(s) ? this.events.emit(yt$1("session_request", t), { result: s.result }) : isJsonRpcError(s) && this.events.emit(yt$1("session_request", t), { error: s.error }); - }, this.onSessionEventRequest = async (e, s) => { + }, this.onSessionEventRequest = async (e2, s) => { const { id: t, params: i2 } = s; try { - const n2 = `${e}_session_event_${i2.event.name}`, o = sr$1.get(n2); - if (o && this.isRequestOutOfSync(o, t)) { + const n3 = `${e2}_session_event_${i2.event.name}`, o2 = sr$1.get(n3); + if (o2 && this.isRequestOutOfSync(o2, t)) { this.client.logger.info(`Discarding out of sync request - ${t}`); return; } - this.isValidEmit(g$1({ topic: e }, i2)), this.client.events.emit("session_event", { id: t, topic: e, params: i2 }), sr$1.set(n2, t); - } catch (n2) { - await this.sendError(t, e, n2), this.client.logger.error(n2); + this.isValidEmit(g$2({ topic: e2 }, i2)), this.client.events.emit("session_event", { id: t, topic: e2, params: i2 }), sr$1.set(n3, t); + } catch (n3) { + await this.sendError(t, e2, n3), this.client.logger.error(n3); } - }, this.addSessionRequestToSessionRequestQueue = (e) => { - this.sessionRequestQueue.queue.push(e); - }, this.cleanupAfterResponse = (e) => { - this.deletePendingSessionRequest(e.response.id, { message: "fulfilled", code: 0 }), setTimeout(() => { + }, this.addSessionRequestToSessionRequestQueue = (e2) => { + this.sessionRequestQueue.queue.push(e2); + }, this.cleanupAfterResponse = (e2) => { + this.deletePendingSessionRequest(e2.response.id, { message: "fulfilled", code: 0 }), setTimeout(() => { this.sessionRequestQueue.state = I.idle, this.processSessionRequestQueue(); }, cjs$4.toMiliseconds(this.requestQueueDelay)); - }, this.cleanupPendingSentRequestsForTopic = ({ topic: e, error: s }) => { + }, this.cleanupPendingSentRequestsForTopic = ({ topic: e2, error: s }) => { const t = this.client.core.history.pending; - t.length > 0 && t.filter((i2) => i2.topic === e && i2.request.method === "wc_sessionRequest").forEach((i2) => { + t.length > 0 && t.filter((i2) => i2.topic === e2 && i2.request.method === "wc_sessionRequest").forEach((i2) => { this.events.emit(yt$1("session_request", i2.request.id), { error: s }); }); }, this.processSessionRequestQueue = () => { @@ -10581,111 +10581,111 @@ class ds extends w$2 { this.client.logger.info("session request queue is already active."); return; } - const e = this.sessionRequestQueue.queue[0]; - if (!e) { + const e2 = this.sessionRequestQueue.queue[0]; + if (!e2) { this.client.logger.info("session request queue is empty."); return; } try { - this.sessionRequestQueue.state = I.active, this.client.events.emit("session_request", e); + this.sessionRequestQueue.state = I.active, this.client.events.emit("session_request", e2); } catch (s) { this.client.logger.error(s); } - }, this.onPairingCreated = (e) => { - if (e.active) + }, this.onPairingCreated = (e2) => { + if (e2.active) return; - const s = this.client.proposal.getAll().find((t) => t.pairingTopic === e.topic); - s && this.onSessionProposeRequest(e.topic, formatJsonRpcRequest("wc_sessionPropose", { requiredNamespaces: s.requiredNamespaces, optionalNamespaces: s.optionalNamespaces, relays: s.relays, proposer: s.proposer, sessionProperties: s.sessionProperties }, s.id)); - }, this.isValidConnect = async (e) => { - if (!Gt$1(e)) { - const { message: a3 } = N$2("MISSING_OR_INVALID", `connect() params: ${JSON.stringify(e)}`); + const s = this.client.proposal.getAll().find((t) => t.pairingTopic === e2.topic); + s && this.onSessionProposeRequest(e2.topic, formatJsonRpcRequest("wc_sessionPropose", { requiredNamespaces: s.requiredNamespaces, optionalNamespaces: s.optionalNamespaces, relays: s.relays, proposer: s.proposer, sessionProperties: s.sessionProperties }, s.id)); + }, this.isValidConnect = async (e2) => { + if (!Gt$1(e2)) { + const { message: a3 } = N$2("MISSING_OR_INVALID", `connect() params: ${JSON.stringify(e2)}`); throw new Error(a3); } - const { pairingTopic: s, requiredNamespaces: t, optionalNamespaces: i2, sessionProperties: n2, relays: o } = e; - if (w$4(s) || await this.isValidPairingTopic(s), !qt$1(o)) { - const { message: a3 } = N$2("MISSING_OR_INVALID", `connect() relays: ${o}`); + const { pairingTopic: s, requiredNamespaces: t, optionalNamespaces: i2, sessionProperties: n3, relays: o2 } = e2; + if (w$5(s) || await this.isValidPairingTopic(s), !qt$1(o2)) { + const { message: a3 } = N$2("MISSING_OR_INVALID", `connect() relays: ${o2}`); throw new Error(a3); } - !w$4(t) && B$1(t) !== 0 && this.validateNamespaces(t, "requiredNamespaces"), !w$4(i2) && B$1(i2) !== 0 && this.validateNamespaces(i2, "optionalNamespaces"), w$4(n2) || this.validateSessionProps(n2, "sessionProperties"); - }, this.validateNamespaces = (e, s) => { - const t = Ht$1(e, "connect()", s); + !w$5(t) && B$1(t) !== 0 && this.validateNamespaces(t, "requiredNamespaces"), !w$5(i2) && B$1(i2) !== 0 && this.validateNamespaces(i2, "optionalNamespaces"), w$5(n3) || this.validateSessionProps(n3, "sessionProperties"); + }, this.validateNamespaces = (e2, s) => { + const t = Ht$1(e2, "connect()", s); if (t) throw new Error(t.message); - }, this.isValidApprove = async (e) => { - if (!Gt$1(e)) - throw new Error(N$2("MISSING_OR_INVALID", `approve() params: ${e}`).message); - const { id: s, namespaces: t, relayProtocol: i2, sessionProperties: n2 } = e; + }, this.isValidApprove = async (e2) => { + if (!Gt$1(e2)) + throw new Error(N$2("MISSING_OR_INVALID", `approve() params: ${e2}`).message); + const { id: s, namespaces: t, relayProtocol: i2, sessionProperties: n3 } = e2; await this.isValidProposalId(s); - const o = this.client.proposal.get(s), a3 = ln(t, "approve()"); + const o2 = this.client.proposal.get(s), a3 = ln(t, "approve()"); if (a3) throw new Error(a3.message); - const c2 = fn(o.requiredNamespaces, t, "approve()"); + const c2 = fn(o2.requiredNamespaces, t, "approve()"); if (c2) throw new Error(c2.message); - if (!g$5(i2, true)) { + if (!g$6(i2, true)) { const { message: p3 } = N$2("MISSING_OR_INVALID", `approve() relayProtocol: ${i2}`); throw new Error(p3); } - w$4(n2) || this.validateSessionProps(n2, "sessionProperties"); - }, this.isValidReject = async (e) => { - if (!Gt$1(e)) { - const { message: i2 } = N$2("MISSING_OR_INVALID", `reject() params: ${e}`); + w$5(n3) || this.validateSessionProps(n3, "sessionProperties"); + }, this.isValidReject = async (e2) => { + if (!Gt$1(e2)) { + const { message: i2 } = N$2("MISSING_OR_INVALID", `reject() params: ${e2}`); throw new Error(i2); } - const { id: s, reason: t } = e; + const { id: s, reason: t } = e2; if (await this.isValidProposalId(s), !Wt(t)) { const { message: i2 } = N$2("MISSING_OR_INVALID", `reject() reason: ${JSON.stringify(t)}`); throw new Error(i2); } - }, this.isValidSessionSettleRequest = (e) => { - if (!Gt$1(e)) { - const { message: c2 } = N$2("MISSING_OR_INVALID", `onSessionSettleRequest() params: ${e}`); + }, this.isValidSessionSettleRequest = (e2) => { + if (!Gt$1(e2)) { + const { message: c2 } = N$2("MISSING_OR_INVALID", `onSessionSettleRequest() params: ${e2}`); throw new Error(c2); } - const { relay: s, controller: t, namespaces: i2, expiry: n2 } = e; + const { relay: s, controller: t, namespaces: i2, expiry: n3 } = e2; if (!dn(s)) { const { message: c2 } = N$2("MISSING_OR_INVALID", "onSessionSettleRequest() relay protocol should be a string"); throw new Error(c2); } - const o = Ft$1(t, "onSessionSettleRequest()"); - if (o) - throw new Error(o.message); + const o2 = Ft$1(t, "onSessionSettleRequest()"); + if (o2) + throw new Error(o2.message); const a3 = ln(i2, "onSessionSettleRequest()"); if (a3) throw new Error(a3.message); - if (mt$1(n2)) { + if (mt$1(n3)) { const { message: c2 } = N$2("EXPIRED", "onSessionSettleRequest()"); throw new Error(c2); } - }, this.isValidUpdate = async (e) => { - if (!Gt$1(e)) { - const { message: a3 } = N$2("MISSING_OR_INVALID", `update() params: ${e}`); + }, this.isValidUpdate = async (e2) => { + if (!Gt$1(e2)) { + const { message: a3 } = N$2("MISSING_OR_INVALID", `update() params: ${e2}`); throw new Error(a3); } - const { topic: s, namespaces: t } = e; + const { topic: s, namespaces: t } = e2; await this.isValidSessionTopic(s); - const i2 = this.client.session.get(s), n2 = ln(t, "update()"); - if (n2) - throw new Error(n2.message); - const o = fn(i2.requiredNamespaces, t, "update()"); - if (o) - throw new Error(o.message); - }, this.isValidExtend = async (e) => { - if (!Gt$1(e)) { - const { message: t } = N$2("MISSING_OR_INVALID", `extend() params: ${e}`); + const i2 = this.client.session.get(s), n3 = ln(t, "update()"); + if (n3) + throw new Error(n3.message); + const o2 = fn(i2.requiredNamespaces, t, "update()"); + if (o2) + throw new Error(o2.message); + }, this.isValidExtend = async (e2) => { + if (!Gt$1(e2)) { + const { message: t } = N$2("MISSING_OR_INVALID", `extend() params: ${e2}`); throw new Error(t); } - const { topic: s } = e; + const { topic: s } = e2; await this.isValidSessionTopic(s); - }, this.isValidRequest = async (e) => { - if (!Gt$1(e)) { - const { message: a3 } = N$2("MISSING_OR_INVALID", `request() params: ${e}`); + }, this.isValidRequest = async (e2) => { + if (!Gt$1(e2)) { + const { message: a3 } = N$2("MISSING_OR_INVALID", `request() params: ${e2}`); throw new Error(a3); } - const { topic: s, request: t, chainId: i2, expiry: n2 } = e; + const { topic: s, request: t, chainId: i2, expiry: n3 } = e2; await this.isValidSessionTopic(s); - const { namespaces: o } = this.client.session.get(s); - if (!Qt(o, i2)) { + const { namespaces: o2 } = this.client.session.get(s); + if (!Qt(o2, i2)) { const { message: a3 } = N$2("MISSING_OR_INVALID", `request() chainId: ${i2}`); throw new Error(a3); } @@ -10693,76 +10693,76 @@ class ds extends w$2 { const { message: a3 } = N$2("MISSING_OR_INVALID", `request() ${JSON.stringify(t)}`); throw new Error(a3); } - if (!Zt(o, i2, t.method)) { + if (!Zt(o2, i2, t.method)) { const { message: a3 } = N$2("MISSING_OR_INVALID", `request() method: ${t.method}`); throw new Error(a3); } - if (n2 && !tr$1(n2, U$1)) { - const { message: a3 } = N$2("MISSING_OR_INVALID", `request() expiry: ${n2}. Expiry must be a number (in seconds) between ${U$1.min} and ${U$1.max}`); + if (n3 && !tr$1(n3, U$1)) { + const { message: a3 } = N$2("MISSING_OR_INVALID", `request() expiry: ${n3}. Expiry must be a number (in seconds) between ${U$1.min} and ${U$1.max}`); throw new Error(a3); } - }, this.isValidRespond = async (e) => { + }, this.isValidRespond = async (e2) => { var s; - if (!Gt$1(e)) { - const { message: n2 } = N$2("MISSING_OR_INVALID", `respond() params: ${e}`); - throw new Error(n2); + if (!Gt$1(e2)) { + const { message: n3 } = N$2("MISSING_OR_INVALID", `respond() params: ${e2}`); + throw new Error(n3); } - const { topic: t, response: i2 } = e; + const { topic: t, response: i2 } = e2; try { await this.isValidSessionTopic(t); - } catch (n2) { - throw (s = e == null ? void 0 : e.response) != null && s.id && this.cleanupAfterResponse(e), n2; + } catch (n3) { + throw (s = e2 == null ? void 0 : e2.response) != null && s.id && this.cleanupAfterResponse(e2), n3; } if (!Yt$1(i2)) { - const { message: n2 } = N$2("MISSING_OR_INVALID", `respond() response: ${JSON.stringify(i2)}`); - throw new Error(n2); + const { message: n3 } = N$2("MISSING_OR_INVALID", `respond() response: ${JSON.stringify(i2)}`); + throw new Error(n3); } - }, this.isValidPing = async (e) => { - if (!Gt$1(e)) { - const { message: t } = N$2("MISSING_OR_INVALID", `ping() params: ${e}`); + }, this.isValidPing = async (e2) => { + if (!Gt$1(e2)) { + const { message: t } = N$2("MISSING_OR_INVALID", `ping() params: ${e2}`); throw new Error(t); } - const { topic: s } = e; + const { topic: s } = e2; await this.isValidSessionOrPairingTopic(s); - }, this.isValidEmit = async (e) => { - if (!Gt$1(e)) { - const { message: o } = N$2("MISSING_OR_INVALID", `emit() params: ${e}`); - throw new Error(o); + }, this.isValidEmit = async (e2) => { + if (!Gt$1(e2)) { + const { message: o2 } = N$2("MISSING_OR_INVALID", `emit() params: ${e2}`); + throw new Error(o2); } - const { topic: s, event: t, chainId: i2 } = e; + const { topic: s, event: t, chainId: i2 } = e2; await this.isValidSessionTopic(s); - const { namespaces: n2 } = this.client.session.get(s); - if (!Qt(n2, i2)) { - const { message: o } = N$2("MISSING_OR_INVALID", `emit() chainId: ${i2}`); - throw new Error(o); + const { namespaces: n3 } = this.client.session.get(s); + if (!Qt(n3, i2)) { + const { message: o2 } = N$2("MISSING_OR_INVALID", `emit() chainId: ${i2}`); + throw new Error(o2); } if (!Jt$1(t)) { - const { message: o } = N$2("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(t)}`); - throw new Error(o); + const { message: o2 } = N$2("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(t)}`); + throw new Error(o2); } - if (!Xt(n2, i2, t.name)) { - const { message: o } = N$2("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(t)}`); - throw new Error(o); + if (!Xt(n3, i2, t.name)) { + const { message: o2 } = N$2("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(t)}`); + throw new Error(o2); } - }, this.isValidDisconnect = async (e) => { - if (!Gt$1(e)) { - const { message: t } = N$2("MISSING_OR_INVALID", `disconnect() params: ${e}`); + }, this.isValidDisconnect = async (e2) => { + if (!Gt$1(e2)) { + const { message: t } = N$2("MISSING_OR_INVALID", `disconnect() params: ${e2}`); throw new Error(t); } - const { topic: s } = e; + const { topic: s } = e2; await this.isValidSessionOrPairingTopic(s); - }, this.getVerifyContext = async (e, s) => { + }, this.getVerifyContext = async (e2, s) => { const t = { verified: { verifyUrl: s.verifyUrl || F$1, validation: "UNKNOWN", origin: s.url || "" } }; try { - const i2 = await this.client.core.verify.resolve({ attestationId: e, verifyUrl: s.verifyUrl }); + const i2 = await this.client.core.verify.resolve({ attestationId: e2, verifyUrl: s.verifyUrl }); i2 && (t.verified.origin = i2.origin, t.verified.isScam = i2.isScam, t.verified.validation = i2.origin === new URL(s.url).origin ? "VALID" : "INVALID"); } catch (i2) { this.client.logger.info(i2); } return this.client.logger.info(`Verify context: ${JSON.stringify(t)}`), t; - }, this.validateSessionProps = (e, s) => { - Object.values(e).forEach((t) => { - if (!g$5(t, false)) { + }, this.validateSessionProps = (e2, s) => { + Object.values(e2).forEach((t) => { + if (!g$6(t, false)) { const { message: i2 } = N$2("MISSING_OR_INVALID", `${s} must be in Record format. Received: ${JSON.stringify(t)}`); throw new Error(i2); } @@ -10771,115 +10771,115 @@ class ds extends w$2 { } async isInitialized() { if (!this.initialized) { - const { message: r } = N$2("NOT_INITIALIZED", this.name); - throw new Error(r); + const { message: r2 } = N$2("NOT_INITIALIZED", this.name); + throw new Error(r2); } await this.client.core.relayer.confirmOnlineStateOrThrow(); } registerRelayerEvents() { - this.client.core.relayer.on(D$2.message, async (r) => { - const { topic: e, message: s } = r; + this.client.core.relayer.on(D$2.message, async (r2) => { + const { topic: e2, message: s } = r2; if (this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(s))) return; - const t = await this.client.core.crypto.decode(e, s); + const t = await this.client.core.crypto.decode(e2, s); try { - isJsonRpcRequest(t) ? (this.client.core.history.set(e, t), this.onRelayEventRequest({ topic: e, payload: t })) : isJsonRpcResponse(t) ? (await this.client.core.history.resolve(t), await this.onRelayEventResponse({ topic: e, payload: t }), this.client.core.history.delete(e, t.id)) : this.onRelayEventUnknownPayload({ topic: e, payload: t }); + isJsonRpcRequest(t) ? (this.client.core.history.set(e2, t), this.onRelayEventRequest({ topic: e2, payload: t })) : isJsonRpcResponse(t) ? (await this.client.core.history.resolve(t), await this.onRelayEventResponse({ topic: e2, payload: t }), this.client.core.history.delete(e2, t.id)) : this.onRelayEventUnknownPayload({ topic: e2, payload: t }); } catch (i2) { this.client.logger.error(i2); } }); } registerExpirerEvents() { - this.client.core.expirer.on(v$1.expired, async (r) => { - const { topic: e, id: s } = ft$2(r.target); + this.client.core.expirer.on(v$2.expired, async (r2) => { + const { topic: e2, id: s } = ft$2(r2.target); if (s && this.client.pendingRequest.keys.includes(s)) return await this.deletePendingSessionRequest(s, N$2("EXPIRED"), true); - e ? this.client.session.keys.includes(e) && (await this.deleteSession({ topic: e, expirerHasDeleted: true }), this.client.events.emit("session_expire", { topic: e })) : s && (await this.deleteProposal(s, true), this.client.events.emit("proposal_expire", { id: s })); + e2 ? this.client.session.keys.includes(e2) && (await this.deleteSession({ topic: e2, expirerHasDeleted: true }), this.client.events.emit("session_expire", { topic: e2 })) : s && (await this.deleteProposal(s, true), this.client.events.emit("proposal_expire", { id: s })); }); } registerPairingEvents() { - this.client.core.pairing.events.on(V.create, (r) => this.onPairingCreated(r)); + this.client.core.pairing.events.on(V.create, (r2) => this.onPairingCreated(r2)); } - isValidPairingTopic(r) { - if (!g$5(r, false)) { - const { message: e } = N$2("MISSING_OR_INVALID", `pairing topic should be a string: ${r}`); - throw new Error(e); + isValidPairingTopic(r2) { + if (!g$6(r2, false)) { + const { message: e2 } = N$2("MISSING_OR_INVALID", `pairing topic should be a string: ${r2}`); + throw new Error(e2); } - if (!this.client.core.pairing.pairings.keys.includes(r)) { - const { message: e } = N$2("NO_MATCHING_KEY", `pairing topic doesn't exist: ${r}`); - throw new Error(e); + if (!this.client.core.pairing.pairings.keys.includes(r2)) { + const { message: e2 } = N$2("NO_MATCHING_KEY", `pairing topic doesn't exist: ${r2}`); + throw new Error(e2); } - if (mt$1(this.client.core.pairing.pairings.get(r).expiry)) { - const { message: e } = N$2("EXPIRED", `pairing topic: ${r}`); - throw new Error(e); + if (mt$1(this.client.core.pairing.pairings.get(r2).expiry)) { + const { message: e2 } = N$2("EXPIRED", `pairing topic: ${r2}`); + throw new Error(e2); } } - async isValidSessionTopic(r) { - if (!g$5(r, false)) { - const { message: e } = N$2("MISSING_OR_INVALID", `session topic should be a string: ${r}`); - throw new Error(e); + async isValidSessionTopic(r2) { + if (!g$6(r2, false)) { + const { message: e2 } = N$2("MISSING_OR_INVALID", `session topic should be a string: ${r2}`); + throw new Error(e2); } - if (!this.client.session.keys.includes(r)) { - const { message: e } = N$2("NO_MATCHING_KEY", `session topic doesn't exist: ${r}`); - throw new Error(e); + if (!this.client.session.keys.includes(r2)) { + const { message: e2 } = N$2("NO_MATCHING_KEY", `session topic doesn't exist: ${r2}`); + throw new Error(e2); } - if (mt$1(this.client.session.get(r).expiry)) { - await this.deleteSession({ topic: r }); - const { message: e } = N$2("EXPIRED", `session topic: ${r}`); - throw new Error(e); + if (mt$1(this.client.session.get(r2).expiry)) { + await this.deleteSession({ topic: r2 }); + const { message: e2 } = N$2("EXPIRED", `session topic: ${r2}`); + throw new Error(e2); } - if (!this.client.core.crypto.keychain.has(r)) { - const { message: e } = N$2("MISSING_OR_INVALID", `session topic does not exist in keychain: ${r}`); - throw await this.deleteSession({ topic: r }), new Error(e); + if (!this.client.core.crypto.keychain.has(r2)) { + const { message: e2 } = N$2("MISSING_OR_INVALID", `session topic does not exist in keychain: ${r2}`); + throw await this.deleteSession({ topic: r2 }), new Error(e2); } } - async isValidSessionOrPairingTopic(r) { - if (this.client.session.keys.includes(r)) - await this.isValidSessionTopic(r); - else if (this.client.core.pairing.pairings.keys.includes(r)) - this.isValidPairingTopic(r); - else if (g$5(r, false)) { - const { message: e } = N$2("NO_MATCHING_KEY", `session or pairing topic doesn't exist: ${r}`); - throw new Error(e); + async isValidSessionOrPairingTopic(r2) { + if (this.client.session.keys.includes(r2)) + await this.isValidSessionTopic(r2); + else if (this.client.core.pairing.pairings.keys.includes(r2)) + this.isValidPairingTopic(r2); + else if (g$6(r2, false)) { + const { message: e2 } = N$2("NO_MATCHING_KEY", `session or pairing topic doesn't exist: ${r2}`); + throw new Error(e2); } else { - const { message: e } = N$2("MISSING_OR_INVALID", `session or pairing topic should be a string: ${r}`); - throw new Error(e); + const { message: e2 } = N$2("MISSING_OR_INVALID", `session or pairing topic should be a string: ${r2}`); + throw new Error(e2); } } - async isValidProposalId(r) { - if (!Bt$1(r)) { - const { message: e } = N$2("MISSING_OR_INVALID", `proposal id should be a number: ${r}`); - throw new Error(e); + async isValidProposalId(r2) { + if (!Bt$1(r2)) { + const { message: e2 } = N$2("MISSING_OR_INVALID", `proposal id should be a number: ${r2}`); + throw new Error(e2); } - if (!this.client.proposal.keys.includes(r)) { - const { message: e } = N$2("NO_MATCHING_KEY", `proposal id doesn't exist: ${r}`); - throw new Error(e); + if (!this.client.proposal.keys.includes(r2)) { + const { message: e2 } = N$2("NO_MATCHING_KEY", `proposal id doesn't exist: ${r2}`); + throw new Error(e2); } - if (mt$1(this.client.proposal.get(r).expiryTimestamp)) { - await this.deleteProposal(r); - const { message: e } = N$2("EXPIRED", `proposal id: ${r}`); - throw new Error(e); + if (mt$1(this.client.proposal.get(r2).expiryTimestamp)) { + await this.deleteProposal(r2); + const { message: e2 } = N$2("EXPIRED", `proposal id: ${r2}`); + throw new Error(e2); } } } class us extends Kt { - constructor(r, e) { - super(r, e, oe, G$1), this.core = r, this.logger = e; + constructor(r2, e2) { + super(r2, e2, oe, G$1), this.core = r2, this.logger = e2; } } let ge$1 = class ge extends Kt { - constructor(r, e) { - super(r, e, ce, G$1), this.core = r, this.logger = e; + constructor(r2, e2) { + super(r2, e2, ce, G$1), this.core = r2, this.logger = e2; } }; class gs extends Kt { - constructor(r, e) { - super(r, e, pe, G$1, (s) => s.id), this.core = r, this.logger = e; + constructor(r2, e2) { + super(r2, e2, pe, G$1, (s) => s.id), this.core = r2, this.logger = e2; } } let Q$1 = class Q extends b$1 { - constructor(r) { - super(r), this.protocol = J, this.version = F, this.name = M$1.name, this.events = new eventsExports.EventEmitter(), this.on = (s, t) => this.events.on(s, t), this.once = (s, t) => this.events.once(s, t), this.off = (s, t) => this.events.off(s, t), this.removeListener = (s, t) => this.events.removeListener(s, t), this.removeAllListeners = (s) => this.events.removeAllListeners(s), this.connect = async (s) => { + constructor(r2) { + super(r2), this.protocol = J, this.version = F, this.name = M$1.name, this.events = new eventsExports.EventEmitter(), this.on = (s, t) => this.events.on(s, t), this.once = (s, t) => this.events.once(s, t), this.off = (s, t) => this.events.off(s, t), this.removeListener = (s, t) => this.events.removeListener(s, t), this.removeAllListeners = (s) => this.events.removeAllListeners(s), this.connect = async (s) => { try { return await this.engine.connect(s); } catch (t) { @@ -10957,13 +10957,13 @@ let Q$1 = class Q extends b$1 { } catch (s) { throw this.logger.error(s.message), s; } - }, this.name = (r == null ? void 0 : r.name) || M$1.name, this.metadata = (r == null ? void 0 : r.metadata) || Qn(); - const e = typeof (r == null ? void 0 : r.logger) < "u" && typeof (r == null ? void 0 : r.logger) != "string" ? r.logger : Hg(k({ level: (r == null ? void 0 : r.logger) || M$1.logger })); - this.core = (r == null ? void 0 : r.core) || new Mr(r), this.logger = E$2(e, this.name), this.session = new ge$1(this.core, this.logger), this.proposal = new us(this.core, this.logger), this.pendingRequest = new gs(this.core, this.logger), this.engine = new ds(this); + }, this.name = (r2 == null ? void 0 : r2.name) || M$1.name, this.metadata = (r2 == null ? void 0 : r2.metadata) || Qn(); + const e2 = typeof (r2 == null ? void 0 : r2.logger) < "u" && typeof (r2 == null ? void 0 : r2.logger) != "string" ? r2.logger : Hg(k({ level: (r2 == null ? void 0 : r2.logger) || M$1.logger })); + this.core = (r2 == null ? void 0 : r2.core) || new Mr(r2), this.logger = E$3(e2, this.name), this.session = new ge$1(this.core, this.logger), this.proposal = new us(this.core, this.logger), this.pendingRequest = new gs(this.core, this.logger), this.engine = new ds(this); } - static async init(r) { - const e = new Q(r); - return await e.initialize(), e; + static async init(r2) { + const e2 = new Q(r2); + return await e2.initialize(), e2; } get context() { return y$2(this.logger); @@ -10975,8 +10975,8 @@ let Q$1 = class Q extends b$1 { this.logger.trace("Initialized"); try { await this.core.start(), await this.session.init(), await this.proposal.init(), await this.pendingRequest.init(), await this.engine.init(), this.core.verify.init({ verifyUrl: this.metadata.verifyUrl }), this.logger.info("SignClient Initialization Success"); - } catch (r) { - throw this.logger.info("SignClient Initialization Failure"), this.logger.error(r.message), r; + } catch (r2) { + throw this.logger.info("SignClient Initialization Failure"), this.logger.error(r2.message), r2; } } }; @@ -11000,7 +11000,7 @@ var browserPonyfill = { exports: {} }; try { new Blob(); return true; - } catch (e) { + } catch (e2) { return false; } }(), @@ -11441,29 +11441,21 @@ var browserPonyfill = { exports: {} }; module.exports = exports; })(browserPonyfill, browserPonyfill.exports); var browserPonyfillExports = browserPonyfill.exports; -const fetch$1 = /* @__PURE__ */ getDefaultExportFromCjs(browserPonyfillExports); -const DEFAULT_HTTP_HEADERS = { - Accept: "application/json", - "Content-Type": "application/json" -}; -const DEFAULT_HTTP_METHOD = "POST"; -const DEFAULT_FETCH_OPTS = { - headers: DEFAULT_HTTP_HEADERS, - method: DEFAULT_HTTP_METHOD -}; -const EVENT_EMITTER_MAX_LISTENERS_DEFAULT = 10; -class HttpConnection { - constructor(url, disableProviderPing = false) { - this.url = url; - this.disableProviderPing = disableProviderPing; - this.events = new eventsExports.EventEmitter(); - this.isAvailable = false; - this.registering = false; - if (!isHttpUrl(url)) { - throw new Error(`Provided URL is not compatible with HTTP connection: ${url}`); - } - this.url = url; - this.disableProviderPing = disableProviderPing; +const o = /* @__PURE__ */ getDefaultExportFromCjs(browserPonyfillExports); +var P$1 = Object.defineProperty, w2 = Object.defineProperties, E$1 = Object.getOwnPropertyDescriptors, c = Object.getOwnPropertySymbols, L$1 = Object.prototype.hasOwnProperty, O$1 = Object.prototype.propertyIsEnumerable, l = (r2, t, e2) => t in r2 ? P$1(r2, t, { enumerable: true, configurable: true, writable: true, value: e2 }) : r2[t] = e2, p$1 = (r2, t) => { + for (var e2 in t || (t = {})) + L$1.call(t, e2) && l(r2, e2, t[e2]); + if (c) + for (var e2 of c(t)) + O$1.call(t, e2) && l(r2, e2, t[e2]); + return r2; +}, v$1 = (r2, t) => w2(r2, E$1(t)); +const j$1 = { Accept: "application/json", "Content-Type": "application/json" }, T = "POST", d2 = { headers: j$1, method: T }, g$1 = 10; +let f$1 = class f2 { + constructor(t, e2 = false) { + if (this.url = t, this.disableProviderPing = e2, this.events = new eventsExports.EventEmitter(), this.isAvailable = false, this.registering = false, !isHttpUrl(t)) + throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`); + this.url = t, this.disableProviderPing = e2; } get connected() { return this.isAvailable; @@ -11471,109 +11463,85 @@ class HttpConnection { get connecting() { return this.registering; } - on(event, listener) { - this.events.on(event, listener); + on(t, e2) { + this.events.on(t, e2); } - once(event, listener) { - this.events.once(event, listener); + once(t, e2) { + this.events.once(t, e2); } - off(event, listener) { - this.events.off(event, listener); + off(t, e2) { + this.events.off(t, e2); } - removeListener(event, listener) { - this.events.removeListener(event, listener); + removeListener(t, e2) { + this.events.removeListener(t, e2); } - async open(url = this.url) { - await this.register(url); + async open(t = this.url) { + await this.register(t); } async close() { - if (!this.isAvailable) { + if (!this.isAvailable) throw new Error("Connection already closed"); - } this.onClose(); } - async send(payload, context) { - if (!this.isAvailable) { - await this.register(); - } + async send(t) { + this.isAvailable || await this.register(); try { - const body = safeJsonStringify(payload); - const res = await fetch$1(this.url, Object.assign(Object.assign({}, DEFAULT_FETCH_OPTS), { body })); - const data = await res.json(); - this.onPayload({ data }); - } catch (e) { - this.onError(payload.id, e); + const e2 = safeJsonStringify(t), s = await (await o(this.url, v$1(p$1({}, d2), { body: e2 }))).json(); + this.onPayload({ data: s }); + } catch (e2) { + this.onError(t.id, e2); } } - async register(url = this.url) { - if (!isHttpUrl(url)) { - throw new Error(`Provided URL is not compatible with HTTP connection: ${url}`); - } + async register(t = this.url) { + if (!isHttpUrl(t)) + throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`); if (this.registering) { - const currentMaxListeners = this.events.getMaxListeners(); - if (this.events.listenerCount("register_error") >= currentMaxListeners || this.events.listenerCount("open") >= currentMaxListeners) { - this.events.setMaxListeners(currentMaxListeners + 1); - } - return new Promise((resolve, reject) => { - this.events.once("register_error", (error) => { - this.resetMaxListeners(); - reject(error); - }); - this.events.once("open", () => { - this.resetMaxListeners(); - if (typeof this.isAvailable === "undefined") { - return reject(new Error("HTTP connection is missing or invalid")); - } - resolve(); + const e2 = this.events.getMaxListeners(); + return (this.events.listenerCount("register_error") >= e2 || this.events.listenerCount("open") >= e2) && this.events.setMaxListeners(e2 + 1), new Promise((s, i2) => { + this.events.once("register_error", (n3) => { + this.resetMaxListeners(), i2(n3); + }), this.events.once("open", () => { + if (this.resetMaxListeners(), typeof this.isAvailable > "u") + return i2(new Error("HTTP connection is missing or invalid")); + s(); }); }); } - this.url = url; - this.registering = true; + this.url = t, this.registering = true; try { if (!this.disableProviderPing) { - const body = safeJsonStringify({ id: 1, jsonrpc: "2.0", method: "test", params: [] }); - await fetch$1(url, Object.assign(Object.assign({}, DEFAULT_FETCH_OPTS), { body })); + const e2 = safeJsonStringify({ id: 1, jsonrpc: "2.0", method: "test", params: [] }); + await o(t, v$1(p$1({}, d2), { body: e2 })); } this.onOpen(); - } catch (e) { - const error = this.parseError(e); - this.events.emit("register_error", error); - this.onClose(); - throw error; + } catch (e2) { + const s = this.parseError(e2); + throw this.events.emit("register_error", s), this.onClose(), s; } } onOpen() { - this.isAvailable = true; - this.registering = false; - this.events.emit("open"); + this.isAvailable = true, this.registering = false, this.events.emit("open"); } onClose() { - this.isAvailable = false; - this.registering = false; - this.events.emit("close"); + this.isAvailable = false, this.registering = false, this.events.emit("close"); } - onPayload(e) { - if (typeof e.data === "undefined") + onPayload(t) { + if (typeof t.data > "u") return; - const payload = typeof e.data === "string" ? safeJsonParse(e.data) : e.data; - this.events.emit("payload", payload); + const e2 = typeof t.data == "string" ? safeJsonParse(t.data) : t.data; + this.events.emit("payload", e2); } - onError(id, e) { - const error = this.parseError(e); - const message = error.message || error.toString(); - const payload = formatJsonRpcError(id, message); - this.events.emit("payload", payload); + onError(t, e2) { + const s = this.parseError(e2), i2 = s.message || s.toString(), n3 = formatJsonRpcError(t, i2); + this.events.emit("payload", n3); } - parseError(e, url = this.url) { - return parseConnectionError(e, url, "HTTP"); + parseError(t, e2 = this.url) { + return parseConnectionError(t, e2, "HTTP"); } resetMaxListeners() { - if (this.events.getMaxListeners() > EVENT_EMITTER_MAX_LISTENERS_DEFAULT) { - this.events.setMaxListeners(EVENT_EMITTER_MAX_LISTENERS_DEFAULT); - } + this.events.getMaxListeners() > g$1 && this.events.setMaxListeners(g$1); } -} +}; const Ia = "error", Fg = "wss://relay.walletconnect.com", Mg = "wc", qg = "universal_provider", xa = `${Mg}@2:${qg}:`, Bg = "https://rpc.walletconnect.com/v1/", Vn = { DEFAULT_CHAIN_CHANGED: "default_chain_changed" }; var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ui = { exports: {} }; /** @@ -11586,7 +11554,7 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : */ (function(A2, u3) { (function() { - var i2, d2 = "4.17.21", w3 = 200, L2 = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", D2 = "Expected a function", En = "Invalid `variable` option passed into `_.template`", zt2 = "__lodash_hash_undefined__", pr2 = 500, It2 = "__lodash_placeholder__", Ln2 = 1, Fn2 = 2, xt2 = 4, Et2 = 1, ve2 = 2, vn2 = 1, ct2 = 2, qi = 4, Dn2 = 8, yt2 = 16, Hn2 = 32, St2 = 64, Mn2 = 128, Kt2 = 256, dr2 = 512, Da = 30, Ha = "...", Na = 800, $a = 16, Bi = 1, Ua = 2, Wa = 3, ht2 = 1 / 0, kn2 = 9007199254740991, Fa = 17976931348623157e292, _e2 = 0 / 0, Nn = 4294967295, Ma = Nn - 1, qa = Nn >>> 1, Ba = [["ary", Mn2], ["bind", vn2], ["bindKey", ct2], ["curry", Dn2], ["curryRight", yt2], ["flip", dr2], ["partial", Hn2], ["partialRight", St2], ["rearg", Kt2]], Ot2 = "[object Arguments]", me = "[object Array]", Ga = "[object AsyncFunction]", Yt2 = "[object Boolean]", Zt2 = "[object Date]", za = "[object DOMException]", we = "[object Error]", Pe2 = "[object Function]", Gi2 = "[object GeneratorFunction]", yn2 = "[object Map]", Jt2 = "[object Number]", Ka = "[object Null]", qn2 = "[object Object]", zi = "[object Promise]", Ya = "[object Proxy]", Xt2 = "[object RegExp]", Sn = "[object Set]", Qt2 = "[object String]", Ae2 = "[object Symbol]", Za = "[object Undefined]", Vt2 = "[object WeakMap]", Ja = "[object WeakSet]", kt2 = "[object ArrayBuffer]", Rt2 = "[object DataView]", gr2 = "[object Float32Array]", vr2 = "[object Float64Array]", _r2 = "[object Int8Array]", mr2 = "[object Int16Array]", wr = "[object Int32Array]", Pr2 = "[object Uint8Array]", Ar2 = "[object Uint8ClampedArray]", Cr2 = "[object Uint16Array]", Ir2 = "[object Uint32Array]", Xa = /\b__p \+= '';/g, Qa = /\b(__p \+=) '' \+/g, Va = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Ki = /&(?:amp|lt|gt|quot|#39);/g, Yi2 = /[&<>"']/g, ka = RegExp(Ki.source), ja = RegExp(Yi2.source), no = /<%-([\s\S]+?)%>/g, to = /<%([\s\S]+?)%>/g, Zi2 = /<%=([\s\S]+?)%>/g, eo = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ro = /^\w*$/, io = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, xr2 = /[\\^$.*+?()[\]{}|]/g, so = RegExp(xr2.source), Er = /^\s+/, uo = /\s/, ao = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, oo = /\{\n\/\* \[wrapped with (.+)\] \*/, fo = /,? & /, co = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, ho = /[()=,{}\[\]\/\s]/, lo = /\\(\\)?/g, po = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Ji2 = /\w*$/, go = /^[-+]0x[0-9a-f]+$/i, vo = /^0b[01]+$/i, _o = /^\[object .+?Constructor\]$/, mo = /^0o[0-7]+$/i, wo = /^(?:0|[1-9]\d*)$/, Po = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ce2 = /($^)/, Ao = /['\n\r\u2028\u2029\\]/g, Ie = "\\ud800-\\udfff", Co = "\\u0300-\\u036f", Io = "\\ufe20-\\ufe2f", xo = "\\u20d0-\\u20ff", Xi2 = Co + Io + xo, Qi2 = "\\u2700-\\u27bf", Vi = "a-z\\xdf-\\xf6\\xf8-\\xff", Eo = "\\xac\\xb1\\xd7\\xf7", yo = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", So = "\\u2000-\\u206f", Oo = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", ki = "A-Z\\xc0-\\xd6\\xd8-\\xde", ji = "\\ufe0e\\ufe0f", ns2 = Eo + yo + So + Oo, yr2 = "['’]", Ro = "[" + Ie + "]", ts2 = "[" + ns2 + "]", xe = "[" + Xi2 + "]", es2 = "\\d+", bo = "[" + Qi2 + "]", rs2 = "[" + Vi + "]", is2 = "[^" + Ie + ns2 + es2 + Qi2 + Vi + ki + "]", Sr2 = "\\ud83c[\\udffb-\\udfff]", To = "(?:" + xe + "|" + Sr2 + ")", ss2 = "[^" + Ie + "]", Or2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", Rr2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", bt2 = "[" + ki + "]", us2 = "\\u200d", as2 = "(?:" + rs2 + "|" + is2 + ")", Lo = "(?:" + bt2 + "|" + is2 + ")", os2 = "(?:" + yr2 + "(?:d|ll|m|re|s|t|ve))?", fs2 = "(?:" + yr2 + "(?:D|LL|M|RE|S|T|VE))?", cs2 = To + "?", hs2 = "[" + ji + "]?", Do = "(?:" + us2 + "(?:" + [ss2, Or2, Rr2].join("|") + ")" + hs2 + cs2 + ")*", Ho = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", No = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", ls2 = hs2 + cs2 + Do, $o = "(?:" + [bo, Or2, Rr2].join("|") + ")" + ls2, Uo = "(?:" + [ss2 + xe + "?", xe, Or2, Rr2, Ro].join("|") + ")", Wo = RegExp(yr2, "g"), Fo = RegExp(xe, "g"), br = RegExp(Sr2 + "(?=" + Sr2 + ")|" + Uo + ls2, "g"), Mo = RegExp([bt2 + "?" + rs2 + "+" + os2 + "(?=" + [ts2, bt2, "$"].join("|") + ")", Lo + "+" + fs2 + "(?=" + [ts2, bt2 + as2, "$"].join("|") + ")", bt2 + "?" + as2 + "+" + os2, bt2 + "+" + fs2, No, Ho, es2, $o].join("|"), "g"), qo = RegExp("[" + us2 + Ie + Xi2 + ji + "]"), Bo = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Go = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], zo = -1, B2 = {}; + var i2, d3 = "4.17.21", w3 = 200, L2 = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", D2 = "Expected a function", En = "Invalid `variable` option passed into `_.template`", zt2 = "__lodash_hash_undefined__", pr2 = 500, It2 = "__lodash_placeholder__", Ln2 = 1, Fn2 = 2, xt2 = 4, Et2 = 1, ve2 = 2, vn2 = 1, ct2 = 2, qi = 4, Dn2 = 8, yt2 = 16, Hn2 = 32, St2 = 64, Mn2 = 128, Kt2 = 256, dr2 = 512, Da = 30, Ha = "...", Na = 800, $a = 16, Bi = 1, Ua = 2, Wa = 3, ht2 = 1 / 0, kn2 = 9007199254740991, Fa = 17976931348623157e292, _e2 = 0 / 0, Nn = 4294967295, Ma = Nn - 1, qa = Nn >>> 1, Ba = [["ary", Mn2], ["bind", vn2], ["bindKey", ct2], ["curry", Dn2], ["curryRight", yt2], ["flip", dr2], ["partial", Hn2], ["partialRight", St2], ["rearg", Kt2]], Ot2 = "[object Arguments]", me = "[object Array]", Ga = "[object AsyncFunction]", Yt2 = "[object Boolean]", Zt2 = "[object Date]", za = "[object DOMException]", we = "[object Error]", Pe2 = "[object Function]", Gi2 = "[object GeneratorFunction]", yn2 = "[object Map]", Jt2 = "[object Number]", Ka = "[object Null]", qn2 = "[object Object]", zi = "[object Promise]", Ya = "[object Proxy]", Xt2 = "[object RegExp]", Sn = "[object Set]", Qt2 = "[object String]", Ae2 = "[object Symbol]", Za = "[object Undefined]", Vt2 = "[object WeakMap]", Ja = "[object WeakSet]", kt2 = "[object ArrayBuffer]", Rt2 = "[object DataView]", gr2 = "[object Float32Array]", vr2 = "[object Float64Array]", _r2 = "[object Int8Array]", mr2 = "[object Int16Array]", wr = "[object Int32Array]", Pr2 = "[object Uint8Array]", Ar2 = "[object Uint8ClampedArray]", Cr2 = "[object Uint16Array]", Ir2 = "[object Uint32Array]", Xa = /\b__p \+= '';/g, Qa = /\b(__p \+=) '' \+/g, Va = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Ki = /&(?:amp|lt|gt|quot|#39);/g, Yi2 = /[&<>"']/g, ka = RegExp(Ki.source), ja = RegExp(Yi2.source), no = /<%-([\s\S]+?)%>/g, to = /<%([\s\S]+?)%>/g, Zi2 = /<%=([\s\S]+?)%>/g, eo = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ro = /^\w*$/, io = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, xr2 = /[\\^$.*+?()[\]{}|]/g, so = RegExp(xr2.source), Er = /^\s+/, uo = /\s/, ao = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, oo = /\{\n\/\* \[wrapped with (.+)\] \*/, fo = /,? & /, co = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, ho = /[()=,{}\[\]\/\s]/, lo = /\\(\\)?/g, po = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Ji2 = /\w*$/, go = /^[-+]0x[0-9a-f]+$/i, vo = /^0b[01]+$/i, _o = /^\[object .+?Constructor\]$/, mo = /^0o[0-7]+$/i, wo = /^(?:0|[1-9]\d*)$/, Po = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ce2 = /($^)/, Ao = /['\n\r\u2028\u2029\\]/g, Ie = "\\ud800-\\udfff", Co = "\\u0300-\\u036f", Io = "\\ufe20-\\ufe2f", xo = "\\u20d0-\\u20ff", Xi2 = Co + Io + xo, Qi2 = "\\u2700-\\u27bf", Vi = "a-z\\xdf-\\xf6\\xf8-\\xff", Eo = "\\xac\\xb1\\xd7\\xf7", yo = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", So = "\\u2000-\\u206f", Oo = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", ki = "A-Z\\xc0-\\xd6\\xd8-\\xde", ji = "\\ufe0e\\ufe0f", ns2 = Eo + yo + So + Oo, yr2 = "['’]", Ro = "[" + Ie + "]", ts2 = "[" + ns2 + "]", xe = "[" + Xi2 + "]", es2 = "\\d+", bo = "[" + Qi2 + "]", rs2 = "[" + Vi + "]", is2 = "[^" + Ie + ns2 + es2 + Qi2 + Vi + ki + "]", Sr2 = "\\ud83c[\\udffb-\\udfff]", To = "(?:" + xe + "|" + Sr2 + ")", ss2 = "[^" + Ie + "]", Or2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", Rr2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", bt2 = "[" + ki + "]", us2 = "\\u200d", as2 = "(?:" + rs2 + "|" + is2 + ")", Lo = "(?:" + bt2 + "|" + is2 + ")", os2 = "(?:" + yr2 + "(?:d|ll|m|re|s|t|ve))?", fs2 = "(?:" + yr2 + "(?:D|LL|M|RE|S|T|VE))?", cs2 = To + "?", hs2 = "[" + ji + "]?", Do = "(?:" + us2 + "(?:" + [ss2, Or2, Rr2].join("|") + ")" + hs2 + cs2 + ")*", Ho = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", No = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", ls2 = hs2 + cs2 + Do, $o = "(?:" + [bo, Or2, Rr2].join("|") + ")" + ls2, Uo = "(?:" + [ss2 + xe + "?", xe, Or2, Rr2, Ro].join("|") + ")", Wo = RegExp(yr2, "g"), Fo = RegExp(xe, "g"), br = RegExp(Sr2 + "(?=" + Sr2 + ")|" + Uo + ls2, "g"), Mo = RegExp([bt2 + "?" + rs2 + "+" + os2 + "(?=" + [ts2, bt2, "$"].join("|") + ")", Lo + "+" + fs2 + "(?=" + [ts2, bt2 + as2, "$"].join("|") + ")", bt2 + "?" + as2 + "+" + os2, bt2 + "+" + fs2, No, Ho, es2, $o].join("|"), "g"), qo = RegExp("[" + us2 + Ie + Xi2 + ji + "]"), Bo = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Go = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], zo = -1, B2 = {}; B2[gr2] = B2[vr2] = B2[_r2] = B2[mr2] = B2[wr] = B2[Pr2] = B2[Ar2] = B2[Cr2] = B2[Ir2] = true, B2[Ot2] = B2[me] = B2[kt2] = B2[Yt2] = B2[Rt2] = B2[Zt2] = B2[we] = B2[Pe2] = B2[yn2] = B2[Jt2] = B2[qn2] = B2[Xt2] = B2[Sn] = B2[Qt2] = B2[Vt2] = false; var q2 = {}; q2[Ot2] = q2[me] = q2[kt2] = q2[Rt2] = q2[Yt2] = q2[Zt2] = q2[gr2] = q2[vr2] = q2[_r2] = q2[mr2] = q2[wr] = q2[yn2] = q2[Jt2] = q2[qn2] = q2[Xt2] = q2[Sn] = q2[Qt2] = q2[Ae2] = q2[Pr2] = q2[Ar2] = q2[Cr2] = q2[Ir2] = true, q2[we] = q2[Pe2] = q2[Vt2] = false; @@ -11869,67 +11837,67 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : var Cf = function h4(g3) { g3 = g3 == null ? k2 : Ht2.defaults(k2.Object(), g3, Ht2.pick(k2, Go)); var p3 = g3.Array, C2 = g3.Date, S2 = g3.Error, U2 = g3.Function, X2 = g3.Math, M2 = g3.Object, Br = g3.RegExp, If = g3.String, wn = g3.TypeError, Oe = p3.prototype, xf = U2.prototype, Nt2 = M2.prototype, Re2 = g3["__core-js_shared__"], be = xf.toString, F2 = Nt2.hasOwnProperty, Ef = 0, Ts2 = function() { - var n2 = /[^.]+$/.exec(Re2 && Re2.keys && Re2.keys.IE_PROTO || ""); - return n2 ? "Symbol(src)_1." + n2 : ""; + var n3 = /[^.]+$/.exec(Re2 && Re2.keys && Re2.keys.IE_PROTO || ""); + return n3 ? "Symbol(src)_1." + n3 : ""; }(), Te2 = Nt2.toString, yf = be.call(M2), Sf = k2._, Of = Br("^" + be.call(F2).replace(xr2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Le2 = ds2 ? g3.Buffer : i2, et2 = g3.Symbol, De2 = g3.Uint8Array, Ls2 = Le2 ? Le2.allocUnsafe : i2, He2 = Rs2(M2.getPrototypeOf, M2), Ds2 = M2.create, Hs2 = Nt2.propertyIsEnumerable, Ne2 = Oe.splice, Ns2 = et2 ? et2.isConcatSpreadable : i2, ne = et2 ? et2.iterator : i2, pt2 = et2 ? et2.toStringTag : i2, $e2 = function() { try { - var n2 = mt2(M2, "defineProperty"); - return n2({}, "", {}), n2; + var n3 = mt2(M2, "defineProperty"); + return n3({}, "", {}), n3; } catch { } }(), Rf = g3.clearTimeout !== k2.clearTimeout && g3.clearTimeout, bf = C2 && C2.now !== k2.Date.now && C2.now, Tf = g3.setTimeout !== k2.setTimeout && g3.setTimeout, Ue2 = X2.ceil, We2 = X2.floor, Gr = M2.getOwnPropertySymbols, Lf = Le2 ? Le2.isBuffer : i2, $s2 = g3.isFinite, Df = Oe.join, Hf = Rs2(M2.keys, M2), Q3 = X2.max, nn2 = X2.min, Nf = C2.now, $f = g3.parseInt, Us2 = X2.random, Uf = Oe.reverse, zr2 = mt2(g3, "DataView"), te2 = mt2(g3, "Map"), Kr = mt2(g3, "Promise"), $t2 = mt2(g3, "Set"), ee2 = mt2(g3, "WeakMap"), re2 = mt2(M2, "create"), Fe2 = ee2 && new ee2(), Ut2 = {}, Wf = wt2(zr2), Ff = wt2(te2), Mf = wt2(Kr), qf = wt2($t2), Bf = wt2(ee2), Me2 = et2 ? et2.prototype : i2, ie2 = Me2 ? Me2.valueOf : i2, Ws2 = Me2 ? Me2.toString : i2; - function a3(n2) { - if (Y(n2) && !O2(n2) && !(n2 instanceof N2)) { - if (n2 instanceof Pn) - return n2; - if (F2.call(n2, "__wrapped__")) - return Fu(n2); + function a3(n3) { + if (Y(n3) && !O2(n3) && !(n3 instanceof N2)) { + if (n3 instanceof Pn) + return n3; + if (F2.call(n3, "__wrapped__")) + return Fu(n3); } - return new Pn(n2); + return new Pn(n3); } var Wt2 = /* @__PURE__ */ function() { - function n2() { + function n3() { } return function(t) { if (!K2(t)) return {}; if (Ds2) return Ds2(t); - n2.prototype = t; - var e = new n2(); - return n2.prototype = i2, e; + n3.prototype = t; + var e2 = new n3(); + return n3.prototype = i2, e2; }; }(); function qe2() { } - function Pn(n2, t) { - this.__wrapped__ = n2, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = i2; + function Pn(n3, t) { + this.__wrapped__ = n3, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = i2; } a3.templateSettings = { escape: no, evaluate: to, interpolate: Zi2, variable: "", imports: { _: a3 } }, a3.prototype = qe2.prototype, a3.prototype.constructor = a3, Pn.prototype = Wt2(qe2.prototype), Pn.prototype.constructor = Pn; - function N2(n2) { - this.__wrapped__ = n2, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = Nn, this.__views__ = []; + function N2(n3) { + this.__wrapped__ = n3, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = Nn, this.__views__ = []; } function Gf() { - var n2 = new N2(this.__wrapped__); - return n2.__actions__ = un2(this.__actions__), n2.__dir__ = this.__dir__, n2.__filtered__ = this.__filtered__, n2.__iteratees__ = un2(this.__iteratees__), n2.__takeCount__ = this.__takeCount__, n2.__views__ = un2(this.__views__), n2; + var n3 = new N2(this.__wrapped__); + return n3.__actions__ = un2(this.__actions__), n3.__dir__ = this.__dir__, n3.__filtered__ = this.__filtered__, n3.__iteratees__ = un2(this.__iteratees__), n3.__takeCount__ = this.__takeCount__, n3.__views__ = un2(this.__views__), n3; } function zf() { if (this.__filtered__) { - var n2 = new N2(this); - n2.__dir__ = -1, n2.__filtered__ = true; + var n3 = new N2(this); + n3.__dir__ = -1, n3.__filtered__ = true; } else - n2 = this.clone(), n2.__dir__ *= -1; - return n2; + n3 = this.clone(), n3.__dir__ *= -1; + return n3; } function Kf() { - var n2 = this.__wrapped__.value(), t = this.__dir__, e = O2(n2), r = t < 0, s = e ? n2.length : 0, o = rh(0, s, this.__views__), f3 = o.start, c2 = o.end, l2 = c2 - f3, v3 = r ? c2 : f3 - 1, _3 = this.__iteratees__, m2 = _3.length, P2 = 0, I2 = nn2(l2, this.__takeCount__); - if (!e || !r && s == l2 && I2 == l2) - return ou(n2, this.__actions__); + var n3 = this.__wrapped__.value(), t = this.__dir__, e2 = O2(n3), r2 = t < 0, s = e2 ? n3.length : 0, o2 = rh(0, s, this.__views__), f4 = o2.start, c2 = o2.end, l2 = c2 - f4, v3 = r2 ? c2 : f4 - 1, _3 = this.__iteratees__, m2 = _3.length, P2 = 0, I2 = nn2(l2, this.__takeCount__); + if (!e2 || !r2 && s == l2 && I2 == l2) + return ou(n3, this.__actions__); var E3 = []; n: for (; l2-- && P2 < I2; ) { v3 += t; - for (var b3 = -1, y3 = n2[v3]; ++b3 < m2; ) { + for (var b3 = -1, y3 = n3[v3]; ++b3 < m2; ) { var H2 = _3[b3], $2 = H2.iteratee, dn2 = H2.type, sn2 = $2(y3); if (dn2 == Ua) y3 = sn2; @@ -11944,347 +11912,347 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : return E3; } N2.prototype = Wt2(qe2.prototype), N2.prototype.constructor = N2; - function dt2(n2) { - var t = -1, e = n2 == null ? 0 : n2.length; - for (this.clear(); ++t < e; ) { - var r = n2[t]; - this.set(r[0], r[1]); + function dt2(n3) { + var t = -1, e2 = n3 == null ? 0 : n3.length; + for (this.clear(); ++t < e2; ) { + var r2 = n3[t]; + this.set(r2[0], r2[1]); } } function Yf() { this.__data__ = re2 ? re2(null) : {}, this.size = 0; } - function Zf(n2) { - var t = this.has(n2) && delete this.__data__[n2]; + function Zf(n3) { + var t = this.has(n3) && delete this.__data__[n3]; return this.size -= t ? 1 : 0, t; } - function Jf(n2) { + function Jf(n3) { var t = this.__data__; if (re2) { - var e = t[n2]; - return e === zt2 ? i2 : e; + var e2 = t[n3]; + return e2 === zt2 ? i2 : e2; } - return F2.call(t, n2) ? t[n2] : i2; + return F2.call(t, n3) ? t[n3] : i2; } - function Xf(n2) { + function Xf(n3) { var t = this.__data__; - return re2 ? t[n2] !== i2 : F2.call(t, n2); + return re2 ? t[n3] !== i2 : F2.call(t, n3); } - function Qf(n2, t) { - var e = this.__data__; - return this.size += this.has(n2) ? 0 : 1, e[n2] = re2 && t === i2 ? zt2 : t, this; + function Qf(n3, t) { + var e2 = this.__data__; + return this.size += this.has(n3) ? 0 : 1, e2[n3] = re2 && t === i2 ? zt2 : t, this; } dt2.prototype.clear = Yf, dt2.prototype.delete = Zf, dt2.prototype.get = Jf, dt2.prototype.has = Xf, dt2.prototype.set = Qf; - function Bn2(n2) { - var t = -1, e = n2 == null ? 0 : n2.length; - for (this.clear(); ++t < e; ) { - var r = n2[t]; - this.set(r[0], r[1]); + function Bn2(n3) { + var t = -1, e2 = n3 == null ? 0 : n3.length; + for (this.clear(); ++t < e2; ) { + var r2 = n3[t]; + this.set(r2[0], r2[1]); } } function Vf() { this.__data__ = [], this.size = 0; } - function kf(n2) { - var t = this.__data__, e = Be2(t, n2); - if (e < 0) + function kf(n3) { + var t = this.__data__, e2 = Be2(t, n3); + if (e2 < 0) return false; - var r = t.length - 1; - return e == r ? t.pop() : Ne2.call(t, e, 1), --this.size, true; + var r2 = t.length - 1; + return e2 == r2 ? t.pop() : Ne2.call(t, e2, 1), --this.size, true; } - function jf(n2) { - var t = this.__data__, e = Be2(t, n2); - return e < 0 ? i2 : t[e][1]; + function jf(n3) { + var t = this.__data__, e2 = Be2(t, n3); + return e2 < 0 ? i2 : t[e2][1]; } - function nc(n2) { - return Be2(this.__data__, n2) > -1; + function nc(n3) { + return Be2(this.__data__, n3) > -1; } - function tc(n2, t) { - var e = this.__data__, r = Be2(e, n2); - return r < 0 ? (++this.size, e.push([n2, t])) : e[r][1] = t, this; + function tc(n3, t) { + var e2 = this.__data__, r2 = Be2(e2, n3); + return r2 < 0 ? (++this.size, e2.push([n3, t])) : e2[r2][1] = t, this; } Bn2.prototype.clear = Vf, Bn2.prototype.delete = kf, Bn2.prototype.get = jf, Bn2.prototype.has = nc, Bn2.prototype.set = tc; - function Gn2(n2) { - var t = -1, e = n2 == null ? 0 : n2.length; - for (this.clear(); ++t < e; ) { - var r = n2[t]; - this.set(r[0], r[1]); + function Gn2(n3) { + var t = -1, e2 = n3 == null ? 0 : n3.length; + for (this.clear(); ++t < e2; ) { + var r2 = n3[t]; + this.set(r2[0], r2[1]); } } function ec() { this.size = 0, this.__data__ = { hash: new dt2(), map: new (te2 || Bn2)(), string: new dt2() }; } - function rc(n2) { - var t = nr2(this, n2).delete(n2); + function rc(n3) { + var t = nr2(this, n3).delete(n3); return this.size -= t ? 1 : 0, t; } - function ic(n2) { - return nr2(this, n2).get(n2); + function ic(n3) { + return nr2(this, n3).get(n3); } - function sc(n2) { - return nr2(this, n2).has(n2); + function sc(n3) { + return nr2(this, n3).has(n3); } - function uc(n2, t) { - var e = nr2(this, n2), r = e.size; - return e.set(n2, t), this.size += e.size == r ? 0 : 1, this; + function uc(n3, t) { + var e2 = nr2(this, n3), r2 = e2.size; + return e2.set(n3, t), this.size += e2.size == r2 ? 0 : 1, this; } Gn2.prototype.clear = ec, Gn2.prototype.delete = rc, Gn2.prototype.get = ic, Gn2.prototype.has = sc, Gn2.prototype.set = uc; - function gt2(n2) { - var t = -1, e = n2 == null ? 0 : n2.length; - for (this.__data__ = new Gn2(); ++t < e; ) - this.add(n2[t]); + function gt2(n3) { + var t = -1, e2 = n3 == null ? 0 : n3.length; + for (this.__data__ = new Gn2(); ++t < e2; ) + this.add(n3[t]); } - function ac(n2) { - return this.__data__.set(n2, zt2), this; + function ac(n3) { + return this.__data__.set(n3, zt2), this; } - function oc(n2) { - return this.__data__.has(n2); + function oc(n3) { + return this.__data__.has(n3); } gt2.prototype.add = gt2.prototype.push = ac, gt2.prototype.has = oc; - function Rn(n2) { - var t = this.__data__ = new Bn2(n2); + function Rn(n3) { + var t = this.__data__ = new Bn2(n3); this.size = t.size; } function fc() { this.__data__ = new Bn2(), this.size = 0; } - function cc(n2) { - var t = this.__data__, e = t.delete(n2); - return this.size = t.size, e; + function cc(n3) { + var t = this.__data__, e2 = t.delete(n3); + return this.size = t.size, e2; } - function hc(n2) { - return this.__data__.get(n2); + function hc(n3) { + return this.__data__.get(n3); } - function lc(n2) { - return this.__data__.has(n2); + function lc(n3) { + return this.__data__.has(n3); } - function pc(n2, t) { - var e = this.__data__; - if (e instanceof Bn2) { - var r = e.__data__; - if (!te2 || r.length < w3 - 1) - return r.push([n2, t]), this.size = ++e.size, this; - e = this.__data__ = new Gn2(r); + function pc(n3, t) { + var e2 = this.__data__; + if (e2 instanceof Bn2) { + var r2 = e2.__data__; + if (!te2 || r2.length < w3 - 1) + return r2.push([n3, t]), this.size = ++e2.size, this; + e2 = this.__data__ = new Gn2(r2); } - return e.set(n2, t), this.size = e.size, this; + return e2.set(n3, t), this.size = e2.size, this; } Rn.prototype.clear = fc, Rn.prototype.delete = cc, Rn.prototype.get = hc, Rn.prototype.has = lc, Rn.prototype.set = pc; - function Fs2(n2, t) { - var e = O2(n2), r = !e && Pt2(n2), s = !e && !r && at2(n2), o = !e && !r && !s && Bt2(n2), f3 = e || r || s || o, c2 = f3 ? Fr2(n2.length, If) : [], l2 = c2.length; - for (var v3 in n2) - (t || F2.call(n2, v3)) && !(f3 && (v3 == "length" || s && (v3 == "offset" || v3 == "parent") || o && (v3 == "buffer" || v3 == "byteLength" || v3 == "byteOffset") || Zn(v3, l2))) && c2.push(v3); + function Fs2(n3, t) { + var e2 = O2(n3), r2 = !e2 && Pt2(n3), s = !e2 && !r2 && at2(n3), o2 = !e2 && !r2 && !s && Bt2(n3), f4 = e2 || r2 || s || o2, c2 = f4 ? Fr2(n3.length, If) : [], l2 = c2.length; + for (var v3 in n3) + (t || F2.call(n3, v3)) && !(f4 && (v3 == "length" || s && (v3 == "offset" || v3 == "parent") || o2 && (v3 == "buffer" || v3 == "byteLength" || v3 == "byteOffset") || Zn(v3, l2))) && c2.push(v3); return c2; } - function Ms2(n2) { - var t = n2.length; - return t ? n2[ei(0, t - 1)] : i2; + function Ms2(n3) { + var t = n3.length; + return t ? n3[ei(0, t - 1)] : i2; } - function dc(n2, t) { - return tr2(un2(n2), vt2(t, 0, n2.length)); + function dc(n3, t) { + return tr2(un2(n3), vt2(t, 0, n3.length)); } - function gc(n2) { - return tr2(un2(n2)); + function gc(n3) { + return tr2(un2(n3)); } - function Yr(n2, t, e) { - (e !== i2 && !bn(n2[t], e) || e === i2 && !(t in n2)) && zn(n2, t, e); + function Yr(n3, t, e2) { + (e2 !== i2 && !bn(n3[t], e2) || e2 === i2 && !(t in n3)) && zn(n3, t, e2); } - function se(n2, t, e) { - var r = n2[t]; - (!(F2.call(n2, t) && bn(r, e)) || e === i2 && !(t in n2)) && zn(n2, t, e); + function se(n3, t, e2) { + var r2 = n3[t]; + (!(F2.call(n3, t) && bn(r2, e2)) || e2 === i2 && !(t in n3)) && zn(n3, t, e2); } - function Be2(n2, t) { - for (var e = n2.length; e--; ) - if (bn(n2[e][0], t)) - return e; + function Be2(n3, t) { + for (var e2 = n3.length; e2--; ) + if (bn(n3[e2][0], t)) + return e2; return -1; } - function vc(n2, t, e, r) { - return rt2(n2, function(s, o, f3) { - t(r, s, e(s), f3); - }), r; + function vc(n3, t, e2, r2) { + return rt2(n3, function(s, o2, f4) { + t(r2, s, e2(s), f4); + }), r2; } - function qs2(n2, t) { - return n2 && Un2(t, V2(t), n2); + function qs2(n3, t) { + return n3 && Un2(t, V2(t), n3); } - function _c(n2, t) { - return n2 && Un2(t, on2(t), n2); + function _c(n3, t) { + return n3 && Un2(t, on2(t), n3); } - function zn(n2, t, e) { - t == "__proto__" && $e2 ? $e2(n2, t, { configurable: true, enumerable: true, value: e, writable: true }) : n2[t] = e; + function zn(n3, t, e2) { + t == "__proto__" && $e2 ? $e2(n3, t, { configurable: true, enumerable: true, value: e2, writable: true }) : n3[t] = e2; } - function Zr(n2, t) { - for (var e = -1, r = t.length, s = p3(r), o = n2 == null; ++e < r; ) - s[e] = o ? i2 : Si(n2, t[e]); + function Zr(n3, t) { + for (var e2 = -1, r2 = t.length, s = p3(r2), o2 = n3 == null; ++e2 < r2; ) + s[e2] = o2 ? i2 : Si(n3, t[e2]); return s; } - function vt2(n2, t, e) { - return n2 === n2 && (e !== i2 && (n2 = n2 <= e ? n2 : e), t !== i2 && (n2 = n2 >= t ? n2 : t)), n2; + function vt2(n3, t, e2) { + return n3 === n3 && (e2 !== i2 && (n3 = n3 <= e2 ? n3 : e2), t !== i2 && (n3 = n3 >= t ? n3 : t)), n3; } - function An(n2, t, e, r, s, o) { - var f3, c2 = t & Ln2, l2 = t & Fn2, v3 = t & xt2; - if (e && (f3 = s ? e(n2, r, s, o) : e(n2)), f3 !== i2) - return f3; - if (!K2(n2)) - return n2; - var _3 = O2(n2); + function An(n3, t, e2, r2, s, o2) { + var f4, c2 = t & Ln2, l2 = t & Fn2, v3 = t & xt2; + if (e2 && (f4 = s ? e2(n3, r2, s, o2) : e2(n3)), f4 !== i2) + return f4; + if (!K2(n3)) + return n3; + var _3 = O2(n3); if (_3) { - if (f3 = sh(n2), !c2) - return un2(n2, f3); + if (f4 = sh(n3), !c2) + return un2(n3, f4); } else { - var m2 = tn2(n2), P2 = m2 == Pe2 || m2 == Gi2; - if (at2(n2)) - return hu(n2, c2); + var m2 = tn2(n3), P2 = m2 == Pe2 || m2 == Gi2; + if (at2(n3)) + return hu(n3, c2); if (m2 == qn2 || m2 == Ot2 || P2 && !s) { - if (f3 = l2 || P2 ? {} : bu(n2), !c2) - return l2 ? Jc(n2, _c(f3, n2)) : Zc(n2, qs2(f3, n2)); + if (f4 = l2 || P2 ? {} : bu(n3), !c2) + return l2 ? Jc(n3, _c(f4, n3)) : Zc(n3, qs2(f4, n3)); } else { if (!q2[m2]) - return s ? n2 : {}; - f3 = uh(n2, m2, c2); + return s ? n3 : {}; + f4 = uh(n3, m2, c2); } } - o || (o = new Rn()); - var I2 = o.get(n2); + o2 || (o2 = new Rn()); + var I2 = o2.get(n3); if (I2) return I2; - o.set(n2, f3), sa(n2) ? n2.forEach(function(y3) { - f3.add(An(y3, t, e, y3, n2, o)); - }) : ra(n2) && n2.forEach(function(y3, H2) { - f3.set(H2, An(y3, t, e, H2, n2, o)); + o2.set(n3, f4), sa(n3) ? n3.forEach(function(y3) { + f4.add(An(y3, t, e2, y3, n3, o2)); + }) : ra(n3) && n3.forEach(function(y3, H2) { + f4.set(H2, An(y3, t, e2, H2, n3, o2)); }); - var E3 = v3 ? l2 ? pi : li : l2 ? on2 : V2, b3 = _3 ? i2 : E3(n2); - return mn2(b3 || n2, function(y3, H2) { - b3 && (H2 = y3, y3 = n2[H2]), se(f3, H2, An(y3, t, e, H2, n2, o)); - }), f3; - } - function mc(n2) { - var t = V2(n2); - return function(e) { - return Bs2(e, n2, t); + var E3 = v3 ? l2 ? pi : li : l2 ? on2 : V2, b3 = _3 ? i2 : E3(n3); + return mn2(b3 || n3, function(y3, H2) { + b3 && (H2 = y3, y3 = n3[H2]), se(f4, H2, An(y3, t, e2, H2, n3, o2)); + }), f4; + } + function mc(n3) { + var t = V2(n3); + return function(e2) { + return Bs2(e2, n3, t); }; } - function Bs2(n2, t, e) { - var r = e.length; - if (n2 == null) - return !r; - for (n2 = M2(n2); r--; ) { - var s = e[r], o = t[s], f3 = n2[s]; - if (f3 === i2 && !(s in n2) || !o(f3)) + function Bs2(n3, t, e2) { + var r2 = e2.length; + if (n3 == null) + return !r2; + for (n3 = M2(n3); r2--; ) { + var s = e2[r2], o2 = t[s], f4 = n3[s]; + if (f4 === i2 && !(s in n3) || !o2(f4)) return false; } return true; } - function Gs2(n2, t, e) { - if (typeof n2 != "function") + function Gs2(n3, t, e2) { + if (typeof n3 != "function") throw new wn(D2); return le2(function() { - n2.apply(i2, e); + n3.apply(i2, e2); }, t); } - function ue2(n2, t, e, r) { - var s = -1, o = Ee, f3 = true, c2 = n2.length, l2 = [], v3 = t.length; + function ue2(n3, t, e2, r2) { + var s = -1, o2 = Ee, f4 = true, c2 = n3.length, l2 = [], v3 = t.length; if (!c2) return l2; - e && (t = G2(t, hn2(e))), r ? (o = Dr2, f3 = false) : t.length >= w3 && (o = jt2, f3 = false, t = new gt2(t)); + e2 && (t = G2(t, hn2(e2))), r2 ? (o2 = Dr2, f4 = false) : t.length >= w3 && (o2 = jt2, f4 = false, t = new gt2(t)); n: for (; ++s < c2; ) { - var _3 = n2[s], m2 = e == null ? _3 : e(_3); - if (_3 = r || _3 !== 0 ? _3 : 0, f3 && m2 === m2) { + var _3 = n3[s], m2 = e2 == null ? _3 : e2(_3); + if (_3 = r2 || _3 !== 0 ? _3 : 0, f4 && m2 === m2) { for (var P2 = v3; P2--; ) if (t[P2] === m2) continue n; l2.push(_3); } else - o(t, m2, r) || l2.push(_3); + o2(t, m2, r2) || l2.push(_3); } return l2; } var rt2 = vu($n), zs2 = vu(Xr, true); - function wc(n2, t) { - var e = true; - return rt2(n2, function(r, s, o) { - return e = !!t(r, s, o), e; - }), e; - } - function Ge2(n2, t, e) { - for (var r = -1, s = n2.length; ++r < s; ) { - var o = n2[r], f3 = t(o); - if (f3 != null && (c2 === i2 ? f3 === f3 && !pn2(f3) : e(f3, c2))) - var c2 = f3, l2 = o; + function wc(n3, t) { + var e2 = true; + return rt2(n3, function(r2, s, o2) { + return e2 = !!t(r2, s, o2), e2; + }), e2; + } + function Ge2(n3, t, e2) { + for (var r2 = -1, s = n3.length; ++r2 < s; ) { + var o2 = n3[r2], f4 = t(o2); + if (f4 != null && (c2 === i2 ? f4 === f4 && !pn2(f4) : e2(f4, c2))) + var c2 = f4, l2 = o2; } return l2; } - function Pc(n2, t, e, r) { - var s = n2.length; - for (e = R2(e), e < 0 && (e = -e > s ? 0 : s + e), r = r === i2 || r > s ? s : R2(r), r < 0 && (r += s), r = e > r ? 0 : aa(r); e < r; ) - n2[e++] = t; - return n2; + function Pc(n3, t, e2, r2) { + var s = n3.length; + for (e2 = R2(e2), e2 < 0 && (e2 = -e2 > s ? 0 : s + e2), r2 = r2 === i2 || r2 > s ? s : R2(r2), r2 < 0 && (r2 += s), r2 = e2 > r2 ? 0 : aa(r2); e2 < r2; ) + n3[e2++] = t; + return n3; } - function Ks2(n2, t) { - var e = []; - return rt2(n2, function(r, s, o) { - t(r, s, o) && e.push(r); - }), e; + function Ks2(n3, t) { + var e2 = []; + return rt2(n3, function(r2, s, o2) { + t(r2, s, o2) && e2.push(r2); + }), e2; } - function j2(n2, t, e, r, s) { - var o = -1, f3 = n2.length; - for (e || (e = oh), s || (s = []); ++o < f3; ) { - var c2 = n2[o]; - t > 0 && e(c2) ? t > 1 ? j2(c2, t - 1, e, r, s) : nt2(s, c2) : r || (s[s.length] = c2); + function j2(n3, t, e2, r2, s) { + var o2 = -1, f4 = n3.length; + for (e2 || (e2 = oh), s || (s = []); ++o2 < f4; ) { + var c2 = n3[o2]; + t > 0 && e2(c2) ? t > 1 ? j2(c2, t - 1, e2, r2, s) : nt2(s, c2) : r2 || (s[s.length] = c2); } return s; } var Jr = _u(), Ys2 = _u(true); - function $n(n2, t) { - return n2 && Jr(n2, t, V2); + function $n(n3, t) { + return n3 && Jr(n3, t, V2); } - function Xr(n2, t) { - return n2 && Ys2(n2, t, V2); + function Xr(n3, t) { + return n3 && Ys2(n3, t, V2); } - function ze2(n2, t) { - return jn(t, function(e) { - return Jn2(n2[e]); + function ze2(n3, t) { + return jn(t, function(e2) { + return Jn2(n3[e2]); }); } - function _t2(n2, t) { - t = st2(t, n2); - for (var e = 0, r = t.length; n2 != null && e < r; ) - n2 = n2[Wn2(t[e++])]; - return e && e == r ? n2 : i2; + function _t2(n3, t) { + t = st2(t, n3); + for (var e2 = 0, r2 = t.length; n3 != null && e2 < r2; ) + n3 = n3[Wn2(t[e2++])]; + return e2 && e2 == r2 ? n3 : i2; } - function Zs2(n2, t, e) { - var r = t(n2); - return O2(n2) ? r : nt2(r, e(n2)); + function Zs2(n3, t, e2) { + var r2 = t(n3); + return O2(n3) ? r2 : nt2(r2, e2(n3)); } - function en2(n2) { - return n2 == null ? n2 === i2 ? Za : Ka : pt2 && pt2 in M2(n2) ? eh(n2) : gh(n2); + function en2(n3) { + return n3 == null ? n3 === i2 ? Za : Ka : pt2 && pt2 in M2(n3) ? eh(n3) : gh(n3); } - function Qr(n2, t) { - return n2 > t; + function Qr(n3, t) { + return n3 > t; } - function Ac(n2, t) { - return n2 != null && F2.call(n2, t); + function Ac(n3, t) { + return n3 != null && F2.call(n3, t); } - function Cc(n2, t) { - return n2 != null && t in M2(n2); + function Cc(n3, t) { + return n3 != null && t in M2(n3); } - function Ic(n2, t, e) { - return n2 >= nn2(t, e) && n2 < Q3(t, e); + function Ic(n3, t, e2) { + return n3 >= nn2(t, e2) && n3 < Q3(t, e2); } - function Vr(n2, t, e) { - for (var r = e ? Dr2 : Ee, s = n2[0].length, o = n2.length, f3 = o, c2 = p3(o), l2 = 1 / 0, v3 = []; f3--; ) { - var _3 = n2[f3]; - f3 && t && (_3 = G2(_3, hn2(t))), l2 = nn2(_3.length, l2), c2[f3] = !e && (t || s >= 120 && _3.length >= 120) ? new gt2(f3 && _3) : i2; + function Vr(n3, t, e2) { + for (var r2 = e2 ? Dr2 : Ee, s = n3[0].length, o2 = n3.length, f4 = o2, c2 = p3(o2), l2 = 1 / 0, v3 = []; f4--; ) { + var _3 = n3[f4]; + f4 && t && (_3 = G2(_3, hn2(t))), l2 = nn2(_3.length, l2), c2[f4] = !e2 && (t || s >= 120 && _3.length >= 120) ? new gt2(f4 && _3) : i2; } - _3 = n2[0]; + _3 = n3[0]; var m2 = -1, P2 = c2[0]; n: for (; ++m2 < s && v3.length < l2; ) { var I2 = _3[m2], E3 = t ? t(I2) : I2; - if (I2 = e || I2 !== 0 ? I2 : 0, !(P2 ? jt2(P2, E3) : r(v3, E3, e))) { - for (f3 = o; --f3; ) { - var b3 = c2[f3]; - if (!(b3 ? jt2(b3, E3) : r(n2[f3], E3, e))) + if (I2 = e2 || I2 !== 0 ? I2 : 0, !(P2 ? jt2(P2, E3) : r2(v3, E3, e2))) { + for (f4 = o2; --f4; ) { + var b3 = c2[f4]; + if (!(b3 ? jt2(b3, E3) : r2(n3[f4], E3, e2))) continue n; } P2 && P2.push(E3), v3.push(I2); @@ -12292,753 +12260,753 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } return v3; } - function xc(n2, t, e, r) { - return $n(n2, function(s, o, f3) { - t(r, e(s), o, f3); - }), r; + function xc(n3, t, e2, r2) { + return $n(n3, function(s, o2, f4) { + t(r2, e2(s), o2, f4); + }), r2; } - function ae2(n2, t, e) { - t = st2(t, n2), n2 = Hu(n2, t); - var r = n2 == null ? n2 : n2[Wn2(In(t))]; - return r == null ? i2 : cn2(r, n2, e); + function ae2(n3, t, e2) { + t = st2(t, n3), n3 = Hu(n3, t); + var r2 = n3 == null ? n3 : n3[Wn2(In(t))]; + return r2 == null ? i2 : cn2(r2, n3, e2); } - function Js2(n2) { - return Y(n2) && en2(n2) == Ot2; + function Js2(n3) { + return Y(n3) && en2(n3) == Ot2; } - function Ec(n2) { - return Y(n2) && en2(n2) == kt2; + function Ec(n3) { + return Y(n3) && en2(n3) == kt2; } - function yc(n2) { - return Y(n2) && en2(n2) == Zt2; + function yc(n3) { + return Y(n3) && en2(n3) == Zt2; } - function oe2(n2, t, e, r, s) { - return n2 === t ? true : n2 == null || t == null || !Y(n2) && !Y(t) ? n2 !== n2 && t !== t : Sc(n2, t, e, r, oe2, s); + function oe2(n3, t, e2, r2, s) { + return n3 === t ? true : n3 == null || t == null || !Y(n3) && !Y(t) ? n3 !== n3 && t !== t : Sc(n3, t, e2, r2, oe2, s); } - function Sc(n2, t, e, r, s, o) { - var f3 = O2(n2), c2 = O2(t), l2 = f3 ? me : tn2(n2), v3 = c2 ? me : tn2(t); + function Sc(n3, t, e2, r2, s, o2) { + var f4 = O2(n3), c2 = O2(t), l2 = f4 ? me : tn2(n3), v3 = c2 ? me : tn2(t); l2 = l2 == Ot2 ? qn2 : l2, v3 = v3 == Ot2 ? qn2 : v3; var _3 = l2 == qn2, m2 = v3 == qn2, P2 = l2 == v3; - if (P2 && at2(n2)) { + if (P2 && at2(n3)) { if (!at2(t)) return false; - f3 = true, _3 = false; + f4 = true, _3 = false; } if (P2 && !_3) - return o || (o = new Rn()), f3 || Bt2(n2) ? Su(n2, t, e, r, s, o) : nh(n2, t, l2, e, r, s, o); - if (!(e & Et2)) { - var I2 = _3 && F2.call(n2, "__wrapped__"), E3 = m2 && F2.call(t, "__wrapped__"); + return o2 || (o2 = new Rn()), f4 || Bt2(n3) ? Su(n3, t, e2, r2, s, o2) : nh(n3, t, l2, e2, r2, s, o2); + if (!(e2 & Et2)) { + var I2 = _3 && F2.call(n3, "__wrapped__"), E3 = m2 && F2.call(t, "__wrapped__"); if (I2 || E3) { - var b3 = I2 ? n2.value() : n2, y3 = E3 ? t.value() : t; - return o || (o = new Rn()), s(b3, y3, e, r, o); + var b3 = I2 ? n3.value() : n3, y3 = E3 ? t.value() : t; + return o2 || (o2 = new Rn()), s(b3, y3, e2, r2, o2); } } - return P2 ? (o || (o = new Rn()), th(n2, t, e, r, s, o)) : false; + return P2 ? (o2 || (o2 = new Rn()), th(n3, t, e2, r2, s, o2)) : false; } - function Oc(n2) { - return Y(n2) && tn2(n2) == yn2; + function Oc(n3) { + return Y(n3) && tn2(n3) == yn2; } - function kr(n2, t, e, r) { - var s = e.length, o = s, f3 = !r; - if (n2 == null) - return !o; - for (n2 = M2(n2); s--; ) { - var c2 = e[s]; - if (f3 && c2[2] ? c2[1] !== n2[c2[0]] : !(c2[0] in n2)) + function kr(n3, t, e2, r2) { + var s = e2.length, o2 = s, f4 = !r2; + if (n3 == null) + return !o2; + for (n3 = M2(n3); s--; ) { + var c2 = e2[s]; + if (f4 && c2[2] ? c2[1] !== n3[c2[0]] : !(c2[0] in n3)) return false; } - for (; ++s < o; ) { - c2 = e[s]; - var l2 = c2[0], v3 = n2[l2], _3 = c2[1]; - if (f3 && c2[2]) { - if (v3 === i2 && !(l2 in n2)) + for (; ++s < o2; ) { + c2 = e2[s]; + var l2 = c2[0], v3 = n3[l2], _3 = c2[1]; + if (f4 && c2[2]) { + if (v3 === i2 && !(l2 in n3)) return false; } else { var m2 = new Rn(); - if (r) - var P2 = r(v3, _3, l2, n2, t, m2); - if (!(P2 === i2 ? oe2(_3, v3, Et2 | ve2, r, m2) : P2)) + if (r2) + var P2 = r2(v3, _3, l2, n3, t, m2); + if (!(P2 === i2 ? oe2(_3, v3, Et2 | ve2, r2, m2) : P2)) return false; } } return true; } - function Xs2(n2) { - if (!K2(n2) || ch(n2)) + function Xs2(n3) { + if (!K2(n3) || ch(n3)) return false; - var t = Jn2(n2) ? Of : _o; - return t.test(wt2(n2)); + var t = Jn2(n3) ? Of : _o; + return t.test(wt2(n3)); } - function Rc(n2) { - return Y(n2) && en2(n2) == Xt2; + function Rc(n3) { + return Y(n3) && en2(n3) == Xt2; } - function bc(n2) { - return Y(n2) && tn2(n2) == Sn; + function bc(n3) { + return Y(n3) && tn2(n3) == Sn; } - function Tc(n2) { - return Y(n2) && ar2(n2.length) && !!B2[en2(n2)]; + function Tc(n3) { + return Y(n3) && ar2(n3.length) && !!B2[en2(n3)]; } - function Qs2(n2) { - return typeof n2 == "function" ? n2 : n2 == null ? fn2 : typeof n2 == "object" ? O2(n2) ? js2(n2[0], n2[1]) : ks2(n2) : ma(n2); + function Qs2(n3) { + return typeof n3 == "function" ? n3 : n3 == null ? fn2 : typeof n3 == "object" ? O2(n3) ? js2(n3[0], n3[1]) : ks2(n3) : ma(n3); } - function jr(n2) { - if (!he2(n2)) - return Hf(n2); + function jr(n3) { + if (!he2(n3)) + return Hf(n3); var t = []; - for (var e in M2(n2)) - F2.call(n2, e) && e != "constructor" && t.push(e); + for (var e2 in M2(n3)) + F2.call(n3, e2) && e2 != "constructor" && t.push(e2); return t; } - function Lc(n2) { - if (!K2(n2)) - return dh(n2); - var t = he2(n2), e = []; - for (var r in n2) - r == "constructor" && (t || !F2.call(n2, r)) || e.push(r); - return e; - } - function ni(n2, t) { - return n2 < t; - } - function Vs2(n2, t) { - var e = -1, r = an2(n2) ? p3(n2.length) : []; - return rt2(n2, function(s, o, f3) { - r[++e] = t(s, o, f3); - }), r; - } - function ks2(n2) { - var t = gi(n2); - return t.length == 1 && t[0][2] ? Lu(t[0][0], t[0][1]) : function(e) { - return e === n2 || kr(e, n2, t); + function Lc(n3) { + if (!K2(n3)) + return dh(n3); + var t = he2(n3), e2 = []; + for (var r2 in n3) + r2 == "constructor" && (t || !F2.call(n3, r2)) || e2.push(r2); + return e2; + } + function ni(n3, t) { + return n3 < t; + } + function Vs2(n3, t) { + var e2 = -1, r2 = an2(n3) ? p3(n3.length) : []; + return rt2(n3, function(s, o2, f4) { + r2[++e2] = t(s, o2, f4); + }), r2; + } + function ks2(n3) { + var t = gi(n3); + return t.length == 1 && t[0][2] ? Lu(t[0][0], t[0][1]) : function(e2) { + return e2 === n3 || kr(e2, n3, t); }; } - function js2(n2, t) { - return _i(n2) && Tu(t) ? Lu(Wn2(n2), t) : function(e) { - var r = Si(e, n2); - return r === i2 && r === t ? Oi(e, n2) : oe2(t, r, Et2 | ve2); + function js2(n3, t) { + return _i(n3) && Tu(t) ? Lu(Wn2(n3), t) : function(e2) { + var r2 = Si(e2, n3); + return r2 === i2 && r2 === t ? Oi(e2, n3) : oe2(t, r2, Et2 | ve2); }; } - function Ke2(n2, t, e, r, s) { - n2 !== t && Jr(t, function(o, f3) { - if (s || (s = new Rn()), K2(o)) - Dc(n2, t, f3, e, Ke2, r, s); + function Ke2(n3, t, e2, r2, s) { + n3 !== t && Jr(t, function(o2, f4) { + if (s || (s = new Rn()), K2(o2)) + Dc(n3, t, f4, e2, Ke2, r2, s); else { - var c2 = r ? r(wi(n2, f3), o, f3 + "", n2, t, s) : i2; - c2 === i2 && (c2 = o), Yr(n2, f3, c2); + var c2 = r2 ? r2(wi(n3, f4), o2, f4 + "", n3, t, s) : i2; + c2 === i2 && (c2 = o2), Yr(n3, f4, c2); } }, on2); } - function Dc(n2, t, e, r, s, o, f3) { - var c2 = wi(n2, e), l2 = wi(t, e), v3 = f3.get(l2); + function Dc(n3, t, e2, r2, s, o2, f4) { + var c2 = wi(n3, e2), l2 = wi(t, e2), v3 = f4.get(l2); if (v3) { - Yr(n2, e, v3); + Yr(n3, e2, v3); return; } - var _3 = o ? o(c2, l2, e + "", n2, t, f3) : i2, m2 = _3 === i2; + var _3 = o2 ? o2(c2, l2, e2 + "", n3, t, f4) : i2, m2 = _3 === i2; if (m2) { var P2 = O2(l2), I2 = !P2 && at2(l2), E3 = !P2 && !I2 && Bt2(l2); _3 = l2, P2 || I2 || E3 ? O2(c2) ? _3 = c2 : Z2(c2) ? _3 = un2(c2) : I2 ? (m2 = false, _3 = hu(l2, true)) : E3 ? (m2 = false, _3 = lu(l2, true)) : _3 = [] : pe2(l2) || Pt2(l2) ? (_3 = c2, Pt2(c2) ? _3 = oa(c2) : (!K2(c2) || Jn2(c2)) && (_3 = bu(l2))) : m2 = false; } - m2 && (f3.set(l2, _3), s(_3, l2, r, o, f3), f3.delete(l2)), Yr(n2, e, _3); + m2 && (f4.set(l2, _3), s(_3, l2, r2, o2, f4), f4.delete(l2)), Yr(n3, e2, _3); } - function nu(n2, t) { - var e = n2.length; - if (e) - return t += t < 0 ? e : 0, Zn(t, e) ? n2[t] : i2; + function nu(n3, t) { + var e2 = n3.length; + if (e2) + return t += t < 0 ? e2 : 0, Zn(t, e2) ? n3[t] : i2; } - function tu(n2, t, e) { - t.length ? t = G2(t, function(o) { - return O2(o) ? function(f3) { - return _t2(f3, o.length === 1 ? o[0] : o); - } : o; + function tu(n3, t, e2) { + t.length ? t = G2(t, function(o2) { + return O2(o2) ? function(f4) { + return _t2(f4, o2.length === 1 ? o2[0] : o2); + } : o2; }) : t = [fn2]; - var r = -1; + var r2 = -1; t = G2(t, hn2(x2())); - var s = Vs2(n2, function(o, f3, c2) { + var s = Vs2(n3, function(o2, f4, c2) { var l2 = G2(t, function(v3) { - return v3(o); + return v3(o2); }); - return { criteria: l2, index: ++r, value: o }; + return { criteria: l2, index: ++r2, value: o2 }; }); - return uf(s, function(o, f3) { - return Yc(o, f3, e); + return uf(s, function(o2, f4) { + return Yc(o2, f4, e2); }); } - function Hc(n2, t) { - return eu(n2, t, function(e, r) { - return Oi(n2, r); + function Hc(n3, t) { + return eu(n3, t, function(e2, r2) { + return Oi(n3, r2); }); } - function eu(n2, t, e) { - for (var r = -1, s = t.length, o = {}; ++r < s; ) { - var f3 = t[r], c2 = _t2(n2, f3); - e(c2, f3) && fe(o, st2(f3, n2), c2); + function eu(n3, t, e2) { + for (var r2 = -1, s = t.length, o2 = {}; ++r2 < s; ) { + var f4 = t[r2], c2 = _t2(n3, f4); + e2(c2, f4) && fe(o2, st2(f4, n3), c2); } - return o; + return o2; } - function Nc(n2) { + function Nc(n3) { return function(t) { - return _t2(t, n2); + return _t2(t, n3); }; } - function ti(n2, t, e, r) { - var s = r ? sf : Tt2, o = -1, f3 = t.length, c2 = n2; - for (n2 === t && (t = un2(t)), e && (c2 = G2(n2, hn2(e))); ++o < f3; ) - for (var l2 = 0, v3 = t[o], _3 = e ? e(v3) : v3; (l2 = s(c2, _3, l2, r)) > -1; ) - c2 !== n2 && Ne2.call(c2, l2, 1), Ne2.call(n2, l2, 1); - return n2; - } - function ru(n2, t) { - for (var e = n2 ? t.length : 0, r = e - 1; e--; ) { - var s = t[e]; - if (e == r || s !== o) { - var o = s; - Zn(s) ? Ne2.call(n2, s, 1) : si(n2, s); + function ti(n3, t, e2, r2) { + var s = r2 ? sf : Tt2, o2 = -1, f4 = t.length, c2 = n3; + for (n3 === t && (t = un2(t)), e2 && (c2 = G2(n3, hn2(e2))); ++o2 < f4; ) + for (var l2 = 0, v3 = t[o2], _3 = e2 ? e2(v3) : v3; (l2 = s(c2, _3, l2, r2)) > -1; ) + c2 !== n3 && Ne2.call(c2, l2, 1), Ne2.call(n3, l2, 1); + return n3; + } + function ru(n3, t) { + for (var e2 = n3 ? t.length : 0, r2 = e2 - 1; e2--; ) { + var s = t[e2]; + if (e2 == r2 || s !== o2) { + var o2 = s; + Zn(s) ? Ne2.call(n3, s, 1) : si(n3, s); } } - return n2; + return n3; } - function ei(n2, t) { - return n2 + We2(Us2() * (t - n2 + 1)); + function ei(n3, t) { + return n3 + We2(Us2() * (t - n3 + 1)); } - function $c(n2, t, e, r) { - for (var s = -1, o = Q3(Ue2((t - n2) / (e || 1)), 0), f3 = p3(o); o--; ) - f3[r ? o : ++s] = n2, n2 += e; - return f3; + function $c(n3, t, e2, r2) { + for (var s = -1, o2 = Q3(Ue2((t - n3) / (e2 || 1)), 0), f4 = p3(o2); o2--; ) + f4[r2 ? o2 : ++s] = n3, n3 += e2; + return f4; } - function ri(n2, t) { - var e = ""; - if (!n2 || t < 1 || t > kn2) - return e; + function ri(n3, t) { + var e2 = ""; + if (!n3 || t < 1 || t > kn2) + return e2; do - t % 2 && (e += n2), t = We2(t / 2), t && (n2 += n2); + t % 2 && (e2 += n3), t = We2(t / 2), t && (n3 += n3); while (t); - return e; + return e2; } - function T2(n2, t) { - return Pi(Du(n2, t, fn2), n2 + ""); + function T2(n3, t) { + return Pi(Du(n3, t, fn2), n3 + ""); } - function Uc(n2) { - return Ms2(Gt2(n2)); + function Uc(n3) { + return Ms2(Gt2(n3)); } - function Wc(n2, t) { - var e = Gt2(n2); - return tr2(e, vt2(t, 0, e.length)); + function Wc(n3, t) { + var e2 = Gt2(n3); + return tr2(e2, vt2(t, 0, e2.length)); } - function fe(n2, t, e, r) { - if (!K2(n2)) - return n2; - t = st2(t, n2); - for (var s = -1, o = t.length, f3 = o - 1, c2 = n2; c2 != null && ++s < o; ) { - var l2 = Wn2(t[s]), v3 = e; + function fe(n3, t, e2, r2) { + if (!K2(n3)) + return n3; + t = st2(t, n3); + for (var s = -1, o2 = t.length, f4 = o2 - 1, c2 = n3; c2 != null && ++s < o2; ) { + var l2 = Wn2(t[s]), v3 = e2; if (l2 === "__proto__" || l2 === "constructor" || l2 === "prototype") - return n2; - if (s != f3) { + return n3; + if (s != f4) { var _3 = c2[l2]; - v3 = r ? r(_3, l2, c2) : i2, v3 === i2 && (v3 = K2(_3) ? _3 : Zn(t[s + 1]) ? [] : {}); + v3 = r2 ? r2(_3, l2, c2) : i2, v3 === i2 && (v3 = K2(_3) ? _3 : Zn(t[s + 1]) ? [] : {}); } se(c2, l2, v3), c2 = c2[l2]; } - return n2; + return n3; } - var iu = Fe2 ? function(n2, t) { - return Fe2.set(n2, t), n2; - } : fn2, Fc = $e2 ? function(n2, t) { - return $e2(n2, "toString", { configurable: true, enumerable: false, value: bi(t), writable: true }); + var iu = Fe2 ? function(n3, t) { + return Fe2.set(n3, t), n3; + } : fn2, Fc = $e2 ? function(n3, t) { + return $e2(n3, "toString", { configurable: true, enumerable: false, value: bi(t), writable: true }); } : fn2; - function Mc(n2) { - return tr2(Gt2(n2)); - } - function Cn(n2, t, e) { - var r = -1, s = n2.length; - t < 0 && (t = -t > s ? 0 : s + t), e = e > s ? s : e, e < 0 && (e += s), s = t > e ? 0 : e - t >>> 0, t >>>= 0; - for (var o = p3(s); ++r < s; ) - o[r] = n2[r + t]; - return o; - } - function qc(n2, t) { - var e; - return rt2(n2, function(r, s, o) { - return e = t(r, s, o), !e; - }), !!e; - } - function Ye2(n2, t, e) { - var r = 0, s = n2 == null ? r : n2.length; + function Mc(n3) { + return tr2(Gt2(n3)); + } + function Cn(n3, t, e2) { + var r2 = -1, s = n3.length; + t < 0 && (t = -t > s ? 0 : s + t), e2 = e2 > s ? s : e2, e2 < 0 && (e2 += s), s = t > e2 ? 0 : e2 - t >>> 0, t >>>= 0; + for (var o2 = p3(s); ++r2 < s; ) + o2[r2] = n3[r2 + t]; + return o2; + } + function qc(n3, t) { + var e2; + return rt2(n3, function(r2, s, o2) { + return e2 = t(r2, s, o2), !e2; + }), !!e2; + } + function Ye2(n3, t, e2) { + var r2 = 0, s = n3 == null ? r2 : n3.length; if (typeof t == "number" && t === t && s <= qa) { - for (; r < s; ) { - var o = r + s >>> 1, f3 = n2[o]; - f3 !== null && !pn2(f3) && (e ? f3 <= t : f3 < t) ? r = o + 1 : s = o; + for (; r2 < s; ) { + var o2 = r2 + s >>> 1, f4 = n3[o2]; + f4 !== null && !pn2(f4) && (e2 ? f4 <= t : f4 < t) ? r2 = o2 + 1 : s = o2; } return s; } - return ii(n2, t, fn2, e); + return ii(n3, t, fn2, e2); } - function ii(n2, t, e, r) { - var s = 0, o = n2 == null ? 0 : n2.length; - if (o === 0) + function ii(n3, t, e2, r2) { + var s = 0, o2 = n3 == null ? 0 : n3.length; + if (o2 === 0) return 0; - t = e(t); - for (var f3 = t !== t, c2 = t === null, l2 = pn2(t), v3 = t === i2; s < o; ) { - var _3 = We2((s + o) / 2), m2 = e(n2[_3]), P2 = m2 !== i2, I2 = m2 === null, E3 = m2 === m2, b3 = pn2(m2); - if (f3) - var y3 = r || E3; + t = e2(t); + for (var f4 = t !== t, c2 = t === null, l2 = pn2(t), v3 = t === i2; s < o2; ) { + var _3 = We2((s + o2) / 2), m2 = e2(n3[_3]), P2 = m2 !== i2, I2 = m2 === null, E3 = m2 === m2, b3 = pn2(m2); + if (f4) + var y3 = r2 || E3; else - v3 ? y3 = E3 && (r || P2) : c2 ? y3 = E3 && P2 && (r || !I2) : l2 ? y3 = E3 && P2 && !I2 && (r || !b3) : I2 || b3 ? y3 = false : y3 = r ? m2 <= t : m2 < t; - y3 ? s = _3 + 1 : o = _3; + v3 ? y3 = E3 && (r2 || P2) : c2 ? y3 = E3 && P2 && (r2 || !I2) : l2 ? y3 = E3 && P2 && !I2 && (r2 || !b3) : I2 || b3 ? y3 = false : y3 = r2 ? m2 <= t : m2 < t; + y3 ? s = _3 + 1 : o2 = _3; } - return nn2(o, Ma); + return nn2(o2, Ma); } - function su(n2, t) { - for (var e = -1, r = n2.length, s = 0, o = []; ++e < r; ) { - var f3 = n2[e], c2 = t ? t(f3) : f3; - if (!e || !bn(c2, l2)) { + function su(n3, t) { + for (var e2 = -1, r2 = n3.length, s = 0, o2 = []; ++e2 < r2; ) { + var f4 = n3[e2], c2 = t ? t(f4) : f4; + if (!e2 || !bn(c2, l2)) { var l2 = c2; - o[s++] = f3 === 0 ? 0 : f3; + o2[s++] = f4 === 0 ? 0 : f4; } } - return o; - } - function uu(n2) { - return typeof n2 == "number" ? n2 : pn2(n2) ? _e2 : +n2; - } - function ln2(n2) { - if (typeof n2 == "string") - return n2; - if (O2(n2)) - return G2(n2, ln2) + ""; - if (pn2(n2)) - return Ws2 ? Ws2.call(n2) : ""; - var t = n2 + ""; - return t == "0" && 1 / n2 == -ht2 ? "-0" : t; - } - function it2(n2, t, e) { - var r = -1, s = Ee, o = n2.length, f3 = true, c2 = [], l2 = c2; - if (e) - f3 = false, s = Dr2; - else if (o >= w3) { - var v3 = t ? null : kc(n2); + return o2; + } + function uu(n3) { + return typeof n3 == "number" ? n3 : pn2(n3) ? _e2 : +n3; + } + function ln2(n3) { + if (typeof n3 == "string") + return n3; + if (O2(n3)) + return G2(n3, ln2) + ""; + if (pn2(n3)) + return Ws2 ? Ws2.call(n3) : ""; + var t = n3 + ""; + return t == "0" && 1 / n3 == -ht2 ? "-0" : t; + } + function it2(n3, t, e2) { + var r2 = -1, s = Ee, o2 = n3.length, f4 = true, c2 = [], l2 = c2; + if (e2) + f4 = false, s = Dr2; + else if (o2 >= w3) { + var v3 = t ? null : kc(n3); if (v3) return Se(v3); - f3 = false, s = jt2, l2 = new gt2(); + f4 = false, s = jt2, l2 = new gt2(); } else l2 = t ? [] : c2; n: - for (; ++r < o; ) { - var _3 = n2[r], m2 = t ? t(_3) : _3; - if (_3 = e || _3 !== 0 ? _3 : 0, f3 && m2 === m2) { + for (; ++r2 < o2; ) { + var _3 = n3[r2], m2 = t ? t(_3) : _3; + if (_3 = e2 || _3 !== 0 ? _3 : 0, f4 && m2 === m2) { for (var P2 = l2.length; P2--; ) if (l2[P2] === m2) continue n; t && l2.push(m2), c2.push(_3); } else - s(l2, m2, e) || (l2 !== c2 && l2.push(m2), c2.push(_3)); + s(l2, m2, e2) || (l2 !== c2 && l2.push(m2), c2.push(_3)); } return c2; } - function si(n2, t) { - return t = st2(t, n2), n2 = Hu(n2, t), n2 == null || delete n2[Wn2(In(t))]; + function si(n3, t) { + return t = st2(t, n3), n3 = Hu(n3, t), n3 == null || delete n3[Wn2(In(t))]; } - function au(n2, t, e, r) { - return fe(n2, t, e(_t2(n2, t)), r); + function au(n3, t, e2, r2) { + return fe(n3, t, e2(_t2(n3, t)), r2); } - function Ze2(n2, t, e, r) { - for (var s = n2.length, o = r ? s : -1; (r ? o-- : ++o < s) && t(n2[o], o, n2); ) + function Ze2(n3, t, e2, r2) { + for (var s = n3.length, o2 = r2 ? s : -1; (r2 ? o2-- : ++o2 < s) && t(n3[o2], o2, n3); ) ; - return e ? Cn(n2, r ? 0 : o, r ? o + 1 : s) : Cn(n2, r ? o + 1 : 0, r ? s : o); + return e2 ? Cn(n3, r2 ? 0 : o2, r2 ? o2 + 1 : s) : Cn(n3, r2 ? o2 + 1 : 0, r2 ? s : o2); } - function ou(n2, t) { - var e = n2; - return e instanceof N2 && (e = e.value()), Hr(t, function(r, s) { - return s.func.apply(s.thisArg, nt2([r], s.args)); - }, e); + function ou(n3, t) { + var e2 = n3; + return e2 instanceof N2 && (e2 = e2.value()), Hr(t, function(r2, s) { + return s.func.apply(s.thisArg, nt2([r2], s.args)); + }, e2); } - function ui(n2, t, e) { - var r = n2.length; - if (r < 2) - return r ? it2(n2[0]) : []; - for (var s = -1, o = p3(r); ++s < r; ) - for (var f3 = n2[s], c2 = -1; ++c2 < r; ) - c2 != s && (o[s] = ue2(o[s] || f3, n2[c2], t, e)); - return it2(j2(o, 1), t, e); + function ui(n3, t, e2) { + var r2 = n3.length; + if (r2 < 2) + return r2 ? it2(n3[0]) : []; + for (var s = -1, o2 = p3(r2); ++s < r2; ) + for (var f4 = n3[s], c2 = -1; ++c2 < r2; ) + c2 != s && (o2[s] = ue2(o2[s] || f4, n3[c2], t, e2)); + return it2(j2(o2, 1), t, e2); } - function fu(n2, t, e) { - for (var r = -1, s = n2.length, o = t.length, f3 = {}; ++r < s; ) { - var c2 = r < o ? t[r] : i2; - e(f3, n2[r], c2); + function fu(n3, t, e2) { + for (var r2 = -1, s = n3.length, o2 = t.length, f4 = {}; ++r2 < s; ) { + var c2 = r2 < o2 ? t[r2] : i2; + e2(f4, n3[r2], c2); } - return f3; + return f4; } - function ai(n2) { - return Z2(n2) ? n2 : []; + function ai(n3) { + return Z2(n3) ? n3 : []; } - function oi(n2) { - return typeof n2 == "function" ? n2 : fn2; + function oi(n3) { + return typeof n3 == "function" ? n3 : fn2; } - function st2(n2, t) { - return O2(n2) ? n2 : _i(n2, t) ? [n2] : Wu(W2(n2)); + function st2(n3, t) { + return O2(n3) ? n3 : _i(n3, t) ? [n3] : Wu(W2(n3)); } var Bc = T2; - function ut2(n2, t, e) { - var r = n2.length; - return e = e === i2 ? r : e, !t && e >= r ? n2 : Cn(n2, t, e); + function ut2(n3, t, e2) { + var r2 = n3.length; + return e2 = e2 === i2 ? r2 : e2, !t && e2 >= r2 ? n3 : Cn(n3, t, e2); } - var cu = Rf || function(n2) { - return k2.clearTimeout(n2); + var cu = Rf || function(n3) { + return k2.clearTimeout(n3); }; - function hu(n2, t) { + function hu(n3, t) { if (t) - return n2.slice(); - var e = n2.length, r = Ls2 ? Ls2(e) : new n2.constructor(e); - return n2.copy(r), r; + return n3.slice(); + var e2 = n3.length, r2 = Ls2 ? Ls2(e2) : new n3.constructor(e2); + return n3.copy(r2), r2; } - function fi(n2) { - var t = new n2.constructor(n2.byteLength); - return new De2(t).set(new De2(n2)), t; + function fi(n3) { + var t = new n3.constructor(n3.byteLength); + return new De2(t).set(new De2(n3)), t; } - function Gc(n2, t) { - var e = t ? fi(n2.buffer) : n2.buffer; - return new n2.constructor(e, n2.byteOffset, n2.byteLength); + function Gc(n3, t) { + var e2 = t ? fi(n3.buffer) : n3.buffer; + return new n3.constructor(e2, n3.byteOffset, n3.byteLength); } - function zc(n2) { - var t = new n2.constructor(n2.source, Ji2.exec(n2)); - return t.lastIndex = n2.lastIndex, t; + function zc(n3) { + var t = new n3.constructor(n3.source, Ji2.exec(n3)); + return t.lastIndex = n3.lastIndex, t; } - function Kc(n2) { - return ie2 ? M2(ie2.call(n2)) : {}; + function Kc(n3) { + return ie2 ? M2(ie2.call(n3)) : {}; } - function lu(n2, t) { - var e = t ? fi(n2.buffer) : n2.buffer; - return new n2.constructor(e, n2.byteOffset, n2.length); + function lu(n3, t) { + var e2 = t ? fi(n3.buffer) : n3.buffer; + return new n3.constructor(e2, n3.byteOffset, n3.length); } - function pu(n2, t) { - if (n2 !== t) { - var e = n2 !== i2, r = n2 === null, s = n2 === n2, o = pn2(n2), f3 = t !== i2, c2 = t === null, l2 = t === t, v3 = pn2(t); - if (!c2 && !v3 && !o && n2 > t || o && f3 && l2 && !c2 && !v3 || r && f3 && l2 || !e && l2 || !s) + function pu(n3, t) { + if (n3 !== t) { + var e2 = n3 !== i2, r2 = n3 === null, s = n3 === n3, o2 = pn2(n3), f4 = t !== i2, c2 = t === null, l2 = t === t, v3 = pn2(t); + if (!c2 && !v3 && !o2 && n3 > t || o2 && f4 && l2 && !c2 && !v3 || r2 && f4 && l2 || !e2 && l2 || !s) return 1; - if (!r && !o && !v3 && n2 < t || v3 && e && s && !r && !o || c2 && e && s || !f3 && s || !l2) + if (!r2 && !o2 && !v3 && n3 < t || v3 && e2 && s && !r2 && !o2 || c2 && e2 && s || !f4 && s || !l2) return -1; } return 0; } - function Yc(n2, t, e) { - for (var r = -1, s = n2.criteria, o = t.criteria, f3 = s.length, c2 = e.length; ++r < f3; ) { - var l2 = pu(s[r], o[r]); + function Yc(n3, t, e2) { + for (var r2 = -1, s = n3.criteria, o2 = t.criteria, f4 = s.length, c2 = e2.length; ++r2 < f4; ) { + var l2 = pu(s[r2], o2[r2]); if (l2) { - if (r >= c2) + if (r2 >= c2) return l2; - var v3 = e[r]; + var v3 = e2[r2]; return l2 * (v3 == "desc" ? -1 : 1); } } - return n2.index - t.index; + return n3.index - t.index; } - function du(n2, t, e, r) { - for (var s = -1, o = n2.length, f3 = e.length, c2 = -1, l2 = t.length, v3 = Q3(o - f3, 0), _3 = p3(l2 + v3), m2 = !r; ++c2 < l2; ) + function du(n3, t, e2, r2) { + for (var s = -1, o2 = n3.length, f4 = e2.length, c2 = -1, l2 = t.length, v3 = Q3(o2 - f4, 0), _3 = p3(l2 + v3), m2 = !r2; ++c2 < l2; ) _3[c2] = t[c2]; - for (; ++s < f3; ) - (m2 || s < o) && (_3[e[s]] = n2[s]); + for (; ++s < f4; ) + (m2 || s < o2) && (_3[e2[s]] = n3[s]); for (; v3--; ) - _3[c2++] = n2[s++]; + _3[c2++] = n3[s++]; return _3; } - function gu(n2, t, e, r) { - for (var s = -1, o = n2.length, f3 = -1, c2 = e.length, l2 = -1, v3 = t.length, _3 = Q3(o - c2, 0), m2 = p3(_3 + v3), P2 = !r; ++s < _3; ) - m2[s] = n2[s]; + function gu(n3, t, e2, r2) { + for (var s = -1, o2 = n3.length, f4 = -1, c2 = e2.length, l2 = -1, v3 = t.length, _3 = Q3(o2 - c2, 0), m2 = p3(_3 + v3), P2 = !r2; ++s < _3; ) + m2[s] = n3[s]; for (var I2 = s; ++l2 < v3; ) m2[I2 + l2] = t[l2]; - for (; ++f3 < c2; ) - (P2 || s < o) && (m2[I2 + e[f3]] = n2[s++]); + for (; ++f4 < c2; ) + (P2 || s < o2) && (m2[I2 + e2[f4]] = n3[s++]); return m2; } - function un2(n2, t) { - var e = -1, r = n2.length; - for (t || (t = p3(r)); ++e < r; ) - t[e] = n2[e]; + function un2(n3, t) { + var e2 = -1, r2 = n3.length; + for (t || (t = p3(r2)); ++e2 < r2; ) + t[e2] = n3[e2]; return t; } - function Un2(n2, t, e, r) { - var s = !e; - e || (e = {}); - for (var o = -1, f3 = t.length; ++o < f3; ) { - var c2 = t[o], l2 = r ? r(e[c2], n2[c2], c2, e, n2) : i2; - l2 === i2 && (l2 = n2[c2]), s ? zn(e, c2, l2) : se(e, c2, l2); + function Un2(n3, t, e2, r2) { + var s = !e2; + e2 || (e2 = {}); + for (var o2 = -1, f4 = t.length; ++o2 < f4; ) { + var c2 = t[o2], l2 = r2 ? r2(e2[c2], n3[c2], c2, e2, n3) : i2; + l2 === i2 && (l2 = n3[c2]), s ? zn(e2, c2, l2) : se(e2, c2, l2); } - return e; + return e2; } - function Zc(n2, t) { - return Un2(n2, vi(n2), t); + function Zc(n3, t) { + return Un2(n3, vi(n3), t); } - function Jc(n2, t) { - return Un2(n2, Ou(n2), t); + function Jc(n3, t) { + return Un2(n3, Ou(n3), t); } - function Je2(n2, t) { - return function(e, r) { - var s = O2(e) ? ko : vc, o = t ? t() : {}; - return s(e, n2, x2(r, 2), o); + function Je2(n3, t) { + return function(e2, r2) { + var s = O2(e2) ? ko : vc, o2 = t ? t() : {}; + return s(e2, n3, x2(r2, 2), o2); }; } - function Ft2(n2) { - return T2(function(t, e) { - var r = -1, s = e.length, o = s > 1 ? e[s - 1] : i2, f3 = s > 2 ? e[2] : i2; - for (o = n2.length > 3 && typeof o == "function" ? (s--, o) : i2, f3 && rn2(e[0], e[1], f3) && (o = s < 3 ? i2 : o, s = 1), t = M2(t); ++r < s; ) { - var c2 = e[r]; - c2 && n2(t, c2, r, o); + function Ft2(n3) { + return T2(function(t, e2) { + var r2 = -1, s = e2.length, o2 = s > 1 ? e2[s - 1] : i2, f4 = s > 2 ? e2[2] : i2; + for (o2 = n3.length > 3 && typeof o2 == "function" ? (s--, o2) : i2, f4 && rn2(e2[0], e2[1], f4) && (o2 = s < 3 ? i2 : o2, s = 1), t = M2(t); ++r2 < s; ) { + var c2 = e2[r2]; + c2 && n3(t, c2, r2, o2); } return t; }); } - function vu(n2, t) { - return function(e, r) { - if (e == null) - return e; - if (!an2(e)) - return n2(e, r); - for (var s = e.length, o = t ? s : -1, f3 = M2(e); (t ? o-- : ++o < s) && r(f3[o], o, f3) !== false; ) + function vu(n3, t) { + return function(e2, r2) { + if (e2 == null) + return e2; + if (!an2(e2)) + return n3(e2, r2); + for (var s = e2.length, o2 = t ? s : -1, f4 = M2(e2); (t ? o2-- : ++o2 < s) && r2(f4[o2], o2, f4) !== false; ) ; - return e; + return e2; }; } - function _u(n2) { - return function(t, e, r) { - for (var s = -1, o = M2(t), f3 = r(t), c2 = f3.length; c2--; ) { - var l2 = f3[n2 ? c2 : ++s]; - if (e(o[l2], l2, o) === false) + function _u(n3) { + return function(t, e2, r2) { + for (var s = -1, o2 = M2(t), f4 = r2(t), c2 = f4.length; c2--; ) { + var l2 = f4[n3 ? c2 : ++s]; + if (e2(o2[l2], l2, o2) === false) break; } return t; }; } - function Xc(n2, t, e) { - var r = t & vn2, s = ce2(n2); - function o() { - var f3 = this && this !== k2 && this instanceof o ? s : n2; - return f3.apply(r ? e : this, arguments); + function Xc(n3, t, e2) { + var r2 = t & vn2, s = ce2(n3); + function o2() { + var f4 = this && this !== k2 && this instanceof o2 ? s : n3; + return f4.apply(r2 ? e2 : this, arguments); } - return o; + return o2; } - function mu(n2) { + function mu(n3) { return function(t) { t = W2(t); - var e = Lt2(t) ? On(t) : i2, r = e ? e[0] : t.charAt(0), s = e ? ut2(e, 1).join("") : t.slice(1); - return r[n2]() + s; + var e2 = Lt2(t) ? On(t) : i2, r2 = e2 ? e2[0] : t.charAt(0), s = e2 ? ut2(e2, 1).join("") : t.slice(1); + return r2[n3]() + s; }; } - function Mt2(n2) { + function Mt2(n3) { return function(t) { - return Hr(va(ga(t).replace(Wo, "")), n2, ""); + return Hr(va(ga(t).replace(Wo, "")), n3, ""); }; } - function ce2(n2) { + function ce2(n3) { return function() { var t = arguments; switch (t.length) { case 0: - return new n2(); + return new n3(); case 1: - return new n2(t[0]); + return new n3(t[0]); case 2: - return new n2(t[0], t[1]); + return new n3(t[0], t[1]); case 3: - return new n2(t[0], t[1], t[2]); + return new n3(t[0], t[1], t[2]); case 4: - return new n2(t[0], t[1], t[2], t[3]); + return new n3(t[0], t[1], t[2], t[3]); case 5: - return new n2(t[0], t[1], t[2], t[3], t[4]); + return new n3(t[0], t[1], t[2], t[3], t[4]); case 6: - return new n2(t[0], t[1], t[2], t[3], t[4], t[5]); + return new n3(t[0], t[1], t[2], t[3], t[4], t[5]); case 7: - return new n2(t[0], t[1], t[2], t[3], t[4], t[5], t[6]); + return new n3(t[0], t[1], t[2], t[3], t[4], t[5], t[6]); } - var e = Wt2(n2.prototype), r = n2.apply(e, t); - return K2(r) ? r : e; + var e2 = Wt2(n3.prototype), r2 = n3.apply(e2, t); + return K2(r2) ? r2 : e2; }; } - function Qc(n2, t, e) { - var r = ce2(n2); + function Qc(n3, t, e2) { + var r2 = ce2(n3); function s() { - for (var o = arguments.length, f3 = p3(o), c2 = o, l2 = qt2(s); c2--; ) - f3[c2] = arguments[c2]; - var v3 = o < 3 && f3[0] !== l2 && f3[o - 1] !== l2 ? [] : tt2(f3, l2); - if (o -= v3.length, o < e) - return Iu(n2, t, Xe2, s.placeholder, i2, f3, v3, i2, i2, e - o); - var _3 = this && this !== k2 && this instanceof s ? r : n2; - return cn2(_3, this, f3); + for (var o2 = arguments.length, f4 = p3(o2), c2 = o2, l2 = qt2(s); c2--; ) + f4[c2] = arguments[c2]; + var v3 = o2 < 3 && f4[0] !== l2 && f4[o2 - 1] !== l2 ? [] : tt2(f4, l2); + if (o2 -= v3.length, o2 < e2) + return Iu(n3, t, Xe2, s.placeholder, i2, f4, v3, i2, i2, e2 - o2); + var _3 = this && this !== k2 && this instanceof s ? r2 : n3; + return cn2(_3, this, f4); } return s; } - function wu(n2) { - return function(t, e, r) { + function wu(n3) { + return function(t, e2, r2) { var s = M2(t); if (!an2(t)) { - var o = x2(e, 3); - t = V2(t), e = function(c2) { - return o(s[c2], c2, s); + var o2 = x2(e2, 3); + t = V2(t), e2 = function(c2) { + return o2(s[c2], c2, s); }; } - var f3 = n2(t, e, r); - return f3 > -1 ? s[o ? t[f3] : f3] : i2; + var f4 = n3(t, e2, r2); + return f4 > -1 ? s[o2 ? t[f4] : f4] : i2; }; } - function Pu(n2) { + function Pu(n3) { return Yn(function(t) { - var e = t.length, r = e, s = Pn.prototype.thru; - for (n2 && t.reverse(); r--; ) { - var o = t[r]; - if (typeof o != "function") + var e2 = t.length, r2 = e2, s = Pn.prototype.thru; + for (n3 && t.reverse(); r2--; ) { + var o2 = t[r2]; + if (typeof o2 != "function") throw new wn(D2); - if (s && !f3 && je2(o) == "wrapper") - var f3 = new Pn([], true); + if (s && !f4 && je2(o2) == "wrapper") + var f4 = new Pn([], true); } - for (r = f3 ? r : e; ++r < e; ) { - o = t[r]; - var c2 = je2(o), l2 = c2 == "wrapper" ? di(o) : i2; - l2 && mi(l2[0]) && l2[1] == (Mn2 | Dn2 | Hn2 | Kt2) && !l2[4].length && l2[9] == 1 ? f3 = f3[je2(l2[0])].apply(f3, l2[3]) : f3 = o.length == 1 && mi(o) ? f3[c2]() : f3.thru(o); + for (r2 = f4 ? r2 : e2; ++r2 < e2; ) { + o2 = t[r2]; + var c2 = je2(o2), l2 = c2 == "wrapper" ? di(o2) : i2; + l2 && mi(l2[0]) && l2[1] == (Mn2 | Dn2 | Hn2 | Kt2) && !l2[4].length && l2[9] == 1 ? f4 = f4[je2(l2[0])].apply(f4, l2[3]) : f4 = o2.length == 1 && mi(o2) ? f4[c2]() : f4.thru(o2); } return function() { var v3 = arguments, _3 = v3[0]; - if (f3 && v3.length == 1 && O2(_3)) - return f3.plant(_3).value(); - for (var m2 = 0, P2 = e ? t[m2].apply(this, v3) : _3; ++m2 < e; ) + if (f4 && v3.length == 1 && O2(_3)) + return f4.plant(_3).value(); + for (var m2 = 0, P2 = e2 ? t[m2].apply(this, v3) : _3; ++m2 < e2; ) P2 = t[m2].call(this, P2); return P2; }; }); } - function Xe2(n2, t, e, r, s, o, f3, c2, l2, v3) { - var _3 = t & Mn2, m2 = t & vn2, P2 = t & ct2, I2 = t & (Dn2 | yt2), E3 = t & dr2, b3 = P2 ? i2 : ce2(n2); + function Xe2(n3, t, e2, r2, s, o2, f4, c2, l2, v3) { + var _3 = t & Mn2, m2 = t & vn2, P2 = t & ct2, I2 = t & (Dn2 | yt2), E3 = t & dr2, b3 = P2 ? i2 : ce2(n3); function y3() { for (var H2 = arguments.length, $2 = p3(H2), dn2 = H2; dn2--; ) $2[dn2] = arguments[dn2]; if (I2) var sn2 = qt2(y3), gn2 = of($2, sn2); - if (r && ($2 = du($2, r, s, I2)), o && ($2 = gu($2, o, f3, I2)), H2 -= gn2, I2 && H2 < v3) { + if (r2 && ($2 = du($2, r2, s, I2)), o2 && ($2 = gu($2, o2, f4, I2)), H2 -= gn2, I2 && H2 < v3) { var J2 = tt2($2, sn2); - return Iu(n2, t, Xe2, y3.placeholder, e, $2, J2, c2, l2, v3 - H2); + return Iu(n3, t, Xe2, y3.placeholder, e2, $2, J2, c2, l2, v3 - H2); } - var Tn = m2 ? e : this, Qn2 = P2 ? Tn[n2] : n2; + var Tn = m2 ? e2 : this, Qn2 = P2 ? Tn[n3] : n3; return H2 = $2.length, c2 ? $2 = vh($2, c2) : E3 && H2 > 1 && $2.reverse(), _3 && l2 < H2 && ($2.length = l2), this && this !== k2 && this instanceof y3 && (Qn2 = b3 || ce2(Qn2)), Qn2.apply(Tn, $2); } return y3; } - function Au(n2, t) { - return function(e, r) { - return xc(e, n2, t(r), {}); + function Au(n3, t) { + return function(e2, r2) { + return xc(e2, n3, t(r2), {}); }; } - function Qe2(n2, t) { - return function(e, r) { + function Qe2(n3, t) { + return function(e2, r2) { var s; - if (e === i2 && r === i2) + if (e2 === i2 && r2 === i2) return t; - if (e !== i2 && (s = e), r !== i2) { + if (e2 !== i2 && (s = e2), r2 !== i2) { if (s === i2) - return r; - typeof e == "string" || typeof r == "string" ? (e = ln2(e), r = ln2(r)) : (e = uu(e), r = uu(r)), s = n2(e, r); + return r2; + typeof e2 == "string" || typeof r2 == "string" ? (e2 = ln2(e2), r2 = ln2(r2)) : (e2 = uu(e2), r2 = uu(r2)), s = n3(e2, r2); } return s; }; } - function ci(n2) { + function ci(n3) { return Yn(function(t) { - return t = G2(t, hn2(x2())), T2(function(e) { - var r = this; - return n2(t, function(s) { - return cn2(s, r, e); + return t = G2(t, hn2(x2())), T2(function(e2) { + var r2 = this; + return n3(t, function(s) { + return cn2(s, r2, e2); }); }); }); } - function Ve2(n2, t) { + function Ve2(n3, t) { t = t === i2 ? " " : ln2(t); - var e = t.length; - if (e < 2) - return e ? ri(t, n2) : t; - var r = ri(t, Ue2(n2 / Dt2(t))); - return Lt2(t) ? ut2(On(r), 0, n2).join("") : r.slice(0, n2); - } - function Vc(n2, t, e, r) { - var s = t & vn2, o = ce2(n2); - function f3() { - for (var c2 = -1, l2 = arguments.length, v3 = -1, _3 = r.length, m2 = p3(_3 + l2), P2 = this && this !== k2 && this instanceof f3 ? o : n2; ++v3 < _3; ) - m2[v3] = r[v3]; + var e2 = t.length; + if (e2 < 2) + return e2 ? ri(t, n3) : t; + var r2 = ri(t, Ue2(n3 / Dt2(t))); + return Lt2(t) ? ut2(On(r2), 0, n3).join("") : r2.slice(0, n3); + } + function Vc(n3, t, e2, r2) { + var s = t & vn2, o2 = ce2(n3); + function f4() { + for (var c2 = -1, l2 = arguments.length, v3 = -1, _3 = r2.length, m2 = p3(_3 + l2), P2 = this && this !== k2 && this instanceof f4 ? o2 : n3; ++v3 < _3; ) + m2[v3] = r2[v3]; for (; l2--; ) m2[v3++] = arguments[++c2]; - return cn2(P2, s ? e : this, m2); + return cn2(P2, s ? e2 : this, m2); } - return f3; + return f4; } - function Cu(n2) { - return function(t, e, r) { - return r && typeof r != "number" && rn2(t, e, r) && (e = r = i2), t = Xn2(t), e === i2 ? (e = t, t = 0) : e = Xn2(e), r = r === i2 ? t < e ? 1 : -1 : Xn2(r), $c(t, e, r, n2); + function Cu(n3) { + return function(t, e2, r2) { + return r2 && typeof r2 != "number" && rn2(t, e2, r2) && (e2 = r2 = i2), t = Xn2(t), e2 === i2 ? (e2 = t, t = 0) : e2 = Xn2(e2), r2 = r2 === i2 ? t < e2 ? 1 : -1 : Xn2(r2), $c(t, e2, r2, n3); }; } - function ke2(n2) { - return function(t, e) { - return typeof t == "string" && typeof e == "string" || (t = xn2(t), e = xn2(e)), n2(t, e); + function ke2(n3) { + return function(t, e2) { + return typeof t == "string" && typeof e2 == "string" || (t = xn2(t), e2 = xn2(e2)), n3(t, e2); }; } - function Iu(n2, t, e, r, s, o, f3, c2, l2, v3) { - var _3 = t & Dn2, m2 = _3 ? f3 : i2, P2 = _3 ? i2 : f3, I2 = _3 ? o : i2, E3 = _3 ? i2 : o; + function Iu(n3, t, e2, r2, s, o2, f4, c2, l2, v3) { + var _3 = t & Dn2, m2 = _3 ? f4 : i2, P2 = _3 ? i2 : f4, I2 = _3 ? o2 : i2, E3 = _3 ? i2 : o2; t |= _3 ? Hn2 : St2, t &= ~(_3 ? St2 : Hn2), t & qi || (t &= ~(vn2 | ct2)); - var b3 = [n2, t, s, I2, m2, E3, P2, c2, l2, v3], y3 = e.apply(i2, b3); - return mi(n2) && Nu(y3, b3), y3.placeholder = r, $u(y3, n2, t); - } - function hi(n2) { - var t = X2[n2]; - return function(e, r) { - if (e = xn2(e), r = r == null ? 0 : nn2(R2(r), 292), r && $s2(e)) { - var s = (W2(e) + "e").split("e"), o = t(s[0] + "e" + (+s[1] + r)); - return s = (W2(o) + "e").split("e"), +(s[0] + "e" + (+s[1] - r)); + var b3 = [n3, t, s, I2, m2, E3, P2, c2, l2, v3], y3 = e2.apply(i2, b3); + return mi(n3) && Nu(y3, b3), y3.placeholder = r2, $u(y3, n3, t); + } + function hi(n3) { + var t = X2[n3]; + return function(e2, r2) { + if (e2 = xn2(e2), r2 = r2 == null ? 0 : nn2(R2(r2), 292), r2 && $s2(e2)) { + var s = (W2(e2) + "e").split("e"), o2 = t(s[0] + "e" + (+s[1] + r2)); + return s = (W2(o2) + "e").split("e"), +(s[0] + "e" + (+s[1] - r2)); } - return t(e); + return t(e2); }; } - var kc = $t2 && 1 / Se(new $t2([, -0]))[1] == ht2 ? function(n2) { - return new $t2(n2); + var kc = $t2 && 1 / Se(new $t2([, -0]))[1] == ht2 ? function(n3) { + return new $t2(n3); } : Di; - function xu(n2) { + function xu(n3) { return function(t) { - var e = tn2(t); - return e == yn2 ? qr(t) : e == Sn ? gf(t) : af(t, n2(t)); + var e2 = tn2(t); + return e2 == yn2 ? qr(t) : e2 == Sn ? gf(t) : af(t, n3(t)); }; } - function Kn2(n2, t, e, r, s, o, f3, c2) { + function Kn2(n3, t, e2, r2, s, o2, f4, c2) { var l2 = t & ct2; - if (!l2 && typeof n2 != "function") + if (!l2 && typeof n3 != "function") throw new wn(D2); - var v3 = r ? r.length : 0; - if (v3 || (t &= ~(Hn2 | St2), r = s = i2), f3 = f3 === i2 ? f3 : Q3(R2(f3), 0), c2 = c2 === i2 ? c2 : R2(c2), v3 -= s ? s.length : 0, t & St2) { - var _3 = r, m2 = s; - r = s = i2; - } - var P2 = l2 ? i2 : di(n2), I2 = [n2, t, e, r, s, _3, m2, o, f3, c2]; - if (P2 && ph(I2, P2), n2 = I2[0], t = I2[1], e = I2[2], r = I2[3], s = I2[4], c2 = I2[9] = I2[9] === i2 ? l2 ? 0 : n2.length : Q3(I2[9] - v3, 0), !c2 && t & (Dn2 | yt2) && (t &= ~(Dn2 | yt2)), !t || t == vn2) - var E3 = Xc(n2, t, e); + var v3 = r2 ? r2.length : 0; + if (v3 || (t &= ~(Hn2 | St2), r2 = s = i2), f4 = f4 === i2 ? f4 : Q3(R2(f4), 0), c2 = c2 === i2 ? c2 : R2(c2), v3 -= s ? s.length : 0, t & St2) { + var _3 = r2, m2 = s; + r2 = s = i2; + } + var P2 = l2 ? i2 : di(n3), I2 = [n3, t, e2, r2, s, _3, m2, o2, f4, c2]; + if (P2 && ph(I2, P2), n3 = I2[0], t = I2[1], e2 = I2[2], r2 = I2[3], s = I2[4], c2 = I2[9] = I2[9] === i2 ? l2 ? 0 : n3.length : Q3(I2[9] - v3, 0), !c2 && t & (Dn2 | yt2) && (t &= ~(Dn2 | yt2)), !t || t == vn2) + var E3 = Xc(n3, t, e2); else - t == Dn2 || t == yt2 ? E3 = Qc(n2, t, c2) : (t == Hn2 || t == (vn2 | Hn2)) && !s.length ? E3 = Vc(n2, t, e, r) : E3 = Xe2.apply(i2, I2); + t == Dn2 || t == yt2 ? E3 = Qc(n3, t, c2) : (t == Hn2 || t == (vn2 | Hn2)) && !s.length ? E3 = Vc(n3, t, e2, r2) : E3 = Xe2.apply(i2, I2); var b3 = P2 ? iu : Nu; - return $u(b3(E3, I2), n2, t); + return $u(b3(E3, I2), n3, t); } - function Eu(n2, t, e, r) { - return n2 === i2 || bn(n2, Nt2[e]) && !F2.call(r, e) ? t : n2; + function Eu(n3, t, e2, r2) { + return n3 === i2 || bn(n3, Nt2[e2]) && !F2.call(r2, e2) ? t : n3; } - function yu(n2, t, e, r, s, o) { - return K2(n2) && K2(t) && (o.set(t, n2), Ke2(n2, t, i2, yu, o), o.delete(t)), n2; + function yu(n3, t, e2, r2, s, o2) { + return K2(n3) && K2(t) && (o2.set(t, n3), Ke2(n3, t, i2, yu, o2), o2.delete(t)), n3; } - function jc(n2) { - return pe2(n2) ? i2 : n2; + function jc(n3) { + return pe2(n3) ? i2 : n3; } - function Su(n2, t, e, r, s, o) { - var f3 = e & Et2, c2 = n2.length, l2 = t.length; - if (c2 != l2 && !(f3 && l2 > c2)) + function Su(n3, t, e2, r2, s, o2) { + var f4 = e2 & Et2, c2 = n3.length, l2 = t.length; + if (c2 != l2 && !(f4 && l2 > c2)) return false; - var v3 = o.get(n2), _3 = o.get(t); + var v3 = o2.get(n3), _3 = o2.get(t); if (v3 && _3) - return v3 == t && _3 == n2; - var m2 = -1, P2 = true, I2 = e & ve2 ? new gt2() : i2; - for (o.set(n2, t), o.set(t, n2); ++m2 < c2; ) { - var E3 = n2[m2], b3 = t[m2]; - if (r) - var y3 = f3 ? r(b3, E3, m2, t, n2, o) : r(E3, b3, m2, n2, t, o); + return v3 == t && _3 == n3; + var m2 = -1, P2 = true, I2 = e2 & ve2 ? new gt2() : i2; + for (o2.set(n3, t), o2.set(t, n3); ++m2 < c2; ) { + var E3 = n3[m2], b3 = t[m2]; + if (r2) + var y3 = f4 ? r2(b3, E3, m2, t, n3, o2) : r2(E3, b3, m2, n3, t, o2); if (y3 !== i2) { if (y3) continue; @@ -13047,151 +13015,151 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } if (I2) { if (!Nr2(t, function(H2, $2) { - if (!jt2(I2, $2) && (E3 === H2 || s(E3, H2, e, r, o))) + if (!jt2(I2, $2) && (E3 === H2 || s(E3, H2, e2, r2, o2))) return I2.push($2); })) { P2 = false; break; } - } else if (!(E3 === b3 || s(E3, b3, e, r, o))) { + } else if (!(E3 === b3 || s(E3, b3, e2, r2, o2))) { P2 = false; break; } } - return o.delete(n2), o.delete(t), P2; + return o2.delete(n3), o2.delete(t), P2; } - function nh(n2, t, e, r, s, o, f3) { - switch (e) { + function nh(n3, t, e2, r2, s, o2, f4) { + switch (e2) { case Rt2: - if (n2.byteLength != t.byteLength || n2.byteOffset != t.byteOffset) + if (n3.byteLength != t.byteLength || n3.byteOffset != t.byteOffset) return false; - n2 = n2.buffer, t = t.buffer; + n3 = n3.buffer, t = t.buffer; case kt2: - return !(n2.byteLength != t.byteLength || !o(new De2(n2), new De2(t))); + return !(n3.byteLength != t.byteLength || !o2(new De2(n3), new De2(t))); case Yt2: case Zt2: case Jt2: - return bn(+n2, +t); + return bn(+n3, +t); case we: - return n2.name == t.name && n2.message == t.message; + return n3.name == t.name && n3.message == t.message; case Xt2: case Qt2: - return n2 == t + ""; + return n3 == t + ""; case yn2: var c2 = qr; case Sn: - var l2 = r & Et2; - if (c2 || (c2 = Se), n2.size != t.size && !l2) + var l2 = r2 & Et2; + if (c2 || (c2 = Se), n3.size != t.size && !l2) return false; - var v3 = f3.get(n2); + var v3 = f4.get(n3); if (v3) return v3 == t; - r |= ve2, f3.set(n2, t); - var _3 = Su(c2(n2), c2(t), r, s, o, f3); - return f3.delete(n2), _3; + r2 |= ve2, f4.set(n3, t); + var _3 = Su(c2(n3), c2(t), r2, s, o2, f4); + return f4.delete(n3), _3; case Ae2: if (ie2) - return ie2.call(n2) == ie2.call(t); + return ie2.call(n3) == ie2.call(t); } return false; } - function th(n2, t, e, r, s, o) { - var f3 = e & Et2, c2 = li(n2), l2 = c2.length, v3 = li(t), _3 = v3.length; - if (l2 != _3 && !f3) + function th(n3, t, e2, r2, s, o2) { + var f4 = e2 & Et2, c2 = li(n3), l2 = c2.length, v3 = li(t), _3 = v3.length; + if (l2 != _3 && !f4) return false; for (var m2 = l2; m2--; ) { var P2 = c2[m2]; - if (!(f3 ? P2 in t : F2.call(t, P2))) + if (!(f4 ? P2 in t : F2.call(t, P2))) return false; } - var I2 = o.get(n2), E3 = o.get(t); + var I2 = o2.get(n3), E3 = o2.get(t); if (I2 && E3) - return I2 == t && E3 == n2; + return I2 == t && E3 == n3; var b3 = true; - o.set(n2, t), o.set(t, n2); - for (var y3 = f3; ++m2 < l2; ) { + o2.set(n3, t), o2.set(t, n3); + for (var y3 = f4; ++m2 < l2; ) { P2 = c2[m2]; - var H2 = n2[P2], $2 = t[P2]; - if (r) - var dn2 = f3 ? r($2, H2, P2, t, n2, o) : r(H2, $2, P2, n2, t, o); - if (!(dn2 === i2 ? H2 === $2 || s(H2, $2, e, r, o) : dn2)) { + var H2 = n3[P2], $2 = t[P2]; + if (r2) + var dn2 = f4 ? r2($2, H2, P2, t, n3, o2) : r2(H2, $2, P2, n3, t, o2); + if (!(dn2 === i2 ? H2 === $2 || s(H2, $2, e2, r2, o2) : dn2)) { b3 = false; break; } y3 || (y3 = P2 == "constructor"); } if (b3 && !y3) { - var sn2 = n2.constructor, gn2 = t.constructor; - sn2 != gn2 && "constructor" in n2 && "constructor" in t && !(typeof sn2 == "function" && sn2 instanceof sn2 && typeof gn2 == "function" && gn2 instanceof gn2) && (b3 = false); + var sn2 = n3.constructor, gn2 = t.constructor; + sn2 != gn2 && "constructor" in n3 && "constructor" in t && !(typeof sn2 == "function" && sn2 instanceof sn2 && typeof gn2 == "function" && gn2 instanceof gn2) && (b3 = false); } - return o.delete(n2), o.delete(t), b3; + return o2.delete(n3), o2.delete(t), b3; } - function Yn(n2) { - return Pi(Du(n2, i2, Bu), n2 + ""); + function Yn(n3) { + return Pi(Du(n3, i2, Bu), n3 + ""); } - function li(n2) { - return Zs2(n2, V2, vi); + function li(n3) { + return Zs2(n3, V2, vi); } - function pi(n2) { - return Zs2(n2, on2, Ou); + function pi(n3) { + return Zs2(n3, on2, Ou); } - var di = Fe2 ? function(n2) { - return Fe2.get(n2); + var di = Fe2 ? function(n3) { + return Fe2.get(n3); } : Di; - function je2(n2) { - for (var t = n2.name + "", e = Ut2[t], r = F2.call(Ut2, t) ? e.length : 0; r--; ) { - var s = e[r], o = s.func; - if (o == null || o == n2) + function je2(n3) { + for (var t = n3.name + "", e2 = Ut2[t], r2 = F2.call(Ut2, t) ? e2.length : 0; r2--; ) { + var s = e2[r2], o2 = s.func; + if (o2 == null || o2 == n3) return s.name; } return t; } - function qt2(n2) { - var t = F2.call(a3, "placeholder") ? a3 : n2; + function qt2(n3) { + var t = F2.call(a3, "placeholder") ? a3 : n3; return t.placeholder; } function x2() { - var n2 = a3.iteratee || Ti; - return n2 = n2 === Ti ? Qs2 : n2, arguments.length ? n2(arguments[0], arguments[1]) : n2; + var n3 = a3.iteratee || Ti; + return n3 = n3 === Ti ? Qs2 : n3, arguments.length ? n3(arguments[0], arguments[1]) : n3; } - function nr2(n2, t) { - var e = n2.__data__; - return fh(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map; + function nr2(n3, t) { + var e2 = n3.__data__; + return fh(t) ? e2[typeof t == "string" ? "string" : "hash"] : e2.map; } - function gi(n2) { - for (var t = V2(n2), e = t.length; e--; ) { - var r = t[e], s = n2[r]; - t[e] = [r, s, Tu(s)]; + function gi(n3) { + for (var t = V2(n3), e2 = t.length; e2--; ) { + var r2 = t[e2], s = n3[r2]; + t[e2] = [r2, s, Tu(s)]; } return t; } - function mt2(n2, t) { - var e = lf(n2, t); - return Xs2(e) ? e : i2; + function mt2(n3, t) { + var e2 = lf(n3, t); + return Xs2(e2) ? e2 : i2; } - function eh(n2) { - var t = F2.call(n2, pt2), e = n2[pt2]; + function eh(n3) { + var t = F2.call(n3, pt2), e2 = n3[pt2]; try { - n2[pt2] = i2; - var r = true; + n3[pt2] = i2; + var r2 = true; } catch { } - var s = Te2.call(n2); - return r && (t ? n2[pt2] = e : delete n2[pt2]), s; + var s = Te2.call(n3); + return r2 && (t ? n3[pt2] = e2 : delete n3[pt2]), s; } - var vi = Gr ? function(n2) { - return n2 == null ? [] : (n2 = M2(n2), jn(Gr(n2), function(t) { - return Hs2.call(n2, t); + var vi = Gr ? function(n3) { + return n3 == null ? [] : (n3 = M2(n3), jn(Gr(n3), function(t) { + return Hs2.call(n3, t); })); - } : Hi2, Ou = Gr ? function(n2) { - for (var t = []; n2; ) - nt2(t, vi(n2)), n2 = He2(n2); + } : Hi2, Ou = Gr ? function(n3) { + for (var t = []; n3; ) + nt2(t, vi(n3)), n3 = He2(n3); return t; } : Hi2, tn2 = en2; - (zr2 && tn2(new zr2(new ArrayBuffer(1))) != Rt2 || te2 && tn2(new te2()) != yn2 || Kr && tn2(Kr.resolve()) != zi || $t2 && tn2(new $t2()) != Sn || ee2 && tn2(new ee2()) != Vt2) && (tn2 = function(n2) { - var t = en2(n2), e = t == qn2 ? n2.constructor : i2, r = e ? wt2(e) : ""; - if (r) - switch (r) { + (zr2 && tn2(new zr2(new ArrayBuffer(1))) != Rt2 || te2 && tn2(new te2()) != yn2 || Kr && tn2(Kr.resolve()) != zi || $t2 && tn2(new $t2()) != Sn || ee2 && tn2(new ee2()) != Vt2) && (tn2 = function(n3) { + var t = en2(n3), e2 = t == qn2 ? n3.constructor : i2, r2 = e2 ? wt2(e2) : ""; + if (r2) + switch (r2) { case Wf: return Rt2; case Ff: @@ -13205,57 +13173,57 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } return t; }); - function rh(n2, t, e) { - for (var r = -1, s = e.length; ++r < s; ) { - var o = e[r], f3 = o.size; - switch (o.type) { + function rh(n3, t, e2) { + for (var r2 = -1, s = e2.length; ++r2 < s; ) { + var o2 = e2[r2], f4 = o2.size; + switch (o2.type) { case "drop": - n2 += f3; + n3 += f4; break; case "dropRight": - t -= f3; + t -= f4; break; case "take": - t = nn2(t, n2 + f3); + t = nn2(t, n3 + f4); break; case "takeRight": - n2 = Q3(n2, t - f3); + n3 = Q3(n3, t - f4); break; } } - return { start: n2, end: t }; + return { start: n3, end: t }; } - function ih(n2) { - var t = n2.match(oo); + function ih(n3) { + var t = n3.match(oo); return t ? t[1].split(fo) : []; } - function Ru(n2, t, e) { - t = st2(t, n2); - for (var r = -1, s = t.length, o = false; ++r < s; ) { - var f3 = Wn2(t[r]); - if (!(o = n2 != null && e(n2, f3))) + function Ru(n3, t, e2) { + t = st2(t, n3); + for (var r2 = -1, s = t.length, o2 = false; ++r2 < s; ) { + var f4 = Wn2(t[r2]); + if (!(o2 = n3 != null && e2(n3, f4))) break; - n2 = n2[f3]; + n3 = n3[f4]; } - return o || ++r != s ? o : (s = n2 == null ? 0 : n2.length, !!s && ar2(s) && Zn(f3, s) && (O2(n2) || Pt2(n2))); + return o2 || ++r2 != s ? o2 : (s = n3 == null ? 0 : n3.length, !!s && ar2(s) && Zn(f4, s) && (O2(n3) || Pt2(n3))); } - function sh(n2) { - var t = n2.length, e = new n2.constructor(t); - return t && typeof n2[0] == "string" && F2.call(n2, "index") && (e.index = n2.index, e.input = n2.input), e; + function sh(n3) { + var t = n3.length, e2 = new n3.constructor(t); + return t && typeof n3[0] == "string" && F2.call(n3, "index") && (e2.index = n3.index, e2.input = n3.input), e2; } - function bu(n2) { - return typeof n2.constructor == "function" && !he2(n2) ? Wt2(He2(n2)) : {}; + function bu(n3) { + return typeof n3.constructor == "function" && !he2(n3) ? Wt2(He2(n3)) : {}; } - function uh(n2, t, e) { - var r = n2.constructor; + function uh(n3, t, e2) { + var r2 = n3.constructor; switch (t) { case kt2: - return fi(n2); + return fi(n3); case Yt2: case Zt2: - return new r(+n2); + return new r2(+n3); case Rt2: - return Gc(n2, e); + return Gc(n3, e2); case gr2: case vr2: case _r2: @@ -13265,479 +13233,479 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : case Ar2: case Cr2: case Ir2: - return lu(n2, e); + return lu(n3, e2); case yn2: - return new r(); + return new r2(); case Jt2: case Qt2: - return new r(n2); + return new r2(n3); case Xt2: - return zc(n2); + return zc(n3); case Sn: - return new r(); + return new r2(); case Ae2: - return Kc(n2); + return Kc(n3); } } - function ah(n2, t) { - var e = t.length; - if (!e) - return n2; - var r = e - 1; - return t[r] = (e > 1 ? "& " : "") + t[r], t = t.join(e > 2 ? ", " : " "), n2.replace(ao, `{ + function ah(n3, t) { + var e2 = t.length; + if (!e2) + return n3; + var r2 = e2 - 1; + return t[r2] = (e2 > 1 ? "& " : "") + t[r2], t = t.join(e2 > 2 ? ", " : " "), n3.replace(ao, `{ /* [wrapped with ` + t + `] */ `); } - function oh(n2) { - return O2(n2) || Pt2(n2) || !!(Ns2 && n2 && n2[Ns2]); + function oh(n3) { + return O2(n3) || Pt2(n3) || !!(Ns2 && n3 && n3[Ns2]); } - function Zn(n2, t) { - var e = typeof n2; - return t = t ?? kn2, !!t && (e == "number" || e != "symbol" && wo.test(n2)) && n2 > -1 && n2 % 1 == 0 && n2 < t; + function Zn(n3, t) { + var e2 = typeof n3; + return t = t ?? kn2, !!t && (e2 == "number" || e2 != "symbol" && wo.test(n3)) && n3 > -1 && n3 % 1 == 0 && n3 < t; } - function rn2(n2, t, e) { - if (!K2(e)) + function rn2(n3, t, e2) { + if (!K2(e2)) return false; - var r = typeof t; - return (r == "number" ? an2(e) && Zn(t, e.length) : r == "string" && t in e) ? bn(e[t], n2) : false; + var r2 = typeof t; + return (r2 == "number" ? an2(e2) && Zn(t, e2.length) : r2 == "string" && t in e2) ? bn(e2[t], n3) : false; } - function _i(n2, t) { - if (O2(n2)) + function _i(n3, t) { + if (O2(n3)) return false; - var e = typeof n2; - return e == "number" || e == "symbol" || e == "boolean" || n2 == null || pn2(n2) ? true : ro.test(n2) || !eo.test(n2) || t != null && n2 in M2(t); + var e2 = typeof n3; + return e2 == "number" || e2 == "symbol" || e2 == "boolean" || n3 == null || pn2(n3) ? true : ro.test(n3) || !eo.test(n3) || t != null && n3 in M2(t); } - function fh(n2) { - var t = typeof n2; - return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? n2 !== "__proto__" : n2 === null; + function fh(n3) { + var t = typeof n3; + return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? n3 !== "__proto__" : n3 === null; } - function mi(n2) { - var t = je2(n2), e = a3[t]; - if (typeof e != "function" || !(t in N2.prototype)) + function mi(n3) { + var t = je2(n3), e2 = a3[t]; + if (typeof e2 != "function" || !(t in N2.prototype)) return false; - if (n2 === e) + if (n3 === e2) return true; - var r = di(e); - return !!r && n2 === r[0]; + var r2 = di(e2); + return !!r2 && n3 === r2[0]; } - function ch(n2) { - return !!Ts2 && Ts2 in n2; + function ch(n3) { + return !!Ts2 && Ts2 in n3; } var hh = Re2 ? Jn2 : Ni; - function he2(n2) { - var t = n2 && n2.constructor, e = typeof t == "function" && t.prototype || Nt2; - return n2 === e; + function he2(n3) { + var t = n3 && n3.constructor, e2 = typeof t == "function" && t.prototype || Nt2; + return n3 === e2; } - function Tu(n2) { - return n2 === n2 && !K2(n2); + function Tu(n3) { + return n3 === n3 && !K2(n3); } - function Lu(n2, t) { - return function(e) { - return e == null ? false : e[n2] === t && (t !== i2 || n2 in M2(e)); + function Lu(n3, t) { + return function(e2) { + return e2 == null ? false : e2[n3] === t && (t !== i2 || n3 in M2(e2)); }; } - function lh(n2) { - var t = sr3(n2, function(r) { - return e.size === pr2 && e.clear(), r; - }), e = t.cache; + function lh(n3) { + var t = sr3(n3, function(r2) { + return e2.size === pr2 && e2.clear(), r2; + }), e2 = t.cache; return t; } - function ph(n2, t) { - var e = n2[1], r = t[1], s = e | r, o = s < (vn2 | ct2 | Mn2), f3 = r == Mn2 && e == Dn2 || r == Mn2 && e == Kt2 && n2[7].length <= t[8] || r == (Mn2 | Kt2) && t[7].length <= t[8] && e == Dn2; - if (!(o || f3)) - return n2; - r & vn2 && (n2[2] = t[2], s |= e & vn2 ? 0 : qi); + function ph(n3, t) { + var e2 = n3[1], r2 = t[1], s = e2 | r2, o2 = s < (vn2 | ct2 | Mn2), f4 = r2 == Mn2 && e2 == Dn2 || r2 == Mn2 && e2 == Kt2 && n3[7].length <= t[8] || r2 == (Mn2 | Kt2) && t[7].length <= t[8] && e2 == Dn2; + if (!(o2 || f4)) + return n3; + r2 & vn2 && (n3[2] = t[2], s |= e2 & vn2 ? 0 : qi); var c2 = t[3]; if (c2) { - var l2 = n2[3]; - n2[3] = l2 ? du(l2, c2, t[4]) : c2, n2[4] = l2 ? tt2(n2[3], It2) : t[4]; + var l2 = n3[3]; + n3[3] = l2 ? du(l2, c2, t[4]) : c2, n3[4] = l2 ? tt2(n3[3], It2) : t[4]; } - return c2 = t[5], c2 && (l2 = n2[5], n2[5] = l2 ? gu(l2, c2, t[6]) : c2, n2[6] = l2 ? tt2(n2[5], It2) : t[6]), c2 = t[7], c2 && (n2[7] = c2), r & Mn2 && (n2[8] = n2[8] == null ? t[8] : nn2(n2[8], t[8])), n2[9] == null && (n2[9] = t[9]), n2[0] = t[0], n2[1] = s, n2; + return c2 = t[5], c2 && (l2 = n3[5], n3[5] = l2 ? gu(l2, c2, t[6]) : c2, n3[6] = l2 ? tt2(n3[5], It2) : t[6]), c2 = t[7], c2 && (n3[7] = c2), r2 & Mn2 && (n3[8] = n3[8] == null ? t[8] : nn2(n3[8], t[8])), n3[9] == null && (n3[9] = t[9]), n3[0] = t[0], n3[1] = s, n3; } - function dh(n2) { + function dh(n3) { var t = []; - if (n2 != null) - for (var e in M2(n2)) - t.push(e); + if (n3 != null) + for (var e2 in M2(n3)) + t.push(e2); return t; } - function gh(n2) { - return Te2.call(n2); + function gh(n3) { + return Te2.call(n3); } - function Du(n2, t, e) { - return t = Q3(t === i2 ? n2.length - 1 : t, 0), function() { - for (var r = arguments, s = -1, o = Q3(r.length - t, 0), f3 = p3(o); ++s < o; ) - f3[s] = r[t + s]; + function Du(n3, t, e2) { + return t = Q3(t === i2 ? n3.length - 1 : t, 0), function() { + for (var r2 = arguments, s = -1, o2 = Q3(r2.length - t, 0), f4 = p3(o2); ++s < o2; ) + f4[s] = r2[t + s]; s = -1; for (var c2 = p3(t + 1); ++s < t; ) - c2[s] = r[s]; - return c2[t] = e(f3), cn2(n2, this, c2); + c2[s] = r2[s]; + return c2[t] = e2(f4), cn2(n3, this, c2); }; } - function Hu(n2, t) { - return t.length < 2 ? n2 : _t2(n2, Cn(t, 0, -1)); + function Hu(n3, t) { + return t.length < 2 ? n3 : _t2(n3, Cn(t, 0, -1)); } - function vh(n2, t) { - for (var e = n2.length, r = nn2(t.length, e), s = un2(n2); r--; ) { - var o = t[r]; - n2[r] = Zn(o, e) ? s[o] : i2; + function vh(n3, t) { + for (var e2 = n3.length, r2 = nn2(t.length, e2), s = un2(n3); r2--; ) { + var o2 = t[r2]; + n3[r2] = Zn(o2, e2) ? s[o2] : i2; } - return n2; + return n3; } - function wi(n2, t) { - if (!(t === "constructor" && typeof n2[t] == "function") && t != "__proto__") - return n2[t]; + function wi(n3, t) { + if (!(t === "constructor" && typeof n3[t] == "function") && t != "__proto__") + return n3[t]; } - var Nu = Uu(iu), le2 = Tf || function(n2, t) { - return k2.setTimeout(n2, t); + var Nu = Uu(iu), le2 = Tf || function(n3, t) { + return k2.setTimeout(n3, t); }, Pi = Uu(Fc); - function $u(n2, t, e) { - var r = t + ""; - return Pi(n2, ah(r, _h(ih(r), e))); + function $u(n3, t, e2) { + var r2 = t + ""; + return Pi(n3, ah(r2, _h(ih(r2), e2))); } - function Uu(n2) { - var t = 0, e = 0; + function Uu(n3) { + var t = 0, e2 = 0; return function() { - var r = Nf(), s = $a - (r - e); - if (e = r, s > 0) { + var r2 = Nf(), s = $a - (r2 - e2); + if (e2 = r2, s > 0) { if (++t >= Na) return arguments[0]; } else t = 0; - return n2.apply(i2, arguments); + return n3.apply(i2, arguments); }; } - function tr2(n2, t) { - var e = -1, r = n2.length, s = r - 1; - for (t = t === i2 ? r : t; ++e < t; ) { - var o = ei(e, s), f3 = n2[o]; - n2[o] = n2[e], n2[e] = f3; + function tr2(n3, t) { + var e2 = -1, r2 = n3.length, s = r2 - 1; + for (t = t === i2 ? r2 : t; ++e2 < t; ) { + var o2 = ei(e2, s), f4 = n3[o2]; + n3[o2] = n3[e2], n3[e2] = f4; } - return n2.length = t, n2; + return n3.length = t, n3; } - var Wu = lh(function(n2) { + var Wu = lh(function(n3) { var t = []; - return n2.charCodeAt(0) === 46 && t.push(""), n2.replace(io, function(e, r, s, o) { - t.push(s ? o.replace(lo, "$1") : r || e); + return n3.charCodeAt(0) === 46 && t.push(""), n3.replace(io, function(e2, r2, s, o2) { + t.push(s ? o2.replace(lo, "$1") : r2 || e2); }), t; }); - function Wn2(n2) { - if (typeof n2 == "string" || pn2(n2)) - return n2; - var t = n2 + ""; - return t == "0" && 1 / n2 == -ht2 ? "-0" : t; - } - function wt2(n2) { - if (n2 != null) { + function Wn2(n3) { + if (typeof n3 == "string" || pn2(n3)) + return n3; + var t = n3 + ""; + return t == "0" && 1 / n3 == -ht2 ? "-0" : t; + } + function wt2(n3) { + if (n3 != null) { try { - return be.call(n2); + return be.call(n3); } catch { } try { - return n2 + ""; + return n3 + ""; } catch { } } return ""; } - function _h(n2, t) { - return mn2(Ba, function(e) { - var r = "_." + e[0]; - t & e[1] && !Ee(n2, r) && n2.push(r); - }), n2.sort(); - } - function Fu(n2) { - if (n2 instanceof N2) - return n2.clone(); - var t = new Pn(n2.__wrapped__, n2.__chain__); - return t.__actions__ = un2(n2.__actions__), t.__index__ = n2.__index__, t.__values__ = n2.__values__, t; - } - function mh(n2, t, e) { - (e ? rn2(n2, t, e) : t === i2) ? t = 1 : t = Q3(R2(t), 0); - var r = n2 == null ? 0 : n2.length; - if (!r || t < 1) + function _h(n3, t) { + return mn2(Ba, function(e2) { + var r2 = "_." + e2[0]; + t & e2[1] && !Ee(n3, r2) && n3.push(r2); + }), n3.sort(); + } + function Fu(n3) { + if (n3 instanceof N2) + return n3.clone(); + var t = new Pn(n3.__wrapped__, n3.__chain__); + return t.__actions__ = un2(n3.__actions__), t.__index__ = n3.__index__, t.__values__ = n3.__values__, t; + } + function mh(n3, t, e2) { + (e2 ? rn2(n3, t, e2) : t === i2) ? t = 1 : t = Q3(R2(t), 0); + var r2 = n3 == null ? 0 : n3.length; + if (!r2 || t < 1) return []; - for (var s = 0, o = 0, f3 = p3(Ue2(r / t)); s < r; ) - f3[o++] = Cn(n2, s, s += t); - return f3; + for (var s = 0, o2 = 0, f4 = p3(Ue2(r2 / t)); s < r2; ) + f4[o2++] = Cn(n3, s, s += t); + return f4; } - function wh(n2) { - for (var t = -1, e = n2 == null ? 0 : n2.length, r = 0, s = []; ++t < e; ) { - var o = n2[t]; - o && (s[r++] = o); + function wh(n3) { + for (var t = -1, e2 = n3 == null ? 0 : n3.length, r2 = 0, s = []; ++t < e2; ) { + var o2 = n3[t]; + o2 && (s[r2++] = o2); } return s; } function Ph() { - var n2 = arguments.length; - if (!n2) + var n3 = arguments.length; + if (!n3) return []; - for (var t = p3(n2 - 1), e = arguments[0], r = n2; r--; ) - t[r - 1] = arguments[r]; - return nt2(O2(e) ? un2(e) : [e], j2(t, 1)); - } - var Ah = T2(function(n2, t) { - return Z2(n2) ? ue2(n2, j2(t, 1, Z2, true)) : []; - }), Ch = T2(function(n2, t) { - var e = In(t); - return Z2(e) && (e = i2), Z2(n2) ? ue2(n2, j2(t, 1, Z2, true), x2(e, 2)) : []; - }), Ih = T2(function(n2, t) { - var e = In(t); - return Z2(e) && (e = i2), Z2(n2) ? ue2(n2, j2(t, 1, Z2, true), i2, e) : []; + for (var t = p3(n3 - 1), e2 = arguments[0], r2 = n3; r2--; ) + t[r2 - 1] = arguments[r2]; + return nt2(O2(e2) ? un2(e2) : [e2], j2(t, 1)); + } + var Ah = T2(function(n3, t) { + return Z2(n3) ? ue2(n3, j2(t, 1, Z2, true)) : []; + }), Ch = T2(function(n3, t) { + var e2 = In(t); + return Z2(e2) && (e2 = i2), Z2(n3) ? ue2(n3, j2(t, 1, Z2, true), x2(e2, 2)) : []; + }), Ih = T2(function(n3, t) { + var e2 = In(t); + return Z2(e2) && (e2 = i2), Z2(n3) ? ue2(n3, j2(t, 1, Z2, true), i2, e2) : []; }); - function xh(n2, t, e) { - var r = n2 == null ? 0 : n2.length; - return r ? (t = e || t === i2 ? 1 : R2(t), Cn(n2, t < 0 ? 0 : t, r)) : []; + function xh(n3, t, e2) { + var r2 = n3 == null ? 0 : n3.length; + return r2 ? (t = e2 || t === i2 ? 1 : R2(t), Cn(n3, t < 0 ? 0 : t, r2)) : []; } - function Eh(n2, t, e) { - var r = n2 == null ? 0 : n2.length; - return r ? (t = e || t === i2 ? 1 : R2(t), t = r - t, Cn(n2, 0, t < 0 ? 0 : t)) : []; + function Eh(n3, t, e2) { + var r2 = n3 == null ? 0 : n3.length; + return r2 ? (t = e2 || t === i2 ? 1 : R2(t), t = r2 - t, Cn(n3, 0, t < 0 ? 0 : t)) : []; } - function yh(n2, t) { - return n2 && n2.length ? Ze2(n2, x2(t, 3), true, true) : []; + function yh(n3, t) { + return n3 && n3.length ? Ze2(n3, x2(t, 3), true, true) : []; } - function Sh(n2, t) { - return n2 && n2.length ? Ze2(n2, x2(t, 3), true) : []; + function Sh(n3, t) { + return n3 && n3.length ? Ze2(n3, x2(t, 3), true) : []; } - function Oh(n2, t, e, r) { - var s = n2 == null ? 0 : n2.length; - return s ? (e && typeof e != "number" && rn2(n2, t, e) && (e = 0, r = s), Pc(n2, t, e, r)) : []; + function Oh(n3, t, e2, r2) { + var s = n3 == null ? 0 : n3.length; + return s ? (e2 && typeof e2 != "number" && rn2(n3, t, e2) && (e2 = 0, r2 = s), Pc(n3, t, e2, r2)) : []; } - function Mu(n2, t, e) { - var r = n2 == null ? 0 : n2.length; - if (!r) + function Mu(n3, t, e2) { + var r2 = n3 == null ? 0 : n3.length; + if (!r2) return -1; - var s = e == null ? 0 : R2(e); - return s < 0 && (s = Q3(r + s, 0)), ye(n2, x2(t, 3), s); + var s = e2 == null ? 0 : R2(e2); + return s < 0 && (s = Q3(r2 + s, 0)), ye(n3, x2(t, 3), s); } - function qu(n2, t, e) { - var r = n2 == null ? 0 : n2.length; - if (!r) + function qu(n3, t, e2) { + var r2 = n3 == null ? 0 : n3.length; + if (!r2) return -1; - var s = r - 1; - return e !== i2 && (s = R2(e), s = e < 0 ? Q3(r + s, 0) : nn2(s, r - 1)), ye(n2, x2(t, 3), s, true); + var s = r2 - 1; + return e2 !== i2 && (s = R2(e2), s = e2 < 0 ? Q3(r2 + s, 0) : nn2(s, r2 - 1)), ye(n3, x2(t, 3), s, true); } - function Bu(n2) { - var t = n2 == null ? 0 : n2.length; - return t ? j2(n2, 1) : []; + function Bu(n3) { + var t = n3 == null ? 0 : n3.length; + return t ? j2(n3, 1) : []; } - function Rh(n2) { - var t = n2 == null ? 0 : n2.length; - return t ? j2(n2, ht2) : []; + function Rh(n3) { + var t = n3 == null ? 0 : n3.length; + return t ? j2(n3, ht2) : []; } - function bh(n2, t) { - var e = n2 == null ? 0 : n2.length; - return e ? (t = t === i2 ? 1 : R2(t), j2(n2, t)) : []; + function bh(n3, t) { + var e2 = n3 == null ? 0 : n3.length; + return e2 ? (t = t === i2 ? 1 : R2(t), j2(n3, t)) : []; } - function Th(n2) { - for (var t = -1, e = n2 == null ? 0 : n2.length, r = {}; ++t < e; ) { - var s = n2[t]; - r[s[0]] = s[1]; + function Th(n3) { + for (var t = -1, e2 = n3 == null ? 0 : n3.length, r2 = {}; ++t < e2; ) { + var s = n3[t]; + r2[s[0]] = s[1]; } - return r; + return r2; } - function Gu(n2) { - return n2 && n2.length ? n2[0] : i2; + function Gu(n3) { + return n3 && n3.length ? n3[0] : i2; } - function Lh(n2, t, e) { - var r = n2 == null ? 0 : n2.length; - if (!r) + function Lh(n3, t, e2) { + var r2 = n3 == null ? 0 : n3.length; + if (!r2) return -1; - var s = e == null ? 0 : R2(e); - return s < 0 && (s = Q3(r + s, 0)), Tt2(n2, t, s); - } - function Dh(n2) { - var t = n2 == null ? 0 : n2.length; - return t ? Cn(n2, 0, -1) : []; - } - var Hh = T2(function(n2) { - var t = G2(n2, ai); - return t.length && t[0] === n2[0] ? Vr(t) : []; - }), Nh = T2(function(n2) { - var t = In(n2), e = G2(n2, ai); - return t === In(e) ? t = i2 : e.pop(), e.length && e[0] === n2[0] ? Vr(e, x2(t, 2)) : []; - }), $h = T2(function(n2) { - var t = In(n2), e = G2(n2, ai); - return t = typeof t == "function" ? t : i2, t && e.pop(), e.length && e[0] === n2[0] ? Vr(e, i2, t) : []; + var s = e2 == null ? 0 : R2(e2); + return s < 0 && (s = Q3(r2 + s, 0)), Tt2(n3, t, s); + } + function Dh(n3) { + var t = n3 == null ? 0 : n3.length; + return t ? Cn(n3, 0, -1) : []; + } + var Hh = T2(function(n3) { + var t = G2(n3, ai); + return t.length && t[0] === n3[0] ? Vr(t) : []; + }), Nh = T2(function(n3) { + var t = In(n3), e2 = G2(n3, ai); + return t === In(e2) ? t = i2 : e2.pop(), e2.length && e2[0] === n3[0] ? Vr(e2, x2(t, 2)) : []; + }), $h = T2(function(n3) { + var t = In(n3), e2 = G2(n3, ai); + return t = typeof t == "function" ? t : i2, t && e2.pop(), e2.length && e2[0] === n3[0] ? Vr(e2, i2, t) : []; }); - function Uh(n2, t) { - return n2 == null ? "" : Df.call(n2, t); + function Uh(n3, t) { + return n3 == null ? "" : Df.call(n3, t); } - function In(n2) { - var t = n2 == null ? 0 : n2.length; - return t ? n2[t - 1] : i2; + function In(n3) { + var t = n3 == null ? 0 : n3.length; + return t ? n3[t - 1] : i2; } - function Wh(n2, t, e) { - var r = n2 == null ? 0 : n2.length; - if (!r) + function Wh(n3, t, e2) { + var r2 = n3 == null ? 0 : n3.length; + if (!r2) return -1; - var s = r; - return e !== i2 && (s = R2(e), s = s < 0 ? Q3(r + s, 0) : nn2(s, r - 1)), t === t ? _f(n2, t, s) : ye(n2, Is2, s, true); + var s = r2; + return e2 !== i2 && (s = R2(e2), s = s < 0 ? Q3(r2 + s, 0) : nn2(s, r2 - 1)), t === t ? _f(n3, t, s) : ye(n3, Is2, s, true); } - function Fh(n2, t) { - return n2 && n2.length ? nu(n2, R2(t)) : i2; + function Fh(n3, t) { + return n3 && n3.length ? nu(n3, R2(t)) : i2; } var Mh = T2(zu); - function zu(n2, t) { - return n2 && n2.length && t && t.length ? ti(n2, t) : n2; + function zu(n3, t) { + return n3 && n3.length && t && t.length ? ti(n3, t) : n3; } - function qh(n2, t, e) { - return n2 && n2.length && t && t.length ? ti(n2, t, x2(e, 2)) : n2; + function qh(n3, t, e2) { + return n3 && n3.length && t && t.length ? ti(n3, t, x2(e2, 2)) : n3; } - function Bh(n2, t, e) { - return n2 && n2.length && t && t.length ? ti(n2, t, i2, e) : n2; + function Bh(n3, t, e2) { + return n3 && n3.length && t && t.length ? ti(n3, t, i2, e2) : n3; } - var Gh = Yn(function(n2, t) { - var e = n2 == null ? 0 : n2.length, r = Zr(n2, t); - return ru(n2, G2(t, function(s) { - return Zn(s, e) ? +s : s; - }).sort(pu)), r; + var Gh = Yn(function(n3, t) { + var e2 = n3 == null ? 0 : n3.length, r2 = Zr(n3, t); + return ru(n3, G2(t, function(s) { + return Zn(s, e2) ? +s : s; + }).sort(pu)), r2; }); - function zh(n2, t) { - var e = []; - if (!(n2 && n2.length)) - return e; - var r = -1, s = [], o = n2.length; - for (t = x2(t, 3); ++r < o; ) { - var f3 = n2[r]; - t(f3, r, n2) && (e.push(f3), s.push(r)); + function zh(n3, t) { + var e2 = []; + if (!(n3 && n3.length)) + return e2; + var r2 = -1, s = [], o2 = n3.length; + for (t = x2(t, 3); ++r2 < o2; ) { + var f4 = n3[r2]; + t(f4, r2, n3) && (e2.push(f4), s.push(r2)); } - return ru(n2, s), e; + return ru(n3, s), e2; } - function Ai(n2) { - return n2 == null ? n2 : Uf.call(n2); + function Ai(n3) { + return n3 == null ? n3 : Uf.call(n3); } - function Kh(n2, t, e) { - var r = n2 == null ? 0 : n2.length; - return r ? (e && typeof e != "number" && rn2(n2, t, e) ? (t = 0, e = r) : (t = t == null ? 0 : R2(t), e = e === i2 ? r : R2(e)), Cn(n2, t, e)) : []; + function Kh(n3, t, e2) { + var r2 = n3 == null ? 0 : n3.length; + return r2 ? (e2 && typeof e2 != "number" && rn2(n3, t, e2) ? (t = 0, e2 = r2) : (t = t == null ? 0 : R2(t), e2 = e2 === i2 ? r2 : R2(e2)), Cn(n3, t, e2)) : []; } - function Yh(n2, t) { - return Ye2(n2, t); + function Yh(n3, t) { + return Ye2(n3, t); } - function Zh(n2, t, e) { - return ii(n2, t, x2(e, 2)); + function Zh(n3, t, e2) { + return ii(n3, t, x2(e2, 2)); } - function Jh(n2, t) { - var e = n2 == null ? 0 : n2.length; - if (e) { - var r = Ye2(n2, t); - if (r < e && bn(n2[r], t)) - return r; + function Jh(n3, t) { + var e2 = n3 == null ? 0 : n3.length; + if (e2) { + var r2 = Ye2(n3, t); + if (r2 < e2 && bn(n3[r2], t)) + return r2; } return -1; } - function Xh(n2, t) { - return Ye2(n2, t, true); + function Xh(n3, t) { + return Ye2(n3, t, true); } - function Qh(n2, t, e) { - return ii(n2, t, x2(e, 2), true); + function Qh(n3, t, e2) { + return ii(n3, t, x2(e2, 2), true); } - function Vh(n2, t) { - var e = n2 == null ? 0 : n2.length; - if (e) { - var r = Ye2(n2, t, true) - 1; - if (bn(n2[r], t)) - return r; + function Vh(n3, t) { + var e2 = n3 == null ? 0 : n3.length; + if (e2) { + var r2 = Ye2(n3, t, true) - 1; + if (bn(n3[r2], t)) + return r2; } return -1; } - function kh(n2) { - return n2 && n2.length ? su(n2) : []; + function kh(n3) { + return n3 && n3.length ? su(n3) : []; } - function jh(n2, t) { - return n2 && n2.length ? su(n2, x2(t, 2)) : []; + function jh(n3, t) { + return n3 && n3.length ? su(n3, x2(t, 2)) : []; } - function nl(n2) { - var t = n2 == null ? 0 : n2.length; - return t ? Cn(n2, 1, t) : []; + function nl(n3) { + var t = n3 == null ? 0 : n3.length; + return t ? Cn(n3, 1, t) : []; } - function tl(n2, t, e) { - return n2 && n2.length ? (t = e || t === i2 ? 1 : R2(t), Cn(n2, 0, t < 0 ? 0 : t)) : []; + function tl(n3, t, e2) { + return n3 && n3.length ? (t = e2 || t === i2 ? 1 : R2(t), Cn(n3, 0, t < 0 ? 0 : t)) : []; } - function el(n2, t, e) { - var r = n2 == null ? 0 : n2.length; - return r ? (t = e || t === i2 ? 1 : R2(t), t = r - t, Cn(n2, t < 0 ? 0 : t, r)) : []; + function el(n3, t, e2) { + var r2 = n3 == null ? 0 : n3.length; + return r2 ? (t = e2 || t === i2 ? 1 : R2(t), t = r2 - t, Cn(n3, t < 0 ? 0 : t, r2)) : []; } - function rl(n2, t) { - return n2 && n2.length ? Ze2(n2, x2(t, 3), false, true) : []; + function rl(n3, t) { + return n3 && n3.length ? Ze2(n3, x2(t, 3), false, true) : []; } - function il(n2, t) { - return n2 && n2.length ? Ze2(n2, x2(t, 3)) : []; + function il(n3, t) { + return n3 && n3.length ? Ze2(n3, x2(t, 3)) : []; } - var sl = T2(function(n2) { - return it2(j2(n2, 1, Z2, true)); - }), ul = T2(function(n2) { - var t = In(n2); - return Z2(t) && (t = i2), it2(j2(n2, 1, Z2, true), x2(t, 2)); - }), al = T2(function(n2) { - var t = In(n2); - return t = typeof t == "function" ? t : i2, it2(j2(n2, 1, Z2, true), i2, t); + var sl = T2(function(n3) { + return it2(j2(n3, 1, Z2, true)); + }), ul = T2(function(n3) { + var t = In(n3); + return Z2(t) && (t = i2), it2(j2(n3, 1, Z2, true), x2(t, 2)); + }), al = T2(function(n3) { + var t = In(n3); + return t = typeof t == "function" ? t : i2, it2(j2(n3, 1, Z2, true), i2, t); }); - function ol(n2) { - return n2 && n2.length ? it2(n2) : []; + function ol(n3) { + return n3 && n3.length ? it2(n3) : []; } - function fl(n2, t) { - return n2 && n2.length ? it2(n2, x2(t, 2)) : []; + function fl(n3, t) { + return n3 && n3.length ? it2(n3, x2(t, 2)) : []; } - function cl(n2, t) { - return t = typeof t == "function" ? t : i2, n2 && n2.length ? it2(n2, i2, t) : []; + function cl(n3, t) { + return t = typeof t == "function" ? t : i2, n3 && n3.length ? it2(n3, i2, t) : []; } - function Ci(n2) { - if (!(n2 && n2.length)) + function Ci(n3) { + if (!(n3 && n3.length)) return []; var t = 0; - return n2 = jn(n2, function(e) { - if (Z2(e)) - return t = Q3(e.length, t), true; - }), Fr2(t, function(e) { - return G2(n2, $r2(e)); + return n3 = jn(n3, function(e2) { + if (Z2(e2)) + return t = Q3(e2.length, t), true; + }), Fr2(t, function(e2) { + return G2(n3, $r2(e2)); }); } - function Ku(n2, t) { - if (!(n2 && n2.length)) + function Ku(n3, t) { + if (!(n3 && n3.length)) return []; - var e = Ci(n2); - return t == null ? e : G2(e, function(r) { - return cn2(t, i2, r); + var e2 = Ci(n3); + return t == null ? e2 : G2(e2, function(r2) { + return cn2(t, i2, r2); }); } - var hl = T2(function(n2, t) { - return Z2(n2) ? ue2(n2, t) : []; - }), ll = T2(function(n2) { - return ui(jn(n2, Z2)); - }), pl = T2(function(n2) { - var t = In(n2); - return Z2(t) && (t = i2), ui(jn(n2, Z2), x2(t, 2)); - }), dl = T2(function(n2) { - var t = In(n2); - return t = typeof t == "function" ? t : i2, ui(jn(n2, Z2), i2, t); + var hl = T2(function(n3, t) { + return Z2(n3) ? ue2(n3, t) : []; + }), ll = T2(function(n3) { + return ui(jn(n3, Z2)); + }), pl = T2(function(n3) { + var t = In(n3); + return Z2(t) && (t = i2), ui(jn(n3, Z2), x2(t, 2)); + }), dl = T2(function(n3) { + var t = In(n3); + return t = typeof t == "function" ? t : i2, ui(jn(n3, Z2), i2, t); }), gl = T2(Ci); - function vl(n2, t) { - return fu(n2 || [], t || [], se); + function vl(n3, t) { + return fu(n3 || [], t || [], se); } - function _l(n2, t) { - return fu(n2 || [], t || [], fe); + function _l(n3, t) { + return fu(n3 || [], t || [], fe); } - var ml = T2(function(n2) { - var t = n2.length, e = t > 1 ? n2[t - 1] : i2; - return e = typeof e == "function" ? (n2.pop(), e) : i2, Ku(n2, e); + var ml = T2(function(n3) { + var t = n3.length, e2 = t > 1 ? n3[t - 1] : i2; + return e2 = typeof e2 == "function" ? (n3.pop(), e2) : i2, Ku(n3, e2); }); - function Yu(n2) { - var t = a3(n2); + function Yu(n3) { + var t = a3(n3); return t.__chain__ = true, t; } - function wl(n2, t) { - return t(n2), n2; + function wl(n3, t) { + return t(n3), n3; } - function er2(n2, t) { - return t(n2); + function er2(n3, t) { + return t(n3); } - var Pl = Yn(function(n2) { - var t = n2.length, e = t ? n2[0] : 0, r = this.__wrapped__, s = function(o) { - return Zr(o, n2); + var Pl = Yn(function(n3) { + var t = n3.length, e2 = t ? n3[0] : 0, r2 = this.__wrapped__, s = function(o2) { + return Zr(o2, n3); }; - return t > 1 || this.__actions__.length || !(r instanceof N2) || !Zn(e) ? this.thru(s) : (r = r.slice(e, +e + (t ? 1 : 0)), r.__actions__.push({ func: er2, args: [s], thisArg: i2 }), new Pn(r, this.__chain__).thru(function(o) { - return t && !o.length && o.push(i2), o; + return t > 1 || this.__actions__.length || !(r2 instanceof N2) || !Zn(e2) ? this.thru(s) : (r2 = r2.slice(e2, +e2 + (t ? 1 : 0)), r2.__actions__.push({ func: er2, args: [s], thisArg: i2 }), new Pn(r2, this.__chain__).thru(function(o2) { + return t && !o2.length && o2.push(i2), o2; })); }); function Al() { @@ -13748,25 +13716,25 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : } function Il() { this.__values__ === i2 && (this.__values__ = ua(this.value())); - var n2 = this.__index__ >= this.__values__.length, t = n2 ? i2 : this.__values__[this.__index__++]; - return { done: n2, value: t }; + var n3 = this.__index__ >= this.__values__.length, t = n3 ? i2 : this.__values__[this.__index__++]; + return { done: n3, value: t }; } function xl() { return this; } - function El(n2) { - for (var t, e = this; e instanceof qe2; ) { - var r = Fu(e); - r.__index__ = 0, r.__values__ = i2, t ? s.__wrapped__ = r : t = r; - var s = r; - e = e.__wrapped__; + function El(n3) { + for (var t, e2 = this; e2 instanceof qe2; ) { + var r2 = Fu(e2); + r2.__index__ = 0, r2.__values__ = i2, t ? s.__wrapped__ = r2 : t = r2; + var s = r2; + e2 = e2.__wrapped__; } - return s.__wrapped__ = n2, t; + return s.__wrapped__ = n3, t; } function yl() { - var n2 = this.__wrapped__; - if (n2 instanceof N2) { - var t = n2; + var n3 = this.__wrapped__; + if (n3 instanceof N2) { + var t = n3; return this.__actions__.length && (t = new N2(this)), t = t.reverse(), t.__actions__.push({ func: er2, args: [Ai], thisArg: i2 }), new Pn(t, this.__chain__); } return this.thru(Ai); @@ -13774,171 +13742,171 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : function Sl() { return ou(this.__wrapped__, this.__actions__); } - var Ol = Je2(function(n2, t, e) { - F2.call(n2, e) ? ++n2[e] : zn(n2, e, 1); + var Ol = Je2(function(n3, t, e2) { + F2.call(n3, e2) ? ++n3[e2] : zn(n3, e2, 1); }); - function Rl(n2, t, e) { - var r = O2(n2) ? As2 : wc; - return e && rn2(n2, t, e) && (t = i2), r(n2, x2(t, 3)); + function Rl(n3, t, e2) { + var r2 = O2(n3) ? As2 : wc; + return e2 && rn2(n3, t, e2) && (t = i2), r2(n3, x2(t, 3)); } - function bl(n2, t) { - var e = O2(n2) ? jn : Ks2; - return e(n2, x2(t, 3)); + function bl(n3, t) { + var e2 = O2(n3) ? jn : Ks2; + return e2(n3, x2(t, 3)); } var Tl = wu(Mu), Ll = wu(qu); - function Dl(n2, t) { - return j2(rr2(n2, t), 1); + function Dl(n3, t) { + return j2(rr2(n3, t), 1); } - function Hl(n2, t) { - return j2(rr2(n2, t), ht2); + function Hl(n3, t) { + return j2(rr2(n3, t), ht2); } - function Nl(n2, t, e) { - return e = e === i2 ? 1 : R2(e), j2(rr2(n2, t), e); + function Nl(n3, t, e2) { + return e2 = e2 === i2 ? 1 : R2(e2), j2(rr2(n3, t), e2); } - function Zu(n2, t) { - var e = O2(n2) ? mn2 : rt2; - return e(n2, x2(t, 3)); + function Zu(n3, t) { + var e2 = O2(n3) ? mn2 : rt2; + return e2(n3, x2(t, 3)); } - function Ju(n2, t) { - var e = O2(n2) ? jo : zs2; - return e(n2, x2(t, 3)); + function Ju(n3, t) { + var e2 = O2(n3) ? jo : zs2; + return e2(n3, x2(t, 3)); } - var $l = Je2(function(n2, t, e) { - F2.call(n2, e) ? n2[e].push(t) : zn(n2, e, [t]); + var $l = Je2(function(n3, t, e2) { + F2.call(n3, e2) ? n3[e2].push(t) : zn(n3, e2, [t]); }); - function Ul(n2, t, e, r) { - n2 = an2(n2) ? n2 : Gt2(n2), e = e && !r ? R2(e) : 0; - var s = n2.length; - return e < 0 && (e = Q3(s + e, 0)), or2(n2) ? e <= s && n2.indexOf(t, e) > -1 : !!s && Tt2(n2, t, e) > -1; - } - var Wl = T2(function(n2, t, e) { - var r = -1, s = typeof t == "function", o = an2(n2) ? p3(n2.length) : []; - return rt2(n2, function(f3) { - o[++r] = s ? cn2(t, f3, e) : ae2(f3, t, e); - }), o; - }), Fl = Je2(function(n2, t, e) { - zn(n2, e, t); + function Ul(n3, t, e2, r2) { + n3 = an2(n3) ? n3 : Gt2(n3), e2 = e2 && !r2 ? R2(e2) : 0; + var s = n3.length; + return e2 < 0 && (e2 = Q3(s + e2, 0)), or2(n3) ? e2 <= s && n3.indexOf(t, e2) > -1 : !!s && Tt2(n3, t, e2) > -1; + } + var Wl = T2(function(n3, t, e2) { + var r2 = -1, s = typeof t == "function", o2 = an2(n3) ? p3(n3.length) : []; + return rt2(n3, function(f4) { + o2[++r2] = s ? cn2(t, f4, e2) : ae2(f4, t, e2); + }), o2; + }), Fl = Je2(function(n3, t, e2) { + zn(n3, e2, t); }); - function rr2(n2, t) { - var e = O2(n2) ? G2 : Vs2; - return e(n2, x2(t, 3)); + function rr2(n3, t) { + var e2 = O2(n3) ? G2 : Vs2; + return e2(n3, x2(t, 3)); } - function Ml(n2, t, e, r) { - return n2 == null ? [] : (O2(t) || (t = t == null ? [] : [t]), e = r ? i2 : e, O2(e) || (e = e == null ? [] : [e]), tu(n2, t, e)); + function Ml(n3, t, e2, r2) { + return n3 == null ? [] : (O2(t) || (t = t == null ? [] : [t]), e2 = r2 ? i2 : e2, O2(e2) || (e2 = e2 == null ? [] : [e2]), tu(n3, t, e2)); } - var ql = Je2(function(n2, t, e) { - n2[e ? 0 : 1].push(t); + var ql = Je2(function(n3, t, e2) { + n3[e2 ? 0 : 1].push(t); }, function() { return [[], []]; }); - function Bl(n2, t, e) { - var r = O2(n2) ? Hr : Es2, s = arguments.length < 3; - return r(n2, x2(t, 4), e, s, rt2); + function Bl(n3, t, e2) { + var r2 = O2(n3) ? Hr : Es2, s = arguments.length < 3; + return r2(n3, x2(t, 4), e2, s, rt2); } - function Gl(n2, t, e) { - var r = O2(n2) ? nf : Es2, s = arguments.length < 3; - return r(n2, x2(t, 4), e, s, zs2); + function Gl(n3, t, e2) { + var r2 = O2(n3) ? nf : Es2, s = arguments.length < 3; + return r2(n3, x2(t, 4), e2, s, zs2); } - function zl(n2, t) { - var e = O2(n2) ? jn : Ks2; - return e(n2, ur2(x2(t, 3))); + function zl(n3, t) { + var e2 = O2(n3) ? jn : Ks2; + return e2(n3, ur2(x2(t, 3))); } - function Kl(n2) { - var t = O2(n2) ? Ms2 : Uc; - return t(n2); + function Kl(n3) { + var t = O2(n3) ? Ms2 : Uc; + return t(n3); } - function Yl(n2, t, e) { - (e ? rn2(n2, t, e) : t === i2) ? t = 1 : t = R2(t); - var r = O2(n2) ? dc : Wc; - return r(n2, t); + function Yl(n3, t, e2) { + (e2 ? rn2(n3, t, e2) : t === i2) ? t = 1 : t = R2(t); + var r2 = O2(n3) ? dc : Wc; + return r2(n3, t); } - function Zl(n2) { - var t = O2(n2) ? gc : Mc; - return t(n2); + function Zl(n3) { + var t = O2(n3) ? gc : Mc; + return t(n3); } - function Jl(n2) { - if (n2 == null) + function Jl(n3) { + if (n3 == null) return 0; - if (an2(n2)) - return or2(n2) ? Dt2(n2) : n2.length; - var t = tn2(n2); - return t == yn2 || t == Sn ? n2.size : jr(n2).length; + if (an2(n3)) + return or2(n3) ? Dt2(n3) : n3.length; + var t = tn2(n3); + return t == yn2 || t == Sn ? n3.size : jr(n3).length; } - function Xl(n2, t, e) { - var r = O2(n2) ? Nr2 : qc; - return e && rn2(n2, t, e) && (t = i2), r(n2, x2(t, 3)); + function Xl(n3, t, e2) { + var r2 = O2(n3) ? Nr2 : qc; + return e2 && rn2(n3, t, e2) && (t = i2), r2(n3, x2(t, 3)); } - var Ql = T2(function(n2, t) { - if (n2 == null) + var Ql = T2(function(n3, t) { + if (n3 == null) return []; - var e = t.length; - return e > 1 && rn2(n2, t[0], t[1]) ? t = [] : e > 2 && rn2(t[0], t[1], t[2]) && (t = [t[0]]), tu(n2, j2(t, 1), []); + var e2 = t.length; + return e2 > 1 && rn2(n3, t[0], t[1]) ? t = [] : e2 > 2 && rn2(t[0], t[1], t[2]) && (t = [t[0]]), tu(n3, j2(t, 1), []); }), ir2 = bf || function() { return k2.Date.now(); }; - function Vl(n2, t) { + function Vl(n3, t) { if (typeof t != "function") throw new wn(D2); - return n2 = R2(n2), function() { - if (--n2 < 1) + return n3 = R2(n3), function() { + if (--n3 < 1) return t.apply(this, arguments); }; } - function Xu(n2, t, e) { - return t = e ? i2 : t, t = n2 && t == null ? n2.length : t, Kn2(n2, Mn2, i2, i2, i2, i2, t); + function Xu(n3, t, e2) { + return t = e2 ? i2 : t, t = n3 && t == null ? n3.length : t, Kn2(n3, Mn2, i2, i2, i2, i2, t); } - function Qu(n2, t) { - var e; + function Qu(n3, t) { + var e2; if (typeof t != "function") throw new wn(D2); - return n2 = R2(n2), function() { - return --n2 > 0 && (e = t.apply(this, arguments)), n2 <= 1 && (t = i2), e; + return n3 = R2(n3), function() { + return --n3 > 0 && (e2 = t.apply(this, arguments)), n3 <= 1 && (t = i2), e2; }; } - var Ii = T2(function(n2, t, e) { - var r = vn2; - if (e.length) { - var s = tt2(e, qt2(Ii)); - r |= Hn2; + var Ii = T2(function(n3, t, e2) { + var r2 = vn2; + if (e2.length) { + var s = tt2(e2, qt2(Ii)); + r2 |= Hn2; } - return Kn2(n2, r, t, e, s); - }), Vu = T2(function(n2, t, e) { - var r = vn2 | ct2; - if (e.length) { - var s = tt2(e, qt2(Vu)); - r |= Hn2; + return Kn2(n3, r2, t, e2, s); + }), Vu = T2(function(n3, t, e2) { + var r2 = vn2 | ct2; + if (e2.length) { + var s = tt2(e2, qt2(Vu)); + r2 |= Hn2; } - return Kn2(t, r, n2, e, s); + return Kn2(t, r2, n3, e2, s); }); - function ku(n2, t, e) { - t = e ? i2 : t; - var r = Kn2(n2, Dn2, i2, i2, i2, i2, i2, t); - return r.placeholder = ku.placeholder, r; - } - function ju(n2, t, e) { - t = e ? i2 : t; - var r = Kn2(n2, yt2, i2, i2, i2, i2, i2, t); - return r.placeholder = ju.placeholder, r; - } - function na(n2, t, e) { - var r, s, o, f3, c2, l2, v3 = 0, _3 = false, m2 = false, P2 = true; - if (typeof n2 != "function") + function ku(n3, t, e2) { + t = e2 ? i2 : t; + var r2 = Kn2(n3, Dn2, i2, i2, i2, i2, i2, t); + return r2.placeholder = ku.placeholder, r2; + } + function ju(n3, t, e2) { + t = e2 ? i2 : t; + var r2 = Kn2(n3, yt2, i2, i2, i2, i2, i2, t); + return r2.placeholder = ju.placeholder, r2; + } + function na(n3, t, e2) { + var r2, s, o2, f4, c2, l2, v3 = 0, _3 = false, m2 = false, P2 = true; + if (typeof n3 != "function") throw new wn(D2); - t = xn2(t) || 0, K2(e) && (_3 = !!e.leading, m2 = "maxWait" in e, o = m2 ? Q3(xn2(e.maxWait) || 0, t) : o, P2 = "trailing" in e ? !!e.trailing : P2); + t = xn2(t) || 0, K2(e2) && (_3 = !!e2.leading, m2 = "maxWait" in e2, o2 = m2 ? Q3(xn2(e2.maxWait) || 0, t) : o2, P2 = "trailing" in e2 ? !!e2.trailing : P2); function I2(J2) { - var Tn = r, Qn2 = s; - return r = s = i2, v3 = J2, f3 = n2.apply(Qn2, Tn), f3; + var Tn = r2, Qn2 = s; + return r2 = s = i2, v3 = J2, f4 = n3.apply(Qn2, Tn), f4; } function E3(J2) { - return v3 = J2, c2 = le2(H2, t), _3 ? I2(J2) : f3; + return v3 = J2, c2 = le2(H2, t), _3 ? I2(J2) : f4; } function b3(J2) { var Tn = J2 - l2, Qn2 = J2 - v3, wa = t - Tn; - return m2 ? nn2(wa, o - Qn2) : wa; + return m2 ? nn2(wa, o2 - Qn2) : wa; } function y3(J2) { var Tn = J2 - l2, Qn2 = J2 - v3; - return l2 === i2 || Tn >= t || Tn < 0 || m2 && Qn2 >= o; + return l2 === i2 || Tn >= t || Tn < 0 || m2 && Qn2 >= o2; } function H2() { var J2 = ir2(); @@ -13947,563 +13915,563 @@ var ge2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : c2 = le2(H2, b3(J2)); } function $2(J2) { - return c2 = i2, P2 && r ? I2(J2) : (r = s = i2, f3); + return c2 = i2, P2 && r2 ? I2(J2) : (r2 = s = i2, f4); } function dn2() { - c2 !== i2 && cu(c2), v3 = 0, r = l2 = s = c2 = i2; + c2 !== i2 && cu(c2), v3 = 0, r2 = l2 = s = c2 = i2; } function sn2() { - return c2 === i2 ? f3 : $2(ir2()); + return c2 === i2 ? f4 : $2(ir2()); } function gn2() { var J2 = ir2(), Tn = y3(J2); - if (r = arguments, s = this, l2 = J2, Tn) { + if (r2 = arguments, s = this, l2 = J2, Tn) { if (c2 === i2) return E3(l2); if (m2) return cu(c2), c2 = le2(H2, t), I2(l2); } - return c2 === i2 && (c2 = le2(H2, t)), f3; + return c2 === i2 && (c2 = le2(H2, t)), f4; } return gn2.cancel = dn2, gn2.flush = sn2, gn2; } - var kl = T2(function(n2, t) { - return Gs2(n2, 1, t); - }), jl = T2(function(n2, t, e) { - return Gs2(n2, xn2(t) || 0, e); + var kl = T2(function(n3, t) { + return Gs2(n3, 1, t); + }), jl = T2(function(n3, t, e2) { + return Gs2(n3, xn2(t) || 0, e2); }); - function np(n2) { - return Kn2(n2, dr2); + function np(n3) { + return Kn2(n3, dr2); } - function sr3(n2, t) { - if (typeof n2 != "function" || t != null && typeof t != "function") + function sr3(n3, t) { + if (typeof n3 != "function" || t != null && typeof t != "function") throw new wn(D2); - var e = function() { - var r = arguments, s = t ? t.apply(this, r) : r[0], o = e.cache; - if (o.has(s)) - return o.get(s); - var f3 = n2.apply(this, r); - return e.cache = o.set(s, f3) || o, f3; + var e2 = function() { + var r2 = arguments, s = t ? t.apply(this, r2) : r2[0], o2 = e2.cache; + if (o2.has(s)) + return o2.get(s); + var f4 = n3.apply(this, r2); + return e2.cache = o2.set(s, f4) || o2, f4; }; - return e.cache = new (sr3.Cache || Gn2)(), e; + return e2.cache = new (sr3.Cache || Gn2)(), e2; } sr3.Cache = Gn2; - function ur2(n2) { - if (typeof n2 != "function") + function ur2(n3) { + if (typeof n3 != "function") throw new wn(D2); return function() { var t = arguments; switch (t.length) { case 0: - return !n2.call(this); + return !n3.call(this); case 1: - return !n2.call(this, t[0]); + return !n3.call(this, t[0]); case 2: - return !n2.call(this, t[0], t[1]); + return !n3.call(this, t[0], t[1]); case 3: - return !n2.call(this, t[0], t[1], t[2]); + return !n3.call(this, t[0], t[1], t[2]); } - return !n2.apply(this, t); + return !n3.apply(this, t); }; } - function tp(n2) { - return Qu(2, n2); + function tp(n3) { + return Qu(2, n3); } - var ep = Bc(function(n2, t) { + var ep = Bc(function(n3, t) { t = t.length == 1 && O2(t[0]) ? G2(t[0], hn2(x2())) : G2(j2(t, 1), hn2(x2())); - var e = t.length; - return T2(function(r) { - for (var s = -1, o = nn2(r.length, e); ++s < o; ) - r[s] = t[s].call(this, r[s]); - return cn2(n2, this, r); + var e2 = t.length; + return T2(function(r2) { + for (var s = -1, o2 = nn2(r2.length, e2); ++s < o2; ) + r2[s] = t[s].call(this, r2[s]); + return cn2(n3, this, r2); }); - }), xi = T2(function(n2, t) { - var e = tt2(t, qt2(xi)); - return Kn2(n2, Hn2, i2, t, e); - }), ta = T2(function(n2, t) { - var e = tt2(t, qt2(ta)); - return Kn2(n2, St2, i2, t, e); - }), rp = Yn(function(n2, t) { - return Kn2(n2, Kt2, i2, i2, i2, t); + }), xi = T2(function(n3, t) { + var e2 = tt2(t, qt2(xi)); + return Kn2(n3, Hn2, i2, t, e2); + }), ta = T2(function(n3, t) { + var e2 = tt2(t, qt2(ta)); + return Kn2(n3, St2, i2, t, e2); + }), rp = Yn(function(n3, t) { + return Kn2(n3, Kt2, i2, i2, i2, t); }); - function ip(n2, t) { - if (typeof n2 != "function") + function ip(n3, t) { + if (typeof n3 != "function") throw new wn(D2); - return t = t === i2 ? t : R2(t), T2(n2, t); + return t = t === i2 ? t : R2(t), T2(n3, t); } - function sp(n2, t) { - if (typeof n2 != "function") + function sp(n3, t) { + if (typeof n3 != "function") throw new wn(D2); - return t = t == null ? 0 : Q3(R2(t), 0), T2(function(e) { - var r = e[t], s = ut2(e, 0, t); - return r && nt2(s, r), cn2(n2, this, s); + return t = t == null ? 0 : Q3(R2(t), 0), T2(function(e2) { + var r2 = e2[t], s = ut2(e2, 0, t); + return r2 && nt2(s, r2), cn2(n3, this, s); }); } - function up(n2, t, e) { - var r = true, s = true; - if (typeof n2 != "function") + function up(n3, t, e2) { + var r2 = true, s = true; + if (typeof n3 != "function") throw new wn(D2); - return K2(e) && (r = "leading" in e ? !!e.leading : r, s = "trailing" in e ? !!e.trailing : s), na(n2, t, { leading: r, maxWait: t, trailing: s }); + return K2(e2) && (r2 = "leading" in e2 ? !!e2.leading : r2, s = "trailing" in e2 ? !!e2.trailing : s), na(n3, t, { leading: r2, maxWait: t, trailing: s }); } - function ap(n2) { - return Xu(n2, 1); + function ap(n3) { + return Xu(n3, 1); } - function op(n2, t) { - return xi(oi(t), n2); + function op(n3, t) { + return xi(oi(t), n3); } function fp() { if (!arguments.length) return []; - var n2 = arguments[0]; - return O2(n2) ? n2 : [n2]; + var n3 = arguments[0]; + return O2(n3) ? n3 : [n3]; } - function cp(n2) { - return An(n2, xt2); + function cp(n3) { + return An(n3, xt2); } - function hp(n2, t) { - return t = typeof t == "function" ? t : i2, An(n2, xt2, t); + function hp(n3, t) { + return t = typeof t == "function" ? t : i2, An(n3, xt2, t); } - function lp(n2) { - return An(n2, Ln2 | xt2); + function lp(n3) { + return An(n3, Ln2 | xt2); } - function pp(n2, t) { - return t = typeof t == "function" ? t : i2, An(n2, Ln2 | xt2, t); + function pp(n3, t) { + return t = typeof t == "function" ? t : i2, An(n3, Ln2 | xt2, t); } - function dp(n2, t) { - return t == null || Bs2(n2, t, V2(t)); + function dp(n3, t) { + return t == null || Bs2(n3, t, V2(t)); } - function bn(n2, t) { - return n2 === t || n2 !== n2 && t !== t; + function bn(n3, t) { + return n3 === t || n3 !== n3 && t !== t; } - var gp = ke2(Qr), vp = ke2(function(n2, t) { - return n2 >= t; + var gp = ke2(Qr), vp = ke2(function(n3, t) { + return n3 >= t; }), Pt2 = Js2(/* @__PURE__ */ function() { return arguments; - }()) ? Js2 : function(n2) { - return Y(n2) && F2.call(n2, "callee") && !Hs2.call(n2, "callee"); + }()) ? Js2 : function(n3) { + return Y(n3) && F2.call(n3, "callee") && !Hs2.call(n3, "callee"); }, O2 = p3.isArray, _p = gs2 ? hn2(gs2) : Ec; - function an2(n2) { - return n2 != null && ar2(n2.length) && !Jn2(n2); + function an2(n3) { + return n3 != null && ar2(n3.length) && !Jn2(n3); } - function Z2(n2) { - return Y(n2) && an2(n2); + function Z2(n3) { + return Y(n3) && an2(n3); } - function mp(n2) { - return n2 === true || n2 === false || Y(n2) && en2(n2) == Yt2; + function mp(n3) { + return n3 === true || n3 === false || Y(n3) && en2(n3) == Yt2; } var at2 = Lf || Ni, wp = vs2 ? hn2(vs2) : yc; - function Pp(n2) { - return Y(n2) && n2.nodeType === 1 && !pe2(n2); + function Pp(n3) { + return Y(n3) && n3.nodeType === 1 && !pe2(n3); } - function Ap(n2) { - if (n2 == null) + function Ap(n3) { + if (n3 == null) return true; - if (an2(n2) && (O2(n2) || typeof n2 == "string" || typeof n2.splice == "function" || at2(n2) || Bt2(n2) || Pt2(n2))) - return !n2.length; - var t = tn2(n2); + if (an2(n3) && (O2(n3) || typeof n3 == "string" || typeof n3.splice == "function" || at2(n3) || Bt2(n3) || Pt2(n3))) + return !n3.length; + var t = tn2(n3); if (t == yn2 || t == Sn) - return !n2.size; - if (he2(n2)) - return !jr(n2).length; - for (var e in n2) - if (F2.call(n2, e)) + return !n3.size; + if (he2(n3)) + return !jr(n3).length; + for (var e2 in n3) + if (F2.call(n3, e2)) return false; return true; } - function Cp(n2, t) { - return oe2(n2, t); + function Cp(n3, t) { + return oe2(n3, t); } - function Ip(n2, t, e) { - e = typeof e == "function" ? e : i2; - var r = e ? e(n2, t) : i2; - return r === i2 ? oe2(n2, t, i2, e) : !!r; + function Ip(n3, t, e2) { + e2 = typeof e2 == "function" ? e2 : i2; + var r2 = e2 ? e2(n3, t) : i2; + return r2 === i2 ? oe2(n3, t, i2, e2) : !!r2; } - function Ei(n2) { - if (!Y(n2)) + function Ei(n3) { + if (!Y(n3)) return false; - var t = en2(n2); - return t == we || t == za || typeof n2.message == "string" && typeof n2.name == "string" && !pe2(n2); + var t = en2(n3); + return t == we || t == za || typeof n3.message == "string" && typeof n3.name == "string" && !pe2(n3); } - function xp(n2) { - return typeof n2 == "number" && $s2(n2); + function xp(n3) { + return typeof n3 == "number" && $s2(n3); } - function Jn2(n2) { - if (!K2(n2)) + function Jn2(n3) { + if (!K2(n3)) return false; - var t = en2(n2); + var t = en2(n3); return t == Pe2 || t == Gi2 || t == Ga || t == Ya; } - function ea(n2) { - return typeof n2 == "number" && n2 == R2(n2); + function ea(n3) { + return typeof n3 == "number" && n3 == R2(n3); } - function ar2(n2) { - return typeof n2 == "number" && n2 > -1 && n2 % 1 == 0 && n2 <= kn2; + function ar2(n3) { + return typeof n3 == "number" && n3 > -1 && n3 % 1 == 0 && n3 <= kn2; } - function K2(n2) { - var t = typeof n2; - return n2 != null && (t == "object" || t == "function"); + function K2(n3) { + var t = typeof n3; + return n3 != null && (t == "object" || t == "function"); } - function Y(n2) { - return n2 != null && typeof n2 == "object"; + function Y(n3) { + return n3 != null && typeof n3 == "object"; } var ra = _s2 ? hn2(_s2) : Oc; - function Ep(n2, t) { - return n2 === t || kr(n2, t, gi(t)); + function Ep(n3, t) { + return n3 === t || kr(n3, t, gi(t)); } - function yp(n2, t, e) { - return e = typeof e == "function" ? e : i2, kr(n2, t, gi(t), e); + function yp(n3, t, e2) { + return e2 = typeof e2 == "function" ? e2 : i2, kr(n3, t, gi(t), e2); } - function Sp(n2) { - return ia(n2) && n2 != +n2; + function Sp(n3) { + return ia(n3) && n3 != +n3; } - function Op(n2) { - if (hh(n2)) + function Op(n3) { + if (hh(n3)) throw new S2(L2); - return Xs2(n2); + return Xs2(n3); } - function Rp(n2) { - return n2 === null; + function Rp(n3) { + return n3 === null; } - function bp(n2) { - return n2 == null; + function bp(n3) { + return n3 == null; } - function ia(n2) { - return typeof n2 == "number" || Y(n2) && en2(n2) == Jt2; + function ia(n3) { + return typeof n3 == "number" || Y(n3) && en2(n3) == Jt2; } - function pe2(n2) { - if (!Y(n2) || en2(n2) != qn2) + function pe2(n3) { + if (!Y(n3) || en2(n3) != qn2) return false; - var t = He2(n2); + var t = He2(n3); if (t === null) return true; - var e = F2.call(t, "constructor") && t.constructor; - return typeof e == "function" && e instanceof e && be.call(e) == yf; + var e2 = F2.call(t, "constructor") && t.constructor; + return typeof e2 == "function" && e2 instanceof e2 && be.call(e2) == yf; } var yi = ms2 ? hn2(ms2) : Rc; - function Tp(n2) { - return ea(n2) && n2 >= -kn2 && n2 <= kn2; + function Tp(n3) { + return ea(n3) && n3 >= -kn2 && n3 <= kn2; } var sa = ws2 ? hn2(ws2) : bc; - function or2(n2) { - return typeof n2 == "string" || !O2(n2) && Y(n2) && en2(n2) == Qt2; + function or2(n3) { + return typeof n3 == "string" || !O2(n3) && Y(n3) && en2(n3) == Qt2; } - function pn2(n2) { - return typeof n2 == "symbol" || Y(n2) && en2(n2) == Ae2; + function pn2(n3) { + return typeof n3 == "symbol" || Y(n3) && en2(n3) == Ae2; } var Bt2 = Ps2 ? hn2(Ps2) : Tc; - function Lp(n2) { - return n2 === i2; + function Lp(n3) { + return n3 === i2; } - function Dp(n2) { - return Y(n2) && tn2(n2) == Vt2; + function Dp(n3) { + return Y(n3) && tn2(n3) == Vt2; } - function Hp(n2) { - return Y(n2) && en2(n2) == Ja; + function Hp(n3) { + return Y(n3) && en2(n3) == Ja; } - var Np = ke2(ni), $p = ke2(function(n2, t) { - return n2 <= t; + var Np = ke2(ni), $p = ke2(function(n3, t) { + return n3 <= t; }); - function ua(n2) { - if (!n2) + function ua(n3) { + if (!n3) return []; - if (an2(n2)) - return or2(n2) ? On(n2) : un2(n2); - if (ne && n2[ne]) - return df(n2[ne]()); - var t = tn2(n2), e = t == yn2 ? qr : t == Sn ? Se : Gt2; - return e(n2); - } - function Xn2(n2) { - if (!n2) - return n2 === 0 ? n2 : 0; - if (n2 = xn2(n2), n2 === ht2 || n2 === -ht2) { - var t = n2 < 0 ? -1 : 1; + if (an2(n3)) + return or2(n3) ? On(n3) : un2(n3); + if (ne && n3[ne]) + return df(n3[ne]()); + var t = tn2(n3), e2 = t == yn2 ? qr : t == Sn ? Se : Gt2; + return e2(n3); + } + function Xn2(n3) { + if (!n3) + return n3 === 0 ? n3 : 0; + if (n3 = xn2(n3), n3 === ht2 || n3 === -ht2) { + var t = n3 < 0 ? -1 : 1; return t * Fa; } - return n2 === n2 ? n2 : 0; + return n3 === n3 ? n3 : 0; } - function R2(n2) { - var t = Xn2(n2), e = t % 1; - return t === t ? e ? t - e : t : 0; + function R2(n3) { + var t = Xn2(n3), e2 = t % 1; + return t === t ? e2 ? t - e2 : t : 0; } - function aa(n2) { - return n2 ? vt2(R2(n2), 0, Nn) : 0; + function aa(n3) { + return n3 ? vt2(R2(n3), 0, Nn) : 0; } - function xn2(n2) { - if (typeof n2 == "number") - return n2; - if (pn2(n2)) + function xn2(n3) { + if (typeof n3 == "number") + return n3; + if (pn2(n3)) return _e2; - if (K2(n2)) { - var t = typeof n2.valueOf == "function" ? n2.valueOf() : n2; - n2 = K2(t) ? t + "" : t; + if (K2(n3)) { + var t = typeof n3.valueOf == "function" ? n3.valueOf() : n3; + n3 = K2(t) ? t + "" : t; } - if (typeof n2 != "string") - return n2 === 0 ? n2 : +n2; - n2 = ys2(n2); - var e = vo.test(n2); - return e || mo.test(n2) ? Qo(n2.slice(2), e ? 2 : 8) : go.test(n2) ? _e2 : +n2; + if (typeof n3 != "string") + return n3 === 0 ? n3 : +n3; + n3 = ys2(n3); + var e2 = vo.test(n3); + return e2 || mo.test(n3) ? Qo(n3.slice(2), e2 ? 2 : 8) : go.test(n3) ? _e2 : +n3; } - function oa(n2) { - return Un2(n2, on2(n2)); + function oa(n3) { + return Un2(n3, on2(n3)); } - function Up(n2) { - return n2 ? vt2(R2(n2), -kn2, kn2) : n2 === 0 ? n2 : 0; + function Up(n3) { + return n3 ? vt2(R2(n3), -kn2, kn2) : n3 === 0 ? n3 : 0; } - function W2(n2) { - return n2 == null ? "" : ln2(n2); + function W2(n3) { + return n3 == null ? "" : ln2(n3); } - var Wp = Ft2(function(n2, t) { + var Wp = Ft2(function(n3, t) { if (he2(t) || an2(t)) { - Un2(t, V2(t), n2); + Un2(t, V2(t), n3); return; } - for (var e in t) - F2.call(t, e) && se(n2, e, t[e]); - }), fa = Ft2(function(n2, t) { - Un2(t, on2(t), n2); - }), fr = Ft2(function(n2, t, e, r) { - Un2(t, on2(t), n2, r); - }), Fp = Ft2(function(n2, t, e, r) { - Un2(t, V2(t), n2, r); + for (var e2 in t) + F2.call(t, e2) && se(n3, e2, t[e2]); + }), fa = Ft2(function(n3, t) { + Un2(t, on2(t), n3); + }), fr = Ft2(function(n3, t, e2, r2) { + Un2(t, on2(t), n3, r2); + }), Fp = Ft2(function(n3, t, e2, r2) { + Un2(t, V2(t), n3, r2); }), Mp = Yn(Zr); - function qp(n2, t) { - var e = Wt2(n2); - return t == null ? e : qs2(e, t); - } - var Bp = T2(function(n2, t) { - n2 = M2(n2); - var e = -1, r = t.length, s = r > 2 ? t[2] : i2; - for (s && rn2(t[0], t[1], s) && (r = 1); ++e < r; ) - for (var o = t[e], f3 = on2(o), c2 = -1, l2 = f3.length; ++c2 < l2; ) { - var v3 = f3[c2], _3 = n2[v3]; - (_3 === i2 || bn(_3, Nt2[v3]) && !F2.call(n2, v3)) && (n2[v3] = o[v3]); + function qp(n3, t) { + var e2 = Wt2(n3); + return t == null ? e2 : qs2(e2, t); + } + var Bp = T2(function(n3, t) { + n3 = M2(n3); + var e2 = -1, r2 = t.length, s = r2 > 2 ? t[2] : i2; + for (s && rn2(t[0], t[1], s) && (r2 = 1); ++e2 < r2; ) + for (var o2 = t[e2], f4 = on2(o2), c2 = -1, l2 = f4.length; ++c2 < l2; ) { + var v3 = f4[c2], _3 = n3[v3]; + (_3 === i2 || bn(_3, Nt2[v3]) && !F2.call(n3, v3)) && (n3[v3] = o2[v3]); } - return n2; - }), Gp = T2(function(n2) { - return n2.push(i2, yu), cn2(ca, i2, n2); + return n3; + }), Gp = T2(function(n3) { + return n3.push(i2, yu), cn2(ca, i2, n3); }); - function zp(n2, t) { - return Cs2(n2, x2(t, 3), $n); + function zp(n3, t) { + return Cs2(n3, x2(t, 3), $n); } - function Kp(n2, t) { - return Cs2(n2, x2(t, 3), Xr); + function Kp(n3, t) { + return Cs2(n3, x2(t, 3), Xr); } - function Yp(n2, t) { - return n2 == null ? n2 : Jr(n2, x2(t, 3), on2); + function Yp(n3, t) { + return n3 == null ? n3 : Jr(n3, x2(t, 3), on2); } - function Zp(n2, t) { - return n2 == null ? n2 : Ys2(n2, x2(t, 3), on2); + function Zp(n3, t) { + return n3 == null ? n3 : Ys2(n3, x2(t, 3), on2); } - function Jp(n2, t) { - return n2 && $n(n2, x2(t, 3)); + function Jp(n3, t) { + return n3 && $n(n3, x2(t, 3)); } - function Xp(n2, t) { - return n2 && Xr(n2, x2(t, 3)); + function Xp(n3, t) { + return n3 && Xr(n3, x2(t, 3)); } - function Qp(n2) { - return n2 == null ? [] : ze2(n2, V2(n2)); + function Qp(n3) { + return n3 == null ? [] : ze2(n3, V2(n3)); } - function Vp(n2) { - return n2 == null ? [] : ze2(n2, on2(n2)); + function Vp(n3) { + return n3 == null ? [] : ze2(n3, on2(n3)); } - function Si(n2, t, e) { - var r = n2 == null ? i2 : _t2(n2, t); - return r === i2 ? e : r; + function Si(n3, t, e2) { + var r2 = n3 == null ? i2 : _t2(n3, t); + return r2 === i2 ? e2 : r2; } - function kp(n2, t) { - return n2 != null && Ru(n2, t, Ac); + function kp(n3, t) { + return n3 != null && Ru(n3, t, Ac); } - function Oi(n2, t) { - return n2 != null && Ru(n2, t, Cc); + function Oi(n3, t) { + return n3 != null && Ru(n3, t, Cc); } - var jp = Au(function(n2, t, e) { - t != null && typeof t.toString != "function" && (t = Te2.call(t)), n2[t] = e; - }, bi(fn2)), nd = Au(function(n2, t, e) { - t != null && typeof t.toString != "function" && (t = Te2.call(t)), F2.call(n2, t) ? n2[t].push(e) : n2[t] = [e]; + var jp = Au(function(n3, t, e2) { + t != null && typeof t.toString != "function" && (t = Te2.call(t)), n3[t] = e2; + }, bi(fn2)), nd = Au(function(n3, t, e2) { + t != null && typeof t.toString != "function" && (t = Te2.call(t)), F2.call(n3, t) ? n3[t].push(e2) : n3[t] = [e2]; }, x2), td = T2(ae2); - function V2(n2) { - return an2(n2) ? Fs2(n2) : jr(n2); - } - function on2(n2) { - return an2(n2) ? Fs2(n2, true) : Lc(n2); - } - function ed(n2, t) { - var e = {}; - return t = x2(t, 3), $n(n2, function(r, s, o) { - zn(e, t(r, s, o), r); - }), e; - } - function rd(n2, t) { - var e = {}; - return t = x2(t, 3), $n(n2, function(r, s, o) { - zn(e, s, t(r, s, o)); - }), e; - } - var id = Ft2(function(n2, t, e) { - Ke2(n2, t, e); - }), ca = Ft2(function(n2, t, e, r) { - Ke2(n2, t, e, r); - }), sd = Yn(function(n2, t) { - var e = {}; - if (n2 == null) - return e; - var r = false; - t = G2(t, function(o) { - return o = st2(o, n2), r || (r = o.length > 1), o; - }), Un2(n2, pi(n2), e), r && (e = An(e, Ln2 | Fn2 | xt2, jc)); + function V2(n3) { + return an2(n3) ? Fs2(n3) : jr(n3); + } + function on2(n3) { + return an2(n3) ? Fs2(n3, true) : Lc(n3); + } + function ed(n3, t) { + var e2 = {}; + return t = x2(t, 3), $n(n3, function(r2, s, o2) { + zn(e2, t(r2, s, o2), r2); + }), e2; + } + function rd(n3, t) { + var e2 = {}; + return t = x2(t, 3), $n(n3, function(r2, s, o2) { + zn(e2, s, t(r2, s, o2)); + }), e2; + } + var id = Ft2(function(n3, t, e2) { + Ke2(n3, t, e2); + }), ca = Ft2(function(n3, t, e2, r2) { + Ke2(n3, t, e2, r2); + }), sd = Yn(function(n3, t) { + var e2 = {}; + if (n3 == null) + return e2; + var r2 = false; + t = G2(t, function(o2) { + return o2 = st2(o2, n3), r2 || (r2 = o2.length > 1), o2; + }), Un2(n3, pi(n3), e2), r2 && (e2 = An(e2, Ln2 | Fn2 | xt2, jc)); for (var s = t.length; s--; ) - si(e, t[s]); - return e; + si(e2, t[s]); + return e2; }); - function ud(n2, t) { - return ha(n2, ur2(x2(t))); + function ud(n3, t) { + return ha(n3, ur2(x2(t))); } - var ad = Yn(function(n2, t) { - return n2 == null ? {} : Hc(n2, t); + var ad = Yn(function(n3, t) { + return n3 == null ? {} : Hc(n3, t); }); - function ha(n2, t) { - if (n2 == null) + function ha(n3, t) { + if (n3 == null) return {}; - var e = G2(pi(n2), function(r) { - return [r]; + var e2 = G2(pi(n3), function(r2) { + return [r2]; }); - return t = x2(t), eu(n2, e, function(r, s) { - return t(r, s[0]); + return t = x2(t), eu(n3, e2, function(r2, s) { + return t(r2, s[0]); }); } - function od(n2, t, e) { - t = st2(t, n2); - var r = -1, s = t.length; - for (s || (s = 1, n2 = i2); ++r < s; ) { - var o = n2 == null ? i2 : n2[Wn2(t[r])]; - o === i2 && (r = s, o = e), n2 = Jn2(o) ? o.call(n2) : o; + function od(n3, t, e2) { + t = st2(t, n3); + var r2 = -1, s = t.length; + for (s || (s = 1, n3 = i2); ++r2 < s; ) { + var o2 = n3 == null ? i2 : n3[Wn2(t[r2])]; + o2 === i2 && (r2 = s, o2 = e2), n3 = Jn2(o2) ? o2.call(n3) : o2; } - return n2; + return n3; } - function fd(n2, t, e) { - return n2 == null ? n2 : fe(n2, t, e); + function fd(n3, t, e2) { + return n3 == null ? n3 : fe(n3, t, e2); } - function cd(n2, t, e, r) { - return r = typeof r == "function" ? r : i2, n2 == null ? n2 : fe(n2, t, e, r); + function cd(n3, t, e2, r2) { + return r2 = typeof r2 == "function" ? r2 : i2, n3 == null ? n3 : fe(n3, t, e2, r2); } var la = xu(V2), pa = xu(on2); - function hd(n2, t, e) { - var r = O2(n2), s = r || at2(n2) || Bt2(n2); - if (t = x2(t, 4), e == null) { - var o = n2 && n2.constructor; - s ? e = r ? new o() : [] : K2(n2) ? e = Jn2(o) ? Wt2(He2(n2)) : {} : e = {}; + function hd(n3, t, e2) { + var r2 = O2(n3), s = r2 || at2(n3) || Bt2(n3); + if (t = x2(t, 4), e2 == null) { + var o2 = n3 && n3.constructor; + s ? e2 = r2 ? new o2() : [] : K2(n3) ? e2 = Jn2(o2) ? Wt2(He2(n3)) : {} : e2 = {}; } - return (s ? mn2 : $n)(n2, function(f3, c2, l2) { - return t(e, f3, c2, l2); - }), e; + return (s ? mn2 : $n)(n3, function(f4, c2, l2) { + return t(e2, f4, c2, l2); + }), e2; } - function ld(n2, t) { - return n2 == null ? true : si(n2, t); + function ld(n3, t) { + return n3 == null ? true : si(n3, t); } - function pd(n2, t, e) { - return n2 == null ? n2 : au(n2, t, oi(e)); + function pd(n3, t, e2) { + return n3 == null ? n3 : au(n3, t, oi(e2)); } - function dd(n2, t, e, r) { - return r = typeof r == "function" ? r : i2, n2 == null ? n2 : au(n2, t, oi(e), r); + function dd(n3, t, e2, r2) { + return r2 = typeof r2 == "function" ? r2 : i2, n3 == null ? n3 : au(n3, t, oi(e2), r2); } - function Gt2(n2) { - return n2 == null ? [] : Mr2(n2, V2(n2)); + function Gt2(n3) { + return n3 == null ? [] : Mr2(n3, V2(n3)); } - function gd(n2) { - return n2 == null ? [] : Mr2(n2, on2(n2)); + function gd(n3) { + return n3 == null ? [] : Mr2(n3, on2(n3)); } - function vd(n2, t, e) { - return e === i2 && (e = t, t = i2), e !== i2 && (e = xn2(e), e = e === e ? e : 0), t !== i2 && (t = xn2(t), t = t === t ? t : 0), vt2(xn2(n2), t, e); + function vd(n3, t, e2) { + return e2 === i2 && (e2 = t, t = i2), e2 !== i2 && (e2 = xn2(e2), e2 = e2 === e2 ? e2 : 0), t !== i2 && (t = xn2(t), t = t === t ? t : 0), vt2(xn2(n3), t, e2); } - function _d(n2, t, e) { - return t = Xn2(t), e === i2 ? (e = t, t = 0) : e = Xn2(e), n2 = xn2(n2), Ic(n2, t, e); + function _d(n3, t, e2) { + return t = Xn2(t), e2 === i2 ? (e2 = t, t = 0) : e2 = Xn2(e2), n3 = xn2(n3), Ic(n3, t, e2); } - function md(n2, t, e) { - if (e && typeof e != "boolean" && rn2(n2, t, e) && (t = e = i2), e === i2 && (typeof t == "boolean" ? (e = t, t = i2) : typeof n2 == "boolean" && (e = n2, n2 = i2)), n2 === i2 && t === i2 ? (n2 = 0, t = 1) : (n2 = Xn2(n2), t === i2 ? (t = n2, n2 = 0) : t = Xn2(t)), n2 > t) { - var r = n2; - n2 = t, t = r; + function md(n3, t, e2) { + if (e2 && typeof e2 != "boolean" && rn2(n3, t, e2) && (t = e2 = i2), e2 === i2 && (typeof t == "boolean" ? (e2 = t, t = i2) : typeof n3 == "boolean" && (e2 = n3, n3 = i2)), n3 === i2 && t === i2 ? (n3 = 0, t = 1) : (n3 = Xn2(n3), t === i2 ? (t = n3, n3 = 0) : t = Xn2(t)), n3 > t) { + var r2 = n3; + n3 = t, t = r2; } - if (e || n2 % 1 || t % 1) { + if (e2 || n3 % 1 || t % 1) { var s = Us2(); - return nn2(n2 + s * (t - n2 + Xo("1e-" + ((s + "").length - 1))), t); + return nn2(n3 + s * (t - n3 + Xo("1e-" + ((s + "").length - 1))), t); } - return ei(n2, t); + return ei(n3, t); } - var wd = Mt2(function(n2, t, e) { - return t = t.toLowerCase(), n2 + (e ? da(t) : t); + var wd = Mt2(function(n3, t, e2) { + return t = t.toLowerCase(), n3 + (e2 ? da(t) : t); }); - function da(n2) { - return Ri(W2(n2).toLowerCase()); + function da(n3) { + return Ri(W2(n3).toLowerCase()); } - function ga(n2) { - return n2 = W2(n2), n2 && n2.replace(Po, ff).replace(Fo, ""); + function ga(n3) { + return n3 = W2(n3), n3 && n3.replace(Po, ff).replace(Fo, ""); } - function Pd(n2, t, e) { - n2 = W2(n2), t = ln2(t); - var r = n2.length; - e = e === i2 ? r : vt2(R2(e), 0, r); - var s = e; - return e -= t.length, e >= 0 && n2.slice(e, s) == t; + function Pd(n3, t, e2) { + n3 = W2(n3), t = ln2(t); + var r2 = n3.length; + e2 = e2 === i2 ? r2 : vt2(R2(e2), 0, r2); + var s = e2; + return e2 -= t.length, e2 >= 0 && n3.slice(e2, s) == t; } - function Ad(n2) { - return n2 = W2(n2), n2 && ja.test(n2) ? n2.replace(Yi2, cf) : n2; + function Ad(n3) { + return n3 = W2(n3), n3 && ja.test(n3) ? n3.replace(Yi2, cf) : n3; } - function Cd(n2) { - return n2 = W2(n2), n2 && so.test(n2) ? n2.replace(xr2, "\\$&") : n2; + function Cd(n3) { + return n3 = W2(n3), n3 && so.test(n3) ? n3.replace(xr2, "\\$&") : n3; } - var Id = Mt2(function(n2, t, e) { - return n2 + (e ? "-" : "") + t.toLowerCase(); - }), xd = Mt2(function(n2, t, e) { - return n2 + (e ? " " : "") + t.toLowerCase(); + var Id = Mt2(function(n3, t, e2) { + return n3 + (e2 ? "-" : "") + t.toLowerCase(); + }), xd = Mt2(function(n3, t, e2) { + return n3 + (e2 ? " " : "") + t.toLowerCase(); }), Ed = mu("toLowerCase"); - function yd(n2, t, e) { - n2 = W2(n2), t = R2(t); - var r = t ? Dt2(n2) : 0; - if (!t || r >= t) - return n2; - var s = (t - r) / 2; - return Ve2(We2(s), e) + n2 + Ve2(Ue2(s), e); - } - function Sd(n2, t, e) { - n2 = W2(n2), t = R2(t); - var r = t ? Dt2(n2) : 0; - return t && r < t ? n2 + Ve2(t - r, e) : n2; - } - function Od(n2, t, e) { - n2 = W2(n2), t = R2(t); - var r = t ? Dt2(n2) : 0; - return t && r < t ? Ve2(t - r, e) + n2 : n2; - } - function Rd(n2, t, e) { - return e || t == null ? t = 0 : t && (t = +t), $f(W2(n2).replace(Er, ""), t || 0); - } - function bd(n2, t, e) { - return (e ? rn2(n2, t, e) : t === i2) ? t = 1 : t = R2(t), ri(W2(n2), t); + function yd(n3, t, e2) { + n3 = W2(n3), t = R2(t); + var r2 = t ? Dt2(n3) : 0; + if (!t || r2 >= t) + return n3; + var s = (t - r2) / 2; + return Ve2(We2(s), e2) + n3 + Ve2(Ue2(s), e2); + } + function Sd(n3, t, e2) { + n3 = W2(n3), t = R2(t); + var r2 = t ? Dt2(n3) : 0; + return t && r2 < t ? n3 + Ve2(t - r2, e2) : n3; + } + function Od(n3, t, e2) { + n3 = W2(n3), t = R2(t); + var r2 = t ? Dt2(n3) : 0; + return t && r2 < t ? Ve2(t - r2, e2) + n3 : n3; + } + function Rd(n3, t, e2) { + return e2 || t == null ? t = 0 : t && (t = +t), $f(W2(n3).replace(Er, ""), t || 0); + } + function bd(n3, t, e2) { + return (e2 ? rn2(n3, t, e2) : t === i2) ? t = 1 : t = R2(t), ri(W2(n3), t); } function Td() { - var n2 = arguments, t = W2(n2[0]); - return n2.length < 3 ? t : t.replace(n2[1], n2[2]); + var n3 = arguments, t = W2(n3[0]); + return n3.length < 3 ? t : t.replace(n3[1], n3[2]); } - var Ld = Mt2(function(n2, t, e) { - return n2 + (e ? "_" : "") + t.toLowerCase(); + var Ld = Mt2(function(n3, t, e2) { + return n3 + (e2 ? "_" : "") + t.toLowerCase(); }); - function Dd(n2, t, e) { - return e && typeof e != "number" && rn2(n2, t, e) && (t = e = i2), e = e === i2 ? Nn : e >>> 0, e ? (n2 = W2(n2), n2 && (typeof t == "string" || t != null && !yi(t)) && (t = ln2(t), !t && Lt2(n2)) ? ut2(On(n2), 0, e) : n2.split(t, e)) : []; + function Dd(n3, t, e2) { + return e2 && typeof e2 != "number" && rn2(n3, t, e2) && (t = e2 = i2), e2 = e2 === i2 ? Nn : e2 >>> 0, e2 ? (n3 = W2(n3), n3 && (typeof t == "string" || t != null && !yi(t)) && (t = ln2(t), !t && Lt2(n3)) ? ut2(On(n3), 0, e2) : n3.split(t, e2)) : []; } - var Hd = Mt2(function(n2, t, e) { - return n2 + (e ? " " : "") + Ri(t); + var Hd = Mt2(function(n3, t, e2) { + return n3 + (e2 ? " " : "") + Ri(t); }); - function Nd(n2, t, e) { - return n2 = W2(n2), e = e == null ? 0 : vt2(R2(e), 0, n2.length), t = ln2(t), n2.slice(e, e + t.length) == t; + function Nd(n3, t, e2) { + return n3 = W2(n3), e2 = e2 == null ? 0 : vt2(R2(e2), 0, n3.length), t = ln2(t), n3.slice(e2, e2 + t.length) == t; } - function $d(n2, t, e) { - var r = a3.templateSettings; - e && rn2(n2, t, e) && (t = i2), n2 = W2(n2), t = fr({}, t, r, Eu); - var s = fr({}, t.imports, r.imports, Eu), o = V2(s), f3 = Mr2(s, o), c2, l2, v3 = 0, _3 = t.interpolate || Ce2, m2 = "__p += '", P2 = Br((t.escape || Ce2).source + "|" + _3.source + "|" + (_3 === Zi2 ? po : Ce2).source + "|" + (t.evaluate || Ce2).source + "|$", "g"), I2 = "//# sourceURL=" + (F2.call(t, "sourceURL") ? (t.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++zo + "]") + ` + function $d(n3, t, e2) { + var r2 = a3.templateSettings; + e2 && rn2(n3, t, e2) && (t = i2), n3 = W2(n3), t = fr({}, t, r2, Eu); + var s = fr({}, t.imports, r2.imports, Eu), o2 = V2(s), f4 = Mr2(s, o2), c2, l2, v3 = 0, _3 = t.interpolate || Ce2, m2 = "__p += '", P2 = Br((t.escape || Ce2).source + "|" + _3.source + "|" + (_3 === Zi2 ? po : Ce2).source + "|" + (t.evaluate || Ce2).source + "|$", "g"), I2 = "//# sourceURL=" + (F2.call(t, "sourceURL") ? (t.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++zo + "]") + ` `; - n2.replace(P2, function(y3, H2, $2, dn2, sn2, gn2) { - return $2 || ($2 = dn2), m2 += n2.slice(v3, gn2).replace(Ao, hf), H2 && (c2 = true, m2 += `' + + n3.replace(P2, function(y3, H2, $2, dn2, sn2, gn2) { + return $2 || ($2 = dn2), m2 += n3.slice(v3, gn2).replace(Ao, hf), H2 && (c2 = true, m2 += `' + __e(` + H2 + `) + '`), sn2 && (l2 = true, m2 += `'; ` + sn2 + `; @@ -14528,175 +14496,175 @@ function print() { __p += __j.call(arguments, '') } `) + m2 + `return __p }`; var b3 = _a(function() { - return U2(o, I2 + "return " + m2).apply(i2, f3); + return U2(o2, I2 + "return " + m2).apply(i2, f4); }); if (b3.source = m2, Ei(b3)) throw b3; return b3; } - function Ud(n2) { - return W2(n2).toLowerCase(); - } - function Wd(n2) { - return W2(n2).toUpperCase(); - } - function Fd(n2, t, e) { - if (n2 = W2(n2), n2 && (e || t === i2)) - return ys2(n2); - if (!n2 || !(t = ln2(t))) - return n2; - var r = On(n2), s = On(t), o = Ss2(r, s), f3 = Os2(r, s) + 1; - return ut2(r, o, f3).join(""); - } - function Md(n2, t, e) { - if (n2 = W2(n2), n2 && (e || t === i2)) - return n2.slice(0, bs2(n2) + 1); - if (!n2 || !(t = ln2(t))) - return n2; - var r = On(n2), s = Os2(r, On(t)) + 1; - return ut2(r, 0, s).join(""); - } - function qd(n2, t, e) { - if (n2 = W2(n2), n2 && (e || t === i2)) - return n2.replace(Er, ""); - if (!n2 || !(t = ln2(t))) - return n2; - var r = On(n2), s = Ss2(r, On(t)); - return ut2(r, s).join(""); - } - function Bd(n2, t) { - var e = Da, r = Ha; + function Ud(n3) { + return W2(n3).toLowerCase(); + } + function Wd(n3) { + return W2(n3).toUpperCase(); + } + function Fd(n3, t, e2) { + if (n3 = W2(n3), n3 && (e2 || t === i2)) + return ys2(n3); + if (!n3 || !(t = ln2(t))) + return n3; + var r2 = On(n3), s = On(t), o2 = Ss2(r2, s), f4 = Os2(r2, s) + 1; + return ut2(r2, o2, f4).join(""); + } + function Md(n3, t, e2) { + if (n3 = W2(n3), n3 && (e2 || t === i2)) + return n3.slice(0, bs2(n3) + 1); + if (!n3 || !(t = ln2(t))) + return n3; + var r2 = On(n3), s = Os2(r2, On(t)) + 1; + return ut2(r2, 0, s).join(""); + } + function qd(n3, t, e2) { + if (n3 = W2(n3), n3 && (e2 || t === i2)) + return n3.replace(Er, ""); + if (!n3 || !(t = ln2(t))) + return n3; + var r2 = On(n3), s = Ss2(r2, On(t)); + return ut2(r2, s).join(""); + } + function Bd(n3, t) { + var e2 = Da, r2 = Ha; if (K2(t)) { var s = "separator" in t ? t.separator : s; - e = "length" in t ? R2(t.length) : e, r = "omission" in t ? ln2(t.omission) : r; + e2 = "length" in t ? R2(t.length) : e2, r2 = "omission" in t ? ln2(t.omission) : r2; } - n2 = W2(n2); - var o = n2.length; - if (Lt2(n2)) { - var f3 = On(n2); - o = f3.length; + n3 = W2(n3); + var o2 = n3.length; + if (Lt2(n3)) { + var f4 = On(n3); + o2 = f4.length; } - if (e >= o) - return n2; - var c2 = e - Dt2(r); + if (e2 >= o2) + return n3; + var c2 = e2 - Dt2(r2); if (c2 < 1) - return r; - var l2 = f3 ? ut2(f3, 0, c2).join("") : n2.slice(0, c2); + return r2; + var l2 = f4 ? ut2(f4, 0, c2).join("") : n3.slice(0, c2); if (s === i2) - return l2 + r; - if (f3 && (c2 += l2.length - c2), yi(s)) { - if (n2.slice(c2).search(s)) { + return l2 + r2; + if (f4 && (c2 += l2.length - c2), yi(s)) { + if (n3.slice(c2).search(s)) { var v3, _3 = l2; for (s.global || (s = Br(s.source, W2(Ji2.exec(s)) + "g")), s.lastIndex = 0; v3 = s.exec(_3); ) var m2 = v3.index; l2 = l2.slice(0, m2 === i2 ? c2 : m2); } - } else if (n2.indexOf(ln2(s), c2) != c2) { + } else if (n3.indexOf(ln2(s), c2) != c2) { var P2 = l2.lastIndexOf(s); P2 > -1 && (l2 = l2.slice(0, P2)); } - return l2 + r; + return l2 + r2; } - function Gd(n2) { - return n2 = W2(n2), n2 && ka.test(n2) ? n2.replace(Ki, mf) : n2; + function Gd(n3) { + return n3 = W2(n3), n3 && ka.test(n3) ? n3.replace(Ki, mf) : n3; } - var zd = Mt2(function(n2, t, e) { - return n2 + (e ? " " : "") + t.toUpperCase(); + var zd = Mt2(function(n3, t, e2) { + return n3 + (e2 ? " " : "") + t.toUpperCase(); }), Ri = mu("toUpperCase"); - function va(n2, t, e) { - return n2 = W2(n2), t = e ? i2 : t, t === i2 ? pf(n2) ? Af(n2) : rf(n2) : n2.match(t) || []; + function va(n3, t, e2) { + return n3 = W2(n3), t = e2 ? i2 : t, t === i2 ? pf(n3) ? Af(n3) : rf(n3) : n3.match(t) || []; } - var _a = T2(function(n2, t) { + var _a = T2(function(n3, t) { try { - return cn2(n2, i2, t); - } catch (e) { - return Ei(e) ? e : new S2(e); - } - }), Kd = Yn(function(n2, t) { - return mn2(t, function(e) { - e = Wn2(e), zn(n2, e, Ii(n2[e], n2)); - }), n2; + return cn2(n3, i2, t); + } catch (e2) { + return Ei(e2) ? e2 : new S2(e2); + } + }), Kd = Yn(function(n3, t) { + return mn2(t, function(e2) { + e2 = Wn2(e2), zn(n3, e2, Ii(n3[e2], n3)); + }), n3; }); - function Yd(n2) { - var t = n2 == null ? 0 : n2.length, e = x2(); - return n2 = t ? G2(n2, function(r) { - if (typeof r[1] != "function") + function Yd(n3) { + var t = n3 == null ? 0 : n3.length, e2 = x2(); + return n3 = t ? G2(n3, function(r2) { + if (typeof r2[1] != "function") throw new wn(D2); - return [e(r[0]), r[1]]; - }) : [], T2(function(r) { + return [e2(r2[0]), r2[1]]; + }) : [], T2(function(r2) { for (var s = -1; ++s < t; ) { - var o = n2[s]; - if (cn2(o[0], this, r)) - return cn2(o[1], this, r); + var o2 = n3[s]; + if (cn2(o2[0], this, r2)) + return cn2(o2[1], this, r2); } }); } - function Zd(n2) { - return mc(An(n2, Ln2)); + function Zd(n3) { + return mc(An(n3, Ln2)); } - function bi(n2) { + function bi(n3) { return function() { - return n2; + return n3; }; } - function Jd(n2, t) { - return n2 == null || n2 !== n2 ? t : n2; + function Jd(n3, t) { + return n3 == null || n3 !== n3 ? t : n3; } var Xd = Pu(), Qd = Pu(true); - function fn2(n2) { - return n2; + function fn2(n3) { + return n3; } - function Ti(n2) { - return Qs2(typeof n2 == "function" ? n2 : An(n2, Ln2)); + function Ti(n3) { + return Qs2(typeof n3 == "function" ? n3 : An(n3, Ln2)); } - function Vd(n2) { - return ks2(An(n2, Ln2)); + function Vd(n3) { + return ks2(An(n3, Ln2)); } - function kd(n2, t) { - return js2(n2, An(t, Ln2)); + function kd(n3, t) { + return js2(n3, An(t, Ln2)); } - var jd = T2(function(n2, t) { - return function(e) { - return ae2(e, n2, t); + var jd = T2(function(n3, t) { + return function(e2) { + return ae2(e2, n3, t); }; - }), ng = T2(function(n2, t) { - return function(e) { - return ae2(n2, e, t); + }), ng = T2(function(n3, t) { + return function(e2) { + return ae2(n3, e2, t); }; }); - function Li(n2, t, e) { - var r = V2(t), s = ze2(t, r); - e == null && !(K2(t) && (s.length || !r.length)) && (e = t, t = n2, n2 = this, s = ze2(t, V2(t))); - var o = !(K2(e) && "chain" in e) || !!e.chain, f3 = Jn2(n2); + function Li(n3, t, e2) { + var r2 = V2(t), s = ze2(t, r2); + e2 == null && !(K2(t) && (s.length || !r2.length)) && (e2 = t, t = n3, n3 = this, s = ze2(t, V2(t))); + var o2 = !(K2(e2) && "chain" in e2) || !!e2.chain, f4 = Jn2(n3); return mn2(s, function(c2) { var l2 = t[c2]; - n2[c2] = l2, f3 && (n2.prototype[c2] = function() { + n3[c2] = l2, f4 && (n3.prototype[c2] = function() { var v3 = this.__chain__; - if (o || v3) { - var _3 = n2(this.__wrapped__), m2 = _3.__actions__ = un2(this.__actions__); - return m2.push({ func: l2, args: arguments, thisArg: n2 }), _3.__chain__ = v3, _3; + if (o2 || v3) { + var _3 = n3(this.__wrapped__), m2 = _3.__actions__ = un2(this.__actions__); + return m2.push({ func: l2, args: arguments, thisArg: n3 }), _3.__chain__ = v3, _3; } - return l2.apply(n2, nt2([this.value()], arguments)); + return l2.apply(n3, nt2([this.value()], arguments)); }); - }), n2; + }), n3; } function tg() { return k2._ === this && (k2._ = Sf), this; } function Di() { } - function eg(n2) { - return n2 = R2(n2), T2(function(t) { - return nu(t, n2); + function eg(n3) { + return n3 = R2(n3), T2(function(t) { + return nu(t, n3); }); } var rg = ci(G2), ig = ci(As2), sg = ci(Nr2); - function ma(n2) { - return _i(n2) ? $r2(Wn2(n2)) : Nc(n2); + function ma(n3) { + return _i(n3) ? $r2(Wn2(n3)) : Nc(n3); } - function ug(n2) { + function ug(n3) { return function(t) { - return n2 == null ? i2 : _t2(n2, t); + return n3 == null ? i2 : _t2(n3, t); }; } var ag = Cu(), og = Cu(true); @@ -14715,140 +14683,140 @@ function print() { __p += __j.call(arguments, '') } function hg() { return true; } - function lg(n2, t) { - if (n2 = R2(n2), n2 < 1 || n2 > kn2) + function lg(n3, t) { + if (n3 = R2(n3), n3 < 1 || n3 > kn2) return []; - var e = Nn, r = nn2(n2, Nn); - t = x2(t), n2 -= Nn; - for (var s = Fr2(r, t); ++e < n2; ) - t(e); + var e2 = Nn, r2 = nn2(n3, Nn); + t = x2(t), n3 -= Nn; + for (var s = Fr2(r2, t); ++e2 < n3; ) + t(e2); return s; } - function pg(n2) { - return O2(n2) ? G2(n2, Wn2) : pn2(n2) ? [n2] : un2(Wu(W2(n2))); + function pg(n3) { + return O2(n3) ? G2(n3, Wn2) : pn2(n3) ? [n3] : un2(Wu(W2(n3))); } - function dg(n2) { + function dg(n3) { var t = ++Ef; - return W2(n2) + t; + return W2(n3) + t; } - var gg = Qe2(function(n2, t) { - return n2 + t; - }, 0), vg = hi("ceil"), _g = Qe2(function(n2, t) { - return n2 / t; + var gg = Qe2(function(n3, t) { + return n3 + t; + }, 0), vg = hi("ceil"), _g = Qe2(function(n3, t) { + return n3 / t; }, 1), mg = hi("floor"); - function wg(n2) { - return n2 && n2.length ? Ge2(n2, fn2, Qr) : i2; + function wg(n3) { + return n3 && n3.length ? Ge2(n3, fn2, Qr) : i2; } - function Pg(n2, t) { - return n2 && n2.length ? Ge2(n2, x2(t, 2), Qr) : i2; + function Pg(n3, t) { + return n3 && n3.length ? Ge2(n3, x2(t, 2), Qr) : i2; } - function Ag(n2) { - return xs2(n2, fn2); + function Ag(n3) { + return xs2(n3, fn2); } - function Cg(n2, t) { - return xs2(n2, x2(t, 2)); + function Cg(n3, t) { + return xs2(n3, x2(t, 2)); } - function Ig(n2) { - return n2 && n2.length ? Ge2(n2, fn2, ni) : i2; + function Ig(n3) { + return n3 && n3.length ? Ge2(n3, fn2, ni) : i2; } - function xg(n2, t) { - return n2 && n2.length ? Ge2(n2, x2(t, 2), ni) : i2; + function xg(n3, t) { + return n3 && n3.length ? Ge2(n3, x2(t, 2), ni) : i2; } - var Eg = Qe2(function(n2, t) { - return n2 * t; - }, 1), yg = hi("round"), Sg = Qe2(function(n2, t) { - return n2 - t; + var Eg = Qe2(function(n3, t) { + return n3 * t; + }, 1), yg = hi("round"), Sg = Qe2(function(n3, t) { + return n3 - t; }, 0); - function Og(n2) { - return n2 && n2.length ? Wr(n2, fn2) : 0; + function Og(n3) { + return n3 && n3.length ? Wr(n3, fn2) : 0; } - function Rg(n2, t) { - return n2 && n2.length ? Wr(n2, x2(t, 2)) : 0; + function Rg(n3, t) { + return n3 && n3.length ? Wr(n3, x2(t, 2)) : 0; } return a3.after = Vl, a3.ary = Xu, a3.assign = Wp, a3.assignIn = fa, a3.assignInWith = fr, a3.assignWith = Fp, a3.at = Mp, a3.before = Qu, a3.bind = Ii, a3.bindAll = Kd, a3.bindKey = Vu, a3.castArray = fp, a3.chain = Yu, a3.chunk = mh, a3.compact = wh, a3.concat = Ph, a3.cond = Yd, a3.conforms = Zd, a3.constant = bi, a3.countBy = Ol, a3.create = qp, a3.curry = ku, a3.curryRight = ju, a3.debounce = na, a3.defaults = Bp, a3.defaultsDeep = Gp, a3.defer = kl, a3.delay = jl, a3.difference = Ah, a3.differenceBy = Ch, a3.differenceWith = Ih, a3.drop = xh, a3.dropRight = Eh, a3.dropRightWhile = yh, a3.dropWhile = Sh, a3.fill = Oh, a3.filter = bl, a3.flatMap = Dl, a3.flatMapDeep = Hl, a3.flatMapDepth = Nl, a3.flatten = Bu, a3.flattenDeep = Rh, a3.flattenDepth = bh, a3.flip = np, a3.flow = Xd, a3.flowRight = Qd, a3.fromPairs = Th, a3.functions = Qp, a3.functionsIn = Vp, a3.groupBy = $l, a3.initial = Dh, a3.intersection = Hh, a3.intersectionBy = Nh, a3.intersectionWith = $h, a3.invert = jp, a3.invertBy = nd, a3.invokeMap = Wl, a3.iteratee = Ti, a3.keyBy = Fl, a3.keys = V2, a3.keysIn = on2, a3.map = rr2, a3.mapKeys = ed, a3.mapValues = rd, a3.matches = Vd, a3.matchesProperty = kd, a3.memoize = sr3, a3.merge = id, a3.mergeWith = ca, a3.method = jd, a3.methodOf = ng, a3.mixin = Li, a3.negate = ur2, a3.nthArg = eg, a3.omit = sd, a3.omitBy = ud, a3.once = tp, a3.orderBy = Ml, a3.over = rg, a3.overArgs = ep, a3.overEvery = ig, a3.overSome = sg, a3.partial = xi, a3.partialRight = ta, a3.partition = ql, a3.pick = ad, a3.pickBy = ha, a3.property = ma, a3.propertyOf = ug, a3.pull = Mh, a3.pullAll = zu, a3.pullAllBy = qh, a3.pullAllWith = Bh, a3.pullAt = Gh, a3.range = ag, a3.rangeRight = og, a3.rearg = rp, a3.reject = zl, a3.remove = zh, a3.rest = ip, a3.reverse = Ai, a3.sampleSize = Yl, a3.set = fd, a3.setWith = cd, a3.shuffle = Zl, a3.slice = Kh, a3.sortBy = Ql, a3.sortedUniq = kh, a3.sortedUniqBy = jh, a3.split = Dd, a3.spread = sp, a3.tail = nl, a3.take = tl, a3.takeRight = el, a3.takeRightWhile = rl, a3.takeWhile = il, a3.tap = wl, a3.throttle = up, a3.thru = er2, a3.toArray = ua, a3.toPairs = la, a3.toPairsIn = pa, a3.toPath = pg, a3.toPlainObject = oa, a3.transform = hd, a3.unary = ap, a3.union = sl, a3.unionBy = ul, a3.unionWith = al, a3.uniq = ol, a3.uniqBy = fl, a3.uniqWith = cl, a3.unset = ld, a3.unzip = Ci, a3.unzipWith = Ku, a3.update = pd, a3.updateWith = dd, a3.values = Gt2, a3.valuesIn = gd, a3.without = hl, a3.words = va, a3.wrap = op, a3.xor = ll, a3.xorBy = pl, a3.xorWith = dl, a3.zip = gl, a3.zipObject = vl, a3.zipObjectDeep = _l, a3.zipWith = ml, a3.entries = la, a3.entriesIn = pa, a3.extend = fa, a3.extendWith = fr, Li(a3, a3), a3.add = gg, a3.attempt = _a, a3.camelCase = wd, a3.capitalize = da, a3.ceil = vg, a3.clamp = vd, a3.clone = cp, a3.cloneDeep = lp, a3.cloneDeepWith = pp, a3.cloneWith = hp, a3.conformsTo = dp, a3.deburr = ga, a3.defaultTo = Jd, a3.divide = _g, a3.endsWith = Pd, a3.eq = bn, a3.escape = Ad, a3.escapeRegExp = Cd, a3.every = Rl, a3.find = Tl, a3.findIndex = Mu, a3.findKey = zp, a3.findLast = Ll, a3.findLastIndex = qu, a3.findLastKey = Kp, a3.floor = mg, a3.forEach = Zu, a3.forEachRight = Ju, a3.forIn = Yp, a3.forInRight = Zp, a3.forOwn = Jp, a3.forOwnRight = Xp, a3.get = Si, a3.gt = gp, a3.gte = vp, a3.has = kp, a3.hasIn = Oi, a3.head = Gu, a3.identity = fn2, a3.includes = Ul, a3.indexOf = Lh, a3.inRange = _d, a3.invoke = td, a3.isArguments = Pt2, a3.isArray = O2, a3.isArrayBuffer = _p, a3.isArrayLike = an2, a3.isArrayLikeObject = Z2, a3.isBoolean = mp, a3.isBuffer = at2, a3.isDate = wp, a3.isElement = Pp, a3.isEmpty = Ap, a3.isEqual = Cp, a3.isEqualWith = Ip, a3.isError = Ei, a3.isFinite = xp, a3.isFunction = Jn2, a3.isInteger = ea, a3.isLength = ar2, a3.isMap = ra, a3.isMatch = Ep, a3.isMatchWith = yp, a3.isNaN = Sp, a3.isNative = Op, a3.isNil = bp, a3.isNull = Rp, a3.isNumber = ia, a3.isObject = K2, a3.isObjectLike = Y, a3.isPlainObject = pe2, a3.isRegExp = yi, a3.isSafeInteger = Tp, a3.isSet = sa, a3.isString = or2, a3.isSymbol = pn2, a3.isTypedArray = Bt2, a3.isUndefined = Lp, a3.isWeakMap = Dp, a3.isWeakSet = Hp, a3.join = Uh, a3.kebabCase = Id, a3.last = In, a3.lastIndexOf = Wh, a3.lowerCase = xd, a3.lowerFirst = Ed, a3.lt = Np, a3.lte = $p, a3.max = wg, a3.maxBy = Pg, a3.mean = Ag, a3.meanBy = Cg, a3.min = Ig, a3.minBy = xg, a3.stubArray = Hi2, a3.stubFalse = Ni, a3.stubObject = fg, a3.stubString = cg, a3.stubTrue = hg, a3.multiply = Eg, a3.nth = Fh, a3.noConflict = tg, a3.noop = Di, a3.now = ir2, a3.pad = yd, a3.padEnd = Sd, a3.padStart = Od, a3.parseInt = Rd, a3.random = md, a3.reduce = Bl, a3.reduceRight = Gl, a3.repeat = bd, a3.replace = Td, a3.result = od, a3.round = yg, a3.runInContext = h4, a3.sample = Kl, a3.size = Jl, a3.snakeCase = Ld, a3.some = Xl, a3.sortedIndex = Yh, a3.sortedIndexBy = Zh, a3.sortedIndexOf = Jh, a3.sortedLastIndex = Xh, a3.sortedLastIndexBy = Qh, a3.sortedLastIndexOf = Vh, a3.startCase = Hd, a3.startsWith = Nd, a3.subtract = Sg, a3.sum = Og, a3.sumBy = Rg, a3.template = $d, a3.times = lg, a3.toFinite = Xn2, a3.toInteger = R2, a3.toLength = aa, a3.toLower = Ud, a3.toNumber = xn2, a3.toSafeInteger = Up, a3.toString = W2, a3.toUpper = Wd, a3.trim = Fd, a3.trimEnd = Md, a3.trimStart = qd, a3.truncate = Bd, a3.unescape = Gd, a3.uniqueId = dg, a3.upperCase = zd, a3.upperFirst = Ri, a3.each = Zu, a3.eachRight = Ju, a3.first = Gu, Li(a3, function() { - var n2 = {}; - return $n(a3, function(t, e) { - F2.call(a3.prototype, e) || (n2[e] = t); - }), n2; - }(), { chain: false }), a3.VERSION = d2, mn2(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(n2) { - a3[n2].placeholder = a3; - }), mn2(["drop", "take"], function(n2, t) { - N2.prototype[n2] = function(e) { - e = e === i2 ? 1 : Q3(R2(e), 0); - var r = this.__filtered__ && !t ? new N2(this) : this.clone(); - return r.__filtered__ ? r.__takeCount__ = nn2(e, r.__takeCount__) : r.__views__.push({ size: nn2(e, Nn), type: n2 + (r.__dir__ < 0 ? "Right" : "") }), r; - }, N2.prototype[n2 + "Right"] = function(e) { - return this.reverse()[n2](e).reverse(); + var n3 = {}; + return $n(a3, function(t, e2) { + F2.call(a3.prototype, e2) || (n3[e2] = t); + }), n3; + }(), { chain: false }), a3.VERSION = d3, mn2(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(n3) { + a3[n3].placeholder = a3; + }), mn2(["drop", "take"], function(n3, t) { + N2.prototype[n3] = function(e2) { + e2 = e2 === i2 ? 1 : Q3(R2(e2), 0); + var r2 = this.__filtered__ && !t ? new N2(this) : this.clone(); + return r2.__filtered__ ? r2.__takeCount__ = nn2(e2, r2.__takeCount__) : r2.__views__.push({ size: nn2(e2, Nn), type: n3 + (r2.__dir__ < 0 ? "Right" : "") }), r2; + }, N2.prototype[n3 + "Right"] = function(e2) { + return this.reverse()[n3](e2).reverse(); }; - }), mn2(["filter", "map", "takeWhile"], function(n2, t) { - var e = t + 1, r = e == Bi || e == Wa; - N2.prototype[n2] = function(s) { - var o = this.clone(); - return o.__iteratees__.push({ iteratee: x2(s, 3), type: e }), o.__filtered__ = o.__filtered__ || r, o; + }), mn2(["filter", "map", "takeWhile"], function(n3, t) { + var e2 = t + 1, r2 = e2 == Bi || e2 == Wa; + N2.prototype[n3] = function(s) { + var o2 = this.clone(); + return o2.__iteratees__.push({ iteratee: x2(s, 3), type: e2 }), o2.__filtered__ = o2.__filtered__ || r2, o2; }; - }), mn2(["head", "last"], function(n2, t) { - var e = "take" + (t ? "Right" : ""); - N2.prototype[n2] = function() { - return this[e](1).value()[0]; + }), mn2(["head", "last"], function(n3, t) { + var e2 = "take" + (t ? "Right" : ""); + N2.prototype[n3] = function() { + return this[e2](1).value()[0]; }; - }), mn2(["initial", "tail"], function(n2, t) { - var e = "drop" + (t ? "" : "Right"); - N2.prototype[n2] = function() { - return this.__filtered__ ? new N2(this) : this[e](1); + }), mn2(["initial", "tail"], function(n3, t) { + var e2 = "drop" + (t ? "" : "Right"); + N2.prototype[n3] = function() { + return this.__filtered__ ? new N2(this) : this[e2](1); }; }), N2.prototype.compact = function() { return this.filter(fn2); - }, N2.prototype.find = function(n2) { - return this.filter(n2).head(); - }, N2.prototype.findLast = function(n2) { - return this.reverse().find(n2); - }, N2.prototype.invokeMap = T2(function(n2, t) { - return typeof n2 == "function" ? new N2(this) : this.map(function(e) { - return ae2(e, n2, t); + }, N2.prototype.find = function(n3) { + return this.filter(n3).head(); + }, N2.prototype.findLast = function(n3) { + return this.reverse().find(n3); + }, N2.prototype.invokeMap = T2(function(n3, t) { + return typeof n3 == "function" ? new N2(this) : this.map(function(e2) { + return ae2(e2, n3, t); }); - }), N2.prototype.reject = function(n2) { - return this.filter(ur2(x2(n2))); - }, N2.prototype.slice = function(n2, t) { - n2 = R2(n2); - var e = this; - return e.__filtered__ && (n2 > 0 || t < 0) ? new N2(e) : (n2 < 0 ? e = e.takeRight(-n2) : n2 && (e = e.drop(n2)), t !== i2 && (t = R2(t), e = t < 0 ? e.dropRight(-t) : e.take(t - n2)), e); - }, N2.prototype.takeRightWhile = function(n2) { - return this.reverse().takeWhile(n2).reverse(); + }), N2.prototype.reject = function(n3) { + return this.filter(ur2(x2(n3))); + }, N2.prototype.slice = function(n3, t) { + n3 = R2(n3); + var e2 = this; + return e2.__filtered__ && (n3 > 0 || t < 0) ? new N2(e2) : (n3 < 0 ? e2 = e2.takeRight(-n3) : n3 && (e2 = e2.drop(n3)), t !== i2 && (t = R2(t), e2 = t < 0 ? e2.dropRight(-t) : e2.take(t - n3)), e2); + }, N2.prototype.takeRightWhile = function(n3) { + return this.reverse().takeWhile(n3).reverse(); }, N2.prototype.toArray = function() { return this.take(Nn); - }, $n(N2.prototype, function(n2, t) { - var e = /^(?:filter|find|map|reject)|While$/.test(t), r = /^(?:head|last)$/.test(t), s = a3[r ? "take" + (t == "last" ? "Right" : "") : t], o = r || /^find/.test(t); + }, $n(N2.prototype, function(n3, t) { + var e2 = /^(?:filter|find|map|reject)|While$/.test(t), r2 = /^(?:head|last)$/.test(t), s = a3[r2 ? "take" + (t == "last" ? "Right" : "") : t], o2 = r2 || /^find/.test(t); s && (a3.prototype[t] = function() { - var f3 = this.__wrapped__, c2 = r ? [1] : arguments, l2 = f3 instanceof N2, v3 = c2[0], _3 = l2 || O2(f3), m2 = function(H2) { + var f4 = this.__wrapped__, c2 = r2 ? [1] : arguments, l2 = f4 instanceof N2, v3 = c2[0], _3 = l2 || O2(f4), m2 = function(H2) { var $2 = s.apply(a3, nt2([H2], c2)); - return r && P2 ? $2[0] : $2; + return r2 && P2 ? $2[0] : $2; }; - _3 && e && typeof v3 == "function" && v3.length != 1 && (l2 = _3 = false); - var P2 = this.__chain__, I2 = !!this.__actions__.length, E3 = o && !P2, b3 = l2 && !I2; - if (!o && _3) { - f3 = b3 ? f3 : new N2(this); - var y3 = n2.apply(f3, c2); + _3 && e2 && typeof v3 == "function" && v3.length != 1 && (l2 = _3 = false); + var P2 = this.__chain__, I2 = !!this.__actions__.length, E3 = o2 && !P2, b3 = l2 && !I2; + if (!o2 && _3) { + f4 = b3 ? f4 : new N2(this); + var y3 = n3.apply(f4, c2); return y3.__actions__.push({ func: er2, args: [m2], thisArg: i2 }), new Pn(y3, P2); } - return E3 && b3 ? n2.apply(this, c2) : (y3 = this.thru(m2), E3 ? r ? y3.value()[0] : y3.value() : y3); + return E3 && b3 ? n3.apply(this, c2) : (y3 = this.thru(m2), E3 ? r2 ? y3.value()[0] : y3.value() : y3); }); - }), mn2(["pop", "push", "shift", "sort", "splice", "unshift"], function(n2) { - var t = Oe[n2], e = /^(?:push|sort|unshift)$/.test(n2) ? "tap" : "thru", r = /^(?:pop|shift)$/.test(n2); - a3.prototype[n2] = function() { + }), mn2(["pop", "push", "shift", "sort", "splice", "unshift"], function(n3) { + var t = Oe[n3], e2 = /^(?:push|sort|unshift)$/.test(n3) ? "tap" : "thru", r2 = /^(?:pop|shift)$/.test(n3); + a3.prototype[n3] = function() { var s = arguments; - if (r && !this.__chain__) { - var o = this.value(); - return t.apply(O2(o) ? o : [], s); + if (r2 && !this.__chain__) { + var o2 = this.value(); + return t.apply(O2(o2) ? o2 : [], s); } - return this[e](function(f3) { - return t.apply(O2(f3) ? f3 : [], s); + return this[e2](function(f4) { + return t.apply(O2(f4) ? f4 : [], s); }); }; - }), $n(N2.prototype, function(n2, t) { - var e = a3[t]; - if (e) { - var r = e.name + ""; - F2.call(Ut2, r) || (Ut2[r] = []), Ut2[r].push({ name: t, func: e }); + }), $n(N2.prototype, function(n3, t) { + var e2 = a3[t]; + if (e2) { + var r2 = e2.name + ""; + F2.call(Ut2, r2) || (Ut2[r2] = []), Ut2[r2].push({ name: t, func: e2 }); } }), Ut2[Xe2(i2, ct2).name] = [{ name: "wrapper", func: i2 }], N2.prototype.clone = Gf, N2.prototype.reverse = zf, N2.prototype.value = Kf, a3.prototype.at = Pl, a3.prototype.chain = Al, a3.prototype.commit = Cl, a3.prototype.next = Il, a3.prototype.plant = El, a3.prototype.reverse = yl, a3.prototype.toJSON = a3.prototype.valueOf = a3.prototype.value = Sl, a3.prototype.first = a3.prototype.head, ne && (a3.prototype[ne] = xl), a3; }, Ht2 = Cf(); @@ -14864,9 +14832,9 @@ var Gg = Object.defineProperty, zg = Object.defineProperties, Kg = Object.getOwn return A2; }, Jg = (A2, u3) => zg(A2, Kg(u3)); function ft(A2, u3, i2) { - var d2; + var d3; const w3 = ve(A2); - return ((d2 = u3.rpcMap) == null ? void 0 : d2[w3.reference]) || `${Bg}?chainId=${w3.namespace}:${w3.reference}&projectId=${i2}`; + return ((d3 = u3.rpcMap) == null ? void 0 : d3[w3.reference]) || `${Bg}?chainId=${w3.namespace}:${w3.reference}&projectId=${i2}`; } function Ct(A2) { return A2.includes(":") ? A2.split(":")[1] : A2; @@ -14878,24 +14846,24 @@ function Xg(A2, u3) { const i2 = Object.keys(u3.namespaces).filter((w3) => w3.includes(A2)); if (!i2.length) return []; - const d2 = []; + const d3 = []; return i2.forEach((w3) => { const L2 = u3.namespaces[w3].accounts; - d2.push(...L2); - }), d2; + d3.push(...L2); + }), d3; } function Oa(A2 = {}, u3 = {}) { - const i2 = Ra(A2), d2 = Ra(u3); - return Ui.exports.merge(i2, d2); + const i2 = Ra(A2), d3 = Ra(u3); + return Ui.exports.merge(i2, d3); } function Ra(A2) { - var u3, i2, d2, w3; + var u3, i2, d3, w3; const L2 = {}; if (!B$1(A2)) return L2; for (const [D2, En] of Object.entries(A2)) { const zt2 = oe$1(D2) ? [D2] : En.chains, pr2 = En.methods || [], It2 = En.events || [], Ln2 = En.rpcMap || {}, Fn2 = en(D2); - L2[Fn2] = Jg(cr(cr({}, L2[Fn2]), En), { chains: S$3(zt2, (u3 = L2[Fn2]) == null ? void 0 : u3.chains), methods: S$3(pr2, (i2 = L2[Fn2]) == null ? void 0 : i2.methods), events: S$3(It2, (d2 = L2[Fn2]) == null ? void 0 : d2.events), rpcMap: cr(cr({}, Ln2), (w3 = L2[Fn2]) == null ? void 0 : w3.rpcMap) }); + L2[Fn2] = Jg(cr(cr({}, L2[Fn2]), En), { chains: S$3(zt2, (u3 = L2[Fn2]) == null ? void 0 : u3.chains), methods: S$3(pr2, (i2 = L2[Fn2]) == null ? void 0 : i2.methods), events: S$3(It2, (d3 = L2[Fn2]) == null ? void 0 : d3.events), rpcMap: cr(cr({}, Ln2), (w3 = L2[Fn2]) == null ? void 0 : w3.rpcMap) }); } return L2; } @@ -14904,8 +14872,8 @@ function Qg(A2) { } function Vg(A2) { const u3 = {}; - for (const [i2, d2] of Object.entries(A2)) { - const w3 = d2.methods || [], L2 = d2.events || [], D2 = d2.accounts || [], En = oe$1(i2) ? [i2] : d2.chains ? d2.chains : Sa(d2.accounts); + for (const [i2, d3] of Object.entries(A2)) { + const w3 = d3.methods || [], L2 = d3.events || [], D2 = d3.accounts || [], En = oe$1(i2) ? [i2] : d3.chains ? d3.chains : Sa(d3.accounts); u3[i2] = { chains: En, methods: w3, events: L2, accounts: D2 }; } return u3; @@ -14949,9 +14917,9 @@ class kg { createHttpProviders() { const u3 = {}; return this.namespace.chains.forEach((i2) => { - var d2; + var d3; const w3 = Ct(i2); - u3[w3] = this.createHttpProvider(w3, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); + u3[w3] = this.createHttpProvider(w3, (d3 = this.namespace.rpcMap) == null ? void 0 : d3[i2]); }), u3; } getHttpProvider() { @@ -14961,14 +14929,14 @@ class kg { return i2; } setHttpProvider(u3, i2) { - const d2 = this.createHttpProvider(u3, i2); - d2 && (this.httpProviders[u3] = d2); + const d3 = this.createHttpProvider(u3, i2); + d3 && (this.httpProviders[u3] = d3); } createHttpProvider(u3, i2) { - const d2 = i2 || ft(u3, this.namespace, this.client.core.projectId); - if (!d2) + const d3 = i2 || ft(u3, this.namespace, this.client.core.projectId); + if (!d3) throw new Error(`No RPC url provided for chainId: ${u3}`); - return new JsonRpcProvider(new HttpConnection(d2, z("disableProviderPing"))); + return new JsonRpcProvider(new f$1(d3, z("disableProviderPing"))); } } class jg { @@ -15008,21 +14976,21 @@ class jg { return u3.split(":")[1]; } createHttpProvider(u3, i2) { - const d2 = i2 || ft(`${this.name}:${u3}`, this.namespace, this.client.core.projectId); - if (!d2) + const d3 = i2 || ft(`${this.name}:${u3}`, this.namespace, this.client.core.projectId); + if (!d3) throw new Error(`No RPC url provided for chainId: ${u3}`); - return new JsonRpcProvider(new HttpConnection(d2, z("disableProviderPing"))); + return new JsonRpcProvider(new f$1(d3, z("disableProviderPing"))); } setHttpProvider(u3, i2) { - const d2 = this.createHttpProvider(u3, i2); - d2 && (this.httpProviders[u3] = d2); + const d3 = this.createHttpProvider(u3, i2); + d3 && (this.httpProviders[u3] = d3); } createHttpProviders() { const u3 = {}; return this.namespace.chains.forEach((i2) => { - var d2; + var d3; const w3 = parseInt(Ct(i2)); - u3[w3] = this.createHttpProvider(w3, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); + u3[w3] = this.createHttpProvider(w3, (d3 = this.namespace.rpcMap) == null ? void 0 : d3[i2]); }), u3; } getAccounts() { @@ -15036,14 +15004,14 @@ class jg { return i2; } async handleSwitchChain(u3) { - var i2, d2; + var i2, d3; let w3 = u3.request.params ? (i2 = u3.request.params[0]) == null ? void 0 : i2.chainId : "0x0"; w3 = w3.startsWith("0x") ? w3 : `0x${w3}`; const L2 = parseInt(w3, 16); if (this.isChainApproved(L2)) this.setDefaultChain(`${L2}`); else if (this.namespace.methods.includes("wallet_switchEthereumChain")) - await this.client.request({ topic: u3.topic, request: { method: u3.request.method, params: [{ chainId: w3 }] }, chainId: (d2 = this.namespace.chains) == null ? void 0 : d2[0] }), this.setDefaultChain(`${L2}`); + await this.client.request({ topic: u3.topic, request: { method: u3.request.method, params: [{ chainId: w3 }] }, chainId: (d3 = this.namespace.chains) == null ? void 0 : d3[0] }), this.setDefaultChain(`${L2}`); else throw new Error(`Failed to switch to chain 'eip155:${L2}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`); return null; @@ -15085,9 +15053,9 @@ class nv { createHttpProviders() { const u3 = {}; return this.namespace.chains.forEach((i2) => { - var d2; + var d3; const w3 = Ct(i2); - u3[w3] = this.createHttpProvider(w3, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); + u3[w3] = this.createHttpProvider(w3, (d3 = this.namespace.rpcMap) == null ? void 0 : d3[i2]); }), u3; } getHttpProvider() { @@ -15097,14 +15065,14 @@ class nv { return i2; } setHttpProvider(u3, i2) { - const d2 = this.createHttpProvider(u3, i2); - d2 && (this.httpProviders[u3] = d2); + const d3 = this.createHttpProvider(u3, i2); + d3 && (this.httpProviders[u3] = d3); } createHttpProvider(u3, i2) { - const d2 = i2 || ft(u3, this.namespace, this.client.core.projectId); - if (!d2) + const d3 = i2 || ft(u3, this.namespace, this.client.core.projectId); + if (!d3) throw new Error(`No RPC url provided for chainId: ${u3}`); - return new JsonRpcProvider(new HttpConnection(d2, z("disableProviderPing"))); + return new JsonRpcProvider(new f$1(d3, z("disableProviderPing"))); } } class tv { @@ -15140,9 +15108,9 @@ class tv { createHttpProviders() { const u3 = {}; return this.namespace.chains.forEach((i2) => { - var d2; + var d3; const w3 = Ct(i2); - u3[w3] = this.createHttpProvider(w3, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); + u3[w3] = this.createHttpProvider(w3, (d3 = this.namespace.rpcMap) == null ? void 0 : d3[i2]); }), u3; } getHttpProvider() { @@ -15152,14 +15120,14 @@ class tv { return i2; } setHttpProvider(u3, i2) { - const d2 = this.createHttpProvider(u3, i2); - d2 && (this.httpProviders[u3] = d2); + const d3 = this.createHttpProvider(u3, i2); + d3 && (this.httpProviders[u3] = d3); } createHttpProvider(u3, i2) { - const d2 = i2 || ft(u3, this.namespace, this.client.core.projectId); - if (!d2) + const d3 = i2 || ft(u3, this.namespace, this.client.core.projectId); + if (!d3) throw new Error(`No RPC url provided for chainId: ${u3}`); - return new JsonRpcProvider(new HttpConnection(d2, z("disableProviderPing"))); + return new JsonRpcProvider(new f$1(d3, z("disableProviderPing"))); } } class ev { @@ -15195,8 +15163,8 @@ class ev { createHttpProviders() { const u3 = {}; return this.namespace.chains.forEach((i2) => { - const d2 = this.getCardanoRPCUrl(i2), w3 = Ct(i2); - u3[w3] = this.createHttpProvider(w3, d2); + const d3 = this.getCardanoRPCUrl(i2), w3 = Ct(i2); + u3[w3] = this.createHttpProvider(w3, d3); }), u3; } getHttpProvider() { @@ -15211,14 +15179,14 @@ class ev { return i2[u3]; } setHttpProvider(u3, i2) { - const d2 = this.createHttpProvider(u3, i2); - d2 && (this.httpProviders[u3] = d2); + const d3 = this.createHttpProvider(u3, i2); + d3 && (this.httpProviders[u3] = d3); } createHttpProvider(u3, i2) { - const d2 = i2 || this.getCardanoRPCUrl(u3); - if (!d2) + const d3 = i2 || this.getCardanoRPCUrl(u3); + if (!d3) throw new Error(`No RPC url provided for chainId: ${u3}`); - return new JsonRpcProvider(new HttpConnection(d2, z("disableProviderPing"))); + return new JsonRpcProvider(new f$1(d3, z("disableProviderPing"))); } } class rv { @@ -15254,9 +15222,9 @@ class rv { createHttpProviders() { const u3 = {}; return this.namespace.chains.forEach((i2) => { - var d2; + var d3; const w3 = Ct(i2); - u3[w3] = this.createHttpProvider(w3, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); + u3[w3] = this.createHttpProvider(w3, (d3 = this.namespace.rpcMap) == null ? void 0 : d3[i2]); }), u3; } getHttpProvider() { @@ -15266,14 +15234,14 @@ class rv { return i2; } setHttpProvider(u3, i2) { - const d2 = this.createHttpProvider(u3, i2); - d2 && (this.httpProviders[u3] = d2); + const d3 = this.createHttpProvider(u3, i2); + d3 && (this.httpProviders[u3] = d3); } createHttpProvider(u3, i2) { - const d2 = i2 || ft(u3, this.namespace, this.client.core.projectId); - if (!d2) + const d3 = i2 || ft(u3, this.namespace, this.client.core.projectId); + if (!d3) throw new Error(`No RPC url provided for chainId: ${u3}`); - return new JsonRpcProvider(new HttpConnection(d2, z("disableProviderPing"))); + return new JsonRpcProvider(new f$1(d3, z("disableProviderPing"))); } } class iv { @@ -15309,9 +15277,9 @@ class iv { createHttpProviders() { const u3 = {}; return this.namespace.chains.forEach((i2) => { - var d2; + var d3; const w3 = Ct(i2); - u3[w3] = this.createHttpProvider(w3, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); + u3[w3] = this.createHttpProvider(w3, (d3 = this.namespace.rpcMap) == null ? void 0 : d3[i2]); }), u3; } getHttpProvider() { @@ -15321,14 +15289,14 @@ class iv { return i2; } setHttpProvider(u3, i2) { - const d2 = this.createHttpProvider(u3, i2); - d2 && (this.httpProviders[u3] = d2); + const d3 = this.createHttpProvider(u3, i2); + d3 && (this.httpProviders[u3] = d3); } createHttpProvider(u3, i2) { - const d2 = i2 || ft(u3, this.namespace, this.client.core.projectId); - if (!d2) + const d3 = i2 || ft(u3, this.namespace, this.client.core.projectId); + if (!d3) throw new Error(`No RPC url provided for chainId: ${u3}`); - return new JsonRpcProvider(new HttpConnection(d2, z("disableProviderPing"))); + return new JsonRpcProvider(new f$1(d3, z("disableProviderPing"))); } } class sv { @@ -15356,10 +15324,10 @@ class sv { } setDefaultChain(u3, i2) { if (this.chainId = u3, !this.httpProviders[u3]) { - const d2 = i2 || ft(`${this.name}:${u3}`, this.namespace); - if (!d2) + const d3 = i2 || ft(`${this.name}:${u3}`, this.namespace); + if (!d3) throw new Error(`No RPC url provided for chainId: ${u3}`); - this.setHttpProvider(u3, d2); + this.setHttpProvider(u3, d3); } this.events.emit(Vn.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`); } @@ -15370,8 +15338,8 @@ class sv { createHttpProviders() { const u3 = {}; return this.namespace.chains.forEach((i2) => { - var d2; - u3[i2] = this.createHttpProvider(i2, (d2 = this.namespace.rpcMap) == null ? void 0 : d2[i2]); + var d3; + u3[i2] = this.createHttpProvider(i2, (d3 = this.namespace.rpcMap) == null ? void 0 : d3[i2]); }), u3; } getHttpProvider() { @@ -15381,12 +15349,12 @@ class sv { return i2; } setHttpProvider(u3, i2) { - const d2 = this.createHttpProvider(u3, i2); - d2 && (this.httpProviders[u3] = d2); + const d3 = this.createHttpProvider(u3, i2); + d3 && (this.httpProviders[u3] = d3); } createHttpProvider(u3, i2) { - const d2 = i2 || ft(u3, this.namespace); - return typeof d2 > "u" ? void 0 : new JsonRpcProvider(new HttpConnection(d2, z("disableProviderPing"))); + const d3 = i2 || ft(u3, this.namespace); + return typeof d3 > "u" ? void 0 : new JsonRpcProvider(new f$1(d3, z("disableProviderPing"))); } } var uv = Object.defineProperty, av = Object.defineProperties, ov = Object.getOwnPropertyDescriptors, Ta = Object.getOwnPropertySymbols, fv = Object.prototype.hasOwnProperty, cv = Object.prototype.propertyIsEnumerable, La = (A2, u3, i2) => u3 in A2 ? uv(A2, u3, { enumerable: true, configurable: true, writable: true, value: i2 }) : A2[u3] = i2, hr = (A2, u3) => { @@ -15405,15 +15373,15 @@ class lr { const i2 = new lr(u3); return await i2.initialize(), i2; } - async request(u3, i2, d2) { + async request(u3, i2, d3) { const [w3, L2] = this.validateChain(i2); if (!this.session) throw new Error("Please call connect() before request()"); - return await this.getProvider(w3).request({ request: hr({}, u3), chainId: `${w3}:${L2}`, topic: this.session.topic, expiry: d2 }); + return await this.getProvider(w3).request({ request: hr({}, u3), chainId: `${w3}:${L2}`, topic: this.session.topic, expiry: d3 }); } - sendAsync(u3, i2, d2, w3) { + sendAsync(u3, i2, d3, w3) { const L2 = (/* @__PURE__ */ new Date()).getTime(); - this.request(u3, d2, w3).then((D2) => i2(null, formatJsonRpcResult(L2, D2))).catch((D2) => i2(D2, void 0)); + this.request(u3, d3, w3).then((D2) => i2(null, formatJsonRpcResult(L2, D2))).catch((D2) => i2(D2, void 0)); } async enable() { if (!this.client) @@ -15455,8 +15423,8 @@ class lr { throw new Error("Pairing aborted"); if (i2 >= this.maxPairingAttempts) throw new Error("Max auto pairing attempts reached"); - const { uri: d2, approval: w3 } = await this.client.connect({ pairingTopic: u3, requiredNamespaces: this.namespaces, optionalNamespaces: this.optionalNamespaces, sessionProperties: this.sessionProperties }); - d2 && (this.uri = d2, this.events.emit("display_uri", d2)), await w3().then((L2) => { + const { uri: d3, approval: w3 } = await this.client.connect({ pairingTopic: u3, requiredNamespaces: this.namespaces, optionalNamespaces: this.optionalNamespaces, sessionProperties: this.sessionProperties }); + d3 && (this.uri = d3, this.events.emit("display_uri", d3)), await w3().then((L2) => { this.session = L2; const D2 = Vg(L2.namespaces); this.namespaces = Oa(this.namespaces, D2), this.persist("namespaces", this.namespaces); @@ -15472,19 +15440,19 @@ class lr { try { if (!this.session) return; - const [d2, w3] = this.validateChain(u3); - this.getProvider(d2).setDefaultChain(w3, i2); - } catch (d2) { - if (!/Please call connect/.test(d2.message)) - throw d2; + const [d3, w3] = this.validateChain(u3); + this.getProvider(d3).setDefaultChain(w3, i2); + } catch (d3) { + if (!/Please call connect/.test(d3.message)) + throw d3; } } async cleanupPendingPairings(u3 = {}) { this.logger.info("Cleaning up inactive pairings..."); const i2 = this.client.pairing.getAll(); if (k$2(i2)) { - for (const d2 of i2) - u3.deletePairings ? this.client.core.expirer.set(d2.topic, 0) : await this.client.core.relayer.subscriber.unsubscribe(d2.topic); + for (const d3 of i2) + u3.deletePairings ? this.client.core.expirer.set(d3.topic, 0) : await this.client.core.relayer.subscriber.unsubscribe(d3.topic); this.logger.info(`Inactive pairings cleared: ${i2.length}`); } } @@ -15512,7 +15480,7 @@ class lr { Fi("client", this.client), Fi("events", this.events), Fi("disableProviderPing", this.disableProviderPing), u3.forEach((i2) => { if (!this.session) return; - const d2 = Xg(i2, this.session), w3 = Sa(d2), L2 = Oa(this.namespaces, this.optionalNamespaces), D2 = Mi(hr({}, L2[i2]), { accounts: d2, chains: w3 }); + const d3 = Xg(i2, this.session), w3 = Sa(d3), L2 = Oa(this.namespaces, this.optionalNamespaces), D2 = Mi(hr({}, L2[i2]), { accounts: d3, chains: w3 }); switch (i2) { case "eip155": this.rpcProviders[i2] = new jg({ namespace: D2 }); @@ -15547,19 +15515,19 @@ class lr { this.client.on("session_ping", (u3) => { this.events.emit("session_ping", u3); }), this.client.on("session_event", (u3) => { - const { params: i2 } = u3, { event: d2 } = i2; - if (d2.name === "accountsChanged") { - const w3 = d2.data; + const { params: i2 } = u3, { event: d3 } = i2; + if (d3.name === "accountsChanged") { + const w3 = d3.data; w3 && k$2(w3) && this.events.emit("accountsChanged", w3.map(Qg)); - } else if (d2.name === "chainChanged") { + } else if (d3.name === "chainChanged") { const w3 = i2.chainId, L2 = i2.event.data, D2 = en(w3), En = Wi(w3) !== Wi(L2) ? `${D2}:${Wi(L2)}` : w3; this.onChainChanged(En); } else - this.events.emit(d2.name, d2.data); + this.events.emit(d3.name, d3.data); this.events.emit("session_event", u3); }), this.client.on("session_update", ({ topic: u3, params: i2 }) => { - var d2; - const { namespaces: w3 } = i2, L2 = (d2 = this.client) == null ? void 0 : d2.session.get(u3); + var d3; + const { namespaces: w3 } = i2, L2 = (d3 = this.client) == null ? void 0 : d3.session.get(u3); this.session = Mi(hr({}, L2), { namespaces: w3 }), this.onSessionUpdate(), this.events.emit("session_update", { topic: u3, params: i2 }); }), this.client.on("session_delete", async (u3) => { await this.cleanup(), this.events.emit("session_delete", u3), this.events.emit("disconnect", Mi(hr({}, U$2("USER_DISCONNECTED")), { data: u3.topic })); @@ -15579,17 +15547,17 @@ class lr { }); } setNamespaces(u3) { - const { namespaces: i2, optionalNamespaces: d2, sessionProperties: w3 } = u3; - i2 && Object.keys(i2).length && (this.namespaces = i2), d2 && Object.keys(d2).length && (this.optionalNamespaces = d2), this.sessionProperties = w3, this.persist("namespaces", i2), this.persist("optionalNamespaces", d2); + const { namespaces: i2, optionalNamespaces: d3, sessionProperties: w3 } = u3; + i2 && Object.keys(i2).length && (this.namespaces = i2), d3 && Object.keys(d3).length && (this.optionalNamespaces = d3), this.sessionProperties = w3, this.persist("namespaces", i2), this.persist("optionalNamespaces", d3); } validateChain(u3) { - const [i2, d2] = (u3 == null ? void 0 : u3.split(":")) || ["", ""]; + const [i2, d3] = (u3 == null ? void 0 : u3.split(":")) || ["", ""]; if (!this.namespaces || !Object.keys(this.namespaces).length) - return [i2, d2]; + return [i2, d3]; if (i2 && !Object.keys(this.namespaces || {}).map((D2) => en(D2)).includes(i2)) throw new Error(`Namespace '${i2}' is not configured. Please call connect() first with namespace config.`); - if (i2 && d2) - return [i2, d2]; + if (i2 && d3) + return [i2, d3]; const w3 = en(Object.keys(this.namespaces)[0]), L2 = this.rpcProviders[w3].getDefaultChain(); return [w3, L2]; } @@ -15600,8 +15568,8 @@ class lr { onChainChanged(u3, i2 = false) { if (!this.namespaces) return; - const [d2, w3] = this.validateChain(u3); - w3 && (i2 || this.getProvider(d2).setDefaultChain(w3), this.namespaces[d2] ? this.namespaces[d2].defaultChain = w3 : this.namespaces[`${d2}:${w3}`] ? this.namespaces[`${d2}:${w3}`].defaultChain = w3 : this.namespaces[`${d2}:${w3}`] = { defaultChain: w3 }, this.persist("namespaces", this.namespaces), this.events.emit("chainChanged", w3)); + const [d3, w3] = this.validateChain(u3); + w3 && (i2 || this.getProvider(d3).setDefaultChain(w3), this.namespaces[d3] ? this.namespaces[d3].defaultChain = w3 : this.namespaces[`${d3}:${w3}`] ? this.namespaces[`${d3}:${w3}`].defaultChain = w3 : this.namespaces[`${d3}:${w3}`] = { defaultChain: w3 }, this.persist("namespaces", this.namespaces), this.events.emit("chainChanged", w3)); } onConnect() { this.createProviders(), this.events.emit("connect", { session: this.session }); @@ -15629,18 +15597,18 @@ var N = Object.defineProperty, q = Object.defineProperties, D = Object.getOwnPro function g2(a3) { return Number(a3[0].split(":")[1]); } -function f2(a3) { +function f3(a3) { return `0x${a3.toString(16)}`; } function L(a3) { - const { chains: t, optionalChains: s, methods: i2, optionalMethods: n2, events: e, optionalEvents: h4, rpcMap: c2 } = a3; + const { chains: t, optionalChains: s, methods: i2, optionalMethods: n3, events: e2, optionalEvents: h4, rpcMap: c2 } = a3; if (!k$2(t)) throw new Error("Invalid chains"); - const o = { chains: t, methods: i2 || u2, events: e || m, rpcMap: p2({}, t.length ? { [g2(t)]: c2[g2(t)] } : {}) }, r = e == null ? void 0 : e.filter((l2) => !m.includes(l2)), d2 = i2 == null ? void 0 : i2.filter((l2) => !u2.includes(l2)); - if (!s && !h4 && !n2 && !(r != null && r.length) && !(d2 != null && d2.length)) - return { required: t.length ? o : void 0 }; - const C2 = (r == null ? void 0 : r.length) && (d2 == null ? void 0 : d2.length) || !s, I2 = { chains: [...new Set(C2 ? o.chains.concat(s || []) : s)], methods: [...new Set(o.methods.concat(n2 != null && n2.length ? n2 : E2))], events: [...new Set(o.events.concat(h4 != null && h4.length ? h4 : _2))], rpcMap: c2 }; - return { required: t.length ? o : void 0, optional: s.length ? I2 : void 0 }; + const o2 = { chains: t, methods: i2 || u2, events: e2 || m, rpcMap: p2({}, t.length ? { [g2(t)]: c2[g2(t)] } : {}) }, r2 = e2 == null ? void 0 : e2.filter((l2) => !m.includes(l2)), d3 = i2 == null ? void 0 : i2.filter((l2) => !u2.includes(l2)); + if (!s && !h4 && !n3 && !(r2 != null && r2.length) && !(d3 != null && d3.length)) + return { required: t.length ? o2 : void 0 }; + const C2 = (r2 == null ? void 0 : r2.length) && (d3 == null ? void 0 : d3.length) || !s, I2 = { chains: [...new Set(C2 ? o2.chains.concat(s || []) : s)], methods: [...new Set(o2.methods.concat(n3 != null && n3.length ? n3 : E2))], events: [...new Set(o2.events.concat(h4 != null && h4.length ? h4 : _2))], rpcMap: c2 }; + return { required: t.length ? o2 : void 0, optional: s.length ? I2 : void 0 }; } class v2 { constructor() { @@ -15671,22 +15639,22 @@ class v2 { this.loadConnectOpts(t); const { required: s, optional: i2 } = L(this.rpc); try { - const n2 = await new Promise(async (h4, c2) => { - var o; - this.rpc.showQrModal && ((o = this.modal) == null || o.subscribeModal((r) => { - !r.open && !this.signer.session && (this.signer.abortPairingAttempt(), c2(new Error("Connection request reset. Please try again."))); - })), await this.signer.connect(M(p2({ namespaces: p2({}, s && { [this.namespace]: s }) }, i2 && { optionalNamespaces: { [this.namespace]: i2 } }), { pairingTopic: t == null ? void 0 : t.pairingTopic })).then((r) => { - h4(r); - }).catch((r) => { - c2(new Error(r.message)); + const n3 = await new Promise(async (h4, c2) => { + var o2; + this.rpc.showQrModal && ((o2 = this.modal) == null || o2.subscribeModal((r2) => { + !r2.open && !this.signer.session && (this.signer.abortPairingAttempt(), c2(new Error("Connection request reset. Please try again."))); + })), await this.signer.connect(M(p2({ namespaces: p2({}, s && { [this.namespace]: s }) }, i2 && { optionalNamespaces: { [this.namespace]: i2 } }), { pairingTopic: t == null ? void 0 : t.pairingTopic })).then((r2) => { + h4(r2); + }).catch((r2) => { + c2(new Error(r2.message)); }); }); - if (!n2) + if (!n3) return; - const e = Un(n2.namespaces, [this.namespace]); - this.setChainIds(this.rpc.chains.length ? this.rpc.chains : e), this.setAccounts(e), this.events.emit("connect", { chainId: f2(this.chainId) }); - } catch (n2) { - throw this.signer.logger.error(n2), n2; + const e2 = Un(n3.namespaces, [this.namespace]); + this.setChainIds(this.rpc.chains.length ? this.rpc.chains : e2), this.setAccounts(e2), this.events.emit("connect", { chainId: f3(this.chainId) }); + } catch (n3) { + throw this.signer.logger.error(n3), n3; } finally { this.modal && this.modal.closeModal(); } @@ -15706,7 +15674,7 @@ class v2 { i2.name === "accountsChanged" ? (this.accounts = this.parseAccounts(i2.data), this.events.emit("accountsChanged", this.accounts)) : i2.name === "chainChanged" ? this.setChainId(this.formatChainId(i2.data)) : this.events.emit(i2.name, i2.data), this.events.emit("session_event", t); }), this.signer.on("chainChanged", (t) => { const s = parseInt(t); - this.chainId = s, this.events.emit("chainChanged", f2(this.chainId)), this.persist(); + this.chainId = s, this.events.emit("chainChanged", f3(this.chainId)), this.persist(); }), this.signer.on("session_update", (t) => { this.events.emit("session_update", t); }), this.signer.on("session_delete", (t) => { @@ -15730,7 +15698,7 @@ class v2 { } setChainIds(t) { const s = t.filter((i2) => this.isCompatibleChainId(i2)).map((i2) => this.parseChainId(i2)); - s.length && (this.chainId = s[0], this.events.emit("chainChanged", f2(this.chainId)), this.persist()); + s.length && (this.chainId = s[0], this.events.emit("chainChanged", f3(this.chainId)), this.persist()); } setChainId(t) { if (this.isCompatibleChainId(t)) { @@ -15739,31 +15707,31 @@ class v2 { } } parseAccountId(t) { - const [s, i2, n2] = t.split(":"); - return { chainId: `${s}:${i2}`, address: n2 }; + const [s, i2, n3] = t.split(":"); + return { chainId: `${s}:${i2}`, address: n3 }; } setAccounts(t) { this.accounts = t.filter((s) => this.parseChainId(this.parseAccountId(s).chainId) === this.chainId).map((s) => this.parseAccountId(s).address), this.events.emit("accountsChanged", this.accounts); } getRpcConfig(t) { var s, i2; - const n2 = (s = t == null ? void 0 : t.chains) != null ? s : [], e = (i2 = t == null ? void 0 : t.optionalChains) != null ? i2 : [], h4 = n2.concat(e); + const n3 = (s = t == null ? void 0 : t.chains) != null ? s : [], e2 = (i2 = t == null ? void 0 : t.optionalChains) != null ? i2 : [], h4 = n3.concat(e2); if (!h4.length) throw new Error("No chains specified in either `chains` or `optionalChains`"); - const c2 = n2.length ? (t == null ? void 0 : t.methods) || u2 : [], o = n2.length ? (t == null ? void 0 : t.events) || m : [], r = (t == null ? void 0 : t.optionalMethods) || [], d2 = (t == null ? void 0 : t.optionalEvents) || [], C2 = (t == null ? void 0 : t.rpcMap) || this.buildRpcMap(h4, t.projectId), I2 = (t == null ? void 0 : t.qrModalOptions) || void 0; - return { chains: n2 == null ? void 0 : n2.map((l2) => this.formatChainId(l2)), optionalChains: e.map((l2) => this.formatChainId(l2)), methods: c2, events: o, optionalMethods: r, optionalEvents: d2, rpcMap: C2, showQrModal: !!(t != null && t.showQrModal), qrModalOptions: I2, projectId: t.projectId, metadata: t.metadata }; + const c2 = n3.length ? (t == null ? void 0 : t.methods) || u2 : [], o2 = n3.length ? (t == null ? void 0 : t.events) || m : [], r2 = (t == null ? void 0 : t.optionalMethods) || [], d3 = (t == null ? void 0 : t.optionalEvents) || [], C2 = (t == null ? void 0 : t.rpcMap) || this.buildRpcMap(h4, t.projectId), I2 = (t == null ? void 0 : t.qrModalOptions) || void 0; + return { chains: n3 == null ? void 0 : n3.map((l2) => this.formatChainId(l2)), optionalChains: e2.map((l2) => this.formatChainId(l2)), methods: c2, events: o2, optionalMethods: r2, optionalEvents: d3, rpcMap: C2, showQrModal: !!(t != null && t.showQrModal), qrModalOptions: I2, projectId: t.projectId, metadata: t.metadata }; } buildRpcMap(t, s) { const i2 = {}; - return t.forEach((n2) => { - i2[n2] = this.getRpcUrl(n2, s); + return t.forEach((n3) => { + i2[n3] = this.getRpcUrl(n3, s); }), i2; } async initialize(t) { if (this.rpc = this.getRpcConfig(t), this.chainId = this.rpc.chains.length ? g2(this.rpc.chains) : g2(this.rpc.optionalChains), this.signer = await hv.init({ projectId: this.rpc.projectId, metadata: this.rpc.metadata, disableProviderPing: t.disableProviderPing, relayUrl: t.relayUrl, storageOptions: t.storageOptions }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) { let s; try { - const { WalletConnectModal: i2 } = await __vitePreload(() => import("./index-DxKizXZQ.js").then((n2) => n2.i), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url); + const { WalletConnectModal: i2 } = await __vitePreload(() => import("./index-CJ5MvQ2C.js").then((n3) => n3.i), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url); s = i2; } catch { throw new Error("To use QR modal, please install @walletconnect/modal package"); @@ -15779,11 +15747,11 @@ class v2 { loadConnectOpts(t) { if (!t) return; - const { chains: s, optionalChains: i2, rpcMap: n2 } = t; - s && k$2(s) && (this.rpc.chains = s.map((e) => this.formatChainId(e)), s.forEach((e) => { - this.rpc.rpcMap[e] = (n2 == null ? void 0 : n2[e]) || this.getRpcUrl(e); - })), i2 && k$2(i2) && (this.rpc.optionalChains = [], this.rpc.optionalChains = i2 == null ? void 0 : i2.map((e) => this.formatChainId(e)), i2.forEach((e) => { - this.rpc.rpcMap[e] = (n2 == null ? void 0 : n2[e]) || this.getRpcUrl(e); + const { chains: s, optionalChains: i2, rpcMap: n3 } = t; + s && k$2(s) && (this.rpc.chains = s.map((e2) => this.formatChainId(e2)), s.forEach((e2) => { + this.rpc.rpcMap[e2] = (n3 == null ? void 0 : n3[e2]) || this.getRpcUrl(e2); + })), i2 && k$2(i2) && (this.rpc.optionalChains = [], this.rpc.optionalChains = i2 == null ? void 0 : i2.map((e2) => this.formatChainId(e2)), i2.forEach((e2) => { + this.rpc.rpcMap[e2] = (n3 == null ? void 0 : n3[e2]) || this.getRpcUrl(e2); })); } getRpcUrl(t, s) { diff --git a/index.html b/index.html index 1dd8e9be..39e1eb95 100644 --- a/index.html +++ b/index.html @@ -24,8 +24,8 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Sequence Kit Demo - - + +