@ekg_gg/devkit 0.0.11 → 0.0.12

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.
@@ -1,4 +1,4 @@
1
- import{state as e,widget as t}from"ekg:widget";import{EventSchema as n,loadWidget as r}from"ekg:devkit";import"@fontsource-variable/inter";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(e&&(t=e(e=0)),t),d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=e=>{let t={};for(var n in e)a(t,n,{get:e[n],enumerable:!0});return t},p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},m=(e,t,n)=>(n=e==null?{}:i(c(e)),p(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),h=e=>p(a({},`__esModule`,{value:!0}),e);(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var g=d((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},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+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+A(a,u),c+=te(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+A(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(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 M(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(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 N=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)},P={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,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)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},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,N)}catch(e){N(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.0`})),_=d(((e,t)=>{t.exports=g()})),v=d((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,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=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&&E());){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&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(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,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),y=d(((e,t)=>{t.exports=v()})),b=d((e=>{var t=_();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 s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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=c(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=c(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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.0`})),x=d(((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=b()})),S=d((e=>{var t=y(),n=_(),r=x();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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(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 s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case b:return`Profiler`;case v:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h: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 D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},F=[],I=-1;function ie(e){return{current:e}}function ae(e){0>I||(e.current=F[I],F[I]=null,I--)}function L(e,t){I++,F[I]=e.current,e.current=t}var oe=ie(null),se=ie(null),ce=ie(null),le=ie(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?uf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=uf(t),e=df(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(oe),L(oe,e)}function de(){ae(oe),ae(se),ae(ce)}function fe(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=df(t,e.type);t!==n&&(L(se,e),L(oe,n))}function pe(e){se.current===e&&(ae(oe),ae(se)),le.current===e&&(ae(le),bp._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
1
+ import{state as e,widget as t}from"ekg:widget";import{EventSchema as n,manager as r}from"ekg:devkit";import"@fontsource-variable/inter";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(e&&(t=e(e=0)),t),d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=e=>{let t={};for(var n in e)a(t,n,{get:e[n],enumerable:!0});return t},p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},m=(e,t,n)=>(n=e==null?{}:i(c(e)),p(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),h=e=>p(a({},`__esModule`,{value:!0}),e);(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var g=d((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},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+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+A(a,u),c+=te(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+A(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(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 M(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(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 N=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)},P={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,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)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},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,N)}catch(e){N(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.0`})),_=d(((e,t)=>{t.exports=g()})),v=d((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,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=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&&E());){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&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(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,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),y=d(((e,t)=>{t.exports=v()})),b=d((e=>{var t=_();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 s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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=c(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=c(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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.0`})),x=d(((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=b()})),S=d((e=>{var t=y(),n=_(),r=x();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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(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 s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case b:return`Profiler`;case v:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h: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 D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},F=[],I=-1;function ie(e){return{current:e}}function ae(e){0>I||(e.current=F[I],F[I]=null,I--)}function L(e,t){I++,F[I]=e.current,e.current=t}var oe=ie(null),se=ie(null),ce=ie(null),le=ie(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?uf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=uf(t),e=df(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(oe),L(oe,e)}function de(){ae(oe),ae(se),ae(ce)}function fe(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=df(t,e.type);t!==n&&(L(se,e),L(oe,n))}function pe(e){se.current===e&&(ae(oe),ae(se)),le.current===e&&(ae(le),bp._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
2
2
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
3
  `+me+e+he}var R=!1;function _e(e,t){if(!e||R)return``;R=!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
4
  `),l=s.split(`
@@ -35,4 +35,4 @@ Error generating stack: `+e.message+`
35
35
  newResult[${r}] = ${n}.value;
36
36
  }
37
37
 
38
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=J_,s=!P_.jitless,c=s&&Y_.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?pb([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function gb(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=>!uv(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=>pv(e,r,F_())))}),t)}const _b=Q(`$ZodUnion`,(e,t)=>{Ay.init(e,t),U_(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),U_(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),U_(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),U_(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>B_(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>gb(t,i,e,a)):gb(s,i,e,a)}}),vb=Q(`$ZodIntersection`,(e,t)=>{Ay.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])=>bb(e,t,n)):bb(e,i,a)}});function yb(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(X_(e)&&X_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=yb(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=yb(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 bb(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),uv(e))return e;let r=yb(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const xb=Q(`$ZodRecord`,(e,t)=>{Ay.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!X_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...dv(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...dv(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>pv(e,r,F_())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...dv(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...dv(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Sb=Q(`$ZodEnum`,(e,t)=>{Ay.init(e,t);let n=I_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Q_.has(typeof e)).map(e=>typeof e==`string`?$_(e):e.toString()).join(`|`)})$`),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}}),Cb=Q(`$ZodLiteral`,(e,t)=>{if(Ay.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?$_(e):e?$_(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),wb=Q(`$ZodTransform`,(e,t)=>{Ay.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new N_(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 M_;return n.value=i,n}});function Tb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Eb=Q(`$ZodOptional`,(e,t)=>{Ay.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,U_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),U_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${B_(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Tb(t,e.value)):Tb(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Db=Q(`$ZodNullable`,(e,t)=>{Ay.init(e,t),U_(e._zod,`optin`,()=>t.innerType._zod.optin),U_(e._zod,`optout`,()=>t.innerType._zod.optout),U_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${B_(e.source)}|null)$`):void 0}),U_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ob=Q(`$ZodDefault`,(e,t)=>{Ay.init(e,t),e._zod.optin=`optional`,U_(e._zod,`values`,()=>t.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=>kb(e,t)):kb(r,t)}});function kb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ab=Q(`$ZodPrefault`,(e,t)=>{Ay.init(e,t),e._zod.optin=`optional`,U_(e._zod,`values`,()=>t.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))}),jb=Q(`$ZodNonOptional`,(e,t)=>{Ay.init(e,t),U_(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].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=>Mb(t,e)):Mb(i,e)}});function Mb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Nb=Q(`$ZodCatch`,(e,t)=>{Ay.init(e,t),U_(e._zod,`optin`,()=>t.innerType._zod.optin),U_(e._zod,`optout`,()=>t.innerType._zod.optout),U_(e._zod,`values`,()=>t.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(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>pv(e,n,F_()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>pv(e,n,F_()))},input:e.value}),e.issues=[]),e)}}),Pb=Q(`$ZodPipe`,(e,t)=>{Ay.init(e,t),U_(e._zod,`values`,()=>t.in._zod.values),U_(e._zod,`optin`,()=>t.in._zod.optin),U_(e._zod,`optout`,()=>t.out._zod.optout),U_(e._zod,`propValues`,()=>t.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=>Fb(e,t.in,n)):Fb(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Fb(e,t.out,n)):Fb(r,t.out,n)}});function Fb(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ib=Q(`$ZodReadonly`,(e,t)=>{Ay.init(e,t),U_(e._zod,`propValues`,()=>t.innerType._zod.propValues),U_(e._zod,`values`,()=>t.innerType._zod.values),U_(e._zod,`optin`,()=>t.innerType._zod.optin),U_(e._zod,`optout`,()=>t.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(Lb):Lb(r)}});function Lb(e){return e.value=Object.freeze(e.value),e}const Rb=Q(`$ZodCustom`,(e,t)=>{dy.init(e,t),Ay.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=>zb(t,n,r,e));zb(i,n,r,e)}});function zb(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(hv(e))}}var Bb=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return 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 Vb(){return new Bb}const Hb=Vb();function Ub(e,t){return new e({type:`string`,...$(t)})}function Wb(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...$(t)})}function Gb(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...$(t)})}function Kb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...$(t)})}function qb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...$(t)})}function Jb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...$(t)})}function Yb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...$(t)})}function Xb(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...$(t)})}function Zb(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...$(t)})}function Qb(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...$(t)})}function $b(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...$(t)})}function ex(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...$(t)})}function tx(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...$(t)})}function nx(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...$(t)})}function rx(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...$(t)})}function ix(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...$(t)})}function ax(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...$(t)})}function ox(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...$(t)})}function sx(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...$(t)})}function cx(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...$(t)})}function lx(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...$(t)})}function ux(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...$(t)})}function dx(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...$(t)})}function fx(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...$(t)})}function px(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...$(t)})}function mx(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...$(t)})}function hx(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...$(t)})}function gx(e,t){return new e({type:`number`,checks:[],...$(t)})}function _x(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...$(t)})}function vx(e){return new e({type:`unknown`})}function yx(e,t){return new e({type:`never`,...$(t)})}function bx(e,t){return new py({check:`less_than`,...$(t),value:e,inclusive:!1})}function xx(e,t){return new py({check:`less_than`,...$(t),value:e,inclusive:!0})}function Sx(e,t){return new my({check:`greater_than`,...$(t),value:e,inclusive:!1})}function Cx(e,t){return new my({check:`greater_than`,...$(t),value:e,inclusive:!0})}function wx(e,t){return new hy({check:`multiple_of`,...$(t),value:e})}function Tx(e,t){return new _y({check:`max_length`,...$(t),maximum:e})}function Ex(e,t){return new vy({check:`min_length`,...$(t),minimum:e})}function Dx(e,t){return new yy({check:`length_equals`,...$(t),length:e})}function Ox(e,t){return new xy({check:`string_format`,format:`regex`,...$(t),pattern:e})}function kx(e){return new Sy({check:`string_format`,format:`lowercase`,...$(e)})}function Ax(e){return new Cy({check:`string_format`,format:`uppercase`,...$(e)})}function jx(e,t){return new wy({check:`string_format`,format:`includes`,...$(t),includes:e})}function Mx(e,t){return new Ty({check:`string_format`,format:`starts_with`,...$(t),prefix:e})}function Nx(e,t){return new Ey({check:`string_format`,format:`ends_with`,...$(t),suffix:e})}function Px(e){return new Dy({check:`overwrite`,tx:e})}function Fx(e){return Px(t=>t.normalize(e))}function Ix(){return Px(e=>e.trim())}function Lx(){return Px(e=>e.toLowerCase())}function Rx(){return Px(e=>e.toUpperCase())}function zx(e,t,n){return new e({type:`array`,element:t,...$(n)})}function Bx(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...$(n)})}function Vx(e){let t=Hx(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(hv(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(hv(r))}},e(n.value,n)));return t}function Hx(e,t){let n=new dy({check:`custom`,...$(t)});return n._zod.check=e,n}const Ux=Q(`ZodISODateTime`,(e,t)=>{Wy.init(e,t),hS.init(e,t)});function Wx(e){return fx(Ux,e)}const Gx=Q(`ZodISODate`,(e,t)=>{Gy.init(e,t),hS.init(e,t)});function Kx(e){return px(Gx,e)}const qx=Q(`ZodISOTime`,(e,t)=>{Ky.init(e,t),hS.init(e,t)});function Jx(e){return mx(qx,e)}const Yx=Q(`ZodISODuration`,(e,t)=>{qy.init(e,t),hS.init(e,t)});function Xx(e){return hx(Yx,e)}var Zx=(e,t)=>{_v.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>bv(e,t)},flatten:{value:t=>yv(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,L_,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,L_,2)}},isEmpty:{get(){return e.issues.length===0}}})};Q(`ZodError`,Zx);const Qx=Q(`ZodError`,Zx,{Parent:Error}),$x=xv(Qx),eS=Sv(Qx),tS=Cv(Qx),nS=Tv(Qx),rS=Dv(Qx),iS=Ov(Qx),aS=kv(Qx),oS=Av(Qx),sS=jv(Qx),cS=Mv(Qx),lS=Nv(Qx),uS=Pv(Qx),dS=Q(`ZodType`,(e,t)=>(Ay.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(G_(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>ev(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>$x(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>tS(e,t,n),e.parseAsync=async(t,n)=>eS(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>nS(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>rS(e,t,n),e.decode=(t,n)=>iS(e,t,n),e.encodeAsync=async(t,n)=>aS(e,t,n),e.decodeAsync=async(t,n)=>oS(e,t,n),e.safeEncode=(t,n)=>sS(e,t,n),e.safeDecode=(t,n)=>cS(e,t,n),e.safeEncodeAsync=async(t,n)=>lS(e,t,n),e.safeDecodeAsync=async(t,n)=>uS(e,t,n),e.refine=(t,n)=>e.check(CC(t,n)),e.superRefine=t=>e.check(wC(t)),e.overwrite=t=>e.check(Px(t)),e.optional=()=>sC(e),e.nullable=()=>lC(e),e.nullish=()=>sC(lC(e)),e.nonoptional=t=>hC(e,t),e.array=()=>WS(e),e.or=t=>YS([e,t]),e.and=t=>ZS(e,t),e.transform=t=>yC(e,aC(t)),e.default=t=>dC(e,t),e.prefault=t=>pC(e,t),e.catch=t=>_C(e,t),e.pipe=t=>yC(e,t),e.readonly=()=>xC(e),e.describe=t=>{let n=e.clone();return Hb.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Hb.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Hb.get(e);let n=e.clone();return Hb.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fS=Q(`_ZodString`,(e,t)=>{jy.init(e,t),dS.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ox(...t)),e.includes=(...t)=>e.check(jx(...t)),e.startsWith=(...t)=>e.check(Mx(...t)),e.endsWith=(...t)=>e.check(Nx(...t)),e.min=(...t)=>e.check(Ex(...t)),e.max=(...t)=>e.check(Tx(...t)),e.length=(...t)=>e.check(Dx(...t)),e.nonempty=(...t)=>e.check(Ex(1,...t)),e.lowercase=t=>e.check(kx(t)),e.uppercase=t=>e.check(Ax(t)),e.trim=()=>e.check(Ix()),e.normalize=(...t)=>e.check(Fx(...t)),e.toLowerCase=()=>e.check(Lx()),e.toUpperCase=()=>e.check(Rx())}),pS=Q(`ZodString`,(e,t)=>{jy.init(e,t),fS.init(e,t),e.email=t=>e.check(Wb(gS,t)),e.url=t=>e.check(Xb(yS,t)),e.jwt=t=>e.check(dx(PS,t)),e.emoji=t=>e.check(Zb(bS,t)),e.guid=t=>e.check(Gb(_S,t)),e.uuid=t=>e.check(Kb(vS,t)),e.uuidv4=t=>e.check(qb(vS,t)),e.uuidv6=t=>e.check(Jb(vS,t)),e.uuidv7=t=>e.check(Yb(vS,t)),e.nanoid=t=>e.check(Qb(xS,t)),e.guid=t=>e.check(Gb(_S,t)),e.cuid=t=>e.check($b(SS,t)),e.cuid2=t=>e.check(ex(CS,t)),e.ulid=t=>e.check(tx(wS,t)),e.base64=t=>e.check(cx(jS,t)),e.base64url=t=>e.check(lx(MS,t)),e.xid=t=>e.check(nx(TS,t)),e.ksuid=t=>e.check(rx(ES,t)),e.ipv4=t=>e.check(ix(DS,t)),e.ipv6=t=>e.check(ax(OS,t)),e.cidrv4=t=>e.check(ox(kS,t)),e.cidrv6=t=>e.check(sx(AS,t)),e.e164=t=>e.check(ux(NS,t)),e.datetime=t=>e.check(Wx(t)),e.date=t=>e.check(Kx(t)),e.time=t=>e.check(Jx(t)),e.duration=t=>e.check(Xx(t))});function mS(e){return Ub(pS,e)}const hS=Q(`ZodStringFormat`,(e,t)=>{My.init(e,t),fS.init(e,t)}),gS=Q(`ZodEmail`,(e,t)=>{Fy.init(e,t),hS.init(e,t)}),_S=Q(`ZodGUID`,(e,t)=>{Ny.init(e,t),hS.init(e,t)}),vS=Q(`ZodUUID`,(e,t)=>{Py.init(e,t),hS.init(e,t)}),yS=Q(`ZodURL`,(e,t)=>{Iy.init(e,t),hS.init(e,t)}),bS=Q(`ZodEmoji`,(e,t)=>{Ly.init(e,t),hS.init(e,t)}),xS=Q(`ZodNanoID`,(e,t)=>{Ry.init(e,t),hS.init(e,t)}),SS=Q(`ZodCUID`,(e,t)=>{zy.init(e,t),hS.init(e,t)}),CS=Q(`ZodCUID2`,(e,t)=>{By.init(e,t),hS.init(e,t)}),wS=Q(`ZodULID`,(e,t)=>{Vy.init(e,t),hS.init(e,t)}),TS=Q(`ZodXID`,(e,t)=>{Hy.init(e,t),hS.init(e,t)}),ES=Q(`ZodKSUID`,(e,t)=>{Uy.init(e,t),hS.init(e,t)}),DS=Q(`ZodIPv4`,(e,t)=>{Jy.init(e,t),hS.init(e,t)}),OS=Q(`ZodIPv6`,(e,t)=>{Yy.init(e,t),hS.init(e,t)}),kS=Q(`ZodCIDRv4`,(e,t)=>{Xy.init(e,t),hS.init(e,t)}),AS=Q(`ZodCIDRv6`,(e,t)=>{Zy.init(e,t),hS.init(e,t)}),jS=Q(`ZodBase64`,(e,t)=>{$y.init(e,t),hS.init(e,t)}),MS=Q(`ZodBase64URL`,(e,t)=>{tb.init(e,t),hS.init(e,t)}),NS=Q(`ZodE164`,(e,t)=>{nb.init(e,t),hS.init(e,t)}),PS=Q(`ZodJWT`,(e,t)=>{ib.init(e,t),hS.init(e,t)}),FS=Q(`ZodNumber`,(e,t)=>{ab.init(e,t),dS.init(e,t),e.gt=(t,n)=>e.check(Sx(t,n)),e.gte=(t,n)=>e.check(Cx(t,n)),e.min=(t,n)=>e.check(Cx(t,n)),e.lt=(t,n)=>e.check(bx(t,n)),e.lte=(t,n)=>e.check(xx(t,n)),e.max=(t,n)=>e.check(xx(t,n)),e.int=t=>e.check(RS(t)),e.safe=t=>e.check(RS(t)),e.positive=t=>e.check(Sx(0,t)),e.nonnegative=t=>e.check(Cx(0,t)),e.negative=t=>e.check(bx(0,t)),e.nonpositive=t=>e.check(xx(0,t)),e.multipleOf=(t,n)=>e.check(wx(t,n)),e.step=(t,n)=>e.check(wx(t,n)),e.finite=()=>e;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});function IS(e){return gx(FS,e)}const LS=Q(`ZodNumberFormat`,(e,t)=>{ob.init(e,t),FS.init(e,t)});function RS(e){return _x(LS,e)}const zS=Q(`ZodUnknown`,(e,t)=>{sb.init(e,t),dS.init(e,t)});function BS(){return vx(zS)}const VS=Q(`ZodNever`,(e,t)=>{cb.init(e,t),dS.init(e,t)});function HS(e){return yx(VS,e)}const US=Q(`ZodArray`,(e,t)=>{ub.init(e,t),dS.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ex(t,n)),e.nonempty=t=>e.check(Ex(1,t)),e.max=(t,n)=>e.check(Tx(t,n)),e.length=(t,n)=>e.check(Dx(t,n)),e.unwrap=()=>e.element});function WS(e,t){return zx(US,e,t)}const GS=Q(`ZodObject`,(e,t)=>{hb.init(e,t),dS.init(e,t),U_(e,`shape`,()=>t.shape),e.keyof=()=>tC(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:BS()}),e.loose=()=>e.clone({...e._zod.def,catchall:BS()}),e.strict=()=>e.clone({...e._zod.def,catchall:HS()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>av(e,t),e.safeExtend=t=>ov(e,t),e.merge=t=>sv(e,t),e.pick=t=>rv(e,t),e.omit=t=>iv(e,t),e.partial=(...t)=>cv(oC,e,t[0]),e.required=(...t)=>lv(mC,e,t[0])});function KS(e,t){let n={type:`object`,shape:e??{},...$(t)};return new GS(n)}function qS(e,t){return new GS({type:`object`,shape:e,catchall:BS(),...$(t)})}const JS=Q(`ZodUnion`,(e,t)=>{_b.init(e,t),dS.init(e,t),e.options=t.options});function YS(e,t){return new JS({type:`union`,options:e,...$(t)})}const XS=Q(`ZodIntersection`,(e,t)=>{vb.init(e,t),dS.init(e,t)});function ZS(e,t){return new XS({type:`intersection`,left:e,right:t})}const QS=Q(`ZodRecord`,(e,t)=>{xb.init(e,t),dS.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function $S(e,t,n){return new QS({type:`record`,keyType:e,valueType:t,...$(n)})}const eC=Q(`ZodEnum`,(e,t)=>{Sb.init(e,t),dS.init(e,t),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 eC({...t,checks:[],...$(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 eC({...t,checks:[],...$(r),entries:i})}});function tC(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new eC({type:`enum`,entries:n,...$(t)})}const nC=Q(`ZodLiteral`,(e,t)=>{Cb.init(e,t),dS.init(e,t),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 rC(e,t){return new nC({type:`literal`,values:Array.isArray(e)?e:[e],...$(t)})}const iC=Q(`ZodTransform`,(e,t)=>{wb.init(e,t),dS.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new N_(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(hv(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(hv(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function aC(e){return new iC({type:`transform`,transform:e})}const oC=Q(`ZodOptional`,(e,t)=>{Eb.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sC(e){return new oC({type:`optional`,innerType:e})}const cC=Q(`ZodNullable`,(e,t)=>{Db.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lC(e){return new cC({type:`nullable`,innerType:e})}const uC=Q(`ZodDefault`,(e,t)=>{Ob.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dC(e,t){return new uC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Z_(t)}})}const fC=Q(`ZodPrefault`,(e,t)=>{Ab.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pC(e,t){return new fC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Z_(t)}})}const mC=Q(`ZodNonOptional`,(e,t)=>{jb.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function hC(e,t){return new mC({type:`nonoptional`,innerType:e,...$(t)})}const gC=Q(`ZodCatch`,(e,t)=>{Nb.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _C(e,t){return new gC({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const vC=Q(`ZodPipe`,(e,t)=>{Pb.init(e,t),dS.init(e,t),e.in=t.in,e.out=t.out});function yC(e,t){return new vC({type:`pipe`,in:e,out:t})}const bC=Q(`ZodReadonly`,(e,t)=>{Ib.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xC(e){return new bC({type:`readonly`,innerType:e})}const SC=Q(`ZodCustom`,(e,t)=>{Rb.init(e,t),dS.init(e,t)});function CC(e,t={}){return Bx(SC,e,t)}function wC(e){return Vx(e)}const TC=KS({width:IS().min(0).default(1e3),height:IS().min(0).default(1e3),settings:$S(mS(),BS()).default({}),events:$S(mS(),BS()).default({})}),EC=KS({$schema:rC(`https://ekg.gg/schemas/manifest.json`).default(`https://ekg.gg/schemas/manifest.json`),name:mS().optional(),version:mS().optional(),description:mS().optional(),template:mS().default(``),css:mS().default(``),js:mS().default(``),assets:$S(mS(),KS({type:mS().default(``),file:mS().default(``)})).optional(),settings:$S(mS(),qS({type:mS().default(``),name:mS().default(``),description:mS().optional()})).optional()});function DC(e){let t=TC.parse(JSON.parse(e.state)),r=EC.parse(JSON.parse(e.widget[`manifest.json`])),i=e=>import.meta.hot?.send(`ekg:state`,{...t,...e}),a=e=>import.meta.hot?.send(`ekg:manifest`,{...r,...e}),o=e=>i({width:e}),s=e=>i({height:e}),c=e=>a({name:e}),l=e=>a({version:e}),u=e=>a({description:e}),d=Object.entries(r.settings??{}).map(([n,r])=>({setting:{...r,key:n},value:t.settings[n]??(r.type===`image`?e.widget[r.default]:r.default),update:e=>i({settings:{...t.settings,[n]:e}})})),f=(0,w.useRef)(null),[p,m]=(0,w.useState)({width:1,height:1});(0,w.useEffect)(()=>{let e=f.current;if(!e)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();m({width:t,height:n})},n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[f.current]);let h=Math.min(p.width/t.width,p.height/t.height),[g,_]=(0,w.useState)(n.oneOf.map(e=>{let r=e.$ref.split(`/`).at(-1),i=n.$defs[r].properties.type.const,a={$schema:`https://json-schema.org/draft/2020-12/schema`,$defs:n.$defs,...n.$defs[r].properties.data},o=OC(a.properties,t.events[i]);return{name:r,type:i,schema:a,data:o}}));(0,w.useEffect)(()=>{i({events:Object.fromEntries(g.map(e=>[e.type,e.data]))})},[g]);let v=e=>{let t=g.find(t=>t.name===e);window.EkgBus.publish({id:kC(60),timestamp:Math.floor(Date.now()/1e3),type:t.type,data:t.data})};return(0,Z.jsxs)(`div`,{className:`flex h-screen dark:text-slate-100 dark:bg-slate-900`,children:[(0,Z.jsx)(`div`,{className:`bg-black/10 border-r border-white/10 w-72 contain-strict overflow-auto`,children:(0,Z.jsxs)(`div`,{className:`px-6 flex flex-col gap-4 pb-8`,children:[(0,Z.jsx)(`h1`,{className:`text-xl font-bold py-4`,children:`Widget Dev Kit`}),(0,Z.jsxs)(`div`,{className:`flex gap-4`,children:[(0,Z.jsx)(C_,{label:`Width:`,name:`width`,value:t.width,update:o}),(0,Z.jsx)(C_,{label:`Height:`,name:`height`,value:t.height,update:s})]}),(0,Z.jsx)(x_,{type:`text`,label:`Name:`,name:`name`,value:r.name??``,update:c}),(0,Z.jsx)(x_,{type:`text`,label:`Version:`,name:`version`,value:r.version??``,update:l}),(0,Z.jsx)(x_,{type:`textarea`,label:`Description:`,name:`description`,value:r.description??``,update:u}),(0,Z.jsx)(`h1`,{className:`text-lg font-bold pt-4`,children:`Settings`}),d.map(e=>(0,Z.jsx)(jC,{...e},e.setting.key))]})}),(0,Z.jsx)(`div`,{className:`p-4 sm:p-16 flex-1 contain-strict`,children:(0,Z.jsx)(`div`,{className:`@container-[size] h-full grid auto-cols-fr place-items-center`,children:(0,Z.jsx)(`div`,{ref:f,className:`max-w-full`,style:{aspectRatio:`${t.width}/${t.height}`,width:`${100*t.width/t.height}cqh`},children:(0,Z.jsx)(`div`,{className:`relative origin-top-left bg-white dark:bg-black`,style:{width:`${t.width}px`,height:`${t.height}px`,transform:`scale(${h})`},children:(0,Z.jsx)(AC,{state:t,manifest:r,widget:e.widget})})})})}),(0,Z.jsx)(`div`,{className:`bg-black/10 border-l border-white/10 w-72 contain-strict overflow-auto`,children:(0,Z.jsxs)(`div`,{className:`px-6 flex flex-col gap-4 pb-8`,children:[(0,Z.jsx)(`h1`,{className:`text-xl font-bold py-4`,children:`Test Events`}),g.map(e=>(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(y_,{variant:`secondary`,size:`md`,className:`grow`,onClick:()=>v(e.name),children:e.name}),(0,Z.jsx)(y_,{variant:`secondary`,size:`md`,commandfor:`${e.name}-modal`,command:`show-modal`,children:`S`}),(0,Z.jsx)(k_,{id:`${e.name}-modal`,name:e.name,schema:e.schema,data:e.data,setData:t=>_(n=>n.map(n=>n.name===e.name?{...n,data:t}:n))})]},e.name))]})})]})}function OC(e,t){let n=(e,n)=>t?.[e]&&(n===`array`?Array.isArray(t[e]):typeof t[e]===n)?t[e]:null;return Object.fromEntries(Object.entries(e).map(([e,r])=>e===`raw`?[e,n(e,`object`)??{}]:typeof r!=`object`||!r?[e,null]:`const`in r?[e,r.const]:`enum`in r&&Array.isArray(r.enum)?[e,r.enum.includes(t?.[e])?t[e]:r.enum[0]]:`type`in r?e.endsWith(`At`)&&r.type===`integer`?[e,n(e,`number`)??Math.floor(Date.now()/1e3)]:r.type===`string`?[e,n(e,`string`)??kC(12)]:r.type===`boolean`?[e,n(e,`boolean`)??!1]:r.type===`integer`?[e,n(e,`number`)??2]:r.type===`array`&&`items`in r&&typeof r.items==`object`&&r.items&&`$ref`in r.items&&r.items.$ref===`#/$defs/ChatNode`?[e,n(e,`array`)??[{type:`text`,text:kC(40)}]]:r.type===`array`?[e,n(e,`array`)??[]]:[e,null]:[e,null]))}function kC(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(36).slice(-1)).join(``)}function AC({state:e,manifest:t,widget:n}){let i=n[t.template],a=n[t.css],o=n[t.js],s=Object.fromEntries(Object.entries(t.assets??{}).map(([e,{file:t}])=>[e,n[t]])),c=Object.fromEntries(Object.entries(t.settings??{}).map(([t,{type:r,default:i}])=>[t,e.settings[t]??(r===`image`?n[i]:i)])),l=(0,w.useRef)(null);return(0,w.useEffect)(()=>{let e=l.current;if(!e||!i||!a||!o)return;console.log(`reloading widget`);let t=r(e,{template:i,js:o,css:a,assets:s,settings:c,initialData:{}});return()=>{t.then(([e,t])=>t())}},[l.current,i,a,o,JSON.stringify(s),JSON.stringify(c)]),(0,Z.jsx)(`div`,{ref:l,className:`size-full`})}function jC({setting:e,value:t,update:n}){if(e.choices){let r=Object.entries(e.choices).map(([e,t])=>({label:t,value:e})),i=[`decimal`,`integer`].includes(e.type)?e=>n(parseFloat(e)):n;return(0,Z.jsx)(E_,{label:e.name,description:e.description,name:e.key,value:t.toString(),update:i,options:r})}let r={label:e.name,description:e.description,name:e.key,value:t,update:n};switch(e.type){case`boolean`:return(0,Z.jsx)(b_,{...r});case`color`:return(0,Z.jsx)(S_,{...r});case`color_array`:return(0,Z.jsx)(j_,{...r,render:e=>(0,Z.jsx)(S_,{...e})});case`decimal`:return(0,Z.jsx)(w_,{...r});case`decimal_array`:return(0,Z.jsx)(j_,{...r,render:e=>(0,Z.jsx)(w_,{...e})});case`image`:return(0,Z.jsx)(A_,{...r});case`integer`:return(0,Z.jsx)(C_,{...r});case`integer_array`:return(0,Z.jsx)(j_,{...r,render:e=>(0,Z.jsx)(C_,{...e})});case`string`:return(0,Z.jsx)(x_,{type:`text`,...r});case`string_array`:return(0,Z.jsx)(j_,{...r,render:e=>(0,Z.jsx)(x_,{type:`text`,...e})})}return null}import.meta.hot?(MC(import.meta.hot.data.root??=(0,C.createRoot)(document.body),t,e),import.meta.hot.accept(`ekg:widget`,e=>{MC(import.meta.hot.data.root,e.widget,e.state)})):MC((0,C.createRoot)(document.body),t,e);function MC(e,t,n){let r=Object.fromEntries(Object.entries(t).map(([e,t])=>[e.slice(2),t]));e.render((0,Z.jsx)(w.StrictMode,{children:(0,Z.jsx)(D,{fallbackRender:NC,children:(0,Z.jsx)(DC,{widget:r,state:n})})}))}function NC({error:e}){return(0,Z.jsx)(`div`,{className:`text-2xl text-red-500`,children:e.message})}
38
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=J_,s=!P_.jitless,c=s&&Y_.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?pb([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function gb(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=>!uv(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=>pv(e,r,F_())))}),t)}const _b=Q(`$ZodUnion`,(e,t)=>{Ay.init(e,t),U_(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),U_(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),U_(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),U_(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>B_(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>gb(t,i,e,a)):gb(s,i,e,a)}}),vb=Q(`$ZodIntersection`,(e,t)=>{Ay.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])=>bb(e,t,n)):bb(e,i,a)}});function yb(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(X_(e)&&X_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=yb(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=yb(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 bb(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),uv(e))return e;let r=yb(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const xb=Q(`$ZodRecord`,(e,t)=>{Ay.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!X_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...dv(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...dv(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>pv(e,r,F_())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...dv(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...dv(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Sb=Q(`$ZodEnum`,(e,t)=>{Ay.init(e,t);let n=I_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Q_.has(typeof e)).map(e=>typeof e==`string`?$_(e):e.toString()).join(`|`)})$`),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}}),Cb=Q(`$ZodLiteral`,(e,t)=>{if(Ay.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?$_(e):e?$_(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),wb=Q(`$ZodTransform`,(e,t)=>{Ay.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new N_(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 M_;return n.value=i,n}});function Tb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Eb=Q(`$ZodOptional`,(e,t)=>{Ay.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,U_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),U_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${B_(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Tb(t,e.value)):Tb(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Db=Q(`$ZodNullable`,(e,t)=>{Ay.init(e,t),U_(e._zod,`optin`,()=>t.innerType._zod.optin),U_(e._zod,`optout`,()=>t.innerType._zod.optout),U_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${B_(e.source)}|null)$`):void 0}),U_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ob=Q(`$ZodDefault`,(e,t)=>{Ay.init(e,t),e._zod.optin=`optional`,U_(e._zod,`values`,()=>t.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=>kb(e,t)):kb(r,t)}});function kb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ab=Q(`$ZodPrefault`,(e,t)=>{Ay.init(e,t),e._zod.optin=`optional`,U_(e._zod,`values`,()=>t.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))}),jb=Q(`$ZodNonOptional`,(e,t)=>{Ay.init(e,t),U_(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].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=>Mb(t,e)):Mb(i,e)}});function Mb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Nb=Q(`$ZodCatch`,(e,t)=>{Ay.init(e,t),U_(e._zod,`optin`,()=>t.innerType._zod.optin),U_(e._zod,`optout`,()=>t.innerType._zod.optout),U_(e._zod,`values`,()=>t.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(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>pv(e,n,F_()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>pv(e,n,F_()))},input:e.value}),e.issues=[]),e)}}),Pb=Q(`$ZodPipe`,(e,t)=>{Ay.init(e,t),U_(e._zod,`values`,()=>t.in._zod.values),U_(e._zod,`optin`,()=>t.in._zod.optin),U_(e._zod,`optout`,()=>t.out._zod.optout),U_(e._zod,`propValues`,()=>t.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=>Fb(e,t.in,n)):Fb(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Fb(e,t.out,n)):Fb(r,t.out,n)}});function Fb(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ib=Q(`$ZodReadonly`,(e,t)=>{Ay.init(e,t),U_(e._zod,`propValues`,()=>t.innerType._zod.propValues),U_(e._zod,`values`,()=>t.innerType._zod.values),U_(e._zod,`optin`,()=>t.innerType._zod.optin),U_(e._zod,`optout`,()=>t.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(Lb):Lb(r)}});function Lb(e){return e.value=Object.freeze(e.value),e}const Rb=Q(`$ZodCustom`,(e,t)=>{dy.init(e,t),Ay.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=>zb(t,n,r,e));zb(i,n,r,e)}});function zb(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(hv(e))}}var Bb=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return 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 Vb(){return new Bb}const Hb=Vb();function Ub(e,t){return new e({type:`string`,...$(t)})}function Wb(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...$(t)})}function Gb(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...$(t)})}function Kb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...$(t)})}function qb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...$(t)})}function Jb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...$(t)})}function Yb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...$(t)})}function Xb(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...$(t)})}function Zb(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...$(t)})}function Qb(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...$(t)})}function $b(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...$(t)})}function ex(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...$(t)})}function tx(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...$(t)})}function nx(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...$(t)})}function rx(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...$(t)})}function ix(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...$(t)})}function ax(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...$(t)})}function ox(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...$(t)})}function sx(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...$(t)})}function cx(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...$(t)})}function lx(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...$(t)})}function ux(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...$(t)})}function dx(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...$(t)})}function fx(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...$(t)})}function px(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...$(t)})}function mx(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...$(t)})}function hx(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...$(t)})}function gx(e,t){return new e({type:`number`,checks:[],...$(t)})}function _x(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...$(t)})}function vx(e){return new e({type:`unknown`})}function yx(e,t){return new e({type:`never`,...$(t)})}function bx(e,t){return new py({check:`less_than`,...$(t),value:e,inclusive:!1})}function xx(e,t){return new py({check:`less_than`,...$(t),value:e,inclusive:!0})}function Sx(e,t){return new my({check:`greater_than`,...$(t),value:e,inclusive:!1})}function Cx(e,t){return new my({check:`greater_than`,...$(t),value:e,inclusive:!0})}function wx(e,t){return new hy({check:`multiple_of`,...$(t),value:e})}function Tx(e,t){return new _y({check:`max_length`,...$(t),maximum:e})}function Ex(e,t){return new vy({check:`min_length`,...$(t),minimum:e})}function Dx(e,t){return new yy({check:`length_equals`,...$(t),length:e})}function Ox(e,t){return new xy({check:`string_format`,format:`regex`,...$(t),pattern:e})}function kx(e){return new Sy({check:`string_format`,format:`lowercase`,...$(e)})}function Ax(e){return new Cy({check:`string_format`,format:`uppercase`,...$(e)})}function jx(e,t){return new wy({check:`string_format`,format:`includes`,...$(t),includes:e})}function Mx(e,t){return new Ty({check:`string_format`,format:`starts_with`,...$(t),prefix:e})}function Nx(e,t){return new Ey({check:`string_format`,format:`ends_with`,...$(t),suffix:e})}function Px(e){return new Dy({check:`overwrite`,tx:e})}function Fx(e){return Px(t=>t.normalize(e))}function Ix(){return Px(e=>e.trim())}function Lx(){return Px(e=>e.toLowerCase())}function Rx(){return Px(e=>e.toUpperCase())}function zx(e,t,n){return new e({type:`array`,element:t,...$(n)})}function Bx(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...$(n)})}function Vx(e){let t=Hx(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(hv(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(hv(r))}},e(n.value,n)));return t}function Hx(e,t){let n=new dy({check:`custom`,...$(t)});return n._zod.check=e,n}const Ux=Q(`ZodISODateTime`,(e,t)=>{Wy.init(e,t),hS.init(e,t)});function Wx(e){return fx(Ux,e)}const Gx=Q(`ZodISODate`,(e,t)=>{Gy.init(e,t),hS.init(e,t)});function Kx(e){return px(Gx,e)}const qx=Q(`ZodISOTime`,(e,t)=>{Ky.init(e,t),hS.init(e,t)});function Jx(e){return mx(qx,e)}const Yx=Q(`ZodISODuration`,(e,t)=>{qy.init(e,t),hS.init(e,t)});function Xx(e){return hx(Yx,e)}var Zx=(e,t)=>{_v.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>bv(e,t)},flatten:{value:t=>yv(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,L_,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,L_,2)}},isEmpty:{get(){return e.issues.length===0}}})};Q(`ZodError`,Zx);const Qx=Q(`ZodError`,Zx,{Parent:Error}),$x=xv(Qx),eS=Sv(Qx),tS=Cv(Qx),nS=Tv(Qx),rS=Dv(Qx),iS=Ov(Qx),aS=kv(Qx),oS=Av(Qx),sS=jv(Qx),cS=Mv(Qx),lS=Nv(Qx),uS=Pv(Qx),dS=Q(`ZodType`,(e,t)=>(Ay.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(G_(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>ev(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>$x(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>tS(e,t,n),e.parseAsync=async(t,n)=>eS(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>nS(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>rS(e,t,n),e.decode=(t,n)=>iS(e,t,n),e.encodeAsync=async(t,n)=>aS(e,t,n),e.decodeAsync=async(t,n)=>oS(e,t,n),e.safeEncode=(t,n)=>sS(e,t,n),e.safeDecode=(t,n)=>cS(e,t,n),e.safeEncodeAsync=async(t,n)=>lS(e,t,n),e.safeDecodeAsync=async(t,n)=>uS(e,t,n),e.refine=(t,n)=>e.check(CC(t,n)),e.superRefine=t=>e.check(wC(t)),e.overwrite=t=>e.check(Px(t)),e.optional=()=>sC(e),e.nullable=()=>lC(e),e.nullish=()=>sC(lC(e)),e.nonoptional=t=>hC(e,t),e.array=()=>WS(e),e.or=t=>YS([e,t]),e.and=t=>ZS(e,t),e.transform=t=>yC(e,aC(t)),e.default=t=>dC(e,t),e.prefault=t=>pC(e,t),e.catch=t=>_C(e,t),e.pipe=t=>yC(e,t),e.readonly=()=>xC(e),e.describe=t=>{let n=e.clone();return Hb.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Hb.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Hb.get(e);let n=e.clone();return Hb.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fS=Q(`_ZodString`,(e,t)=>{jy.init(e,t),dS.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ox(...t)),e.includes=(...t)=>e.check(jx(...t)),e.startsWith=(...t)=>e.check(Mx(...t)),e.endsWith=(...t)=>e.check(Nx(...t)),e.min=(...t)=>e.check(Ex(...t)),e.max=(...t)=>e.check(Tx(...t)),e.length=(...t)=>e.check(Dx(...t)),e.nonempty=(...t)=>e.check(Ex(1,...t)),e.lowercase=t=>e.check(kx(t)),e.uppercase=t=>e.check(Ax(t)),e.trim=()=>e.check(Ix()),e.normalize=(...t)=>e.check(Fx(...t)),e.toLowerCase=()=>e.check(Lx()),e.toUpperCase=()=>e.check(Rx())}),pS=Q(`ZodString`,(e,t)=>{jy.init(e,t),fS.init(e,t),e.email=t=>e.check(Wb(gS,t)),e.url=t=>e.check(Xb(yS,t)),e.jwt=t=>e.check(dx(PS,t)),e.emoji=t=>e.check(Zb(bS,t)),e.guid=t=>e.check(Gb(_S,t)),e.uuid=t=>e.check(Kb(vS,t)),e.uuidv4=t=>e.check(qb(vS,t)),e.uuidv6=t=>e.check(Jb(vS,t)),e.uuidv7=t=>e.check(Yb(vS,t)),e.nanoid=t=>e.check(Qb(xS,t)),e.guid=t=>e.check(Gb(_S,t)),e.cuid=t=>e.check($b(SS,t)),e.cuid2=t=>e.check(ex(CS,t)),e.ulid=t=>e.check(tx(wS,t)),e.base64=t=>e.check(cx(jS,t)),e.base64url=t=>e.check(lx(MS,t)),e.xid=t=>e.check(nx(TS,t)),e.ksuid=t=>e.check(rx(ES,t)),e.ipv4=t=>e.check(ix(DS,t)),e.ipv6=t=>e.check(ax(OS,t)),e.cidrv4=t=>e.check(ox(kS,t)),e.cidrv6=t=>e.check(sx(AS,t)),e.e164=t=>e.check(ux(NS,t)),e.datetime=t=>e.check(Wx(t)),e.date=t=>e.check(Kx(t)),e.time=t=>e.check(Jx(t)),e.duration=t=>e.check(Xx(t))});function mS(e){return Ub(pS,e)}const hS=Q(`ZodStringFormat`,(e,t)=>{My.init(e,t),fS.init(e,t)}),gS=Q(`ZodEmail`,(e,t)=>{Fy.init(e,t),hS.init(e,t)}),_S=Q(`ZodGUID`,(e,t)=>{Ny.init(e,t),hS.init(e,t)}),vS=Q(`ZodUUID`,(e,t)=>{Py.init(e,t),hS.init(e,t)}),yS=Q(`ZodURL`,(e,t)=>{Iy.init(e,t),hS.init(e,t)}),bS=Q(`ZodEmoji`,(e,t)=>{Ly.init(e,t),hS.init(e,t)}),xS=Q(`ZodNanoID`,(e,t)=>{Ry.init(e,t),hS.init(e,t)}),SS=Q(`ZodCUID`,(e,t)=>{zy.init(e,t),hS.init(e,t)}),CS=Q(`ZodCUID2`,(e,t)=>{By.init(e,t),hS.init(e,t)}),wS=Q(`ZodULID`,(e,t)=>{Vy.init(e,t),hS.init(e,t)}),TS=Q(`ZodXID`,(e,t)=>{Hy.init(e,t),hS.init(e,t)}),ES=Q(`ZodKSUID`,(e,t)=>{Uy.init(e,t),hS.init(e,t)}),DS=Q(`ZodIPv4`,(e,t)=>{Jy.init(e,t),hS.init(e,t)}),OS=Q(`ZodIPv6`,(e,t)=>{Yy.init(e,t),hS.init(e,t)}),kS=Q(`ZodCIDRv4`,(e,t)=>{Xy.init(e,t),hS.init(e,t)}),AS=Q(`ZodCIDRv6`,(e,t)=>{Zy.init(e,t),hS.init(e,t)}),jS=Q(`ZodBase64`,(e,t)=>{$y.init(e,t),hS.init(e,t)}),MS=Q(`ZodBase64URL`,(e,t)=>{tb.init(e,t),hS.init(e,t)}),NS=Q(`ZodE164`,(e,t)=>{nb.init(e,t),hS.init(e,t)}),PS=Q(`ZodJWT`,(e,t)=>{ib.init(e,t),hS.init(e,t)}),FS=Q(`ZodNumber`,(e,t)=>{ab.init(e,t),dS.init(e,t),e.gt=(t,n)=>e.check(Sx(t,n)),e.gte=(t,n)=>e.check(Cx(t,n)),e.min=(t,n)=>e.check(Cx(t,n)),e.lt=(t,n)=>e.check(bx(t,n)),e.lte=(t,n)=>e.check(xx(t,n)),e.max=(t,n)=>e.check(xx(t,n)),e.int=t=>e.check(RS(t)),e.safe=t=>e.check(RS(t)),e.positive=t=>e.check(Sx(0,t)),e.nonnegative=t=>e.check(Cx(0,t)),e.negative=t=>e.check(bx(0,t)),e.nonpositive=t=>e.check(xx(0,t)),e.multipleOf=(t,n)=>e.check(wx(t,n)),e.step=(t,n)=>e.check(wx(t,n)),e.finite=()=>e;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});function IS(e){return gx(FS,e)}const LS=Q(`ZodNumberFormat`,(e,t)=>{ob.init(e,t),FS.init(e,t)});function RS(e){return _x(LS,e)}const zS=Q(`ZodUnknown`,(e,t)=>{sb.init(e,t),dS.init(e,t)});function BS(){return vx(zS)}const VS=Q(`ZodNever`,(e,t)=>{cb.init(e,t),dS.init(e,t)});function HS(e){return yx(VS,e)}const US=Q(`ZodArray`,(e,t)=>{ub.init(e,t),dS.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ex(t,n)),e.nonempty=t=>e.check(Ex(1,t)),e.max=(t,n)=>e.check(Tx(t,n)),e.length=(t,n)=>e.check(Dx(t,n)),e.unwrap=()=>e.element});function WS(e,t){return zx(US,e,t)}const GS=Q(`ZodObject`,(e,t)=>{hb.init(e,t),dS.init(e,t),U_(e,`shape`,()=>t.shape),e.keyof=()=>tC(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:BS()}),e.loose=()=>e.clone({...e._zod.def,catchall:BS()}),e.strict=()=>e.clone({...e._zod.def,catchall:HS()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>av(e,t),e.safeExtend=t=>ov(e,t),e.merge=t=>sv(e,t),e.pick=t=>rv(e,t),e.omit=t=>iv(e,t),e.partial=(...t)=>cv(oC,e,t[0]),e.required=(...t)=>lv(mC,e,t[0])});function KS(e,t){let n={type:`object`,shape:e??{},...$(t)};return new GS(n)}function qS(e,t){return new GS({type:`object`,shape:e,catchall:BS(),...$(t)})}const JS=Q(`ZodUnion`,(e,t)=>{_b.init(e,t),dS.init(e,t),e.options=t.options});function YS(e,t){return new JS({type:`union`,options:e,...$(t)})}const XS=Q(`ZodIntersection`,(e,t)=>{vb.init(e,t),dS.init(e,t)});function ZS(e,t){return new XS({type:`intersection`,left:e,right:t})}const QS=Q(`ZodRecord`,(e,t)=>{xb.init(e,t),dS.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function $S(e,t,n){return new QS({type:`record`,keyType:e,valueType:t,...$(n)})}const eC=Q(`ZodEnum`,(e,t)=>{Sb.init(e,t),dS.init(e,t),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 eC({...t,checks:[],...$(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 eC({...t,checks:[],...$(r),entries:i})}});function tC(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new eC({type:`enum`,entries:n,...$(t)})}const nC=Q(`ZodLiteral`,(e,t)=>{Cb.init(e,t),dS.init(e,t),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 rC(e,t){return new nC({type:`literal`,values:Array.isArray(e)?e:[e],...$(t)})}const iC=Q(`ZodTransform`,(e,t)=>{wb.init(e,t),dS.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new N_(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(hv(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(hv(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function aC(e){return new iC({type:`transform`,transform:e})}const oC=Q(`ZodOptional`,(e,t)=>{Eb.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sC(e){return new oC({type:`optional`,innerType:e})}const cC=Q(`ZodNullable`,(e,t)=>{Db.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lC(e){return new cC({type:`nullable`,innerType:e})}const uC=Q(`ZodDefault`,(e,t)=>{Ob.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dC(e,t){return new uC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Z_(t)}})}const fC=Q(`ZodPrefault`,(e,t)=>{Ab.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pC(e,t){return new fC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Z_(t)}})}const mC=Q(`ZodNonOptional`,(e,t)=>{jb.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function hC(e,t){return new mC({type:`nonoptional`,innerType:e,...$(t)})}const gC=Q(`ZodCatch`,(e,t)=>{Nb.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _C(e,t){return new gC({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const vC=Q(`ZodPipe`,(e,t)=>{Pb.init(e,t),dS.init(e,t),e.in=t.in,e.out=t.out});function yC(e,t){return new vC({type:`pipe`,in:e,out:t})}const bC=Q(`ZodReadonly`,(e,t)=>{Ib.init(e,t),dS.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xC(e){return new bC({type:`readonly`,innerType:e})}const SC=Q(`ZodCustom`,(e,t)=>{Rb.init(e,t),dS.init(e,t)});function CC(e,t={}){return Bx(SC,e,t)}function wC(e){return Vx(e)}const TC=KS({width:IS().min(0).default(1e3),height:IS().min(0).default(1e3),settings:$S(mS(),BS()).default({}),events:$S(mS(),BS()).default({})}),EC=KS({$schema:rC(`https://ekg.gg/schemas/manifest.json`).default(`https://ekg.gg/schemas/manifest.json`),name:mS().optional(),version:mS().optional(),description:mS().optional(),template:mS().default(``),css:mS().default(``),js:mS().default(``),assets:$S(mS(),KS({type:mS().default(``),file:mS().default(``)})).optional(),settings:$S(mS(),qS({type:mS().default(``),name:mS().default(``),description:mS().optional()})).optional()});function DC(e){let t=TC.parse(JSON.parse(e.state)),i=EC.parse(JSON.parse(e.widget[`manifest.json`])),a=e=>import.meta.hot?.send(`ekg:state`,{...t,...e}),o=e=>import.meta.hot?.send(`ekg:manifest`,{...i,...e}),s=e=>a({width:e}),c=e=>a({height:e}),l=e=>o({name:e}),u=e=>o({version:e}),d=e=>o({description:e}),f=Object.entries(i.settings??{}).map(([n,r])=>({setting:{...r,key:n},value:t.settings[n]??(r.type===`image`?e.widget[r.default]:r.default),update:e=>a({settings:{...t.settings,[n]:e}})})),p=(0,w.useRef)(null),[m,h]=(0,w.useState)({width:1,height:1});(0,w.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();h({width:t,height:n})},n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[p.current]);let g=Math.min(m.width/t.width,m.height/t.height),[_,v]=(0,w.useState)(n.oneOf.map(e=>{let r=e.$ref.split(`/`).at(-1),i=n.$defs[r].properties.type.const,a={$schema:`https://json-schema.org/draft/2020-12/schema`,$defs:n.$defs,...n.$defs[r].properties.data},o=OC(a.properties,t.events[i]);return{name:r,type:i,schema:a,data:o}}));(0,w.useEffect)(()=>{a({events:Object.fromEntries(_.map(e=>[e.type,e.data]))})},[_]);let y=e=>{let t=_.find(t=>t.name===e);r.fireEvent({id:kC(60),timestamp:Math.floor(Date.now()/1e3),type:t.type,data:t.data})};return(0,Z.jsxs)(`div`,{className:`flex h-screen dark:text-slate-100 dark:bg-slate-900`,children:[(0,Z.jsx)(`div`,{className:`bg-black/10 border-r border-white/10 w-72 contain-strict overflow-auto`,children:(0,Z.jsxs)(`div`,{className:`px-6 flex flex-col gap-4 pb-8`,children:[(0,Z.jsx)(`h1`,{className:`text-xl font-bold py-4`,children:`Widget Dev Kit`}),(0,Z.jsxs)(`div`,{className:`flex gap-4`,children:[(0,Z.jsx)(C_,{label:`Width:`,name:`width`,value:t.width,update:s}),(0,Z.jsx)(C_,{label:`Height:`,name:`height`,value:t.height,update:c})]}),(0,Z.jsx)(x_,{type:`text`,label:`Name:`,name:`name`,value:i.name??``,update:l}),(0,Z.jsx)(x_,{type:`text`,label:`Version:`,name:`version`,value:i.version??``,update:u}),(0,Z.jsx)(x_,{type:`textarea`,label:`Description:`,name:`description`,value:i.description??``,update:d}),(0,Z.jsx)(`h1`,{className:`text-lg font-bold pt-4`,children:`Settings`}),f.map(e=>(0,Z.jsx)(jC,{...e},e.setting.key))]})}),(0,Z.jsx)(`div`,{className:`p-4 sm:p-16 flex-1 contain-strict`,children:(0,Z.jsx)(`div`,{className:`@container-[size] h-full grid auto-cols-fr place-items-center`,children:(0,Z.jsx)(`div`,{ref:p,className:`max-w-full`,style:{aspectRatio:`${t.width}/${t.height}`,width:`${100*t.width/t.height}cqh`},children:(0,Z.jsx)(`div`,{className:`relative origin-top-left bg-white dark:bg-black`,style:{width:`${t.width}px`,height:`${t.height}px`,transform:`scale(${g})`},children:(0,Z.jsx)(AC,{state:t,manifest:i,widget:e.widget})})})})}),(0,Z.jsx)(`div`,{className:`bg-black/10 border-l border-white/10 w-72 contain-strict overflow-auto`,children:(0,Z.jsxs)(`div`,{className:`px-6 flex flex-col gap-4 pb-8`,children:[(0,Z.jsx)(`h1`,{className:`text-xl font-bold py-4`,children:`Test Events`}),_.map(e=>(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(y_,{variant:`secondary`,size:`md`,className:`grow`,onClick:()=>y(e.name),children:e.name}),(0,Z.jsx)(y_,{variant:`secondary`,size:`md`,commandfor:`${e.name}-modal`,command:`show-modal`,children:`S`}),(0,Z.jsx)(k_,{id:`${e.name}-modal`,name:e.name,schema:e.schema,data:e.data,setData:t=>v(n=>n.map(n=>n.name===e.name?{...n,data:t}:n))})]},e.name))]})})]})}function OC(e,t){let n=(e,n)=>t?.[e]&&(n===`array`?Array.isArray(t[e]):typeof t[e]===n)?t[e]:null;return Object.fromEntries(Object.entries(e).map(([e,r])=>e===`raw`?[e,n(e,`object`)??{}]:typeof r!=`object`||!r?[e,null]:`const`in r?[e,r.const]:`enum`in r&&Array.isArray(r.enum)?[e,r.enum.includes(t?.[e])?t[e]:r.enum[0]]:`type`in r?e.endsWith(`At`)&&r.type===`integer`?[e,n(e,`number`)??Math.floor(Date.now()/1e3)]:r.type===`string`?[e,n(e,`string`)??kC(12)]:r.type===`boolean`?[e,n(e,`boolean`)??!1]:r.type===`integer`?[e,n(e,`number`)??2]:r.type===`array`&&`items`in r&&typeof r.items==`object`&&r.items&&`$ref`in r.items&&r.items.$ref===`#/$defs/ChatNode`?[e,n(e,`array`)??[{type:`text`,text:kC(40)}]]:r.type===`array`?[e,n(e,`array`)??[]]:[e,null]:[e,null]))}function kC(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(36).slice(-1)).join(``)}function AC({state:e,manifest:t,widget:n}){let i=n[t.template],a=n[t.css],o=n[t.js],s=Object.fromEntries(Object.entries(t.assets??{}).map(([e,{file:t}])=>[e,n[t]])),c=Object.fromEntries(Object.entries(t.settings??{}).map(([t,{type:r,default:i}])=>[t,e.settings[t]??(r===`image`?n[i]:i)])),l=(0,w.useRef)(null),[u,d]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let e=l.current;if(!e)return;let t=r.createManagedWidget(e);return d(t),()=>{d(null),t.stop()}},[l.current]),(0,w.useEffect)(()=>{!u||!i||!o||!a||(console.log(`reloading widget`),u.init(i,o,a,s,c))},[u,i,a,o,JSON.stringify(s),JSON.stringify(c)]),(0,Z.jsx)(`div`,{ref:l,className:`size-full`})}function jC({setting:e,value:t,update:n}){if(e.choices){let r=Object.entries(e.choices).map(([e,t])=>({label:t,value:e})),i=[`decimal`,`integer`].includes(e.type)?e=>n(parseFloat(e)):n;return(0,Z.jsx)(E_,{label:e.name,description:e.description,name:e.key,value:t.toString(),update:i,options:r})}let r={label:e.name,description:e.description,name:e.key,value:t,update:n};switch(e.type){case`boolean`:return(0,Z.jsx)(b_,{...r});case`color`:return(0,Z.jsx)(S_,{...r});case`color_array`:return(0,Z.jsx)(j_,{...r,render:e=>(0,Z.jsx)(S_,{...e})});case`decimal`:return(0,Z.jsx)(w_,{...r});case`decimal_array`:return(0,Z.jsx)(j_,{...r,render:e=>(0,Z.jsx)(w_,{...e})});case`image`:return(0,Z.jsx)(A_,{...r});case`integer`:return(0,Z.jsx)(C_,{...r});case`integer_array`:return(0,Z.jsx)(j_,{...r,render:e=>(0,Z.jsx)(C_,{...e})});case`string`:return(0,Z.jsx)(x_,{type:`text`,...r});case`string_array`:return(0,Z.jsx)(j_,{...r,render:e=>(0,Z.jsx)(x_,{type:`text`,...e})})}return null}import.meta.hot?(MC(import.meta.hot.data.root??=(0,C.createRoot)(document.body),t,e),import.meta.hot.accept(`ekg:widget`,e=>{MC(import.meta.hot.data.root,e.widget,e.state)})):MC((0,C.createRoot)(document.body),t,e);function MC(e,t,n){let r=Object.fromEntries(Object.entries(t).map(([e,t])=>[e.slice(2),t]));e.render((0,Z.jsx)(w.StrictMode,{children:(0,Z.jsx)(D,{fallbackRender:NC,children:(0,Z.jsx)(DC,{widget:r,state:n})})}))}function NC({error:e}){return(0,Z.jsx)(`div`,{className:`text-2xl text-red-500`,children:e.message})}
package/dist/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>EKG.gg Widget Dev Kit</title>
7
- <script async type="module" crossorigin src="/assets/index-cNHaZ59Y.js"></script>
7
+ <script async type="module" crossorigin src="/assets/index-wP52cYEy.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-BBJQw-IZ.css">
9
9
  </head>
10
10
  <body class="dark"></body>
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ declare namespace EKG {
6
6
  interface WidgetSettings ${t}
7
7
  }
8
8
  `,a=(e,t)=>{let n=Object.entries(e).map(([e,n])=>` ${e}: ${t(n)}\n`).join(``);return n?`{\n${n} }`:`{}`},o=e=>{if(e.choices)return Object.keys(e.choices).map(e=>JSON.stringify(e)).join(` | `);switch(e.type){case`string`:case`color`:case`image`:return`string`;case`string_array`:case`color_array`:return`string[]`;case`decimal`:case`integer`:return`number`;case`decimal_array`:case`integer_array`:return`number[]`;case`boolean`:return`boolean`;default:return`any`}};try{let c=await n.readFile(t),l=s.parse(JSON.parse(c.toString(`utf8`))),u=a(l.assets??{},()=>`string`),d=a(l.settings??{},o);await n.writeFile(r.join(e,`ekg.d.ts`),i(u,d))}catch{try{await n.writeFile(r.join(e,`ekg.d.ts`),i(`{}`,`{}`),{flag:`wx`})}catch{}}}async function p(e,t){let a=await c(e,t);await u(a.ekg);let o=await i({configFile:t?`vite.config.ts`:!1,root:a.server,define:{"import.meta.hot":!1},server:{fs:{allow:[a.node_modules,a.widget]},watch:{ignored:[`!${a.ekg}/**`]}},plugins:[{name:`EKG Dev Kit`,configureServer(e){e.ws.on(`ekg:state`,e=>{n.writeFile(a.state,JSON.stringify(e,null,2)).catch(e=>console.error(`Failed to write state file.`,e))}),e.ws.on(`ekg:manifest`,e=>{n.writeFile(a.manifest,JSON.stringify(e,null,2)).catch(e=>console.error(`Failed to write manifest file.`,e))})},resolveId(e){if(e.startsWith(`ekg:`))return`\0${e}`},load(e){let t=[`json`,`css`,`hbs`].join(`|`);switch(e){case`\0ekg:devkit`:return`
9
- export { loadWidget } from '/@fs${a.ekg}/devkit.js'
9
+ export { manager } from '/@fs${a.ekg}/devkit.js'
10
10
  export { default as EventSchema } from '/@fs${a.ekg}/events.json'
11
11
  `;case`\0ekg:widget`:return`
12
12
  export { default as state } from '/@fs${a.state}?raw'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekg_gg/devkit",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "bin": "dist/index.mjs",
6
6
  "types": ".runtime/devkit.d.ts",