@fungi.computer/prints 0.10.29 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/data-list-C1ZJzFIa.js +1 -0
- package/dist/assets/index-B6hDdk8u.js +3 -0
- package/dist/assets/{index-BXP5WVeX.css → index-D7S-Vf-N.css} +1 -1
- package/dist/assets/{log-event-D8Vqq_TK.js → log-event-DMyf-0Cc.js} +3 -3
- package/dist/assets/media-CFrkAVYT.js +76 -0
- package/dist/assets/{print-download-button-CZdu0Ehv.js → print-download-button-BOD2H-Xo.js} +1 -1
- package/dist/assets/print-info-drawer-PnUdSKK7.js +2 -0
- package/dist/index.html +5 -5
- package/package.json +7 -7
- package/dist/assets/data-list-XRmQUP8_.js +0 -1
- package/dist/assets/index-Clonmrne.js +0 -3
- package/dist/assets/media-DlmW7SfA.js +0 -76
- package/dist/assets/print-info-drawer-CnhkmuWH.js +0 -2
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{r as n}from"./modules-C4mfDnjH.js";var r=t((e=>{var t=Symbol.for(`react.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.provider`),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.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): 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`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var ee=Array.isArray,te=Object.prototype.hasOwnProperty,ne={current:null},re={key:!0,ref:!0,__self:!0,__source:!0};function ie(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)te.call(n,i)&&!re.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:ne.current}}function x(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function S(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ae(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var oe=/\/+/g;function C(e,t){return typeof e==`object`&&e&&e.key!=null?ae(``+e.key):t.toString(36)}function w(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`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+C(c,0):a,ee(o)?(i=``,e!=null&&(i=e.replace(oe,`$&/`)+`/`),w(o,r,i,``,function(e){return e})):o!=null&&(S(o)&&(o=x(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(oe,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,ee(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+C(s,l);c+=w(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+C(s,l++),c+=w(s,r,i,u,o);else if(s===`object`)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 se(e,t,n){if(e==null)return e;var r=[],i=0;return w(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(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 T={current:null},le={transition:null},ue={ReactCurrentDispatcher:T,ReactCurrentBatchConfig:le,ReactCurrentOwner:ne};function de(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ue,e.act=de,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=ne.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)te.call(n,l)&&!re.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=ie,e.createFactory=function(e){var t=ie.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=S,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=le.transition;le.transition={};try{e()}finally{le.transition=t}},e.unstable_act=de,e.useCallback=function(e,t){return T.current.useCallback(e,t)},e.useContext=function(e){return T.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return T.current.useDeferredValue(e)},e.useEffect=function(e,t){return T.current.useEffect(e,t)},e.useId=function(){return T.current.useId()},e.useImperativeHandle=function(e,t,n){return T.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.current.useMemo(e,t)},e.useReducer=function(e,t,n){return T.current.useReducer(e,t,n)},e.useRef=function(e){return T.current.useRef(e)},e.useState=function(e){return T.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.current.useTransition()},e.version=`18.3.1`})),i=t(((e,t)=>{t.exports=r()})),a;function o(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var s=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},c=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(a=globalThis).__zod_globalConfig??(a.__zod_globalConfig={});var l=globalThis.__zod_globalConfig;function u(e){return e&&Object.assign(l,e),l}function d(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function f(e,t){return typeof t==`bigint`?t.toString():t}function p(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function m(e){return e==null}function h(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function g(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var _=Symbol(`evaluating`);function v(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==_)return r===void 0&&(r=_,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function y(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function b(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ee(e){return JSON.stringify(e)}function te(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ne=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function re(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ie=p(()=>{if(l.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function x(e){if(re(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return re(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function S(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function C(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function w(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function se(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ce={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function T(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return C(e,b(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return y(this,`shape`,e),e},checks:[]}))}function le(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return C(e,b(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return y(this,`shape`,r),r},checks:[]}))}function ue(e,t){if(!x(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return C(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return y(this,`shape`,n),n}}))}function de(e,t){if(!x(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return C(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return y(this,`shape`,n),n}}))}function fe(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return C(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return y(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function pe(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return C(t,b(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return y(this,`shape`,i),i},checks:[]}))}function me(e,t,n){return C(t,b(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return y(this,`shape`,i),i}}))}function he(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ge(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function _e(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ve(e){return typeof e==`string`?e:e?.message}function ye(e,t,n){let r=e.message?e.message:ve(e.inst?._zod.def?.error?.(e))??ve(t?.error?.(e))??ve(n.customError?.(e))??ve(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function be(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function xe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Se=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,f,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ce=o(`$ZodError`,Se),we=o(`$ZodError`,Se,{Parent:Error});function Te(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ee(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var De=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new s;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ye(e,a,u())));throw ne(t,i?.callee),t}return o.value},Oe=De(we),ke=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ye(e,a,u())));throw ne(t,i?.callee),t}return o.value},Ae=ke(we),je=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new s;return a.issues.length?{success:!1,error:new(e??Ce)(a.issues.map(e=>ye(e,i,u())))}:{success:!0,data:a.value}},Me=je(we),Ne=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ye(e,i,u())))}:{success:!0,data:a.value}},Pe=Ne(we),Fe=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return De(e)(t,n,i)},Ie=e=>(t,n,r)=>De(e)(t,n,r),Le=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ke(e)(t,n,i)},Re=e=>async(t,n,r)=>ke(e)(t,n,r),ze=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return je(e)(t,n,i)},Be=e=>(t,n,r)=>je(e)(t,n,r),Ve=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ne(e)(t,n,i)},He=e=>async(t,n,r)=>Ne(e)(t,n,r),Ue=/^[cC][0-9a-z]{6,}$/,We=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ke=/^[0-9a-vA-V]{20}$/,qe=/^[A-Za-z0-9]{27}$/,Je=/^[a-zA-Z0-9_-]{21}$/,Ye=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ze=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$e=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function et(){return new RegExp($e,`u`)}var tt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,it=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,at=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ot=/^[A-Za-z0-9_-]*$/,st=/^https?$/,ct=/^\+[1-9]\d{6,14}$/,lt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,ut=RegExp(`^${lt}$`);function dt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ft(e){return RegExp(`^${dt(e)}$`)}function pt(e){let t=dt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${lt}T(?:${r})$`)}var mt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ht=/^-?\d+$/,gt=/^-?\d+(?:\.\d+)?$/,_t=/^(?:true|false)$/i,vt=/^null$/i,yt=/^[^A-Z]*$/,bt=/^[^a-z]*$/,xt=o(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),St={number:`number`,bigint:`bigint`,object:`date`},Ct=o(`$ZodCheckLessThan`,(e,t)=>{xt.init(e,t);let n=St[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wt=o(`$ZodCheckGreaterThan`,(e,t)=>{xt.init(e,t);let n=St[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tt=o(`$ZodCheckMultipleOf`,(e,t)=>{xt.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):g(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Et=o(`$ZodCheckNumberFormat`,(e,t)=>{xt.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ce[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=ht)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Dt=o(`$ZodCheckMaxLength`,(e,t)=>{var n;xt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!m(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=be(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ot=o(`$ZodCheckMinLength`,(e,t)=>{var n;xt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!m(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=be(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kt=o(`$ZodCheckLengthEquals`,(e,t)=>{var n;xt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!m(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=be(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),At=o(`$ZodCheckStringFormat`,(e,t)=>{var n,r;xt.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jt=o(`$ZodCheckRegex`,(e,t)=>{At.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mt=o(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=yt,At.init(e,t)}),Nt=o(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=bt,At.init(e,t)}),Pt=o(`$ZodCheckIncludes`,(e,t)=>{xt.init(e,t);let n=oe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ft=o(`$ZodCheckStartsWith`,(e,t)=>{xt.init(e,t);let n=RegExp(`^${oe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),It=o(`$ZodCheckEndsWith`,(e,t)=>{xt.init(e,t);let n=RegExp(`.*${oe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Lt=o(`$ZodCheckOverwrite`,(e,t)=>{xt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Rt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
|
+
`))}},zt={major:4,minor:4,patch:3},E=o(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=he(e),i;for(let a of t){if(a._zod.def.when){if(ge(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new s;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=he(e,t))});else{if(e.issues.length===t)continue;r||=he(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(he(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new s;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new s;return o.then(e=>t(e,r,a))}return t(o,r,a)}}v(e,`~standard`,()=>({validate:t=>{try{let n=Me(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Pe(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Bt=o(`$ZodString`,(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??mt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),D=o(`$ZodStringFormat`,(e,t)=>{At.init(e,t),Bt.init(e,t)}),Vt=o(`$ZodGUID`,(e,t)=>{t.pattern??=Xe,D.init(e,t)}),Ht=o(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ze(e)}else t.pattern??=Ze();D.init(e,t)}),Ut=o(`$ZodEmail`,(e,t)=>{t.pattern??=Qe,D.init(e,t)}),Wt=o(`$ZodURL`,(e,t)=>{D.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===st.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Gt=o(`$ZodEmoji`,(e,t)=>{t.pattern??=et(),D.init(e,t)}),Kt=o(`$ZodNanoID`,(e,t)=>{t.pattern??=Je,D.init(e,t)}),qt=o(`$ZodCUID`,(e,t)=>{t.pattern??=Ue,D.init(e,t)}),Jt=o(`$ZodCUID2`,(e,t)=>{t.pattern??=We,D.init(e,t)}),Yt=o(`$ZodULID`,(e,t)=>{t.pattern??=Ge,D.init(e,t)}),Xt=o(`$ZodXID`,(e,t)=>{t.pattern??=Ke,D.init(e,t)}),Zt=o(`$ZodKSUID`,(e,t)=>{t.pattern??=qe,D.init(e,t)}),Qt=o(`$ZodISODateTime`,(e,t)=>{t.pattern??=pt(t),D.init(e,t)}),$t=o(`$ZodISODate`,(e,t)=>{t.pattern??=ut,D.init(e,t)}),en=o(`$ZodISOTime`,(e,t)=>{t.pattern??=ft(t),D.init(e,t)}),tn=o(`$ZodISODuration`,(e,t)=>{t.pattern??=Ye,D.init(e,t)}),nn=o(`$ZodIPv4`,(e,t)=>{t.pattern??=tt,D.init(e,t),e._zod.bag.format=`ipv4`}),rn=o(`$ZodIPv6`,(e,t)=>{t.pattern??=nt,D.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),an=o(`$ZodCIDRv4`,(e,t)=>{t.pattern??=rt,D.init(e,t)}),on=o(`$ZodCIDRv6`,(e,t)=>{t.pattern??=it,D.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function sn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var cn=o(`$ZodBase64`,(e,t)=>{t.pattern??=at,D.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{sn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ln(e){if(!ot.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return sn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var un=o(`$ZodBase64URL`,(e,t)=>{t.pattern??=ot,D.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ln(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),dn=o(`$ZodE164`,(e,t)=>{t.pattern??=ct,D.init(e,t)});function fn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var pn=o(`$ZodJWT`,(e,t)=>{D.init(e,t),e._zod.check=n=>{fn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),mn=o(`$ZodNumber`,(e,t)=>{E.init(e,t),e._zod.pattern=e._zod.bag.pattern??gt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),hn=o(`$ZodNumberFormat`,(e,t)=>{Et.init(e,t),mn.init(e,t)}),gn=o(`$ZodBoolean`,(e,t)=>{E.init(e,t),e._zod.pattern=_t,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),_n=o(`$ZodNull`,(e,t)=>{E.init(e,t),e._zod.pattern=vt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),vn=o(`$ZodUnknown`,(e,t)=>{E.init(e,t),e._zod.parse=e=>e}),yn=o(`$ZodNever`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),bn=o(`$ZodVoid`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}});function xn(e,t,n){e.issues.length&&t.issues.push(..._e(n,e.issues)),t.value[n]=e.value}var Sn=o(`$ZodArray`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>xn(t,n,e))):xn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Cn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(..._e(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function wn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=se(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Tn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Cn(e,n,i,t,u,d))):Cn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var En=o(`$ZodObject`,(e,t)=>{if(E.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=p(()=>wn(t));v(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=re,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Cn(n,t,e,s,r,i))):Cn(a,t,e,s,r,i)}return i?Tn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Dn=o(`$ZodObjectJIT`,(e,t)=>{En.init(e,t);let n=e._zod.parse,r=p(()=>wn(t)),i=e=>{let t=new Rt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ee(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ee(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
4
|
+
if (${n}.issues.length) {
|
|
5
|
+
if (${o} in input) {
|
|
6
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
+
...iss,
|
|
8
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
+
})));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (${n}.value === undefined) {
|
|
14
|
+
if (${o} in input) {
|
|
15
|
+
newResult[${o}] = undefined;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
newResult[${o}] = ${n}.value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
`):c?t.write(`
|
|
22
|
+
if (${n}.issues.length) {
|
|
23
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (${n}.value === undefined) {
|
|
30
|
+
if (${o} in input) {
|
|
31
|
+
newResult[${o}] = undefined;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
newResult[${o}] = ${n}.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
`):t.write(`
|
|
38
|
+
const ${n}_present = ${o} in input;
|
|
39
|
+
if (${n}.issues.length) {
|
|
40
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
41
|
+
...iss,
|
|
42
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
+
payload.issues.push({
|
|
47
|
+
code: "invalid_type",
|
|
48
|
+
expected: "nonoptional",
|
|
49
|
+
input: undefined,
|
|
50
|
+
path: [${o}]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (${n}_present) {
|
|
55
|
+
if (${n}.value === undefined) {
|
|
56
|
+
newResult[${o}] = undefined;
|
|
57
|
+
} else {
|
|
58
|
+
newResult[${o}] = ${n}.value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=re,s=!l.jitless,c=s&&ie.value,u=t.catchall,d;e._zod.parse=(l,f)=>{d??=r.value;let p=l.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),l=a(l,f),u?Tn([],p,l,f,d,e):l):n(l,f):(l.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),l)}});function On(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=>!he(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=>ye(e,r,u())))}),t)}var kn=o(`$ZodUnion`,(e,t)=>{E.init(e,t),v(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),v(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),v(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),v(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=>h(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>On(t,r,e,i)):On(o,r,e,i)}}),An=o(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,kn.init(e,t);let n=e._zod.parse;v(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=p(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!re(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),jn=o(`$ZodIntersection`,(e,t)=>{E.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])=>Nn(e,t,n)):Nn(e,i,a)}});function Mn(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=Mn(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=Mn(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 Nn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),he(e))return e;let o=Mn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Pn=o(`$ZodTuple`,(e,t)=>{E.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Fn(n,`optin`),c=Fn(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>In(t,r,e))):In(a,r,e)}}return o.length?Promise.all(o).then(()=>Ln(l,r,n,a,c)):Ln(l,r,n,a,c)}});function Fn(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function In(e,t,n){e.issues.length&&t.issues.push(..._e(n,e.issues)),t.value[n]=e.value}function Ln(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(..._e(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Rn=o(`$ZodRecord`,(e,t)=>{E.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=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>ye(e,r,u())),input:c,path:[c],inst:e});continue}let l=o.value,d=t.valueType._zod.run({value:i[c],issues:[]},r);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(..._e(c,e.issues)),n.value[l]=e.value})):(d.issues.length&&n.issues.push(..._e(c,d.issues)),n.value[l]=d.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))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(typeof o==`string`&>.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ye(e,r,u())),input:o,path:[o],inst:e});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(..._e(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(..._e(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),zn=o(`$ZodEnum`,(e,t)=>{E.init(e,t);let n=d(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ae.has(typeof e)).map(e=>typeof e==`string`?oe(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}}),Bn=o(`$ZodLiteral`,(e,t)=>{if(E.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?oe(e):e?oe(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Vn=o(`$ZodTransform`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new c(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.fallback=!0,n));if(i instanceof Promise)throw new s;return n.value=i,n.fallback=!0,n}});function Hn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Un=o(`$ZodOptional`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),v(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${h(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Hn(e,r)):Hn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Wn=o(`$ZodExactOptional`,(e,t)=>{Un.init(e,t),v(e._zod,`values`,()=>t.innerType._zod.values),v(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Gn=o(`$ZodNullable`,(e,t)=>{E.init(e,t),v(e._zod,`optin`,()=>t.innerType._zod.optin),v(e._zod,`optout`,()=>t.innerType._zod.optout),v(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${h(e.source)}|null)$`):void 0}),v(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)}),Kn=o(`$ZodDefault`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,v(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=>qn(e,t)):qn(r,t)}});function qn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Jn=o(`$ZodPrefault`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,v(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))}),Yn=o(`$ZodNonOptional`,(e,t)=>{E.init(e,t),v(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=>Xn(t,e)):Xn(i,e)}});function Xn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Zn=o(`$ZodCatch`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,v(e._zod,`optout`,()=>t.innerType._zod.optout),v(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=>ye(e,n,u()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ye(e,n,u()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Qn=o(`$ZodPipe`,(e,t)=>{E.init(e,t),v(e._zod,`values`,()=>t.in._zod.values),v(e._zod,`optin`,()=>t.in._zod.optin),v(e._zod,`optout`,()=>t.out._zod.optout),v(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=>$n(e,t.in,n)):$n(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>$n(e,t.out,n)):$n(r,t.out,n)}});function $n(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var er=o(`$ZodReadonly`,(e,t)=>{E.init(e,t),v(e._zod,`propValues`,()=>t.innerType._zod.propValues),v(e._zod,`values`,()=>t.innerType._zod.values),v(e._zod,`optin`,()=>t.innerType?._zod?.optin),v(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(tr):tr(r)}});function tr(e){return e.value=Object.freeze(e.value),e}var nr=o(`$ZodFunction`,(e,t)=>(E.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Oe(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Oe(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await Ae(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Ae(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Pn({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),rr=o(`$ZodPromise`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),ir=o(`$ZodLazy`,(e,t)=>{E.init(e,t),v(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),v(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),v(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),v(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),v(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),ar=o(`$ZodCustom`,(e,t)=>{xt.init(e,t),E.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=>or(t,n,r,e));or(i,n,r,e)}});function or(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(xe(e))}}var sr,cr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function lr(){return new cr}(sr=globalThis).__zod_globalRegistry??(sr.__zod_globalRegistry=lr());var ur=globalThis.__zod_globalRegistry;function dr(e,t){return new e({type:`string`,...w(t)})}function fr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...w(t)})}function pr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...w(t)})}function mr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...w(t)})}function hr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...w(t)})}function gr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...w(t)})}function _r(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...w(t)})}function vr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...w(t)})}function yr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...w(t)})}function br(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...w(t)})}function xr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...w(t)})}function Sr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...w(t)})}function Cr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...w(t)})}function wr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...w(t)})}function Tr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...w(t)})}function Er(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...w(t)})}function Dr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...w(t)})}function Or(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...w(t)})}function kr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...w(t)})}function Ar(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...w(t)})}function jr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...w(t)})}function Mr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...w(t)})}function Nr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...w(t)})}function Pr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...w(t)})}function Fr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...w(t)})}function Ir(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...w(t)})}function Lr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...w(t)})}function Rr(e,t){return new e({type:`number`,checks:[],...w(t)})}function zr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...w(t)})}function Br(e,t){return new e({type:`boolean`,...w(t)})}function Vr(e,t){return new e({type:`null`,...w(t)})}function Hr(e){return new e({type:`unknown`})}function Ur(e,t){return new e({type:`never`,...w(t)})}function Wr(e,t){return new e({type:`void`,...w(t)})}function Gr(e,t){return new Ct({check:`less_than`,...w(t),value:e,inclusive:!1})}function Kr(e,t){return new Ct({check:`less_than`,...w(t),value:e,inclusive:!0})}function qr(e,t){return new wt({check:`greater_than`,...w(t),value:e,inclusive:!1})}function Jr(e,t){return new wt({check:`greater_than`,...w(t),value:e,inclusive:!0})}function Yr(e,t){return new Tt({check:`multiple_of`,...w(t),value:e})}function Xr(e,t){return new Dt({check:`max_length`,...w(t),maximum:e})}function Zr(e,t){return new Ot({check:`min_length`,...w(t),minimum:e})}function Qr(e,t){return new kt({check:`length_equals`,...w(t),length:e})}function $r(e,t){return new jt({check:`string_format`,format:`regex`,...w(t),pattern:e})}function ei(e){return new Mt({check:`string_format`,format:`lowercase`,...w(e)})}function ti(e){return new Nt({check:`string_format`,format:`uppercase`,...w(e)})}function ni(e,t){return new Pt({check:`string_format`,format:`includes`,...w(t),includes:e})}function ri(e,t){return new Ft({check:`string_format`,format:`starts_with`,...w(t),prefix:e})}function ii(e,t){return new It({check:`string_format`,format:`ends_with`,...w(t),suffix:e})}function ai(e){return new Lt({check:`overwrite`,tx:e})}function oi(e){return ai(t=>t.normalize(e))}function si(){return ai(e=>e.trim())}function ci(){return ai(e=>e.toLowerCase())}function li(){return ai(e=>e.toUpperCase())}function ui(){return ai(e=>te(e))}function di(e,t,n){return new e({type:`array`,element:t,...w(n)})}function fi(e,t,n){let r=w(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function pi(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...w(n)})}function mi(e,t){let n=hi(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(xe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(xe(r))}},e(t.value,t)),t);return n}function hi(e,t){let n=new xt({check:`custom`,...w(t)});return n._zod.check=e,n}function gi(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ur,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function O(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,O(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&yi(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function _i(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
|
+
|
|
64
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function vi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:xi(t,`input`,e.processors),output:xi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function yi(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return yi(r.element,n);if(r.type===`set`)return yi(r.valueType,n);if(r.type===`lazy`)return yi(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return yi(r.innerType,n);if(r.type===`intersection`)return yi(r.left,n)||yi(r.right,n);if(r.type===`record`||r.type===`map`)return yi(r.keyType,n)||yi(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:yi(r.in,n)||yi(r.out,n);if(r.type===`object`){for(let e in r.shape)if(yi(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(yi(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(yi(e,n))return!0;return!!(r.rest&&yi(r.rest,n))}return!1}var bi=(e,t={})=>n=>{let r=gi({...n,processors:t});return O(e,r),_i(r,e),vi(r,e)},xi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gi({...i??{},target:a,io:t,processors:n});return O(e,o),_i(o,e),vi(o,e)},Si={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ci=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Si[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},wi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Ti=(e,t,n,r)=>{n.type=`boolean`},Ei=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Oi=(e,t,n,r)=>{n.not={}},ki=(e,t,n,r)=>{let i=e._zod.def,a=d(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ai=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},ji=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Mi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Ni=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Pi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=O(a.element,t,{...r,path:[...r.path,`items`]})},Fi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=O(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=O(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ii=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>O(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Li=(e,t,n,r)=>{let i=e._zod.def,a=O(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=O(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ri=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>O(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?O(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},zi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=O(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=O(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=O(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Bi=(e,t,n,r)=>{let i=e._zod.def,a=O(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Vi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ui=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Wi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Gi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;O(o,t,r);let s=t.seen.get(e);s.ref=o},Ki=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},qi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ji=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Yi=(e,t,n,r)=>{let i=e._zod.innerType;O(i,t,r);let a=t.seen.get(e);a.ref=i},Xi=o(`ZodISODateTime`,(e,t)=>{Qt.init(e,t),j.init(e,t)});function Zi(e){return Pr(Xi,e)}var Qi=o(`ZodISODate`,(e,t)=>{$t.init(e,t),j.init(e,t)});function $i(e){return Fr(Qi,e)}var ea=o(`ZodISOTime`,(e,t)=>{en.init(e,t),j.init(e,t)});function ta(e){return Ir(ea,e)}var na=o(`ZodISODuration`,(e,t)=>{tn.init(e,t),j.init(e,t)});function ra(e){return Lr(na,e)}var ia=o(`ZodError`,(e,t)=>{Ce.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ee(e,t)},flatten:{value:t=>Te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,f,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,f,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),aa=De(ia),oa=ke(ia),sa=je(ia),ca=Ne(ia),la=Fe(ia),ua=Ie(ia),da=Le(ia),fa=Re(ia),pa=ze(ia),ma=Be(ia),ha=Ve(ia),ga=He(ia),_a=new WeakMap;function va(e,t,n){let r=Object.getPrototypeOf(e),i=_a.get(r);if(i||(i=new Set,_a.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var k=o(`ZodType`,(e,t)=>(E.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:xi(e,`input`),output:xi(e,`output`)}}),e.toJSONSchema=bi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>aa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>sa(e,t,n),e.parseAsync=async(t,n)=>oa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ca(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>la(e,t,n),e.decode=(t,n)=>ua(e,t,n),e.encodeAsync=async(t,n)=>da(e,t,n),e.decodeAsync=async(t,n)=>fa(e,t,n),e.safeEncode=(t,n)=>pa(e,t,n),e.safeDecode=(t,n)=>ma(e,t,n),e.safeEncodeAsync=async(t,n)=>ha(e,t,n),e.safeDecodeAsync=async(t,n)=>ga(e,t,n),va(e,`ZodType`,{check(...e){let t=this.def;return this.clone(b(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return C(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Yo(e,t))},superRefine(e,t){return this.check(Xo(e,t))},overwrite(e){return this.check(ai(e))},optional(){return wo(this)},exactOptional(){return Eo(this)},nullable(){return Oo(this)},nullish(){return wo(Oo(this))},nonoptional(e){return Po(this,e)},array(){return ro(this)},or(e){return co([this,e])},and(e){return po(this,e)},transform(e){return Ro(this,So(e))},default(e){return Ao(this,e)},prefault(e){return Mo(this,e)},catch(e){return Io(this,e)},pipe(e){return Ro(this,e)},readonly(){return Bo(this)},describe(e){let t=this.clone();return ur.add(t,{description:e}),t},meta(...e){if(e.length===0)return ur.get(this);let t=this.clone();return ur.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return ur.get(e)?.description},configurable:!0}),e)),ya=o(`_ZodString`,(e,t)=>{Bt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,va(e,`_ZodString`,{regex(...e){return this.check($r(...e))},includes(...e){return this.check(ni(...e))},startsWith(...e){return this.check(ri(...e))},endsWith(...e){return this.check(ii(...e))},min(...e){return this.check(Zr(...e))},max(...e){return this.check(Xr(...e))},length(...e){return this.check(Qr(...e))},nonempty(...e){return this.check(Zr(1,...e))},lowercase(e){return this.check(ei(e))},uppercase(e){return this.check(ti(e))},trim(){return this.check(si())},normalize(...e){return this.check(oi(...e))},toLowerCase(){return this.check(ci())},toUpperCase(){return this.check(li())},slugify(){return this.check(ui())}})}),ba=o(`ZodString`,(e,t)=>{Bt.init(e,t),ya.init(e,t),e.email=t=>e.check(fr(xa,t)),e.url=t=>e.check(vr(Ta,t)),e.jwt=t=>e.check(Nr(Va,t)),e.emoji=t=>e.check(yr(Da,t)),e.guid=t=>e.check(pr(Sa,t)),e.uuid=t=>e.check(mr(Ca,t)),e.uuidv4=t=>e.check(hr(Ca,t)),e.uuidv6=t=>e.check(gr(Ca,t)),e.uuidv7=t=>e.check(_r(Ca,t)),e.nanoid=t=>e.check(br(Oa,t)),e.guid=t=>e.check(pr(Sa,t)),e.cuid=t=>e.check(xr(ka,t)),e.cuid2=t=>e.check(Sr(Aa,t)),e.ulid=t=>e.check(Cr(ja,t)),e.base64=t=>e.check(Ar(Ra,t)),e.base64url=t=>e.check(jr(za,t)),e.xid=t=>e.check(wr(Ma,t)),e.ksuid=t=>e.check(Tr(Na,t)),e.ipv4=t=>e.check(Er(Pa,t)),e.ipv6=t=>e.check(Dr(Fa,t)),e.cidrv4=t=>e.check(Or(Ia,t)),e.cidrv6=t=>e.check(kr(La,t)),e.e164=t=>e.check(Mr(Ba,t)),e.datetime=t=>e.check(Zi(t)),e.date=t=>e.check($i(t)),e.time=t=>e.check(ta(t)),e.duration=t=>e.check(ra(t))});function A(e){return dr(ba,e)}var j=o(`ZodStringFormat`,(e,t)=>{D.init(e,t),ya.init(e,t)}),xa=o(`ZodEmail`,(e,t)=>{Ut.init(e,t),j.init(e,t)}),Sa=o(`ZodGUID`,(e,t)=>{Vt.init(e,t),j.init(e,t)}),Ca=o(`ZodUUID`,(e,t)=>{Ht.init(e,t),j.init(e,t)});function wa(e){return mr(Ca,e)}var Ta=o(`ZodURL`,(e,t)=>{Wt.init(e,t),j.init(e,t)});function Ea(e){return vr(Ta,e)}var Da=o(`ZodEmoji`,(e,t)=>{Gt.init(e,t),j.init(e,t)}),Oa=o(`ZodNanoID`,(e,t)=>{Kt.init(e,t),j.init(e,t)}),ka=o(`ZodCUID`,(e,t)=>{qt.init(e,t),j.init(e,t)}),Aa=o(`ZodCUID2`,(e,t)=>{Jt.init(e,t),j.init(e,t)}),ja=o(`ZodULID`,(e,t)=>{Yt.init(e,t),j.init(e,t)}),Ma=o(`ZodXID`,(e,t)=>{Xt.init(e,t),j.init(e,t)}),Na=o(`ZodKSUID`,(e,t)=>{Zt.init(e,t),j.init(e,t)}),Pa=o(`ZodIPv4`,(e,t)=>{nn.init(e,t),j.init(e,t)}),Fa=o(`ZodIPv6`,(e,t)=>{rn.init(e,t),j.init(e,t)}),Ia=o(`ZodCIDRv4`,(e,t)=>{an.init(e,t),j.init(e,t)}),La=o(`ZodCIDRv6`,(e,t)=>{on.init(e,t),j.init(e,t)}),Ra=o(`ZodBase64`,(e,t)=>{cn.init(e,t),j.init(e,t)}),za=o(`ZodBase64URL`,(e,t)=>{un.init(e,t),j.init(e,t)}),Ba=o(`ZodE164`,(e,t)=>{dn.init(e,t),j.init(e,t)}),Va=o(`ZodJWT`,(e,t)=>{pn.init(e,t),j.init(e,t)}),Ha=o(`ZodNumber`,(e,t)=>{mn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),va(e,`ZodNumber`,{gt(e,t){return this.check(qr(e,t))},gte(e,t){return this.check(Jr(e,t))},min(e,t){return this.check(Jr(e,t))},lt(e,t){return this.check(Gr(e,t))},lte(e,t){return this.check(Kr(e,t))},max(e,t){return this.check(Kr(e,t))},int(e){return this.check(Ga(e))},safe(e){return this.check(Ga(e))},positive(e){return this.check(qr(0,e))},nonnegative(e){return this.check(Jr(0,e))},negative(e){return this.check(Gr(0,e))},nonpositive(e){return this.check(Kr(0,e))},multipleOf(e,t){return this.check(Yr(e,t))},step(e,t){return this.check(Yr(e,t))},finite(){return this}});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 Ua(e){return Rr(Ha,e)}var Wa=o(`ZodNumberFormat`,(e,t)=>{hn.init(e,t),Ha.init(e,t)});function Ga(e){return zr(Wa,e)}var Ka=o(`ZodBoolean`,(e,t)=>{gn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r)});function qa(e){return Br(Ka,e)}var Ja=o(`ZodNull`,(e,t)=>{_n.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r)});function Ya(e){return Vr(Ja,e)}var Xa=o(`ZodUnknown`,(e,t)=>{vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Za(){return Hr(Xa)}var Qa=o(`ZodNever`,(e,t)=>{yn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r)});function $a(e){return Ur(Qa,e)}var eo=o(`ZodVoid`,(e,t)=>{bn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r)});function to(e){return Wr(eo,e)}var no=o(`ZodArray`,(e,t)=>{Sn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.element=t.element,va(e,`ZodArray`,{min(e,t){return this.check(Zr(e,t))},nonempty(e){return this.check(Zr(1,e))},max(e,t){return this.check(Xr(e,t))},length(e,t){return this.check(Qr(e,t))},unwrap(){return this.element}})});function ro(e,t){return di(no,e,t)}var io=o(`ZodObject`,(e,t)=>{Dn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),v(e,`shape`,()=>t.shape),va(e,`ZodObject`,{keyof(){return yo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Za()})},loose(){return this.clone({...this._zod.def,catchall:Za()})},strict(){return this.clone({...this._zod.def,catchall:$a()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ue(this,e)},safeExtend(e){return de(this,e)},merge(e){return fe(this,e)},pick(e){return T(this,e)},omit(e){return le(this,e)},partial(...e){return pe(Co,this,e[0])},required(...e){return me(No,this,e[0])}})});function M(e,t){return new io({type:`object`,shape:e??{},...w(t)})}function ao(e,t){return new io({type:`object`,shape:e,catchall:$a(),...w(t)})}function oo(e,t){return new io({type:`object`,shape:e,catchall:Za(),...w(t)})}var so=o(`ZodUnion`,(e,t)=>{kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.options=t.options});function co(e,t){return new so({type:`union`,options:e,...w(t)})}var lo=o(`ZodDiscriminatedUnion`,(e,t)=>{so.init(e,t),An.init(e,t)});function uo(e,t,n){return new lo({type:`union`,options:t,discriminator:e,...w(n)})}var fo=o(`ZodIntersection`,(e,t)=>{jn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r)});function po(e,t){return new fo({type:`intersection`,left:e,right:t})}var mo=o(`ZodTuple`,(e,t)=>{Pn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function ho(e,t,n){let r=t instanceof E;return new mo({type:`tuple`,items:e,rest:r?t:null,...w(r?n:t)})}var go=o(`ZodRecord`,(e,t)=>{Rn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function _o(e,t,n){return!t||!t._zod?new go({type:`record`,keyType:A(),valueType:e,...w(t)}):new go({type:`record`,keyType:e,valueType:t,...w(n)})}var vo=o(`ZodEnum`,(e,t)=>{zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new vo({...t,checks:[],...w(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 vo({...t,checks:[],...w(r),entries:i})}});function yo(e,t){return new vo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...w(t)})}var bo=o(`ZodLiteral`,(e,t)=>{Bn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function N(e,t){return new bo({type:`literal`,values:Array.isArray(e)?e:[e],...w(t)})}var xo=o(`ZodTransform`,(e,t)=>{Vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new c(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xe(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(xe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function So(e){return new xo({type:`transform`,transform:e})}var Co=o(`ZodOptional`,(e,t)=>{Un.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wo(e){return new Co({type:`optional`,innerType:e})}var To=o(`ZodExactOptional`,(e,t)=>{Wn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Eo(e){return new To({type:`optional`,innerType:e})}var Do=o(`ZodNullable`,(e,t)=>{Gn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oo(e){return new Do({type:`nullable`,innerType:e})}var ko=o(`ZodDefault`,(e,t)=>{Kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ao(e,t){return new ko({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():S(t)}})}var jo=o(`ZodPrefault`,(e,t)=>{Jn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mo(e,t){return new jo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():S(t)}})}var No=o(`ZodNonOptional`,(e,t)=>{Yn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Po(e,t){return new No({type:`nonoptional`,innerType:e,...w(t)})}var Fo=o(`ZodCatch`,(e,t)=>{Zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Io(e,t){return new Fo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Lo=o(`ZodPipe`,(e,t)=>{Qn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.in=t.in,e.out=t.out});function Ro(e,t){return new Lo({type:`pipe`,in:e,out:t})}var zo=o(`ZodReadonly`,(e,t)=>{er.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bo(e){return new zo({type:`readonly`,innerType:e})}var Vo=o(`ZodLazy`,(e,t)=>{ir.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Ho(e){return new Vo({type:`lazy`,getter:e})}var Uo=o(`ZodPromise`,(e,t)=>{rr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wo(e){return new Uo({type:`promise`,innerType:e})}var Go=o(`ZodFunction`,(e,t)=>{nr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r)});function Ko(e){return new Go({type:`function`,input:Array.isArray(e?.input)?ho(e?.input):e?.input??ro(Za()),output:e?.output??Za()})}var qo=o(`ZodCustom`,(e,t)=>{ar.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r)});function Jo(e,t){return fi(qo,e??(()=>!0),t)}function Yo(e,t={}){return pi(qo,e,t)}function Xo(e,t){return mi(e,t)}function Zo(e,t={}){let n=new qo({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...w(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Qo(e){let t=Ho(()=>co([A(e),Ua(),qa(),Ya(),ro(t),_o(A(),t)]));return t}var P=e(i(),1),$o=Qo(),es=Ho(()=>uo(`status`,[M({status:N(`available`)}).strict(),M({status:N(`unavailable`),reason:A()}).strict()])),ts=$o,ns=Ho(()=>_o(A(),ts)),rs=e=>ts.parse(e),is=Ho(()=>M({code:A().min(1).max(160),message:A().min(1).max(512),details:ts.optional()}).strict()),as=e=>is.parse(e),os=ns,ss=Ho(()=>A().refine(e=>e.trim().length>0)),cs=es,ls=Ho(()=>co([M({type:N(`action`)}).strict(),M({type:N(`custom`),data:ns}).strict(),M({type:N(`choice`),options:ro(M({value:ts,label:ss,description:ss.optional()}))}).strict(),M({type:N(`form`),submitLabel:ss.optional()}).strict(),M({type:N(`confirmation`),message:ss,confirmLabel:ss.optional(),cancelLabel:ss.optional()}).strict()])),us=Ho(()=>M({inputSchema:os.optional(),outputSchema:os.optional(),presentation:ls.optional()}).strict()),ds=Ho(()=>Ua().int().refine(e=>Number.isSafeInteger(e))),fs=Ho(()=>M({hint:ss.pipe(A().max(120)),words:ro(M({word:A().regex(/^\S{1,64}$/u),description:ss.pipe(A().max(512)).optional(),arguments:ns}).strict()).max(32).optional(),text:M({field:ss.pipe(A().max(120)),arguments:ns,requestIdField:ss.pipe(A().max(120)).optional()}).strict().optional()}).strict().refine(e=>e.words!==void 0||e.text!==void 0,`slash arguments need words or text`)),ps=Ho(()=>M({order:ds.optional()}).strict()),ms=Ho(()=>M({bindings:M({order:ds.optional(),values:ro(ss).max(16)}).strict().optional(),agent:M({keybind:ss.optional(),order:ds.optional()}).strict().optional(),help:ps.optional(),menu:ps.optional(),palette:ps.optional(),slash:M({aliases:ro(ss).max(16),consumesDraft:qa().optional(),order:ds.optional(),arguments:fs.optional()}).strict().optional()}).strict()),hs=Ho(()=>M({id:ss.refine(e=>!e.includes(`:`)),title:ss,category:ss,description:ss.optional(),projections:ms.optional(),action:us.optional(),availability:cs.optional()}).strict()),gs=e=>hs.parse(e),_s=Ho(()=>M({inputSchema:os.optional(),outputSchema:os.optional()}).strict()),vs=A().min(1).brand();Ho(()=>M({commandId:vs,command:M({namespace:A(),id:A()}).strict(),sourceId:A(),scope:A().optional(),title:A(),category:A(),description:A().optional(),order:Ua(),availability:es,action:_s.optional(),keybind:A().optional()}).strict());var ys=8192,F=ss.pipe(A().max(ys)),bs=ss.pipe(A().max(60)),xs=Ea({protocol:/^https?$/u}),Ss=M({label:F,value:F}).strict(),Cs={summary:F.optional(),facts:ro(Ss).max(4).optional(),body:F.optional(),bodyLabel:F.optional(),details:ro(Ss).max(24).optional()};uo(`type`,[M({type:N(`choice`),message:bs,...Cs,current:F.optional(),collapsedGroup:F.optional(),options:ro(M({value:F,label:F,description:F.optional(),group:F.optional(),destructive:N(!0).optional()}).strict()).min(1).max(256)}).strict(),M({type:N(`text`),message:bs,...Cs,placeholder:F.optional(),secret:qa().optional()}).strict(),M({type:N(`confirmation`),message:bs,...Cs,confirmLabel:F.optional(),cancelLabel:F.optional(),destructive:N(!0).optional()}).strict(),M({type:N(`decision`),message:bs,...Cs,options:ro(M({value:F,label:F,description:F.optional(),destructive:N(!0).optional()}).strict()).min(1).max(8).refine(e=>new Set(e.map(e=>e.value)).size===e.length,`Decision option values must be unique`),multiple:qa().optional(),other:M({label:F,placeholder:F.optional(),maxLength:Ua().int().min(1).max(ys),blank:F.optional()}).strict().optional(),escape:F.optional()}).strict().refine(e=>[e.escape,e.other?.blank].every(t=>t===void 0||e.options.some(e=>e.value===t)),`A decision's escape and blank answers must be offered options`)]),Ho(()=>uo(`type`,[M({type:N(`info`),message:F,links:ro(M({url:xs,label:F.optional()}).strict()).max(16).optional()}).strict(),M({type:N(`progress`),message:F}).strict(),M({type:N(`handoff`),url:xs,code:F.optional(),message:F.optional()}).strict(),M({type:N(`success`),message:F}).strict()]));var ws=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},Ts={pipe(){return ws(this,arguments)}},Es=function(){function e(){}return e.prototype=Ts,e}(),I=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},Ds=e=>e,Os=e=>()=>e,ks=Os(!0),As=Os(null),js=Os(void 0),Ms=js;function Ns(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function Ps(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Fs(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i!==n&&t.set(i,i),i}}var Is=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},Ls=new WeakSet,Rs=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),zs=0,Bs=()=>{zs++};function Vs(e){return typeof e==`string`}function Hs(e){return typeof e==`number`}function Us(e){return typeof e==`boolean`}function Ws(e){return typeof e==`symbol`}function Gs(e){return Vs(e)||Hs(e)||Ws(e)}function Ks(e){return typeof e==`function`}function qs(e){return e===void 0}function Js(e){return e!=null}function Ys(e){return!0}function Xs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Zs(e){return typeof e==`object`&&!!e||Ks(e)}var Qs=I(2,(e,t)=>Zs(e)&&t in e),$s=`~effect/Hash`,L=e=>{switch(typeof e){case`number`:return ac(e);case`bigint`:return oc(e.toString(10));case`string`:return oc(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?oc(`Invalid Date`):oc(e.toISOString());if(e instanceof RegExp)return oc(e.toString());{if(Ls.has(e))return ec(e);let t=hc.get(e);if(t!==void 0)return t;if(gc.has(e))return Bs(),oc(`[Circular]`);gc.add(e);let n=zs,r;try{r=`~effect/Hash`in e?e[$s]():typeof e==`function`?ec(e):e instanceof DataView?uc(Rs(e)):Array.isArray(e)||ArrayBuffer.isView(e)?uc(e):e instanceof Map?dc(e):e instanceof Set?pc(e):cc(e)}finally{gc.delete(e)}return n===zs&&hc.set(e,r),r}}return rc(tc(oc(String(e))))},ec=e=>(mc.has(e)||mc.set(e,rc(Math.random()*4294967296|0)),mc.get(e)),tc=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),nc=I(2,(e,t)=>tc(Math.imul(e,2654435761)+Math.imul(t,2246822507))),rc=e=>e&3221225471|e>>>1&1073741824,ic=new DataView(new ArrayBuffer(8)),ac=e=>{let t=e|0;return t===e?rc(t):(ic.setFloat64(0,e===e?e:NaN),rc(nc(ic.getInt32(0),ic.getInt32(4))))},oc=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return rc(t)},sc=(e,t)=>{let n=12289;for(let r of t)n^=nc(L(r),L(e[r]));return rc(n)},cc=e=>sc(e,Is(e)),lc=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return rc(r)},uc=e=>{let t=6151;for(let n of e)t=nc(t,L(n));return rc(t)},dc=lc(oc(`Map`),([e,t])=>nc(L(e),L(t))),fc=oc(`Set`),pc=lc(fc,e=>nc(fc,L(e))),mc=new WeakMap,hc=new WeakMap,gc=new WeakSet,_c=`~effect/Equal`;function vc(){return arguments.length===1?e=>yc(e,arguments[0]):yc(arguments[0],arguments[1])}function yc(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||Ls.has(e)||Ls.has(t)?!1:bc(e,t):!1}function bc(e,t){let n=Sc.length;for(let r=n;r-->0;)if(Sc[r]===e&&Cc[r]===t)return!0;if(n)return xc(e,t);let r=wc.get(e);r||wc.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=xc(e,t)),i}function xc(e,t){Sc.push(e),Cc.push(t);try{return Tc(e,t)}finally{Sc.pop(),Cc.pop()}}var Sc=[],Cc=[],wc=new WeakMap;function Tc(e,t){if(L(e)!==L(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=Mc(e);if(n!==Mc(t)||typeof e==`function`&&!n)return!1;if(n)return e[_c](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Ec(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?Dc(Rs(e),Rs(t)):Dc(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:kc(e,t,Ac,jc):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:kc(e,t,L,yc):Oc(e,t)}function Ec(e,t){for(let n=0;n<e.length;n++)if(!yc(e[n],t[n]))return!1;return!0}function Dc(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Oc(e,t){let n=Is(e),r=Is(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!yc(e[i],t[i]))return!1;return!0}function kc(e,t,n,r){let i=new Map,a=0;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e]),a++}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop(),a--;continue outer}}return!1}return a===0}var Ac=e=>L(e[0]),jc=(e,t)=>yc(e[0],t[0])&&yc(e[1],t[1]),Mc=e=>Qs(e,_c),Nc=e=>e.length>0;function Pc(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Fc(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Pc(e,n,t[n])}var Ic=Symbol.for(`~effect/Redactable`),Lc=e=>Qs(e,Ic);function Rc(e){return Lc(e)?zc(e):e}function zc(e){return e[Ic](globalThis[`~effect/Fiber/currentFiber`]?.context??Hc)}var Bc=`~effect/Fiber/currentFiber`,Vc=new Map,Hc={"~effect/Context":{},base:Vc,depth:0,mapUnsafe:Vc,pipe(){return ws(this,arguments)}};function R(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return Uc;r.add(e);let l;if(Ic in e)l=c(zc(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
65
|
+
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Kc(e);else if(!t?.ignoreToString&&Qs(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=qc(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${Wc(t)}:${c(Jc(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Wc(t)}: ${c(Jc(e,t),n+1)}`).join(`,
|
|
66
|
+
`)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Uc=`[Circular]`;function Wc(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Gc(e){return e.map(e=>`[${Wc(e)}]`).join(``)}function Kc(e){try{return e.toISOString()}catch{return`Invalid Date`}}function qc(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Jc(e,t){try{return e[t]}catch{return`[property access threw]`}}function Yc(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=Qs(r,Ic)?Rc(r):Rc(t);if(typeof i==`bigint`)return R(i);if(typeof i!=`object`||!i)return i;let a=i instanceof Error&&!Qs(i,`toJSON`)?{...i,name:i.name,message:i.message}:i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return;if(n.push(i),a!==i&&n.push(a),!Xc(a)||Zc(a))return a;let o=new Proxy(a,{get(e,t){let n=Reflect.get(e,t,e);return Object.getOwnPropertyDescriptor(e,t)?.get===void 0?n:Rc(n)}});return n.push(o),o},t?.space)??`null`}function Xc(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function Zc(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}var Qc=Symbol.for(`nodejs.util.inspect.custom`),$c=e=>{try{return e=Rc(e),Qs(e,`toJSON`)&&Ks(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map($c):e}catch{return`[toJSON threw]`}},el={toJSON(){return $c(this)},[Qc](){return this.toJSON()},toString(){return R(this.toJSON())}},tl=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),nl=()=>Error.stackTraceLimit,rl=e=>{tl&&(Error.stackTraceLimit=e)},il=class{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}},al=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return nl()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),ol=`~effect/Effect`,sl=`~effect/Exit`,cl={_A:Ds,_E:Ds,_R:Ds},ll=`${ol}/identifier`,z=`${ol}/args`,ul=`${ol}/evaluate`,dl=`${ol}/successCont`,fl=`${ol}/failureCont`,pl=`${ol}/ensureCont`,ml=Symbol.for(`effect/Effect/Yield`),hl={pipe(){return ws(this,arguments)},toJSON(){return{...this}},toString(){return R(this.toJSON(),{ignoreToString:!0,space:2})},[Qc](){return this.toJSON()}},gl={[ol]:cl,...hl,[Symbol.iterator](){return new il(this)},toJSON(){return{_id:`Effect`,op:this[ll],...z in this?{args:this[z]}:void 0}}},_l=e=>Qs(e,sl),vl=`~effect/Cause`,yl=`~effect/Cause/Reason`,bl=e=>Qs(e,vl),xl=class{constructor(e){this[vl]=vl,this.reasons=e}pipe(){return ws(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${R(this.reasons)})`}[Qc](){return this.toJSON()}[_c](e){return bl(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>vc(t,e.reasons[n]))}[$s](){return uc(this.reasons)}},Sl=new WeakMap,Cl=class{[yl];annotations;_tag;constructor(e,t,n){if(this[yl]=yl,this._tag=e,t!==wl&&typeof n==`object`&&n&&t.size>0){let e=Sl.get(n);e&&(t=new Map([...e,...t])),Sl.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return ws(this,arguments)}toString(){return R(this)}[Qc](){return this.toString()}},wl=new Map,Tl=class extends Cl{constructor(e,t=wl){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${R(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[_c](e){return Nl(e)&&vc(this.error,e.error)&&vc(this.annotations,e.annotations)}[$s](){return nc(oc(this._tag))(nc(L(this.error))(L(this.annotations)))}},El=e=>new xl(e),Dl=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=L(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>vc(e,i)))continue;else t.push(i);r.push(i)}return r},Ol=I(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new xl(Dl(e.reasons,t.reasons));return vc(e,n)?e:n}),kl=e=>new xl([new Tl(e)]),Al=class extends Cl{constructor(e,t=wl){super(`Die`,t,e),this.defect=e}toString(){return`Die(${R(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[_c](e){return Pl(e)&&vc(this.defect,e.defect)&&vc(this.annotations,e.annotations)}[$s](){return nc(oc(this._tag))(nc(L(this.defect))(L(this.annotations)))}},jl=e=>new xl([new Al(e)]),Ml=I(e=>bl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new xl(e.reasons.map(e=>e.annotate(t,n)))),Nl=e=>e._tag===`Fail`,Pl=e=>e._tag===`Die`,Fl=e=>e._tag===`Interrupt`;function Il(e){return Gl(`Effect.evaluate: Not implemented`)}var Ll=e=>({...gl,[ll]:e.op,[ul]:e[ul]??Il,[dl]:e[dl],[fl]:e[fl],[pl]:e[pl]}),Rl=e=>{let t=Ll(e),n=function(e){this[z]=e};return n.prototype=t,function(e){return new n(e)}},zl=e=>{let t={[sl]:sl,_tag:e.op,get[e.prop](){return this[z]},...Ll(e),toString(){return`${e.op}(${R(this[z])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[z]}},[_c](e){return _l(e)&&e._tag===this._tag&&vc(this[z],e[z])},[$s](){return nc(oc(e.op),L(this[z]))}},n=function(e){this[z]=e};return n.prototype=t,function(e){return new n(e)}},Bl=zl({op:`Success`,prop:`value`,[ul](e){let t=e.getCont(dl);return t?t[dl](this[z],e,this):e.yieldWith(this)}}),Vl={key:`effect/Cause/StackTrace`},Hl={key:`effect/Cause/InterruptorStackTrace`},Ul=zl({op:`Failure`,prop:`cause`,[ul](e){let t=this[z],n=!1;e.cache.stackFrame&&(t=Ml(t,{mapUnsafe:new Map([[Vl.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(fl),i=e._interruptedCause;if(i&&e.interruptible){let a=!1;for(;r&&e.interruptible;)a||=ll in r,r=e.getCont(fl);a&&(t=El(t.reasons.filter(e=>e._tag!==`Fail`))),t=Ol(t,i),n=!0}return r?r[fl](t,e,n?void 0:this):e.yieldWith(n?Ul(t):this)}}),Wl=e=>Ul(kl(e)),Gl=e=>Ul(jl(e)),Kl=Rl({op:`WithFiber`,[ul](e){return this[z](e)}}),ql=function(){class e extends globalThis.Error{}let t=Ll({op:`YieldableError`,[ul](){return Wl(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Jl=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends ql{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Fc(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Yl=e=>{class t extends Jl{_tag=e}return t.prototype.name=e,t};Yl(`NoSuchElementError`);var Xl=`~effect/Option`,Zl={[Xl]:{_A:e=>e},...hl,[Symbol.iterator](){return new il(this)}},Ql=Object.defineProperty(Object.assign(Object.create(Zl),{_tag:`Some`,_op:`Some`,[_c](e){return tu(e)&&ru(e)&&vc(this.value,e.value)},[$s](){return nc(L(this._tag))(L(this.value))},toString(){return`some(${R(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:$c(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),$l=L(`None`),eu=Object.assign(Object.create(Zl),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[_c](e){return tu(e)&&nu(e)},[$s](){return $l},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),tu=e=>Qs(e,Xl),nu=e=>e._tag===`None`,ru=e=>e._tag===`Some`,iu=Object.create(eu),au=function(e){this.value=e};au.prototype=Ql;var ou=e=>new au(e),su=`~effect/Result`,cu={[su]:{_A:e=>e,_E:e=>e},...hl,[Symbol.iterator](){return new il(this)}},lu=Object.assign(Object.create(cu),{_tag:`Success`,_op:`Success`,[_c](e){return du(e)&&pu(e)&&vc(this.success,e.success)},[$s](){return nc(L(this._tag))(L(this.success))},toString(){return`success(${R(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:$c(this.success)}}}),uu=Object.assign(Object.create(cu),{_tag:`Failure`,_op:`Failure`,[_c](e){return du(e)&&fu(e)&&vc(this.failure,e.failure)},[$s](){return nc(L(this._tag))(L(this.failure))},toString(){return`failure(${R(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:$c(this.failure)}}}),du=e=>Qs(e,su),fu=e=>e._tag===`Failure`,pu=e=>e._tag===`Success`,mu=function(e){this.failure=e};mu.prototype=uu;var hu=e=>new mu(e),gu=function(e){this.success=e};gu.prototype=lu;var _u=e=>new gu(e);function vu(e){return(t,n)=>t===n?0:e(t,n)}var yu=vu((e,t)=>e<t?-1:1),bu=vu((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),xu=e=>I(2,(t,n)=>e(t,n)===-1),Su=e=>I(2,(t,n)=>e(t,n)===1),Cu=e=>I(2,(t,n)=>e(t,n)!==1),wu=e=>I(2,(t,n)=>e(t,n)!==-1),Tu=()=>iu,Eu=ou,Du=nu,Ou=ru,ku=I(2,(e,{onNone:t,onSome:n})=>Du(e)?t():n(e.value)),Au=I(2,(e,t)=>Du(e)?t():e.value),ju=I(2,(e,t)=>Du(e)?t():e),Mu=Au(As),Nu=Au(js),Pu=I(2,(e,t)=>Du(e)?Tu():Eu(t(e.value))),Fu=_u,Iu=hu,Lu=fu,Ru=pu,zu=I(2,(e,t)=>Lu(e)?Iu(t(e.failure)):e),Bu=I(2,(e,{onFailure:t,onSuccess:n})=>Lu(e)?t(e.failure):n(e.success)),Vu=globalThis.Array,Hu=I(2,(e,t)=>[...e,t]);Vu.isArray;var Uu=Nc,Wu=Nc,Gu=()=>[],Ku=I(2,(e,t)=>e.map(t)),qu=`~effect/BigDecimal`,Ju={[qu]:qu,[$s](){let e=nd(this);return nc(oc(String(e.value)),ac(e.scale))},[_c](e){return Yu(e)&&sd(this,e)===0},toString(){return`BigDecimal(${ld(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[Qc](){return this.toJSON()},pipe(){return ws(this,arguments)}},Yu=e=>Qs(e,qu),Xu=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(Ju);return n.value=e,n.scale=t,n},Zu=(e,t)=>{let n=Xu(e,t);return n.normalized=n,n},Qu=BigInt(0),$u=BigInt(1),ed=BigInt(10),td=Zu(Qu,0),nd=e=>{if(e.normalized===void 0){if(e.value===Qu)e.normalized=td;else{let t=`${e.value}`,n=t.length;for(;t[n-1]===`0`;)n--;e.normalized=Zu(BigInt(t.slice(0,n)),e.scale-(t.length-n))}}return e.normalized},rd=100,id=[$u],ad=(e,t)=>e===t?0:e<t?-1:1,od=(e,t)=>{let n=`${e.value<Qu?-e.value:e.value}`,r=`${t.value<Qu?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==Qu)return i<Qu?-1:1;let a=Math.max(n.length,r.length);return yu(n.padEnd(a,`0`),r.padEnd(a,`0`))},sd=(e,t)=>{if(e.scale===t.scale)return ad(e.value,t.value);let n=cd(e),r=cd(t);if(n!==r)return n<r?-1:1;if(n===0)return 0;let i=e.scale-t.scale,a=Math.abs(i);if(a>rd)return n===-1?od(t,e):od(e,t);let o=id[a]??=ed**BigInt(a);return i>0?ad(e.value,t.value*o):ad(e.value*o,t.value)},cd=e=>e.value===Qu?0:e.value<Qu?-1:1,ld=e=>{let t=nd(e);if(Math.abs(t.scale)>=16)return ud(t);let n=t.value<Qu,r=`${n?-t.value:t.value}`,i=t.scale>0?r.padStart(t.scale+1,`0`):r.padEnd(r.length-t.scale,`0`),a=i.length-t.scale,o=t.scale>0?`${i.slice(0,a)}.${i.slice(a)}`:i;return n?`-${o}`:o},ud=e=>{if(dd(e))return`0e+0`;let t=nd(e),n=`${t.value}`,r=t.value<Qu?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},dd=e=>e.value===Qu,fd=e=>Ll({op:e.label,[ul]:e.evaluate}),pd=`~effect/Context/Service`,md=function(){function e(){}let t=e;Object.setPrototypeOf(t,hd);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[_d]=_d,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&gd.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},hd={[pd]:pd,...fd({label:`Service`,evaluate(e){return Bl(Ld(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Nd(this,e)},use(e){return Kl(t=>e(Ld(t.context,this)))},useSync(e){return Kl(t=>Bl(e(Ld(t.context,this))))}},gd=new Set,_d=`~effect/Context/Reference`,vd=`~effect/Context`,yd=8,bd=8,xd=(e,t,n,r)=>{let i=Object.create(Dd);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Sd=(e,t)=>{t&&(Sd(e,t.parent),e.set(t.key,t.value))},Cd=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Sd(t,e.overlay),e._flat=t},wd=Symbol(),Td=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?wd:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=bd&&(n.base=Cd(n),n.overlay=void 0,n.depth=0),r)},Ed=e=>xd(void 0,e,void 0,0),Dd={get mapUnsafe(){return Cd(this)},...hl,[vd]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[_c](e){if(!kd(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!vc(r,n.get(e)))return!1;return!0},[$s](){return ac(this.mapUnsafe.size)}},Od=(e,t)=>e.cacheRoot===t.cacheRoot,kd=e=>Qs(e,vd),Ad=e=>!!e[_d],jd=()=>Md,Md=Ed(new Map),Nd=(e,t)=>Ed(new Map([[e.key,t]])),Pd=I(3,(e,t,n)=>Fd(e,t.key,n)),Fd=(e,t,n)=>{let r=e,i=gd.has(t)?void 0:r.cacheRoot;if(r.depth>=yd){let e=new Map(r.mapUnsafe);return e.set(t,n),xd(i,e,void 0,0)}return xd(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Id=(e,t)=>{let n=Td(e,t);return n===wd?void 0:n},Ld=I(2,(e,t)=>{let n=Td(e,t.key);if(n===wd){if(Ad(t))return zd(t);throw Bd(t)}return n}),Rd=`~effect/Context/defaultValue`,zd=e=>Rd in e?e[Rd]:e[Rd]=e.defaultValue(),Bd=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
67
|
+
`);e.splice(1,3),t.stack=e.join(`
|
|
68
|
+
`)}return t},Vd=md,Hd=`~effect/Duration`,Ud=BigInt(0),Wd=BigInt(1),Gd=BigInt(2),Kd=BigInt(10),qd=BigInt(1e3),Jd=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),Yd=e=>Jd(e*1e6),Xd=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=Kd**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*Gd>=a?Wd:Ud);return r?-s:s},Zd=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Qd=e=>{switch(typeof e){case`number`:return df(e);case`bigint`:return uf(e);case`string`:{if(e===`Infinity`)return cf;if(e===`-Infinity`)return lf;let t=Zd.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return uf(Xd(r,Wd));if(i===`micro`||i===`micros`)return uf(Xd(r,qd));let a=Number(r);switch(i){case`milli`:case`millis`:return df(a);case`second`:case`seconds`:return ff(a);case`minute`:case`minutes`:return pf(a);case`hour`:case`hours`:return mf(a);case`day`:case`days`:return hf(a);case`week`:case`weeks`:return gf(a)}break}case`object`:{if(e===null)break;if(Hd in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Hs)?$d(e):Number.isNaN(e[0])||Number.isNaN(e[1])?sf:e[0]===-1/0||e[1]===-1/0?lf:e[0]===1/0||e[1]===1/0?cf:af(Jd(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?af(n):af(Jd(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return $d(e)},$d=e=>{throw Error(`Invalid Input: ${e}`)},ef={_tag:`Millis`,millis:0},tf={_tag:`Infinity`},nf={_tag:`NegativeInfinity`},rf={[Hd]:Hd,[$s](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?L(Jd(e)):ac(this.value.millis)}case`Nanos`:return L(this.value.nanos);default:return cc(this.value)}},[_c](e){return of(e)&&bf(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[Qc](){return this.toJSON()},pipe(){return ws(this,arguments)}},af=e=>{let t=Object.create(rf);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?ef:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:Yd(e)}:e>0?tf:nf:e===Ud?ef:{_tag:`Nanos`,nanos:e},t},of=e=>Qs(e,Hd),sf=af(0),cf=af(1/0),lf=af(-1/0),uf=e=>af(e),df=e=>af(e),ff=e=>af(e*1e3),pf=e=>af(e*6e4),mf=e=>af(e*36e5),hf=e=>af(e*864e5),gf=e=>af(e*6048e5),_f=e=>{let t=Qd(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return Yd(t.value.millis)}},vf=I(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(_f(e),t.value.nanos):n.onNanos(e.value.nanos,_f(t))),yf=(e,t)=>vf(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),bf=I(2,(e,t)=>yf(e,t)),xf=Vd(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Ef}),Sf=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Cf=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},wf=e=>{try{return Cf(e)}catch{return Sf(e)}},Tf=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},Ef=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Sf:wf)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new Df(this.setImmediate)}},Df=class{tasks=new Tf;running=void 0;setImmediate;constructor(e=wf){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},Of=Vd(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),kf=Vd(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),Af=Yl,jf=`~effect/encoding/EncodingError`,Mf=class extends Af(`EncodingError`){[jf]=jf},Nf=`effect/Tracer/ParentSpan`;md()(Nf,{fiberCached:!0});var Pf=`effect/Tracer`,Ff=`effect/Metric/FiberRuntimeMetrics`,If=Vd(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:js}),Lf=Vd(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:ks}),Rf=Vd(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),zf=Vd(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Bf=class extends Cl{constructor(e,t=wl){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[_c](e){return Fl(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[$s](){return nc(oc(`${this._tag}:${this.fiberId}`))(ec(this.annotations))}},Vf=e=>new xl([new Bf(e)]),Hf=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return Fu(n.error)}return Iu(e)},Uf=e=>e.reasons.some(Fl),Wf=I(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Nl(e)?(n=!0,new Tl(t(e.error),e.annotations)):e);return n?El(r):e}),Gf=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=nl();i!==0&&rl(1);try{for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(Kf(i._tag===`Die`?i.defect:i.error,i.annotations,t))}if(n.length===0){let e=Error(`The fiber was interrupted by:`);e.name=`InterruptCause`,e.stack=Zf(e,r);let i=new globalThis.Error(`All fibers interrupted without error`,{cause:e});i.name=`InterruptError`,i.stack=`${i.name}: ${i.message}`,n.push(Kf(i,r[0].annotations,t))}}finally{i!==0&&rl(i)}return n},Kf=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(qf(e),{cause:e.cause?Kf(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=Yf(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?Xf(e,t):e}n?.includeCauseInStack&&(i.stack=ep(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else{i=new globalThis.Error(e?r===`string`?e:Yc(e):`Unknown error: ${e}`);let n=`${i.name}: ${i.message}`;i.stack=t?Xf(n,t):n}return i},qf=e=>{if(typeof e.message==`string`)return e.message;if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Yc(e)},Jf=/\((.*)\)/g,Yf=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
|
|
69
|
+
`),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?Xf(a.join(`
|
|
70
|
+
`),n):a.join(`
|
|
71
|
+
`)},Xf=(e,t)=>{let n=t?.get(Vl.key);return n&&(e=`${e}\n${Qf(n)}`),e},Zf=(e,t)=>{let n=[`${e.name}: ${e.message}`];for(let e of t){let t=e.fiberId===void 0?`unknown`:`#${e.fiberId}`,r=e.annotations.get(Hl.key);n.push(` at fiber (${t})`),r&&n.push(Qf(r))}return n.join(`
|
|
72
|
+
`)},Qf=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(Jf),i=!1;for(let[,e]of r)i=!0,t.push(` at ${n.name} (${e})`);i||t.push(` at ${n.name} (${e.replace(/^at /,``)})`)}else t.push(` at ${n.name}`);n=n.parent,r++}return t.join(`
|
|
73
|
+
`)},$f=e=>Gf(e).map(ep).join(`
|
|
74
|
+
`),ep=e=>e.cause?`${e.stack} {\n${tp(e.cause,` `)}\n}`:e.stack,tp=(e,t)=>{let n=e.stack.split(`
|
|
75
|
+
`),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${tp(e.cause,`${t} `)}\n${t}}`),r},np=`~effect/Fiber`,rp={_A:Ds,_E:Ds},ip={id:0},ap=(()=>{try{return globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncResource}catch{return}})(),op=()=>ap===void 0?void 0:new ap(`effect/Fiber`),sp=()=>globalThis[Bc],cp=class{constructor(e,t=!0){this.setContext(e),this.id=++ip.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[np](){return rp}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Ld(this.context,e)}addObserver(e){return this._exit?(e(this._exit),Ms):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let n=Vf(e);this.cache.stackFrame&&(n=Ml(n,Nd(Vl,this.cache.stackFrame))),t&&(n=Ml(n,t)),this._interruptedCause=this._interruptedCause?Ol(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(_p(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._asyncContext!==void 0){let t=this._asyncContext;return this._asyncContext=void 0,t.runInAsyncScope(this.evaluate,this,e)}if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===ml){this._asyncContext=op();return}let n=fp.interruptChildren&&fp.interruptChildren(this);if(n!==void 0)return this.evaluate(Up(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=jd()}runLoop(e){let t=globalThis[Bc];globalThis[Bc]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;)try{this._deferredInterrupt&&(this._deferredInterrupt=!1,i=_p(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Up(Sp,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[ul](this),i===ml){let e=this._yielded;if(sl in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return ml}}catch(e){if(!Qs(i,ul))return Gl(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=Gl(e)}}finally{this._running=n,globalThis[Bc]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,up;for(;;){let t=this._stack.pop();if(!t)return;let n=t[pl];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&dp-1))return Bl(e);let t=this.getCont(dl);return t?t[dl](e,this):this.yieldWith(Bl(e))}yieldWith(e){return this._yielded=e,ml}children(){return this._children??=new Set}pipe(){return ws(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Od(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=lp(e);this.cache?.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},lp=e=>{let t=Id(e,Pf);return{scheduler:Ld(e,xf),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Ld(e,Lf),span:Id(e,Nf),logLevel:Ld(e,Rf),minimumLogLevel:Ld(e,zf),stackFrame:Ld(e,If),runtimeMetrics:Id(e,Ff),maxOpsBeforeYield:Ld(e,Of),preventYield:Ld(e,kf)}},up={[dl](e,t){return _p(t._interruptedCause)},[fl](e,t){return _p(t._interruptedCause)}},dp=32,fp={interruptChildren:void 0},pp=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Hl.key,e.cache.stackFrame),Ed(t)},mp=e=>Ap(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(gp(r))}return a(),yp(()=>i?.())}),hp=e=>Kl(t=>{let n=pp(t),r=Gu();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return Hp(mp(r))}),gp=Bl,_p=Ul,vp=Wl,yp=Rl({op:`Sync`,[ul](e){let t=this[z](),n=e.getCont(dl);return n?n[dl](t,e):e.yieldWith(Bl(t))}}),bp=Rl({op:`Suspend`,[ul](e){return this[z]()}}),xp=Bu({onFailure:vp,onSuccess:gp}),Sp=Rl({op:`Yield`,[ul](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Xp)},this[z]??0),e.yieldWith(()=>{t=!0})}})(0),Cp=e=>bp(()=>_p(e())),wp=e=>Gl(e),Tp=e=>bp(()=>vp(e())),Ep=gp(void 0),Dp=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new wm(e,`An error occurred in Effect.try`):e.catch;return bp(()=>{try{return gp(t())}catch(e){return vp(n(e))}})},Op=function(){let e=Ll({op:`Async`,[ul](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(kp(()=>(t=!0,r?.abort(),i??Xp))),ml):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),kp=Rl({op:`AsyncFinalizer`,[pl](e){e.interruptible&&(e.interruptible=!1,e._stack.push(fm))},[fl](e,t){return Uf(e)?Up(um(Ul(e),this[z]()),()=>_p(e)):_p(e)}}),Ap=e=>Op(e,e.length>=2),jp=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Mp=(e,...t)=>jp(e.length,t.length===0?function(){return Np(()=>e.apply(this,arguments))}:function(){let n=Np(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),Np=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return gp(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return bp(()=>n?(n=!1,Up(r.value,e=>Pp(t,e))):bp(()=>Pp(e())))}}}catch(e){return wp(e)}},Pp=function(){let e=Ll({op:`Iterator`,[dl](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return gp(r.value);if(!Wp(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[ul](e){return this[dl](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Fp=function(e){return e._stack.push(this),this[z]},Ip=Ll({op:`OnSuccess`,[ul]:Fp}),Lp=function(e,t,n){this[z]=e,this[dl]=t,this.payload=n};Lp.prototype=Ip;var Rp=function(){return this.payload},zp=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),Bp=function(e,t){let n=this.payload;return t.succeedWith(zp?n(e):al(()=>n(e)))},Vp=function(e){let t=this.payload;return t(e)},Hp=e=>new Lp(e,Rp,Xp),Up=I(2,(e,t)=>new Lp(e,Vp,t)),Wp=e=>e[sl]!==void 0,Gp=I(2,(e,t)=>Wp(e)?e._tag===`Success`?t(e.value):e:Up(e,t)),Kp=I(2,(e,t)=>new Lp(e,Bp,t)),qp=I(2,(e,t)=>Wp(e)?Zp(e,t):Kp(e,t)),Jp=I(2,(e,t)=>Wp(e)?Qp(e,t):im(e,t)),Yp=e=>e._tag===`Success`,Xp=Bl(void 0),Zp=I(2,(e,t)=>e._tag===`Success`?Bl(t(e.value)):e),Qp=I(2,(e,t)=>{if(e._tag===`Success`)return e;let n=Hf(e.cause);return Lu(n)?e:Wl(t(n.success))}),$p=I(2,(e,t)=>new tm(e,t.length===1?t:e=>t(e))),em=Ll({op:`OnFailure`,[ul]:Fp}),tm=function(e,t){this[z]=e,this[fl]=t};tm.prototype=em;var nm=I(3,(e,t,n)=>$p(e,e=>{let r=t(e);return Lu(r)?_p(r.failure):n(r.success,e)})),rm=I(2,(e,t)=>nm(e,Hf,e=>t(e))),im=I(2,(e,t)=>rm(e,e=>Tp(()=>t(e)))),am=function(e,t){let n=this.payload;return t.succeedWith(zp?n.onSuccess(e):al(()=>n.onSuccess(e)))},om=((e,t)=>{let n=Ll({op:e,[ul]:Fp,[dl]:am,[fl]:t}),r=function(e,t){this[z]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find(Nl);if(n===void 0)return _p(e);let r=this.payload;return t.succeedWith(zp?r.onFailure(n.error):al(()=>r.onFailure(n.error)))}),sm=I(2,(e,t)=>new om(e,t)),cm=e=>Wp(e)?Bl(e):lm(e),lm=Rl({op:`Exit`,[ul](e){return e._stack.push(this),this[z]},[dl](e,t,n){return t.succeedWith(n??Bl(e))},[fl](e,t,n){return t.succeedWith(n??Ul(e))}}),um=(e,t)=>Yp(e)?t:$p(t,t=>_p(Ol(e.cause,t))),dm=e=>Kl(t=>t.interruptible?(t.interruptible=!1,t._stack.push(fm),e):e),fm=Rl({op:`SetInterruptible`,[pl](e){if(e.interruptible=this[z],e._interruptedCause&&e.interruptible)return()=>_p(e._interruptedCause)}})(!0),pm=e=>e===`unbounded`?1/0:Math.max(1,e??1),mm=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>Up(cm(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??Ep),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!Wp(c))return r(e,i,a,o,c);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return i},hm=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f,p,m=e=>{let t=Gl(e);return f=t,c=!0,u&&u.size>0?Up(dm(hp(Array.from(u))),()=>f??t):t},h=()=>{let i=!1;for(;!f&&a<o;a++){let o=r[a],g=p??t(e,o,a);if(Wp(g)){if(f=n(e,o,g,a),f)break}else if(l){p=void 0;let t=_m(l,g,!0,!0,`inherit`);if(t._exit){if(f=n(e,o,t._exit,a),f)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(f){if(a._tag===`Failure`){let e=a.cause.reasons.filter(e=>e._tag!==`Interrupt`);if(e.length>0){let t=El(e);f=Ul(f._tag===`Failure`?Ol(f.cause,t):t)}}}else{let t=n(e,o,a,r);t&&(f=t,h())}if(i){let e=h();e&&d(e)}else c&&u.size===0&&d(f??Ep)}catch(e){d(m(e))}}),u.size<s)continue;i=!0,a++;return}else return Ap(e=>{l=sp(),u=new Set,p=g,d=e;let t;try{t=h()}catch(t){return e(m(t))}return t?e(t):bp(()=>(f??=Xp,Up(u?hp(u):Ep,()=>f?._tag===`Failure`?f:Ep)))})}if(c=!0,f){if(u&&u.size>0){let e=pp(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||f._tag===`Failure`)return f}else if(d){if(u)u.size===0&&d(Ep);else return Xp}};return h()}},gm=()=>e=>hm(e),_m=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new cp(a.context,o);return r||(a.children().add(s),s._parent=a),n?s.evaluate(t):(s._asyncContext=op(),a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0)),s},vm=e=>(t,n)=>{let r=new cp(n?.scheduler?Pd(e,xf,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},ym=vm(jd()),bm=(e=>{let t=vm(e);return e=>{if(Wp(e))return e;let n=new Ef(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??Gl(new Sm(r))}})(jd());Yl(`TimeoutError`),Yl(`IllegalArgumentError`),Yl(`ExceededCapacityError`);var xm=`~effect/Cause/AsyncFiberError`,Sm=class extends Yl(`AsyncFiberError`){[xm]=xm;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Cm=`~effect/Cause/UnknownError`,wm=class extends Yl(`UnknownError`){[Cm]=Cm;constructor(e,t){super({message:t,cause:e})}},Tm={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Tm.gray,Tm.blue,Tm.green,Tm.yellow,Tm.red,Tm.bgBrightRed,Tm.black;var Em=Nl,Dm=jl,Om=Wf,km=$f;md()(`effect/Cause/StackTrace`),md()(`effect/Cause/InterruptorStackTrace`);var Am=Bl,jm=Ul,Mm=Wl,Nm=Xp,Pm=Yp,Fm=`~effect/DateTime`,Im=`~effect/DateTime/TimeZone`,Lm={[Fm]:Fm,pipe(){return ws(this,arguments)},[Qc](){return this.toString()},toJSON(){return zm(this).toJSON()}};({...Lm}),{...Lm};var Rm={[Im]:Im,[Qc](){return this.toString()}};({...Rm}),{...Rm};var zm=e=>new Date(e.epochMilliseconds);globalThis.String;var Bm=e=>e.trim(),Vm=gp,Hm=bp,Um=vp,Wm=Cp,Gm=wp,Km=Dp,qm=xp,Jm=Up,Ym=cm,Xm=$p,Zm=sm,Qm=ym,$m=bm;md()(`effect/Effect/Transaction`);var eh=qp,th=Jp,nh=Gp,rh=Mp;md()(`effect/DateTime/CurrentTimeZone`);var ih=e=>oh(typeof e==`string`?sh.encode(e):e),ah=e=>{let t=ch(e),n=t.length;if(n%4!=0)return Iu(new Mf({kind:`Decode`,module:`Base64`,input:t,message:`Length must be a multiple of 4, but is ${n}`}));let r=t.indexOf(`=`);if(r!==-1&&(r<n-2||r===n-2&&t[n-1]!==`=`))return Iu(new Mf({kind:`Decode`,module:`Base64`,input:t,message:`Found a '=' character, but it is not at the end`}));try{let e=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=new Uint8Array(n/4*3-e);for(let e=0,i=0;e<n;e+=4,i+=3){let n=dh(t.charCodeAt(e))<<18|dh(t.charCodeAt(e+1))<<12|dh(t.charCodeAt(e+2))<<6|dh(t.charCodeAt(e+3));r[i]=n>>16,r[i+1]=n>>8&255,r[i+2]=n&255}return Fu(r)}catch(e){return Iu(new Mf({kind:`Decode`,module:`Base64`,input:t,message:e instanceof Error?e.message:`Invalid input`}))}},oh=e=>{let t=e.length,n=``,r;for(r=2;r<t;r+=3)n+=lh[e[r-2]>>2],n+=lh[(e[r-2]&3)<<4|e[r-1]>>4],n+=lh[(e[r-1]&15)<<2|e[r]>>6],n+=lh[e[r]&63];return r===t+1&&(n+=lh[e[r-2]>>2],n+=lh[(e[r-2]&3)<<4],n+=`==`),r===t&&(n+=lh[e[r-2]>>2],n+=lh[(e[r-2]&3)<<4|e[r-1]>>4],n+=lh[(e[r-1]&15)<<2],n+=`=`),n},sh=new TextEncoder,ch=e=>e.replace(/[\n\r]/g,``),lh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,uh=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)uh[lh.charCodeAt(e)]=e;uh[61]=0;var dh=e=>{if(e>=uh.length||uh[e]===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return uh[e]};Af(`CookiesError`),{...el},{...el},{...hl};function fh(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function ph(e){return t=>fh(t)?.[e]}var mh=`~structural`,hh=`~identifier`,gh=`~sentinels`,_h=`~constructor`,vh=[`title`,`description`,`default`,`examples`,`readOnly`,`writeOnly`,`format`,`contentEncoding`,`contentMediaType`,`contentSchema`],yh=ph(`identifier`),bh=ph(hh),xh=ph(`title`),Sh=ph(`description`),Ch=Ps(e=>{let t=fh(e)?.identifier;return typeof t==`string`?t:e.getExpected(Ch)}),wh=new Set([gh,mh,`representation`,`arbitraryConstraint`,`toJsonSchema`,`toCode`,`toEquivalence`,`toFormatter`,`toCodec`,`toCodecJson`,`toCodecStringTree`,`toCodecIso`,`toCodecArbitrary`]),B=Symbol(),Th=Am,Eh=Th(B),Dh=Th(B),Oh=e=>e===B?Tu():Eu(e),kh=e=>e._tag===`None`?Eh:Th(e.value),Ah=`~effect/SchemaIssue/Issue`;function jh(e){return Qs(e,Ah)&&e[Ah]===Ah}function Mh(e){return Object.hasOwn(e,`input`)}var Nh=class{[Ah]=Ah;constructor(e,t){t?.reportInput===!0&&e!==B&&(this.input=e)}},Ph=class extends Nh{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Fh=class extends Nh{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Ih=class extends Nh{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Lh=class extends Nh{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Rh=class extends Nh{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},zh=class extends Nh{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Bh=class extends Nh{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Vh=class extends Nh{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},Hh=class extends Nh{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Uh=class extends Nh{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function Wh(e,t,n){if(jh(e))return e;if(typeof e==`string`)return new Vh({message:e},t,n);let r=typeof e.issue==`string`?new Vh({message:e.issue},t,n):e.issue;return new Ih(e.path,r)}function Gh(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new Vh(void 0,t,n):Wh(e,t,n)}function Kh(e,t,n,r){return Array.isArray(t)?Wu(t)?t.length===1?Wh(t[0],n,r):new zh(e,Ku(t,e=>Wh(e,n,r)),n,r):void 0:Gh(t,n,r)}var qh=e=>{let t=ig(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Qh(Ch(e.ast),e);case`InvalidValue`:{let t=Zh(e);if(t!==void 0)return Qh(t,e);let n=Xh(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=Xh(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=Xh(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Jh=e=>ig(e.issue)??ig(e);function Yh(e){return t=>({issues:$h(t,[],e?.leafHook??qh,e?.checkHook??Jh)})}function Xh(e){return Mh(e)?R(e.input):void 0}function Zh(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Qh(e,t){let n=Xh(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function $h(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return $h(e.issue,t,n,r);let a=Zh(e.issue);return[{path:t,message:a===void 0?Qh(eg(e.filter),e):Qh(a,e.issue)}]}case`Encoding`:return $h(e.issue,t,n,r);case`Pointer`:return $h(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>$h(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:ig(e)??Qh(Ch(e.ast),e)}]:e.issues.flatMap(e=>$h(e,t,n,r));default:return[{path:t,message:n(e)}]}}function eg(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>eg(e)).join(` & `)}}function tg(){return e=>rg(e,``)}var ng=tg();function rg(e,t){let n;switch(e._tag){case`Filter`:{let r=Jh(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return rg(e.issue,t);let r=Zh(e.issue);n=r===void 0?Qh(eg(e.filter),e):Qh(r,e.issue)}break}case`Encoding`:return rg(e.issue,t);case`Pointer`:return rg(e.issue,t+Gc(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>rg(e,t)).join(`
|
|
76
|
+
`);n=ig(e)??Qh(Ch(e.ast),e);break;default:n=qh(e)}return t?`${n}\n at ${t}`:n}function ig(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return ig(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function ag(e){let t;for(let n of e.reasons){if(!Em(n)||!jh(n.error))return;t??=n.error}return t}function og(e,t){let n=ag(e);if(n===void 0)throw Error(t,{cause:e});return n}var sg=e=>Object.assign(Object.create(Ts),e),cg=sg({_tag:`Passthrough`});function lg(){return cg}function ug(e){return sg({_tag:`Transform`,transform:e})}function dg(e){return sg({_tag:`TransformEffect`,transform:e})}function fg(){return ug(globalThis.String)}function pg(){return ug(globalThis.Number)}function mg(){return ug(Bm)}function hg(e){return dg((t,n)=>Km({try:()=>JSON.parse(t,e?.reviver),catch:()=>new Vh({expected:`a valid JSON string`},t,n)}))}function gg(e){return dg((t,n)=>Km({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw TypeError(`Value cannot be represented as JSON`);return n},catch:()=>new Vh({expected:`a JSON-serializable value`},t,n)}))}function _g(){return ug(ih)}function vg(){return dg((e,t)=>th(qm(ah(e)),()=>new Vh({expected:`a valid Base64 string`},e,t)))}var yg=class extends Es{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new yg(this.encode,this.decode)}},bg=`~effect/SchemaTransformation/Transformation`,xg=class extends Es{[bg]=bg;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new xg(this.encode,this.decode)}};function Sg(e){return Qs(e,bg)&&e[bg]===bg}var Cg=e=>Sg(e)?e:new xg(e.decode,e.encode);function wg(){return new xg(mg(),lg())}var Tg=new xg(lg(),lg());function Eg(){return Tg}var Dg=new xg(pg(),fg()),Og=new xg(vg(),_g());function kg(e){return new xg(hg(e??{}),gg(e))}function Ag(e){return t=>t._tag===e}var jg=Ag(`Declaration`),Mg=Ag(`Null`),Ng=Ag(`Undefined`),Pg=Ag(`Never`),Fg=Ag(`String`),Ig=Ag(`Number`),Lg=Ag(`Boolean`),Rg=Ag(`Literal`),zg=Ag(`UniqueSymbol`),Bg=Ag(`Arrays`),Vg=Ag(`Objects`),Hg=Ag(`Union`),Ug=Ag(`Suspend`),Wg=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Gg={},Kg=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},qg=`~effect/Schema`,Jg=class{[qg]=qg;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},Yg=class extends Jg{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===B?Eh:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=hv(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new Yg(a,r,this.annotations,t,void 0,this.context,n,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},Xg=new class extends Jg{_tag=`Null`;getParser(){return Nv(this,null)}getExpected(){return`null`}},Zg=class extends Jg{_tag=`Undefined`;getParser(){return Nv(this,void 0)}toCodecJson(){return rv(this,[Qg])}getExpected(){return`undefined`}},Qg=new Wg(Xg,new xg(ug(()=>void 0),ug(()=>null))),$g=new Zg,e_=new class extends Jg{_tag=`Unknown`;getParser(){return Pv(this,Ys)}getExpected(){return`unknown`}},t_=class extends Jg{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${R(e)}`);this.literal=e}getParser(){return Nv(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?n_(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:n_(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function n_(e){let t=globalThis.String(e.literal);return rv(e,[new Wg(new t_(t),new xg(ug(()=>e.literal),ug(()=>t)))])}var r_=new class extends Jg{_tag=`String`;getParser(){return Pv(this,Vs)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Wv(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},i_=class extends Jg{_tag=`Number`;getParser(){return Pv(this,Hs)}matchKey(e,t){return this._match(zv,e,t)}matchPart(e,t){return this._match(Rv,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Wv(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(a_(this.checks,`effect/schema/isFinite`)||a_(this.checks,`effect/schema/isInt`))?this:rv(this,[Q_])}toCodecStringTree(){return this.toCodecJson()===this?rv(this,[Hv]):rv(this,[Uv])}getExpected(){return`number`}};function a_(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&a_(e.checks,t))}var o_=new i_,s_=new class extends Jg{_tag=`Boolean`;getParser(){return Pv(this,Us)}getExpected(){return`boolean`}},c_=class extends Jg{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(Cv(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(Cv(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}let c=e=>{let{input:t,len:r,options:i}=e;if(n.rest.length===0&&r>a)for(let o=a;o<r;o++){let r=new Rh(n,t[o],i),a=new Ih([o],r);if(i.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Um(new zh(n,[a],t,i))}return e.issues?Um(new zh(n,e.issues,t,i)):Th(e.output)},l=(e,t)=>{let r=e.length,i={ast:n,getParser:s,input:e,len:r,tailThreshold:Math.max(a,r-o),output:new globalThis.Array(r),issues:void 0,options:t},u=n.rest.length===0?a:Math.max(r,a+o),d=t.concurrency===void 0?1:pm(t.concurrency),f=d===1?d_(i,e,0,u):f_(i,e,{concurrency:d,end:u});if(!f)return c(i);if(Wp(f))return nh(f,()=>c(i));let p=!0;return Hm(()=>p?(p=!1,Jm(f,()=>c(i))):l(e,t))};return(e,a)=>{if(e===B)return Eh;try{return Array.isArray(e)?(r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)}))),l(e,a)):Um(new Bh(n,e,a))}catch(e){return Gm(e)}}}_rebuild(e,t,n){let r=hv(this.elements,e),i=hv(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new c_(this.isMutable,r,i,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};function l_(e,t,n,r){if(n._tag===`Failure`)return p_(e,e.ast,r,n);let i=n===Dh?t:n[z];if(i!==B)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Cv(t.ast))return;let n=new Ih([r],new Lh(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Mm(new zh(e.ast,[n],e.input,e.options))}}var u_={onItem(e,t,n){let r=n<e.len?t:B;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:l_},d_=mm()(u_),f_=gm()(u_),p_=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=ag(r.cause);if(i===void 0)return jm(Om(r.cause,r=>new zh(t,[new Ih([n],r)],e.input,e.options)));let a=new Ih([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Mm(new zh(t,[a],e.input,e.options))},m_=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function h_(e,t,n=Gg){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(r=>Object.prototype.propertyIsEnumerable.call(e,r)&&t.matchKey(r,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(Fv(kv(t)))}var g_=class{name;type;constructor(e,t){this.name=e,this.type=t}};function __(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(__);default:return!1}}function v_(e){let t=av(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(v_);default:return!1}}function y_(e){return __(e)&&v_(e)}var b_=class{parameter;type;constructor(e,t){if(!y_(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Cv(t)&&!Mv(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},x_=class extends Jg{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o}getParser(e,t=e){let n=this,r=n.propertySignatures.length,i=n.indexSignatures.length;if(!r&&!i)return Pv(n,Js);let a,o,s=()=>(a||(a=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),o=i?n.indexSignatures.map(n=>({is:n,parserKey:e(Fv(n.parameter)),parserValue:t(n.type)})):void 0),a),c=()=>{let e=new Set(n.propertySignatures.map(e=>typeof e.name==`number`?globalThis.String(e.name):e.name)),t=(t,i,a,o,s)=>{if(s._tag===`Failure`)return p_(t,n,i,s)??Nm;let c=s===Dh?o:s[z];if(a!==B&&c!==B){if(r&&(e.has(i)||e.has(typeof a==`number`?globalThis.String(a):a)))return Nm;Pc(t.out,a,c)}return Nm},c=(e,r,i,a)=>{if(!a){let t=i.parserKey(r,e.options);if(!Wp(t))return Jm(Ym(t),t=>c(e,r,i,t));a=t}if(a._tag===`Failure`)return p_(e,n,r,a)??Nm;let o=a===Dh?r:a[z],s=e.input[r],l=i.parserValue(s,e.options);return Wp(l)?t(e,r,o,s,l):Jm(Ym(l),n=>t(e,r,o,s,n))},l=(e,n,r)=>{let i=e.input[n],a=r.parserValue(i,e.options);return Wp(a)?t(e,n,n,i,a):Jm(Ym(a),r=>t(e,n,n,i,r))},u=i?gm()({onItem:(e,[t,n])=>n.is.parameter===r_?l(e,t,n):c(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return rh(function*(t,d){if(t===B)return B;if(!(typeof t==`object`&&t&&!Array.isArray(t)))return yield*Um(new Bh(n,t,d));s();let f=t,p={},m={ast:n,input:f,out:p,issues:void 0,options:d},h=d.errors===`all`,g=d.onExcessProperty===`error`,_=d.concurrency===void 0?1:pm(d.concurrency),v=i&&g?n.indexSignatures.map(e=>h_(f,e.parameter,d)):void 0;if(g){let r=v?new Set(e):e;if(v)for(let e of v)for(let t of e)r.add(t);let i=Reflect.ownKeys(f);for(let e=0;e<i.length;e++){let a=i[e];if(!r.has(a)&&Object.prototype.propertyIsEnumerable.call(f,a)){let e=new Rh(n,f[a],d),r=new Ih([a],e);if(h){m.issues?m.issues.push(r):m.issues=[r];continue}return yield*Um(new zh(n,[r],t,d))}}}if(r){let e=_===1?w_(m,a):T_(m,a,{concurrency:_});e&&(yield*e)}if(i&&_===1)for(let e=0;e<i;e++){let t=o[e],n=t.is.parameter===r_?l:c,r=v?.[e]??(t.is.parameter===r_?Object.keys(f):h_(f,t.is.parameter,d));for(let e=0;e<r.length;e++){let i=n(m,r[e],t);if(!Wp(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(u){let e=Gu();for(let t=0;t<i;t++){let n=o[t],r=v?.[t]??(n.is.parameter===r_?Object.keys(f):h_(f,n.is.parameter,d));for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=u(m,e,{concurrency:_});t&&(yield*t)}return m.issues?yield*Um(new zh(n,m.issues,t,d)):p})};if(i)return c();let l,u=(e,t,n)=>{let r=a[t];return Jm(Ym(n),n=>{let i=S_(e,r,n);if(i)return i;let o=()=>Th(e.out),s=w_(e,a.slice(t+1));return s?nh(s,o):o()})};return(e,t)=>{if(e===B)return Eh;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&pm(t.concurrency)!==1)return(l??=c())(e,t);if(!(typeof e==`object`&&e&&!Array.isArray(e)))return Um(new Bh(n,e,t));let r=s(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=I_(i,s),l=c?i[s]:B,d=n.parser(l,t);if(!Wp(d))return u(o,e,d);if(d===Dh){c&&Pc(a,s,l);continue}let f=S_(o,n,d);if(f)return f}}catch(e){return Gm(e)}return Th(a)}}_rebuild(e,t,n,r){let i=hv(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new g_(t.name,n)}),a=hv(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new b_(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new x_(i,a,this.annotations,n,void 0,this.context,r)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function S_(e,t,n){if(n._tag===`Failure`)return p_(e,e.ast,t.name,n);if(n===Dh)return;let r=n[z];if(r!==B){Pc(e.out,t.name,r);return}if(delete e.out[t.name],!Cv(t.type)){let n=new Ih([t.name],new Lh(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return Mm(new zh(e.ast,[n],e.input,e.options))}}var C_={onItem(e,t){if(!I_(e.input,t.name))return t.parser(B,e.options);let n=e.input[t.name];return Pc(e.out,t.name,n),t.parser(n,e.options)},step:S_},w_=mm()(C_),T_=gm()(C_);function E_(e,t){return e?t?[...e,...t]:e:t}function D_(e,t,n){return new x_(Reflect.ownKeys(e).map(t=>new g_(t,e[t].ast)),[],n,t)}function O_(e){return e.ast}function k_(e,t,n){return new R_(e.map(O_),t,void 0,n)}var A_=Fs(e=>{for(;;){if(Ug(e))return e_;let t=e.encoding;if(!t)return e.recur?.(A_,Ds)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==Ds))return e_;e=t[t.length-1].to}});function j_(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(j_)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function M_(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[gh];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Cv(t)){if(Rg(t))return[{key:e.name,literal:t.literal}];if(zg(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Cv(e)){if(Rg(e))return[{key:t,literal:e.literal}];if(zg(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>M_(A_(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return M_(e.thunk())}}var N_=new WeakMap,P_=Object.freeze([]),F_=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,I_=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function L_(e){let t=N_.get(e);if(t)return t;let n,r=0,i,a,o=!0,s=[];for(let t=0;t<e.length;t++){let c=e[t],l=A_(c);if(Pg(l))continue;if(Rg(l)||zg(l)){a??=new Map;let e=Rg(l)?l.literal:l.symbol;s[t]=e;let n=a.get(e);n||a.set(e,n=[]),n.push(t)}else o=!1;let u=M_(l);if(u.length){n??=new Map,r++;for(let{key:e,literal:r}of u){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=j_(l);for(let n of e)(i[n]??=[]).push(t)}}let c={},l=e=>c[e]??=Object.freeze(i?.[e]??P_);if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??P_;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=new Map;for(let[e,t]of i)a.set(e,Object.freeze(Array.from(t)));let o=Object.freeze(e.map((e,t)=>t));t=(e,t)=>{if(Zs(e)){let n=I_(e,r)?e[r]:void 0;if(n!==void 0)return a.get(n)??P_;if(t)return o}return P_}}else if(n){let e;for(let t of n)(!e||t[1][0].size>e[1][0].size)&&t[1][1].size===r&&(e=t);t=(t,r)=>{let a=F_(t);if(!Zs(t))return l(a);let o=new Set(i?.[a]),s;if(e){let[n,[i]]=e,c=I_(t,n),u=c?t[n]:void 0;if(c&&(!r||u!==void 0)){let e=i.get(u);if(!e)return l(a);for(let t of e)o.add(t);s=n}}if(s===void 0)for(let[e,[i,a]]of n){let n=I_(t,e),s=n?t[e]:void 0;if(n&&(!r||s!==void 0)){let e=i.get(s);if(e)for(let t of e)o.add(t)}else if(r)for(let e of a)o.add(e)}for(let[e,[i,a]]of n){if(e===s)continue;let n=I_(t,e),c=n?t[e]:void 0;if(n&&(!r||c!==void 0)){let e=i.get(c);for(let t of o)a.has(t)&&!e?.has(t)&&o.delete(t)}}return Array.from(o).sort((e,t)=>e-t)}}else t=e=>{let t=l(F_(e));return a?t.filter(t=>s[t]===void 0||s[t]===e):t};return N_.set(e,t),t}var R_=class extends Jg{_tag=`Union`;types;options;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.options=t,this.encodingChecks=o}getParser(e,t){let n=this,r=t!==void 0,i=[],a=t=>i[t]??=e(n.types[t]),o;return(e,t)=>{if(e===B)return Eh;let i=(o??=L_(n.types))(e,r);if(i.length===0)return Um(new Hh(n,[],e,t));if(i.length===1){let r=a(i[0])(e,t);return r._tag===`Success`?r:Wp(r)?z_(n,r.cause,e,t):B_(n,r,e,t)}return V_(n,a,i,e,t)}}_rebuild(e,t,n){let r=hv(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new R_(r,this.options,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=kv(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(Rg);if(t.length>0)return`${G_(n.isMutable)}[ ${t.map(t=>e(t)+K_(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>Rg(e.type));if(t.length>0)return`{ ${t.map(t=>`${G_(t.type.context?.isMutable)}${Wc(t.name)}${K_(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function z_(e,t,n,r){let i=ag(t);return i?Mm(new Hh(e,[i],n,r)):jm(t)}function B_(e,t,n,r){return Xm(t,t=>z_(e,t,n,r))}function V_(e,t,n,r,i){let a={ast:e,parser:t,input:r,out:void 0,successes:e.options?.mode===`oneOf`?[]:void 0,issues:void 0,options:i},o=U_(a,n);if(!o)return a.out?a.out:Um(new Hh(e,a.issues??[],r,i));if(Wp(o))return H_(o,a);let s=!0;return Hm(()=>s?(s=!1,H_(o,a)):V_(e,t,n,r,i))}function H_(e,t){return nh(e,e=>t.out===Dh?Vm(t.input):t.out?t.out:Um(new Hh(t.ast,t.issues??[],t.input,t.options)))}var U_=mm()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=ag(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),Mm(new Uh(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(e.ast.types[t]);else return Nm}}}),W_=new R_([new t_(`Infinity`),new t_(`-Infinity`),new t_(`NaN`)]);function G_(e){return e?``:`readonly `}function K_(e){return e?`?`:``}var q_=class extends Es{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new q_(this.run,{...this.annotations,...e},this.aborted)}abort(){return new q_(this.run,this.annotations,!0)}and(e,t){return new J_([this,e],t)}},J_=class extends Es{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new J_(this.checks,{...this.annotations,...e})}and(e,t){return new J_([this,e],t)}};function Y_(e,t,n=!1){return new q_((t,n,r)=>Kh(n,e(t,n,r),t,r),t,n)}function X_(e){return Y_(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitraryConstraint:{number:`finite`},...e})}var Z_=cv(o_,[X_()]),Q_=new Wg(new R_([Z_,W_]),new xg(pg(),ug(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function $_(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return Y_(e=>(n.lastIndex=0,n.test(e)),{expected:`a string matching the RegExp ${r.source}`,representation:{id:`effect/schema/isPattern`,payload:r},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[r]},...t})}var ev=new WeakMap;function tv(e,t){let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>e===`context`||e===`encoding`)&&ev.set(n,nv(e)),n}function nv(e){let t=ev.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return ev.set(e,n),n}function rv(e,t){return e.encoding===t?e:tv(e,{encoding:t})}function iv(e,t){if(e.context===t)return e;let n=nv(e);return n.context===t&&n.encoding===e.encoding?n:tv(e,{context:t})}function av(e){return e.encoding?av(e.encoding[e.encoding.length-1].to):e}function ov(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return sv(e,Hu(e.checks.slice(0,-1),n.annotate(t)))}return tv(e,{annotations:{...e.annotations,...t}})}function sv(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:tv(e,{checks:t})}function cv(e,t){return sv(e,E_(e.checks,t))}function lv(e,t){let n=t(e.to);return n===e.to?e:new Wg(n,e.transformation)}function uv(e,t){let n=e,r=n[n.length-1],i=lv(r,t);return i===r?e:Hu(e.slice(0,e.length-1),i)}function dv(e){return t=>t.encoding?rv(t,uv(t.encoding,e)):t}function fv(e,t){return dv(e=>iv(e,t))(e)}function pv(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:rv(r,uv(r.encoding,n))}return e(r)}return Fs(n)}function mv(e,t,n){let r=new Wg(e,t);return rv(n,n.encoding?[...n.encoding,r]:[r])}function hv(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r],a=t(i);if(n)n[r]=a;else if(a!==i){n=Array(e.length);for(let t=0;t<r;t++)n[t]=e[t];n[r]=a}}return n??e}function gv(e,t){return iv(e,e.context?new Kg(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Kg(!1,!1,void 0,t))}var _v=Fs(e=>vv(iv(e,e.context?e.context.isOptional===!1?new Kg(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Kg(!0,!1)))),vv=dv(_v),yv=Ps(e=>_v(new R_([e,$g])));function bv(e,t,n){return mv(e,n,t)}function xv(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Gs(e.literal)&&!t.includes(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.includes(e.symbol)||t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Sv(e,t){let{literals:n,parameters:r}=xv(e);return new x_(n.map(e=>new g_(e,t)),r.map(e=>new b_(e,t)))}function Cv(e){return e.context?.isOptional??!1}function wv(e){return e.context?.isMutable??!1}function Tv(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Tv)}function Ev(e){function t(e){return Tv(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Uu(n)?n:void 0}function Dv(e){let t=!0;function n(e){return t=t&&!e.encoding&&!Ug(e),t&&`recur`in e&&e.recur(n),e}return`recur`in e&&e.recur(n),t}var Ov=Fs(e=>{let t=nv(e);if(t!==e){let n=Ov(t);return n===t&&e.encoding===void 0?e:iv(n,e.context)}let n=`recur`in e?e.recur(Ov):e;if(`encodingChecks`in n&&n.encodingChecks){let t=Dv(e)?n.encodingChecks:Bg(n)||Vg(n)||jg(n)&&n.typeParameters.length>0?Ev(n.encodingChecks):void 0;return tv(n,{encodingChecks:void 0,checks:E_(n.checks,t)})}return n}),kv=Fs(e=>Ov(jv(e)));function Av(e,t){let n=t,r=n.length,i=n[r-1],a=[new Wg(jv(rv(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Wg(jv(n[e-1].to),n[e].transformation.flip()));let o=jv(i.to);return o.encoding?rv(o,[...o.encoding,...a]):rv(o,a)}var jv=Ps(e=>{if(e.encoding)return Av(e,e.encoding);let t=nv(e);if(t!==e){let n=jv(t);return n===t?e:iv(n,e.context)}return`flip`in e?e.flip(jv):`recur`in e?e.recur(jv):e});function Mv(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Mv);default:return!1}}function Nv(e,t){let n=t===0?Dh:Th(t);return(r,i)=>r===B?Eh:r===t?n:Um(new Bh(e,r,i))}function Pv(e,t){return(n,r)=>n===B?Eh:t(n)?Dh:Um(new Bh(e,n,r))}var Fv=pv(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(Fv)}}),Iv=pv(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(Iv)}}),Lv=`[\\s\\S]*?`,Rv=new globalThis.RegExp(`^${m_}$`),zv=new globalThis.RegExp(`^(?:${m_}|Infinity|-Infinity|NaN)$`);function Bv(e){return $_(Rv,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Rv.source}),...e})}var Vv=cv(r_,[Bv()]),Hv=new Wg(Vv,Dg),Uv=new Wg(new R_([Vv,W_]),Dg);function Wv(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Wv(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new Ph(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Gv(e){if(!jg(e))return;let t=e.annotations?.[_h];return Ks(t)?t(e.typeParameters):void 0}var Kv=fh,qv=xh,Jv=Sh;function Yv(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function Xv(e){return e===void 0||typeof e==`string`}function Zv(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function Qv(e){return Zv(e,Yv)}var $v=new Yg([],()=>(e,t,n)=>Qv(e)?Dh:Um(new Bh(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>ry}),ey=new Wg($v,Eg()),ty=new Wg(new R_([new c_(!1,[],[$v]),new x_([],[new b_(r_,$v)])]),Eg());function ny(e){return Zv(e,Xv)}var ry=new Wg(new Yg([],()=>(e,t,n)=>ny(e)?Dh:Um(new Bh(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),Eg()),iy=(e,t,n)=>e===Dh?n(t):nh(e,n);function ay(e){if(e._tag===`Middleware`)return(t,n,r)=>oy(t===Dh?e.decode(Th(Oh(n)),r):e.decode(eh(t,Oh),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===Dh?Th(t):e;case`Transform`:{let e=e=>e===B?Eh:Th(t.transform(e));return(t,n)=>iy(t,n,e)}case`TransformOptional`:{let e=e=>kh(t.transform(Oh(e)));return(t,n)=>iy(t,n,e)}case`TransformEffect`:return(e,n,r)=>iy(e,n,e=>e===B?Eh:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>iy(e,n,e=>oy(t.transform(Oh(e),r)))}}var oy=e=>nh(e,kh),sy=(e,t,n,r)=>Xm(r,r=>Wm(()=>Om(r,r=>new Fh(e,r,t,n))));function cy(e,t){let n=ay(e.link.transformation),r;return(i,a)=>{if(i===B)return Eh;if(e.isConstructed(i))return Dh;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function ly(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==B&&r!==void 0)return t(r,i);let a=n;if(Wp(a)&&a._tag===`Success`){let e=t(a[z],i);return e===Dh?a:e}return nh(sy(e,r,i,a),e=>{let n=t(e,i);return n===Dh?Th(e):n})}}function uy(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:ly(e,n)}function dy(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?Gv(e):void 0,o=a?cy(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>ay(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);if(u&&!n.disableChecks){if(Wp(r)){if(r._tag===`Success`){let i=r===Dh?t:r[z];if(t!==B&&i!==B){let i=Wv(u,t,void 0,e,n);i&&(r=Um(new zh(e,i,t,n)))}}}else r=Jm(r,r=>{if(t!==B&&r!==B){let r=Wv(u,t,void 0,e,n);if(r)return Um(new zh(e,r,t,n))}return Vm(r)})}if(s&&!n.disableChecks){if(Wp(r)){if(r._tag===`Success`){let i=r===Dh?t:r[z];if(i===B)return r;let a=Wv(s,i,void 0,e,n);a&&(r=Um(new zh(e,a,i,n)))}}else r=Jm(r,t=>{if(t!==B){let r=Wv(s,t,void 0,e,n);if(r)return Um(new zh(e,r,t,n))}return Vm(t)})}return r},p=i===void 0?f:i(f);return c?(n,r)=>{let i=d??=c.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=c.length-1;e>=0;e--)if(o=l[e](o,a,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[z],o=t(a,r)):o=nh(o,e=>{let n=t(e,r);return n===Dh?Th(e):n})}if(o._tag===`Success`){let e=o[z],t=p(e,r);return t===Dh?o:t}return o=sy(e,n,r,o),nh(o,e=>{let t=p(e,r);return t===Dh?Th(e):t})}:p}var fy=Symbol(),py=new WeakMap,my=e=>vy(e).parser,hy=e=>vy(e).makeEffect,gy=e=>uy(e,hy),_y=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=dy(this.ast,my)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=dy(this.ast,hy,gy)}};function vy(e){let t=py.get(e);if(t!==void 0)return t;let n=new _y(e);return py.set(e,n),n}function yy(e){let t=e.ast,n;return(e,r)=>(n??=My(zy,Ov(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function by(e){let t=yy(e);return(e,n)=>{let r=$m(t(e,n));return Pm(r)?Eu(r.value):(og(r.cause,`Option adapter can only return none for schema issues`),Tu())}}function xy(e){return Ly(Ov(e.ast))}function Sy(e){return wy(e.ast)}function Cy(e){{let t=Ny(Ay(e));return e=>{let n=t(e,Gg);return Pm(n)?!0:(og(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}}function wy(e){let t=Ov(e),n=e=>(n=Cy(t),n(e));return e=>n(e)}function Ty(e,t){let n=Ay(e.ast);return t===void 0?n:(e,r)=>n(e,Oy(t,r))}function Ey(e,t){return Py(Ty(e,t))}function Dy(e,t){return Fy(Ty(e,t))}var Oy=(e,t)=>t?{...e,...t}:e,ky=e=>e===B?Um(new Vh):Vm(e);function Ay(e){return My(Ry,e)}function jy(e,t){return e===Dh?Vm(t):Wp(e)?e[z]===B?ky(B):e:nh(e,ky)}function My(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Gg);return a===Dh?Vm(r):Wp(a)?a[z]===B?ky(B):a:nh(a,ky)}}function Ny(e){return(t,n)=>$m(e(t,n))}function Py(e){let t=Ny(e);return(e,n)=>{let r=t(e,n);return Pm(r)?Eu(r.value):(og(r.cause,`Option adapter can only return none for schema issues`),Tu())}}function Fy(e){let t=Ny(e);return(e,n)=>{let r=t(e,n);return Pm(r)?Fu(r.value):Iu(og(r.cause,`Result adapter can only return schema issues`))}}function Iy(e,t){let n=$m(e);if(Pm(n))return n.value;let r=og(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function Ly(e){let t,n;return(r,i)=>{t??=vy(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??Gg,o=t.make;if(o!==void 0&&r!==B){let e;try{e=o(r,a)}catch(e){throw og(Dm(e),`Constructor adapter can only throw schema issues`),e}if(e!==fy&&e!==B)return e}return Iy(jy((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var Ry=e=>vy(e).parser,zy=e=>vy(e).makeEffect,By=`~effect/Schema/Schema`,Vy=Symbol(),Hy={[By]:By,get make(){let e=xy(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=yy(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=by(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return ws(this,arguments)},annotate(e){return this.rebuild(ov(this.ast,e))},annotateKey(e){return this.rebuild(gv(this.ast,e))},check(...e){return this.rebuild(cv(this.ast,e))},rebuild(e){return Uy(e,this[Vy])}};function Uy(e,t){function n(){}let r=Object.setPrototypeOf(n,Hy);return t&&(Object.hasOwn(t,`name`)||Object.hasOwn(t,`length`)||Object.hasOwn(t,`__proto__`))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r[Vy]=t,r.ast=e,r}function Wy(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Gy(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Ky(e){return encodeURI(Wy(e)).replace(/#/g,`%23`)}function qy(e){if(e.length===0||e===`#`)return``;if(!e.startsWith(`#`))return;let t=e.slice(1);try{if(encodeURI(t).replace(/%25/g,`%`).replace(/#/g,`%23`)!==t)return;let e=decodeURIComponent(t);return e.startsWith(`/`)&&!/~(?:[^01]|$)/.test(e)?e:void 0}catch{return}}function Jy(e,t){return n(e,!1,!0);function n(e,r,i=!1){if(!Xs(e))return e;let a=r||!i&&Qy(e.$id),o={};for(let t of Object.keys(e)){let r=e[t],i=r;switch(t){case`$defs`:case`properties`:case`patternProperties`:case`dependentSchemas`:i=Zy(r,e=>n(e,a))??r;break;case`allOf`:case`anyOf`:case`oneOf`:case`prefixItems`:i=Array.isArray(r)?r.map(e=>n(e,a)):r;break;case`not`:case`additionalProperties`:case`propertyNames`:case`unevaluatedProperties`:case`items`:case`contains`:case`unevaluatedItems`:case`if`:case`then`:case`else`:case`contentSchema`:i=n(r,a)}Pc(o,t,i)}return t(o,a),o}}function Yy(e,t){return Jy(e,e=>{Xy(e,t)})}function Xy(e,t){typeof e.$ref==`string`&&Pc(e,`$ref`,t(e.$ref,`$ref`)),typeof e.$dynamicRef==`string`&&Pc(e,`$dynamicRef`,t(e.$dynamicRef,`$dynamicRef`))}function Zy(e,t){if(!Xs(e))return;let n={};for(let r of Object.keys(e))Pc(n,r,t(e[r],r));return n}function Qy(e){return typeof e==`string`&&e.length>0&&e[0]!==`#`}var $y=[`$anchor`,`$defs`,`$dynamicAnchor`,`$dynamicRef`,`$vocabulary`,`contentSchema`,`dependentRequired`,`dependentSchemas`,`maxContains`,`minContains`,`prefixItems`,`unevaluatedItems`,`unevaluatedProperties`];[...$y],[...$y];var eb=pv(e=>{let t=ab(e,eb),n=e.context;return t===e||n===void 0?t:fv(t,tb(n))});function tb(e){return e.constructorDefault===void 0?e:new Kg(e.isOptional,e.isMutable,void 0,e.annotations)}function nb(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function rb(e){return t=>{let n=[...t].sort((t,n)=>e(kv(t))-e(kv(n)));return n.some((e,n)=>e!==t[n])?n:t}}var ib=rb(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function ab(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Ks(n))return rv(e,[ey]);let r=n(e.typeParameters.map(e=>Uy(kv(e))));return r===void 0?e:rv(e,[lv(r,t)])}case`Unknown`:return rv(e,[ey]);case`ObjectKeyword`:return rv(e,[ty]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return nb(e),e.recur(t,Iv);case`Union`:{let n=ib(e.types);return n===e.types?e.recur(t):new R_(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t)}case`Arrays`:case`Suspend`:return e.recur(t)}return e}globalThis.RegExp;var ob=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,`\\$&`);function sb(e,t){return t.length>0&&(e+=`\n at ${Gc(t)}`),Error(e)}function cb(e){return`#/$defs/${Ky(e)}`}var lb=new Set([...wh,hh,...vh]);function ub(e,t){if(e===void 0)return;let n={},r=e.title;typeof r==`string`&&(n.title=r);let i=e.description,a=e.expected;typeof i==`string`?n.description=i:t?.generateDescriptions===!0&&typeof a==`string`&&(n.description=a);let o=e.default;Qv(o)&&(n.default=o);let s=e.examples;Array.isArray(s)&&Qv(s)&&(n.examples=s);let c=e.readOnly;typeof c==`boolean`&&(n.readOnly=c);let l=e.writeOnly;typeof l==`boolean`&&(n.writeOnly=l);let u=e.format;typeof u==`string`&&(n.format=u);let d=e.contentEncoding;typeof d==`string`&&(n.contentEncoding=d);let f=e.contentMediaType;typeof f==`string`&&(n.contentMediaType=f);let p=e.contentSchema;if(Qv(p)&&(n.contentSchema=p),t?.includeAnnotationKey!==void 0)for(let[r,i]of Object.entries(e))lb.has(r)||!t.includeAnnotationKey(r)||Qv(i)&&Pc(n,r,i);return Object.keys(n).length===0?void 0:n}function db(e){let t=e.type===`number`||e.type===`integer`?e.type:void 0,n=e;if(t!==void 0&&(n={...e},delete n.type),Array.isArray(n.allOf)){let e=[],r=!1;for(let i of n.allOf){let n=db(i);n.type!==void 0&&(r=!0,(t===void 0||n.type===`integer`)&&(t=n.type)),Object.keys(n.schema).length>0&&e.push(n.schema)}if(r){let{allOf:t,...r}=n;n=e.length===0?r:{...r,allOf:e}}}return{type:t,schema:n}}function fb(e){if(!Array.isArray(e.anyOf)||e.anyOf.length!==2||e.anyOf[0]?.type!==`number`)return!1;let t=e.anyOf[1];return t?.type===`string`&&Array.isArray(t.enum)&&t.enum.length===3&&t.enum.includes(`NaN`)&&t.enum.includes(`Infinity`)&&t.enum.includes(`-Infinity`)}var pb=`|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|`;function mb(e,t){return Object.keys(e).every(e=>t.includes(`|${e}|`))}function hb(e,t){return typeof e.$ref!=`string`&&t.every(t=>!Object.hasOwn(e,t))}var gb=`|title|description|default|examples|readOnly|writeOnly|`,_b=pb+gb;function vb(e,t,n){if(Object.keys(e).length===0)return t;let r=Object.keys(t);if(r.length===0)return e;let i=e.type===`number`||e.type===`integer`?e.type:void 0,a=fb(e);if(i!==void 0||a){let r=db(t);if(r.type!==void 0){let t=i===`integer`||r.type===`integer`?`integer`:`number`,o={...e,type:t};a&&delete o.anyOf;let s=Object.keys(r.schema);return s.length===0?o:mb(r.schema,gb)&&hb(o,s)?{...o,...r.schema}:vb(o,r.schema,n)}}if(n&&hb(e,r))return{...e,...t};let o=Array.isArray(t.allOf)&&r.length===1?t.allOf:[t];return Array.isArray(e.allOf)?{...e,allOf:[...e.allOf,...o]}:typeof e.$ref==`string`?{allOf:[e,...o]}:{...e,allOf:o}}function yb(e,t=new Set){return typeof e==`boolean`?e:t.has(e)?!0:(t.add(e),e.every(e=>yb(e,t)))}function bb(e){return Array.isArray(e)}function xb(e,t,n,r){let i=new Map,a=new Map,o=new WeakMap,s=new Map,c=new Map,l=Object.keys(n);for(let e of l)m(e,[`references`,e]);let u=Ku(e,(e,n)=>v(e,t[n],[]));for(let[e,t]of s.values())if(!yb(e))for(let e of t)Array.isArray(e.oneOf)&&(e.anyOf=e.oneOf,delete e.oneOf);for(let e of l){let t=n[e],r=g(t);if(r===void 0)continue;let o=i.get(e)[0],s=c.get(r),l=s?.find(e=>vc(i.get(e)[0],o));l===void 0?s===void 0?c.set(r,[e]):s.push(e):a.set(e,l)}let d=Ku(u,h),f={};for(let e of l)a.has(e)||Pc(f,e,h(i.get(e)[0]));return{dialect:`draft-2020-12`,schemas:d,definitions:f};function p(e){return Array.isArray(e.oneOf)&&s.get(e.oneOf)?.[1].push(e),e}function m(e,t){if(!Object.hasOwn(n,e))throw sb(`Invalid reference ${e}`,[...t,`$ref`]);let r=i.get(e);if(r!==void 0)return r;let a=[{},[]];return i.set(e,a),a[0]=v(n[e],[`references`,e],a[1]),a}function h(e){return Yy(e,e=>{let t=qy(e);if(t===void 0){if(/^#(?:\/|%2f)/i.test(e))throw Error(`Invalid JSON Pointer URI fragment ${JSON.stringify(e)}`);return e}if(!t.startsWith(`/$defs/`))return e;let n=t.indexOf(`/`,7),r=a.get(Gy(t.slice(7,n<0?void 0:n)));return r===void 0?e:e.replace(/^#(?:\/|%2f).*?(?:\/|%2f).*?(?=\/|%2f|$)/i,cb(r))})}function g(e){if(e._tag===`Reference`)return;let t=e.checks.length===0?e.annotations:e.checks[e.checks.length-1].annotations;return typeof t?.identifier!=`string`&&typeof t?.[`~identifier`]==`string`?t[hh]:void 0}function _(e,t,n,i){let a=e.annotations,o=a?.toJsonSchema;if(o!==void 0){let s=o({type:t,schemas:e.representation?.schemas?.map((e,t)=>v(e,[...n,`representation`,`schemas`,t],i))??[]}),c=bb(s);c&&i.push(!1);let l=c?s[0]:s,u=ub(a,r),d=u===void 0?l:{...l,...u},f=u===void 0?pb:_b;return[d,e._tag===`Filter`&&mb(d,f)&&(u===void 0||mb(u,gb))?!0:void 0]}if(e._tag===`Filter`){i.push(!1);return}let s=e.checks.flatMap((e,r)=>{let a=_(e,t,[...n,`checks`,r],i);return a===void 0?[]:[a[0]]});if(s.length===0)return;let c=ub(a,r),l={allOf:s};return[c===void 0?l:{...l,...c}]}function v(e,t,n){if(e._tag===`Reference`)return n.push(m(e.$ref,t)[1]),{$ref:cb(e.$ref)};let i=o.get(e);if(i!==void 0)return n.push(i[1]),i[0];let a=[];n.push(a);let s=y(e,t,a),c=ub(e.annotations,r);c!==void 0&&(s={...s,...c});for(let n=0;n<e.checks.length;n++){let r=typeof s.type==`string`&&Sb(s.type)?s.type:void 0,i=_(e.checks[n],r,[...t,`checks`,n],a);i!==void 0&&(s=vb(s,...i))}return o.set(e,[s,a]),p(s)}function y(e,t,n){switch(e._tag){case`Any`:case`Unknown`:return{};case`ObjectKeyword`:return{anyOf:[{type:`object`},{type:`array`}]};case`Void`:case`Undefined`:case`Null`:return{type:`null`};case`BigInt`:return{type:`string`,allOf:[{pattern:`^-?\\d+$`}]};case`Symbol`:return{type:`string`,allOf:[{pattern:`^Symbol\\(([\\s\\S]*)\\)$`}]};case`UniqueSymbol`:return globalThis.Symbol.keyFor(e.symbol)===void 0?{not:{}}:{type:`string`,enum:[globalThis.String(e.symbol)]};case`Declaration`:return n.push(!1),{};case`Suspend`:return v(e.thunk,[...t,`thunk`],n);case`Never`:return{not:{}};case`String`:return{type:`string`};case`Number`:return{anyOf:[{type:`number`},{type:`string`,enum:[`NaN`,`Infinity`,`-Infinity`]}]};case`Boolean`:return{type:`boolean`};case`Literal`:{let t=e.literal;return typeof t==`bigint`?{type:`string`,enum:[globalThis.String(t)]}:{type:typeof t,enum:[t]}}case`Enum`:{let n=e.enums.map(([e,n],r)=>{if(typeof n==`number`&&!globalThis.Number.isFinite(n))throw sb(`Invalid numeric enum value ${globalThis.String(n)}`,[...t,`enums`,r,1]);return{type:typeof n,enum:[n],title:e}});return n.length===0?{not:{}}:{anyOf:n}}case`TemplateLiteral`:return{type:`string`,pattern:`^${e.parts.map(wb).join(``)}$`};case`Arrays`:{if(e.rest.length>1)throw sb(`Invalid schema representation document`,[...t,`rest`]);let i={type:`array`},a=e.elements.length,o=e.elements.map((e,i)=>{e.isOptional&&a--;let o=v(e.type,[...t,`elements`,i,`type`],n),s=ub(e.annotations,r);return s===void 0?o:p(vb(o,s))});if(o.length>0?(i.prefixItems=o,i.maxItems=e.elements.length,a>0&&(i.minItems=a)):i.items=!1,e.rest.length===1){delete i.maxItems;let r=v(e.rest[0],[...t,`rest`,0],n);Object.keys(r).length>0?i.items=r:delete i.items}return i}case`Objects`:{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return{not:{type:`null`}};let i={type:`object`},a={},o=[];for(let i=0;i<e.propertySignatures.length;i++){let s=e.propertySignatures[i];if(typeof s.name!=`string`)throw sb(`Invalid schema representation document`,[...t,`propertySignatures`,i,`name`]);let c=s.name,l=v(s.type,[...t,`propertySignatures`,i,`type`],n),u=ub(s.annotations,r);Pc(a,c,u===void 0?l:p(vb(l,u))),s.isOptional||o.push(c)}e.propertySignatures.length>0&&(i.properties=a),o.length>0&&(i.required=o);let s={},c=[],l=[],u=!1;for(let r=0;r<e.indexSignatures.length;r++){let i=e.indexSignatures[r],a=v(i.type,[...t,`indexSignatures`,r,`type`],n);vc(a,{not:{}})&&(a=!1),l.push(a);let o=b(i.parameter,[...t,`indexSignatures`,r,`parameter`],new Set);if(o===void 0){u=!0,n.push(!1);continue}if(o.length===0)c.push(a);else for(let e of o){let t=s[e];Pc(s,e,t===void 0?a:t===!1||a===!1?!1:p(vb(t,a)))}}let d=Object.keys(s).length>0;if(d&&(i.patternProperties=s),u&&r?.onExcessProperty===`error`){let r=[];e.propertySignatures.length>0&&r.push({enum:Object.keys(a)});for(let i=0;i<e.indexSignatures.length;i++)r.push(v(e.indexSignatures[i].parameter,[...t,`indexSignatures`,i,`parameter`],n));i.propertyNames=r.length===1?r[0]:{anyOf:r},i.additionalProperties=l.length===1?l[0]:{anyOf:l},c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})))}else c.length===0?i.additionalProperties=u||r?.onExcessProperty!==`error`:c.length===1&&e.propertySignatures.length===0&&!d?i.additionalProperties=c[0]:c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})));return typeof i.additionalProperties==`object`&&i.additionalProperties!==null&&Object.keys(i.additionalProperties).length===0&&delete i.additionalProperties,i}case`Union`:{let r=[],i=e.types.map((e,n)=>v(e,[...t,`types`,n],r));if(n.push(r),i.length===0)return{not:{}};let a=e.options?.mode??`anyOf`;if(a===`anyOf`&&i.length>1){let e=Cb(i);if(e!==void 0)return e}return a===`oneOf`&&s.set(i,[r,[]]),{[a]:i}}}}function b(e,t,r){switch(e._tag){case`Reference`:{if(!Object.hasOwn(n,e.$ref))throw sb(`Invalid reference ${e.$ref}`,[...t,`$ref`]);if(m(e.$ref,t),r.has(e.$ref))return;let i=new Set(r).add(e.$ref);return b(n[e.$ref],[`references`,e.$ref],i)}case`String`:{if(e.checks.length===0)return[];if(e.checks.length!==1||e.checks[0]._tag!==`Filter`||e.checks[0].annotations?.toJsonSchema===void 0)return;let n=[],r=v(e,t,n);return yb(n)&&r.type===`string`&&typeof r.pattern==`string`&&mb(r,`|type|pattern|title|description|default|examples|readOnly|writeOnly|`)?[r.pattern]:void 0}case`TemplateLiteral`:return e.checks.length===0?[`^${e.parts.map(wb).join(``)}$`]:void 0;case`Union`:{if(e.types.length===0||e.checks.length>0||e.options?.mode===`oneOf`)return;let n=[];for(let i=0;i<e.types.length;i++){let a=b(e.types[i],[...t,`types`,i],r);if(a===void 0)return;if(a.length===0)return[];n.push(...a)}return n}default:throw sb(`Invalid schema representation document`,t)}}}function Sb(e){return e===`string`||e===`number`||e===`boolean`||e===`array`||e===`object`||e===`null`||e===`integer`}function Cb(e){let t,n=[];for(let r of e){if(Object.keys(r).length!==2||r.type===void 0||!Array.isArray(r.enum)||r.enum.length===0)return;if(t===void 0)t=r.type;else if(r.type!==t)return;for(let e of r.enum){if(n.includes(e))return;n.push(e)}}return{type:t,enum:n}}function wb(e){switch(e._tag){case`Literal`:return ob(globalThis.String(e.literal));case`String`:return Lv;case`Number`:return m_;case`TemplateLiteral`:return e.parts.map(wb).join(``);case`Union`:return`(?:${e.types.map(wb).join(`|`)})`;default:throw sb(`Invalid schema representation document`,[])}}function Tb(e,t){let n=xb([e.representation],[[`representation`]],e.references,t);return{dialect:n.dialect,schema:n.schemas[0],definitions:n.definitions}}var Eb=({identifier:e})=>e;function Db(e){return e===void 0?void 0:{annotations:e}}function Ob(e,t){let{references:n,representations:r}=kb([e],t);return{representation:r[0],references:n}}function kb(e,t){let n={},r=new Map,i=new Set,a=new Map,o=new Set;for(let t of e)f(t);let s=t?.referencePolicy??Eb;for(let e of a.values())for(let t of e.values()){let e=s({ast:t.ast,occurrences:t.occurrences,identifier:t.identifier});e===void 0?t.isRecursive&&(t.reference=c(`${t.ast._tag}_`,t,``)):t.reference=c(e,t,e===t.identifier||!e.endsWith(`_`)?`_`:``)}return{representations:Ku(e,e=>m(e)),references:n};function c(e,t,n=`_`){let i=e,a=0;for(;r.has(i);){if(r.get(i)===t)return i;i=`${e}${n}${++a}`}return r.set(i,t),i}function l(e,t,n){let r=t.fallback;return r===void 0?n===t.identifier?e:ov(e,{identifier:n}):bh(e)===r?e:ov(e,{[hh]:r})}function u(e,t){if(!Object.hasOwn(n,e)&&!i.has(e)){i.add(e);let r=h(t);i.delete(e),Pc(n,e,r)}return{_tag:`Reference`,$ref:e}}function d(e){let t=av(e),n=nv(t),r=yh(t),i=r===void 0?(t===e?void 0:yh(e))??bh(t):void 0;i!==void 0&&(r=`${i}Encoded`);let o=a.get(n);o===void 0&&(o=new Map,a.set(n,o));let s=o.get(r);return s===void 0&&(s={ast:n,identifier:r,fallback:i,occurrences:0,isRecursive:!1,reference:void 0},o.set(r,s)),s}function f(e){let t=d(e),n=t.ast;if(t.occurrences++,o.has(t)){t.isRecursive=!0;return}if(!(t.occurrences>1)){switch(o.add(t),p(n.checks),n._tag){case`Declaration`:case`Arrays`:case`Objects`:case`Union`:n.recur(e=>(f(e),e));break;case`TemplateLiteral`:n.parts.forEach(f);break;case`Suspend`:f(n.thunk())}o.delete(t)}}function p(e){e?.forEach(e=>{e.annotations?.representation?.schemas?.forEach(e=>f(Ov(e))),e._tag===`FilterGroup`&&p(e.checks)})}function m(e){let t=d(e),n=t.ast,r=t.reference;return r===void 0?h(n):u(r,t.identifier===void 0?n:l(n,t,r))}function h(e){let t=g(e.checks);switch(e._tag){case`Declaration`:return{_tag:`Declaration`,typeParameters:e.typeParameters.map(e=>m(e)),checks:t,...v(e.annotations)};case`Null`:case`Undefined`:case`Void`:case`Never`:case`Unknown`:case`Any`:case`String`:case`Boolean`:case`Number`:case`BigInt`:case`Symbol`:case`ObjectKeyword`:return{_tag:e._tag,checks:t,...Db(e.annotations)};case`Literal`:return{_tag:`Literal`,literal:e.literal,checks:t,...Db(e.annotations)};case`UniqueSymbol`:return{_tag:`UniqueSymbol`,symbol:e.symbol,checks:t,...Db(e.annotations)};case`Enum`:return{_tag:`Enum`,enums:e.enums,checks:t,...Db(e.annotations)};case`TemplateLiteral`:return{_tag:`TemplateLiteral`,parts:e.parts.map(e=>m(e)),checks:t,...Db(e.annotations)};case`Arrays`:return{_tag:`Arrays`,elements:e.elements.map(e=>{let t=av(e),n=t.context?.annotations;return{isOptional:Cv(t),type:m(e),...Db(n)}}),rest:e.rest.map(e=>m(e)),checks:t,...Db(e.annotations)};case`Objects`:return{_tag:`Objects`,propertySignatures:e.propertySignatures.map(e=>{let t=av(e.type),n=t.context?.annotations;return{name:e.name,type:m(e.type),isOptional:Cv(t),isMutable:wv(t),...Db(n)}}),indexSignatures:e.indexSignatures.map(e=>({parameter:m(e.parameter),type:m(e.type)})),checks:t,...Db(e.annotations)};case`Union`:return{_tag:`Union`,types:e.types.map(e=>m(e)),...e.options===void 0?{}:{options:e.options},checks:t,...Db(e.annotations)};case`Suspend`:return{_tag:`Suspend`,checks:[],thunk:m(e.thunk()),...Db(e.annotations)}}}function g(e){return e?.map(_)??[]}function _(e){switch(e._tag){case`Filter`:return{_tag:`Filter`,aborted:e.aborted,...y(e.annotations)};case`FilterGroup`:return{_tag:`FilterGroup`,checks:Ku(e.checks,_),...y(e.annotations)}}}function v(e){if(e===void 0)return;let{representation:t,...n}=e;return{...t===void 0?void 0:{representation:t},...Object.keys(n).length===0?void 0:{annotations:n}}}function y(e){if(e===void 0)return;let{representation:t,...n}=e,r=t===void 0?void 0:t.schemas===void 0?t:{...t,schemas:t.schemas.map(e=>m(Ov(e)))};return{...r===void 0?void 0:{representation:r},...Object.keys(n).length===0?void 0:{annotations:n}}}}function Ab(e){return Pm(e)?e.value:{issues:[{message:km(e.cause)}]}}function jb(e,t){let n=Ty(e),r={errors:`all`,...t?.parseOptions},i=Yh(t),a=e=>{let t=new Ef(`sync`),a=Qm(Zm(n(e,r),{onFailure:i,onSuccess:e=>({value:e})}),{scheduler:t});a.currentDispatcher?.flush();let o=a.pollUnsafe();return o?Ab(o):new Promise(e=>{a.addObserver(t=>{e(Ab(t))})})};if(Object.hasOwn(e,`~standard`)){let t=e;return`validate`in t[`~standard`]||Object.assign(t[`~standard`],{validate:a}),t}return Object.assign(e,{"~standard":{version:1,vendor:`effect`,validate:a}})}var Mb=e=>e,Nb=`~effect/Schema/SchemaError`;function Pb(e){return Qs(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}function Fb(){return(e,t,n)=>Yb(new Yg(e.map(O_),e=>t(e.map(e=>Yb(e))),n))}function Ib(e,t){return Fb()([],()=>(t,n,r)=>e(t)?Vm(t):Um(new Bh(n,t,r)),t)}var Lb=class extends Af(`SchemaError`){[Nb]=Nb;constructor(e){let t=nl();rl(0);try{super({issue:e})}finally{rl(t)}}get message(){return ng(this.issue)}toString(){return`SchemaError(${this.message})`}};function Rb(e){return Pb(e)}function zb(e){return Wp(e)?Bb(e):Xm(e,e=>Wm(()=>Om(e,e=>new Lb(e))))}function Bb(e){return Pm(e)?e:jm(Om(e.cause,e=>new Lb(e)))}function Vb(e,t){let n;for(let r of e.reasons){if(!Em(r)||!Rb(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function Hb(e){let t=$m(e);if(Pm(t))return t.value;throw Vb(t.cause,`Sync adapter can only throw schema errors`)}function Ub(e,t){return jb(e,t)}var Wb=Sy;function Gb(e,t){let n=Ty(e,t);return(e,t)=>zb(n(e,t))}var Kb=Ey;function qb(e,t){let n=Dy(e,t);return(e,t)=>zu(n(e,t),e=>new Lb(e))}function Jb(e,t){let n=Gb(e,t);return(e,t)=>Hb(n(e,t))}var Yb=Uy,Xb=Mb(e=>Yb(_v(e.ast),{schema:e})),V=Mb(e=>{let t=ox(e);return Yb(yv(e.ast),{schema:t})});function H(e){let t=Yb(new t_(e),{literal:e,transform(n){return t.pipe(cx(H(n),{decode:ug(()=>n),encode:ug(()=>e)}))}});return t}var U=Yb(e_),Zb=Yb(Xg),Qb=Yb($g),$b=Yb(r_),ex=Yb(o_),W=Yb(s_);function tx(e,t){return Yb(e,{fields:t,mapFields(e,t){let n=e(this.fields);return tx(D_(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function G(e){return tx(D_(e,void 0),e)}function nx(e,t){return Yb(Sv(e.ast,t.ast),{key:e,value:t})}var K=Mb(e=>Yb(new c_(!1,[],[e.ast]),{value:e}));function rx(e,t){return Yb(e,{members:t,mapMembers(e,t){let n=e(this.members);return rx(k_(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function ix(e,t){return rx(k_(e,t,void 0),e)}function q(e){let t=e.map(H);return Yb(k_(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return ix(e(this.members))},pick(e){return q(e)},transform(e){return ix(t.map((t,n)=>t.transform(e[n])))}})}var ax=Mb(e=>ix([e,Zb])),ox=Mb(e=>ix([e,Qb]));function J(...e){return t=>t.check(...e)}function sx(e){return t=>Yb(t.ast,{schema:t,identifier:e})}function cx(e,t){return n=>Yb(bv(n.ast,e.ast,t?Cg(t):Eg()),{from:n,to:e})}function lx(e,t){return Ib(t=>t instanceof e,t)}function ux(){return(e,t)=>new Wg(e.ast,Cg(t))}var dx=Y_,fx=`^\\S[\\s\\S]*\\S$|^\\S$|^$`;function px(e){let t=new globalThis.RegExp(fx);return dx(e=>e.trim()===e,{expected:`a string with no leading or trailing whitespace`,representation:{id:`effect/schema/isTrimmed`,payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:`Schema.isTrimmed()`}),arbitraryConstraint:{patterns:[{source:fx,flags:``}]},...e})}function mx(e,t){let n=e.source,r=e.flags,i=/^[dg]*uy?$/.test(r),a=r===``?`new RegExp(${R(n)})`:`new RegExp(${R(n)}, ${R(r)})`;return $_(e,{toJsonSchema:()=>i?{pattern:r.endsWith(`y`)?`^(?:${n})`:n}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${a})`}),...t})}var hx=Yb(Z_);function gx(e){let t=Su(e.order),n=e.formatter??R;return(r,i)=>dx(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r,exclusiveMinimum:!0},...e.annotate?.(r),...i})}function _x(e){let t=wu(e.order),n=e.formatter??R;return(r,i)=>dx(e=>t(e,r),{expected:`a value greater than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r},...e.annotate?.(r),...i})}function vx(e){let t=Cu(e.order),n=e.formatter??R;return(r,i)=>dx(e=>t(e,r),{expected:`a value less than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,maximum:r},...e.annotate?.(r),...i})}function yx(e){let t=wu(e.order),n=Su(e.order),r=Cu(e.order),i=xu(e.order),a=e.formatter??R;return(o,s)=>{let c=o.exclusiveMinimum?n:t,l=o.exclusiveMaximum?i:r;return dx(e=>c(e,o.minimum)&&l(e,o.maximum),{expected:`a value between ${a(o.minimum)}${o.exclusiveMinimum?` (excluded)`:``} and ${a(o.maximum)}${o.exclusiveMaximum?` (excluded)`:``}`,arbitraryConstraint:{order:e.order,minimum:o.minimum,maximum:o.maximum,...o.exclusiveMinimum&&{exclusiveMinimum:!0},...o.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(o),...s})}}function bx(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${R(e)}`);return e}var xx=gx({order:bu,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:bx(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${R(e)})`})})}),Sx=_x({order:bu,annotate:e=>({representation:{id:`effect/schema/isGreaterThanOrEqualTo`,payload:{minimum:bx(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${R(e)})`})})}),Cx=vx({order:bu,annotate:e=>({representation:{id:`effect/schema/isLessThanOrEqualTo`,payload:{maximum:bx(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${R(e)})`})})}),wx=yx({order:bu,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:`effect/schema/isBetween`,payload:{minimum:bx(e.minimum),maximum:bx(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?`exclusiveMinimum`:`minimum`]:e.minimum,[n?`exclusiveMaximum`:`maximum`]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${R(e.minimum)}, maximum: ${R(e.maximum)}, exclusiveMinimum: ${R(t)}, exclusiveMaximum: ${R(n)} })`})}}});function Tx(e){return dx(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>[{type:`integer`},!0],toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}var Ex=ex.check(Tx());function Dx(e,t){return e=jx(e),Ox(e,Math.ceil(e/2),t)}function Ox(e,t,n){return dx(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:n})=>n===`string`?e<=1?{minLength:t}:[{minLength:t},!0]:n===`array`?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[mh]:!0,arbitraryConstraint:{minLength:e},...n})}function kx(e){return Ox(1,1,e)}function Ax(e,t){return e=jx(e),dx(t=>t.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:`effect/schema/isMaxLength`,payload:{maxLength:e}},toJsonSchema:({type:t})=>t===`string`?e===0?{maxLength:e}:[{maxLength:e},!0]:t===`array`?{maxItems:e}:t===void 0?[{maxLength:e,maxItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[mh]:!0,arbitraryConstraint:{maxLength:e},...t})}function jx(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}var Mx=$b.check(kx());globalThis.RegExp,globalThis.URL;var Nx=$b.annotate({expected:`a string that will be decoded as JSON`,contentMediaType:`application/json`});function Px(e,t){return Nx.pipe(cx(e,kg(t)))}globalThis.File,globalThis.FormData,globalThis.URLSearchParams;var Fx=$b.check(px()),Ix=$b.annotate({expected:`a string that will be decoded as a trimmed string`}).pipe(cx(Fx,wg())),Lx=$b.annotate({expected:`a base64 encoded string that will be decoded as Uint8Array`,format:`byte`,contentEncoding:`base64`}),Rx=lx(globalThis.Uint8Array,{representation:{id:`effect/schema/Uint8Array`,payload:null},toCode:()=>({runtime:`Schema.Uint8Array`,Type:`globalThis.Uint8Array`}),expected:`Uint8Array`,toCodecJson:()=>ux()(Lx,Og)});function zx(e,t){return Tb(Ob(eb(e.ast),t),t)}var Bx=$b.pipe(J(Dx(1)),J(Ax(80))),Vx=[`InferenceUpstreamError`,`AiInternalError`,`TypeError`,`AbortError`,`TimeoutError`,`Error`],Hx={minimum:0,maximum:99999},Ux={minimum:0,maximum:599},Wx=ix([G({category:q(Vx),code:ax(Ex.check(wx(Hx))),reason:Xb(H(`credits_exhausted`))}),G({category:H(`result_download`),status:Ex.check(wx(Ux))})]);co([ao({category:yo(Vx),code:Ua().int().min(Hx.minimum).max(Hx.maximum).nullable(),reason:N(`credits_exhausted`).optional()}),ao({category:N(`result_download`),status:Ua().int().min(Ux.minimum).max(Ux.maximum)})]);var Gx=[`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`COMMAND_NOT_DECLARED`,`CONFLICT`,`DELIVERY_PENDING`,`DISCONNECTED`,`FILE_TOO_LARGE`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`MEDIA_PROVIDER_FAILURE`,`MEDIA_PROVIDER_FAILURE_UNCHARGED`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`SELECTION_CHANGED`,`SETUP_REQUIRED`,`TIMEOUT`],Kx=G({name:H(`AppError`),code:q(Gx),retryable:W,need:V($b)}),Y=class extends Error{code;retryable;need;constructor(e,t){super(e,{cause:t.cause}),this.name=`AppError`,this.code=t.code,this.retryable=t.retryable,this.need=t.need}};function qx(e){return Nu(Kb(Bx)(e))}function Jx(e){return`This needs ${e??`setup`} first.`}var Yx={CANCELLED:{title:`Request cancelled`,message:`It stopped before it finished. Start it again if you still want it.`},CAPABILITY_DENIED:{title:`Access needed`,message:`This App needs permission to do that.`,action:`grant`},CAPABILITY_REVOKED:{title:`Access changed`,message:`This App no longer has permission to do that.`,action:`grant`},COMMAND_NOT_DECLARED:{title:`Action unavailable`,message:`This App doesn't include that action. It may need an update.`},CONFLICT:{title:`File changed`,message:`This file changed elsewhere. Review it before saving again.`},DELIVERY_PENDING:{title:`App delivery pending`,message:`The App hasn't finished getting ready. Try opening it again.`},DISCONNECTED:{title:`Connection lost`,message:`Reopen the App to connect again.`,action:`reconnect`},HOST_FAILURE:{title:`Couldn't complete the request`,message:`The host stopped answering. Reopen the App or reload the workspace.`},FILE_TOO_LARGE:{title:`File too large`,message:`Choose a file within the supported size limit.`},IDENTITY:{title:`Couldn't connect`,message:`Reopen the App to connect again.`,action:`reconnect`},INSUFFICIENT_CREDIT:{title:`Something went wrong`,message:`The App couldn't complete this request.`,action:`billing`},INVALID_ARGUMENT:{title:`Request not accepted`,message:`Some of the details weren't usable. Check them and try again.`},MEDIA_PROVIDER_FAILURE:{title:`Generation failed`,message:`The model couldn't complete this generation. Change the prompt or model and send again.`},MEDIA_PROVIDER_FAILURE_UNCHARGED:{title:`Generation failed`,message:`The model couldn't complete this generation. You weren't charged. Change the prompt or model and send again.`},PROTOCOL:{title:`Couldn't read the response`,message:`The host sent something this App doesn't understand. Reload the workspace; if it keeps happening, the App may need an update.`},SAFETY_FILTER_REFUSED:{title:`Generation refused`,message:`The model refused this generation. Change the prompt or reference image and send again.`},SELECTION_CHANGED:{title:`Selection changed`,message:`The selection changed during this request. Reopen the App to continue.`,action:`reconnect`},SETUP_REQUIRED:{title:`Setup needed`,message:Jx(void 0),action:`setup`},TIMEOUT:{title:`Still waiting`,message:`The request didn't respond in time. Its outcome isn't known yet.`},UNKNOWN:{title:`Something went wrong`,message:`The App couldn't complete this request.`}};function Xx(e,t){let n=Kb(Kx)(e);if(Du(n))return{...Yx.UNKNOWN,retryable:!1};let r=n.value,i=Yx[r.code],a=t?.[r.code]??(r.code===`SETUP_REQUIRED`?{title:i.title,message:Jx(qx(r.need))}:i),o=i.action??(r.retryable?`retry`:void 0),s={title:a.title,message:a.message,retryable:r.retryable};return o?{...s,action:o}:s}var Zx=t((e=>{var t=i(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),a=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var i,c={},l=null,u=null;for(i in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)a.call(t,i)&&!s.hasOwnProperty(i)&&(c[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)c[i]===void 0&&(c[i]=t[i]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:o.current}}e.Fragment=r,e.jsx=c,e.jsxs=c})),Qx=t(((e,t)=>{t.exports=Zx()})),X=Qx(),$x=P.createContext(void 0),eS=e=>{let t=P.useContext($x);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},tS=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)($x.Provider,{value:e,children:t})),nS={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},rS=new class{#e=nS;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function iS(e){setTimeout(e,0)}var aS=typeof window>`u`||`Deno`in globalThis;function oS(){}function sS(e,t){return typeof e==`function`?e(t):e}function cS(e){return typeof e==`number`&&e>=0&&e!==1/0}function lS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uS(e,t){return typeof e==`function`?e(t):e}function dS(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==pS(o,t.options))return!1}else if(!hS(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function fS(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(mS(t.options.mutationKey)!==mS(a))return!1}else if(!hS(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function pS(e,t){return(t?.queryKeyHashFn||mS)(e)}function mS(e){return JSON.stringify(e,(e,t)=>bS(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function hS(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!hS(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!hS(e[r],t[r]))return!1;return!0}return!1}var gS=Object.prototype.hasOwnProperty;function _S(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=yS(e)&&yS(t);if(!r&&!(bS(e)&&bS(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:gS.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=_S(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function vS(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function yS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bS(e){if(!xS(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!xS(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function xS(e){return Object.prototype.toString.call(e)===`[object Object]`}function SS(e){return new Promise(t=>{rS.setTimeout(t,e)})}function CS(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:_S(e,t)}function wS(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function TS(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ES=Symbol();function DS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ES?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function OS(e,t){return typeof e==`function`?e(...t):!!e}function kS(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var AS=()=>aS,jS=()=>AS(),MS=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},NS=new class extends MS{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},PS=iS;function FS(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=PS,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var IS=FS(),LS=new class extends MS{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function RS(e){return Math.min(1e3*2**e,3e4)}function zS(e){return(e??`online`)!==`online`||LS.isOnline()}var BS=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function VS(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(oS);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new BS(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>NS.isFocused()&&(e.networkMode===`always`||LS.isOnline())&&e.canRun(),p=()=>zS(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(jS()?0:3),a=e.retryDelay??RS,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),SS(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var HS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cS(this.gcTime)&&(this.#e=rS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(jS()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(rS.clearTimeout(this.#e),this.#e=void 0)}},US=class extends HS{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||WS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=VS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),IS.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function WS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var GS=class extends MS{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),vS(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&mS(t.mutationKey)!==mS(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??WS();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){IS.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function KS(e,t){let n=eS(t),[r]=P.useState(()=>new GS(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(IS.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(oS)},[r]);if(i.error&&OS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var qS=Symbol(`workers-module`);Symbol.dispose||(Symbol.dispose=Symbol.for(`dispose`)),Symbol.asyncDispose||(Symbol.asyncDispose=Symbol.for(`asyncDispose`)),Promise.withResolvers||(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}});var JS=globalThis[qS],YS=JS?JS.RpcTarget:class{},XS=async function(){}.constructor,ZS=typeof Buffer<`u`?Buffer.prototype:void 0;function QS(e){switch(typeof e){case`boolean`:case`number`:case`string`:return`primitive`;case`undefined`:return`undefined`;case`object`:case`function`:break;case`bigint`:return`bigint`;default:return`unsupported`}if(e===null)return`primitive`;let t=Object.getPrototypeOf(e);switch(t){case Object.prototype:return`object`;case Function.prototype:case XS.prototype:return`function`;case Array.prototype:return`array`;case Date.prototype:return`date`;case Uint8Array.prototype:case ZS:case ArrayBuffer.prototype:case DataView.prototype:case Int8Array.prototype:case Uint8ClampedArray.prototype:case Int16Array.prototype:case Uint16Array.prototype:case Int32Array.prototype:case Uint32Array.prototype:case BigInt64Array.prototype:case BigUint64Array.prototype:case Float32Array.prototype:case Float64Array.prototype:return`bytes`;case WritableStream.prototype:return`writable`;case ReadableStream.prototype:return`readable`;case URL.prototype:return`url`;case Headers.prototype:return`headers`;case Request.prototype:return`request`;case Response.prototype:return`response`;case Blob.prototype:return`blob`;case uC.prototype:return`stub`;case dC.prototype:return`rpc-promise`;default:if(JS){if(t==JS.RpcStub.prototype||e instanceof JS.ServiceStub)return`rpc-target`;if(t==JS.RpcPromise.prototype||t==JS.RpcProperty.prototype)return`rpc-thenable`}return e instanceof YS?`rpc-target`:e instanceof Error?`error`:`unsupported`}}function $S(){throw Error(`RPC map() implementation was not loaded.`)}var eC={applyMap:$S,sendMap:$S};function tC(){throw Error(`Stream implementation was not loaded.`)}var nC={createWritableStreamHook:tC,createWritableStreamFromHook:tC,createReadableStreamHook:tC},rC=class{stream(e,t){let n=this.call(e,t),r;try{r=n.pull()}catch(e){throw n.dispose(),e}let i;return r instanceof Promise?i=r.then(e=>{e.dispose()}):(r.dispose(),i=Promise.resolve()),{promise:i}}},iC=class extends rC{error;constructor(e){super(),this.error=e}call(e,t){return t.dispose(),this}map(e,t,n){for(let e of t)e.dispose();return this}get(e){return this}dup(){return this}pull(){return Promise.reject(this.error)}ignoreUnhandledRejections(){}dispose(){}onBroken(e){try{e(this.error)}catch(e){Promise.resolve(e)}}},aC=new iC(Error(`Attempted to use RPC stub after it has been disposed.`)),oC=(e,t,n)=>e.call(t,n);function sC(e,t){let n=oC;oC=e;try{return t()}finally{oC=n}}var cC=Symbol(`realStub`),lC={apply(e,t,n){let r=e.raw;return new dC(oC(r.hook,r.pathIfPromise||[],vC.fromAppParams(n)),[])},get(e,t,n){let r=e.raw;if(t===cC)return r;if(t in dC.prototype)return r[t];if(typeof t==`string`)return new dC(r.hook,r.pathIfPromise?[...r.pathIfPromise,t]:[t]);if(t===Symbol.dispose&&(!r.pathIfPromise||r.pathIfPromise.length==0))return()=>{r.hook.dispose(),r.hook=aC}},has(e,t){let n=e.raw;return t===cC?!0:t in dC.prototype?t in n:typeof t==`string`||t===Symbol.dispose&&(!n.pathIfPromise||n.pathIfPromise.length==0)},construct(e,t){throw Error(`An RPC stub cannot be used as a constructor.`)},defineProperty(e,t,n){throw Error(`Can't define properties on RPC stubs.`)},deleteProperty(e,t){throw Error(`Can't delete properties on RPC stubs.`)},getOwnPropertyDescriptor(e,t){},getPrototypeOf(e){return Object.getPrototypeOf(e.raw)},isExtensible(e){return!1},ownKeys(e){return[]},preventExtensions(e){return!0},set(e,t,n,r){throw Error(`Can't assign properties on RPC stubs.`)},setPrototypeOf(e,t){throw Error(`Can't override prototype of RPC stubs.`)}},uC=class e extends YS{constructor(e,t){if(super(),!(e instanceof rC)){let n=e;if(e=n instanceof YS||n instanceof Function?CC.create(n,void 0):new xC(vC.fromAppReturn(n)),t)throw TypeError(`RpcStub constructor expected one argument, received two.`)}this.hook=e,this.pathIfPromise=t;let n=()=>{};return n.raw=this,new Proxy(n,lC)}hook;pathIfPromise;dup(){let t=this[cC];return t.pathIfPromise?new e(t.hook.get(t.pathIfPromise)):new e(t.hook.dup())}onRpcBroken(e){this[cC].hook.onBroken(e)}map(e){let{hook:t,pathIfPromise:n}=this[cC];return eC.sendMap(t,n||[],e)}toString(){return`[object RpcStub]`}},dC=class extends uC{constructor(e,t){if(e instanceof rC)super(e,t??[]);else{if(t!==void 0)throw TypeError(`RpcPromise constructor expected one argument, received two.`);let n=QS(e);if(n===`rpc-promise`){let t=gC(e);if(t.pathIfPromise.length>0)super(t.hook,t.pathIfPromise);else{let e=t.hook;t.hook=aC,super(e,[])}}else if(n===`rpc-thenable`)super(CC.create(e,void 0),[]);else{let t=new wC(Promise.resolve(e).then(e=>new xC(vC.fromAppReturn(e))));t.ignoreUnhandledRejections(),super(t,[])}}}then(e,t){return _C(this).then(...arguments)}catch(e){return _C(this).catch(...arguments)}finally(e){return _C(this).finally(...arguments)}toString(){return`[object RpcPromise]`}};function fC(e){let{hook:t,pathIfPromise:n}=e[cC];return n&&n.length>0?t.get(n):t}function pC(e){let{hook:t,pathIfPromise:n}=e[cC];return n?t.get(n):t.dup()}function mC(e){let{hook:t,pathIfPromise:n}=e[cC];if(!(n&&n.length>0))return t}function hC(e){return e[cC].hook}function gC(e){return e[cC]}async function _C(e){let{hook:t,pathIfPromise:n}=e[cC];return n.length>0&&(t=t.get(n)),(await t.pull()).deliverResolve()}var vC=class e{value;source;hooks;promises;static fromAppParams(t){return new e(t,`params`)}static fromAppReturn(t){return new e(t,`return`)}static fromArray(t){let n=[],r=[],i=[];for(let e of t){e.ensureDeepCopied();for(let t of e.hooks)n.push(t);for(let t of e.promises)t.parent===e&&(t={parent:i,property:i.length,promise:t.promise}),r.push(t);i.push(e.value)}return new e(i,`owned`,n,r)}static forEvaluate(t,n){return new e(null,`owned`,t,n)}static deepCopyFrom(t,n,r){let i=new e(null,`owned`,[],[]);return i.value=i.deepCopy(t,n,`value`,i,!0,r),i}constructor(e,t,n,r){this.value=e,this.source=t,this.hooks=n,this.promises=r}rpcTargets;getHookForRpcTarget(e,t,n=!0){if(this.source===`params`){if(n){let t=e;typeof t.dup==`function`&&(e=t.dup())}return CC.create(e,t)}if(this.source===`return`){let r=this.rpcTargets?.get(e);return r?n?r.dup():(this.rpcTargets?.delete(e),r):(r=CC.create(e,t),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,r),r.dup()):r)}throw Error(`owned payload shouldn't contain raw RpcTargets`)}getHookForWritableStream(e,t,n=!0){if(this.source===`params`)return nC.createWritableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=nC.createWritableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw WritableStreams`)}getHookForReadableStream(e,t,n=!0){if(this.source===`params`)return nC.createReadableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=nC.createReadableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw ReadableStreams`)}deepCopy(e,t,n,r,i,a){switch(QS(e)){case`unsupported`:return e;case`primitive`:case`bigint`:case`date`:case`bytes`:case`blob`:case`url`:case`error`:case`undefined`:return e;case`array`:{let t=e,n=t.length,r=Array(n);for(let e=0;e<n;e++)r[e]=this.deepCopy(t[e],t,e,r,i,a);return r}case`object`:{let t={},n=e;for(let e in n)t[e]=this.deepCopy(n[e],n,e,t,i,a);return t}case`stub`:case`rpc-promise`:{let t=e,a;if(a=i?pC(t):fC(t),t instanceof dC){let e=new dC(a,[]);return this.promises.push({parent:r,property:n,promise:e}),e}return this.hooks.push(a),new uC(a)}case`function`:case`rpc-target`:{let n=e,r;return r=a?a.getHookForRpcTarget(n,t,i):CC.create(n,t),this.hooks.push(r),new uC(r)}case`rpc-thenable`:{let o=e,s;return s=a?new dC(a.getHookForRpcTarget(o,t,i),[]):new dC(CC.create(o,t),[]),this.promises.push({parent:r,property:n,promise:s}),s}case`writable`:{let n=e,r;return r=a?a.getHookForWritableStream(n,t,i):nC.createWritableStreamHook(n),this.hooks.push(r),n}case`readable`:{let n=e,r;return r=a?a.getHookForReadableStream(n,t,i):nC.createReadableStreamHook(n),this.hooks.push(r),n}case`headers`:return new Headers(e);case`request`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Request(t)}case`response`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Response(t.body,t)}default:throw Error(`unreachable`)}}ensureDeepCopied(){if(this.source!==`owned`){let e=this.source===`params`;this.hooks=[],this.promises=[];try{this.value=this.deepCopy(this.value,void 0,`value`,this,e,this)}catch(e){throw this.hooks=void 0,this.promises=void 0,e}if(this.source=`owned`,this.rpcTargets&&this.rpcTargets.size>0)throw Error(`Not all rpcTargets were accounted for in deep-copy?`);this.rpcTargets=void 0}}deliverTo(t,n,r){if(this.ensureDeepCopied(),this.value instanceof dC)e.deliverRpcPromiseTo(this.value,t,n,r);else{t[n]=this.value;for(let t of this.promises)e.deliverRpcPromiseTo(t.promise,t.parent,t.property,r)}}static deliverRpcPromiseTo(t,n,r,i){let a=mC(t);if(!a)throw Error(`property promises should have been resolved earlier`);let o=a.pull();o instanceof e?o.deliverTo(n,r,i):i.push(o.then(e=>{let t=[];if(e.deliverTo(n,r,t),t.length>0)return Promise.all(t)}))}async deliverCall(t,n){try{let r=[];this.deliverTo(this,`value`,r),r.length>0&&await Promise.all(r);let i=Function.prototype.apply.call(t,n,this.value);return i instanceof dC?e.fromAppReturn(i):e.fromAppReturn(await i)}finally{this.dispose()}}async deliverStreamWrite(t){try{let n=[];this.deliverTo(this,`value`,n),n.length>0&&await Promise.all(n);let r=this.value[0];return(this.hooks.length>0||this.promises.length>0)&&r instanceof Object?(Symbol.dispose in r||Object.defineProperty(r,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0}),await t.write(r),e.fromAppReturn(void 0)):(await t.write(r),this.dispose(),e.fromAppReturn(void 0))}catch(e){throw this.dispose(),e}}async deliverResolve(){try{let e=[];this.deliverTo(this,`value`,e),e.length>0&&await Promise.all(e);let t=this.value;return t instanceof Object&&(Symbol.dispose in t||Object.defineProperty(t,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0})),t}catch(e){throw this.dispose(),e}}dispose(){if(this.source===`owned`)this.hooks.forEach(e=>e.dispose()),this.promises.forEach(e=>e.promise[Symbol.dispose]());else if(this.source===`return`&&(this.disposeImpl(this.value,void 0),this.rpcTargets&&this.rpcTargets.size>0))throw Error(`Not all rpcTargets were accounted for in disposeImpl()?`);this.source=`owned`,this.hooks=[],this.promises=[]}disposeImpl(e,t){switch(QS(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`url`:case`error`:case`undefined`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.disposeImpl(t[e],t);return}case`object`:{let t=e;for(let e in t)this.disposeImpl(t[e],t);return}case`stub`:case`rpc-promise`:{let t=mC(e);t&&t.dispose();return}case`function`:case`rpc-target`:{let t=e,n=this.rpcTargets?.get(t);n?(n.dispose(),this.rpcTargets.delete(t)):SC(t);return}case`rpc-thenable`:return;case`headers`:return;case`request`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`response`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`writable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=nC.createWritableStreamHook(t),n.dispose();return}case`readable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=nC.createReadableStreamHook(t),n.dispose();return}default:return}}ignoreUnhandledRejections(){this.hooks?(this.hooks.forEach(e=>{e.ignoreUnhandledRejections()}),this.promises.forEach(e=>hC(e.promise).ignoreUnhandledRejections())):this.ignoreUnhandledRejectionsImpl(this.value)}ignoreUnhandledRejectionsImpl(e){switch(QS(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`undefined`:case`function`:case`rpc-target`:case`writable`:case`readable`:case`url`:case`headers`:case`request`:case`response`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`object`:{let t=e;for(let e in t)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`stub`:case`rpc-promise`:hC(e).ignoreUnhandledRejections();return;case`rpc-thenable`:e.then(e=>{},e=>{});return;default:return}}};function yC(e,t,n,r){for(let i=0;i<n.length;i++){t=e;let a=n[i];if(a in Object.prototype){e=void 0;continue}switch(QS(e)){case`object`:case`function`:e=Object.hasOwn(e,a)?e[a]:void 0;break;case`array`:e=Number.isInteger(a)&&a>=0?e[a]:void 0;break;case`rpc-target`:case`rpc-thenable`:if(Object.hasOwn(e,a))throw TypeError(`Attempted to access property '${a}', which is an instance property of the RpcTarget. To avoid leaking private internals, instance properties cannot be accessed over RPC. If you want to make this property available over RPC, define it as a method or getter on the class, instead of an instance property.`);e=e[a],r=null;break;case`stub`:case`rpc-promise`:{let{hook:t,pathIfPromise:r}=gC(e);return{hook:t,remainingPath:r?r.concat(n.slice(i)):n.slice(i)}}case`writable`:e=void 0;break;case`readable`:e=void 0;break;case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`url`:case`headers`:case`request`:case`response`:e=void 0;break;case`undefined`:e=e[a];break;case`unsupported`:if(i===0)throw TypeError(`RPC stub points at a non-serializable type.`);{let e=n.slice(0,i).join(`.`),t=n.slice(0,i).join(`.`);throw TypeError(`'${e}' is not a serializable type, so property ${t} cannot be accessed.`)}default:throw TypeError(`unreachable`)}}if(e instanceof dC){let{hook:t,pathIfPromise:n}=gC(e);return{hook:t,remainingPath:n||[]}}return{value:e,parent:t,owner:r}}var bC=class extends rC{call(e,t){let n;try{let{value:t,owner:r}=this.getValue();n=yC(t,void 0,e,r)}catch(e){return t.dispose(),new iC(e)}return n.hook?n.hook.call(n.remainingPath,t):typeof n.value==`function`?new wC(t.deliverCall(n.value,n.parent).then(e=>new xC(e))):(t.dispose(),new iC(TypeError(`'${e.join(`.`)}' is not a function.`)))}map(e,t,n){try{let r;try{let{value:t,owner:n}=this.getValue();r=yC(t,void 0,e,n)}catch(e){for(let e of t)e.dispose();throw e}return r.hook?r.hook.map(r.remainingPath,t,n):eC.applyMap(r.value,r.parent,r.owner,t,n)}catch(e){return new iC(e)}}get(e){try{let{value:t,owner:n}=this.getValue();if(e.length===0&&n===null){if(t instanceof Object&&`then`in t)return this.dup();throw Error(`Can't dup an RpcTarget stub as a promise.`)}let r=yC(t,void 0,e,n);return r.hook?r.hook.get(r.remainingPath):new xC(vC.deepCopyFrom(r.value,r.parent,r.owner))}catch(e){return new iC(e)}}},xC=class e extends bC{constructor(e){super(),this.payload=e}payload;getPayload(){if(this.payload)return this.payload;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){let e=this.getPayload();return{value:e.value,owner:e}}dup(){let t=this.getPayload();return new e(vC.deepCopyFrom(t.value,void 0,t))}pull(){return this.getPayload()}ignoreUnhandledRejections(){this.payload&&this.payload.ignoreUnhandledRejections()}dispose(){this.payload&&=(this.payload.dispose(),void 0)}onBroken(e){this.payload&&this.payload.value instanceof uC&&this.payload.value.onRpcBroken(e)}};function SC(e){if(Symbol.dispose in e)try{e[Symbol.dispose]()}catch(e){Promise.reject(e)}}var CC=class e extends bC{static create(t,n){return typeof t!=`function`&&(n=void 0),new e(t,n)}constructor(e,t,n){super(),this.target=e,this.parent=t,n?n.refcount&&(this.refcount=n.refcount,++this.refcount.count):Symbol.dispose in e&&(this.refcount={count:1})}target;parent;refcount;getTarget(){if(this.target)return this.target;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){return{value:this.getTarget(),owner:null}}dup(){return new e(this.getTarget(),this.parent,this)}pull(){let e=this.getTarget();return`then`in e?Promise.resolve(e).then(e=>vC.fromAppReturn(e)):Promise.reject(Error(`Tried to resolve a non-promise stub.`))}ignoreUnhandledRejections(){}dispose(){this.target&&=(this.refcount&&--this.refcount.count==0&&SC(this.target),void 0)}onBroken(e){let t=this.target;t&&`then`in t&&Promise.resolve(t).then(()=>{},e)}},wC=class e extends rC{promise;resolution;constructor(e){super(),this.promise=e.then(e=>(this.resolution=e,e))}call(t,n){return n.ensureDeepCopied(),new e(this.promise.then(e=>e.call(t,n),e=>{throw n.dispose(),e}))}stream(e,t){return t.ensureDeepCopied(),{promise:this.promise.then(n=>n.stream(e,t).promise,e=>{throw t.dispose(),e})}}map(t,n,r){return new e(this.promise.then(e=>e.map(t,n,r),e=>{for(let e of n)e.dispose();throw e}))}get(t){return new e(this.promise.then(e=>e.get(t)))}dup(){return this.resolution?this.resolution.dup():new e(this.promise.then(e=>e.dup()))}pull(){return this.resolution?this.resolution.pull():this.promise.then(e=>e.pull())}ignoreUnhandledRejections(){this.resolution?this.resolution.ignoreUnhandledRejections():this.promise.then(e=>{e.ignoreUnhandledRejections()},e=>{})}dispose(){this.promise.then(e=>e.dispose(),()=>{})}onBroken(e){this.resolution?this.resolution.onBroken(e):this.promise.then(t=>{t.onBroken(e)},e)}},TC={maxBigIntDigits:16384,maxDepth:256,maxMessageSize:33554432},EC=new Uint8Array(new Uint16Array([1]).buffer)[0]===1,DC=[`ArrayBuffer`,`DataView`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`,`Float32Array`,`Float64Array`];function OC(e){return DC.includes(e)}var kC={ArrayBuffer:void 0,DataView:void 0,Int8Array:void 0,Uint8Array:void 0,Uint8ClampedArray:void 0,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,BigInt64Array:8,BigUint64Array:8,Float32Array:4,Float64Array:8},AC={ArrayBuffer:ArrayBuffer.prototype,DataView:DataView.prototype,Int8Array:Int8Array.prototype,Uint8ClampedArray:Uint8ClampedArray.prototype,Int16Array:Int16Array.prototype,Uint16Array:Uint16Array.prototype,Int32Array:Int32Array.prototype,Uint32Array:Uint32Array.prototype,BigInt64Array:BigInt64Array.prototype,BigUint64Array:BigUint64Array.prototype,Float32Array:Float32Array.prototype,Float64Array:Float64Array.prototype},jC=new Map;for(let e of Object.keys(AC))jC.set(AC[e],e);function MC(e,t){if(t!==2&&t!==4&&t!==8)throw RangeError(`Unsupported element size: ${t}`);let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let r=0;r<e.byteLength;r+=t)switch(t){case 2:n.setUint16(r,n.getUint16(r,!1),!0);break;case 4:n.setUint32(r,n.getUint32(r,!1),!0);break;case 8:n.setBigUint64(r,n.getBigUint64(r,!1),!0)}}var NC=new class{exportStub(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}exportPromise(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}getImport(e){}unexport(e){}createPipe(e){throw Error(`Cannot create pipes without an RPC session.`)}onSendError(e){}};async function PC(e,t){let n=await new Response(e).blob();return n.type===t?n:n.slice(0,n.size,t)}var FC={__proto__:null,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError},IC=class e{exporter;source;encodingLevel;constructor(e,t,n){this.exporter=e,this.source=t,this.encodingLevel=n}static devaluate(t,n,r=NC,i,a=`string`){let o=new e(r,i,a);try{return o.devaluateImpl(t,n,0)}catch(e){if(o.exports)try{r.unexport(o.exports)}catch{}throw e}}exports;devaluateImpl(e,t,n){if(n>=256)throw Error(`Serialization exceeded maximum allowed depth. (Does the message contain cycles?)`);switch(QS(e)){case`unsupported`:{let t;try{t=`Cannot serialize value: ${e}`}catch{t=`Cannot serialize value: (couldn't stringify value)`}throw TypeError(t)}case`primitive`:return typeof e==`number`&&!isFinite(e)?this.encodingLevel===`structuredClonable`?e:e===1/0?[`inf`]:e===-1/0?[`-inf`]:[`nan`]:e;case`object`:{let t=e,r={};for(let e in t)r[e]=this.devaluateImpl(t[e],t,n+1);return r}case`array`:{let t=e,r=t.length,i=Array(r);for(let e=0;e<r;e++)i[e]=this.devaluateImpl(t[e],t,n+1);return[i]}case`bigint`:return this.encodingLevel===`structuredClonable`?e:[`bigint`,e.toString()];case`date`:{if(this.encodingLevel===`structuredClonable`)return e;let t=e.getTime();return[`date`,Number.isNaN(t)?null:t]}case`bytes`:{let t=jC.get(Object.getPrototypeOf(e)),n;if(t===`ArrayBuffer`)n=new Uint8Array(e);else if(t===void 0)n=e;else{let r=e;n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);let i=kC[t];!EC&&i&&(n=n.slice(),MC(n,i))}if(this.encodingLevel===`structuredClonable`||this.encodingLevel===`jsonCompatibleWithBytes`)return t===void 0?[`bytes`,n]:[`bytes`,n,t];let r;if(n.toBase64)r=n.toBase64({omitPadding:!0});else if(typeof Buffer<`u`)r=(n instanceof Buffer?n:Buffer.from(n.buffer,n.byteOffset,n.byteLength)).toString(`base64`);else{let e=``;for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);r=btoa(e)}return r=r.replace(/=+$/,``),t===void 0?[`bytes`,r]:[`bytes`,r,t]}case`url`:return[`url`,e.href];case`headers`:return[`headers`,[...e]];case`request`:{let t=e,r={};t.method!==`GET`&&(r.method=t.method);let i=[...t.headers];if(i.length>0&&(r.headers=i),t.body)r.body=this.devaluateImpl(t.body,t,n+1),r.duplex=t.duplex||`half`;else if(t.body===void 0&&![`GET`,`HEAD`,`OPTIONS`,`TRACE`,`DELETE`].includes(t.method)){let e=t.arrayBuffer(),n=new ReadableStream({async start(t){try{t.enqueue(new Uint8Array(await e)),t.close()}catch(e){t.error(e)}}}),i=nC.createReadableStreamHook(n);r.body=[`readable`,this.exporter.createPipe(n,i)],r.duplex=t.duplex||`half`}t.cache&&t.cache!=="default"&&(r.cache=t.cache),t.redirect!==`follow`&&(r.redirect=t.redirect),t.integrity&&(r.integrity=t.integrity),t.mode&&t.mode!==`cors`&&(r.mode=t.mode),t.credentials&&t.credentials!==`same-origin`&&(r.credentials=t.credentials),t.referrer&&t.referrer!==`about:client`&&(r.referrer=t.referrer),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.keepalive&&(r.keepalive=t.keepalive);let a=t;return a.cf&&(r.cf=a.cf),a.encodeResponseBody&&a.encodeResponseBody!==`automatic`&&(r.encodeResponseBody=a.encodeResponseBody),[`request`,t.url,r]}case`response`:{let t=e,r=this.devaluateImpl(t.body,t,n+1),i={};t.status!==200&&(i.status=t.status),t.statusText&&(i.statusText=t.statusText);let a=[...t.headers];a.length>0&&(i.headers=a);let o=t;if(o.cf&&(i.cf=o.cf),o.encodeBody&&o.encodeBody!==`automatic`&&(i.encodeBody=o.encodeBody),o.webSocket)throw TypeError(`Can't serialize a Response containing a webSocket.`);return[`response`,r,i]}case`blob`:{let t=e,n=t.stream(),r=nC.createReadableStreamHook(n),i=this.exporter.createPipe(n,r);return[`blob`,t.type,[`readable`,i]]}case`error`:{let t=e,r=this.exporter.onSendError(t);r&&(t=r);let i=t,a,o=(e,r)=>{let i=this.exports?.length??0;try{let i=this.devaluateImpl(r,t,n+1);a||={},a[e]=i}catch{if(this.exports&&this.exports.length>i){let e=this.exports.splice(i);try{this.exporter.unexport(e)}catch{}}}};for(let e of Object.keys(t))e!==`name`&&e!==`message`&&e!==`stack`&&o(e,i[e]);`cause`in t&&o(`cause`,i.cause),t instanceof AggregateError&&o(`errors`,t.errors);let s=[`error`,t.name,t.message];return a?(s.push(r&&r.stack?r.stack:null),s.push(a)):r&&r.stack&&s.push(r.stack),s}case`undefined`:return this.encodingLevel===`structuredClonable`?void 0:[`undefined`];case`stub`:case`rpc-promise`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let{hook:t,pathIfPromise:n}=gC(e),r=this.exporter.getImport(t);return r===void 0?(t=n?t.get(n):t.dup(),this.devaluateHook(n?`promise`:`export`,t)):n?n.length>0?[`pipeline`,r,n]:[`pipeline`,r]:[`import`,r]}case`function`:case`rpc-target`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`export`,n)}case`rpc-thenable`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`promise`,n)}case`writable`:{if(!this.source)throw Error(`Can't serialize WritableStream in this context.`);let n=this.source.getHookForWritableStream(e,t);return this.devaluateHook(`writable`,n)}case`readable`:{if(!this.source)throw Error(`Can't serialize ReadableStream in this context.`);let n=e,r=this.source.getHookForReadableStream(n,t);return[`readable`,this.exporter.createPipe(n,r)]}default:throw Error(`unreachable`)}}devaluateHook(e,t){this.exports||=[];let n=e===`promise`?this.exporter.exportPromise(t):this.exporter.exportStub(t);return this.exports.push(n),[e,n]}};new class{importStub(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}importPromise(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}getExport(e){}getPipeReadable(e){throw Error(`Cannot retrieve pipe readable without an RPC session.`)}getLimits(){return TC}};function LC(e,t){return new dC(new wC(new Response(t).arrayBuffer().then(t=>{let n=new Uint8Array(t),r=new Request(e,{body:n});return new xC(vC.fromAppReturn(r))})),[])}function RC(e,t){return new dC(new wC(PC(e,t).then(e=>new xC(vC.fromAppReturn(e)))),[])}var zC=class e{importer;encodingLevel;limits;constructor(e,t=`string`){this.importer=e,this.encodingLevel=t,this.limits=e.getLimits()}hooks=[];promises=[];evaluate(e){return this.evaluateWithDepth(e,0)}evaluateWithDepth(e,t){let n=vC.forEvaluate(this.hooks,this.promises);try{return n.value=this.evaluateImpl(e,n,`value`,t),n}catch(e){throw n.dispose(),e}}evaluateCopy(e){return this.evaluate(structuredClone(e))}evaluateImpl(t,n,r,i){let a=this.limits.maxDepth;if(i>=a)throw TypeError(`Deserialization exceeded maximum allowed message depth of ${a}.`);if(this.encodingLevel===`structuredClonable`&&(t instanceof Date||typeof t==`bigint`))return t;if(t instanceof Array){if(t.length==1&&t[0]instanceof Array){let e=t[0];for(let t=0;t<e.length;t++)e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}switch(t[0]){case`bigint`:if(typeof t[1]==`string`){let e=t[1],n=this.limits.maxBigIntDigits;if(e.length>n)throw TypeError(`Deserialized bigint exceeds maximum length of ${n} digits.`);return BigInt(e)}break;case`date`:if(t[1]===null)return new Date(NaN);if(typeof t[1]==`number`)return new Date(t[1]);break;case`bytes`:{let e;if(t[1]instanceof Uint8Array)e=t[1];else if(typeof t[1]==`string`){if(typeof Buffer<`u`)e=Buffer.from(t[1],`base64`);else if(Uint8Array.fromBase64)e=Uint8Array.fromBase64(t[1]);else{let n=atob(t[1]),r=n.length;e=new Uint8Array(r);for(let t=0;t<r;t++)e[t]=n.charCodeAt(t)}}else break;if(t.length===2)return e;if(typeof t[2]!=`string`)throw TypeError(`Unknown bytes type marker type: ${typeof t[2]}`);if(!OC(t[2])){let e=t[2].slice(0,64);throw TypeError(`Unknown bytes type marker: ${e}`)}let n=t[2],r=kC[n];if(r!==void 0&&e.byteLength%r!==0)throw TypeError(`Invalid byte length ${e.byteLength} for ${n}; expected a multiple of ${r}`);let i=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);switch(!EC&&r!==void 0&&MC(new Uint8Array(i),r),n){case`ArrayBuffer`:return i;case`DataView`:return new DataView(i);case`Int8Array`:return new Int8Array(i);case`Uint8Array`:return new Uint8Array(i);case`Uint8ClampedArray`:return new Uint8ClampedArray(i);case`Int16Array`:return new Int16Array(i);case`Uint16Array`:return new Uint16Array(i);case`Int32Array`:return new Int32Array(i);case`Uint32Array`:return new Uint32Array(i);case`BigInt64Array`:return new BigInt64Array(i);case`BigUint64Array`:return new BigUint64Array(i);case`Float32Array`:return new Float32Array(i);case`Float64Array`:return new Float64Array(i)}}case`error`:if(t.length>=3&&typeof t[1]==`string`&&typeof t[2]==`string`){let e=FC[t[1]]||Error,n=e===AggregateError?new e([],t[2]):new e(t[2]);if(typeof t[3]==`string`&&(n.stack=t[3]),t.length>=5){let e=t[4];if(!e||typeof e!=`object`||Array.isArray(e))break;let r=n,a=e;for(let e of Object.keys(a))if(e!==`name`&&e!==`message`&&e!==`stack`){if(e in Object.prototype||e===`toJSON`){this.evaluateImpl(a[e],n,e,i+1);continue}r[e]=this.evaluateImpl(a[e],n,e,i+1)}}return n}break;case`undefined`:if(t.length===1)return;break;case`inf`:return 1/0;case`-inf`:return-1/0;case`nan`:return NaN;case`url`:if(t.length===2&&typeof t[1]==`string`)return new URL(t[1]);break;case`headers`:if(t.length===2&&t[1]instanceof Array)return new Headers(t[1]);break;case`request`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=t[2];if(typeof a!=`object`||!a)break;if(a.body&&(a.body=this.evaluateImpl(a.body,a,`body`,i+1),!(a.body===null||typeof a.body==`string`||a.body instanceof Uint8Array||a.body instanceof ReadableStream)))throw TypeError(`Request body must be of type ReadableStream.`);if(a.signal&&(a.signal=this.evaluateImpl(a.signal,a,`signal`,i+1),!(a.signal instanceof AbortSignal)))throw TypeError(`Request siganl must be of type AbortSignal.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);let o=new Request(e,a);if(a.body instanceof ReadableStream&&o.body===void 0){let e=LC(o,a.body);return this.promises.push({promise:e,parent:n,property:r}),e}return o}case`response`:{if(t.length!==3)break;let e=this.evaluateImpl(t[1],n,r,i+1);if(!(e===null||typeof e==`string`||e instanceof Uint8Array||e instanceof ReadableStream))throw TypeError(`Response body must be of type ReadableStream.`);let a=t[2];if(typeof a!=`object`||!a)break;if(a.webSocket)throw TypeError(`Can't deserialize a Response containing a webSocket.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);return new Response(e,a)}case`blob`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=this.evaluateImpl(t[2],n,r,i+1);if(!(a instanceof ReadableStream))throw TypeError(`Blob content must be serialized as a ReadableStream.`);let o=RC(a,e);return this.promises.push({promise:o,parent:n,property:r}),o}case`import`:case`pipeline`:{if(t.length<2||t.length>4||typeof t[1]!=`number`)break;let a=this.importer.getExport(t[1]);if(!a)throw Error(`no such entry on exports table: ${t[1]}`);let o=t[0]==`pipeline`,s=e=>{if(o){let t=new dC(e,[]);return this.promises.push({promise:t,parent:n,property:r}),t}return this.hooks.push(e),new dC(e,[])};if(t.length==2)return s(o?a.get([]):a.dup());let c=t[2];if(!(c instanceof Array)||!c.every(e=>typeof e==`string`||typeof e==`number`))break;if(t.length==3)return s(a.get(c));let l=t[3];if(!(l instanceof Array))break;return l=new e(this.importer).evaluateWithDepth([l],i),s(a.call(c,l))}case`remap`:{if(t.length!==5||typeof t[1]!=`number`||!(t[2]instanceof Array)||!(t[3]instanceof Array)||!(t[4]instanceof Array))break;let e=this.importer.getExport(t[1]);if(!e)throw Error(`no such entry on exports table: ${t[1]}`);let i=t[2];if(!i.every(e=>typeof e==`string`||typeof e==`number`))break;let a=t[3].map(e=>{if(!(e instanceof Array)||e.length!==2||e[0]!==`import`&&e[0]!==`export`||typeof e[1]!=`number`)throw TypeError(`unknown map capture: ${JSON.stringify(e)}`);if(e[0]===`export`)return this.importer.importStub(e[1]);{let t=this.importer.getExport(e[1]);if(!t)throw Error(`no such entry on exports table: ${e[1]}`);return t.dup()}}),o=t[4],s=new dC(e.map(i,a,o),[]);return this.promises.push({promise:s,parent:n,property:r}),s}case`export`:case`promise`:if(typeof t[1]==`number`){if(t[0]==`promise`){let e=new dC(this.importer.importPromise(t[1]),[]);return this.promises.push({parent:n,property:r,promise:e}),e}{let e=this.importer.importStub(t[1]);return this.hooks.push(e),new uC(e)}}break;case`writable`:if(typeof t[1]==`number`){let e=this.importer.importStub(t[1]),n=nC.createWritableStreamFromHook(e);return this.hooks.push(e),n}break;case`readable`:if(typeof t[1]==`number`){let e=this.importer.getPipeReadable(t[1]),n=nC.createReadableStreamHook(e);return this.hooks.push(n),e}}throw TypeError(`unknown special value: ${JSON.stringify(t)}`)}if(t instanceof Object){let e=t;for(let t in e)t in Object.prototype||t===`toJSON`?(this.evaluateImpl(e[t],e,t,i+1),delete e[t]):e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}return t}},BC=16,VC=8,HC=16,UC=64;function WC(e){return 2+e.length*3}function GC(e,t,n=0){if(n>=UC)return VC;switch(typeof e){case`string`:return WC(e);case`number`:return 16;case`bigint`:return 16;case`boolean`:return 8;case`undefined`:return 16;case`object`:{if(e===null)return 8;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)return HC+e.byteLength;if(typeof Blob<`u`&&e instanceof Blob)return HC+e.size;if(e instanceof Date)return 16;if(t??=new WeakSet,t.has(e))return VC;if(t.add(e),e instanceof Array){let r=BC;for(let i of e)r+=VC+GC(i,t,n+1);return r}if(e instanceof Error){let r=BC+WC(e.name)+WC(e.message)+WC(e.stack??``);for(let i of Object.keys(e))r+=VC+WC(i)+GC(e[i],t,n+1);return r}let r=BC;for(let i of Object.keys(e))r+=VC+WC(i)+GC(e[i],t,n+1);return r}default:return 16}}var KC=class{session;importId;constructor(e,t,n){this.session=e,this.importId=t,n&&(this.activePull=Promise.withResolvers())}localRefcount=0;remoteRefcount=1;activePull;resolution;onBrokenRegistrations;resolve(e){if(this.localRefcount==0){e.dispose();return}if(this.resolution=e,this.sendRelease(),this.onBrokenRegistrations){for(let t of this.onBrokenRegistrations){let n=this.session.onBrokenCallbacks[t],r=this.session.onBrokenCallbacks.length;e.onBroken(n),this.session.onBrokenCallbacks[r]===n?delete this.session.onBrokenCallbacks[r]:delete this.session.onBrokenCallbacks[t]}this.onBrokenRegistrations=void 0}this.activePull&&=(this.activePull.resolve(),void 0)}async awaitResolution(){return this.activePull||=(this.session.sendPull(this.importId),Promise.withResolvers()),await this.activePull.promise,this.resolution.pull()}dispose(){this.resolution?this.resolution.dispose():(this.abort(Error(`RPC was canceled because the RpcPromise was disposed.`)),this.sendRelease())}abort(e){if(!this.resolution){if(this.resolution=new iC(e),this.activePull&&=(this.activePull.reject(e),void 0),this.onBrokenRegistrations)for(let e of this.onBrokenRegistrations)delete this.session.onBrokenCallbacks[e];this.onBrokenRegistrations=void 0}}onBroken(e){if(this.resolution)this.resolution.onBroken(e);else{let t=this.session.onBrokenCallbacks.length;this.session.onBrokenCallbacks.push(e),this.onBrokenRegistrations||=[],this.onBrokenRegistrations.push(t)}}sendRelease(){this.remoteRefcount>0&&(this.session.sendRelease(this.importId,this.remoteRefcount),this.remoteRefcount=0)}},qC=class e extends rC{isPromise;entry;constructor(e,t){super(),this.isPromise=e,++t.localRefcount,this.entry=t}collectPath(e){return this}getEntry(){if(this.entry)return this.entry;throw Error(`This RpcImportHook was already disposed.`)}getEntryTakingOwnership(e){try{return this.getEntry()}catch(t){throw e(),t}}call(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.call(e,t):n.session.sendCall(n.importId,e,t)}stream(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.stream(e,t):n.session.sendStream(n.importId,e,t)}map(e,t,n){let r=this.getEntryTakingOwnership(()=>{for(let e of t)e.dispose()});return r.resolution?r.resolution.map(e,t,n):r.session.sendMap(r.importId,e,t,n)}get(e){let t=this.getEntry();return t.resolution?t.resolution.get(e):t.session.sendCall(t.importId,e)}dup(){return new e(!1,this.getEntry())}pull(){let e=this.getEntry();if(!this.isPromise)throw Error(`Can't pull this hook because it's not a promise hook.`);return e.resolution?e.resolution.pull():e.awaitResolution()}ignoreUnhandledRejections(){}dispose(){let e=this.entry;this.entry=void 0,e&&--e.localRefcount===0&&e.dispose()}onBroken(e){this.entry&&this.entry.onBroken(e)}},JC=class extends qC{session;constructor(e){super(!1,e),this.session=e.session}dispose(){if(this.session){let e=this.session;this.session=void 0,e.shutdown()}}},YC=class{transport;options;exports=[];reverseExports=new Map;imports=[];abortReason;cancelReadLoop;nextExportId=-1;onBatchDone;pullCount=0;onBrokenCallbacks=[];encodingLevel;limits;constructor(e,t,n){this.transport=e,this.options=n;let r=`string`;if(`encodingLevel`in e){let t=e.encodingLevel;if(t!==void 0){if(t!==`string`&&t!==`jsonCompatible`&&t!==`jsonCompatibleWithBytes`&&t!==`structuredClonable`)throw TypeError(`Unknown transport encodingLevel: ${String(t)}`);r=t}}this.encodingLevel=r,this.limits={...TC,...n.limits},this.exports.push({hook:t,refcount:1}),this.imports.push(new KC(this,0,!1)),this.readLoop().catch(e=>this.abort(e))}getMainImport(){return new JC(this.imports[0])}shutdown(){this.abort(Error(`RPC session was shut down by disposing the main stub`),!1)}exportStub(e){if(this.abortReason)throw this.abortReason;let t=this.reverseExports.get(e);if(t!==void 0)return++this.exports[t].refcount,t;{let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),this.watchExport(t,e),t}}exportPromise(e){if(this.abortReason)throw this.abortReason;let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),this.ensureResolvingExport(t),t}unexport(e){for(let t of e)this.releaseExport(t,1)}watchExport(e,t){t.onBroken(n=>{queueMicrotask(()=>{if(this.abortReason===void 0&&this.exports[e]?.hook===t)try{this.send([`reject`,e,IC.devaluate(n,void 0,this,void 0,this.encodingLevel)])}catch(e){this.abort(e)}})})}releaseExport(e,t){let n=this.exports[e];if(!n)throw Error(`no such export ID: ${e}`);if(n.refcount<t)throw Error(`refcount would go negative: ${n.refcount} < ${t}`);n.refcount-=t,n.refcount===0&&(delete this.exports[e],this.reverseExports.delete(n.hook),n.hook.dispose())}onSendError(e){if(this.options.onSendError)return this.options.onSendError(e)}ensureResolvingExport(e){let t=this.exports[e];if(!t)throw Error(`no such export ID: ${e}`);if(!t.pull){let n=async()=>{let e=t.hook;for(;;){let t=await e.pull();if(t.value instanceof uC){let{hook:n,pathIfPromise:r}=gC(t.value);if(r&&r.length==0&&this.getImport(e)===void 0){e=n;continue}}return t}},r=t.autoRelease;++this.pullCount,t.pull=n().then(t=>{let n=IC.devaluate(t.value,void 0,this,t,this.encodingLevel);this.send([`resolve`,e,n]),r&&this.releaseExport(e,1)},t=>{this.send([`reject`,e,IC.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}).catch(t=>{try{this.send([`reject`,e,IC.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}catch(e){this.abort(e)}}).finally(()=>{--this.pullCount===0&&this.onBatchDone&&this.onBatchDone.resolve()})}}getImport(e){if(e instanceof qC&&e.entry&&e.entry.session===this)return e.entry.importId}importStub(e){if(this.abortReason)throw this.abortReason;let t=this.imports[e];return t||(t=new KC(this,e,!1),this.imports[e]=t),new qC(!1,t)}importPromise(e){if(this.abortReason)throw this.abortReason;if(this.imports[e])return new iC(Error(`Bug in RPC system: The peer sent a promise reusing an existing export ID.`));let t=new KC(this,e,!0);return this.imports[e]=t,new qC(!0,t)}getExport(e){return this.exports[e]?.hook}getPipeReadable(e){let t=this.exports[e];if(!t||!t.pipeReadable)throw Error(`Export ${e} is not a pipe or its readable end was already consumed.`);let n=t.pipeReadable;return t.pipeReadable=void 0,n}getLimits(){return this.limits}createPipe(e,t){if(this.abortReason)throw this.abortReason;this.send([`pipe`]);let n=this.imports.length,r=new KC(this,n,!1);this.imports.push(r);let i=new qC(!1,r),a=nC.createWritableStreamFromHook(i);return e.pipeTo(a).catch(()=>{}).finally(()=>t.dispose()),n}send(e){if(this.abortReason!==void 0)return 0;if(this.encodingLevel===`string`){let t;try{t=JSON.stringify(e)}catch(e){try{this.abort(e)}catch{}throw e}try{let e=this.transport.send(t);e!==void 0&&typeof e.catch==`function`&&e.catch(e=>this.abort(e,!1))}catch(e){queueMicrotask(()=>this.abort(e,!1))}return t.length}try{let t=this.transport.send(e);if(typeof t==`number`)return t;let n=t;n&&typeof n.then==`function`&&Promise.resolve(n).catch(e=>this.abort(e,!1));return}catch(e){queueMicrotask(()=>this.abort(e,!1));return}}sendCall(e,t,n){if(this.abortReason)throw n?.dispose(),this.abortReason;let r=[`pipeline`,e,t];if(n){let e;try{e=IC.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(e[0])}this.send([`push`,r]);let i=new KC(this,this.imports.length,!1);return this.imports.push(i),new qC(!0,i)}sendStream(e,t,n){if(this.abortReason)throw n.dispose(),this.abortReason;let r=[`pipeline`,e,t],i;try{i=IC.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(i[0]);let a=[`stream`,r],o=this.send(a);o===void 0&&(o=GC(a));let s=this.imports.length,c=new KC(this,s,!0);return c.remoteRefcount=0,c.localRefcount=1,this.imports.push(c),{promise:c.awaitResolution().then(e=>{e.dispose(),delete this.imports[s]},e=>{throw delete this.imports[s],e}),size:o}}sendMap(e,t,n,r){if(this.abortReason){for(let e of n)e.dispose();throw this.abortReason}let i=[`remap`,e,t,n.map(e=>{let t=this.getImport(e);return t===void 0?[`export`,this.exportStub(e)]:[`import`,t]}),r];this.send([`push`,i]);let a=new KC(this,this.imports.length,!1);return this.imports.push(a),new qC(!0,a)}sendPull(e){if(this.abortReason)throw this.abortReason;this.send([`pull`,e])}sendRelease(e,t){this.abortReason||(this.send([`release`,e,t]),delete this.imports[e])}abort(e,t=!0){if(this.abortReason===void 0){if(this.cancelReadLoop?.(e),this.cancelReadLoop=void 0,t)try{let t=[`abort`,IC.devaluate(e,void 0,this,void 0,this.encodingLevel)];if(this.encodingLevel===`string`){let e=this.transport.send(JSON.stringify(t));e!==void 0&&typeof e.catch==`function`&&e.catch(e=>{})}else{let e=this.transport.send(t);e&&typeof e.then==`function`&&Promise.resolve(e).catch(e=>{})}}catch{}if(e===void 0&&(e=`undefined`),this.abortReason=e,this.onBatchDone&&this.onBatchDone.reject(e),this.transport.abort)try{this.transport.abort(e)}catch(e){Promise.resolve(e)}for(let t of Object.values(this.onBrokenCallbacks))try{t(e)}catch(e){Promise.resolve(e)}for(let t in this.imports)this.imports[t].abort(e);for(let e in this.exports)this.exports[e].hook.dispose()}}async readLoop(){for(;!this.abortReason;){let e=Promise.withResolvers();this.cancelReadLoop=e.reject;let t;try{t=await Promise.race([this.transport.receive(),e.promise])}finally{this.cancelReadLoop===e.reject&&(this.cancelReadLoop=void 0)}if(this.encodingLevel===`string`&&t.length>this.limits.maxMessageSize)throw TypeError(`Incoming message exceeds maximum size of ${this.limits.maxMessageSize} UTF-16 code units.`);if(this.abortReason)break;let n=this.encodingLevel===`string`?JSON.parse(t):t;if(n instanceof Array)switch(n[0]){case`push`:if(n.length>1){let e=new xC(new zC(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections(),this.exports.push({hook:e,refcount:1});continue}break;case`stream`:if(n.length>1){let e=new xC(new zC(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections();let t=this.exports.length;this.exports.push({hook:e,refcount:1,autoRelease:!0}),this.ensureResolvingExport(t);continue}break;case`pipe`:{let{readable:e,writable:t}=new TransformStream,n=nC.createWritableStreamHook(t),r=this.exports.length;this.exports.push({hook:n,refcount:1,pipeReadable:e}),this.watchExport(r,n);continue}case`pull`:{let e=n[1];if(typeof e==`number`){this.ensureResolvingExport(e);continue}break}case`resolve`:case`reject`:{let e=n[1];if(typeof e==`number`&&n.length>2){let t=this.imports[e];if(t){if(n[0]==`resolve`)t.resolve(new xC(new zC(this,this.encodingLevel).evaluate(n[2])));else{let e=new zC(this,this.encodingLevel).evaluate(n[2]);e.dispose(),t.resolve(new iC(e.value))}}else n[0]==`resolve`&&new zC(this,this.encodingLevel).evaluate(n[2]).dispose();continue}break}case`release`:{let e=n[1],t=n[2];if(typeof e==`number`&&typeof t==`number`){this.releaseExport(e,t);continue}break}case`abort`:{let e=new zC(this,this.encodingLevel).evaluate(n[1]);e.dispose(),this.abort(e.value,!1);break}}throw Error(`bad RPC message: ${JSON.stringify(n)}`)}}async drain(){if(this.abortReason)throw this.abortReason;if(this.pullCount>0){let{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.onBatchDone={resolve:t,reject:n},await e}}getStats(){let e={imports:0,exports:0};for(let t in this.imports)++e.imports;for(let t in this.exports)++e.exports;return e}},XC=class{#e;#t;constructor(e,t,n={}){let r;r=t?new xC(vC.fromAppReturn(t)):new iC(Error(`This connection has no main object.`)),this.#e=new YC(e,r,n),this.#t=new uC(this.#e.getMainImport())}getRemoteMain(){return this.#t}getStats(){return this.#e.getStats()}drain(){return this.#e.drain()}};function ZC(e,t,n){return new XC(new QC(e),t,n).getRemoteMain()}var QC=class{encodingLevel=`structuredClonable`;constructor(e){this.#e=e,e.start(),e.addEventListener(`message`,e=>{this.#i||(e.data===null?this.#a(Error(`Peer closed MessagePort connection.`)):this.#t?(this.#t(e.data),this.#t=void 0,this.#n=void 0):this.#r.push(e.data))}),e.addEventListener(`messageerror`,e=>{this.#a(Error(`MessagePort message error.`))})}#e;#t;#n;#r=[];#i;send(e){if(this.#i)throw this.#i;this.#e.postMessage(e)}async receive(){if(this.#r.length>0)return this.#r.shift();if(this.#i)throw this.#i;return new Promise((e,t)=>{this.#t=e,this.#n=t})}abort(e){try{this.#e.postMessage(null)}catch{}this.#e.close(),this.#i||=e}#a(e){this.#i||(this.#i=e,this.#n&&=(this.#n(e),this.#t=void 0,void 0))}},$C,ew=class{context;captureMap=new Map;instructions=[];constructor(e,t){this.context=$C?{parent:$C,captures:[],subject:$C.capture(e),path:t}:{parent:void 0,captures:[],subject:e,path:t},$C=this}unregister(){$C=this.context.parent}makeInput(){return new nw(this,0)}makeOutput(e){let t;try{t=IC.devaluate(e.value,void 0,this,e)}finally{e.dispose()}return this.instructions.push(t),this.context.parent?(this.context.parent.instructions.push([`remap`,this.context.subject,this.context.path,this.context.captures.map(e=>[`import`,e]),this.instructions]),new nw(this.context.parent,this.context.parent.instructions.length)):this.context.subject.map(this.context.path,this.context.captures,this.instructions)}pushCall(e,t,n){let r=IC.devaluate(n.value,void 0,this,n);r=r[0];let i=this.capture(e.dup());return this.instructions.push([`pipeline`,i,t,r]),new nw(this,this.instructions.length)}pushGet(e,t){let n=this.capture(e.dup());return this.instructions.push([`pipeline`,n,t]),new nw(this,this.instructions.length)}capture(e){if(e instanceof nw&&e.mapper===this)return e.idx;let t=this.captureMap.get(e);if(t===void 0){if(this.context.parent){let t=this.context.parent.capture(e);this.context.captures.push(t)}else this.context.captures.push(e);t=-this.context.captures.length,this.captureMap.set(e,t)}return t}exportStub(e){throw Error(`Can't construct an RpcTarget or RPC callback inside a mapper function. Try creating a new RpcStub outside the callback first, then using it inside the callback.`)}exportPromise(e){return this.exportStub(e)}getImport(e){return this.capture(e)}unexport(e){}createPipe(e){throw Error(`Cannot send ReadableStream inside a mapper function.`)}onSendError(e){}};eC.sendMap=(e,t,n)=>{let r=new ew(e,t),i;try{i=vC.fromAppReturn(sC(r.pushCall.bind(r),()=>n(new dC(r.makeInput(),[]))))}finally{r.unregister()}if(i instanceof Promise)throw i.catch(e=>{}),Error(`RPC map() callbacks cannot be async.`);return new dC(r.makeOutput(i),[])};function tw(){throw Error(`Attempted to use an abstract placeholder from a mapper function. Please make sure your map function has no side effects.`)}var nw=class extends rC{mapper;idx;constructor(e,t){super(),this.mapper=e,this.idx=t}dup(){return this}dispose(){}get(e){if(e.length==0)return this;if($C)return $C.pushGet(this,e);tw()}call(e,t){t.dispose(),tw()}map(e,t,n){for(let e of t)e.dispose();tw()}pull(){tw()}ignoreUnhandledRejections(){}onBroken(e){tw()}},rw=class{captures;variables;constructor(e,t){this.captures=e,this.variables=[t]}dispose(){for(let e of this.variables)e.dispose()}apply(e){try{if(e.length<1)throw Error(`Invalid empty mapper function.`);for(let t of e.slice(0,-1)){let e=new zC(this).evaluateCopy(t);if(e.value instanceof uC){let t=mC(e.value);if(t){this.variables.push(t);continue}}this.variables.push(new xC(e))}return new zC(this).evaluateCopy(e[e.length-1])}finally{for(let e of this.variables)e.dispose()}}importStub(e){throw Error(`A mapper function cannot refer to exports.`)}importPromise(e){return this.importStub(e)}getExport(e){return e<0?this.captures[-e-1]:this.variables[e]}getPipeReadable(e){throw Error(`A mapper function cannot use pipe readables.`)}getLimits(){return TC}};function iw(e,t,n,r,i){let a=new rw(r,new xC(vC.deepCopyFrom(e,t,n)));try{return a.apply(i)}finally{a.dispose()}}eC.applyMap=(e,t,n,r,i)=>{try{let a;if(e instanceof dC)throw Error(`applyMap() can't be called on RpcPromise`);if(e instanceof Array){let t=[];try{for(let a of e)t.push(iw(a,e,n,r,i))}catch(e){for(let e of t)e.dispose();throw e}a=vC.fromArray(t)}else a=e==null?vC.fromAppReturn(e):iw(e,t,n,r,i);return new xC(a)}finally{for(let e of r)e.dispose()}};var aw=class e extends rC{state;static create(t){let n=t.getWriter();return new e({refcount:1,writer:n,closed:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}getState(){if(this.state)return this.state;throw Error(`Attempted to use a WritableStreamStubHook after it was disposed.`)}call(e,t){try{let n=this.getState();if(e.length!==1||typeof e[0]!=`string`)throw Error(`WritableStream stub only supports direct method calls`);let r=e[0];if(r!==`write`&&r!==`close`&&r!==`abort`)throw Error(`Unknown WritableStream method: ${r}`);return(r===`close`||r===`abort`)&&(n.closed=!0),new wC((r===`write`?t.deliverStreamWrite(n.writer):t.deliverCall(n.writer[r],n.writer)).then(e=>new xC(e)))}catch(e){return t.dispose(),new iC(e)}}map(e,t,n){for(let e of t)e.dispose();return new iC(Error(`Cannot use map() on a WritableStream`))}get(e){return new iC(Error(`Cannot access properties on a WritableStream stub`))}dup(){let t=this.getState();return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a WritableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.closed||e.writer.abort(Error(`WritableStream RPC stub was disposed without calling close()`)).catch(()=>{}),e.writer.releaseLock())}onBroken(e){this.getState().writer.closed.then(void 0,e)}},ow=262144,sw=1073741824,cw=65536,lw=2,uw=1.25,dw=.9,fw=3,pw=class{now;window=ow;bytesInFlight=0;inStartupPhase=!0;delivered=0;deliveredTime=0;firstAckTime=0;firstAckDelivered=0;minRtt=1/0;roundsWithoutIncrease=0;lastRoundWindow=0;roundStartTime=0;constructor(e){this.now=e}onSend(e){this.bytesInFlight+=e;let t={sentTime:this.now(),size:e,deliveredAtSend:this.delivered,deliveredTimeAtSend:this.deliveredTime,windowAtSend:this.window,windowFullAtSend:this.bytesInFlight>=this.window};return{token:t,shouldBlock:t.windowFullAtSend}}onError(e){this.bytesInFlight-=e.size}onAck(e){let t=this.now();this.delivered+=e.size,this.deliveredTime=t,this.bytesInFlight-=e.size;let n=t-e.sentTime;if(this.minRtt=Math.min(this.minRtt,n),this.firstAckTime===0)this.firstAckTime=t,this.firstAckDelivered=this.delivered;else{let n,r;e.deliveredTimeAtSend===0?(n=this.firstAckTime,r=this.firstAckDelivered):(n=e.deliveredTimeAtSend,r=e.deliveredAtSend);let i=t-n,a=(this.delivered-r)/i,o=this.inStartupPhase?lw:uw,s=a*this.minRtt*o;s=Math.min(s,e.windowAtSend*o),s=e.windowFullAtSend?Math.max(s,e.windowAtSend*dw):Math.max(s,this.window),this.window=Math.max(Math.min(s,sw),cw),this.inStartupPhase&&e.sentTime>=this.roundStartTime&&(this.window>this.lastRoundWindow*uw?this.roundsWithoutIncrease=0:++this.roundsWithoutIncrease>=fw&&(this.inStartupPhase=!1),this.roundStartTime=t,this.lastRoundWindow=this.window)}return this.bytesInFlight<this.window}};function mw(e){let t,n=!1,r=new pw(()=>performance.now()),i,a,o=()=>{n||(n=!0,e.dispose())};return new WritableStream({start(n){e.onBroken(e=>{t===void 0&&(t=e,n.error(e),o()),a&&=(a(e),i=void 0,void 0)})},write(n,s){if(t!==void 0)throw t;let c=vC.fromAppParams([n]),{promise:l,size:u}=e.stream([`write`],c);if(u===void 0)return l.catch(e=>{throw t===void 0&&(t=e),e});{let{token:e,shouldBlock:n}=r.onSend(u);if(l.then(()=>{r.onAck(e)&&i&&(i(),i=void 0,a=void 0)},n=>{r.onError(e),t===void 0&&(t=n,s.error(n),o()),a&&=(a(n),i=void 0,void 0)}),n)return new Promise((e,t)=>{i=e,a=t})}},async close(){if(t!==void 0)throw o(),t;let{promise:n}=e.stream([`close`],vC.fromAppParams([]));try{await n}catch(e){throw t??e}finally{o()}},abort(n){if(t!==void 0)return;t=n??Error(`WritableStream was aborted`),a&&=(a(t),i=void 0,void 0);let{promise:r}=e.stream([`abort`],vC.fromAppParams([n]));r.then(()=>o(),()=>o())}})}var hw=class e extends rC{state;static create(t){return new e({refcount:1,stream:t,canceled:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}call(e,t){return t.dispose(),new iC(Error(`Cannot call methods on a ReadableStream stub`))}map(e,t,n){for(let e of t)e.dispose();return new iC(Error(`Cannot use map() on a ReadableStream`))}get(e){return new iC(Error(`Cannot access properties on a ReadableStream stub`))}dup(){let t=this.state;if(!t)throw Error(`Attempted to dup a ReadableStreamStubHook after it was disposed.`);return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a ReadableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.canceled||(e.canceled=!0,e.stream.locked||e.stream.cancel(Error(`ReadableStream RPC stub was disposed without being consumed`)).catch(()=>{})))}onBroken(e){}};nC.createWritableStreamHook=aw.create,nC.createWritableStreamFromHook=mw,nC.createReadableStreamHook=hw.create;var gw=uC,_w=YS,vw=ZC;function yw(e){return e<32||e>=127&&e<=159||e===1564||e>=8203&&e<=8207||e===8232||e===8233||e>=8234&&e<=8238||e>=8294&&e<=8297||e===65279}function bw(e,t=80){let n=``;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);n+=yw(r)?` `:e.charAt(t)}return n=n.replace(/\s+/gu,` `).trim(),n.length<=t?n:`${n.slice(0,Math.max(0,t-1)).trimEnd()}…`}function xw(e,t){let n=e.find(e=>e.id===t.itemId);if(n===void 0||n.kind===`text`)return!1;if(n.kind===`menu`){let e=n.options.find(e=>e.id===t.optionId);return e!==void 0&&e.disabled!==!0}return t.optionId===void 0?n.kind!==`button`||n.disabled!==!0:!1}Object.freeze({publish:()=>Promise.resolve(),onBack:()=>()=>void 0,onForward:()=>()=>void 0,onActivate:()=>()=>void 0});function Sw(e,t){if(t.kind===`action`){let n=[...e.primary??[],...e.menu??[]].find(e=>e.id===t.actionId);return n!==void 0&&n.disabled!==!0}let n=e.crumbs?.find(e=>e.id===t.crumbId);return n===void 0?!1:t.siblingId===void 0||n.siblings?.some(e=>e.id===t.siblingId)===!0}var Cw=`fungi.app.ready`,ww=`fungi.app.connect`,Z=e=>$b.pipe(J(Dx(1)),J(Ax(e))),Tw=e=>V(Z(e)),Ew=ex.pipe(J(Tx()),J(dx(Number.isSafeInteger,{message:`Expected a safe integer`}))),Dw=Ew.pipe(J(Sx(0))),Ow=Ew.pipe(J(xx(0))),kw=G({appId:Z(160),releaseId:Z(160),surfaceId:Z(160)}),Aw=G({editing:W,surface:ix([Z(160),Zb])}),jw=ix([G({kind:H(`compose`),requestId:Z(160),text:Z(2e3)}),G({kind:H(`navigate`),requestId:Z(160),params:K(G({key:Z(64),value:Z(4096)})).pipe(J(Ax(16)))})]),Mw=Xb(q([`granted`,`missing`])),Nw=G({"agent.list":Mw,"agent.manage":Mw,"agent.read":Mw,"agent.send":Mw,"computer.list":Mw,"computer.readFile":Mw,"computer.writeFile":Mw,"computer.execute":Mw,"git.repository":Mw,"workflow.publish":Mw,"workflow.arm":Mw,"workflow.run":Mw,"app.events.emit":Mw,"llm.generation":Mw,"media.generation":Mw,"media.share":Mw}),Pw=q([`ready`,`missing`,`unknown`]),Fw=G({models:Pw,media:Pw,git:Pw,terminal:q([`ready`,`exec-only`,`missing`,`unknown`]),terminalReason:V($b)}),Iw=q([`model`,`media`,`git`,`computer`]),Lw=q([`opened`,`unavailable`]),Rw=G({computerId:ix([Z(256),Zb]),teamHasComputers:V(ax(W)),computerAccessGranted:V(W),setup:V(Fw),permissions:V(Nw),focus:Aw,openRequest:ix([Zb,jw]),visibility:q([`visible`,`hidden`])}),zw=q([`connecting`,`connected`,`suspended`,`disconnected`,`disposing`,`disposed`]),Bw=G({altKey:W,ctrlKey:W,id:Z(160),key:Z(64),metaKey:W,shiftKey:W}),Vw=G({action:V(U),availability:V(U),category:Z(160),description:Tw(512),id:Z(160),projections:V(U),title:Z(160)}),Hw=G({arguments:V(U),commandId:Z(321),origin:q([`agent`,`browser`,`keyboard`,`menu`,`palette`,`programmatic`,`slash`,`terminal`]),requestId:Z(160)}),Uw=ix([G({result:V(U),status:H(`handled`)}),G({error:U,status:H(`failed`)})]),Ww=e=>Z(e).pipe(J(dx(e=>{for(let t=0;t<e.length;t+=1)if(yw(e.charCodeAt(t)))return!1;return!0},{message:`Expected one line of plain text`}))),Gw={id:Z(64),text:Ww(80),end:Xb(W),priority:Xb(H(`low`))},Kw=Xb(ex.pipe(J(Tx()),J(wx({minimum:0,maximum:9999})))),qw=K(ix([G({...Gw,kind:H(`text`),tone:Xb(q([`neutral`,`success`,`warning`,`error`]))}),G({...Gw,kind:H(`button`),icon:Xb(q([`folder`,`ports`,`processes`,`access`])),count:Kw,tone:Xb(q([`neutral`,`success`,`warning`,`error`])),busy:Xb(W),title:Xb(Ww(1024)),disabled:Xb(W),opens:Xb(H(`dialog`)),expanded:Xb(W)}),G({...Gw,kind:H(`toggle`),pressed:W}),G({...Gw,kind:H(`menu`),count:Kw,title:Xb(Ww(1024)),options:K(G({id:Z(64),text:Ww(80),checked:Xb(W),disabled:Xb(W)})).pipe(J(Ax(16)),J(dx(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status option ids`})))})])).pipe(J(Ax(6)),J(dx(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status item ids`}))),Jw=G({computerId:Z(256),path:Z(1024)}),Yw=Z(80).pipe(J(dx(e=>e.trim()===e,{message:`Expected a trimmed title`}))),Xw=Z(64),Zw=Z(80),Qw=e=>new Set(e.map(e=>e.id)).size===e.length,$w=G({id:Xw,label:Zw,siblings:V(K(G({id:Xw,label:Zw})).pipe(J(Ax(16)),J(dx(Qw,{message:`Expected unique crumb sibling ids`}))))}),eT=G({id:Xw,label:Zw,icon:V(H(`play`)),variant:V(q([`primary`,`outline`,`ghost`])),tone:V(H(`destructive`)),disabled:V(W)}),tT=e=>K(eT).pipe(J(Ax(e)),J(dx(Qw,{message:`Expected unique header command ids`}))),nT={status:V(K(G({id:Xw,label:Zw,presentation:V(H(`bead`)),tone:V(q([`neutral`,`info`,`warning`,`success`,`error`]))})).pipe(J(Ax(4)),J(dx(Qw,{message:`Expected unique header status ids`})))),crumbs:V(K($w).pipe(J(Ax(8)),J(dx(Qw,{message:`Expected unique crumb ids`})))),primary:V(tT(3)),menu:V(tT(12))},rT=G({contractVersion:H(2),canGoBack:W,canGoForward:W,title:V(Yw),...nT}),iT=G({canGoBack:W,canGoForward:W,title:V($b),...nT}),aT=ix([G({kind:H(`crumb`),crumbId:Xw,siblingId:V(Xw)}),G({kind:H(`action`),actionId:Xw})]),oT=ax(G({agentId:Z(256),sessionId:Z(256)})),sT=e=>V(K(q(e)).pipe(J(Ax(e.length)))),cT=G({agents:V(K(q([`agent.list`,`agent.manage`,`agent.read`,`agent.send`])).pipe(J(Ax(4)))),computers:V(K(q([`computer.list`,`computer.readFile`,`computer.writeFile`,`computer.execute`])).pipe(J(Ax(4)))),git:sT([`git.repository`]),workflows:sT([`workflow.publish`,`workflow.arm`,`workflow.run`]),events:sT([`app.events.emit`]),generation:sT([`llm.generation`,`media.generation`,`media.share`])}),lT=q([`granted`,`declined`,`customize`]),uT=G({message:Z(512),tone:V(q([`info`,`success`,`warning`,`error`]))}),dT=q(Gx);G({code:dT.pick([`DELIVERY_PENDING`])});var fT=G({code:dT,message:Z(512),retryable:W,need:Xb(Bx)}),pT=G({protocolVersion:H(2),type:H(Cw)}),mT=G({epoch:Z(160),protocolVersion:H(2),type:H(ww)}),hT=G({epoch:Z(160),protocolVersion:H(2)}),gT={[Symbol.dispose]:V(U)},_T=ix([G({...gT,ok:H(!0),value:U}),G({...gT,error:fT,ok:H(!1)})]);function Q(e,t,n=`PROTOCOL`){return Ns(qb(e,{onExcessProperty:`error`}),Bu({onFailure:e=>{throw new Y(`The peer sent malformed protocol data`,{cause:e,code:n,retryable:!1})},onSuccess:t}))}function $(e){return Object.freeze(e)}function vT(e,t){let n=e.arguments===void 0?void 0:rs(e.arguments),r={origin:e.origin,signal:t};return n!==void 0&&Object.assign(r,{arguments:n}),$(r)}var yT=Q(Vw,e=>{let t={category:e.category,id:e.id,title:e.title};return e.action!==void 0&&Object.assign(t,{action:e.action}),e.availability!==void 0&&Object.assign(t,{availability:e.availability}),e.description!==void 0&&Object.assign(t,{description:e.description}),e.projections!==void 0&&Object.assign(t,{projections:e.projections}),$(uE(()=>gs(t)))},`INVALID_ARGUMENT`),bT=Q(Z(321),e=>e),xT=Q(Hw,e=>{let t=e.arguments===void 0?void 0:rs(e.arguments),n={commandId:e.commandId,origin:e.origin,requestId:e.requestId};return t!==void 0&&Object.assign(n,{arguments:t}),$(n)}),ST=Q(ix([Qb,U]),e=>e===void 0?void 0:rs(e)),CT=Q(mT,e=>$(e));Q(hT,e=>$(e));var wT=Q(Rw,e=>{let t={computerId:e.computerId,focus:$({...e.focus}),openRequest:e.openRequest===null?null:$({...e.openRequest}),visibility:e.visibility};return e.teamHasComputers!==void 0&&(t.teamHasComputers=e.teamHasComputers),e.computerAccessGranted!==void 0&&(t.computerAccessGranted=e.computerAccessGranted),e.setup!==void 0&&(t.setup=$({...e.setup})),e.permissions!==void 0&&(t.permissions=$({...e.permissions})),$(t)}),TT=Q(fT,e=>$({...e})),ET=Q(Aw,e=>$({...e}),`INVALID_ARGUMENT`),DT=Q(kw,e=>$({...e})),OT=Q(zw,e=>e),kT=Q(qw,e=>$(e.map(e=>e.kind===`menu`?$({...e,options:$(e.options.map(e=>$(e)))}):$(e))),`INVALID_ARGUMENT`),AT=Q(G({itemId:Z(64),optionId:Xb(Z(64)),anchor:Xb(G({start:ex.pipe(J(wx({minimum:0,maximum:1e5}))),width:ex.pipe(J(wx({minimum:0,maximum:1e5})))}))}),e=>$(e.anchor===void 0?{...e}:{...e,anchor:$({...e.anchor})}),`INVALID_ARGUMENT`),jT=Q(Jw,e=>$({...e}),`INVALID_ARGUMENT`);function MT(e){let t={id:e.id,label:e.label};return e.presentation!==void 0&&(t={...t,presentation:e.presentation}),e.tone!==void 0&&(t={...t,tone:e.tone}),$(t)}function NT(e){let t={id:e.id,label:e.label};return e.siblings===void 0?$(t):$({...t,siblings:$(e.siblings.map(e=>$({...e})))})}function PT(e){let t={id:e.id,label:e.label};return e.icon!==void 0&&(t={...t,icon:e.icon}),e.variant!==void 0&&(t={...t,variant:e.variant}),e.tone!==void 0&&(t={...t,tone:e.tone}),e.disabled!==void 0&&(t={...t,disabled:e.disabled}),$(t)}function FT(e){let t={canGoBack:e.canGoBack,canGoForward:e.canGoForward};return e.title!==void 0&&(t={...t,title:e.title}),e.crumbs!==void 0&&(t={...t,crumbs:$(e.crumbs.map(NT))}),e.primary!==void 0&&(t={...t,primary:$(e.primary.map(PT))}),e.menu!==void 0&&(t={...t,menu:$(e.menu.map(PT))}),e.status!==void 0&&(t={...t,status:$(e.status.map(MT))}),$(t)}var IT=Q(rT,FT,`INVALID_ARGUMENT`),LT=Q(iT,e=>{let t=e.title?.trim();return RT({...FT({...e,title:t===void 0||t.length===0?void 0:t}),contractVersion:2})},`INVALID_ARGUMENT`),RT=Q(rT,e=>$({...FT(e),contractVersion:2}),`INVALID_ARGUMENT`),zT=Q(aT,e=>e.kind===`action`?$({...e}):$(e.siblingId===void 0?{kind:e.kind,crumbId:e.crumbId}:e),`INVALID_ARGUMENT`),BT=Q(oT,e=>e===null?null:$({...e}),`INVALID_ARGUMENT`),VT=Q(cT,e=>$({agents:$([...new Set(e.agents??[])]),computers:$([...new Set(e.computers??[])]),...e.git&&{git:$([...new Set(e.git)])},...e.workflows&&{workflows:$([...new Set(e.workflows)])},...e.events&&{events:$([...new Set(e.events)])},...e.generation&&{generation:$([...new Set(e.generation)])}}),`INVALID_ARGUMENT`),HT=Q(Iw,e=>e,`INVALID_ARGUMENT`);Q(pT,e=>$(e));var UT=Q(Z(512),e=>e),WT=Q(uT,e=>$({...e}),`INVALID_ARGUMENT`);Q(G({id:Z(160),repeat:W}),e=>$(e));var GT=Q(K(Bw).pipe(J(Ax(64))),e=>{if(new Set(e.map(e=>e.id)).size!==e.length)throw new Y(`Reserved chords are invalid`,{code:`PROTOCOL`,retryable:!1});return $(e.map(e=>$({...e})))});function KT(e){return Q(G({value:U,version:Dw}),t=>$({value:e(t.value),version:t.version}))}var qT=KT(wT),JT=Q(G({capabilities:K(U).pipe(J(Ax(128))),context:U}),e=>$({capabilities:$(e.capabilities.map(e=>eE(e))),context:qT(e.context)})),YT=KT(OT),XT=KT(GT),ZT=KT(UT),QT=Ns(YT,e=>{if(e.value!==`connected`&&e.value!==`suspended`)throw new Y(`The host lifecycle is invalid`,{code:`PROTOCOL`,retryable:!1});return $({value:e.value,version:e.version})});function $T(e){return Q(G({handle:U,id:Z(160),version:Ow}),t=>{if(!(t.handle instanceof gw)&&!(e&&t.handle instanceof _w))throw new Y(`A capability handle is invalid`,{code:`PROTOCOL`,retryable:!1});return $({handle:t.handle,id:t.id,version:t.version})})}var eE=$T(!1),tE=$T(!0);function nE(e){let t=e?tE:eE;return Q(G({capabilities:K(U).pipe(J(Ax(128))),context:U,identity:U,lifecycle:U,reservedChords:U,theme:U}),e=>$({capabilities:$(e.capabilities.map(e=>t(e))),context:qT(e.context),identity:DT(e.identity),lifecycle:QT(e.lifecycle),reservedChords:XT(e.reservedChords),theme:ZT(e.theme)}))}var rE=nE(!1);nE(!0);function iE(e){return Q(_T,t=>t.ok?$({ok:!0,value:e(t.value)}):$({ok:!1,error:TT(t.error)}))}var aE=iE(rE),oE=iE(Q(G({commandId:Z(321)}),e=>$(e)));iE(Q(Uw,e=>{if(e.status===`failed`)return $({status:`failed`,error:uE(()=>as(e.error))});let t=e.result===void 0?void 0:rs(e.result);return $(t===void 0?{status:`handled`}:{status:`handled`,result:t})}));var sE=iE(Q(Qb,()=>void 0)),cE=iE(Q(lT,e=>e)),lE=iE(Q(Lw,e=>e));iE(Q(W,e=>e)),iE(Q(W,e=>e));function uE(e){try{return e()}catch(e){throw new Y(`The command metadata is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}}var dE=ix([G({kind:H(`saveFile`),name:Z(255).pipe(J(mx(/^[^\p{Cc}/\\]+$/u))),mime:Z(255),bytes:Rx}),G({kind:H(`copyText`),text:$b})]);function fE(e){let t=qb(dE,{onExcessProperty:`error`})(e);if(Lu(t))return{kind:`refused`,reason:`invalid-request`};let n=t.success;return n.kind===`saveFile`?n.name===`.`||n.name===`..`?{kind:`refused`,reason:`invalid-request`}:n.bytes.byteLength>33554432?{kind:`refused`,reason:`too-large`}:{...n,bytes:new Uint8Array(n.bytes)}:n.text.length>1048576||new TextEncoder().encode(n.text).byteLength>1048576?{kind:`refused`,reason:`too-large`}:n}var pE=iE(Q(ix([G({kind:H(`saved`)}),G({kind:H(`copied`)}),G({kind:H(`refused`),reason:q([`no-user-gesture`,`too-large`,`invalid-request`,`unavailable`,`denied`,`busy`])})]),e=>$(e)));function mE(e){let t=e,n=new Set;return{get:()=>t,subscribe(e){n.add(e);let t=!0;return()=>{t&&(t=!1,n.delete(e))}},update(e){if(!Object.is(t,e)){t=e;for(let e of Array.from(n))try{e(t)}catch(e){console.warn(`App store subscriber failed`,e)}}}}}function hE(e){let t=new Map,n=mE(0),r=!1,i=e=>{let t=new Map;try{for(let n of e){let e=eE(n),r=bE(e.id,e.version);if(t.has(r))throw _E(e.handle),new Y(`Duplicate capability grant`,{code:`PROTOCOL`,retryable:!1});t.set(r,e.handle)}}catch(e){for(let e of t.values())_E(e);throw e}return t};for(let[n,r]of i(e))t.set(n,r);let a=e=>{for(let t of e)_E(t)},o=e=>{if(r)throw new Y(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let n=bE(e.id,e.version);return t.get(n)};return{directory:Object.freeze({get version(){return n.get()},subscribe:e=>n.subscribe(e),has(e){return!!o(e)},require(e){let t=o(e);if(!t)throw new Y(`The capability is not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});try{return e.schema.parse(t)}catch(e){throw new Y(`The capability interface is malformed`,{cause:e,code:`PROTOCOL`,retryable:!1})}}}),replace(e){if(r)throw new Y(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let o=i(e),s=[...t.values()];t.clear();for(let[e,n]of o)t.set(e,n);a(s.filter(e=>![...o.values()].includes(e))),n.update(n.get()+1)},disconnect(){r||(r=!0,a(t.values()),t.clear(),n.update(n.get()+1))}}}var gE=Za().transform(e=>{let t=Zo(Object).safeParse(e);if(!t.success)return;let n=Object.create(t.data),r=Jb(G({[Symbol.dispose]:V(lx(Function))}))(n);return{owner:t.data,dispose:r[Symbol.dispose]}});function _E(e){try{let t=gE.parse(e);if(t===void 0||yE.has(t.owner))return;yE.add(t.owner),t.dispose?.call(t.owner)}catch(e){console.warn(`RPC value disposal failed`,e)}}function vE(e){return{value:e,[Symbol.dispose](){_E(e)}}}var yE=new WeakSet;function bE(e,t){return`${e}@${String(t)}`}var xE=class{id;version;#e;constructor(e,t,n){this.id=e,this.version=t,this.#e=n,Object.freeze(this)}get schema(){return this.#e}};function SE(e,t,n){return new xE(e,t,n)}function CE(e){let t=M(e),n=Zo(Object),r=M(Object.fromEntries(Object.keys(e).map(e=>[e,Za().optional()])));return Za().transform(e=>{let i=n.parse(e),a=Object.create(i),o=r.parse(a),s=Object.fromEntries(Object.entries(o).map(([e,t])=>[e,Ko().parse(t).bind(i)]));return{...t.parse(s),[Symbol.dispose](){_E(e)}}})}function wE(e){return Za().transform(t=>{try{return e.parse(t)}catch(e){throw e instanceof Y?e:new Y(`The capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}finally{_E(t)}})}function TE(e){return Ko({output:Wo(Za().transform(t=>{try{return e.parse(t)}catch(e){throw _E(t),e instanceof Y?e:new Y(`The capability returned a malformed result`,{cause:e,code:`PROTOCOL`,retryable:!1})}}))})}var EE=TE(wE(to()));CE({fetch:TE(Zo(Response)),close:EE});var DE=Object.freeze({alphaIntercept:-9,alphaSlope:19,blurStdDeviation:1.5}),OE=Object.freeze([`2xs`,`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`]);Object.freeze(`--stipe-font-synthesis.--stipe-surface-frame-width.--stipe-surface-frame-image.--stipe-surface-molding-contrast.--stipe-shadow-raised.--stipe-shadow-inset.--stipe-shadow-edge.--stipe-display-gasket-face.--stipe-display-texture-image.--stipe-display-text-shadow.--stipe-canvas.--stipe-surface.--stipe-surface-raised.--stipe-surface-selected.--stipe-fg-muted.--stipe-linework.--stipe-hairline.--stipe-hairline-quiet.--stipe-figure-ink.--stipe-density-compact.--stipe-density-comfortable.--stipe-motion-spring.--stipe-motion-squish.--stipe-motion-fast.--stipe-motion-normal.--stipe-motion-slow.--stipe-motion-ease.--stipe-motion-ease-exit.--stipe-motion-bounce.--stipe-motion-spring-duration.--stipe-motion-stretch.--stipe-motion-distance.--stipe-motion-stagger.--stipe-motion-blur.--stipe-motion-shake.--stipe-motion-steps.--stipe-motion-fuse.--stipe-press-depth.--stipe-press-scale.--stipe-layer-desktop.--stipe-layer-windows.--stipe-layer-chrome.--stipe-layer-popover.--stipe-layer-dialog.--stipe-layer-toast.--stipe-layer-tooltip.--stipe-overlay-shadow-outset.--stipe-icon-size-sm.--stipe-icon-size-md.--stipe-icon-size-lg.--stipe-icon-stroke.--stipe-card-rim.--stipe-card-rim-edge.--stipe-card-face.--stipe-card-panel.--stipe-card-ink.--stipe-card-ink-muted.--stipe-card-accent.--stipe-card-shadow.--stipe-card-foil-highlight.--stipe-card-foil-warm.--stipe-card-foil-cool.--stipe-avatar-shadow.--stipe-art-coral.--stipe-art-blue.--stipe-art-mint.--stipe-art-grape.--stipe-art-yellow.--stipe-art-cream.--stipe-art-ink.--stipe-art-inkcap.--stipe-art-graphite.--stipe-sketch-ink`.split(`.`));function kE(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=kE(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function AE(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=kE(e))&&(r&&(r+=` `),r+=t);return r}var jE=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ME=AE,NE=(e,t)=>n=>{if(t?.variants==null)return ME(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=jE(t)||jE(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ME(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},PE=Object.defineProperty,FE=((e,t)=>{let n={};for(var r in e)PE(n,r,{get:e[r],enumerable:!0});return t||PE(n,Symbol.toStringTag,{value:`Module`}),n})({isAny:()=>YE,isAnyNonArbitrary:()=>eD,isArbitraryFamilyName:()=>_D,isArbitraryImage:()=>yD,isArbitraryLength:()=>mD,isArbitraryNumber:()=>hD,isArbitraryPosition:()=>vD,isArbitraryShadow:()=>bD,isArbitrarySize:()=>fD,isArbitraryValue:()=>pD,isArbitraryVariable:()=>xD,isArbitraryVariableFamilyName:()=>CD,isArbitraryVariableImage:()=>ED,isArbitraryVariableLength:()=>SD,isArbitraryVariablePosition:()=>wD,isArbitraryVariableShadow:()=>DD,isArbitraryVariableSize:()=>TD,isArbitraryVariableWeight:()=>OD,isArbitraryWeight:()=>gD,isFraction:()=>WE,isInteger:()=>KE,isNamedContainerQuery:()=>tD,isNumber:()=>GE,isPercent:()=>qE,isTshirtSize:()=>JE}),IE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,LE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,RE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,BE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,VE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,HE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,UE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,WE=e=>RE.test(e),GE=e=>!!e&&!Number.isNaN(Number(e)),KE=e=>!!e&&Number.isInteger(Number(e)),qE=e=>e.endsWith(`%`)&&GE(e.slice(0,-1)),JE=e=>zE.test(e),YE=()=>!0,XE=e=>BE.test(e)&&!VE.test(e),ZE=()=>!1,QE=e=>HE.test(e),$E=e=>UE.test(e),eD=e=>!pD(e)&&!xD(e),tD=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),nD=(e,t,n)=>{let r=IE.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rD=(e,t,n=!1)=>{let r=LE.exec(e);return r?r[1]?t(r[1]):n:!1},iD=e=>e===`position`||e===`percentage`,aD=e=>e===`image`||e===`url`,oD=e=>e===`length`||e===`size`||e===`bg-size`,sD=e=>e===`length`,cD=e=>e===`number`,lD=e=>e===`family-name`,uD=e=>e===`number`||e===`weight`,dD=e=>e===`shadow`,fD=e=>nD(e,oD,ZE),pD=e=>IE.test(e),mD=e=>nD(e,sD,XE),hD=e=>nD(e,cD,GE),gD=e=>nD(e,uD,YE),_D=e=>nD(e,lD,ZE),vD=e=>nD(e,iD,ZE),yD=e=>nD(e,aD,$E),bD=e=>nD(e,dD,QE),xD=e=>LE.test(e),SD=e=>rD(e,sD),CD=e=>rD(e,lD),wD=e=>rD(e,iD),TD=e=>rD(e,oD),ED=e=>rD(e,aD),DD=e=>rD(e,dD,!0),OD=e=>rD(e,uD,!0),kD=(e,t)=>{let n=Object.keys(e);return n.length===1&&n[0]===t&&typeof e[t]==`string`},AD=e=>typeof e==`function`&&e.isThemeGetter===!0,jD=e=>({...e,theme:{...e.theme},classGroups:{...e.classGroups},conflictingClassGroups:{...e.conflictingClassGroups},conflictingClassGroupModifiers:{...e.conflictingClassGroupModifiers},orderSensitiveModifiers:[...e.orderSensitiveModifiers],postfixLookupClassGroups:[...e.postfixLookupClassGroups??[]]}),MD=(e,t)=>{let n=jD(e);t.prefix!==void 0&&(n.prefix=t.prefix);let r=(e,t)=>{if(t)for(let n in t)t[n]!==void 0&&(e[n]=t[n])},i=t.override;i&&(i.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...i.orderSensitiveModifiers]),r(n.theme,i.theme),r(n.classGroups,i.classGroups),r(n.conflictingClassGroups,i.conflictingClassGroups),r(n.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers));let a=(e,t)=>{if(t)for(let n in t){let r=t[n];r&&(e[n]=(e[n]??[]).concat(r))}},o=t.extend;return o&&(o.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...n.orderSensitiveModifiers,...o.orderSensitiveModifiers]),a(n.theme,o.theme),a(n.classGroups,o.classGroups),a(n.conflictingClassGroups,o.conflictingClassGroups),a(n.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers)),n},ND={isAny:0,isAnyNonArbitrary:1,isArbitraryValue:2,isArbitraryVariable:3,isFraction:4,isNumber:5,isInteger:6,isPercent:7,isTshirtSize:8,isNamedContainerQuery:9,isArbitraryLength:10,isArbitraryNumber:11,isArbitraryWeight:12,isArbitraryFamilyName:13,isArbitraryPosition:14,isArbitrarySize:15,isArbitraryImage:16,isArbitraryShadow:17,isArbitraryVariableLength:18,isArbitraryVariableFamilyName:19,isArbitraryVariablePosition:20,isArbitraryVariableSize:21,isArbitraryVariableImage:22,isArbitraryVariableShadow:23,isArbitraryVariableWeight:24},PD=25,FD=()=>({names:[],idByName:new Map,impls:{},fnName:new Map,classifierFns:new Map}),ID=(e,t,n)=>{let r=e.idByName.get(t);return r===void 0&&(r=e.names.length,e.names.push(t),e.idByName.set(t,r),e.classifierFns.set(t,n)),r},LD=(e,t)=>{if(typeof t==`function`){let n=e.fnName.get(t);return n===void 0&&(n=`$c`+e.fnName.size,e.fnName.set(t,n),e.impls[n]=t),ID(e,n,t)}let n=t.$v,r=FE[n];if(ND[n]===void 0||!r)throw Error(`cn: unknown validator "${n}"`);return ID(e,n,r)},RD=()=>({nextPart:new Map,validators:null,classGroupId:-1,lit:[]}),zD=(e,t)=>e.theme[t]??[],BD=(e,t,n)=>{let r=RD(),i=(e,t)=>{for(let n of t.split(`-`)){let t=e.nextPart.get(n);t||(t=RD(),e.nextPart.set(n,t)),e=t}return e},a=(n,r,o)=>{if(typeof n==`string`){let e=n===``?r:i(r,n);e.classGroupId=o;return}if(typeof n==`function`){if(AD(n)){for(let t of n(e.theme))a(t,r,o);return}(r.validators??=[]).push({validatorId:LD(t,n),groupId:o});return}if(kD(n,`$t`)){for(let t of zD(e,n.$t))a(t,r,o);return}if(kD(n,`$v`)){(r.validators??=[]).push({validatorId:LD(t,n),groupId:o});return}for(let[e,t]of Object.entries(n)){let n=i(r,e);for(let e of t)a(e,n,o)}};for(let[t,i]of Object.entries(e.classGroups)){let e=n(t);for(let t of i)a(t,r,e)}return r},VD=e=>{let t=FD(),n=[],r=new Map,i=e=>{let t=r.get(e);return t===void 0&&(t=n.length,n.push(e),r.set(e,t)),t},a=BD(e,t,i),o=e=>{if(e.validators)return!1;for(let t of e.nextPart.values())if(!o(t))return!1;return!0},s=(e,t,n)=>{e.classGroupId>=0&&n.push({tail:t,gid:e.classGroupId});for(let[r,i]of e.nextPart)s(i,t+`-`+r,n)},c=e=>{for(let[t,n]of[...e.nextPart])o(n)?(s(n,t,e.lit),e.nextPart.delete(t)):c(n)};c(a);let l=[{edges:new Map,groupId:-1,vlist:-1}],u=()=>(l.push({edges:new Map,groupId:-1,vlist:-1}),l.length-1),d=[],f=new Map,p=e=>{let t=e.map(e=>e.validatorId+`:`+e.groupId).join(`,`),n=f.get(t);return n===void 0&&(n=d.length,d.push(e.map(e=>[e.validatorId,e.groupId])),f.set(t,n)),n},m=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),i=l[n].edges.get(r);i===void 0&&(i=u(),l[n].edges.set(r,i)),n=i}return n},h=[],g=(e,t,n)=>{e.classGroupId>=0&&(l[t].groupId=e.classGroupId),e.validators&&(l[t].vlist=p(e.validators));for(let{tail:n,gid:r}of e.lit)h.push({anchor:t,tail:n,gid:r});for(let[r,i]of e.nextPart){let e=t;if(!n){let n=l[t].edges.get(45);n===void 0&&(n=u(),l[t].edges.set(45,n)),e=n}let a=m(e,r);g(i,a,!1)}};g(a,0,!0);let _=new Set(h.map(e=>e.anchor)),v=e=>l[e].groupId>=0||l[e].vlist>=0||_.has(e),y=new Map,b=[],ee=e=>{let t=b.length;y.set(e,t);let n={edges:[],groupId:l[e].groupId,vlist:l[e].vlist};b.push(n);let r=[...l[e].edges.entries()].sort((e,t)=>e[0]-t[0]);for(let[e,t]of r){let r=String.fromCharCode(e),i=t;for(;l[i].edges.size===1&&!v(i);){let[[e,t]]=l[i].edges.entries();r+=String.fromCharCode(e),i=t}n.edges.push({label:r,oldTarget:i})}for(let e of n.edges)ee(e.oldTarget);return t};ee(0);let te=b.length,ne=0;for(let e of b)ne+=e.edges.length;let re=new Int32Array(te),ie=new Int32Array(ne),x=``,S=new Int32Array(te),ae=new Int32Array(te),oe=[];{let e=0;for(let t=0;t<te;t++){let n=b[t];re[t]=n.edges.length;for(let t of n.edges)ie[e]=t.label.length,x+=t.label,oe.push(y.get(t.oldTarget)),e++;S[t]=n.groupId,ae[t]=n.vlist}}{let e=new Int32Array(te);for(let t=te-1;t>=0;t--){let n=1,r=t+1;for(let i=0;i<re[t];i++)n+=e[r],r+=e[r];e[t]=n}let t=0;for(let n=0;n<te;n++){let r=n+1;for(let i=0;i<re[n];i++){if(r!==oe[t])throw Error(`cn compiler: edge target mismatch at ${t}`);r+=e[r],t++}}}for(let e of h)e.anchor=y.get(e.anchor);{let e=new Int32Array(d.length).fill(-1),t=[];for(let n=0;n<te;n++){let r=ae[n];r>=0&&(e[r]===-1&&(e[r]=t.length,t.push(d[r])),ae[n]=e[r])}d.length=0,d.push(...t)}let C=0;for(let e of d)C+=e.length;let w=new Int32Array(C),se=new Int32Array(C);{let e=0;for(let t of d)for(let[n,r]of t)w[e]=n,se[e]=r,e++}h.sort((e,t)=>e.anchor-t.anchor||e.gid-t.gid||(e.tail<t.tail?-1:1));let ce=[];for(let e of h){let t=ce[ce.length-1];t&&t.anchor===e.anchor&&t.gid===e.gid?t.tails.push(e.tail):ce.push({anchor:e.anchor,gid:e.gid,tails:[e.tail],set:-1})}let T=new Map,le=[];for(let e of ce){let t=e.tails.join(` `),n=T.get(t);n===void 0&&(n=le.length,T.set(t,n),le.push(e.tails)),e.set=n}for(let e of le.flat())if(e.includes(`|`)||e.includes(` `))throw Error(`cn compiler: tail contains delimiter: `+e);let ue=new Set(le.flat()).size;ce.sort((e,t)=>e.anchor-t.anchor||e.set-t.set);for(let t of Object.values(e.conflictingClassGroups))for(let e of t)i(e);for(let t of Object.values(e.conflictingClassGroupModifiers))for(let e of t)i(e);for(let t of e.postfixLookupClassGroups??[])i(t);let de=n.length,fe=new Int32Array(de).fill(-1),pe=0,me=e=>(fe[e]===-1&&(fe[e]=pe++),fe[e]);for(let e=0;e<se.length;e++)se[e]=me(se[e]);for(let e of ce)e.gid=me(e.gid);for(let e=0;e<S.length;e++)S[e]>=0&&(S[e]=me(S[e]));for(let e=0;e<de;e++)fe[e]===-1&&(fe[e]=pe++);let he=Array(de);for(let e=0;e<de;e++)he[fe[e]]=n[e];let ge=[],_e=[],ve=[],ye=[],be=[];for(let t=0;t<de;t++){let n=he[t],i=(e.conflictingClassGroups[n]??[]).map(e=>fe[r.get(e)]),a=(e.conflictingClassGroupModifiers[n]??[]).map(e=>fe[r.get(e)]);i.length&&(ge.push(t),_e.push(i.length),ve.push(...i));for(let e of a)ye.push(t),be.push(e)}let xe=(e.postfixLookupClassGroups??[]).map(e=>fe[r.get(e)]),Se=[],Ce=new Int32Array(w.length);for(let e=0;e<w.length;e++){let n=t.names[w[e]],r=ND[n];if(r!==void 0)Ce[e]=r;else{let t=Se.indexOf(n);t===-1&&(t=Se.length,Se.push(n)),Ce[e]=PD+t}}let we=new Map,Te=[],Ee=[],De=[];{let e=0;for(let t of d){let n=[];for(let r=0;r<t.length;r++)n.push(Ce[e++]);let r=n.join(`,`),i=we.get(r);i===void 0&&(i=Te.length,we.set(r,i),Te.push(n.length),Ee.push(...n)),De.push(i)}}let Oe={};for(let e of Se)Oe[e]=t.classifierFns.get(e);return{G:de,customNames:Se,impls:Oe,edgeCounts:re,edgeLabelLen:ie,labelText:x,edgeTargetActual:oe,nodeGroup:S,nodeVlist:ae,nodeCount:te,totalEdges:ne,patCounts:Te,patOps:Ee,listPat:De,vlistGroup:se,litEntries:h,sets:le,attachments:ce,uniqueTailCount:ue,adjGid:ge,adjCnt:_e,adjTgt:ve,patGid:ye,patTgt:be,postfixLookup:xe,orderSensitiveModifiers:e.orderSensitiveModifiers.join(` `),prefix:e.prefix}},HD=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},UD=e=>{let t=VD(e),n=t.litEntries.length,r=new Int32Array(n),i=new Int32Array(n),a=new Int32Array(n),o=``,s=new Int32Array(t.uniqueTailCount*2);{let e=new Map,n=0,c=0;for(let l of t.attachments)for(let u of t.sets[l.set]){let t=e.get(u);t===void 0&&(t=n++,e.set(u,t),s[t*2]=o.length,s[t*2+1]=u.length,o+=u),r[c]=l.anchor,i[c]=l.gid,a[c]=t,c++}}return{tables:{GROUP_COUNT:t.G,edgeStart:HD(t.edgeCounts),labelStart:HD(t.edgeLabelLen),labelText:t.labelText,edgeTarget:Int32Array.from(t.edgeTargetActual),nodeGroup:t.nodeGroup,nodeVlist:t.nodeVlist,vlistPat:HD(t.patCounts),vlistOps:Int32Array.from(t.patOps),vlistRef:Int32Array.from(t.listPat),vlistGroup:t.vlistGroup,litAnchor:r,litGroup:i,litPool:a,poolOffsets:s,poolText:o,adjGid:Int32Array.from(t.adjGid),adjStart:HD(t.adjCnt),adjTgt:Int32Array.from(t.adjTgt),patGid:Int32Array.from(t.patGid),patTgt:Int32Array.from(t.patTgt),postfixLookupGroups:Int32Array.from(t.postfixLookup),customValidatorNames:t.customNames,orderSensitiveModifiers:t.orderSensitiveModifiers},validatorImpls:t.impls,prefix:t.prefix}},WD=`line`in Error(),GD=-1,KD=-1,qD=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},JD=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},YD=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:ee,patGid:te,patTgt:ne,postfixLookupGroups:re,customValidatorNames:ie,orderSensitiveModifiers:x}=e,S=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)S[y[e]]=e;let ae=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>ae&&(ae=t)}let oe=32;for(;oe<2*(1+ae+te.length);)oe<<=1;let C=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)C[e+1]=C[e]+u[f[e]+1]-u[f[e]];let w=new Uint8Array(r);for(let e=0;e<re.length;e++)w[re[e]]=1;let se=i.length-1,ce=new Uint8Array(se),T=0,le=!0;for(let e=0;e<m.length;e++){ce[m[e]]=1;let t=_[g[e]*2+1];t>T&&(T=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(le=!1)}let ue=1;for(;ue<m.length*2;)ue<<=1;let de=new Int32Array(ue).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(qD(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&ue-1;for(;de[n]!==-1;)n=n+1&ue-1;de[n]=e}let fe=(e,t,n,r)=>{let i=(qD(t,n,r)^Math.imul(e,2654435761)|0)&ue-1,a=r-n;for(;;){let r=de[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&ue-1}},pe=n.cacheSize??8192,me=n.prefix??e.prefix??``,he=me===``?``:me+`:`,ge=he.length,_e=(ie??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ve=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ye=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,be=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Se=0,Ce=-1,we=-1,Te=-1,Ee=-1,De=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,Oe=e=>/\s/.test(String.fromCharCode(e)),ke=(e,t,n)=>{if(Se=0,Ce=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)Se=1;else if(r===40&&i===41)Se=2;else return;Te=t+1,Ee=n-1;let a=t+1;if(De(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!De(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(Ce=t+1,we=a,Te=a+1)}},Ae=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},je=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ne=e=>!!e&&!Number.isNaN(Number(e)),Pe=(e,t,n)=>{if(n-t<11||!Ae(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&Ae(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&Ae(e,t+10,t+18,`-normal/`)},Fe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Ie=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),Le=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Re=(e,t,n,r)=>{if(e>=10){if(e>=25)return _e[e-25](t.slice(n,r));let i=e-10;if(Se!==Fe[i])return!1;if(Ce>=0){for(let e of Ie[i])if(Ae(t,Ce,we,e))return!0;return!1}switch(Le[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(Te,Ee);return ve.test(e)&&!ye.test(e)}case 3:return Ne(t.slice(Te,Ee));case 4:return xe.test(t.slice(Te,Ee));default:return be.test(t.slice(Te,Ee))}}switch(e){case 0:return!0;case 1:return Se===0;case 2:return Se===1;case 3:return Se===2;case 4:return je.test(t.slice(n,r));case 5:return Ne(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&Ne(t.slice(n,r-1));case 8:return Me.test(t.slice(n,r));default:return Pe(t,n,r)}},ze=new Set(typeof x==`string`?x.split(` `):x),Be=(e,t,n,r,i,a)=>{let o=qD(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ve=new Map,He=new Map,Ue=2,We=4096,Ge=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ze.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=He.get(s);return c===void 0&&He.set(s,c=Ue++),c},Ke=new Map,qe=r,Je=r+4096,Ye=()=>qe++,Xe=2097152,Ze=8192,Qe=new Int32Array(Ze),$e=Array(Ze).fill(null),et=new Int32Array(Ze),tt=new Int32Array(Ze),nt=new Uint8Array(Ze),rt=0,it=(e,t,n,r,i,a,o,s)=>{let c=e;if($e[e]!==null){if($e[e|1]===null)c=e|1;else if(!(rt++&3))c=e|rt>>2&1;else return}$e[c]=t.slice(n,r),Qe[c]=i,et[c]=a,tt[c]=o,nt[c]=s},at=()=>$e.fill(null),ot=256,st=[new Int32Array(ot),new Int32Array(ot),new Int32Array(ot),new Int32Array(ot)],[ct,lt,ut,dt]=st,ft=new Uint8Array(ot),pt=new Uint8Array(ot),mt=()=>{ot*=2,st=st.map(e=>{let t=new Int32Array(ot);return t.set(e),t}),[ct,lt,ut,dt]=st;let e=new Uint8Array(ot);e.set(ft),ft=e,pt=new Uint8Array(ot)},ht=64,gt=new Int32Array(ht),_t=new Int32Array(ht),vt=new Int32Array(r),yt=2048,bt=21,xt=new Float64Array(yt),St=new Int32Array(yt),Ct=0,wt=(e,t)=>{if(e===0&&t<r)return vt[t]===Ct?1:(vt[t]=Ct,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>bt;for(;St[i]===Ct;){if(xt[i]===n)return 1;i=i+1&yt-1}return xt[i]=n,St[i]=Ct,0},Tt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?GD:Be(Ke,e,t+1,r,0,Ye)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=_t[t];if(r>n)continue;let i=gt[t],a=n-r;if(ce[i]===1&&a>0&&a<=T){let t=e.charCodeAt(r);if(le===!1||t!==91&&t!==40){let t=fe(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;ke(e,r,n);let h=C[o]-c;for(let t=c;t<m;t++)if(Re(d[t],e,r,n))return p[h+t]}return GD},Et=e=>{let t=e.length,n=0,c=0,u=!1;(Ue>We||Ve.size>We)&&(Ve=new Map,He=new Map,Ue=2,at()),qe>Je&&(Ke=new Map,qe=r,at());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&Oe(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&Oe(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===ot&&mt();let _=n++;ct[_]=p,lt[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Qe[y]===v&&$e[y]!==null&&$e[y].length===g?t=y:Qe[y|1]===v&&$e[y|1]!==null&&$e[y|1].length===g&&(t=y|1),t>=0){let n=$e[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){ut[_]=et[t],dt[_]=tt[t],ft[_]=nt[t];continue}}}let b=p;if(ge!==0){if(h-p<=ge||!e.startsWith(he,p)){ut[_]=GD,it(y,e,p,h,v,GD,0,0);continue}b=p+ge}let ee=0,te=0,ne=-1,re=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(ee===0&&te===0){if(n===58){ne=t;continue}if(n===47){re=t;continue}}n===91?ee++:n===93?ee--:n===40?te++:n===41&&te--}let ie=ne>=b?ne+1:b,x=ie,S=h,ae=!1,oe=0;S>x&&e.charCodeAt(S-1)===33?(ae=!0,S--):S>x&&e.charCodeAt(x)===33&&(ae=!0,x++,oe=1);let C=-1;re>ie&&(C=re+oe,C>=S&&(C=-1));let se=x;S-x>1&&e.charCodeAt(x)===45&&(se=x+1);let T=0,le=0,ue=0,de=-1,fe=0;(l[0]>=0||ce[0]===1)&&(gt[0]=0,_t[0]=se,fe=1);let pe=KD,me=0;for(let t=se;t<S;t++)if(t===C&&(pe=le<ue?KD:T,me=fe),T!==KD){let n=e.charCodeAt(t),r=-1;if(le<ue)o.charCodeAt(le)===n?(le++,le===ue&&(r=T=de)):T=KD;else{let e=i[T],t=i[T+1],c=KD;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(le=e+1,ue=a[i+1],de=s[i],c=T);break}}T=c}if(r>=0&&(l[r]>=0||ce[r]===1)&&t+1<S&&e.charCodeAt(t+1)===45){if(fe===ht){ht*=2;let e=new Int32Array(ht);e.set(gt),gt=e;let t=new Int32Array(ht);t.set(_t),_t=t}gt[fe]=r,_t[fe]=t+2,fe++}}C===S&&(pe=le<ue?KD:T,me=fe);let _e=le<ue?KD:T,ve,ye=!1;if(C>=0){if(ye=!0,ve=Tt(e,x,C,pe,me),ve!==GD&&ve<r&&w[ve]){let t=Tt(e,x,S,_e,fe);t!==GD&&t!==ve&&(ve=t,ye=!1)}else ve===GD&&(ve=Tt(e,x,S,_e,fe),ye=!1)}else ve=Tt(e,x,S,_e,fe);let be=0,xe=0;ve===GD?ut[_]=GD:(xe=+!!ye,be=b>=ne?+!!ae:Be(Ve,e,b,ne,+!!ae,e=>Ge(e,ae)),ut[_]=ve,ft[_]=xe,dt[_]=be),it(y,e,p,h,v,ve,be,xe)}if(n===0)return``;if(n===1)return ct[0]===0&<[0]===t?e:e.slice(ct[0],lt[0]);if(n*oe>yt){for(;n*oe>yt;)yt<<=1,bt--;xt=new Float64Array(yt),St=new Int32Array(yt)}if(Ue>=Xe||qe>=Xe)throw Error(`cn: too many distinct classes in one merge`);Ct=Ct+1|0,Ct===0&&(vt.fill(0),St.fill(0),Ct=1);let f=!1;for(let e=n-1;e>=0;e--){let t=ut[e];if(t===GD){pt[e]=1;continue}let n=dt[e];if(wt(n,t)===1){pt[e]=0,f=!0;continue}if(pt[e]=1,t<r){let r=S[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)wt(n,ee[e]);if(ft[e]&1)for(let e=0;e<te.length;e++)te[e]===t&&wt(n,ne[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!pt[m]){m++;continue}let t=ct[m],r=lt[m],i=m+1;for(;i<n&&pt[i]&&ct[i]===r+1&&e.charCodeAt(r)===32;)r=lt[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},Dt=16384,Ot=new Int32Array(Dt*2),kt=0,At=1,jt=Object.create(null),Mt=Object.create(null),Nt=new Map,Pt=new Map,Ft=0,It=0,Lt=()=>{kt^=Dt,At=At+1|0,It=0},Rt=e=>{let t=jt[e];if(t!==void 0)return t;let n=JD(e,0,e.length),r=(n&16383)+kt,i=Ot[r]===(n^At)||Ot[r^Dt]===(n^At-1);return i&&(t=Mt[e],t!==void 0)?(jt[e]=t,t):(t=Et(e),i?(jt[e]=t,++Ft>pe&&(Ft=0,Mt=jt,jt=Object.create(null),Lt())):(Ot[r]=n^At,++It>Dt&&Lt()),t)},zt=e=>{let t=Nt.get(e);if(t!==void 0)return t;let n=JD(e,0,e.length),r=(n&16383)+kt,i=Ot[r]===(n^At)||Ot[r^Dt]===(n^At-1);return i&&(t=Pt.get(e),t!==void 0)?(Nt.set(e,t),t):(t=Et(e),i?(Nt.set(e,t),++Ft>pe&&(Ft=0,Pt=Nt,Nt=new Map,Lt())):(Ot[r]=n^At,++It>Dt&&Lt()),t)},E=e=>{let t=JD(e,0,e.length),n=(t&16383)+kt;return Ot[n]===(t^At)||Ot[n^Dt]===(t^At-1)||(Ot[n]=t^At,++It>Dt&&Lt(),!1)},Bt=pe===0?Et:WD?e=>{let t=Nt.get(e);return t===void 0?zt(e):t}:Rt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?Bt(arguments[0]):Bt(QD.apply(null,arguments))},mergeString:Bt,seenBefore:pe===0?()=>!1:E,mergeUncached:Et}},XD=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:XD(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},ZD=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:XD(i,t);a&&(n&&(n+=` `),n+=a)}return n},QD=function(){return ZD(arguments,!1)},$D=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},l=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},u=(t,c)=>{let u=t.length,d=s===null?null:s.n;if(!c){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let f=``,p=-1,m=0,h=!1;for(let e=0;e<u;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=XD(n,!0),!n)continue;h=!0}p<0&&(f=n,p=e),m++}}if(m===0)return``;if(m===1)return e(f);if(h){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let g=i.get(f);g===void 0&&(g=a.get(f),g!==void 0&&i.set(f,g));let _=null;if(g!==void 0)outer:for(let e=0;e<g.length;e++){let n=g[e];if(n.t!==m)continue;let r=n.a,i=1;for(let e=p+1;e<u;e++){let n=t[e];if(n&&n!==r[i++])continue outer}_=n;break}if(_===null){let s=f,c=[f];for(let e=p+1;e<u;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);_={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},g===void 0&&i.set(f,g=[]),g.length>=256&&g.shift(),g.push(_),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==_&&(s.n=_),s=_,_.r},d=t=>Array.isArray(t)?u(t.slice(),!1):e(XD(t,!0));return function(t,n,r){let i=arguments.length;if((i|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&c(i,t,n,r))return s=i,i.r;if(e!==i&&c(e,t,n,r))return e.r}return u([t,n,r],!0)}if(i===1)return typeof t==`string`?e(t):d(t);let a=s;if(a!==null){let e=a.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<i;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(a!==e){let e=a.a,t=0,n=!0;for(let r=0;r<i;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===a.t)return a.r}}let o=[];for(let e=0;e<i;e++)o.push(arguments[e]);return u(o,!0)}},eO=`{"theme":{"animate":[{"$v":"isAny"}],"aspect":["video"],"blur":[{"$v":"isTshirtSize"}],"breakpoint":[{"$v":"isTshirtSize"}],"color":[{"$v":"isAny"}],"container":[{"$v":"isTshirtSize"}],"drop-shadow":[{"$v":"isTshirtSize"}],"ease":["in","out","in-out"],"font":[{"$v":"isAnyNonArbitrary"}],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[{"$v":"isTshirtSize"}],"leading":["none","tight","snug","normal","relaxed","loose"],"perspective":["dramatic","near","normal","midrange","distant","none"],"radius":[{"$v":"isTshirtSize"}],"shadow":[{"$v":"isTshirtSize"}],"spacing":["px",{"$v":"isNumber"}],"text":[{"$v":"isTshirtSize"}],"text-shadow":[{"$v":"isTshirtSize"}],"tracking":["tighter","tight","normal","wide","wider","widest"]},"classGroups":{"aspect":[{"aspect":["auto","square",{"$v":"isFraction"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"aspect"}]}],"container":["container"],"container-type":[{"@container":["","normal","size",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"container-named":[{"$v":"isNamedContainerQuery"}],"columns":[{"columns":[{"$v":"isNumber"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"container"}]},"columns-auto"],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],"box":[{"box":["border","content"]}],"display":["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],"sr":["sr-only","not-sr-only"],"float":[{"float":["right","left","none","start","end"]}],"clear":[{"clear":["left","right","both","none","start","end"]}],"isolation":["isolate","isolation-auto"],"object-fit":[{"object":["contain","cover","fill","none","scale-down"]}],"object-position":[{"object":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"overflow":[{"overflow":["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],"overscroll":[{"overscroll":["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],"position":["static","fixed","absolute","relative","sticky"],"inset":[{"inset":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-x":[{"inset-x":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-y":[{"inset-y":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"start":[{"inset-s":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"start":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"end":[{"inset-e":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"end":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-bs":[{"inset-bs":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-be":[{"inset-be":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"top":[{"top":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"right":[{"right":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"bottom":[{"bottom":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"left":[{"left":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"visibility":["visible","invisible","collapse"],"z":[{"z":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"basis":[{"basis":[{"$v":"isFraction"},"full","auto",{"$t":"container"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"flex-direction":[{"flex":["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{"flex":["nowrap","wrap","wrap-reverse"]}],"flex":[{"flex":[{"$v":"isNumber"},{"$v":"isFraction"},"auto","initial","none",{"$v":"isArbitraryValue"}]}],"grow":[{"grow":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shrink":[{"shrink":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"order":[{"order":[{"$v":"isInteger"},"first","last","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-cols":[{"grid-cols":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start-end":[{"col":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start":[{"col-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-end":[{"col-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-rows":[{"grid-rows":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start-end":[{"row":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start":[{"row-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-end":[{"row-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-cols":[{"$t":"spacing"}]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-rows":[{"$t":"spacing"}]}],"gap":[{"gap":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-x":[{"gap-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-y":[{"gap-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"justify-content":[{"justify":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{"content":["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{"items":["start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"align-self":[{"self":["auto","start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"p":[{"p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"px":[{"px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"py":[{"py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ps":[{"ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pe":[{"pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbs":[{"pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbe":[{"pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pt":[{"pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pr":[{"pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pb":[{"pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pl":[{"pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"m":[{"m":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mx":[{"mx":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"my":[{"my":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ms":[{"ms":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"me":[{"me":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbs":[{"mbs":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbe":[{"mbe":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mt":[{"mt":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mr":[{"mr":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mb":[{"mb":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ml":[{"ml":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x":[{"space-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-y-reverse":["space-y-reverse"],"size":[{"size":[{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inline-size":[{"inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"inline":[{"$t":"container"}]}],"min-inline-size":[{"min-inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"min-inline":[{"$t":"container"}]}],"max-inline-size":[{"max-inline":["none",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"max-inline":[{"$t":"container"}]}],"block-size":[{"block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-block-size":[{"min-block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-block-size":[{"max-block":["none",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"w":[{"w":[{"$t":"container"},"screen",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-w":[{"min-w":[{"$t":"container"},"screen","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-w":[{"max-w":[{"$t":"container"},"screen","none","prose",{"screen":[{"$t":"breakpoint"}]},{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"h":[{"h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-h":[{"min-h":["screen","lh","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-h":[{"max-h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},"max-h-none"],"font-size":[{"text":["base",{"$t":"text"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{"font":[{"$t":"font-weight"},{"$v":"isArbitraryVariableWeight"},{"$v":"isArbitraryWeight"}]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",{"$v":"isPercent"},{"$v":"isArbitraryValue"}]}],"font-family":[{"font":[{"$v":"isArbitraryVariableFamilyName"},{"$v":"isArbitraryFamilyName"},{"$t":"font"}]}],"font-features":[{"font-features":[{"$v":"isArbitraryValue"}]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],"tracking":[{"tracking":[{"$t":"tracking"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"line-clamp":[{"line-clamp":[{"$v":"isNumber"},"none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryNumber"}]}],"leading":[{"leading":[{"$t":"leading"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"list-image":[{"list-image":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"list-style-position":[{"list":["inside","outside"]}],"list-style-type":[{"list":["disc","decimal","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-alignment":[{"text":["left","center","right","justify","start","end"]}],"placeholder-color":[{"placeholder":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-color":[{"text":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{"decoration":["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{"decoration":[{"$v":"isNumber"},"from-font","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryLength"}]}],"text-decoration-color":[{"decoration":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"underline-offset":[{"underline-offset":[{"$v":"isNumber"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{"text":["wrap","nowrap","balance","pretty"]}],"indent":[{"indent":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"tab-size":[{"tab":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"vertical-align":[{"align":["baseline","top","middle","bottom","text-top","text-bottom","sub","super",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"whitespace":[{"whitespace":["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],"break":[{"break":["normal","words","all","keep"]}],"wrap":[{"wrap":["break-word","anywhere","normal"]}],"hyphens":[{"hyphens":["none","manual","auto"]}],"content":[{"content":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"bg-attachment":[{"bg":["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{"bg":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-repeat":[{"bg":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"bg-size":[{"bg":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-image":[{"bg":["none",{"linear":[{"to":["t","tr","r","br","b","bl","l","tl"]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"radial":["",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"conic":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isArbitraryVariableImage"},{"$v":"isArbitraryImage"}]},{"bg-gradient-to":["t","tr","r","br","b","bl","l","tl"]},"bg-conic"],"bg-color":[{"bg":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-from-pos":[{"from":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-via-pos":[{"via":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-to-pos":[{"to":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-from":[{"from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-via":[{"via":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-to":[{"to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded":[{"rounded":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-s":[{"rounded-s":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-e":[{"rounded-e":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-t":[{"rounded-t":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-r":[{"rounded-r":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-b":[{"rounded-b":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-l":[{"rounded-l":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ss":[{"rounded-ss":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-se":[{"rounded-se":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ee":[{"rounded-ee":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-es":[{"rounded-es":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tl":[{"rounded-tl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tr":[{"rounded-tr":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-br":[{"rounded-br":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-bl":[{"rounded-bl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-w":[{"border":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-x":[{"border-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-y":[{"border-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-s":[{"border-s":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-e":[{"border-e":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-bs":[{"border-bs":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-be":[{"border-be":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-t":[{"border-t":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-r":[{"border-r":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-b":[{"border-b":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-l":[{"border-l":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x":[{"divide-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{"border":["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{"divide":["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{"border":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-x":[{"border-x":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-y":[{"border-y":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-s":[{"border-s":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-e":[{"border-e":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-bs":[{"border-bs":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-be":[{"border-be":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-t":[{"border-t":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-r":[{"border-r":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-b":[{"border-b":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-l":[{"border-l":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"divide-color":[{"divide":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-style":[{"outline":["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-w":[{"outline":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"outline-color":[{"outline":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shadow":[{"shadow":["","none",{"$t":"shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]},"shadow-inner"],"shadow-color":[{"shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-shadow":[{"inset-shadow":["none",{"$t":"inset-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"inset-shadow-color":[{"inset-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-w":[{"ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"ring-w-inset":["ring-inset"],"ring-color":[{"ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-offset-w":[{"ring-offset":[{"$v":"isNumber"},{"$v":"isArbitraryLength"}]}],"ring-offset-color":[{"ring-offset":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-ring-w":[{"inset-ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"inset-ring-color":[{"inset-ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-shadow":[{"text-shadow":["none",{"$t":"text-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"text-shadow-color":[{"text-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"opacity":[{"opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{"mask":["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[{"$v":"isNumber"}]}],"mask-image-linear-from-pos":[{"mask-linear-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-to-pos":[{"mask-linear-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-from-color":[{"mask-linear-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-linear-to-color":[{"mask-linear-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-from-pos":[{"mask-t-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-to-pos":[{"mask-t-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-from-color":[{"mask-t-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-to-color":[{"mask-t-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-from-pos":[{"mask-r-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-to-pos":[{"mask-r-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-from-color":[{"mask-r-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-to-color":[{"mask-r-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-from-pos":[{"mask-b-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-to-pos":[{"mask-b-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-from-color":[{"mask-b-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-to-color":[{"mask-b-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-from-pos":[{"mask-l-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-to-pos":[{"mask-l-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-from-color":[{"mask-l-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-to-color":[{"mask-l-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-from-pos":[{"mask-x-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-to-pos":[{"mask-x-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-from-color":[{"mask-x-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-to-color":[{"mask-x-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-from-pos":[{"mask-y-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-to-pos":[{"mask-y-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-from-color":[{"mask-y-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-to-color":[{"mask-y-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial":[{"mask-radial":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-from-pos":[{"mask-radial-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-to-pos":[{"mask-radial-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-from-color":[{"mask-radial-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-to-color":[{"mask-radial-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{"closest":["side","corner"],"farthest":["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[{"$v":"isNumber"}]}],"mask-image-conic-from-pos":[{"mask-conic-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-to-pos":[{"mask-conic-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-from-color":[{"mask-conic-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-conic-to-color":[{"mask-conic-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-mode":[{"mask":["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{"mask":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-repeat":[{"mask":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"mask-size":[{"mask":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{"mask":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"filter":[{"filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"blur":[{"blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"brightness":[{"brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contrast":[{"contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"drop-shadow":[{"drop-shadow":["","none",{"$t":"drop-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"drop-shadow-color":[{"drop-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grayscale":[{"grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"hue-rotate":[{"hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"invert":[{"invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"saturate":[{"saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"sepia":[{"sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-filter":[{"backdrop-filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-blur":[{"backdrop-blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-brightness":[{"backdrop-brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-contrast":[{"backdrop-contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-grayscale":[{"backdrop-grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-invert":[{"backdrop-invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-opacity":[{"backdrop-opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-saturate":[{"backdrop-saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-sepia":[{"backdrop-sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-collapse":[{"border":["collapse","separate"]}],"border-spacing":[{"border-spacing":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-x":[{"border-spacing-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-y":[{"border-spacing-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"table-layout":[{"table":["auto","fixed"]}],"caption":[{"caption":["top","bottom"]}],"transition":[{"transition":["","all","colors","opacity","shadow","transform","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transition-behavior":[{"transition":["normal","discrete"]}],"duration":[{"duration":[{"$v":"isNumber"},"initial",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ease":[{"ease":["linear","initial",{"$t":"ease"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"delay":[{"delay":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"animate":[{"animate":["none",{"$t":"animate"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backface":[{"backface":["hidden","visible"]}],"perspective":[{"perspective":[{"$t":"perspective"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"perspective-origin":[{"perspective-origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate":[{"rotate":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-x":[{"rotate-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-y":[{"rotate-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-z":[{"rotate-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale":[{"scale":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-x":[{"scale-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-y":[{"scale-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-z":[{"scale-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-3d":["scale-3d"],"skew":[{"skew":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-x":[{"skew-x":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-y":[{"skew-y":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform":[{"transform":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},"","none","gpu","cpu"]}],"transform-origin":[{"origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform-style":[{"transform":["3d","flat"]}],"translate":[{"translate":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-x":[{"translate-x":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-y":[{"translate-y":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-z":[{"translate-z":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-none":["translate-none"],"zoom":[{"zoom":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"accent":[{"accent":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"appearance":[{"appearance":["none","auto"]}],"caret-color":[{"caret":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"color-scheme":[{"scheme":["normal","dark","light","light-dark","only-dark","only-light"]}],"cursor":[{"cursor":["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],"resize":[{"resize":["none","","y","x"]}],"scroll-behavior":[{"scroll":["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-track-color":[{"scrollbar-track":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{"scrollbar":["auto","thin","none"]}],"scroll-m":[{"scroll-m":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mx":[{"scroll-mx":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-my":[{"scroll-my":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ms":[{"scroll-ms":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-me":[{"scroll-me":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbs":[{"scroll-mbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbe":[{"scroll-mbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mt":[{"scroll-mt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mr":[{"scroll-mr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mb":[{"scroll-mb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ml":[{"scroll-ml":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-p":[{"scroll-p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-px":[{"scroll-px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-py":[{"scroll-py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ps":[{"scroll-ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pe":[{"scroll-pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbs":[{"scroll-pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbe":[{"scroll-pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pt":[{"scroll-pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pr":[{"scroll-pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pb":[{"scroll-pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pl":[{"scroll-pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"snap-align":[{"snap":["start","end","center","align-none"]}],"snap-stop":[{"snap":["normal","always"]}],"snap-type":[{"snap":["none","x","y","both"]}],"snap-strictness":[{"snap":["mandatory","proximity"]}],"touch":[{"touch":["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],"select":[{"select":["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"fill":[{"fill":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"stroke-w":[{"stroke":[{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"},{"$v":"isArbitraryNumber"}]}],"stroke":[{"stroke":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}],"contain":[{"contain":["none","content","strict",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contain-size":[{"contain":["size","inline-size"]}],"contain-layout":["contain-layout"],"contain-paint":["contain-paint"],"contain-style":["contain-style"]},"conflictingClassGroups":{"container-named":["container-type"],"overflow":["overflow-x","overflow-y"],"overscroll":["overscroll-x","overscroll-y"],"inset":["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],"flex":["basis","grow","shrink"],"gap":["gap-x","gap-y"],"p":["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],"px":["pr","pl"],"py":["pt","pb"],"m":["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],"mx":["mr","ml"],"my":["mt","mb"],"size":["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],"rounded":["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"translate":["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],"touch":["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"],"contain":["contain-size","contain-layout","contain-paint","contain-style"],"contain-size":["contain"],"contain-layout":["contain"],"contain-paint":["contain"],"contain-style":["contain"]},"conflictingClassGroupModifiers":{"font-size":["leading"]},"orderSensitiveModifiers":["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"],"postfixLookupClassGroups":["container-type"]}`,tO=()=>JSON.parse(eO),nO=e=>`classGroups`in e&&`theme`in e&&`conflictingClassGroups`in e,rO=e=>e===void 0?{config:tO()}:typeof e==`function`?{config:e(tO())}:nO(e)?{config:e}:{config:MD(tO(),e),cacheSize:e.cacheSize},iO=e=>{let{config:t,cacheSize:n}=rO(e),{tables:r,validatorImpls:i,prefix:a}=UD(t);return YD(r,i,{cacheSize:n,prefix:a})},aO=(e=>{let t=null,n=()=>t??=iO(e);return $D(e=>n().mergeString(e),{seenBefore:e=>n().seenBefore(e),mergeUncached:e=>n().mergeUncached(e)})})({extend:{theme:{spacing:[...OE]}}});function oO(e,t){return typeof e==`function`?e(t):e}function sO(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function cO(...e){return t=>{let n=!1,r=e.map(e=>{let r=sO(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():sO(e[t],null)}}}}function lO(...e){return P.useCallback(cO(...e),e)}function uO(e){let t=P.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];vO(r)&&typeof SO==`function`&&(r=SO(r._payload)),P.Children.forEach(r,e=>{if(gO(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;vO(n)&&typeof SO==`function`&&(n=SO(n._payload)),a=pO(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=P.cloneElement(a,void 0,s):!o&&P.Children.count(r)===1&&P.isValidElement(r)&&(a=r);let c=a?hO(a):void 0,l=lO(n,c);if(!a){if(r||r===0)throw Error(o?xO(e):bO(e));return r}let u=mO(i,a.props??{});return a.type!==P.Fragment&&(u.ref=n?l:c),P.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var dO=uO(`Slot`),fO=Symbol.for(`radix.slottable`),pO=(e,t)=>{if(`child`in e.props){let t=e.props.child;return P.isValidElement(t)?P.cloneElement(t,void 0,e.props.children(t.props.children)):null}return P.isValidElement(t)?t:null};function mO(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function hO(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function gO(e){return P.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===fO}var _O=Symbol.for(`react.lazy`);function vO(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===_O&&`_payload`in e&&yO(e._payload)}function yO(e){return typeof e==`object`&&!!e&&`then`in e}var bO=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,xO=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,SO=P.use,CO=Object.freeze({reduced:!1,squish:90,fast:120,normal:180,slow:280,springDuration:320,bounce:.3,stretch:.28,distance:4,stagger:24,blur:0,shake:3,steps:0,fuse:1,pressDepth:.5,pressScale:1,ease:`cubic-bezier(0.2, 0, 0, 1)`,easeExit:`cubic-bezier(0.4, 0, 1, 1)`}),wO=`(prefers-reduced-motion: reduce)`;function TO(e){let t=e.ownerDocument.defaultView;if(!t)return CO;let n=t.getComputedStyle(e),r=(e,t)=>{let r=n.getPropertyValue(e).trim(),i=Number.parseFloat(r);return Number.isFinite(i)?Math.max(0,i):t},i=(e,t)=>{let i=n.getPropertyValue(e).trim();return r(e,t)*(i.endsWith(`s`)&&!i.endsWith(`ms`)?1e3:1)},a=t.matchMedia?.(wO).matches??!1,o=(e,t)=>a?120:i(`--stipe-motion-${e}`,t),s=(e,t)=>a?0:r(`--stipe-motion-${e}`,t);return{reduced:a,squish:o(`squish`,CO.squish),fast:o(`fast`,CO.fast),normal:o(`normal`,CO.normal),slow:o(`slow`,CO.slow),springDuration:o(`spring-duration`,CO.springDuration),bounce:Math.min(1,s(`bounce`,CO.bounce)),stretch:s(`stretch`,CO.stretch),distance:s(`distance`,CO.distance),stagger:a?0:i(`--stipe-motion-stagger`,CO.stagger),blur:s(`blur`,CO.blur),shake:s(`shake`,CO.shake),steps:Math.floor(s(`steps`,CO.steps)),fuse:r(`--stipe-motion-fuse`,CO.fuse),pressDepth:a?0:r(`--stipe-press-depth`,CO.pressDepth),pressScale:a?1:r(`--stipe-press-scale`,CO.pressScale),ease:n.getPropertyValue(`--stipe-motion-ease`).trim()||CO.ease,easeExit:n.getPropertyValue(`--stipe-motion-ease-exit`).trim()||CO.easeExit}}function EO(e){let[t,n]=(0,P.useState)(()=>({...CO,reduced:!0}));return(0,P.useLayoutEffect)(()=>{let t=e.current,r=t?.ownerDocument.defaultView;if(!t||!r)return;let i=()=>{let e=TO(t);n(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)};i();let a=new r.MutationObserver(i);for(let e=t;e;e=e.parentElement)a.observe(e,{attributes:!0,attributeFilter:[`data-theme`,`class`,`style`]});let o=r.matchMedia?.(wO);return o?.addEventListener(`change`,i),()=>{a.disconnect(),o?.removeEventListener(`change`,i)}},[e]),t}function DO(e,t){return e.reduced?0:Math.round(t*e.normal/CO.normal)}function OO(e,t){if(e.reduced)return 0;let n=t*e.bounce/CO.bounce;return Math.min(.9,Math.max(0,n))}function kO(e,t){return e.reduced?0:Math.round(t*e.springDuration/CO.springDuration)}function AO(e,t){return e.steps>0?`steps(${String(e.steps)}, end)`:t}function jO(e){return`animate`in e}var MO=globalThis;function NO(){return MO.matchMedia?.(wO).matches??!1}function PO(e){let t=MO.matchMedia?.(wO);return t?.addEventListener(`change`,e),()=>{t?.removeEventListener(`change`,e)}}function FO(){return!0}function IO(){return(0,P.useSyncExternalStore)(PO,NO,FO)}var LO=(0,P.forwardRef)(function({asChild:e=!1,className:t,...n},r){let i=aO(`absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]`,t);return e?(0,X.jsx)(dO,{...n,className:i,ref:r}):(0,X.jsx)(`span`,{...n,className:i,ref:r})}),RO=(0,P.forwardRef)(function({id:e,transform:t},n){return(0,X.jsxs)(`radialGradient`,{ref:n,id:e,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`-1.6`,r:`5.6`,gradientTransform:t,children:[(0,X.jsx)(`stop`,{offset:`0`,stopColor:`color-mix(in oklab, var(--color-white) calc(var(--depth) * 50%), currentColor)`}),(0,X.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`})]})});function zO({id:e}){return(0,X.jsx)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,X.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1`,floodColor:`currentColor`,style:{floodOpacity:`calc(var(--depth) * 0.6)`}})})}function BO({id:e}){return(0,X.jsxs)(`filter`,{id:e,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,X.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.3`,result:`soft-edge`}),(0,X.jsx)(`feOffset`,{in:`soft-edge`,dx:`0.25`,dy:`0.45`,result:`lower-edge`}),(0,X.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`lower-edge`,operator:`out`,result:`inner-shadow`}),(0,X.jsx)(`feFlood`,{floodColor:`var(--color-black)`,floodOpacity:`calc(var(--depth) * 0.28)`}),(0,X.jsx)(`feComposite`,{in2:`inner-shadow`,operator:`in`,result:`shade`}),(0,X.jsx)(`feOffset`,{in:`soft-edge`,dx:`-0.2`,dy:`-0.35`,result:`upper-edge`}),(0,X.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`upper-edge`,operator:`out`,result:`inner-highlight`}),(0,X.jsx)(`feFlood`,{floodColor:`var(--color-white)`,floodOpacity:`calc(var(--depth) * 0.7)`}),(0,X.jsx)(`feComposite`,{in2:`inner-highlight`,operator:`in`,result:`highlight`}),(0,X.jsxs)(`feMerge`,{children:[(0,X.jsx)(`feMergeNode`,{in:`SourceGraphic`}),(0,X.jsx)(`feMergeNode`,{in:`shade`}),(0,X.jsx)(`feMergeNode`,{in:`highlight`})]})]})}var VO=Object.freeze({alphaIntercept:-8,alphaSlope:18,blurStdDeviation:2});function HO({id:e,values:t=DE}){return(0,X.jsxs)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,X.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t.blurStdDeviation,result:`blur`}),(0,X.jsx)(`feColorMatrix`,{in:`blur`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${String(t.alphaSlope)} ${String(t.alphaIntercept)}`,result:`gooey`}),(0,X.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`gooey`,operator:`atop`})]})}function UO(e,t){let n=e.ownerDocument,r=!0,i=()=>{t(r&&!n.hidden)},a=globalThis,o=`IntersectionObserver`in globalThis&&a.IntersectionObserver?new a.IntersectionObserver(t=>{let n=t.find(t=>t.target===e);n&&(r=n.isIntersecting,i())}):void 0;return o?.observe(e),n.addEventListener(`visibilitychange`,i),i(),()=>{o?.disconnect(),n.removeEventListener(`visibilitychange`,i)}}function WO(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function GO(e,t){let n=Math.max(0,Math.min(1,(t-(e-1)*.085)/.68));return Math.sin(n*Math.PI)**2}function KO(e,t,n){let r=n*Math.PI*2,i=t*2.1,a=Math.sin(r*2+i)*.15,o={rx:4*(1+a),ry:4/(1+a)};if(e===`line`){let e=7.5+4*Math.cos(r+(t===2?-.45:0));return{cx:(t-1)*e,cy:Math.sin(r+i)*.7,...o}}if(e===`square`){let e=4.7+2.7*Math.cos(r);return{cx:(t%2?1:-1)*e,cy:(t<2?-1:1)*e,...o}}if(e===`donut`){let e=WO(n/.66)*Math.PI*2,o=Math.min(e,t*Math.PI/8)-Math.PI/2,s=WO((n-.79)/.21),c=8+Math.sin(r*2+i)*.35*Math.sin(n*Math.PI);return{cx:Math.cos(o)*c*(1-s),cy:Math.sin(o)*c*(1-s)-8*s,rx:3.6*(1+a*Math.sin(n*Math.PI)),ry:3.6/(1+a*Math.sin(n*Math.PI))}}if(e===`bloom`){if(t===0){let e=[1,2,3,4].reduce((e,t)=>e+GO(t,n),0),t=Math.sqrt(49-e*4);return{cx:Math.sin(r)*.4,cy:Math.sin(r*2)*.4,rx:t*(1+a),ry:t/(1+a)}}let e=GO(t,n),i=(t-1)*Math.PI/2-Math.PI/4+Math.sin(r)*.22;return{cx:Math.cos(i)*14*e,cy:Math.sin(i)*14*e,rx:3.2*(1+a),ry:3.2/(1+a)}}return{cx:Math.sin(r+i)*6+Math.sin(r*3+i)*2.5,cy:Math.cos(r*2+i)*6,...o}}var qO={line:1700,square:1900,donut:3e3,wander:4600,bloom:2800},JO=2;function YO({variant:e,pace:t=`working`}){let r=`caps-loader-${(0,P.useId)().replaceAll(`:`,``)}`,i=(0,P.useRef)(null),a=(0,P.useRef)(null),o=EO(a),{reduced:s}=o,c=e===`donut`?16:e===`bloom`?5:e===`square`?4:3;return(0,P.useLayoutEffect)(()=>{if(!i.current||!a.current||s&&t===`idle`)return;let r=s?[n(i.current,{opacity:[.55,1],duration:o.slow*10,ease:`inOutSine`,alternate:!0,loop:!0})]:[...i.current.querySelectorAll(`ellipse`)].map((r,i)=>n(r,{keyframes:Array.from({length:48},(n,r)=>({...KO(e,i,(r+1)/48),duration:DO(o,qO[e]*(t===`idle`?JO:1))/48})),ease:`linear`,loop:!0})),c=UO(a.current,e=>{for(let t of r)e?t.resume():t.pause()});return()=>{c();for(let e of r)e.revert()}},[e,t,s,o]),(0,X.jsxs)(`svg`,{ref:a,"aria-hidden":`true`,focusable:`false`,viewBox:e===`line`?`-20 -10 40 20`:`-20 -20 40 40`,children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsx)(HO,{id:r,values:VO}),(0,X.jsx)(RO,{id:`${r}-surface`,transform:e===`line`?`matrix(3.4 0 0 1.4 0 0)`:`matrix(3 0 0 3 0 0)`}),(0,X.jsx)(zO,{id:`${r}-shadow`}),(0,X.jsx)(`mask`,{id:`${r}-mask`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`40`,height:`40`,style:{maskType:`alpha`},children:(0,X.jsx)(`g`,{ref:i,fill:`currentColor`,filter:`url(#${r})`,children:Array.from({length:c},(t,n)=>(0,X.jsx)(`ellipse`,{...KO(e,n,0)},n))})})]}),(0,X.jsx)(`g`,{filter:`url(#${r}-shadow)`,children:(0,X.jsx)(`rect`,{x:`-20`,y:`-20`,width:`40`,height:`40`,fill:`url(#${r}-surface)`,mask:`url(#${r}-mask)`})})]})}var XO={sm:`caps-loader-sm`,md:`caps-loader-md`,lg:`caps-loader-lg`,fill:`caps-loader-fill`},ZO={neutral:`text-base-content`,accent:`text-accent`,primary:`text-primary`,success:`text-success`,current:`text-current`},QO=(0,P.forwardRef)(function({"aria-label":e,"aria-labelledby":t,className:n,decorative:r=!1,label:i=`Loading`,size:a=`md`,variant:o=`line`,pace:s=`working`,tone:c=`neutral`,...l},u){let d=`${(0,P.useId)()}-label`,f=!r&&e===void 0&&t===void 0;return(0,X.jsxs)(`span`,{...l,"aria-label":r?void 0:e,"aria-hidden":r||void 0,"aria-labelledby":r?void 0:t??(e===void 0?d:void 0),className:aO(`caps-loader`,XO[a],ZO[c],n),"data-variant":o,"data-pace":s,role:r?void 0:`status`,ref:u,children:[(0,X.jsx)(YO,{variant:o,pace:s}),f?(0,X.jsx)(LO,{id:d,children:i}):null]})}),$O=`disabled:bg-base-200 disabled:text-base-content disabled:outline-1 disabled:outline-solid disabled:outline-base-content/25 aria-disabled:bg-base-200 aria-disabled:text-base-content aria-disabled:outline-1 aria-disabled:outline-solid aria-disabled:outline-base-content/25`,ek=NE(`btn caps-button disabled:pointer-events-none`,{variants:{variant:{primary:`btn-primary caps-button-filled`,secondary:`btn-secondary caps-button-filled`,accent:`btn-accent caps-button-filled`,destructive:`btn-error caps-button-filled`,outline:`btn-outline ${$O}`,ghost:`btn-ghost`,"ghost-destructive":`btn-ghost caps-button-ghost-destructive`,link:`btn-link ${$O}`},size:{xs:`btn-xs`,sm:`btn-sm`,default:`btn-md`,lg:`btn-lg`,icon:`btn-square btn-md`,menubar:`caps-button-menubar`}},defaultVariants:{variant:`primary`,size:`default`}}),tk=(0,P.forwardRef)(function({asChild:e=!1,children:t,className:n,disabled:r,loading:i=!1,result:a,resultLabel:o,onResultEnd:s,size:c=`default`,variant:l=`primary`,...u},d){let f=aO(ek({size:c,variant:l}),n),p=(0,P.useRef)(a).current,m=(0,P.useRef)(null);return(0,P.useImperativeHandle)(d,()=>m.current),nk(m,i,a),e?(0,X.jsx)(dO,{...u,"aria-busy":i?!0:u[`aria-busy`],"aria-disabled":r===!0||i?!0:void 0,className:f,ref:m,children:t}):(0,X.jsx)(`button`,{...u,"aria-busy":i?!0:u[`aria-busy`],className:f,disabled:r===!0||i,ref:m,type:u.type??`button`,children:a===void 0&&o===void 0?(0,X.jsxs)(X.Fragment,{children:[i?(0,X.jsx)(QO,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,t]}):(0,X.jsx)(sk,{label:o,loading:i,onResultEnd:s,result:a,settled:p,children:t})})});function nk(e,t,n){let r=(0,P.useRef)(null),i=(0,P.useRef)(null),a=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let o=e.current;if(!o)return;let s=JSON.stringify([t,n??null,o.textContent]),c=s!==i.current;i.current=s;let l=a.current;if(!c&&l)return;let u=l?o.offsetWidth:r.current;l&&(a.current=null,l.cancel(),o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`));let d=o.offsetWidth;if(r.current=d>0?d:null,!c||u===null||d===0||Math.abs(u-d)<1||!jO(o))return;let f=TO(o);if(f.reduced)return;let p=o.animate([{width:`${String(u)}px`},{width:`${String(d)}px`}],{duration:f.normal,easing:AO(f,f.ease)});a.current=p,o.style.overflow=`clip`,o.style.whiteSpace=`nowrap`;let m=()=>{a.current===p&&(a.current=null,o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`))};p.onfinish=m,p.oncancel=m})}var rk=1100;function ik(e,t){let n=t.bounce/.3,r=1+.05*Math.min(1.4,.4+n),i=1-.02*Math.min(1.4,n);return e.animate([{transform:`scale(1)`},{transform:`scale(${String(r)})`,offset:.35},{transform:`scale(${String(i)})`,offset:.7},{transform:`scale(1)`}],{duration:t.springDuration,easing:AO(t,`ease-out`)})}function ak(e,t){let n=t.shake;return e.animate([{transform:`none`},{transform:`translateX(${String(-n)}px)`},{transform:`translateX(${String(n)}px)`},{transform:`translateX(${String(-n*.6)}px)`},{transform:`translateX(${String(n*.3)}px)`},{transform:`none`}],{duration:t.slow*1.3,easing:AO(t,`linear`)})}function ok(e,t,n){let r=n.distance+2,i=`blur(${String(n.blur)}px)`;return[e.animate([{opacity:1,transform:`none`,filter:`blur(0px)`},{opacity:0,transform:`translateY(${String(-r)}px)`,filter:i}],{duration:n.fast,easing:AO(n,n.ease)}),t.animate([{opacity:0,transform:`translateY(${String(r)}px)`,filter:i},{opacity:1,transform:`none`,filter:`blur(0px)`}],{duration:n.normal,easing:AO(n,n.ease),fill:`backwards`})]}function sk({children:e,label:t,loading:n,onResultEnd:r,result:i,settled:a}){let o=(0,P.useRef)(null),s=IO(),[c,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(!1);c&&!u&&d(!0);let f=(0,P.useRef)(a),p=(0,P.useRef)(r);(0,P.useEffect)(()=>{p.current=r},[r]),(0,P.useLayoutEffect)(()=>{let e=f.current;if(f.current=i,i===e)return;if(i===`done`){l(!0);let e=setTimeout(()=>{p.current?p.current():l(!1)},rk);return()=>{clearTimeout(e)}}l(!1);let t=o.current;if(i!==`failed`||!t||!jO(t))return;let n=TO(t);if(n.shake<=0)return;let r=ak(t,n);return()=>{r.cancel()}},[i,s]);let m=(0,P.useRef)(c);return(0,P.useLayoutEffect)(()=>{let e=o.current;if(!e||m.current===c)return;m.current=c;let t=e.querySelector(`[data-face="label"]`),n=e.querySelector(`[data-face="result"]`);if(!t||!n||!jO(e)){c||d(!1);return}let r=TO(e),i=c?ok(t,n,r):ok(n,t,r);if(c||i[0]?.addEventListener(`finish`,()=>{d(!1)}),c&&!r.reduced){i.push(ik(e.closest(`button`)??e,r));let t=n.querySelector(`path`);t&&i.push(t.animate([{strokeDashoffset:1},{strokeDashoffset:0}],{duration:r.normal*1.4,delay:r.fast/2,easing:AO(r,r.ease),fill:`backwards`}))}return()=>{for(let e of i)e.cancel()}},[c,s]),(0,X.jsxs)(`span`,{ref:o,className:`caps-button-faces`,"data-showing":c?`result`:`label`,children:[(0,X.jsxs)(`span`,{className:`caps-button-face`,"data-face":`label`,"aria-hidden":c?!0:void 0,children:[n||c?(0,X.jsx)(QO,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,e]}),u?(0,X.jsxs)(`span`,{className:`caps-button-face`,"data-face":`result`,"aria-hidden":!c||void 0,children:[(0,X.jsx)(`svg`,{className:`caps-button-check`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,X.jsx)(`path`,{d:`M4.5 12.5 9.5 17.5 19.5 6.5`,pathLength:1})}),t===void 0?e:t]}):null]})}var ck={xs:`size-3`,sm:`size-[var(--stipe-icon-size-sm)]`,md:`size-[var(--stipe-icon-size-md)]`,lg:`size-[var(--stipe-icon-size-lg)]`},lk=(0,P.forwardRef)(function({active:e=!1,icon:t,iconSize:n=`xs`,className:r,reveal:i=!1,size:a=`xs`,tone:o=`default`,variant:s=`ghost`,...c},l){let u=a===`responsive`;return(0,X.jsx)(tk,{...c,resultLabel:c.result===void 0?void 0:null,ref:l,size:u?`sm`:a,variant:s,className:aO(`caps-icon-button btn-circle`,u&&`caps-icon-button-responsive md:btn-xs`,e&&`text-accent`,i&&`scale-0 transition-transform group-hover:scale-100 focus-visible:scale-100`,o===`destructive`&&`hover:text-error`,r),children:(0,X.jsx)(`span`,{"aria-hidden":`true`,className:aO(`inline-flex shrink-0 [&>svg]:size-full [&>svg]:[stroke-width:var(--stipe-icon-stroke)]`,ck[n]),children:t})})}),uk=(0,P.forwardRef)(function({tone:e=`neutral`,size:t=`md`,pressed:n=!1,touch:r,className:i,...a},o){return(0,X.jsx)(`kbd`,{...a,ref:o,className:aO(`caps-keycap`,i),"data-tone":e,"data-size":t,"data-pressed":n,"data-touch":r})}),dk=(0,P.forwardRef)(function({label:e,shortcut:t,icon:n,readout:r,tone:i=`neutral`,density:a=`regular`,pressed:o,expanded:s,className:c,type:l=`button`,...u},d){let f=o??s;return(0,X.jsxs)(`button`,{...u,ref:d,type:l,className:aO(`caps-keycap-button`,c),"data-tone":i,"data-density":a===`compact`?a:void 0,"aria-pressed":o,"aria-expanded":s,"aria-keyshortcuts":u[`aria-keyshortcuts`]??t,children:[f===void 0?null:(0,X.jsx)(`span`,{className:`caps-keycap-led`,"data-lit":f,"aria-hidden":`true`}),n?(0,X.jsx)(`span`,{className:`caps-keycap-button-icon`,"aria-hidden":`true`,children:n}):null,e===null?null:(0,X.jsx)(`span`,{className:`caps-keycap-button-label`,children:e}),r,t?(0,X.jsx)(uk,{size:`sm`,tone:`neutral`,touch:`hide`,"aria-hidden":`true`,children:t}):null]})}),fk=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),pk=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),mk={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},hk=(0,P.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,P.createElement)(`svg`,{ref:c,...mk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:pk(`lucide`,i),...s},[...o.map(([e,t])=>(0,P.createElement)(e,t)),...Array.isArray(a)?a:[a]])),gk=(e,t)=>{let n=(0,P.forwardRef)(({className:n,...r},i)=>(0,P.createElement)(hk,{ref:i,iconNode:t,className:pk(`lucide-${fk(e)}`,n),...r}));return n.displayName=`${e}`,n},_k=function(e,t,n){if(t!=null){if(typeof t!=`object`&&typeof t!=`function`)throw TypeError(`Object expected.`);var r,i;if(n){if(!Symbol.asyncDispose)throw TypeError(`Symbol.asyncDispose is not defined.`);r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw TypeError(`Symbol.dispose is not defined.`);r=t[Symbol.dispose],n&&(i=r)}if(typeof r!=`function`)throw TypeError(`Object not disposable.`);i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},vk=(function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,`An error was suppressed during disposal.`):n,t.hasError=!0}var r,i=0;function a(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(a);if(r.dispose){var e=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(e).then(a,function(e){return n(e),a()})}else i|=1}catch(e){n(e)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a()}})(typeof SuppressedError==`function`?SuppressedError:function(e,t,n){var r=Error(n);return r.name=`SuppressedError`,r.error=e,r.suppressed=t,r}),yk=class extends Y{stage;provider;constructor(e){super(e.message,{code:e.code,retryable:e.retryable,...e.need!==void 0&&{need:e.need}}),this.stage=e.stage??null,this.provider=e.provider}},bk=e=>$b.pipe(J(Dx(1)),J(Ax(e))),xk=G({requestId:bk(256),computerId:bk(256)}),Sk=ex.pipe(J(Tx()),J(dx(Number.isSafeInteger,{message:`Expected a safe integer`}))),Ck=Sk.pipe(J(xx(0))),wk=Sk.pipe(J(Sx(0))),Tk=q([`first-frame`,`last-frame`,`reference`]),Ek=q([`480p`,`720p`,`768p`,`1080p`,`4k`]),Dk=q([`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`,`9:21`]),Ok=G({computerId:V(bk(256)),path:bk(4096),role:V(Tk)}),kk=G({path:bk(4096),role:Tk}),Ak=G({computerId:bk(256),path:bk(4096)}),jk=G({defaultHeight:Ck,defaultSteps:ax(wk),defaultWidth:Ck,dimensions:q([`none`,`own`]),maxDimension:ax(Ck),maxDimensionDocumented:W,maxReferences:wk,maxSteps:ax(Ck),referenceDimension:ax(Ck),referenceField:ax(bk(256)),referenceFormat:q([`png`,`webp`]),steps:q([`steps`,`num_steps`,`fixed`]),transport:q([`json`,`multipart`])}),Mk=G({minSeconds:Ck,maxSeconds:Ck,defaultSeconds:Ck,durations:K(Ck),provider:q([`seedance`,`veo`,`minimax`]),formats:K(G({resolution:Ek,aspectRatio:Dk,width:Ck,height:Ck})),defaultResolution:Ek,defaultAspectRatio:Dk,supportsAudio:W,defaultGenerateAudio:ax(W),referenceRoles:K(Tk),maxReferenceImages:wk,referenceResolutions:K(Ek),prices:K(G({resolution:Ek,silentMilliunitsPerSecond:Ck,audioMilliunitsPerSecond:Ck}))}),Nk=K(G({id:bk(256),input:jk,kind:q([`image`,`video`]),label:bk(512),maxPromptLength:Ck,tier:q([`draft`,`balanced`,`premium`,`max`]),outputFormats:K(q([`png`,`jpeg`,`webp`])).pipe(J(Ax(3))),sizes:ax(K($b.pipe(J(mx(/^\d+x\d+$/u))))),video:ax(Mk)})),Pk=G({[Symbol.dispose]:V(U),computerId:bk(256),models:Nk,canGenerate:W}),Fk=G({model:bk(256),prompt:bk(2048),width:Ck.pipe(J(Cx(5040))),height:Ck.pipe(J(Cx(5040))),steps:V(Ck),durationSeconds:V(Ck),resolution:V(Ek),aspectRatio:V(Dk),generateAudio:V(W),references:V(K(Ok).pipe(J(Ax(16))))});G({model:bk(256),prompt:bk(2048),resolution:V(Ek),aspectRatio:V(Dk),durationSeconds:V(Ck.pipe(J(Sx(4)),J(Cx(15)))),generateAudio:V(W),references:V(K(kk).pipe(J(Ax(4))))});var Ik=[`admission`,`generation-authorization`,`settings`,`estimate`,`billing`,`operation`,`provider`,`normalization`,`artifact`,`destination-authorization`,`destination-write`],Lk=G({destination:G({path:bk(4096)}),settings:U}),Rk=G({[Symbol.dispose]:V(U),bytes:Ck,costMilliunits:wk,destination:Ak,format:q([`png`,`jpeg`,`gif`,`webp`,`mp4`]),height:Ck,model:bk(256),width:Ck});G({...Rk.fields,format:H(`mp4`)});var zk=G({message:bk(512),stage:V(q(Ik)),provider:V(Wx),code:q([`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`DISCONNECTED`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`MEDIA_PROVIDER_FAILURE`,`MEDIA_PROVIDER_FAILURE_UNCHARGED`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`SETUP_REQUIRED`,`TIMEOUT`]),retryable:W,need:V(Bx)}),Bk=ix([G({[Symbol.dispose]:V(U),kind:H(`succeeded`),result:Rk}),G({[Symbol.dispose]:V(U),kind:H(`failed`),failure:zk})]),Vk=CE({reference:TE(wE(Za().transform(e=>Jb(xk)(e)))),generate:TE(wE(Za().transform(e=>{let t=Jb(Bk,{onExcessProperty:`error`})(e);return t.kind===`succeeded`?{kind:t.kind,result:{bytes:t.result.bytes,costMilliunits:t.result.costMilliunits,destination:t.result.destination,format:t.result.format,height:t.result.height,model:t.result.model,width:t.result.width}}:{kind:t.kind,failure:t.failure}})))}),Hk=SE(`media.generation`,5,Ho(()=>CE({describe:TE(wE(Za().transform(e=>{let{computerId:t,canGenerate:n,models:r}=Jb(Pk,{onExcessProperty:`error`})(e);return{computerId:t,canGenerate:n,models:r}}))),createAttempt:TE(Vk),restoreAttempt:TE(Vk),cancelAttempt:EE}))),Uk=co([ao({shared:N(!1)}),ao({shared:N(!0),url:Ea(),showPrompt:qa()})]);ao({requestId:A().min(1).max(256),showPrompt:qa()});var Wk=SE(`media.share`,1,Ho(()=>CE({status:TE(wE(Uk)),share:TE(wE(Uk)),stop:TE(wE(Uk))})));function Gk(e,t){try{return Jb(e,{onExcessProperty:`error`})(t)}catch(e){throw new Y(`The Media capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}}function Kk(e){return e instanceof Y?e:new Y(`The Media capability failed`,{cause:e,code:`HOST_FAILURE`,retryable:!0})}function qk(e){if(e?.aborted)throw new Y(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1})}function Jk(e){let t;try{t=Jb(Lk,{onExcessProperty:`error`})(e)}catch(e){throw new Y(`Media generation input is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let n;try{n=Yk(Jb(Fk,{onExcessProperty:`error`})(t.settings))}catch(e){throw new Y(`Media generation settings are invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let r={path:t.destination.path.trim()};if(r.path.length===0)throw new Y(`Media generation destination is invalid`,{code:`INVALID_ARGUMENT`,retryable:!1});return Object.freeze({destination:Object.freeze(r),settings:n})}function Yk(e){let t=(e,t)=>{let n=e.trim();if(n.length===0)throw Error(`${t} must not be blank`);return n},n={model:t(e.model,`model`),prompt:t(e.prompt,`prompt`),width:e.width,height:e.height};return e.steps!==void 0&&(n.steps=e.steps),e.durationSeconds!==void 0&&(n.durationSeconds=e.durationSeconds),e.resolution!==void 0&&(n.resolution=e.resolution),e.aspectRatio!==void 0&&(n.aspectRatio=e.aspectRatio),e.generateAudio!==void 0&&(n.generateAudio=e.generateAudio),e.references!==void 0&&(n.references=Object.freeze(e.references.map(e=>Object.freeze({...e,path:t(e.path,`reference`)})))),Object.freeze(n)}function Xk(e){let t=Gk(Nk,e),n=new Set;for(let e of t){if(n.has(e.id))throw new Y(`The Media capability repeated a model`,{code:`PROTOCOL`,retryable:!1});n.add(e.id)}return Object.freeze(t.map(e=>Object.freeze(e)))}function Zk(e,t,n){let r=Gk(Rk,e);if(r.model!==t.settings.model||r.destination.computerId!==n||r.destination.path!==t.destination.path||r.width!==t.settings.width||r.height!==t.settings.height)throw new Y(`The Media capability returned an unrelated result`,{code:`PROTOCOL`,retryable:!1});return Object.freeze({bytes:r.bytes,costMilliunits:r.costMilliunits,destination:Object.freeze({...r.destination}),format:r.format,height:r.height,model:r.model,width:r.width})}async function Qk(e){try{let t=e.require(Hk);{let e={stack:[],error:void 0,hasError:!1};try{let n=Gk(Pk,_k(e,vE(await t.describe()),!1).value),r=n.computerId.trim();if(r.length===0)throw new Y(`The Media capability returned no Computer`,{code:`PROTOCOL`,retryable:!1});let i=Xk(n.models),a=async e=>{let n=vE(e),i;try{{let t={stack:[],error:void 0,hasError:!1};try{let n=_k(t,vE(await e.reference()),!1),a=Gk(G({...xk.fields,[Symbol.dispose]:V(U)}),n.value);if(i={requestId:a.requestId,computerId:a.computerId},i.computerId!==r)throw new Y(`Media attempt belongs to another Computer`,{code:`IDENTITY`,retryable:!1})}catch(e){t.error=e,t.hasError=!0}finally{vk(t)}}}catch(e){throw n[Symbol.dispose](),Kk(e)}let a=!1;return{reference:Object.freeze(i),async generate(n,o={}){if(a)throw new Y(`Media generation attempt is closed`,{code:`CAPABILITY_DENIED`,retryable:!1});qk(o.signal);let s=Jk(n),c=o.signal,l,u,d=()=>(u??=t.cancelAttempt(i),u);try{let t=e.generate(s),n=c===void 0?await t:await Promise.race([t,new Promise((e,t)=>{l=()=>{d().then(()=>{t(new Y(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1}))},t)},c.addEventListener(`abort`,l,{once:!0}),c.aborted&&l()})]);c?.aborted&&(await d(),qk(c)),qk(c);{let e={stack:[],error:void 0,hasError:!1};try{let t=Gk(Bk,_k(e,vE(n),!1).value);if(t.kind===`failed`)throw new yk(t.failure);return Zk(t.result,s,r)}catch(t){e.error=t,e.hasError=!0}finally{vk(e)}}}catch(e){throw c?.aborted&&(await d(),qk(c)),Kk(e)}finally{l!==void 0&&c?.removeEventListener(`abort`,l)}},[Symbol.dispose](){a||(a=!0,n[Symbol.dispose]())}}};return Object.freeze({computerId:r,canGenerate:n.canGenerate,models:i,async createAttempt(){return a(await t.createAttempt())},async restoreAttempt(e){let n=Gk(xk,e);if(n.computerId!==r)throw new Y(`Select the original Computer to retry this generation`,{code:`IDENTITY`,retryable:!1});let i=await a(await t.restoreAttempt(n));if(i.reference.requestId!==n.requestId)throw i[Symbol.dispose](),new Y(`Media restore changed the request identity`,{code:`PROTOCOL`,retryable:!1});return i}})}catch(t){e.error=t,e.hasError=!0}finally{vk(e)}}}catch(e){throw Kk(e)}}export{JT as $,Ng as $n,ao as $r,ES as $t,NE as A,Jb as An,ko as Ar,VS as At,BT as B,mx as Bn,so as Br,sS as Bt,kO as C,ox as Cn,Vs as Cr,_w as Ct,IO as D,Ib as Dn,rs as Dr,HS as Dt,EO as E,J as En,as as Er,US as Et,SE as F,xx as Fn,io as Fr,jS as Ft,bT as G,Ub as Gn,Jo as Gr,dS as Gt,fE as H,V as Hn,Zo as Hr,pS as Ht,hE as I,Sx as In,Co as Ir,kS as It,CT as J,Rg as Jn,N as Jr,CS as Jt,xT as K,Bg as Kn,Qo as Kr,oS as Kt,_E as L,Tx as Ln,Lo as Lr,wS as Lt,CE as M,lx as Mn,bo as Mr,IS as Mt,TE as N,Wb as Nn,Do as Nr,NS as Nt,aO as O,Kb as On,no as Or,BS as Ot,EE as P,wx as Pn,Ha as Pr,MS as Pt,ET as Q,Fg as Qn,_o as Qr,OS as Qt,mE as R,Ax as Rn,ba as Rr,TS as Rt,AO as S,Qb as Sn,Xs as Sr,gw as St,TO as T,sx as Tn,vs as Tr,KS as Tt,pE as U,Xb as Un,ro as Ur,cS as Ut,aE as V,dx as Vn,yo as Vr,mS as Vt,yT as W,zx as Wn,qa as Wr,fS as Wt,TT as X,Ig as Xn,Ua as Xr,uS as Xt,wT as Y,Mg as Yn,oo as Yr,_S as Yt,KT as Z,Vg as Zn,M as Zr,vS as Zt,RO as _,ex as _n,_c as _r,ww as _t,Wk as a,Bn as ai,Y as an,Yh as ar,LT as at,jO as b,G as bn,Qs as br,xw as bt,gk as c,Oe as ci,K as cn,Au as cr,oE as ct,tk as d,Pe as di,Ex as dn,Ou as dr,lE as dt,A as ei,lS as en,Hg as er,DT as et,QO as f,C as fi,H as fn,Pu as fr,AT as ft,zO as g,i as gi,ax as gn,vc as gr,sE as gt,BO as h,o as hi,Zb as hn,hl as hr,WT as ht,xk as i,ur as ii,Qx as in,kv as ir,IT as it,wE as j,Px as jn,vo as jr,LS as jt,oO as k,qb as kn,Ka as kr,zS as kt,dk as l,Ae as li,W as ln,Mu as lr,GT as lt,HO as m,w as mi,Mx as mn,ju as mr,UT as mt,Hk as n,Za as ni,tS as nn,Jv as nr,jT as nt,Qk as o,En as oi,Gx as on,Lu as or,cE as ot,UO as p,v as pi,q as pn,ku as pr,kT as pt,ST as q,Lg as qn,Ho as qr,hS as qt,Lk as r,wa as ri,eS as rn,qv as rr,zT as rt,Jk as s,E as si,Xx as sn,Ru as sr,VT as st,yk as t,co as ti,rS as tn,Kv as tr,OT as tt,lk as u,Me as ui,hx as un,Nu as ur,HT as ut,VO as v,nx as vn,L as vr,Cw as vt,DO as w,ix as wn,qs as wr,vw as wt,OO as x,Ix as xn,Ks as xr,bw as xt,LO as y,$b as yn,$s as yr,Sw as yt,vT as z,Dx as zn,k as zr,DS as zt};
|