bsv-mcp 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +13 -17
- package/dist/app.html +32 -24
- package/dist/index.js +4985 -5638
- package/dist/local-mcp-launcher.js +529 -294
- package/dist/local-ui/app.html +2 -2
- package/dist/local-ui/assets/index-4J-0ZDJf.css +1 -0
- package/dist/local-ui/assets/index-CUxfBDh6.js +117 -0
- package/dist/local-ui/index.html +2 -2
- package/package.json +100 -64
- package/dist/local-ui/assets/index-B1jJYtjR.js +0 -109
- package/dist/local-ui/assets/index-DsjtK58c.css +0 -1
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var i=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-ee<w)}function ne(){if(g=!1,S){var t=e.unstable_now();ee=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?T():S=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,T=function(){ie.postMessage(null)}}else T=function(){_(ne,0)};function ae(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,T()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),a=t(((e,t)=>{t.exports=i()})),o=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var E=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},D={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=D,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return te(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=T,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,E)}catch(e){E(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),s=t(((e,t)=>{t.exports=o()})),c=t((e=>{var t=s();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=i.p;try{if(c.T=null,i.p=2,e)return e()}finally{c.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),l=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=c()})),u=t((e=>{var t=a(),n=s(),r=l();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(c(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return f(a),e;if(o===r)return f(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var s=!1,l=a.child;l;){if(l===n){s=!0,n=a,r=o;break}if(l===r){s=!0,r=a,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=a;break}if(l===r){s=!0,r=o,n=a;break}l=l.sibling}if(!s)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$d(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$d(t),e=ef(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function Se(e){e.memoizedState!==null&&he(ye,e);var t=ge.current,n=ef(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Ce(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),up._currentValue=ue)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Fe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&<(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=D.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function ht(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt;function Tt(e){delete e[_t],delete e[vt],delete e[bt],delete e[xt],delete e[St]}function Et(e){var t=e[_t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[_t])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[wt]=!0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),It={},Lt={};function Rt(e){return je.call(Lt,e)?!0:je.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}function zt(e,t,n){if(Rt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Bt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Vt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ht(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Wt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gt(e){if(!e._valueTracker){var t=Ut(e)?`checked`:`value`;e._valueTracker=Wt(e,t,``+e[t])}}function Kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ut(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function qt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Jt=/[\n"\\]/g;function Yt(e){return e.replace(Jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Xt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ht(t)):e.value!==``+Ht(t)&&(e.value=``+Ht(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Qt(e,o,Ht(n)):Qt(e,o,Ht(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ht(s):e.removeAttribute(`name`)}function Zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Gt(e);return}n=n==null?``:``+Ht(n),t=t==null?n:``+Ht(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Gt(e)}function Qt(e,t,n){t===`number`&&qt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function $t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ht(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function en(e,t,n){if(t!=null&&(t=``+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ht(n)}function tn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(le(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ht(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Gt(e)}function nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function an(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||rn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&an(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&an(e,o,t[o])}function sn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var cn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),ln=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function un(e){return ln.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function dn(){}var fn=null;function pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mn=null,hn=null;function gn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Xt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Yt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[vt]||null;if(!a)throw Error(i(90));Xt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Kt(r)}break a;case`textarea`:en(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&$t(e,!!n.multiple,t,!1)}}}var _n=!1;function vn(e,t,n){if(_n)return e(t,n);_n=!0;try{return e(t)}finally{if(_n=!1,(mn!==null||hn!==null)&&(Au(),mn&&(t=mn,e=hn,hn=mn=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function yn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var bn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),xn=!1;if(bn)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){xn=!0}}),window.addEventListener(`test`,Sn,Sn),window.removeEventListener(`test`,Sn,Sn)}catch{xn=!1}var Cn=null,wn=null,Tn=null;function En(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Tn=i.slice(e,1<r?1-r:void 0)}function Dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function On(){return!0}function kn(){return!1}function An(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?On:kn,this.isPropagationStopped=kn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=On)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=On)},persist:function(){},isPersistent:On}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mn=An(jn),Nn=h({},jn,{view:0,detail:0}),Pn=An(Nn),Fn,In,Ln,Rn=h({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Ln&&(Ln&&e.type===`mousemove`?(Fn=e.screenX-Ln.screenX,In=e.screenY-Ln.screenY):In=Fn=0,Ln=e),Fn)},movementY:function(e){return`movementY`in e?e.movementY:In}}),zn=An(Rn),Bn=An(h({},Rn,{dataTransfer:0})),Vn=An(h({},Nn,{relatedTarget:0})),Hn=An(h({},jn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=An(h({},jn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=An(h({},jn,{data:0})),O={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Gn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kn[e])?!!t[e]:!1}function Jn(){return qn}var Yn=An(h({},Nn,{key:function(e){if(e.key){var t=O[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Gn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jn,charCode:function(e){return e.type===`keypress`?Dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Xn=An(h({},Rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Zn=An(h({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jn})),Qn=An(h({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),$n=An(h({},Rn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),er=An(h({},jn,{newState:0,oldState:0})),tr=[9,13,27,32],nr=bn&&`CompositionEvent`in window,rr=null;bn&&`documentMode`in document&&(rr=document.documentMode);var ir=bn&&`TextEvent`in window&&!rr,ar=bn&&(!nr||rr&&8<rr&&11>=rr),or=` `,sr=!1;function cr(e,t){switch(e){case`keyup`:return tr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function lr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ur=!1;function dr(e,t){switch(e){case`compositionend`:return lr(t);case`keypress`:return t.which===32?(sr=!0,or):null;case`textInput`:return e=t.data,e===or&&sr?null:e;default:return null}}function fr(e,t){if(ur)return e===`compositionend`||!nr&&cr(e,t)?(e=En(),Tn=wn=Cn=null,ur=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return ar&&t.locale!==`ko`?null:t.data;default:return null}}var pr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!pr[e.type]:t===`textarea`}function hr(e,t,n,r){mn?hn?hn.push(r):hn=[r]:mn=r,t=Ld(t,`onChange`),0<t.length&&(n=new Mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var gr=null,_r=null;function vr(e){Ad(e,0)}function yr(e){if(Kt(Ot(e)))return e}function br(e,t){if(e===`change`)return t}var xr=!1;if(bn){var Sr;if(bn){var Cr=`oninput`in document;if(!Cr){var wr=document.createElement(`div`);wr.setAttribute(`oninput`,`return;`),Cr=typeof wr.oninput==`function`}Sr=Cr}else Sr=!1;xr=Sr&&(!document.documentMode||9<document.documentMode)}function Tr(){gr&&(gr.detachEvent(`onpropertychange`,Er),_r=gr=null)}function Er(e){if(e.propertyName===`value`&&yr(_r)){var t=[];hr(t,_r,e,pn(e)),vn(vr,t)}}function Dr(e,t,n){e===`focusin`?(Tr(),gr=t,_r=n,gr.attachEvent(`onpropertychange`,Er)):e===`focusout`&&Tr()}function Or(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return yr(_r)}function kr(e,t){if(e===`click`)return yr(t)}function Ar(e,t){if(e===`input`||e===`change`)return yr(t)}function jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Mr=typeof Object.is==`function`?Object.is:jr;function k(e,t){if(Mr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!je.call(t,i)||!Mr(e[i],t[i]))return!1}return!0}function Nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pr(e,t){var n=Nr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Nr(n)}}function Fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ir(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=qt(e.document)}return t}function Lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Rr=bn&&`documentMode`in document&&11>=document.documentMode,zr=null,Br=null,Vr=null,Hr=!1;function Ur(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hr||zr==null||zr!==qt(r)||(r=zr,`selectionStart`in r&&Lr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vr&&k(Vr,r)||(Vr=r,r=Ld(Br,`onSelect`),0<r.length&&(t=new Mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=zr)))}function Wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Gr={animationend:Wr(`Animation`,`AnimationEnd`),animationiteration:Wr(`Animation`,`AnimationIteration`),animationstart:Wr(`Animation`,`AnimationStart`),transitionrun:Wr(`Transition`,`TransitionRun`),transitionstart:Wr(`Transition`,`TransitionStart`),transitioncancel:Wr(`Transition`,`TransitionCancel`),transitionend:Wr(`Transition`,`TransitionEnd`)},Kr={},qr={};bn&&(qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),`TransitionEvent`in window||delete Gr.transitionend.transition);function Jr(e){if(Kr[e])return Kr[e];if(!Gr[e])return e;var t=Gr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qr)return Kr[e]=t[n];return e}var Yr=Jr(`animationend`),Xr=Jr(`animationiteration`),Zr=Jr(`animationstart`),Qr=Jr(`transitionrun`),$r=Jr(`transitionstart`),ei=Jr(`transitioncancel`),ti=Jr(`transitionend`),ni=new Map,ri=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ri.push(`scrollEnd`);function ii(e,t){ni.set(e,t),Nt(t,[e])}var ai=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},oi=[],si=0,ci=0;function li(){for(var e=si,t=ci=si=0;t<e;){var n=oi[t];oi[t++]=null;var r=oi[t];oi[t++]=null;var i=oi[t];oi[t++]=null;var a=oi[t];if(oi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&pi(n,i,a)}}function ui(e,t,n,r){oi[si++]=e,oi[si++]=t,oi[si++]=n,oi[si++]=r,ci|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function di(e,t,n,r){return ui(e,t,n,r),mi(e)}function fi(e,t){return ui(e,null,null,t),mi(e)}function pi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function mi(e){if(50<xu)throw xu=0,Su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hi={};function gi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _i(e,t,n,r){return new gi(e,t,n,r)}function vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yi(e,t){var n=e.alternate;return n===null?(n=_i(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function bi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function xi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)vi(e)&&(s=1);else if(typeof e==`string`)s=tp(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case re:return e=_i(31,n,t,a),e.elementType=re,e.lanes=o,e;case y:return Si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=_i(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=_i(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=_i(19,n,t,a),e.elementType=te,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ne:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=_i(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Si(e,t,n,r){return e=_i(7,e,r,t),e.lanes=n,e}function Ci(e,t,n){return e=_i(6,e,null,t),e.lanes=n,e}function wi(e){var t=_i(18,null,null,0);return t.stateNode=e,t}function Ti(e,t,n){return t=_i(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ei=new WeakMap;function Di(e,t){if(typeof e==`object`&&e){var n=Ei.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Ei.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Oi=[],ki=0,Ai=null,ji=0,Mi=[],Ni=0,Pi=null,Fi=1,Ii=``;function Li(e,t){Oi[ki++]=ji,Oi[ki++]=Ai,Ai=e,ji=t}function Ri(e,t,n){Mi[Ni++]=Fi,Mi[Ni++]=Ii,Mi[Ni++]=Pi,Pi=e;var r=Fi;e=Ii;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Fi=1<<32-Je(t)+i|n<<i|r,Ii=a+e}else Fi=1<<a|n<<i|r,Ii=e}function zi(e){e.return!==null&&(Li(e,1),Ri(e,1,0))}function Bi(e){for(;e===Ai;)Ai=Oi[--ki],Oi[ki]=null,ji=Oi[--ki],Oi[ki]=null;for(;e===Pi;)Pi=Mi[--Ni],Mi[Ni]=null,Ii=Mi[--Ni],Mi[Ni]=null,Fi=Mi[--Ni],Mi[Ni]=null}function Vi(e,t){Mi[Ni++]=Fi,Mi[Ni++]=Ii,Mi[Ni++]=Pi,Fi=t.id,Ii=t.overflow,Pi=e}var Hi=null,Ui=null,Wi=!1,Gi=null,Ki=!1,qi=Error(i(519));function Ji(e){throw ea(Di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),qi}function Yi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:V(`cancel`,t),V(`close`,t);break;case`iframe`:case`object`:case`embed`:V(`load`,t);break;case`video`:case`audio`:for(n=0;n<Od.length;n++)V(Od[n],t);break;case`source`:V(`error`,t);break;case`img`:case`image`:case`link`:V(`error`,t),V(`load`,t);break;case`details`:V(`toggle`,t);break;case`input`:V(`invalid`,t),Zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:V(`invalid`,t);break;case`textarea`:V(`invalid`,t),tn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ud(t.textContent,n)?(r.popover!=null&&(V(`beforetoggle`,t),V(`toggle`,t)),r.onScroll!=null&&V(`scroll`,t),r.onScrollEnd!=null&&V(`scrollend`,t),r.onClick!=null&&(t.onclick=dn),t=!0):t=!1,t||Ji(e,!0)}function Xi(e){for(Hi=e.return;Hi;)switch(Hi.tag){case 5:case 31:case 13:Ki=!1;return;case 27:case 3:Ki=!0;return;default:Hi=Hi.return}}function Zi(e){if(e!==Hi)return!1;if(!Wi)return Xi(e),Wi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||tf(e.type,e.memoizedProps)),n=!n),n&&Ui&&Ji(e),Xi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ui=Sf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ui=Sf(e)}else t===27?(t=Ui,uf(e.type)?(e=xf,xf=null,Ui=e):Ui=t):Ui=Hi?bf(e.stateNode.nextSibling):null;return!0}function Qi(){Ui=Hi=null,Wi=!1}function $i(){var e=Gi;return e!==null&&(su===null?su=e:su.push.apply(su,e),Gi=null),e}function ea(e){Gi===null?Gi=[e]:Gi.push(e)}var ta=pe(null),na=null,ra=null;function ia(e,t,n){he(ta,t._currentValue),t._currentValue=n}function aa(e){e._currentValue=ta.current,me(ta)}function oa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function sa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),oa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),oa(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ca(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[up]:e.push(up))}a=a.return}e!==null&&sa(t,e,n,r),t.flags|=262144}function la(e){for(e=e.firstContext;e!==null;){if(!Mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ua(e){na=e,ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function da(e){return A(na,e)}function fa(e,t){return na===null&&ua(e),A(e,t)}function A(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ra===null){if(e===null)throw Error(i(308));ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ra=ra.next=t;return n}var pa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ma=t.unstable_scheduleCallback,ha=t.unstable_NormalPriority,ga={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _a(){return{controller:new pa,data:new Map,refCount:0}}function va(e){e.refCount--,e.refCount===0&&ma(ha,function(){e.controller.abort()})}var ya=null,ba=0,xa=0,j=null;function Sa(e,t){if(ya===null){var n=ya=[];ba=0,xa=Sd(),j={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ba++,t.then(Ca,Ca),t}function Ca(){if(--ba===0&&ya!==null){j!==null&&(j.status=`fulfilled`);var e=ya;ya=null,xa=0,j=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ta=E.S;E.S=function(e,t){uu=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&Sa(e,t),Ta!==null&&Ta(e,t)};var Ea=pe(null);function Da(){var e=Ea.current;return e===null?ql.pooledCache:e}function Oa(e,t){t===null?he(Ea,Ea.current):he(Ea,t.pool)}function ka(){var e=Da();return e===null?null:{parent:ga._currentValue,pool:e}}var Aa=Error(i(460)),ja=Error(i(474)),Ma=Error(i(542)),Na={then:function(){}};function Pa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Fa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dn,dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,za(e),e;default:if(typeof t.status==`string`)t.then(dn,dn);else{if(e=ql,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,za(e),e}throw La=t,Aa}}function Ia(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(La=e,Aa):e}}var La=null;function Ra(){if(La===null)throw Error(i(459));var e=La;return La=null,e}function za(e){if(e===Aa||e===Ma)throw Error(i(483))}var Ba=null,Va=0;function Ha(e){var t=Va;return Va+=1,Ba===null&&(Ba=[]),Fa(Ba,e,t)}function Ua(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Wa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ga(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=yi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ci(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Ia(i)===t.type)?(t=a(t,n.props),Ua(t,n),t.return=e,t):(t=xi(n.type,n.key,n.props,null,e.mode,r),Ua(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ti(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Si(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=xi(t.type,t.key,t.props,null,e.mode,n),Ua(n,t),n.return=e,n;case v:return t=Ti(t,e.mode,n),t.return=e,t;case T:return t=Ia(t),f(e,t,n)}if(le(t)||oe(t))return t=Si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ha(t),n);if(t.$$typeof===C)return f(e,fa(e,t),n);Wa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case T:return n=Ia(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ha(n),r);if(n.$$typeof===C)return p(e,t,fa(e,n),r);Wa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Ia(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ha(r),i);if(r.$$typeof===C)return m(e,t,n,fa(t,r),i);Wa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Wi&&Li(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Wi&&Li(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Wi&&Li(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Wi&&Li(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Wi&&Li(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Wi&&Li(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Ia(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ua(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=Si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=xi(o.type,o.key,o.props,null,e.mode,c),Ua(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ti(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Ia(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ha(o),c);if(o.$$typeof===C)return b(e,r,fa(e,o),c);Wa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Va=0;var i=b(e,t,n,r);return Ba=null,i}catch(t){if(t===Aa||t===Ma)throw t;var a=_i(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ka=Ga(!0),qa=Ga(!1),Ja=!1;function M(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function N(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Kl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=mi(e),pi(e,null,n),t}return ui(e,r,t,n),mi(e)}function Za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function Qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var $a=!1;function eo(){if($a){var e=j;if(e!==null)throw e}}function to(e,t,n,r){$a=!1;var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(B&f)===f:(r&f)===f){f!==0&&f===xa&&($a=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ja=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),tu|=o,e.lanes=o,e.memoizedState=d}}function no(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ro(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)no(n[e],t)}var io=pe(null),ao=pe(0);function oo(e,t){e=$l,he(ao,e),he(io,t),$l=e|t.baseLanes}function so(){he(ao,$l),he(io,io.current)}function co(){$l=ao.current,me(io),me(ao)}var lo=pe(null),uo=null;function fo(e){var t=e.alternate;he(P,P.current&1),he(lo,e),uo===null&&(t===null||io.current!==null||t.memoizedState!==null)&&(uo=e)}function po(e){he(P,P.current),he(lo,e),uo===null&&(uo=e)}function mo(e){e.tag===22?(he(P,P.current),he(lo,e),uo===null&&(uo=e)):ho(e)}function ho(){he(P,P.current),he(lo,lo.current)}function go(e){me(lo),uo===e&&(uo=null),me(P)}var P=pe(0);function _o(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_f(n)||vf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vo=0,F=null,yo=null,bo=null,xo=!1,So=!1,Co=!1,wo=0,To=0,Eo=null,Do=0;function Oo(){throw Error(i(321))}function ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mr(e[n],t[n]))return!1;return!0}function Ao(e,t,n,r,i,a){return vo=a,F=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Gs:Ks,Co=!1,a=n(r,i),Co=!1,So&&(a=Mo(t,n,r,i)),jo(e),a}function jo(e){E.H=Ws;var t=yo!==null&&yo.next!==null;if(vo=0,bo=yo=F=null,xo=!1,To=0,Eo=null,t)throw Error(i(300));e===null||lc||(e=e.dependencies,e!==null&&la(e)&&(lc=!0))}function Mo(e,t,n,r){F=e;var a=0;do{if(So&&(Eo=null),To=0,So=!1,25<=a)throw Error(i(301));if(a+=1,bo=yo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}E.H=qs,o=t(n,r)}while(So);return o}function I(){var e=E.H,t=e.useState()[0];return t=typeof t.then==`function`?zo(t):t,e=e.useState()[0],(yo===null?null:yo.memoizedState)!==e&&(F.flags|=1024),t}function No(){var e=wo!==0;return wo=0,e}function Po(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Fo(e){if(xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xo=!1}vo=0,bo=yo=F=null,So=!1,To=wo=0,Eo=null}function Io(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bo===null?F.memoizedState=bo=e:bo=bo.next=e,bo}function Lo(){if(yo===null){var e=F.alternate;e=e===null?null:e.memoizedState}else e=yo.next;var t=bo===null?F.memoizedState:bo.next;if(t!==null)bo=t,yo=e;else{if(e===null)throw F.alternate===null?Error(i(467)):Error(i(310));yo=e,e={memoizedState:yo.memoizedState,baseState:yo.baseState,baseQueue:yo.baseQueue,queue:yo.queue,next:null},bo===null?F.memoizedState=bo=e:bo=bo.next=e}return bo}function Ro(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zo(e){var t=To;return To+=1,Eo===null&&(Eo=[]),e=Fa(Eo,e,t),t=F,(bo===null?t.memoizedState:bo.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Gs:Ks),e}function Bo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return zo(e);if(e.$$typeof===C)return da(e)}throw Error(i(438,String(e)))}function L(e){var t=null,n=F.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=F.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Ro(),F.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ie;return t.index++,n}function Vo(e,t){return typeof t==`function`?t(e):t}function Ho(e){return Uo(Lo(),yo,e)}function Uo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(vo&f)===f:(B&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===xa&&(d=!0);else if((vo&p)===p){u=u.next,p===xa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,F.lanes|=p,tu|=p;f=u.action,Co&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,F.lanes|=f,tu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Mr(o,e.memoizedState)&&(lc=!0,d&&(n=j,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Wo(e){var t=Lo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Mr(o,t.memoizedState)||(lc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Go(e,t,n){var r=F,a=Lo(),o=Wi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Mr((yo||a).memoizedState,n);if(s&&(a.memoizedState=n,lc=!0),a=a.queue,gs(Jo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||bo!==null&&bo.memoizedState.tag&1){if(r.flags|=2048,ds(9,{destroy:void 0},qo.bind(null,r,a,n,t),null),ql===null)throw Error(i(349));o||vo&127||Ko(r,t,n)}return n}function Ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=F.updateQueue,t===null?(t=Ro(),F.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qo(e,t,n,r){t.value=n,t.getSnapshot=r,Yo(t)&&Xo(e)}function Jo(e,t,n){return n(function(){Yo(t)&&Xo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mr(e,n)}catch{return!0}}function Xo(e){var t=fi(e,2);t!==null&&Tu(t,e,2)}function Zo(e){var t=Io();if(typeof e==`function`){var n=e;if(e=n(),Co){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:e},t}function Qo(e,t,n,r){return e.baseState=n,Uo(e,yo,typeof r==`function`?r:Vo)}function $o(e,t,n,r,a){if(Vs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};E.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=E.T,o={};E.T=o;try{var s=n(i,r),c=E.S;c!==null&&c(o,s),ts(e,t,s)}catch(n){rs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),E.T=a}}else try{a=n(i,r),ts(e,t,a)}catch(n){rs(e,t,n)}}function ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ns(e,t,n)},function(n){return rs(e,t,n)}):ns(e,t,n)}function ns(e,t,n){t.status=`fulfilled`,t.value=n,is(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,es(e,n)))}function rs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,is(t),t=t.next;while(t!==r)}e.action=null}function is(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function as(e,t){return t}function os(e,t){if(Wi){var n=ql.formState;if(n!==null){a:{var r=F;if(Wi){if(Ui){b:{for(var i=Ui,a=Ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=bf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ui=bf(i.nextSibling),r=i.data===`F!`;break a}}Ji(r)}r=!1}r&&(t=n[0])}}return n=Io(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:t},n.queue=r,n=Rs.bind(null,F,r),r.dispatch=n,r=Zo(!1),a=Bs.bind(null,F,!1,r.queue),r=Io(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=$o.bind(null,F,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ss(e){return cs(Lo(),yo,e)}function cs(e,t,n){if(t=Uo(e,t,as)[0],e=Ho(Vo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=zo(t)}catch(e){throw e===Aa?Ma:e}else r=t;t=Lo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(F.flags|=2048,ds(9,{destroy:void 0},ls.bind(null,i,n),null)),[r,a,e]}function ls(e,t){e.action=t}function us(e){var t=Lo(),n=yo;if(n!==null)return cs(t,n,e);Lo(),t=t.memoizedState,n=Lo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ds(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=F.updateQueue,t===null&&(t=Ro(),F.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function fs(){return Lo().memoizedState}function ps(e,t,n,r){var i=Io();F.flags|=e,i.memoizedState=ds(1|t,{destroy:void 0},n,r===void 0?null:r)}function ms(e,t,n,r){var i=Lo();r=r===void 0?null:r;var a=i.memoizedState.inst;yo!==null&&r!==null&&ko(r,yo.memoizedState.deps)?i.memoizedState=ds(t,a,n,r):(F.flags|=e,i.memoizedState=ds(1|t,a,n,r))}function hs(e,t){ps(8390656,8,e,t)}function gs(e,t){ms(2048,8,e,t)}function _s(e){F.flags|=4;var t=F.updateQueue;if(t===null)t=Ro(),F.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function vs(e){var t=Lo().memoizedState;return _s({ref:t,nextImpl:e}),function(){if(Kl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ys(e,t){return ms(4,2,e,t)}function bs(e,t){return ms(4,4,e,t)}function xs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ss(e,t,n){n=n==null?null:n.concat([e]),ms(4,4,xs.bind(null,t,e),n)}function Cs(){}function ws(e,t){var n=Lo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ts(e,t){var n=Lo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ko(t,r[1]))return r[0];if(r=e(),Co){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Es(e,t,n){return n===void 0||vo&1073741824&&!(B&261930)?e.memoizedState=t:(e.memoizedState=n,e=wu(),F.lanes|=e,tu|=e,n)}function Ds(e,t,n,r){return Mr(n,t)?n:io.current===null?!(vo&42)||vo&1073741824&&!(B&261930)?(lc=!0,e.memoizedState=n):(e=wu(),F.lanes|=e,tu|=e,t):(e=Es(e,n,r),Mr(e,t)||(lc=!0),e)}function Os(e,t,n,r,i){var a=D.p;D.p=a!==0&&8>a?a:8;var o=E.T,s={};E.T=s,Bs(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?zs(e,t,wa(c,r),Cu(e)):zs(e,t,r,Cu(e))}catch(n){zs(e,t,{then:function(){},status:`rejected`,reason:n},Cu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function ks(){}function As(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=js(e).queue;Os(e,a,t,ue,n===null?ks:function(){return Ms(e),n(r)})}function js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ms(e){var t=js(e);t.next===null&&(t=e.alternate.memoizedState),zs(e,t.next.queue,{},Cu())}function Ns(){return da(up)}function Ps(){return Lo().memoizedState}function Fs(){return Lo().memoizedState}function Is(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=N(n);var r=Xa(t,e,n);r!==null&&(Tu(r,t,n),Za(r,t,n)),t={cache:_a()},e.payload=t;return}t=t.return}}function Ls(e,t,n){var r=Cu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Hs(t,n):(n=di(e,t,n,r),n!==null&&(Tu(n,e,r),Us(n,t,r)))}function Rs(e,t,n){zs(e,t,n,Cu())}function zs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Hs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Mr(s,o))return ui(e,t,i,0),ql===null&&li(),!1}catch{}if(n=di(e,t,i,r),n!==null)return Tu(n,e,r),Us(n,t,r),!0}return!1}function Bs(e,t,n,r){if(r={lane:2,revertLane:Sd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(i(479))}else t=di(e,n,r,2),t!==null&&Tu(t,e,2)}function Vs(e){var t=e.alternate;return e===F||t!==null&&t===F}function Hs(e,t){So=xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Us(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var Ws={readContext:da,use:Bo,useCallback:Oo,useContext:Oo,useEffect:Oo,useImperativeHandle:Oo,useLayoutEffect:Oo,useInsertionEffect:Oo,useMemo:Oo,useReducer:Oo,useRef:Oo,useState:Oo,useDebugValue:Oo,useDeferredValue:Oo,useTransition:Oo,useSyncExternalStore:Oo,useId:Oo,useHostTransitionStatus:Oo,useFormState:Oo,useActionState:Oo,useOptimistic:Oo,useMemoCache:Oo,useCacheRefresh:Oo};Ws.useEffectEvent=Oo;var Gs={readContext:da,use:Bo,useCallback:function(e,t){return Io().memoizedState=[e,t===void 0?null:t],e},useContext:da,useEffect:hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ps(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var n=Io();t=t===void 0?null:t;var r=e();if(Co){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Io();if(n!==void 0){var i=n(t);if(Co){qe(!0);try{n(t)}finally{qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ls.bind(null,F,e),[r.memoizedState,e]},useRef:function(e){var t=Io();return e={current:e},t.memoizedState=e},useState:function(e){e=Zo(e);var t=e.queue,n=Rs.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cs,useDeferredValue:function(e,t){return Es(Io(),e,t)},useTransition:function(){var e=Zo(!1);return e=Os.bind(null,F,e.queue,!0,!1),Io().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=F,a=Io();if(Wi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ql===null)throw Error(i(349));B&127||Ko(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,hs(Jo.bind(null,r,o,e),[e]),r.flags|=2048,ds(9,{destroy:void 0},qo.bind(null,r,o,n,t),null),n},useId:function(){var e=Io(),t=ql.identifierPrefix;if(Wi){var n=Ii,r=Fi;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Do++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ns,useFormState:os,useActionState:os,useOptimistic:function(e){var t=Io();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bs.bind(null,F,!0,n),n.dispatch=t,[e,t]},useMemoCache:L,useCacheRefresh:function(){return Io().memoizedState=Is.bind(null,F)},useEffectEvent:function(e){var t=Io(),n={impl:e};return t.memoizedState=n,function(){if(Kl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ks={readContext:da,use:Bo,useCallback:ws,useContext:da,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Ho,useRef:fs,useState:function(){return Ho(Vo)},useDebugValue:Cs,useDeferredValue:function(e,t){return Ds(Lo(),yo.memoizedState,e,t)},useTransition:function(){var e=Ho(Vo)[0],t=Lo().memoizedState;return[typeof e==`boolean`?e:zo(e),t]},useSyncExternalStore:Go,useId:Ps,useHostTransitionStatus:Ns,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){return Qo(Lo(),yo,e,t)},useMemoCache:L,useCacheRefresh:Fs};Ks.useEffectEvent=vs;var qs={readContext:da,use:Bo,useCallback:ws,useContext:da,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Wo,useRef:fs,useState:function(){return Wo(Vo)},useDebugValue:Cs,useDeferredValue:function(e,t){var n=Lo();return yo===null?Es(n,e,t):Ds(n,yo.memoizedState,e,t)},useTransition:function(){var e=Wo(Vo)[0],t=Lo().memoizedState;return[typeof e==`boolean`?e:zo(e),t]},useSyncExternalStore:Go,useId:Ps,useHostTransitionStatus:Ns,useFormState:us,useActionState:us,useOptimistic:function(e,t){var n=Lo();return yo===null?(n.baseState=e,[e,n.queue.dispatch]):Qo(n,yo,e,t)},useMemoCache:L,useCacheRefresh:Fs};qs.useEffectEvent=vs;function Js(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ys={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=N(r);i.payload=t,n!=null&&(i.callback=n),t=Xa(e,i,r),t!==null&&(Tu(t,e,r),Za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=N(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Xa(e,i,r),t!==null&&(Tu(t,e,r),Za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cu(),r=N(n);r.tag=2,t!=null&&(r.callback=t),t=Xa(e,r,n),t!==null&&(Tu(t,e,n),Za(t,e,n))}};function Xs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!k(n,r)||!k(i,a):!0}function Zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ys.enqueueReplaceState(t,t.state,null)}function Qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function $s(e){ai(e)}function ec(e){console.error(e)}function tc(e){ai(e)}function nc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function rc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ic(e,t,n){return n=N(n),n.tag=3,n.payload={element:null},n.callback=function(){nc(e,t)},n}function ac(e){return e=N(e),e.tag=3,e}function oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){rc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){rc(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function sc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ca(t,n,a,!0),n=lo.current,n!==null){switch(n.tag){case 31:case 13:return uo===null?Lu():n.alternate===null&&eu===0&&(eu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Na?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),nd(e,r,a)),!1;case 22:return n.flags|=65536,r===Na?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),nd(e,r,a)),!1}throw Error(i(435,n.tag))}return nd(e,r,a),Lu(),!1}if(Wi)return t=lo.current,t===null?(r!==qi&&(t=Error(i(423),{cause:r}),ea(Di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Di(r,n),a=ic(e.stateNode,r,a),Qa(e,a),eu!==4&&(eu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==qi&&(e=Error(i(422),{cause:r}),ea(Di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Di(o,n),ou===null?ou=[o]:ou.push(o),eu!==4&&(eu=2),t===null)return!0;r=Di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ic(n.stateNode,r,e),Qa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(pu===null||!pu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ac(a),oc(a,e,n,r),Qa(n,a),!1}n=n.return}while(n!==null);return!1}var cc=Error(i(461)),lc=!1;function uc(e,t,n,r){t.child=e===null?qa(t,null,n,r):Ka(t,e.child,n,r)}function dc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ua(t),r=Ao(e,t,n,o,a,i),s=No(),e!==null&&!lc?(Po(e,t,i),Fc(e,t,i)):(Wi&&s&&zi(t),t.flags|=1,uc(e,t,r,i),t.child)}function fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!vi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,pc(e,t,a,r,i)):(e=xi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ic(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?k:n,n(o,r)&&e.ref===t.ref)return Fc(e,t,i)}return t.flags|=1,e=yi(a,r),e.ref=t.ref,e.return=t,t.child=e}function pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(k(a,r)&&e.ref===t.ref){if(lc=!1,t.pendingProps=r=a,Ic(e,i))e.flags&131072&&(lc=!0);else return t.lanes=e.lanes,Fc(e,t,i)}}return xc(e,t,n,r,i)}function mc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return gc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Oa(t,a===null?null:a.cachePool),a===null?so():oo(t,a),mo(t);else return r=t.lanes=536870912,gc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Oa(t,null),so(),ho(t)):(Oa(t,a.cachePool),oo(t,a),ho(t),t.memoizedState=null);return uc(e,t,i,n),t.child}function hc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gc(e,t,n,r,i){var a=Da();return a=a===null?null:{parent:ga._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Oa(t,null),so(),mo(t),e!==null&&ca(e,t,r,!0),t.childLanes=i,null}function _c(e,t){return t=Ac({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function vc(e,t,n){return Ka(t,e.child,null,n),e=_c(t,t.pendingProps),e.flags|=2,go(t),t.memoizedState=null,e}function yc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Wi){if(r.mode===`hidden`)return e=_c(t,r),t.lanes=536870912,hc(null,e);if(po(t),(e=Ui)?(e=gf(e,Ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,Ui=null)):e=null,e===null)throw Ji(t);return t.lanes=536870912,null}return _c(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(po(t),a){if(t.flags&256)t.flags&=-257,t=vc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(lc||ca(e,t,n,!1),a=(n&e.childLanes)!==0,lc||a){if(r=ql,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,fi(e,s),Tu(r,e,s),cc;Lu(),t=vc(e,t,n)}else e=o.treeContext,Ui=bf(s.nextSibling),Hi=t,Wi=!0,Gi=null,Ki=!1,e!==null&&Vi(t,e),t=_c(t,r),t.flags|=4096;return t}return e=yi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function xc(e,t,n,r,i){return ua(t),n=Ao(e,t,n,r,void 0,i),r=No(),e!==null&&!lc?(Po(e,t,i),Fc(e,t,i)):(Wi&&r&&zi(t),t.flags|=1,uc(e,t,n,i),t.child)}function Sc(e,t,n,r,i,a){return ua(t),t.updateQueue=null,n=Mo(t,r,n,i),jo(e),r=No(),e!==null&&!lc?(Po(e,t,a),Fc(e,t,a)):(Wi&&r&&zi(t),t.flags|=1,uc(e,t,n,a),t.child)}function Cc(e,t,n,r,i){if(ua(t),t.stateNode===null){var a=hi,o=n.contextType;typeof o==`object`&&o&&(a=da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ys,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},M(t),o=n.contextType,a.context=typeof o==`object`&&o?da(o):hi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Js(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ys.enqueueReplaceState(a,a.state,null),to(t,r,a,i),eo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=hi,typeof u==`object`&&u&&(o=da(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Zs(t,a,r,o),Ja=!1;var f=t.memoizedState;a.state=f,to(t,r,a,i),eo(),l=t.memoizedState,s||f!==l||Ja?(typeof d==`function`&&(Js(t,n,d,r),l=t.memoizedState),(c=Ja||Xs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ya(e,t),o=t.memoizedProps,u=Qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=hi,typeof l==`object`&&l&&(c=da(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Zs(t,a,r,c),Ja=!1,f=t.memoizedState,a.state=f,to(t,r,a,i),eo();var p=t.memoizedState;o!==d||f!==p||Ja||e!==null&&e.dependencies!==null&&la(e.dependencies)?(typeof s==`function`&&(Js(t,n,s,r),p=t.memoizedState),(u=Ja||Xs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&la(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,bc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ka(t,e.child,null,i),t.child=Ka(t,null,n,i)):uc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Fc(e,t,i),e}function wc(e,t,n,r){return Qi(),t.flags|=256,uc(e,t,n,r),t.child}var Tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ec(e){return{baseLanes:e,cachePool:ka()}}function Dc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=iu),e}function Oc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(P.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Wi){if(a?fo(t):ho(t),(e=Ui)?(e=gf(e,Ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,Ui=null)):e=null,e===null)throw Ji(t);return vf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ho(t),a=t.mode,c=Ac({mode:`hidden`,children:c},a),r=Si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Ec(n),r.childLanes=Dc(e,s,n),t.memoizedState=Tc,hc(null,r)):(fo(t),kc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(fo(t),t.flags&=-257,t=jc(e,t,n)):t.memoizedState===null?(ho(t),c=r.fallback,a=t.mode,r=Ac({mode:`visible`,children:r.children},a),c=Si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ka(t,e.child,null,n),r=t.child,r.memoizedState=Ec(n),r.childLanes=Dc(e,s,n),t.memoizedState=Tc,t=hc(null,r)):(ho(t),t.child=e.child,t.flags|=128,t=null);else if(fo(t),vf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,ea({value:r,source:null,stack:null}),t=jc(e,t,n)}else if(lc||ca(e,t,n,!1),s=(n&e.childLanes)!==0,lc||s){if(s=ql,s!==null&&(r=dt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,fi(e,r),Tu(s,e,r),cc;_f(c)||Lu(),t=jc(e,t,n)}else _f(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ui=bf(c.nextSibling),Hi=t,Wi=!0,Gi=null,Ki=!1,e!==null&&Vi(t,e),t=kc(t,r.children),t.flags|=4096);return t}return a?(ho(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=yi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=Si(c,a,n,null),c.flags|=2):c=yi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,hc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Ec(n):(a=c.cachePool,a===null?a=ka():(l=ga._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Dc(e,s,n),t.memoizedState=Tc,hc(e.child,r)):(fo(t),n=e.child,e=n.sibling,n=yi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function kc(e,t){return t=Ac({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ac(e,t){return e=_i(22,e,null,t),e.lanes=0,e}function jc(e,t,n){return Ka(t,e.child,null,n),e=kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),oa(e.return,t,n)}function Nc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Pc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=P.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,he(P,o),uc(e,t,r,n),r=Wi?ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Mc(e,n,t);else if(e.tag===19)Mc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&_o(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Nc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&_o(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Nc(t,!0,n,null,a,r);break;case`together`:Nc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Fc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ca(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=yi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ic(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&la(e)))}function Lc(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),ia(t,ga,e.memoizedState.cache),Qi();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:ia(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,po(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(fo(t),e=Fc(e,t,n),e===null?null:e.sibling):Oc(e,t,n):(fo(t),t.flags|=128,null);fo(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Pc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),he(P,P.current),r)break;return null;case 22:return t.lanes=0,mc(e,t,n,t.pendingProps);case 24:ia(t,ga,e.memoizedState.cache)}return Fc(e,t,n)}function Rc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)lc=!0;else{if(!Ic(e,n)&&!(t.flags&128))return lc=!1,Lc(e,t,n);lc=!!(e.flags&131072)}}else lc=!1,Wi&&t.flags&1048576&&Ri(t,ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e==`function`)vi(e)?(r=Qs(e,r),t.tag=1,t=Cc(null,t,e,r,n)):(t.tag=0,t=xc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=dc(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=fc(null,t,e,r,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return xc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Qs(r,t.pendingProps),Cc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ya(e,t),to(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ia(t,ga,r),r!==o.cache&&sa(t,[ga],n,!0),eo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=wc(e,t,r,n);break a}if(r!==a){a=Di(Error(i(424)),t),ea(a),t=wc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ui=bf(e.firstChild),Hi=t,Wi=!0,Gi=null,Ki=!0,n=qa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Qi(),r===a){t=Fc(e,t,n);break a}uc(e,t,r,n)}t=t.child}return t;case 26:return bc(e,t),e===null?(n=Vf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Wi||(n=t.type,e=t.pendingProps,r=Qd(ve.current).createElement(n),r[_t]=t,r[vt]=e,Kd(r,n,e),At(r),t.stateNode=r):t.memoizedState=Vf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&Wi&&(r=t.stateNode=wf(t.type,t.pendingProps,ve.current),Hi=t,Ki=!0,a=Ui,uf(t.type)?(xf=a,Ui=bf(r.firstChild)):Ui=a),uc(e,t,t.pendingProps.children,n),bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Wi&&((a=r=Ui)&&(r=mf(r,t.type,t.pendingProps,Ki),r===null?a=!1:(t.stateNode=r,Hi=t,Ui=bf(r.firstChild),Ki=!1,a=!0)),a||Ji(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,tf(a,o)?r=null:s!==null&&tf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ao(e,t,I,null,null,n),up._currentValue=a),bc(e,t),uc(e,t,r,n),t.child;case 6:return e===null&&Wi&&((e=n=Ui)&&(n=hf(n,t.pendingProps,Ki),n===null?e=!1:(t.stateNode=n,Hi=t,Ui=null,e=!0)),e||Ji(t)),null;case 13:return Oc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ka(t,null,r,n):uc(e,t,r,n),t.child;case 11:return dc(e,t,t.type,t.pendingProps,n);case 7:return uc(e,t,t.pendingProps,n),t.child;case 8:return uc(e,t,t.pendingProps.children,n),t.child;case 12:return uc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ia(t,t.type,r.value),uc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ua(t),a=da(a),r=r(a),t.flags|=1,uc(e,t,r,n),t.child;case 14:return fc(e,t,t.type,t.pendingProps,n);case 15:return pc(e,t,t.type,t.pendingProps,n);case 19:return Pc(e,t,n);case 31:return yc(e,t,n);case 22:return mc(e,t,n,t.pendingProps);case 24:return ua(t),r=da(ga),e===null?(a=Da(),a===null&&(a=ql,o=_a(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},M(t),ia(t,ga,a)):((e.lanes&n)!==0&&(Ya(e,t),to(t,null,null,n),eo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ia(t,ga,r),r!==a.cache&&sa(t,[ga],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ia(t,ga,r))),uc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function zc(e){e.flags|=4}function Bc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Pu())e.flags|=8192;else throw La=Na,ja}}else e.flags&=-16777217}function Vc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!np(t)){if(Pu())e.flags|=8192;else throw La=Na,ja}}function Hc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,au|=t)}function Uc(e,t){if(!Wi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Wc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Gc(e,t,n){var r=t.pendingProps;switch(Bi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wc(t),null;case 1:return Wc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),aa(ga),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Zi(t)?zc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$i())),Wc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(zc(t),o===null?(Wc(t),Bc(t,a,null,r,n)):(Wc(t),Vc(t,o))):o?o===e.memoizedState?(Wc(t),t.flags&=-16777217):(zc(t),Wc(t),Vc(t,o)):(e=e.memoizedProps,e!==r&&zc(t),Wc(t),Bc(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Wc(t),null}e=ge.current,Zi(t)?Yi(t,e):(e=wf(a,r,n),t.stateNode=e,zc(t))}return Wc(t),null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Wc(t),null}if(o=ge.current,Zi(t))Yi(t,o);else{var s=Qd(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[_t]=t,o[vt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Kd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&zc(t)}}return Wc(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,Zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Hi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Ji(t,!0)}else e=Qd(e).createTextNode(r),e[_t]=t,t.stateNode=e}return Wc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[_t]=t}else Qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),e=!1}else n=$i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(go(t),t):(go(t),null);if(t.flags&128)throw Error(i(558))}return Wc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[_t]=t}else Qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),a=!1}else a=$i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(go(t),t):(go(t),null)}return go(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hc(t,t.updateQueue),Wc(t),null);case 4:return xe(),e===null&&Nd(t.stateNode.containerInfo),Wc(t),null;case 10:return aa(t.type),Wc(t),null;case 19:if(me(P),r=t.memoizedState,r===null)return Wc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Uc(r,!1);else{if(eu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=_o(e),o!==null){for(t.flags|=128,Uc(r,!1),e=o.updateQueue,t.updateQueue=e,Hc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bi(n,e),n=n.sibling;return he(P,P.current&1|2),Wi&&Li(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>du&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=_o(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Hc(t,e),Uc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Wi)return Wc(t),null}else 2*Ie()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Wc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,n=P.current,he(P,a?n&1|2:n&1),Wi&&Li(t,r.treeForkCount),e);case 22:case 23:return go(t),co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Wc(t),t.subtreeFlags&6&&(t.flags|=8192)):Wc(t),n=t.updateQueue,n!==null&&Hc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(Ea),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),aa(ga),Wc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Kc(e,t){switch(Bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(ga),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(go(t),t.alternate===null)throw Error(i(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(go(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(P),null;case 4:return xe(),null;case 10:return aa(t.type),null;case 22:case 23:return go(t),co(),e!==null&&me(Ea),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return aa(ga),null;case 25:return null;default:return null}}function qc(e,t){switch(Bi(t),t.tag){case 3:aa(ga),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&go(t);break;case 13:go(t);break;case 19:me(P);break;case 10:aa(t.type);break;case 22:case 23:go(t),co(),e!==null&&me(Ea);break;case 24:aa(ga)}}function Jc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){td(t,t.return,e)}}function Yc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){td(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){td(t,t.return,e)}}function Xc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ro(t,n)}catch(t){td(e,e.return,t)}}}function Zc(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){td(e,t,n)}}function Qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){td(e,t,n)}}function $c(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){td(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){td(e,t,n)}else n.current=null}}function el(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){td(e,e.return,t)}}function tl(e,t,n){try{var r=e.stateNode;qd(r,e.type,n,t),r[vt]=t}catch(t){td(e,e.return,t)}}function nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&uf(e.type)||e.tag===4}function rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&uf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=dn));else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Kd(t,r,n),t[_t]=e,t[vt]=n}catch(t){td(e,e.return,t)}}var sl=!1,cl=!1,ll=!1,ul=typeof WeakSet==`function`?WeakSet:Set,dl=null;function fl(e,t){if(e=e.containerInfo,Xd=yp,e=Ir(e),Lr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},yp=!1,dl=t;dl!==null;)if(t=dl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,dl=e;else for(;dl!==null;){switch(t=dl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){td(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:pf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,dl=e;break}dl=t.return}}function pl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Dl(e,n),r&4&&Jc(5,n);break;case 1:if(Dl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){td(n,n.return,e)}else{var i=Qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){td(n,n.return,e)}}}r&64&&Xc(n),r&512&&Qc(n,n.return);break;case 3:if(Dl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ro(e,t)}catch(e){td(n,n.return,e)}}break;case 27:t===null&&r&4&&ol(n);case 26:case 5:Dl(e,n),t===null&&r&4&&el(n),r&512&&Qc(n,n.return);break;case 12:Dl(e,n);break;case 31:Dl(e,n),r&4&&yl(e,n);break;case 13:Dl(e,n),r&4&&bl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ad.bind(null,n),yf(e,n))));break;case 22:if(r=n.memoizedState!==null||sl,!r){t=t!==null&&t.memoizedState!==null||cl,i=sl;var a=cl;sl=r,(cl=t)&&!a?kl(e,n,!!(n.subtreeFlags&8772)):Dl(e,n),sl=i,cl=a}break;case 30:break;default:Dl(e,n)}}function ml(e){var t=e.alternate;t!==null&&(e.alternate=null,ml(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var hl=null,gl=!1;function _l(e,t,n){for(n=n.child;n!==null;)vl(e,t,n),n=n.sibling}function vl(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:cl||$c(n,t),_l(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cl||$c(n,t);var r=hl,i=gl;uf(n.type)&&(hl=n.stateNode,gl=!1),_l(e,t,n),Tf(n.stateNode),hl=r,gl=i;break;case 5:cl||$c(n,t);case 6:if(r=hl,i=gl,hl=null,_l(e,t,n),hl=r,gl=i,hl!==null){if(gl)try{(hl.nodeType===9?hl.body:hl.nodeName===`HTML`?hl.ownerDocument.body:hl).removeChild(n.stateNode)}catch(e){td(n,t,e)}else try{hl.removeChild(n.stateNode)}catch(e){td(n,t,e)}}break;case 18:hl!==null&&(gl?(e=hl,df(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gp(e)):df(hl,n.stateNode));break;case 4:r=hl,i=gl,hl=n.stateNode.containerInfo,gl=!0,_l(e,t,n),hl=r,gl=i;break;case 0:case 11:case 14:case 15:Yc(2,n,t),cl||Yc(4,n,t),_l(e,t,n);break;case 1:cl||($c(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Zc(n,t,r)),_l(e,t,n);break;case 21:_l(e,t,n);break;case 22:cl=(r=cl)||n.memoizedState!==null,_l(e,t,n),cl=r;break;default:_l(e,t,n)}}function yl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gp(e)}catch(e){td(t,t.return,e)}}}function bl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gp(e)}catch(e){td(t,t.return,e)}}function xl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ul),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ul),t;default:throw Error(i(435,e.tag))}}function Sl(e,t){var n=xl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=od.bind(null,e,t);t.then(r,r)}})}function Cl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(uf(c.type)){hl=c.stateNode,gl=!1;break a}break;case 5:hl=c.stateNode,gl=!1;break a;case 3:case 4:hl=c.stateNode.containerInfo,gl=!0;break a}c=c.return}if(hl===null)throw Error(i(160));vl(o,s,a),hl=null,gl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)R(t,e),t=t.sibling}var wl=null;function R(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Cl(t,e),Tl(e),r&4&&(Yc(3,e,e.return),Jc(3,e),Yc(5,e,e.return));break;case 1:Cl(t,e),Tl(e),r&512&&(cl||n===null||$c(n,n.return)),r&64&&sl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=wl;if(Cl(t,e),Tl(e),r&512&&(cl||n===null||$c(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[wt]||o[_t]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Kd(o,r,n),o[_t]=e,At(o),r=o;break a;case`link`:var s=$f(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=$f(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[_t]=e,At(o),r=o}e.stateNode=r}else ep(a,e.type,e.stateNode)}else e.stateNode=Jf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&tl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?ep(a,e.type,e.stateNode):Jf(a,r,e.memoizedProps))}break;case 27:Cl(t,e),Tl(e),r&512&&(cl||n===null||$c(n,n.return)),n!==null&&r&4&&tl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cl(t,e),Tl(e),r&512&&(cl||n===null||$c(n,n.return)),e.flags&32){a=e.stateNode;try{nn(a,``)}catch(t){td(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,tl(e,a,n===null?a:n.memoizedProps)),r&1024&&(ll=!0);break;case 6:if(Cl(t,e),Tl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){td(e,e.return,t)}}break;case 3:if(Qf=null,a=wl,wl=Of(t.containerInfo),Cl(t,e),wl=a,Tl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gp(t.containerInfo)}catch(t){td(e,e.return,t)}ll&&(ll=!1,El(e));break;case 4:r=wl,wl=Of(e.stateNode.containerInfo),Cl(t,e),Tl(e),wl=r;break;case 12:Cl(t,e),Tl(e);break;case 31:Cl(t,e),Tl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 13:Cl(t,e),Tl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lu=Ie()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=sl,d=cl;if(sl=u||a,cl=d||l,Cl(t,e),cl=d,sl=u,Tl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||sl||cl||Ol(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){td(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){td(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ff(m,!0):ff(l.stateNode,!1)}catch(e){td(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Sl(e,n))));break;case 19:Cl(t,e),Tl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 30:break;case 21:break;default:Cl(t,e),Tl(e)}}function Tl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(nl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;al(e,rl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(nn(o,``),n.flags&=-33),al(e,rl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;il(e,rl(e),s);break;default:throw Error(i(161))}}catch(t){td(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function El(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;El(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Dl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pl(e,t.alternate,t),t=t.sibling}function Ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Yc(4,t,t.return),Ol(t);break;case 1:$c(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Zc(t,t.return,n),Ol(t);break;case 27:Tf(t.stateNode);case 26:case 5:$c(t,t.return),Ol(t);break;case 22:t.memoizedState===null&&Ol(t);break;case 30:Ol(t);break;default:Ol(t)}e=e.sibling}}function kl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:kl(i,a,n),Jc(4,a);break;case 1:if(kl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){td(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)no(c[i],s)}catch(e){td(r,r.return,e)}}n&&o&64&&Xc(a),Qc(a,a.return);break;case 27:ol(a);case 26:case 5:kl(i,a,n),n&&r===null&&o&4&&el(a),Qc(a,a.return);break;case 12:kl(i,a,n);break;case 31:kl(i,a,n),n&&o&4&&yl(i,a);break;case 13:kl(i,a,n),n&&o&4&&bl(i,a);break;case 22:a.memoizedState===null&&kl(i,a,n),Qc(a,a.return);break;case 30:break;default:kl(i,a,n)}t=t.sibling}}function Al(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&va(n))}function jl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&va(e))}function Ml(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Nl(e,t,n,r),t=t.sibling}function Nl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ml(e,t,n,r),i&2048&&Jc(9,t);break;case 1:Ml(e,t,n,r);break;case 3:Ml(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&va(e)));break;case 12:if(i&2048){Ml(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){td(t,t.return,e)}}else Ml(e,t,n,r);break;case 31:Ml(e,t,n,r);break;case 13:Ml(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ml(e,t,n,r):(a._visibility|=2,Pl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Ml(e,t,n,r):Fl(e,t),i&2048&&Al(o,t);break;case 24:Ml(e,t,n,r),i&2048&&jl(t.alternate,t);break;default:Ml(e,t,n,r)}}function Pl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Pl(a,o,s,c,i),Jc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Pl(a,o,s,c,i)):u._visibility&2?Pl(a,o,s,c,i):Fl(a,o),i&&l&2048&&Al(o.alternate,o);break;case 24:Pl(a,o,s,c,i),i&&l&2048&&jl(o.alternate,o);break;default:Pl(a,o,s,c,i)}t=t.sibling}}function Fl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Fl(n,r),i&2048&&Al(r.alternate,r);break;case 24:Fl(n,r),i&2048&&jl(r.alternate,r);break;default:Fl(n,r)}t=t.sibling}}var Il=8192;function Ll(e,t,n){if(e.subtreeFlags&Il)for(e=e.child;e!==null;)Rl(e,t,n),e=e.sibling}function Rl(e,t,n){switch(e.tag){case 26:Ll(e,t,n),e.flags&Il&&e.memoizedState!==null&&rp(n,wl,e.memoizedState,e.memoizedProps);break;case 5:Ll(e,t,n);break;case 3:case 4:var r=wl;wl=Of(e.stateNode.containerInfo),Ll(e,t,n),wl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Il,Il=16777216,Ll(e,t,n),Il=r):Ll(e,t,n));break;default:Ll(e,t,n)}}function zl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];dl=r,Ul(r,e)}zl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vl(e),e=e.sibling}function Vl(e){switch(e.tag){case 0:case 11:case 15:Bl(e),e.flags&2048&&Yc(9,e,e.return);break;case 3:Bl(e);break;case 12:Bl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hl(e)):Bl(e);break;default:Bl(e)}}function Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];dl=r,Ul(r,e)}zl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Yc(8,t,t.return),Hl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hl(t));break;default:Hl(t)}e=e.sibling}}function Ul(e,t){for(;dl!==null;){var n=dl;switch(n.tag){case 0:case 11:case 15:Yc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:va(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,dl=r;else a:for(n=e;dl!==null;){r=dl;var i=r.sibling,a=r.return;if(ml(r),r===n){dl=null;break a}if(i!==null){i.return=a,dl=i;break a}dl=a}}}var Wl={getCacheForType:function(e){var t=da(ga),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return da(ga).controller.signal}},Gl=typeof WeakMap==`function`?WeakMap:Map,Kl=0,ql=null,z=null,B=0,Jl=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=null,su=null,cu=!1,lu=0,uu=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,yu=null,bu=null,xu=0,Su=null;function Cu(){return Kl&2&&B!==0?B&-B:E.T===null?mt():Sd()}function wu(){if(iu===0){if(!(B&536870912)||Wi){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),iu=e}else iu=536870912}return e=lo.current,e!==null&&(e.flags|=32),iu}function Tu(e,t,n){(e===ql&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)&&(Mu(e,0),ku(e,B,iu,!1)),st(e,n),(!(Kl&2)||e!==ql)&&(e===ql&&(!(Kl&2)&&(nu|=n),eu===4&&ku(e,B,iu,!1)),md(e))}function Eu(e,t,n){if(Kl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||rt(e,t),a=r?Bu(e,t):Ru(e,t,!0),o=r;do{if(a===0){Zl&&!r&&ku(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ou(n)){a=Ru(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ou;var l=c.current.memoizedState.isDehydrated;if(l&&(Mu(c,s).flags|=256),s=Ru(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,nu|=o,a=4;break a}o=su,su=a,o!==null&&(su===null?su=o:su.push.apply(su,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Mu(e,0),ku(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ku(r,t,iu,!Xl);break a;case 2:su=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=lu+300-Ie(),10<a)){if(ku(r,t,iu,!Xl),nt(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=af(Du.bind(null,r,n,su,fu,cu,t,iu,nu,au,Xl,o,`Throttled`,-0,0),a);break a}Du(r,n,su,fu,cu,t,iu,nu,au,Xl,o,null,-0,0)}break}while(1);md(e)}function Du(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dn},Rl(t,a,d);var m=(a&62914560)===a?lu-Ie():(a&4194048)===a?uu-Ie():0;if(m=ap(d,m),m!==null){_u=a,e.cancelPendingCommit=m(qu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ku(e,a,o,!l);return}}qu(e,t,a,n,r,i,o,s,c)}function Ou(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Mr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ku(e,t,n,r){t&=~ru,t&=~nu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&<(e,n,t)}function Au(){return Kl&6?!0:(hd(0,!1),!1)}function ju(){if(z!==null){if(Jl===0)var e=z.return;else e=z,ra=na=null,Fo(e),Ba=null,Va=0,e=z;for(;e!==null;)qc(e.alternate,e),e=e.return;z=null}}function Mu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,of(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,ju(),ql=e,z=n=yi(e.current,null),B=t,Jl=0,Yl=null,Xl=!1,Zl=rt(e,t),Ql=!1,au=iu=ru=nu=tu=eu=0,su=ou=null,cu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Je(r),a=1<<i;t|=e[i],r&=~a}return $l=t,li(),n}function Nu(e,t){F=null,E.H=Ws,t===Aa||t===Ma?(t=Ra(),Jl=3):t===ja?(t=Ra(),Jl=4):Jl=t===cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,z===null&&(eu=1,nc(e,Di(t,e.current)))}function Pu(){var e=lo.current;return e===null?!0:(B&4194048)===B?uo===null:(B&62914560)===B||B&536870912?e===uo:!1}function Fu(){var e=E.H;return E.H=Ws,e===null?Ws:e}function Iu(){var e=E.A;return E.A=Wl,e}function Lu(){eu=4,Xl||(B&4194048)!==B&&lo.current!==null||(Zl=!0),!(tu&134217727)&&!(nu&134217727)||ql===null||ku(ql,B,iu,!1)}function Ru(e,t,n){var r=Kl;Kl|=2;var i=Fu(),a=Iu();(ql!==e||B!==t)&&(fu=null,Mu(e,t)),t=!1;var o=eu;a:do try{if(Jl!==0&&z!==null){var s=z,c=Yl;switch(Jl){case 8:ju(),o=6;break a;case 3:case 2:case 9:case 6:lo.current===null&&(t=!0);var l=Jl;if(Jl=0,Yl=null,Wu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=Jl,Jl=0,Yl=null,Wu(e,s,c,l)}}zu(),o=eu;break}catch(t){Nu(e,t)}while(1);return t&&e.shellSuspendCounter++,ra=na=null,Kl=r,E.H=i,E.A=a,z===null&&(ql=null,B=0,li()),o}function zu(){for(;z!==null;)Hu(z)}function Bu(e,t){var n=Kl;Kl|=2;var r=Fu(),a=Iu();ql!==e||B!==t?(fu=null,du=Ie()+500,Mu(e,t)):Zl=rt(e,t);a:do try{if(Jl!==0&&z!==null){t=z;var o=Yl;b:switch(Jl){case 1:Jl=0,Yl=null,Wu(e,t,o,1);break;case 2:case 9:if(Pa(o)){Jl=0,Yl=null,Uu(t);break}t=function(){Jl!==2&&Jl!==9||ql!==e||(Jl=7),md(e)},o.then(t,t);break a;case 3:Jl=7;break a;case 4:Jl=5;break a;case 7:Pa(o)?(Jl=0,Yl=null,Uu(t)):(Jl=0,Yl=null,Wu(e,t,o,7));break;case 5:var s=null;switch(z.tag){case 26:s=z.memoizedState;case 5:case 27:var c=z;if(s?np(s):c.stateNode.complete){Jl=0,Yl=null;var l=c.sibling;if(l!==null)z=l;else{var u=c.return;u===null?z=null:(z=u,Gu(u))}break b}}Jl=0,Yl=null,Wu(e,t,o,5);break;case 6:Jl=0,Yl=null,Wu(e,t,o,6);break;case 8:ju(),eu=6;break a;default:throw Error(i(462))}}Vu();break}catch(t){Nu(e,t)}while(1);return ra=na=null,E.H=r,E.A=a,Kl=n,z===null?(ql=null,B=0,li(),eu):0}function Vu(){for(;z!==null&&!Pe();)Hu(z)}function Hu(e){var t=Rc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Gu(e):z=t}function Uu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Sc(n,t,t.pendingProps,t.type,void 0,B);break;case 11:t=Sc(n,t,t.pendingProps,t.type.render,t.ref,B);break;case 5:Fo(t);default:qc(n,t),t=z=bi(t,$l),t=Rc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Gu(e):z=t}function Wu(e,t,n,r){ra=na=null,Fo(t),Ba=null,Va=0;var i=t.return;try{if(sc(e,i,t,n,B)){eu=1,nc(e,Di(n,e.current)),z=null;return}}catch(t){if(i!==null)throw z=i,t;eu=1,nc(e,Di(n,e.current)),z=null;return}t.flags&32768?(Wi||r===1?e=!0:Zl||B&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=lo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ku(t,e)):Gu(t)}function Gu(e){var t=e;do{if(t.flags&32768){Ku(t,Xl);return}e=t.return;var n=Gc(t.alternate,t,$l);if(n!==null){z=n;return}if(t=t.sibling,t!==null){z=t;return}z=t=e}while(t!==null);eu===0&&(eu=5)}function Ku(e,t){do{var n=Kc(e.alternate,e);if(n!==null){n.flags&=32767,z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){z=e;return}z=e=n}while(e!==null);eu=6,z=null}function qu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Qu();while(mu!==0);if(Kl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ci,ct(e,n,o,s,c,l),e===ql&&(z=ql=null,B=0),gu=t,hu=e,_u=n,vu=o,yu=a,bu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,sd(Be,function(){return $u(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=E.T,E.T=null,a=D.p,D.p=2,s=Kl,Kl|=4;try{fl(e,t,n)}finally{Kl=s,D.p=a,E.T=r}}mu=1,Ju(),Yu(),Xu()}}function Ju(){if(mu===1){mu=0;var e=hu,t=gu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=Kl;Kl|=4;try{R(t,e);var a=Zd,o=Ir(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Fr(s.ownerDocument.documentElement,s)){if(c!==null&&Lr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Pr(s,h),v=Pr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}yp=!!Xd,Zd=Xd=null}finally{Kl=i,D.p=r,E.T=n}}e.current=t,mu=2}}function Yu(){if(mu===2){mu=0;var e=hu,t=gu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=Kl;Kl|=4;try{pl(e,t.alternate,t)}finally{Kl=i,D.p=r,E.T=n}}mu=3}}function Xu(){if(mu===4||mu===3){mu=0,Fe();var e=hu,t=gu,n=_u,r=bu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=null),pt(n),t=t.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=E.T,i=D.p,D.p=2,E.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{E.T=t,D.p=i}}_u&3&&Qu(),md(e),i=e.pendingLanes,n&261930&&i&42?e===Su?xu++:(xu=0,Su=e):xu=0,hd(0,!1)}}function Zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,va(t)))}function Qu(){return Ju(),Yu(),Xu(),$u()}function $u(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=pt(_u),r=E.T,a=D.p;try{D.p=32>n?32:n,E.T=null,n=yu,yu=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,Kl&6)throw Error(i(331));var c=Kl;if(Kl|=4,Vl(o.current),Nl(o,o.current,s,n),Kl=c,hd(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{D.p=a,E.T=r,Zu(e,t)}}function ed(e,t,n){t=Di(n,t),t=ic(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(st(e,2),md(e))}function td(e,t,n){if(e.tag===3)ed(e,e,n);else for(;t!==null;){if(t.tag===3){ed(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=Di(n,e),n=ac(2),r=Xa(t,n,2),r!==null&&(oc(n,r,t,e),st(r,2),md(r));break}}t=t.return}}function nd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Gl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ql=!0,i.add(n),e=rd.bind(null,e,t,n),t.then(e,e))}function rd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ql===e&&(B&n)===n&&(eu===4||eu===3&&(B&62914560)===B&&300>Ie()-lu?!(Kl&2)&&Mu(e,0):ru|=n,au===B&&(au=0)),md(e)}function id(e,t){t===0&&(t=at()),e=fi(e,t),e!==null&&(st(e,t),md(e))}function ad(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),id(e,n)}function od(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),id(e,n)}function sd(e,t){return Me(e,t)}var cd=null,ld=null,ud=!1,dd=!1,fd=!1,pd=0;function md(e){e!==ld&&e.next===null&&(ld===null?cd=ld=e:ld=ld.next=e),dd=!0,ud||(ud=!0,xd())}function hd(e,t){if(!fd&&dd){fd=!0;do for(var n=!1,r=cd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,bd(r,a))}else a=B,a=nt(r,r===ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,bd(r,a))}r=r.next}while(n);fd=!1}}function gd(){_d()}function _d(){dd=ud=!1;var e=0;pd!==0&&rf()&&(e=pd);for(var t=Ie(),n=null,r=cd;r!==null;){var i=r.next,a=vd(r,t);a===0?(r.next=null,n===null?cd=i:n.next=i,i===null&&(ld=n)):(n=r,(e!==0||a&3)&&(dd=!0)),r=i}mu!==0&&mu!==5||hd(e,!1),pd!==0&&(pd=0)}function vd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ql,n=B,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),pt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=yd.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function yd(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qu()&&e.callbackNode!==n)return null;var r=B;return r=nt(e,e===ql?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Eu(e,r,t),vd(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?yd.bind(null,e):null)}function bd(e,t){if(Qu())return null;Eu(e,t,!0)}function xd(){cf(function(){Kl&6?Me(Re,gd):_d()})}function Sd(){if(pd===0){var e=xa;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),pd=e}return pd}function Cd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:un(``+e)}function wd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Td(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Cd((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?Cd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(pd!==0){var e=o?wd(i,o):new FormData(i);As(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?wd(i,o):new FormData(i),As(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ed=0;Ed<ri.length;Ed++){var Dd=ri[Ed];ii(Dd.toLowerCase(),`on`+(Dd[0].toUpperCase()+Dd.slice(1)))}ii(Yr,`onAnimationEnd`),ii(Xr,`onAnimationIteration`),ii(Zr,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii(Qr,`onTransitionRun`),ii($r,`onTransitionStart`),ii(ei,`onTransitionCancel`),ii(ti,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Od=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),kd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Od));function Ad(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ai(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ai(e)}i.currentTarget=null,a=c}}}}function V(e,t){var n=t[bt];n===void 0&&(n=t[bt]=new Set);var r=e+`__bubble`;n.has(r)||(Pd(t,e,2,!1),n.add(r))}function jd(e,t,n){var r=0;t&&(r|=4),Pd(n,e,r,t)}var Md=`_reactListening`+Math.random().toString(36).slice(2);function Nd(e){if(!e[Md]){e[Md]=!0,jt.forEach(function(t){t!==`selectionchange`&&(kd.has(t)||jd(t,!1,e),jd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Md]||(t[Md]=!0,jd(`selectionchange`,!1,t))}}function Pd(e,t,n,r){switch(Ep(t)){case 2:var i=bp;break;case 8:i=xp;break;default:i=Sp}n=i.bind(null,t,n,e),i=void 0,!xn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Fd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Et(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}vn(function(){var r=a,i=pn(n),o=[];a:{var s=ni.get(e);if(s!==void 0){var l=Mn,u=e;switch(e){case`keypress`:if(Dn(n)===0)break a;case`keydown`:case`keyup`:l=Yn;break;case`focusin`:u=`focus`,l=Vn;break;case`focusout`:u=`blur`,l=Vn;break;case`beforeblur`:case`afterblur`:l=Vn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=zn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Zn;break;case Yr:case Xr:case Zr:l=Hn;break;case ti:l=Qn;break;case`scroll`:case`scrollend`:l=Pn;break;case`wheel`:l=$n;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Xn;break;case`toggle`:case`beforetoggle`:l=er}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=yn(m,p),g!=null&&d.push(Id(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==fn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[yt]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?Et(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Xn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:Ot(l),h=u==null?s:Ot(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Rd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&zd(o,s,l,d,!1),u!==null&&f!==null&&zd(o,f,u,d,!0)}}a:{if(s=r?Ot(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=br;else if(mr(s)){if(xr)v=Ar;else{v=Or;var y=Dr}}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&sn(r.elementType)&&(v=br):v=kr;if(v&&=v(e,r)){hr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Qt(s,`number`,s.value)}switch(y=r?Ot(r):window,e){case`focusin`:(mr(y)||y.contentEditable===`true`)&&(zr=y,Br=r,Vr=null);break;case`focusout`:Vr=Br=zr=null;break;case`mousedown`:Hr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Hr=!1,Ur(o,n,i);break;case`selectionchange`:if(Rr)break;case`keydown`:case`keyup`:Ur(o,n,i)}var b;if(nr)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else ur?cr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(ar&&n.locale!==`ko`&&(ur||x!==`onCompositionStart`?x===`onCompositionEnd`&&ur&&(b=En()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,ur=!0)),y=Ld(r,x),0<y.length&&(x=new Wn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=lr(n),b!==null&&(x.data=b)))),(b=ir?dr(e,n):fr(e,n))&&(x=Ld(r,`onBeforeInput`),0<x.length&&(y=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),Td(o,e,r,n,i)}Ad(o,t)})}function Id(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ld(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=yn(e,n),i!=null&&r.unshift(Id(e,i,a)),i=yn(e,t),i!=null&&r.push(Id(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Rd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=yn(n,a),l!=null&&o.unshift(Id(n,l,c))):i||(l=yn(n,a),l!=null&&o.push(Id(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Bd=/\r\n?/g,Vd=/\u0000|\uFFFD/g;function Hd(e){return(typeof e==`string`?e:``+e).replace(Bd,`
|
|
9
|
-
`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function Wd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&nn(e,``+r);break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:on(e,r,o);break;case`data`:if(t!==`object`){Bt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Wd(e,t,`name`,a.name,a,null),Wd(e,t,`formEncType`,a.formEncType,a,null),Wd(e,t,`formMethod`,a.formMethod,a,null),Wd(e,t,`formTarget`,a.formTarget,a,null)):(Wd(e,t,`encType`,a.encType,a,null),Wd(e,t,`method`,a.method,a,null),Wd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`onScroll`:r!=null&&V(`scroll`,e);break;case`onScrollEnd`:r!=null&&V(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=un(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:V(`beforetoggle`,e),V(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=cn.get(n)||n,zt(e,n,r))}}function Gd(e,t,n,r,a,o){switch(n){case`style`:on(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&nn(e,``+r);break;case`onScroll`:r!=null&&V(`scroll`,e);break;case`onScrollEnd`:r!=null&&V(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[vt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}}}function Kd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:V(`error`,e),V(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Wd(e,t,o,s,n,null)}}a&&Wd(e,t,`srcSet`,n.srcSet,n,null),r&&Wd(e,t,`src`,n.src,n,null);return;case`input`:V(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Wd(e,t,r,d,n,null)}}Zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in V(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Wd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&$t(e,!!r,n,!0):$t(e,!!r,t,!1);return;case`textarea`:for(s in V(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Wd(e,t,s,c,n,null)}tn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Wd(e,t,l,r,n,null)}return;case`dialog`:V(`beforetoggle`,e),V(`toggle`,e),V(`cancel`,e),V(`close`,e);break;case`iframe`:case`object`:V(`load`,e);break;case`video`:case`audio`:for(r=0;r<Od.length;r++)V(Od[r],e);break;case`image`:V(`error`,e),V(`load`,e);break;case`details`:V(`toggle`,e);break;case`embed`:case`source`:case`link`:V(`error`,e),V(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Wd(e,t,u,r,n,null)}return;default:if(sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Gd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Wd(e,t,c,r,n,null))}function qd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Wd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Wd(e,t,p,m,r,f)}}Xt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Wd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Wd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?$t(e,!!n,n?[]:``,!1):$t(e,!!n,t,!0)):$t(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Wd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Wd(e,t,s,a,r,o)}en(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Wd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Wd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Wd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Wd(e,t,u,p,r,m)}return;default:if(sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Gd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Gd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Wd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Wd(e,t,f,p,r,m)}function Jd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Yd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Jd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Jd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Xd=null,Zd=null;function Qd(e){return e.nodeType===9?e:e.ownerDocument}function $d(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function ef(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function tf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nf=null;function rf(){var e=window.event;return e&&e.type===`popstate`?e!==nf&&(nf=e,!0):(nf=null,!1)}var af=typeof setTimeout==`function`?setTimeout:void 0,of=typeof clearTimeout==`function`?clearTimeout:void 0,sf=typeof Promise==`function`?Promise:void 0,cf=typeof queueMicrotask==`function`?queueMicrotask:sf===void 0?af:function(e){return sf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tf(e.ownerDocument.body)}n=i}while(n);Gp(t)}function ff(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function pf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pf(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[wt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=bf(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bf(e.nextSibling),e===null))return null;return e}function gf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bf(e.nextSibling),e===null))return null;return e}function _f(e){return e.data===`$?`||e.data===`$~`}function vf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function yf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function bf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var xf=null;function Sf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function wf(e,t,n){switch(t=Qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var Ef=new Map,Df=new Set;function Of(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var kf=D.d;D.d={f:Af,r:jf,D:Pf,C:Ff,L:If,m:Lf,X:zf,S:Rf,M:Bf};function Af(){var e=kf.f(),t=Au();return e||t}function jf(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?Ms(t):kf.r(e)}var Mf=typeof document>`u`?null:document;function Nf(e,t,n){var r=Mf;if(r&&typeof t==`string`&&t){var i=Yt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Df.has(i)||(Df.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),At(t),r.head.appendChild(t)))}}function Pf(e){kf.D(e),Nf(`dns-prefetch`,e,null)}function Ff(e,t){kf.C(e,t),Nf(`preconnect`,e,t)}function If(e,t,n){kf.L(e,t,n);var r=Mf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Yt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Yt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Yt(n.imageSizes)+`"]`)):i+=`[href="`+Yt(e)+`"]`;var a=i;switch(t){case`style`:a=Hf(e);break;case`script`:a=Kf(e)}Ef.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Ef.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Uf(a))||t===`script`&&r.querySelector(qf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),At(t),r.head.appendChild(t)))}}function Lf(e,t){kf.m(e,t);var n=Mf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Yt(r)+`"][href="`+Yt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Kf(e)}if(!Ef.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Ef.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),At(r),n.head.appendChild(r)}}}function Rf(e,t,n){kf.S(e,t,n);var r=Mf;if(r&&e){var i=kt(r).hoistableStyles,a=Hf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Uf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Ef.get(a))&&Xf(e,n);var c=o=r.createElement(`link`);At(c),Kd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Yf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zf(e,t){kf.X(e,t);var n=Mf;if(n&&e){var r=kt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=h({src:e,async:!0},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),At(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t){kf.M(e,t);var n=Mf;if(n&&e){var r=kt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),At(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t,n,r){var a=(a=ve.current)?Of(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Hf(n.href),n=kt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hf(n.href);var o=kt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Uf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Ef.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ef.set(e,n),o||Gf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Kf(n),n=kt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hf(e){return`href="`+Yt(e)+`"`}function Uf(e){return`link[rel="stylesheet"][`+e+`]`}function Wf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Gf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Kd(t,`link`,n),At(t),e.head.appendChild(t))}function Kf(e){return`[src="`+Yt(e)+`"]`}function qf(e){return`script[async]`+e}function Jf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Yt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),Kd(r,`style`,a),Yf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hf(n.href);var o=e.querySelector(Uf(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Wf(n),(a=Ef.get(a))&&Xf(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,Yf(o,n.precedence,e),t.instance=o;case`script`:return o=Kf(n.src),(a=e.querySelector(qf(o)))?(t.instance=a,At(a),a):(r=n,(a=Ef.get(o))&&(r=h({},n),Zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),Kd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Yf(r,n.precedence,e));return t.instance}function Yf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qf=null;function $f(e,t,n){if(Qf===null){var r=new Map,i=Qf=new Map;i.set(n,r)}else i=Qf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[wt]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function ep(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function tp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function np(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hf(r.href),a=t.querySelector(Uf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Wf(r),(i=Ef.get(i))&&Xf(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ip===0&&(ip=62500*Yd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=op.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var up={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function dp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=_i(3,null,null,t),e.current=a,a.stateNode=e,t=_a(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},M(a),e}function pp(e){return e?(e=hi,e):hi}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=N(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Xa(e,r,t),n!==null&&(Tu(n,e,t),Za(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&Tu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=Cu();t=ft(t);var n=fi(e,t);n!==null&&Tu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,Sp(e,t,n,r)}finally{D.p=a,E.T=i}}function xp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,Sp(e,t,n,r)}finally{D.p=a,E.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Fd(e,t,r,wp,n),Fp(e,r);else if(Lp(i,e,t,n,r))r.stopPropagation();else if(Fp(e,r),t&4&&-1<Pp.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}md(a),!(Kl&6)&&(du=Ie()+500,hd(0,!1))}}break;case 31:case 13:s=fi(a,2),s!==null&&Tu(s,a,2),Au(),gp(a,2)}if(a=Cp(r),a===null&&Fd(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function Cp(e){return e=pn(e),Tp(e)}var wp=null;function Tp(e){if(wp=null,e=Et(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return wp=e,null}function Ep(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Fp(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function Ip(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lp(e,t,n,r,i){switch(t){case`focusin`:return Op=Ip(Op,e,t,n,r,i),!0;case`dragenter`:return kp=Ip(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=Ip(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,Ip(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,Ip(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function Rp(e){var t=Et(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,ht(e.priority,function(){vp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,ht(e.priority,function(){vp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fn=r,n.target.dispatchEvent(r),fn=null}else return t=Dt(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){zp(e)&&n.delete(t)}function Vp(){Dp=!1,Op!==null&&zp(Op)&&(Op=null),kp!==null&&zp(kp)&&(kp=null),Ap!==null&&zp(Ap)&&(Ap=null),jp.forEach(Bp),Mp.forEach(Bp)}function Hp(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vp)))}var Up=null;function Wp(e){Up!==e&&(Up=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Up===e&&(Up=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Tp(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,As(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gp(e){function t(t){return Hp(t,e)}Op!==null&&Hp(Op,e),kp!==null&&Hp(kp,e),Ap!==null&&Hp(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Np.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||Wp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wp(n)}}}function Kp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function qp(e){this._internalRoot=e}Jp.prototype.render=qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,Cu(),e,t,null,null)},Jp.prototype.unmount=qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),Au(),t[yt]=null}};function Jp(e){this._internalRoot=e}Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&Rp(e)}};var Yp=n.version;if(Yp!==`19.2.8`)throw Error(i(527,Yp,`19.2.8`));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{Ge=Zp.inject(Xp),Ke=Zp}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(i(299));var n=!1,r=``,a=$s,s=ec,c=tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=fp(e,1,!1,null,null,n,r,null,a,s,c,Kp),e[yt]=t.current,Nd(e),new qp(t)}})),d=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=u()})),f=globalThis.Buffer,p=f!=null&&typeof f.from==`function`,m=new Int8Array(256).fill(-1);for(let e=0;e<10;e++)m[48+e]=e;for(let e=0;e<6;e++)m[65+e]=10+e,m[97+e]=10+e;var h=class e{static zeros=`.0.00.000.0000.00000.000000.0000000.00000000.000000000.0000000000.00000000000.000000000000.0000000000000.00000000000000.000000000000000.0000000000000000.00000000000000000.000000000000000000.0000000000000000000.00000000000000000000.000000000000000000000.0000000000000000000000.00000000000000000000000.000000000000000000000000.0000000000000000000000000`.split(`.`);static groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];static groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];static wordSize=26;static WORD_SIZE_BIGINT=BigInt(e.wordSize);static WORD_MASK=(1n<<e.WORD_SIZE_BIGINT)-1n;static MAX_SAFE_INTEGER_BIGINT=BigInt(2**53-1);static MIN_SAFE_INTEGER_BIGINT=BigInt(-(2**53-1));static MAX_IMULN_ARG=67108863;static MAX_NUMBER_CONSTRUCTOR_MAG_BIGINT=(1n<<53n)-1n;static MAX_NOMINAL_WORD_LENGTH=1048576;_magnitude=0n;_sign=0;_nominalWordLength=1;red=null;get negative(){return this._sign}set negative(e){this.assert(e===0||e===1,`Negative property must be 0 or 1`);let t=+(e===1);this._sign=this._magnitude===0n?0:t}get _computedWordsArray(){if(this._magnitude===0n)return[0];let t=[],n=this._magnitude;for(;n>0n;)t.push(Number(n&e.WORD_MASK)),n>>=e.WORD_SIZE_BIGINT;return t.length>0?t:[0]}get words(){if(!Number.isSafeInteger(this._nominalWordLength)||this._nominalWordLength<1||this._nominalWordLength>e.MAX_NOMINAL_WORD_LENGTH)throw Error(`BigNumber word length exceeds the supported limit`);let t=this._computedWordsArray;if(this._nominalWordLength<=t.length)return t;let n=Array.from({length:this._nominalWordLength}).fill(0);for(let e=0;e<t.length;e++)n[e]=t[e];return n}set words(t){let n=this._sign,r=0n,i=t.length>0?t.length:1;for(let n=i-1;n>=0;n--){let i=t[n]??0;r=r<<e.WORD_SIZE_BIGINT|BigInt(i&Number(e.WORD_MASK))}this._magnitude=r,this._sign=n,this._nominalWordLength=i,this.normSign()}get length(){return Math.max(1,this._nominalWordLength)}static isBN(t){return t instanceof e||typeof t==`object`&&!!t&&t.constructor?.wordSize===e.wordSize&&Array.isArray(t.words)}static max(e,t){return e.cmp(t)>0?e:t}static min(e,t){return e.cmp(t)<0?e:t}constructor(e=0,t=10,n=`be`){if(e??=0,typeof e==`bigint`){this._initializeState(e<0n?-e:e,+(e<0n)),this.normSign();return}let r=t===`le`||t===`be`,i=r?10:t,a=r?t:n;if(typeof e==`number`){this.initNumber(e,a);return}if(Array.isArray(e)){this.initArray(e,a);return}if(typeof e==`string`){this._initFromString(e,i,a);return}e===0?this._initializeState(0n,0):this.assert(!1,`Unsupported input type for BigNumber constructor`)}_initFromString(e,t,n){t===`hex`&&(t=16),this.assert(typeof t==`number`&&t===Math.trunc(t)&&t>=2&&t<=36,`Base must be an integer between 2 and 36`);let r=e.toString().replace(/\s+/g,``),i=0,a=0;r.startsWith(`-`)?(i++,a=1):r.startsWith(`+`)&&i++;let o=r.substring(i);if(o.length===0){this._initializeState(0n,a===1&&r.startsWith(`-`)?1:0),this.normSign();return}t===16?this._initFromHexString(o,a,n):this._initFromNonHexString(o,t,a,n)}_initFromHexString(e,t,n){if(n===`le`){let n=[],r=e;r.length%2!=0&&(r=`0`+r);for(let e=0;e<r.length;e+=2){let t=r.substring(e,e+2),i=Number.parseInt(t,16);if(Number.isNaN(i))throw Error(`Invalid character in `+r);n.push(i)}this.initArray(n,`le`),this._sign=t,this.normSign()}else{let n;try{n=BigInt(`0x`+e)}catch{throw Error(`Invalid character in `+e)}this._initializeState(n,t),this.normSign()}}_initFromNonHexString(e,t,n,r){try{if(this._parseBaseString(e,t),this._sign=n,this.normSign(),r===`le`){let e=this._sign;this.initArray(this.toArray(`be`),`le`),this._sign=e,this.normSign()}}catch(e){let t=e;throw t.message.includes(`Invalid character in string`)||t.message.includes(`Invalid digit for base`)||t.message.startsWith(`Invalid character:`)?Error(`Invalid character`):t}}_bigIntToStringInBase(e,t){if(e===0n)return`0`;if(t<2||t>36)throw Error(`Base must be between 2 and 36`);let n=``,r=e>0n?e:-e,i=BigInt(t);for(;r>0n;)n=`0123456789abcdefghijklmnopqrstuvwxyz`[Number(r%i)]+n,r/=i;return n}_parseBaseString(t,n){this._magnitude=0n;let r=BigInt(n),i=e.groupSizes[n],a=BigInt(e.groupBases[n]);(i===0||a===0n)&&(i=Math.floor(Math.log(67108863)/Math.log(n)),i===0&&(i=1),a=r**BigInt(i));let o=0,s=t.length,c=s%i;if(c===0&&s>0&&(c=i),c>0){let e=t.substring(o,o+c);this._magnitude=BigInt(this._parseBaseWord(e,n)),o+=c}for(;o<s;){let e=t.substring(o,o+i),r=BigInt(this._parseBaseWord(e,n));this._magnitude=this._magnitude*a+r,o+=i}this._finishInitialization()}_parseBaseWord(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e.codePointAt(r),a;if(i>=48&&i<=57)a=i-48;else if(i>=65&&i<=90)a=i-65+10;else if(i>=97&&i<=122)a=i-97+10;else throw Error(`Invalid character: `+e[r]);if(a>=t)throw Error(`Invalid character`);n=n*t+a}return n}_initializeState(e,t){this._magnitude=e,this._sign=e===0n?0:t,this._finishInitialization()}_finishInitialization(){if(this._magnitude===0n)this._nominalWordLength=1,this._sign=0;else{let t=this._magnitude.toString(2).length;this._nominalWordLength=Math.max(1,Math.ceil(t/e.wordSize))}}assert(e,t=`Assertion failed`){if(!e)throw Error(t)}initNumber(t,n=`be`){if(this.assert(BigInt(Math.abs(t))<=e.MAX_NUMBER_CONSTRUCTOR_MAG_BIGINT,`The number is larger than 2 ^ 53 (unsafe)`),this.assert(t%1==0,`Number must be an integer for BigNumber conversion`),this._initializeState(BigInt(Math.abs(t)),+(t<0)),n===`le`){let e=this._sign,t=this.toArray(`be`);this.initArray(t,`le`),this._sign=e,this.normSign()}return this}initArray(e,t){if(e.length===0)return this._initializeState(0n,0),this;let n=0n;if(t===`be`)for(let t of e)n=n<<8n|BigInt(t&255);else for(let t=e.length-1;t>=0;t--)n=n<<8n|BigInt(e[t]&255);return this._initializeState(n,0),this}copy(e){e._magnitude=this._magnitude,e._sign=this._sign,e._nominalWordLength=this._nominalWordLength,e.red=this.red}static move(e,t){e._magnitude=t._magnitude,e._sign=t._sign,e._nominalWordLength=t._nominalWordLength,e.red=t.red}clone(){let t=new e(0n);return this.copy(t),t}expand(t){return this.assert(Number.isSafeInteger(t)&&t>=0&&t<=e.MAX_NOMINAL_WORD_LENGTH,`Expand size must be a non-negative safe integer within the supported word limit`),this._nominalWordLength=Math.max(this._nominalWordLength,t,1),this}strip(){return this._finishInitialization(),this.normSign()}normSign(){return this._magnitude===0n&&(this._sign=0),this}inspect(){return(this.red===null?`<BN: `:`<BN-R: `)+this.toString(16)+`>`}_getMinimalHex(){return this._magnitude===0n?`0`:this._magnitude.toString(16)}_toHexString(e){let t=this._getMinimalHex();if(e>1)for(t!==`0`&&t.length%2!=0&&(t=`0`+t);t.length%e!==0;)t=`0`+t;return(this.isNeg()?`-`:``)+t}toString(e=10,t=1){if(e===16||e===`hex`)return this._toHexString(t);if(typeof e!=`number`||e<2||e>36||e%1!=0)throw Error(`Base should be an integer between 2 and 36`);return this.toBaseString(e,t)}toBaseString(t,n){if(this._magnitude===0n)return e._paddedZero(n);let r=e.groupSizes[t],i=BigInt(e.groupBases[t]);(r===0||i===0n)&&(r=Math.floor(Math.log(2**53-1)/Math.log(t)),r===0&&(r=1),i=BigInt(t)**BigInt(r));let a=``,o=this._magnitude;for(;o>0n;){let e=o%i;o/=i;let n=this._bigIntToStringInBase(e,t);a=(o>0n?this._zeroPaddedChunk(n,r):n)+a}if(n>0)for(;a.length<n;)a=`0`+a;return(this._sign===1?`-`:``)+a}static _paddedZero(e){let t=`0`;if(e>1)for(;t.length<e;)t=`0`+t;return t}_zeroPaddedChunk(t,n){let r=n-t.length;return r<=0?t:r<e.zeros.length?e.zeros[r]+t:`0`.repeat(r)+t}toNumber(){let t=this._getSignedValue();if(t>e.MAX_SAFE_INTEGER_BIGINT||t<e.MIN_SAFE_INTEGER_BIGINT)throw Error(`Number can only safely store up to 53 bits`);return Number(t)}toBigInt(){return this._getSignedValue()}toJSON(){let e=this._getMinimalHex();return(this.isNeg()?`-`:``)+e}toArrayLikeGeneric(e,t){let n=this._magnitude,r=t?0:e.length-1,i=t?1:-1;for(let t of e){if(n===0n&&r>=0&&r<e.length)e[r]=0;else if(r>=0&&r<e.length)e[r]=Number(n&255n);else break;n>>=8n,r+=i}}toArray(e=`be`,t){this.strip();let n=this.byteLength(),r=t??Math.max(1,n);this.assert(n<=r,`byte array longer than desired length`),this.assert(r>0,`Requested array length <= 0`);let i=Array.from({length:r}).fill(0);return this._magnitude===0n&&r>0?i:this._magnitude===0n&&r===0?[]:(this.toArrayLikeGeneric(i,e===`le`),i)}bitLength(){return this._magnitude===0n?0:this._magnitude.toString(2).length}static toBitArray(e){let t=e.bitLength();if(t===0)return[];let n=Array.from({length:t}),r=e._magnitude;for(let e=0;e<t;e++)n[e]=(r>>BigInt(e)&1n)==0n?0:1;return n}toBitArray(){return e.toBitArray(this)}zeroBits(){if(this._magnitude===0n)return 0;let e=0,t=this._magnitude;for(;(t&1n)==0n&&t!==0n;)e++,t>>=1n;return e}byteLength(){return this._magnitude===0n?0:Math.ceil(this.bitLength()/8)}_getSignedValue(){return this._sign===1?-this._magnitude:this._magnitude}_setValueFromSigned(e){e<0n?(this._magnitude=-e,this._sign=1):(this._magnitude=e,this._sign=0),this._finishInitialization(),this.normSign()}toTwos(t){this.assert(t>=0);let n=BigInt(t),r=this._getSignedValue();this._sign===1&&this._magnitude!==0n&&(r=(1n<<n)+r);let i=(1n<<n)-1n;r&=i;let a=new e(0n);return a._initializeState(r,0),a}fromTwos(t){this.assert(t>=0);let n=BigInt(t),r=this._magnitude;if(t>0&&(r>>n-1n&1n)!=0n&&this._sign===0){let t=r-(1n<<n),i=new e(0n);return i._setValueFromSigned(t),i}return this.clone()}isNeg(){return this._sign===1&&this._magnitude!==0n}neg(){return this.clone().ineg()}ineg(){return this._magnitude!==0n&&(this._sign=this._sign===1?0:1),this}_iuop(e,t,n=!1){let r=t(this._magnitude,e._magnitude),i=this._nominalWordLength;return n&&(i=Math.max(this.length,e.length)),this._magnitude=r,this._finishInitialization(),n&&(this._nominalWordLength=Math.max(this._nominalWordLength,i)),this.strip()}iuor(e){return this._iuop(e,(e,t)=>e|t)}iuand(e){return this._iuop(e,(e,t)=>e&t)}iuxor(e){return this._iuop(e,(e,t)=>e^t,!0)}_iop(e,t,n=!1){return this.assert(this._sign===0&&e._sign===0),this._iuop(e,t,n)}ior(e){return this._iop(e,(e,t)=>e|t)}iand(e){return this._iop(e,(e,t)=>e&t)}ixor(e){return this._iop(e,(e,t)=>e^t,!0)}_uop_new(e,t){return this.length>=e.length?this.clone()[t](e):e.clone()[t](this)}or(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuor`)}uor(e){return this._uop_new(e,`iuor`)}and(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuand`)}uand(e){return this._uop_new(e,`iuand`)}xor(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuxor`)}uxor(e){return this._uop_new(e,`iuxor`)}inotn(t){this.assert(typeof t==`number`&&t>=0);let n=(1n<<BigInt(t))-1n;this._magnitude=~this._magnitude&n;let r=t===0?1:Math.ceil(t/e.wordSize);return this._nominalWordLength=Math.max(1,r),this.strip(),this._nominalWordLength=Math.max(this._nominalWordLength,Math.max(1,r)),this}notn(e){return this.clone().inotn(e)}setn(t,n){this.assert(typeof t==`number`&&t>=0);let r=BigInt(t);n===1||n===!0?this._magnitude|=1n<<r:this._magnitude&=~(1n<<r);let i=Math.floor(t/e.wordSize)+1;return this._nominalWordLength=Math.max(this._nominalWordLength,i),this._finishInitialization(),this.strip()}iadd(e){return this._setValueFromSigned(this._getSignedValue()+e._getSignedValue()),this}add(t){let n=new e(0n);return n._setValueFromSigned(this._getSignedValue()+t._getSignedValue()),n}isub(e){return this._setValueFromSigned(this._getSignedValue()-e._getSignedValue()),this}sub(t){let n=new e(0n);return n._setValueFromSigned(this._getSignedValue()-t._getSignedValue()),n}mul(t){let n=new e(0n);return n._magnitude=this._magnitude*t._magnitude,n._sign=n._magnitude===0n?0:this._sign^t._sign,n._nominalWordLength=this.length+t.length,n.red=null,n.normSign()}imul(e){return this._magnitude*=e._magnitude,this._sign=this._magnitude===0n?0:this._sign^e._sign,this._nominalWordLength=this.length+e.length,this.red=null,this.normSign()}imuln(t){return this.assert(typeof t==`number`,`Assertion failed`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Assertion failed`),this._setValueFromSigned(this._getSignedValue()*BigInt(t)),this}muln(e){return this.clone().imuln(e)}sqr(){let t=new e(0n);return t._magnitude=this._magnitude*this._magnitude,t._sign=0,t._nominalWordLength=this.length*2,t.red=null,t}isqr(){return this._magnitude*=this._magnitude,this._sign=0,this._nominalWordLength=this.length*2,this.red=null,this}pow(t){if(this.assert(t._sign===0,`Exponent for pow must be non-negative`),t.isZero())return new e(1n);let n=new e(1n),r=this.clone(),i=t.clone(),a=r.isNeg(),o=i.isOdd();for(a&&r.ineg();!i.isZero();)i.isOdd()&&n.imul(r),r.isqr(),i.iushrn(1);return a&&o&&n.ineg(),n}static normalizeNonNegativeBigInt(e,t){if(typeof e==`number`){if(!Number.isFinite(e)||!Number.isInteger(e)||e<0)throw Error(`${t} must be a non-negative integer`);return BigInt(e)}if(e<0n)throw Error(`${t} must be a non-negative integer`);return e}iushln(t){let n=e.normalizeNonNegativeBigInt(t,`Shift bits`);return n===0n?this:(this._magnitude<<=n,this._finishInitialization(),this.strip())}ishln(e){return this.assert(this._sign===0,`ishln requires positive number`),this.iushln(e)}iushrn(t,n,r){let i=e.normalizeNonNegativeBigInt(t,`Shift bits`);if(i===0n)return r?._initializeState(0n,0),this;if(r!=null){let e=(1n<<i)-1n,t=this._magnitude&e;r._initializeState(t,0)}return this._magnitude>>=i,this._finishInitialization(),this.strip()}ishrn(e,t,n){return this.assert(this._sign===0,`ishrn requires positive number`),this.iushrn(e,t,n)}shln(e){return this.clone().ishln(e)}ushln(e){return this.clone().iushln(e)}shrn(e){return this.clone().ishrn(e)}ushrn(e){return this.clone().iushrn(e)}testn(e){return this.assert(typeof e==`number`&&e>=0),(this._magnitude>>BigInt(e)&1n)!=0n}imaskn(t){this.assert(typeof t==`number`&&t>=0),this.assert(this._sign===0,`imaskn works only with positive numbers`);let n=BigInt(t),r=n===0n?0n:(1n<<n)-1n;this._magnitude&=r;let i=t===0?1:Math.max(1,Math.ceil(t/e.wordSize));return this._nominalWordLength=i,this._finishInitialization(),this._nominalWordLength=Math.max(this._nominalWordLength,i),this.strip()}maskn(e){return this.clone().imaskn(e)}iaddn(t){return this.assert(typeof t==`number`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`num is too large`),this._setValueFromSigned(this._getSignedValue()+BigInt(t)),this}_iaddn(e){return this.iaddn(e)}isubn(t){return this.assert(typeof t==`number`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Assertion failed`),this._setValueFromSigned(this._getSignedValue()-BigInt(t)),this}addn(e){return this.clone().iaddn(e)}subn(e){return this.clone().isubn(e)}iabs(){return this._sign=0,this}abs(){return this.clone().iabs()}divmod(t,n,r){if(this.assert(!t.isZero(),`Division by zero`),this.isZero()){let t=new e(0n);return{div:n===`mod`?null:t,mod:n===`div`?null:t}}let i=this._getSignedValue(),a=t._getSignedValue(),o=n===`mod`?null:i/a,s=this._computeMod(i,a,n,r);return{div:this._bigNumberFromSigned(o),mod:this._bigNumberFromSigned(s)}}_computeMod(e,t,n,r){if(n===`div`)return null;let i=e%t;return r===!0&&i<0n&&(i+=t<0n?-t:t),i}_bigNumberFromSigned(t){if(t===null)return null;let n=new e(0n);return n._setValueFromSigned(t),n}div(e){return this.divmod(e,`div`,!1).div}mod(e){return this.divmod(e,`mod`,!1).mod}umod(e){return this.divmod(e,`mod`,!0).mod}divRound(t){this.assert(!t.isZero());let n=this._getSignedValue(),r=t._getSignedValue(),i=n/r,a=n%r;if(a===0n){let t=new e(0n);return t._setValueFromSigned(i),t}let o=a<0n?-a:a,s=r<0n?-r:r;o*2n>=s&&(n>0n&&r>0n||n<0n&&r<0n?i+=1n:i-=1n);let c=new e(0n);return c._setValueFromSigned(i),c}modrn(e){this.assert(e!==0,`Division by zero in modrn`);let t=BigInt(Math.abs(e));if(t===0n)throw Error(`Division by zero in modrn`);let n=this._magnitude%t;return Number(e<0?-n:n)}idivn(t){return this.assert(t!==0),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`num is too large`),this._setValueFromSigned(this._getSignedValue()/BigInt(t)),this}divn(e){return this.clone().idivn(e)}egcd(t){this.assert(t._sign===0,`p must not be negative`),this.assert(!t.isZero(),`p must not be zero`);let n=this._getSignedValue(),r=t._magnitude,i=1n,a=0n,o=0n,s=1n;for(;r!==0n;){let e=n/r,t=r;r=n%r,n=t,t=a,a=i-e*a,i=t,t=s,s=o-e*s,o=t}let c=new e(0n);c._setValueFromSigned(i);let l=new e(0n);l._setValueFromSigned(o);let u=new e(0n);return u._initializeState(n<0n?-n:n,0),{a:c,b:l,gcd:u}}gcd(t){let n=this._magnitude,r=t._magnitude;if(n===0n){let t=new e(0n);return t._setValueFromSigned(r),t.iabs()}if(r===0n){let t=new e(0n);return t._setValueFromSigned(n),t.iabs()}for(;r!==0n;){let e=n%r;n=r,r=e}let i=new e(0n);return i._initializeState(n,0),i}invm(e){this.assert(!e.isZero()&&e._sign===0,`Modulus for invm must be positive and non-zero`);let t=this.egcd(e);if(!t.gcd.eqn(1))throw Error(`Inverse does not exist (numbers are not coprime).`);return t.a.umod(e)}isEven(){return this._magnitude%2n==0n}isOdd(){return this._magnitude%2n==1n}andln(e){return this.assert(e>=0),Number(this._magnitude&BigInt(e))}bincn(e){this.assert(typeof e==`number`&&e>=0);let t=1n<<BigInt(e);return this._setValueFromSigned(this._getSignedValue()+t),this}isZero(){return this._magnitude===0n}cmpn(t){this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Number is too big`);let n=this._getSignedValue(),r=BigInt(t);return n<r?-1:+(n>r)}cmp(e){let t=this._getSignedValue(),n=e._getSignedValue();return t<n?-1:+(t>n)}ucmp(e){return this._magnitude<e._magnitude?-1:+(this._magnitude>e._magnitude)}gtn(e){return this.cmpn(e)===1}gt(e){return this.cmp(e)===1}gten(e){return this.cmpn(e)>=0}gte(e){return this.cmp(e)>=0}ltn(e){return this.cmpn(e)===-1}lt(e){return this.cmp(e)===-1}lten(e){return this.cmpn(e)<=0}lte(e){return this.cmp(e)<=0}eqn(e){return this.cmpn(e)===0}eq(e){return this.cmp(e)===0}toRed(e){return this.assert(this.red==null,`Already a number in reduction context`),this.assert(this._sign===0,`toRed works only with positives`),e.convertTo(this).forceRed(e)}fromRed(){return this.assert(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)}forceRed(e){return this.red=e,this}redAdd(e){return this.assert(this.red,`redAdd works only with red numbers`),this.red.add(this,e)}redIAdd(e){return this.assert(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)}redSub(e){return this.assert(this.red,`redSub works only with red numbers`),this.red.sub(this,e)}redISub(e){return this.assert(this.red,`redISub works only with red numbers`),this.red.isub(this,e)}redShl(e){return this.assert(this.red,`redShl works only with red numbers`),this.red.shl(this,e)}redMul(e){return this.assert(this.red,`redMul works only with red numbers`),this.red.verify2(this,e),this.red.mul(this,e)}redIMul(e){return this.assert(this.red,`redIMul works only with red numbers`),this.red.verify2(this,e),this.red.imul(this,e)}redSqr(){return this.assert(this.red,`redSqr works only with red numbers`),this.red.verify1(this),this.red.sqr(this)}redISqr(){return this.assert(this.red,`redISqr works only with red numbers`),this.red.verify1(this),this.red.isqr(this)}redSqrt(){return this.assert(this.red,`redSqrt works only with red numbers`),this.red.verify1(this),this.red.sqrt(this)}redInvm(){return this.assert(this.red,`redInvm works only with red numbers`),this.red.verify1(this),this.red.invm(this)}redNeg(){return this.assert(this.red,`redNeg works only with red numbers`),this.red.verify1(this),this.red.neg(this)}redPow(e){return this.assert(this.red!=null&&e.red==null,`redPow(normalNum)`),this.red.verify1(this),this.red.pow(this,e)}static fromHex(t,n){let r=`be`;return(n===`little`||n===`le`)&&(r=`le`),new e(t,16,r)}toHex(e=0){if(this.isZero()&&e===0)return``;let t=this._getMinimalHex();t!==`0`&&t.length%2!=0&&(t=`0`+t);let n=e*2;for(;t.length<n;)t=`0`+t;return(this.isNeg()?`-`:``)+t}static fromJSON(t){return new e(t,16)}static fromNumber(t){return new e(t)}static fromString(t,n){return new e(t,n)}static fromSm(t,n=`big`){if(t.length===0)return new e(0n);let r=t.slice();n===`little`&&r.reverse();let i=0;r.length>0&&r[0]&128&&(i=1,r[0]&=127);let a;if(p)a=f.from(r).toString(`hex`);else{a=``;for(let e of r)a+=e<16?`0`+e.toString(16):e.toString(16)}let o=a.length===0?0n:BigInt(`0x`+a),s=new e(0n);return s._initializeState(o,i),s}toSm(e=`big`){if(this._magnitude===0n)return this._sign===1?[128]:[];let t=this._getMinimalHex();t.length%2!=0&&(t=`0`+t);let n=t.length/2,r=Array.from({length:n});for(let e=0,n=0;e<t.length;e+=2){let i=m[t.codePointAt(e)],a=m[t.codePointAt(e+1)];r[n++]=(i&15)<<4|a&15}let i;return this._sign===1?r[0]&128?i=[128,...r]:(i=r.slice(),i[0]|=128):i=r[0]&128?[0,...r]:r.slice(),e===`little`?i.reverse():i}static fromBits(t,n=!1){let r=t>>>24,i=t&8388607,a=!!(t&8388608);if(n&&a)throw Error(`negative bit set`);if(r===0&&i===0){if(a&&n)throw Error(`negative bit set for zero value`);return new e(0n)}let o=new e(i);return r<=3?o.iushrn((3-r)*8):o.iushln((r-3)*8),a&&o.ineg(),o}toBits(){if(this.strip(),this.isZero()&&!this.isNeg())return 0;let e=this.isNeg(),t=this.abs().toArray(`be`),n=0;for(;n<t.length-1&&t[n]===0;)n++;t=t.slice(n);let r=t.length,i;if(r===0)i=0;else if(r<=3){i=0;for(let e=0;e<r;e++)i=i<<8|t[e]}else i=t[0]<<16|t[1]<<8|t[2];i&8388608&&r<=255&&(i>>>=8,r++);let a=r<<24|i;return e&&(a|=8388608),a>>>0}static fromScriptNum(t,n=!1,r){if(r!==void 0&&t.length>r)throw Error(`script number overflow`);if(t.length===0)return new e(0n);if(n&&!(t.at(-1)&127)&&(t.length<=1||!(t.at(-2)&128)))throw Error(`non-minimally encoded script number`);return e.fromSm(t,`little`)}toScriptNum(){return this.toSm(`little`)}_invmp(t){this.assert(t._sign===0,`p must not be negative for _invmp`),this.assert(!t.isZero(),`p must not be zero for _invmp`);let n=this.umod(t),r=t.subn(2);if(n.red!==null)return n.redPow(r);let i=new e(1n),a=n.clone(),o=r.clone();for(;!o.isZero();)o.isOdd()&&(i=i.mul(a).umod(t)),a=a.sqr().umod(t),o.iushrn(1);return i}mulTo(e,t){return t._magnitude=this._magnitude*e._magnitude,t._sign=t._magnitude===0n?0:this._sign^e._sign,t._nominalWordLength=this.length+e.length,t.red=null,t.normSign(),t}},g=class{name;p;k;n;tmp;constructor(e,t){this.name=e,this.p=new h(t,16),this.n=this.p.bitLength(),this.k=new h(BigInt(1)).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_tmp(){let e=new h(BigInt(0)),t=Math.ceil(this.n/h.wordSize);return e.expand(Math.max(1,t)),e}ireduce(e){let t=e,n;do this.split(t,this.tmp),this.imulK(t),t.iadd(this.tmp),n=t.bitLength();while(n>this.n);let r=n<this.n?-1:t.ucmp(this.p);return r===0?t.words=[0]:r>0&&t.isub(this.p),t.strip(),t}split(e,t){e.iushrn(this.n,0,t)}imulK(e){return e.imul(this.k)}},_=class extends g{constructor(){super(`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}split(e,t){let n=4194303,r=e.words,i=e.length,a=Math.min(i,9),o=Array.from({length:a+ +(i>9)},()=>0);for(let e=0;e<a;e++)o[e]=r[e];let s=a;if(i<=9){let n=Array.from({length:s},()=>0);for(let e=0;e<s;++e)n[e]=o[e];t.words=n,e.words=[0];return}let c=r[9];o[s++]=c&n;let l=Array.from({length:s},()=>0);for(let e=0;e<s;++e)l[e]=o[e];t.words=l;let u=Array.from({length:Math.max(1,i-9)},()=>0),d=0;for(let e=10;e<i;e++){let t=Math.trunc(r[e]);d<u.length&&(u[d++]=(t&n)<<4|c>>>22),c=t}c>>>=22,d<u.length?u[d++]=c:c!==0&&u.length;let f=Array.from({length:d},()=>0);for(let e=0;e<d;++e)f[e]=u[e];e.words=f}imulK(e){let t=e.words,n=e.length,r=n+2,i=Array.from({length:r},()=>0);for(let e=0;e<n;e++)i[e]=t[e];let a=0;for(let e=0;e<r;e++){let t=Math.trunc(i[e]);a+=t*977,i[e]=a&67108863,a=t*64+Math.trunc(a/67108864)}return e.words=i,e}},v=class{prime;m;constructor(e){if(e===`k256`){let e=new _;this.m=e.p,this.prime=e}else this.assert(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}assert(e,t=`Assertion failed`){if(!e)throw Error(t)}verify1(e){this.assert(e.negative===0,`red works only with positives`),this.assert(e.red,`red works only with red numbers`)}verify2(e,t){this.assert((e.negative|t.negative)===0,`red works only with positives`),this.assert(e.red!=null&&e.red===t.red,`red works only with red numbers`)}imod(e){return this.prime==null?(h.move(e,e.umod(this.m).forceRed(this)),e):this.prime.ireduce(e).forceRed(this)}neg(e){return e.isZero()?e.clone():this.m.sub(e).forceRed(this)}add(e,t){this.verify2(e,t);let n=e.clone();return n.iadd(t),n.isub(this.m),n.isNeg()&&n.iadd(this.m),n}iadd(e,t){return this.verify2(e,t),e.iadd(t),e.isub(this.m),e.isNeg()&&e.iadd(this.m),e}sub(e,t){this.verify2(e,t);let n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n.forceRed(this)}isub(e,t){this.verify2(e,t);let n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n}shl(e,t){return this.verify1(e),this.imod(e.ushln(t))}imul(e,t){return this.verify2(e,t),this.imod(e.imul(t))}mul(e,t){return this.verify2(e,t),this.imod(e.mul(t))}isqr(e){return this.imul(e,e.clone())}sqr(e){return this.mul(e,e)}sqrt(e){if(e.isZero())return e.clone();let t=this.m.andln(3);if(this.assert(t%2==1),t===3){let t=this.m.add(new h(1)).iushrn(2);return this.pow(e,t)}let n=this.m.subn(1),r=0;for(;!n.isZero()&&n.andln(1)===0;)r++,n.iushrn(1);this.assert(!n.isZero());let i=new h(1).toRed(this),a=i.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength(),c=new h(2*s*s).toRed(this);for(;this.pow(c,o).cmp(a)!==0;)c.redIAdd(a);let l=this.pow(c,n),u=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),f=r;for(;d.cmp(i)!==0;){let e=d,t=0;for(;e.cmp(i)!==0;)e=e.redSqr(),t++;this.assert(t<f);let n=this.pow(l,new h(1).iushln(f-t-1));u=u.redMul(n),l=n.redSqr(),d=d.redMul(l),f=t}return u}invm(e){let t=e._invmp(this.m);return t.negative===0?this.imod(t):(t.negative=0,this.imod(t).redNeg())}pow(e,t){if(this.verify1(e),t.isZero())return new h(1).toRed(this);let n=new h(1).toRed(this),r=e.clone(),i=t.bitLength();for(let e=i-1;e>=0;e--)n=this.sqr(n),t.testn(e)&&(n=this.mul(n,r));return n}convertTo(e){let t=e.umod(this.m);return t===e?t.clone():t}convertFrom(e){let t=e.clone();return t.red=null,t}},y=class extends v{shift;r;r2;rinv;minv;constructor(e){super(e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}convertTo(e){return this.imod(e.ushln(this.shift))}convertFrom(e){let t=this.imod(e.mul(this.rinv));return t.red=null,t}imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;let n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a.forceRed(this)}mul(e,t){if(e.isZero()||t.isZero())return new h(0).forceRed(this);let n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a.forceRed(this)}invm(e){return this.imod(e._invmp(this.m).mul(this.r2)).forceRed(this)}},b=/^[0-9a-fA-F]*$/;function x(e){if(typeof e!=`string`)throw TypeError(`Invalid hex string`);if(e.length!==0&&!b.test(e))throw Error(`Invalid hex string`)}function S(e){if(x(e),e.length===0)return``;let t=e.toLowerCase();return t.length%2!=0&&(t=`0`+t),t}var C=(e,t=`Hash assertion failed`)=>{if(!e)throw Error(t)},w=class{pending=null;pendingTotal=0;blockSize;outSize;endian;_delta8;_delta32;padLength;hmacStrength;constructor(e,t,n,r){this.blockSize=e,this.outSize=t,this.hmacStrength=n,this.padLength=r/8,this.endian=`big`,this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_update(e,t){throw Error(`Not implemented`)}_digest(){throw Error(`Not implemented`)}_digestHex(){throw Error(`Not implemented`)}update(e,t){if(e=re(e,t),this.pending=this.pending==null?e:this.pending.concat(e),this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;let t=e.length%this._delta8;this.pending=e.slice(e.length-t,e.length),this.pending.length===0&&(this.pending=null),e=be(e,0,e.length-t,this.endian);for(let t=0;t<e.length;t+=this._delta32)this._update(e,t)}return this}digest(){return this.update(this._pad()),C(this.pending===null),this._digest()}digestHex(){return this.update(this._pad()),C(this.pending===null),this._digestHex()}_pad(){let e=this.pendingTotal;if(!Number.isSafeInteger(e)||e<0)throw Error(`Message too long for this hash function`);let t=this._delta8,n=t-(e+this.padLength)%t,r=Array.from({length:n+this.padLength});r[0]=128;let i=1;for(;i<n;i++)r[i]=0;let a=this.padLength,o=1n<<BigInt(a*8),s=BigInt(e)*8n;if(s>=o)throw Error(`Message too long for this hash function`);if(this.endian===`big`){let e=Array.from({length:a});for(let t=a-1;t>=0;t--)e[t]=Number(s&255n),s>>=8n;for(let t=0;t<a;t++)r[i++]=e[t]}else for(let e=0;e<a;e++)r[i++]=Number(s&255n),s>>=8n;return r}};function ee(e,t,n){let r=e.codePointAt(t);return r<128?(n.push(r),t):r<2048?(n.push(r>>6|192,r&63|128),t):r>65535?(n.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128),t+1):(n.push(r>>12|224,r>>6&63|128,r&63|128),t)}function te(e){let t=[],n=0;for(;n<e.length;)n=ee(e,n,t)+1;return t}function ne(e){x(e);let t=S(e),n=[];for(let e=0;e<t.length;e+=2)n.push(Number.parseInt(t[e]+t[e+1],16));return n}function T(e){let t=[];for(let n=0;n<e.length;n++)t[n]=Math.trunc(e[n]);return t}function re(e,t){return Array.isArray(e)?e.slice():e?typeof e==`string`?t===`hex`?ne(e):te(e):T(e):[]}function ie(e){return qt(e)}function ae(e,t){let n=``;for(let r of e)t===`little`&&(r=ie(r)),n+=oe(r.toString(16));return n}function oe(e){return e.length===7?`0`+e:e.length===6?`00`+e:e.length===5?`000`+e:e.length===4?`0000`+e:e.length===3?`00000`+e:e.length===2?`000000`+e:e.length===1?`0000000`+e:e}var se=typeof globalThis>`u`?void 0:globalThis.Buffer,ce=se!=null&&typeof se.from==`function`,le=`0123456789abcdef`,E=Array.from({length:256});for(let e=0;e<E.length;e++)E[e]=le[e>>4&15]+le[e&15];function D(e){if(ce)return se.from(e).toString(`hex`);let t=Array.from({length:e.length});for(let n=0;n<e.length;n++)t[n]=E[e[n]];return t.join(``)}var ue=(()=>{let e=typeof globalThis>`u`?void 0:globalThis.process,t=e?.getBuiltinModule;if(typeof t==`function`)try{let n=t.call(e,`node:crypto`);if(n!=null)return n}catch{}})();function de(e,t){return e instanceof Uint8Array?e:Array.isArray(e)?new Uint8Array(e):Uint8Array.from(re(e,t))}function fe(e){return typeof e==`string`?de(e,`hex`):de(e)}function pe(e,t,n){e==null?t?.update(n):e.update(n)}function me(e,t){return e==null?t==null?[]:Array.from(t.digest()):Array.from(e.digest())}function he(e,t){return e==null?t==null?``:D(t.digest()):e.digest(`hex`)}function ge(e){let t=ue?.createHash;if(typeof t==`function`)try{return t(e)}catch{return}}function _e(e,t){let n=ue?.createHmac;if(typeof n==`function`)try{return n(e,t)}catch{return}}function ve(e,t,n){let r=ge(e);if(r!=null)return r.update(de(t,n)),r.digest()}function ye(e,t,n,r){let i=_e(e,fe(t));if(i!=null)return i.update(de(n,r)),i.digest()}function be(e,t,n,r){let i=n-t;C(i%4==0);let a=Array.from({length:i/4});for(let n=0,i=t;n<a.length;n++,i+=4){let t;t=r===`big`?e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]:e[i+3]<<24|e[i+2]<<16|e[i+1]<<8|e[i],a[n]=t>>>0}return a}function xe(e,t){let n=Array.from({length:e.length*4});for(let r=0,i=0;r<e.length;r++,i+=4){let a=e[r];t===`big`?(n[i]=a>>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=a&255):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=a&255)}return n}function Se(e,t){return e>>>t|e<<32-t}function Ce(e,t){return e<<t|e>>>32-t}function we(e,t){return e+t>>>0}function Te(e,t,n){return e+t+n>>>0}function Ee(e,t,n,r){return e+t+n+r>>>0}function De(e,t,n,r,i){return e+t+n+r+i>>>0}function Oe(e,t,n,r){return e===0?ke(t,n,r):e===1||e===3?je(t,n,r):e===2?Ae(t,n,r):0}function ke(e,t,n){return e&t^~e&n}function Ae(e,t,n){return e&t^e&n^t&n}function je(e,t,n){return e^t^n}function Me(e){return Se(e,2)^Se(e,13)^Se(e,22)}function Ne(e){return Se(e,6)^Se(e,11)^Se(e,25)}function Pe(e){return Se(e,7)^Se(e,18)^e>>>3}function Fe(e){return Se(e,17)^Se(e,19)^e>>>10}var Ie=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Le=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Re=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],ze=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function Be(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function Ve(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function He(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var Ue=class extends w{h;constructor(){super(512,160,192,64),this.endian=`little`,this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian=`little`}_update(e,t){let n=this.h[0],r=this.h[1],i=this.h[2],a=this.h[3],o=this.h[4],s=n,c=r,l=i,u=a,d=o,f;for(let p=0;p<80;p++)f=we(Ce(Ee(n,Be(p,r,i,a),e[Ie[p]+t],Ve(p)),Re[p]),o),n=o,o=a,a=Ce(i,10),i=r,r=f,f=we(Ce(Ee(s,Be(79-p,c,l,u),e[Le[p]+t],He(p)),ze[p]),d),s=d,d=u,u=Ce(l,10),l=c,c=f;f=Te(this.h[1],i,u),this.h[1]=Te(this.h[2],a,d),this.h[2]=Te(this.h[3],o,s),this.h[3]=Te(this.h[4],n,c),this.h[4]=Te(this.h[0],r,l),this.h[0]=f}_digest(){return xe(this.h,`little`)}_digestHex(){return ae(this.h,`little`)}},We=class extends w{h;W;k;constructor(){super(512,160,80,64),this.k=[1518500249,1859775393,2400959708,3395469782],this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array.from({length:80})}_update(e,t){let n=this.W;t??=0;let r=0;for(;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=Ce(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);let i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],c=this.h[4];for(r=0;r<n.length;r++){let e=Math.trunc(r/20),t=De(Ce(i,5),Oe(e,a,o,s),c,n[r],this.k[e]);c=s,s=o,o=Ce(a,30),a=i,i=t}this.h[0]=we(this.h[0],i),this.h[1]=we(this.h[1],a),this.h[2]=we(this.h[2],o),this.h[3]=we(this.h[3],s),this.h[4]=we(this.h[4],c)}_digest(){return xe(this.h,`big`)}_digestHex(){return ae(this.h,`big`)}},Ge=class{h;native;blockSize=64;outSize=32;constructor(e){let t=fe(e);this.native=_e(`sha256`,t),this.native??(this.h=new Kt(Lt,t))}update(e,t){return pe(this.native,this.h,de(e,t)),this}digest(){return me(this.native,this.h)}digestHex(){return he(this.native,this.h)}},Ke=class{h;native;blockSize=128;outSize=32;constructor(e){let t=fe(e);this.native=_e(`sha512`,t),this.native??(this.h=new Kt(Gt,t))}update(e,t){return pe(this.native,this.h,de(e,t)),this}digest(){return me(this.native,this.h)}digestHex(){return he(this.native,this.h)}};function qe(e,t){return ve(`sha256`,e,t)??new It().update(de(e,t)).digest()}function Je(e,t){return ve(`ripemd160`,e,t)}var Ye=(e,t)=>{let n=Je(e,t);return n==null?new Ue().update(e,t).digest():Array.from(n)},Xe=(e,t)=>new We().update(e,t).digest(),Ze=(e,t)=>Array.from(qe(e,t)),Qe=(e,t)=>Array.from(qe(qe(e,t))),$e=(e,t)=>{let n=qe(e,t),r=Je(n);return r==null?new Ue().update(n).digest():Array.from(r)},et=(e,t,n)=>{let r=ye(`sha256`,e,t,n);return r==null?new Ge(e).update(t,n).digest():Array.from(r)},tt=(e,t,n)=>{let r=ye(`sha512`,e,t,n);return r==null?new Ke(e).update(t,n).digest():Array.from(r)};function nt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function rt(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got ${e}`)}function it(e,...t){if(!nt(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length)){let n=t.join(`,`);throw Error(`Uint8Array expected of length ${n}, got length=${e.length}`)}}function at(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`Hash should be wrapped by utils.createHasher`);rt(e.outputLen),rt(e.blockLen)}function ot(e,t=!0){if(e.destroyed===!0)throw Error(`Hash instance has been destroyed`);if(t&&e.finished===!0)throw Error(`Hash#digest() has already been called`)}function st(e,t){it(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}function ct(...e){for(let t of e)t.fill(0)}function lt(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ut(e){return typeof e==`string`&&(e=dt(e)),it(e),e}function dt(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}var ft=class{};function pt(e){let t=t=>e().update(ut(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}var mt=BigInt(2**32-1),ht=BigInt(32);function gt(e,t=!1){return t?{h:Number(e&mt),l:Number(e>>ht&mt)}:{h:Number(e>>ht&mt)|0,l:Number(e&mt)|0}}function _t(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=gt(e[a],t);r[a]=n,i[a]=o}return[r,i]}var vt=(e,t,n)=>e>>>n,yt=(e,t,n)=>e<<32-n|t>>>n,bt=(e,t,n)=>e>>>n|t<<32-n,xt=(e,t,n)=>e<<32-n|t>>>n,St=(e,t,n)=>e<<64-n|t>>>n-32,Ct=(e,t,n)=>e>>>n-32|t<<64-n;function wt(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Tt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Et=(e,t,n,r)=>Math.trunc(t+n+r+Math.trunc(e/2**32)),Dt=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Ot=(e,t,n,r,i)=>Math.trunc(t+n+r+i+Math.trunc(e/2**32)),kt=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),At=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,jt=class extends ft{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=lt(this.buffer)}update(e){ot(this),e=ut(e),it(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=lt(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ot(this),st(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,ct(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Mt(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=lt(e),s=this.outputLen;if(s%4!=0)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e??=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t!==0&&e.buffer.set(n),e}clone(){return this._cloneInto()}};function Mt(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var Nt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pt=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ft=new Uint32Array(64),It=class extends jt{A=Nt[0]|0;B=Nt[1]|0;C=Nt[2]|0;D=Nt[3]|0;E=Nt[4]|0;F=Nt[5]|0;G=Nt[6]|0;H=Nt[7]|0;constructor(e=32){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(...[e,t,n,r,i,a,o,s]){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Ft[n]=e.getUint32(t);for(let e=16;e<64;e++){let t=Ft[e-15],n=Ft[e-2],r=Pe(t),i=Fe(n);Ft[e]=we(we(r,Ft[e-7]),we(i,Ft[e-16]))}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=De(l,Ne(o),ke(o,s,c),Pt[e],Ft[e]),u=we(Me(n),Ae(n,r,i));l=c,c=s,s=o,o=we(a,t),a=i,i=r,r=n,n=we(t,u)}this.A=we(this.A,n),this.B=we(this.B,r),this.C=we(this.C,i),this.D=we(this.D,a),this.E=we(this.E,o),this.F=we(this.F,s),this.G=we(this.G,c),this.H=we(this.H,l)}roundClean(){ct(Ft)}destroy(){ct(this.buffer),this.set(0,0,0,0,0,0,0,0)}},Lt=pt(()=>new It),Rt=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),zt=_t(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(BigInt)),Bt=zt[0],Vt=zt[1],Ht=new Uint32Array(80),Ut=new Uint32Array(80),Wt=class extends jt{Ah=Rt[0]|0;Al=Rt[1]|0;Bh=Rt[2]|0;Bl=Rt[3]|0;Ch=Rt[4]|0;Cl=Rt[5]|0;Dh=Rt[6]|0;Dl=Rt[7]|0;Eh=Rt[8]|0;El=Rt[9]|0;Fh=Rt[10]|0;Fl=Rt[11]|0;Gh=Rt[12]|0;Gl=Rt[13]|0;Hh=Rt[14]|0;Hl=Rt[15]|0;constructor(e=64){super(128,e,16,!1)}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(...[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=8)Ht[n]=e.getUint32(t),Ut[n]=e.getUint32(t+4);for(let e=16;e<80;e++){let t=Ht[e-15]|0,n=Ut[e-15]|0,r=bt(t,n,1)^bt(t,n,8)^vt(t,n,7),i=xt(t,n,1)^xt(t,n,8)^yt(t,n,7),a=Ht[e-2]|0,o=Ut[e-2]|0,s=bt(a,o,19)^St(a,o,61)^vt(a,o,6),c=Dt(i,xt(a,o,19)^Ct(a,o,61)^yt(a,o,6),Ut[e-7],Ut[e-16]),l=Ot(c,r,s,Ht[e-7],Ht[e-16]);Ht[e]=l|0,Ut[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=bt(u,d,14)^bt(u,d,18)^St(u,d,41),v=xt(u,d,14)^xt(u,d,18)^Ct(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=kt(_,v,b,Vt[e],Ut[e]),S=At(x,g,t,y,Bt[e],Ht[e]),C=x|0,w=bt(n,r,28)^St(n,r,34)^St(n,r,39),ee=xt(n,r,28)^Ct(n,r,34)^Ct(n,r,39),te=n&i^n&o^i&o,ne=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=wt(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let T=Tt(ee,ne,C);n=Et(T,w,te,S),r=T|0}({h:n,l:r}=wt(n,r,this.Ah,this.Al)),{h:i,l:a}=wt(i,a,this.Bh,this.Bl),{h:o,l:s}=wt(o,s,this.Ch,this.Cl),{h:c,l}=wt(c,l,this.Dh,this.Dl),{h:u,l:d}=wt(u,d,this.Eh,this.El),{h:f,l:p}=wt(f,p,this.Fh,this.Fl),{h:m,l:h}=wt(m,h,this.Gh,this.Gl),{h:g,l:_}=wt(g,_,this.Hh,this.Hl),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){ct(Ht,Ut)}destroy(){ct(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Gt=pt(()=>new Wt),Kt=class extends ft{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,t){super(),at(e);let n=ut(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw TypeError(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),ct(i)}update(e){return ot(this),this.iHash.update(e),this}digestInto(e){ot(this),it(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e??=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash??void 0),e.iHash=n._cloneInto(e.iHash??void 0),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};function qt(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24)>>>0}(()=>{let e=new ArrayBuffer(4),t=new Uint32Array(e),n=new Uint8Array(e);return t[0]=16909060,n[0]===4})();var Jt=class{buffer;pos;capacity;constructor(e,t=256){if(e!=null&&e.length>0){let n=e.reduce((e,t)=>e+t.length,0);t=Math.max(t,n)}if(this.buffer=new Uint8Array(t),this.pos=0,this.capacity=t,e!=null)for(let t of e)this.write(t)}getLength(){return this.pos}toUint8Array(){return this.buffer.slice(0,this.pos)}toArray(){return Array.from(this.toUint8Array())}toUint8ArrayZeroCopy(){return this.buffer.subarray(0,this.pos)}reserve(e){if(!Number.isSafeInteger(e)||e<0)throw RangeError(`WriterUint8Array reserve requires a non-negative safe integer`);this.ensureCapacity(e)}ensureCapacity(e){if(this.pos+e>this.capacity){let t=this.capacity*2;for(;this.pos+e>t;)t*=2;let n=new Uint8Array(t);n.set(this.buffer),this.buffer=n,this.capacity=t}}write(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);return this.ensureCapacity(t.length),this.buffer.set(t,this.pos),this.pos+=t.length,this}writeReverse(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);this.ensureCapacity(t.length);for(let e=t.length-1;e>=0;e--)this.buffer[this.pos]=t[e],this.pos+=1;return this}writeUInt8(e){return this.ensureCapacity(1),this.buffer[this.pos]=e&255,this.pos+=1,this}writeInt8(e){return this.writeUInt8(e),this}writeUInt16LE(e){return this.ensureCapacity(2),this.buffer[this.pos]=e&255,this.buffer[this.pos+1]=e>>8&255,this.pos+=2,this}writeUInt16BE(e){return this.ensureCapacity(2),this.buffer[this.pos]=e>>8&255,this.buffer[this.pos+1]=e&255,this.pos+=2,this}writeInt16LE(e){return this.writeUInt16LE(e&65535),this}writeInt16BE(e){return this.writeUInt16BE(e&65535),this}writeUInt32LE(e){return this.ensureCapacity(4),this.buffer[this.pos]=e&255,this.buffer[this.pos+1]=e>>8&255,this.buffer[this.pos+2]=e>>16&255,this.buffer[this.pos+3]=e>>24&255,this.pos+=4,this}writeUInt32BE(e){return this.ensureCapacity(4),this.buffer[this.pos]=e>>24&255,this.buffer[this.pos+1]=e>>16&255,this.buffer[this.pos+2]=e>>8&255,this.buffer[this.pos+3]=e&255,this.pos+=4,this}writeInt32LE(e){return this.writeUInt32LE(e>>>0),this}writeInt32BE(e){return this.writeUInt32BE(e>>>0),this}writeUInt64BEBn(e){let t=e.toArray(`be`,8);return this.write(t),this}writeUInt64LEBn(e){let t=e.toArray(`be`,8);return this.writeReverse(t),this}writeUInt64LE(e){let t=new h(e).toArray(`be`,8);return this.writeReverse(t),this}writeVarIntNum(e){let t=yn.varIntNum(e);return this.write(t),this}writeVarIntBn(e){let t=yn.varIntBn(e);return this.write(t),this}reset(){this.pos=0}},Yt=class e{bin;pos;length;static makeReader(t,n=0){if(t instanceof Uint8Array)return new e(t,n);if(Array.isArray(t))return new bn(t,n);throw Error(`ReaderUint8Array.makeReader: bin must be Uint8Array or number[]`)}constructor(e=new Uint8Array,t=0){if(e instanceof Uint8Array)this.bin=e;else if(Array.isArray(e))this.bin=new Uint8Array(e);else throw TypeError(`ReaderUint8Array constructor: bin must be Uint8Array or number[]`);this.pos=t,this.length=this.bin.length}eof(){return this.pos>=this.length}read(e=this.length){let t=this.pos,n=this.pos+e;return this.pos=n,this.bin.slice(t,n)}readView(e=this.length-this.pos){if(!Number.isSafeInteger(e)||e<0||this.pos+e>this.length)throw RangeError(`ReaderUint8Array read exceeds available data`);let t=this.pos;return this.pos+=e,this.bin.subarray(t,this.pos)}skip(e){if(!Number.isSafeInteger(e)||e<0||this.pos+e>this.length)throw RangeError(`ReaderUint8Array skip exceeds available data`);this.pos+=e}remaining(){return this.length-this.pos}readReverse(e=this.length){let t=new Uint8Array(e);for(let n=0;n<e;n++)t[n]=this.bin[this.pos+e-1-n];return this.pos+=e,t}readUInt8(){let e=this.bin[this.pos];return this.pos+=1,e}readInt8(){let e=this.bin[this.pos];return this.pos+=1,e&128?e-256:e}readUInt16BE(){let e=this.bin[this.pos]<<8|this.bin[this.pos+1];return this.pos+=2,e}readInt16BE(){let e=this.readUInt16BE();return e&32768?e-65536:e}readUInt16LE(){let e=this.bin[this.pos]|this.bin[this.pos+1]<<8;return this.pos+=2,e}readInt16LE(){let e=this.readUInt16LE();return e&32768?e-65536:e}readUInt32BE(){let e=this.bin[this.pos]*16777216+(this.bin[this.pos+1]<<16|this.bin[this.pos+2]<<8|this.bin[this.pos+3]);return this.pos+=4,e}readInt32BE(){let e=this.readUInt32BE();return e&2147483648?e-4294967296:e}readUInt32LE(){let e=(this.bin[this.pos]|this.bin[this.pos+1]<<8|this.bin[this.pos+2]<<16|this.bin[this.pos+3]<<24)>>>0;return this.pos+=4,e}readInt32LE(){let e=this.readUInt32LE();return e&2147483648?e-4294967296:e}readUInt64BEBn(){let e=new h(Array.from(this.bin.slice(this.pos,this.pos+8)));return this.pos+=8,e}readUInt64LEBn(){return new h(Array.from(this.readReverse(8)))}readInt64LEBn(){let e=new h(2).pow(new h(63)),t=new h(2).pow(new h(64)),n=new h(Array.from(this.readReverse(8)));return n.gte(e)&&(n=n.sub(t)),n}readVarIntNum(e=!0){let t=this.readUInt8(),n;switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(n=e?this.readInt64LEBn():this.readUInt64LEBn(),n.lte(new h(2).pow(new h(53))))return n.toNumber();throw Error(`number too large to retain precision - use readVarIntBn`);default:return t}}readVarInt(){switch(this.bin[this.pos]){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){let e=this.readUInt8();switch(e){case 253:return new h(this.readUInt16LE());case 254:return new h(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new h(e)}}},Xt=globalThis.Buffer,Zt=Xt!=null&&typeof Xt.from==`function`,Qt=`0123456789abcdef`,$t=Array.from({length:256},()=>``);for(let e=0;e<256;e++)$t[e]=Qt[e>>4&15]+Qt[e&15];var en=e=>Zt?Xt.from(e).toString(`hex`):e.length===0?``:Array.from(e,e=>$t[e&255]).join(``),tn=(e,t)=>e instanceof Uint8Array?e:typeof e==`string`&&t===`hex`?on(e):new Uint8Array(nn(e,t)),nn=(e,t)=>{if(Array.isArray(e))return e.slice();if(e===void 0)return[];if(typeof e!=`string`)return Array.from(e,e=>Math.trunc(e));switch(t){case`hex`:return an(e);case`base64`:return ln(e);default:return un(e)}},rn=new Int8Array(256).fill(-1);for(let e=0;e<10;e++)rn[48+e]=e;for(let e=0;e<6;e++)rn[65+e]=10+e,rn[97+e]=10+e;var an=e=>Array.from(on(e)),on=e=>{x(e);let t=e.length%2==0?e:`0`+e;if(Zt){let e=Xt.from(t,`hex`);return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let n=new Uint8Array(t.length/2),r=0;for(let e=0;e<t.length;e+=2){let i=rn[t.codePointAt(e)],a=rn[t.codePointAt(e+1)];n[r++]=i<<4|a}return n},sn=e=>{if(typeof e!=`string`)throw TypeError(`msg must be a string`);let t=e.trim().replaceAll(/[\r\n\t\f\v ]+/g,``).replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t.indexOf(`=`);if(n===-1)return t;let r=t.slice(n);if(!/^={1,2}$/.test(r)||t.slice(0,n).includes(`=`))throw Error(`Invalid base64 padding`);return t.slice(0,n)},cn=(e,t)=>{if(e>=65&&e<=90)return e-65;if(e>=97&&e<=122)return e-97+26;if(e>=48&&e<=57)return e-48+52;if(e===43)return 62;if(e===47)return 63;throw Error(`Invalid base64 character at index ${t}`)};function ln(e){let t=sn(e),n=[],r=0,i=0;for(let e=0;e<t.length;e++){let a=cn(t.codePointAt(e),e);for(r=r<<6|a,i+=6;i>=8;)i-=8,n.push(r>>i&255),r&=(1<<i)-1}return n}function un(e){return Array.from(new TextEncoder().encode(e))}var dn=e=>new TextDecoder().decode(e instanceof Uint8Array?e:new Uint8Array(e)),fn=(e,t)=>{switch(t){case`hex`:return en(e);case`utf8`:return dn(e);default:return e}};function pn(e){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=``,r=0;for(;r<e.length;r+=3){let i=e[r],a=r+1<e.length?e[r+1]:0,o=r+2<e.length?e[r+2]:0,s=i>>2,c=(i&3)<<4|a>>4,l=(a&15)<<2|o>>6,u=o&63;n+=t.charAt(s)+t.charAt(c),n+=r+1<e.length?t.charAt(l):`=`,n+=r+2<e.length?t.charAt(u):`=`}return n}var mn=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,hn=e=>{if(e===``||typeof e!=`string`)throw Error(`Expected base58 string but got “${e}”`);let t=e.match(/[^1-9A-HJ-NP-Za-km-z]/gmu);if(t!==null)throw Error(`Invalid base58 character “${t.join(``)}”`);let n=e.match(/^1+/gmu),r=n===null?0:n[0].length,i=(e.length-r)*(Math.log(58)/Math.log(256))+1>>>0;return[...new Uint8Array([...new Uint8Array(r),...Array.from(e).map(e=>mn.indexOf(e)).reduce((e,t)=>(e=e.map(e=>{let n=e*58+t;return t=n>>8,n}),e),new Uint8Array(i)).reverse().filter((e=>t=>e||=t)(!1))])]},gn=e=>{let t=Array.from({length:256},()=>-1);for(let e=0;e<58;++e)t[mn.codePointAt(e)]=e;let n=[];for(let r of e){let e=r;for(let r=0;r<n.length;++r){let i=(t[n[r]]<<8)+e,a=Math.trunc(i/58),o=i-a*58;n[r]=mn.codePointAt(o),e=a}for(;e!==0;){let t=Math.trunc(e/58),r=e-t*58;n.push(mn.codePointAt(r)),e=t}}for(let t of e)if(t===0)n.push(`1`.codePointAt(0));else break;return n.reverse(),String.fromCodePoint(...n)},_n=(e,t=[0])=>{let n=Qe([...t,...e]);return n=[...t,...e,...n.slice(0,4)],gn(n)},vn=(e,t,n=1)=>{let r=hn(e),i=r.slice(0,n),a=r.slice(n,-4),o=[...i,...a];return o=Qe(o),r.slice(-4).forEach((e,t)=>{if(e!==o[t])throw Error(`Invalid checksum`)}),t===`hex`&&(i=en(i),a=en(a)),{prefix:i,data:a}},yn=class e{bufs;length;constructor(e){this.bufs=e??[],this.length=0;for(let e of this.bufs)this.length+=e.length}getLength(){return this.length}toUint8Array(){let e=new Uint8Array(this.length),t=0;for(let n of this.bufs)e.set(n,t),t+=n.length;return e}toArray(){let e=this.length,t=Array.from({length:e},()=>0),n=0;for(let e of this.bufs)if(e instanceof Uint8Array)for(let r of e)t[n++]=r;else{let r=e;for(let e of r)t[n++]=e}return t}toHex(){return this.toArray().map(e=>e.toString(16).padStart(2,`0`)).join(``)}write(e){return this.bufs.push(e),this.length+=e.length,this}writeReverse(e){let t=Array.from({length:e.length},()=>0);for(let n=0;n<t.length;n++)t[n]=e[e.length-1-n];return this.write(t)}writeUInt8(e){let t=Array.from({length:1},()=>0);return t[0]=e&255,this.write(t),this}writeInt8(e){return this.writeUInt8(e)}writeUInt16BE(e){let t=[e>>8&255,e&255];return this.write(t)}writeInt16BE(e){return this.writeUInt16BE(e&65535)}writeUInt16LE(e){let t=[e&255,e>>8&255];return this.write(t)}writeInt16LE(e){return this.writeUInt16LE(e&65535)}writeUInt32BE(e){let t=[e>>24&255,e>>16&255,e>>8&255,e&255];return this.write(t)}writeInt32BE(e){return this.writeUInt32BE(e>>>0)}writeUInt32LE(e){let t=[e&255,e>>8&255,e>>16&255,e>>24&255];return this.write(t)}writeInt32LE(e){return this.writeUInt32LE(e>>>0)}writeUInt64BEBn(e){let t=e.toArray(`be`,8);return this.write(t),this}writeUInt64LEBn(e){let t=e.toArray(`be`,8);return this.writeReverse(t),this}writeUInt64LE(e){if(e===-1)this.write(Array.from({length:8},()=>255));else{let t=new h(e).toArray(`be`,8);this.writeReverse(t)}return this}writeVarIntNum(t){let n=e.varIntNum(t);return this.write(n),this}writeVarIntBn(t){let n=e.varIntBn(t);return this.write(n),this}static varIntNum(e){let t;if(e<0)return this.varIntBn(new h(e));if(e<253)t=[e];else if(e<65536)t=[253,e&255,e>>8&255];else if(e<4294967296)t=[254,e&255,e>>8&255,e>>16&255,e>>24&255];else{let n=e&4294967295,r=Math.floor(e/4294967296)&4294967295;t=[255,n&255,n>>8&255,n>>16&255,n>>24&255,r&255,r>>8&255,r>>16&255,r>>24&255]}return t}static varIntBn(t){let n;if(t.isNeg()&&(t=t.add(Cn)),t.ltn(253))n=[t.toNumber()];else if(t.ltn(65536)){let e=t.toNumber();n=[253,e&255,e>>8&255]}else if(t.lt(new h(4294967296))){let e=t.toNumber();n=[254,e&255,e>>8&255,e>>16&255,e>>24&255]}else{let r=new e;r.writeUInt8(255),r.writeUInt64LEBn(t),n=r.toArray()}return n}},bn=class{bin;pos;length;constructor(e=[],t=0){this.bin=e,this.pos=t,this.length=e.length}eof(){return this.pos>=this.length}read(e=this.length){let t=this.pos,n=this.pos+e;return this.pos=n,this.bin.slice(t,n)}readReverse(e=this.length){let t=Array.from({length:e},()=>0);for(let n=0;n<e;n++)t[n]=this.bin[this.pos+e-1-n];return this.pos+=e,t}readUInt8(){let e=this.bin[this.pos];return this.pos+=1,e}readInt8(){let e=this.bin[this.pos];return this.pos+=1,e&128?e-256:e}readUInt16BE(){let e=this.bin[this.pos]<<8|this.bin[this.pos+1];return this.pos+=2,e}readInt16BE(){let e=this.readUInt16BE();return e&32768?e-65536:e}readUInt16LE(){let e=this.bin[this.pos]|this.bin[this.pos+1]<<8;return this.pos+=2,e}readInt16LE(){let e=this.readUInt16LE();return e&32768?e-65536:e}readUInt32BE(){let e=this.bin[this.pos]*16777216+(this.bin[this.pos+1]<<16|this.bin[this.pos+2]<<8|this.bin[this.pos+3]);return this.pos+=4,e}readInt32BE(){let e=this.readUInt32BE();return e&2147483648?e-4294967296:e}readUInt32LE(){let e=(this.bin[this.pos]|this.bin[this.pos+1]<<8|this.bin[this.pos+2]<<16|this.bin[this.pos+3]<<24)>>>0;return this.pos+=4,e}readInt32LE(){let e=this.readUInt32LE();return e&2147483648?e-4294967296:e}readUInt64BEBn(){let e=new h(this.bin.slice(this.pos,this.pos+8));return this.pos+=8,e}readUInt64LEBn(){return new h(this.readReverse(8))}readInt64LEBn(){let e=new h(this.readReverse(8));return e.gte(Sn)&&(e=e.sub(Cn)),e}readVarIntNum(e=!0){let t=this.readUInt8(),n;switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(n=e?this.readInt64LEBn():this.readUInt64LEBn(),n.lte(new h(2).pow(new h(53))))return n.toNumber();throw Error(`number too large to retain precision - use readVarIntBn`);default:return t}}readVarInt(){switch(this.bin[this.pos]){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){let e=this.readUInt8();switch(e){case 253:return new h(this.readUInt16LE());case 254:return new h(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new h(e)}}},xn=e=>{if(e.length===0)return e;let t=e.at(-1);if(t&127)return e;if(e.length===1)return[];if(e.at(-2)&128)return e;for(let n=e.length-1;n>0;n--)if(e[n-1]!==0)return e[n-1]&128?(e[n]=t,e.slice(0,n+1)):(e[n-1]|=t,e.slice(0,n));return[]},Sn=new h(2).pow(new h(63)),Cn=new h(2).pow(new h(64));function wn(e,t=`Expected a valid value, but got undefined or null.`){if(e==null)throw Error(t);return e}var Tn;function En(e,t){let n=e.andln(3)+t&3;return n===3?-1:n}function Dn(e,t,n,r){if(!(n&1))return 0;let i=e.andln(7)+t&7;return(i===3||i===5)&&r===2?-n:n}function On(e,t){return 2*e===t+1?1-e:e}var kn=class e{p;red;redN;zero;one;two;g;n;a;b;tinv;zeroA;threeA;endo;_endoWnafT1;_endoWnafT2;_wnafT1;_wnafT2;_wnafT3;_wnafT4;_bitLength;static assert(e,t=`Elliptic curve assertion failed`){if(!e)throw Error(t)}getNAF(e,t,n){let r=Array.from({length:Math.max(e.bitLength(),n)+1},()=>0);r.fill(0);let i=1<<t+1,a=e.clone();for(let e=0;e<r.length;e++){let t,n=a.andln(i-1);a.isOdd()?(t=n>(i>>1)-1?(i>>1)-n:n,a.isubn(t)):t=0,r[e]=t,a.iushrn(1)}return r}getJSF(e,t){let n=[[],[]];e=e.clone(),t=t.clone();let r=0,i=0;for(;e.cmpn(-r)>0||t.cmpn(-i)>0;){let a=En(e,r),o=En(t,i),s=Dn(e,r,a,o);n[0].push(s);let c=Dn(t,i,o,a);n[1].push(c),r=On(r,s),i=On(i,c),e.iushrn(1),t.iushrn(1)}return n}static cachedProperty(e,t,n){let r=`_`+t;e.prototype[t]=function(){return this[r]===void 0&&(this[r]=n.call(this)),this[r]}}static parseBytes(e){return typeof e==`string`?nn(e,`hex`):e}static intFromLE(e){return new h(e,`hex`,`le`)}constructor(){if(Tn===void 0)Tn=this;else return Tn;let e={prime:`k256`,p:`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`,a:`0`,b:`7`,n:`ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141`,h:`1`,beta:`7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`,lambda:`5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72`,basis:[{a:`3086d221a7d46bcde86c90e49284eb15`,b:`-e4437ed6010e88286f547fa90abfe4c3`},{a:`114ca50f7a8e2f3f657c1108d9d44cfd8`,b:`3086d221a7d46bcde86c90e49284eb15`}],gRed:!1,g:[`79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798`,`483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8`,{doubles:{step:4,points:[[`e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a`,`f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821`],[`8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508`,`11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf`],[`175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739`,`d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695`],[`363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640`,`4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9`],[`8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c`,`4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36`],[`723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda`,`96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f`],[`eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa`,`5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999`],[`100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0`,`cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09`],[`e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d`,`9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d`],[`feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d`,`e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088`],[`da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1`,`9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d`],[`53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0`,`5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8`],[`8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047`,`10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a`],[`385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862`,`283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453`],[`6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7`,`7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160`],[`3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd`,`56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0`],[`85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83`,`7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6`],[`948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a`,`53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589`],[`6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8`,`bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17`],[`e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d`,`4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda`],[`e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725`,`7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd`],[`213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754`,`4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2`],[`4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c`,`17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6`],[`fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6`,`6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f`],[`76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39`,`c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01`],[`c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891`,`893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3`],[`d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b`,`febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f`],[`b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03`,`2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7`],[`e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d`,`eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78`],[`a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070`,`7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1`],[`90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4`,`e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150`],[`8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da`,`662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82`],[`e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11`,`1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc`],[`8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e`,`efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b`],[`e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41`,`2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51`],[`b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef`,`67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45`],[`d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8`,`db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120`],[`324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d`,`648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84`],[`4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96`,`35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d`],[`9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd`,`ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d`],[`6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5`,`9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8`],[`a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266`,`40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8`],[`7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71`,`34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac`],[`928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac`,`c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f`],[`85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751`,`1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962`],[`ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e`,`493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907`],[`827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241`,`c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec`],[`eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3`,`be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d`],[`e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f`,`4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414`],[`1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19`,`aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd`],[`146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be`,`b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0`],[`fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9`,`6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811`],[`da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2`,`8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1`],[`a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13`,`7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c`],[`174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c`,`ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73`],[`959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba`,`2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd`],[`d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151`,`e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405`],[`64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073`,`d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589`],[`8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458`,`38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e`],[`13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b`,`69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27`],[`bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366`,`d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1`],[`8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa`,`40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482`],[`8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0`,`620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945`],[`dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787`,`7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573`],[`f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e`,`ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82`]]},naf:{wnd:7,points:[[`f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9`,`388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672`],[`2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4`,`d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6`],[`5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc`,`6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da`],[`acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe`,`cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37`],[`774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb`,`d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b`],[`f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8`,`ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81`],[`d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e`,`581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58`],[`defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34`,`4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77`],[`2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c`,`85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a`],[`352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5`,`321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c`],[`2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f`,`2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67`],[`9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714`,`73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402`],[`daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729`,`a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55`],[`c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db`,`2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482`],[`6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4`,`e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82`],[`1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5`,`b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396`],[`605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479`,`2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49`],[`62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d`,`80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf`],[`80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f`,`1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a`],[`7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb`,`d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7`],[`d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9`,`eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933`],[`49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963`,`758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a`],[`77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74`,`958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6`],[`f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530`,`e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37`],[`463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b`,`5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e`],[`f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247`,`cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6`],[`caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1`,`cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476`],[`2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120`,`4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40`],[`7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435`,`91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61`],[`754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18`,`673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683`],[`e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8`,`59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5`],[`186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb`,`3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b`],[`df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f`,`55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417`],[`5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143`,`efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868`],[`290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba`,`e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a`],[`af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45`,`f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6`],[`766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a`,`744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996`],[`59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e`,`c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e`],[`f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8`,`e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d`],[`7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c`,`30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2`],[`948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519`,`e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e`],[`7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab`,`100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437`],[`3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca`,`ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311`],[`d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf`,`8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4`],[`1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610`,`68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575`],[`733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4`,`f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d`],[`15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c`,`d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d`],[`a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940`,`edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629`],[`e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980`,`a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06`],[`311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3`,`66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374`],[`34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf`,`9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee`],[`f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63`,`4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1`],[`d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448`,`fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b`],[`32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf`,`5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661`],[`7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5`,`8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6`],[`ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6`,`8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e`],[`16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5`,`5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d`],[`eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99`,`f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc`],[`78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51`,`f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4`],[`494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5`,`42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c`],[`a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5`,`204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b`],[`c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997`,`4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913`],[`841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881`,`73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154`],[`5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5`,`39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865`],[`36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66`,`d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc`],[`336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726`,`ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224`],[`8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede`,`6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e`],[`1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94`,`60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6`],[`85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31`,`3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511`],[`29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51`,`b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b`],[`a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252`,`ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2`],[`4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5`,`cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c`],[`d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b`,`6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3`],[`ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4`,`322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d`],[`af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f`,`6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700`],[`e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889`,`2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4`],[`591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246`,`b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196`],[`11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984`,`998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4`],[`3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a`,`b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257`],[`cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030`,`bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13`],[`c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197`,`6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096`],[`c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593`,`c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38`],[`a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef`,`21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f`],[`347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38`,`60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448`],[`da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a`,`49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a`],[`c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111`,`5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4`],[`4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502`,`7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437`],[`3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea`,`be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7`],[`cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26`,`8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d`],[`b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986`,`39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a`],[`d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e`,`62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54`],[`48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4`,`25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77`],[`dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda`,`ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517`],[`6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859`,`cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10`],[`e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f`,`f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125`],[`eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c`,`6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e`],[`13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942`,`fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1`],[`ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a`,`1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2`],[`b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80`,`5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423`],[`ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d`,`438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8`],[`8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1`,`cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758`],[`52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63`,`c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375`],[`e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352`,`6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d`],[`7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193`,`ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec`],[`5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00`,`9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0`],[`32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58`,`ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c`],[`e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7`,`d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4`],[`8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8`,`c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f`],[`4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e`,`67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649`],[`3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d`,`cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826`],[`674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b`,`299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5`],[`d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f`,`f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87`],[`30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6`,`462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b`],[`be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297`,`62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc`],[`93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a`,`7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c`],[`b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c`,`ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f`],[`d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52`,`4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a`],[`d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb`,`bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46`],[`463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065`,`bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f`],[`7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917`,`603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03`],[`74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9`,`cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08`],[`30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3`,`553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8`],[`9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57`,`712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373`],[`176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66`,`ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3`],[`75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8`,`9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8`],[`809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721`,`9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1`],[`1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180`,`4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9`]]}}]};this.p=new h(e.p,16),this.red=new v(e.prime),this.zero=new h(0).toRed(this.red),this.one=new h(1).toRed(this.red),this.two=new h(2).toRed(this.red),this.n=new h(e.n,16),this.g=ur.fromJSON(e.g,e.gRed),this._wnafT1=Array.from({length:4},()=>void 0),this._wnafT2=Array.from({length:4},()=>void 0),this._wnafT3=Array.from({length:4},()=>void 0),this._wnafT4=Array.from({length:4},()=>void 0),this._bitLength=this.n.bitLength(),this.redN=this.n.toRed(this.red),this.a=new h(e.a,16).toRed(this.red),this.b=new h(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=Array.from({length:4},()=>void 0),this._endoWnafT2=Array.from({length:4},()=>void 0)}_getEndomorphism(e){if(!this.zeroA||this.p.modrn(3)!==1)return;let t=this._resolveEndomorphismBeta(e),n=this._resolveEndomorphismLambda(e,t);return{beta:t,lambda:n,basis:this._resolveEndomorphismBasis(e,n)}}_resolveEndomorphismBeta(e){if(e.beta!==void 0)return new h(e.beta,16).toRed(this.red);let t=this._getEndoRoots(this.p);if(t==null)throw Error(`Failed to get endomorphism roots for beta.`);return(t[0].cmp(t[1])<0?t[0]:t[1]).toRed(this.red)}_endomorphismLambdaMatches(e,t,n=!1){if(this.g==null)throw Error(`Curve generator point (g) is not defined.`);let r=this.g.mul(e)?.x,i=this.g.x==null?void 0:this.g.x.redMul(t);if(r==null||i==null){if(n)throw Error(`Lambda computation failed: g.mul(lambda).x or g.x.redMul(beta) is undefined.`);return!1}return r.cmp(i)===0}_resolveEndomorphismLambda(t,n){if(t.lambda!==void 0)return new h(t.lambda,16);let r=this._getEndoRoots(this.n);if(r==null)throw Error(`Failed to get endomorphism roots for lambda.`);return this._endomorphismLambdaMatches(r[0],n)?r[0]:(e.assert(this._endomorphismLambdaMatches(r[1],n,!0),`Lambda selection does not match computed beta.`),r[1])}_resolveEndomorphismBasis(e,t){return typeof e.basis!=`object`||e.basis===null?this._getEndoBasis(t):e.basis.map(e=>({a:new h(e.a,16),b:new h(e.b,16)}))}_getEndoRoots(e){let t=e===this.p?this.red:new y(e),n=new h(2).toRed(t).redInvm(),r=n.redNeg(),i=new h(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]}_getEndoBasis(e){let t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,r=this.n.clone(),i=new h(1),a=new h(0),o=new h(0),s=new h(1),c,l,u,d,f,p,m=new h(0),g=0,_=new h(0),v=new h(0);for(;n.cmpn(0)!==0;){let e=r.div(n);_=r.sub(e.mul(n)),v=o.sub(e.mul(i));let f=s.sub(e.mul(a));if(u===void 0&&_.cmp(t)<0)c=m.neg(),l=i,u=_.neg(),d=v;else if(u!==void 0&&++g===2)break;m=_,r=n,n=_,o=i,i=v,s=a,a=f}if(c===void 0||l===void 0||u===void 0||d===void 0)throw Error(`Failed to compute Endo Basis values`);f=_.neg(),p=v;let y=u.sqr().add(d.sqr());return f.sqr().add(p.sqr()).cmp(y)>=0&&(f=c,p=l),u.negative!==0&&(u=u.neg(),d=d.neg()),f.negative!==0&&(f=f.neg(),p=p.neg()),[{a:u,b:d},{a:f,b:p}]}_endoSplit(e){if(this.endo==null)throw Error(`Endomorphism is not defined.`);let t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=i.mul(n.a),s=a.mul(r.a),c=i.mul(n.b),l=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:c.add(l).neg()}}validate(e){if(e.inf)return!0;let t=e.x,n=e.y;if(t===null||n===null)throw Error(`Point coordinates cannot be null`);let r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return n.redSqr().redISub(i).cmpn(0)===0}},An=class{curve;type;precomputed;constructor(e){this.curve=new kn,this.type=e,this.precomputed=null}},jn=class e extends An{x;y;z;zOne;constructor(e,t,n){super(`jacobian`),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new h(0)):(h.isBN(e)||(e=new h(e,16)),this.x=e,h.isBN(t)||(t=new h(t,16)),this.y=t,h.isBN(n)||(n=new h(n,16)),this.z=n),this.x.red??(this.x=this.x.toRed(this.curve.red)),this.y.red??(this.y=this.y.toRed(this.curve.red)),this.z.red??(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.isInfinity()&&(this.x=this.curve.one,this.y=this.curve.one,this.z=new h(0).toRed(this.curve.red),this.zOne=!1)}toP(){if(this.isInfinity())return new ur(null,null);let e=this.z.redInvm(),t=e.redSqr();return new ur(this.x.redMul(t),this.y.redMul(t).redMul(e))}neg(){return new e(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;let n=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(n),a=t.x.redMul(r),o=this.y.redMul(n.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),c=i.redSub(a),l=o.redSub(s);if(c.cmpn(0)===0)return l.cmpn(0)===0?this.dbl():new e(null,null,null);let u=c.redSqr(),d=u.redMul(c),f=i.redMul(u),p=l.redSqr().redIAdd(d).redISub(f).redISub(f),m=l.redMul(f.redISub(p)).redISub(o.redMul(d)),h=this.z.redMul(t.z).redMul(c);return new e(p,m,h)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;if(t.x===null||t.y===null)throw Error(`Point coordinates cannot be null`);let n=this.z.redSqr(),r=this.x,i=t.x.redMul(n),a=this.y,o=t.y.redMul(n).redMul(this.z),s=r.redSub(i),c=a.redSub(o);if(s.cmpn(0)===0)return c.cmpn(0)===0?this.dbl():new e(null,null,null);let l=s.redSqr(),u=l.redMul(s),d=r.redMul(l),f=c.redSqr().redIAdd(u).redISub(d).redISub(d),p=c.redMul(d.redISub(f)).redISub(a.redMul(u)),m=this.z.redMul(s);return new e(f,p,m)}dblp(e){if(e===0||this.isInfinity())return this;if(e===void 0)return this.dbl();let t=this;for(let n=0;n<e;n++)t=t.dbl();return t}dbl(){if(this.isInfinity())return this;let t,n,r;if(this.zOne){let e=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(e).redISub(a);o=o.redIAdd(o);let s=e.redAdd(e).redIAdd(e),c=s.redSqr().redISub(o).redISub(o),l=a.redIAdd(a);l=l.redIAdd(l),l=l.redIAdd(l),t=c,n=s.redMul(o.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{let e=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(e).redISub(a);o=o.redIAdd(o);let s=e.redAdd(e).redIAdd(e),c=s.redSqr(),l=a.redIAdd(a);l=l.redIAdd(l),l=l.redIAdd(l),t=c.redISub(o).redISub(o),n=s.redMul(o.redISub(t)).redISub(l),r=this.y.redMul(this.z),r=r.redIAdd(r)}return new e(t,n,r)}eq(e){if(e.type===`affine`)return this.eq(e.toJ());if(this===e||(e=e,this.isInfinity()&&e.isInfinity()))return!0;if(this.isInfinity()!==e.isInfinity())return!1;let t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;let r=t.redMul(this.z),i=n.redMul(e.z);return this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)===0}eqXToP(e){let t=this.z.redSqr(),n=e.toRed(this.curve?.red).redMul(t);if(this.x.cmp(n)===0)return!0;let r=e.clone();if(this.curve?.redN==null)throw Error(`Curve or redN is not initialized.`);let i=this.curve.redN.redMul(t);for(;r.cmp(this.curve.p)<0;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),this.x.cmp(n)===0)return!0}return!1}inspect(){return this.isInfinity()?`<EC JPoint Infinity>`:`<EC JPoint x: `+this.x.toString(16,2)+` y: `+this.y.toString(16,2)+` z: `+this.z.toString(16,2)+`>`}isInfinity(){return this.z.cmpn(0)===0}};function Mn(e,t,n){let r=-e,i=(t.X^n.X)&r,a=(t.Y^n.Y)&r,o=(t.Z^n.Z)&r;t.X^=i,n.X^=i,t.Y^=a,n.Y^=a,t.Z^=o,n.Z^=o}var Nn=0n,Pn=1n,Fn=2n,In=3n,Ln=4n,Rn=8n,zn=115792089237316195423570985008687907853269984665640564039457584007908834671663n,Bn=115792089237316195423570985008687907852837564279074904382605163141518161494337n,Vn=(1n<<256n)-1n;function Hn(e){let t=e>>256n;return e=(e&Vn)+(t<<32n)+t*977n,t=e>>256n,e=(e&Vn)+(t<<32n)+t*977n,e>=115792089237316195423570985008687907853269984665640564039457584007908834671663n&&(e-=zn),e}var Un=e=>Hn((e%zn+zn)%zn),Wn=(e,t)=>e>=t?e-t:zn-(t-e),O=(e,t)=>Hn(e*t),Gn=(e,t)=>Hn(e+t),Kn=e=>{let t=Pn,n=Nn,r=Un(e),i=zn;for(;r>Pn;){let e=i/r;[t,n]=[n-t*e,t],[r,i]=[i-r*e,r]}return Un(t)},qn=e=>O(e,e),Jn=(e,t)=>{let n=1n;for(e=Un(e);t>0n;)(t&1n)!=0n&&(n=O(n,e)),e=O(e,e),t>>=1n;return n},Yn=115792089237316195423570985008687907853269984665640564039457584007908834671664n>>2n,Xn=e=>{let t=Jn(e,Yn);return O(t,t)===Un(e)?t:null},Zn=e=>h.isBN(e)?BigInt(`0x`+e.toString(16)):BigInt(typeof e==`string`?`0x`+e:Array.isArray(e)?`0x`+en(e):e),Qn=BigInt(`0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798`),$n=BigInt(`0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8`),er=new Map,tr=e=>{let{X:t,Y:n,Z:r}=e;if(n===0n)return{X:Nn,Y:Pn,Z:Nn};let i=O(n,n),a=O(Ln,O(t,i)),o=O(In,O(t,t)),s=Wn(O(o,o),O(Fn,a));return{X:s,Y:Wn(O(o,Wn(a,s)),O(Rn,O(i,i))),Z:O(Fn,O(n,r))}},nr=(e,t)=>{if(e.Z===0n)return t;if(t.Z===0n)return e;let n=O(e.Z,e.Z),r=O(t.Z,t.Z),i=O(e.X,r),a=O(t.X,n),o=O(e.Y,O(r,t.Z)),s=O(t.Y,O(n,e.Z)),c=Wn(a,i),l=Wn(s,o);if(c===0n)return l===0n?tr(e):{X:Nn,Y:Pn,Z:Nn};let u=O(c,c),d=O(c,u),f=O(i,u),p=Wn(Wn(O(l,l),d),O(Fn,f));return{X:p,Y:Wn(O(l,Wn(f,p)),O(o,d)),Z:O(c,O(e.Z,t.Z))}},rr=e=>e.Z===0n?e:{X:e.X,Y:zn-e.Y,Z:e.Z},ir=(e,t)=>{let n=`${e}:${t.x.toString(16)}:${t.y.toString(16)}`,r=er.get(n);if(r!==void 0)return r;let i=Array.from({length:1<<e-1},()=>({X:Nn,Y:Pn,Z:Nn})),a={X:t.x,Y:t.y,Z:Pn};i[0]=a;let o=tr(a);for(let e=1;e<i.length;e++)i[e]=nr(i[e-1],o);return er.set(n,i),i},ar=(e,t)=>{let n=[],r=1n<<BigInt(t),i=r>>1n,a=e;for(;a>0n;){if((a&1n)==0n)n.push(0);else{let e=a&r-1n;e>i&&(e-=r),n.push(Number(e)),a-=e}a>>=Pn}return n},or=(e,t,n=5)=>{let r=ir(n,t),i=ar(e,n),a={X:Nn,Y:Pn,Z:Nn};for(let e=i.length-1;e>=0;e--){a=tr(a);let t=i[e];if(t!==0){let e=Math.abs(t)>>1,n=t>0?r[e]:rr(r[e]);a=nr(a,n)}}return a},sr=e=>{let t=e%Bn;return t<0n&&(t+=Bn),t},cr=(e,t)=>sr(e*t),lr=e=>{let t=1n,n=0n,r=sr(e),i=Bn;for(;r>1n;){let e=i/r;[t,n]=[n-t*e,t],[r,i]=[i-r*e,r]}return sr(t)},ur=class e extends An{x;y;inf;static _assertOnCurve(e){if(!e.validate())throw Error(`Invalid point`);return e}static fromDER(t){if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1==64){if(t[0]===6){if(t.at(-1)%2!=0)throw Error(`Point string value is wrong length`)}else if(t[0]===7&&t.at(-1)%2!=1)throw Error(`Point string value is wrong length`);let n=new e(t.slice(1,33),t.slice(33,65));return e._assertOnCurve(n)}if((t[0]===2||t[0]===3)&&t.length-1==32)return e._assertOnCurve(e.fromX(t.slice(1,33),t[0]===3));throw Error(`Unknown point format`)}static fromString(t){let n=nn(t,`hex`);return e._assertOnCurve(e.fromDER(n))}static fromX(t,n){let r=Zn(t);r=Un(r);let i=Xn(Gn(O(qn(r),r),7n));if(i===null)throw Error(`Invalid point`);let a=i;(a&1n)!=(n?1n:0n)&&(a=Wn(zn,a));let o=new h(r.toString(16),16),s=new h(a.toString(16),16);return e._assertOnCurve(new e(o,s))}static fromJSON(t,n){typeof t==`string`&&(t=JSON.parse(t));let r=new e(t[0],t[1],n);if(r=e._assertOnCurve(r),typeof t[2]!=`object`||t[2]===null)return r;let i=t[2],a=t=>{let r=new e(t[0],t[1],n);return e._assertOnCurve(r)};return r.precomputed={beta:null,doubles:typeof i.doubles==`object`&&i.doubles!==null?{step:i.doubles.step,points:[r].concat(i.doubles.points.map(a))}:void 0,naf:typeof i.naf==`object`&&i.naf!==null?{wnd:i.naf.wnd,points:[r].concat(i.naf.points.map(a))}:void 0},r}constructor(e,t,n=!0){super(`affine`),this.precomputed=null,e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(h.isBN(e)||(e=new h(e,16)),this.x=e,h.isBN(t)||(t=new h(t,16)),this.y=t,n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red===null&&(this.x=this.x.toRed(this.curve.red)),this.y.red===null&&(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}validate(){if(this.inf||this.x==null||this.y==null)return!1;try{let e=BigInt(`0x`+this.x.fromRed().toString(16)),t=BigInt(`0x`+this.y.fromRed().toString(16));return O(t,t)===Gn(O(O(e,e),e),7n)}catch{return!1}}encode(e=!0,t){if(this.inf)return t===`hex`?`00`:[0];let n=this.curve.p.byteLength(),r=this.getX().toArray(`be`,n),i;return i=e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray(`be`,n)),t===`hex`?en(i):i}toString(){return this.encode(!0,`hex`)}toJSON(){return this.precomputed==null?[this.x,this.y]:[this.x,this.y,typeof this.precomputed==`object`&&this.precomputed!==null?{doubles:this.precomputed.doubles==null?void 0:{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf==null?void 0:{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}:void 0]}inspect(){return this.isInfinity()?`<EC Point Infinity>`:`<EC Point x: `+(this.x?.fromRed()?.toString(16,2)??`undefined`)+` y: `+(this.y?.fromRed()?.toString(16,2)??`undefined`)+`>`}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||this.x?.cmp(t.x??new h(0))===0)return new e(null,null);let n=nr({X:BigInt(`0x`+this.x.fromRed().toString(16)),Y:BigInt(`0x`+this.y.fromRed().toString(16)),Z:Pn},{X:BigInt(`0x`+t.x.fromRed().toString(16)),Y:BigInt(`0x`+t.y.fromRed().toString(16)),Z:Pn});if(n.Z===0n)return new e(null,null);let r=Kn(n.Z),i=O(r,r),a=O(n.X,i),o=O(n.Y,O(i,r));return new e(a.toString(16),o.toString(16))}dbl(){if(this.inf)return this;if(this.x===null||this.y===null)throw Error(`Point coordinates cannot be null`);let t=BigInt(`0x`+this.x.fromRed().toString(16)),n=BigInt(`0x`+this.y.fromRed().toString(16));if(n===0n)return new e(null,null);let r=tr({X:t,Y:n,Z:Pn}),i=Kn(r.Z),a=O(i,i),o=O(r.X,a),s=O(r.Y,O(a,i));return new e(o.toString(16),s.toString(16))}getX(){return(this.x??new h(0)).fromRed()}getY(){return(this.y??new h(0)).fromRed()}mul(t){if(h.isBN(t)||(t=new h(t,16)),t=t,this.inf)return this;let n=t.isNeg(),r=n?t.neg():t,i=BigInt(`0x`+r.toString(16));if(i=Un(i),i===0n||i===0n)return new e(null,null);if(this.x===null||this.y===null)throw Error(`Point coordinates cannot be null`);let a,o;this===this.curve.g?(a=Qn,o=$n):(a=BigInt(`0x`+this.x.fromRed().toString(16)),o=BigInt(`0x`+this.y.fromRed().toString(16)));let s=or(i,{x:a,y:o});if(s.Z===0n)return new e(null,null);let c=Kn(s.Z),l=O(c,c),u=O(s.X,l),d=O(s.Y,O(l,c)),f=new h(u.toString(16),16),p=new h(d.toString(16),16),m=new e(f,p);return n?m.neg():m}mulCT(t){if(h.isBN(t)||(t=new h(t,16)),t=t,this.inf)return new e(null,null);let n=t.isNeg(),r=n?t.neg():t,i=BigInt(`0x`+r.toString(16));if(i=Un(i),i===0n)return new e(null,null);let a=this===this.curve.g?Qn:BigInt(`0x`+this.getX().toString(16)),o=this===this.curve.g?$n:BigInt(`0x`+this.getY().toString(16)),s={X:0n,Y:1n,Z:0n},c={X:a,Y:o,Z:1n},l=i.toString(2);for(let e of l){let t=e===`1`?1n:0n;Mn(t,s,c),c=nr(s,c),s=tr(s),Mn(t,s,c)}if(s.Z===0n)return new e(null,null);let u=Kn(s.Z),d=O(u,u),f=O(s.X,d),p=O(s.Y,O(d,u)),m=new e(f.toString(16),p.toString(16));return n?m.neg():m}mulAdd(e,t,n){let r=[this,t],i=[e,n];return this._endoWnafMulAdd(r,i)}jmulAdd(e,t,n){let r=[this,t],i=[e,n];return this._endoWnafMulAdd(r,i,!0)}eq(e){return this===e||this.inf===e.inf&&(this.inf||(this.x??new h(0)).cmp(e.x??new h(0))===0&&(this.y??new h(0)).cmp(e.y??new h(0))===0)}neg(t){if(this.inf)return this;let n=new e(this.x,(this.y??new h(0)).redNeg());if(t===!0&&this.precomputed!=null){let e=this.precomputed;n.precomputed={naf:e.naf==null?void 0:{wnd:e.naf.wnd,points:e.naf.points.map(e=>e.neg())},doubles:e.doubles==null?void 0:{step:e.doubles.step,points:e.doubles.points.map(e=>e.neg())},beta:void 0}}return n}dblp(e){let t;for(let n=0;n<e;n++)t=(t??this).dbl();return t??this}toJ(){return this.inf?new jn(null,null,null):new jn(this.x,this.y,this.curve.one)}_getBeta(){if(typeof this.curve.endo!=`object`)return;let t=this.precomputed;if(typeof t==`object`&&t&&typeof t.beta==`object`&&t.beta!==null)return t.beta;let n=new e((this.x??new h(0)).redMul(this.curve.endo.beta),this.y);if(t!=null){let r=this.curve,i=t=>{let n=t;if(n.x===null)throw Error(`p.x is null`);if(r.endo===void 0||r.endo===null)throw Error(`curve.endo is undefined`);return new e(n.x.redMul(r.endo.beta),n.y)};t.beta=n,n.precomputed={beta:null,naf:t.naf==null?void 0:{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles==null?void 0:{step:t.doubles.step,points:t.doubles.points.map(i)}}}return n}_fixedNafMul(e){if(typeof this.precomputed!=`object`||this.precomputed===null)throw Error(`_fixedNafMul requires precomputed values for the point`);let t=this._getDoubles(),n=this.curve.getNAF(e,1,this.curve._bitLength),r=(1<<t.step+1)-(t.step%2==0?2:1);r/=3;let i=[];for(let e=0;e<n.length;e+=t.step){let r=0;for(let i=e+t.step-1;i>=e;i--)r=(r<<1)+n[i];i.push(r)}let a=new jn(null,null,null),o=new jn(null,null,null);for(let e=r;e>0;e--){for(let n=0;n<i.length;n++){let r=i[n];r===e?o=o.mixedAdd(t.points[n]):r===-e&&(o=o.mixedAdd(t.points[n].neg()))}a=a.add(o)}return a.toP()}_prepareWnafWindows(e,t,n,r,i){for(let a=0;a<n;a++){let n=t[a]._getNAFPoints(e);r[a]=n.wnd,i[a]=n.points}}_combineWnafPair(e,t,n){let{points:r,coeffs:i,wndWidth:a,wnd:o,naf:s,currentMax:c}=n;if(a[e]!==1||a[t]!==1)return s[e]=this.curve.getNAF(i[e],a[e],this.curve._bitLength),s[t]=this.curve.getNAF(i[t],a[t],this.curve._bitLength),Math.max(c,s[e].length,s[t].length);let l=[r[e],null,null,r[t]],u=r[e].y??new h(0),d=r[t].y??new h(0);u.cmp(d)===0?(l[1]=r[e].add(r[t]),l[2]=r[e].toJ().mixedAdd(r[t].neg())):u.cmp(d.redNeg())===0?(l[1]=r[e].toJ().mixedAdd(r[t]),l[2]=r[e].add(r[t].neg())):(l[1]=r[e].toJ().mixedAdd(r[t]),l[2]=r[e].toJ().mixedAdd(r[t].neg()));let f=[-3,-1,-5,-7,0,7,5,1,3],p=this.curve.getJSF(i[e],i[t]),m=Math.max(c,p[0].length);s[e]=Array.from({length:m}),s[t]=Array.from({length:m});for(let n=0;n<m;n++){let r=Math.trunc(p[0][n]),i=Math.trunc(p[1][n]);s[e][n]=f[(r+1)*3+(i+1)],s[t][n]=0,o[e]=l}return m}_prepareWnafRepresentations(e,t,n,r,i,a){let o=0;for(let s=n-1;s>=1;s-=2)o=this._combineWnafPair(s-1,s,{points:e,coeffs:t,wndWidth:r,wnd:i,naf:a,currentMax:o});return o}_collectWnafStep(e,t,n,r){let i=e,a=0;for(;i>=0;){let e=!0;for(let a=0;a<t;a++)r[a]=new h(typeof n[a][i]==`number`?n[a][i]:0),r[a].isZero()||(e=!1);if(!e)break;a++,i--}return i>=0&&a++,{index:i,doubles:a}}_addWnafStep(e,t,n,r){let i=new h(1),a=new h(2),o=e;for(let e=0;e<t;e++){let t=n[e];if(t.cmpn(0)===0)continue;let s=t.isNeg()?r[e][t.neg().sub(i).div(a).toNumber()].neg():r[e][t.sub(i).div(a).toNumber()];o=s.type===`affine`?o.mixedAdd(s):o.add(s)}return o}_wnafMulAdd(e,t,n,r,i){let a=this.curve._wnafT1.length,o=Array.from({length:a}),s=Array.from({length:a},()=>[]),c=Array.from({length:a},()=>[]);this._prepareWnafWindows(e,t,r,o,s);let l=this._prepareWnafRepresentations(t,n,r,o,s,c),u=new jn(null,null,null),d=this.curve._wnafT4,f=l;for(;f>=0;){let e=this._collectWnafStep(f,r,c,d);if(f=e.index,u=u.dblp(e.doubles),f<0)break;u=this._addWnafStep(u,r,d,s),f--}for(let e=0;e<r;e++)s[e]=[];return i===!0?u:u.toP()}_endoWnafMulAdd(t,n,r){let i=Array.from({length:t.length*2}),a=Array.from({length:t.length*2}),o=0;for(;o<t.length;o++){let r=this.curve._endoSplit(n[o]),s=t[o],c=s._getBeta()??new e(null,null);r.k1.negative!==0&&(r.k1.ineg(),s=s.neg(!0)),r.k2.negative!==0&&(r.k2.ineg(),c=c.neg(!0)),i[o*2]=s,i[o*2+1]=c,a[o*2]=r.k1,a[o*2+1]=r.k2}let s=this._wnafMulAdd(1,i,a,o*2,r);for(let e=0;e<o*2;e++)i[e]=null,a[e]=null;return s}_hasDoubles(e){if(this.precomputed==null)return!1;let t=this.precomputed.doubles;return typeof t==`object`&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)}_getDoubles(e,t){if(typeof this.precomputed==`object`&&this.precomputed!==null&&typeof this.precomputed.doubles==`object`&&this.precomputed.doubles!==null)return this.precomputed.doubles;let n=[this],r;for(let i=0;i<(t??0);i+=e??1){for(let t=0;t<(e??1);t++)r=(r??this).dbl();n.push(r)}return{step:e??1,points:n}}_getNAFPoints(e){if(typeof this.precomputed==`object`&&this.precomputed!==null&&typeof this.precomputed.naf==`object`&&this.precomputed.naf!==null)return this.precomputed.naf;let t=[this],n=(1<<e)-1,r=n===1?null:this.dbl();for(let e=1;e<n;e++)r!==null&&(t[e]=t[e-1].add(r));return{wnd:e,points:t}}},dr=class e extends ur{static fromPrivateKey(t){let n=new kn().g.mul(t);return new e(n.x,n.y)}static fromString(t){let n=ur.fromString(t);return new e(n.x,n.y)}static fromDER(t){let n=ur.fromDER(t);return new e(n.x,n.y)}constructor(e,t=null,n=!0){if(e instanceof ur)super(e.getX(),e.getY());else{if(t===null&&n&&typeof e==`string`&&(e.length===66||e.length===130))throw Error(`You are using the "new PublicKey()" constructor with a DER hex string. You need to use "PublicKey.fromString()" instead.`);super(e,t,n)}}deriveSharedSecret(e){if(!this.validate())throw Error(`Public key not valid for ECDH secret derivation`);return this.mulCT(e)}verify(e,t,n){return wr(new h(Ze(e,n),16),t,this)}toDER(e){return e===`hex`?this.encode(!0,e):this.encode(!0)}toHash(e){let t=$e(this.encode(!0));return e===`hex`?en(t):t}toAddress(e=[0]){if(typeof e==`string`){if(e===`testnet`||e===`test`)e=[111];else if(e===`mainnet`||e===`main`)e=[0];else throw Error(`Invalid prefix ${e}`)}return _n(this.toHash(),e)}deriveChild(t,n,r,i){let a;if(typeof i==`function`){let e=i(t,this);e===void 0?(a=this.deriveSharedSecret(t),typeof r==`function`&&r(t,this,a)):a=e}else a=this.deriveSharedSecret(t);let o=nn(n,`utf8`),s=et(a.encode(!0),o),c=new kn().g.mul(new h(s)),l=this.add(c);return new e(l.x,l.y)}static fromMsgHashAndCompactSignature(e,t,n){let r=nn(t,n);if(r.length!==65)throw Error(`Invalid Compact Signature`);let i=r[0];if(i<27||i>=35)throw Error(`Invalid Compact Byte`);let a=r[0]-27;return a>3&&(a-=4),new fr(new h(r.slice(1,33)),new h(r.slice(33,65))).RecoverPublicKey(a,e)}},fr=class e{r;s;static fromDER(t,n){let r=(e,t)=>{let n=e[t.place++];if(n&128)throw Error(`Invalid DER entity length`);return n};class i{place=0}t=nn(t,n);let a=new i;if(t[a.place++]!==48)throw Error(`Signature DER must start with 0x30`);if(r(t,a)+a.place!==t.length||t[a.place++]!==2)throw Error(`Signature DER invalid`);let o=r(t,a),s=t.slice(a.place,o+a.place);if(a.place+=o,t[a.place++]!==2)throw Error(`Signature DER invalid`);let c=r(t,a);if(t.length!==c+a.place)throw Error(`Invalid R-length in signature DER`);let l=t.slice(a.place,c+a.place);if(s[0]===0){if(s[1]&128)s=s.slice(1);else throw Error(`Invalid R-value in signature DER`)}if(l[0]===0){if(l[1]&128)l=l.slice(1);else throw Error(`Invalid S-value in signature DER`)}return new e(new h(s),new h(l))}static fromCompact(t,n){if(t=nn(t,n),t.length!==65)throw Error(`Invalid Compact Signature`);let r=t[0];if(r<27||r>=35)throw Error(`Invalid Compact Byte`);return new e(new h(t.slice(1,33)),new h(t.slice(33,65)))}constructor(e,t){this.r=e,this.s=t}verify(e,t,n){return wr(new h(Ze(e,n),16),this,t)}toString(e){return this.toDER(e)}toDER(e){let t=(e,t)=>{if(t<128)e.push(t);else throw Error(`len must be < 0x80`)},n=e=>{let t=0,n=e.length-1;for(;e[t]===0&&!(e[t+1]&128)&&t<n;)t++;return t===0?e:e.slice(t)},r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=n(r),i=n(i);i[0]===0&&!(i[1]&128);)i=i.slice(1);let a=[2];t(a,r.length),a=a.concat(r),a.push(2),t(a,i.length);let o=a.concat(i),s=[48];return t(s,o.length),s=s.concat(o),e===`hex`?en(s):e===`base64`?pn(s):s}toCompact(e,t,n){if(e<0||e>3)throw Error(`Invalid recovery param`);if(typeof t!=`boolean`)throw TypeError(`Invalid compressed param`);let r=27+e;t&&(r+=4);let i=[r];return i=i.concat(this.r.toArray(`be`,32)),i=i.concat(this.s.toArray(`be`,32)),n===`hex`?en(i):n===`base64`?pn(i):i}RecoverPublicKey(e,t){let n=this.r,r=this.s,i=!!(e&1),a=e>>1,o=new kn,s=o.n,c=o.g,l=a===0?n:n.add(s),u=ur.fromX(l,i);if(!u.mul(s).isInfinity())throw Error(`nR is not at infinity`);let d=t.neg().umod(s),f=n.invm(s),p=f.mul(r).umod(s),m=f.mul(d).umod(s),h=new dr(c.mul(m).add(u.mul(p)));return h.validate(),h}CalculateRecoveryFactor(e,t){for(let n=0;n<4;n++){let r;try{r=this.RecoverPublicKey(n,t)}catch{continue}if(e.eq(r))return n}throw Error(`Unable to find valid recovery factor`)}},pr=class{K;V;constructor(e,t){let n=nn(e,`hex`),r=nn(t,`hex`);if(n.length!==32)throw Error(`Entropy must be exactly 32 bytes (256 bits)`);if(r.length!==32)throw Error(`Nonce must be exactly 32 bytes (256 bits)`);let i=n.concat(r);this.K=Array.from({length:32}),this.V=Array.from({length:32});for(let e=0;e<32;e++)this.K[e]=0,this.V[e]=1;this.update(i)}hmac(){return new Ge(this.K)}update(e){let t=this.hmac().update(this.V).update([0]);e!==void 0&&(t=t.update(e)),this.K=t.digest(),this.V=this.hmac().update(this.V).digest(),e!==void 0&&(this.K=this.hmac().update(this.V).update([1]).update(e).digest(),this.V=this.hmac().update(this.V).digest())}generate(e){let t=[];for(;t.length<e;)this.V=this.hmac().update(this.V).digest(),t=t.concat(this.V);let n=t.slice(0,e);return this.update(),en(n)}};function mr(e,t,n=new kn){let r=e.byteLength()*8-n.n.bitLength();return r>0&&e.iushrn(r),t!==!0&&e.cmp(n.n)>=0?e.sub(n.n):e}function hr(e){let t=e.toArray(`be`),n=0n;for(let e of t)n=n<<8n|BigInt(e);return n}var gr=new kn,_r=gr.n.byteLength(),vr=gr.n.subn(1),yr=Bn>>1n;function br(e,t,n){let r;if(r=typeof e==`function`?e(t):e!==void 0&&h.isBN(e)?e:new h(n.generate(_r),16),r==null)throw Error(`k is undefined`);return mr(r,!0)}function xr(e,t){if(e)throw Error(t)}function Sr(e,t,n,r,i){if(e.cmpn(1)<0||e.cmp(vr)>0)return xr(i,`Invalid fixed custom K value (must be >1 and <N-1)`);let a=gr.g.mulCT(e);if(a.isInfinity())return xr(i,`Invalid fixed custom K value (k·G at infinity)`);let o=sr(BigInt(`0x`+a.getX().toString(16)));if(o===0n)return xr(i,`Invalid fixed custom K value (r == 0)`);let s=cr(lr(BigInt(`0x`+e.toString(16))),sr(t+cr(o,n)));return s===0n?xr(i,`Invalid fixed custom K value (s == 0)`):(r&&s>yr&&(s=Bn-s),new fr(new h(o.toString(16),16),new h(s.toString(16),16)))}var Cr=(e,t,n=!1,r)=>{let i=gr.n.bitLength();if(e.bitLength()>i)throw Error(`ECDSA message is too large: expected <= ${i} bits. Callers must hash messages before signing.`);e=mr(e);let a=hr(e),o=hr(t),s=new pr(t.toArray(`be`,_r),e.toArray(`be`,_r)),c=h.isBN(r);for(let e=0;;e++){let t=Sr(br(r,e,s),a,o,n,c);if(t!=null)return t}},wr=(e,t,n)=>{let r=gr.n.bitLength();if(e.bitLength()>r)return!1;let i=hr(e);if(n.x==null||n.y==null)throw Error(`Invalid public key: missing coordinates.`);let a={x:hr(n.x),y:hr(n.y)},{r:o,s}={r:hr(t.r),s:hr(t.s)},c=i;if(o<=0n||o>=115792089237316195423570985008687907852837564279074904382605163141518161494337n||s<=0n||s>=115792089237316195423570985008687907852837564279074904382605163141518161494337n)return!1;let l=lr(s);if(l===0n)return!1;let u=cr(c,l),d=cr(o,l),f=nr(or(u,{x:Qn,y:$n}),or(d,a));if(f.Z===0n)return!1;let p=Kn(f.Z),m=O(p,p);return sr(O(f.X,m))===o},Tr=class{_rand;getRandomValues(e,t){let n=new Uint8Array(t);return e.crypto.getRandomValues(n),Array.from(n)}constructor(){let e=()=>{throw Error(`No secure random number generator is available in this environment.`)};if(this._rand=e,typeof globalThis<`u`&&typeof globalThis.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis,e);return}if(globalThis.self!==void 0&&typeof globalThis.self.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis.self,e);return}if(globalThis.window!==void 0&&typeof globalThis.window.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis.window,e);return}if(typeof process<`u`&&typeof process.getBuiltinModule==`function`){let e=process.getBuiltinModule(`node:crypto`);if(typeof e?.randomBytes==`function`){this._rand=t=>Array.from(e.randomBytes(t));return}}this._rand=e}generate(e){return this._rand(e)}},Er=null,Dr=e=>(Er??=new Tr,Er.generate(e)),Or=class e{x;y;constructor(e,t){let n=new kn().p;this.x=e.umod(n),this.y=t.umod(n)}toString(){return gn(this.x.toArray())+`.`+gn(this.y.toArray())}static fromString(t){let[n,r]=t.split(`.`);return new e(new h(hn(n)),new h(hn(r)))}},kr=class e{points;threshold;constructor(e,t){this.points=e,this.threshold=t??e.length}static fromPrivateKey(t,n){let r=new kn().p,i=[new Or(new h(0),new h(t.toArray()))];for(let e=1;e<n;e++){let e=new h(Dr(32)).umod(r),t=new h(Dr(32)).umod(r);i.push(new Or(e,t))}return new e(i)}valueAt(e){let t=new kn().p,n=new h(0);for(let r=0;r<this.threshold;r++){let i=this.points[r].y;for(let n=0;n<this.threshold;n++)if(r!==n){let a=this.points[n].x,o=this.points[r].x,s=e.sub(a).umod(t),c=o.sub(a).umod(t).invm(t),l=s.mul(c).umod(t);i=i.mul(l).umod(t)}n=n.add(i).umod(t)}return n}},Ar=class e{points;threshold;integrity;constructor(e,t,n){this.points=e,this.threshold=t,this.integrity=n}static fromBackupFormat(t){let n=0,r=``,i=t.map((e,t)=>{let i=e.split(`.`);if(i.length!==4)throw Error(`Invalid share format in share `+t.toString()+`. Expected format: "x.y.t.i" - received `+e);let[a,o,s,c]=i;if(s===void 0)throw Error(`Threshold not found in share `+t.toString());if(c===void 0)throw Error(`Integrity not found in share `+t.toString());let l=Number.parseInt(s,10);if(t!==0&&n!==l)throw Error(`Threshold mismatch in share `+t.toString());if(t!==0&&r!==c)throw Error(`Integrity mismatch in share `+t.toString());return n=l,r=c,Or.fromString([a,o].join(`.`))});return new e(i,n,r)}toBackupFormat(){return this.points.map(e=>e.toString()+`.`+this.threshold.toString()+`.`+this.integrity)}},jr=class e extends h{static fromRandom(){return new e(Dr(32))}static fromString(t,n=`hex`){return new e(super.fromString(t,n).toArray())}static fromHex(t){return new e(super.fromHex(t,`big`))}static fromWif(t,n=1){let r=vn(t,void 0,n);if(r.data.length!==33)throw Error(`Invalid WIF length`);if(r.data[32]!==1)throw Error(`Invalid WIF padding`);return new e(r.data.slice(0,32))}constructor(e=0,t=10,n=`be`,r=`apply`){if(e instanceof h?(super(),e.copy(this)):super(e,t,n),r!==`nocheck`){let e=this.checkInField();if(!e.inField){if(r===`error`)throw Error(`Input is out of field`);h.move(this,e.modN)}}}checkInField(){let e=new kn,t=this.mod(e.n);return{inField:this.cmp(t)===0,modN:t}}isValid(){return this.checkInField().inField}sign(e,t,n=!0,r){return Cr(new h(Ze(e,t),16),this,n,r)}verify(e,t,n){return wr(new h(Ze(e,n),16),t,this.toPublicKey())}toPublicKey(){let e=new kn().g.mulCT(this);return new dr(e.x,e.y)}toWif(e=[128]){if(!this.isValid())throw Error(`Value is out of field`);return _n([...this.toArray(`be`,32),1],e)}toAddress(e=[0]){return this.toPublicKey().toAddress(e)}toHex(){return super.toHex(32)}toString(e=`hex`,t=64){return super.toString(e,t)}deriveSharedSecret(e){if(!e.validate())throw Error(`Public key not valid for ECDH secret derivation`);return e.mulCT(this)}deriveChild(t,n,r,i){let a;if(typeof i==`function`){let e=i(this,t);e===void 0?(a=this.deriveSharedSecret(t),typeof r==`function`&&r(this,t,a)):a=e}else a=this.deriveSharedSecret(t);let o=nn(n,`utf8`),s=et(a.encode(!0),o),c=new kn;return new e(this.add(new h(s)).mod(c.n).toArray())}toKeyShares(e,t){if(typeof e!=`number`||typeof t!=`number`)throw TypeError(`threshold and totalShares must be numbers`);if(e<2)throw Error(`threshold must be at least 2`);if(t<2)throw Error(`totalShares must be at least 2`);if(e>t)throw Error(`threshold should be less than or equal to totalShares`);let n=kr.fromPrivateKey(this,e),r=[],i=new Set,a=new kn,o=Dr(64);for(let e=0;e<t;e++){let t,s=0;do if(t=new h(tt(o,[e,s,...Dr(32)])).umod(a.p),s++,s>5)throw Error(`Failed to generate unique x coordinate after 5 attempts`);while(t.isZero()||i.has(t.toString()));i.add(t.toString());let c=n.valueAt(t);r.push(new Or(t,c))}return new Ar(r,e,this.toPublicKey().toHash(`hex`).slice(0,8))}toBackupShares(e,t){return this.toKeyShares(e,t).toBackupFormat()}static fromBackupShares(t){return e.fromKeyShares(Ar.fromBackupFormat(t))}static fromKeyShares(t){let{points:n,threshold:r,integrity:i}=t;if(r<2)throw Error(`threshold must be at least 2`);if(n.length<r)throw Error(`At least ${r} shares are required to reconstruct the private key`);for(let e=0;e<r;e++)for(let t=e+1;t<r;t++)if(n[e].x.eq(n[t].x))throw Error(`Duplicate share detected, each must be unique.`);let a=new kr(n,r),o=new e(a.valueAt(new h(0)).toArray());if(o.toPublicKey().toHash(`hex`).slice(0,8)!==i)throw Error(`Integrity hash mismatch`);return o}},Mr={OP_0:0,OP_FALSE:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_1:81,OP_TRUE:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP2:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP3:178,OP_SUBSTR:179,OP_NOP4:179,OP_LEFT:180,OP_NOP5:180,OP_RIGHT:181,OP_NOP6:181,OP_LSHIFTNUM:182,OP_NOP7:182,OP_RSHIFTNUM:183,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_NOP11:186,OP_NOP12:187,OP_NOP13:188,OP_NOP14:189,OP_NOP15:190,OP_NOP16:191,OP_NOP17:192,OP_NOP18:193,OP_NOP19:194,OP_NOP20:195,OP_NOP21:196,OP_NOP22:197,OP_NOP23:198,OP_NOP24:199,OP_NOP25:200,OP_NOP26:201,OP_NOP27:202,OP_NOP28:203,OP_NOP29:204,OP_NOP30:205,OP_NOP31:206,OP_NOP32:207,OP_NOP33:208,OP_NOP34:209,OP_NOP35:210,OP_NOP36:211,OP_NOP37:212,OP_NOP38:213,OP_NOP39:214,OP_NOP40:215,OP_NOP41:216,OP_NOP42:217,OP_NOP43:218,OP_NOP44:219,OP_NOP45:220,OP_NOP46:221,OP_NOP47:222,OP_NOP48:223,OP_NOP49:224,OP_NOP50:225,OP_NOP51:226,OP_NOP52:227,OP_NOP53:228,OP_NOP54:229,OP_NOP55:230,OP_NOP56:231,OP_NOP57:232,OP_NOP58:233,OP_NOP59:234,OP_NOP60:235,OP_NOP61:236,OP_NOP62:237,OP_NOP63:238,OP_NOP64:239,OP_NOP65:240,OP_NOP66:241,OP_NOP67:242,OP_NOP68:243,OP_NOP69:244,OP_NOP70:245,OP_NOP71:246,OP_NOP72:247,OP_NOP73:248,OP_NOP77:252,OP_SMALLDATA:249,OP_SMALLINTEGER:250,OP_PUBKEYS:251,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},k=Mr;for(let e of Object.keys(Mr)){let t=Mr[e];k[t]??=e}var Nr=typeof globalThis>`u`?void 0:globalThis.Buffer;function Pr(e){let t=e.data?.length??0;if(t===0||e.op===k.OP_RETURN||e.op<k.OP_PUSHDATA1)return[e.op];if(e.op===k.OP_PUSHDATA1)return[e.op,t&255];if(e.op===k.OP_PUSHDATA2)return[e.op,t&255,t>>8&255];if(e.op===k.OP_PUSHDATA4){let n=t>>>0;return[e.op,n&255,n>>8&255,n>>16&255,n>>24&255]}}function Fr(e,t){let n=Pr(e),r=e.data??[];if(n==null||t.length!==n.length+r.length)return!1;for(let e=0;e<n.length;e++)if(t[e]!==n[e])return!1;for(let e=0;e<r.length;e++)if(t[n.length+e]!==r[e])return!1;return!0}var Ir=class e{_chunks;parsed;rawBytesCache;hexCache;static fromASM(t){let n=[],r=t.split(` `),i=0;for(;i<r.length;){let{chunk:t,advance:a}=e.parseASMToken(r,i);n.push(t),i+=a}return new e(n)}static pushdataOpCodeNum(e){return e>=0&&e<k.OP_PUSHDATA1?e:e<256?k.OP_PUSHDATA1:e<2**16?k.OP_PUSHDATA2:k.OP_PUSHDATA4}static parseASMToken(t,n){let r=t[n];if(r===`0`)return{chunk:{op:0},advance:1};if(r===`-1`)return{chunk:{op:k.OP_1NEGATE},advance:1};let i=r.startsWith(`OP_`)&&k[r]!==void 0,a=i?k[r]:0;if(a===k.OP_PUSHDATA1||a===k.OP_PUSHDATA2||a===k.OP_PUSHDATA4)return{chunk:{data:nn(t[n+2],`hex`),op:a},advance:3};if(!i){let t=r;t.length%2!=0&&(t=`0`+t);let n=nn(t,`hex`);if(fn(n,`hex`)!==t)throw Error(`invalid hex string in script`);return{chunk:{data:n,op:e.pushdataOpCodeNum(n.length)},advance:1}}return{chunk:{op:a},advance:1}}static fromHex(t){if(t.length===0)return e.fromBinary([]);if(t.length%2!=0)throw Error(`There is an uneven number of characters in the string which suggests it is not hex encoded.`);if(!/^[0-9a-fA-F]+$/.test(t))throw Error(`Some elements in this string are not hex encoded.`);let n=on(t);return new e([],n,t.toLowerCase(),!1)}static fromBinary(t){let n=Uint8Array.from(t);return new e([],n,void 0,!1)}static fromBinaryView(t){return new e([],t,void 0,!1)}constructor(e=[],t,n,r=!0){this._chunks=e,this.parsed=r,this.rawBytesCache=t,this.hexCache=n}get chunks(){return this.ensureParsed(),this._chunks}set chunks(e){this._chunks=e,this.parsed=!0,this.invalidateSerializationCaches()}ensureParsed(){this.parsed||=(this._chunks=this.rawBytesCache==null?[]:e.parseChunks(this.rawBytesCache),!0)}toASM(){let e=``;for(let t of this.chunks)e+=this._chunkToString(t);return e.slice(1)}toHex(){if(this.hexCache!=null)return this.hexCache;this.rawBytesCache??=this.serializeChunksToBytes();let e=Nr==null?fn(Array.from(this.rawBytesCache),`hex`):Nr.from(this.rawBytesCache).toString(`hex`);return this.hexCache=e,e}toBinary(){return Array.from(this.toUint8Array())}toUint8Array(){return this.rawBytesCache??=this.serializeChunksToBytes(),this.rawBytesCache}writeScript(e){return this.invalidateSerializationCaches(),this.chunks=this.chunks.concat(e.chunks),this}writeOpCode(e){return this.invalidateSerializationCaches(),this.chunks.push({op:e}),this}setChunkOpCode(e,t){return this.invalidateSerializationCaches(),this.chunks[e]={op:t},this}writeBn(e){if(this.invalidateSerializationCaches(),e.cmpn(0)===k.OP_0)this.chunks.push({op:k.OP_0});else if(e.cmpn(-1)===0)this.chunks.push({op:k.OP_1NEGATE});else if(e.cmpn(1)>=0&&e.cmpn(16)<=0)this.chunks.push({op:e.toNumber()+k.OP_1-1});else{let t=e.toSm(`little`);this.writeBin(t)}return this}writeBin(e){this.invalidateSerializationCaches();let t,n=e.length>0?e:void 0;if(e.length>0&&e.length<k.OP_PUSHDATA1)t=e.length;else if(e.length===0)t=k.OP_0;else if(e.length<256)t=k.OP_PUSHDATA1;else if(e.length<2**16)t=k.OP_PUSHDATA2;else if(e.length<2**32)t=k.OP_PUSHDATA4;else throw Error(`You can't push that much data`);return this.chunks.push({data:n,op:t}),this}writeNumber(e){return this.invalidateSerializationCaches(),this.writeBn(new h(e)),this}removeCodeseparators(){let t=this.toUint8Array();return this.rawBytesCache=Uint8Array.from(e.removeOpcodeBytes(t,k.OP_CODESEPARATOR)),this.hexCache=void 0,this._chunks=[],this.parsed=!1,this}findAndDelete(e){this.invalidateSerializationCaches();let t=e.toUint8Array();if(t.length===0)return this;for(let e=0;e<this.chunks.length;)Fr(this.chunks[e],t)?this.chunks.splice(e,1):e++;return this}isPushOnly(){for(let e of this.chunks)if(e.op>k.OP_16)return!1;return!0}isLockingScript(){throw Error(`Not implemented`)}isUnlockingScript(){throw Error(`Not implemented`)}static computeSerializedLength(e){let t=0;for(let n of e){if(t+=1,n.data==null)continue;let e=n.data.length;if(n.op===k.OP_RETURN){t+=e;break}n.op<k.OP_PUSHDATA1?t+=e:n.op===k.OP_PUSHDATA1?t+=1+e:n.op===k.OP_PUSHDATA2?t+=2+e:n.op===k.OP_PUSHDATA4&&(t+=4+e)}return t}serializeChunksToBytes(){let t=this.chunks,n=e.computeSerializedLength(t),r=new Uint8Array(n),i=0;for(let n of t)if(r[i++]=n.op,n.data!=null){if(n.op===k.OP_RETURN){r.set(n.data,i);break}i=e.writeChunkData(r,i,n.op,n.data)}return r}invalidateSerializationCaches(){this.rawBytesCache=void 0,this.hexCache=void 0}static writeChunkData(e,t,n,r){let i=r.length;if(n<k.OP_PUSHDATA1)return e.set(r,t),t+i;if(n===k.OP_PUSHDATA1)return e[t++]=i&255,e.set(r,t),t+i;if(n===k.OP_PUSHDATA2)return e[t++]=i&255,e[t++]=i>>8&255,e.set(r,t),t+i;if(n===k.OP_PUSHDATA4){let n=i>>>0;return e[t++]=n&255,e[t++]=n>>8&255,e[t++]=n>>16&255,e[t++]=n>>24&255,e.set(r,t),t+i}return t}static readPushdataLength(e,t,n,r){if(e>0&&e<k.OP_PUSHDATA1)return{len:e,newPos:n,hasLength:!0};if(e===k.OP_PUSHDATA1){let e=n<r;return{len:e?t[n++]??0:0,newPos:n,hasLength:e}}if(e===k.OP_PUSHDATA2){let e=n+1<r;return{len:(t[n]??0)|(t[n+1]??0)<<8,newPos:Math.min(n+2,r),hasLength:e}}let i=n+3<r;return{len:((t[n]??0)|(t[n+1]??0)<<8|(t[n+2]??0)<<16|(t[n+3]??0)<<24)>>>0,newPos:Math.min(n+4,r),hasLength:i}}static parseChunks(t){let n=[],r=t.length,i=0,a=0;for(;i<r;){let o=t[i++]??0;if(o===k.OP_RETURN&&a===0){n.push({op:o,data:e.copyRange(t,i,r)});break}if(o===k.OP_IF||o===k.OP_NOTIF||o===k.OP_VERIF||o===k.OP_VERNOTIF?a++:o===k.OP_ENDIF&&a--,o>0&&o<=k.OP_PUSHDATA4){let{len:a,newPos:s,hasLength:c}=e.readPushdataLength(o,t,i,r);i=s;let l=Math.min(i+a,r),u=!c||l-i!==a;n.push({data:e.copyRange(t,i,l),op:o,invalidLength:u}),i=l}else n.push({op:o})}return n}static removeOpcodeBytes(t,n){let r=[],i=t.length,a=0;for(;a<i;){let o=a,s=t[a++]??0;if(s>0&&s<=k.OP_PUSHDATA4){let{len:c,newPos:l}=e.readPushdataLength(s,t,a,i);a=l;let u=Math.min(a+c,i);if(s!==n)for(let e=o;e<u;e++)r.push(t[e]??0);a=u}else s!==n&&r.push(s)}return r}static copyRange(e,t,n){let r=Math.max(n-t,0),i=Array.from({length:r},()=>0);for(let n=0;n<r;n++)i[n]=e[t+n]??0;return i}_chunkToString(e){let t=e.op,n=``;if(e.data===void 0){let e=k[t];n=`${n} ${e}`}else n=`${n} ${en(e.data)}`;return n}},Lr=new Uint8Array,Rr=Object.freeze(Array.from({length:32},()=>0));function zr(e,t){if(e.allInputs!=null)return e.allInputs;let n=[...e.otherInputs];return n.splice(e.inputIndex,0,t),n}function Br(e,t,n,r){return r===t?n:e[r]}function Vr(e,t,n){let r=new yn;for(let i=0;i<e.length;i++){let a=Br(e,t,n,i);if(a.sourceTXID==null){if(a.sourceTransaction==null)throw Error(`Missing sourceTransaction for input`);r.write(a.sourceTransaction.hash())}else r.writeReverse(nn(a.sourceTXID,`hex`));r.writeUInt32LE(a.sourceOutputIndex)}return Qe(r.toUint8Array())}function Hr(e,t,n){let r=new yn;for(let i=0;i<e.length;i++){let a=Br(e,t,n,i);r.writeUInt32LE(a.sequence??4294967295)}return Qe(r.toUint8Array())}function Ur(e,t){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript?.toUint8Array()??Lr;e.writeVarIntNum(n.length),e.write(n)}function Wr(e,t){let n=new yn;if(t==null)for(let t of e)Ur(n,t);else{let r=e[t];if(r==null)throw Error(`Output at index ${t} does not exist`);Ur(n,r)}return Qe(n.toUint8Array())}function Gr(e,t,n){if((e.scope&Jr.SIGHASH_ANYONECANPAY)!==0)return[...Rr];if(e.cache?.hashPrevouts!=null)return e.cache.hashPrevouts;let r=Vr(t,e.inputIndex,n);return e.cache!=null&&(e.cache.hashPrevouts=r),r}function Kr(e,t,n){let r=e.scope&31;if((e.scope&Jr.SIGHASH_ANYONECANPAY)!==0||r===Jr.SIGHASH_SINGLE||r===Jr.SIGHASH_NONE)return[...Rr];if(e.cache?.hashSequence!=null)return e.cache.hashSequence;let i=Hr(t,e.inputIndex,n);return e.cache!=null&&(e.cache.hashSequence=i),i}function qr(e){let t=e.scope&31;if(t!==Jr.SIGHASH_SINGLE&&t!==Jr.SIGHASH_NONE){if(e.cache?.hashOutputsAll!=null)return e.cache.hashOutputsAll;let t=Wr(e.outputs);return e.cache!=null&&(e.cache.hashOutputsAll=t),t}if(t!==Jr.SIGHASH_SINGLE||e.inputIndex>=e.outputs.length)return[...Rr];let n=e.cache?.hashOutputsSingle?.get(e.inputIndex);if(n!=null)return n;let r=Wr(e.outputs,e.inputIndex);return e.cache!=null&&(e.cache.hashOutputsSingle??=new Map,e.cache.hashOutputsSingle.set(e.inputIndex,r)),r}var Jr=class e extends fr{static SIGHASH_ALL=1;static SIGHASH_NONE=2;static SIGHASH_SINGLE=3;static SIGHASH_CHRONICLE=32;static SIGHASH_FORKID=64;static SIGHASH_ANYONECANPAY=128;scope;static formatOTDA(t){let n=(t.scope&e.SIGHASH_ANYONECANPAY)===e.SIGHASH_ANYONECANPAY,r=(t.scope&31)===e.SIGHASH_SINGLE,i=(t.scope&31)===e.SIGHASH_NONE,a=(t.scope&31)===e.SIGHASH_ALL||!r&&!i,o=Ir.fromBinary(t.subscript.toBinary());o.removeCodeseparators();let s={sourceTXID:t.sourceTXID,sourceOutputIndex:t.sourceOutputIndex,sequence:t.inputSequence,script:o.toBinary()},c=new yn;function l(e){c.writeVarIntNum(e.length);for(let t of e)c.writeReverse(nn(t.sourceTXID,`hex`)),c.writeUInt32LE(t.sourceOutputIndex),c.writeVarIntNum(t.script.length),c.write(t.script),c.writeUInt32LE(t.sequence)}function u(e){c.writeVarIntNum(e.length);for(let t of e)c.writeUInt64LE(t.satoshis),c.writeVarIntNum(t.script.length),c.write(t.script)}c.writeInt32LE(t.transactionVersion);let d=new Ir().toBinary();if(n)n&&l([s]);else{let e=t.allInputs==null?t.otherInputs.map(e=>({sourceTXID:e.sourceTXID??e.sourceTransaction?.id(`hex`)??``,sourceOutputIndex:e.sourceOutputIndex,sequence:r||i?0:e.sequence??4294967295,script:d})):t.allInputs.map((e,n)=>n===t.inputIndex?s:{sourceTXID:e.sourceTXID??e.sourceTransaction?.id(`hex`)??``,sourceOutputIndex:e.sourceOutputIndex,sequence:r||i?0:e.sequence??4294967295,script:d});t.allInputs??e.splice(t.inputIndex,0,s),l(e)}if(a)u(t.outputs.map(e=>({satoshis:e.satoshis??0,script:e.lockingScript.toBinary()})));else if(r){let e=[];for(let n=0;n<t.inputIndex;n++)e.push({satoshis:-1,script:d});let n=t.outputs[t.inputIndex];n!==void 0&&e.push({satoshis:n.satoshis??0,script:n.lockingScript.toBinary()}),u(e)}else i&&u([]);return c.writeUInt32LE(t.lockTime),c.writeUInt32LE(t.scope>>>0),c.toUint8Array()}static formatBip143(e){let t={sourceTXID:e.sourceTXID,sourceOutputIndex:e.sourceOutputIndex,sequence:e.inputSequence},n=zr(e,t),r=Gr(e,n,t),i=Kr(e,n,t),a=qr(e),o=new yn;o.writeInt32LE(e.transactionVersion),o.write(r),o.write(i),o.writeReverse(nn(e.sourceTXID,`hex`)),o.writeUInt32LE(e.sourceOutputIndex);let s=e.subscript.toUint8Array();o.writeVarIntNum(s.length),o.write(s),o.writeUInt64LE(e.sourceSatoshis);let c=t.sequence??4294967295;return o.writeUInt32LE(c),o.write(a),o.writeUInt32LE(e.lockTime),o.writeUInt32LE(e.scope>>>0),o.toUint8Array()}static format(e){return Array.from(this.formatBytes(e))}static formatBytes(t){let n=(t.scope&e.SIGHASH_FORKID)!==0,r=t.ignoreChronicle!==!0&&(t.scope&e.SIGHASH_CHRONICLE)!==0;return n&&!r?e.formatBip143(t):!n||n&&r?e.formatOTDA(t):new Uint8Array}static usesOtdaSingleBug(t){let n=(t.scope&e.SIGHASH_FORKID)!==0,r=t.ignoreChronicle!==!0&&(t.scope&e.SIGHASH_CHRONICLE)!==0;return(!n||n&&r)&&(t.scope&31)===e.SIGHASH_SINGLE&&t.inputIndex>=t.outputs.length}static fromChecksigFormat(t){if(t.length===0){let t=new h(1),n=new h(1);return new e(t,n,1)}let n=t.at(-1),r=t.slice(0,-1),i=fr.fromDER(r);return new e(i.r,i.s,n)}constructor(e,t,n){super(e,t),this.scope=n}hasLowS(){return!(this.s.ltn(1)||this.s.gt(new h(`7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0`,`hex`)))}toChecksigFormat(){return[...this.toDER(),this.scope]}};function Yr(e,t,n){if(!(t instanceof Uint8Array))throw TypeError(`${e} returned a non-byte result`);if(n!==void 0&&t.length!==n)throw Error(`${e} returned ${t.length} bytes; expected ${n}`);return t}function Xr(){return globalThis}function Zr(e){let t=Xr().__bsvSdkAsyncCryptoBackendV1;if(t!==void 0){if(!t.isReady()){t.preload().catch(()=>{});return}return t.supportsCrypto(e)?t:void 0}}var Qr=class extends Ir{isLockingScript(){return!0}isUnlockingScript(){return!1}},$r=class extends Ir{isLockingScript(){return!1}isUnlockingScript(){return!0}};function ei(e){return e==null?`null/undef`:e.length===void 0?`INVALID_STACK_ITEM`:en(e)}var ti=class extends Error{txid;outputIndex;context;programCounter;stackState;altStackState;ifStackState;stackMem;altStackMem;constructor(e){let t=e.stackState.map(ei).join(`, `),n=e.altStackState.map(ei).join(`, `),r=`Context: ${e.context}, PC: ${e.programCounter}`,i=`Stack: [${t}] (len: ${e.stackState.length}, mem: ${e.stackMem})`,a=`AltStack: [${n}] (len: ${e.altStackState.length}, mem: ${e.altStackMem})`,o=`IfStack: [${e.ifStackState.join(`, `)}]`,s=`Script evaluation error: ${e.message}\nTXID: ${e.txid}, OutputIdx: ${e.outputIndex}\n${r}\n${i}\n${a}\n${o}`;super(s),this.name=this.constructor.name,this.txid=e.txid,this.outputIndex=e.outputIndex,this.context=e.context,this.programCounter=e.programCounter,this.stackState=e.stackState.map(e=>e.slice()),this.altStackState=e.altStackState.map(e=>e.slice()),this.ifStackState=e.ifStackState.slice(),this.stackMem=e.stackMem,this.altStackMem=e.altStackMem}},ni=class extends Error{resource;limit;attempted;constructor(e,t,n){let r={stack:`Stack memory usage`,"alt-stack":`Alt stack memory usage`,"element-size":`Script element allocation`}[e];super(`${r} has exceeded ${t} bytes`),this.resource=e,this.limit=t,this.attempted=n,this.name=`ScriptResourceLimitError`}};function ri(){return globalThis}function ii(){return ri().__bsvSdkScriptVerificationBackendV1}var ai=520,oi=1e4,si=500,ci=4294967295n,li=1e3,ui=BigInt(2**31-1),di=20,fi=2147483648,pi=Object.freeze(new h(-1).toScriptNum()),mi=Object.freeze(Array.from({length:17},(e,t)=>Object.freeze(new h(t).toScriptNum())));function hi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function gi(e){return new h(+!!e)}function _i(e,t){return gi(e&&t)}function vi(e,t){return gi(e||t)}function yi(e,t){return e.cmp(t)<0?e:t}function bi(e,t){return e.cmp(t)>0?e:t}function xi(e,t=2**53-1){return!(e.length>t||e.length>0&&!(e.at(-1)&127)&&(e.length<=1||!(e.at(-2)&128)))}function Si(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;let t=e[2],n=e[3];if(t!==2||n===0||5+n>=e.length)return!1;let r=4+n,i=e[r],a=e[r+1];if(i!==2||a===0||e[4]&128||n>1&&e[4]===0&&!(e[5]&128))return!1;let o=r+2;return!(e[o]&128||a>1&&e[o]===0&&!(e[o+1]&128)||n+a+7!==e.length)}function Ci(e){let t=e.data,n=e.op;return Array.isArray(t)?t.length===0?n===k.OP_0:t.length===1&&t[0]>=1&&t[0]<=16?n===k.OP_1+(t[0]-1):t.length===1&&t[0]===129?n===k.OP_1NEGATE:t.length<=75?n===t.length:t.length<=255?n===k.OP_PUSHDATA1:t.length<=65535?n===k.OP_PUSHDATA2:!0:!0}var wi=class{sourceTXID;sourceOutputIndex;sourceSatoshis;lockingScript;transactionVersion;otherInputs;allInputs;outputs;inputIndex;unlockingScript;inputSequence;lockTime;context;programCounter;lastCodeSeparator;stack;altStack;ifStack;elseStack;memoryLimit;hasExplicitMemoryLimit;stackMem;altStackMem;isRelaxedOverride;verifyFlags;executedOpCount;returningFromConditional;sigHashCache;ownsSigHashCache;constructor(e){if(this.sourceTXID=e.sourceTXID,this.sourceOutputIndex=e.sourceOutputIndex,this.sourceSatoshis=e.sourceSatoshis,this.lockingScript=e.lockingScript,this.transactionVersion=e.transactionVersion,this.otherInputs=e.otherInputs,this.allInputs=e.allInputs,this.outputs=e.outputs,this.inputIndex=e.inputIndex,this.unlockingScript=e.unlockingScript,this.inputSequence=e.inputSequence,this.lockTime=e.lockTime,this.hasExplicitMemoryLimit=e.memoryLimit!==void 0,this.memoryLimit=e.memoryLimit??1/0,this.isRelaxedOverride=e.isRelaxed===!0,e.verifyFlags===void 0)this.verifyFlags=void 0;else{let t=Array.isArray(e.verifyFlags)?e.verifyFlags:e.verifyFlags.split(`,`);this.verifyFlags=new Set(t.map(e=>e.trim()).filter(e=>e.length>0))}this.stack=[],this.altStack=[],this.ifStack=[],this.elseStack=[],this.stackMem=0,this.altStackMem=0,this.executedOpCount=0,this.returningFromConditional=!1,this.ownsSigHashCache=e.sigHashCache==null,this.sigHashCache=e.sigHashCache??{hashOutputsSingle:new Map},this.reset()}isRelaxed(){return this.isRelaxedOverride||this.transactionVersion>1}hasExplicitFlags(){return this.verifyFlags!==void 0}hasFlag(e){return this.verifyFlags?.has(e)===!0}isAfterGenesis(){return this.hasExplicitFlags()?this.hasFlag(`GENESIS`)||this.hasFlag(`UTXO_AFTER_GENESIS`)||this.hasFlag(`UTXO_AFTER_CHRONICLE`):this.isRelaxed()}isAfterChronicle(){return this.hasExplicitFlags()?this.hasFlag(`UTXO_AFTER_CHRONICLE`):this.isRelaxed()}shouldEnforceMinimalData(){return this.hasExplicitFlags()?this.hasFlag(`MINIMALDATA`):!this.isRelaxed()}shouldEnforceLowS(){return this.hasExplicitFlags()?this.hasFlag(`LOW_S`):!this.isRelaxed()}shouldEnforceNullDummy(){return this.hasExplicitFlags()?this.hasFlag(`NULLDUMMY`):!this.isRelaxed()}shouldEnforceSigPushOnly(){return this.hasExplicitFlags()?this.hasFlag(`SIGPUSHONLY`):!this.isRelaxed()}shouldEnforceCleanStack(){return this.hasExplicitFlags()?this.hasFlag(`CLEANSTACK`):!this.isRelaxed()}shouldEnforceDerSignatures(){return!this.hasExplicitFlags()||this.hasFlag(`DERSIG`)||this.hasFlag(`STRICTENC`)||this.hasFlag(`LOW_S`)||this.hasFlag(`SIGHASH_FORKID`)}shouldEnforceStrictEncoding(){return!this.hasExplicitFlags()||this.hasFlag(`STRICTENC`)||this.hasFlag(`SIGHASH_FORKID`)}scriptNumMaxSize(){if(this.hasExplicitFlags()&&!this.isAfterGenesis())return 4}maxPushSize(){return this.hasExplicitFlags()&&!this.isAfterGenesis()?ai:1/0}reset(){this.ownsSigHashCache&&(delete this.sigHashCache.hashPrevouts,delete this.sigHashCache.hashSequence,delete this.sigHashCache.hashOutputsAll,this.sigHashCache.hashOutputsSingle?.clear()),this.context=`UnlockingScript`,this.programCounter=0,this.lastCodeSeparator=null,this.stack=[],this.altStack=[],this.ifStack=[],this.elseStack=[],this.stackMem=0,this.altStackMem=0,this.executedOpCount=0,this.returningFromConditional=!1}ensureStackMem(e){if(this.stackMem+e>this.memoryLimit)throw new ni(`stack`,this.memoryLimit,this.stackMem+e)}ensureAltStackMem(e){if(this.altStackMem+e>this.memoryLimit)throw new ni(`alt-stack`,this.memoryLimit,this.altStackMem+e)}pushStack(e){this.ensureStackMem(e.length),this.stack.push(e),this.stackMem+=e.length}pushStackCopy(e){this.ensureStackMem(e.length);let t=e.slice();this.stack.push(t),this.stackMem+=t.length}popStack(){this.stack.length===0&&this.scriptEvaluationError(`Attempted to pop from an empty stack.`);let e=this.stack.pop();return e===void 0?(this.scriptEvaluationError(`Attempted to pop from an empty stack.`),[]):(this.stackMem-=e.length,e)}stackTop(e=-1){return(this.stack.length===0||this.stack.length<Math.abs(e)||e>=0&&e>=this.stack.length)&&this.scriptEvaluationError(`Stack underflow accessing element at index ${e}. Stack length is ${this.stack.length}.`),this.stack[this.stack.length+e]}requireStackItems(e,t){this.stack.length<e&&this.scriptEvaluationError(t)}requireAltStackItems(e,t){this.altStack.length<e&&this.scriptEvaluationError(t)}setStack(e){this.stack=e.map(e=>e.slice()),this.stackMem=this.stack.reduce((e,t)=>e+t.length,0)}clearAltStack(){this.altStack=[],this.altStackMem=0}pushAltStack(e){this.ensureAltStackMem(e.length),this.altStack.push(e),this.altStackMem+=e.length}popAltStack(){this.altStack.length===0&&this.scriptEvaluationError(`Attempted to pop from an empty alt stack.`);let e=this.altStack.pop();return e===void 0?(this.scriptEvaluationError(`Attempted to pop from an empty alt stack.`),[]):(this.altStackMem-=e.length,e)}readScriptNumber(e){try{return h.fromScriptNum(e,this.shouldEnforceMinimalData(),this.scriptNumMaxSize())}catch(e){let t=e instanceof Error?e.message:String(e);this.scriptEvaluationError(t)}return new h(0)}isDefinedHashType(e){let t=e&31;return t>=Jr.SIGHASH_ALL&&t<=Jr.SIGHASH_SINGLE}enforceSignatureHashType(e){this.shouldEnforceStrictEncoding()&&(this.isDefinedHashType(e.scope)||this.scriptEvaluationError(`The signature hash type is invalid.`),(e.scope&Jr.SIGHASH_CHRONICLE)!==0&&!this.isAfterChronicle()&&this.scriptEvaluationError(`The signature hash type is invalid before Chronicle.`))}enforceSignatureForkId(e){if(!this.hasExplicitFlags())return;let t=(e.scope&Jr.SIGHASH_FORKID)!==0;this.hasFlag(`SIGHASH_FORKID`)&&!t&&this.scriptEvaluationError(`The signature must use SIGHASH_FORKID.`),!this.hasFlag(`SIGHASH_FORKID`)&&!this.isAfterGenesis()&&t&&this.scriptEvaluationError(`The signature must not use SIGHASH_FORKID.`)}checkSignatureEncoding(e){if(e.length===0)return!0;let t=this.shouldEnforceDerSignatures();if(t&&!Si(e))return this.scriptEvaluationError(`The signature format is invalid.`),!1;try{let t=Jr.fromChecksigFormat(e);if(this.enforceSignatureHashType(t),this.enforceSignatureForkId(t),this.shouldEnforceLowS()&&!t.hasLowS())return this.scriptEvaluationError(`The signature must have a low S value.`),!1}catch{if(t)return this.scriptEvaluationError(`The signature format is invalid.`),!1}return!0}parseChecksigSignature(e){try{return Jr.fromChecksigFormat(e)}catch(t){if(this.shouldEnforceDerSignatures())throw t;return this.parseLaxChecksigSignature(e)}}readLaxDERLength(e,t){let n=e[t.value++];if(n===void 0)throw Error(`Invalid DER length`);if(!(n&128))return n;let r=n&127;if(r===0||t.value+r>e.length)throw Error(`Invalid DER length`);let i=0;for(let n=0;n<r;n++)i=i<<8|(e[t.value++]??0);return i}parseLaxDERInteger(e,t,n){if(t.value>=n||e[t.value++]!==2)throw Error(`Invalid DER integer`);let r=this.readLaxDERLength(e,t);if(t.value+r>n)throw Error(`Invalid DER integer length`);let i=e.slice(t.value,t.value+r);for(t.value+=r;i.length>1&&i[0]===0;)i=i.slice(1);return i.length===0&&(i=[0]),new h(i)}parseLaxChecksigSignature(e){if(e.length===0)return Jr.fromChecksigFormat(e);let t=e.at(-1),n=e.slice(0,-1),r={value:0};if(n[r.value++]!==48)throw Error(`Signature DER must start with 0x30`);let i=this.readLaxDERLength(n,r),a=Math.min(r.value+i,n.length);return new Jr(this.parseLaxDERInteger(n,r,a),this.parseLaxDERInteger(n,r,a),t)}checkPublicKeyEncoding(e){if(!this.shouldEnforceStrictEncoding())return!0;if(e.length===0)return this.scriptEvaluationError(`Public key is empty.`),!1;if(e.length<33)return this.scriptEvaluationError(`The public key is too short, it must be at least 33 bytes.`),!1;if(e[0]===4){if(e.length!==65)return this.scriptEvaluationError(`The non-compressed public key must be 65 bytes.`),!1}else if(e[0]===2||e[0]===3){if(e.length!==33)return this.scriptEvaluationError(`The compressed public key must be 33 bytes.`),!1}else return this.scriptEvaluationError(`The public key is in an unknown format.`),!1;try{dr.fromDER(e)}catch{return this.scriptEvaluationError(`The public key is in an unknown format.`),!1}return!0}verifySignature(e,t,n){let r={sourceTXID:this.sourceTXID,sourceOutputIndex:this.sourceOutputIndex,sourceSatoshis:this.sourceSatoshis,transactionVersion:this.transactionVersion,otherInputs:this.otherInputs,allInputs:this.allInputs,outputs:this.outputs,inputIndex:this.inputIndex,subscript:n,inputSequence:this.inputSequence,lockTime:this.lockTime,scope:e.scope,cache:this.sigHashCache};return wr(Jr.usesOtdaSingleBug(r)?new h([1,...Array.from({length:31},()=>0)]):new h(Qe(Jr.formatBytes(r))),e,t)}enforceStepResourceLimits(){if(this.stackMem>this.memoryLimit)throw new ni(`stack`,this.memoryLimit,this.stackMem);if(this.altStackMem>this.memoryLimit)throw new ni(`alt-stack`,this.memoryLimit,this.altStackMem)}currentScriptForStep(){return this.context===`UnlockingScript`&&this.programCounter>=this.unlockingScript.chunks.length&&(this.ifStack.length>0&&this.scriptEvaluationError(`Every OP_IF, OP_NOTIF, or OP_ELSE must be terminated with OP_ENDIF prior to the end of the unlocking script.`),this.clearAltStack(),this.ifStack=[],this.elseStack=[],this.returningFromConditional=!1,this.lastCodeSeparator=null,this.context=`LockingScript`,this.programCounter=0),this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript}opcodeForOperation(e){let t=e.op;return t===void 0?(this.scriptEvaluationError(`Missing opcode in ${this.context} at pc=${this.programCounter}.`),0):(e.invalidLength===!0&&this.scriptEvaluationError(`Malformed push data in ${this.context} at pc=${this.programCounter}.`),Array.isArray(e.data)&&e.data.length>this.maxPushSize()&&this.scriptEvaluationError(`Data push > ${this.maxPushSize()} bytes (pc=${this.programCounter}).`),t)}enforceChronicleOnlyOpcode(e){this.hasExplicitFlags()&&!this.isAfterGenesis()&&!this.isAfterChronicle()&&(e===k.OP_2MUL||e===k.OP_2DIV||e===k.OP_VERIF||e===k.OP_VERNOTIF)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`)}executeDataPush(e){this.shouldEnforceMinimalData()&&!Ci(e)&&this.scriptEvaluationError(`This data is not minimally-encoded. (PC: ${this.programCounter})`),this.pushStack(Array.isArray(e.data)?e.data:[])}countExecutedOpcode(e,t){!t||e<=k.OP_16||(this.executedOpCount++,this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.executedOpCount>si&&this.scriptEvaluationError(`Script executed more than ${si} opcodes.`))}skipUnavailablePreChronicleOpcode(e,t){return!this.hasExplicitFlags()||this.isAfterChronicle()?!1:t&&(e===k.OP_SUBSTR||e===k.OP_LEFT||e===k.OP_RIGHT||e===k.OP_LSHIFTNUM||e===k.OP_RSHIFTNUM)?(this.hasFlag(`DISCOURAGE_UPGRADABLE_NOPS`)&&this.scriptEvaluationError(`${k[e]} is discouraged by verification flags.`),this.programCounter++,!0):((t||!this.isAfterGenesis())&&(e===k.OP_2MUL||e===k.OP_2DIV)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`),(t||!this.isAfterGenesis())&&(e===k.OP_VER||e===k.OP_VERIF||e===k.OP_VERNOTIF)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`),!t&&this.isAfterGenesis()&&(e===k.OP_VERIF||e===k.OP_VERNOTIF)?(this.programCounter++,!0):!1)}enforceDiscouragedNop(e,t){t&&this.hasFlag(`DISCOURAGE_UPGRADABLE_NOPS`)&&(e===k.OP_NOP1||e===k.OP_CHECKLOCKTIMEVERIFY||e===k.OP_CHECKSEQUENCEVERIFY||e===k.OP_NOP9||e===k.OP_NOP10)&&this.scriptEvaluationError(`${k[e]} is discouraged by verification flags.`)}advanceAfterStep(e){this.returningFromConditional&&this.ifStack.length===0?this.programCounter=e.chunks.length:this.programCounter++,this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.stack.length+this.altStack.length>li&&this.scriptEvaluationError(`Stack item count has exceeded ${li}.`)}step(){this.enforceStepResourceLimits();let e=this.currentScriptForStep();if(this.programCounter>=e.chunks.length)return!1;let t=e.chunks[this.programCounter],n=this.opcodeForOperation(t),r=!this.returningFromConditional&&!this.ifStack.includes(!1);if(this.enforceChronicleOnlyOpcode(n),r&&n>=0&&n<=k.OP_PUSHDATA4)this.executeDataPush(t);else if(r||n>=k.OP_IF&&n<=k.OP_ENDIF){let e,t,i,a,o,s,c,l,u,d,f,p,m,g,_,v,y,b,x,S,C,w,ee,te,ne,T;if(this.countExecutedOpcode(n,r),this.skipUnavailablePreChronicleOpcode(n,r))return!0;switch(this.enforceDiscouragedNop(n,r),n){case k.OP_VER:{let e=this.transactionVersion;this.pushStack([e&255,e>>>8&255,e>>>16&255,e>>>24&255]);break}case k.OP_SUBSTR:(()=>{this.stack.length<3&&this.scriptEvaluationError(`OP_SUBSTR requires at least three items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber(),n=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let r=e.length;(n<0||n>=r||t<0||t>r-n)&&this.scriptEvaluationError(`OP_SUBSTR offset (${n}) must be in range [0, ${r}) and length (${t}) must be in range [0, ${r-n}]`),this.pushStack(e.slice(n,n+t))})();break;case k.OP_LEFT:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_LEFT requires at least two items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let n=e.length;(t<0||t>n)&&this.scriptEvaluationError(`OP_LEFT length (${t}) must be in range [0, ${n}]`),this.pushStack(e.slice(0,t))})();break;case k.OP_RIGHT:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_RIGHT requires at least two items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let n=e.length;(t<0||t>n)&&this.scriptEvaluationError(`OP_RIGHT length (${t}) must be in range [0, ${n}]`),this.pushStack(e.slice(n-t))})();break;case k.OP_LSHIFTNUM:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_LSHIFTNUM requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt();e<0&&this.scriptEvaluationError(`OP_LSHIFTNUM bits to shift must not be negative.`);let t=new h(this.readScriptNumber(this.popStack()).toBigInt()<<e);this.pushStack(t.toScriptNum())})();break;case k.OP_RSHIFTNUM:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_RSHIFTNUM requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt();e<0&&this.scriptEvaluationError(`OP_RSHIFTNUM bits to shift must not be negative.`);let t=this.readScriptNumber(this.popStack()).toBigInt(),n;n=t<0?new h(-(-t>>e)):new h(t>>e),this.pushStack(n.toScriptNum())})();break;case k.OP_1NEGATE:this.pushStackCopy(pi);break;case k.OP_0:this.pushStackCopy(mi[0]);break;case k.OP_1:case k.OP_2:case k.OP_3:case k.OP_4:case k.OP_5:case k.OP_6:case k.OP_7:case k.OP_8:case k.OP_9:case k.OP_10:case k.OP_11:case k.OP_12:case k.OP_13:case k.OP_14:case k.OP_15:case k.OP_16:p=n-(k.OP_1-1),this.pushStackCopy(mi[p]);break;case k.OP_NOP:case k.OP_NOP1:case k.OP_CHECKLOCKTIMEVERIFY:break;case k.OP_CHECKSEQUENCEVERIFY:(()=>{if(this.hasFlag(`CHECKSEQUENCEVERIFY`)){this.stack.length<1&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires at least one item to be on the stack.`);let e=0n;try{e=h.fromScriptNum(this.stackTop(),this.shouldEnforceMinimalData(),5).toBigInt()}catch{this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires a minimally-encoded numeric lock time.`)}e<0n&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires a non-negative lock time.`),Number(e&BigInt(fi))===0&&this.transactionVersion<2&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY lock time is unsatisfied.`)}})();break;case k.OP_NOP9:case k.OP_NOP10:break;case k.OP_VERIF:case k.OP_VERNOTIF:(()=>{if(g=!1,r){if(this.stack.length<1&&this.scriptEvaluationError(`OP_VERIF and OP_VERNOTIF require at least one item on the stack when they are used!`),t=this.popStack(),t.length===4){let e=this.transactionVersion;i=[e&255,e>>>8&255,e>>>16&255,e>>>24&255],g=hi(t,i)}n===k.OP_VERNOTIF&&(g=!g)}this.ifStack.push(g),this.elseStack.push(!1)})();break;case k.OP_IF:case k.OP_NOTIF:g=!1,r&&(this.stack.length<1&&this.scriptEvaluationError(`OP_IF and OP_NOTIF require at least one item on the stack when they are used!`),e=this.popStack(),this.hasFlag(`MINIMALIF`)&&e.length>0&&(e.length!==1||e[0]!==1)&&this.scriptEvaluationError(`OP_IF and OP_NOTIF require minimal truth values.`),g=this.castToBool(e),n===k.OP_NOTIF&&(g=!g)),this.ifStack.push(g),this.elseStack.push(!1);break;case k.OP_ELSE:this.ifStack.length===0&&this.scriptEvaluationError(`OP_ELSE requires a preceeding OP_IF.`),this.hasExplicitFlags()&&this.isAfterGenesis()&&this.elseStack.at(-1)===!0&&this.scriptEvaluationError(`OP_ELSE may only be used once for each OP_IF or OP_NOTIF after Genesis.`),this.elseStack[this.elseStack.length-1]=!0,this.ifStack[this.ifStack.length-1]=this.ifStack.at(-1)!==!0;break;case k.OP_ENDIF:this.ifStack.length===0&&this.scriptEvaluationError(`OP_ENDIF requires a preceeding OP_IF.`),this.ifStack.pop(),this.elseStack.pop();break;case k.OP_VERIFY:this.stack.length<1&&this.scriptEvaluationError(`OP_VERIFY requires at least one item to be on the stack.`),t=this.stackTop(),g=this.castToBool(t),g||this.scriptEvaluationError(`OP_VERIFY requires the top stack value to be truthy.`),this.popStack();break;case k.OP_RETURN:this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.scriptEvaluationError(`OP_RETURN is invalid before Genesis.`),this.ifStack.length>0?this.returningFromConditional=!0:(this.programCounter=this.context===`UnlockingScript`?this.unlockingScript.chunks.length:this.lockingScript.chunks.length,this.programCounter--);break;case k.OP_TOALTSTACK:this.requireStackItems(1,`OP_TOALTSTACK requires at oeast one item to be on the stack.`),this.pushAltStack(this.popStack());break;case k.OP_FROMALTSTACK:this.requireAltStackItems(1,`OP_FROMALTSTACK requires at least one item to be on the stack.`),this.pushStack(this.popAltStack());break;case k.OP_2DROP:this.requireStackItems(2,`OP_2DROP requires at least two items to be on the stack.`),this.popStack(),this.popStack();break;case k.OP_2DUP:this.requireStackItems(2,`OP_2DUP requires at least two items to be on the stack.`),t=this.stackTop(-2),i=this.stackTop(-1),this.pushStackCopy(t),this.pushStackCopy(i);break;case k.OP_3DUP:this.requireStackItems(3,`OP_3DUP requires at least three items to be on the stack.`),t=this.stackTop(-3),i=this.stackTop(-2),a=this.stackTop(-1),this.pushStackCopy(t),this.pushStackCopy(i),this.pushStackCopy(a);break;case k.OP_2OVER:this.requireStackItems(4,`OP_2OVER requires at least four items to be on the stack.`),t=this.stackTop(-4),i=this.stackTop(-3),this.pushStackCopy(t),this.pushStackCopy(i);break;case k.OP_2ROT:{this.requireStackItems(6,`OP_2ROT requires at least six items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.popStack(),r=this.popStack(),i=this.popStack(),a=this.popStack();this.pushStack(r),this.pushStack(n),this.pushStack(t),this.pushStack(e),this.pushStack(a),this.pushStack(i);break}case k.OP_2SWAP:{this.requireStackItems(4,`OP_2SWAP requires at least four items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.popStack(),r=this.popStack();this.pushStack(t),this.pushStack(e),this.pushStack(r),this.pushStack(n);break}case k.OP_IFDUP:this.requireStackItems(1,`OP_IFDUP requires at least one item to be on the stack.`),t=this.stackTop(),this.castToBool(t)&&this.pushStackCopy(t);break;case k.OP_DEPTH:this.pushStack(new h(this.stack.length).toScriptNum());break;case k.OP_DROP:this.requireStackItems(1,`OP_DROP requires at least one item to be on the stack.`),this.popStack();break;case k.OP_DUP:this.requireStackItems(1,`OP_DUP requires at least one item to be on the stack.`),this.pushStackCopy(this.stackTop());break;case k.OP_NIP:this.requireStackItems(2,`OP_NIP requires at least two items to be on the stack.`),i=this.popStack(),this.popStack(),this.pushStack(i);break;case k.OP_OVER:this.requireStackItems(2,`OP_OVER requires at least two items to be on the stack.`),this.pushStackCopy(this.stackTop(-2));break;case k.OP_PICK:case k.OP_ROLL:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),l=this.readScriptNumber(this.popStack());let e=l.toBigInt();(e<0n||e>=BigInt(this.stack.length))&&this.scriptEvaluationError(`${k[n]} requires the top stack element to be 0 or a positive number less than the current size of the stack.`);let t=Number(e),r=this.stack[this.stack.length-1-t];n===k.OP_ROLL?(this.stack.splice(this.stack.length-1-t,1),this.stackMem-=r.length,this.pushStack(r)):this.pushStackCopy(r)})();break;case k.OP_ROT:this.requireStackItems(3,`OP_ROT requires at least three items to be on the stack.`),c=this.popStack(),s=this.popStack(),o=this.popStack(),this.pushStack(s),this.pushStack(c),this.pushStack(o);break;case k.OP_SWAP:this.requireStackItems(2,`OP_SWAP requires at least two items to be on the stack.`),s=this.popStack(),o=this.popStack(),this.pushStack(s),this.pushStack(o);break;case k.OP_TUCK:this.requireStackItems(2,`OP_TUCK requires at least two items to be on the stack.`),t=this.stackTop(-1),this.ensureStackMem(t.length),this.stack.splice(-2,0,t.slice()),this.stackMem+=t.length;break;case k.OP_SIZE:this.requireStackItems(1,`OP_SIZE requires at least one item to be on the stack.`),this.pushStack(new h(this.stackTop().length).toScriptNum());break;case k.OP_AND:case k.OP_OR:case k.OP_XOR:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items on the stack.`),i=this.popStack(),t=this.popStack(),t.length!==i.length&&this.scriptEvaluationError(`${k[n]} requires the top two stack items to be the same size.`);let e=Array.from({length:t.length},()=>0);for(let r=0;r<t.length;r++)n===k.OP_AND?e[r]=t[r]&i[r]:n===k.OP_OR?e[r]=t[r]|i[r]:e[r]=t[r]^i[r];this.pushStack(e)})();break;case k.OP_INVERT:(()=>{this.requireStackItems(1,`OP_INVERT requires at least one item to be on the stack.`),e=this.popStack();let t=Array.from({length:e.length},()=>0);for(let n=0;n<e.length;n++)t[n]=~e[n]&255;this.pushStack(t)})();break;case k.OP_LSHIFT:case k.OP_RSHIFT:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),d=this.readScriptNumber(this.popStack()),t=this.popStack();let e=d.toBigInt();if(e<0n&&this.scriptEvaluationError(`${k[n]} requires the top item on the stack not to be negative.`),t.length===0){this.pushStack([]);return}u=new h(t);let r;if(n===k.OP_LSHIFT){r=u.ushln(e);let n=new h(1).ushln(t.length*8).isubn(1);r=r.iand(n)}else r=u.ushrn(e);let i=r.toArray(`be`,t.length);this.pushStack(i)})();break;case k.OP_EQUAL:case k.OP_EQUALVERIFY:this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack(),g=hi(t,i),this.pushStack(g?[1]:[]),n===k.OP_EQUALVERIFY&&(g||this.scriptEvaluationError(`OP_EQUALVERIFY requires the top two stack items to be equal.`),this.popStack());break;case k.OP_1ADD:case k.OP_1SUB:case k.OP_2MUL:case k.OP_2DIV:case k.OP_NEGATE:case k.OP_ABS:case k.OP_NOT:case k.OP_0NOTEQUAL:(()=>{switch(this.requireStackItems(1,`${k[n]} requires at least one item to be on the stack.`),l=this.readScriptNumber(this.popStack()),n){case k.OP_1ADD:l=l.add(new h(1));break;case k.OP_1SUB:l=l.sub(new h(1));break;case k.OP_2MUL:l=l.mul(new h(2));break;case k.OP_2DIV:l=l.div(new h(2));break;case k.OP_NEGATE:l=l.neg();break;case k.OP_ABS:l.isNeg()&&(l=l.neg());break;case k.OP_NOT:l=new h(+(l.cmpn(0)===0));break;case k.OP_0NOTEQUAL:l=new h(l.cmpn(0)===0?0:1)}this.pushStack(l.toScriptNum())})();break;case k.OP_ADD:case k.OP_SUB:case k.OP_MUL:case k.OP_DIV:case k.OP_MOD:case k.OP_BOOLAND:case k.OP_BOOLOR:case k.OP_NUMEQUAL:case k.OP_NUMEQUALVERIFY:case k.OP_NUMNOTEQUAL:case k.OP_LESSTHAN:case k.OP_GREATERTHAN:case k.OP_LESSTHANOREQUAL:case k.OP_GREATERTHANOREQUAL:case k.OP_MIN:case k.OP_MAX:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack(),d=this.readScriptNumber(i),u=this.readScriptNumber(t);let e=(()=>{switch(n){case k.OP_MUL:return u.byteLength()+d.byteLength();case k.OP_ADD:case k.OP_SUB:return Math.max(u.byteLength(),d.byteLength())+1;default:return Math.max(u.byteLength(),d.byteLength())}})();this.ensureStackMem(e);let r=(()=>{switch(n){case k.OP_ADD:return u.add(d);case k.OP_SUB:return u.sub(d);case k.OP_MUL:return u.mul(d);case k.OP_DIV:return d.cmpn(0)===0&&this.scriptEvaluationError(`OP_DIV cannot divide by zero!`),u.div(d);case k.OP_MOD:return d.cmpn(0)===0&&this.scriptEvaluationError(`OP_MOD cannot divide by zero!`),u.mod(d);case k.OP_BOOLAND:return _i(u.cmpn(0)!==0,d.cmpn(0)!==0);case k.OP_BOOLOR:return vi(u.cmpn(0)!==0,d.cmpn(0)!==0);case k.OP_NUMEQUAL:case k.OP_NUMEQUALVERIFY:return gi(u.cmp(d)===0);case k.OP_NUMNOTEQUAL:return gi(u.cmp(d)!==0);case k.OP_LESSTHAN:return gi(u.cmp(d)<0);case k.OP_GREATERTHAN:return gi(u.cmp(d)>0);case k.OP_LESSTHANOREQUAL:return gi(u.cmp(d)<=0);case k.OP_GREATERTHANOREQUAL:return gi(u.cmp(d)>=0);case k.OP_MIN:return yi(u,d);case k.OP_MAX:return bi(u,d);default:return new h(0)}})();this.pushStack(r.toScriptNum()),n===k.OP_NUMEQUALVERIFY&&(this.castToBool(this.stackTop())||this.scriptEvaluationError(`OP_NUMEQUALVERIFY requires the top stack item to be truthy.`),this.popStack())})();break;case k.OP_WITHIN:this.requireStackItems(3,`OP_WITHIN requires at least three items to be on the stack.`),f=this.readScriptNumber(this.popStack()),d=this.readScriptNumber(this.popStack()),u=this.readScriptNumber(this.popStack()),g=u.cmp(d)>=0&&u.cmp(f)<0,this.pushStack(g?[1]:[]);break;case k.OP_RIPEMD160:case k.OP_SHA1:case k.OP_SHA256:case k.OP_HASH160:case k.OP_HASH256:(()=>{this.requireStackItems(1,`${k[n]} requires at least one item to be on the stack.`),e=this.popStack();let t=[];n===k.OP_RIPEMD160?t=Ye(e):n===k.OP_SHA1?t=Xe(e):n===k.OP_SHA256?t=Ze(e):n===k.OP_HASH160?t=$e(e):n===k.OP_HASH256&&(t=Qe(e)),this.pushStack(t)})();break;case k.OP_CODESEPARATOR:this.lastCodeSeparator=this.programCounter;break;case k.OP_CHECKSIG:case k.OP_CHECKSIGVERIFY:this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),b=this.popStack(),y=this.popStack(),(!this.checkSignatureEncoding(y)||!this.checkPublicKeyEncoding(b))&&this.scriptEvaluationError(`${k[n]} requires correct encoding for the public key and signature.`),_=(()=>{if(y.length===0)return!1;try{x=this.parseChecksigSignature(y);let e=(this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript).chunks.slice(this.lastCodeSeparator===null?0:this.lastCodeSeparator+1);return this.context===`UnlockingScript`&&(e=e.concat(this.lockingScript.chunks)),v=new Ir(e),v.findAndDelete(new Ir().writeBin(y)),S=dr.fromDER(b),this.verifySignature(x,S,v)}catch{return!1}})(),!_&&this.hasFlag(`NULLFAIL`)&&y.length>0&&this.scriptEvaluationError(`${k[n]} requires failing signatures to be empty.`),this.pushStack(_?[1]:[]),n===k.OP_CHECKSIGVERIFY&&(_||this.scriptEvaluationError(`OP_CHECKSIGVERIFY requires that a valid signature is provided.`),this.popStack());break;case k.OP_CHECKMULTISIG:case k.OP_CHECKMULTISIGVERIFY:(()=>{C=1,this.stack.length<C&&this.scriptEvaluationError(`${k[n]} requires at least 1 item for nKeys.`);let e=this.readScriptNumber(this.stackTop(-C)).toBigInt(),t=this.hasExplicitFlags()&&!this.isAfterGenesis()?BigInt(di):ui;(e<0n||e>t)&&this.scriptEvaluationError(`${k[n]} requires a key count between 0 and ${t.toString()}.`),te=Number(e);let r=te;w=++C,C+=te,this.stack.length<C&&this.scriptEvaluationError(`${k[n]} stack too small for nKeys and keys. Need ${C}, have ${this.stack.length}.`);let i=this.readScriptNumber(this.stackTop(-C)).toBigInt();(i<0n||i>BigInt(te))&&this.scriptEvaluationError(`${k[n]} requires the number of signatures to be no greater than the number of keys.`),ne=Number(i);let a=ne;ee=++C,C+=ne,this.stack.length<C&&this.scriptEvaluationError(`${k[n]} stack too small for N, keys, M, sigs, and dummy. Need ${C}, have ${this.stack.length}.`),v=new Ir((this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript).chunks.slice(this.lastCodeSeparator===null?0:this.lastCodeSeparator+1));let o=!1;for(let e=0;e<ne;e++)y=this.stackTop(-ee-e),y.length>0&&(o=!0),v.findAndDelete(new Ir().writeBin(y));(()=>{for(_=!0;_&&ne>0;){if(te===0){_=!1;break}if(y=this.stackTop(-ee),b=this.stackTop(-w),(!this.checkSignatureEncoding(y)||!this.checkPublicKeyEncoding(b))&&this.scriptEvaluationError(`${k[n]} requires correct encoding for the public key and signature.`),T=!1,y.length>0)try{x=this.parseChecksigSignature(y),S=dr.fromDER(b),T=this.verifySignature(x,S,v)}catch{T=!1}T&&(ee++,ne--),w++,te--,ne>te&&(_=!1)}})(),(()=>{!_&&this.hasFlag(`NULLFAIL`)&&o&&this.scriptEvaluationError(`${k[n]} requires failing signatures to be empty.`);let e=1+r+1+a+1-1;for(;e>0;)this.popStack(),e--;this.requireStackItems(1,`${k[n]} requires an extra item (dummy) to be on the stack.`);let t=this.popStack();this.shouldEnforceNullDummy()&&t.length>0&&this.scriptEvaluationError(`${k[n]} requires the extra stack item (dummy) to be empty.`),this.pushStack(_?[1]:[]),n===k.OP_CHECKMULTISIGVERIFY&&(_||this.scriptEvaluationError(`OP_CHECKMULTISIGVERIFY requires that a sufficient number of valid signatures are provided.`),this.popStack())})()})();break;case k.OP_CAT:(()=>{this.requireStackItems(2,`OP_CAT requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack();let e=t.concat(i);e.length>this.maxPushSize()&&this.scriptEvaluationError(`It's not currently possible to push data larger than ${this.maxPushSize()} bytes.`),this.pushStack(e)})();break;case k.OP_SPLIT:(()=>{this.requireStackItems(2,`OP_SPLIT requires at least two items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.readScriptNumber(e).toBigInt();(n<0n||n>BigInt(t.length))&&this.scriptEvaluationError(`OP_SPLIT requires the first stack item to be a non-negative number less than or equal to the size of the second-from-top stack item.`);let r=Number(n);this.pushStack(t.slice(0,r)),this.pushStack(t.slice(r))})();break;case k.OP_NUM2BIN:(()=>{this.requireStackItems(2,`OP_NUM2BIN requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt(),t=this.maxPushSize();if((Number.isFinite(t)&&e>BigInt(t)||e<0n)&&this.scriptEvaluationError(`It's not currently possible to push data larger than ${t} bytes or negative size.`),e>ci)throw new ni(`element-size`,ci,e);m=Number(e);let n=this.popStack();if(n=xn(n),n.length>m&&this.scriptEvaluationError(`OP_NUM2BIN requires that the size expressed in the top stack item is large enough to hold the value expressed in the second-from-top stack item.`),n.length===m){this.pushStack(n);return}let r=Array.from({length:m},()=>0),i=0;n.length>0&&(i=n.at(-1)&128,n[n.length-1]&=127);for(let e=0;e<n.length;e++)r[e]=n[e];i!==0&&(r[m-1]|=128),this.pushStack(r)})();break;case k.OP_BIN2NUM:(()=>{this.requireStackItems(1,`OP_BIN2NUM requires at least one item to be on the stack.`),t=this.popStack();let e=xn(t);xi(e)||this.scriptEvaluationError(`OP_BIN2NUM requires that the resulting number is valid.`),this.pushStack(e)})();break;default:this.scriptEvaluationError(`Invalid opcode ${n} (pc=${this.programCounter}).`)}}return this.advanceAfterStep(e),!0}validate(e){let t=ii();return t?.verifySpendSync!==void 0&&(t.isReady?.()??!0)&&(e===void 0?t.shouldVerifySpend?.(this):t.shouldVerifySpend?.(this,e))!==!1?((e===void 0?t.verifySpendSync(this):t.verifySpendSync(this,e))||this.scriptEvaluationError(`The selected script-verification backend rejected the spend.`),!0):this.validateJavaScript()}validateJavaScript(){this.reset(),this.shouldEnforceSigPushOnly()&&!this.unlockingScript.isPushOnly()&&this.scriptEvaluationError(`Unlocking scripts can only contain push operations, and no other opcodes.`);let e=this.lockingScript,t=this.hasFlag(`P2SH`)&&!this.isAfterGenesis()&&this.isP2SHLockingScript(this.lockingScript);t&&!this.unlockingScript.isPushOnly()&&this.scriptEvaluationError(`P2SH unlocking scripts can only contain push operations.`),this.runScript(`UnlockingScript`);let n=this.stack.map(e=>e.slice());this.runScript(`LockingScript`),this.requireTruthyTopStack();try{if(t){n.length===0&&this.scriptEvaluationError(`P2SH evaluation requires a redeem script on the stack.`);let e=n.pop();if(e===void 0)return this.scriptEvaluationError(`P2SH evaluation requires a redeem script on the stack.`),!1;this.setStack(n);let t=Ir.fromBinary(e);this.lockingScript=new Qr(t.chunks),this.runScript(`LockingScript`)}}finally{this.lockingScript=e}return this.shouldEnforceCleanStack()&&this.stack.length!==1&&this.scriptEvaluationError(`The clean stack rule requires exactly one item to be on the stack after script execution, found ${this.stack.length}.`),this.requireTruthyTopStack(),!0}async validateWith(e,t){return(t===void 0?e.shouldVerifySpend?.(this):e.shouldVerifySpend?.(this,t))===!1?this.validateJavaScript():t===void 0?await e.verifySpend(this):await e.verifySpend(this,t)}toTransactionUint8Array(){let e={sourceTXID:this.sourceTXID,sourceOutputIndex:this.sourceOutputIndex,unlockingScript:this.unlockingScript,sequence:this.inputSequence},t=this.allInputs??[...this.otherInputs.slice(0,this.inputIndex),e,...this.otherInputs.slice(this.inputIndex)];if(this.inputIndex<0||this.inputIndex>=t.length)throw RangeError(`Spend input index is out of range`);let n=new Jt;n.writeUInt32LE(this.transactionVersion),n.writeVarIntNum(t.length);for(let r=0;r<t.length;r++){let i=r===this.inputIndex?e:t[r],a=i.sourceTXID??i.sourceTransaction?.id(`hex`);if(a===void 0)throw Error(`Input ${r} is missing its source transaction ID`);if(i.unlockingScript===void 0)throw Error(`Input ${r} is missing its unlocking script`);n.writeReverse(nn(a,`hex`)),n.writeUInt32LE(i.sourceOutputIndex);let o=i.unlockingScript.toUint8Array();n.writeVarIntNum(o.length),n.write(o),n.writeUInt32LE(i.sequence??4294967295)}n.writeVarIntNum(this.outputs.length);for(let e of this.outputs){n.writeUInt64LE(e.satoshis??0);let t=e.lockingScript.toUint8Array();n.writeVarIntNum(t.length),n.write(t)}return n.writeUInt32LE(this.lockTime),n.toUint8Array()}runScript(e){this.context=e,this.programCounter=0,this.ifStack=[],this.elseStack=[],this.returningFromConditional=!1,this.clearAltStack(),this.lastCodeSeparator=null;let t=e===`UnlockingScript`?this.unlockingScript:this.lockingScript;for(this.hasExplicitFlags()&&!this.isAfterGenesis()&&t.toUint8Array().length>oi&&this.scriptEvaluationError(`Script size exceeds ${oi} bytes.`);this.programCounter<t.chunks.length;)this.step();this.ifStack.length>0&&this.scriptEvaluationError(`Every OP_IF, OP_NOTIF, or OP_ELSE must be terminated with OP_ENDIF prior to the end of the script.`),this.ifStack=[],this.elseStack=[],this.clearAltStack(),this.lastCodeSeparator=null}isP2SHLockingScript(e){let t=e.chunks;return t.length===3&&t[0].op===k.OP_HASH160&&t[1].op===20&&Array.isArray(t[1].data)&&t[1].data.length===20&&t[2].op===k.OP_EQUAL}requireTruthyTopStack(){this.stack.length===0?this.scriptEvaluationError(`The top stack element must be truthy after script evaluation (stack is empty).`):this.castToBool(this.stackTop())||this.scriptEvaluationError(`The top stack element must be truthy after script evaluation.`)}castToBool(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(e[t]!==0)return t!==e.length-1||e[t]!==128;return!1}scriptEvaluationError(e){throw new ti({message:e,txid:this.sourceTXID,outputIndex:this.sourceOutputIndex,context:this.context,programCounter:this.programCounter,stackState:this.stack,altStackState:this.altStack,ifStackState:this.ifStack,stackMem:this.stackMem,altStackMem:this.altStackMem})}};function Ti(e,t){let n=Jr.SIGHASH_FORKID;return e===`all`&&(n|=Jr.SIGHASH_ALL),e===`none`&&(n|=Jr.SIGHASH_NONE),e===`single`&&(n|=Jr.SIGHASH_SINGLE),t&&(n|=Jr.SIGHASH_ANYONECANPAY),n}function Ei(e,t,n,r){let i=e.inputs[t],a=i.sourceTXID??i.sourceTransaction?.id(`hex`);if(a==null||a===void 0||a===``)throw Error(`The input sourceTXID or sourceTransaction is required for transaction signing.`);let o=n??i.sourceTransaction?.outputs[i.sourceOutputIndex].satoshis;if(o==null||o===void 0)throw Error(`The sourceSatoshis or input sourceTransaction is required for transaction signing.`);let s=r??i.sourceTransaction?.outputs[i.sourceOutputIndex].lockingScript;if(s==null)throw Error(`The lockingScript or input sourceTransaction is required for transaction signing.`);return{sourceTXID:a,sourceSatoshis:o,lockingScript:s,allInputs:e.inputs,get otherInputs(){return e.inputs.filter((e,n)=>n!==t)}}}function Di(e){let{tx:t,inputIndex:n,signatureScope:r,sourceTXID:i,sourceSatoshis:a,lockingScript:o,otherInputs:s,allInputs:c,inputSequence:l}=e,u=t.inputs[n];return Jr.format({sourceTXID:i,sourceOutputIndex:wn(u.sourceOutputIndex,`input.sourceOutputIndex must have value`),sourceSatoshis:a,transactionVersion:t.version,otherInputs:s??[],allInputs:c,inputIndex:n,outputs:t.outputs,inputSequence:l??wn(u.sequence,`input.sequence must have value`),subscript:o,lockTime:t.lockTime,scope:r,cache:t.getSignatureHashCache()})}var Oi=class{lock(e){let t;if(typeof e==`string`){let n=vn(e);if(n.prefix[0]!==0&&n.prefix[0]!==111)throw Error(`only P2PKH is supported`);t=n.data}else t=e;if(t.length!==20)throw Error(`P2PKH hash length must be 20 bytes`);return new Qr([{op:k.OP_DUP},{op:k.OP_HASH160},{op:t.length,data:t},{op:k.OP_EQUALVERIFY},{op:k.OP_CHECKSIG}])}unlock(e,t=`all`,n=!1,r,i){return{sign:async(a,o)=>{let s=Ti(t,n),c=Ei(a,o,r,i);r=c.sourceSatoshis,i=c.lockingScript;let l=Ze(Di({tx:a,inputIndex:o,signatureScope:s,sourceTXID:c.sourceTXID,sourceSatoshis:c.sourceSatoshis,lockingScript:c.lockingScript,allInputs:c.allInputs})),u=Zr(`signDigest`),d=Zr(`publicKeyFromPrivate`),f=u===void 0&&d===void 0?void 0:Uint8Array.from(e.toArray(`be`,32)),p=u===void 0?e.sign(l):fr.fromDER(Array.from(Yr(`signDigest`,await u.signDigest(f,Uint8Array.from(Ze(l)))))),m=new Jr(p.r,p.s,s).toChecksigFormat(),h=d===void 0?e.toPublicKey().encode(!0):Array.from(ki(await d.publicKeyFromPrivate(f)));return new $r([{op:m.length,data:m},{op:h.length,data:h}])},estimateLength:async()=>108}}};function ki(e){let t=Yr(`publicKeyFromPrivate`,e,33);if(t[0]!==2&&t[0]!==3)throw Error(`publicKeyFromPrivate returned an invalid compressed public key`);return t}var Ai=class{value;constructor(e){this.value=e}async computeFee(e){let t=e=>e>2**32?9:e>2**16?5:e>253?3:1,n=4;n+=t(e.inputs.length);for(let r=0;r<e.inputs.length;r++){let i=e.inputs[r];n+=40;let a;if(typeof i.unlockingScript==`object`)a=i.unlockingScript.toBinary().length;else if(typeof i.unlockingScriptTemplate==`object`)a=await i.unlockingScriptTemplate.estimateLength(e,r);else throw TypeError(`All inputs must have an unlocking script or an unlocking script template for sat/kb fee computation.`);n+=t(a),n+=a}n+=t(e.outputs.length);for(let r of e.outputs){n+=8;let e=r.lockingScript.toBinary().length;n+=t(e),n+=e}return n+=4,Math.ceil(n/1e3*this.value)}},ji=class e extends Ai{static ARC_POLICY_URL=`https://arc.gorillapool.io/v1/policy`;static instance=null;cachedRate=null;cacheTimestamp=0;cacheValidityMs;constructor(e=3e5){super(100),this.cacheValidityMs=e}static getInstance(t=3e5){return e.instance??=new e(t),e.instance}async fetchFeeRate(){let t=Date.now();if(this.cachedRate!==null&&t-this.cacheTimestamp<this.cacheValidityMs)return this.cachedRate;try{let n=await fetch(e.ARC_POLICY_URL);if(!n.ok)throw Error(`HTTP ${n.status}: ${n.statusText}`);let r=await n.json();if(!r.policy?.miningFee||typeof r.policy.miningFee.satoshis!=`number`||typeof r.policy.miningFee.bytes!=`number`)throw Error(`Invalid policy response format`);let i=r.policy.miningFee.satoshis/r.policy.miningFee.bytes*1e3;return this.cachedRate=i,this.cacheTimestamp=t,i}catch(e){return this.cachedRate===null?(console.warn(`Failed to fetch live fee rate, using default 100 sat/kb:`,e),100):(console.warn(`Failed to fetch live fee rate, using cached value:`,e),this.cachedRate)}}async computeFee(e){let t=await this.fetchFeeRate();return this.value=t,super.computeFee(e)}};function Mi(e,t,n,r){return new Promise((i,a)=>{let o=e.request(t,n,e=>{let t=``;e.on(`data`,e=>{t+=e}),e.on(`end`,()=>{let n=e.statusCode>=200&&e.statusCode<=299,r=e.headers[`content-type`],a=t!==``&&typeof r==`string`&&r.startsWith(`application/json`)?JSON.parse(t):t;i({status:e.statusCode,statusText:e.statusMessage,ok:n,data:a})})});o.on(`error`,e=>{a(e)}),n.data!==null&&n.data!==void 0&&o.write(r(n.data)),o.end()})}var Ni=class{https;constructor(e){this.https=e}async request(e,t){return await Mi(this.https,e,t,e=>JSON.stringify(e))}},Pi=class{fetch;constructor(e){this.fetch=e}async request(e,t){let n={method:t.method,headers:t.headers,body:JSON.stringify(t.data)},r=await this.fetch(e,n),i=r.headers.get(`Content-Type`)?.startsWith(`application/json`)??!1?await r.json():await r.text();return{ok:r.ok,status:r.status,statusText:r.statusText,data:i}}};function Fi(){let e={async request(...e){throw Error(`No method available to perform HTTP request`)}};if(globalThis.window!==void 0&&typeof globalThis.window.fetch==`function`)return new Pi(globalThis.window.fetch.bind(globalThis.window));if(typeof globalThis.fetch==`function`)return new Pi(globalThis.fetch.bind(globalThis));let t=typeof r==`function`?r:void 0;if(t===void 0)return e;try{return new Ni(t([`node`,`https`].join(`:`)))}catch{return e}}function Ii(){return`ts-sdk-${en(Dr(16))}`}var Li=new Set([`DOUBLE_SPEND_ATTEMPTED`,`REJECTED`,`INVALID`,`MALFORMED`,`MINED_IN_STALE_BLOCK`]);function Ri(e){try{return e.toHexEF()}catch(t){if(t.message===`All inputs must have source transactions when serializing to EF format`)return e.toHex();throw t}}function zi(e){let{txid:t,extraInfo:n,txStatus:r,competingTxs:i}=e,a=r?.toUpperCase(),o=n?.toUpperCase().includes(`ORPHAN`)||a?.includes(`ORPHAN`);if(Li.has(a)||o){let e={status:`error`,code:r??`UNKNOWN`,txid:t,description:`${r??``} ${n??``}`.trim()};return i!=null&&(e.more={competingTxs:i}),e}let s={status:`success`,txid:t,message:`${r} ${n}`};return i!=null&&(s.competingTxs=i),s}function Bi(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}function Vi(e,t){let n={status:`error`,code:typeof e==`number`||typeof e==`string`?e.toString():`ERR_UNKNOWN`,description:`Unknown error`},r=Bi(t);return typeof r!=`object`||!r?n:(n.more=r,`txid`in r&&typeof r.txid==`string`&&(n.txid=r.txid),`detail`in r&&typeof r.detail==`string`&&(n.description=r.detail),n)}function Hi(e){return{status:`error`,code:`500`,description:typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`?e.message:`Internal Server Error`}}var Ui=class{URL;apiKey;deploymentId;callbackUrl;callbackToken;headers;httpClient;constructor(e,t){if(this.URL=e,typeof t==`string`)this.apiKey=t,this.httpClient=Fi(),this.deploymentId=Ii(),this.callbackToken=void 0,this.callbackUrl=void 0;else{let{apiKey:e,deploymentId:n,httpClient:r,callbackToken:i,callbackUrl:a,headers:o}=t??{};this.apiKey=e,this.httpClient=r??Fi(),this.deploymentId=n??Ii(),this.callbackToken=i,this.callbackUrl=a,this.headers=o}}requestHeaders(){let e={"Content-Type":`application/json`,"XDeployment-ID":this.deploymentId};if(this.apiKey!=null&&this.apiKey!==``&&(e.Authorization=`Bearer ${this.apiKey}`),this.callbackUrl!=null&&this.callbackUrl!==``&&(e[`X-CallbackUrl`]=this.callbackUrl),this.callbackToken!=null&&this.callbackToken!==``&&(e[`X-CallbackToken`]=this.callbackToken),this.headers!=null)for(let t in this.headers)e[t]=this.headers[t];return e}async broadcast(e){let t={method:`POST`,headers:this.requestHeaders(),data:{rawTx:Ri(e)}};try{let e=await this.httpClient.request(`${this.URL}/v1/tx`,t);return e.ok?zi(e.data):Vi(e.status,e.data)}catch(e){return Hi(e)}}async broadcastMany(e){let t=e.map(e=>({rawTx:Ri(e)})),n={method:`POST`,headers:this.requestHeaders(),data:t};try{return(await this.httpClient.request(`${this.URL}/v1/txs`,n)).data}catch(t){let n=Hi(t);return e.map(()=>n)}}};function Wi(e=!1,t={}){return new Ui(e?`https://testnet.arc.gorillapool.io`:`https://arc.gorillapool.io`,t)}var Gi=class{network;apiKey;URL;httpClient;constructor(e=`main`,t={}){let{apiKey:n,httpClient:r}=t;this.network=e,this.URL=`https://api.whatsonchain.com/v1/bsv/${e}`,this.httpClient=r??Fi(),this.apiKey=n??``}async isValidRootForHeight(e,t){let n={method:`GET`,headers:this.getHttpHeaders()},r=await this.httpClient.request(`${this.URL}/block/${t}/header`,n);if(r.ok){let{merkleroot:t}=r.data;return t===e}if(r.status===404)return!1;throw Error(`Failed to verify merkleroot for height ${t} because of an error: ${JSON.stringify(r.data)} `)}async currentHeight(){try{let e={method:`GET`,headers:this.getHttpHeaders()},t=await this.httpClient.request(`${this.URL}/block/headers`,e);if(t.ok)return t.data[0].height;throw Error(`Failed to get current height because of an error: ${JSON.stringify(t.data)} `)}catch(e){throw Error(`Failed to get current height because of an error: ${e instanceof Error?e.message:String(e)}`)}}getHttpHeaders(){let e={Accept:`application/json`};return typeof this.apiKey==`string`&&this.apiKey.trim()!==``&&(e.Authorization=this.apiKey),e}};function Ki(){return new Gi}function qi(e,t){return en(Qe(nn((e??``)+(t??``),`hex`).reverse()).reverse())}function Ji(e,t,n,r){let i=r.get(e);if(i==null)return;if(i!==t)throw Error(`Mismatched roots`);let a=r.get(`${n}:0`);if(a==null)throw Error(`Mismatched roots`);return a}function Yi(e,t,n,r,i,a){if(t==null){if(a)return qi(e,e);throw Error(`Missing hash for index ${r} at height ${i}`)}return t.duplicate===!0?qi(e,e):n%2==1?qi(t.hash,e):qi(e,t.hash)}var Xi=class e{blockHeight;path;static fromHex(t){return e.fromBinary(nn(t,`hex`))}static fromReader(t,n=!0,r=!0){let i=t.readVarIntNum(),a=t.readUInt8(),o=Array.from({length:a}).fill(null).map(()=>[]),s,c,l;for(let e=0;e<a;e++){for(l=t.readVarIntNum();l>0;){c=t.readVarIntNum(),s=t.readUInt8();let n={offset:c};(s&1)==1?n.duplicate=!0:(s&2&&(n.txid=!0),n.hash=en(t.read(32).reverse())),(!Array.isArray(o[e])||o[e].length===0)&&(o[e]=[]),o[e].push(n),l--}o[e].sort((e,t)=>e.offset-t.offset)}return new e(i,o,n,r)}static fromBinary(t,n=!0,r=!0){let i=new Yt(t);return e.fromReader(i,n,r)}static fromCoinbaseTxidAndHeight(t,n){return new e(n,[[{offset:0,hash:t,txid:!0}]])}constructor(e,t,n=!0,r=!0){this.blockHeight=e,this.path=t;let i=Array.from({length:this.path.length}).fill(0).map(()=>new Set);if(this.path.forEach((e,t)=>{if(e.length===0&&t===0)throw Error(`Empty level at height: ${t}`);let r=new Set;e.forEach(e=>{if(r.has(e.offset))throw Error(`Duplicate offset: ${e.offset}, at height: ${t}`);if(r.add(e.offset),t===0){if(e.duplicate!==!0)for(let t=1;t<this.path.length;t++)i[t].add(e.offset>>t^1)}else if(n&&!i[t].has(e.offset))throw Error(`Invalid offset: ${e.offset}, at height: ${t}, with legal offsets: ${Array.from(i[t],e=>e.toString()).join(`, `)}`)})}),!r)return;let a=this.path.map(e=>new Map(e.map(e=>[e.offset,e]))),o=new Map,s=new Map,c=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),l;this.path[0].forEach((e,t)=>{let n=this.computeRootCached(e.hash,a,o,s,c);if(t===0&&(l=n),l!==n)throw Error(`Mismatched roots`)})}toWriter(e){e.writeVarIntNum(this.blockHeight);let t=this.path.length;e.writeUInt8(t);for(let n=0;n<t;n++){let t=Object.keys(this.path[n]).length;e.writeVarIntNum(t);for(let t of this.path[n]){e.writeVarIntNum(t.offset);let n=0;t?.duplicate===!0&&(n|=1),t?.txid!==void 0&&t.txid!==null&&(n|=2),e.writeUInt8(n),n&1||e.write(nn(t.hash,`hex`).reverse())}}}toBinary(){let e=new yn;return this.toWriter(e),e.toArray()}toBinaryUint8Array(){let e=new Jt;return this.toWriter(e),e.toUint8Array()}toHex(){return en(this.toBinaryUint8Array())}indexOf(e){let t=this.path[0].find(t=>t.hash===e);if(t==null)throw Error(`Transaction ID ${e} not found in the Merkle Path`);return t.offset}computeRootCached(e,t,n,r,i){if(typeof e!=`string`&&(e=this.path[0].find(e=>!!e.hash)?.hash),typeof e!=`string`)throw TypeError(`Transaction ID is undefined`);let a=this.indexOf(e);if(this.path.length===1&&this.path[0].length===1)return e;let o=Math.max(this.path.length,32-Math.clz32(i)),s=e;for(let e=0;e<o;e++){let c=`${e}:${a>>e}`,l=Ji(c,s,o,r);if(l!=null)return l;r.set(c,s);let u=a>>e^1,d=this.cachedFindLeaf(e,u,t,n,i);s=Yi(s,d,u,a,e,this.path.length===1&&a>>e===i>>e)}return r.set(`${o}:0`,s),s}nextRootHash(e,t,n,r){let i=t>>n^1,a=this.findOrComputeLeaf(n,i);if(a==null){if(this.path.length===1&&t>>n===r>>n)return qi(e,e);throw Error(`Missing hash for index ${t} at height ${n}`)}return a.duplicate===!0?qi(e,e):i%2==1?qi(a.hash,e):qi(e,a.hash)}computeRoot(e){if(typeof e!=`string`){let t=this.path[0].find(e=>!!e?.hash);if(t==null)throw Error(`No valid leaf found in the Merkle Path`);e=t.hash}if(typeof e!=`string`)throw TypeError(`Transaction ID is undefined`);let t=this.indexOf(e),n=e;if(this.path.length===1&&this.path[0].length===1)return n;let r=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),i=Math.max(this.path.length,32-Math.clz32(r));for(let e=0;e<i;e++)n=this.nextRootHash(n,t,e,r);return n}findOrComputeLeaf(e,t){let n=e=>en(Qe(nn(e,`hex`).reverse()).reverse()),r=e<this.path.length?this.path[e].find(e=>e.offset===t):void 0;if(r!=null)return r;if(e===0)return;let i=e-1,a=t<<1,o=this.findOrComputeLeaf(i,a);if(o?.hash==null||o.hash===``)return;let s=this.findOrComputeLeaf(i,a+1);if(s?.hash==null)return s?.duplicate===!0||this.path.length===1&&a===this.path[0].reduce((e,t)=>Math.max(e,t.offset),0)>>i?{offset:t,hash:n(o.hash+o.hash)}:void 0;let c;return c=s.duplicate===!0?n(o.hash+o.hash):n((s.hash??``)+(o.hash??``)),r={offset:t,hash:c},r}async verify(e,t){let n=this.computeRoot(e);if(this.indexOf(e)===0){let e=await t.currentHeight();if(this.blockHeight+100>e)return!1}return await t.isValidRootForHeight(n,this.blockHeight)}combine(e){if(this.blockHeight!==e.blockHeight)throw Error(`You cannot combine paths which do not have the same block height.`);if(this.computeRoot()!==e.computeRoot())throw Error(`You cannot combine paths which do not have the same root.`);let t=[];for(let n=0;n<this.path.length;n++){t.push([]);for(let e of this.path[n])t[n].push(e);for(let r of e.path[n]){let e=t[n].find(e=>e.offset===r.offset);e===void 0?t[n].push(r):r?.txid!==void 0&&r?.txid!==null&&(e.txid=!0)}}this.path=t,this.trim()}trim(){let e=(e,t)=>{(t.length===0||t.at(-1)!==e)&&t.push(e)},t=(e,t)=>{for(let n=e.length;n>=0;n--){let r=this.path[t].findIndex(t=>t.offset===e[n]);r>=0&&this.path[t].splice(r,1)}},n=t=>{let n=[];for(let r of t)e(r>>1,n);return n},r=[],i=[];for(let e of this.path)e.sort((e,t)=>e.offset-t.offset);for(let t=0;t<this.path[0].length;t++){let n=this.path[0][t];if(n.txid===!0)e(n.offset>>1,r);else{let r=n.offset%2==1,a=this.path[0][t+(r?-1:1)];(a.txid===void 0||a.txid===null||!a.txid)&&e(a.offset,i)}}t(i,0);for(let e=1;e<this.path.length;e++)i=r,r=n(r),t(i,e)}cachedFindLeaf(e,t,n,r,i){let a=`${e}:${t}`;if(r.has(a))return r.get(a);let o=e=>en(Qe(nn(e,`hex`).reverse()).reverse()),s=e<n.length?n[e].get(t):void 0;if(s!=null)return r.set(a,s),s;if(e===0){r.set(a,void 0);return}let c=e-1,l=t<<1,u=this.cachedFindLeaf(c,l,n,r,i);if(u?.hash==null||u.hash===``){r.set(a,void 0);return}let d=this.cachedFindLeaf(c,l+1,n,r,i);if(d?.hash==null){if(d?.duplicate===!0||this.path.length===1&&l===i>>c)return s={offset:t,hash:o(u.hash+u.hash)},r.set(a,s),s;r.set(a,void 0);return}return s={offset:t,hash:d.duplicate===!0?o(u.hash+u.hash):o((d.hash??``)+(u.hash??``))},r.set(a,s),s}extract(t){if(t.length===0)throw Error(`At least one txid must be provided to extract`);let n=this.computeRoot(),r=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),i=Math.max(this.path.length,32-Math.clz32(r)),a=this.createSourceLeafIndex(),o=new Map,s=this.createTxidToOffsetIndex(),c=this.createNeededLeafLevels(i);for(let e of t)this.collectExtractedLeaves(e,s,c,a,o,r,i);let l=new e(this.blockHeight,this.buildExtractedPath(c));l.trim();let u=l.computeRoot();if(u!==n)throw Error(`Extracted path root ${u} does not match original root ${n}`);return l}createSourceLeafIndex(){let e=Array.from({length:this.path.length});for(let t=0;t<this.path.length;t++){let n=new Map;for(let e of this.path[t])n.set(e.offset,e);e[t]=n}return e}createTxidToOffsetIndex(){let e=new Map;for(let t of this.path[0])t.hash!=null&&e.set(t.hash,t.offset);return e}createNeededLeafLevels(e){let t=Array.from({length:e});for(let n=0;n<e;n++)t[n]=new Map;return t}collectExtractedLeaves(e,t,n,r,i,a,o){let s=t.get(e);if(s===void 0)throw Error(`Transaction ID ${e} not found in the Merkle Path`);n[0].set(s,{offset:s,txid:!0,hash:e});let c=s^1;if(!n[0].has(c)){let e=this.cachedFindLeaf(0,c,r,i,a);e!=null&&n[0].set(c,e)}for(let e=1;e<o;e++){let t=s>>e^1;if(n[e].has(t))continue;let o=this.cachedFindLeaf(e,t,r,i,a);o==null?s>>e===a>>e&&n[e].set(t,{offset:t,duplicate:!0}):n[e].set(t,o)}}buildExtractedPath(e){return e.map(e=>Array.from(e.values()).sort((e,t)=>e.offset-t.offset))}},Zi=4022206465,Qi=4022206466,$i=16843009,ea;(function(e){e[e.RAWTX=0]=`RAWTX`,e[e.RAWTX_AND_BUMP_INDEX=1]=`RAWTX_AND_BUMP_INDEX`,e[e.TXID_ONLY=2]=`TXID_ONLY`})(ea||={});function ta(e,t){if(!Number.isSafeInteger(t)||t<0||e.pos+t>e.bin.length)throw RangeError(`Serialized transaction exceeds available BEEF data`);e instanceof Yt?e.skip(t):e.pos+=t}function na(e){let t=e.pos;ta(e,4);let n=e.readVarIntNum(!1),r=new Set;for(let t=0;t<n;t++)r.add(en(e.readReverse(32))),ta(e,4),ta(e,e.readVarIntNum(!1)+4);let i=e.readVarIntNum(!1);for(let t=0;t<i;t++)ta(e,8),ta(e,e.readVarIntNum(!1));return ta(e,4),{rawTx:e instanceof Yt?e.bin.subarray(t,e.pos):Uint8Array.from(e.bin.slice(t,e.pos)),inputTxids:Array.from(r)}}function ra(e){return na(new Yt(e)).inputTxids}function ia(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var aa=class e{_bumpIndex;_tx;_rawTx;_txid;inputTxids=[];isValid=void 0;get bumpIndex(){return this._bumpIndex}set bumpIndex(e){this._bumpIndex=e,this.updateInputTxids()}get hasProof(){return this._bumpIndex!==void 0}get isTxidOnly(){return this._txid!==void 0&&this._txid!==null&&this._rawTx==null&&this._tx==null}get txid(){if(this._txid!==void 0&&this._txid!==null&&this._txid!==``)return this._txid;if(this._tx!=null)return this._txid=this._tx.id(`hex`),this._txid;if(this._rawTx!=null)return this._txid=en(Qe(this._rawTx).reverse()),this._txid;throw Error(`Internal`)}get tx(){if(this._tx!=null)return this._tx;if(this._rawTx!=null)return this._tx=fa.fromBinaryView(this._rawTx),this._tx}get rawTx(){let e=this.rawTxUint8Array;return e==null?void 0:Array.from(e)}get rawTxUint8Array(){return this._tx==null||(this._rawTx==null?this._rawTx=this._tx.toUint8Array():this.syncRawTxFromTransaction()),this._rawTx}syncRawTxFromTransaction(){if(this._tx==null)return!1;let e=this._tx.toUint8Array();if(this._rawTx!=null)return e!==this._rawTx&&(this._rawTx=e,this._txid=this._tx.id(`hex`),this.updateInputTxids(),!0);let t=this._tx.id(`hex`),n=this._txid!=null&&this._txid!==t,r=this.inputTxids;return this._txid=t,this.updateInputTxids(),n||!ia(r,this.inputTxids)}constructor(e,t,n){if(typeof e==`string`)this._txid=e;else if(e instanceof Uint8Array)this._rawTx=e;else if(Array.isArray(e))this._rawTx=new Uint8Array(e);else if(e instanceof fa)this._tx=e;else throw TypeError(`Invalid transaction data type`);this._bumpIndex=t,this.hasProof?this.inputTxids=[]:n==null?this.updateInputTxids():this.inputTxids=n}static fromTx(t,n){return new e(t,n)}static fromRawTx(t,n){return new e(t,n)}static fromTxid(t,n){return new e(t,n)}updateInputTxids(){if(this.hasProof)this.inputTxids=[];else if(this._tx!=null){let e=new Set;for(let t of this._tx.inputs)t.sourceTXID!==void 0&&t.sourceTXID!==null&&t.sourceTXID!==``&&e.add(t.sourceTXID);this.inputTxids=Array.from(e)}else this.inputTxids=this._rawTx==null?[]:ra(this._rawTx)}toWriter(e,t){let n=t=>{e.writeUInt8(t)},r=()=>{if(this._txid==null)throw Error(`Transaction ID (_txid) is undefined`);e.writeReverse(nn(this._txid,`hex`))},i=()=>{let t=this.rawTxUint8Array;if(t==null)throw Error(`a valid serialized Transaction is expected`);e.write(t)};t===4022206466?this.isTxidOnly?(n(ea.TXID_ONLY),r()):this.bumpIndex===void 0?(n(ea.RAWTX),i()):(n(ea.RAWTX_AND_BUMP_INDEX),e.writeVarIntNum(this.bumpIndex),i()):(i(),this.bumpIndex===void 0?n(ea.RAWTX):(n(ea.RAWTX_AND_BUMP_INDEX),e.writeVarIntNum(this.bumpIndex)))}static fromReader(t,n){let r,i;if(n===4022206466){let n=t.readUInt8();if(n===ea.TXID_ONLY)i=e.fromTxid(en(t.readReverse(32)));else{n===ea.RAWTX_AND_BUMP_INDEX&&(r=t.readVarIntNum());let{rawTx:a,inputTxids:o}=na(t);i=new e(a,r,o)}}else{let{rawTx:n,inputTxids:a}=na(t);r=t.readUInt8()===0?void 0:t.readVarIntNum(),i=new e(n,r,a)}return i}};function oa(e,t,n,r){if(t.path.length!==n)throw Error(`Mismatched roots`);for(let i=0;i<n;i++)sa(e[i],t.path[i],r)}function sa(e,t,n){for(let r of t){let t=e.get(r.offset);if(t==null){e.set(r.offset,r);continue}ca(t,r,n)}}function ca(e,t,n){if(n&&(e.hash!==t.hash||e.duplicate!==t.duplicate))throw Error(`Mismatched roots`);t.txid!=null&&(e.txid=!0)}function la(e,t,n){for(let r of e.path[0])typeof r.hash==`string`&&n.set(r.hash,t)}var ua=class e{bumps=[];txs=[];version=Qi;atomicTxid=void 0;txidIndex=void 0;txPositionIndex=void 0;bumpIndexesByHeight=void 0;bumpIndexByTxid=void 0;rawBytesCache;hexCache;atomicBytesCache=new Map;atomicCacheTxs;atomicCacheBumps;atomicCacheVersion;rawCacheVersion;rawCacheTxs;rawCacheBumps;bumpState;needsSort=!0;sortResultCache;sortTxState;constructor(e=Qi){this.version=e}invalidateSerializationCaches(){this.rawBytesCache=void 0,this.hexCache=void 0,this.atomicBytesCache.clear(),this.atomicCacheTxs=void 0,this.atomicCacheBumps=void 0,this.atomicCacheVersion=void 0,this.rawCacheVersion=void 0,this.rawCacheTxs=void 0,this.rawCacheBumps=void 0}captureSerializationState(){this.rawCacheVersion=this.version,this.rawCacheTxs=this.captureTransactionState(),this.rawCacheBumps=Array.from(this.bumps),this.captureBumpState()}captureTransactionState(){return this.txs.map(e=>({ref:e,bumpIndex:e._bumpIndex,rawTx:e._rawTx,tx:e._rawTx==null?e._tx:void 0,txid:e._rawTx==null&&e._tx==null?e._txid:void 0}))}transactionStateMatches(e){if(e?.length!==this.txs.length)return!1;for(let t=0;t<this.txs.length;t++){let n=this.txs[t],r=e[t];if(r.ref!==n||r.bumpIndex!==n._bumpIndex||r.rawTx!==n._rawTx||r.tx!==(n._rawTx==null?n._tx:void 0)||r.txid!==(n._rawTx==null&&n._tx==null?n._txid:void 0))return!1}return!0}captureBumpState(){this.bumpState=this.bumps.map(e=>({ref:e,blockHeight:e.blockHeight,levels:e.path.map(e=>({ref:e,leaves:e.map(e=>({ref:e,offset:e.offset,hash:e.hash,txid:e.txid,duplicate:e.duplicate}))}))}))}bumpLeafStateMatches(e,t){return t.ref===e&&t.offset===e.offset&&t.hash===e.hash&&t.txid===e.txid&&t.duplicate===e.duplicate}bumpLevelStateMatches(e,t){return t.ref===e&&t.leaves.length===e.length&&e.every((e,n)=>this.bumpLeafStateMatches(e,t.leaves[n]))}singleBumpStateMatches(e,t){return t.ref===e&&t.blockHeight===e.blockHeight&&t.levels.length===e.path.length&&e.path.every((e,n)=>this.bumpLevelStateMatches(e,t.levels[n]))}bumpStateMatches(){return this.bumpState?.length===this.bumps.length&&this.bumps.every((e,t)=>this.singleBumpStateMatches(e,this.bumpState[t]))}synchronizeNestedBumpMutations(){if(this.bumpState==null){this.captureBumpState();return}this.bumpStateMatches()||(this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,this.needsSort=!0,this.invalidateBumpIndexes(),this.captureBumpState())}serializationCacheMatchesState(){if(this.rawBytesCache==null||this.rawCacheVersion!==this.version||!this.transactionStateMatches(this.rawCacheTxs)||this.rawCacheBumps?.length!==this.bumps.length)return!1;for(let e=0;e<this.bumps.length;e++)if(this.rawCacheBumps[e]!==this.bumps[e])return!1;return!0}markMutated(e=!0){this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,e&&(this.needsSort=!0)}ensureSerializableState(){for(let e of this.txs)e.txid}synchronizeNestedTransactionMutations(){let e=!1;for(let t of this.txs)e=t.syncRawTxFromTransaction()||e;e&&(this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,this.needsSort=!0,this.rebuildTxIndexes())}ensureSortedForSerialization(){this.needsSort&&this.sortTxs()}getSerializedBytes(){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.serializationCacheMatchesState()&&this.rawBytesCache!=null)return this.rawBytesCache;this.invalidateSerializationCaches(),this.ensureSerializableState(),this.ensureSortedForSerialization();let e=new Jt;return this.toWriter(e),this.rawBytesCache=e.toUint8Array(),this.captureSerializationState(),this.rawBytesCache}getBeefForAtomic(e){this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations();let t=this.ensureTxidIndex(),n=t.get(e);if(n==null)throw Error(`${e} does not exist in this Beef`);let r=this.collectAtomicTransactions(n,t),i=this.copySelectedTransactions(r);return i.sortTxs(),i}getAtomicSerializedBytes(e){this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.atomicCacheVersion===this.version&&this.transactionStateMatches(this.atomicCacheTxs)&&this.atomicCacheBumps?.length===this.bumps.length&&this.bumps.every((e,t)=>this.atomicCacheBumps?.[t]===e)||this.atomicBytesCache.clear();let t=this.atomicBytesCache.get(e);if(t!=null)return t;let n=this.getBeefForAtomic(e).getSerializedBytes(),r=tn(e,`hex`),i=new Uint8Array(4+r.length+n.length);new DataView(i.buffer).setUint32(0,$i,!0);for(let e=0;e<r.length;e++)i[4+e]=r[r.length-1-e];return i.set(n,4+r.length),this.atomicBytesCache.set(e,i),this.atomicCacheTxs=this.captureTransactionState(),this.atomicCacheBumps=Array.from(this.bumps),this.atomicCacheVersion=this.version,i}collectAtomicTransactions(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop();if(!(e==null||n.has(e))&&(n.add(e),!(this.hasMatchingBump(e)||e.isTxidOnly)))for(let n of e.inputTxids){let e=t.get(n);e!=null&&r.push(e)}}return n}hasMatchingBump(e){let t=e.bumpIndex;return t==null||!Number.isSafeInteger(t)||t<0||t>=this.bumps.length?!1:this.bumps[t]?.path[0]?.some(t=>t.hash===e.txid)??!1}copySelectedTransactions(t){let n=new e(this.version),r=new Map;for(let e of this.txs)t.has(e)&&this.hasMatchingBump(e)&&e.bumpIndex!=null&&(r.has(e.bumpIndex)||(r.set(e.bumpIndex,n.bumps.length),n.bumps.push(this.bumps[e.bumpIndex])));for(let e of this.txs){if(!t.has(e))continue;let i=e.bumpIndex==null?void 0:r.get(e.bumpIndex),a;a=e._rawTx==null?e._tx==null?aa.fromTxid(e.txid,i):aa.fromTx(e._tx,i):new aa(e._rawTx,i,Array.from(e.inputTxids)),n.txs.push(a)}return n}isAtomic(e=this.atomicTxid??``){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),e.length===0)return!1;let t=this.ensureTxidIndex();if(t.size!==this.txs.length)return!1;let n=t.get(e);return n!=null&&this.collectAtomicTransactions(n,t).size===this.txs.length}findTxid(e){return this.synchronizeNestedTransactionMutations(),this.findTxidIndexed(e)}findTxidIndexed(e){return this.ensureTxidIndex().get(e)}ensureTxidIndex(){return(this.txidIndex==null||this.txPositionIndex==null)&&this.rebuildTxIndexes(),this.txidIndex}ensureTxPositionIndex(){return(this.txPositionIndex==null||this.txidIndex==null)&&this.rebuildTxIndexes(),this.txPositionIndex}rebuildTxIndexes(){this.txidIndex=new Map,this.txPositionIndex=new Map;for(let e=0;e<this.txs.length;e++){let t=this.txs[e];this.txidIndex.set(t.txid,t),this.txPositionIndex.set(t.txid,e)}}deleteFromIndex(e){this.txidIndex?.delete(e),this.txPositionIndex?.delete(e)}addToIndex(e,t=this.txs.length-1){this.txidIndex?.set(e.txid,e),this.txPositionIndex?.set(e.txid,t)}replaceOrAppendTx(e){let t=this.ensureTxPositionIndex().get(e.txid);t===void 0?(this.txs.push(e),this.addToIndex(e)):(this.txs[t]=e,this.addToIndex(e,t))}makeTxidOnly(e){let t=this.ensureTxPositionIndex().get(e);if(t===void 0)return;let n=this.txs[t];return n.isTxidOnly?n:(n=aa.fromTxid(e),this.txs[t]=n,this.addToIndex(n,t),this.tryToValidateBumpIndex(n),this.markMutated(!0),n)}findBump(e){this.synchronizeNestedBumpMutations();let t=this.ensureBumpTxidIndex().get(e);return t===void 0?void 0:this.bumps[t]}ensureBumpTxidIndex(){if(this.bumpIndexByTxid==null){this.bumpIndexByTxid=new Map;for(let e=0;e<this.bumps.length;e++)for(let t of this.bumps[e].path[0])typeof t.hash==`string`&&this.bumpIndexByTxid.set(t.hash,e)}return this.bumpIndexByTxid}ensureBumpHeightIndex(){if(this.bumpIndexesByHeight==null){this.bumpIndexesByHeight=new Map;for(let e=0;e<this.bumps.length;e++){let t=this.bumps[e],n=this.bumpIndexesByHeight.get(t.blockHeight)??[];n.push(e),this.bumpIndexesByHeight.set(t.blockHeight,n)}}return this.bumpIndexesByHeight}invalidateBumpIndexes(){this.bumpIndexesByHeight=void 0,this.bumpIndexByTxid=void 0}findTransactionForSigning(e){let t=this.findTxid(e);if(t?.tx!=null){for(let e of t.tx.inputs)if(e.sourceTransaction==null){let t=this.findTxidIndexed(wn(e.sourceTXID,`sourceTXID must be valid`));t!=null&&(e.sourceTransaction=t.tx)}return t.tx}}findAtomicTransaction(e){let t=this.findTxid(e);if(t?.tx!=null)return this.addInputProof(t.tx),t.tx}addInputProof(e){let t=new Set,n=[e];for(;n.length>0;){let e=n.pop();if(e==null)continue;let r=e.id(`hex`);if(t.has(r))continue;t.add(r);let i=this.findBump(r);if(i!=null){e.merklePath=i;continue}for(let t of e.inputs)this.resolveInputSource(t),t.sourceTransaction!=null&&n.push(t.sourceTransaction)}}resolveInputSource(e){if(e.sourceTransaction==null){let t=this.findTxidIndexed(wn(e.sourceTXID,`sourceTXID must be valid`));t!=null&&(e.sourceTransaction=t.tx)}}mergeBump(e){return this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!1),this.mergeBumpEntry(e)}mergeProvenTxs(e){if(e.length===0)return[];this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!0);let t=[];for(let n of e)t.push(this.mergeRawTxEntry(n.rawTx));let n=new Map;for(let t of e){let e=t.merklePath.blockHeight;n.set(e,(n.get(e)??0)+1)}let r=new Map;for(let t=0;t<e.length;t++){let i=e[t].merklePath,a=e[t].merkleRoot,o=n.get(i.blockHeight)===1?`${i.blockHeight}:single:${t}`:`${i.blockHeight}:${a??i.computeRoot()}`,s=r.get(o);s==null?r.set(o,{first:t,paths:[i],validateCombined:a!=null}):(s.paths.push(i),s.validateCombined=s.validateCombined||a!=null)}for(let e of[...r.values()].sort((e,t)=>e.first-t.first))this.mergeBumpEntry(this.combineCompatibleBumps(e.paths,e.validateCombined));return t}combineCompatibleBumps(e,t=!1){let n=e[0];if(e.length===1&&!t)return n;let r=n.path.map(e=>new Map(e.map(e=>[e.offset,e])));for(let i=1;i<e.length;i++)oa(r,e[i],n.path.length,t);let i=r.map(e=>[...e.values()]);if(t){let e=new Xi(n.blockHeight,i);return e.trim(),e}return n.path=i,n.trim(),n}mergeBumpEntry(e){let t=this.findOrInsertBump(e),n=this.bumps[t],r=this.ensureTxidIndex();for(let e of n.path[0]){if(typeof e.hash!=`string`)continue;let i=r.get(e.hash);i!=null&&i.bumpIndex==null&&this.tryMarkTxProvenByBump(i,n,t)}return t}findOrInsertBump(e){let t=this.ensureBumpHeightIndex(),n=this.ensureBumpTxidIndex(),r=t.get(e.blockHeight)??[];if(r.length>0){let t=e.computeRoot();for(let i of r)if(this.bumps[i].computeRoot()===t)return this.bumps[i].combine(e),la(this.bumps[i],i,n),i}this.bumps.push(e);let i=this.bumps.length-1;return r.push(i),t.set(e.blockHeight,r),la(e,i,n),i}tryMarkTxProvenByBump(e,t,n){let r=e.txid;for(let i of t.path[0])if(i.hash===r){e.bumpIndex=n,i.txid=!0;break}}mergeRawTx(e,t){return this.synchronizeNestedTransactionMutations(),this.markMutated(!0),this.mergeRawTxEntry(e,t)}mergeRawTxEntry(e,t){let n=new aa(e,t);return this.replaceOrAppendTx(n),this.tryToValidateBumpIndex(n),n}mergeTransactionEntry(e){let t=new aa(e,e.merklePath==null?void 0:this.mergeBumpEntry(e.merklePath));return this.replaceOrAppendTx(t),this.tryToValidateBumpIndex(t),t}queueSourceTransactions(e,t){for(let n=e.inputs.length-1;n>=0;n--){let r=e.inputs[n].sourceTransaction;r!=null&&t.push(r)}}mergeTransaction(e){return this.synchronizeNestedTransactionMutations(),this.markMutated(!0),this.mergeTransactionGraph(e)}mergeTransactionGraph(e){e.materializeSourceTXIDs();let t=e.id(`hex`),n=new Set,r=[e],i;for(;r.length>0;){let e=r.pop();if(e==null)continue;let a=e.id(`hex`);if(n.has(a))continue;n.add(a);let o=this.mergeTransactionEntry(e);a===t&&(i=o),o.bumpIndex===void 0&&this.queueSourceTransactions(e,r)}if(i==null)throw Error(`Failed to merge root transaction`);return i}removeExistingTxid(e){let t=this.ensureTxPositionIndex().get(e);t!==void 0&&(this.txs.splice(t,1),this.rebuildTxIndexes(),this.markMutated(!0))}mergeTxidOnly(e){let t=this.findTxid(e);return t??(t=new aa(e),this.txs.push(t),this.addToIndex(t),this.tryToValidateBumpIndex(t),this.markMutated(!0)),t}mergeBeefTx(e){let t=this.findTxid(e.txid);if(e.isTxidOnly&&t==null?t=this.mergeTxidOnly(e.txid):e._tx!=null&&(t==null||t.isTxidOnly)?t=this.mergeTransaction(e._tx):e._rawTx!=null&&(t==null||t.isTxidOnly)&&(t=this.mergeRawTx(e._rawTx)),t==null)throw Error(`Failed to merge BeefTx for txid: ${e.txid}`);return t}mergeBeefTxEntry(e){let t=this.findTxidIndexed(e.txid);if(e.isTxidOnly&&t==null?(t=aa.fromTxid(e.txid),this.txs.push(t),this.addToIndex(t),this.tryToValidateBumpIndex(t)):e._tx!=null&&(t==null||t.isTxidOnly)?t=this.mergeTransactionGraph(e._tx):e._rawTx!=null&&(t==null||t.isTxidOnly)&&(t=this.mergeRawTxEntry(e._rawTx)),t==null)throw Error(`Failed to merge BeefTx for txid: ${e.txid}`);return t}mergeBeef(t){let n=t instanceof e?t:e.fromBinary(t);this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!0);for(let e of n.bumps)this.mergeBumpEntry(e);for(let e of n.txs)this.mergeBeefTxEntry(e)}isValid(e){return this.verifyValid(e).valid}async verify(e,t){let n=this.verifyValid(t);if(!n.valid)return!1;for(let t of Object.keys(n.roots))if(!await e.isValidRootForHeight(n.roots[t],Number(t)))return!1;return!0}verifyValid(e){this.synchronizeNestedBumpMutations();let t={valid:!1,roots:{}};if(this.atomicTxid!=null&&!this.isAtomic(this.atomicTxid))return t;let n=this.sortTxs();if(this.hasDuplicateTxids()||n.missingInputs.length>0||n.notValid.length>0||n.txidOnly.length>0&&e!==!0||n.withMissingInputs.length>0)return t;let r={};return!this.collectTxidOnlyTxids(r,e)||!this.collectBumpTxids(r,t)||!this.verifyBumpIndexLeaves()||!this.verifyInputDependencies(r)||(t.valid=!0),t}hasDuplicateTxids(){let e=new Set;for(let t of this.txs){if(e.has(t.txid))return!0;e.add(t.txid)}return!1}collectTxidOnlyTxids(e,t){for(let n of this.txs)if(n.isTxidOnly){if(t!==!0)return!1;e[n.txid]=!0}return!0}collectBumpTxids(e,t){for(let n of this.bumps)for(let r of n.path[0])if(r.txid===!0&&typeof r.hash==`string`&&r.hash.length!==0&&(e[r.hash]=!0,!this.confirmComputedRoot(n,r.hash,t)))return!1;return!0}verifyBumpIndexLeaves(){for(let e of this.txs)if(e.bumpIndex!==void 0&&(!Number.isSafeInteger(e.bumpIndex)||e.bumpIndex<0||e.bumpIndex>=this.bumps.length||this.bumps[e.bumpIndex]?.path[0]?.find(t=>t.hash===e.txid)==null))return!1;return!0}verifyInputDependencies(e){for(let t of this.txs){for(let n of t.inputTxids)if(!e[n])return!1;e[t.txid]=!0}return!0}confirmComputedRoot(e,t,n){let r=e.computeRoot(t);return(n.roots[e.blockHeight]===void 0||n.roots[e.blockHeight]===``)&&(n.roots[e.blockHeight]=r),n.roots[e.blockHeight]===r}toWriter(e){e.writeUInt32LE(this.version),e.writeVarIntNum(this.bumps.length);for(let t of this.bumps)e.write(e instanceof Jt?t.toBinaryUint8Array():t.toBinary());e.writeVarIntNum(this.txs.length);for(let t of this.txs)t.toWriter(e,this.version)}toBinary(){return Array.from(this.getSerializedBytes())}toUint8Array(){return this.getSerializedBytes()}toBinaryAtomic(e){return Array.from(this.getAtomicSerializedBytes(e))}toUint8ArrayAtomic(e){return this.getAtomicSerializedBytes(e)}toHex(){let e=this.getSerializedBytes();if(this.hexCache!=null)return this.hexCache;let t=en(e);return this.hexCache=t,t}static fromReader(t){let n=t.pos,r=t.readUInt32LE(),i,a=n;if(r===16843009&&(i=en(t.readReverse(32)),a=t.pos,r=t.readUInt32LE()),r!==4022206465&&r!==4022206466)throw Error(`Serialized BEEF must start with ${Zi} or ${Qi} but starts with ${r}`);let o=new e(r),s=t.readVarIntNum();for(let e=0;e<s;e++){let e=Xi.fromReader(t,!1);o.bumps.push(e)}let c=t.readVarIntNum();for(let e=0;e<c;e++){let e=aa.fromReader(t,r);o.txs.push(e)}return o.atomicTxid=i,t instanceof Yt&&(o.rawBytesCache=t.bin.subarray(a,t.pos),o.captureSerializationState()),o}static fromBinary(t){return e.fromReader(new Yt(Uint8Array.from(t)))}static fromBinaryView(t){let n=new Yt(t),r=e.fromReader(n);if(!n.eof())throw Error(`Serialized BEEF contains trailing data`);return r}static fromString(t,n=`hex`){let r=new Yt(tn(t,n));return e.fromReader(r)}tryToValidateBumpIndex(e){if(e.bumpIndex!==void 0)return!0;let t=e.txid,n=this.ensureBumpTxidIndex().get(t);if(n===void 0)return!1;e.bumpIndex=n;let r=this.bumps[n].path[0].find(e=>e.hash===t);return r!=null&&(r.txid=!0),!0}sortTxs(){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.sortResultCache!=null&&this.sortTxStateMatches())return this.cloneSortResult(this.sortResultCache);this.sortResultCache=void 0,this.sortTxState=void 0;let e={},t={},n=[],r=[],i=this.partitionTxs(t,e,n,r),{txsMissingInputs:a,missingInputs:o,remaining:s}=this.separateMissingInputs(i,t);i=s;let c=this.topoSort(i,e,n);this.txs=a.concat(c).concat(r).concat(n),this.needsSort=!1,this.invalidateSerializationCaches(),this.rebuildTxIndexes();let l={missingInputs:Object.keys(o),notValid:c.map(e=>e.txid),valid:Object.keys(e),withMissingInputs:a.map(e=>e.txid),txidOnly:r.map(e=>e.txid)};return this.sortResultCache=l,this.captureSortTxState(),this.cloneSortResult(l)}captureSortTxState(){this.sortTxState=this.txs.map(e=>({ref:e,txid:e.txid,bumpIndex:e.bumpIndex,isTxidOnly:e.isTxidOnly,inputTxids:[...e.inputTxids]}))}sortTxStateMatches(){if(this.sortTxState?.length!==this.txs.length)return!1;for(let e=0;e<this.txs.length;e++){let t=this.txs[e],n=this.sortTxState[e];if(n.ref!==t||n.txid!==t.txid||n.bumpIndex!==t.bumpIndex||n.isTxidOnly!==t.isTxidOnly||n.inputTxids.length!==t.inputTxids.length)return!1;for(let e=0;e<t.inputTxids.length;e++)if(n.inputTxids[e]!==t.inputTxids[e])return!1}return!0}cloneSortResult(e){return{missingInputs:[...e.missingInputs],notValid:[...e.notValid],valid:[...e.valid],withMissingInputs:[...e.withMissingInputs],txidOnly:[...e.txidOnly]}}partitionTxs(e,t,n,r){let i=[];for(let a of this.txs)e[a.txid]=a,a.isValid=a.hasProof,a.isValid?(t[a.txid]=!0,n.push(a)):a.isTxidOnly&&a.inputTxids.length===0?(t[a.txid]=!0,r.push(a)):i.push(a);return i}separateMissingInputs(e,t){let n={},r=[],i=[];for(let a of e){let e=!1;for(let r of a.inputTxids)t[r]===void 0&&(n[r]=!0,e=!0);e?r.push(a):i.push(a)}return{txsMissingInputs:r,missingInputs:n,remaining:i}}topoSort(e,t,n){let{indegree:r,dependents:i,originalIndex:a,round:o}=this.buildTopoSortGraph(e,t),s=this.processTopoSortQueue(e,r,i,a,o);return this.appendTopoSortResult(e,s,o,t,n),e.filter(e=>!s.has(e.txid))}buildTopoSortGraph(e,t){let n=new Set(e.map(e=>e.txid)),r=new Map,i=new Map,a=new Map(e.map((e,t)=>[e.txid,t])),o=new Map;for(let a of e){let e=0;for(let r of a.inputTxids)if(!t[r]&&(e++,n.has(r))){let e=i.get(r)??[];e.push(a),i.set(r,e)}r.set(a.txid,e),o.set(a.txid,0)}return{indegree:r,dependents:i,originalIndex:a,round:o}}processTopoSortQueue(e,t,n,r,i){let a=e.filter(e=>t.get(e.txid)===0),o=new Set;for(let e of a)if(!o.has(e.txid)){o.add(e.txid);for(let o of n.get(e.txid)??[]){let n=(i.get(e.txid)??0)+ +((r.get(e.txid)??0)>(r.get(o.txid)??0));i.set(o.txid,Math.max(i.get(o.txid)??0,n));let s=(t.get(o.txid)??0)-1;t.set(o.txid,s),s===0&&a.push(o)}}return o}appendTopoSortResult(e,t,n,r,i){let a=[];for(let r of e){if(!t.has(r.txid))continue;let e=n.get(r.txid)??0,i=a[e]??[];i.push(r),a[e]=i}for(let e of a)for(let t of e??[])r[t.txid]=!0,i.push(t)}clone(){let t=new e;return t.version=this.version,t.bumps=Array.from(this.bumps),t.txs=Array.from(this.txs),t.txidIndex=void 0,t.txPositionIndex=void 0,t.bumpIndexesByHeight=void 0,t.bumpIndexByTxid=void 0,t.needsSort=this.needsSort,t.sortResultCache=this.sortResultCache==null?void 0:this.cloneSortResult(this.sortResultCache),t.sortResultCache!=null&&t.captureSortTxState(),t.hexCache=this.hexCache,t.rawBytesCache=this.rawBytesCache,t.rawBytesCache!=null&&t.captureSerializationState(),t}trimKnownTxids(e){let t=this.removeKnownTxidOnlyTxs(new Set(e));t=this.reindexBumps()||t,t&&this.markMutated(!0)}removeKnownTxidOnlyTxs(e){let t=this.txs.length;this.txs=this.txs.filter(t=>!(t.isTxidOnly&&e.has(t.txid)));let n=this.txs.length!==t;return n&&this.rebuildTxIndexes(),n}reindexBumps(){let e=new Set;for(let t of this.txs)t.bumpIndex!==void 0&&e.add(t.bumpIndex);if(e.size>=this.bumps.length)return!1;let t=new Map,n=0;for(let r=0;r<this.bumps.length;r++)e.has(r)&&(t.set(r,n),n++);this.bumps=this.bumps.filter((t,n)=>e.has(n));for(let e of this.txs){if(e.bumpIndex===void 0)continue;let n=t.get(e.bumpIndex);if(n===void 0)throw Error(`Internal error: bumpIndex ${e.bumpIndex} not found in indexMap`);e.bumpIndex=n}return this.invalidateBumpIndexes(),!0}getValidTxids(){return this.sortTxs().valid}toLogString(){let e=``;e+=`BEEF with ${this.bumps.length} BUMPS and ${this.txs.length} Transactions, isValid ${this.isValid().toString()}\n`;let t=-1;for(let n of this.bumps)t++,e+=` BUMP ${t}\n block: ${n.blockHeight}\n txids: [\n${n.path[0].filter(e=>e.txid===!0).map(e=>` '${e.hash??``}'`).join(`,
|
|
10
|
-
`)}\n ]\n`;t=-1;for(let n of this.txs)if(t++,e+=` TX ${t}\n txid: ${n.txid}\n`,n.bumpIndex!==void 0&&(e+=` bumpIndex: ${n.bumpIndex}\n`),n.isTxidOnly?e+=` txidOnly
|
|
11
|
-
`:e+=` rawTx length=${n.rawTx?.length??0}\n`,n.inputTxids.length>0){let t=n.inputTxids.map(e=>` '${e}'`).join(`,
|
|
12
|
-
`);e+=` inputs: [\n${t}\n ]\n`}return e}addComputedLeaves(){for(let e of this.bumps)for(let t=1;t<e.path.length;t++)this.addComputedLeavesForRow(e,t)}addComputedLeavesForRow(e,t){let n=e=>en(Qe(nn(e,`hex`).reverse()).reverse());for(let r of e.path[t-1]){if(typeof r.hash!=`string`||r.offset&1)continue;let i=e.path[t-1].find(e=>e.offset===r.offset+1);if(i===void 0||typeof i.hash!=`string`)continue;let a=r.offset>>1;e.path[t].every(e=>e.offset!==a)&&e.path[t].push({offset:a,hash:n(i.hash+r.hash)})}}},da=943816,fa=class e{version;inputs;outputs;lockTime;metadata;merklePath;cachedHash;cachedIdHex;rawBytesCache;efBytesCache;hexCache;activeSignatureHashCache;rawCacheState;getSignatureHashCache(){return this.activeSignatureHashCache??{hashOutputsSingle:new Map}}completeSourceTransaction(e,t,n){for(let t of e.inputs)t.sourceTXID==null&&t.sourceTransaction!=null&&(t.sourceTXID=t.sourceTransaction.id(`hex`));t.delete(e),n.add(e)}scheduleSourceTransactions(e,t,n,r){if(t.has(e))throw Error(`Cyclic source transaction graph`);t.add(e),r.push({tx:e,expanded:!0});for(let t=e.inputs.length-1;t>=0;t--){let i=e.inputs[t].sourceTransaction;e.inputs[t].sourceTXID==null&&i!=null&&!n.has(i)&&r.push({tx:i,expanded:!1})}}materializeSourceTXIDs(){let e=new Set,t=new Set,n=[{tx:this,expanded:!1}];for(;n.length>0;){let r=n.pop();if(r!=null&&!e.has(r.tx)){if(r.expanded){this.completeSourceTransaction(r.tx,t,e);continue}this.scheduleSourceTransactions(r.tx,t,e,n)}}}static fromBEEF(t,n){let{tx:r}=e.fromAnyBeef(t,n);return r}static fromBEEFView(t,n){let{tx:r}=e.fromAnyBeef(t,n,!0);return r}static fromAtomicBEEF(t){let{tx:n,txid:r,beef:i}=e.fromAnyBeef(t);if(r!==i.atomicTxid)throw i.atomicTxid==null?Error(`beef must conform to BRC-95 and must contain the subject txid.`):Error(`Transaction with TXID ${i.atomicTxid} not found in BEEF data.`);if(!i.isAtomic(r))throw Error(`Atomic BEEF contains unrelated transaction data.`);return n}static fromAtomicBEEFView(t){let{tx:n,txid:r,beef:i}=e.fromAnyBeef(t,void 0,!0);if(r!==i.atomicTxid)throw i.atomicTxid==null?Error(`beef must conform to BRC-95 and must contain the subject txid.`):Error(`Transaction with TXID ${i.atomicTxid} not found in BEEF data.`);if(!i.isAtomic(r))throw Error(`Atomic BEEF contains unrelated transaction data.`);return n}static fromAnyBeef(e,t,n=!1){let r=n&&e instanceof Uint8Array?ua.fromBinaryView(e):ua.fromBinary(e);if(r.txs.length<1)throw Error(`beef must include at least one transaction.`);let i=r.txs.at(-1);if(i==null)throw Error(`beef must include at least one transaction.`);let a=t??r.atomicTxid??i.txid,o=r.findAtomicTransaction(a);if(o==null)throw Error(t==null?`beef does not contain transaction for atomic txid.`:`Transaction with TXID ${String(a)} not found in BEEF data.`);return{tx:o,beef:r,txid:a}}static fromEF(t){let n=Yt.makeReader(t),r=n.readUInt32LE();if(en(n.read(6))!==`0000000000ef`)throw Error(`Invalid EF marker`);let i=n.readVarIntNum(),a=[];for(let t=0;t<i;t++){let t=en(n.readReverse(32)),r=n.readUInt32LE(),i=n.readVarIntNum(),o=n.read(i),s=$r.fromBinary(o),c=n.readUInt32LE(),l=n.readUInt64LEBn().toNumber(),u=n.readVarIntNum(),d=n.read(u),f=Qr.fromBinary(d),p=new e(void 0,[],[],void 0);p.outputs=Array.from({length:r+1}).fill(null),p.outputs[r]={satoshis:l,lockingScript:f},a.push({sourceTransaction:p,sourceTXID:t,sourceOutputIndex:r,unlockingScript:s,sequence:c})}let o=n.readVarIntNum(),s=[];for(let e=0;e<o;e++){let e=n.readUInt64LEBn().toNumber(),t=n.readVarIntNum(),r=n.read(t),i=Qr.fromBinary(r);s.push({satoshis:e,lockingScript:i})}let c=n.readUInt32LE();return new e(r,a,s,c)}static parseScriptOffsets(e){let t=Yt.makeReader(e),n=[],r=[];t.pos+=4;let i=t.readVarIntNum();for(let e=0;e<i;e++){t.pos+=36;let r=t.readVarIntNum();n.push({vin:e,offset:t.pos,length:r}),t.pos+=r+4}let a=t.readVarIntNum();for(let e=0;e<a;e++){t.pos+=8;let n=t.readVarIntNum();r.push({vout:e,offset:t.pos,length:n}),t.pos+=n}return{inputs:n,outputs:r}}static fromReader(t){return e.fromReaderInternal(t,!1)}static fromReaderInternal(t,n){let r=t.readUInt32LE(),i=t.readVarIntNum(),a=[];for(let e=0;e<i;e++){let e=en(t.readReverse(32)),r=t.readUInt32LE(),i=t.readVarIntNum(),o=n&&t instanceof Yt?t.readView(i):t.read(i),s=n&&o instanceof Uint8Array?$r.fromBinaryView(o):$r.fromBinary(o),c=t.readUInt32LE();a.push({sourceTXID:e,sourceOutputIndex:r,unlockingScript:s,sequence:c})}let o=t.readVarIntNum(),s=[];for(let e=0;e<o;e++){let e=t.readUInt64LEBn().toNumber(),r=t.readVarIntNum(),i=n&&t instanceof Yt?t.readView(r):t.read(r),a=n&&i instanceof Uint8Array?Qr.fromBinaryView(i):Qr.fromBinary(i);s.push({satoshis:e,lockingScript:a})}let c=t.readUInt32LE();return new e(r,a,s,c)}static fromBinary(t){let n=Uint8Array.from(t),r=new Yt(n),i=e.fromReaderInternal(r,!0);return i.rawBytesCache=n,i.captureSerializationState(),i}static fromBinaryView(t){let n=new Yt(t),r=e.fromReaderInternal(n,!0);if(!n.eof())throw Error(`Serialized transaction contains trailing data`);return r.rawBytesCache=t,r.captureSerializationState(),r}static fromHex(t){let n=tn(t,`hex`),r=new Yt(n),i=e.fromReaderInternal(r,!0);return i.rawBytesCache=n,i.hexCache=en(n),i.captureSerializationState(),i}static fromHexEF(t){return e.fromEF(tn(t,`hex`))}static fromHexBEEF(t,n){return e.fromBEEF(nn(t,`hex`),n)}constructor(e=1,t=[],n=[],r=0,i=new Map,a){this.version=e,this.inputs=t,this.outputs=n,this.lockTime=r,this.metadata=i,this.merklePath=a}invalidateSerializationCaches(){this.cachedHash=void 0,this.cachedIdHex=void 0,this.rawBytesCache=void 0,this.efBytesCache=void 0,this.hexCache=void 0,this.rawCacheState=void 0}sourceTransactionId(e){return e.sourceTXID==null?e.sourceTransaction?.id(`hex`):void 0}captureSerializationState(){this.rawCacheState={version:this.version,lockTime:this.lockTime,inputs:this.inputs.map(e=>{let t=e.sourceTransaction?.outputs[e.sourceOutputIndex];return{ref:e,sourceTXID:e.sourceTXID,sourceTransactionId:this.sourceTransactionId(e),sourceOutputIndex:e.sourceOutputIndex,sequence:e.sequence,unlockingScript:e.unlockingScript,unlockingScriptBytes:e.unlockingScript?.toUint8Array(),sourceOutput:t,sourceSatoshis:t?.satoshis,sourceLockingScript:t?.lockingScript,sourceLockingScriptBytes:t?.lockingScript.toUint8Array()}}),outputs:this.outputs.map(e=>({ref:e,satoshis:e.satoshis,lockingScript:e.lockingScript,lockingScriptBytes:e.lockingScript.toUint8Array()}))}}serializationCacheMatchesState(){let e=this.rawCacheState;if(e?.version!==this.version||e.lockTime!==this.lockTime||e.inputs.length!==this.inputs.length||e.outputs.length!==this.outputs.length)return!1;for(let t=0;t<this.inputs.length;t++){let n=this.inputs[t],r=e.inputs[t],i=n.sourceTransaction?.outputs[n.sourceOutputIndex];if(r.ref!==n||r.sourceTXID!==n.sourceTXID||r.sourceTransactionId!==this.sourceTransactionId(n)||r.sourceOutputIndex!==n.sourceOutputIndex||r.sequence!==n.sequence||r.unlockingScript!==n.unlockingScript||r.unlockingScriptBytes!==n.unlockingScript?.toUint8Array()||r.sourceOutput!==i||r.sourceSatoshis!==i?.satoshis||r.sourceLockingScript!==i?.lockingScript||r.sourceLockingScriptBytes!==i?.lockingScript.toUint8Array())return!1}for(let t=0;t<this.outputs.length;t++){let n=this.outputs[t],r=e.outputs[t];if(r.ref!==n||r.satoshis!==n.satoshis||r.lockingScript!==n.lockingScript||r.lockingScriptBytes!==n.lockingScript.toUint8Array())return!1}return!0}addInput(e){if(e.sourceTXID===void 0&&e.sourceTransaction===void 0)throw TypeError(`A reference to an an input transaction is required. If the input transaction itself cannot be referenced, its TXID must still be provided.`);e.sequence??=4294967295,this.invalidateSerializationCaches(),this.inputs.push(e)}addOutput(e){if(this.invalidateSerializationCaches(),e.change!==!0){if(e.satoshis===void 0)throw TypeError(`either satoshis must be defined or change must be set to true`);if(e.satoshis<0)throw Error(`satoshis must be a positive integer or zero`)}if(e.lockingScript==null)throw Error(`lockingScript must be defined`);this.outputs.push(e)}addP2PKHOutput(e,t){let n=new Oi().lock(e);if(t===void 0)return this.addOutput({lockingScript:n,change:!0});this.addOutput({lockingScript:n,satoshis:t})}updateMetadata(e){this.metadata={...this.metadata,...e}}async fee(e=ji.getInstance(),t=`equal`){if(this.invalidateSerializationCaches(),typeof e==`number`){let t=e;e={computeFee:async()=>t}}let n=await e.computeFee(this),r=this.calculateChange(n);if(r<=0){this.outputs=this.outputs.filter(e=>e.change!==!0);return}this.distributeChange(r,t)}calculateChange(e){let t=0;for(let e of this.inputs){if(typeof e.sourceTransaction!=`object`)throw TypeError(`Source transactions are required for all inputs during fee computation`);t+=e.sourceTransaction.outputs[e.sourceOutputIndex].satoshis??0}t-=e;for(let e of this.outputs)e.change!==!0&&e.satoshis!==void 0&&(t-=e.satoshis);return t}distributeChange(e,t){let n=0,r=this.outputs.filter(e=>e.change);if(t===`random`?n=this.distributeRandomChange(e,r):t===`equal`&&(n=this.distributeEqualChange(e,r)),n<e){let t=this.outputs.at(-1);t.satoshis===void 0?t.satoshis=e-n:t.satoshis+=e-n}}distributeRandomChange(e,t){let n=0,r=e,i=Array.from({length:t.length}).fill(1);r-=t.length,n+=t.length;for(let e=0;e<t.length-1;e++){let t=this.benfordNumber(0,r);i[e]=i[e]+t,n+=t,r-=t}for(let e of this.outputs)e.change===!0&&(e.satoshis=i.shift());return n}distributeEqualChange(e,t){let n=0,r=Math.floor(e/t.length);for(let e of t)n+=r,e.satoshis=r;return n}benfordNumber(e,t){let n=Dr(1)[0]%9+1;return Math.floor(e+(t-e)*Math.log10(1+1/n)/Math.log10(10))}getFee(){let e=0;for(let t of this.inputs){if(typeof t.sourceTransaction!=`object`)throw TypeError(`Source transactions or sourceSatoshis are required for all inputs to calculate fee`);e+=t.sourceTransaction.outputs[t.sourceOutputIndex].satoshis??0}let t=0;for(let e of this.outputs)t+=e.satoshis??0;return e-t}async sign(e={}){this.invalidateSerializationCaches();for(let e of this.outputs)if(e.satoshis===void 0)throw e.change===!0?Error(`There are still change outputs with uncomputed amounts. Use the fee() method to compute the change amounts and transaction fees prior to signing.`):Error(`One or more transaction outputs is missing an amount. Ensure all output amounts are provided before signing.`);this.materializeSourceTXIDs();let t=this.activeSignatureHashCache;this.activeSignatureHashCache={hashOutputsSingle:new Map};let n;try{n=await Promise.all(this.inputs.map(async(t,n)=>e.skipExistingSignatures===!0&&this.inputs[n].unlockingScript!=null?this.inputs[n].unlockingScript:typeof this.inputs[n].unlockingScriptTemplate==`object`?await this.inputs[n]?.unlockingScriptTemplate?.sign(this,n):await Promise.resolve(void 0)))}finally{this.activeSignatureHashCache=t}for(let e=0,t=this.inputs.length;e<t;e++)typeof this.inputs[e].unlockingScriptTemplate==`object`&&(this.inputs[e].unlockingScript=n[e]);this.invalidateSerializationCaches()}async broadcast(e=Wi()){return await e.broadcast(this)}writeTransactionBody(e){e.writeUInt32LE(this.version),e.writeVarIntNum(this.inputs.length);for(let t of this.inputs){if(t.sourceTXID===void 0){if(t.sourceTransaction==null)throw Error(`sourceTransaction is undefined`);e.write(t.sourceTransaction.hash())}else e.writeReverse(nn(t.sourceTXID,`hex`));if(e.writeUInt32LE(t.sourceOutputIndex),t.unlockingScript==null)throw Error(`unlockingScript is undefined`);let n=t.unlockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n),e.writeUInt32LE(t.sequence??4294967295)}e.writeVarIntNum(this.outputs.length);for(let t of this.outputs){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n)}e.writeUInt32LE(this.lockTime)}buildSerializedBytes(){let e=new Jt;return this.writeTransactionBody(e),e.toUint8Array()}getSerializedBytes(){return(this.rawBytesCache==null||!this.serializationCacheMatchesState())&&(this.invalidateSerializationCaches(),this.rawBytesCache=this.buildSerializedBytes(),this.captureSerializationState()),this.rawBytesCache}toBinary(){return Array.from(this.getSerializedBytes())}toUint8Array(){return this.getSerializedBytes()}writeEF(e){e.writeUInt32LE(this.version),e.write([0,0,0,0,0,239]),e.writeVarIntNum(this.inputs.length);for(let t of this.inputs){if(t.sourceTransaction===void 0)throw TypeError(`All inputs must have source transactions when serializing to EF format`);if(t.sourceTXID===void 0?e.write(t.sourceTransaction.hash()):e.write(nn(t.sourceTXID,`hex`).reverse()),e.writeUInt32LE(t.sourceOutputIndex),t.unlockingScript==null)throw Error(`unlockingScript is undefined`);let n=t.unlockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n),e.writeUInt32LE(t.sequence??4294967295),e.writeUInt64LE(t.sourceTransaction.outputs[t.sourceOutputIndex].satoshis??0);let r=t.sourceTransaction.outputs[t.sourceOutputIndex].lockingScript.toUint8Array();e.writeVarIntNum(r.length),e.write(r)}e.writeVarIntNum(this.outputs.length);for(let t of this.outputs){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n)}e.writeUInt32LE(this.lockTime)}toEF(){return Array.from(this.getEFBytes())}toEFUint8Array(){return this.toEFBinary()}getEFBytes(){if(this.efBytesCache==null||!this.serializationCacheMatchesState()){this.invalidateSerializationCaches();let e=new Jt;this.writeEF(e),this.efBytesCache=e.toUint8Array(),this.captureSerializationState()}return this.efBytesCache}toEFBinary(){return this.getEFBytes()}toHexEF(){return en(this.toEFBinary())}toHex(){let e=this.getSerializedBytes();if(this.hexCache!=null)return this.hexCache;let t=en(e);return this.hexCache=t,t}toHexBEEF(){return en(this.toBEEF())}toHexAtomicBEEF(){return en(this.toAtomicBEEF())}hash(e){let t=this.getSerializedBytes();return this.cachedHash??=Qe(t),e===`hex`?en(this.cachedHash):Array.from(this.cachedHash)}id(e){if(this.getSerializedBytes(),e===`hex`&&this.cachedIdHex!=null)return this.cachedIdHex;let t=[...this.hash()];return t.reverse(),e===`hex`?(this.cachedIdHex=en(t),this.cachedIdHex):t}async completeVerificationFromMerklePath(e,t,n,r,i,a){if(typeof e.merklePath!=`object`)return!1;if(t)return i.add(e),!0;if(await e.merklePath.verify(r(),n))return a.add(r()),!0;throw Error(`Invalid merkle path for transaction ${r()}`)}async verifyTransactionFee(t,n,r){if(n===void 0)return;if(t===void 0)throw Error(`Transaction is undefined`);let i=e.fromEF(t.toEF());if(delete i.outputs[0].satoshis,i.outputs[0].change=!0,await i.fee(n),t.getFee()<i.getFee())throw Error(`Verification failed because the transaction ${r()} has an insufficient fee and has not been mined.`)}queueSourceTransactionForVerification(e,t,n){if(n.scriptsOnly){!n.verifiedTransactions.has(e)&&!n.queuedTransactions.has(e)&&(n.txQueue.push(e),n.queuedTransactions.add(e));return}!n.verifiedTxids.has(t)&&!n.queuedTxids.has(t)&&(n.txQueue.push(e),n.queuedTxids.add(t))}verifyTransactionInputs(e,t,n,r){let i=0,a={hashOutputsSingle:new Map};for(let o=0;o<e.inputs.length;o++){let s=e.inputs[o];if(typeof s.sourceTransaction!=`object`)throw TypeError(`Verification failed because the input at index ${o} of transaction ${n()} is missing an associated source transaction. This source transaction is required for transaction verification because there is no merkle proof for the transaction spending a UTXO it contains.`);if(typeof s.unlockingScript!=`object`)throw TypeError(`Verification failed because the input at index ${o} of transaction ${n()} is missing an associated unlocking script. This script is required for transaction verification because there is no merkle proof for the transaction spending the UTXO.`);let c=s.sourceTransaction,l=c.outputs[s.sourceOutputIndex];i+=l.satoshis??0;let u=r.scriptsOnly&&s.sourceTXID!==void 0?s.sourceTXID:c.id(`hex`);if(this.queueSourceTransactionForVerification(c,u,r),s.sourceTXID??=u,!t&&!new wi({sourceTXID:s.sourceTXID,sourceOutputIndex:s.sourceOutputIndex,lockingScript:l.lockingScript,sourceSatoshis:l.satoshis??0,transactionVersion:e.version,otherInputs:[],allInputs:e.inputs,unlockingScript:s.unlockingScript,inputSequence:s.sequence??4294967295,inputIndex:o,outputs:e.outputs,lockTime:e.lockTime,memoryLimit:r.memoryLimit,sigHashCache:a}).validateJavaScript())return{valid:!1,inputTotal:i}}return{valid:!0,inputTotal:i}}totalVerifiedOutputs(e){let t=0;for(let n of e.outputs){if(typeof n.satoshis!=`number`)throw TypeError(`Every output must have a defined amount during transaction verification.`);t+=n.satoshis}return t}async verifyQueuedScripts(e,t){if(e.length===0||t===void 0)return;let n=t.verifyScriptsBatch===void 0?await Promise.all(e.map(async e=>await t.verifyScripts(e))):await t.verifyScriptsBatch(e);if(n.length!==e.length)throw Error(`Script verifier returned an invalid batch result count`);let r=n.findIndex(e=>!e);if(r>=0)throw Error(`Script verification failed for transaction ${e[r].tx.id(`hex`)}`)}isTransactionAlreadyVerified(e,t,n){return n.scriptsOnly?n.verifiedTransactions.has(e):n.verifiedTxids.has(t())}async verifyUnminedTransaction(e,t,n){let{feeModel:r,memoryLimit:i,selectedVerifier:a,verifierQueue:o}=n;await this.verifyTransactionFee(e,r,t);let s={tx:e,blockHeight:da,consensus:!0,...i===void 0?{}:{memoryLimit:i}},c=a!==void 0&&(i===void 0||a.supportsMemoryLimit===!0)&&(a.shouldVerifyScripts?.(s)??!0),l=this.verifyTransactionInputs(e,c,t,n);return!l.valid||(c&&o.push(s),this.totalVerifiedOutputs(e)>l.inputTotal)?!1:(n.scriptsOnly?n.verifiedTransactions.add(e):n.verifiedTxids.add(t()),!0)}async verify(e=Ki(),t,n,r){let i=e===`scripts only`,a=r??ii();i||this.materializeSourceTXIDs();let o=new Set,s=new Set,c=[this],l=new Set;i||l.add(this.id(`hex`));let u=new Set(c),d=[],f={scriptsOnly:i,memoryLimit:n,txQueue:c,queuedTransactions:u,queuedTxids:l,verifiedTransactions:s,verifiedTxids:o,feeModel:t,selectedVerifier:a,verifierQueue:d},p=0;for(;p<c.length;){let t=c[p++],n,r=()=>(n??=t.id(`hex`),n);if(!this.isTransactionAlreadyVerified(t,r,f)&&!await this.completeVerificationFromMerklePath(t,i,e,r,s,o)&&!await this.verifyUnminedTransaction(t,r,f))return!1}return await this.verifyQueuedScripts(d,a),!0}writeSerializedBEEF(e,t){this.materializeSourceTXIDs(),e.writeUInt32LE(Zi);let{bumps:n,txs:r}=this.collectBEEFTransactions(t);e.writeVarIntNum(n.length);let i=this.reserveBEEFWriter(e,n,r);for(let t=0;t<n.length;t++)e.write(i?.[t]??n[t].toBinary());e.writeVarIntNum(r.length);for(let t of r)e.write(t.tx.toUint8Array()),typeof t.pathIndex==`number`?(e.writeUInt8(1),e.writeVarIntNum(t.pathIndex)):e.writeUInt8(0)}collectBEEFTransactions(e){let t=[],n=new Map,r=new Map,i=[],a=new Set,o=new Set,s=[{tx:this,expanded:!1}];for(;s.length>0;){let c=s.pop();if(c!=null){if(c.expanded){this.appendBEEFTransaction(c.tx,a,i,t,n,r);continue}this.scheduleBEEFTransaction(c.tx,e,o,s)}}return{bumps:t,txs:i}}appendBEEFTransaction(e,t,n,r,i,a){let o=e.id(`hex`);if(t.has(o))return;let s={tx:e};e.merklePath!=null&&(s.pathIndex=this.getBEEFPathIndex(e.merklePath,r,i,a)),t.add(o),n.push(s)}scheduleBEEFTransaction(e,t,n,r){let i=e.id(`hex`);if(!n.has(i)&&(n.add(i),r.push({tx:e,expanded:!0}),e.merklePath==null))for(let n of e.inputs){let e=n.sourceTransaction;if(e!=null)r.push({tx:e,expanded:!1});else if(t===!1)throw Error(`A required source transaction is missing!`)}}getBEEFPathIndex(e,t,n,r){let i=n.get(e);if(i!==void 0)return i;let a=`${e.blockHeight}:${e.computeRoot()}`,o=r.get(a);if(o!==void 0)return t[o].combine(e),n.set(e,o),o;let s=t.length;return t.push(e),n.set(e,s),r.set(a,s),s}reserveBEEFWriter(e,t,n){let r;if(e instanceof Jt){r=t.map(e=>e.toBinaryUint8Array());let i=16;for(let e of r)i+=e.length;for(let e of n)i+=e.tx.toUint8Array().length+10;e.reserve(i)}return r}toBEEF(e){let t=new yn;return this.writeSerializedBEEF(t,e),t.toArray()}toBEEFUint8Array(e){let t=new Jt;return this.writeSerializedBEEF(t,e),t.toArray()}toBEEFBytes(e){let t=new Jt;return this.writeSerializedBEEF(t,e),t.toUint8Array()}toAtomicBEEF(e){this.materializeSourceTXIDs();let t=[1,1,1,1],n=this.hash(),r=this.toBEEF(e);return t.concat(n,r)}toAtomicBEEFUint8Array(e){this.materializeSourceTXIDs();let t=new Jt;t.write([1,1,1,1]);let n=this.hash();return t.write(n),this.writeSerializedBEEF(t,e),t.toUint8Array()}async completeWithWallet(t,n,r,i){let a=this.inputs.length,o=this.outputs.length,s=n??`Transaction with ${a} input(s) and ${o} output(s)`,c=this.inputs.some(e=>e.unlockingScriptTemplate!=null),l=await this.buildWalletActionArgs(s,c),u=c?await this.completeWalletTemplateAction(t,l,r,i):await this.completeWalletScriptAction(t,l,r,i),d=e.fromAtomicBEEF(u);this.version=d.version,this.inputs=d.inputs,this.outputs=d.outputs,this.lockTime=d.lockTime,this.merklePath=d.merklePath,this.invalidateSerializationCaches(),this.metadata={...this.metadata,...d.metadata}}async buildWalletActionArgs(e,t){let n={description:e,inputs:[],outputs:[],lockTime:this.lockTime,version:this.version};this.materializeSourceTXIDs();let r=new ua;for(let e=0;e<this.inputs.length;e++){let i=this.inputs[e];if(i.sourceTransaction==null)throw Error(`All inputs must have a sourceTransaction when using completeWithWallet`);r.mergeTransaction(i.sourceTransaction),n.inputs.push(await this.buildWalletInputArg(i,e,t))}return this.inputs.length>0&&(n.inputBEEF=r.toUint8Array()),n.outputs=this.outputs.map(e=>({satoshis:e.satoshis,lockingScript:e.lockingScript.toHex(),outputDescription:`Output from source transaction`})),Array.isArray(this.metadata?.labels)&&(n.labels=this.metadata.labels),n}async buildWalletInputArg(e,t,n){let r={outpoint:`${e.sourceTransaction.id(`hex`)}.${e.sourceOutputIndex}`,inputDescription:`Input from source transaction`,sequenceNumber:e.sequence};if(!n){if(e.unlockingScript==null)throw Error(`All inputs must have an unlockingScript when using completeWithWallet`);return r.unlockingScript=e.unlockingScript.toHex(),r}if(e.unlockingScriptTemplate!=null)r.unlockingScriptLength=await e.unlockingScriptTemplate.estimateLength(this,t);else if(e.unlockingScript!=null)r.unlockingScript=e.unlockingScript.toHex();else throw Error(`Input ${t} must have either an unlockingScript or unlockingScriptTemplate`);return r}async completeWalletTemplateAction(t,n,r,i){n.options={...i,signAndProcess:!1};let{signableTransaction:a}=await t.createAction(n,r);if(a==null)throw Error(`Wallet createAction did not return signableTransaction`);let o=e.fromBEEF(a.tx),s=await this.buildWalletSpends(o),c=i==null?void 0:{acceptDelayedBroadcast:i.acceptDelayedBroadcast,returnTXIDOnly:i.returnTXIDOnly,noSend:i.noSend,sendWith:i.sendWith},l=await t.signAction({reference:a.reference,spends:s,options:c},r);if(l.tx==null)throw Error(`Wallet signAction did not return transaction data`);return l.tx}async buildWalletSpends(e){let t={};for(let n=0;n<this.inputs.length;n++){let r=this.inputs[n];if(r.unlockingScriptTemplate!=null){let i=await r.unlockingScriptTemplate.sign(e,n);t[n]={unlockingScript:i.toHex()}}else r.unlockingScript!=null&&(t[n]={unlockingScript:r.unlockingScript.toHex()})}return t}async completeWalletScriptAction(e,t,n,r){r!=null&&(t.options=r);let{tx:i}=await e.createAction(t,n);if(i==null)throw Error(`Wallet createAction did not return transaction data`);return i}preimage(e,t,n){if(e??=0,t??=Jr.SIGHASH_FORKID|Jr.SIGHASH_ALL,e<0||e>=this.inputs.length)throw Error(`Invalid input index`);let r=t&240;if(r!==224&&r!==192&&r!==64)throw Error(`FORKID must be set`);let i=t&15;if(i<1||i>3)throw Error(`Invalid signature coverage, must be all, none or single`);let a=this.inputs[e];if(a.sourceTransaction==null)throw Error(`Source transaction is required`);let o=a.sourceTransaction.outputs[a.sourceOutputIndex];if(o==null)throw Error(`Source transaction's output at index ${a.sourceOutputIndex} is required`);return Jr.format({sourceTXID:a.sourceTXID??a.sourceTransaction.id(`hex`),sourceOutputIndex:a.sourceOutputIndex,sourceSatoshis:o.satoshis,transactionVersion:this.version,otherInputs:[],allInputs:this.inputs,inputIndex:e,outputs:this.outputs,inputSequence:a.sequence??4294967295,subscript:n??o.lockingScript,lockTime:this.lockTime,scope:t})}},A=s(),pa=d(),ma=n({BIGINT_FORMAT_RANGES:()=>Qa,CONSTANT_CATCH:()=>Po,Class:()=>wo,NUMBER_FORMAT_RANGES:()=>Za,aborted:()=>oo,allowsEval:()=>Ba,assert:()=>ba,assertEqual:()=>ha,assertIs:()=>va,assertNever:()=>ya,assertNotEqual:()=>ga,assignProp:()=>Aa,attachSchema:()=>uo,base64ToUint8Array:()=>F,base64urlToUint8Array:()=>bo,cached:()=>Ca,captureStackTrace:()=>Ra,cleanEnum:()=>vo,cleanRegex:()=>Ta,clone:()=>Ja,cloneDef:()=>Ma,codePointLength:()=>ho,constantCatch:()=>Fo,createTransparentProxy:()=>Ya,defineLazy:()=>Oa,defineLazyInternal:()=>I,esc:()=>Ia,escapeRegex:()=>qa,explicitlyAborted:()=>so,extend:()=>to,finalizeIssue:()=>fo,floatSafeRemainder:()=>Ea,getElementAtPath:()=>Na,getEnumValues:()=>xa,getLengthableOrigin:()=>go,getParsedType:()=>Wa,getSizableOrigin:()=>po,hexToUint8Array:()=>So,hide:()=>Do,installLazyProp:()=>No,isObject:()=>za,isPlainObject:()=>Va,issue:()=>_o,joinValues:()=>j,jsonStringifyReplacer:()=>Sa,members:()=>To,merge:()=>ro,mergeDefs:()=>ja,normalizeParams:()=>M,nullish:()=>wa,numKeys:()=>Ua,objectClone:()=>ka,omit:()=>eo,optionalKeys:()=>Xa,own:()=>Eo,parsedType:()=>P,partial:()=>io,pick:()=>$a,prefixIssues:()=>co,primitiveTypes:()=>Ka,promiseAllObject:()=>Pa,propertyKeyTypes:()=>Ga,randomString:()=>Fa,required:()=>ao,safeExtend:()=>no,shallowClone:()=>Ha,slugify:()=>La,stringifyPrimitive:()=>N,toZod:()=>_a,uint8ArrayToBase64:()=>yo,uint8ArrayToBase64url:()=>xo,uint8ArrayToHex:()=>Co,unwrapMessage:()=>lo});function ha(e){return e}function ga(e){return e}function _a(){return e=>e}function va(e){}function ya(e){throw Error(`Unexpected value in exhaustive check`)}function ba(e){}function xa(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function j(e,t=`|`){return e.map(e=>N(e)).join(t)}function Sa(e,t){return typeof t==`bigint`?t.toString():t}function Ca(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function wa(e){return e==null}function Ta(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ea(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Da=Symbol(`evaluating`);function Oa(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Da)return r===void 0&&(r=Da,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ka(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Aa(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ja(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ma(e){return ja(e._zod.def)}function Na(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function Pa(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function Fa(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Ia(e){return JSON.stringify(e)}function La(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ra=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function za(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ba=Ca(()=>{if(Wo.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Va(e){if(za(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return za(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ha(e){return Va(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Ua(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Wa=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Ga=new Set([`string`,`number`,`symbol`]),Ka=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function qa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ja(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function M(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ya(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function N(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Xa(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Za={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Qa={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function $a(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ja(e,ja(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&Aa(e,r,n.shape[r])}return Aa(this,`shape`,e),e},checks:[]}))}function eo(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ja(e,ja(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return Aa(this,`shape`,r),r},checks:[]}))}function to(e,t){if(!Va(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ja(e,ja(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Aa(this,`shape`,n),n}}))}function no(e,t){if(!Va(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ja(e,ja(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Aa(this,`shape`,n),n}}))}function ro(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Ja(e,ja(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Aa(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function io(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return Ja(t,ja(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Aa(this,`shape`,i),i},checks:[]}))}function ao(e,t,n){return Ja(t,ja(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return Aa(this,`shape`,i),i}}))}function oo(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function so(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function co(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function lo(e){return typeof e==`string`?e:e?.message}function uo(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function fo(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:lo(e.inst?._zod.def?.error?.(e))??lo(a?.(e))??lo(t?.error?.(e))??lo(n.customError?.(e))??lo(n.localeError?.(e))??`Invalid input`,{inst:s,schema:c,continue:l,input:u,...d}=e;return d.path??=[],d.message=o,t?.reportInput&&(d.input=u),d}function po(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}var mo=/[\uD800-\uDBFF]/;function ho(e){let t=e.length;if(!mo.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function go(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function P(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function _o(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function vo(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function F(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function yo(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function bo(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return F(t+`=`.repeat((4-t.length%4)%4))}function xo(e){return yo(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function So(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function Co(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var wo=class{constructor(...e){}};function To(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Oo(e,n,r.value)}}function Eo(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Do(e,t,n){return Eo(e,t,n,!1)}function Oo(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Eo(this,t,n.bind(this))},set(e){Eo(this,t,e)}})}function ko(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Ao,jo=!1,Mo={configurable:!0,get(){jo=!0}};function I(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Ao!==e._zod){Ao=void 0;return}Ao=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Mo);let e=jo;jo=!1;try{let r=n(this);return jo?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),jo||=e,r}catch(n){throw delete this[t],jo||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function No(e,t,n,r){let i=ko(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Po=`~constantCatch`;function Fo(e){let t=()=>e;return t[Po]=!0,t}var Io,Lo=Object.freeze({status:`aborted`}),Ro={value:void 0,enumerable:!1},zo=`captureStackTrace`in Error?Error:null;function Bo(e){let t=zo;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return zo=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function L(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ro.value=new a(r);try{Object.defineProperty(n,"_zod",Ro)}finally{Ro.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),To(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Bo(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Vo=Symbol(`zod_brand`),Ho=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Uo=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Io=globalThis).__zod_globalConfig??(Io.__zod_globalConfig={});var Wo=globalThis.__zod_globalConfig;function Go(e){return e&&Object.assign(Wo,e),Wo}function Ko(){let e=this._zod;return e.message??=JSON.stringify(e.def,Sa,2),e.message}function qo(e){this._zod.message=e}var Jo={get:Ko,set:qo,enumerable:!0,configurable:!0},Yo={value:void 0,enumerable:!1},Xo={value:void 0,enumerable:!1},Zo=new WeakSet([Object.prototype,Error.prototype]),Qo=(e,t)=>{e.name=`$ZodError`,Yo.value=e._zod,Object.defineProperty(e,"_zod",Yo),Xo.value=t,Object.defineProperty(e,"issues",Xo),Yo.value=void 0,Xo.value=void 0,Object.defineProperty(e,"message",Jo);let n=Object.getPrototypeOf(e);Zo.has(n)||(Zo.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},$o=L(`$ZodError`,Qo),es=L(`$ZodError`,Qo,void 0,{Parent:Error});function ts(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ns(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ts(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function rs(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function is(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a;for(let o of e.issues)if(o.code===`invalid_union`&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if(o.code===`invalid_key`)r({issues:o.issues},[...i,...o.path]);else if(o.code===`invalid_element`)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(e.length===0){n.errors.push(t(o));continue}let r=n,s=0;for(;s<e.length;){let n=e[s],i=s===e.length-1;typeof n==`string`?(r.properties??(r.properties={}),Object.prototype.hasOwnProperty.call(r.properties,n)||Object.defineProperty(r.properties,n,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),r=r.properties[n]):(r.items??(r.items=[]),(a=r.items)[n]??(a[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(o)),s++}}};return r(e),n}function as(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function os(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${as(e.path)}`);return t.join(`
|
|
13
|
-
`)}function ss(e,t){return{callee:t?.callee??e,Err:t?.Err}}var cs=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Ho;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>fo(e,o,Go())));throw Ra(n,a?.callee??t),n}return s.value};return t},ls=cs(es),us=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>fo(e,o,Go())));throw Ra(n,a?.callee??t),n}return s.value};return t},ds=us(es),fs=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ho;return a.issues.length?{success:!1,error:new(e??$o)(a.issues.map(e=>fo(e,i,Go())))}:{success:!0,data:a.value}},ps=fs(es),ms=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>fo(e,i,Go())))}:{success:!0,data:a.value}},hs=ms(es),gs=Symbol.for(`zod.compile.invalid`),_s=Symbol.for(`zod.compile.fallback`),vs=((e,t,n)=>{let r=e._zod.bag.validator;return r!==void 0&&r(t)!==gs||ys(e,t,n)});function ys(e,t,n){let r=n?{...n,async:!1}:{async:!1},i=e._zod.bag.fallbackRun,a;if(i?(r[_s]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Ho;return a.issues.length===0}var bs=async(e,t,n)=>{let r=n?{...n,async:!0}:{async:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},xs=e=>{let t=cs(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ss(n,a))};return n},Ss=xs(es),Cs=e=>{let t=cs(e),n=(e,r,i,a)=>t(e,r,i,ss(n,a));return n},ws=Cs(es),Ts=e=>{let t=us(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ss(n,a))};return n},Es=Ts(es),Ds=e=>{let t=us(e),n=async(e,r,i,a)=>await t(e,r,i,ss(n,a));return n},Os=Ds(es),ks=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return fs(e)(t,n,i)},As=ks(es),js=e=>(t,n,r)=>fs(e)(t,n,r),Ms=js(es),Ns=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ms(e)(t,n,i)},Ps=Ns(es),Fs=e=>async(t,n,r)=>ms(e)(t,n,r),Is=Fs(es),Ls=n({base64:()=>dc,base64url:()=>fc,bigint:()=>Tc,boolean:()=>Oc,browserEmail:()=>rc,cidrv4:()=>lc,cidrv6:()=>uc,creditCard:()=>_c,cuid:()=>Rs,cuid2:()=>zs,date:()=>bc,datetime:()=>Cc,domain:()=>mc,duration:()=>Gs,e164:()=>gc,email:()=>Qs,emoji:()=>ac,extendedDuration:()=>Ks,guid:()=>qs,hex:()=>Nc,hostname:()=>pc,html5Email:()=>$s,httpProtocol:()=>hc,idnEmail:()=>nc,integer:()=>Ec,ipv4:()=>oc,ipv6:()=>sc,ksuid:()=>Hs,lowercase:()=>jc,mac:()=>cc,md5_base64:()=>Lc,md5_base64url:()=>Rc,md5_hex:()=>Ic,nanoid:()=>Us,nanoidOfLength:()=>Ws,null:()=>kc,number:()=>Dc,rfc5322Email:()=>ec,sha1_base64:()=>Bc,sha1_base64url:()=>Vc,sha1_hex:()=>zc,sha256_base64:()=>Uc,sha256_base64url:()=>Wc,sha256_hex:()=>Hc,sha384_base64:()=>Kc,sha384_base64url:()=>qc,sha384_hex:()=>Gc,sha512_base64:()=>Yc,sha512_base64url:()=>Xc,sha512_hex:()=>Jc,string:()=>wc,time:()=>Sc,ulid:()=>Bs,undefined:()=>Ac,unicodeEmail:()=>tc,uppercase:()=>Mc,uuid:()=>Js,uuid4:()=>Ys,uuid6:()=>Xs,uuid7:()=>Zs,xid:()=>Vs}),Rs=/^[cC][0-9a-z]{6,}$/,zs=/^[0-9a-z]+$/,Bs=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Vs=/^[0-9a-vA-V]{20}$/,Hs=/^[A-Za-z0-9]{27}$/,Us=/^[a-zA-Z0-9_-]{21}$/;function Ws(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Gs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ks=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Js=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ys=Js(4),Xs=Js(6),Zs=Js(7),Qs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$s=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ec=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,tc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,nc=tc,rc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ic=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function ac(){return new RegExp(ic,`u`)}var oc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,cc=e=>{let t=qa(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},lc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,uc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fc=/^[A-Za-z0-9_-]*$/,pc=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,mc=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,hc=/^https?$/,gc=/^\+[1-9]\d{6,14}$/,_c=/^\d(?:[ -]?\d){11,18}$/,vc=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function yc(e){return RegExp(`^${e}$`)}var bc=yc(vc);function xc(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Sc(e){return RegExp(`^${xc(e)}$`)}function Cc(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${xc({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${xc({precision:e.precision})}`:n;return RegExp(`^${vc}T(?:${r})$`)}var wc=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Tc=/^-?\d+n?$/,Ec=/^-?\d+$/,Dc=/^-?\d+(?:\.\d+)?$/,Oc=/^(?:true|false)$/i,kc=/^null$/i,Ac=/^undefined$/i,jc=/^[^A-Z]*$/,Mc=/^[^a-z]*$/,Nc=/^[0-9a-fA-F]*$/;function Pc(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Fc(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ic=/^[0-9a-fA-F]{32}$/,Lc=Pc(22,`==`),Rc=Fc(22),zc=/^[0-9a-fA-F]{40}$/,Bc=Pc(27,`=`),Vc=Fc(27),Hc=/^[0-9a-fA-F]{64}$/,Uc=Pc(43,`=`),Wc=Fc(43),Gc=/^[0-9a-fA-F]{96}$/,Kc=Pc(64,``),qc=Fc(64),Jc=/^[0-9a-fA-F]{128}$/,Yc=Pc(86,`==`),Xc=Fc(86),Zc=L(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qc=e=>{let t=e.value;return!wa(t)&&t.size!==void 0},$c=e=>{let t=e.value;return!wa(t)&&t.length!==void 0},el={number:`number`,bigint:`bigint`,object:`date`},tl=L(`$ZodCheckLessThan`,(e,t)=>{Zc.init(e,t);let n=el[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:el[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nl=L(`$ZodCheckGreaterThan`,(e,t)=>{Zc.init(e,t);let n=el[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:el[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rl=L(`$ZodCheckMultipleOf`,(e,t)=>{Zc.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Ea(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),il=L(`$ZodCheckNumberFormat`,(e,t)=>{Zc.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Za[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Ec)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),al=L(`$ZodCheckBigIntFormat`,(e,t)=>{Zc.init(e,t);let[n,r]=Qa[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),ol=L(`$ZodCheckMaxSize`,(e,t)=>{var n;Zc.init(e,t),(n=e._zod.def).when??(n.when=Qc),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:po(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sl=L(`$ZodCheckMinSize`,(e,t)=>{var n;Zc.init(e,t),(n=e._zod.def).when??(n.when=Qc),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:po(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cl=L(`$ZodCheckSizeEquals`,(e,t)=>{var n;Zc.init(e,t),(n=e._zod.def).when??(n.when=Qc),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:po(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ll=L(`$ZodCheckMaxLength`,(e,t)=>{var n;Zc.init(e,t),(n=e._zod.def).when??(n.when=$c),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?ho(r):i)<=t.maximum)return;let a=go(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ul=L(`$ZodCheckMinLength`,(e,t)=>{var n;Zc.init(e,t),(n=e._zod.def).when??(n.when=$c),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?ho(r):i)>=t.minimum)return;let a=go(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dl=L(`$ZodCheckLengthEquals`,(e,t)=>{var n;Zc.init(e,t),(n=e._zod.def).when??(n.when=$c),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?ho(r):i;if(a===t.length)return;let o=go(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),fl=L(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Zc.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),pl=L(`$ZodCheckRegex`,(e,t)=>{fl.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ml=L(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=jc,fl.init(e,t)}),hl=L(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Mc,fl.init(e,t)}),gl=L(`$ZodCheckIncludes`,(e,t)=>{Zc.init(e,t);let n=qa(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),_l=L(`$ZodCheckStartsWith`,(e,t)=>{Zc.init(e,t);let n=RegExp(`^${qa(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),vl=L(`$ZodCheckEndsWith`,(e,t)=>{Zc.init(e,t);let n=RegExp(`.*${qa(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function yl(e,t,n){e.issues.length&&t.issues.push(...co(n,e.issues))}var bl=L(`$ZodCheckProperty`,(e,t)=>{Zc.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>yl(n,e,t.property));yl(n,e,t.property)}}),xl=L(`$ZodCheckMimeType`,(e,t)=>{Zc.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Sl=L(`$ZodCheckOverwrite`,(e,t)=>{Zc.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Cl=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
14
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
15
|
-
`)}\n};`)(...Object.values(this.closed))}},wl={major:4,minor:5,patch:4},R=L(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wl;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=oo(t),a;for(let o of n){if(o._zod.def.when){if(so(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Ho;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(uo(t.issues,n,e),i||=oo(t,n))});else{if(t.issues.length===n)continue;uo(t.issues,n,e),i||=oo(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(oo(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Ho;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Ho;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Do(this,`~standard`,El(this))},set"~standard"(e){Eo(this,`~standard`,e)}}),Tl=e=>e.success?{value:e.data}:{issues:e.error?.issues};function El(e){return{validate:t=>{try{return Tl(ps(e,t))}catch{return hs(e,t).then(Tl)}},vendor:`zod`,version:1}}var Dl=L(`$ZodString`,(e,t)=>{R.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wc(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Ol=L(`$ZodStringFormat`,(e,t)=>{fl.init(e,t),Dl.init(e,t)}),kl=L(`$ZodGUID`,(e,t)=>{t.pattern??=qs,Ol.init(e,t)}),Al=L(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Js(e)}else t.pattern??=Js();Ol.init(e,t)}),jl=L(`$ZodEmail`,(e,t)=>{t.pattern??=Qs,Ol.init(e,t)});function Ml(e,t){if(!t.normalize&&t.protocol?.source===hc.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var Nl=/[\t\n\r]/g;function Pl(e){return e.replace(Nl,``)}function Fl(e,t){return t.lastIndex=0,t.test(e.hostname)}function Il(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Ll=L(`$ZodURL`,(e,t)=>{Ol.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Ml(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Fl(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Il(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Pl(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Rl=L(`$ZodEmoji`,(e,t)=>{t.pattern??=ac(),Ol.init(e,t)}),zl=L(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Us:Ws(t.length),Ol.init(e,t)}),Bl=L(`$ZodCUID`,(e,t)=>{t.pattern??=Rs,Ol.init(e,t)}),Vl=L(`$ZodCUID2`,(e,t)=>{t.pattern??=zs,Ol.init(e,t)}),Hl=L(`$ZodULID`,(e,t)=>{t.pattern??=Bs,Ol.init(e,t)}),Ul=L(`$ZodXID`,(e,t)=>{t.pattern??=Vs,Ol.init(e,t)}),Wl=L(`$ZodKSUID`,(e,t)=>{t.pattern??=Hs,Ol.init(e,t)}),Gl=L(`$ZodISODateTime`,(e,t)=>{t.pattern??=Cc(t),Ol.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),Kl=L(`$ZodISODate`,(e,t)=>{t.pattern??=bc,Ol.init(e,t)}),ql=L(`$ZodISOTime`,(e,t)=>{t.pattern??=Sc(t),Ol.init(e,t)}),z=L(`$ZodISODuration`,(e,t)=>{t.pattern??=Gs,Ol.init(e,t)}),B=L(`$ZodIPv4`,(e,t)=>{t.pattern??=oc,Ol.init(e,t),e._zod.bag.format=`ipv4`}),Jl=/^[0-9a-fA-F:.]+$/;function Yl(e){if(!Jl.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Xl=L(`$ZodIPv6`,(e,t)=>{t.pattern??=sc,Ol.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{Yl(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Zl=L(`$ZodMAC`,(e,t)=>{t.pattern??=cc(t.delimiter),Ol.init(e,t),e._zod.bag.format=`mac`}),Ql=L(`$ZodCIDRv4`,(e,t)=>{t.pattern??=lc,Ol.init(e,t)});function $l(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Yl(n)}var eu=L(`$ZodCIDRv6`,(e,t)=>{t.pattern??=uc,Ol.init(e,t),e._zod.check=n=>{$l(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function tu(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var nu=L(`$ZodBase64`,(e,t)=>{t.pattern??=dc,Ol.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{tu(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ru(e){if(!fc.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return tu(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var iu=L(`$ZodBase64URL`,(e,t)=>{t.pattern??=fc,Ol.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ru(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),au=L(`$ZodE164`,(e,t)=>{t.pattern??=gc,Ol.init(e,t)}),ou=/[- ]/g;function su(e){let t=e.length,n=1,r=0;for(;t;){let i=+e[--t];n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10==0}function cu(e){return _c.test(e)?su(e.replace(ou,``)):!1}var lu=L(`$ZodCreditCard`,(e,t)=>{t.pattern??=_c,Ol.init(e,t),e._zod.check=n=>{cu(n.value)||n.issues.push({code:`invalid_format`,format:`credit_card`,input:n.value,inst:e,continue:!t.abort})}});function uu(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var du=L(`$ZodJWT`,(e,t)=>{Ol.init(e,t),e._zod.check=n=>{uu(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),fu=L(`$ZodCustomStringFormat`,(e,t)=>{Ol.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),pu=L(`$ZodNumber`,(e,t)=>{R.init(e,t),e._zod.pattern=e._zod.bag.pattern??Dc,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),mu=L(`$ZodNumberFormat`,(e,t)=>{il.init(e,t),pu.init(e,t)}),hu=L(`$ZodBoolean`,(e,t)=>{R.init(e,t),e._zod.pattern=Oc,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),gu=L(`$ZodBigInt`,(e,t)=>{R.init(e,t),e._zod.pattern=Tc,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),_u=L(`$ZodBigIntFormat`,(e,t)=>{al.init(e,t),gu.init(e,t)}),vu=L(`$ZodSymbol`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),yu=L(`$ZodUndefined`,(e,t)=>{R.init(e,t),e._zod.pattern=Ac,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),bu=L(`$ZodNull`,(e,t)=>{R.init(e,t),e._zod.pattern=kc,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),xu=L(`$ZodAny`,(e,t)=>{R.init(e,t),e._zod.parse=e=>e}),Su=L(`$ZodUnknown`,(e,t)=>{R.init(e,t),e._zod.parse=e=>e}),Cu=L(`$ZodNever`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),wu=L(`$ZodVoid`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Tu=L(`$ZodDate`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function Eu(e,t,n){e.issues.length&&t.issues.push(...co(n,e.issues)),t.value[n]=e.value}var Du=L(`$ZodArray`,(e,t)=>{R.init(e,t);let n=Wo.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;e<a.length;e++){let n=a[e],s=t.element._zod.run({value:n,issues:[]},i);s instanceof Promise?o.push(s.then(t=>Eu(t,r,e))):Eu(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function Ou(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...co(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var ku=[];function Au(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ku,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Xa(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ju(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Ou(e,n,i,t,u,d))):Ou(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Mu=new WeakMap,Nu=L(`$ZodObject`,(e,t)=>{if(R.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Mu.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),Mu.set(t,n),n}})}let n=Ca(()=>Au(t));I(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Aa(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=za,i=t.catchall,a,o=Wo.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>Ou(n,t,e,c,r,i))):Ou(a,t,e,c,r,i)}return i?ju(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Pu=L(`$ZodObjectJIT`,(e,t)=>{Nu.init(e,t);let n=e._zod.parse,r=Ca(()=>Au(t)),i=Wo.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Cl([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
16
|
-
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
17
|
-
const iss = ${e}.issues[i];
|
|
18
|
-
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
19
|
-
payload.issues.push(iss);
|
|
20
|
-
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Ia(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
21
|
-
const ${n}_present = ${i};
|
|
22
|
-
if (!${n}.issues.length || ${n}_present) {
|
|
23
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (${e}) {
|
|
27
|
-
newResult[${r}] = ${n}.value;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
`)}else f?o.write(`
|
|
32
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (${n}.value === undefined) {
|
|
36
|
-
if (${i}) {
|
|
37
|
-
newResult[${r}] = undefined;
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
newResult[${r}] = ${n}.value;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
`):o.write(`
|
|
44
|
-
const ${n}_present = ${i};
|
|
45
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
46
|
-
}
|
|
47
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
48
|
-
payload.issues.push({
|
|
49
|
-
code: "invalid_type",
|
|
50
|
-
expected: "nonoptional",
|
|
51
|
-
input: undefined,
|
|
52
|
-
path: [${r}]
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (${n}_present) {
|
|
57
|
-
newResult[${r}] = ${n}.value;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=za,c=!Wo.jitless,l=c&&Ba.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ju([],p,i,f,d,e):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Fu(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!oo(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>fo(e,r,Go())))}),t)}var Iu=L(`$ZodUnion`,(e,t)=>{R.init(e,t),I(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),I(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),I(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),I(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Ta(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Fu(t,r,e,i)):Fu(o,r,e,i)}});function Lu(e,t,n,r){let i=[];for(let t=0;t<e.length;t++)e[t].issues.length===0&&i.push(t);return i.length===1?(t.value=e[i[0]].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>fo(e,r,Go())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t)}var Ru=L(`$ZodXor`,(e,t)=>{Iu.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then(t=>Lu(t,r,e,i)):Lu(o,r,e,i)}});function zu(e,t){let n=e._zod,r=n.bag.optionsMap;if(!r){r=new Map;let{options:e,discriminator:t}=n.def;for(let n of e)for(let e of n._zod.propValues?.[t]??[])r.has(e)||r.set(e,n);n.bag.optionsMap=r}return r.get(t)}var Bu=L(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Iu.init(e,t);let n=e._zod.parse;I(e,`propValues`,e=>{let t={};for(let n of e.def.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[e,n]of Object.entries(r)){Object.prototype.hasOwnProperty.call(t,e)||Aa(t,e,new Set);for(let r of n)t[e].add(r)}}return t}),t.options.forEach((e,n)=>{let r=Mu.get(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Ca(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!za(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Vu=L(`$ZodIntersection`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Uu(e,t,n)):Uu(e,i,a)}});function Hu(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Va(e)&&Va(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Hu(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Hu(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Uu(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Hu(t.value,n.value);if(!c.valid){if(oo(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Wu=L(`$ZodTuple`,(e,t)=>{R.init(e,t);let n=t.items,r=Wo.memoizer;r?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=Gu(n,`optin`),l=Gu(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):u[e]=t}if(t.rest){let e=n.length-1,r=o.slice(n.length);for(let n of r){e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>Ku(t,i,e))):Ku(r,i,e)}}return s.length?Promise.all(s).then(()=>qu(u,i,n,o,l)):qu(u,i,n,o,l)}});function Gu(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function Ku(e,t,n){e.issues.length&&t.issues.push(...co(n,e.issues)),t.value[n]=e.value}function qu(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...co(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Ju=L(`$ZodRecord`,(e,t)=>{R.init(e,t);let n=Wo.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Va(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>fo(e,i,Go())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...co(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...co(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Dc.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>fo(e,i,Go())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...co(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...co(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Yu=L(`$ZodMap`,(e,t)=>{R.init(e,t);let n=Wo.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!(a instanceof Map))return r.issues.push({expected:`map`,code:`invalid_type`,input:a,inst:e}),r;let o=[];r.value=n?n.alloc(e,r,new Map,i):new Map;for(let[n,s]of a){let c=t.keyType._zod.run({value:n,issues:[]},i),l=t.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([t,o])=>{Xu(t,o,r,n,a,e,i)})):Xu(c,l,r,n,a,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function Xu(e,t,n,r,i,a,o){e.issues.length&&(Ga.has(typeof r)?n.issues.push(...co(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>fo(e,o,Go()))})),t.issues.length&&(Ga.has(typeof r)?n.issues.push(...co(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>fo(e,o,Go()))})),n.value.set(e.value,t.value)}var Zu=L(`$ZodSet`,(e,t)=>{R.init(e,t);let n=Wo.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!(a instanceof Set))return r.issues.push({input:a,inst:e,expected:`set`,code:`invalid_type`}),r;let o=[];r.value=n?n.alloc(e,r,new Set,i):new Set;for(let e of a){let n=t.valueType._zod.run({value:e,issues:[]},i);n instanceof Promise?o.push(n.then(e=>Qu(e,r))):Qu(n,r)}return o.length?Promise.all(o).then(()=>r):r}});function Qu(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var $u=L(`$ZodEnum`,(e,t)=>{R.init(e,t);let n=xa(t.entries),r=new Set(n);e._zod.values=r;let i=n.filter(e=>Ga.has(typeof e));e._zod.pattern=RegExp(i.length?`^(${i.map(e=>qa(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ed=L(`$ZodLiteral`,(e,t)=>{R.init(e,t);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(t.values.length?`^(${t.values.map(e=>typeof e==`string`?qa(e):e?qa(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),td=L(`$ZodFile`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),nd=L(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,Wo.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Uo(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Ho;return n.value=i,n}});function rd(e,t){return e.value=t.issues.length?void 0:t.value,e}var id=L(`$ZodOptional`,(e,t)=>{R.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ta(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>rd(e,t)):rd(e,r)}return t.innerType._zod.run(e,n)}}),ad=L(`$ZodExactOptional`,(e,t)=>{id.init(e,t),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),od=L(`$ZodNullable`,(e,t)=>{R.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ta(t.source)}|null)$`):void 0}),I(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),sd=L(`$ZodDefault`,(e,t)=>{R.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>cd(e,t)):cd(r,t)}});function cd(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ld=L(`$ZodPrefault`,(e,t)=>{R.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ud=L(`$ZodNonOptional`,(e,t)=>{R.init(e,t),I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>dd(t,e)):dd(i,e)}});function dd(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var fd=L(`$ZodSuccess`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new Uo(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}});function pd(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>fo(e,r,Go()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var md=L(`$ZodCatch`,(e,t)=>{R.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>pd(e,r,t,n)):pd(e,r,t,n)}}),hd=L(`$ZodNaN`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),gd=L(`$ZodPipe`,(e,t)=>{R.init(e,t),I(e,`values`,e=>e.def.in._zod.values),I(e,`optin`,e=>e.def.in._zod.optin),I(e,`optout`,e=>e.def.out._zod.optout),I(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>_d(e,t.in,n)):_d(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>_d(e,t.out,n)):_d(r,t.out,n)}});function _d(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var vd=L(`$ZodCodec`,(e,t)=>{R.init(e,t),I(e,`values`,e=>e.def.in._zod.values),I(e,`optin`,e=>e.def.in._zod.optin),I(e,`optout`,e=>e.def.out._zod.optout),I(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>yd(e,t,n)):yd(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>yd(e,t,n)):yd(r,t,n)}}});function yd(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>bd(e,r,t.out,n)):bd(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>bd(e,r,t.in,n)):bd(e,r,t.in,n)}}function bd(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var xd=L(`$ZodPreprocess`,(e,t)=>{gd.init(e,t)}),Sd=L(`$ZodReadonly`,(e,t)=>{R.init(e,t),I(e,`propValues`,e=>e.def.innerType._zod.propValues),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`optin`,e=>e.def.innerType?._zod?.optin),I(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Cd):Cd(r)}});function Cd(e){return e.memo||(e.value=Object.freeze(e.value)),e}var wd=L(`$ZodTemplateLiteral`,(e,t)=>{R.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Ka.has(typeof e))n.push(qa(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),Td=L(`$ZodFunction`,(e,t)=>(R.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return Object.defineProperty(function(...n){let r=e._def.input?ls(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?ls(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return Object.defineProperty(async function(...n){let r=e._def.input?await ds(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await ds(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Wu({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Ed=L(`$ZodPromise`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Dd=L(`$ZodLazy`,(e,t)=>{R.init(e,t),Oa(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),I(e,`pattern`,e=>e.innerType?._zod?.pattern),I(e,`propValues`,e=>e.innerType?._zod?.propValues),I(e,`optin`,e=>e.innerType?._zod?.optin??void 0),I(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Od=L(`$ZodCustom`,(e,t)=>{Zc.init(e,t),R.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>kd(t,n,r,e));kd(i,n,r,e)}});function kd(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(_o(e))}}var Ad=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},V=`~memo`,jd=[];function Md(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Nd=new WeakMap;function Pd(e,t){let n=Nd.get(e);if(n!==void 0)return n;if(t.has(e))return!0;t.add(e);let r=!1,i=e=>{!r&&e?._zod&&Pd(e,t)&&(r=!0)},a=e._zod.def;switch(a.type){case`object`:for(let e of Reflect.ownKeys(a.shape))i(a.shape[e]);i(a.catchall);break;case`array`:i(a.element);break;case`tuple`:for(let e of a.items)i(e);i(a.rest);break;case`record`:case`map`:i(a.keyType),i(a.valueType);break;case`set`:i(a.valueType);break;case`union`:for(let e of a.options)i(e);break;case`intersection`:i(a.left),i(a.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:i(a.innerType);break;case`pipe`:i(a.in),i(a.out);break;case`function`:i(a.input),i(a.output);break;case`lazy`:i(e._zod.innerType);break;case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in a){let t=Object.getOwnPropertyDescriptor(a,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)i(n);else if(Array.isArray(n))for(let e of n)i(e)}}}return t.delete(e),Nd.set(e,r),r}function Fd(e){return Pd(e,new Set)}function Id(e,t){let n=e.buckets.get(t);return n||(n=new Map,e.buckets.set(t,n)),n}var Ld,Rd=[],zd={alloc(e,t,n){let r=Ld;if(!r)return n;Ld=void 0;let i={value:n,issues:null};return r.set(t.value,i),Rd.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Vd(n,e.value))throw new Ad;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(o,s)=>{if(n===void 0&&(n=Pd(e,new Set),!n))return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(o,s);let c=o.value;if(typeof c!=`object`||!c)return t(o,s);let l=s[V];l||(l={buckets:new Map,backEdges:void 0},s[V]=l);let u;r===s?u=i:(u=Id(l,e),r=s,i=u);let d=u.get(c);if(d)return o.value=d.value,d.issues?d.issues.length&&o.issues.push(...Md(d.issues)):(o.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(d.value)),o;Ld=u;let f=Rd.length,p=t(o,s);Ld=void 0;let m=Rd.length>f?Rd.pop():void 0;return p instanceof Promise?p.then(e=>(m&&(m.issues=e.issues.length?Md(e.issues):jd),e)):(m&&(m.issues=p.issues.length?Md(p.issues):jd),p)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}};function Bd(){return zd}function Vd(e,t){let n=e[V]?.backEdges;return n!==void 0&&typeof t==`object`&&!!t&&n.has(t)}var Hd=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`},map:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,mac:`عنوان MAC`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,credit_card:`رقم بطاقة الائتمان`,jwt:`JWT`,template_literal:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${N(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${j(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function Ud(){return{localeError:Hd()}}var Wd=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`},map:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`kredit kartı nömrəsi`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${N(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function Gd(){return{localeError:Wd()}}function Kd(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}var qd=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},map:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,mac:`MAC адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,credit_card:`нумар крэдытнай карты`,jwt:`JWT`,template_literal:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${N(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Kd(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Kd(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function Jd(){return{localeError:qd()}}var Yd=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`},map:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,mac:`MAC адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,credit_card:`номер на кредитна карта`,jwt:`JWT`,template_literal:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${N(e.values[0])}`:`Невалидна опция: очаквано едно от ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function Xd(){return{localeError:Yd()}}var Zd=()=>{let e={string:{unit:`অক্ষর`,verb:`থাকতে হবে`},file:{unit:`বাইট`,verb:`থাকতে হবে`},array:{unit:`আইটেম`,verb:`থাকতে হবে`},set:{unit:`আইটেম`,verb:`থাকতে হবে`},map:{unit:`এন্ট্রি`,verb:`থাকতে হবে`}};function t(t){return e[t]??null}let n={regex:`ইনপুট`,email:`ইমেইল ঠিকানা`,url:`URL`,emoji:`ইমোজি`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO তারিখ ও সময়`,date:`ISO তারিখ`,time:`ISO সময়`,duration:`ISO সময়কাল`,ipv4:`IPv4 ঠিকানা`,ipv6:`IPv6 ঠিকানা`,mac:`MAC ঠিকানা`,cidrv4:`IPv4 রেঞ্জ`,cidrv6:`IPv6 রেঞ্জ`,base64:`base64-এনকোডেড স্ট্রিং`,base64url:`base64url-এনকোডেড স্ট্রিং`,json_string:`JSON স্ট্রিং`,e164:`E.164 নম্বর`,credit_card:`ক্রেডিট কার্ড নম্বর`,jwt:`JWT`,template_literal:`ইনপুট`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input);return`অবৈধ ইনপুট: প্রত্যাশিত ${t}, প্রাপ্ত ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`অবৈধ ইনপুট: প্রত্যাশিত ${N(e.values[0])}`:`অবৈধ অপশন: ${j(e.values,` | `)} এর মধ্যে একটি প্রত্যাশিত`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`অনেক বড়: ${e.origin??`মান`} ${n}${e.maximum.toString()} ${r.unit??`এলিমেন্ট`} হতে হবে`:`অনেক বড়: ${e.origin??`মান`} ${n}${e.maximum.toString()} হতে হবে`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`অনেক ছোট: ${e.origin} ${n}${e.minimum.toString()} ${r.unit} হতে হবে`:`অনেক ছোট: ${e.origin} ${n}${e.minimum.toString()} হতে হবে`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`অবৈধ স্ট্রিং: "${t.prefix}" দিয়ে শুরু হতে হবে`:t.format===`ends_with`?`অবৈধ স্ট্রিং: "${t.suffix}" দিয়ে শেষ হতে হবে`:t.format===`includes`?`অবৈধ স্ট্রিং: "${t.includes}" অন্তর্ভুক্ত থাকতে হবে`:t.format===`regex`?`অবৈধ স্ট্রিং: ${t.pattern} প্যাটার্ন মিলতে হবে`:`অবৈধ ${n[t.format]??e.format}`}case`not_multiple_of`:return`অবৈধ নম্বর: ${e.divisor} এর গুণিতক হতে হবে`;case`unrecognized_keys`:return`অচেনা কী${e.keys.length>1?`গুলো`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} এ অবৈধ কী`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`অবৈধ ডিসক্রিমিনেটর মান। প্রত্যাশিত ${e.options.map(e=>`'${e}'`).join(` | `)}`:`অবৈধ ইনপুট`;case`invalid_element`:return`${e.origin} এ অবৈধ মান`;default:return`অবৈধ ইনপুট`}}};function Qd(){return{localeError:Zd()}}var $d=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`},map:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,mac:`adreça MAC`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,credit_card:`número de targeta de crèdit`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${N(e.values[0])}`:`Opció invàlida: s'esperava una de ${j(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function ef(){return{localeError:$d()}}var tf=()=>{let e={string:{unit:`پیت`,verb:`بێت`},file:{unit:`بایت`,verb:`بێت`},array:{unit:`دانە`,verb:`بێت`},set:{unit:`دانە`,verb:`بێت`},map:{unit:`دانە`,verb:`بێت`}};function t(t){return e[t]??null}let n={regex:`regex`,email:`ئیمەیڵ`,url:`بەستەر (URL)`,emoji:`ئیمۆجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ڕێکەوت و کات`,date:`ڕێکەوت`,time:`کات`,duration:`ماوە`,ipv4:`ناونیشانی IPv4`,ipv6:`ناونیشانی IPv6`,mac:`ناونیشانی MAC`,cidrv4:`مەودای IPv4`,cidrv6:`مەودای IPv6`,base64:`دەقی base64`,base64url:`دەقی base64url`,json_string:`دەقی JSON`,e164:`ژمارەی E.164`,credit_card:`ژمارەی کارتی کرێدیت`,jwt:`JWT`,template_literal:`تێکردە`},r={nan:`NaN`,string:`نووسین`,number:`ژمارە`,boolean:`boolean`,array:`array`,object:`object`,date:`ڕێکەوت`,integer:`ژمارە`,float:`ژمارە`,null:`null`,undefined:`undefined`,function:`function`,symbol:`symbol`,unknown:`unknown`,promise:`promise`,void:`void`,never:`never`,map:`map`,set:`set`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n,a=[`ا`,`و`,`ۆ`,`وو`,`ە`,`ی`,`ێ`].some(e=>i.endsWith(e))?`یە`:`ە`,o=/^[a-zA-Z]+$/.test(i);return n===`null`||n===`undefined`?`داواکراوە`:`چاوەڕوانکراوە ${t} بێت، بەڵام ${i}${o?``:a}`}case`invalid_value`:return e.values.length===1?`بەهاکە نادرووستە: چاوەڕوانکراوە ${N(e.values[0])} بێت`:`هەڵبژاردەی نادروست: چاوەڕوانکراوە یەکێک بێت لە ${j(e.values,`|`)}`;case`too_big`:{let n=t(e.origin);return n?`پێویستە بە لایەنی زۆرەوە ${e.maximum.toString()} ${n.unit} ${n.verb}`:`پێویستە بە لایەنی زۆرەوە ${e.maximum.toString()} بێت`}case`too_small`:{let n=t(e.origin);return n?`پێویستە بە لایەنی کەمەوە ${e.minimum.toString()} ${n.unit} ${n.verb}`:`پێویستە بە لایەنی کەمەوە ${e.minimum.toString()} بێت`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`دەقی نادروست: پێویستە دەستپێبکات بە "${t.prefix}"`:t.format===`ends_with`?`دەقی نادروست: پێویستە کۆتاییبێت بە "${t.suffix}"`:t.format===`includes`?`دەقی نادروست: پێویستە "${t.includes}" لەخۆبگرێت`:t.format===`regex`?`دەقی نادروست: پێویستە لەگەڵ پاتێرنی ${t.pattern} بگونجێت`:`بەهای ${n[t.format]??e.format} نادروستە`}case`not_multiple_of`:return`ژمارەی نادروست: دەبێت چەند هێندە بێت بۆ ${e.divisor}`;case`unrecognized_keys`:return`کلیلی نەناسراو: ${j(e.keys,`, `)}`;case`invalid_key`:return`کلیلی نادروست لە ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`بەهای نەناسراو هەیە. بەهای چاوەڕوانکراو: ${e.options.map(e=>`'${e}'`).join(` | `)}`:`یەکگرتنی نادروست`;case`invalid_element`:return`${e.origin} بەهاکە نادروستە`;default:return`تێکردەی نادروست`}}};function nf(){return{localeError:tf()}}var rf=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`},map:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,mac:`MAC adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,credit_card:`číslo kreditní karty`,jwt:`JWT`,template_literal:`vstup`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${N(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${j(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function af(){return{localeError:rf()}}var of=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`},map:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-adresse`,ipv6:`IPv6-adresse`,mac:`MAC-adresse`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,credit_card:`kreditkortnummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${N(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function sf(){return{localeError:of()}}var cf=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`},map:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,mac:`MAC-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,credit_card:`Kreditkartennummer`,jwt:`JWT`,template_literal:`Eingabe`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${N(e.values[0])}`:`Ungültige Option: erwartet eine von ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function lf(){return{localeError:cf()}}var uf=()=>{let e={string:{unit:`χαρακτήρες`,verb:`να έχει`},file:{unit:`bytes`,verb:`να έχει`},array:{unit:`στοιχεία`,verb:`να έχει`},set:{unit:`στοιχεία`,verb:`να έχει`},map:{unit:`καταχωρήσεις`,verb:`να έχει`}};function t(t){return e[t]??null}let n={regex:`είσοδος`,email:`διεύθυνση email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ημερομηνία και ώρα`,date:`ISO ημερομηνία`,time:`ISO ώρα`,duration:`ISO διάρκεια`,ipv4:`διεύθυνση IPv4`,ipv6:`διεύθυνση IPv6`,mac:`διεύθυνση MAC`,cidrv4:`εύρος IPv4`,cidrv6:`εύρος IPv6`,base64:`συμβολοσειρά κωδικοποιημένη σε base64`,base64url:`συμβολοσειρά κωδικοποιημένη σε base64url`,json_string:`συμβολοσειρά JSON`,e164:`αριθμός E.164`,credit_card:`αριθμός πιστωτικής κάρτας`,jwt:`JWT`,template_literal:`είσοδος`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return typeof e.expected==`string`&&/^[A-Z]/.test(e.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${e.expected}, λήφθηκε ${i}`:`Μη έγκυρη είσοδος: αναμενόταν ${t}, λήφθηκε ${i}`}case`invalid_value`:return e.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${N(e.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Πολύ μεγάλο: αναμενόταν ${e.origin??`τιμή`} να έχει ${n}${e.maximum.toString()} ${r.unit??`στοιχεία`}`:`Πολύ μεγάλο: αναμενόταν ${e.origin??`τιμή`} να είναι ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Πολύ μικρό: αναμενόταν ${e.origin} να έχει ${n}${e.minimum.toString()} ${r.unit}`:`Πολύ μικρό: αναμενόταν ${e.origin} να είναι ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${t.prefix}"`:t.format===`ends_with`?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${t.suffix}"`:t.format===`includes`?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${t.includes}"`:t.format===`regex`?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${t.pattern}`:`Μη έγκυρο: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${e.divisor}`;case`unrecognized_keys`:return`Άγνωστ${e.keys.length>1?`α`:`ο`} κλειδ${e.keys.length>1?`ιά`:`ί`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Μη έγκυρο κλειδί στο ${e.origin}`;case`invalid_union`:return`Μη έγκυρη είσοδος`;case`invalid_element`:return`Μη έγκυρη τιμή στο ${e.origin}`;default:return`Μη έγκυρη είσοδος`}}};function df(){return{localeError:uf()}}var ff=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(P(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${N(e.values[0])}`:`Invalid option: expected one of ${j(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function pf(){return{localeError:ff()}}var mf=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`},map:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,mac:`MAC-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,credit_card:`kreditkarta numero`,jwt:`JWT`,template_literal:`enigo`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${N(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function hf(){return{localeError:mf()}}var gf=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,mac:`dirección MAC`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,credit_card:`número de tarjeta de crédito`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${N(e.values[0])}`:`Opción inválida: se esperaba una de ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}};function _f(){return{localeError:gf()}}var vf=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`},map:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,mac:`MAC آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,credit_card:`شماره کارت اعتباری`,jwt:`JWT`,template_literal:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: میبایست instanceof ${e.expected} میبود، ${i} دریافت شد`:`ورودی نامعتبر: میبایست ${t} میبود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: میبایست ${N(e.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${j(e.values,`|`)} میبود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${j(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function yf(){return{localeError:vf()}}var bf=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},map:{unit:`alkiota`,subject:`kuvauksen`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,mac:`MAC-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,credit_card:`luottokortin numero`,jwt:`JWT`,template_literal:`templaattimerkkijono`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${N(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}};function xf(){return{localeError:bf()}}var Sf=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`expression régulière`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,mac:`adresse MAC`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne de caractères encodée en base64`,base64url:`chaîne de caractères encodée en base64url`,json_string:`chaîne de caractères JSON`,e164:`numéro au format E.164`,credit_card:`numéro de carte de crédit`,jwt:`JWT`,template_literal:`entrée`},r={string:`chaîne de caractères`,number:`nombre`,int:`entier`,boolean:`booléen`,bigint:`grand entier`,symbol:`symbole`,undefined:`indéfini`,null:`null`,never:`jamais`,void:`vide`,date:`date`,array:`tableau`,object:`objet`,tuple:`tuple`,record:`record`,map:`map`,set:`ensemble`,file:`fichier`,nonoptional:`non optionnel`,nan:`NaN`,function:`fonction`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instance de ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${N(e.values[0])} attendu`:`Option invalide : une valeur parmi ${j(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin);return i?`Trop grand : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.maximum.toString()} ${i.unit??`élément(s)`}`:`Trop grand : ${r[e.origin]??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin);return i?`Trop petit : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.minimum.toString()} ${i.unit}`:`Trop petit : ${r[e.origin]??`valeur`} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne de caractères invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne de caractères invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne de caractères invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne de caractères invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${j(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function Cf(){return{localeError:Sf()}}var wf=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`},map:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,mac:`adresse MAC`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,credit_card:`numéro de carte de crédit`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${N(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${j(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function Tf(){return{localeError:wf()}}var Ef=()=>{let e={string:{unit:`અક્ષર`,verb:`હોવા જોઈએ`},file:{unit:`બાયટ`,verb:`હોવા જોઈએ`},array:{unit:`આઇટમ`,verb:`હોવા જોઈએ`},set:{unit:`આઇટમ`,verb:`હોવા જોઈએ`},map:{unit:`એન્ટ્રી`,verb:`હોવા જોઈએ`}};function t(t){return e[t]??null}let n={regex:`ઇનપુટ`,email:`ઈમેઇલ એડ્રેસ`,url:`URL`,emoji:`ઇમોજી`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO તારીખ અને સમય`,date:`ISO તારીખ`,time:`ISO સમય`,duration:`ISO અવધિ`,ipv4:`IPv4 એડ્રેસ`,ipv6:`IPv6 એડ્રેસ`,mac:`MAC એડ્રેસ`,cidrv4:`IPv4 શ્રેણી`,cidrv6:`IPv6 શ્રેણી`,base64:`base64-એન્કોડેડ સ્ટ્રિંગ`,base64url:`base64url-એન્કોડેડ સ્ટ્રિંગ`,json_string:`JSON સ્ટ્રિંગ`,e164:`E.164 નંબર`,credit_card:`ક્રેડિટ કાર્ડ નંબર`,jwt:`JWT`,template_literal:`ઇનપુટ`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input);return`અમાન્ય ઇનપુટ: અપેક્ષિત ${t}, પ્રાપ્ત ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`અમાન્ય ઇનપુટ: અપેક્ષિત ${N(e.values[0])}`:`અમાન્ય વિકલ્પ: ${j(e.values,` | `)} માધ્યમથી એક અપેક્ષિત`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ખૂબ મોટું: ${e.origin??`મૂલ્ય`} ${n}${e.maximum.toString()} ${r.unit??`એલિમેન્ટ`} હોવા જોઈએ`:`ખૂબ મોટું: ${e.origin??`મૂલ્ય`} ${n}${e.maximum.toString()} હોવું જોઈએ`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ખૂબ નાનું: ${e.origin} ${n}${e.minimum.toString()} ${r.unit} હોવા જોઈએ`:`ખૂબ નાનું: ${e.origin} ${n}${e.minimum.toString()} હોવું જોઈએ`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`અમાન્ય સ્ટ્રિંગ: "${t.prefix}" થી શરૂ થવું જોઈએ`:t.format===`ends_with`?`અમાન્ય સ્ટ્રિંગ: "${t.suffix}" પર સમાપ્ત થવું જોઈએ`:t.format===`includes`?`અમાન્ય સ્ટ્રિંગ: "${t.includes}" શામેલ હોવું જોઈએ`:t.format===`regex`?`અમાન્ય સ્ટ્રિંગ: પેટર્ન ${t.pattern} સાથે મેળ ખાવું જોઈએ`:`અમાન્ય ${n[t.format]??e.format}`}case`not_multiple_of`:return`અમાન્ય નંબર: ${e.divisor} નો ગુણાંક હોવો જોઈએ`;case`unrecognized_keys`:return`ઓળખી શકાતા નહીં તે કી${e.keys.length>1?`ઓ`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} માં અમાન્ય કી`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`અમાન્ય ડિસ્ક્રિમિનેટર મૂલ્ય. અપેક્ષિત ${e.options.map(e=>`'${e}'`).join(` | `)}`:`અમાન્ય ઇનપુટ`;case`invalid_element`:return`${e.origin} માં અમાન્ય મૂલ્ય`;default:return`અમાન્ય ઇનપુટ`}}};function Df(){return{localeError:Ef()}}var Of=()=>{let e={string:{label:`מחרוזת`,gender:`f`},number:{label:`מספר`,gender:`m`},boolean:{label:`ערך בוליאני`,gender:`m`},bigint:{label:`BigInt`,gender:`m`},date:{label:`תאריך`,gender:`m`},array:{label:`מערך`,gender:`m`},object:{label:`אובייקט`,gender:`m`},null:{label:`ערך ריק (null)`,gender:`m`},undefined:{label:`ערך לא מוגדר (undefined)`,gender:`m`},symbol:{label:`סימבול (Symbol)`,gender:`m`},function:{label:`פונקציה`,gender:`f`},map:{label:`מפה (Map)`,gender:`f`},set:{label:`קבוצה (Set)`,gender:`f`},file:{label:`קובץ`,gender:`m`},promise:{label:`Promise`,gender:`m`},NaN:{label:`NaN`,gender:`m`},unknown:{label:`ערך לא ידוע`,gender:`m`},value:{label:`ערך`,gender:`m`}},t={string:{unit:`תווים`,shortLabel:`קצר`,longLabel:`ארוך`},file:{unit:`בייטים`,shortLabel:`קטן`,longLabel:`גדול`},array:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},set:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},number:{unit:``,shortLabel:`קטן`,longLabel:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??null:null,s={regex:{label:`קלט`,gender:`m`},email:{label:`כתובת אימייל`,gender:`f`},url:{label:`כתובת רשת`,gender:`f`},emoji:{label:`אימוג'י`,gender:`m`},uuid:{label:`UUID`,gender:`m`},uuidv4:{label:`UUIDv4`,gender:`m`},uuidv6:{label:`UUIDv6`,gender:`m`},nanoid:{label:`nanoid`,gender:`m`},guid:{label:`GUID`,gender:`m`},cuid:{label:`cuid`,gender:`m`},cuid2:{label:`cuid2`,gender:`m`},ulid:{label:`ULID`,gender:`m`},xid:{label:`XID`,gender:`m`},ksuid:{label:`KSUID`,gender:`m`},datetime:{label:`תאריך וזמן ISO`,gender:`m`},date:{label:`תאריך ISO`,gender:`m`},time:{label:`זמן ISO`,gender:`m`},duration:{label:`משך זמן ISO`,gender:`m`},ipv4:{label:`כתובת IPv4`,gender:`f`},ipv6:{label:`כתובת IPv6`,gender:`f`},mac:{label:`כתובת MAC`,gender:`f`},cidrv4:{label:`טווח IPv4`,gender:`m`},cidrv6:{label:`טווח IPv6`,gender:`m`},base64:{label:`מחרוזת בבסיס 64`,gender:`f`},base64url:{label:`מחרוזת בבסיס 64 לכתובות רשת`,gender:`f`},json_string:{label:`מחרוזת JSON`,gender:`f`},e164:{label:`מספר E.164`,gender:`m`},credit_card:{label:`מספר כרטיס אשראי`,gender:`m`},jwt:{label:`JWT`,gender:`m`},template_literal:{label:`קלט`,gender:`m`},ends_with:{label:`קלט`,gender:`m`},includes:{label:`קלט`,gender:`m`},lowercase:{label:`קלט`,gender:`m`},starts_with:{label:`קלט`,gender:`m`},uppercase:{label:`קלט`,gender:`m`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=P(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${N(t.values[0])}`;let e=t.values.map(e=>N(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${j(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}};function kf(){return{localeError:Of()}}var Af=()=>{let e={string:{unit:`अक्षर`,verb:`रखने के लिए`},file:{unit:`बाइट्स`,verb:`रखने के लिए`},array:{unit:`तत्व`,verb:`रखने के लिए`},set:{unit:`तत्व`,verb:`रखने के लिए`},map:{unit:`प्रविष्टियाँ`,verb:`रखने के लिए`}};function t(t){return e[t]??null}let n={regex:`इनपुट`,email:`ईमेल पता`,url:`URL`,emoji:`इमोजी`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO तिथि और समय`,date:`ISO तिथि`,time:`ISO समय`,duration:`ISO अवधि`,ipv4:`IPv4 पता`,ipv6:`IPv6 पता`,mac:`MAC पता`,cidrv4:`IPv4 श्रेणी`,cidrv6:`IPv6 श्रेणी`,base64:`Base64-एन्कोडेड स्ट्रिंग`,base64url:`Base64URL-एन्कोडेड स्ट्रिंग`,json_string:`JSON स्ट्रिंग`,e164:`E.164 संख्या`,credit_card:`क्रेडिट कार्ड संख्या`,jwt:`JWT`,template_literal:`इनपुट`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input);return`अमान्य इनपुट: अपेक्षित ${t}, प्राप्त ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`अमान्य इनपुट: अपेक्षित ${N(e.values[0])}`:`अमान्य विकल्प: अपेक्षित मानों में से एक ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`बहुत बड़ा: अपेक्षित था कि ${e.origin??`मान`} में ${n}${e.maximum} ${r.unit} हों`:`बहुत बड़ा: अपेक्षित था कि ${e.origin??`मान`} ${n}${e.maximum} हो`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`बहुत छोटा: अपेक्षित था कि ${e.origin} में ${n}${e.minimum} ${r.unit} हों`:`बहुत छोटा: अपेक्षित था कि ${e.origin} ${n}${e.minimum} हो`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`अमान्य स्ट्रिंग: "${t.prefix}" से शुरू होना चाहिए`:t.format===`ends_with`?`अमान्य स्ट्रिंग: "${t.suffix}" पर समाप्त होना चाहिए`:t.format===`includes`?`अमान्य स्ट्रिंग: इसमें "${t.includes}" शामिल होना चाहिए`:t.format===`regex`?`अमान्य स्ट्रिंग: पैटर्न ${t.pattern} से मेल खाना चाहिए`:`अमान्य ${n[t.format]??e.format}`}case`not_multiple_of`:return`अमान्य संख्या: यह ${e.divisor} का गुणज होना चाहिए`;case`unrecognized_keys`:return`अपरिचित कुंजी${e.keys.length>1?`याँ`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`अमान्य कुंजी: ${e.origin} में`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${e.options.map(e=>`'${e}'`).join(` | `)}`:`अमान्य इनपुट`;case`invalid_element`:return`अमान्य मान: ${e.origin} में`;default:return`अमान्य इनपुट`}}};function jf(){return{localeError:Af()}}var Mf=()=>{let e={string:{unit:`znakova`,verb:`imati`},file:{unit:`bajtova`,verb:`imati`},array:{unit:`stavki`,verb:`imati`},set:{unit:`stavki`,verb:`imati`}};function t(t){return e[t]??null}let n={regex:`unos`,email:`email adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum i vrijeme`,date:`ISO datum`,time:`ISO vrijeme`,duration:`ISO trajanje`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,mac:`MAC adresa`,cidrv4:`IPv4 raspon`,cidrv6:`IPv6 raspon`,base64:`base64 kodirani tekst`,base64url:`base64url kodirani tekst`,json_string:`JSON tekst`,e164:`E.164 broj`,credit_card:`broj kreditne kartice`,jwt:`JWT`,template_literal:`unos`},r={nan:`NaN`,string:`tekst`,number:`broj`,boolean:`boolean`,array:`niz`,object:`objekt`,set:`skup`,file:`datoteka`,date:`datum`,bigint:`bigint`,symbol:`simbol`,undefined:`undefined`,null:`null`,function:`funkcija`,map:`mapa`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neispravan unos: očekuje se instanceof ${e.expected}, a primljeno je ${i}`:`Neispravan unos: očekuje se ${t}, a primljeno je ${i}`}case`invalid_value`:return e.values.length===1?`Neispravna vrijednost: očekivano ${N(e.values[0])}`:`Neispravna opcija: očekivano jedno od ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Preveliko: očekivano da ${a??`vrijednost`} ima ${n}${e.maximum.toString()} ${i.unit??`elemenata`}`:`Preveliko: očekivano da ${a??`vrijednost`} bude ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Premalo: očekivano da ${a} ima ${n}${e.minimum.toString()} ${i.unit}`:`Premalo: očekivano da ${a} bude ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neispravan tekst: mora započinjati s "${t.prefix}"`:t.format===`ends_with`?`Neispravan tekst: mora završavati s "${t.suffix}"`:t.format===`includes`?`Neispravan tekst: mora sadržavati "${t.includes}"`:t.format===`regex`?`Neispravan tekst: mora odgovarati uzorku ${t.pattern}`:`Neispravna ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neispravan broj: mora biti višekratnik od ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznat${e.keys.length>1?`i ključevi`:` ključ`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Neispravan ključ u ${r[e.origin]??e.origin}`;case`invalid_union`:return`Neispravan unos`;case`invalid_element`:return`Neispravna vrijednost u ${r[e.origin]??e.origin}`;default:return`Neispravan unos`}}};function Nf(){return{localeError:Mf()}}var Pf=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`},map:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,mac:`MAC cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,credit_card:`hitelkártyaszám`,jwt:`JWT`,template_literal:`bemenet`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${N(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function Ff(){return{localeError:Pf()}}function If(e,t,n){return Math.abs(e)===1?t:n}function Lf(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}var Rf=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},map:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let n={regex:`մուտք`,email:`էլ. հասցե`,url:`URL`,emoji:`էմոջի`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ամսաթիվ և ժամ`,date:`ISO ամսաթիվ`,time:`ISO ժամ`,duration:`ISO տևողություն`,ipv4:`IPv4 հասցե`,ipv6:`IPv6 հասցե`,mac:`MAC հասցե`,cidrv4:`IPv4 միջակայք`,cidrv6:`IPv6 միջակայք`,base64:`base64 ձևաչափով տող`,base64url:`base64url ձևաչափով տող`,json_string:`JSON տող`,e164:`E.164 համար`,credit_card:`կրեդիտ քարտի համար`,jwt:`JWT`,template_literal:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${N(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=If(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Lf(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Lf(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=If(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Lf(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Lf(e.origin)} լինի ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով`:t.format===`ends_with`?`Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով`:t.format===`includes`?`Սխալ տող․ պետք է պարունակի "${t.includes}"`:t.format===`regex`?`Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${j(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${Lf(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${Lf(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}};function zf(){return{localeError:Rf()}}var Bf=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`},map:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,mac:`alamat MAC`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,credit_card:`nomor kartu kredit`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${N(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${n[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function Vf(){return{localeError:Bf()}}var Hf=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`},map:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,credit_card:`kreditkortanúmer`,jwt:`JWT`,template_literal:`gildi`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${N(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function Uf(){return{localeError:Hf()}}var Wf=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`},map:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,mac:`indirizzo MAC`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,credit_card:`numero di carta di credito`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${N(e.values[0])}`:`Opzione non valida: atteso uno tra ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Input non valido: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function Gf(){return{localeError:Wf()}}var Kf=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`},map:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,mac:`MACアドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,credit_card:`クレジットカード番号`,jwt:`JWT`,template_literal:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${N(e.values[0])}が期待されました`:`無効な選択: ${j(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${j(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function qf(){return{localeError:Kf()}}var Jf=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},map:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,mac:`MAC მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული ველი`,base64url:`base64url-კოდირებული ველი`,json_string:`JSON ველი`,e164:`E.164 ნომერი`,credit_card:`საკრედიტო ბარათის ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`ველი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${N(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${j(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი ველი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი ველი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი ველი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function Yf(){return{localeError:Jf()}}var Xf=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`},map:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,mac:`អាសយដ្ឋាន MAC`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,credit_card:`លេខប័ណ្ណឥណទាន`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${N(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${j(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function Zf(){return{localeError:Xf()}}function Qf(){return Zf()}var $f=()=>{let e={string:{unit:`ಅಕ್ಷರಗಳು`,verb:`ಹೊಂದಲು`},file:{unit:`ಬೈಟ್ಗಳು`,verb:`ಹೊಂದಲು`},array:{unit:`ವಸ್ತುಗಳು`,verb:`ಹೊಂದಲು`},set:{unit:`ವಸ್ತುಗಳು`,verb:`ಹೊಂದಲು`},map:{unit:`entries`,verb:`ಹೊಂದಲು`}};function t(t){return e[t]??null}let n={regex:`ಇನ್ಪುಟ್`,email:`email ವಿಳಾಸ`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ದಿನಾಂಕದ ಸಮಯ`,date:`ISO ದಿನಾಂಕ`,time:`ISO ಸಮಯ`,duration:`ISO ಅವಧಿ`,ipv4:`IPv4 ವಿಳಾಸ`,ipv6:`IPv6 ವಿಳಾಸ`,mac:`MAC ವಿಳಾಸ`,cidrv4:`IPv4 ವ್ಯಾಪ್ತಿಯ`,cidrv6:`IPv6 ವ್ಯಾಪ್ತಿಯ`,base64:`base64-encodedಸ್ಟ್ರಿಂಗ್`,base64url:`base64url-encodedಸ್ಟ್ರಿಂಗ್`,json_string:`JSONಸ್ಟ್ರಿಂಗ್`,e164:`E.164 ಸಂಖ್ಯೆ`,credit_card:`ಕ್ರೆಡಿಟ್ ಕಾರ್ಡ್ ಸಂಖ್ಯೆ`,jwt:`JWT`,template_literal:`ಇನ್ಪುಟ್`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input);return`ಅಮಾನ್ಯ ಇನ್ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t}, ಸ್ವೀಕರಿಸಿದನು ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`ಅಮಾನ್ಯ ಇನ್ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${N(e.values[0])}`:`ಅಮಾನ್ಯ ಆಯ್ಕೆ: ಇವುಗಳಲ್ಲಿ ಒಂದನ್ನು ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.origin??`value`} ಹೊಂದಲು ${n}${e.maximum.toString()} ${r.unit??`ಅಂಶಗಳು`}`:`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.origin??`value`} ಎಂದು ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.origin} ಹೊಂದಲು ${n}${e.minimum.toString()} ${r.unit}`:`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.origin} ಎಂದು ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಪ್ರಾರಂಭಿಸಬೇಕು "${t.prefix}"`:t.format===`ends_with`?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಕೊನೆಗೊಳ್ಳಬೇಕು "${t.suffix}"`:t.format===`includes`?`ಅಮಾನ್ಯ ಸ್ಟ್ರಿಂಗ್: ಒಳಗೊಂಡಿರಬೇಕು "${t.includes}"`:t.format===`regex`?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಮಾದರಿಗೆ ಹೊಂದಿಕೆಯಾಗಬೇಕು ${t.pattern}`:`ಅಮಾನ್ಯ ${n[t.format]??e.format}`}case`not_multiple_of`:return`ಅಮಾನ್ಯ ಸಂಖ್ಯೆ: ಬಹುಸಂಖ್ಯೆಯಾಗಿರಬೇಕು ${e.divisor}`;case`unrecognized_keys`:return`ಗುರುತಿಸಲಾಗದ ಕೀ ${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`ಅಮಾನ್ಯವಾದ ಕೀ ಇನ್ ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`ಅಮಾನ್ಯ ತಾರತಮ್ಯ ಮೌಲ್ಯ. ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.options.map(e=>`'${e}'`).join(` | `)}`:`ಅಮಾನ್ಯ ಇನ್ಪುಟ್`;case`invalid_element`:return`ರಲ್ಲಿ ಅಮಾನ್ಯ ಮೌಲ್ಯ ${e.origin}`;default:return`ಅಮಾನ್ಯ ಇನ್ಪುಟ್`}}};function ep(){return{localeError:$f()}}var tp=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`},map:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,mac:`MAC 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,credit_card:`신용카드 번호`,jwt:`JWT`,template_literal:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${N(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${j(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${j(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function np(){return{localeError:tp()}}var rp=e=>e.charAt(0).toUpperCase()+e.slice(1);function ip(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}var ap=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,mac:`MAC adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,credit_card:`kredito kortelės numeris`,jwt:`JWT`,template_literal:`įvestis`},r={nan:`NaN`,number:`skaičius`,bigint:`sveikasis skaičius`,string:`eilutė`,boolean:`loginė reikšmė`,undefined:`neapibrėžta reikšmė`,function:`funkcija`,symbol:`simbolis`,array:`masyvas`,object:`objektas`,null:`nulinė reikšmė`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${N(e.values[0])}`:`Privalo būti vienas iš ${j(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,ip(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${rp(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${rp(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,ip(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${rp(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${rp(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:return`${rp(r[e.origin]??e.origin??e.origin??`reikšmė`)} turi klaidingą įvestį`;default:return`Klaidinga įvestis`}}};function op(){return{localeError:ap()}}var sp=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`},map:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,mac:`MAC адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,credit_card:`број на кредитна картичка`,jwt:`JWT`,template_literal:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${N(e.values[0])}`:`Грешана опција: се очекува една ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function cp(){return{localeError:sp()}}var lp=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`},map:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,mac:`alamat MAC`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,credit_card:`nombor kad kredit`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${N(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${n[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${j(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function up(){return{localeError:lp()}}var dp=()=>{let e={string:{unit:`अक्षर`,verb:`हुनुपर्छ`},file:{unit:`बाइट`,verb:`हुनुपर्छ`},array:{unit:`तत्व`,verb:`हुनुपर्छ`},set:{unit:`तत्व`,verb:`हुनुपर्छ`},map:{unit:`प्रविष्टि`,verb:`हुनुपर्छ`}};function t(t){return e[t]??null}let n={regex:`इनपुट`,email:`इमेल ठेगाना`,url:`URL`,emoji:`इमोजी`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO मिति र समय`,date:`ISO मिति`,time:`ISO समय`,duration:`ISO अवधि`,ipv4:`IPv4 ठेगाना`,ipv6:`IPv6 ठेगाना`,mac:`MAC ठेगाना`,cidrv4:`IPv4 दायरा`,cidrv6:`IPv6 दायरा`,base64:`base64-इन्कोड गरिएको स्ट्रिङ`,base64url:`base64url-इन्कोड गरिएको स्ट्रिङ`,json_string:`JSON स्ट्रिङ`,e164:`E.164 नम्बर`,credit_card:`क्रेडिट कार्ड नम्बर`,jwt:`JWT`,template_literal:`इनपुट`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input);return`अमान्य इनपुट: अपेक्षित ${t}, प्राप्त ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`अमान्य इनपुट: अपेक्षित ${N(e.values[0])}`:`अमान्य विकल्प: अपेक्षित मानहरू मध्ये एक ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`धेरै ठूलो: ${e.origin??`मान`} मा ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`धेरै ठूलो: ${e.origin??`मान`} ${n}${e.maximum.toString()} हुनुपर्छ`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`धेरै सानो: ${e.origin} मा ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`धेरै सानो: ${e.origin} ${n}${e.minimum.toString()} हुनुपर्छ`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`अमान्य स्ट्रिङ: "${t.prefix}" बाट सुरु हुनुपर्छ`:t.format===`ends_with`?`अमान्य स्ट्रिङ: "${t.suffix}" मा समाप्त हुनुपर्छ`:t.format===`includes`?`अमान्य स्ट्रिङ: "${t.includes}" समावेश हुनुपर्छ`:t.format===`regex`?`अमान्य स्ट्रिङ: ढाँचा ${t.pattern} सँग मेल खानुपर्छ`:`अमान्य ${n[t.format]??e.format}`}case`not_multiple_of`:return`अमान्य संख्या: ${e.divisor} को गुणज हुनुपर्छ`;case`unrecognized_keys`:return`अपरिचित कुञ्जी${e.keys.length>1?`हरू`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`अमान्य कुञ्जी: ${e.origin} मा`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${e.options.map(e=>`'${e}'`).join(` | `)}`:`अमान्य इनपुट`;case`invalid_element`:return`अमान्य मान: ${e.origin} मा`;default:return`अमान्य इनपुट`}}};function fp(){return{localeError:dp()}}var pp=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`},map:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let n={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,mac:`MAC-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,credit_card:`creditcardnummer`,jwt:`JWT`,template_literal:`invoer`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${N(e.values[0])}`:`Ongeldige optie: verwacht één van ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function mp(){return{localeError:pp()}}var hp=()=>{let e={string:{unit:`teikn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`element`,verb:`å innehalde`},set:{unit:`element`,verb:`å innehalde`},map:{unit:`element`,verb:`å innehalde`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varigheit`,ipv4:`IPv4-adresse`,ipv6:`IPv6-adresse`,mac:`MAC-adresse`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkoda streng`,base64url:`base64url-enkoda streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,credit_card:`kredittkortnummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`tal`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventa instanceof ${e.expected}, fekk ${i}`:`Ugyldig input: forventa ${t}, fekk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventa ${N(e.values[0])}`:`Ugyldig val: forventa eitt av ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventa ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`For stor(t): forventa ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventa ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventa ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må slutte med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må innehalde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tal: må vere eit multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjende nøklar`:`Ukjend nøkkel`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function gp(){return{localeError:hp()}}var _p=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`},map:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-adresse`,ipv6:`IPv6-adresse`,mac:`MAC-adresse`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,credit_card:`kredittkortnummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${N(e.values[0])}`:`Ugyldig valg: forventet en av ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function vp(){return{localeError:_p()}}var yp=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`},map:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,mac:`MAC nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,credit_card:`i'tibâr kartı numarası`,jwt:`JWT`,template_literal:`giren`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${N(e.values[0])}`:`Fâsit tercih: mûteberler ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${n[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function bp(){return{localeError:yp()}}var xp=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`},map:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,mac:`د MAC پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,credit_card:`د کریډیټ کارت شمیره`,jwt:`JWT`,template_literal:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${N(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${j(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function Sp(){return{localeError:xp()}}var Cp=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`},map:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,mac:`adres MAC`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,credit_card:`numer karty kredytowej`,jwt:`JWT`,template_literal:`wejście`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${N(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function wp(){return{localeError:Cp()}}var Tp=()=>{let e={string:{unit:`caracteres`},file:{unit:`bytes`},array:{unit:`elementos`},set:{unit:`elementos`},map:{unit:`entradas`}};function t(t){return e[t]??null}let n={regex:`a entrada`,email:`o endereço de e-mail`,url:`o URL`,emoji:`o emoji`,uuid:`o UUID`,uuidv4:`o UUIDv4`,uuidv6:`o UUIDv6`,nanoid:`o nanoid`,guid:`o GUID`,cuid:`o cuid`,cuid2:`o cuid2`,ulid:`o ULID`,xid:`o XID`,ksuid:`o KSUID`,datetime:`a data e hora ISO`,date:`a data ISO`,time:`a hora ISO`,duration:`a duração ISO`,ipv4:`o endereço IPv4`,ipv6:`o endereço IPv6`,mac:`o endereço MAC`,cidrv4:`o intervalo de endereços IPv4`,cidrv6:`o intervalo de endereços IPv6`,base64:`o texto codificado em base64`,base64url:`o texto codificado em base64url`,json_string:`o texto JSON`,e164:`o número E.164`,credit_card:`o número de cartão de crédito`,jwt:`o JWT`,template_literal:`a entrada`},r={masculine:{definite:`o`,indefinite:`um`},feminine:{definite:`a`,indefinite:`uma`}},i={string:{name:`texto`,articles:r.masculine},number:{name:`número`,articles:r.masculine},int:{name:`número inteiro`,articles:r.masculine},boolean:{name:`valor booleano`,articles:r.masculine},bigint:{name:`número bigint`,articles:r.masculine},symbol:{name:`símbolo`,articles:r.masculine},undefined:{name:`valor "undefined"`,articles:r.masculine},null:{name:`valor "nulo"`,articles:r.masculine},never:{name:`valor "never"`,articles:r.masculine},void:{name:`valor "void"`,articles:r.masculine},date:{name:`data`,articles:r.feminine},array:{name:`vetor`,articles:r.masculine},object:{name:`objeto`,articles:r.masculine},tuple:{name:`tuplo`,articles:r.masculine},record:{name:`registo`,articles:r.masculine},map:{name:`mapa`,articles:r.masculine},set:{name:`conjunto`,articles:r.masculine},file:{name:`ficheiro`,articles:r.masculine},nonoptional:{name:`valor não opcional`,articles:r.masculine},nan:{name:`valor "NaN"`,articles:r.masculine},function:{name:`função`,articles:r.feminine}};function a(e,t){let n=i[e]??{name:`valor "${e}"`,articles:r.masculine};return`${n.articles[t]} ${n.name}`}return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: esperava ${a(e.expected,`indefinite`)}, recebeu ${a(P(e.input),`indefinite`)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperava ${N(e.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Demasiado grande: esperava que ${a(e.origin,`definite`)} tivesse ${n} ${e.maximum.toString()} ${r.unit??`elementos`}`:`Demasiado grande: esperava que ${a(e.origin,`definite`)} fosse ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Demasiado pequeno: esperava que ${a(e.origin,`definite`)} tivesse ${n} ${e.minimum.toString()} ${r.unit??`elementos`}`:`Demasiado pequeno: esperava que ${a(e.origin,`definite`)} fosse ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar por "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar em "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`Formato d${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:{let t=e.keys.length>1?`s`:``;return`Chave${t} inválida${t}: ${j(e.keys,`, `)}`}case`invalid_key`:return`Entrada inválida n${a(e.origin,`definite`)}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Valor de discriminação inválido. Esperava ${e.options.map(e=>`'${e}'`).join(` | `)}`:`Entrada inválida`;case`invalid_element`:return`Entrada inválida n${a(e.origin,`definite`)}`;default:return`Entrada inválida`}}};function Ep(){return{localeError:Tp()}}var Dp=()=>{let e={string:{unit:`caracteres`},file:{unit:`bytes`},array:{unit:`elementos`},set:{unit:`elementos`},map:{unit:`entradas`}};function t(t){return e[t]??null}let n={regex:`a entrada`,email:`o endereço de e-mail`,url:`o URL`,emoji:`o emoji`,uuid:`o UUID`,uuidv4:`o UUIDv4`,uuidv6:`o UUIDv6`,nanoid:`o nanoid`,guid:`o GUID`,cuid:`o cuid`,cuid2:`o cuid2`,ulid:`o ULID`,xid:`o XID`,ksuid:`o KSUID`,datetime:`a data e hora ISO`,date:`a data ISO`,time:`a hora ISO`,duration:`a duração ISO`,ipv4:`o endereço IPv4`,ipv6:`o endereço IPv6`,mac:`o endereço MAC`,cidrv4:`a faixa de endereços IPv4`,cidrv6:`a faixa de endereços IPv6`,base64:`o texto codificado em base64`,base64url:`o texto codificado em base64url`,json_string:`o texto JSON`,e164:`o número E.164`,credit_card:`o número de cartão de crédito`,jwt:`o JWT`,template_literal:`a entrada`},r={masculine:{definite:`o`,indefinite:`um`},feminine:{definite:`a`,indefinite:`uma`}},i={string:{name:`texto`,articles:r.masculine},number:{name:`número`,articles:r.masculine},int:{name:`número inteiro`,articles:r.masculine},boolean:{name:`valor booleano`,articles:r.masculine},bigint:{name:`número bigint`,articles:r.masculine},symbol:{name:`símbolo`,articles:r.masculine},undefined:{name:`valor "undefined"`,articles:r.masculine},null:{name:`valor "nulo"`,articles:r.masculine},never:{name:`valor "never"`,articles:r.masculine},void:{name:`valor "void"`,articles:r.masculine},date:{name:`data`,articles:r.feminine},array:{name:`vetor`,articles:r.masculine},object:{name:`objeto`,articles:r.masculine},tuple:{name:`tupla`,articles:r.feminine},record:{name:`registro`,articles:r.masculine},map:{name:`mapa`,articles:r.masculine},set:{name:`conjunto`,articles:r.masculine},file:{name:`arquivo`,articles:r.masculine},nonoptional:{name:`valor não opcional`,articles:r.masculine},nan:{name:`valor "NaN"`,articles:r.masculine},function:{name:`função`,articles:r.feminine}};function a(e,t){let n=i[e]??{name:`valor "${e}"`,articles:r.masculine};return`${n.articles[t]} ${n.name}`}return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: esperava ${a(e.expected,`indefinite`)}, recebeu ${a(P(e.input),`indefinite`)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperava ${N(e.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Grande demais: esperava que ${a(e.origin,`definite`)} tivesse ${n} ${e.maximum.toString()} ${r.unit??`elementos`}`:`Grande demais: esperava que ${a(e.origin,`definite`)} fosse ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Pequeno demais: esperava que ${a(e.origin,`definite`)} tivesse ${n} ${e.minimum.toString()} ${r.unit??`elementos`}`:`Pequeno demais: esperava que ${a(e.origin,`definite`)} fosse ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`Formato d${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:{let t=e.keys.length>1?`s`:``;return`Chave${t} inválida${t}: ${j(e.keys,`, `)}`}case`invalid_key`:return`Entrada inválida n${a(e.origin,`definite`)}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Valor de discriminação inválido. Esperava ${e.options.map(e=>`'${e}'`).join(` | `)}`:`Entrada inválida`;case`invalid_element`:return`Entrada inválida n${a(e.origin,`definite`)}`;default:return`Entrada inválida`}}};function Op(){return{localeError:Dp()}}var kp=()=>{let e={string:{unit:`caractere`,verb:`să aibă`},file:{unit:`octeți`,verb:`să aibă`},array:{unit:`elemente`,verb:`să aibă`},set:{unit:`elemente`,verb:`să aibă`},map:{unit:`intrări`,verb:`să aibă`}};function t(t){return e[t]??null}let n={regex:`intrare`,email:`adresă de email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`dată și oră ISO`,date:`dată ISO`,time:`oră ISO`,duration:`durată ISO`,ipv4:`adresă IPv4`,ipv6:`adresă IPv6`,mac:`adresă MAC`,cidrv4:`interval IPv4`,cidrv6:`interval IPv6`,base64:`șir codat base64`,base64url:`șir codat base64url`,json_string:`șir JSON`,e164:`număr E.164`,credit_card:`număr de card de credit`,jwt:`JWT`,template_literal:`intrare`},r={nan:`NaN`,string:`șir`,number:`număr`,boolean:`boolean`,function:`funcție`,array:`matrice`,object:`obiect`,undefined:`nedefinit`,symbol:`simbol`,bigint:`număr mare`,void:`void`,never:`never`,map:`hartă`,set:`set`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input);return`Intrare invalidă: așteptat ${t}, primit ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Intrare invalidă: așteptat ${N(e.values[0])}`:`Opțiune invalidă: așteptat una dintre ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Prea mare: așteptat ca ${e.origin??`valoarea`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemente`}`:`Prea mare: așteptat ca ${e.origin??`valoarea`} să fie ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Prea mic: așteptat ca ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Prea mic: așteptat ca ${e.origin} să fie ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Șir invalid: trebuie să înceapă cu "${t.prefix}"`:t.format===`ends_with`?`Șir invalid: trebuie să se termine cu "${t.suffix}"`:t.format===`includes`?`Șir invalid: trebuie să includă "${t.includes}"`:t.format===`regex`?`Șir invalid: trebuie să se potrivească cu modelul ${t.pattern}`:`Format invalid: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Număr invalid: trebuie să fie multiplu de ${e.divisor}`;case`unrecognized_keys`:return`Chei nerecunoscute: ${j(e.keys,`, `)}`;case`invalid_key`:return`Cheie invalidă în ${e.origin}`;case`invalid_union`:return`Intrare invalidă`;case`invalid_element`:return`Valoare invalidă în ${e.origin}`;default:return`Intrare invalidă`}}};function Ap(){return{localeError:kp()}}function jp(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}var Mp=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},map:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,mac:`MAC адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,credit_card:`номер кредитной карты`,jwt:`JWT`,template_literal:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${N(e.values[0])}`:`Неверный вариант: ожидалось одно из ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=jp(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=jp(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function Np(){return{localeError:Mp()}}var Pp=()=>{let e={string:{unit:`znakov`,verb:`mať`},file:{unit:`bajtov`,verb:`mať`},array:{unit:`prvkov`,verb:`mať`},set:{unit:`prvkov`,verb:`mať`},map:{unit:`položiek`,verb:`mať`}};function t(t){return e[t]??null}let n={regex:`regulárny výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`dátum a čas vo formáte ISO`,date:`dátum vo formáte ISO`,time:`čas vo formáte ISO`,duration:`doba trvania ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,mac:`MAC adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`reťazec zakódovaný vo formáte base64`,base64url:`reťazec zakódovaný vo formáte base64url`,json_string:`reťazec vo formáte JSON`,e164:`číslo E.164`,credit_card:`číslo kreditnej karty`,jwt:`JWT`,template_literal:`vstup`},r={nan:`NaN`,number:`číslo`,string:`reťazec`,function:`funkcia`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očakávané instanceof ${e.expected}, obdržané ${i}`:`Neplatný vstup: očakávané ${t}, obdržané ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očakávané ${N(e.values[0])}`:`Neplatný vstup: očakávaná jedna z hodnôt ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je príliš veľká: ${e.origin??`hodnota`} musí mať ${n}${e.maximum.toString()} ${r.unit??`prvkov`}`:`Hodnota je príliš veľká: ${e.origin??`hodnota`} musí byť ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je príliš malá: ${e.origin??`hodnota`} musí mať ${n}${e.minimum.toString()} ${r.unit??`prvkov`}`:`Hodnota je príliš malá: ${e.origin??`hodnota`} musí byť ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný reťazec: musí začínať na "${t.prefix}"`:t.format===`ends_with`?`Neplatný reťazec: musí končiť na "${t.suffix}"`:t.format===`includes`?`Neplatný reťazec: musí obsahovať "${t.includes}"`:t.format===`regex`?`Neplatný reťazec: musí zodpovedať vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí byť násobkom ${e.divisor}`;case`unrecognized_keys`:return`Neznáme klúče: ${j(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klúč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function Fp(){return{localeError:Pp()}}var Ip=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`},map:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,mac:`MAC naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,credit_card:`številka kreditne kartice`,jwt:`JWT`,template_literal:`vnos`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${N(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function Lp(){return{localeError:Ip()}}var Rp=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`},map:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-adress`,ipv6:`IPv6-adress`,mac:`MAC-adress`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,credit_card:`kreditkortsnummer`,jwt:`JWT`,template_literal:`mall-literal`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${N(e.values[0])}`:`Ogiltigt val: förväntade en av ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function zp(){return{localeError:Rp()}}var Bp=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},map:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,mac:`MAC முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,credit_card:`கடன் அட்டை எண்`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${N(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${j(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function Vp(){return{localeError:Bp()}}var Hp=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`},map:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,mac:`ที่อยู่ MAC`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,credit_card:`หมายเลขบัตรเครดิต`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${N(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${j(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function Up(){return{localeError:Hp()}}var Wp=()=>{let e={string:{unit:`simwol`,verb:`bolmaly`},file:{unit:`baýt`,verb:`bolmaly`},array:{unit:`elementler`,verb:`bolmaly`},set:{unit:`elementler`,verb:`bolmaly`},map:{unit:`elementler`,verb:`bolmaly`}};function t(t){return e[t]??null}let n={regex:`giriş`,email:`e-poçta salgysy`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sene we wagt`,date:`ISO sene`,time:`ISO wagt`,duration:`ISO wagt aralygy`,ipv4:`IPv4 salgysy`,ipv6:`IPv6 salgysy`,mac:`MAC salgysy`,cidrv4:`IPv4 aralygy`,cidrv6:`IPv6 aralygy`,base64:`base64 bilen şifrlenen setir`,base64url:`base64url bilen şifrlenen setir`,json_string:`JSON setiri`,e164:`E.164 nomeri`,credit_card:`kredit kartynyň nomeri`,jwt:`JWT`,template_literal:`şablon`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input);return`Nädogry baha: garaşylan ${t} ýerine ${r[n]??n} alyndy`}case`invalid_value`:return e.values.length===1?`Nädogry baha: ${N(e.values[0])} bolmaly`:`Nädogry saýlaw: aşakdakylardan biri bolmaly: ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Has uly: garaşylýan ${e.origin??`baha`} ${n} ${e.maximum.toString()} ${r.unit??`element`}`:`Has uly: garaşylýan ${e.origin??`baha`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Has kiçi: garaşylýan ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`Has kiçi: garaşylýan ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nädogry setir: "${t.prefix}" bilen başlamaly`:t.format===`ends_with`?`Nädogry setir: "${t.suffix}" bilen gutarmaly`:t.format===`includes`?`Nädogry setir: "${t.includes}" saklamaly`:t.format===`regex`?`Nädogry setir: ${t.pattern} nusga laýyk bolmaly`:`Nädogry ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nädogry san: ${e.divisor} bilen galyndysyz bölünmeli`;case`unrecognized_keys`:return`Tanalmaýan açar${e.keys.length>1?`lar`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde nädogry açar`;case`invalid_union`:return`Nädogry baha`;case`invalid_element`:return`${e.origin} içinde nädogry baha`;default:return`Nädogry baha`}}};function Gp(){return{localeError:Wp()}}var Kp=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`},map:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,mac:`MAC adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,credit_card:`kredi kartı numarası`,jwt:`JWT`,template_literal:`Şablon dizesi`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${N(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function qp(){return{localeError:Kp()}}var Jp=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`},map:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,mac:`адреса MAC`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,credit_card:`номер кредитної картки`,jwt:`JWT`,template_literal:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${N(e.values[0])}`:`Неправильна опція: очікується одне з ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function Yp(){return{localeError:Jp()}}function Xp(){return Yp()}var Zp=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`},map:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,mac:`ایم اے سی ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,credit_card:`کریڈٹ کارڈ نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${N(e.values[0])} متوقع تھا`:`غلط آپشن: ${j(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${j(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function Qp(){return{localeError:Zp()}}var $p=()=>{let e={string:{unit:`belgi`,verb:`bo‘lishi kerak`},file:{unit:`bayt`,verb:`bo‘lishi kerak`},array:{unit:`element`,verb:`bo‘lishi kerak`},set:{unit:`element`,verb:`bo‘lishi kerak`},map:{unit:`yozuv`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let n={regex:`kirish`,email:`elektron pochta manzili`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sana va vaqti`,date:`ISO sana`,time:`ISO vaqt`,duration:`ISO davomiylik`,ipv4:`IPv4 manzil`,ipv6:`IPv6 manzil`,mac:`MAC manzil`,cidrv4:`IPv4 diapazon`,cidrv6:`IPv6 diapazon`,base64:`base64 kodlangan satr`,base64url:`base64url kodlangan satr`,json_string:`JSON satr`,e164:`E.164 raqam`,credit_card:`kredit karta raqami`,jwt:`JWT`,template_literal:`kirish`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${N(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}};function em(){return{localeError:$p()}}var tm=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`},map:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,mac:`địa chỉ MAC`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,credit_card:`số thẻ tín dụng`,jwt:`JWT`,template_literal:`đầu vào`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${N(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${n[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${j(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function nm(){return{localeError:tm()}}var rm=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`},map:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,mac:`MAC地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,credit_card:`信用卡号`,jwt:`JWT`,template_literal:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${N(e.values[0])}`:`无效选项:期望以下之一 ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${j(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function im(){return{localeError:rm()}}var am=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`},map:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,mac:`MAC 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,credit_card:`信用卡號`,jwt:`JWT`,template_literal:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${N(e.values[0])}`:`無效的選項:預期為以下其中之一 ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${j(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function om(){return{localeError:am()}}var sm=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`},map:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,mac:`àdírẹ́sì MAC`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,credit_card:`nọmba kaadi gbese`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=P(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${N(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${j(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${j(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function cm(){return{localeError:sm()}}var lm=n({ar:()=>Ud,az:()=>Gd,be:()=>Jd,bg:()=>Xd,bn:()=>Qd,ca:()=>ef,ckb:()=>nf,cs:()=>af,da:()=>sf,de:()=>lf,el:()=>df,en:()=>pf,eo:()=>hf,es:()=>_f,fa:()=>yf,fi:()=>xf,fr:()=>Cf,frCA:()=>Tf,gu:()=>Df,he:()=>kf,hi:()=>jf,hr:()=>Nf,hu:()=>Ff,hy:()=>zf,id:()=>Vf,is:()=>Uf,it:()=>Gf,ja:()=>qf,ka:()=>Yf,kh:()=>Qf,km:()=>Zf,kn:()=>ep,ko:()=>np,lt:()=>op,mk:()=>cp,ms:()=>up,ne:()=>fp,nl:()=>mp,nn:()=>gp,no:()=>vp,ota:()=>bp,pl:()=>wp,ps:()=>Sp,pt:()=>Ep,ptBR:()=>Op,ro:()=>Ap,ru:()=>Np,sk:()=>Fp,sl:()=>Lp,sv:()=>zp,ta:()=>Vp,th:()=>Up,tk:()=>Gp,tr:()=>qp,ua:()=>Xp,uk:()=>Yp,ur:()=>Qp,uz:()=>em,vi:()=>nm,yo:()=>cm,zhCN:()=>im,zhTW:()=>om}),um,dm=Symbol(`ZodOutput`),fm=Symbol(`ZodInput`),pm=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function mm(){return new pm}(um=globalThis).__zod_globalRegistry??(um.__zod_globalRegistry=mm());var hm=globalThis.__zod_globalRegistry,gm=Symbol.for(`zod.compile.invalid`),_m=Symbol.for(`zod.compile.fallback`),vm=class extends Error{constructor(e=`z.compile does not support async refinements, transforms, or checks`){super(e),this.name=`ZodCompileAsyncError`}},ym=class extends Error{constructor(e,t=!0){super(`z.compile does not support ${e}; this schema must use the runtime parser`),this.name=`ZodCompileUnsupportedError`,this.islandable=t}};function bm(e,t){try{return Cm(e,{assertOnly:!0})}catch{return t}}function xm(e,t){try{let t=Cm(e),n=Ja(e),r=e._zod.run,i=r.__originalRun??r,a=(e,n)=>{if(n?.async||n?.direction===`backward`||n?.skipChecks||n?.[_m]||n&&Vd(n,e.value))return i(e,n);let r=t(e.value);return r===gm?(n&&(n[_m]=!0),i(e,n)):(e.value=r,e)};return a.__originalRun=i,n._zod.bag.fallbackRun=i,n._zod.bag.validator=bm(e,t),n._zod.run=a,r.__originalRun||Sm(n,e,t),n}catch(n){if(t?.strict)throw n;return e}}function Sm(e,t,n){let r=e,i=t;if(typeof i.safeParse==`function`){let e=i.safeParse;r.safeParse=(t,r)=>{let i=n(t);return i===gm?e(t,r):{success:!0,data:i}}}if(typeof i.parse==`function`){let e=i.parse;r.parse=(t,r)=>{let i=n(t);return i===gm?e(t,r):i}}}function Cm(e,t){let n=!0;try{n=Fd(e)}catch{}if(n)throw new ym(`a schema whose subtree contains a reference cycle`);let r={constants:new Map,constantCounter:0,varCounter:0},i=new Cl([`input`]),a=Gm(i,r,e,`input`,!t?.assertOnly);i.write(a===null?`return true;`:`return ${a};`);let o=[`INVALID`,...r.constants.keys()],s=[gm,...r.constants.values()],c=i.content.join(`
|
|
61
|
-
`),l=t?.debug?o.length>0?`// Constants: ${o.join(`, `)}\n${c}`:c:``,u=Function,d=`return (input) => {\n${c}\n}`,f;try{f=new u(...o,d)(...s)}catch(e){throw new ym(`this schema (generated code failed to evaluate: ${e.message})`)}return t?.debug&&(f.code=l),f}function H(e,t){for(let[n,r]of e.constants)if(r===t)return n;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function U(e){return`v${e.varCounter++}`}function wm(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then==`function`)return gm;let r=n;return r.issues.length===0?r.value:gm}function Tm(e,t,n,r,i=!0){let a=e.content.length,o=t.constants.size,s=t.constantCounter,c=t.varCounter;try{return Gm(e,t,n,r,i)}catch(i){if(!(i instanceof ym)||!i.islandable)throw i;if(e.content.length=a,t.constants.size>o){let e=Array.from(t.constants.keys()).slice(o);for(let n of e)t.constants.delete(n)}return t.constantCounter=s,t.varCounter=c,Em(e,t,n,r)}}function Em(e,t,n,r){let i=H(t,n),a=H(t,wm),o=U(t);return e.write(`const ${o} = ${a}(${i}, ${r});`),e.write(`if (${o} === INVALID) return INVALID;`),o}var Dm=new Set([`max_size`,`min_size`,`size_equals`,`max_length`,`min_length`,`length_equals`]);function Om(e,t,n,r){let i=n._zod.def.checks;if(!i||i.length===0)return r;let a=r;for(let n of i){let r=n._zod.def;if(r.when&&!Dm.has(r.check))throw new ym(`check with a custom "when" condition`);switch(r.check){case`greater_than`:Mm(e,t,r,a);break;case`less_than`:Nm(e,t,r,a);break;case`multiple_of`:Pm(e,t,r,a);break;case`number_format`:Fm(e,r,a);break;case`min_length`:{let n=Am(r.minimum,`min_length`),i=km(e,t,a,`${a}.length >= ${n} && ${a}.length < ${r.minimum*2}`);e.write(`if (${i} < ${n}) return INVALID;`);break}case`max_length`:{let n=Am(r.maximum,`max_length`),i=km(e,t,a,`${a}.length > ${n}`);e.write(`if (${i} > ${n}) return INVALID;`);break}case`length_equals`:{let n=Am(r.length,`length_equals`),i=km(e,t,a,`${a}.length >= ${n} && ${a}.length <= ${r.length*2}`);e.write(`if (${i} !== ${n}) return INVALID;`);break}case`min_size`:e.write(`if (${a}.size < ${Am(r.minimum,`min_size`)}) return INVALID;`);break;case`max_size`:e.write(`if (${a}.size > ${Am(r.maximum,`max_size`)}) return INVALID;`);break;case`size_equals`:e.write(`if (${a}.size !== ${Am(r.size,`size_equals`)}) return INVALID;`);break;case`string_format`:a=Wm(e,t,r,a);break;case`custom`:a=Hm(e,t,n,a);break;case`bigint_format`:Im(e,r,a);break;case`mime_type`:Lm(e,t,r,a);break;case`property`:Rm(e,t,r,a);break;case`overwrite`:{let r=U(t);zm(e,t,n,a,r),a=r;break}default:throw new ym(`check type ${r.check}`)}}return a}function km(e,t,n,r){let i=H(t,ho),a=U(t);return e.write(`const ${a} = typeof ${n} === "string" && ${r} ? ${i}(${n}) : ${n}.length;`),a}function Am(e,t){if(typeof e!=`number`||!Number.isFinite(e))throw new ym(`${t} bound of type ${typeof e}`);return`${e}`}function jm(e,t){if(typeof t==`bigint`)return`${t}n`;if(typeof t==`number`){if(Number.isNaN(t))throw new ym(`comparison check with NaN bound`);return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new ym(`comparison check with Invalid Date bound`);return H(e,t)}throw new ym(`comparison check bound of type ${typeof t}`)}function Mm(e,t,n,r){let i=n.inclusive?`<`:`<=`;e.write(`if (${r} ${i} ${jm(t,n.value)}) return INVALID;`)}function Nm(e,t,n,r){let i=n.inclusive?`>`:`>=`;e.write(`if (${r} ${i} ${jm(t,n.value)}) return INVALID;`)}function Pm(e,t,n,r){if(typeof n.value==`bigint`){if(n.value===BigInt(0))throw new ym(`multiple_of check with a zero divisor`);e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let i=H(t,Ea);e.write(`if (${i}(${r}, ${Am(n.value,`multiple_of`)}) !== 0) return INVALID;`)}}function Fm(e,t,n){let r=t.format;switch(r){case`safeint`:e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case`int32`:e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case`uint32`:e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case`float32`:e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case`float64`:e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new ym(`number format ${r}`)}}function Im(e,t,n){let r=t.format;if(r)switch(r){case`int64`:e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case`uint64`:e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new ym(`bigint format ${r}`)}}function Lm(e,t,n,r){let i=n.mime;if(i&&i.length>0){let n=H(t,new Set(i));e.write(`if (!${n}.has(${r}.type)) return INVALID;`)}}function Rm(e,t,n,r){let i=`${r}[${JSON.stringify(n.property)}]`;Gm(e,t,n.schema,i)}function zm(e,t,n,r,i){let a=n._zod.def.tx;if(!a)throw new ym(`overwrite check without a transform function`);if(Ah(a))throw new vm(`z.compile: async overwrite transforms are not supported`);let o=H(t,a);e.write(`const ${i} = ${o}(${r});`)}function Bm(){throw new Ho}function Vm(e){this.issues.push(e)}function Hm(e,t,n,r){let i=n._zod.def;if(i.fn){if(Ah(i.fn))throw new vm(`z.compile: async .refine() predicates are not supported`);let n=H(t,i.fn),a=H(t,Bm),o=U(t);return e.write(`const ${o} = ${n}(${r});`),e.write(`if (${o} instanceof Promise) ${a}();`),e.write(`if (!${o}) return INVALID;`),r}if(n._zod.check){if(Ah(n._zod.check))throw new vm(`z.compile: async .superRefine() / check functions are not supported`);let i=n._zod.check,a=H(t,e=>{let t={value:e,issues:[],addIssue:Vm};return i(t)instanceof Promise&&Bm(),t.issues.length===0?t.value:gm}),o=U(t);return e.write(`const ${o} = ${a}(${r});`),e.write(`if (${o} === INVALID) return INVALID;`),o}throw new ym(`custom check without a predicate or check function`)}var Um=new Set([`cidrv4`,`cuid`,`cuid2`,`date`,`datetime`,`duration`,`e164`,`email`,`emoji`,`ends_with`,`guid`,`includes`,`ipv4`,`ksuid`,`lowercase`,`mac`,`nanoid`,`regex`,`starts_with`,`time`,`ulid`,`uppercase`,`uuid`,`xid`]);function Wm(e,t,n,r){let i=n.format;if(i===`base64`){let n=H(t,tu);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(i===`base64url`){let n=H(t,ru);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(i===`jwt`){let i=H(t,uu),a=H(t,n.alg??null);return e.write(`if (!${i}(${r}, ${a})) return INVALID;`),r}if(i===`ipv6`){let n=H(t,Yl);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(i===`cidrv6`){let n=H(t,$l);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(i===`credit_card`){let n=H(t,cu);return e.write(`if (!${n}(${r})) return INVALID;`),r}let a=n;if(i===`url`||i===`httpurl`||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let i=H(t,Ml),o=H(t,n),s=U(t),c=U(t);if(e.write(`const ${s} = ${r}.trim();`),e.write(`const ${c} = ${i}(${s}, ${o});`),e.write(`if (typeof ${c} === "number") return INVALID;`),a.hostname!==void 0){let n=H(t,Fl);e.write(`if (!${n}(${c}, ${o}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let n=H(t,Il);e.write(`if (!${n}(${c}, ${o}.protocol)) return INVALID;`)}let l=U(t),u=a.normalize?`${c}.href`:`${H(t,Pl)}(${s})`;return e.write(`const ${l} = ${u};`),l}let o=n.fn;if(o){if(Ah(o))throw new ym(`async string format ${i}`);let n=H(t,o);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(Um.has(i)&&n.pattern){let i=H(t,n.pattern);return e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${r})) return INVALID;`),r}let s=n.format;switch(s){case`regex`:throw new ym(`regex format without a pattern`);case`lowercase`:e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case`uppercase`:e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case`includes`:e.write(`if (!${r}.includes(${Ia(n.includes)})) return INVALID;`);break;case`starts_with`:{let t=n.prefix;e.write(`if (${r}.slice(0, ${t.length}) !== ${Ia(t)}) return INVALID;`);break}case`ends_with`:{let t=n.suffix;e.write(`if (${r}.slice(-${t.length}) !== ${Ia(t)}) return INVALID;`);break}default:throw new ym(`string format ${s}`)}return r}function Gm(e,t,n,r,i=!0){let a=n._zod.def,o=a.type;if(a.coerce)throw new ym(`coercion (z.coerce.${o}())`);let s=i||!!a.checks?.length,c;switch(o){case`string`:c=Km(e,t,n,r);break;case`number`:c=qm(e,n,r);break;case`boolean`:c=Jm(e,r);break;case`bigint`:c=Ym(e,n,r);break;case`symbol`:c=Xm(e,r);break;case`undefined`:c=Zm(e,r);break;case`null`:c=Qm(e,r);break;case`any`:case`unknown`:c=r;break;case`never`:e.write(`return INVALID;`),c=r;break;case`void`:c=$m(e,r);break;case`nan`:c=eh(e,r);break;case`date`:c=th(e,r);break;case`object`:c=nh(e,t,n,r,s);break;case`optional`:c=rh(e,t,n,r,s);break;case`nullable`:c=lh(e,t,n,r,s);break;case`array`:c=uh(e,t,n,r,s);break;case`literal`:c=dh(e,t,n,r);break;case`enum`:c=fh(e,t,n,r);break;case`readonly`:{let i=ph(e,t,n,r),a=U(t);e.write(`const ${a} = Object.freeze(${i});`),c=a;break}case`success`:ph(e,t,n,r),c=`true`;break;case`default`:case`prefault`:c=mh(e,t,n,r);break;case`nonoptional`:c=hh(e,t,n,r);break;case`tuple`:c=gh(e,t,n,r);break;case`union`:c=vh(e,t,n,r);break;case`intersection`:c=xh(e,t,n,r);break;case`record`:c=Sh(e,t,n,r);break;case`map`:c=wh(e,t,n,r);break;case`set`:c=Th(e,t,n,r);break;case`file`:c=Eh(e,r);break;case`template_literal`:c=Dh(e,t,n,r);break;case`lazy`:c=Oh(e,t,n,r);break;case`pipe`:c=kh(e,t,n,r);break;case`custom`:c=jh(e,t,n,r);break;case`transform`:c=Ph(e,t,n,r);break;case`catch`:c=Nh(e,t,n,r);break;default:throw new ym(`schema type ${o}`)}return c===null?null:Om(e,t,n,c)}function Km(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.def;return i.format===void 0?r:Wm(e,t,i,r)}function qm(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check===`number_format`&&r.format&&Fm(e,{format:r.format},n),n}function Jm(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Ym(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case`int64`:e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case`uint64`:e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`)}return n}function Xm(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Zm(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Qm(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function $m(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function eh(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function th(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function nh(e,t,n,r,i=!0){let a=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let o=a.shape,s=Object.keys(o),c=Object.getOwnPropertySymbols(o),l=c.length?[...s,...c]:s,u=e=>typeof e==`symbol`?H(t,e):Ia(e),d=e=>typeof e==`symbol`?`[${u(e)}]`:Ia(e),f=o;if(s.includes(`__proto__`))throw new ym(`object shape key "__proto__"`);let p=new Map;for(let n of l){let a=f[n],o=u(n),s=U(t);if(e.write(`const ${s} = ${r}[${o}];`),a._zod.optin!==void 0){let i=U(t);e.write(`let ${i} = (() => {`),e.indented(e=>{let n=Tm(e,t,a,s);e.write(`return ${n};`)}),e.write(`})();`),a._zod.optout===`optional`?(e.write(`if (${i} === INVALID) {`),e.indented(e=>{e.write(`if (${o} in ${r}) return INVALID;`),e.write(`${i} = undefined;`)}),e.write(`}`)):e.write(`if (${i} === INVALID) return INVALID;`),p.set(n,i)}else{ah(a)&&e.write(`if (!(${o} in ${r})) return INVALID;`);let c=Tm(e,t,a,s,i);c!==null&&p.set(n,c)}}let m=a.catchall,h=`none`;if(m){let t=m._zod.def.type;if(t===`never`){let t=s.map(e=>`k !== ${Ia(e)}`).join(` && `)||`true`;e.write(`for (const k in ${r}) {`),e.indented(e=>{e.write(`if (${t}) return INVALID;`)}),e.write(`}`)}else h=(t===`unknown`||t===`any`)&&!m._zod.def.checks?.length?`passthrough`:`schema`}let g=U(t),_=l.some(e=>ch(f[e])||sh(f[e]));if(!i){if(h===`schema`){let n=s.length>0?H(t,new Set(s)):null;e.write(`for (const k in ${r}) {`),e.indented(e=>{e.write(`if (k === "__proto__") continue;`),n&&e.write(`if (${n}.has(k)) continue;`);let i=U(t);e.write(`const ${i} = ${r}[k];`),Tm(e,t,m,i,!1)}),e.write(`}`)}return null}if(_){e.write(`const ${g} = {};`);for(let t of l){let n=u(t),i=p.get(t);sh(f[t])?e.write(`if (${n} in ${r}) ${g}[${n}] = ${i};`):ch(f[t])?e.write(`if (${i} !== undefined || ${n} in ${r}) ${g}[${n}] = ${i};`):e.write(`${g}[${n}] = ${i};`)}}else{let t=l.map(e=>`${d(e)}: ${p.get(e)}`).join(`, `);e.write(`const ${g} = { ${t} };`)}if(h!==`none`){let n=s.length>0?H(t,new Set(s)):null;e.write(`for (const k in ${r}) {`),e.indented(e=>{if(e.write(`if (k === "__proto__") continue;`),n&&e.write(`if (${n}.has(k)) continue;`),h===`passthrough`)e.write(`${g}[k] = ${r}[k];`);else{let n=U(t);e.write(`const ${n} = ${r}[k];`);let i=Tm(e,t,m,n);e.write(`${g}[k] = ${i};`)}}),e.write(`}`)}return g}function rh(e,t,n,r,i=!0){let a=n._zod.def;if(ih(n))return Gm(e,t,a.innerType,r,i);if(a.innerType._zod.optin===`defaulted`){let n=U(t),i=U(t);return e.write(`let ${n};`),e.write(`if (${r} === undefined) {`),e.indented(e=>{e.write(`const ${i} = (() => {`),e.indented(e=>{let n=Gm(e,t,a.innerType,r);e.write(`return ${n};`)}),e.write(`})();`),e.write(`if (${i} !== INVALID) ${n} = ${i};`)}),e.write(`} else {`),e.indented(e=>{let i=Gm(e,t,a.innerType,r);e.write(`${n} = ${i};`)}),e.write(`}`),n}let o=i?U(t):null;return o&&e.write(`let ${o};`),e.write(`if (${r} !== undefined) {`),e.indented(e=>{let n=Gm(e,t,a.innerType,r,i);o&&n!==null&&e.write(`${o} = ${n};`)}),e.write(`}`),o}function ih(e){return e._zod.traits?.has(`$ZodExactOptional`)===!0}function ah(e){return e._zod.optin===void 0&&oh(e)}function oh(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case`any`:case`unknown`:case`undefined`:case`void`:case`default`:case`prefault`:case`transform`:case`custom`:case`lazy`:return!0;case`string`:case`number`:case`boolean`:case`bigint`:case`symbol`:case`null`:case`never`:case`nan`:case`date`:case`object`:case`array`:case`tuple`:case`record`:case`map`:case`set`:case`file`:case`template_literal`:return!1;case`nonoptional`:return t.innerType?oh(t.innerType):!1;case`literal`:return!!t.values?.includes(void 0);case`enum`:return!!e._zod.values?.has(void 0);case`optional`:case`nullable`:case`readonly`:case`success`:return!t.innerType||oh(t.innerType);case`catch`:return!0;case`union`:return!t.options||t.options.some(oh);case`intersection`:return!t.left||!t.right||oh(t.left)&&oh(t.right);case`pipe`:return!t.in||oh(t.in);default:return!0}}function sh(e){return e._zod.optin===`optional`&&e._zod.optout===`optional`}function ch(e){let t=e._zod.def;switch(t.type){case`string`:case`number`:case`boolean`:case`bigint`:case`symbol`:case`null`:case`nan`:case`date`:case`object`:case`array`:case`tuple`:case`record`:case`map`:case`set`:case`file`:case`template_literal`:case`never`:case`success`:return!1;case`literal`:return!!t.values?.includes(void 0);case`enum`:return!!e._zod.values?.has(void 0);case`optional`:return!0;case`nullable`:case`readonly`:case`nonoptional`:return!t.innerType||ch(t.innerType);case`union`:return!t.options||t.options.some(ch);case`intersection`:return!t.left||!t.right||ch(t.left)||ch(t.right);case`pipe`:return!t.out||ch(t.out);default:return!0}}function lh(e,t,n,r,i=!0){let a=n._zod.def,o=i?U(t):null;return o&&e.write(`let ${o} = null;`),e.write(`if (${r} !== null) {`),e.indented(e=>{let n=Gm(e,t,a.innerType,r,i);o&&n!==null&&e.write(`${o} = ${n};`)}),e.write(`}`),o}function uh(e,t,n,r,i=!0){let a=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`);let o=i?U(t):null,s=U(t),c=U(t);return o&&e.write(`const ${o} = new Array(${r}.length);`),e.write(`for (let ${s} = 0; ${s} < ${r}.length; ${s}++) {`),e.indented(e=>{e.write(`const ${c} = ${r}[${s}];`);let n=Tm(e,t,a.element,c,i);o&&n!==null&&e.write(`${o}[${s}] = ${n};`)}),e.write(`}`),o}function dh(e,t,n,r){let i=n._zod.def.values;if(i.length!==1){let n=H(t,new Set(i));return e.write(`if (!${n}.has(${r})) return INVALID;`),r}let a=i[0];if(typeof a==`number`&&Number.isNaN(a)){let n=H(t,new Set(i));return e.write(`if (!${n}.has(${r})) return INVALID;`),r}if(typeof a==`string`)e.write(`if (${r} !== ${Ia(a)}) return INVALID;`);else if(typeof a==`number`||typeof a==`boolean`)e.write(`if (${r} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${r} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof a==`bigint`)e.write(`if (${r} !== ${a}n) return INVALID;`);else throw new ym(`literal type ${typeof a}`);return r}function fh(e,t,n,r){let i=n._zod.values;if(!i)throw new ym(`enum schema without enumerated values`);let a=H(t,i);return e.write(`if (!${a}.has(${r})) return INVALID;`),r}function ph(e,t,n,r){let i=n._zod.def;return Gm(e,t,i.innerType,r)}function mh(e,t,n,r){let i=n._zod.def,a=Object.getOwnPropertyDescriptor(n._zod.def,`defaultValue`)?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type===`prefault`){if(!a)return Gm(e,t,i.innerType,r);let n=H(t,a),o=U(t);return e.write(`let ${o} = ${r};`),e.write(`if (${r} === undefined) ${o} = ${n}();`),Gm(e,t,i.innerType,o)}let o=U(t);if(a){let n=H(t,a),s=H(t,Ha);e.write(`let ${o};`),e.write(`if (${r} === undefined) {`),e.indented(e=>{e.write(`${o} = ${s}(${n}());`)}),e.write(`} else {`),e.indented(e=>{let a=Gm(e,t,i.innerType,r);e.write(`${o} = ${a} === undefined ? ${s}(${n}()) : ${a};`)}),e.write(`}`)}else e.write(`let ${o};`),e.write(`if (${r} !== undefined) {`),e.indented(e=>{let n=Gm(e,t,i.innerType,r);e.write(`${o} = ${n};`)}),e.write(`}`);return o}function hh(e,t,n,r){let i=n._zod.def,a=Gm(e,t,i.innerType,r),o=U(t);return e.write(`const ${o} = ${a};`),e.write(`if (${o} === undefined) return INVALID;`),o}function gh(e,t,n,r){let i=n._zod.def,a=i.items,o=i.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let s=_h(a,`optin`),c=_h(a,`optout`);o?e.write(`if (${r}.length < ${s}) return INVALID;`):e.write(`if (${r}.length < ${s} || ${r}.length > ${a.length}) return INVALID;`);let l=U(t);e.write(`const ${l} = [];`);for(let n=0;n<a.length;n++){let i=a[n];if(n>=c)e.write(`if (${l}.length === ${n}) {`),e.indented(e=>{e.write(`if (${n} < ${r}.length) {`),e.indented(e=>{let a=U(t);e.write(`const ${a} = ${r}[${n}];`);let o=Tm(e,t,i,a);e.write(`${l}[${n}] = ${o};`)}),e.write(`} else {`),e.indented(e=>{if(sh(i)){e.write(`${l}.length = ${n};`);return}let r=U(t),a=U(t);e.write(`const ${r} = undefined;`),e.write(`const ${a} = (() => {`),e.indented(e=>{let n=Tm(e,t,i,r);e.write(`return ${n};`)}),e.write(`})();`),e.write(`if (${a} === INVALID || ${a} === undefined) ${l}.length = ${n};`),e.write(`else ${l}[${n}] = ${a};`)}),e.write(`}`)}),e.write(`}`);else{let a=U(t);e.write(`const ${a} = ${r}[${n}];`);let o=Tm(e,t,i,a);e.write(`${l}[${n}] = ${o};`)}}if(o){let n=U(t),i=U(t);e.write(`for (let ${n} = ${a.length}; ${n} < ${r}.length; ${n}++) {`),e.indented(e=>{e.write(`const ${i} = ${r}[${n}];`);let a=Tm(e,t,o,i);e.write(`${l}[${n}] = ${a};`)}),e.write(`}`)}return l}function _h(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function vh(e,t,n,r){let i=n._zod.def,a=i.options;if(i.discriminator)return yh(e,t,i,r);if(i.inclusive===!1)throw new ym(`exclusive unions (z.xor)`);if(a.length===0)return e.write(`return INVALID;`),r;if(a.length===1)return Gm(e,t,a[0],r);if(a.every(e=>e._zod.def.type===`literal`&&!e._zod.def.checks?.length)){let n=H(t,new Set(a.flatMap(e=>e._zod.def.values)));return e.write(`if (!${n}.has(${r})) return INVALID;`),r}let o=U(t);e.write(`let ${o};`);for(let n=0;n<a.length;n++){let i=a[n];n===0?e.write(`${o} = (() => {`):e.write(`if (${o} === INVALID) ${o} = (() => {`),e.indented(e=>{let n=Gm(e,t,i,r);e.write(`return ${n};`)}),e.write(`})();`)}return e.write(`if (${o} === INVALID) return INVALID;`),o}function yh(e,t,n,r){if(n.unionFallback)throw new ym(`discriminated union with unionFallback`);if(n.options.length===0)return e.write(`return INVALID;`),r;let i=U(t),a=U(t);e.write(`const ${i} = ${r}?.[${Ia(n.discriminator)}];`),e.write(`let ${a};`);let o=!0,s=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new ym(`discriminated union option without static discriminator values`);for(let e of l){if(s.has(e))throw new ym(`duplicate discriminator value ${String(e)}`);s.add(e)}let u=Array.from(l,e=>bh(t,i,e)),d=o?`if`:`else if`;e.write(`${d} (${u.join(` || `)}) {`),e.indented(e=>{let n=Gm(e,t,c,r);e.write(`${a} = ${n};`)}),e.write(`}`),o=!1}return e.write(`else { return INVALID; }`),a}function bh(e,t,n){if(typeof n==`string`)return`${t} === ${Ia(n)}`;if(typeof n==`number`)return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n==`boolean`)return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n==`bigint`)return`${t} === ${n}n`;if(typeof n==`symbol`)return`${t} === ${H(e,n)}`;throw new ym(`literal discriminator value ${String(n)}`)}function xh(e,t,n,r){let i=n._zod.def,a=Tm(e,t,i.left,r),o=Tm(e,t,i.right,r),s=H(t,Hu),c=U(t);return e.write(`const ${c} = ${s}(${a}, ${o});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Sh(e,t,n,r){let i=n._zod.def,a=H(t,Va);e.write(`if (!${a}(${r})) return INVALID;`);let o=U(t),s=U(t),c=U(t);e.write(`const ${o} = {};`);let l=i,u=l.partial?void 0:i.keyType._zod.values;if(u){let n=[];for(let a of u){if(typeof a!=`string`&&typeof a!=`number`&&typeof a!=`symbol`)throw new ym(`record key value ${String(a)}`);let s=typeof a==`number`?a.toString():a;if(s===`__proto__`)throw new ym(`record key "__proto__"`);n.push(s);let c=H(t,a),l=Gm(e,t,i.keyType,c),u=U(t);e.write(`const ${u} = ${r}[${Ch(t,s)}];`);let d=Tm(e,t,i.valueType,u);e.write(`${o}[${l}] = ${d};`)}let a=H(t,new Set(n));return e.write(`for (const ${s} in ${r}) {`),e.indented(e=>{e.write(`if (${a}.has(${s})) continue;`),l.mode===`loose`?e.write(`if (${s} !== "__proto__") ${o}[${s}] = ${r}[${s}];`):e.write(`return INVALID;`)}),e.write(`}`),o}let d=i.keyType._zod.def;if(d.type!==`string`||d.format!==void 0||d.coerce||(d.checks?.length??0)!==0){let n=i.mode===`loose`,a=H(t,Cm(i.keyType)),c=H(t,Dc),l=H(t,Object.prototype.propertyIsEnumerable),u=U(t);return e.write(`for (const ${s} of Reflect.ownKeys(${r})) {`),e.indented(e=>{e.write(`if (${s} === "__proto__") continue;`),e.write(`if (!${l}.call(${r}, ${s})) continue;`),e.write(`let ${u} = ${a}(${s});`),e.write(`if (${u} === INVALID && typeof ${s} === "string" && ${c}.test(${s})) ${u} = ${a}(Number(${s}));`),n?e.write(`if (${u} === INVALID) { ${o}[${s}] = ${r}[${s}]; continue; }`):e.write(`if (${u} === INVALID) return INVALID;`),e.write(`if (${u} === "__proto__") continue;`);let d=U(t);e.write(`const ${d} = ${r}[${s}];`);let f=Tm(e,t,i.valueType,d);e.write(`${o}[${u}] = ${f};`)}),e.write(`}`),o}let f=H(t,Object.prototype.propertyIsEnumerable);return e.write(`for (const ${s} of Reflect.ownKeys(${r})) {`),e.indented(e=>{e.write(`if (${s} === "__proto__") continue;`),e.write(`if (!${f}.call(${r}, ${s})) continue;`),e.write(`if (typeof ${s} !== "string") return INVALID;`),e.write(`const ${c} = ${r}[${s}];`);let n=Tm(e,t,i.valueType,c);e.write(`${o}[${s}] = ${n};`)}),e.write(`}`),o}function Ch(e,t){return typeof t==`string`?Ia(t):H(e,t)}function wh(e,t,n,r){let i=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`);let a=U(t),o=U(t),s=U(t);return e.write(`const ${a} = new Map();`),e.write(`for (const [${o}, ${s}] of ${r}) {`),e.indented(e=>{let n=Gm(e,t,i.keyType,o),r=Gm(e,t,i.valueType,s);e.write(`${a}.set(${n}, ${r});`)}),e.write(`}`),a}function Th(e,t,n,r){let i=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`);let a=U(t),o=U(t);return e.write(`const ${a} = new Set();`),e.write(`for (const ${o} of ${r}) {`),e.indented(e=>{let n=Gm(e,t,i.valueType,o);e.write(`${a}.add(${n});`)}),e.write(`}`),a}function Eh(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Dh(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.pattern;if(i){let n=H(t,i);e.write(`${n}.lastIndex = 0;`),e.write(`if (!${n}.test(${r})) return INVALID;`)}return r}function Oh(e,t,n,r){let i=n._zod.def,a=H(t,i.getter),o=H(t,{parser:null});e.write(`if (!${o}.parser) {`),e.indented(e=>{e.write(`const inner = ${a}();`),e.write(`${o}.parser = function(input) {`),e.indented(e=>{e.write(`const result = inner._zod.run({ value: input, issues: [] }, {});`),e.write(`return result.issues.length === 0 ? result.value : INVALID;`)}),e.write(`};`)}),e.write(`}`);let s=U(t);return e.write(`const ${s} = ${o}.parser(${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function kh(e,t,n,r){let i=n._zod.def,a=Gm(e,t,i.in,r);if(i.transform){if(Ah(i.transform))throw new vm(`z.compile: async transforms in pipes are not supported`);let n=i.transform,r=H(t,e=>{let t={value:e,issues:[],addIssue:Vm},r=n(e,t);return r instanceof Promise?gm:t.issues.length===0?r:gm}),o=U(t);return e.write(`const ${o} = ${r}(${a});`),e.write(`if (${o} === INVALID) return INVALID;`),Gm(e,t,i.out,o)}return Gm(e,t,i.out,a)}function Ah(e){return typeof e==`function`&&(e.constructor.name===`AsyncFunction`||e[Symbol.toStringTag]===`AsyncFunction`)}function jh(e,t,n,r){let i=n._zod.def;if(i.fn){if(Ah(i.fn))throw new vm(`z.compile: async custom predicates are not supported`);let n=H(t,i.fn),a=H(t,Bm),o=U(t);e.write(`const ${o} = ${n}(${r});`),e.write(`if (${o} instanceof Promise) ${a}();`),e.write(`if (!${o}) return INVALID;`)}else throw new ym(`custom schema without a predicate function`);return r}function Mh(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then==`function`)return gm;let i=r;return i.issues.length===0?i.value:t()}function Nh(e,t,n,r){let i=n._zod.def;if(!i.catchValue[`~constantCatch`])throw new ym(`catch with a callback (only a constant catch value compiles)`,!1);let a=U(t);e.write(`let ${a} = (() => {`),e.indented(e=>{let n=Tm(e,t,i.innerType,r);e.write(`return ${n};`)}),e.write(`})();`);let o=H(t,i.innerType),s=H(t,i.catchValue),c=H(t,Mh);return e.write(`if (${a} === INVALID) {`),e.indented(e=>{e.write(`${a} = ${c}(${o}, ${s}, ${r});`),e.write(`if (${a} === INVALID) return INVALID;`)}),e.write(`}`),a}function Ph(e,t,n,r){let i=n._zod.def;if(i.transform){if(Ah(i.transform))throw new vm(`z.compile: async transforms are not supported`);let n=i.transform,a=H(t,e=>{let t={value:e,issues:[],addIssue:Vm},r=n(e,t);return r instanceof Promise?gm:t.issues.length===0?r:gm}),o=U(t);return e.write(`const ${o} = ${a}(${r});`),e.write(`if (${o} === INVALID) return INVALID;`),o}return r}function Fh(e,t){return new e({type:`string`,...M(t)})}function Ih(e,t){return new e({type:`string`,coerce:!0,...M(t)})}function Lh(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...M(t)})}function Rh(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...M(t)})}function zh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...M(t)})}function Bh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...M(t)})}function Vh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...M(t)})}function Hh(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...M(t)})}function Uh(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...M(t)})}function Wh(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...M(t)})}function Gh(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...M(t)})}function Kh(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...M(t)})}function qh(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...M(t)})}function Jh(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...M(t)})}function Yh(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...M(t)})}function Xh(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...M(t)})}function Zh(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...M(t)})}function Qh(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...M(t)})}function $h(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...M(t)})}function eg(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...M(t)})}function tg(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...M(t)})}function ng(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...M(t)})}function rg(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...M(t)})}function ig(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...M(t)})}function ag(e,t){return new e({type:`string`,format:`credit_card`,check:`string_format`,abort:!1,...M(t)})}function og(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...M(t)})}var sg={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function cg(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...M(t)})}function lg(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...M(t)})}function ug(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...M(t)})}function dg(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...M(t)})}function fg(e,t){return new e({type:`number`,checks:[],...M(t)})}function pg(e,t){return new e({type:`number`,coerce:!0,checks:[],...M(t)})}function mg(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...M(t)})}function hg(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...M(t)})}function gg(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...M(t)})}function _g(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...M(t)})}function vg(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...M(t)})}function yg(e,t){return new e({type:`boolean`,...M(t)})}function bg(e,t){return new e({type:`boolean`,coerce:!0,...M(t)})}function xg(e,t){return new e({type:`bigint`,...M(t)})}function Sg(e,t){return new e({type:`bigint`,coerce:!0,...M(t)})}function Cg(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...M(t)})}function wg(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...M(t)})}function Tg(e,t){return new e({type:`symbol`,...M(t)})}function Eg(e,t){return new e({type:`undefined`,...M(t)})}function Dg(e,t){return new e({type:`null`,...M(t)})}function Og(e){return new e({type:`any`})}function kg(e){return new e({type:`unknown`})}function Ag(e,t){return new e({type:`never`,...M(t)})}function jg(e,t){return new e({type:`void`,...M(t)})}function Mg(e,t){return new e({type:`date`,...M(t)})}function Ng(e,t){return new e({type:`date`,coerce:!0,...M(t)})}function Pg(e,t){return new e({type:`nan`,...M(t)})}function Fg(e,t){return new tl({check:`less_than`,...M(t),value:e,inclusive:!1})}function Ig(e,t){return new tl({check:`less_than`,...M(t),value:e,inclusive:!0})}function Lg(e,t){return new nl({check:`greater_than`,...M(t),value:e,inclusive:!1})}function Rg(e,t){return new nl({check:`greater_than`,...M(t),value:e,inclusive:!0})}function zg(e){return Lg(0,e)}function Bg(e){return Fg(0,e)}function Vg(e){return Ig(0,e)}function Hg(e){return Rg(0,e)}function Ug(e,t){return new rl({check:`multiple_of`,...M(t),value:e})}function Wg(e,t){return new ol({check:`max_size`,...M(t),maximum:e})}function Gg(e,t){return new sl({check:`min_size`,...M(t),minimum:e})}function Kg(e,t){return new cl({check:`size_equals`,...M(t),size:e})}function qg(e,t){return new ll({check:`max_length`,...M(t),maximum:e})}function Jg(e,t){return new ul({check:`min_length`,...M(t),minimum:e})}function Yg(e,t){return new dl({check:`length_equals`,...M(t),length:e})}function Xg(e,t){return new pl({check:`string_format`,format:`regex`,...M(t),pattern:e})}function Zg(e){return new ml({check:`string_format`,format:`lowercase`,...M(e)})}function Qg(e){return new hl({check:`string_format`,format:`uppercase`,...M(e)})}function $g(e,t){return new gl({check:`string_format`,format:`includes`,...M(t),includes:e})}function e_(e,t){return new _l({check:`string_format`,format:`starts_with`,...M(t),prefix:e})}function t_(e,t){return new vl({check:`string_format`,format:`ends_with`,...M(t),suffix:e})}function n_(e,t,n){return new bl({check:`property`,property:e,schema:t,...M(n)})}function r_(e){return Object.entries(e).map(([e,t])=>new bl({check:`property`,property:e,schema:t}))}function i_(e,t){return new xl({check:`mime_type`,mime:e,...M(t)})}function a_(e){return new Sl({check:`overwrite`,tx:e})}function o_(e){return a_(t=>t.normalize(e))}function s_(){return a_(e=>e.trim())}function c_(){return a_(e=>e.toLowerCase())}function l_(){return a_(e=>e.toUpperCase())}function u_(){return a_(e=>La(e))}function d_(e,t,n){return new e({type:`array`,element:t,...M(n)})}function f_(e,t,n){return new e({type:`union`,options:t,...M(n)})}function p_(e,t,n){return new e({type:`union`,options:t,inclusive:!1,...M(n)})}function m_(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...M(r)})}function h_(e,t,n){return new e({type:`intersection`,left:t,right:n})}function g_(e,t,n,r){let i=n instanceof R;return new e({type:`tuple`,items:t,rest:i?n:null,...M(i?r:n)})}function __(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...M(r)})}function v_(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...M(r)})}function y_(e,t,n){return new e({type:`set`,valueType:t,...M(n)})}function b_(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...M(n)})}function x_(e,t,n){return new e({type:`enum`,entries:t,...M(n)})}function S_(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...M(n)})}function C_(e,t){return new e({type:`file`,...M(t)})}function w_(e,t){return new e({type:`transform`,transform:t})}function T_(e,t){return new e({type:`optional`,innerType:t})}function E_(e,t){return new e({type:`nullable`,innerType:t})}function D_(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():Ha(n)}})}function O_(e,t,n){return new e({type:`nonoptional`,innerType:t,...M(n)})}function k_(e,t){return new e({type:`success`,innerType:t})}function A_(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:Fo(n)})}function j_(e,t,n){return new e({type:`pipe`,in:t,out:n})}function M_(e,t){return new e({type:`readonly`,innerType:t})}function N_(e,t,n){return new e({type:`template_literal`,parts:t,...M(n)})}function P_(e,t){return new e({type:`lazy`,getter:t})}function F_(e,t){return new e({type:`promise`,innerType:t})}function I_(e,t,n){let r=M(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function L_(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...M(n)})}function R_(e,t){let n=z_(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(_o(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(_o(r))}},e(t.value,t)),t);return n}function z_(e,t){let n=new Zc({check:`custom`,...M(t)});return n._zod.check=e,n}function B_(e){let t=new Zc({check:`describe`});return t._zod.onattach=[t=>{let n=hm.get(t)??{};hm.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function V_(e){let t=new Zc({check:`meta`});return t._zod.onattach=[t=>{let n=hm.get(t)??{};hm.add(t,{...n,...e})}],t._zod.check=()=>{},t}function H_(e,t){let n=M(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??vd,c=e.Boolean??hu,l=new s({type:`pipe`,in:new(e.String??Dl)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:!o.has(r)&&(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l._zod.bag.truthy=r,l._zod.bag.falsy=i,l._zod.bag.case=n.case??`insensitive`,l}function U_(e,t,n,r={}){let i=M(r),a={check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}function W_(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Aa(e,t,n[t]);return e}function G_(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??hm,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function K_(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function q_(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,q_(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&W_(o.schema,c),t.io===`input`&&rv(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function J_(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Y_(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${J_(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+J_(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
62
|
-
|
|
63
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function X_(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;X_(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Z_=new Set([`type`,`properties`,`required`,`additionalProperties`]),Q_=[`oneOf`,`anyOf`];function $_(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ev(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Z_.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??$_(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Aa(n,r,e.length===1?e[0]:ev(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=$_(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function tv(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Z_)if(t in e)return;let n=t.filter(e=>Q_.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ev(t);else{let e=n[0],i=Q_.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>ev([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,W_(e,r))}function nv(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):W_(i,s),W_(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())X_(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])tv(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}W_(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Aa(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:av(t,`input`,e.processors),output:av(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function rv(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return rv(r.element,n);if(r.type===`set`)return rv(r.valueType,n);if(r.type===`lazy`)return rv(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return rv(r.innerType,n);if(r.type===`intersection`)return rv(r.left,n)||rv(r.right,n);if(r.type===`record`||r.type===`map`)return rv(r.keyType,n)||rv(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:rv(r.in,n)||rv(r.out,n);if(r.type===`object`){for(let e in r.shape)if(rv(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(rv(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(rv(e,n))return!0;return!!(r.rest&&rv(r.rest,n))}return!1}var iv=(e,t={})=>n=>{let r=G_({...n,processors:t});return q_(e,r),Y_(r,e),nv(r,e)},av=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=G_({...i??{},target:a,io:t,processors:n});return q_(e,o),Y_(o,e),nv(o,e)},ov={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},sv=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ov[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},cv=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(Number.isFinite(c)&&c!==0?i.multipleOf=Math.abs(c):K_(e,t,i,r,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},lv=(e,t,n,r)=>{n.type=`boolean`},uv=(e,t,n,r)=>{K_(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},dv=(e,t,n,r)=>{K_(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},fv=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},pv=(e,t,n,r)=>{K_(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},mv=(e,t,n,r)=>{K_(e,t,n,r,`Void cannot be represented in JSON Schema`)},hv=(e,t,n,r)=>{n.not={}},gv=(e,t,n,r)=>{},_v=(e,t,n,r)=>{},vv=(e,t,n,r)=>{K_(e,t,n,r,`Date cannot be represented in JSON Schema`)},yv=(e,t,n,r)=>{let i=e._zod.def,a=xa(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},bv=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(K_(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(K_(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},xv=(e,t,n,r)=>{K_(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Sv=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Cv=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},wv=(e,t,n,r)=>{n.type=`boolean`},Tv=(e,t,n,r)=>{K_(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ev=(e,t,n,r)=>{K_(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Dv=(e,t,n,r)=>{K_(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ov=(e,t,n,r)=>{K_(e,t,n,r,`Map cannot be represented in JSON Schema`)},kv=(e,t,n,r)=>{K_(e,t,n,r,`Set cannot be represented in JSON Schema`)},Av=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=q_(a.element,t,{...r,path:[...r.path,`items`]})};function jv(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?jv(t.out):t.type===`catch`?jv(t.innerType):e._zod.optin}var Mv=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&K_(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Aa(i.properties,e,q_(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?jv(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=q_(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Nv=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>q_(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Pv=(e,t,n,r)=>{let i=e._zod.def,a=q_(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=q_(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Fv=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>q_(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?q_(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?jv(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=e._zod.bag;typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Iv(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Iv(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Iv(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Dc:Ec).source),p):p}var Lv=new WeakMap;function Rv(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Lv.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Iv(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var zv=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=q_(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Aa(i.patternProperties,t.source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=q_(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Lv.get(t);n||(n=[],Lv.set(t,n),t.deferred.push(()=>Rv(t))),n.push(e)}i.additionalProperties=q_(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&jv(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Bv=(e,t,n,r)=>{let i=e._zod.def,a=q_(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Vv=(e,t,n,r)=>{let i=e._zod.def;q_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hv=Symbol();function Uv(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(K_(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Hv):JSON.parse(o)}var Wv=(e,t,n,r)=>{let i=e._zod.def;q_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Uv(i.defaultValue,e,t,n,r);o!==Hv&&(n.default=o)},Gv=(e,t,n,r)=>{let i=e._zod.def;q_(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Uv(i.defaultValue,e,t,n,r);o!==Hv&&(n._prefault=o)},Kv=(e,t,n,r)=>{let i=e._zod.def;q_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{K_(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},qv=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;q_(o,t,r);let s=t.seen.get(e);s.ref=o},Jv=(e,t,n,r)=>{let i=e._zod.def;q_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yv=(e,t,n,r)=>{let i=e._zod.def;q_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xv=(e,t,n,r)=>{let i=e._zod.def;q_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zv=(e,t,n,r)=>{let i=e._zod.innerType;q_(i,t,r);let a=t.seen.get(e);a.ref=i},Qv={string:sv,number:cv,boolean:lv,bigint:uv,symbol:dv,null:fv,undefined:pv,void:mv,never:hv,any:gv,unknown:_v,date:vv,enum:yv,literal:bv,nan:xv,template_literal:Sv,file:Cv,success:wv,custom:Tv,function:Ev,transform:Dv,map:Ov,set:kv,array:Av,object:Mv,union:Nv,intersection:Pv,tuple:Fv,record:zv,nullable:Bv,nonoptional:Vv,default:Wv,prefault:Gv,catch:Kv,pipe:qv,readonly:Jv,promise:Yv,optional:Xv,lazy:Zv};function $v(e,t){if(`_idmap`in e){let n=e,r=G_({...t,processors:Qv}),i={};for(let e of n._idmap.entries()){let[t,n]=e;q_(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Y_(r,n),Aa(a,t,nv(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=G_({...t,processors:Qv});return q_(e,n),Y_(n,e),nv(n,e)}var ey=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=G_({processors:Qv,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return q_(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Y_(this.ctx,e);let{"~standard":n,...r}=nv(this.ctx,e);return r}},ty=n({}),ny=n({$ZodAny:()=>xu,$ZodArray:()=>Du,$ZodAsyncError:()=>Ho,$ZodBase64:()=>nu,$ZodBase64URL:()=>iu,$ZodBigInt:()=>gu,$ZodBigIntFormat:()=>_u,$ZodBoolean:()=>hu,$ZodCIDRv4:()=>Ql,$ZodCIDRv6:()=>eu,$ZodCUID:()=>Bl,$ZodCUID2:()=>Vl,$ZodCatch:()=>md,$ZodCheck:()=>Zc,$ZodCheckBigIntFormat:()=>al,$ZodCheckEndsWith:()=>vl,$ZodCheckGreaterThan:()=>nl,$ZodCheckIncludes:()=>gl,$ZodCheckLengthEquals:()=>dl,$ZodCheckLessThan:()=>tl,$ZodCheckLowerCase:()=>ml,$ZodCheckMaxLength:()=>ll,$ZodCheckMaxSize:()=>ol,$ZodCheckMimeType:()=>xl,$ZodCheckMinLength:()=>ul,$ZodCheckMinSize:()=>sl,$ZodCheckMultipleOf:()=>rl,$ZodCheckNumberFormat:()=>il,$ZodCheckOverwrite:()=>Sl,$ZodCheckProperty:()=>bl,$ZodCheckRegex:()=>pl,$ZodCheckSizeEquals:()=>cl,$ZodCheckStartsWith:()=>_l,$ZodCheckStringFormat:()=>fl,$ZodCheckUpperCase:()=>hl,$ZodCodec:()=>vd,$ZodCreditCard:()=>lu,$ZodCustom:()=>Od,$ZodCustomStringFormat:()=>fu,$ZodCyclicError:()=>Ad,$ZodDate:()=>Tu,$ZodDefault:()=>sd,$ZodDiscriminatedUnion:()=>Bu,$ZodE164:()=>au,$ZodEmail:()=>jl,$ZodEmoji:()=>Rl,$ZodEncodeError:()=>Uo,$ZodEnum:()=>$u,$ZodError:()=>$o,$ZodExactOptional:()=>ad,$ZodFile:()=>td,$ZodFunction:()=>Td,$ZodGUID:()=>kl,$ZodIPv4:()=>B,$ZodIPv6:()=>Xl,$ZodISODate:()=>Kl,$ZodISODateTime:()=>Gl,$ZodISODuration:()=>z,$ZodISOTime:()=>ql,$ZodIntersection:()=>Vu,$ZodJWT:()=>du,$ZodKSUID:()=>Wl,$ZodLazy:()=>Dd,$ZodLiteral:()=>ed,$ZodMAC:()=>Zl,$ZodMap:()=>Yu,$ZodNaN:()=>hd,$ZodNanoID:()=>zl,$ZodNever:()=>Cu,$ZodNonOptional:()=>ud,$ZodNull:()=>bu,$ZodNullable:()=>od,$ZodNumber:()=>pu,$ZodNumberFormat:()=>mu,$ZodObject:()=>Nu,$ZodObjectJIT:()=>Pu,$ZodOptional:()=>id,$ZodPipe:()=>gd,$ZodPrefault:()=>ld,$ZodPreprocess:()=>xd,$ZodPromise:()=>Ed,$ZodReadonly:()=>Sd,$ZodRealError:()=>es,$ZodRecord:()=>Ju,$ZodRegistry:()=>pm,$ZodSet:()=>Zu,$ZodString:()=>Dl,$ZodStringFormat:()=>Ol,$ZodSuccess:()=>fd,$ZodSymbol:()=>vu,$ZodTemplateLiteral:()=>wd,$ZodTransform:()=>nd,$ZodTuple:()=>Wu,$ZodType:()=>R,$ZodULID:()=>Hl,$ZodURL:()=>Ll,$ZodUUID:()=>Al,$ZodUndefined:()=>yu,$ZodUnion:()=>Iu,$ZodUnknown:()=>Su,$ZodVoid:()=>wu,$ZodXID:()=>Ul,$ZodXor:()=>Ru,$brand:()=>Vo,$constructor:()=>L,$input:()=>fm,$output:()=>dm,Doc:()=>Cl,INVALID:()=>gm,JSONSchema:()=>ty,JSONSchemaGenerator:()=>ey,NEVER:()=>Lo,TimePrecision:()=>sg,URL_BAD_FORMAT:()=>1,URL_UNPARSEABLE:()=>2,ZodCompileAsyncError:()=>vm,ZodCompileUnsupportedError:()=>ym,_any:()=>Og,_array:()=>d_,_base64:()=>ng,_base64url:()=>rg,_bigint:()=>xg,_boolean:()=>yg,_catch:()=>A_,_check:()=>z_,_cidrv4:()=>eg,_cidrv6:()=>tg,_coercedBigint:()=>Sg,_coercedBoolean:()=>bg,_coercedDate:()=>Ng,_coercedNumber:()=>pg,_coercedString:()=>Ih,_creditCard:()=>ag,_cuid:()=>Kh,_cuid2:()=>qh,_custom:()=>I_,_date:()=>Mg,_decode:()=>Cs,_decodeAsync:()=>Ds,_default:()=>D_,_discriminatedUnion:()=>m_,_e164:()=>ig,_email:()=>Lh,_emoji:()=>Wh,_encode:()=>xs,_encodeAsync:()=>Ts,_endsWith:()=>t_,_enum:()=>b_,_file:()=>C_,_float32:()=>hg,_float64:()=>gg,_gt:()=>Lg,_gte:()=>Rg,_guid:()=>Rh,_includes:()=>$g,_int:()=>mg,_int32:()=>_g,_int64:()=>Cg,_intersection:()=>h_,_ipv4:()=>Zh,_ipv6:()=>Qh,_isoDate:()=>lg,_isoDateTime:()=>cg,_isoDuration:()=>dg,_isoTime:()=>ug,_jwt:()=>og,_ksuid:()=>Xh,_lazy:()=>P_,_length:()=>Yg,_literal:()=>S_,_lowercase:()=>Zg,_lt:()=>Fg,_lte:()=>Ig,_mac:()=>$h,_map:()=>v_,_max:()=>Ig,_maxLength:()=>qg,_maxSize:()=>Wg,_mime:()=>i_,_min:()=>Rg,_minLength:()=>Jg,_minSize:()=>Gg,_multipleOf:()=>Ug,_nan:()=>Pg,_nanoid:()=>Gh,_nativeEnum:()=>x_,_negative:()=>Bg,_never:()=>Ag,_nonnegative:()=>Hg,_nonoptional:()=>O_,_nonpositive:()=>Vg,_normalize:()=>o_,_null:()=>Dg,_nullable:()=>E_,_number:()=>fg,_optional:()=>T_,_overwrite:()=>a_,_parse:()=>cs,_parseAsync:()=>us,_pipe:()=>j_,_positive:()=>zg,_promise:()=>F_,_properties:()=>r_,_property:()=>n_,_readonly:()=>M_,_record:()=>__,_refine:()=>L_,_regex:()=>Xg,_safeDecode:()=>js,_safeDecodeAsync:()=>Fs,_safeEncode:()=>ks,_safeEncodeAsync:()=>Ns,_safeParse:()=>fs,_safeParseAsync:()=>ms,_set:()=>y_,_size:()=>Kg,_slugify:()=>u_,_startsWith:()=>e_,_string:()=>Fh,_stringFormat:()=>U_,_stringbool:()=>H_,_success:()=>k_,_superRefine:()=>R_,_symbol:()=>Tg,_templateLiteral:()=>N_,_toLowerCase:()=>c_,_toUpperCase:()=>l_,_transform:()=>w_,_trim:()=>s_,_tuple:()=>g_,_uint32:()=>vg,_uint64:()=>wg,_ulid:()=>Jh,_undefined:()=>Eg,_union:()=>f_,_unknown:()=>kg,_uppercase:()=>Qg,_url:()=>Uh,_uuid:()=>zh,_uuidv4:()=>Bh,_uuidv6:()=>Vh,_uuidv7:()=>Hh,_void:()=>jg,_xid:()=>Yh,_xor:()=>p_,clone:()=>Ja,compile:()=>xm,compileFn:()=>Cm,config:()=>Go,createStandardJSONSchemaMethod:()=>av,createToJSONSchemaMethod:()=>iv,decode:()=>ws,decodeAsync:()=>Os,describe:()=>B_,encode:()=>Ss,encodeAsync:()=>Es,extractDefs:()=>Y_,finalize:()=>nv,flattenError:()=>ns,formatError:()=>rs,getDiscriminatedOption:()=>zu,globalConfig:()=>Wo,globalRegistry:()=>hm,handleUnrepresentable:()=>K_,initializeContext:()=>G_,isBackEdge:()=>Vd,isRecursiveSchema:()=>Fd,isValidBase64:()=>tu,isValidBase64URL:()=>ru,isValidCIDRv6:()=>$l,isValidCreditCard:()=>cu,isValidIPv6:()=>Yl,isValidJWT:()=>uu,locales:()=>lm,memoizer:()=>Bd,mergeValues:()=>Hu,meta:()=>V_,parse:()=>ls,parseAsync:()=>ds,parseURLObject:()=>Ml,prettifyError:()=>os,process:()=>q_,regexes:()=>Ls,registry:()=>mm,safeDecode:()=>Ms,safeDecodeAsync:()=>Is,safeEncode:()=>As,safeEncodeAsync:()=>Ps,safeParse:()=>ps,safeParseAsync:()=>hs,standardProps:()=>El,stripTabAndNewline:()=>Pl,toDotPath:()=>as,toJSONSchema:()=>$v,toZod:()=>_a,treeifyError:()=>is,urlHostnameOk:()=>Fl,urlProtocolOk:()=>Il,util:()=>ma,validate:()=>vs,validateAsync:()=>bs,version:()=>wl}),ry=Symbol(`z.visit/resolving`);function iy(e,t){let n=typeof t==`function`?t:(e,n)=>{let r=t[e._zod.def.type];return r?r(e,n):e},r=new Map;function i(e){let t=r.get(e);if(t===ry)return new Dd({type:`lazy`,getter:()=>r.get(e)});if(t!==void 0)return t;r.set(e,ry);let i=a(e),o=n(i,i!==e);return r.set(e,o),o}function a(e){let t=e._zod.def;switch(t.type){case`object`:{let n=t.shape,r=Object.keys(n),a=!1,o={};for(let e of r){let t=i(n[e]);t!==n[e]&&(a=!0),o[e]=t}let s=t.catchall;return t.catchall&&(s=i(t.catchall),s!==t.catchall&&(a=!0)),a?Ja(e,{...t,shape:o,catchall:s}):e}case`array`:{let n=i(t.element);return n===t.element?e:Ja(e,{...t,element:n})}case`tuple`:{let n=t.items,r=!1,a=[];for(let e of n){let t=i(e);t!==e&&(r=!0),a.push(t)}let o=t.rest;return t.rest&&(o=i(t.rest),o!==t.rest&&(r=!0)),r?Ja(e,{...t,items:a,rest:o}):e}case`record`:case`map`:{let n=i(t.keyType),r=i(t.valueType);return n===t.keyType&&r===t.valueType?e:Ja(e,{...t,keyType:n,valueType:r})}case`set`:{let n=i(t.valueType);return n===t.valueType?e:Ja(e,{...t,valueType:n})}case`union`:{let n=t.options,r=!1,a=[];for(let e of n){let t=i(e);t!==e&&(r=!0),a.push(t)}return r?Ja(e,{...t,options:a}):e}case`intersection`:{let n=i(t.left),r=i(t.right);return n===t.left&&r===t.right?e:Ja(e,{...t,left:n,right:r})}case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:{let n=i(t.innerType);return n===t.innerType?e:Ja(e,{...t,innerType:n})}case`pipe`:{let n=i(t.in),r=i(t.out);return n===t.in&&r===t.out?e:Ja(e,{...t,in:n,out:r})}case`function`:{let n=i(t.input),r=i(t.output);return n===t.input&&r===t.output?e:Ja(e,{...t,input:n,output:r})}case`lazy`:{let n=t.getter,{_cachedInner:r,...a}=t;return Ja(e,{...a,getter:()=>i(n())})}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:return e;default:return e}}return i(e)}function ay(e){return!!e._zod}function oy(e,t){return ay(e)?ps(e,t):e.safeParse(t)}function sy(e){if(!e)return;let t;if(t=ay(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function cy(e){if(ay(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var ly=n({endsWith:()=>t_,gt:()=>Lg,gte:()=>Rg,includes:()=>$g,length:()=>Yg,lowercase:()=>Zg,lt:()=>Fg,lte:()=>Ig,maxLength:()=>qg,maxSize:()=>Wg,mime:()=>i_,minLength:()=>Jg,minSize:()=>Gg,multipleOf:()=>Ug,negative:()=>Bg,nonnegative:()=>Hg,nonpositive:()=>Vg,normalize:()=>o_,overwrite:()=>a_,positive:()=>zg,properties:()=>r_,property:()=>n_,regex:()=>Xg,size:()=>Kg,slugify:()=>u_,startsWith:()=>e_,toLowerCase:()=>c_,toUpperCase:()=>l_,trim:()=>s_,uppercase:()=>Qg}),uy=new WeakSet([Object.prototype,Error.prototype]);function dy(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var fy=(e,t)=>{$o.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);uy.has(n)||(uy.add(n),dy(n,`format`,e=>t=>rs(e,t)),dy(n,`flatten`,e=>t=>ns(e,t)),dy(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Sa,2)}),dy(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Sa,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},py=L(`ZodError`,fy),my=L(`ZodError`,fy,void 0,{Parent:Error}),hy=cs(my),gy=us(my),_y=fs(my),vy=ms(my),yy=xs(my),by=Cs(my),xy=Ts(my),Sy=Ds(my),Cy=ks(my),wy=js(my),Ty=Ns(my),Ey=Fs(my),Dy=n({ZodAny:()=>ex,ZodArray:()=>ux,ZodBase64:()=>yb,ZodBase64URL:()=>xb,ZodBigInt:()=>Ub,ZodBigIntFormat:()=>Gb,ZodBoolean:()=>Vb,ZodCIDRv4:()=>hb,ZodCIDRv6:()=>_b,ZodCUID:()=>$y,ZodCUID2:()=>tb,ZodCatch:()=>eS,ZodCodec:()=>oS,ZodCreditCard:()=>Tb,ZodCustom:()=>bS,ZodCustomStringFormat:()=>kb,ZodDate:()=>cx,ZodDefault:()=>Kx,ZodDiscriminatedUnion:()=>vx,ZodE164:()=>Cb,ZodEmail:()=>Ly,ZodEmoji:()=>Yy,ZodEnum:()=>jx,ZodExactOptional:()=>Vx,ZodFile:()=>Fx,ZodFunction:()=>vS,ZodGUID:()=>zy,ZodIPv4:()=>lb,ZodIPv6:()=>pb,ZodISODate:()=>Py,ZodISODateTime:()=>Ny,ZodISODuration:()=>Iy,ZodISOTime:()=>Fy,ZodIntersection:()=>bx,ZodJWT:()=>Db,ZodKSUID:()=>sb,ZodLazy:()=>mS,ZodLiteral:()=>Px,ZodMAC:()=>db,ZodMap:()=>Dx,ZodNaN:()=>nS,ZodNanoID:()=>Zy,ZodNever:()=>ix,ZodNonOptional:()=>Xx,ZodNull:()=>Qb,ZodNullable:()=>Ux,ZodNumber:()=>Pb,ZodNumberFormat:()=>Fb,ZodObject:()=>fx,ZodOptional:()=>zx,ZodPipe:()=>iS,ZodPrefault:()=>Jx,ZodPreprocess:()=>lS,ZodPromise:()=>gS,ZodReadonly:()=>uS,ZodRecord:()=>wx,ZodSet:()=>kx,ZodString:()=>jy,ZodStringFormat:()=>My,ZodSuccess:()=>Qx,ZodSymbol:()=>Jb,ZodTemplateLiteral:()=>fS,ZodTransform:()=>Lx,ZodTuple:()=>Sx,ZodType:()=>W,ZodULID:()=>rb,ZodURL:()=>Ky,ZodUUID:()=>Vy,ZodUndefined:()=>Xb,ZodUnion:()=>hx,ZodUnknown:()=>nx,ZodVoid:()=>ox,ZodXID:()=>ab,ZodXor:()=>gx,_ZodString:()=>Ay,_default:()=>qx,_function:()=>yS,any:()=>tx,array:()=>q,base64:()=>bb,base64url:()=>Sb,bigint:()=>Wb,boolean:()=>Hb,catch:()=>tS,check:()=>xS,cidrv4:()=>gb,cidrv6:()=>vb,codec:()=>sS,creditCard:()=>Eb,cuid:()=>eb,cuid2:()=>nb,custom:()=>SS,date:()=>lx,describe:()=>TS,discriminatedUnion:()=>yx,e164:()=>wb,email:()=>Ry,emoji:()=>Xy,enum:()=>Mx,exactOptional:()=>Hx,file:()=>Ix,float32:()=>Lb,float64:()=>Rb,function:()=>yS,guid:()=>By,hash:()=>Nb,hex:()=>Mb,hostname:()=>jb,httpUrl:()=>Jy,instanceof:()=>DS,int:()=>Ib,int32:()=>zb,int64:()=>Kb,intersection:()=>xx,invertCodec:()=>cS,ipv4:()=>ub,ipv6:()=>mb,json:()=>kS,jwt:()=>Ob,keyof:()=>dx,ksuid:()=>cb,lazy:()=>hS,literal:()=>Z,looseObject:()=>mx,looseRecord:()=>Ex,mac:()=>fb,map:()=>Ox,meta:()=>ES,nan:()=>rS,nanoid:()=>Qy,nativeEnum:()=>Nx,never:()=>ax,nonoptional:()=>Zx,null:()=>$b,nullable:()=>Wx,nullish:()=>Gx,number:()=>K,object:()=>J,optional:()=>Bx,partialRecord:()=>Tx,pipe:()=>aS,prefault:()=>Yx,preprocess:()=>AS,promise:()=>_S,readonly:()=>dS,record:()=>X,refine:()=>CS,set:()=>Ax,strictObject:()=>px,string:()=>G,stringFormat:()=>Ab,stringbool:()=>OS,success:()=>$x,superRefine:()=>wS,symbol:()=>Yb,templateLiteral:()=>pS,transform:()=>Rx,tuple:()=>Cx,uint32:()=>Bb,uint64:()=>qb,ulid:()=>ib,undefined:()=>Zb,union:()=>Y,unknown:()=>rx,url:()=>qy,uuid:()=>Hy,uuidv4:()=>Uy,uuidv6:()=>Wy,uuidv7:()=>Gy,void:()=>sx,xid:()=>ob,xor:()=>_x});function Oy(){Wo.localeError||Go(pf())}function ky(){Wo.memoizer||Go({memoizer:Bd()})}var W=L(`ZodType`,(e,t)=>(Oy(),R.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ja(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ja(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(CS(e,t))},superRefine(e,t){return this.check(wS(e,t))},overwrite(e){return this.check(a_(e))},optional(){return Bx(this)},exactOptional(){return Hx(this)},nullable(){return Wx(this)},nullish(){return Bx(Wx(this))},nonoptional(e){return Zx(this,e)},array(){return q(this)},or(e){return Y([this,e])},and(e){return xx(this,e)},transform(e){return aS(this,Rx(e))},default(e){return qx(this,e)},prefault(e){return Yx(this,e)},catch(e){return tS(this,e)},pipe(e){return aS(this,e)},readonly(){return dS(this)},describe(e){let t=this.clone();return hm.add(t,{description:e}),t},meta(...e){if(e.length===0)return hm.get(this);let t=this.clone();return hm.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Do(this,`~standard`,{...El(this),jsonSchema:{input:av(this,`input`),output:av(this,`output`)}})},set"~standard"(e){Eo(this,`~standard`,e)},parse:function e(t,n){return hy(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await gy(this,t,n,{callee:e})},safeParse(e,t){return _y(this,e,t)},async safeParseAsync(e,t){return vy(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Eo(this,`spa`,e)},encode:function e(t,n){return yy(this,t,n,{callee:e})},decode:function e(t,n){return by(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await xy(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Sy(this,t,n,{callee:e})},safeEncode(e,t){return Cy(this,e,t)},safeDecode(e,t){return wy(this,e,t)},async safeEncodeAsync(e,t){return Ty(this,e,t)},async safeDecodeAsync(e,t){return Ey(this,e,t)},toJSONSchema(e){return iv(this,{})(e)},get description(){return hm.get(this)?.description},get _def(){return this._zod.def}}),Ay=L(`_ZodString`,(e,t)=>{Dl.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sv(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(Xg(...e))},includes(...e){return this.check($g(...e))},startsWith(...e){return this.check(e_(...e))},endsWith(...e){return this.check(t_(...e))},min(...e){return this.check(Jg(...e))},max(...e){return this.check(qg(...e))},length(...e){return this.check(Yg(...e))},nonempty(...e){return this.check(Jg(1,...e))},lowercase(e){return this.check(Zg(e))},uppercase(e){return this.check(Qg(e))},trim(){return this.check(s_())},normalize(...e){return this.check(o_(...e))},toLowerCase(){return this.check(c_())},toUpperCase(){return this.check(l_())},slugify(){return this.check(u_())}}),jy=L(`ZodString`,(e,t)=>{Dl.init(e,t),Ay.init(e,t)},{email(e){return this.check(Lh(Ly,e))},url(e){return this.check(Uh(Ky,e))},jwt(e){return this.check(og(Db,e))},emoji(e){return this.check(Wh(Yy,e))},guid(e){return this.check(Rh(zy,e))},uuid(e){return this.check(zh(Vy,e))},uuidv4(e){return this.check(Bh(Vy,e))},uuidv6(e){return this.check(Vh(Vy,e))},uuidv7(e){return this.check(Hh(Vy,e))},nanoid(e){return this.check(Gh(Zy,e))},cuid(e){return this.check(Kh($y,e))},cuid2(e){return this.check(qh(tb,e))},ulid(e){return this.check(Jh(rb,e))},base64(e){return this.check(ng(yb,e))},base64url(e){return this.check(rg(xb,e))},xid(e){return this.check(Yh(ab,e))},ksuid(e){return this.check(Xh(sb,e))},ipv4(e){return this.check(Zh(lb,e))},ipv6(e){return this.check(Qh(pb,e))},cidrv4(e){return this.check(eg(hb,e))},cidrv6(e){return this.check(tg(_b,e))},e164(e){return this.check(ig(Cb,e))},datetime(e){return this.check(cg(Ny,e))},date(e){return this.check(lg(Py,e))},time(e){return this.check(ug(Fy,e))},duration(e){return this.check(dg(Iy,e))}});function G(e){return Fh(jy,e)}var My=L(`ZodStringFormat`,(e,t)=>{Ol.init(e,t),Ay.init(e,t)}),Ny=L(`ZodISODateTime`,(e,t)=>{Gl.init(e,t),My.init(e,t)}),Py=L(`ZodISODate`,(e,t)=>{Kl.init(e,t),My.init(e,t)}),Fy=L(`ZodISOTime`,(e,t)=>{ql.init(e,t),My.init(e,t)}),Iy=L(`ZodISODuration`,(e,t)=>{z.init(e,t),My.init(e,t)}),Ly=L(`ZodEmail`,(e,t)=>{jl.init(e,t),My.init(e,t)});function Ry(e){return Lh(Ly,e)}var zy=L(`ZodGUID`,(e,t)=>{kl.init(e,t),My.init(e,t)});function By(e){return Rh(zy,e)}var Vy=L(`ZodUUID`,(e,t)=>{Al.init(e,t),My.init(e,t)});function Hy(e){return zh(Vy,e)}function Uy(e){return Bh(Vy,e)}function Wy(e){return Vh(Vy,e)}function Gy(e){return Hh(Vy,e)}var Ky=L(`ZodURL`,(e,t)=>{Ll.init(e,t),My.init(e,t)});function qy(e){return Uh(Ky,e)}function Jy(e){return Uh(Ky,{protocol:hc,hostname:mc,...M(e)})}var Yy=L(`ZodEmoji`,(e,t)=>{Rl.init(e,t),My.init(e,t)});function Xy(e){return Wh(Yy,e)}var Zy=L(`ZodNanoID`,(e,t)=>{zl.init(e,t),My.init(e,t)});function Qy(e){return Gh(Zy,e)}var $y=L(`ZodCUID`,(e,t)=>{Bl.init(e,t),My.init(e,t)});function eb(e){return Kh($y,e)}var tb=L(`ZodCUID2`,(e,t)=>{Vl.init(e,t),My.init(e,t)});function nb(e){return qh(tb,e)}var rb=L(`ZodULID`,(e,t)=>{Hl.init(e,t),My.init(e,t)});function ib(e){return Jh(rb,e)}var ab=L(`ZodXID`,(e,t)=>{Ul.init(e,t),My.init(e,t)});function ob(e){return Yh(ab,e)}var sb=L(`ZodKSUID`,(e,t)=>{Wl.init(e,t),My.init(e,t)});function cb(e){return Xh(sb,e)}var lb=L(`ZodIPv4`,(e,t)=>{B.init(e,t),My.init(e,t)});function ub(e){return Zh(lb,e)}var db=L(`ZodMAC`,(e,t)=>{Zl.init(e,t),My.init(e,t)});function fb(e){return $h(db,e)}var pb=L(`ZodIPv6`,(e,t)=>{Xl.init(e,t),My.init(e,t)});function mb(e){return Qh(pb,e)}var hb=L(`ZodCIDRv4`,(e,t)=>{Ql.init(e,t),My.init(e,t)});function gb(e){return eg(hb,e)}var _b=L(`ZodCIDRv6`,(e,t)=>{eu.init(e,t),My.init(e,t)});function vb(e){return tg(_b,e)}var yb=L(`ZodBase64`,(e,t)=>{nu.init(e,t),My.init(e,t)});function bb(e){return ng(yb,e)}var xb=L(`ZodBase64URL`,(e,t)=>{iu.init(e,t),My.init(e,t)});function Sb(e){return rg(xb,e)}var Cb=L(`ZodE164`,(e,t)=>{au.init(e,t),My.init(e,t)});function wb(e){return ig(Cb,e)}var Tb=L(`ZodCreditCard`,(e,t)=>{lu.init(e,t),My.init(e,t)});function Eb(e){return ag(Tb,e)}var Db=L(`ZodJWT`,(e,t)=>{du.init(e,t),My.init(e,t)});function Ob(e){return og(Db,e)}var kb=L(`ZodCustomStringFormat`,(e,t)=>{fu.init(e,t),My.init(e,t)});function Ab(e,t,n={}){return U_(kb,e,t,n)}function jb(e){return U_(kb,`hostname`,pc,e)}function Mb(e){return U_(kb,`hex`,Nc,e)}function Nb(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Ls[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return U_(kb,n,r,t)}var Pb=L(`ZodNumber`,(e,t)=>{pu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cv(e,t,n,r);let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check(Lg(e,t))},gte(e,t){return this.check(Rg(e,t))},min(e,t){return this.check(Rg(e,t))},lt(e,t){return this.check(Fg(e,t))},lte(e,t){return this.check(Ig(e,t))},max(e,t){return this.check(Ig(e,t))},int(e){return this.check(Ib(e))},safe(e){return this.check(Ib(e))},positive(e){return this.check(Lg(0,e))},nonnegative(e){return this.check(Rg(0,e))},negative(e){return this.check(Fg(0,e))},nonpositive(e){return this.check(Ig(0,e))},multipleOf(e,t){return this.check(Ug(e,t))},step(e,t){return this.check(Ug(e,t))},finite(){return this}});function K(e){return fg(Pb,e)}var Fb=L(`ZodNumberFormat`,(e,t)=>{mu.init(e,t),Pb.init(e,t)});function Ib(e){return mg(Fb,e)}function Lb(e){return hg(Fb,e)}function Rb(e){return gg(Fb,e)}function zb(e){return _g(Fb,e)}function Bb(e){return vg(Fb,e)}var Vb=L(`ZodBoolean`,(e,t)=>{hu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lv(e,t,n,r)});function Hb(e){return yg(Vb,e)}var Ub=L(`ZodBigInt`,(e,t)=>{gu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uv(e,t,n,r);let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null},{gte(e,t){return this.check(Rg(e,t))},min(e,t){return this.check(Rg(e,t))},gt(e,t){return this.check(Lg(e,t))},lt(e,t){return this.check(Fg(e,t))},lte(e,t){return this.check(Ig(e,t))},max(e,t){return this.check(Ig(e,t))},positive(e){return this.check(Lg(BigInt(0),e))},negative(e){return this.check(Fg(BigInt(0),e))},nonpositive(e){return this.check(Ig(BigInt(0),e))},nonnegative(e){return this.check(Rg(BigInt(0),e))},multipleOf(e,t){return this.check(Ug(e,t))}});function Wb(e){return xg(Ub,e)}var Gb=L(`ZodBigIntFormat`,(e,t)=>{_u.init(e,t),Ub.init(e,t)});function Kb(e){return Cg(Gb,e)}function qb(e){return wg(Gb,e)}var Jb=L(`ZodSymbol`,(e,t)=>{vu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dv(e,t,n,r)});function Yb(e){return Tg(Jb,e)}var Xb=L(`ZodUndefined`,(e,t)=>{yu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pv(e,t,n,r)});function Zb(e){return Eg(Xb,e)}var Qb=L(`ZodNull`,(e,t)=>{bu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fv(e,t,n,r)});function $b(e){return Dg(Qb,e)}var ex=L(`ZodAny`,(e,t)=>{xu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function tx(){return Og(ex)}var nx=L(`ZodUnknown`,(e,t)=>{Su.init(e,t),W.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function rx(){return kg(nx)}var ix=L(`ZodNever`,(e,t)=>{Cu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hv(e,t,n,r)});function ax(e){return Ag(ix,e)}var ox=L(`ZodVoid`,(e,t)=>{wu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mv(e,t,n,r)});function sx(e){return jg(ox,e)}var cx=L(`ZodDate`,(e,t)=>{Tu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vv(e,t,n,r),e.min=(t,n)=>e.check(Rg(t,n)),e.max=(t,n)=>e.check(Ig(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function lx(e){return Mg(cx,e)}var ux=L(`ZodArray`,(e,t)=>{ky(),Du.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Av(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Jg(e,t))},nonempty(e){return this.check(Jg(1,e))},max(e,t){return this.check(qg(e,t))},length(e,t){return this.check(Yg(e,t))},unwrap(){return this.element}});function q(e,t){return d_(ux,e,t)}function dx(e){let t=e._zod.def.shape;return Mx(Object.keys(t))}var fx=L(`ZodObject`,(e,t)=>{ky(),Pu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mv(e,t,n,r),No(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Mx(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:rx()})},loose(){return this.clone({...this._zod.def,catchall:rx()})},strict(){return this.clone({...this._zod.def,catchall:ax()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return to(this,e)},safeExtend(e){return no(this,e)},merge(e){return ro(this,e)},pick(e){return $a(this,e)},omit(e){return eo(this,e)},partial(...e){return io(zx,this,e[0])},exactPartial(...e){return io(Vx,this,e[0],`exactPartial`)},required(...e){return ao(Xx,this,e[0])}});function J(e,t){return new fx({type:`object`,shape:e??{},...M(t)})}function px(e,t){return new fx({type:`object`,shape:e,catchall:ax(),...M(t)})}function mx(e,t){return new fx({type:`object`,shape:e,catchall:rx(),...M(t)})}var hx=L(`ZodUnion`,(e,t)=>{Iu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nv(e,t,n,r),e.options=t.options});function Y(e,t){return new hx({type:`union`,options:e,...M(t)})}var gx=L(`ZodXor`,(e,t)=>{hx.init(e,t),Ru.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nv(e,t,n,r),e.options=t.options});function _x(e,t){return new gx({type:`union`,options:e,inclusive:!1,...M(t)})}var vx=L(`ZodDiscriminatedUnion`,(e,t)=>{hx.init(e,t),Bu.init(e,t)});function yx(e,t,n){return new vx({type:`union`,options:t,discriminator:e,...M(n)})}var bx=L(`ZodIntersection`,(e,t)=>{Vu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pv(e,t,n,r)});function xx(e,t){return new bx({type:`intersection`,left:e,right:t})}var Sx=L(`ZodTuple`,(e,t)=>{ky(),Wu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fv(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new zx({type:`optional`,innerType:e}))})}});function Cx(e,t,n){let r=t instanceof R;return new Sx({type:`tuple`,items:e,rest:r?t:null,...M(r?n:t)})}var wx=L(`ZodRecord`,(e,t)=>{ky(),Ju.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zv(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function X(e,t,n){return!t||!t._zod?new wx({type:`record`,keyType:G(),valueType:e,...M(t)}):new wx({type:`record`,keyType:e,valueType:t,...M(n)})}function Tx(e,t,n){return new wx({type:`record`,keyType:e,valueType:t,...M(n),partial:!0})}function Ex(e,t,n){return new wx({type:`record`,keyType:e,valueType:t,mode:`loose`,...M(n)})}var Dx=L(`ZodMap`,(e,t)=>{ky(),Yu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ov(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(Gg(...t)),e.nonempty=t=>e.check(Gg(1,t)),e.max=(...t)=>e.check(Wg(...t)),e.size=(...t)=>e.check(Kg(...t))});function Ox(e,t,n){return new Dx({type:`map`,keyType:e,valueType:t,...M(n)})}var kx=L(`ZodSet`,(e,t)=>{ky(),Zu.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kv(e,t,n,r),e.min=(...t)=>e.check(Gg(...t)),e.nonempty=t=>e.check(Gg(1,t)),e.max=(...t)=>e.check(Wg(...t)),e.size=(...t)=>e.check(Kg(...t))});function Ax(e,t){return new kx({type:`set`,valueType:e,...M(t)})}var jx=L(`ZodEnum`,(e,t)=>{$u.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yv(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new jx({...t,checks:[],...M(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new jx({...t,checks:[],...M(r),entries:i})}});function Mx(e,t){return new jx({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...M(t)})}function Nx(e,t){return new jx({type:`enum`,entries:e,...M(t)})}var Px=L(`ZodLiteral`,(e,t)=>{ed.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bv(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Z(e,t){return new Px({type:`literal`,values:Array.isArray(e)?e:[e],...M(t)})}var Fx=L(`ZodFile`,(e,t)=>{td.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cv(e,t,n,r),e.min=(t,n)=>e.check(Gg(t,n)),e.max=(t,n)=>e.check(Wg(t,n)),e.mime=(t,n)=>e.check(i_(Array.isArray(t)?t:[t],n))});function Ix(e){return C_(Fx,e)}var Lx=L(`ZodTransform`,(e,t)=>{ky(),nd.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dv(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Uo(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(_o(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(_o(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Rx(e){return new Lx({type:`transform`,transform:e})}var zx=L(`ZodOptional`,(e,t)=>{id.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bx(e){return new zx({type:`optional`,innerType:e})}var Vx=L(`ZodExactOptional`,(e,t)=>{ad.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hx(e){return new Vx({type:`optional`,innerType:e})}var Ux=L(`ZodNullable`,(e,t)=>{od.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wx(e){return new Ux({type:`nullable`,innerType:e})}function Gx(e){return Bx(Wx(e))}var Kx=L(`ZodDefault`,(e,t)=>{sd.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qx(e,t){return new Kx({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ha(t)}})}var Jx=L(`ZodPrefault`,(e,t)=>{ld.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yx(e,t){return new Jx({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ha(t)}})}var Xx=L(`ZodNonOptional`,(e,t)=>{ud.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zx(e,t){return new Xx({type:`nonoptional`,innerType:e,...M(t)})}var Qx=L(`ZodSuccess`,(e,t)=>{fd.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $x(e){return new Qx({type:`success`,innerType:e})}var eS=L(`ZodCatch`,(e,t)=>{md.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tS(e,t){return new eS({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Fo(t)})}var nS=L(`ZodNaN`,(e,t)=>{hd.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xv(e,t,n,r)});function rS(e){return Pg(nS,e)}var iS=L(`ZodPipe`,(e,t)=>{gd.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qv(e,t,n,r),e.in=t.in,e.out=t.out});function aS(e,t){return new iS({type:`pipe`,in:e,out:t})}var oS=L(`ZodCodec`,(e,t)=>{iS.init(e,t),vd.init(e,t)});function sS(e,t,n){return new oS({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function cS(e){let t=e._zod.def;return new oS({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var lS=L(`ZodPreprocess`,(e,t)=>{iS.init(e,t),xd.init(e,t)}),uS=L(`ZodReadonly`,(e,t)=>{Sd.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dS(e){return new uS({type:`readonly`,innerType:e})}var fS=L(`ZodTemplateLiteral`,(e,t)=>{wd.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sv(e,t,n,r)});function pS(e,t){return new fS({type:`template_literal`,parts:e,...M(t)})}var mS=L(`ZodLazy`,(e,t)=>{Dd.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zv(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function hS(e){return new mS({type:`lazy`,getter:e})}var gS=L(`ZodPromise`,(e,t)=>{Ed.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _S(e){return new gS({type:`promise`,innerType:e})}var vS=L(`ZodFunction`,(e,t)=>{Td.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ev(e,t,n,r)});function yS(e){return new vS({type:`function`,input:Array.isArray(e?.input)?Cx(e?.input):e?.input??q(rx()),output:e?.output??rx()})}var bS=L(`ZodCustom`,(e,t)=>{Od.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tv(e,t,n,r)});function xS(e){let t=new Zc({check:`custom`});return t._zod.check=e,t}function SS(e,t){return I_(bS,e??(()=>!0),t)}function CS(e,t={}){return L_(bS,e,t)}function wS(e,t){return R_(e,t)}var TS=B_,ES=V_;function DS(e,t={}){let n=new bS({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...M(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var OS=(...e)=>H_({Codec:oS,Boolean:Vb,String:jy},...e);function kS(e){let t=hS(()=>Y([G(e),K(),Hb(),$b(),q(t),X(G(),t)]));return t}function AS(e,t){return new lS({type:`pipe`,in:Rx(e),out:t})}var jS={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function MS(e){Go({customError:e})}function NS(){return Go().customError}var PS;PS||={};var FS=n({ZodISODate:()=>Py,ZodISODateTime:()=>Ny,ZodISODuration:()=>Iy,ZodISOTime:()=>Fy,date:()=>LS,datetime:()=>IS,duration:()=>zS,time:()=>RS});function IS(e){return cg(Ny,e)}function LS(e){return lg(Py,e)}function RS(e){return ug(Fy,e)}function zS(e){return dg(Iy,e)}var Q={...Dy,...ly,iso:FS},BS=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function VS(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function HS(e,t){return e.map((e,n)=>n<t?e:e.optional())}function US(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function WS(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1]===void 0?void 0:US(n[1]);if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function GS(e,t){return Q.transform(e=>e).check(e=>{let n=e.value;if(typeof n==`object`&&n&&!Array.isArray(n))for(let r of Object.getOwnPropertyNames(n)){let n=t.safeParse(r);n.success||e.issues.push({code:`invalid_key`,origin:`record`,issues:n.error.issues,input:r,path:[r],continue:!0})}}).pipe(e)}function KS(e,t){if(e!==!1)return e===void 0||e===!0?Q.any():YS(e,t)}var qS=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function JS(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return Q.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Q.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=YS(WS(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return Q.null();if(n.length===0)return Q.never();if(n.length===1)return Q.literal(n[0]);if(n.every(e=>typeof e==`string`))return Q.enum(n);let r=n.map(e=>Q.literal(e));return r.length<2?r[0]:Q.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return Q.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>JS({...e,type:n},t));return r.length===0?Q.never():r.length===1?r[0]:Q.union(r)}if(!n)return Q.any();let r;switch(n){case`string`:{let t=Q.string();if(e.format){let n=e.format;n===`email`?t=t.check(Q.email()):n===`uri`||n===`uri-reference`?t=t.check(Q.url()):n===`uuid`||n===`guid`?t=t.check(Q.uuid()):n===`date-time`?t=t.check(Q.iso.datetime({offset:!0})):n===`date`?t=t.check(Q.iso.date()):n===`time`?t=t.check(Q.regex(qS)):n===`duration`?t=t.check(Q.iso.duration()):n===`hostname`?t=t.check(Q.hostname()):n===`ipv4`?t=t.check(Q.ipv4()):n===`ipv6`?t=t.check(Q.ipv6()):n===`mac`?t=t.check(Q.mac()):n===`cidr`?t=t.check(Q.cidrv4()):n===`cidr-v6`?t=t.check(Q.cidrv6()):n===`base64`?t=t.check(Q.base64()):n===`base64url`?t=t.check(Q.base64url()):n===`e164`?t=t.check(Q.e164()):n===`credit_card`?t=t.check(Q.creditCard()):n===`jwt`?t=t.check(Q.jwt()):n===`emoji`?t=t.check(Q.emoji()):n===`nanoid`?t=t.check(Q.nanoid()):n===`cuid`?t=t.check(Q.cuid()):n===`cuid2`?t=t.check(Q.cuid2()):n===`ulid`?t=t.check(Q.ulid()):n===`xid`?t=t.check(Q.xid()):n===`ksuid`&&(t=t.check(Q.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?Q.number().int():Q.number();typeof e.minimum==`number`&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=Q.boolean();break;case`null`:r=Q.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]),o=typeof e.additionalProperties==`object`?YS(e.additionalProperties,t):void 0;for(let[e,r]of Object.entries(i)){let i=YS(r,t);Aa(n,e,a.has(e)?i:i.optional())}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=YS(i[e],t),r=Q.string().regex(new RegExp(e));o.push(Q.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(Q.object(n).passthrough()),s.push(...o),s.length===0)r=Q.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=Q.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=Q.intersection(e,s[t]);r=e}if(e.additionalProperties===!1){let e=Object.keys(n),t=a.map(e=>new RegExp(e)),i=r;r=r.check(n=>{if(!Va(n.value))return;let r=[];for(let i of Object.keys(n.value))e.includes(i)||t.some(e=>e.test(i))||r.push(i);r.length&&n.issues.push({code:`unrecognized_keys`,keys:r,input:n.value,inst:i})})}}else{let t=Q.object(n);r=e.additionalProperties===!1?t.strict():o?t.catchall(o):t.passthrough()}if(e.propertyNames!==void 0&&e.propertyNames!==!0){let n=typeof e.propertyNames==`object`&&e.propertyNames.type===void 0?{type:`string`,...e.propertyNames}:e.propertyNames;r=GS(r,YS(n,t))}break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=typeof e.minItems==`number`?e.minItems:0,o=HS(n.map(e=>YS(e,t)),a),s=Array.isArray(i)?void 0:KS(i,t),c=Q.tuple(o);r=s?c.rest(s):c,typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=typeof e.minItems==`number`?e.minItems:0,a=HS(i.map(e=>YS(e,t)),n),o=KS(e.additionalItems,t),s=Q.tuple(a);r=o?s.rest(o):s,typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(i!==void 0){let n=YS(i,t),a=Q.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=Q.array(Q.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function YS(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n=JS(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>YS(e,t)),a=Q.union(i);n=r?Q.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>YS(e,t)),a=Q.xor(i);n=r?Q.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf)){if(e.allOf.length===0)n=r?n:Q.any();else{let i=r?n:YS(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=Q.intersection(i,YS(e.allOf[n],t));n=i}}e.nullable===!0&&t.version===`openapi-3.0`&&(n=Q.nullable(n)),e.readOnly===!0&&(n=Q.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);e.propertyNames!==void 0&&e.type===`object`&&e.$ref===void 0&&(i.propertyNames=e.propertyNames);for(let t of Object.keys(e))BS.has(t)||Aa(i,t,e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function XS(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:VS(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??hm};return YS(n,r)}function ZS(e){return iy(e,{object:e=>e.partial(),union:e=>{let t=e._zod.def;return t.discriminator===void 0?e:Y(t.options)}})}function QS(e,t){if(!t?.length)return e;let n=e._zod.def;return Ja(e,ja(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function $S(e){return QS(e.out,e.checks)}function eC(e){return e.in._zod.traits.has(`$ZodTransform`)?$S(e):e.in}function tC(e){return iy(e,{pipe:e=>eC(e._zod.def),default:(e,t)=>t?Bx(e._zod.def.innerType):e,catch:(e,t)=>t?e._zod.def.innerType:e})}function nC(e){return iy(e,{pipe:e=>$S(e._zod.def),prefault:(e,t)=>t?e._zod.def.innerType:e})}var rC=n({bigint:()=>sC,boolean:()=>oC,date:()=>cC,number:()=>aC,string:()=>iC});function iC(e){return Ih(jy,e)}function aC(e){return pg(Pb,e)}function oC(e){return bg(Vb,e)}function sC(e){return Sg(Ub,e)}function cC(e){return Ng(cx,e)}var lC=n({$brand:()=>Vo,$input:()=>fm,$output:()=>dm,NEVER:()=>Lo,TimePrecision:()=>sg,ZodAny:()=>ex,ZodArray:()=>ux,ZodBase64:()=>yb,ZodBase64URL:()=>xb,ZodBigInt:()=>Ub,ZodBigIntFormat:()=>Gb,ZodBoolean:()=>Vb,ZodCIDRv4:()=>hb,ZodCIDRv6:()=>_b,ZodCUID:()=>$y,ZodCUID2:()=>tb,ZodCatch:()=>eS,ZodCodec:()=>oS,ZodCompileAsyncError:()=>vm,ZodCompileUnsupportedError:()=>ym,ZodCreditCard:()=>Tb,ZodCustom:()=>bS,ZodCustomStringFormat:()=>kb,ZodDate:()=>cx,ZodDefault:()=>Kx,ZodDiscriminatedUnion:()=>vx,ZodE164:()=>Cb,ZodEmail:()=>Ly,ZodEmoji:()=>Yy,ZodEnum:()=>jx,ZodError:()=>py,ZodExactOptional:()=>Vx,ZodFile:()=>Fx,ZodFirstPartyTypeKind:()=>PS,ZodFunction:()=>vS,ZodGUID:()=>zy,ZodIPv4:()=>lb,ZodIPv6:()=>pb,ZodISODate:()=>Py,ZodISODateTime:()=>Ny,ZodISODuration:()=>Iy,ZodISOTime:()=>Fy,ZodIntersection:()=>bx,ZodIssueCode:()=>jS,ZodJWT:()=>Db,ZodKSUID:()=>sb,ZodLazy:()=>mS,ZodLiteral:()=>Px,ZodMAC:()=>db,ZodMap:()=>Dx,ZodNaN:()=>nS,ZodNanoID:()=>Zy,ZodNever:()=>ix,ZodNonOptional:()=>Xx,ZodNull:()=>Qb,ZodNullable:()=>Ux,ZodNumber:()=>Pb,ZodNumberFormat:()=>Fb,ZodObject:()=>fx,ZodOptional:()=>zx,ZodPipe:()=>iS,ZodPrefault:()=>Jx,ZodPreprocess:()=>lS,ZodPromise:()=>gS,ZodReadonly:()=>uS,ZodRealError:()=>my,ZodRecord:()=>wx,ZodSet:()=>kx,ZodString:()=>jy,ZodStringFormat:()=>My,ZodSuccess:()=>Qx,ZodSymbol:()=>Jb,ZodTemplateLiteral:()=>fS,ZodTransform:()=>Lx,ZodTuple:()=>Sx,ZodType:()=>W,ZodULID:()=>rb,ZodURL:()=>Ky,ZodUUID:()=>Vy,ZodUndefined:()=>Xb,ZodUnion:()=>hx,ZodUnknown:()=>nx,ZodVoid:()=>ox,ZodXID:()=>ab,ZodXor:()=>gx,_ZodString:()=>Ay,_default:()=>qx,_function:()=>yS,any:()=>tx,array:()=>q,base64:()=>bb,base64url:()=>Sb,bigint:()=>Wb,boolean:()=>Hb,catch:()=>tS,check:()=>xS,cidrv4:()=>gb,cidrv6:()=>vb,clone:()=>Ja,codec:()=>sS,coerce:()=>rC,compile:()=>xm,config:()=>Go,core:()=>ny,creditCard:()=>Eb,cuid:()=>eb,cuid2:()=>nb,custom:()=>SS,date:()=>lx,decode:()=>by,decodeAsync:()=>Sy,deepPartial:()=>ZS,describe:()=>TS,discriminatedUnion:()=>yx,e164:()=>wb,email:()=>Ry,emoji:()=>Xy,encode:()=>yy,encodeAsync:()=>xy,endsWith:()=>t_,enum:()=>Mx,exactOptional:()=>Hx,file:()=>Ix,flattenError:()=>ns,float32:()=>Lb,float64:()=>Rb,formatError:()=>rs,fromJSONSchema:()=>XS,function:()=>yS,getDiscriminatedOption:()=>zu,getErrorMap:()=>NS,globalRegistry:()=>hm,gt:()=>Lg,gte:()=>Rg,guid:()=>By,hash:()=>Nb,hex:()=>Mb,hostname:()=>jb,httpUrl:()=>Jy,includes:()=>$g,input:()=>tC,instanceof:()=>DS,int:()=>Ib,int32:()=>zb,int64:()=>Kb,intersection:()=>xx,invertCodec:()=>cS,ipv4:()=>ub,ipv6:()=>mb,iso:()=>FS,json:()=>kS,jwt:()=>Ob,keyof:()=>dx,ksuid:()=>cb,lazy:()=>hS,length:()=>Yg,literal:()=>Z,locales:()=>lm,looseObject:()=>mx,looseRecord:()=>Ex,lowercase:()=>Zg,lt:()=>Fg,lte:()=>Ig,mac:()=>fb,map:()=>Ox,maxLength:()=>qg,maxSize:()=>Wg,memoizer:()=>Bd,meta:()=>ES,mime:()=>i_,minLength:()=>Jg,minSize:()=>Gg,multipleOf:()=>Ug,nan:()=>rS,nanoid:()=>Qy,nativeEnum:()=>Nx,negative:()=>Bg,never:()=>ax,nonnegative:()=>Hg,nonoptional:()=>Zx,nonpositive:()=>Vg,normalize:()=>o_,null:()=>$b,nullable:()=>Wx,nullish:()=>Gx,number:()=>K,object:()=>J,optional:()=>Bx,output:()=>nC,overwrite:()=>a_,parse:()=>hy,parseAsync:()=>gy,partialRecord:()=>Tx,pipe:()=>aS,positive:()=>zg,prefault:()=>Yx,preprocess:()=>AS,prettifyError:()=>os,promise:()=>_S,properties:()=>r_,property:()=>n_,readonly:()=>dS,record:()=>X,refine:()=>CS,regex:()=>Xg,regexes:()=>Ls,registry:()=>mm,safeDecode:()=>wy,safeDecodeAsync:()=>Ey,safeEncode:()=>Cy,safeEncodeAsync:()=>Ty,safeParse:()=>_y,safeParseAsync:()=>vy,set:()=>Ax,setErrorMap:()=>MS,size:()=>Kg,slugify:()=>u_,startsWith:()=>e_,strictObject:()=>px,string:()=>G,stringFormat:()=>Ab,stringbool:()=>OS,success:()=>$x,superRefine:()=>wS,symbol:()=>Yb,templateLiteral:()=>pS,toJSONSchema:()=>$v,toLowerCase:()=>c_,toUpperCase:()=>l_,toZod:()=>_a,transform:()=>Rx,treeifyError:()=>is,trim:()=>s_,tuple:()=>Cx,uint32:()=>Bb,uint64:()=>qb,ulid:()=>ib,undefined:()=>Zb,union:()=>Y,unknown:()=>rx,uppercase:()=>Qg,url:()=>qy,util:()=>ma,uuid:()=>Hy,uuidv4:()=>Uy,uuidv6:()=>Wy,uuidv7:()=>Gy,validate:()=>vs,validateAsync:()=>bs,void:()=>sx,xid:()=>ob,xor:()=>_x}),uC=n({$brand:()=>Vo,$input:()=>fm,$output:()=>dm,NEVER:()=>Lo,TimePrecision:()=>sg,ZodAny:()=>ex,ZodArray:()=>ux,ZodBase64:()=>yb,ZodBase64URL:()=>xb,ZodBigInt:()=>Ub,ZodBigIntFormat:()=>Gb,ZodBoolean:()=>Vb,ZodCIDRv4:()=>hb,ZodCIDRv6:()=>_b,ZodCUID:()=>$y,ZodCUID2:()=>tb,ZodCatch:()=>eS,ZodCodec:()=>oS,ZodCompileAsyncError:()=>vm,ZodCompileUnsupportedError:()=>ym,ZodCreditCard:()=>Tb,ZodCustom:()=>bS,ZodCustomStringFormat:()=>kb,ZodDate:()=>cx,ZodDefault:()=>Kx,ZodDiscriminatedUnion:()=>vx,ZodE164:()=>Cb,ZodEmail:()=>Ly,ZodEmoji:()=>Yy,ZodEnum:()=>jx,ZodError:()=>py,ZodExactOptional:()=>Vx,ZodFile:()=>Fx,ZodFirstPartyTypeKind:()=>PS,ZodFunction:()=>vS,ZodGUID:()=>zy,ZodIPv4:()=>lb,ZodIPv6:()=>pb,ZodISODate:()=>Py,ZodISODateTime:()=>Ny,ZodISODuration:()=>Iy,ZodISOTime:()=>Fy,ZodIntersection:()=>bx,ZodIssueCode:()=>jS,ZodJWT:()=>Db,ZodKSUID:()=>sb,ZodLazy:()=>mS,ZodLiteral:()=>Px,ZodMAC:()=>db,ZodMap:()=>Dx,ZodNaN:()=>nS,ZodNanoID:()=>Zy,ZodNever:()=>ix,ZodNonOptional:()=>Xx,ZodNull:()=>Qb,ZodNullable:()=>Ux,ZodNumber:()=>Pb,ZodNumberFormat:()=>Fb,ZodObject:()=>fx,ZodOptional:()=>zx,ZodPipe:()=>iS,ZodPrefault:()=>Jx,ZodPreprocess:()=>lS,ZodPromise:()=>gS,ZodReadonly:()=>uS,ZodRealError:()=>my,ZodRecord:()=>wx,ZodSet:()=>kx,ZodString:()=>jy,ZodStringFormat:()=>My,ZodSuccess:()=>Qx,ZodSymbol:()=>Jb,ZodTemplateLiteral:()=>fS,ZodTransform:()=>Lx,ZodTuple:()=>Sx,ZodType:()=>W,ZodULID:()=>rb,ZodURL:()=>Ky,ZodUUID:()=>Vy,ZodUndefined:()=>Xb,ZodUnion:()=>hx,ZodUnknown:()=>nx,ZodVoid:()=>ox,ZodXID:()=>ab,ZodXor:()=>gx,_ZodString:()=>Ay,_default:()=>qx,_function:()=>yS,any:()=>tx,array:()=>q,base64:()=>bb,base64url:()=>Sb,bigint:()=>Wb,boolean:()=>Hb,catch:()=>tS,check:()=>xS,cidrv4:()=>gb,cidrv6:()=>vb,clone:()=>Ja,codec:()=>sS,coerce:()=>rC,compile:()=>xm,config:()=>Go,core:()=>ny,creditCard:()=>Eb,cuid:()=>eb,cuid2:()=>nb,custom:()=>SS,date:()=>lx,decode:()=>by,decodeAsync:()=>Sy,deepPartial:()=>ZS,describe:()=>TS,discriminatedUnion:()=>yx,e164:()=>wb,email:()=>Ry,emoji:()=>Xy,encode:()=>yy,encodeAsync:()=>xy,endsWith:()=>t_,enum:()=>Mx,exactOptional:()=>Hx,file:()=>Ix,flattenError:()=>ns,float32:()=>Lb,float64:()=>Rb,formatError:()=>rs,fromJSONSchema:()=>XS,function:()=>yS,getDiscriminatedOption:()=>zu,getErrorMap:()=>NS,globalRegistry:()=>hm,gt:()=>Lg,gte:()=>Rg,guid:()=>By,hash:()=>Nb,hex:()=>Mb,hostname:()=>jb,httpUrl:()=>Jy,includes:()=>$g,input:()=>tC,instanceof:()=>DS,int:()=>Ib,int32:()=>zb,int64:()=>Kb,intersection:()=>xx,invertCodec:()=>cS,ipv4:()=>ub,ipv6:()=>mb,iso:()=>FS,json:()=>kS,jwt:()=>Ob,keyof:()=>dx,ksuid:()=>cb,lazy:()=>hS,length:()=>Yg,literal:()=>Z,locales:()=>lm,looseObject:()=>mx,looseRecord:()=>Ex,lowercase:()=>Zg,lt:()=>Fg,lte:()=>Ig,mac:()=>fb,map:()=>Ox,maxLength:()=>qg,maxSize:()=>Wg,memoizer:()=>Bd,meta:()=>ES,mime:()=>i_,minLength:()=>Jg,minSize:()=>Gg,multipleOf:()=>Ug,nan:()=>rS,nanoid:()=>Qy,nativeEnum:()=>Nx,negative:()=>Bg,never:()=>ax,nonnegative:()=>Hg,nonoptional:()=>Zx,nonpositive:()=>Vg,normalize:()=>o_,null:()=>$b,nullable:()=>Wx,nullish:()=>Gx,number:()=>K,object:()=>J,optional:()=>Bx,output:()=>nC,overwrite:()=>a_,parse:()=>hy,parseAsync:()=>gy,partialRecord:()=>Tx,pipe:()=>aS,positive:()=>zg,prefault:()=>Yx,preprocess:()=>AS,prettifyError:()=>os,promise:()=>_S,properties:()=>r_,property:()=>n_,readonly:()=>dS,record:()=>X,refine:()=>CS,regex:()=>Xg,regexes:()=>Ls,registry:()=>mm,safeDecode:()=>wy,safeDecodeAsync:()=>Ey,safeEncode:()=>Cy,safeEncodeAsync:()=>Ty,safeParse:()=>_y,safeParseAsync:()=>vy,set:()=>Ax,setErrorMap:()=>MS,size:()=>Kg,slugify:()=>u_,startsWith:()=>e_,strictObject:()=>px,string:()=>G,stringFormat:()=>Ab,stringbool:()=>OS,success:()=>$x,superRefine:()=>wS,symbol:()=>Yb,templateLiteral:()=>pS,toJSONSchema:()=>$v,toLowerCase:()=>c_,toUpperCase:()=>l_,toZod:()=>_a,transform:()=>Rx,treeifyError:()=>is,trim:()=>s_,tuple:()=>Cx,uint32:()=>Bb,uint64:()=>qb,ulid:()=>ib,undefined:()=>Zb,union:()=>Y,unknown:()=>rx,uppercase:()=>Qg,url:()=>qy,util:()=>ma,uuid:()=>Hy,uuidv4:()=>Uy,uuidv6:()=>Wy,uuidv7:()=>Gy,validate:()=>vs,validateAsync:()=>bs,void:()=>sx,xid:()=>ob,xor:()=>_x,z:()=>lC}),dC=`io.modelcontextprotocol/related-task`,fC=SS(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),pC=Y([G(),K().int()]),mC=G();mx({ttl:K().optional(),pollInterval:K().optional()});var hC=J({ttl:K().optional()}),gC=J({taskId:G()}),_C=mx({progressToken:pC.optional(),[dC]:gC.optional()}),vC=J({_meta:_C.optional()}),yC=vC.extend({task:hC.optional()}),bC=e=>yC.safeParse(e).success,xC=J({method:G(),params:vC.loose().optional()}),SC=J({_meta:_C.optional()}),CC=J({method:G(),params:SC.loose().optional()}),wC=mx({_meta:_C.optional()}),TC=Y([G(),K().int()]),EC=J({jsonrpc:Z(`2.0`),id:TC,...xC.shape}).strict(),DC=e=>EC.safeParse(e).success,OC=J({jsonrpc:Z(`2.0`),...CC.shape}).strict(),kC=e=>OC.safeParse(e).success,AC=J({jsonrpc:Z(`2.0`),id:TC,result:wC}).strict(),jC=e=>AC.safeParse(e).success,MC;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(MC||={});var NC=J({jsonrpc:Z(`2.0`),id:TC.optional(),error:J({code:K().int(),message:G(),data:rx().optional()})}).strict(),PC=e=>NC.safeParse(e).success,FC=Y([EC,OC,AC,NC]);Y([AC,NC]);var IC=wC.strict(),LC=SC.extend({requestId:TC.optional(),reason:G().optional()}),RC=CC.extend({method:Z(`notifications/cancelled`),params:LC}),zC=J({icons:q(J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Mx([`light`,`dark`]).optional()})).optional()}),BC=J({name:G(),title:G().optional()}),VC=BC.extend({...BC.shape,...zC.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),HC=AS(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,xx(J({form:xx(J({applyDefaults:Hb().optional()}),X(G(),rx())).optional(),url:fC.optional()}),X(G(),rx()).optional())),UC=mx({list:fC.optional(),cancel:fC.optional(),requests:mx({sampling:mx({createMessage:fC.optional()}).optional(),elicitation:mx({create:fC.optional()}).optional()}).optional()}),WC=mx({list:fC.optional(),cancel:fC.optional(),requests:mx({tools:mx({call:fC.optional()}).optional()}).optional()}),GC=J({experimental:X(G(),fC).optional(),sampling:J({context:fC.optional(),tools:fC.optional()}).optional(),elicitation:HC.optional(),roots:J({listChanged:Hb().optional()}).optional(),tasks:UC.optional(),extensions:X(G(),fC).optional()}),KC=vC.extend({protocolVersion:G(),capabilities:GC,clientInfo:VC}),qC=xC.extend({method:Z(`initialize`),params:KC}),JC=J({experimental:X(G(),fC).optional(),logging:fC.optional(),completions:fC.optional(),prompts:J({listChanged:Hb().optional()}).optional(),resources:J({subscribe:Hb().optional(),listChanged:Hb().optional()}).optional(),tools:J({listChanged:Hb().optional()}).optional(),tasks:WC.optional(),extensions:X(G(),fC).optional()}),YC=wC.extend({protocolVersion:G(),capabilities:JC,serverInfo:VC,instructions:G().optional()}),XC=CC.extend({method:Z(`notifications/initialized`),params:SC.optional()}),ZC=xC.extend({method:Z(`ping`),params:vC.optional()}),QC=J({progress:K(),total:Bx(K()),message:Bx(G())}),$C=J({...SC.shape,...QC.shape,progressToken:pC}),ew=CC.extend({method:Z(`notifications/progress`),params:$C}),tw=vC.extend({cursor:mC.optional()}),nw=xC.extend({params:tw.optional()}),rw=wC.extend({nextCursor:mC.optional()}),iw=Mx([`working`,`input_required`,`completed`,`failed`,`cancelled`]),aw=J({taskId:G(),status:iw,ttl:Y([K(),$b()]),createdAt:G(),lastUpdatedAt:G(),pollInterval:Bx(K()),statusMessage:Bx(G())}),ow=wC.extend({task:aw}),sw=SC.merge(aw),cw=CC.extend({method:Z(`notifications/tasks/status`),params:sw}),lw=xC.extend({method:Z(`tasks/get`),params:vC.extend({taskId:G()})}),uw=wC.merge(aw),dw=xC.extend({method:Z(`tasks/result`),params:vC.extend({taskId:G()})});wC.loose();var fw=nw.extend({method:Z(`tasks/list`)}),pw=rw.extend({tasks:q(aw)}),mw=xC.extend({method:Z(`tasks/cancel`),params:vC.extend({taskId:G()})}),hw=wC.merge(aw),gw=J({uri:G(),mimeType:Bx(G()),_meta:X(G(),rx()).optional()}),_w=gw.extend({text:G()}),vw=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),yw=gw.extend({blob:vw}),bw=Mx([`user`,`assistant`]),xw=J({audience:q(bw).optional(),priority:K().min(0).max(1).optional(),lastModified:IS({offset:!0}).optional()}),Sw=J({...BC.shape,...zC.shape,uri:G(),description:Bx(G()),mimeType:Bx(G()),size:Bx(K()),annotations:xw.optional(),_meta:Bx(mx({}))}),Cw=J({...BC.shape,...zC.shape,uriTemplate:G(),description:Bx(G()),mimeType:Bx(G()),annotations:xw.optional(),_meta:Bx(mx({}))}),ww=nw.extend({method:Z(`resources/list`)}),Tw=rw.extend({resources:q(Sw)}),Ew=nw.extend({method:Z(`resources/templates/list`)}),Dw=rw.extend({resourceTemplates:q(Cw)}),Ow=vC.extend({uri:G()}),kw=Ow,Aw=xC.extend({method:Z(`resources/read`),params:kw}),jw=wC.extend({contents:q(Y([_w,yw]))}),Mw=CC.extend({method:Z(`notifications/resources/list_changed`),params:SC.optional()}),Nw=Ow,Pw=xC.extend({method:Z(`resources/subscribe`),params:Nw}),Fw=Ow,Iw=xC.extend({method:Z(`resources/unsubscribe`),params:Fw}),Lw=SC.extend({uri:G()}),Rw=CC.extend({method:Z(`notifications/resources/updated`),params:Lw}),zw=J({name:G(),description:Bx(G()),required:Bx(Hb())}),Bw=J({...BC.shape,...zC.shape,description:Bx(G()),arguments:Bx(q(zw)),_meta:Bx(mx({}))}),Vw=nw.extend({method:Z(`prompts/list`)}),Hw=rw.extend({prompts:q(Bw)}),Uw=vC.extend({name:G(),arguments:X(G(),G()).optional()}),Ww=xC.extend({method:Z(`prompts/get`),params:Uw}),Gw=J({type:Z(`text`),text:G(),annotations:xw.optional(),_meta:X(G(),rx()).optional()}),Kw=J({type:Z(`image`),data:vw,mimeType:G(),annotations:xw.optional(),_meta:X(G(),rx()).optional()}),qw=J({type:Z(`audio`),data:vw,mimeType:G(),annotations:xw.optional(),_meta:X(G(),rx()).optional()}),Jw=J({type:Z(`tool_use`),name:G(),id:G(),input:X(G(),rx()),_meta:X(G(),rx()).optional()}),Yw=J({type:Z(`resource`),resource:Y([_w,yw]),annotations:xw.optional(),_meta:X(G(),rx()).optional()}),Xw=Sw.extend({type:Z(`resource_link`)}),Zw=Y([Gw,Kw,qw,Xw,Yw]),Qw=J({role:bw,content:Zw}),$w=wC.extend({description:G().optional(),messages:q(Qw)}),eT=CC.extend({method:Z(`notifications/prompts/list_changed`),params:SC.optional()}),tT=J({title:G().optional(),readOnlyHint:Hb().optional(),destructiveHint:Hb().optional(),idempotentHint:Hb().optional(),openWorldHint:Hb().optional()}),nT=J({taskSupport:Mx([`required`,`optional`,`forbidden`]).optional()}),rT=J({...BC.shape,...zC.shape,description:G().optional(),inputSchema:J({type:Z(`object`),properties:X(G(),fC).optional(),required:q(G()).optional()}).catchall(rx()),outputSchema:J({type:Z(`object`),properties:X(G(),fC).optional(),required:q(G()).optional()}).catchall(rx()).optional(),annotations:tT.optional(),execution:nT.optional(),_meta:X(G(),rx()).optional()}),iT=nw.extend({method:Z(`tools/list`)}),aT=rw.extend({tools:q(rT)}),oT=wC.extend({content:q(Zw).default([]),structuredContent:X(G(),rx()).optional(),isError:Hb().optional()});oT.or(wC.extend({toolResult:rx()}));var sT=yC.extend({name:G(),arguments:X(G(),rx()).optional()}),cT=xC.extend({method:Z(`tools/call`),params:sT}),lT=CC.extend({method:Z(`notifications/tools/list_changed`),params:SC.optional()});J({autoRefresh:Hb().default(!0),debounceMs:K().int().nonnegative().default(300)});var uT=Mx([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),dT=vC.extend({level:uT}),fT=xC.extend({method:Z(`logging/setLevel`),params:dT}),pT=SC.extend({level:uT,logger:G().optional(),data:rx()}),mT=CC.extend({method:Z(`notifications/message`),params:pT}),hT=J({hints:q(J({name:G().optional()})).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),gT=J({mode:Mx([`auto`,`required`,`none`]).optional()}),_T=J({type:Z(`tool_result`),toolUseId:G().describe(`The unique identifier for the corresponding tool call.`),content:q(Zw).default([]),structuredContent:J({}).loose().optional(),isError:Hb().optional(),_meta:X(G(),rx()).optional()}),vT=yx(`type`,[Gw,Kw,qw]),yT=yx(`type`,[Gw,Kw,qw,Jw,_T]),bT=J({role:bw,content:Y([yT,q(yT)]),_meta:X(G(),rx()).optional()}),xT=yC.extend({messages:q(bT),modelPreferences:hT.optional(),systemPrompt:G().optional(),includeContext:Mx([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:fC.optional(),tools:q(rT).optional(),toolChoice:gT.optional()}),ST=xC.extend({method:Z(`sampling/createMessage`),params:xT}),CT=wC.extend({model:G(),stopReason:Bx(Mx([`endTurn`,`stopSequence`,`maxTokens`]).or(G())),role:bw,content:vT}),wT=wC.extend({model:G(),stopReason:Bx(Mx([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(G())),role:bw,content:Y([yT,q(yT)])}),TT=J({type:Z(`boolean`),title:G().optional(),description:G().optional(),default:Hb().optional()}),ET=J({type:Z(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Mx([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),DT=J({type:Mx([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),OT=J({type:Z(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),kT=J({type:Z(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),AT=Y([Y([J({type:Z(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),Y([OT,kT]),Y([J({type:Z(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Z(`string`),enum:q(G())}),default:q(G()).optional()}),J({type:Z(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()})])]),TT,ET,DT]),jT=Y([yC.extend({mode:Z(`form`).optional(),message:G(),requestedSchema:J({type:Z(`object`),properties:X(G(),AT),required:q(G()).optional()})}),yC.extend({mode:Z(`url`),message:G(),elicitationId:G(),url:G().url()})]),MT=xC.extend({method:Z(`elicitation/create`),params:jT}),NT=SC.extend({elicitationId:G()}),PT=CC.extend({method:Z(`notifications/elicitation/complete`),params:NT}),FT=wC.extend({action:Mx([`accept`,`decline`,`cancel`]),content:AS(e=>e===null?void 0:e,X(G(),Y([G(),K(),Hb(),q(G())])).optional())}),IT=J({type:Z(`ref/resource`),uri:G()}),LT=J({type:Z(`ref/prompt`),name:G()}),RT=vC.extend({ref:Y([LT,IT]),argument:J({name:G(),value:G()}),context:J({arguments:X(G(),G()).optional()}).optional()}),zT=xC.extend({method:Z(`completion/complete`),params:RT}),BT=wC.extend({completion:mx({values:q(G()).max(100),total:Bx(K().int()),hasMore:Bx(Hb())})}),VT=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:X(G(),rx()).optional()}),HT=xC.extend({method:Z(`roots/list`),params:vC.optional()}),UT=wC.extend({roots:q(VT)}),WT=CC.extend({method:Z(`notifications/roots/list_changed`),params:SC.optional()});Y([ZC,qC,zT,fT,Ww,Vw,ww,Ew,Aw,Pw,Iw,cT,iT,lw,dw,fw,mw]),Y([RC,ew,XC,WT,cw]),Y([IC,CT,wT,FT,UT,uw,pw,ow]),Y([ZC,ST,MT,HT,lw,dw,fw,mw]),Y([RC,ew,mT,Rw,Mw,lT,eT,cw,PT]),Y([IC,YC,BT,$w,Hw,Tw,Dw,jw,oT,aT,uw,pw,ow]);var GT=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===MC.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new KT(e.elicitations,n)}return new e(t,n,r)}},KT=class extends GT{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(MC.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function qT(e){return e===`completed`||e===`failed`||e===`cancelled`}function JT(e){let t=sy(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=cy(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function YT(e,t){let n=oy(e,t);if(!n.success)throw n.error;return n.data}var XT=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(RC,e=>{this._oncancel(e)}),this.setNotificationHandler(ew,e=>{this._onprogress(e)}),this.setRequestHandler(ZC,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(lw,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new GT(MC.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(dw,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new GT(e.error.code,e.error.message,e.error.data))}}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new GT(MC.InvalidParams,`Task not found: ${r}`);if(!qT(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(qT(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[dC]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(fw,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new GT(MC.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(mw,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new GT(MC.InvalidParams,`Task not found: ${e.params.taskId}`);if(qT(n.status))throw new GT(MC.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new GT(MC.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof GT?e:new GT(MC.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),GT.fromError(MC.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),jC(e)||PC(e)?this._onresponse(e):DC(e)?this._onrequest(e,t):kC(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=GT.fromError(MC.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[dC]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:MC.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=bC(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new GT(MC.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:MC.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),jC(e)?n(e):n(new GT(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(jC(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),jC(e)?r(e):r(GT.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof GT?e:new GT(MC.InternalError,String(e))}}return}let i;try{let r=await this.request(e,ow,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new GT(MC.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},qT(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new GT(MC.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new GT(MC.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof GT?e:new GT(MC.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[dC]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof GT?e:new GT(MC.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=oy(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(GT.fromError(MC.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},uw,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},pw,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},hw,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[dC]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[dC]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[dC]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=JT(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=YT(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=JT(e);this._notificationHandlers.set(n,n=>{let r=YT(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&DC(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new GT(MC.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new GT(MC.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new GT(MC.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new GT(MC.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=cw.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),qT(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new GT(MC.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(qT(a.status))throw new GT(MC.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=cw.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),qT(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};function ZT(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function QT(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=ZT(a)&&ZT(i)?{...a,...i}:i}return n}var $T=`modulepreload`,eE=function(e){return`/`+e},tE={},nE=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=eE(t,n),t=s(t),t in tE)return;tE[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:$T,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};(e=>typeof r<`u`?r:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof r<`u`?r:e)[t]}):e)(function(e){if(typeof r<`u`)return r.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var rE=class extends XT{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},iE=`2026-01-26`,aE=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=FC.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},oE=Y([Z(`light`),Z(`dark`)]).describe(`Color theme preference for the host environment.`),sE=Y([Z(`inline`),Z(`fullscreen`),Z(`pip`)]).describe(`Display mode for UI presentation.`),cE=X(Y([Z(`--color-background-primary`),Z(`--color-background-secondary`),Z(`--color-background-tertiary`),Z(`--color-background-inverse`),Z(`--color-background-ghost`),Z(`--color-background-info`),Z(`--color-background-danger`),Z(`--color-background-success`),Z(`--color-background-warning`),Z(`--color-background-disabled`),Z(`--color-text-primary`),Z(`--color-text-secondary`),Z(`--color-text-tertiary`),Z(`--color-text-inverse`),Z(`--color-text-ghost`),Z(`--color-text-info`),Z(`--color-text-danger`),Z(`--color-text-success`),Z(`--color-text-warning`),Z(`--color-text-disabled`),Z(`--color-border-primary`),Z(`--color-border-secondary`),Z(`--color-border-tertiary`),Z(`--color-border-inverse`),Z(`--color-border-ghost`),Z(`--color-border-info`),Z(`--color-border-danger`),Z(`--color-border-success`),Z(`--color-border-warning`),Z(`--color-border-disabled`),Z(`--color-ring-primary`),Z(`--color-ring-secondary`),Z(`--color-ring-inverse`),Z(`--color-ring-info`),Z(`--color-ring-danger`),Z(`--color-ring-success`),Z(`--color-ring-warning`),Z(`--font-sans`),Z(`--font-mono`),Z(`--font-weight-normal`),Z(`--font-weight-medium`),Z(`--font-weight-semibold`),Z(`--font-weight-bold`),Z(`--font-text-xs-size`),Z(`--font-text-sm-size`),Z(`--font-text-md-size`),Z(`--font-text-lg-size`),Z(`--font-heading-xs-size`),Z(`--font-heading-sm-size`),Z(`--font-heading-md-size`),Z(`--font-heading-lg-size`),Z(`--font-heading-xl-size`),Z(`--font-heading-2xl-size`),Z(`--font-heading-3xl-size`),Z(`--font-text-xs-line-height`),Z(`--font-text-sm-line-height`),Z(`--font-text-md-line-height`),Z(`--font-text-lg-line-height`),Z(`--font-heading-xs-line-height`),Z(`--font-heading-sm-line-height`),Z(`--font-heading-md-line-height`),Z(`--font-heading-lg-line-height`),Z(`--font-heading-xl-line-height`),Z(`--font-heading-2xl-line-height`),Z(`--font-heading-3xl-line-height`),Z(`--border-radius-xs`),Z(`--border-radius-sm`),Z(`--border-radius-md`),Z(`--border-radius-lg`),Z(`--border-radius-xl`),Z(`--border-radius-full`),Z(`--border-width-regular`),Z(`--shadow-hairline`),Z(`--shadow-sm`),Z(`--shadow-md`),Z(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
64
|
-
|
|
65
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
66
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
67
|
-
|
|
68
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
69
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Y([G(),Zb()]).describe(`Style variables for theming MCP apps.
|
|
70
|
-
|
|
71
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
72
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
73
|
-
|
|
74
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
75
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
|
|
76
|
-
|
|
77
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
78
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
79
|
-
|
|
80
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
81
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);J({method:Z(`ui/open-link`),params:J({url:G().describe(`URL to open in the host's browser`)})});var lE=J({isError:Hb().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),uE=J({isError:Hb().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),dE=J({isError:Hb().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();J({method:Z(`ui/notifications/sandbox-proxy-ready`),params:J({})});var fE=J({connectDomains:q(G()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
82
|
-
|
|
83
|
-
- Maps to CSP \`connect-src\` directive
|
|
84
|
-
- Empty or omitted → no network connections (secure default)`),resourceDomains:q(G()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:q(G()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:q(G()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),pE=J({camera:J({}).optional().describe(`Request camera access.
|
|
85
|
-
|
|
86
|
-
Maps to Permission Policy \`camera\` feature.`),microphone:J({}).optional().describe(`Request microphone access.
|
|
87
|
-
|
|
88
|
-
Maps to Permission Policy \`microphone\` feature.`),geolocation:J({}).optional().describe(`Request geolocation access.
|
|
89
|
-
|
|
90
|
-
Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:J({}).optional().describe(`Request clipboard write access.
|
|
91
|
-
|
|
92
|
-
Maps to Permission Policy \`clipboard-write\` feature.`)});J({method:Z(`ui/notifications/size-changed`),params:J({width:K().optional().describe(`New width in pixels.`),height:K().optional().describe(`New height in pixels.`)})});var mE=J({method:Z(`ui/notifications/tool-input`),params:J({arguments:X(G(),rx().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),hE=J({method:Z(`ui/notifications/tool-input-partial`),params:J({arguments:X(G(),rx().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),gE=J({method:Z(`ui/notifications/tool-cancelled`),params:J({reason:G().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})}),_E=J({fonts:G().optional()}),vE=J({variables:cE.optional().describe(`CSS variables for theming the app.`),css:_E.optional().describe(`CSS blocks that apps can inject.`)}),yE=J({method:Z(`ui/resource-teardown`),params:J({})});X(G(),rx());var bE=J({text:J({}).optional().describe(`Host supports text content blocks.`),image:J({}).optional().describe(`Host supports image content blocks.`),audio:J({}).optional().describe(`Host supports audio content blocks.`),resource:J({}).optional().describe(`Host supports resource content blocks.`),resourceLink:J({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:J({}).optional().describe(`Host supports structured content.`)});J({method:Z(`ui/notifications/request-teardown`),params:J({}).optional()});var xE=J({experimental:X(G(),X(G(),tx()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:J({}).optional().describe(`Host supports opening external URLs.`),downloadFile:J({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:J({listChanged:Hb().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:J({listChanged:Hb().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:J({}).optional().describe(`Host accepts log messages.`),sandbox:J({permissions:pE.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:fE.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:bE.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:bE.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:J({tools:J({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),SE=J({experimental:X(G(),X(G(),tx()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:J({listChanged:Hb().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:q(sE).optional().describe(`Display modes the app supports.`)});J({method:Z(`ui/notifications/initialized`),params:J({}).optional()}),J({csp:fE.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:pE.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:G().optional().describe(`Dedicated origin for view sandbox.
|
|
93
|
-
|
|
94
|
-
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
95
|
-
|
|
96
|
-
**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
|
|
97
|
-
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
98
|
-
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
99
|
-
|
|
100
|
-
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Hb().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
101
|
-
|
|
102
|
-
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
|
|
103
|
-
|
|
104
|
-
- \`true\`: request visible border + background
|
|
105
|
-
- \`false\`: request no visible border + background
|
|
106
|
-
- omitted: host decides border`)}),J({method:Z(`ui/request-display-mode`),params:J({mode:sE.describe(`The display mode being requested.`)})});var CE=J({mode:sE.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),wE=Y([Z(`model`),Z(`app`)]).describe(`Tool visibility scope - who can access the tool.`);J({resourceUri:G().optional(),visibility:q(wE).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
107
|
-
- "model": Tool visible to and callable by the agent
|
|
108
|
-
- "app": Tool callable by the app from this server only`),csp:ax().optional(),permissions:ax().optional()}),J({mimeTypes:q(G()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),J({method:Z(`ui/download-file`),params:J({contents:q(Y([Yw,Xw])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),J({method:Z(`ui/message`),params:J({role:Z(`user`).describe(`Message role, currently only "user" is supported.`),content:q(Zw).describe(`Message content blocks (text, image, etc.).`)})}),J({method:Z(`ui/notifications/sandbox-resource-ready`),params:J({html:G().describe(`HTML content to load into the inner iframe.`),sandbox:G().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:fE.optional().describe(`CSP configuration from resource metadata.`),permissions:pE.optional().describe(`Sandbox permissions from resource metadata.`)})});var TE=J({method:Z(`ui/notifications/tool-result`),params:oT.describe(`Standard MCP tool execution result.`)}),EE=J({toolInfo:J({id:TC.optional().describe(`JSON-RPC id of the tools/call request.`),tool:rT.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:oE.optional().describe(`Current color theme preference.`),styles:vE.optional().describe(`Style configuration for theming the app.`),displayMode:sE.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:q(sE).optional().describe(`Display modes the host supports.`),containerDimensions:Y([J({height:K().describe(`Fixed container height in pixels.`)}),J({maxHeight:Y([K(),Zb()]).optional().describe(`Maximum container height in pixels.`)})]).and(Y([J({width:K().describe(`Fixed container width in pixels.`)}),J({maxWidth:Y([K(),Zb()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
109
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:G().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:G().optional().describe(`User's timezone in IANA format.`),userAgent:G().optional().describe(`Host application identifier.`),platform:Y([Z(`web`),Z(`desktop`),Z(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:J({touch:Hb().optional().describe(`Whether the device supports touch input.`),hover:Hb().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:J({top:K().describe(`Top safe area inset in pixels.`),right:K().describe(`Right safe area inset in pixels.`),bottom:K().describe(`Bottom safe area inset in pixels.`),left:K().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),DE=J({method:Z(`ui/notifications/host-context-changed`),params:EE.describe(`Partial context update containing only changed fields.`)});J({method:Z(`ui/update-model-context`),params:J({content:q(Zw).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:X(G(),rx().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),J({method:Z(`ui/initialize`),params:J({appInfo:VC.describe(`App identification (name and version).`),appCapabilities:SE.describe(`Features and capabilities this app provides.`),protocolVersion:G().describe(`Protocol version this app supports.`)})});var OE=J({protocolVersion:G().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:VC.describe(`Host application identification and version.`),hostCapabilities:xE.describe(`Features and capabilities provided by the host.`),hostContext:EE.describe(`Rich context about the host environment.`)}).passthrough(),kE={target:`draft-2020-12`};async function AE(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](kE);if(n.vendor===`zod`){let{z:n}=await nE(async()=>{let{z:e}=await Promise.resolve().then(()=>uC);return{z:e}},void 0);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function jE(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}var ME=class e extends rE{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:mE,toolinputpartial:hE,toolresult:TE,toolcancelled:gE,hostcontextchanged:DE};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||Go({jitless:!0}),this.setRequestHandler(ZC,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=QT(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await jE(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await jE(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await AE(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await AE(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(yE,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(cT,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(iT,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},oT,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},jw,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},Tw,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?wT:CT;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},dE,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},IC,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},lE,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},uE,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},CE,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new aE(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:iE}},OE,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},NE=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),$=t(((e,t)=>{t.exports=NE()}))();function PE({className:e=``}){return(0,$.jsxs)(`svg`,{viewBox:`0 0 2500 2500`,className:e,"aria-hidden":`true`,fillRule:`evenodd`,clipRule:`evenodd`,children:[(0,$.jsx)(`path`,{d:`m2499.6 1250c0 690.2-559.6 1249.8-1250.1 1249.9-690 0-1249.6-559.7-1249.5-1250-.2-690.3 559.4-1249.9 1249.7-1249.9s1249.9 559.7 1249.9 1250z`,fill:`#eab300`}),(0,$.jsxs)(`g`,{fill:`#fff`,children:[(0,$.jsx)(`path`,{d:`m1741.5 943.8c-16.1-167.4-160.6-223.5-343.2-239.5v-232.3h-141.3v226.1c-37.1 0-75.1.7-112.8 1.5v-227.6h-141.3l-.1 232.1c-30.6.6-60.7 1.2-90 1.2v-.7l-194.9-.1v151s104.4-2 102.6-.1c57.3 0 75.9 33.2 81.3 61.9v264.6c4 0 9.1.2 14.9 1h-14.9l-.1 370.7c-2.5 18-13.1 46.7-53.1 46.8 1.8 1.6-102.7 0-102.7 0l-28.1 168.8h184c34.2 0 67.9.6 100.9.8l.1 234.9h141.2v-232.4c38.7.8 76.2 1.1 112.9 1.1l-.1 231.3h141.3v-234.4c237.6-13.6 404.1-73.5 424.7-296.7 16.7-179.7-67.8-260-202.7-292.4 82.1-41.6 133.4-115.1 121.4-237.6zm-197.8 502.2c0 175.5-300.5 155.6-396.4 155.6v-311.3c95.9.2 396.4-27.3 396.4 155.7zm-65.8-439.1c0 159.7-250.8 141-330.6 141.1v-282.2c79.9 0 330.7-25.4 330.6 141.1z`}),(0,$.jsx)(`path`,{d:`m902 1175.7h21v15.5h-21z`})]})]})}function FE({children:e,active:t,onNavigate:n,navigation:r=!0}){return(0,$.jsxs)(`div`,{className:r?`local-shell`:`local-shell setup-shell`,children:[(0,$.jsxs)(`header`,{className:`local-header`,children:[(0,$.jsxs)(`div`,{className:`brand-mark`,children:[(0,$.jsx)(PE,{className:`brand-symbol`}),(0,$.jsx)(`span`,{children:`BSV MCP`})]}),r&&n?(0,$.jsx)(`nav`,{className:`local-nav`,"aria-label":`Local app sections`,children:[`explorer`,`wallet`,`ordinals`,`sweep`].map(e=>(0,$.jsx)(`button`,{type:`button`,className:t===e?`nav-tab active`:`nav-tab`,"aria-current":t===e?`page`:void 0,onClick:()=>n(e),children:e},e))}):null]}),(0,$.jsx)(`main`,{className:`local-content`,children:e}),(0,$.jsxs)(`footer`,{className:`local-footer`,children:[(0,$.jsx)(`span`,{children:`LOCAL PROCESS`}),(0,$.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:`PRIVATE BY DEFAULT`})]})]})}function IE({eyebrow:e,title:t,description:n}){return(0,$.jsxs)(`header`,{className:`page-header`,children:[(0,$.jsxs)(`p`,{className:`eyebrow`,children:[(0,$.jsx)(`span`,{children:`#`}),` `,e]}),(0,$.jsx)(`h1`,{children:t}),n?(0,$.jsx)(`p`,{className:`page-description`,children:n}):null]})}function LE({children:e,className:t=``}){return(0,$.jsx)(`section`,{className:`surface ${t}`,children:e})}function RE({children:e,tone:t=`info`}){return(0,$.jsx)(`div`,{className:`notice notice-${t}`,role:t===`error`||t===`warning`?`alert`:`status`,children:e})}function zE({children:e,type:t=`button`,variant:n=`primary`,disabled:r,onClick:i,"aria-busy":a}){return(0,$.jsx)(`button`,{type:t,className:`button button-${n}`,disabled:r,onClick:i,"aria-busy":a,children:e})}function BE({label:e=`Loading`}){return(0,$.jsxs)(`div`,{className:`spinner-row`,role:`status`,children:[(0,$.jsx)(`span`,{className:`spinner`,"aria-hidden":`true`}),e]})}function VE({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`data-row`,children:[(0,$.jsx)(`span`,{className:`data-label`,children:e}),(0,$.jsx)(`span`,{className:`data-value`,children:t})]})}function HE(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function UE(e){return Array.isArray(e)?e.filter(e=>!!(e&&typeof e==`object`)):[]}function WE(e,t=8){return e.length<=t*2+3?e:`${e.slice(0,t)}…${e.slice(-t)}`}function GE(e){return Number(e??0).toLocaleString()}function KE(){let e=(0,A.useRef)(null),[t,n]=(0,A.useState)(!1),[r,i]=(0,A.useState)();return(0,A.useEffect)(()=>{let t=new ME({name:`BSV MCP`,version:`1.0.0`});return e.current=t,t.ontoolresult=()=>n(!0),t.connect().then(()=>n(!0)).catch(e=>i(String(e))),()=>{e.current=null}},[]),{call:(0,A.useCallback)(async(t,n={})=>{let r=e.current;if(!r)throw Error(`The local app is not connected to its MCP host.`);let i=(await r.callServerTool({name:t,arguments:n}))?.structuredContent;if(!i)throw Error(`The MCP host returned no structured data.`);return HE(i)},[]),ready:t,error:r}}function qE(){let{call:e,ready:t,error:n}=KE(),[r,i]=(0,A.useState)(`explorer`);return n?(0,$.jsx)(FE,{navigation:!1,children:(0,$.jsxs)(RE,{tone:`error`,children:[`Could not connect to the MCP host: `,n]})}):t?(0,$.jsxs)(FE,{active:r,onNavigate:i,children:[r===`explorer`?(0,$.jsx)(JE,{call:e}):null,r===`wallet`?(0,$.jsx)(QE,{call:e}):null,r===`ordinals`?(0,$.jsx)($E,{call:e}):null,r===`sweep`?(0,$.jsx)(tD,{call:e}):null]}):(0,$.jsx)(FE,{navigation:!1,children:(0,$.jsx)(`div`,{className:`center-state`,children:(0,$.jsx)(BE,{label:`Connecting to MCP host`})})})}function JE({call:e}){let[t,n]=(0,A.useState)(),[r,i]=(0,A.useState)(),[a,o]=(0,A.useState)(``);(0,A.useEffect)(()=>{e(`app_explorer_data`).then(n).catch(e=>i(String(e)))},[e]);async function s(){let t=a.trim();if(t){i(void 0);try{let r=/^[0-9a-f]{64}$/i.test(t)?{txid:t}:t.startsWith(`1`)?{address:t}:{query:t};n(await e(`app_explorer_data`,r))}catch(e){i(String(e))}}}let c=HE(t?.chainInfo),l=UE(t?.recentBlocks);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(IE,{eyebrow:`explorer`,title:`Read the chain`,description:`Inspect live network data without leaving your local MCP session.`}),r?(0,$.jsx)(RE,{tone:`error`,children:r}):null,!t&&!r?(0,$.jsx)(LE,{children:(0,$.jsx)(`div`,{className:`surface-body`,children:(0,$.jsx)(BE,{label:`Loading explorer data`})})}):null,t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid grid-stats`,children:[(0,$.jsx)(YE,{label:`Block height`,value:Number(c.blocks??0)?Number(c.blocks).toLocaleString():`—`}),(0,$.jsx)(YE,{label:`BSV price`,value:typeof t.price==`number`?`$${t.price.toFixed(2)}`:`—`}),(0,$.jsx)(YE,{label:`Difficulty`,value:XE(c.difficulty)}),(0,$.jsx)(YE,{label:`Best block`,value:c.bestblockhash?WE(String(c.bestblockhash),6):`—`})]}),(0,$.jsxs)(LE,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`lookup`}),(0,$.jsx)(`h2`,{children:`Search BSV`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(`div`,{className:`search-row`,children:[(0,$.jsx)(`input`,{className:`field`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s()},placeholder:`Transaction ID or address`,"aria-label":`Transaction ID or address`}),(0,$.jsx)(zE,{onClick:()=>void s(),children:`Search`})]}),(0,$.jsx)(ZE,{data:t,query:a})]})]}),l.length?(0,$.jsxs)(LE,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`network`}),(0,$.jsx)(`h2`,{children:`Recent blocks`})]})}),(0,$.jsxs)(`div`,{className:`table`,children:[(0,$.jsxs)(`div`,{className:`table-row table-head`,children:[(0,$.jsx)(`span`,{children:`Height`}),(0,$.jsx)(`span`,{children:`Hash`}),(0,$.jsx)(`span`,{children:`Txs`}),(0,$.jsx)(`span`,{children:`Size`}),(0,$.jsx)(`span`,{children:`Time`})]}),l.map((e,t)=>(0,$.jsxs)(`div`,{className:`table-row`,children:[(0,$.jsx)(`span`,{className:`mono`,children:Number(e.height??0).toLocaleString()}),(0,$.jsx)(`span`,{className:`mono dim`,children:WE(String(e.hash??`—`),10)}),(0,$.jsx)(`span`,{className:`dim`,children:UE(e.tx).length||`—`}),(0,$.jsx)(`span`,{className:`dim`,children:e.size?`${(Number(e.size)/1024).toFixed(1)} KB`:`—`}),(0,$.jsx)(`span`,{className:`dim`,children:e.time?new Date(Number(e.time)*1e3).toLocaleTimeString():`—`})]},String(e.hash??t)))]})]}):null]}):null]})}function YE({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`stat-card`,children:[(0,$.jsx)(`div`,{className:`stat-label`,children:e}),(0,$.jsx)(`div`,{className:`stat-value`,children:t})]})}function XE(e){let t=Number(e??0);if(!t)return`—`;for(let[e,n]of[[`PH`,0x38d7ea4c68000],[`TH`,0xe8d4a51000],[`GH`,1e9],[`MH`,1e6]])if(t>=n)return`${(t/n).toFixed(1)} ${e}`;return t.toLocaleString()}function ZE({data:e,query:t}){let n=HE(e.transaction),r=HE(e.addressInfo);if(!Object.keys(n).length&&!Object.keys(r).length&&t)return(0,$.jsx)(`div`,{className:`empty`,children:`No results found`});if(Object.keys(n).length)return(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(VE,{label:`TXID`,value:(0,$.jsx)(`span`,{className:`mono`,children:String(n.txid??t)})}),(0,$.jsx)(VE,{label:`Size`,value:`${n.size??`—`} bytes`}),(0,$.jsx)(VE,{label:`Fee`,value:n.fee==null?`—`:`${GE(n.fee)} sats`}),(0,$.jsx)(VE,{label:`Confirmations`,value:String(n.confirmations??`—`)}),(0,$.jsx)(VE,{label:`Outputs`,value:UE(n.outputs).length})]});if(Object.keys(r).length){let e=HE(r.balance);return(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(VE,{label:`Address`,value:(0,$.jsx)(`span`,{className:`mono`,children:t})}),(0,$.jsx)(VE,{label:`Confirmed`,value:`${GE(e.confirmed)} sats`}),(0,$.jsx)(VE,{label:`Unconfirmed`,value:`${GE(e.unconfirmed)} sats`}),(0,$.jsx)(VE,{label:`Transactions`,value:UE(r.history).length||`—`})]})}return(0,$.jsx)(`div`,{className:`empty`,children:`Enter a transaction ID or address to search.`})}function QE({call:e}){let[t,n]=(0,A.useState)(),[r,i]=(0,A.useState)();if((0,A.useEffect)(()=>{e(`app_wallet_data`).then(e=>{if(e.error)throw Error(String(e.error));n(e)}).catch(e=>i(String(e)))},[e]),r)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(IE,{eyebrow:`wallet`,title:`Wallet`}),(0,$.jsx)(RE,{tone:`error`,children:r})]});if(!t)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(IE,{eyebrow:`wallet`,title:`Wallet`}),(0,$.jsx)(LE,{children:(0,$.jsx)(`div`,{className:`surface-body`,children:(0,$.jsx)(BE,{label:`Loading wallet data`})})})]});let a=HE(t.balance),o=UE(t.utxos),s=Number(a.satoshis??0),c=String(a.bsv??(s/1e8).toFixed(8));return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(IE,{eyebrow:`wallet`,title:`Your local wallet`,description:`Balances and unspent outputs are read from the connected wallet service.`}),(0,$.jsxs)(`div`,{className:`grid grid-three`,children:[(0,$.jsx)(YE,{label:`Balance`,value:`${c} BSV`}),(0,$.jsx)(YE,{label:`Satoshis`,value:`${GE(s)} sats`}),(0,$.jsx)(YE,{label:`UTXOs`,value:String(a.utxoCount??o.length)})]}),t.address?(0,$.jsxs)(`div`,{className:`address-row`,children:[(0,$.jsx)(`code`,{children:String(t.address)}),(0,$.jsx)(`button`,{className:`copy-button`,type:`button`,onClick:()=>void navigator.clipboard?.writeText(String(t.address)),children:`copy`})]}):null,(0,$.jsxs)(LE,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`outputs`}),(0,$.jsx)(`h2`,{children:`Unspent outputs`})]})}),o.length?(0,$.jsxs)(`div`,{className:`table`,children:[(0,$.jsxs)(`div`,{className:`table-row table-head`,children:[(0,$.jsx)(`span`,{children:`TXID`}),(0,$.jsx)(`span`,{children:`Index`}),(0,$.jsx)(`span`,{children:`Value`})]}),o.slice(0,25).map((e,t)=>(0,$.jsxs)(`div`,{className:`table-row`,children:[(0,$.jsx)(`span`,{className:`mono dim`,children:WE(String(e.txid??`—`),10)}),(0,$.jsx)(`span`,{className:`mono`,children:String(e.vout??e.outputIndex??`—`)}),(0,$.jsxs)(`span`,{className:`mono`,children:[GE(e.satoshis),` sats`]})]},`${String(e.txid??t)}-${String(e.vout??e.outputIndex??t)}`))]}):(0,$.jsx)(`div`,{className:`empty`,children:`No UTXOs found.`})]})]})}function $E({call:e}){let[t,n]=(0,A.useState)(),[r,i]=(0,A.useState)(),[a,o]=(0,A.useState)(``),s=(0,A.useCallback)(async t=>{i(void 0);try{let r=await e(`app_ordinals_data`,t?{query:t}:{});if(r.error)throw Error(String(r.error));n(r)}catch(e){i(String(e))}},[e]);(0,A.useEffect)(()=>{s()},[s]);let c=UE(t?.listings),l=String(t?.contentBaseUrl??``);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(IE,{eyebrow:`ordinals`,title:`Inscription collection`,description:`Browse the latest ordinal listings available to this wallet.`}),r?(0,$.jsx)(RE,{tone:`error`,children:r}):null,(0,$.jsx)(LE,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(`div`,{className:`search-row`,children:[(0,$.jsx)(`input`,{className:`field`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s(a.trim()||void 0)},placeholder:`Search listings`,"aria-label":`Search listings`}),(0,$.jsx)(zE,{onClick:()=>void s(a.trim()||void 0),children:`Search`})]}),!t&&!r?(0,$.jsx)(BE,{label:`Loading listings`}):null]})}),t?(0,$.jsx)(`div`,{className:`grid grid-three stack-grid`,children:c.length?c.map((e,t)=>(0,$.jsx)(eD,{item:e,base:l},`${String(e.outpoint??t)}`)):(0,$.jsx)(`div`,{className:`empty`,children:`No listings found.`})}):null]})}function eD({item:e,base:t}){let n=HE(HE(e.data).ordlock),r=String(n.content_type??``),i=String(n.origin??e.outpoint??``),a=r.startsWith(`image/`)&&/^https?:\/\//.test(t);return(0,$.jsxs)(`article`,{className:`ordinal-card`,title:String(e.outpoint??``),children:[(0,$.jsx)(`div`,{className:`ordinal-image`,children:a?(0,$.jsx)(`img`,{src:`${t}/${encodeURIComponent(i)}`,alt:`Inscription preview`,loading:`lazy`}):(0,$.jsx)(`span`,{children:r?r.split(`/`)[1]:`?`})}),(0,$.jsxs)(`div`,{className:`ordinal-info`,children:[(0,$.jsx)(`div`,{className:`ordinal-name`,children:String(n.name??WE(String(e.outpoint??`inscription`),10))}),(0,$.jsxs)(`div`,{className:`ordinal-meta`,children:[(0,$.jsx)(`span`,{children:r?r.split(`/`)[0]:`unknown`}),n.price==null?null:(0,$.jsxs)(`span`,{children:[GE(n.price),` sats`]})]})]})]})}function tD({call:e}){let[t,n]=(0,A.useState)(``),r=(0,A.useRef)(``),[i,a]=(0,A.useState)(``),[o,s]=(0,A.useState)(),[c,l]=(0,A.useState)(new Set),[u,d]=(0,A.useState)([]),[f,p]=(0,A.useState)(`input`),[m,h]=(0,A.useState)(),g=(0,A.useMemo)(()=>{if(!o)return[];let e=[],t=UE(o.funding),n=UE(o.ordinals);t.length&&e.push({type:`bsv`,name:`BSV funding`,detail:`${t.length} UTXOs`,value:`${(Number(o.totalFundingSats??0)/1e8).toFixed(8)} BSV`,inputs:t}),n.length&&e.push({type:`ordinals`,name:`Ordinals`,detail:`${n.length} inscriptions`,value:`${n.length} NFTs`,inputs:n});for(let t of UE(o.bsv21Tokens)){let n=String(t.tokenId??``),r=UE(t.inputs);e.push({type:`bsv21:${n}`,name:`${String(t.symbol??WE(n,6))} token`,detail:`${r.length} UTXOs`,value:String(t.totalAmount??`0`),inputs:r})}return e},[o]);async function _(){h(void 0);let i=t.trim();try{let t=(/^[0-9a-f]{64}$/i.test(i)?new jr(i,16):jr.fromWif(i)).toPublicKey().toAddress();r.current=i,n(``),a(t),p(`scanning`);let o=await e(`app_sweep_scan`,{address:t});if(o.error)throw Error(String(o.error));s(o),l(new Set(nD(o))),p(`review`)}catch(e){r.current=``,n(``),h(e instanceof Error?e.message:String(e)),p(`error`)}}async function v(){if(!o||!c.size||!r.current)return;p(`working`),h(void 0);let t=[];try{for(let n of g.filter(e=>c.has(e.type))){let i=await e(`app_sweep_prepare`,{sweepType:n.type===`bsv`?`bsv`:n.type===`ordinals`?`ordinals`:`bsv21`,inputs:n.inputs.map(e=>({outpoint:e.outpoint,satoshis:e.satoshis,lockingScript:e.lockingScript}))});if(i.error)throw Error(String(i.error));let a=/^[0-9a-f]{64}$/i.test(r.current)?new jr(r.current,16):jr.fromWif(r.current),o=fa.fromBEEF(nn(String(i.txHex),`hex`)),s=new Set(UE(i.inputsToSign).map(e=>`${String(e.outpoint).replace(`_`,`.`)}`));for(let e of o.inputs)s.has(`${e.sourceTXID}.${e.sourceOutputIndex}`)&&(e.unlockingScriptTemplate=new Oi().unlock(a,`all`,!0));await o.sign();let c={};o.inputs.forEach((e,t)=>{s.has(`${e.sourceTXID}.${e.sourceOutputIndex}`)&&(c[String(t)]={unlockingScript:e.unlockingScript?.toHex()??``})});let l=await e(`app_sweep_complete`,{reference:i.reference,spends:c});if(l.error)throw Error(String(l.error));t.push({type:n.name,txid:String(l.txid??``)})}r.current=``,d(t),p(`complete`)}catch(e){r.current=``,h(e instanceof Error?e.message:String(e)),p(`error`)}}function y(){r.current=``,n(``),a(``),s(void 0),l(new Set),d([]),h(void 0),p(`input`)}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(IE,{eyebrow:`sweep`,title:`Import funds`,description:`Scan a key locally, choose the assets to move, and sign in this browser tab.`}),m?(0,$.jsx)(RE,{tone:`error`,children:m}):null,(0,$.jsxs)(LE,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:f===`review`?`review`:f===`complete`?`complete`:`private key`}),(0,$.jsx)(`h2`,{children:f===`review`?`Assets at ${WE(i,8)}`:f===`complete`?`Sweep complete`:`Sweep assets into your wallet`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[f===`input`||f===`error`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`sweep-key`,children:[`WIF or 64-character hex`,(0,$.jsx)(`input`,{id:`sweep-key`,className:`field`,type:`password`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&_()},autoComplete:`new-password`,spellCheck:!1})]}),(0,$.jsx)(`p`,{className:`dim`,children:`The key is used only in this tab and cleared after scanning or sweeping.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(zE,{onClick:()=>void _(),disabled:!t.trim(),children:`Scan address`})})]}):null,f===`scanning`||f===`working`?(0,$.jsx)(BE,{label:f===`scanning`?`Scanning ${WE(i,8)}…`:`Signing and broadcasting selected assets…`}):null,f===`review`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`role-grid`,children:g.length?g.map(e=>(0,$.jsx)(`button`,{type:`button`,className:c.has(e.type)?`asset-card asset-selected`:`asset-card`,onClick:()=>l(t=>{let n=new Set(t);return n.has(e.type)?n.delete(e.type):n.add(e.type),n}),children:(0,$.jsxs)(`div`,{className:`asset-info`,children:[(0,$.jsxs)(`div`,{className:`asset-name`,children:[c.has(e.type)?`✓ `:``,e.name]}),(0,$.jsxs)(`div`,{className:`ordinal-meta`,children:[(0,$.jsx)(`span`,{children:e.detail}),(0,$.jsx)(`span`,{children:e.value})]})]})},e.type)):(0,$.jsx)(`div`,{className:`empty`,children:`No assets found at this address.`})}),(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(zE,{variant:`secondary`,onClick:y,children:`Back`}),(0,$.jsx)(zE,{onClick:()=>void v(),disabled:!c.size,children:`Sweep selected`})]})]}):null,f===`complete`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`data-list`,children:u.map(e=>(0,$.jsx)(VE,{label:String(e.type),value:(0,$.jsx)(`span`,{className:`mono`,children:WE(String(e.txid),12)})},`${String(e.type)}:${String(e.txid)}`))}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(zE,{onClick:y,children:`Sweep another key`})})]}):null]})]})]})}function nD(e){let t=[];UE(e.funding).length&&t.push(`bsv`),UE(e.ordinals).length&&t.push(`ordinals`);for(let n of UE(e.bsv21Tokens))t.push(`bsv21:${String(n.tokenId??``)}`);return t}var rD=l();function iD(e,t,n){let r=Math.abs(n)*Math.PI/180;return{width:e*Math.cos(r)+t*Math.sin(r)+12,height:t*Math.cos(r)+e*Math.sin(r)+12}}function aD(e,t){return Math.abs(e.x-t.x)*2<e.width+t.width&&Math.abs(e.y-t.y)*2<e.height+t.height}function oD(e,t,n,r,i){for(let a=0;a<2800;a++){let o=a*2.399963+i,s=Math.sqrt(a/2800)*.52,c={x:e*(.5+Math.cos(o)*s),y:t*(.5+Math.sin(o)*s),...n};if(!(c.x-n.width/2<8||c.x+n.width/2>e-8||c.y-n.height/2<8||c.y+n.height/2>t-8)&&!r.some(e=>aD(c,e)))return c}}function sD(e){if(e.title)return e.title;let t=e.name.replace(/^[^_]+_/,``).replace(/_/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase();return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/\b(bsv|bap|mnee|utxo|utxos)\b/gi,e=>e.toUpperCase())}function cD(e,t,n,r,i){let a=document.createElement(`canvas`).getContext(`2d`);if(!a)return;let o=sD(e).split(` `),s=o.length>1&&sD(e).length>10?[o.slice(0,Math.ceil(o.length/2)).join(` `),o.slice(Math.ceil(o.length/2)).join(` `)]:[sD(e)],c=Math.min(t/760,n/600,1.25),l=[0,-7,5,-3,8,0,-5,4][i%8];for(let o of[1,.85,.7]){let u=Math.max(15,[100,66,52,58,43,48,36,42,32,38,30,34][i%12]*c*o);a.font=`${u}px "Geist Pixel Line"`;let d=oD(t,n,iD(Math.max(...s.map(e=>a.measureText(e).width)),s.length*u*1.03,l),r,i*1.37);if(d)return{...d,tool:e,lines:s,size:u,angle:l}}}function lD({tools:e}){let t=(0,A.useRef)(null),[n,r]=(0,A.useState)([]),[i,a]=(0,A.useState)(),[o,s]=(0,A.useState)(!1),c=(0,A.useRef)({width:0,height:0}),l=(0,A.useRef)(0);return(0,A.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let i=()=>{let t=n.clientWidth,i=n.clientHeight;if(t===c.current.width&&i===c.current.height)return;c.current={width:t,height:i};let o=[],s=[...e??[]].sort((e,t)=>Number(/^send bsv$/i.test(sD(t)))-Number(/^send bsv$/i.test(sD(e))));for(let e of s){let n=cD(e,t,i,o,o.length);if(n&&o.push(n),o.length===12)break}r(o),a(void 0)};c.current={width:0,height:0};let o=!1,s=new ResizeObserver(i);return document.fonts.load(`30px "Geist Pixel Line"`).catch(()=>[]).then(()=>{o||(i(),s.observe(n))}),()=>{o=!0,s.disconnect()}},[e]),(0,A.useEffect)(()=>{if(o||!e?.length)return;let t,n=setInterval(()=>{document.hidden||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||(r(e=>{if(e.length<2)return e;let t=1+Math.floor(Math.random()*(e.length-1));return e.map((e,n)=>({...e,exiting:n===t||l.current%3==2&&n===t+1}))}),t=setTimeout(()=>{r(t=>{let n=t.filter(e=>e.exiting).map(e=>e.tool.name),r=t.filter(e=>!e.exiting),i=e.filter(e=>!r.some(t=>t.tool.name===e.name)&&!n.includes(e.name)).sort(()=>Math.random()-.5);for(let e of i){let t=cD(e,c.current.width,c.current.height,r,1+l.current++%11);if(t&&r.push(t),r.length>=12)break}return r})},650))},3200);return()=>{clearInterval(n),clearTimeout(t),r(e=>e.map(e=>({...e,exiting:!1})))}},[e,o]),(0,$.jsxs)(`section`,{className:`tool-cloud-section`,"aria-label":`Explore your wallet tools`,children:[(0,$.jsxs)(`svg`,{className:`cloud-orbits`,viewBox:`0 0 760 650`,fill:`none`,"aria-hidden":`true`,children:[(0,$.jsx)(`ellipse`,{cx:`380`,cy:`325`,rx:`365`,ry:`220`,transform:`rotate(-16 380 325)`}),(0,$.jsx)(`ellipse`,{cx:`380`,cy:`325`,rx:`365`,ry:`170`,transform:`rotate(22 380 325)`}),(0,$.jsx)(`circle`,{cx:`110`,cy:`160`,r:`4`}),(0,$.jsx)(`circle`,{cx:`660`,cy:`450`,r:`6`}),(0,$.jsx)(`circle`,{cx:`230`,cy:`570`,r:`3`})]}),(0,$.jsx)(`ul`,{ref:t,className:`tool-cloud`,"aria-label":`Available MCP tools`,onMouseEnter:()=>s(!0),onMouseLeave:e=>{e.currentTarget.contains(document.activeElement)||(s(!1),a(void 0))},onFocus:()=>s(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(s(!1),a(void 0))},onKeyDown:e=>{e.key===`Escape`&&a(void 0)},children:n.map(e=>(0,$.jsx)(`li`,{className:e.exiting?`is-fading`:``,style:{left:e.x,top:e.y},children:(0,$.jsx)(`button`,{type:`button`,className:`tool-cloud-word tool-cloud-weight-${Math.round(e.size)%5}`,style:{fontSize:e.size,transform:`rotate(${e.angle}deg)`},"aria-describedby":i?.tool.name===e.tool.name?`tool-cloud-popover`:void 0,onMouseEnter:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),onMouseLeave:()=>a(void 0),onFocus:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),onClick:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),children:e.lines.map(e=>(0,$.jsx)(`span`,{children:e},e))})},e.tool.name))}),i&&(0,rD.createPortal)((0,$.jsxs)(`div`,{id:`tool-cloud-popover`,role:`tooltip`,className:`tool-cloud-popover`,style:{left:Math.max(12,Math.min(window.innerWidth-292,i.rect.left+i.rect.width/2-140)),...i.rect.top>window.innerHeight/2?{bottom:window.innerHeight-i.rect.top+12}:{top:i.rect.bottom+12}},children:[(0,$.jsx)(`strong`,{children:sD(i.tool)}),(0,$.jsx)(`code`,{children:i.tool.name}),(0,$.jsx)(`p`,{children:i.tool.description||`Available in your MCP client.`})]}),document.body)]})}function uD({tools:e}){return(0,$.jsxs)(`div`,{className:`wallet-ready`,children:[(0,$.jsxs)(`div`,{className:`ready-copy`,children:[(0,$.jsx)(`span`,{className:`ready-check`,"aria-hidden":`true`,children:`✓`}),(0,$.jsx)(`p`,{className:`ready-eyebrow`,children:`Setup complete`}),(0,$.jsxs)(`h1`,{children:[`Your wallet.`,(0,$.jsx)(`br`,{}),`Ready for anything.`]}),(0,$.jsxs)(`p`,{className:`ready-description`,children:[`Your keys are encrypted in your local Vault.`,(0,$.jsx)(`br`,{}),`Return to your MCP client to get started.`]})]}),(0,$.jsx)(lD,{tools:e})]})}function dD({token:e,onWelcome:t,onUnlock:n,standalone:r=!1}){let[i,a]=(0,A.useState)([]),[o,s]=(0,A.useState)(),[c,l]=(0,A.useState)(),[u,d]=(0,A.useState)(),[f,p]=(0,A.useState)(`imported-wallet`),[m,h]=(0,A.useState)(``),[g,_]=(0,A.useState)(``),[v,y]=(0,A.useState)(``),[b,x]=(0,A.useState)(!1),[S,C]=(0,A.useState)(!1),[w,ee]=(0,A.useState)(!1),[te,ne]=(0,A.useState)(``),[T,re]=(0,A.useState)(0),[ie,ae]=(0,A.useState)(``),[oe,se]=(0,A.useState)();(0,A.useEffect)(()=>{e&&fetch(`/api/inventory?revision=${T}`,{headers:{Authorization:`Bearer ${e}`}}).then(async e=>{if(!e.ok)throw Error(`Could not inspect your wallets. Reopen setup and try again.`);return e.json()}).then(e=>{let t=e.boundAccounts??[];a(t),s((e.sources??[]).filter(e=>e.location!==`account`||!t.some(t=>t.name===e.account)))}).catch(e=>ae(e.message))},[e,T]);function ce(){l(void 0),d(void 0),x(!1),h(``),_(``),y(``),ae(``)}async function le(t){if(t.preventDefault(),!S&&b&&(c||u)){if(g.length<8){ae(`Choose a Vault password with at least 8 characters.`);return}if(g!==v){ae(`The Vault passwords don’t match.`);return}if(u&&u.size>1048576){ae(`Choose a key backup smaller than 1 MB.`);return}C(!0),ae(``);try{let t=await fetch(`/api/embedded/import`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({source:c,accountName:f,activate:!1,sourcePassphrase:m,destinationPassphrase:g,passwordConfirmation:v,confirmation:`IMPORT_WALLET_CONFIRMED`,...u?{backupText:await u.text(),backupName:u.name}:{}})}),n=await t.json();if(!t.ok)throw Error(n.error||`The wallet could not be imported.`);if(n.saved===!0&&n.ready===!1){ce(),ne(n.accountName),re(e=>e+1);return}if(n.ready!==!0)throw Error(`The wallet was saved, but could not be activated. Reopen setup to unlock it.`);h(``),_(``),y(``),se(n.tools),ee(!0)}catch(e){ae(e instanceof Error?e.message:`The wallet could not be imported.`)}finally{C(!1)}}}return w&&!r?(0,$.jsx)(FE,{navigation:!1,children:(0,$.jsx)(uD,{tools:oe})}):(0,$.jsxs)(FE,{navigation:!1,children:[(0,$.jsx)(IE,{eyebrow:`Existing wallet`,title:w?r?`Your wallet is saved`:`Your wallet is ready`:`Bring your wallet with you`,description:w?r?`Your keys are protected in your local Vault.`:`Your keys are protected in your local Vault and your wallet is available in this session.`:`Choose a wallet found on this computer, or browse for a key backup.`}),ie&&(0,$.jsx)(RE,{tone:`error`,children:ie}),te&&(0,$.jsxs)(RE,{tone:`success`,children:[te,` is saved in your Vault. Import another wallet below, or choose your default keys to continue.`]}),w?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(RE,{tone:`success`,children:r?`Open wallet setup in your MCP client to unlock and use your saved wallet.`:`Return to your MCP client to use your wallet.`}),!r&&(0,$.jsx)(lD,{tools:oe})]}):!c&&!u?(0,$.jsx)(LE,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Choose your wallet`}),i.map(e=>(0,$.jsxs)(`button`,{className:`setup-choice wallet-source-choice`,type:`button`,onClick:()=>n(e.name),children:[(0,$.jsx)(`strong`,{children:e.name}),(0,$.jsx)(`span`,{children:`Saved in your Vault · choose default keys`})]},e.name)),o===void 0?(0,$.jsx)(`p`,{children:`Looking for local wallets…`}):o.length===0?(0,$.jsx)(`p`,{children:`No additional local wallets were found. You can choose a backup below.`}):o.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice wallet-source-choice`,onClick:()=>{l(e),p(e.account),ae(``)},children:[(0,$.jsx)(`strong`,{children:e.account}),(0,$.jsx)(`span`,{children:e.directory||e.location}),(0,$.jsx)(`span`,{children:e.encryptedBackup?`Encrypted key backup`:e.plaintextKeys?`Local key file`:`Wallet database — matching key backup needed`}),e.walletDatabases.length>0&&(0,$.jsx)(`span`,{children:e.walletDatabases.join(`, `)})]},`${e.location}:${e.account}`)),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Browse for a key backup`,(0,$.jsx)(`input`,{className:`field`,type:`file`,disabled:S,accept:`.bep,.json`,onChange:e=>{d(e.target.files?.[0]),l(void 0),ae(``)}})]}),(0,$.jsx)(zE,{variant:`secondary`,onClick:t,children:`Back`})]})}):(0,$.jsx)(LE,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Protect and import`}),(0,$.jsx)(`p`,{children:u?.name||c?.account}),c&&!c.encryptedBackup&&!c.plaintextKeys&&(0,$.jsx)(RE,{children:`These databases contain wallet records. Select the matching key backup to recover signing access.`}),(0,$.jsxs)(`form`,{className:`stack-surface`,onSubmit:le,children:[c&&!c.encryptedBackup&&!c.plaintextKeys&&(0,$.jsxs)(`label`,{className:`field-label`,children:[`Matching key backup`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`file`,disabled:S,accept:`.bep,.json`,onChange:e=>d(e.target.files?.[0])})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Wallet name`,(0,$.jsx)(`input`,{className:`field`,required:!0,value:f,onChange:e=>p(e.target.value),disabled:S||!!c})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Backup password, if encrypted`,(0,$.jsx)(`input`,{className:`field`,type:`password`,autoComplete:`off`,value:m,onChange:e=>h(e.target.value),disabled:S})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Vault password`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`password`,autoComplete:`new-password`,minLength:8,value:g,onChange:e=>_(e.target.value),disabled:S})]}),(0,$.jsx)(`p`,{children:`Use your existing Vault password, or choose one if this is your first wallet.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Confirm Vault password`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`password`,autoComplete:`new-password`,value:v,onChange:e=>y(e.target.value),disabled:S})]}),(0,$.jsxs)(`label`,{className:`checkbox-field`,children:[(0,$.jsx)(`input`,{required:!0,type:`checkbox`,checked:b,onChange:e=>x(e.target.checked),disabled:S}),` `,`Import this wallet into my local encrypted Vault.`]}),(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(zE,{variant:`secondary`,type:`button`,onClick:ce,disabled:S,children:`Back`}),(0,$.jsx)(zE,{type:`submit`,disabled:S||!b,children:S?`Importing…`:`Import wallet`})]})]})]})})]})}function fD({token:e,onLinked:t}){let[n,r]=(0,A.useState)(``),[i,a]=(0,A.useState)(),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(`vault-key`),[u,d]=(0,A.useState)(``),[f,p]=(0,A.useState)(!1);async function m(){if(!f){p(!0),d(``);try{let l=i?.keys.find(e=>e.entryId===o);if(i&&!l)throw Error(`Choose a private key.`);let u=await fetch(i?`/api/embedded/link-key`:`/api/embedded/vault-keys`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify(i?{password:n,accountName:c,vaultId:i.vaultId,entryId:l?.entryId,publicKey:l?.publicKey}:{password:n})}),d=await u.json();if(!u.ok)throw Error(d.error||`Could not open the Vault.`);i?(r(``),a(void 0),t()):(a(d),s(d.keys[0]?.entryId??``))}catch(e){d(e instanceof Error?e.message:`Could not use this key.`)}finally{p(!1)}}}return(0,$.jsx)(LE,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Use a key already in your Vault`}),(0,$.jsx)(`p`,{children:`Link an existing private key to a new wallet account, then assign it to a role. This does not import another wallet’s transaction history.`}),u&&(0,$.jsx)(RE,{tone:`error`,children:u}),i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`field-label`,children:[`Private key`,(0,$.jsx)(`select`,{className:`field`,value:o,onChange:e=>s(e.target.value),disabled:f,children:i.keys.map(e=>(0,$.jsxs)(`option`,{value:e.entryId,children:[e.label,` · `,e.publicKey.slice(-8)]},e.entryId))})]}),!i.keys.length&&(0,$.jsx)(RE,{children:`No compatible private keys found. HD roots and non-key entries cannot be used directly.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Account name`,(0,$.jsx)(`input`,{className:`field`,value:c,onChange:e=>l(e.target.value),disabled:f})]})]}):(0,$.jsxs)(`label`,{className:`field-label`,children:[`Vault password`,(0,$.jsx)(`input`,{className:`field`,type:`password`,autoComplete:`off`,value:n,onChange:e=>r(e.target.value),disabled:f})]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(zE,{onClick:m,disabled:f||!n||!!i&&!o,children:f?`Please wait…`:i?`Link selected key`:`Show Vault keys`})})]})})}var pD=[{id:`payments`,label:`Payment key`},{id:`identity`,label:`Identity key`},{id:`ordinals`,label:`Ordinals key`}];function mD({token:e,onBack:t,onUnlock:n}){let[r,i]=(0,A.useState)(),[a,o]=(0,A.useState)({}),[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)(!1),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(0);(0,A.useEffect)(()=>{fetch(`/api/embedded/roles`,{headers:{Authorization:`Bearer ${e}`}}).then(async e=>{if(!e.ok)throw Error(`Could not load key settings.`);let t=await e.json();i(t),o({payments:t.defaults.payments??t.keys[0]?.selector??null,identity:t.defaults.identity===void 0?void 0:t.defaults.identity,ordinals:t.defaults.ordinals===void 0?void 0:t.defaults.ordinals})}).catch(e=>c(e.message))},[e,p]);async function h(){if(r&&!l){u(!0),c(``);try{let t=await fetch(`/api/embedded/roles`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({defaults:a,revision:r.revision})});if(!t.ok)throw Error(`Could not save key settings. Reload and try again.`);let o=await t.json();if(i(o),!o.effective.payments)throw Error(`Select a payment key to continue.`);n(o.effective.payments.split(`:`)[0])}catch(e){c(e instanceof Error?e.message:`Could not save settings.`)}finally{u(!1)}}}return(0,$.jsxs)(FE,{navigation:!1,children:[(0,$.jsx)(IE,{eyebrow:`Your Vault`,title:`Choose your default keys`,description:`Keep all your keys in one Vault. Choose which key each role uses; project MCP settings can override individual roles.`}),s&&(0,$.jsx)(RE,{tone:`error`,children:s}),d?(0,$.jsx)(fD,{token:e,onLinked:()=>{f(!1),m(e=>e+1)}}):(0,$.jsx)(zE,{variant:`secondary`,onClick:()=>f(!0),children:`Choose another key from Vault`}),(0,$.jsx)(LE,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`Import several wallets before unlocking. Choosing a default does not move keys or funds.`}),pD.map(e=>(0,$.jsxs)(`label`,{className:`field-label`,children:[e.label,(0,$.jsxs)(`select`,{className:`field`,value:a[e.id]===void 0?`inherit`:a[e.id]??``,disabled:!r||l,onChange:t=>o({...a,[e.id]:t.target.value===`inherit`?void 0:t.target.value||null}),children:[e.id!==`payments`&&(0,$.jsx)(`option`,{value:`inherit`,children:`Use payment key`}),(0,$.jsx)(`option`,{value:``,children:e.id===`payments`?`Choose a key`:`Disabled`}),r?.keys.map(e=>(0,$.jsxs)(`option`,{value:e.selector,children:[e.selector,` · `,e.publicKey.slice(-8)]},e.selector))]}),r?.overrides.includes(e.id)&&(0,$.jsxs)(`span`,{className:`source-detail`,children:[`Project configuration overrides this role:`,` `,r.effective[e.id]??`disabled`,`.`]})]},e.id)),(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(zE,{variant:`secondary`,onClick:t,disabled:l,children:`Import more wallets`}),(0,$.jsx)(zE,{onClick:h,disabled:!r||l,children:`Save defaults and unlock`})]})]})})]})}function hD({token:e,standalone:t=!1}){let[n,r]=(0,A.useState)(`welcome`),[i,a]=(0,A.useState)([]),[o,s]=(0,A.useState)(`default`),[c,l]=(0,A.useState)(``),[u,d]=(0,A.useState)(``),[f,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(``),[g,_]=(0,A.useState)(),[v,y]=(0,A.useState)(!1),[b,x]=(0,A.useState)(!1);(0,A.useEffect)(()=>{e&&fetch(`/api/inventory`,{headers:{Authorization:`Bearer ${e}`}}).then(e=>e.ok?e.json():void 0).then(e=>{e?.sources?.length&&s(`new-wallet`),a(e?.boundAccounts??[]),y(e?.vaultExists===!0)}).catch(()=>{})},[e]);function S(e){f||b||(r(e),window.history.pushState({view:e},``,`/setup/source?mode=migration&view=${e}`))}(0,A.useEffect)(()=>{let e=()=>{if(f||b){window.history.replaceState({view:n},``,`/setup/source?mode=migration&view=${n}`);return}let e=window.history.state?.view;r(e===`create`||e===`existing`||e===`unlock`||e===`roles`?e:`welcome`),l(``),d(``),h(``)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[f,b,n]);function C(){l(``),d(``),h(``),S(`welcome`)}async function w(t){if(t.preventDefault(),!f){if(c.length<8){h(`Choose a password with at least 8 characters.`);return}if(n!==`unlock`&&c!==u){h(`The passwords don’t match. Try again.`);return}p(!0),h(``);try{let t=await fetch(n===`unlock`?`/api/embedded/unlock`:`/api/embedded/create`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({accountName:o,activate:!1,password:c,passwordConfirmation:u,confirmation:`CREATE_NEW_CONFIRMED`})}),i=await t.json();if(!t.ok)throw Error(i.error||`Your wallet could not be created. Please try again.`);if(l(``),d(``),i.saved===!0){r(`roles`),window.history.pushState({view:`roles`},``,`/setup/source?mode=migration&view=roles`);return}if(i.ready!==!0)throw Error(`Your wallet was saved, but could not be activated. Reopen setup to unlock it.`);_(i.tools),x(!0)}catch(e){h(e instanceof Error?e.message:`Your wallet could not be created.`)}finally{p(!1)}}}return e?n===`roles`?(0,$.jsx)(mD,{token:e,onBack:()=>S(`existing`),onUnlock:e=>{s(e),S(`unlock`)}}):n===`existing`?(0,$.jsx)(dD,{token:e,standalone:t,onWelcome:C,onUnlock:()=>S(`roles`)}):b&&!t?(0,$.jsx)(FE,{navigation:!1,children:(0,$.jsx)(uD,{tools:g})}):(0,$.jsxs)(FE,{navigation:!1,children:[(0,$.jsx)(IE,{eyebrow:b?`Wallet saved`:n===`welcome`?`Welcome`:n===`unlock`?`Saved wallet`:`New wallet`,title:b?t?`Your wallet is saved`:`Your wallet is ready`:n===`welcome`?`Your wallet starts here`:n===`unlock`?`Unlock your wallet`:`Make it yours`,description:b?`Your keys are saved in your encrypted local Vault.`:n===`welcome`?`Start fresh, or bring a wallet you already use.`:n===`unlock`?`Enter your Vault password to use your wallet in this session.`:v?`Give your new wallet a name and enter your existing Vault password.`:`Give your wallet a name and choose a password to protect it.`}),b?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(RE,{tone:`success`,children:t?`Open wallet setup in your MCP client to unlock and use your saved wallet.`:`Your wallet is ready to use. Return to your MCP client to continue.`}),!t&&(0,$.jsx)(lD,{tools:g})]}):n===`welcome`?(0,$.jsxs)(`div`,{className:`setup-choices`,children:[(i.length>0||v)&&(0,$.jsx)(zE,{onClick:()=>S(`roles`),children:`Choose default keys`}),(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice`,onClick:()=>S(`create`),children:[(0,$.jsx)(`span`,{className:`choice-icon`,"aria-hidden":`true`,children:`+`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Create a new wallet`}),(0,$.jsx)(`span`,{children:`Get a fresh wallet, protected by your password.`})]}),(0,$.jsx)(`span`,{className:`choice-arrow`,"aria-hidden":`true`,children:`→`})]}),(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice`,onClick:()=>S(`existing`),children:[(0,$.jsx)(`span`,{className:`choice-icon`,"aria-hidden":`true`,children:`↗`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Use an existing wallet`}),(0,$.jsx)(`span`,{children:`Bring your existing keys and account with you.`})]}),(0,$.jsx)(`span`,{className:`choice-arrow`,"aria-hidden":`true`,children:`→`})]}),(0,$.jsx)(`p`,{className:`setup-reassurance`,children:`Your keys stay on this computer, encrypted in your Vault.`})]}):(0,$.jsx)(LE,{children:(0,$.jsxs)(`form`,{className:`surface-body`,onSubmit:w,children:[(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`wallet-name`,children:[`Wallet name`,(0,$.jsx)(`input`,{id:`wallet-name`,className:`field`,value:o,onChange:e=>s(e.target.value),autoComplete:`off`,pattern:`[a-z0-9][a-z0-9_-]{0,63}`,required:!0,disabled:f||n===`unlock`})]}),(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`new-password`,children:[`Password`,(0,$.jsx)(`input`,{id:`new-password`,className:`field`,type:`password`,value:c,onChange:e=>l(e.target.value),autoComplete:`new-password`,minLength:8,required:!0,disabled:f}),(0,$.jsx)(`span`,{className:`source-detail`,children:v?`Use the password for your existing Vault.`:`Use at least 8 characters. Keep this password somewhere safe.`})]}),n!==`unlock`&&(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`confirm-password`,children:[`Confirm password`,(0,$.jsx)(`input`,{id:`confirm-password`,className:`field`,type:`password`,value:u,onChange:e=>d(e.target.value),autoComplete:`new-password`,required:!0,disabled:f})]}),m?(0,$.jsx)(`div`,{className:`stack-surface`,children:(0,$.jsx)(RE,{tone:`error`,children:m})}):null,(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(zE,{variant:`secondary`,onClick:C,disabled:f,children:`Back`}),(0,$.jsx)(zE,{type:`submit`,disabled:f,"aria-busy":f,children:f?`Please wait…`:n===`unlock`?`Unlock wallet`:`Create wallet`})]})]})})]}):(0,$.jsx)(FE,{navigation:!1,children:(0,$.jsx)(IE,{eyebrow:`Setup connection`,title:`Reopen wallet setup`,description:`Open wallet setup from your MCP client to start a private local session.`})})}var gD=[`identity-signing`,`payments`,`one-sat`,`encryption`],_D=[`source`,`destination`,`unlock`,`review`],vD=`migration`,yD=new Set(`token.setuptoken.setup_token.passphrase.sourcepassphrase.source_passphrase.destinationpassphrase.destination_passphrase.password.passwd.session.sessionid.session_id.secret.privatekey.private_key.wif.mnemonic.auth.authorization.accesstoken.access_token.refreshtoken.refresh_token.idtoken.id_token.apikey.api_key`.split(`.`));function bD(e){return _D.indexOf(e)}function xD(e){if(typeof e!=`string`)return null;switch(e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e){case`/setup/source`:return`source`;case`/setup/destination`:return`destination`;case`/setup/unlock`:return`unlock`;case`/setup/review`:return`review`;default:return null}}function SD(e){try{return new URLSearchParams(e).get(`mode`)===vD}catch{return!1}}function CD(e,t){let n=bD(e),r=bD(t);return n!==-1&&r!==-1&&n<=r}function wD(e,t,n){if(!SD(t))return`source`;let r=xD(e);return r===null?`source`:CD(r,n)?r:n}function TD(e,t){let n=new URLSearchParams(t);for(let e of[...n.keys()])yD.has(e.toLowerCase())&&n.delete(e);n.set(`mode`,vD);let r=n.toString();return`/setup/${e}${r?`?${r}`:``}`}function ED(){return{pathname:window.location.pathname,search:window.location.search}}function DD(e){let{maxStep:t,busy:n}=e,[r,i]=(0,A.useState)(`source`),a=(0,A.useRef)(`source`),o=(0,A.useRef)(t),s=(0,A.useRef)(n);return(0,A.useEffect)(()=>{a.current=r,o.current=t,s.current=n}),(0,A.useEffect)(()=>{if(typeof window>`u`)return;let e=ED(),t=wD(e.pathname,e.search,o.current);a.current=t,i(t),window.history.replaceState(null,``,TD(t,e.search))},[]),(0,A.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=a.current,t=ED();if(s.current){window.history.replaceState(null,``,TD(e,t.search));return}let n=wD(t.pathname,t.search,o.current);n!==e&&(a.current=n,i(n));let r=TD(n,t.search);`${t.pathname}${t.search}`!==r&&window.history.replaceState(null,``,r)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,A.useEffect)(()=>{typeof window>`u`||CD(r,t)||(a.current=t,i(t),window.history.replaceState(null,``,TD(t,window.location.search)))},[t,r]),{step:r,goToStep:(0,A.useCallback)(e=>{typeof window>`u`||n||CD(e,t)&&e!==r&&(i(e),a.current=e,window.history.pushState(null,``,TD(e,window.location.search)))},[n,t,r])}}var OD={"identity-signing":`Identity signing`,payments:`Payments`,"one-sat":`OneSat assets`,encryption:`Encryption`};function kD(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function AD(e){return e instanceof Error?e.message:String(e)}function jD({token:e,onWelcome:t}){let[n,r]=(0,A.useState)(),[i,a]=(0,A.useState)(),[o,s]=(0,A.useState)(),[c,l]=(0,A.useState)(),[u,d]=(0,A.useState)(),[f,p]=(0,A.useState)(),[m,h]=(0,A.useState)({}),[g,_]=(0,A.useState)(``),[v,y]=(0,A.useState)(``),[b,x]=(0,A.useState)(``),[S,C]=(0,A.useState)(`Inspecting local setup…`),[w,ee]=(0,A.useState)(),[te,ne]=(0,A.useState)(!1),[T,re]=(0,A.useState)(),[ie,ae]=(0,A.useState)(),{step:oe,goToStep:se}=DD({maxStep:f?`review`:c?`unlock`:o?`destination`:`source`,busy:T!==void 0}),[ce,le]=(0,A.useState)();(0,A.useEffect)(()=>{ce&&T===void 0&&(se(ce),le(void 0))},[ce,T,se]);function E(){_(``),y(``),ae(void 0);let e=_D.indexOf(oe);e>0&&se(_D[e-1])}let D=(0,A.useCallback)(async(t,n={})=>{let r=await fetch(t,{...n,headers:{Authorization:`Bearer ${e}`,...n.body?{"Content-Type":`application/json`}:{},...n.headers}}),i=null;try{i=await r.json()}catch{}if(!r.ok){let e=kD(i),t=Error(typeof e.error==`string`?e.error:`Local setup request failed`);throw Object.assign(t,{noEffect:e.noEffect===!0}),t}return kD(i)},[e]);(0,A.useEffect)(()=>{if(!e){ee(`This setup link is missing its local authorization token. Reopen it from BSV MCP.`);return}Promise.all([D(`/api/inventory`),D(`/api/migration/capabilities`)]).then(([e,t])=>{r(e),a(t),C(`Select a source to begin the local migration.`)}).catch(e=>ee(AD(e)))},[D,e]);function ue(e){T===void 0&&(s(e),le(`destination`),l(void 0),d(void 0),p(void 0),h({}),x(``),ee(void 0),ae(void 0),C(`Source selected: ${e.account}. Choose a Vault destination.`))}function de(e){e.preventDefault(),o&&i?.destinationDefaults&&(l({accountName:o.account,vaultPath:i.destinationDefaults.vaultPath,vaultEntryId:`new`}),le(`unlock`),x(``),p(void 0),h({}),ee(void 0),ae(void 0),C(`Destination selected. Unlock the Vault locally to preview preservation.`))}async function fe(e){if(e.preventDefault(),!o||!c||!i?.available)return;let t=g,n=v;if(_(``),y(``),x(``),!t.trim()&&!n.trim()){ae(`Enter the source backup passphrase or the destination Vault passphrase to unlock locally.`),C(`Action needs attention. Enter at least one passphrase.`);return}ae(void 0),re(`unlock`),ee(void 0),ne(!1),C(`Unlocking locally…`);try{let e=await D(`/api/migration/unlock`,{method:`POST`,body:JSON.stringify({source:o,destination:c,sourcePassphrase:t,destinationPassphrase:n||void 0})});d(e.session),le(`review`),p(e.preview),h(zD(e.preview)),C(`Preview ready. Review preservation before cutover.`)}catch(e){pe(e)}finally{_(``),y(``),re(void 0)}}function pe(e){let t=e;ee(AD(e)),ne(t?.noEffect===!0),C(`Action needs attention.`)}async function me(){if(_(``),y(``),x(``),ae(void 0),!u){C(`Unlock fields cleared.`);return}re(`lock`);try{await D(`/api/migration/lock`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})}),d(void 0),p(void 0),h({}),C(`Vault session locked. Unlock again locally to continue.`)}catch(e){pe(e)}finally{re(void 0)}}async function he(){if(u){re(`refresh`);try{let e=await D(`/api/migration/preview`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})});p(e.preview),h(zD(e.preview)),x(``),ee(void 0),C(`Preview refreshed. Review it before trying the cutover again.`)}catch(e){pe(e)}finally{re(void 0)}}}async function ge(e,t){if(u&&[`keep-existing`,`import-source`,`skip`].includes(t)){re(`resolve:${e}`);try{let n=(await D(`/api/migration/resolve`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId,conflictId:e,resolution:t})})).preview;p(n),h(zD(n)),x(``),ee(void 0),C(`Conflict resolution saved. Review the updated preservation preview.`)}catch(e){pe(e)}finally{re(void 0)}}}async function _e(){if(u){re(`reconcile`);try{let e=await D(`/api/migration/reconcile`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})});e.phase===`destination`?(d(void 0),p(void 0),h({}),x(``),C(`Backend confirmed the source is safe to retry. Unlock again locally.`)):e.phase===`complete`?(x(``),C(`Vault cutover complete and verified.`)):C(`Cutover status is still unknown. Keep the source and backup until reconciliation succeeds.`)}catch(e){pe(e)}finally{re(void 0)}}}async function ve(){if(u&&f&&VD(f,m,b)){re(`cutover`),ee(void 0),C(`Preparing a recoverable backup…`);try{let e=await D(`/api/migration/cutover`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId,confirmation:`MIGRATE_AND_SWITCH`,roleSelection:f.projectRoles?BD(f,m):void 0})});if(e.error)throw Error(String(e.error));C(`Migration verified. Account ${String(kD(e).accountName??c?.accountName??``)} is ready in Vault.`),p(void 0)}catch(e){pe(e)}finally{re(void 0)}}}return(0,$.jsxs)(FE,{navigation:!1,children:[(0,$.jsx)(IE,{eyebrow:`Step ${_D.indexOf(oe)+1} of ${_D.length}`,title:`Set up your wallet`,description:`Bring an existing wallet into your local encrypted Vault.`}),oe===`source`&&t?(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(zE,{variant:`secondary`,onClick:t,disabled:T!==void 0,children:`Back`})}):null,oe===`source`?null:(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(zE,{variant:`secondary`,onClick:E,disabled:T!==void 0,children:`Back`}),(0,$.jsxs)(`span`,{className:`dim`,children:[`Wallet: `,o?.account]})]}),w?(0,$.jsx)(LE,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(RE,{tone:`error`,children:[w,te?` No destination write or source change was reported; retry the preview when ready.`:``]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(zE,{variant:`secondary`,disabled:T!==void 0||!u,"aria-busy":T!==void 0||void 0,onClick:te?he:_e,children:T===void 0?te?`Retry preview`:`Reconcile cutover`:te?`Retrying preview…`:`Reconciling cutover…`})})]})}):null,oe===`source`?(0,$.jsx)(MD,{inventory:n,source:o,onSelect:ue,disabled:T!==void 0}):null,oe===`destination`?(0,$.jsx)(ND,{source:o,destination:c,defaults:i?.destinationDefaults,onSubmit:de,pending:T}):null,oe===`unlock`?(0,$.jsx)(PD,{source:o,destination:c,backend:i,sourcePassphrase:g,destinationPassphrase:v,setSourcePassphrase:_,setDestinationPassphrase:y,validationError:ie,onSubmit:fe,onLock:me,pending:T}):null,oe===`review`?(0,$.jsx)(FD,{preview:f,roles:m,setRoles:h,confirmation:b,setConfirmation:x,onRefresh:he,onResolve:ge,onCutover:ve,canCutover:!!(f&&VD(f,m,b)),pending:T,status:S}):null,(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`dim migration-footnote`,children:S}),(0,$.jsx)(RD,{inventory:n})]})}function MD({inventory:e,source:t,onSelect:n,disabled:r}){let i={"legacy-root":`Earlier BSV MCP wallet`,account:`BSV MCP account`,custom:`Configured wallet`};return(0,$.jsxs)(LE,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Choose a wallet to bring into Vault`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`These files were found on this computer. Choose the wallet you want to keep using.`}),e?e.sources.length?e.sources.map(e=>{let a=t?.account===e.account&&t.location===e.location,o=e.encryptedBackup||e.plaintextKeys,s=[...e.encryptedBackup?[`keys.bep — encrypted key backup`]:[],...e.plaintextKeys?[`${e.keyFile??`keys.json`} — unencrypted key file`]:[],...e.walletDatabases.map(e=>`${e} — wallet database`)];return(0,$.jsxs)(`div`,{className:`source-row`,children:[(0,$.jsxs)(`div`,{className:`source-meta`,children:[(0,$.jsx)(`span`,{className:`source-title`,children:e.account}),(0,$.jsx)(`span`,{className:`source-detail`,children:i[e.location]}),(0,$.jsx)(`p`,{className:`source-detail`,children:e.encryptedBackup?`An encrypted key backup was found. You’ll need its password.`:e.plaintextKeys?`An unencrypted key file was found. Importing will add an encrypted copy to Vault.`:`Wallet data was found, but no key backup. This source cannot be imported on its own.`}),(0,$.jsx)(`div`,{className:`source-location`,children:e.directory}),(0,$.jsxs)(`details`,{className:`source-files`,children:[(0,$.jsxs)(`summary`,{children:[`Files found (`,s.length,`)`]}),(0,$.jsx)(`ul`,{className:`file-list`,children:s.map(e=>(0,$.jsx)(`li`,{children:e},e))})]})]}),o?(0,$.jsx)(zE,{variant:a?`secondary`:`primary`,disabled:r,onClick:()=>n(e),children:a?`Selected`:`Use this wallet`}):(0,$.jsx)(`span`,{className:`source-detail`,children:`Key backup needed`})]},`${e.location}:${e.account}`)}):(0,$.jsx)(RE,{tone:`info`,children:`No existing wallet files were found.`}):(0,$.jsx)(BE,{label:`Finding local wallets`}),e?(0,$.jsx)(`p`,{className:`dim`,children:e.vaultExists?`A Vault file was found. Its contents can be checked after you unlock it.`:`No Vault file was found on this computer.`}):null]})]})}function ND({source:e,destination:t,defaults:n,onSubmit:r,pending:i}){return(0,$.jsxs)(LE,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Where your wallet will be saved`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`Your wallet will be added to the local encrypted Vault. Its existing keys and address will be checked before anything is switched.`}),n&&e?(0,$.jsxs)(`form`,{onSubmit:r,children:[(0,$.jsxs)(`dl`,{className:`stack-surface`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`field-label`,children:`Wallet`}),(0,$.jsx)(`dd`,{children:e.account})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`field-label`,children:`Vault location`}),(0,$.jsx)(`dd`,{style:{overflowWrap:`anywhere`},children:t?.vaultPath??n.vaultPath})]})]}),(0,$.jsx)(`p`,{className:`dim`,children:`A new entry will be created for this wallet. Existing Vault entries are kept.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(zE,{type:`submit`,disabled:i!==void 0,children:`Continue`})})]}):(0,$.jsx)(RE,{tone:`info`,children:`The local server has not provided a Vault destination. Reopen setup after its configuration is complete.`})]})]})}function PD({source:e,destination:t,backend:n,sourcePassphrase:r,destinationPassphrase:i,setSourcePassphrase:a,setDestinationPassphrase:o,validationError:s,onSubmit:c,onLock:l,pending:u}){return n?.available?(0,$.jsxs)(LE,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`03 / unlock`}),(0,$.jsx)(`h2`,{children:`Unlock locally and preview`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[n?(0,$.jsx)(RE,{tone:n.available?`success`:`warning`,children:n.available?`Vault migration backend is ready. Unlock stays on this device.`:n.reason??`Vault migration is unavailable.`}):(0,$.jsx)(BE,{label:`Checking Vault migration support`}),(0,$.jsxs)(`form`,{onSubmit:c,children:[(0,$.jsxs)(`label`,{className:`field-label`,children:[`Source backup passphrase`,(0,$.jsx)(`input`,{className:`field`,type:`password`,value:r,onChange:e=>a(e.target.value),autoComplete:`current-password`,pattern:`.*\\S.*`,title:`Use at least one non-whitespace character.`,"aria-invalid":s?!0:void 0,"aria-describedby":s?`unlock-validation-error`:void 0,disabled:!n?.available||!e||!t||u!==void 0})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Destination Vault passphrase`,(0,$.jsx)(`input`,{className:`field`,type:`password`,value:i,onChange:e=>o(e.target.value),autoComplete:`new-password`,pattern:`.*\\S.*`,title:`Use at least one non-whitespace character.`,"aria-invalid":s?!0:void 0,"aria-describedby":s?`unlock-validation-error`:void 0,disabled:!n?.available||!e||!t||u!==void 0})]}),s?(0,$.jsx)(`div`,{id:`unlock-validation-error`,children:(0,$.jsx)(RE,{tone:`error`,children:s})}):null,(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(zE,{type:`submit`,"aria-busy":u===`unlock`||void 0,disabled:!n?.available||!e||!t||u!==void 0,children:u===`unlock`?`Unlocking…`:`Unlock locally`}),(0,$.jsx)(zE,{type:`button`,variant:`secondary`,onClick:l,"aria-busy":u===`lock`||void 0,disabled:u!==void 0,children:u===`lock`?`Locking…`:`Lock session`})]})]}),(0,$.jsx)(`p`,{className:`dim`,children:`Passphrases are sent only to the loopback setup server and cleared after each request.`})]})]}):(0,$.jsxs)(LE,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Setup is not ready to continue`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`The local server cannot import this wallet yet. Your existing files have not been changed.`}),n?.reason?(0,$.jsxs)(`details`,{children:[(0,$.jsx)(`summary`,{children:`Connection details`}),(0,$.jsx)(`p`,{children:n.reason})]}):null]})]})}function FD({preview:e,roles:t,setRoles:n,confirmation:r,setConfirmation:i,onRefresh:a,onResolve:o,onCutover:s,canCutover:c,pending:l,status:u}){if(!e)return null;let d=kD(kD(e.projectRoles?.current).current);return(0,$.jsxs)(LE,{className:`stack-surface`,children:[(0,$.jsxs)(`div`,{className:`surface-header`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`04 / verify`}),(0,$.jsx)(`h2`,{children:`Review preservation`})]}),(0,$.jsx)(zE,{variant:`secondary`,onClick:a,"aria-busy":l===`refresh`||void 0,disabled:l!==void 0,children:l===`refresh`?`Refreshing preview…`:`Refresh preview`})]}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(RE,{tone:`info`,children:u}),(0,$.jsxs)(`div`,{className:`grid grid-two`,children:[(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(ID,{label:`Source`,value:`${e.source.account} · ${e.source.location}`}),(0,$.jsx)(ID,{label:`Identity`,value:e.preservation.identity}),(0,$.jsx)(ID,{label:`Addresses`,value:e.preservation.addresses}),(0,$.jsx)(ID,{label:`Databases`,value:e.preservation.databases.length?e.preservation.databases.join(`, `):`none`}),(0,$.jsx)(ID,{label:`Vault entries`,value:e.preservation.vaultEntries})]}),(0,$.jsx)(`pre`,{className:`json-preview`,children:JSON.stringify({source:e.source,destination:e.destination,conflicts:e.conflicts},null,2)})]}),e.projectRoles?(0,$.jsx)(LD,{projectRoles:e.projectRoles,assignments:d,roles:t,setRoles:n,onRefresh:a,pending:l}):null,e.conflicts.length?(0,$.jsx)(`div`,{className:`conflict-list`,children:e.conflicts.map(e=>(0,$.jsxs)(`div`,{className:`role-row`,children:[(0,$.jsx)(`label`,{className:`role-label`,htmlFor:`conflict-resolution-${e.id}`,children:e.message}),(0,$.jsxs)(`select`,{id:`conflict-resolution-${e.id}`,className:`select`,"aria-label":`Resolve conflict: ${e.message}`,value:e.resolution??``,onChange:t=>o(e.id,t.target.value),disabled:l!==void 0,children:[(0,$.jsx)(`option`,{value:``,children:`Choose a resolution`}),(0,$.jsx)(`option`,{value:`keep-existing`,children:`Keep existing Vault entry`}),(0,$.jsx)(`option`,{value:`import-source`,children:`Import source material`}),(0,$.jsx)(`option`,{value:`skip`,children:`Skip this item`})]})]},e.id))}):(0,$.jsx)(`p`,{className:`dim`,children:`No conflicts reported.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Type `,(0,$.jsx)(`strong`,{children:`MIGRATE_AND_SWITCH`}),` to authorize`,(0,$.jsx)(`input`,{className:`field`,value:r,onChange:e=>i(e.target.value),autoComplete:`off`,disabled:l!==void 0})]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(zE,{onClick:s,"aria-busy":l===`cutover`||void 0,disabled:!c||l!==void 0,children:l===`cutover`?`Migrating to Vault…`:`Import and switch to Vault`})})]})]})}function ID({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`data-row`,children:[(0,$.jsx)(`span`,{className:`data-label`,children:e}),(0,$.jsx)(`span`,{className:`data-value`,children:t})]})}function LD({projectRoles:e,assignments:t,roles:n,setRoles:r,onRefresh:i,pending:a}){let o=kD(e).presentation,s=e.candidates,c=Array.isArray(o&&o.roles)?o.roles.filter(e=>!!(e&&typeof e==`object`)):[],l=c.length?c.map(e=>({role:String(e.role),label:String(e.label??OD[e.role]??e.role),current:e.current,selectedValue:typeof e.selectedValue==`string`?e.selectedValue:void 0,choices:Array.isArray(e.choices)?e.choices.filter(e=>!!(e&&typeof e==`object`)):[]})):gD.map(e=>({role:e,label:OD[e],current:t[e],selectedValue:void 0,choices:[]}));return(0,$.jsxs)(`div`,{className:`stack-surface`,children:[(0,$.jsx)(`p`,{className:`section-label`,children:`project roles`}),(0,$.jsx)(`h3`,{children:`Choose a verified key for each role`}),(0,$.jsx)(`p`,{className:`dim`,children:`Only candidate IDs are sent when you continue. Key material and paths stay in the trusted backend.`}),s.length===0?(0,$.jsxs)(`div`,{className:`stack-surface`,children:[(0,$.jsx)(RE,{tone:`info`,children:`No verified keys are available for project roles. Refresh the preview to check again.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(zE,{variant:`secondary`,onClick:i,"aria-busy":a===`refresh`||void 0,disabled:a!==void 0,children:a===`refresh`?`Refreshing preview…`:`Refresh preview`})})]}):null,(0,$.jsx)(`div`,{className:`role-grid`,children:l.map(e=>{let t=e.role,i=typeof e.current==`string`?`keep:${e.current}`:`unassigned`,o=n[t]??e.selectedValue??i;return(0,$.jsxs)(`label`,{className:`role-row`,children:[(0,$.jsx)(`span`,{className:`role-label`,children:e.label}),(0,$.jsx)(`span`,{className:`role-help`,children:typeof e.current==`string`?`Current: ${String(e.current)}`:`No current assignment`}),(0,$.jsxs)(`select`,{className:`select`,value:o,disabled:a!==void 0,onChange:e=>r(n=>({...n,[t]:e.target.value})),children:[(0,$.jsx)(`option`,{value:`unassigned`,children:`Leave unassigned`}),typeof e.current==`string`?(0,$.jsx)(`option`,{value:i,children:`Keep current selection`}):null,e.choices.length?e.choices.map(e=>(0,$.jsx)(`option`,{value:String(e.value),disabled:e.disabled===!0,children:String(e.label??e.value)},String(e.value))):s.map(e=>(0,$.jsxs)(`option`,{value:`select:${e.candidateId}`,disabled:!!e.unavailableReason||!e.supportedRoles.includes(t),children:[e.label,e.publicDerivationLabel?` · ${e.publicDerivationLabel}`:``,e.unavailableReason?` · ${e.unavailableReason}`:``]},e.candidateId))]})]},t)})})]})}function RD({inventory:e}){return e?.migrationRequired?(0,$.jsx)(`p`,{className:`dim migration-footnote`,children:`No source is erased and the running wallet is not switched until explicit cutover completes and verifies.`}):null}function zD(e){let t=kD(e.projectRoles).presentation;if(t&&Array.isArray(t.roles)){let e=Object.fromEntries(t.roles.filter(e=>!!(e&&typeof e==`object`)).map(e=>[e.role,e.selectedValue]));return Object.fromEntries(gD.map(t=>[t,typeof e[t]==`string`?e[t]:`unassigned`]))}let n=kD(kD(e.projectRoles?.current).current);return Object.fromEntries(gD.map(e=>[e,typeof n[e]==`string`?`keep:${n[e]}`:`unassigned`]))}function BD(e,t){let n=kD(e.projectRoles).presentation,r=kD(e.projectRoles?.current),i=n&&typeof n.revision==`number`?n.revision:typeof r.revision==`number`?r.revision:null;return{expectedProjectId:e.projectRoles?.projectId??``,expectedRevision:i,roleAssignments:Object.fromEntries(gD.map(e=>[e,t[e]??`unassigned`]))}}function VD(e,t,n){return n===`MIGRATE_AND_SWITCH`&&e.conflicts.every(e=>!!e.resolution)&&(!e.projectRoles||gD.every(e=>typeof t[e]==`string`))}var HD={mode:null,token:``,flow:null},UD=null;function WD(){return HD}function GD(){if(!UD){let e=window.location.hash.slice(1);UD={mode:window.location.pathname.startsWith(`/setup/`)?`migration`:new URLSearchParams(window.location.search).get(`mode`),token:e,flow:new URLSearchParams(window.location.search).get(`flow`)}}return UD}function KD(){return()=>{}}function qD(){let{mode:e,token:t,flow:n}=(0,A.useSyncExternalStore)(KD,GD,WD);return(0,A.useEffect)(()=>{typeof window>`u`||t&&window.history.replaceState(null,``,`${window.location.pathname}?mode=${e??`migration`}${n===`project`||n===`standalone`?`&flow=${n}`:``}`)},[e,t,n]),e===`migration`||t.length>0?n===`project`?(0,$.jsx)(jD,{token:t}):(0,$.jsx)(hD,{token:t,standalone:n===`standalone`}):(0,$.jsx)(qE,{})}var JD=document.getElementById(`root`);if(!JD)throw Error(`Local app is missing its root element`);(0,pa.createRoot)(JD).render((0,$.jsx)(qD,{}));
|