frameboard 0.41.0 → 0.43.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.
@@ -1,8 +1,8 @@
1
- (function(){let e=`data-frameboard`;function t(t){return[...t.querySelectorAll(`*`)].filter(t=>!t.hasAttribute(e))}function n(e,n){let r=t(e).indexOf(n);return r===-1?null:r}function r(e,n){return t(e)[n]??null}function i(e){return e.querySelector(`style[data-frameboard]`)?.getAttribute(`data-hash`)??null}function a(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 o(e,t=`|`){return e.map(e=>ce(e)).join(t)}function s(e,t){return typeof t==`bigint`?t.toString():t}var c=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function l(e){return new c(e)}function u(e){return e==null}function d(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function f(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function p(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function m(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function h(e){return m(e._zod.def)??e._zod.def.shape}function g(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return p(this,t,e),e},enumerable:!0,configurable:!0})}function _(e,t,n){t in e?p(e,t,n):e[t]=n}function v(e,t,n,r){let i=h(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?g(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):_(e,a,r?r(n.value,a):n.value))}}function ee(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?g(e,n,()=>t[n]):_(e,n,r.value))}}function y(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let ie=/* @__PURE__*/ l(()=>{if(A.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function x(e){if(b(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return b(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ae(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let oe=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function S(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function C(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 ce(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function le(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}let ue={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},de={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function fe(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`);let i={};return v(i,e,pe(e,t)),S(e,y(n,{shape:i,checks:[]}))}function pe(e,t){let n=h(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function me(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`);let i=new Set(pe(e,t)),a={};return v(a,e,Reflect.ownKeys(h(e)).filter(e=>!i.has(e))),S(e,y(n,{shape:a,checks:[]}))}function he(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=h(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return S(e,y(e._zod.def,{shape:ge(e,t)}))}function ge(e,t){let n={};return v(n,e,Reflect.ownKeys(h(e))),ee(n,t),n}function _e(e,t){if(!x(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return S(e,y(e._zod.def,{shape:ge(e,t)}))}function ve(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return v(n,e,Reflect.ownKeys(h(e))),v(n,t,Reflect.ownKeys(h(t))),S(e,y(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ye(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(pe(t,n)):void 0,o={};return v(o,t,Reflect.ownKeys(h(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),S(t,y(t._zod.def,{shape:o,checks:[]}))}function be(e,t,n){let r=n?new Set(pe(t,n)):void 0,i={};return v(i,t,Reflect.ownKeys(h(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),S(t,y(t._zod.def,{shape:i}))}function w(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 xe(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 Se(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ce(e){return typeof e==`string`?e:e?.message}function we(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Te(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function T(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ce(e.inst?._zod.def?.error?.(e))??Ce(a?.(e))??Ce(t?.error?.(e))??Ce(n.customError?.(e))??Ce(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}let Ee=/[\uD800-\uDBFF]/;function De(e){let t=e.length;if(!Ee.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Oe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ke(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ae(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function je(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Pe(e,n,r.value)}}function E(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Me(e,t,n){return E(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
2
- function Ne(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return E(this,n,r(this))},set(e){E(this,n,e)}})}return t}function Pe(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:E(this,t,n.bind(this))},set(e){E(this,t,e)}})}function Fe(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Ie,Le=!1,Re={configurable:!0,get(){Le=!0}};function D(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Ie!==e._zod?Ie=void 0:(Ie=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Re);let e=Le;Le=!1;try{let r=n(this);return Le?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Le||=e,r}catch(n){throw delete this[t],Le||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function ze(e,t,n,r){let i=Fe(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function Be(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var Ve;let He={value:void 0,enumerable:!1},Ue=`captureStackTrace`in Error?Error:null;function We(e){let t=Ue;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ue=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
3
- function O(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){He.value=new a(r);try{Object.defineProperty(n,"_zod",He)}finally{He.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),je(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?We(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var k=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Ve=globalThis).__zod_globalConfig??(Ve.__zod_globalConfig={});let A=globalThis.__zod_globalConfig;function j(e){return e&&Object.assign(A,e),A}function Ke(){let e=this._zod;return e.message??=JSON.stringify(e.def,s,2),e.message}function qe(e){this._zod.message=e}let Je={get:Ke,set:qe,enumerable:!0,configurable:!0},Ye={value:void 0,enumerable:!1},Xe=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Ze=/* @__PURE__ */ O(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Ye.value=t,Object.defineProperty(e,"issues",Ye),Ye.value=void 0,Object.defineProperty(e,"message",Je);let n=Object.getPrototypeOf(e);Xe.has(n)||(Xe.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Qe(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function $e(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Qe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function et(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function tt(e,t){return{callee:t?.callee??e,Err:t?.Err}}let nt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new k;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>T(e,o,j())));throw re(n,a?.callee??t),n}return s.value};return t},rt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>T(e,o,j())));throw re(n,a?.callee??t),n}return s.value};return t},it=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 k;return a.issues.length?at(e,a.issues,i):{success:!0,data:a.value}};function at(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>T(e,n,j()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let ot=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?at(e,a.issues,i):{success:!0,data:a.value}},st=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),ct=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),lt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==st)return!0;if(r.definite===!0&&n===void 0)return!1}return ut(e,t,n)});function ut(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[ct]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new k;return a.issues.length===0}let dt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ft=e=>{let t=nt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,tt(n,a))};return n},pt=e=>{let t=nt(e),n=(e,r,i,a)=>t(e,r,i,tt(n,a));return n},mt=e=>{let t=rt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,tt(n,a))};return n},ht=e=>{let t=rt(e),n=async(e,r,i,a)=>await t(e,r,i,tt(n,a));return n},gt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return it(e)(t,n,i)},_t=e=>(t,n,r)=>it(e)(t,n,r),vt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ot(e)(t,n,i)},yt=e=>async(t,n,r)=>ot(e)(t,n,r),bt=/^[cC][0-9a-z]{6,}$/,xt=/^[0-9a-z]+$/,St=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ct=/^[0-9a-vA-V]{20}$/,wt=/^[A-Za-z0-9]{27}$/,Tt=/^[a-zA-Z0-9_-]{21}$/;function Et(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let Dt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ot=/^([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})$/,kt=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)$/,At=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function jt(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}let Mt=/^(?:(?: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}|:))$/,Pt=/^((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])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,It=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rt=/^https?$/,zt=/^\+[1-9]\d{6,14}$/,Bt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Vt(e){return RegExp(`^${e}$`)}let Ht=/*@__PURE__*/ Vt(Bt);function Ut(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wt(e){return RegExp(`^${Ut(e)}$`)}function Gt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ut({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ut({precision:e.precision})}`:n;return RegExp(`^${Bt}T(?:${r})$`)}let Kt=/^[\s\S]{0,}$/,qt=/^-?\d+(?:\.\d+)?$/,Jt=/^(?:true|false)$/i,Yt=/^null$/i,Xt=/^[^A-Z]*$/,Zt=/^[^a-z]*$/,M=/*@__PURE__*/ O(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qt=e=>{let t=e.value;return!u(t)&&t.length!==void 0},$t={number:`number`,bigint:`bigint`,object:`date`},en=/*@__PURE__*/ O(`$ZodCheckLessThan`,(e,t)=>{M.init(e,t);let n=$t[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:$t[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tn=/*@__PURE__*/ O(`$ZodCheckGreaterThan`,(e,t)=>{M.init(e,t);let n=$t[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:$t[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nn=/*@__PURE__*/ O(`$ZodCheckMultipleOf`,(e,t)=>{M.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):f(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})}}),rn=/*@__PURE__*/ O(`$ZodCheckNumberFormat`,(e,t)=>{M.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ue[t.format];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})}}),an=/*@__PURE__*/ O(`$ZodCheckMaxLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=Qt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?De(r):i)<=t.maximum)return;let a=Oe(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),on=/*@__PURE__*/ O(`$ZodCheckMinLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=Qt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?De(r):i)>=t.minimum)return;let a=Oe(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sn=/*@__PURE__*/ O(`$ZodCheckLengthEquals`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=Qt),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?De(r):i;if(a===t.length)return;let o=Oe(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),cn=/*@__PURE__*/ O(`$ZodCheckStringFormat`,(e,t)=>{var n,r;M.init(e,t),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=()=>{})}),ln=/*@__PURE__*/ O(`$ZodCheckRegex`,(e,t)=>{cn.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})}}),un=/*@__PURE__*/ O(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Xt,cn.init(e,t)}),dn=/*@__PURE__*/ O(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Zt,cn.init(e,t)}),fn=/*@__PURE__*/ O(`$ZodCheckIncludes`,(e,t)=>{M.init(e,t);let n=se(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),pn=/*@__PURE__*/ O(`$ZodCheckStartsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`^${se(t.prefix)}.*`);t.pattern??=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})}}),mn=/*@__PURE__*/ O(`$ZodCheckEndsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`.*${se(t.suffix)}$`);t.pattern??=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})}}),hn=/*@__PURE__*/ O(`$ZodCheckOverwrite`,(e,t)=>{M.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var gn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
1
+ (function(){let e=`data-frameboard`;function t(e,t){e.setAttribute(`data-theme`,t),e.style.colorScheme=t,e.classList.toggle(`dark`,t===`dark`),e.classList.toggle(`light`,t===`light`)}function n(t){return[...t.querySelectorAll(`*`)].filter(t=>!t.hasAttribute(e))}function r(e,t){let r=n(e).indexOf(t);return r===-1?null:r}function i(e,t){return n(e)[t]??null}function a(e){return e.querySelector(`style[data-frameboard]`)?.getAttribute(`data-hash`)??null}function o(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 s(e,t=`|`){return e.map(e=>de(e)).join(t)}function c(e,t){return typeof t==`bigint`?t.toString():t}var l=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function u(e){return new l(e)}function d(e){return e==null}function f(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function p(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function m(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function h(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function g(e){return h(e._zod.def)??e._zod.def.shape}function _(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return m(this,t,e),e},enumerable:!0,configurable:!0})}function ee(e,t,n){t in e?m(e,t,n):e[t]=n}function v(e,t,n,r){let i=g(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?_(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ee(e,a,r?r(n.value,a):n.value))}}function te(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?_(e,n,()=>t[n]):ee(e,n,r.value))}}function y(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ne(e){return JSON.stringify(e)}function re(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let ie=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ae(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let oe=/* @__PURE__*/ u(()=>{if(O.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function se(e){if(ae(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ae(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ce(e){return se(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let le=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function b(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function x(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 de(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function fe(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}let pe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},me={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function he(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`);let i={};return v(i,e,ge(e,t)),b(e,y(n,{shape:i,checks:[]}))}function ge(e,t){let n=g(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function _e(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`);let i=new Set(ge(e,t)),a={};return v(a,e,Reflect.ownKeys(g(e)).filter(e=>!i.has(e))),b(e,y(n,{shape:a,checks:[]}))}function ve(e,t){if(!se(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=g(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return b(e,y(e._zod.def,{shape:ye(e,t)}))}function ye(e,t){let n={};return v(n,e,Reflect.ownKeys(g(e))),te(n,t),n}function be(e,t){if(!se(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return b(e,y(e._zod.def,{shape:ye(e,t)}))}function xe(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return v(n,e,Reflect.ownKeys(g(e))),v(n,t,Reflect.ownKeys(g(t))),b(e,y(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Se(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(ge(t,n)):void 0,o={};return v(o,t,Reflect.ownKeys(g(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),b(t,y(t._zod.def,{shape:o,checks:[]}))}function Ce(e,t,n){let r=n?new Set(ge(t,n)):void 0,i={};return v(i,t,Reflect.ownKeys(g(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),b(t,y(t._zod.def,{shape:i}))}function S(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 we(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 Te(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ee(e){return typeof e==`string`?e:e?.message}function De(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Oe(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ke(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ee(e.inst?._zod.def?.error?.(e))??Ee(a?.(e))??Ee(t?.error?.(e))??Ee(n.customError?.(e))??Ee(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}let Ae=/[\uD800-\uDBFF]/;function je(e){let t=e.length;if(!Ae.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Me(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ne(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Pe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Fe(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Re(e,n,r.value)}}function C(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ie(e,t,n){return C(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
2
+ function Le(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return C(this,n,r(this))},set(e){C(this,n,e)}})}return t}function Re(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:C(this,t,n.bind(this))},set(e){C(this,t,e)}})}function ze(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Be,w=!1,Ve={configurable:!0,get(){w=!0}};function T(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Be!==e._zod?Be=void 0:(Be=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Ve);let e=w;w=!1;try{let r=n(this);return w?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),w||=e,r}catch(n){throw delete this[t],w||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function He(e,t,n,r){let i=ze(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function Ue(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var We;let Ge={value:void 0,enumerable:!1},Ke=`captureStackTrace`in Error?Error:null;function qe(e){let t=Ke;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ke=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
3
+ function E(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){Ge.value=new a(r);try{Object.defineProperty(n,"_zod",Ge)}finally{Ge.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Fe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?qe(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var D=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Je=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(We=globalThis).__zod_globalConfig??(We.__zod_globalConfig={});let O=globalThis.__zod_globalConfig;function k(e){return e&&Object.assign(O,e),O}function Ye(){let e=this._zod;return e.message??=JSON.stringify(e.def,c,2),e.message}function Xe(e){this._zod.message=e}let Ze={get:Ye,set:Xe,enumerable:!0,configurable:!0},Qe={value:void 0,enumerable:!1},$e=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),et=/* @__PURE__ */ E(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Qe.value=t,Object.defineProperty(e,"issues",Qe),Qe.value=void 0,Object.defineProperty(e,"message",Ze);let n=Object.getPrototypeOf(e);$e.has(n)||($e.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function tt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function nt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?tt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function rt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function it(e,t){return{callee:t?.callee??e,Err:t?.Err}}let at=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new D;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ke(e,o,k())));throw ie(n,a?.callee??t),n}return s.value};return t},ot=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ke(e,o,k())));throw ie(n,a?.callee??t),n}return s.value};return t},st=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 D;return a.issues.length?ct(e,a.issues,i):{success:!0,data:a.value}};function ct(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>ke(e,n,k()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let lt=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?ct(e,a.issues,i):{success:!0,data:a.value}},ut=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),dt=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),ft=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ut)return!0;if(r.definite===!0&&n===void 0)return!1}return pt(e,t,n)});function pt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[dt]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new D;return a.issues.length===0}let mt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ht=e=>{let t=at(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,it(n,a))};return n},gt=e=>{let t=at(e),n=(e,r,i,a)=>t(e,r,i,it(n,a));return n},_t=e=>{let t=ot(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,it(n,a))};return n},vt=e=>{let t=ot(e),n=async(e,r,i,a)=>await t(e,r,i,it(n,a));return n},yt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return st(e)(t,n,i)},bt=e=>(t,n,r)=>st(e)(t,n,r),xt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},St=e=>async(t,n,r)=>lt(e)(t,n,r),Ct=/^[cC][0-9a-z]{6,}$/,wt=/^[0-9a-z]+$/,Tt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Et=/^[0-9a-vA-V]{20}$/,Dt=/^[A-Za-z0-9]{27}$/,Ot=/^[a-zA-Z0-9_-]{21}$/;function kt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let At=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jt=/^([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})$/,Mt=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)$/,Nt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Pt(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}let Ft=/^(?:(?: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])$/,It=/^(([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}|:))$/,Lt=/^((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])$/,Rt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Vt=/^https?$/,Ht=/^\+[1-9]\d{6,14}$/,Ut=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Wt(e){return RegExp(`^${e}$`)}let Gt=/*@__PURE__*/ Wt(Ut);function Kt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qt(e){return RegExp(`^${Kt(e)}$`)}function Jt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Kt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Kt({precision:e.precision})}`:n;return RegExp(`^${Ut}T(?:${r})$`)}let Yt=/^[\s\S]{0,}$/,Xt=/^-?\d+(?:\.\d+)?$/,Zt=/^(?:true|false)$/i,Qt=/^null$/i,$t=/^[^A-Z]*$/,en=/^[^a-z]*$/,A=/*@__PURE__*/ E(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tn=e=>{let t=e.value;return!d(t)&&t.length!==void 0},nn={number:`number`,bigint:`bigint`,object:`date`},rn=/*@__PURE__*/ E(`$ZodCheckLessThan`,(e,t)=>{A.init(e,t);let n=nn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:nn[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),an=/*@__PURE__*/ E(`$ZodCheckGreaterThan`,(e,t)=>{A.init(e,t);let n=nn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:nn[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),on=/*@__PURE__*/ E(`$ZodCheckMultipleOf`,(e,t)=>{A.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):p(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})}}),sn=/*@__PURE__*/ E(`$ZodCheckNumberFormat`,(e,t)=>{A.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=pe[t.format];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})}}),cn=/*@__PURE__*/ E(`$ZodCheckMaxLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=tn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?je(r):i)<=t.maximum)return;let a=Me(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ln=/*@__PURE__*/ E(`$ZodCheckMinLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=tn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?je(r):i)>=t.minimum)return;let a=Me(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),un=/*@__PURE__*/ E(`$ZodCheckLengthEquals`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=tn),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?je(r):i;if(a===t.length)return;let o=Me(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),dn=/*@__PURE__*/ E(`$ZodCheckStringFormat`,(e,t)=>{var n,r;A.init(e,t),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=()=>{})}),fn=/*@__PURE__*/ E(`$ZodCheckRegex`,(e,t)=>{dn.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})}}),pn=/*@__PURE__*/ E(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=$t,dn.init(e,t)}),mn=/*@__PURE__*/ E(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=en,dn.init(e,t)}),hn=/*@__PURE__*/ E(`$ZodCheckIncludes`,(e,t)=>{A.init(e,t);let n=ue(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),gn=/*@__PURE__*/ E(`$ZodCheckStartsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`^${ue(t.prefix)}.*`);t.pattern??=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})}}),_n=/*@__PURE__*/ E(`$ZodCheckEndsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`.*${ue(t.suffix)}$`);t.pattern??=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})}}),vn=/*@__PURE__*/ E(`$ZodCheckOverwrite`,(e,t)=>{A.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var yn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
4
4
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
5
- `)}\n};`)(...Object.values(this.closed))}};let _n={major:4,minor:6,patch:7},N=/*@__PURE__*/ O(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_n;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=w(t),a;for(let o of n){if(o._zod.def.when){if(xe(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new k;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Te(t.issues,n,e),i||=w(t,n))});else{if(t.issues.length===n)continue;Te(t.issues,n,e),i||=w(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(w(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new k;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new k;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Me(this,`~standard`,bn(this))},set"~standard"(e){E(this,`~standard`,e)}}),vn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>T(e,t,j()))}:{value:e.value};async function yn(e,t){let n={async:!0};return vn(await e._zod.run({value:t,issues:[]},n),n)}function bn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return vn(r,n)}catch{}return yn(e,t)},vendor:`zod`,version:1}}let xn=/*@__PURE__*/ O(`$ZodString`,(e,t)=>{N.init(e,t),e._zod.pattern=t.pattern??Kt,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}}),P=/*@__PURE__*/ O(`$ZodStringFormat`,(e,t)=>{cn.init(e,t),xn.init(e,t)}),Sn=/*@__PURE__*/ O(`$ZodGUID`,(e,t)=>{t.pattern??=Ot,P.init(e,t)}),Cn=/*@__PURE__*/ 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??=kt(e)}else t.pattern??=kt();P.init(e,t)}),wn=/*@__PURE__*/ O(`$ZodEmail`,(e,t)=>{t.pattern??=At,P.init(e,t)});function Tn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function En(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Tn(e)||2:Dn(e,t)}function Dn(e,t){if(!t.normalize&&t.protocol?.source===Rt.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}let On=/[\t\n\r]/g;function kn(e){return e.replace(On,``)}function An(e,t){return t.lastIndex=0,t.test(e.hostname)}function jn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}let Mn=/*@__PURE__*/ O(`$ZodURL`,(e,t)=>{P.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=En(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=kn(r);return}t.hostname&&!An(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!jn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:kn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Nn=/*@__PURE__*/ O(`$ZodEmoji`,(e,t)=>{t.pattern??=jt(),P.init(e,t)}),Pn=/*@__PURE__*/ O(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Tt:Et(t.length),P.init(e,t)}),Fn=/*@__PURE__*/ O(`$ZodCUID`,(e,t)=>{t.pattern??=bt,P.init(e,t)}),In=/*@__PURE__*/ O(`$ZodCUID2`,(e,t)=>{t.pattern??=xt,P.init(e,t)}),Ln=/*@__PURE__*/ O(`$ZodULID`,(e,t)=>{t.pattern??=St,P.init(e,t)}),Rn=/*@__PURE__*/ O(`$ZodXID`,(e,t)=>{t.pattern??=Ct,P.init(e,t)}),zn=/*@__PURE__*/ O(`$ZodKSUID`,(e,t)=>{t.pattern??=wt,P.init(e,t)}),Bn=/*@__PURE__*/ O(`$ZodISODateTime`,(e,t)=>{t.pattern??=Gt(t),P.init(e,t)}),Vn=/*@__PURE__*/ O(`$ZodISODate`,(e,t)=>{t.pattern??=Ht,P.init(e,t)}),Hn=/*@__PURE__*/ O(`$ZodISOTime`,(e,t)=>{t.pattern??=Wt(t),P.init(e,t)}),Un=/*@__PURE__*/ O(`$ZodISODuration`,(e,t)=>{t.pattern??=Dt,P.init(e,t)}),Wn=/*@__PURE__*/ O(`$ZodIPv4`,(e,t)=>{t.pattern??=Mt,P.init(e,t)}),Gn=/^[0-9a-fA-F:.]+$/;function Kn(e){return Gn.test(e)?Tn(`http://[${e}]`):!1}let qn=/*@__PURE__*/ O(`$ZodIPv6`,(e,t)=>{t.pattern??=Nt,P.init(e,t),e._zod.check=n=>{Kn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Jn=/*@__PURE__*/ O(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Pt,P.init(e,t)});function Yn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Kn(n)}let Xn=/*@__PURE__*/ O(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ft,P.init(e,t),e._zod.check=n=>{Yn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Zn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let Qn=/^[0-9a-zA-Z+/]*={0,2}$/,$n=/*@__PURE__*/ O(`$ZodBase64`,(e,t)=>{t.pattern??=Qn,P.init(e,t),e._zod.check=n=>{Zn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),er=/^[A-Za-z0-9_-]*$/;function tr(e){if(!er.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Zn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let nr=/*@__PURE__*/ O(`$ZodBase64URL`,(e,t)=>{t.pattern??=er,P.init(e,t),e._zod.check=n=>{tr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rr=/*@__PURE__*/ O(`$ZodE164`,(e,t)=>{t.pattern??=zt,P.init(e,t)});function ir(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}}let ar=/*@__PURE__*/ O(`$ZodJWT`,(e,t)=>{P.init(e,t),e._zod.check=n=>{ir(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),or=/*@__PURE__*/ O(`$ZodNumber`,(e,t)=>{N.init(e,t),e._zod.pattern=qt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),sr=/*@__PURE__*/ O(`$ZodNumberFormat`,(e,t)=>{rn.init(e,t),or.init(e,t)}),cr=/*@__PURE__*/ O(`$ZodBoolean`,(e,t)=>{N.init(e,t),e._zod.pattern=Jt,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}}),lr=/*@__PURE__*/ O(`$ZodNull`,(e,t)=>{N.init(e,t),e._zod.pattern=Yt,e._zod.values=/* @__PURE__ */ 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}}),ur=/*@__PURE__*/ O(`$ZodUnknown`,(e,t)=>{N.init(e,t),e._zod.parse=e=>e}),dr=/*@__PURE__*/ O(`$ZodNever`,(e,t)=>{N.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function fr(e,t){let n=we(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of we(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Te(n.issues,t,e),n}}return i(n,a)}}let pr=e=>Array.isArray(e)?e.length:-1;function mr(e,t,n){e.issues.length&&t.issues.push(...Se(n,e.issues)),t.value[n]=e.value}let hr=/*@__PURE__*/ O(`$ZodArray`,(e,t)=>{N.init(e,t);let n=A.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>mr(t,r,e)));else if(mr(c,r,e),s&&c.issues.length!==0&&w(c))break}return o.length?Promise.all(o).then(()=>r):r},fr(e,pr)});function gr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Se(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}let _r=[];function vr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:_r,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=le(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function yr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(w(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>gr(e,n,i,t,d,f))):gr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}let br=/*@__PURE__*/ O(`$ZodObject`,(e,t)=>{N.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=l(()=>vr(t));D(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||p(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=b,o=t.catchall,s,c=A.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(w(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>gr(n,t,e,r,a,o))):gr(s,t,e,r,a,o)}return o?yr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),xr=/*@__PURE__*/ O(`$ZodObjectJIT`,(e,t)=>{br.init(e,t);let n=e._zod.parse,r=l(()=>vr(t)),i=A.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new gn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
5
+ `)}\n};`)(...Object.values(this.closed))}};let bn={major:4,minor:6,patch:7},j=/*@__PURE__*/ E(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=S(t),a;for(let o of n){if(o._zod.def.when){if(we(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new D;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Oe(t.issues,n,e),i||=S(t,n))});else{if(t.issues.length===n)continue;Oe(t.issues,n,e),i||=S(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(S(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new D;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new D;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ie(this,`~standard`,Cn(this))},set"~standard"(e){C(this,`~standard`,e)}}),xn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ke(e,t,k()))}:{value:e.value};async function Sn(e,t){let n={async:!0};return xn(await e._zod.run({value:t,issues:[]},n),n)}function Cn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return xn(r,n)}catch{}return Sn(e,t)},vendor:`zod`,version:1}}let wn=/*@__PURE__*/ E(`$ZodString`,(e,t)=>{j.init(e,t),e._zod.pattern=t.pattern??Yt,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}}),M=/*@__PURE__*/ E(`$ZodStringFormat`,(e,t)=>{dn.init(e,t),wn.init(e,t)}),Tn=/*@__PURE__*/ E(`$ZodGUID`,(e,t)=>{t.pattern??=jt,M.init(e,t)}),En=/*@__PURE__*/ E(`$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??=Mt(e)}else t.pattern??=Mt();M.init(e,t)}),Dn=/*@__PURE__*/ E(`$ZodEmail`,(e,t)=>{t.pattern??=Nt,M.init(e,t)});function On(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function kn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?On(e)||2:An(e,t)}function An(e,t){if(!t.normalize&&t.protocol?.source===Vt.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}let jn=/[\t\n\r]/g;function Mn(e){return e.replace(jn,``)}function Nn(e,t){return t.lastIndex=0,t.test(e.hostname)}function Pn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}let Fn=/*@__PURE__*/ E(`$ZodURL`,(e,t)=>{M.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=kn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Mn(r);return}t.hostname&&!Nn(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Pn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Mn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),In=/*@__PURE__*/ E(`$ZodEmoji`,(e,t)=>{t.pattern??=Pt(),M.init(e,t)}),Ln=/*@__PURE__*/ E(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Ot:kt(t.length),M.init(e,t)}),Rn=/*@__PURE__*/ E(`$ZodCUID`,(e,t)=>{t.pattern??=Ct,M.init(e,t)}),zn=/*@__PURE__*/ E(`$ZodCUID2`,(e,t)=>{t.pattern??=wt,M.init(e,t)}),Bn=/*@__PURE__*/ E(`$ZodULID`,(e,t)=>{t.pattern??=Tt,M.init(e,t)}),Vn=/*@__PURE__*/ E(`$ZodXID`,(e,t)=>{t.pattern??=Et,M.init(e,t)}),Hn=/*@__PURE__*/ E(`$ZodKSUID`,(e,t)=>{t.pattern??=Dt,M.init(e,t)}),Un=/*@__PURE__*/ E(`$ZodISODateTime`,(e,t)=>{t.pattern??=Jt(t),M.init(e,t)}),Wn=/*@__PURE__*/ E(`$ZodISODate`,(e,t)=>{t.pattern??=Gt,M.init(e,t)}),Gn=/*@__PURE__*/ E(`$ZodISOTime`,(e,t)=>{t.pattern??=qt(t),M.init(e,t)}),Kn=/*@__PURE__*/ E(`$ZodISODuration`,(e,t)=>{t.pattern??=At,M.init(e,t)}),qn=/*@__PURE__*/ E(`$ZodIPv4`,(e,t)=>{t.pattern??=Ft,M.init(e,t)}),Jn=/^[0-9a-fA-F:.]+$/;function Yn(e){return Jn.test(e)?On(`http://[${e}]`):!1}let Xn=/*@__PURE__*/ E(`$ZodIPv6`,(e,t)=>{t.pattern??=It,M.init(e,t),e._zod.check=n=>{Yn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Zn=/*@__PURE__*/ E(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Lt,M.init(e,t)});function Qn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Yn(n)}let $n=/*@__PURE__*/ E(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Rt,M.init(e,t),e._zod.check=n=>{Qn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function er(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tr=/^[0-9a-zA-Z+/]*={0,2}$/,nr=/*@__PURE__*/ E(`$ZodBase64`,(e,t)=>{t.pattern??=tr,M.init(e,t),e._zod.check=n=>{er(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),rr=/^[A-Za-z0-9_-]*$/;function ir(e){if(!rr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return er(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let ar=/*@__PURE__*/ E(`$ZodBase64URL`,(e,t)=>{t.pattern??=rr,M.init(e,t),e._zod.check=n=>{ir(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),or=/*@__PURE__*/ E(`$ZodE164`,(e,t)=>{t.pattern??=Ht,M.init(e,t)});function sr(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}}let cr=/*@__PURE__*/ E(`$ZodJWT`,(e,t)=>{M.init(e,t),e._zod.check=n=>{sr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),lr=/*@__PURE__*/ E(`$ZodNumber`,(e,t)=>{j.init(e,t),e._zod.pattern=Xt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),ur=/*@__PURE__*/ E(`$ZodNumberFormat`,(e,t)=>{sn.init(e,t),lr.init(e,t)}),dr=/*@__PURE__*/ E(`$ZodBoolean`,(e,t)=>{j.init(e,t),e._zod.pattern=Zt,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}}),fr=/*@__PURE__*/ E(`$ZodNull`,(e,t)=>{j.init(e,t),e._zod.pattern=Qt,e._zod.values=/* @__PURE__ */ 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}}),pr=/*@__PURE__*/ E(`$ZodUnknown`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e}),mr=/*@__PURE__*/ E(`$ZodNever`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function hr(e,t){let n=De(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of De(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Oe(n.issues,t,e),n}}return i(n,a)}}let gr=e=>Array.isArray(e)?e.length:-1;function _r(e,t,n){e.issues.length&&t.issues.push(...Te(n,e.issues)),t.value[n]=e.value}let vr=/*@__PURE__*/ E(`$ZodArray`,(e,t)=>{j.init(e,t);let n=O.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>_r(t,r,e)));else if(_r(c,r,e),s&&c.issues.length!==0&&S(c))break}return o.length?Promise.all(o).then(()=>r):r},hr(e,gr)});function yr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Te(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}let br=[];function xr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:br,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=fe(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Sr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(S(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>yr(e,n,i,t,d,f))):yr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}let Cr=/*@__PURE__*/ E(`$ZodObject`,(e,t)=>{j.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=u(()=>xr(t));T(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||m(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ae,o=t.catchall,s,c=O.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(S(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>yr(n,t,e,r,a,o))):yr(s,t,e,r,a,o)}return o?Sr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),wr=/*@__PURE__*/ E(`$ZodObjectJIT`,(e,t)=>{Cr.init(e,t);let n=e._zod.parse,r=u(()=>xr(t)),i=O.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new yn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
6
6
  let ${e}_ab = false;
7
7
  for (let i = 0; i < ${e}.issues.length; i++) {
8
8
  const iss = ${e}.issues[i];
@@ -13,7 +13,7 @@ function O(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
13
13
  if (${e}_ab && ctx && ctx.abortEarly) {
14
14
  payload.value = newResult;
15
15
  return payload;
16
- }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:te(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
16
+ }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:ne(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
17
17
  const ${n}_present = ${i};
18
18
  if (!${n}.issues.length || ${n}_present) {
19
19
  if (${n}.issues.length) {${c(n,r)}
@@ -52,74 +52,74 @@ function O(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
52
52
  newResult[${r}] = ${n}.value;
53
53
  }
54
54
 
55
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=b,c=!A.jitless,u=c&&ie.value,d=t.catchall,f;e._zod.parse=(i,l)=>{f??=r.value;let p=i.value;return s(p)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=a(t.shape),i=o(i,l),d?yr([],p,i,l,f,e,l?.abortEarly===!0):i):n(i,l):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Sr(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=>!w(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=>T(e,r,j())))}),t)}let Cr=/*@__PURE__*/ O(`$ZodUnion`,(e,t)=>{N.init(e,t),D(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),D(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),D(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),D(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>d(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=>Sr(t,r,e,i)):Sr(o,r,e,i)}}),wr=/*@__PURE__*/ O(`$ZodIntersection`,(e,t)=>{N.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])=>Er(e,t,n)):Er(e,i,a)}});function Tr(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};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Tr(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=Tr(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 Er(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Tr(t.value,n.value);if(!c.valid){if(w(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}let Dr=/*@__PURE__*/ O(`$ZodEnum`,(e,t)=>{N.init(e,t);let n=a(t.entries),r=new Set(n);e._zod.values=r,D(e,`pattern`,e=>{let t=a(e.def.entries).filter(e=>oe.has(typeof e));return RegExp(t.length?`^(${t.map(e=>se(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Or=/*@__PURE__*/ O(`$ZodLiteral`,(e,t)=>{N.init(e,t);let n=new Set(t.values);e._zod.values=n,D(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?se(e):e?se(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),kr=/*@__PURE__*/ O(`$ZodTransform`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,A.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ge(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new k;return n.value=i,n}});function Ar(e,t){return e.value=t.issues.length?void 0:t.value,e}let jr=/*@__PURE__*/ O(`$ZodOptional`,(e,t)=>{N.init(e,t),D(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,D(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),D(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ar(e,t)):Ar(e,r)}return t.innerType._zod.run(e,n)}}),Mr=/*@__PURE__*/ O(`$ZodExactOptional`,(e,t)=>{jr.init(e,t),D(e,`values`,e=>e.def.innerType._zod.values),D(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Nr=/*@__PURE__*/ O(`$ZodNullable`,(e,t)=>{N.init(e,t),D(e,`optin`,e=>e.def.innerType._zod.optin),D(e,`optout`,e=>e.def.innerType._zod.optout),D(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)}|null)$`):void 0}),D(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pr=/*@__PURE__*/ O(`$ZodDefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,D(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fr(e,t)):Fr(r,t)}});function Fr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let Ir=/*@__PURE__*/ O(`$ZodPrefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,D(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Lr=/*@__PURE__*/ O(`$ZodNonOptional`,(e,t)=>{N.init(e,t),D(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Rr(t,e)):Rr(i,e)}});function Rr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function zr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>T(e,r,j()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}let Br=/*@__PURE__*/ O(`$ZodCatch`,(e,t)=>{N.init(e,t),D(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),D(e,`optout`,e=>e.def.innerType._zod.optout),D(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>zr(e,r,t,n)):zr(e,r,t,n)}}),Vr=/*@__PURE__*/ O(`$ZodPipe`,(e,t)=>{N.init(e,t),D(e,`values`,e=>e.def.in._zod.values),D(e,`optin`,e=>e.def.in._zod.optin),D(e,`optout`,e=>e.def.out._zod.optout),D(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Hr(e,t.in,n)):Hr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Hr(e,t.out,n)):Hr(r,t.out,n)}});function Hr(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}let Ur=/*@__PURE__*/ O(`$ZodReadonly`,(e,t)=>{N.init(e,t),D(e,`propValues`,e=>e.def.innerType._zod.propValues),D(e,`values`,e=>e.def.innerType._zod.values),D(e,`optin`,e=>e.def.innerType?._zod?.optin),D(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Wr):Wr(r)}});function Wr(e){return e.memo||(e.value=Object.freeze(e.value)),e}let Gr=/*@__PURE__*/ O(`$ZodCustom`,(e,t)=>{M.init(e,t),N.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=>Kr(t,n,r,e));Kr(i,n,r,e)}});function Kr(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(Ae(e))}}var qr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};let Jr=`~memo`,Yr=[];function Xr(e){return typeof e==`object`&&!!e}function Zr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let Qr=/*@__PURE__*/ new WeakMap;function $r(e,t,n){let r=Qr.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=$r(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?$r(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=m(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?$r(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ei(e,i)}function ei(e,t){return t!==1&&Qr.set(e,t===2),t}function ti(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ni,ri=[],ii={alloc(e,t,n){let r=ni;if(!r)return n;ni=void 0;let i={value:n,issues:null};return r.set(t.value,i),ri.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&oi(n,e.value))throw new qr;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=$r(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Xr(l))return t(s,c);let u=c[Jr];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Jr]=u);let d;i===c?d=a:(d=ti(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Zr(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ni=d;let p=ri.length,m=t(s,c);ni=void 0;let h=ri.length>p?ri.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Zr(e.issues):Yr),e)):(h&&(h.issues=m.issues.length?Zr(m.issues):Yr),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ai(){return ii}function oi(e,t){let n=e[Jr]?.backEdges;return n!==void 0&&Xr(t)&&n.has(t)}let si=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(ke(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ce(e.values[0])}`:`Invalid option: expected one of ${o(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${o(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function ci(){return{localeError:si()}}var li,ui=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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 di(){return new ui}(li=globalThis).__zod_globalRegistry??(li.__zod_globalRegistry=di());let fi=globalThis.__zod_globalRegistry;function pi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
56
- function mi(e,t){return new e(pi({type:`string`,...C(t)}))}// @__NO_SIDE_EFFECTS__
57
- function hi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
58
- function gi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
59
- function _i(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
60
- function vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...C(t)})}// @__NO_SIDE_EFFECTS__
61
- function yi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...C(t)})}// @__NO_SIDE_EFFECTS__
62
- function bi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...C(t)})}// @__NO_SIDE_EFFECTS__
63
- function xi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
64
- function Si(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
65
- function Ci(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
66
- function wi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
67
- function Ti(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
68
- function Ei(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
69
- function Di(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
70
- function Oi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
71
- function ki(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
72
- function Ai(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
73
- function ji(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
74
- function Mi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
75
- function Ni(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
76
- function Pi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
77
- function Fi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
78
- function Ii(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
79
- function Li(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...C(t)})}// @__NO_SIDE_EFFECTS__
80
- function Ri(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...C(t)})}// @__NO_SIDE_EFFECTS__
81
- function zi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...C(t)})}// @__NO_SIDE_EFFECTS__
82
- function Bi(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...C(t)})}// @__NO_SIDE_EFFECTS__
83
- function Vi(e,t){return new e(pi({type:`number`,checks:[],...C(t)}))}// @__NO_SIDE_EFFECTS__
84
- function Hi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...C(t)})}// @__NO_SIDE_EFFECTS__
85
- function Ui(e,t){return new e({type:`boolean`,...C(t)})}// @__NO_SIDE_EFFECTS__
86
- function Wi(e,t){return new e({type:`null`,...C(t)})}// @__NO_SIDE_EFFECTS__
87
- function Gi(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
88
- function Ki(e,t){return new e({type:`never`,...C(t)})}// @__NO_SIDE_EFFECTS__
89
- function qi(e,t){return new en({check:`less_than`,...C(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
90
- function Ji(e,t){return new en({check:`less_than`,...C(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
91
- function Yi(e,t){return new tn({check:`greater_than`,...C(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
92
- function Xi(e,t){return new tn({check:`greater_than`,...C(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
93
- function Zi(e,t){return new nn({check:`multiple_of`,...C(t),value:e})}// @__NO_SIDE_EFFECTS__
94
- function Qi(e,t){return new an({check:`max_length`,...C(t),maximum:e})}// @__NO_SIDE_EFFECTS__
95
- function $i(e,t){return new on({check:`min_length`,...C(t),minimum:e})}// @__NO_SIDE_EFFECTS__
96
- function ea(e,t){return new sn({check:`length_equals`,...C(t),length:e})}// @__NO_SIDE_EFFECTS__
97
- function ta(e,t){return new ln({check:`string_format`,format:`regex`,...C(t),pattern:e})}// @__NO_SIDE_EFFECTS__
98
- function na(e){return new un({check:`string_format`,format:`lowercase`,...C(e)})}// @__NO_SIDE_EFFECTS__
99
- function ra(e){return new dn({check:`string_format`,format:`uppercase`,...C(e)})}// @__NO_SIDE_EFFECTS__
100
- function ia(e,t){return new fn({check:`string_format`,format:`includes`,...C(t),includes:e})}// @__NO_SIDE_EFFECTS__
101
- function aa(e,t){return new pn({check:`string_format`,format:`starts_with`,...C(t),prefix:e})}// @__NO_SIDE_EFFECTS__
102
- function oa(e,t){return new mn({check:`string_format`,format:`ends_with`,...C(t),suffix:e})}// @__NO_SIDE_EFFECTS__
103
- function F(e){return new hn({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
104
- function sa(e){return/* @__PURE__ */ F(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
105
- function ca(){return/* @__PURE__ */ F(e=>e.trim())}// @__NO_SIDE_EFFECTS__
106
- function la(){return/* @__PURE__ */ F(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
107
- function ua(){return/* @__PURE__ */ F(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
108
- function da(){return/* @__PURE__ */ F(e=>ne(e))}// @__NO_SIDE_EFFECTS__
109
- function fa(e,t,n){return new e({type:`array`,element:t,...C(n)})}// @__NO_SIDE_EFFECTS__
110
- function pa(e,t,n){let r=C(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}// @__NO_SIDE_EFFECTS__
111
- function ma(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...C(n)})}// @__NO_SIDE_EFFECTS__
112
- function ha(e,t){let n=/* @__PURE__ */ ga(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ae(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ae(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
113
- function ga(e,t){let n=new M({check:`custom`,...C(t)});return n._zod.check=e,n}function _a(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&p(e,t,n[t]);return e}function va(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??fi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function I(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function L(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,L(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&_a(o.schema,c),t.io===`input`&&R(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 ya(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ba(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ 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}/${ya(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ya(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>
55
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ae,c=!O.jitless,l=c&&oe.value,d=t.catchall,f;e._zod.parse=(i,u)=>{f??=r.value;let p=i.value;return s(p)?c&&l&&u?.async===!1&&u.jitless!==!0?(o||=a(t.shape),i=o(i,u),d?Sr([],p,i,u,f,e,u?.abortEarly===!0):i):n(i,u):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Tr(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=>!S(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=>ke(e,r,k())))}),t)}let Er=/*@__PURE__*/ E(`$ZodUnion`,(e,t)=>{j.init(e,t),T(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),T(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),T(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),T(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>f(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=>Tr(t,r,e,i)):Tr(o,r,e,i)}}),Dr=/*@__PURE__*/ E(`$ZodIntersection`,(e,t)=>{j.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])=>kr(e,t,n)):kr(e,i,a)}});function Or(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(se(e)&&se(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Or(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=Or(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 kr(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Or(t.value,n.value);if(!c.valid){if(S(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}let Ar=/*@__PURE__*/ E(`$ZodEnum`,(e,t)=>{j.init(e,t);let n=o(t.entries),r=new Set(n);e._zod.values=r,T(e,`pattern`,e=>{let t=o(e.def.entries).filter(e=>le.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ue(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),jr=/*@__PURE__*/ E(`$ZodLiteral`,(e,t)=>{j.init(e,t);let n=new Set(t.values);e._zod.values=n,T(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?ue(e):e?ue(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Mr=/*@__PURE__*/ E(`$ZodTransform`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,O.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Je(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new D;return n.value=i,n}});function Nr(e,t){return e.value=t.issues.length?void 0:t.value,e}let Pr=/*@__PURE__*/ E(`$ZodOptional`,(e,t)=>{j.init(e,t),T(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,T(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),T(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${f(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Nr(e,t)):Nr(e,r)}return t.innerType._zod.run(e,n)}}),Fr=/*@__PURE__*/ E(`$ZodExactOptional`,(e,t)=>{Pr.init(e,t),T(e,`values`,e=>e.def.innerType._zod.values),T(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ir=/*@__PURE__*/ E(`$ZodNullable`,(e,t)=>{j.init(e,t),T(e,`optin`,e=>e.def.innerType._zod.optin),T(e,`optout`,e=>e.def.innerType._zod.optout),T(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${f(t.source)}|null)$`):void 0}),T(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Lr=/*@__PURE__*/ E(`$ZodDefault`,(e,t)=>{j.init(e,t),e._zod.optin=`defaulted`,T(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Rr(e,t)):Rr(r,t)}});function Rr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let zr=/*@__PURE__*/ E(`$ZodPrefault`,(e,t)=>{j.init(e,t),e._zod.optin=`defaulted`,T(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Br=/*@__PURE__*/ E(`$ZodNonOptional`,(e,t)=>{j.init(e,t),T(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Vr(t,e)):Vr(i,e)}});function Vr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Hr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ke(e,r,k()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}let Ur=/*@__PURE__*/ E(`$ZodCatch`,(e,t)=>{j.init(e,t),T(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),T(e,`optout`,e=>e.def.innerType._zod.optout),T(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Hr(e,r,t,n)):Hr(e,r,t,n)}}),Wr=/*@__PURE__*/ E(`$ZodPipe`,(e,t)=>{j.init(e,t),T(e,`values`,e=>e.def.in._zod.values),T(e,`optin`,e=>e.def.in._zod.optin),T(e,`optout`,e=>e.def.out._zod.optout),T(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Gr(e,t.in,n)):Gr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Gr(e,t.out,n)):Gr(r,t.out,n)}});function Gr(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}let Kr=/*@__PURE__*/ E(`$ZodReadonly`,(e,t)=>{j.init(e,t),T(e,`propValues`,e=>e.def.innerType._zod.propValues),T(e,`values`,e=>e.def.innerType._zod.values),T(e,`optin`,e=>e.def.innerType?._zod?.optin),T(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(qr):qr(r)}});function qr(e){return e.memo||(e.value=Object.freeze(e.value)),e}let Jr=/*@__PURE__*/ E(`$ZodCustom`,(e,t)=>{A.init(e,t),j.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=>Yr(t,n,r,e));Yr(i,n,r,e)}});function Yr(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(Pe(e))}}var Xr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};let Zr=`~memo`,Qr=[];function $r(e){return typeof e==`object`&&!!e}function ei(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let ti=/*@__PURE__*/ new WeakMap;function ni(e,t,n){let r=ti.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=ni(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?ni(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=h(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?ni(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ri(e,i)}function ri(e,t){return t!==1&&ti.set(e,t===2),t}function ii(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ai,oi=[],si={alloc(e,t,n){let r=ai;if(!r)return n;ai=void 0;let i={value:n,issues:null};return r.set(t.value,i),oi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&li(n,e.value))throw new Xr;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=ni(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!$r(l))return t(s,c);let u=c[Zr];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Zr]=u);let d;i===c?d=a:(d=ii(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...ei(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ai=d;let p=oi.length,m=t(s,c);ai=void 0;let h=oi.length>p?oi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ei(e.issues):Qr),e)):(h&&(h.issues=m.issues.length?ei(m.issues):Qr),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ci(){return si}function li(e,t){let n=e[Zr]?.backEdges;return n!==void 0&&$r(t)&&n.has(t)}let ui=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ne(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${de(e.values[0])}`:`Invalid option: expected one of ${s(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${s(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function di(){return{localeError:ui()}}var fi,pi=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ 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 mi(){return new pi}(fi=globalThis).__zod_globalRegistry??(fi.__zod_globalRegistry=mi());let hi=globalThis.__zod_globalRegistry;function gi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
56
+ function _i(e,t){return new e(gi({type:`string`,...x(t)}))}// @__NO_SIDE_EFFECTS__
57
+ function vi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
58
+ function yi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
59
+ function bi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
60
+ function xi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...x(t)})}// @__NO_SIDE_EFFECTS__
61
+ function Si(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...x(t)})}// @__NO_SIDE_EFFECTS__
62
+ function Ci(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...x(t)})}// @__NO_SIDE_EFFECTS__
63
+ function wi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
64
+ function Ti(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
65
+ function Ei(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
66
+ function Di(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
67
+ function Oi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
68
+ function ki(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
69
+ function Ai(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
70
+ function ji(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
71
+ function Mi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
72
+ function Ni(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
73
+ function Pi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
74
+ function Fi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
75
+ function Ii(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
76
+ function Li(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
77
+ function Ri(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
78
+ function zi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...x(t)})}// @__NO_SIDE_EFFECTS__
79
+ function Bi(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...x(t)})}// @__NO_SIDE_EFFECTS__
80
+ function Vi(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...x(t)})}// @__NO_SIDE_EFFECTS__
81
+ function Hi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...x(t)})}// @__NO_SIDE_EFFECTS__
82
+ function Ui(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...x(t)})}// @__NO_SIDE_EFFECTS__
83
+ function Wi(e,t){return new e(gi({type:`number`,checks:[],...x(t)}))}// @__NO_SIDE_EFFECTS__
84
+ function Gi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...x(t)})}// @__NO_SIDE_EFFECTS__
85
+ function Ki(e,t){return new e({type:`boolean`,...x(t)})}// @__NO_SIDE_EFFECTS__
86
+ function qi(e,t){return new e({type:`null`,...x(t)})}// @__NO_SIDE_EFFECTS__
87
+ function Ji(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
88
+ function Yi(e,t){return new e({type:`never`,...x(t)})}// @__NO_SIDE_EFFECTS__
89
+ function Xi(e,t){return new rn({check:`less_than`,...x(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
90
+ function Zi(e,t){return new rn({check:`less_than`,...x(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
91
+ function Qi(e,t){return new an({check:`greater_than`,...x(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
92
+ function $i(e,t){return new an({check:`greater_than`,...x(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
93
+ function ea(e,t){return new on({check:`multiple_of`,...x(t),value:e})}// @__NO_SIDE_EFFECTS__
94
+ function ta(e,t){return new cn({check:`max_length`,...x(t),maximum:e})}// @__NO_SIDE_EFFECTS__
95
+ function na(e,t){return new ln({check:`min_length`,...x(t),minimum:e})}// @__NO_SIDE_EFFECTS__
96
+ function ra(e,t){return new un({check:`length_equals`,...x(t),length:e})}// @__NO_SIDE_EFFECTS__
97
+ function ia(e,t){return new fn({check:`string_format`,format:`regex`,...x(t),pattern:e})}// @__NO_SIDE_EFFECTS__
98
+ function aa(e){return new pn({check:`string_format`,format:`lowercase`,...x(e)})}// @__NO_SIDE_EFFECTS__
99
+ function oa(e){return new mn({check:`string_format`,format:`uppercase`,...x(e)})}// @__NO_SIDE_EFFECTS__
100
+ function sa(e,t){return new hn({check:`string_format`,format:`includes`,...x(t),includes:e})}// @__NO_SIDE_EFFECTS__
101
+ function ca(e,t){return new gn({check:`string_format`,format:`starts_with`,...x(t),prefix:e})}// @__NO_SIDE_EFFECTS__
102
+ function la(e,t){return new _n({check:`string_format`,format:`ends_with`,...x(t),suffix:e})}// @__NO_SIDE_EFFECTS__
103
+ function ua(e){return new vn({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
104
+ function da(e){return/* @__PURE__ */ ua(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
105
+ function fa(){return/* @__PURE__ */ ua(e=>e.trim())}// @__NO_SIDE_EFFECTS__
106
+ function pa(){return/* @__PURE__ */ ua(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
107
+ function ma(){return/* @__PURE__ */ ua(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
108
+ function ha(){return/* @__PURE__ */ ua(e=>re(e))}// @__NO_SIDE_EFFECTS__
109
+ function ga(e,t,n){return new e({type:`array`,element:t,...x(n)})}// @__NO_SIDE_EFFECTS__
110
+ function _a(e,t,n){let r=x(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}// @__NO_SIDE_EFFECTS__
111
+ function va(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...x(n)})}// @__NO_SIDE_EFFECTS__
112
+ function ya(e,t){let n=/* @__PURE__ */ ba(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Pe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Pe(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
113
+ function ba(e,t){let n=new A({check:`custom`,...x(t)});return n._zod.check=e,n}function xa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&m(e,t,n[t]);return e}function Sa(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??hi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function N(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function P(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,P(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&xa(o.schema,c),t.io===`input`&&F(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 Ca(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function wa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ 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}/${Ca(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Ca(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>
114
114
 
115
- 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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function xa(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;xa(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}let Sa=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Ca=[`oneOf`,`anyOf`];function wa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ta(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Sa.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??wa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}p(n,r,e.length===1?e[0]:Ta(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=wa(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Ea(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Sa)if(t in e)return;let n=t.filter(e=>Ca.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ta(t);else{let e=n[0],i=Ca.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ta([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,_a(e,r))}function Da(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)):_a(i,s),_a(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())xa(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Ea(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}_a(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,p(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ka(t,`input`,e.processors),output:ka(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function R(e,t){let n=t??{seen:/* @__PURE__ */ 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 R(r.element,n);if(r.type===`set`)return R(r.valueType,n);if(r.type===`lazy`)return R(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return R(r.innerType,n);if(r.type===`intersection`)return R(r.left,n)||R(r.right,n);if(r.type===`record`||r.type===`map`)return R(r.keyType,n)||R(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:R(r.in,n)||R(r.out,n);if(r.type===`object`){for(let e in r.shape)if(R(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(R(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(R(e,n))return!0;return!!(r.rest&&R(r.rest,n))}return!1}let Oa=(e,t={})=>n=>{let r=va({...n,processors:t});return L(e,r),ba(r,e),Da(r,e)},ka=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=va({...i??{},target:a,io:t,processors:n});return L(e,o),ba(o,e),Da(o,e)},z=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},B=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Aa=(e,t)=>{z(e,`minimum`,t),B(e,`maximum`,t)},ja=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ma=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Na=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Pa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Fa=(e,t)=>z(e,`minimum`,t.minimum),Ia=(e,t)=>B(e,`maximum`,t.maximum),La=e=>(t,n)=>{Pa(t,n.format);let[r,i]=e[n.format];z(t,`minimum`,r),B(t,`maximum`,i)},Ra={greater_than:(e,t)=>z(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>B(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ja(e,t.value),number_format:La(ue),bigint_format:La(de),min_length:Fa,max_length:Ia,length_equals:(e,t)=>Aa(e,t.length),min_size:Fa,max_size:Ia,size_equals:(e,t)=>Aa(e,t.size),string_format:(e,t)=>{Pa(e,t.format),t.pattern&&Ma(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Na(e,t.mime)};function V(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ra[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&z(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&z(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&B(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&B(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ja(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Na(t,i.mime);for(let e of i.patterns??[])Ma(t,e);return t}let za={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ba=/* @__PURE__ */ new Map([[Qn,It],[er,Lt]]),Va=e=>Ba.get(e)??e,Ha=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=V(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=za[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Va);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}))])}},Ua=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=V(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):I(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Wa=(e,t,n,r)=>{n.type=`boolean`},Ga=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ka=(e,t,n,r)=>{n.not={}},qa=(e,t,n,r)=>{let i=e._zod.def,o=a(i.entries);o.length===0?n.not={}:(o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o)},Ja=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(I(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(I(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ya=(e,t,n,r)=>{I(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Xa=(e,t,n,r)=>{I(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Za=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=V(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=L(a.element,t,{...r,path:[...r.path,`items`]})};function Qa(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Qa(t.out):t.type===`catch`?Qa(t.innerType):e._zod.optin}let $a=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&I(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)p(i.properties,e,L(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Qa(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=L(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},eo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>L(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},to=(e,t,n,r)=>{let i=e._zod.def,a=L(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=L(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},no=(e,t,n,r)=>{let i=e._zod.def,a=L(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`}]},ro=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},io=Symbol();function ao(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(I(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),io):JSON.parse(o)}let oo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n.default=o)},so=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n._prefault=o)},co=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{I(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},lo=(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;L(o,t,r);let s=t.seen.get(e);s.ref=o},uo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},fo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},po=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function mo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let H=/*@__PURE__*/ O(`ZodError`,(e,t)=>{Ze.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);po.has(n)||(po.add(n),mo(n,`format`,e=>t=>et(e,t)),mo(n,`flatten`,e=>t=>$e(e,t)),mo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}),mo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ho=/* @__PURE__ */ nt(H),go=/* @__PURE__ */ rt(H),_o=/* @__PURE__ */ it(H),vo=/* @__PURE__ */ ot(H),yo=/* @__PURE__ */ ft(H),bo=/* @__PURE__ */ pt(H),xo=/* @__PURE__ */ mt(H),So=/* @__PURE__ */ ht(H),Co=/* @__PURE__ */ gt(H),wo=/* @__PURE__ */ _t(H),To=/* @__PURE__ */ vt(H),Eo=/* @__PURE__ */ yt(H);function Do(){A.localeError||j(ci())}function Oo(){A.memoizer||j({memoizer:ai()})}let U=/*@__PURE__*/ O(`ZodType`,(e,t)=>(Do(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(y(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 S(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Hs(e,t))},superRefine(e,t){return this.check(Us(e,t))},overwrite(e){return this.check(/* @__PURE__ */ F(e))},optional(){return Cs(this)},exactOptional(){return Ts(this)},nullable(){return Ds(this)},nullish(){return Cs(Ds(this))},nonoptional(e){return Ns(this,e)},array(){return J(this)},or(e){return ps([this,e])},and(e){return hs(this,e)},transform(e){return Ls(this,xs(e))},default(e){return ks(this,e)},prefault(e){return js(this,e)},catch(e){return Fs(this,e)},pipe(e){return Ls(this,e)},readonly(){return zs(this)},describe(e){let t=this.clone();return fi.add(t,{description:e}),t},meta(...e){if(e.length===0)return fi.get(this);let t=this.clone();return fi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Me(this,`~standard`,{...bn(this),jsonSchema:{input:ka(this,`input`),output:ka(this,`output`)}})},set"~standard"(e){E(this,`~standard`,e)},parse:function e(t,n){return ho(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await go(this,t,n,{callee:e})},safeParse(e,t){return _o(this,e,t)},async safeParseAsync(e,t){return vo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){E(this,`spa`,e)},validate(e,t){return lt(this,e,t)},validateAsync(e,t){return dt(this,e,t)},encode:function e(t,n){return yo(this,t,n,{callee:e})},decode:function e(t,n){return bo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await xo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await So(this,t,n,{callee:e})},safeEncode(e,t){return Co(this,e,t)},safeDecode(e,t){return wo(this,e,t)},async safeEncodeAsync(e,t){return To(this,e,t)},async safeDecodeAsync(e,t){return Eo(this,e,t)},toJSONSchema(e){return Oa(this,{})(e)},get description(){return fi.get(this)?.description},get _def(){return this._zod.def}}),ko=/*@__PURE__*/ O(`_ZodString`,(e,t)=>{xn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r)},/*@__PURE__*/ Ne({format:e=>V(e).format??null,minLength:e=>V(e).minimum??null,maxLength:e=>V(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ ta(...e))},includes(...e){return this.check(/* @__PURE__ */ ia(...e))},startsWith(...e){return this.check(/* @__PURE__ */ aa(...e))},endsWith(...e){return this.check(/* @__PURE__ */ oa(...e))},min(...e){return this.check(/* @__PURE__ */ $i(...e))},max(...e){return this.check(/* @__PURE__ */ Qi(...e))},length(...e){return this.check(/* @__PURE__ */ ea(...e))},nonempty(...e){return this.check(/* @__PURE__ */ $i(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ na(e))},uppercase(e){return this.check(/* @__PURE__ */ ra(e))},trim(){return this.check(/* @__PURE__ */ ca())},normalize(...e){return this.check(/* @__PURE__ */ sa(...e))},toLowerCase(){return this.check(/* @__PURE__ */ la())},toUpperCase(){return this.check(/* @__PURE__ */ ua())},slugify(){return this.check(/* @__PURE__ */ da())}})),Ao=/*@__PURE__*/ O(`ZodString`,(e,t)=>{xn.init(e,t),ko.init(e,t)},{email(e){return this.check(/* @__PURE__ */ hi(Fo,e))},url(e){return this.check(/* @__PURE__ */ xi(Ro,e))},jwt(e){return this.check(/* @__PURE__ */ Ii($o,e))},emoji(e){return this.check(/* @__PURE__ */ Si(zo,e))},guid(e){return this.check(/* @__PURE__ */ gi(Io,e))},uuid(e){return this.check(/* @__PURE__ */ _i(Lo,e))},uuidv4(e){return this.check(/* @__PURE__ */ vi(Lo,e))},uuidv6(e){return this.check(/* @__PURE__ */ yi(Lo,e))},uuidv7(e){return this.check(/* @__PURE__ */ bi(Lo,e))},nanoid(e){return this.check(/* @__PURE__ */ Ci(Bo,e))},cuid(e){return this.check(/* @__PURE__ */ wi(Vo,e))},cuid2(e){return this.check(/* @__PURE__ */ Ti(Ho,e))},ulid(e){return this.check(/* @__PURE__ */ Ei(Uo,e))},base64(e){return this.check(/* @__PURE__ */ Ni(Xo,e))},base64url(e){return this.check(/* @__PURE__ */ Pi(Zo,e))},xid(e){return this.check(/* @__PURE__ */ Di(Wo,e))},ksuid(e){return this.check(/* @__PURE__ */ Oi(Go,e))},ipv4(e){return this.check(/* @__PURE__ */ ki(Ko,e))},ipv6(e){return this.check(/* @__PURE__ */ Ai(qo,e))},cidrv4(e){return this.check(/* @__PURE__ */ ji(Jo,e))},cidrv6(e){return this.check(/* @__PURE__ */ Mi(Yo,e))},e164(e){return this.check(/* @__PURE__ */ Fi(Qo,e))},datetime(e){return this.check(/* @__PURE__ */ Li(jo,e))},date(e){return this.check(/* @__PURE__ */ Ri(Mo,e))},time(e){return this.check(/* @__PURE__ */ zi(No,e))},duration(e){return this.check(/* @__PURE__ */ Bi(Po,e))}});function W(e){return/* @__PURE__ */ mi(Ao,e)}let G=/*@__PURE__*/ O(`ZodStringFormat`,(e,t)=>{P.init(e,t),ko.init(e,t)}),jo=/*@__PURE__*/ O(`ZodISODateTime`,(e,t)=>{Bn.init(e,t),G.init(e,t)}),Mo=/*@__PURE__*/ O(`ZodISODate`,(e,t)=>{Vn.init(e,t),G.init(e,t)}),No=/*@__PURE__*/ O(`ZodISOTime`,(e,t)=>{Hn.init(e,t),G.init(e,t)}),Po=/*@__PURE__*/ O(`ZodISODuration`,(e,t)=>{Un.init(e,t),G.init(e,t)}),Fo=/*@__PURE__*/ O(`ZodEmail`,(e,t)=>{wn.init(e,t),G.init(e,t)}),Io=/*@__PURE__*/ O(`ZodGUID`,(e,t)=>{Sn.init(e,t),G.init(e,t)}),Lo=/*@__PURE__*/ O(`ZodUUID`,(e,t)=>{Cn.init(e,t),G.init(e,t)}),Ro=/*@__PURE__*/ O(`ZodURL`,(e,t)=>{Mn.init(e,t),G.init(e,t)}),zo=/*@__PURE__*/ O(`ZodEmoji`,(e,t)=>{Nn.init(e,t),G.init(e,t)}),Bo=/*@__PURE__*/ O(`ZodNanoID`,(e,t)=>{Pn.init(e,t),G.init(e,t)}),Vo=/*@__PURE__*/ O(`ZodCUID`,(e,t)=>{Fn.init(e,t),G.init(e,t)}),Ho=/*@__PURE__*/ O(`ZodCUID2`,(e,t)=>{In.init(e,t),G.init(e,t)}),Uo=/*@__PURE__*/ O(`ZodULID`,(e,t)=>{Ln.init(e,t),G.init(e,t)}),Wo=/*@__PURE__*/ O(`ZodXID`,(e,t)=>{Rn.init(e,t),G.init(e,t)}),Go=/*@__PURE__*/ O(`ZodKSUID`,(e,t)=>{zn.init(e,t),G.init(e,t)}),Ko=/*@__PURE__*/ O(`ZodIPv4`,(e,t)=>{Wn.init(e,t),G.init(e,t)}),qo=/*@__PURE__*/ O(`ZodIPv6`,(e,t)=>{qn.init(e,t),G.init(e,t)}),Jo=/*@__PURE__*/ O(`ZodCIDRv4`,(e,t)=>{Jn.init(e,t),G.init(e,t)}),Yo=/*@__PURE__*/ O(`ZodCIDRv6`,(e,t)=>{Xn.init(e,t),G.init(e,t)}),Xo=/*@__PURE__*/ O(`ZodBase64`,(e,t)=>{$n.init(e,t),G.init(e,t)}),Zo=/*@__PURE__*/ O(`ZodBase64URL`,(e,t)=>{nr.init(e,t),G.init(e,t)}),Qo=/*@__PURE__*/ O(`ZodE164`,(e,t)=>{rr.init(e,t),G.init(e,t)}),$o=/*@__PURE__*/ O(`ZodJWT`,(e,t)=>{ar.init(e,t),G.init(e,t)}),es=/*@__PURE__*/ O(`ZodNumber`,(e,t)=>{or.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Ne({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=V(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=V(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=V(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>V(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Yi(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},min(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},lt(e,t){return this.check(/* @__PURE__ */ qi(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Ji(e,t))},max(e,t){return this.check(/* @__PURE__ */ Ji(e,t))},int(e){return this.check(ns(e))},safe(e){return this.check(ns(e))},positive(e){return this.check(/* @__PURE__ */ Yi(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Xi(0,e))},negative(e){return this.check(/* @__PURE__ */ qi(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Ji(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},step(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},finite(){return this}}));function K(e){return/* @__PURE__ */ Vi(es,e)}let ts=/*@__PURE__*/ O(`ZodNumberFormat`,(e,t)=>{sr.init(e,t),es.init(e,t)});function ns(e){return/* @__PURE__ */ Hi(ts,e)}let rs=/*@__PURE__*/ O(`ZodBoolean`,(e,t)=>{cr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)});function q(e){return/* @__PURE__ */ Ui(rs,e)}let is=/*@__PURE__*/ O(`ZodNull`,(e,t)=>{lr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r)});function as(e){return/* @__PURE__ */ Wi(is,e)}let os=/*@__PURE__*/ O(`ZodUnknown`,(e,t)=>{ur.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ss(){return/* @__PURE__ */ Gi(os)}let cs=/*@__PURE__*/ O(`ZodNever`,(e,t)=>{dr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r)});function ls(e){return/* @__PURE__ */ Ki(cs,e)}let us=/*@__PURE__*/ O(`ZodArray`,(e,t)=>{Oo(),hr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ $i(e,t))},nonempty(e){return this.check(/* @__PURE__ */ $i(1,e))},max(e,t){return this.check(/* @__PURE__ */ Qi(e,t))},length(e,t){return this.check(/* @__PURE__ */ ea(e,t))},unwrap(){return this.element}});function J(e,t){return/* @__PURE__ */ fa(us,e,t)}let ds=/*@__PURE__*/ O(`ZodObject`,(e,t)=>{Oo(),xr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),ze(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return _s(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y(this._zod.def,{catchall:ss()}))},loose(){return this.clone(y(this._zod.def,{catchall:ss()}))},strict(){return this.clone(y(this._zod.def,{catchall:ls()}))},strip(){return this.clone(y(this._zod.def,{catchall:void 0}))},extend(e){return he(this,e)},safeExtend(e){return _e(this,e)},merge(e){return ve(this,e)},pick(e){return fe(this,e)},omit(e){return me(this,e)},partial(...e){return ye(Ss,this,e[0])},exactPartial(...e){return ye(ws,this,e[0],`exactPartial`)},required(...e){return be(Ms,this,e[0])}});function Y(e,t){let n={type:`object`,shape:e??{},...C(t)};return new ds(n)}let fs=/*@__PURE__*/ O(`ZodUnion`,(e,t)=>{Cr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e.options=t.options});function ps(e,t){return new fs({type:`union`,options:e,...C(t)})}let ms=/*@__PURE__*/ O(`ZodIntersection`,(e,t)=>{wr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r)});function hs(e,t){return new ms({type:`intersection`,left:e,right:t})}let gs=/*@__PURE__*/ O(`ZodEnum`,(e,t)=>{Dr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 gs({...t,checks:[],...C(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 gs({...t,checks:[],...C(r),entries:i})}});function _s(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new gs({type:`enum`,entries:n,...C(t)})}let vs=/*@__PURE__*/ O(`ZodLiteral`,(e,t)=>{Or.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(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 ys(e,t){return new vs({type:`literal`,values:Array.isArray(e)?e:[e],...C(t)})}let bs=/*@__PURE__*/ O(`ZodTransform`,(e,t)=>{Oo(),kr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ge(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ae(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ae(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xs(e){return new bs({type:`transform`,transform:e})}let Ss=/*@__PURE__*/ O(`ZodOptional`,(e,t)=>{jr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cs(e){return new Ss({type:`optional`,innerType:e})}let ws=/*@__PURE__*/ O(`ZodExactOptional`,(e,t)=>{Mr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ts(e){return new ws({type:`optional`,innerType:e})}let Es=/*@__PURE__*/ O(`ZodNullable`,(e,t)=>{Nr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e){return new Es({type:`nullable`,innerType:e})}let Os=/*@__PURE__*/ O(`ZodDefault`,(e,t)=>{Pr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ks(e,t){return new Os({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ae(t)}})}let As=/*@__PURE__*/ O(`ZodPrefault`,(e,t)=>{Ir.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e,t){return new As({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ae(t)}})}let Ms=/*@__PURE__*/ O(`ZodNonOptional`,(e,t)=>{Lr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ns(e,t){return new Ms({type:`nonoptional`,innerType:e,...C(t)})}let Ps=/*@__PURE__*/ O(`ZodCatch`,(e,t)=>{Br.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fs(e,t){return new Ps({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Be(t)})}let Is=/*@__PURE__*/ O(`ZodPipe`,(e,t)=>{Vr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.in=t.in,e.out=t.out});function Ls(e,t){return new Is({type:`pipe`,in:e,out:t})}let Rs=/*@__PURE__*/ O(`ZodReadonly`,(e,t)=>{Ur.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zs(e){return new Rs({type:`readonly`,innerType:e})}let Bs=/*@__PURE__*/ O(`ZodCustom`,(e,t)=>{Gr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r)});function Vs(e,t){return/* @__PURE__ */ pa(Bs,e??(()=>!0),t)}function Hs(e,t={}){return/* @__PURE__ */ ma(Bs,e,t)}function Us(e,t){return/* @__PURE__ */ ha(e,t)}let X=K().finite(),Ws=K().int().nonnegative(),Gs=Y({hash:W(),gap:Y({parent:Ws,before:Ws.nullable(),row:q(),flow:q(),origin:Y({x:X,y:X}),room:X,line:Y({x:X,y:X,width:X,height:X})})}).nullable();function Ks(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}let qs={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Js(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?qs[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function Ys(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function Xs(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}let Z=K().finite(),Zs=K().int().nonnegative(),Qs=_s([`block`,`vertical`,`horizontal`,`wrap`,`grid`]),$s=Y({top:Z,right:Z,bottom:Z,left:Z}),ec=Y({flow:Qs,inline:q(),direction:W(),wrap:W(),justify:W(),alignItems:W(),ownJustify:q(),rowGap:Z,columnGap:Z,padding:$s,parent:Qs,parentAlignItems:W(),width:Z,height:Z}),tc=Y({width:Z,height:Z}),nc=Y({kind:_s([`box`,`text`,`media`,`container`]),natural:tc.nullable(),hugsHeight:q(),inset:tc,sizing:Y({layout:ec,fills:q()}).nullable()}),rc=Y({left:Z,top:Z}),ic=Y({x:Z,y:Z,width:Z,height:Z}),ac=J(Y({index:Zs,box:ic,read:nc.nullable(),placed:rc.nullable(),nested:q(),margin:$s})).nullable(),oc=Y({hash:W(),ghosts:J(Y({index:Zs,box:ic,placed:rc.nullable()}))}).nullable(),sc=J(Y({index:Zs,right:Z,top:Z})),cc=Y({x:Z,y:Z}),lc=J(Y({opacity:Z,radius:Z,fontFamily:W(),fontSize:Z,fontWeight:Z,lineHeight:Z.nullable(),letterSpacing:Z,textAlign:W(),textDecorationLine:W(),textTransform:W(),textWrapStyle:W(),truncated:q(),display:W(),color:W(),bordered:q(),borderWidth:Z.nullable(),holdsText:q(),textOnly:q(),text:W(),keepsBreaks:q(),rotation:Y({degrees:Z.nullable(),scale:cc.nullable(),own:Y({rotate:Z.nullable().optional(),scale:cc.nullable().optional()}),translated:q(),transform:Y({own:W(),ruled:q(),reanchors:q()})}),placement:Y({free:q(),left:Z,top:Z,width:Z.nullable(),height:Z.nullable(),inline:Y({width:W(),height:W()}),wordsLeft:Z.nullable()}),layout:ec,inline:Y({color:q(),backgroundColor:q(),background:q(),border:q()}),step:Y({step:W().nullable(),effect:W().nullable(),start:W().nullable()})})).nullable(),uc=Y({index:Zs,hash:W()}).nullable(),dc=ps([Y({kind:ys(`toggle-play`)}),Y({kind:ys(`seek`),seconds:K().finite()}),Y({kind:ys(`toggle-sound`)}),Y({kind:ys(`set-flag`),name:_s([`controls`,`autoplay`,`loop`,`muted`]),on:q()})]),fc=Y({tag:_s([`video`,`audio`]),playable:q(),paused:q(),time:K().finite(),length:Vs(e=>typeof e==`number`),muted:q(),mutedInFile:q(),controls:q(),autoplay:q(),loop:q()}).nullable(),Q=`frameboard-bridge`,pc=`data-frameboard-editing`,mc=[`element-box`,`element-boxes`,`gap-at`,`hide-strips`,`keep-previews`,`live-body`,`live-element`,`measure`,`media`,`media-act`,`overflow`,`paint`,`pick-at`,`pins`,`preview-style`,`restamp`,`text-edit`,`text-written`];function hc(e,t){let{data:n}=e;if(e.origin!==t||!Tc(n)||n.tag!==`frameboard-bridge`)return null;if(n.kind===`shown`){let{page:e,hash:t}=n;return typeof e==`string`&&e!==``&&(typeof t==`string`||t===null)?{tag:Q,kind:`shown`,page:e,hash:t}:null}if(typeof n.id!=`string`||n.id===``)return null;let{id:r}=n;switch(n.kind){case`request`:return typeof n.op==`string`&&mc.includes(n.op)?{tag:Q,kind:`request`,id:r,op:n.op,args:n.args}:null;case`reply`:return n.ok===!0?{tag:Q,kind:`reply`,id:r,ok:!0,value:n.value}:n.ok===!1&&typeof n.error==`string`?{tag:Q,kind:`reply`,id:r,ok:!1,error:n.error}:null;case`push`:return{tag:Q,kind:`push`,id:r,value:n.value};case`close`:return{tag:Q,kind:`close`,id:r};default:return null}}let $=K().int().nonnegative(),gc=Y({}).strict(),_c=Y({index:$,hash:W()}),vc=Y({x:K().finite(),y:K().finite()}),yc=Y({x:K().finite(),y:K().finite(),width:K().finite(),height:K().finite()}),bc=Y({left:K().finite(),top:K().finite(),right:K().finite(),bottom:K().finite()}),xc=ps([Y({kind:ys(`commit`),text:W(),breaks:q(),run:K().int().nonnegative().optional()}),Y({kind:ys(`closed`)})]),Sc={"element-box":{args:_c,value:bc.nullable()},"element-boxes":{args:Y({hash:W(),indexes:J($)}),value:J(Y({index:$,box:yc})).nullable()},"live-body":{args:gc,value:uc},"live-element":{args:Y({hash:W(),indexes:J($)}),value:lc},measure:{args:Y({hash:W(),indexes:J($)}),value:ac,push:ac},overflow:{args:gc,value:oc,push:oc},pins:{args:Y({indexes:J($)}),value:sc,push:sc},"pick-at":{args:Y({at:vc}),value:Y({hash:W().nullable(),chain:J(Y({index:$,tag:W()}))})},"gap-at":{args:Y({at:vc,carried:$.optional()}),value:Gs},"hide-strips":{args:gc,value:q()},"keep-previews":{args:gc,value:as()},media:{args:_c,value:fc,push:fc},"media-act":{args:_c.extend({act:dc}),value:q()},paint:{args:Y({fill:W()}),value:W().nullable()},"preview-style":{args:Y({index:$,property:W(),value:W().nullable()}),value:as()},restamp:{args:Y({hash:W()}),value:q()},"text-edit":{args:_c.extend({at:vc.optional()}),value:q(),push:xc},"text-written":{args:Y({edit:W(),written:q()}),value:as()}},Cc=Symbol(`refused`);function wc(e,t){let n=Sc[e].args.safeParse(t);return n.success?n.data:Cc}function Tc(e){return typeof e==`object`&&!!e}let Ec=/* @__PURE__ */ new Set([`html`,`body`]);function Dc(e,t){let r=[];for(let i=document.elementFromPoint(e,t);i&&!Ec.has(i.localName);i=i.parentElement){let e=n(document,i);e!==null&&r.push({index:e,tag:i.localName})}return r}let Oc=/* @__PURE__ */ new Set(/* @__PURE__ */ `area.br.col.embed.hr.iframe.img.input.link.meta.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`));function kc(e){if(e.localName===`body`)return!0;if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||Oc.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let t=getComputedStyle(e).display;return t.startsWith(`inline`)||t===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function Ac(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1,flow:!0};if(!t.endsWith(`flex`))return{row:!1,reverse:!1,flow:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`),flow:!0}}function jc(e){let t=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},n=e===document.body||e===document.documentElement?null:e;for(let r=e;r&&!n;)t(r)&&(n=r),r=r.parentElement;if(!n)return{x:0-scrollX,y:0-scrollY};let r=n.getBoundingClientRect();return{x:r.left+n.clientLeft-n.scrollLeft,y:r.top+n.clientTop-n.scrollTop}}function Mc(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function Nc(e){let t=document.body;if(!t)return null;let r=document.elementFromPoint(e.x,e.y);for(r&&t.contains(r)||(r=t);r&&!kc(r);)r=r.parentElement;let i=r&&n(document,r);if(!r||i==null)return null;let a=getComputedStyle(r),{row:o,reverse:s,flow:c}=Ac(a),l=[...r.children].flatMap(e=>{let t=n(document,e),r=e.getBoundingClientRect();return t!==null&&(r.width>0||r.height>0)?[{index:t,box:r}]:[]}),u=l.findIndex(({box:t})=>Mc(e,t,o,s)),d=u===-1?l.at(-1):l[u-1],f=u===-1?void 0:l[u],p=e=>Number.parseFloat(a.getPropertyValue(`padding-${e}`))||0;return{parent:i,before:f?.index??null,row:o,flow:c,origin:jc(r),room:Math.max(0,r.clientWidth-p(`left`)-p(`right`)),line:Pc(r.getBoundingClientRect(),a,o,s,{after:d?.box,ahead:f?.box})}}function Pc(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function Fc(e,t){let i=Nc(e),a=r(document,t),o=i?r(document,i.parent):null;if(!i||!a||!o||a.contains(o))return null;let s=a.nextElementSibling;return o===a.parentElement&&(i.before===t||i.before===(s?n(document,s):null))?null:i}function Ic(e){if(!document.body)return null;let t=document.createElement(`div`);t.style.background=e,document.body.append(t);let n=getComputedStyle(t).backgroundColor;return t.remove(),n}let Lc={"pick-at":({at:e})=>({hash:i(document),chain:Dc(e.x,e.y)}),"gap-at":({at:e,carried:t})=>{let n=i(document),r=t===void 0?Nc(e):Fc(e,t);return n&&r?{hash:n,gap:r}:null},paint:({fill:e})=>Ic(e)};function Rc(e,t){e.readyState===`loading`?e.addEventListener(`DOMContentLoaded`,t,{once:!0}):t()}function zc(e){return i(document)===e.hash?r(document,e.index):null}let Bc={step:`data-step`,effect:`data-step-effect`,start:`data-step-start`};function Vc(e){return Math.round(parseFloat(e)*100)/100}function Hc(e,t){let n=e.parentElement,r=n?getComputedStyle(n):null,i=e instanceof HTMLElement?e:null,a=e=>Vc(e)||0;return{flow:Ks(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!i?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:a(t.rowGap),columnGap:t.columnGap===`normal`?0:a(t.columnGap),padding:{top:a(t.paddingTop),right:a(t.paddingRight),bottom:a(t.paddingBottom),left:a(t.paddingLeft)},parent:r?Ks(r.display,r.flexDirection,r.flexWrap):`block`,parentAlignItems:r?.alignItems??`normal`,width:Math.round(i?.offsetWidth??0),height:Math.round(i?.offsetHeight??0)}}function Uc(e){let t=getComputedStyle(e),n=e.textContent??``,r=[t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth];return{opacity:Number(t.opacity),radius:Math.round(parseFloat(t.borderTopLeftRadius)||0),fontFamily:t.fontFamily,fontSize:Vc(t.fontSize),fontWeight:Number(t.fontWeight),lineHeight:t.lineHeight===`normal`?null:Vc(t.lineHeight),letterSpacing:t.letterSpacing===`normal`?0:Vc(t.letterSpacing),textAlign:Xc(t.textAlign,t.direction),textDecorationLine:t.textDecorationLine,textTransform:t.textTransform,textWrapStyle:t.getPropertyValue(`text-wrap-style`)||`auto`,truncated:t.textOverflow===`ellipsis`&&t.overflowX!==`visible`&&t.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:t.display,color:t.color,bordered:r.some(e=>parseFloat(e)>0),borderWidth:r.every(e=>e===r[0])?Vc(t.borderTopWidth):null,holdsText:n.trim()!==``,textOnly:e.childElementCount===0&&n.trim()!==``,text:n,keepsBreaks:t.whiteSpace!==`normal`&&t.whiteSpace!==`nowrap`,rotation:{degrees:Js(t.rotate),scale:Ys(t.scale),own:Kc(e),translated:Xs(t.transform),transform:qc(e,t)},placement:Wc(e,t),layout:Hc(e,t),inline:Yc(e),step:{step:e.getAttribute(Bc.step),effect:e.getAttribute(Bc.effect),start:e.getAttribute(Bc.start)}}}function Wc(e,t){let n=t.position===`absolute`||t.position===`fixed`,r=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},i=r(t.width),a=r(t.height),o=e instanceof HTMLElement?e.style:null,s={width:o?.getPropertyValue(`width`)??``,height:o?.getPropertyValue(`height`)??``};if(n&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:n,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:i,height:a,inline:s,wordsLeft:null};let c=e.parentElement,l=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},u=null;if(t.position!==`fixed`){if(!n&&c&&c!==document.body&&c!==document.documentElement)u=c;else for(let e=c;e&&!u;e=e.parentElement)l(e)&&(u=e)}let d=t.position===`fixed`?0:-scrollX,f=t.position===`fixed`?0:-scrollY;if(u){let e=u.getBoundingClientRect();d=e.left+u.clientLeft-u.scrollLeft,f=e.top+u.clientTop-u.scrollTop}let p=e.getBoundingClientRect(),m=parseFloat(t.marginLeft)||0,h=Gc(e,t);return{free:n,left:Math.round(p.left-d-m),top:Math.round(p.top-f-(parseFloat(t.marginTop)||0)),width:i,height:a,inline:s,wordsLeft:h===null?null:Math.round(h-d-m)}}function Gc(e,t){if(!(e.childNodes.length>0&&[...e.childNodes].every(e=>e.nodeType===Node.TEXT_NODE)&&e.textContent?.trim()))return null;let n=document.createRange();n.selectNodeContents(e);let r=(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.paddingLeft)||0);return n.getBoundingClientRect().left-r}function Kc(e){let t=e instanceof HTMLElement?e:null,n=!!t?.style.getPropertyValue(`rotate`),r=!!t?.style.getPropertyValue(`scale`);if(!t||!n&&!r)return{};let i=t.getAttribute(`style`);t.style.removeProperty(`rotate`),t.style.removeProperty(`scale`);let a=getComputedStyle(t),o={...n?{rotate:Js(a.rotate)}:{},...r?{scale:Ys(a.scale)}:{}};return i===null?t.removeAttribute(`style`):t.setAttribute(`style`,i),o}function qc(e,t){let n=e instanceof HTMLElement?e.style.getPropertyValue(`transform`):``;return{own:n,ruled:n===``&&t.transform!==`none`,reanchors:t.transform===`none`&&Jc(e,t)}}function Jc(e,t){let n=t.position!==`static`;for(let t of e.querySelectorAll(`*`)){let r=getComputedStyle(t).position;if(r!==`fixed`&&(r!==`absolute`||n))continue;let i=!1;for(let n=t.parentElement;n&&n!==e&&!i;n=n.parentElement){let e=getComputedStyle(n);i=e.transform!==`none`||r===`absolute`&&e.position!==`static`}if(!i)return!0}return!1}function Yc(e){let t=e instanceof HTMLElement?e.style:null,n=t?Array.from({length:t.length},(e,n)=>t.item(n)):[];return{color:n.includes(`color`),backgroundColor:n.includes(`background-color`),background:/(?:^|;)\s*background\s*:/i.test(e.getAttribute(`style`)??``),border:n.some(e=>e.startsWith(`border-`)&&!e.endsWith(`-radius`))}}function Xc(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}let Zc={"live-element":({hash:e,indexes:t})=>{if(i(document)!==e)return null;let n=t.flatMap(e=>{let t=r(document,e);return t?[Uc(t)]:[]});return n.length===t.length?n:null},"live-body":()=>{let e=i(document),t=document.body?n(document,document.body):null;return e!==null&&t!==null?{index:t,hash:e}:null}},Qc=/* @__PURE__ */ new Set([`html`,`body`]);function $c(e){if(!e||Qc.has(e.localName))return null;if(e.localName===`img`||e.localName===`video`)return`media`;let t=(e.textContent??``).trim()!==``;return e.childElementCount>0?t&&[...e.children].every(el)?`text`:`container`:t?`text`:e.localName===`div`?`box`:null}function el(e){let t=getComputedStyle(e).display;return t===`inline`||t.startsWith(`inline-`)}function tl(e){let t=$c(e),n=getComputedStyle(e);return!t||Js(n.rotate)!==0||n.transform.startsWith(`matrix3d(`)||(t===`text`||t===`container`)&&(n.display===`inline`||n.display===`contents`)?null:{kind:t,natural:al(e),hugsHeight:t===`text`&&!ol(e),inset:il(n),sizing:t===`container`?rl(e,n):null}}let nl=/* @__PURE__ */ new Set([`vertical`,`horizontal`,`wrap`]);function rl(e,t){let n=Hc(e,t);return{layout:n,fills:nl.has(n.parent)&&(parseFloat(t.flexGrow)||0)>0}}function il(e){if(e.boxSizing!==`content-box`)return{width:0,height:0};let t=(...e)=>e.reduce((e,t)=>e+(parseFloat(t)||0),0);return{width:t(e.paddingLeft,e.paddingRight,e.borderLeftWidth,e.borderRightWidth),height:t(e.paddingTop,e.paddingBottom,e.borderTopWidth,e.borderBottomWidth)}}function al(e){let[t,n]=e instanceof HTMLImageElement?[e.naturalWidth,e.naturalHeight]:e instanceof HTMLVideoElement?[e.videoWidth,e.videoHeight]:[0,0];return t>0&&n>0?{width:t,height:n}:null}function ol(e){let t=e instanceof HTMLElement?e.style.height:``;return t!==``&&t!==`auto`}function sl(e,t){if(t.some(t=>t!==e&&t.contains(e)))return null;let n=getComputedStyle(e);if(n.position!==`absolute`&&n.position!==`fixed`)return null;let r=parseFloat(n.left),i=parseFloat(n.top);return Number.isNaN(r)||Number.isNaN(i)?null:{left:r,top:i}}function cl(e){let t=getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return{top:n(t.marginTop),right:n(t.marginRight),bottom:n(t.marginBottom),left:n(t.marginLeft)}}function ll(e){let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.top),width:Math.round(t.width),height:Math.round(t.height)}}function ul(e){let t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function dl(e,t){if(i(document)!==e)return null;let n=t.flatMap(e=>{let t=r(document,e);return t?[t]:[]});return n.length===t.length?n:null}function fl(e,t){return t.map((n,r)=>({index:e[r]??0,box:ll(n),read:tl(n),placed:sl(n,[]),nested:t.some(e=>e!==n&&e.contains(n)),margin:cl(n)}))}function pl(){let e=document.body;if(!e)return[];let n=innerWidth,r=innerHeight,i=[],a=[];return t(document).forEach((t,o)=>{if(!e.contains(t)||t===e||a.some(e=>e.contains(t))||getComputedStyle(t).position===`fixed`)return;let s=t.getBoundingClientRect();(s.width!==0||s.height!==0)&&(s.left<-1||s.top<-1||s.right>n+1||s.bottom>r+1)&&!ml(t,e)&&(a.push(t),i.push({index:o,box:ll(t),placed:sl(t,[])}))}),i}function ml(e,t){let n=e=>{let t=e.parentElement;if(getComputedStyle(e).position!==`absolute`)return t;for(;t&&getComputedStyle(t).position===`static`&&getComputedStyle(t).transform===`none`;)t=t.parentElement;return t};for(let r=n(e);r&&r!==t&&t.contains(r);r=n(r)){let e=getComputedStyle(r);if(e.overflowX!==`visible`||e.overflowY!==`visible`)return!0}return!1}function hl(){let e=i(document);return e===null?null:{hash:e,ghosts:pl()}}function gl(e){return e.flatMap(e=>{let t=r(document,e)?.getBoundingClientRect();return t?[{index:e,right:t.right,top:t.top}]:[]})}function _l(e,t,n){let r=new ResizeObserver(t);for(let t of[...e,document.documentElement])r.observe(t);let i=new MutationObserver(t);if(n)for(let t of e)i.observe(t,{attributes:!0,attributeFilter:[`style`]});return addEventListener(`scroll`,t,!0),addEventListener(`resize`,t),()=>{r.disconnect(),i.disconnect(),removeEventListener(`scroll`,t,!0),removeEventListener(`resize`,t)}}let vl={"element-boxes":({hash:e,indexes:t})=>i(document)===e?t.flatMap(e=>{let t=r(document,e),n=t?ul(t):null;return n&&n.width>0&&n.height>0?[{index:e,box:n}]:[]}):null,measure:({hash:e,indexes:t},{push:n,onClose:r})=>{let i=dl(e,t);return i?(r(_l(i,()=>n(fl(t,i)),i.length>1)),fl(t,i)):null},overflow:(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(hl())}))},a=new MutationObserver(i);return a.observe(document,{attributes:!0,attributeFilter:[`style`],subtree:!0}),addEventListener(`resize`,i),n(()=>{cancelAnimationFrame(r),a.disconnect(),removeEventListener(`resize`,i)}),hl()},pins:({indexes:e},{push:t,onClose:n})=>(n(_l(e.flatMap(e=>{let t=r(document,e);return t?[t]:[]}),()=>t(gl(e)),!1)),gl(e))},yl=[`play`,`pause`,`timeupdate`,`durationchange`,`loadedmetadata`,`volumechange`,`seeked`,`error`,`emptied`],bl=[`controls`,`autoplay`,`loop`,`muted`];function xl(e){let t=zc(e);return t instanceof HTMLMediaElement?t:null}function Sl(e){let t=e instanceof HTMLVideoElement,n=t&&e.readyState>=1&&e.videoWidth===0;return{tag:t?`video`:`audio`,playable:e.error===null&&!n,paused:e.paused,time:e.currentTime,length:e.duration,muted:e.muted,mutedInFile:e.defaultMuted,controls:e.hasAttribute(`controls`),autoplay:e.hasAttribute(`autoplay`),loop:e.hasAttribute(`loop`)}}function Cl(e,t){switch(t.kind){case`toggle-play`:e.paused?e.play().catch(()=>void 0):e.pause();return;case`seek`:e.currentTime=t.seconds;return;case`toggle-sound`:e.muted=!e.muted;return;case`set-flag`:e.toggleAttribute(t.name,t.on)}}let wl=`frameboard-media-strip`;function Tl(){if(document.getElementById(wl))return()=>{};let t=document.createElement(`style`);return t.id=wl,t.setAttribute(e,``),t.textContent=`video::-webkit-media-controls { display: none !important }`,document.head?.append(t),()=>t.remove()}let El={media:(e,{push:t,onClose:n})=>{let r=xl(e);if(!r)return null;let i=()=>t(Sl(r));for(let e of yl)r.addEventListener(e,i);let a=new MutationObserver(i);return a.observe(r,{attributeFilter:[...bl]}),n(()=>{for(let e of yl)r.removeEventListener(e,i);a.disconnect()}),Sl(r)},"media-act":({act:e,...t})=>{let n=xl(t);return n?(Cl(n,e),!0):!1},"hide-strips":(e,{onClose:t})=>(t(Tl()),!0)},Dl=/* @__PURE__ */ new Map;function Ol(e,t,n){let i=`${e}:${t}`,a=r(document,e),o=a instanceof HTMLElement?a:null,s=Dl.get(i);if(n===null){if(Dl.delete(i),!s||s.element!==o||!o)return;s.value===``?s.attribute===null?o.removeAttribute(`style`):o.setAttribute(`style`,s.attribute):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&Dl.set(i,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),attribute:o.getAttribute(`style`)}),o.style.setProperty(t,n,`important`))}function kl(t){return{"preview-style":({index:e,property:t,value:n})=>(Ol(e,t,n),null),"keep-previews":()=>(Dl.clear(),null),restamp:({hash:n})=>{let r=document.querySelector(`style[${e}]`);return r?(r.setAttribute(`data-hash`,n),t(),!0):!1}}}let Al=/\r\n|\r/g,jl=/\n+$/,Ml=/[\t\n\f\r ]+/g;function Nl(e){let{whiteSpace:t}=getComputedStyle(e);return t===`normal`||t===`nowrap`}function Pl(e,t,n){if(!(e instanceof HTMLElement))return null;if(e.childElementCount>0){let r=n&&Fl(e,n);return r?Il(e,r,t):null}if((e.textContent??``).trim()===``)return null;let r=e,i=r.textContent??``,a=Nl(r),o=a?i.replace(Ml,` `).trim():i,s=r.style.whiteSpace;o!==i&&(r.textContent=o);let c=!0,l=()=>{c=!1,r.removeAttribute(`contenteditable`),r.removeAttribute(pc),r.removeEventListener(`keydown`,h),r.removeEventListener(`paste`,g),r.removeEventListener(`blur`,m),window.removeEventListener(`pagehide`,p)},u=()=>{r.textContent=i,r.style.whiteSpace=s},d=()=>{r.isConnected&&u()},f=()=>{c&&(l(),u())};function p(){l(),t({kind:`closed`},d)}function m(){if(!c)return;l();let e=(r.textContent??``).replace(Al,`
116
- `).replace(jl,``);e===o.replace(jl,``)?(u(),t({kind:`closed`},d)):(r.textContent=e,t({kind:`commit`,text:e,breaks:a&&e.includes(`
115
+ 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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ta(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ta(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}let Ea=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Da=[`oneOf`,`anyOf`];function Oa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ka(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ea.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Oa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}m(n,r,e.length===1?e[0]:ka(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Oa(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Aa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ea)if(t in e)return;let n=t.filter(e=>Da.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ka(t);else{let e=n[0],i=Da.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>ka([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,xa(e,r))}function ja(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)):xa(i,s),xa(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ta(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Aa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}xa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,m(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Na(t,`input`,e.processors),output:Na(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function F(e,t){let n=t??{seen:/* @__PURE__ */ 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 F(r.element,n);if(r.type===`set`)return F(r.valueType,n);if(r.type===`lazy`)return F(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return F(r.innerType,n);if(r.type===`intersection`)return F(r.left,n)||F(r.right,n);if(r.type===`record`||r.type===`map`)return F(r.keyType,n)||F(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:F(r.in,n)||F(r.out,n);if(r.type===`object`){for(let e in r.shape)if(F(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(F(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(F(e,n))return!0;return!!(r.rest&&F(r.rest,n))}return!1}let Ma=(e,t={})=>n=>{let r=Sa({...n,processors:t});return P(e,r),wa(r,e),ja(r,e)},Na=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Sa({...i??{},target:a,io:t,processors:n});return P(e,o),wa(o,e),ja(o,e)},I=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},L=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Pa=(e,t)=>{I(e,`minimum`,t),L(e,`maximum`,t)},Fa=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ia=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},La=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Ra=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},za=(e,t)=>I(e,`minimum`,t.minimum),Ba=(e,t)=>L(e,`maximum`,t.maximum),Va=e=>(t,n)=>{Ra(t,n.format);let[r,i]=e[n.format];I(t,`minimum`,r),L(t,`maximum`,i)},Ha={greater_than:(e,t)=>I(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>L(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Fa(e,t.value),number_format:Va(pe),bigint_format:Va(me),min_length:za,max_length:Ba,length_equals:(e,t)=>Pa(e,t.length),min_size:za,max_size:Ba,size_equals:(e,t)=>Pa(e,t.size),string_format:(e,t)=>{Ra(e,t.format),t.pattern&&Ia(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>La(e,t.mime)};function R(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ha[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&I(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&I(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&L(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&L(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Fa(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&La(t,i.mime);for(let e of i.patterns??[])Ia(t,e);return t}let Ua={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Wa=/* @__PURE__ */ new Map([[tr,zt],[rr,Bt]]),Ga=e=>Wa.get(e)??e,Ka=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=R(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ua[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Ga);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}))])}},qa=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=R(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):N(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Ja=(e,t,n,r)=>{n.type=`boolean`},Ya=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Xa=(e,t,n,r)=>{n.not={}},Za=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Qa=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(N(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(N(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},$a=(e,t,n,r)=>{N(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},eo=(e,t,n,r)=>{N(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},to=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=R(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=P(a.element,t,{...r,path:[...r.path,`items`]})};function no(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?no(t.out):t.type===`catch`?no(t.innerType):e._zod.optin}let ro=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&N(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)m(i.properties,e,P(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?no(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=P(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},io=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>P(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ao=(e,t,n,r)=>{let i=e._zod.def,a=P(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=P(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},oo=(e,t,n,r)=>{let i=e._zod.def,a=P(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`}]},so=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},co=Symbol();function lo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(N(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),co):JSON.parse(o)}let uo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=lo(i.defaultValue,e,t,n,r);o!==co&&(n.default=o)},fo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=lo(i.defaultValue,e,t,n,r);o!==co&&(n._prefault=o)},po=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{N(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},mo=(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;P(o,t,r);let s=t.seen.get(e);s.ref=o},ho=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},go=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},_o=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function vo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let z=/*@__PURE__*/ E(`ZodError`,(e,t)=>{et.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);_o.has(n)||(_o.add(n),vo(n,`format`,e=>t=>rt(e,t)),vo(n,`flatten`,e=>t=>nt(e,t)),vo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}),vo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),yo=/* @__PURE__ */ at(z),bo=/* @__PURE__ */ ot(z),xo=/* @__PURE__ */ st(z),So=/* @__PURE__ */ lt(z),Co=/* @__PURE__ */ ht(z),wo=/* @__PURE__ */ gt(z),To=/* @__PURE__ */ _t(z),Eo=/* @__PURE__ */ vt(z),Do=/* @__PURE__ */ yt(z),Oo=/* @__PURE__ */ bt(z),ko=/* @__PURE__ */ xt(z),Ao=/* @__PURE__ */ St(z);function jo(){O.localeError||k(di())}function Mo(){O.memoizer||k({memoizer:ci()})}let B=/*@__PURE__*/ E(`ZodType`,(e,t)=>(jo(),j.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(y(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 b(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ws(e,t))},superRefine(e,t){return this.check(Gs(e,t))},overwrite(e){return this.check(/* @__PURE__ */ ua(e))},optional(){return Ts(this)},exactOptional(){return Ds(this)},nullable(){return ks(this)},nullish(){return Ts(ks(this))},nonoptional(e){return Fs(this,e)},array(){return G(this)},or(e){return _s([this,e])},and(e){return ys(this,e)},transform(e){return zs(this,Cs(e))},default(e){return js(this,e)},prefault(e){return Ns(this,e)},catch(e){return Ls(this,e)},pipe(e){return zs(this,e)},readonly(){return Vs(this)},describe(e){let t=this.clone();return hi.add(t,{description:e}),t},meta(...e){if(e.length===0)return hi.get(this);let t=this.clone();return hi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ie(this,`~standard`,{...Cn(this),jsonSchema:{input:Na(this,`input`),output:Na(this,`output`)}})},set"~standard"(e){C(this,`~standard`,e)},parse:function e(t,n){return yo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await bo(this,t,n,{callee:e})},safeParse(e,t){return xo(this,e,t)},async safeParseAsync(e,t){return So(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){C(this,`spa`,e)},validate(e,t){return ft(this,e,t)},validateAsync(e,t){return mt(this,e,t)},encode:function e(t,n){return Co(this,t,n,{callee:e})},decode:function e(t,n){return wo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await To(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Eo(this,t,n,{callee:e})},safeEncode(e,t){return Do(this,e,t)},safeDecode(e,t){return Oo(this,e,t)},async safeEncodeAsync(e,t){return ko(this,e,t)},async safeDecodeAsync(e,t){return Ao(this,e,t)},toJSONSchema(e){return Ma(this,{})(e)},get description(){return hi.get(this)?.description},get _def(){return this._zod.def}}),No=/*@__PURE__*/ E(`_ZodString`,(e,t)=>{wn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r)},/*@__PURE__*/ Le({format:e=>R(e).format??null,minLength:e=>R(e).minimum??null,maxLength:e=>R(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ ia(...e))},includes(...e){return this.check(/* @__PURE__ */ sa(...e))},startsWith(...e){return this.check(/* @__PURE__ */ ca(...e))},endsWith(...e){return this.check(/* @__PURE__ */ la(...e))},min(...e){return this.check(/* @__PURE__ */ na(...e))},max(...e){return this.check(/* @__PURE__ */ ta(...e))},length(...e){return this.check(/* @__PURE__ */ ra(...e))},nonempty(...e){return this.check(/* @__PURE__ */ na(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ aa(e))},uppercase(e){return this.check(/* @__PURE__ */ oa(e))},trim(){return this.check(/* @__PURE__ */ fa())},normalize(...e){return this.check(/* @__PURE__ */ da(...e))},toLowerCase(){return this.check(/* @__PURE__ */ pa())},toUpperCase(){return this.check(/* @__PURE__ */ ma())},slugify(){return this.check(/* @__PURE__ */ ha())}})),Po=/*@__PURE__*/ E(`ZodString`,(e,t)=>{wn.init(e,t),No.init(e,t)},{email(e){return this.check(/* @__PURE__ */ vi(zo,e))},url(e){return this.check(/* @__PURE__ */ wi(Ho,e))},jwt(e){return this.check(/* @__PURE__ */ zi(rs,e))},emoji(e){return this.check(/* @__PURE__ */ Ti(Uo,e))},guid(e){return this.check(/* @__PURE__ */ yi(Bo,e))},uuid(e){return this.check(/* @__PURE__ */ bi(Vo,e))},uuidv4(e){return this.check(/* @__PURE__ */ xi(Vo,e))},uuidv6(e){return this.check(/* @__PURE__ */ Si(Vo,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ci(Vo,e))},nanoid(e){return this.check(/* @__PURE__ */ Ei(Wo,e))},cuid(e){return this.check(/* @__PURE__ */ Di(Go,e))},cuid2(e){return this.check(/* @__PURE__ */ Oi(Ko,e))},ulid(e){return this.check(/* @__PURE__ */ ki(qo,e))},base64(e){return this.check(/* @__PURE__ */ Ii(es,e))},base64url(e){return this.check(/* @__PURE__ */ Li(ts,e))},xid(e){return this.check(/* @__PURE__ */ Ai(Jo,e))},ksuid(e){return this.check(/* @__PURE__ */ ji(Yo,e))},ipv4(e){return this.check(/* @__PURE__ */ Mi(Xo,e))},ipv6(e){return this.check(/* @__PURE__ */ Ni(Zo,e))},cidrv4(e){return this.check(/* @__PURE__ */ Pi(Qo,e))},cidrv6(e){return this.check(/* @__PURE__ */ Fi($o,e))},e164(e){return this.check(/* @__PURE__ */ Ri(ns,e))},datetime(e){return this.check(/* @__PURE__ */ Bi(Fo,e))},date(e){return this.check(/* @__PURE__ */ Vi(Io,e))},time(e){return this.check(/* @__PURE__ */ Hi(Lo,e))},duration(e){return this.check(/* @__PURE__ */ Ui(Ro,e))}});function V(e){return/* @__PURE__ */ _i(Po,e)}let H=/*@__PURE__*/ E(`ZodStringFormat`,(e,t)=>{M.init(e,t),No.init(e,t)}),Fo=/*@__PURE__*/ E(`ZodISODateTime`,(e,t)=>{Un.init(e,t),H.init(e,t)}),Io=/*@__PURE__*/ E(`ZodISODate`,(e,t)=>{Wn.init(e,t),H.init(e,t)}),Lo=/*@__PURE__*/ E(`ZodISOTime`,(e,t)=>{Gn.init(e,t),H.init(e,t)}),Ro=/*@__PURE__*/ E(`ZodISODuration`,(e,t)=>{Kn.init(e,t),H.init(e,t)}),zo=/*@__PURE__*/ E(`ZodEmail`,(e,t)=>{Dn.init(e,t),H.init(e,t)}),Bo=/*@__PURE__*/ E(`ZodGUID`,(e,t)=>{Tn.init(e,t),H.init(e,t)}),Vo=/*@__PURE__*/ E(`ZodUUID`,(e,t)=>{En.init(e,t),H.init(e,t)}),Ho=/*@__PURE__*/ E(`ZodURL`,(e,t)=>{Fn.init(e,t),H.init(e,t)}),Uo=/*@__PURE__*/ E(`ZodEmoji`,(e,t)=>{In.init(e,t),H.init(e,t)}),Wo=/*@__PURE__*/ E(`ZodNanoID`,(e,t)=>{Ln.init(e,t),H.init(e,t)}),Go=/*@__PURE__*/ E(`ZodCUID`,(e,t)=>{Rn.init(e,t),H.init(e,t)}),Ko=/*@__PURE__*/ E(`ZodCUID2`,(e,t)=>{zn.init(e,t),H.init(e,t)}),qo=/*@__PURE__*/ E(`ZodULID`,(e,t)=>{Bn.init(e,t),H.init(e,t)}),Jo=/*@__PURE__*/ E(`ZodXID`,(e,t)=>{Vn.init(e,t),H.init(e,t)}),Yo=/*@__PURE__*/ E(`ZodKSUID`,(e,t)=>{Hn.init(e,t),H.init(e,t)}),Xo=/*@__PURE__*/ E(`ZodIPv4`,(e,t)=>{qn.init(e,t),H.init(e,t)}),Zo=/*@__PURE__*/ E(`ZodIPv6`,(e,t)=>{Xn.init(e,t),H.init(e,t)}),Qo=/*@__PURE__*/ E(`ZodCIDRv4`,(e,t)=>{Zn.init(e,t),H.init(e,t)}),$o=/*@__PURE__*/ E(`ZodCIDRv6`,(e,t)=>{$n.init(e,t),H.init(e,t)}),es=/*@__PURE__*/ E(`ZodBase64`,(e,t)=>{nr.init(e,t),H.init(e,t)}),ts=/*@__PURE__*/ E(`ZodBase64URL`,(e,t)=>{ar.init(e,t),H.init(e,t)}),ns=/*@__PURE__*/ E(`ZodE164`,(e,t)=>{or.init(e,t),H.init(e,t)}),rs=/*@__PURE__*/ E(`ZodJWT`,(e,t)=>{cr.init(e,t),H.init(e,t)}),is=/*@__PURE__*/ E(`ZodNumber`,(e,t)=>{lr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Le({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=R(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=R(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=R(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>R(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Qi(e,t))},gte(e,t){return this.check(/* @__PURE__ */ $i(e,t))},min(e,t){return this.check(/* @__PURE__ */ $i(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},max(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},int(e){return this.check(os(e))},safe(e){return this.check(os(e))},positive(e){return this.check(/* @__PURE__ */ Qi(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ $i(0,e))},negative(e){return this.check(/* @__PURE__ */ Xi(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Zi(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ ea(e,t))},step(e,t){return this.check(/* @__PURE__ */ ea(e,t))},finite(){return this}}));function U(e){return/* @__PURE__ */ Wi(is,e)}let as=/*@__PURE__*/ E(`ZodNumberFormat`,(e,t)=>{ur.init(e,t),is.init(e,t)});function os(e){return/* @__PURE__ */ Gi(as,e)}let ss=/*@__PURE__*/ E(`ZodBoolean`,(e,t)=>{dr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r)});function W(e){return/* @__PURE__ */ Ki(ss,e)}let cs=/*@__PURE__*/ E(`ZodNull`,(e,t)=>{fr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r)});function ls(e){return/* @__PURE__ */ qi(cs,e)}let us=/*@__PURE__*/ E(`ZodUnknown`,(e,t)=>{pr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ds(){return/* @__PURE__ */ Ji(us)}let fs=/*@__PURE__*/ E(`ZodNever`,(e,t)=>{mr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r)});function ps(e){return/* @__PURE__ */ Yi(fs,e)}let ms=/*@__PURE__*/ E(`ZodArray`,(e,t)=>{Mo(),vr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ na(e,t))},nonempty(e){return this.check(/* @__PURE__ */ na(1,e))},max(e,t){return this.check(/* @__PURE__ */ ta(e,t))},length(e,t){return this.check(/* @__PURE__ */ ra(e,t))},unwrap(){return this.element}});function G(e,t){return/* @__PURE__ */ ga(ms,e,t)}let hs=/*@__PURE__*/ E(`ZodObject`,(e,t)=>{Mo(),wr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),He(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return q(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y(this._zod.def,{catchall:ds()}))},loose(){return this.clone(y(this._zod.def,{catchall:ds()}))},strict(){return this.clone(y(this._zod.def,{catchall:ps()}))},strip(){return this.clone(y(this._zod.def,{catchall:void 0}))},extend(e){return ve(this,e)},safeExtend(e){return be(this,e)},merge(e){return xe(this,e)},pick(e){return he(this,e)},omit(e){return _e(this,e)},partial(...e){return Se(ws,this,e[0])},exactPartial(...e){return Se(Es,this,e[0],`exactPartial`)},required(...e){return Ce(Ps,this,e[0])}});function K(e,t){let n={type:`object`,shape:e??{},...x(t)};return new hs(n)}let gs=/*@__PURE__*/ E(`ZodUnion`,(e,t)=>{Er.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.options=t.options});function _s(e,t){return new gs({type:`union`,options:e,...x(t)})}let vs=/*@__PURE__*/ E(`ZodIntersection`,(e,t)=>{Dr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r)});function ys(e,t){return new vs({type:`intersection`,left:e,right:t})}let bs=/*@__PURE__*/ E(`ZodEnum`,(e,t)=>{Ar.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 bs({...t,checks:[],...x(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 bs({...t,checks:[],...x(r),entries:i})}});function q(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new bs({type:`enum`,entries:n,...x(t)})}let xs=/*@__PURE__*/ E(`ZodLiteral`,(e,t)=>{jr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(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 J(e,t){return new xs({type:`literal`,values:Array.isArray(e)?e:[e],...x(t)})}let Ss=/*@__PURE__*/ E(`ZodTransform`,(e,t)=>{Mo(),Mr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Je(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Pe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Cs(e){return new Ss({type:`transform`,transform:e})}let ws=/*@__PURE__*/ E(`ZodOptional`,(e,t)=>{Pr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ts(e){return new ws({type:`optional`,innerType:e})}let Es=/*@__PURE__*/ E(`ZodExactOptional`,(e,t)=>{Fr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e){return new Es({type:`optional`,innerType:e})}let Os=/*@__PURE__*/ E(`ZodNullable`,(e,t)=>{Ir.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ks(e){return new Os({type:`nullable`,innerType:e})}let As=/*@__PURE__*/ E(`ZodDefault`,(e,t)=>{Lr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function js(e,t){return new As({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}let Ms=/*@__PURE__*/ E(`ZodPrefault`,(e,t)=>{zr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ns(e,t){return new Ms({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}let Ps=/*@__PURE__*/ E(`ZodNonOptional`,(e,t)=>{Br.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fs(e,t){return new Ps({type:`nonoptional`,innerType:e,...x(t)})}let Is=/*@__PURE__*/ E(`ZodCatch`,(e,t)=>{Ur.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ls(e,t){return new Is({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ue(t)})}let Rs=/*@__PURE__*/ E(`ZodPipe`,(e,t)=>{Wr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.in=t.in,e.out=t.out});function zs(e,t){return new Rs({type:`pipe`,in:e,out:t})}let Bs=/*@__PURE__*/ E(`ZodReadonly`,(e,t)=>{Kr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vs(e){return new Bs({type:`readonly`,innerType:e})}let Hs=/*@__PURE__*/ E(`ZodCustom`,(e,t)=>{Jr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r)});function Us(e,t){return/* @__PURE__ */ _a(Hs,e??(()=>!0),t)}function Ws(e,t={}){return/* @__PURE__ */ va(Hs,e,t)}function Gs(e,t){return/* @__PURE__ */ ya(e,t)}let Y=U().finite(),Ks=U().int().nonnegative(),qs=K({hash:V(),gap:K({parent:Ks,before:Ks.nullable(),row:W(),flow:W(),origin:K({x:Y,y:Y}),room:Y,line:K({x:Y,y:Y,width:Y,height:Y})})}).nullable();function Js(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}let Ys={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Xs(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?Ys[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function Zs(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function Qs(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}let X=U().finite(),$s=U().int().nonnegative(),ec=q([`block`,`vertical`,`horizontal`,`wrap`,`grid`]),tc=K({top:X,right:X,bottom:X,left:X}),nc=K({flow:ec,inline:W(),direction:V(),wrap:V(),justify:V(),alignItems:V(),ownJustify:W(),rowGap:X,columnGap:X,padding:tc,parent:ec,parentAlignItems:V(),width:X,height:X}),rc=K({width:X,height:X}),ic=K({kind:q([`box`,`text`,`media`,`container`]),natural:rc.nullable(),hugsHeight:W(),inset:rc,sizing:K({layout:nc,fills:W()}).nullable()}),ac=K({left:X,top:X}),oc=K({x:X,y:X,width:X,height:X}),sc=G(K({index:$s,box:oc,read:ic.nullable(),placed:ac.nullable(),nested:W(),margin:tc})).nullable(),cc=K({hash:V(),ghosts:G(K({index:$s,box:oc,placed:ac.nullable()}))}).nullable(),lc=G(K({index:$s,right:X,top:X})),uc=K({x:X,y:X}),dc=G(K({opacity:X,radius:X,fontFamily:V(),fontSize:X,fontWeight:X,lineHeight:X.nullable(),letterSpacing:X,textAlign:V(),textDecorationLine:V(),textTransform:V(),textWrapStyle:V(),truncated:W(),display:V(),color:V(),bordered:W(),borderWidth:X.nullable(),holdsText:W(),textOnly:W(),text:V(),keepsBreaks:W(),rotation:K({degrees:X.nullable(),scale:uc.nullable(),own:K({rotate:X.nullable().optional(),scale:uc.nullable().optional()}),translated:W(),transform:K({own:V(),ruled:W(),reanchors:W()})}),placement:K({free:W(),left:X,top:X,width:X.nullable(),height:X.nullable(),inline:K({width:V(),height:V()}),wordsLeft:X.nullable()}),layout:nc,inline:K({color:W(),backgroundColor:W(),background:W(),border:W()}),step:K({step:V().nullable(),effect:V().nullable(),start:V().nullable()})})).nullable(),fc=K({index:$s,hash:V()}).nullable(),pc=_s([K({kind:J(`toggle-play`)}),K({kind:J(`seek`),seconds:U().finite()}),K({kind:J(`toggle-sound`)}),K({kind:J(`set-flag`),name:q([`controls`,`autoplay`,`loop`,`muted`]),on:W()})]),mc=K({tag:q([`video`,`audio`]),playable:W(),paused:W(),time:U().finite(),length:Us(e=>typeof e==`number`),muted:W(),mutedInFile:W(),controls:W(),autoplay:W(),loop:W()}).nullable(),hc=[`camera-orbit`,`max-camera-orbit`,`orientation`,`scale`,`animation-name`,`autoplay`],gc=K({name:q(hc),value:V().nullable()}),_c=V().nullable(),vc=K({src:V(),loaded:W(),clips:G(V()),orbit:K({theta:U().finite(),phi:U().finite()}).nullable(),staged:K({"camera-orbit":_c,"max-camera-orbit":_c,orientation:_c,scale:_c,"animation-name":_c,autoplay:_c})}).nullable(),Z=`frameboard-bridge`,yc=`data-frameboard-editing`,bc=/* @__PURE__ */ `content-height.element-box.element-boxes.gap-at.hide-scrollbar.hide-strips.keep-previews.keys.live-body.live-element.measure.media.media-act.model.model-stage.overflow.paint.pick-at.pins.preview-style.restamp.scroll.scroll-act.text-edit.text-written.theme`.split(`.`);function xc(e,t){let{data:n}=e;if(e.origin!==t||!jc(n)||n.tag!==`frameboard-bridge`)return null;if(n.kind===`shown`){let{page:e,hash:t}=n;return typeof e==`string`&&e!==``&&(typeof t==`string`||t===null)?{tag:Z,kind:`shown`,page:e,hash:t}:null}if(typeof n.id!=`string`||n.id===``)return null;let{id:r}=n;switch(n.kind){case`request`:return typeof n.op==`string`&&bc.includes(n.op)?{tag:Z,kind:`request`,id:r,op:n.op,args:n.args}:null;case`reply`:return n.ok===!0?{tag:Z,kind:`reply`,id:r,ok:!0,value:n.value}:n.ok===!1&&typeof n.error==`string`?{tag:Z,kind:`reply`,id:r,ok:!1,error:n.error}:null;case`push`:return{tag:Z,kind:`push`,id:r,value:n.value};case`close`:return{tag:Z,kind:`close`,id:r};default:return null}}let Q=U().int().nonnegative(),$=K({}).strict(),Sc=K({index:Q,hash:V()}),Cc=K({x:U().finite(),y:U().finite()}),wc=K({x:U().finite(),y:U().finite(),width:U().finite(),height:U().finite()}),Tc=K({left:U().finite(),top:U().finite(),right:U().finite(),bottom:U().finite()}),Ec=K({top:U().finite(),size:U().finite()}),Dc=_s([K({kind:J(`commit`),text:V(),breaks:W(),run:U().int().nonnegative().optional()}),K({kind:J(`closed`)})]),Oc={theme:{args:K({theme:q([`light`,`dark`])}),value:W()},"hide-scrollbar":{args:$,value:W()},scroll:{args:$,value:Ec.nullable(),push:Ec.nullable()},"scroll-act":{args:_s([K({act:J(`page`),toward:_s([J(-1),J(1)])}),K({act:J(`to`),top:U().finite()})]),value:W()},keys:{args:K({keys:G(V()),keepTyping:W()}),value:W(),push:K({key:V(),repeat:W()})},"content-height":{args:$,value:U().int().positive().nullable()},"element-box":{args:Sc,value:Tc.nullable()},"element-boxes":{args:K({hash:V(),indexes:G(Q)}),value:G(K({index:Q,box:wc})).nullable()},"live-body":{args:$,value:fc},"live-element":{args:K({hash:V(),indexes:G(Q)}),value:dc},measure:{args:K({hash:V(),indexes:G(Q)}),value:sc,push:sc},overflow:{args:$,value:cc,push:cc},pins:{args:K({indexes:G(Q)}),value:lc,push:lc},"pick-at":{args:K({at:Cc}),value:K({hash:V().nullable(),chain:G(K({index:Q,tag:V()}))})},"gap-at":{args:K({at:Cc,carried:Q.optional()}),value:qs},"hide-strips":{args:$,value:W()},"keep-previews":{args:$,value:ls()},media:{args:Sc,value:mc,push:mc},"media-act":{args:Sc.extend({act:pc}),value:W()},model:{args:Sc,value:vc,push:vc},"model-stage":{args:Sc.and(gc),value:W()},paint:{args:K({fill:V()}),value:V().nullable()},"preview-style":{args:K({index:Q,property:V(),value:V().nullable()}),value:ls()},restamp:{args:K({hash:V()}),value:W()},"text-edit":{args:Sc.extend({at:Cc.optional()}),value:W(),push:Dc},"text-written":{args:K({edit:V(),written:W()}),value:ls()}},kc=Symbol(`refused`);function Ac(e,t){let n=Oc[e].args.safeParse(t);return n.success?n.data:kc}function jc(e){return typeof e==`object`&&!!e}function Mc(){let e=document.documentElement.scrollHeight;return e<=innerHeight+1?null:{top:scrollY/e,size:innerHeight/e}}let Nc={theme:({theme:e})=>(t(document.documentElement,e),!0),"hide-scrollbar":(t,{onClose:n})=>{if(!document.head)return!1;let r=document.createElement(`style`);return r.setAttribute(e,``),r.textContent=`html { scrollbar-width: none }`,document.head.append(r),n(()=>r.remove()),!0},scroll:(e,{push:t,onClose:n})=>{let r=Mc(),i=()=>{let e=Mc();(e?.top!==r?.top||e?.size!==r?.size)&&(r=e,t(e))},a=new ResizeObserver(i);return a.observe(document.documentElement),addEventListener(`scroll`,i),addEventListener(`resize`,i),n(()=>{a.disconnect(),removeEventListener(`scroll`,i),removeEventListener(`resize`,i)}),r},"scroll-act":e=>(e.act===`page`?scrollBy({top:e.toward*innerHeight}):scrollTo({top:e.top*document.documentElement.scrollHeight}),!0),"content-height":()=>document.body?Pc(document):null};function Pc(e){let t=e.defaultView;if(!t)return 1;let n=e=>{let n=t.getComputedStyle(e);return n.overflowX!==`visible`||n.overflowY!==`visible`},r=t=>{for(let r=t.parentElement;r&&r!==e.body;r=r.parentElement)if(n(r))return!0;return!1},i=(e,t)=>e<t?(t-e)/2:0,a=r=>{let a=-1/0;if(n(r))return a;let o=parseFloat(t.getComputedStyle(r).lineHeight);for(let n of r.childNodes){if(n.nodeType!==t.Node.TEXT_NODE)continue;let r=e.createRange();r.selectNodeContents(n);for(let e of r.getClientRects())(e.width!==0||e.height!==0)&&(a=Math.max(a,e.bottom-i(o,e.height)))}return a},o=[`img`,`video`,`canvas`,`iframe`,`object`,`embed`,`audio`],s=e=>{let n=e.getBoundingClientRect();if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||o.includes(e.localName))return n.bottom;let r=t.getComputedStyle(e);if(r.display!==`inline`||parseFloat(r.paddingBottom)+parseFloat(r.borderBottomWidth)>0)return n.bottom;let a=parseFloat(r.paddingTop)+parseFloat(r.borderTopWidth);return n.bottom-i(parseFloat(r.lineHeight),n.height-a)},c=e.documentElement.getBoundingClientRect().bottom;for(let t of e.querySelectorAll(`body *`))r(t)||(c=Math.max(c,s(t),a(t)));return Math.max(1,Math.ceil(c+t.scrollY))}let Fc=/* @__PURE__ */ new Set([`html`,`body`]);function Ic(e,t){let n=[];for(let i=document.elementFromPoint(e,t);i&&!Fc.has(i.localName);i=i.parentElement){let e=r(document,i);e!==null&&n.push({index:e,tag:i.localName})}return n}let Lc=/* @__PURE__ */ new Set(/* @__PURE__ */ `area.br.col.embed.hr.iframe.img.input.link.meta.model-viewer.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`));function Rc(e){if(e.localName===`body`)return!0;if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||Lc.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let t=getComputedStyle(e).display;return t.startsWith(`inline`)||t===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function zc(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1,flow:!0};if(!t.endsWith(`flex`))return{row:!1,reverse:!1,flow:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`),flow:!0}}function Bc(e){let t=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},n=e===document.body||e===document.documentElement?null:e;for(let r=e;r&&!n;)t(r)&&(n=r),r=r.parentElement;if(!n)return{x:0-scrollX,y:0-scrollY};let r=n.getBoundingClientRect();return{x:r.left+n.clientLeft-n.scrollLeft,y:r.top+n.clientTop-n.scrollTop}}function Vc(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function Hc(e){let t=document.body;if(!t)return null;let n=document.elementFromPoint(e.x,e.y);for(n&&t.contains(n)||(n=t);n&&!Rc(n);)n=n.parentElement;let i=n&&r(document,n);if(!n||i==null)return null;let a=getComputedStyle(n),{row:o,reverse:s,flow:c}=zc(a),l=[...n.children].flatMap(e=>{let t=r(document,e),n=e.getBoundingClientRect();return t!==null&&(n.width>0||n.height>0)?[{index:t,box:n}]:[]}),u=l.findIndex(({box:t})=>Vc(e,t,o,s)),d=u===-1?l.at(-1):l[u-1],f=u===-1?void 0:l[u],p=e=>Number.parseFloat(a.getPropertyValue(`padding-${e}`))||0;return{parent:i,before:f?.index??null,row:o,flow:c,origin:Bc(n),room:Math.max(0,n.clientWidth-p(`left`)-p(`right`)),line:Uc(n.getBoundingClientRect(),a,o,s,{after:d?.box,ahead:f?.box})}}function Uc(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function Wc(e,t){let n=Hc(e),a=i(document,t),o=n?i(document,n.parent):null;if(!n||!a||!o||a.contains(o))return null;let s=a.nextElementSibling;return o===a.parentElement&&(n.before===t||n.before===(s?r(document,s):null))?null:n}function Gc(e){if(!document.body)return null;let t=document.createElement(`div`);t.style.background=e,document.body.append(t);let n=getComputedStyle(t).backgroundColor;return t.remove(),n}let Kc={"pick-at":({at:e})=>({hash:a(document),chain:Ic(e.x,e.y)}),"gap-at":({at:e,carried:t})=>{let n=a(document),r=t===void 0?Hc(e):Wc(e,t);return n&&r?{hash:n,gap:r}:null},paint:({fill:e})=>Gc(e)};function qc(e,t){e.readyState===`loading`?e.addEventListener(`DOMContentLoaded`,t,{once:!0}):t()}function Jc(e){return a(document)===e.hash?i(document,e.index):null}let Yc=[`Shift`,`Meta`,`Alt`,`Control`],Xc=typeof navigator==`object`?navigator.platform:``,Zc=/Mac|iPod|iPhone|iPad/.test(Xc)?`Meta`:`Control`,Qc=Xc===`Win32`?[`Control`,`Alt`]:[`Alt`];function $c(e){return!!(e.key&&e.code&&e.getModifierState)}function el(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches(`[contenteditable],input,select,textarea`)}function tl(e,t){return typeof e.getModifierState==`function`?e.getModifierState(t)||Qc.includes(t)&&e.getModifierState(`AltGraph`):!1}function nl(e){return e.trim().split(` `).map(e=>{let t=e.split(/(?<=\w|\])\+/),n=t.pop(),r=n.match(/^\((.+)\)$/),i=r?RegExp(`^(?:${r[1]})$`,`iv`):n,a=[],o=[];for(let e of t){let t=e.match(/^\[(.*)\]$/),n=t?.[1]??e;n=n===`$mod`?Zc:n,t?o.push(n):a.push(n)}return[a,o,i]})}function rl(e,[t,n,r]){let i=t.includes(`AltGraph`);return!((r instanceof RegExp?!(r.test(e.key)||r.test(e.code)):r.toUpperCase()!==e.key.toUpperCase()&&r!==e.code)||t.find(t=>!tl(e,t))||Yc.find(a=>!t.includes(a)&&!n.includes(a)&&r!==a&&tl(e,a)&&!(i&&Qc.includes(a))))}function il(e,t={}){let n=t.timeout??1e3,r=t.ignore??el,i=Object.keys(e).map(t=>[t,nl(t),e[t]]),a=/* @__PURE__ */ new Map,o=null;return e=>{if(!$c(e)||r(e))return;let t=[];for(let[n,r,o]of i){let[i,...s]=a.get(n)||r;if(!rl(e,i))tl(e,e.key)||a.delete(n);else if(s.length>0)a.set(n,s),t.push(n);else if(a.delete(n),t.length)console.warn(`tinykeys: Conflict found, "${n}" did not fire, waiting for:`,t);else{o(e);break}}o&&clearTimeout(o),o=setTimeout(()=>a.clear(),n)}}function al(e,t,n={}){let r=n.event??`keydown`,i=il(t,n);return e.addEventListener(r,i,n.capture),()=>{e.removeEventListener(r,i,n.capture)}}function ol(e,t){if(e.isComposing||e.defaultPrevented)return!0;if(!t)return!1;let n=e.target;return n instanceof HTMLElement&&(n.isContentEditable||n.matches(`[contenteditable],input,select,textarea`))}let sl={keys:({keys:e,keepTyping:t},{push:n,onClose:r})=>(r(al(window,Object.fromEntries(e.map(e=>[e,t=>{t.preventDefault(),n({key:e,repeat:t.repeat})}])),{ignore:e=>ol(e,t)})),!0)},cl={step:`data-step`,effect:`data-step-effect`,start:`data-step-start`};function ll(e){return Math.round(parseFloat(e)*100)/100}function ul(e,t){let n=e.parentElement,r=n?getComputedStyle(n):null,i=e instanceof HTMLElement?e:null,a=e=>ll(e)||0;return{flow:Js(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!i?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:a(t.rowGap),columnGap:t.columnGap===`normal`?0:a(t.columnGap),padding:{top:a(t.paddingTop),right:a(t.paddingRight),bottom:a(t.paddingBottom),left:a(t.paddingLeft)},parent:r?Js(r.display,r.flexDirection,r.flexWrap):`block`,parentAlignItems:r?.alignItems??`normal`,width:Math.round(i?.offsetWidth??0),height:Math.round(i?.offsetHeight??0)}}function dl(e){let t=getComputedStyle(e),n=e.textContent??``,r=[t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth];return{opacity:Number(t.opacity),radius:Math.round(parseFloat(t.borderTopLeftRadius)||0),fontFamily:t.fontFamily,fontSize:ll(t.fontSize),fontWeight:Number(t.fontWeight),lineHeight:t.lineHeight===`normal`?null:ll(t.lineHeight),letterSpacing:t.letterSpacing===`normal`?0:ll(t.letterSpacing),textAlign:vl(t.textAlign,t.direction),textDecorationLine:t.textDecorationLine,textTransform:t.textTransform,textWrapStyle:t.getPropertyValue(`text-wrap-style`)||`auto`,truncated:t.textOverflow===`ellipsis`&&t.overflowX!==`visible`&&t.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:t.display,color:t.color,bordered:r.some(e=>parseFloat(e)>0),borderWidth:r.every(e=>e===r[0])?ll(t.borderTopWidth):null,holdsText:n.trim()!==``,textOnly:e.childElementCount===0&&n.trim()!==``,text:n,keepsBreaks:t.whiteSpace!==`normal`&&t.whiteSpace!==`nowrap`,rotation:{degrees:Xs(t.rotate),scale:Zs(t.scale),own:ml(e),translated:Qs(t.transform),transform:hl(e,t)},placement:fl(e,t),layout:ul(e,t),inline:_l(e),step:{step:e.getAttribute(cl.step),effect:e.getAttribute(cl.effect),start:e.getAttribute(cl.start)}}}function fl(e,t){let n=t.position===`absolute`||t.position===`fixed`,r=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},i=r(t.width),a=r(t.height),o=e instanceof HTMLElement?e.style:null,s={width:o?.getPropertyValue(`width`)??``,height:o?.getPropertyValue(`height`)??``};if(n&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:n,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:i,height:a,inline:s,wordsLeft:null};let c=e.parentElement,l=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},u=null;if(t.position!==`fixed`){if(!n&&c&&c!==document.body&&c!==document.documentElement)u=c;else for(let e=c;e&&!u;e=e.parentElement)l(e)&&(u=e)}let d=t.position===`fixed`?0:-scrollX,f=t.position===`fixed`?0:-scrollY;if(u){let e=u.getBoundingClientRect();d=e.left+u.clientLeft-u.scrollLeft,f=e.top+u.clientTop-u.scrollTop}let p=e.getBoundingClientRect(),m=parseFloat(t.marginLeft)||0,h=pl(e,t);return{free:n,left:Math.round(p.left-d-m),top:Math.round(p.top-f-(parseFloat(t.marginTop)||0)),width:i,height:a,inline:s,wordsLeft:h===null?null:Math.round(h-d-m)}}function pl(e,t){if(!(e.childNodes.length>0&&[...e.childNodes].every(e=>e.nodeType===Node.TEXT_NODE)&&e.textContent?.trim()))return null;let n=document.createRange();n.selectNodeContents(e);let r=(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.paddingLeft)||0);return n.getBoundingClientRect().left-r}function ml(e){let t=e instanceof HTMLElement?e:null,n=!!t?.style.getPropertyValue(`rotate`),r=!!t?.style.getPropertyValue(`scale`);if(!t||!n&&!r)return{};let i=t.getAttribute(`style`);t.style.removeProperty(`rotate`),t.style.removeProperty(`scale`);let a=getComputedStyle(t),o={...n?{rotate:Xs(a.rotate)}:{},...r?{scale:Zs(a.scale)}:{}};return i===null?t.removeAttribute(`style`):t.setAttribute(`style`,i),o}function hl(e,t){let n=e instanceof HTMLElement?e.style.getPropertyValue(`transform`):``;return{own:n,ruled:n===``&&t.transform!==`none`,reanchors:t.transform===`none`&&gl(e,t)}}function gl(e,t){let n=t.position!==`static`;for(let t of e.querySelectorAll(`*`)){let r=getComputedStyle(t).position;if(r!==`fixed`&&(r!==`absolute`||n))continue;let i=!1;for(let n=t.parentElement;n&&n!==e&&!i;n=n.parentElement){let e=getComputedStyle(n);i=e.transform!==`none`||r===`absolute`&&e.position!==`static`}if(!i)return!0}return!1}function _l(e){let t=e instanceof HTMLElement?e.style:null,n=t?Array.from({length:t.length},(e,n)=>t.item(n)):[];return{color:n.includes(`color`),backgroundColor:n.includes(`background-color`),background:/(?:^|;)\s*background\s*:/i.test(e.getAttribute(`style`)??``),border:n.some(e=>e.startsWith(`border-`)&&!e.endsWith(`-radius`))}}function vl(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}let yl={"live-element":({hash:e,indexes:t})=>{if(a(document)!==e)return null;let n=t.flatMap(e=>{let t=i(document,e);return t?[dl(t)]:[]});return n.length===t.length?n:null},"live-body":()=>{let e=a(document),t=document.body?r(document,document.body):null;return e!==null&&t!==null?{index:t,hash:e}:null}},bl=/* @__PURE__ */ new Set([`html`,`body`]),xl=/* @__PURE__ */ new Set([`img`,`video`,`model-viewer`]);function Sl(e){if(!e||bl.has(e.localName))return null;if(xl.has(e.localName))return`media`;let t=(e.textContent??``).trim()!==``;return e.childElementCount>0?t&&[...e.children].every(Cl)?`text`:`container`:t?`text`:e.localName===`div`?`box`:null}function Cl(e){let t=getComputedStyle(e).display;return t===`inline`||t.startsWith(`inline-`)}function wl(e){let t=Sl(e),n=getComputedStyle(e);return!t||Xs(n.rotate)!==0||n.transform.startsWith(`matrix3d(`)||(t===`text`||t===`container`)&&(n.display===`inline`||n.display===`contents`)?null:{kind:t,natural:Ol(e),hugsHeight:t===`text`&&!kl(e),inset:Dl(n),sizing:t===`container`?El(e,n):null}}let Tl=/* @__PURE__ */ new Set([`vertical`,`horizontal`,`wrap`]);function El(e,t){let n=ul(e,t);return{layout:n,fills:Tl.has(n.parent)&&(parseFloat(t.flexGrow)||0)>0}}function Dl(e){if(e.boxSizing!==`content-box`)return{width:0,height:0};let t=(...e)=>e.reduce((e,t)=>e+(parseFloat(t)||0),0);return{width:t(e.paddingLeft,e.paddingRight,e.borderLeftWidth,e.borderRightWidth),height:t(e.paddingTop,e.paddingBottom,e.borderTopWidth,e.borderBottomWidth)}}function Ol(e){let[t,n]=e instanceof HTMLImageElement?[e.naturalWidth,e.naturalHeight]:e instanceof HTMLVideoElement?[e.videoWidth,e.videoHeight]:[0,0];return t>0&&n>0?{width:t,height:n}:null}function kl(e){let t=e instanceof HTMLElement?e.style.height:``;return t!==``&&t!==`auto`}function Al(e,t){if(t.some(t=>t!==e&&t.contains(e)))return null;let n=getComputedStyle(e);if(n.position!==`absolute`&&n.position!==`fixed`)return null;let r=parseFloat(n.left),i=parseFloat(n.top);return Number.isNaN(r)||Number.isNaN(i)?null:{left:r,top:i}}function jl(e){let t=getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return{top:n(t.marginTop),right:n(t.marginRight),bottom:n(t.marginBottom),left:n(t.marginLeft)}}function Ml(e){let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.top),width:Math.round(t.width),height:Math.round(t.height)}}function Nl(e){let t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function Pl(e,t){if(a(document)!==e)return null;let n=t.flatMap(e=>{let t=i(document,e);return t?[t]:[]});return n.length===t.length?n:null}function Fl(e,t){return t.map((n,r)=>({index:e[r]??0,box:Ml(n),read:wl(n),placed:Al(n,[]),nested:t.some(e=>e!==n&&e.contains(n)),margin:jl(n)}))}function Il(){let e=document.body;if(!e)return[];let t=innerWidth,r=innerHeight,i=[],a=[];return n(document).forEach((n,o)=>{if(!e.contains(n)||n===e||a.some(e=>e.contains(n))||getComputedStyle(n).position===`fixed`)return;let s=n.getBoundingClientRect();(s.width!==0||s.height!==0)&&(s.left<-1||s.top<-1||s.right>t+1||s.bottom>r+1)&&!Ll(n,e)&&(a.push(n),i.push({index:o,box:Ml(n),placed:Al(n,[])}))}),i}function Ll(e,t){let n=e=>{let t=e.parentElement;if(getComputedStyle(e).position!==`absolute`)return t;for(;t&&getComputedStyle(t).position===`static`&&getComputedStyle(t).transform===`none`;)t=t.parentElement;return t};for(let r=n(e);r&&r!==t&&t.contains(r);r=n(r)){let e=getComputedStyle(r);if(e.overflowX!==`visible`||e.overflowY!==`visible`)return!0}return!1}function Rl(){let e=a(document);return e===null?null:{hash:e,ghosts:Il()}}function zl(e){return e.flatMap(e=>{let t=i(document,e)?.getBoundingClientRect();return t?[{index:e,right:t.right,top:t.top}]:[]})}function Bl(e,t,n){let r=new ResizeObserver(t);for(let t of[...e,document.documentElement])r.observe(t);let i=new MutationObserver(t);if(n)for(let t of e)i.observe(t,{attributes:!0,attributeFilter:[`style`]});return addEventListener(`scroll`,t,!0),addEventListener(`resize`,t),()=>{r.disconnect(),i.disconnect(),removeEventListener(`scroll`,t,!0),removeEventListener(`resize`,t)}}let Vl={"element-boxes":({hash:e,indexes:t})=>a(document)===e?t.flatMap(e=>{let t=i(document,e),n=t?Nl(t):null;return n&&n.width>0&&n.height>0?[{index:e,box:n}]:[]}):null,measure:({hash:e,indexes:t},{push:n,onClose:r})=>{let i=Pl(e,t);return i?(r(Bl(i,()=>n(Fl(t,i)),i.length>1)),Fl(t,i)):null},overflow:(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(Rl())}))},a=new MutationObserver(i);return a.observe(document,{attributes:!0,attributeFilter:[`style`],subtree:!0}),addEventListener(`resize`,i),n(()=>{cancelAnimationFrame(r),a.disconnect(),removeEventListener(`resize`,i)}),Rl()},pins:({indexes:e},{push:t,onClose:n})=>(n(Bl(e.flatMap(e=>{let t=i(document,e);return t?[t]:[]}),()=>t(zl(e)),!1)),zl(e))},Hl=[`play`,`pause`,`timeupdate`,`durationchange`,`loadedmetadata`,`volumechange`,`seeked`,`error`,`emptied`],Ul=[`controls`,`autoplay`,`loop`,`muted`];function Wl(e){let t=Jc(e);return t instanceof HTMLMediaElement?t:null}function Gl(e){let t=e instanceof HTMLVideoElement,n=t&&e.readyState>=1&&e.videoWidth===0;return{tag:t?`video`:`audio`,playable:e.error===null&&!n,paused:e.paused,time:e.currentTime,length:e.duration,muted:e.muted,mutedInFile:e.defaultMuted,controls:e.hasAttribute(`controls`),autoplay:e.hasAttribute(`autoplay`),loop:e.hasAttribute(`loop`)}}function Kl(e,t){switch(t.kind){case`toggle-play`:e.paused?e.play().catch(()=>void 0):e.pause();return;case`seek`:e.currentTime=t.seconds;return;case`toggle-sound`:e.muted=!e.muted;return;case`set-flag`:e.toggleAttribute(t.name,t.on)}}let ql=`frameboard-media-strip`;function Jl(){if(document.getElementById(ql))return()=>{};let t=document.createElement(`style`);return t.id=ql,t.setAttribute(e,``),t.textContent=`video::-webkit-media-controls { display: none !important }`,document.head?.append(t),()=>t.remove()}let Yl={media:(e,{push:t,onClose:n})=>{let r=Wl(e);if(!r)return null;let i=()=>t(Gl(r));for(let e of Hl)r.addEventListener(e,i);let a=new MutationObserver(i);return a.observe(r,{attributeFilter:[...Ul]}),n(()=>{for(let e of Hl)r.removeEventListener(e,i);a.disconnect()}),Gl(r)},"media-act":({act:e,...t})=>{let n=Wl(t);return n?(Kl(n,e),!0):!1},"hide-strips":(e,{onClose:t})=>(t(Jl()),!0)},Xl=[`load`,`error`,`camera-change`];function Zl(e){let t=Jc(e);return t instanceof HTMLElement&&t.localName===`model-viewer`?t:null}function Ql(e){let t=Math.round(e*180/Math.PI)%360;return t>180?t-360:t<=-180?t+360:t}function $l(e){let t=e.loaded===!0,n=t?e.getCameraOrbit?.():void 0,r={};for(let t of hc)r[t]=e.getAttribute(t);return{src:e.getAttribute(`src`)??``,loaded:t,clips:t?[...e.availableAnimations??[]]:[],orbit:n?{theta:Ql(n.theta),phi:Ql(n.phi)}:null,staged:r}}function eu(e,t,n){n===null?e.removeAttribute(t):e.setAttribute(t,n),t===`camera-orbit`&&e.updateComplete?.then(()=>e.jumpCameraToGoal?.()),t===`autoplay`&&n===null&&e.loaded&&(e.pause?.(),e.currentTime=0)}let tu={model:(e,{push:t,onClose:n})=>{let r=Zl(e);if(!r)return null;let i=$l(r),a=JSON.stringify(i),o=()=>{let e=$l(r),n=JSON.stringify(e);n!==a&&(a=n,t(e))};for(let e of Xl)r.addEventListener(e,o);let s=new MutationObserver(o);return s.observe(r,{attributeFilter:[`src`,...hc]}),n(()=>{for(let e of Xl)r.removeEventListener(e,o);s.disconnect()}),i},"model-stage":({name:e,value:t,...n})=>{let r=Zl(n);return r?(eu(r,e,t),!0):!1}},nu=/* @__PURE__ */ new Map;function ru(e,t,n){let r=`${e}:${t}`,a=i(document,e),o=a instanceof HTMLElement?a:null,s=nu.get(r);if(n===null){if(nu.delete(r),!s||s.element!==o||!o)return;s.value===``?s.attribute===null?o.removeAttribute(`style`):o.setAttribute(`style`,s.attribute):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&nu.set(r,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),attribute:o.getAttribute(`style`)}),o.style.setProperty(t,n,`important`))}function iu(t){return{"preview-style":({index:e,property:t,value:n})=>(ru(e,t,n),null),"keep-previews":()=>(nu.clear(),null),restamp:({hash:n})=>{let r=document.querySelector(`style[${e}]`);return r?(r.setAttribute(`data-hash`,n),t(),!0):!1}}}let au=/\r\n|\r/g,ou=/\n+$/,su=/[\t\n\f\r ]+/g;function cu(e){let{whiteSpace:t}=getComputedStyle(e);return t===`normal`||t===`nowrap`}function lu(e,t,n){if(!(e instanceof HTMLElement))return null;if(e.childElementCount>0){let r=n&&uu(e,n);return r?du(e,r,t):null}if((e.textContent??``).trim()===``)return null;let r=e,i=r.textContent??``,a=cu(r),o=a?i.replace(su,` `).trim():i,s=r.style.whiteSpace;o!==i&&(r.textContent=o);let c=!0,l=()=>{c=!1,r.removeAttribute(`contenteditable`),r.removeAttribute(yc),r.removeEventListener(`keydown`,h),r.removeEventListener(`paste`,g),r.removeEventListener(`blur`,m),window.removeEventListener(`pagehide`,p)},u=()=>{r.textContent=i,r.style.whiteSpace=s},d=()=>{r.isConnected&&u()},f=()=>{c&&(l(),u())};function p(){l(),t({kind:`closed`},d)}function m(){if(!c)return;l();let e=(r.textContent??``).replace(au,`
116
+ `).replace(ou,``);e===o.replace(ou,``)?(u(),t({kind:`closed`},d)):(r.textContent=e,t({kind:`commit`,text:e,breaks:a&&e.includes(`
117
117
  `)},d))}function h(e){e.key===`Enter`&&(e.preventDefault(),_(`
118
- `)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m())}function g(e){e.preventDefault(),_((e.clipboardData?.getData(`text/plain`)??``).replace(Al,`
118
+ `)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m())}function g(e){e.preventDefault(),_((e.clipboardData?.getData(`text/plain`)??``).replace(au,`
119
119
  `))}let _=e=>{let t=getSelection()?.getRangeAt(0);if(!t||!r.contains(t.commonAncestorContainer))return;a&&e.includes(`
120
120
  `)&&(r.style.whiteSpace=`pre-line`);let n=(e,t)=>{let n=document.createRange();return n.selectNodeContents(r),n.setEnd(e,t),n.toString().length},i=n(t.startContainer,t.startOffset),o=n(t.endContainer,t.endOffset),s=r.textContent??``,c=s.slice(o),l=c===``&&e.endsWith(`
121
121
  `)?`
122
- `:``;r.textContent=s.slice(0,i)+e+(c||l);let u=document.createRange();u.setStart(r.firstChild??r,i+e.length),u.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(u)};r.setAttribute(`contenteditable`,`plaintext-only`),r.setAttribute(pc,``),r.addEventListener(`keydown`,h),r.addEventListener(`paste`,g),r.addEventListener(`blur`,m),window.addEventListener(`pagehide`,p),r.focus();let v=document.createRange();v.selectNodeContents(r);let ee=getSelection();return ee?.removeAllRanges(),ee?.addRange(v),f}function Fl(e,{x:t,y:n}){let r=document.caretPositionFromPoint?.(t,n)?.offsetNode??document.caretRangeFromPoint?.(t,n)?.startContainer;return r instanceof Text&&r.parentNode===e&&r.data.trim()!==``?r:null}function Il(e,t,n){let r=[...e.childNodes].filter(e=>e instanceof Text).indexOf(t),i=t.data,a=Nl(e),o=a?i.replace(Ml,` `):i;o!==i&&(t.data=o);let s=[...e.children].map(e=>({child:e,editable:e.getAttribute(`contenteditable`)})),c=[...e.childNodes],l=c.map(e=>e instanceof Text?e.data:``),u=!0,d=()=>{for(let t of[...e.childNodes])c.includes(t)||t.remove();for(let n=c.length-1;n>=0;n--){let r=c[n];r!==t&&r instanceof Text&&(r.data=l[n]??``);let i=c[n+1];r&&r.parentNode!==e&&e.insertBefore(r,i?.parentNode===e?i:null)}},f=()=>{u=!1,d(),e.removeAttribute(`contenteditable`),e.removeAttribute(pc);for(let{child:e,editable:t}of s)t===null?e.removeAttribute(`contenteditable`):e.setAttribute(`contenteditable`,t);e.removeEventListener(`keydown`,ee),e.removeEventListener(`paste`,y),e.removeEventListener(`beforeinput`,te),e.removeEventListener(`blur`,_),window.removeEventListener(`pagehide`,g)},p=()=>{t.data=i},m=()=>{t.isConnected&&p()},h=()=>{u&&(f(),p())};function g(){f(),n({kind:`closed`},m)}function _(){if(!u)return;f();let e=t.data.replace(Al,`
123
- `);e===o?(p(),n({kind:`closed`},m)):n({kind:`commit`,text:e,breaks:!1,run:r},m)}let v=e=>a?e.replace(Ml,` `):e.replace(Al,`
124
- `);function ee(e){e.key===`Enter`&&(e.preventDefault(),a||b(ne(),`
125
- `)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function y(e){e.preventDefault(),b(ne(),v(e.clipboardData?.getData(`text/plain`)??``))}function te(e){if(!e.cancelable)return;e.preventDefault();let[t=ne()]=e.getTargetRanges();e.inputType.startsWith(`delete`)?b(t,``):e.inputType.startsWith(`insert`)&&b(t,v(e.data??e.dataTransfer?.getData(`text/plain`)??``))}let ne=()=>{let e=getSelection();return e&&e.rangeCount>0?e.getRangeAt(0):void 0},re=(n,r)=>{if(n===t)return r;if(n!==e)return;let i=[...e.childNodes].indexOf(t);return r===i?0:r===i+1?t.length:void 0},b=(e,n)=>{let r=e&&re(e.startContainer,e.startOffset),i=e&&re(e.endContainer,e.endOffset);if(r===void 0||i===void 0)return;t.replaceData(r,i-r,n);let a=document.createRange();a.setStart(t,r+n.length),a.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(a)};for(let{child:e}of s)e.setAttribute(`contenteditable`,`false`);e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(pc,``),e.addEventListener(`keydown`,ee),e.addEventListener(`paste`,y),e.addEventListener(`beforeinput`,te),e.addEventListener(`blur`,_),window.addEventListener(`pagehide`,g),e.focus();let ie=document.createRange();ie.selectNodeContents(t);let x=getSelection();return x?.removeAllRanges(),x?.addRange(ie),h}document.currentScript?.remove();let Ll=window.parent,Rl=window.origin,zl=crypto.randomUUID(),Bl=/* @__PURE__ */ new Map,Vl=/* @__PURE__ */ new Map,Hl={...Lc,...Zc,...vl,...El,"element-box":e=>{let t=zc(e);if(!t)return null;let{left:n,top:r,right:i,bottom:a}=t.getBoundingClientRect();return{left:n,top:r,right:i,bottom:a}},"text-edit":(e,{id:t,push:n,onClose:r})=>{let i=zc(e),a=!1,o=i&&Pl(i,(e,r)=>{a=!0,e.kind===`commit`&&Vl.set(t,r),n(e)},e.at);return o?(r(()=>{a||o()}),!0):!1},"text-written":({edit:e,written:t})=>{let n=Vl.get(e);return Vl.delete(e),t||n?.(),null},...kl(()=>Wl())};function Ul(e){Ll.postMessage(e,Rl)}function Wl(e=i(document)){Ul({tag:Q,kind:`shown`,page:zl,hash:e})}function Gl(e,t,n){let r=Hl[e];if(!r)throw Error(`no handler for ${e}`);let i=wc(e,t);if(i===Cc)throw Error(`not the arguments ${e} takes`);return r(i,{id:n,push:e=>Ul({tag:Q,kind:`push`,id:n,value:e}),onClose:e=>Bl.set(n,e)})}Ll!==window&&(Rc(document,()=>Wl()),window.addEventListener(`pagehide`,()=>Wl(null)),window.addEventListener(`message`,e=>{if(e.source!==Ll)return;let t=hc(e,Rl);if(t?.kind===`close`&&(Bl.get(t.id)?.(),Bl.delete(t.id)),t?.kind!==`request`)return;let{id:n}=t;try{let e=Gl(t.op,t.args,n);Ul({tag:Q,kind:`reply`,id:n,ok:!0,value:e})}catch(e){let t=e instanceof Error?e.message:String(e);Ul({tag:Q,kind:`reply`,id:n,ok:!1,error:t})}}))})();
122
+ `:``;r.textContent=s.slice(0,i)+e+(c||l);let u=document.createRange();u.setStart(r.firstChild??r,i+e.length),u.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(u)};r.setAttribute(`contenteditable`,`plaintext-only`),r.setAttribute(yc,``),r.addEventListener(`keydown`,h),r.addEventListener(`paste`,g),r.addEventListener(`blur`,m),window.addEventListener(`pagehide`,p),r.focus();let ee=document.createRange();ee.selectNodeContents(r);let v=getSelection();return v?.removeAllRanges(),v?.addRange(ee),f}function uu(e,{x:t,y:n}){let r=document.caretPositionFromPoint?.(t,n)?.offsetNode??document.caretRangeFromPoint?.(t,n)?.startContainer;return r instanceof Text&&r.parentNode===e&&r.data.trim()!==``?r:null}function du(e,t,n){let r=[...e.childNodes].filter(e=>e instanceof Text).indexOf(t),i=t.data,a=cu(e),o=a?i.replace(su,` `):i;o!==i&&(t.data=o);let s=[...e.children].map(e=>({child:e,editable:e.getAttribute(`contenteditable`)})),c=[...e.childNodes],l=c.map(e=>e instanceof Text?e.data:``),u=!0,d=()=>{for(let t of[...e.childNodes])c.includes(t)||t.remove();for(let n=c.length-1;n>=0;n--){let r=c[n];r!==t&&r instanceof Text&&(r.data=l[n]??``);let i=c[n+1];r&&r.parentNode!==e&&e.insertBefore(r,i?.parentNode===e?i:null)}},f=()=>{u=!1,d(),e.removeAttribute(`contenteditable`),e.removeAttribute(yc);for(let{child:e,editable:t}of s)t===null?e.removeAttribute(`contenteditable`):e.setAttribute(`contenteditable`,t);e.removeEventListener(`keydown`,v),e.removeEventListener(`paste`,te),e.removeEventListener(`beforeinput`,y),e.removeEventListener(`blur`,_),window.removeEventListener(`pagehide`,g)},p=()=>{t.data=i},m=()=>{t.isConnected&&p()},h=()=>{u&&(f(),p())};function g(){f(),n({kind:`closed`},m)}function _(){if(!u)return;f();let e=t.data.replace(au,`
123
+ `);e===o?(p(),n({kind:`closed`},m)):n({kind:`commit`,text:e,breaks:!1,run:r},m)}let ee=e=>a?e.replace(su,` `):e.replace(au,`
124
+ `);function v(e){e.key===`Enter`&&(e.preventDefault(),a||ie(ne(),`
125
+ `)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function te(e){e.preventDefault(),ie(ne(),ee(e.clipboardData?.getData(`text/plain`)??``))}function y(e){if(!e.cancelable)return;e.preventDefault();let[t=ne()]=e.getTargetRanges();e.inputType.startsWith(`delete`)?ie(t,``):e.inputType.startsWith(`insert`)&&ie(t,ee(e.data??e.dataTransfer?.getData(`text/plain`)??``))}let ne=()=>{let e=getSelection();return e&&e.rangeCount>0?e.getRangeAt(0):void 0},re=(n,r)=>{if(n===t)return r;if(n!==e)return;let i=[...e.childNodes].indexOf(t);return r===i?0:r===i+1?t.length:void 0},ie=(e,n)=>{let r=e&&re(e.startContainer,e.startOffset),i=e&&re(e.endContainer,e.endOffset);if(r===void 0||i===void 0)return;t.replaceData(r,i-r,n);let a=document.createRange();a.setStart(t,r+n.length),a.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(a)};for(let{child:e}of s)e.setAttribute(`contenteditable`,`false`);e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(yc,``),e.addEventListener(`keydown`,v),e.addEventListener(`paste`,te),e.addEventListener(`beforeinput`,y),e.addEventListener(`blur`,_),window.addEventListener(`pagehide`,g),e.focus();let ae=document.createRange();ae.selectNodeContents(t);let oe=getSelection();return oe?.removeAllRanges(),oe?.addRange(ae),h}document.currentScript?.remove();let fu=window.parent,pu=window.origin,mu=crypto.randomUUID(),hu=/* @__PURE__ */ new Map,gu=/* @__PURE__ */ new Map,_u={...Nc,...Kc,...sl,...yl,...Vl,...Yl,...tu,"element-box":e=>{let t=Jc(e);if(!t)return null;let{left:n,top:r,right:i,bottom:a}=t.getBoundingClientRect();return{left:n,top:r,right:i,bottom:a}},"text-edit":(e,{id:t,push:n,onClose:r})=>{let i=Jc(e),a=!1,o=i&&lu(i,(e,r)=>{a=!0,e.kind===`commit`&&gu.set(t,r),n(e)},e.at);return o?(r(()=>{a||o()}),!0):!1},"text-written":({edit:e,written:t})=>{let n=gu.get(e);return gu.delete(e),t||n?.(),null},...iu(()=>yu())};function vu(e){fu.postMessage(e,pu)}function yu(e=a(document)){vu({tag:Z,kind:`shown`,page:mu,hash:e})}function bu(e,t,n){let r=_u[e];if(!r)throw Error(`no handler for ${e}`);let i=Ac(e,t);if(i===kc)throw Error(`not the arguments ${e} takes`);return r(i,{id:n,push:e=>vu({tag:Z,kind:`push`,id:n,value:e}),onClose:e=>hu.set(n,e)})}fu!==window&&(qc(document,()=>yu()),window.addEventListener(`pagehide`,()=>yu(null)),window.addEventListener(`message`,e=>{if(e.source!==fu)return;let t=xc(e,pu);if(t?.kind===`close`&&(hu.get(t.id)?.(),hu.delete(t.id)),t?.kind!==`request`)return;let{id:n}=t;try{let e=bu(t.op,t.args,n);vu({tag:Z,kind:`reply`,id:n,ok:!0,value:e})}catch(e){let t=e instanceof Error?e.message:String(e);vu({tag:Z,kind:`reply`,id:n,ok:!1,error:t})}}))})();