frameboard 0.50.0 → 0.52.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(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=>ue(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 b(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 se(e){return b(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ce=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function x(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function S(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 ue(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function de(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}let fe={safeint:[-(2**53-1),2**53-1],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},pe={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function me(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,he(e,t)),x(e,y(n,{shape:i,checks:[]}))}function he(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 ge(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(he(e,t)),a={};return v(a,e,Reflect.ownKeys(g(e)).filter(e=>!i.has(e))),x(e,y(n,{shape:a,checks:[]}))}function _e(e,t){if(!b(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 x(e,y(e._zod.def,{shape:ve(e,t)}))}function ve(e,t){let n={};return v(n,e,Reflect.ownKeys(g(e))),te(n,t),n}function ye(e,t){if(!b(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return x(e,y(e._zod.def,{shape:ve(e,t)}))}function be(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))),x(e,y(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function xe(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(he(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}))),x(t,y(t._zod.def,{shape:o,checks:[]}))}function Se(e,t,n){let r=n?new Set(he(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})),x(t,y(t._zod.def,{shape:i}))}function C(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 Ce(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 we(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Te(e){return typeof e==`string`?e:e?.message}function Ee(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 De(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Oe(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:Te(e.inst?._zod.def?.error?.(e))??Te(a?.(e))??Te(t?.error?.(e))??Te(n.customError?.(e))??Te(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 ke=/[\uD800-\uDBFF]/;function Ae(e){let t=e.length;if(!ke.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 je(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Me(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 Ne(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Pe(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Le(e,n,r.value)}}function w(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Fe(e,t,n){return w(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
2
- function Ie(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return w(this,n,r(this))},set(e){w(this,n,e)}})}return t}function Le(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:w(this,t,n.bind(this))},set(e){w(this,t,e)}})}function Re(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let ze,Be=!1,Ve={configurable:!0,get(){Be=!0}};function T(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&ze!==e._zod?ze=void 0:(ze=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Ve);let e=Be;Be=!1;try{let r=n(this);return Be?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Be||=e,r}catch(n){throw delete this[t],Be||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function He(e,t,n,r){let i=Re(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),Pe(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=>Oe(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=>Oe(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=>Oe(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]=fe[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?Ae(r):i)<=t.maximum)return;let a=je(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?Ae(r):i)>=t.minimum)return;let a=je(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?Ae(r):i;if(a===t.length)return;let o=je(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=le(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(`^${le(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(`.*${le(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(`
1
+ (function(){let e=/* @__PURE__ */ new Set([`script`,`style`,`template`,`noscript`,`link`,`meta`]),t=`data-frameboard`;function n(e,t){e.setAttribute(`data-theme`,t),e.style.colorScheme=t,e.classList.toggle(`dark`,t===`dark`),e.classList.toggle(`light`,t===`light`)}function r(e){return[...e.querySelectorAll(`*`)].filter(e=>!e.hasAttribute(t))}function i(e,t){let n=r(e).indexOf(t);return n===-1?null:n}function a(e,t){return r(e)[t]??null}function o(e){return e.querySelector(`style[data-frameboard]`)?.getAttribute(`data-hash`)??null}function s(e){return e.closest(`[data-locked]`)!==null}function c(t){return e.has(t.localName)}function l(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 u(e,t=`|`){return e.map(e=>pe(e)).join(t)}function d(e,t){return typeof t==`bigint`?t.toString():t}var f=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 p(e){return new f(e)}function m(e){return e==null}function h(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ee(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 g(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function te(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function _(e){return te(e._zod.def)??e._zod.def.shape}function ne(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return g(this,t,e),e},enumerable:!0,configurable:!0})}function re(e,t,n){t in e?g(e,t,n):e[t]=n}function v(e,t,n,r){let i=_(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ne(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):re(e,a,r?r(n.value,a):n.value))}}function y(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ne(e,n,()=>t[n]):re(e,n,r.value))}}function b(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ie(e){return JSON.stringify(e)}function ae(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let oe=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function se(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let ce=/* @__PURE__*/ p(()=>{if(O.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function le(e){if(se(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return se(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ue(e){return le(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let de=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function x(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function S(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 pe(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function me(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}let he={safeint:[-(2**53-1),2**53-1],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ge={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function _e(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,ve(e,t)),x(e,b(n,{shape:i,checks:[]}))}function ve(e,t){let n=_(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 ye(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(ve(e,t)),a={};return v(a,e,Reflect.ownKeys(_(e)).filter(e=>!i.has(e))),x(e,b(n,{shape:a,checks:[]}))}function be(e,t){if(!le(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=_(e);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 x(e,b(e._zod.def,{shape:xe(e,t)}))}function xe(e,t){let n={};return v(n,e,Reflect.ownKeys(_(e))),y(n,t),n}function Se(e,t){if(!le(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return x(e,b(e._zod.def,{shape:xe(e,t)}))}function Ce(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(_(e))),v(n,t,Reflect.ownKeys(_(t))),x(e,b(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function we(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(ve(t,n)):void 0,o={};return v(o,t,Reflect.ownKeys(_(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),x(t,b(t._zod.def,{shape:o,checks:[]}))}function Te(e,t,n){let r=n?new Set(ve(t,n)):void 0,i={};return v(i,t,Reflect.ownKeys(_(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),x(t,b(t._zod.def,{shape:i}))}function C(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 Ee(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 De(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Oe(e){return typeof e==`string`?e:e?.message}function ke(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 Ae(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function je(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:Oe(e.inst?._zod.def?.error?.(e))??Oe(a?.(e))??Oe(t?.error?.(e))??Oe(n.customError?.(e))??Oe(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 Me=/[\uD800-\uDBFF]/;function Ne(e){let t=e.length;if(!Me.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 Pe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Fe(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 Ie(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Le(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Be(e,n,r.value)}}function w(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Re(e,t,n){return w(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
2
+ function ze(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return w(this,n,r(this))},set(e){w(this,n,e)}})}return t}function Be(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:w(this,t,n.bind(this))},set(e){w(this,t,e)}})}function Ve(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let He,Ue=!1,We={configurable:!0,get(){Ue=!0}};function T(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&He!==e._zod?He=void 0:(He=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,We);let e=Ue;Ue=!1;try{let r=n(this);return Ue?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Ue||=e,r}catch(n){throw delete this[t],Ue||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Ge(e,t,n,r){let i=Ve(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 Ke(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var qe;let Je={value:void 0,enumerable:!1},Ye=`captureStackTrace`in Error?Error:null;function Xe(e){let t=Ye;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ye=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){Je.value=new a(r);try{Object.defineProperty(n,"_zod",Je)}finally{Je.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),Le(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?Xe(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.`)}},Ze=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(qe=globalThis).__zod_globalConfig??(qe.__zod_globalConfig={});let O=globalThis.__zod_globalConfig;function k(e){return e&&Object.assign(O,e),O}function Qe(){let e=this._zod;return e.message??=JSON.stringify(e.def,d,2),e.message}function $e(e){this._zod.message=e}let et={get:Qe,set:$e,enumerable:!0,configurable:!0},tt={value:void 0,enumerable:!1},nt=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),rt=/* @__PURE__ */ E(`$ZodError`,(e,t)=>{e.name=`$ZodError`,tt.value=t,Object.defineProperty(e,"issues",tt),tt.value=void 0,Object.defineProperty(e,"message",et);let n=Object.getPrototypeOf(e);nt.has(n)||(nt.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 it(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 at(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?it(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ot(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 st(e,t){return{callee:t?.callee??e,Err:t?.Err}}let ct=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=>je(e,o,k())));throw oe(n,a?.callee??t),n}return s.value};return t},lt=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=>je(e,o,k())));throw oe(n,a?.callee??t),n}return s.value};return t},ut=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?dt(e,a.issues,i):{success:!0,data:a.value}};function dt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>je(e,n,k()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let ft=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?dt(e,a.issues,i):{success:!0,data:a.value}},pt=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),mt=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),ht=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==pt)return!0;if(r.definite===!0&&n===void 0)return!1}return gt(e,t,n)});function gt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[mt]=!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 _t=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},vt=e=>{let t=ct(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,st(n,a))};return n},yt=e=>{let t=ct(e),n=(e,r,i,a)=>t(e,r,i,st(n,a));return n},bt=e=>{let t=lt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,st(n,a))};return n},xt=e=>{let t=lt(e),n=async(e,r,i,a)=>await t(e,r,i,st(n,a));return n},St=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ut(e)(t,n,i)},Ct=e=>(t,n,r)=>ut(e)(t,n,r),wt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ft(e)(t,n,i)},Tt=e=>async(t,n,r)=>ft(e)(t,n,r),Et=/^[cC][0-9a-z]{6,}$/,Dt=/^[0-9a-z]+$/,Ot=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,kt=/^[0-9a-vA-V]{20}$/,At=/^[A-Za-z0-9]{27}$/,jt=/^[a-zA-Z0-9_-]{21}$/;function Mt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let Nt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Pt=/^([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})$/,Ft=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)$/,It=/^(?:[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 Lt(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}let Rt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zt=/^(([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}|:))$/,Bt=/^((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])$/,Vt=/^(([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])$/,Ht=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ut=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Wt=/^https?$/,Gt=/^\+[1-9]\d{6,14}$/,Kt=`(?:(?:\\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 qt(e){return RegExp(`^${e}$`)}let Jt=/*@__PURE__*/ qt(Kt);function Yt(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 Xt(e){return RegExp(`^${Yt(e)}$`)}function Zt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Yt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Yt({precision:e.precision})}`:n;return RegExp(`^${Kt}T(?:${r})$`)}let Qt=/^[\s\S]{0,}$/,$t=/^-?\d+(?:\.\d+)?$/,en=/^(?:true|false)$/i,tn=/^null$/i,nn=/^[^A-Z]*$/,rn=/^[^a-z]*$/,A=/*@__PURE__*/ E(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),an=e=>{let t=e.value;return!m(t)&&t.length!==void 0},on={number:`number`,bigint:`bigint`,object:`date`},sn=/*@__PURE__*/ E(`$ZodCheckLessThan`,(e,t)=>{A.init(e,t);let n=on[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:on[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})}}),cn=/*@__PURE__*/ E(`$ZodCheckGreaterThan`,(e,t)=>{A.init(e,t);let n=on[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:on[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})}}),ln=/*@__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):ee(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})}}),un=/*@__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]=he[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})}}),dn=/*@__PURE__*/ E(`$ZodCheckMaxLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=an),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ne(r):i)<=t.maximum)return;let a=Pe(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=/*@__PURE__*/ E(`$ZodCheckMinLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=an),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ne(r):i)>=t.minimum)return;let a=Pe(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pn=/*@__PURE__*/ E(`$ZodCheckLengthEquals`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=an),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ne(r):i;if(a===t.length)return;let o=Pe(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})}}),mn=/*@__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=()=>{})}),hn=/*@__PURE__*/ E(`$ZodCheckRegex`,(e,t)=>{mn.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})}}),gn=/*@__PURE__*/ E(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=nn,mn.init(e,t)}),_n=/*@__PURE__*/ E(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=rn,mn.init(e,t)}),vn=/*@__PURE__*/ E(`$ZodCheckIncludes`,(e,t)=>{A.init(e,t);let n=fe(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})}}),yn=/*@__PURE__*/ E(`$ZodCheckStartsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`^${fe(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})}}),bn=/*@__PURE__*/ E(`$ZodCheckEndsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`.*${fe(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})}}),xn=/*@__PURE__*/ E(`$ZodCheckOverwrite`,(e,t)=>{A.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Sn=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 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=C(t),a;for(let o of n){if(o._zod.def.when){if(Ce(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&&(De(t.issues,n,e),i||=C(t,n))});else{if(t.issues.length===n)continue;De(t.issues,n,e),i||=C(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(C(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 Fe(this,`~standard`,Cn(this))},set"~standard"(e){w(this,`~standard`,e)}}),xn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Oe(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=Ee(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 Ee(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,De(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(...we(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&&C(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(...we(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=de(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(C(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(C(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)=>`
5
+ `)}\n};`)(...Object.values(this.closed))}};let Cn={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=Cn;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=C(t),a;for(let o of n){if(o._zod.def.when){if(Ee(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&&(Ae(t.issues,n,e),i||=C(t,n))});else{if(t.issues.length===n)continue;Ae(t.issues,n,e),i||=C(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(C(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 Re(this,`~standard`,En(this))},set"~standard"(e){w(this,`~standard`,e)}}),wn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>je(e,t,k()))}:{value:e.value};async function Tn(e,t){let n={async:!0};return wn(await e._zod.run({value:t,issues:[]},n),n)}function En(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return wn(r,n)}catch{}return Tn(e,t)},vendor:`zod`,version:1}}let Dn=/*@__PURE__*/ E(`$ZodString`,(e,t)=>{j.init(e,t),e._zod.pattern=t.pattern??Qt,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)=>{mn.init(e,t),Dn.init(e,t)}),On=/*@__PURE__*/ E(`$ZodGUID`,(e,t)=>{t.pattern??=Pt,M.init(e,t)}),kn=/*@__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??=Ft(e)}else t.pattern??=Ft();M.init(e,t)}),An=/*@__PURE__*/ E(`$ZodEmail`,(e,t)=>{t.pattern??=It,M.init(e,t)});function jn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Mn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?jn(e)||2:Nn(e,t)}function Nn(e,t){if(!t.normalize&&t.protocol?.source===Wt.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 Pn=/[\t\n\r]/g;function Fn(e){return e.replace(Pn,``)}function In(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ln(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}let Rn=/*@__PURE__*/ E(`$ZodURL`,(e,t)=>{M.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Mn(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=Fn(r);return}t.hostname&&!In(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&&!Ln(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:Fn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),zn=/*@__PURE__*/ E(`$ZodEmoji`,(e,t)=>{t.pattern??=Lt(),M.init(e,t)}),Bn=/*@__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?jt:Mt(t.length),M.init(e,t)}),Vn=/*@__PURE__*/ E(`$ZodCUID`,(e,t)=>{t.pattern??=Et,M.init(e,t)}),Hn=/*@__PURE__*/ E(`$ZodCUID2`,(e,t)=>{t.pattern??=Dt,M.init(e,t)}),Un=/*@__PURE__*/ E(`$ZodULID`,(e,t)=>{t.pattern??=Ot,M.init(e,t)}),Wn=/*@__PURE__*/ E(`$ZodXID`,(e,t)=>{t.pattern??=kt,M.init(e,t)}),Gn=/*@__PURE__*/ E(`$ZodKSUID`,(e,t)=>{t.pattern??=At,M.init(e,t)}),Kn=/*@__PURE__*/ E(`$ZodISODateTime`,(e,t)=>{t.pattern??=Zt(t),M.init(e,t)}),qn=/*@__PURE__*/ E(`$ZodISODate`,(e,t)=>{t.pattern??=Jt,M.init(e,t)}),Jn=/*@__PURE__*/ E(`$ZodISOTime`,(e,t)=>{t.pattern??=Xt(t),M.init(e,t)}),Yn=/*@__PURE__*/ E(`$ZodISODuration`,(e,t)=>{t.pattern??=Nt,M.init(e,t)}),Xn=/*@__PURE__*/ E(`$ZodIPv4`,(e,t)=>{t.pattern??=Rt,M.init(e,t)}),Zn=/^[0-9a-fA-F:.]+$/;function Qn(e){return Zn.test(e)?jn(`http://[${e}]`):!1}let $n=/*@__PURE__*/ E(`$ZodIPv6`,(e,t)=>{t.pattern??=zt,M.init(e,t),e._zod.check=n=>{Qn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),er=/*@__PURE__*/ E(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Bt,M.init(e,t)});function tr(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:Qn(n)}let nr=/*@__PURE__*/ E(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Vt,M.init(e,t),e._zod.check=n=>{tr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function rr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ir=/^[0-9a-zA-Z+/]*={0,2}$/,ar=/*@__PURE__*/ E(`$ZodBase64`,(e,t)=>{t.pattern??=ir,M.init(e,t),e._zod.check=n=>{rr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),or=/^[A-Za-z0-9_-]*$/;function sr(e){if(!or.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return rr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let cr=/*@__PURE__*/ E(`$ZodBase64URL`,(e,t)=>{t.pattern??=or,M.init(e,t),e._zod.check=n=>{sr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),lr=/*@__PURE__*/ E(`$ZodE164`,(e,t)=>{t.pattern??=Gt,M.init(e,t)});function ur(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 dr=/*@__PURE__*/ E(`$ZodJWT`,(e,t)=>{M.init(e,t),e._zod.check=n=>{ur(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),fr=/*@__PURE__*/ E(`$ZodNumber`,(e,t)=>{j.init(e,t),e._zod.pattern=$t,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}}),pr=/*@__PURE__*/ E(`$ZodNumberFormat`,(e,t)=>{un.init(e,t),fr.init(e,t)}),mr=/*@__PURE__*/ E(`$ZodBoolean`,(e,t)=>{j.init(e,t),e._zod.pattern=en,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}}),hr=/*@__PURE__*/ E(`$ZodNull`,(e,t)=>{j.init(e,t),e._zod.pattern=tn,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}}),gr=/*@__PURE__*/ E(`$ZodUnknown`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e}),_r=/*@__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 vr(e,t){let n=ke(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 ke(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,Ae(n.issues,t,e),n}}return i(n,a)}}let yr=e=>Array.isArray(e)?e.length:-1;function br(e,t,n){e.issues.length&&t.issues.push(...De(n,e.issues)),t.value[n]=e.value}let xr=/*@__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=>br(t,r,e)));else if(br(c,r,e),s&&c.issues.length!==0&&C(c))break}return o.length?Promise.all(o).then(()=>r):r},vr(e,yr)});function Sr(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(...De(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 Cr=[];function wr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Cr,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=me(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Tr(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(C(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=>Sr(e,n,i,t,d,f))):Sr(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 Er=/*@__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=p(()=>wr(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)||g(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=se,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(C(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=>Sr(n,t,e,r,a,o))):Sr(s,t,e,r,a,o)}return o?Tr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Dr=/*@__PURE__*/ E(`$ZodObjectJIT`,(e,t)=>{Er.init(e,t);let n=e._zod.parse,r=p(()=>wr(t)),i=O.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Sn([`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 E(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)}]`: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(`
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)}]`:ie(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,67 +52,67 @@ function E(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=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=>!C(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=>Oe(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(b(e)&&b(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=Or(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.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(C(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=>ce.has(typeof e));return RegExp(t.length?`^(${t.map(e=>le(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`?le(e):e?le(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=>Oe(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(Ne(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(Me(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ue(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`,...S(t)}))}// @__NO_SIDE_EFFECTS__
57
- function vi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
58
- function yi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
59
- function bi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
60
- function xi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...S(t)})}// @__NO_SIDE_EFFECTS__
61
- function Si(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...S(t)})}// @__NO_SIDE_EFFECTS__
62
- function Ci(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...S(t)})}// @__NO_SIDE_EFFECTS__
63
- function wi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
64
- function Ti(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
65
- function Ei(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
66
- function Di(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
67
- function Oi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
68
- function ki(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
69
- function Ai(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
70
- function ji(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
71
- function Mi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
72
- function Ni(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
73
- function Pi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
74
- function Fi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
75
- function Ii(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
76
- function Li(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
77
- function Ri(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
78
- function zi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...S(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,...S(t)})}// @__NO_SIDE_EFFECTS__
80
- function Vi(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...S(t)})}// @__NO_SIDE_EFFECTS__
81
- function Hi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...S(t)})}// @__NO_SIDE_EFFECTS__
82
- function Ui(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...S(t)})}// @__NO_SIDE_EFFECTS__
83
- function Wi(e,t){return new e(gi({type:`number`,checks:[],...S(t)}))}// @__NO_SIDE_EFFECTS__
84
- function Gi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...S(t)})}// @__NO_SIDE_EFFECTS__
85
- function Ki(e,t){return new e({type:`boolean`,...S(t)})}// @__NO_SIDE_EFFECTS__
86
- function qi(e,t){return new e({type:`null`,...S(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`,...S(t)})}// @__NO_SIDE_EFFECTS__
89
- function Xi(e,t){return new rn({check:`less_than`,...S(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
90
- function Zi(e,t){return new rn({check:`less_than`,...S(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
91
- function Qi(e,t){return new an({check:`greater_than`,...S(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
92
- function $i(e,t){return new an({check:`greater_than`,...S(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
93
- function ea(e,t){return new on({check:`multiple_of`,...S(t),value:e})}// @__NO_SIDE_EFFECTS__
94
- function ta(e,t){return new cn({check:`max_length`,...S(t),maximum:e})}// @__NO_SIDE_EFFECTS__
95
- function na(e,t){return new ln({check:`min_length`,...S(t),minimum:e})}// @__NO_SIDE_EFFECTS__
96
- function ra(e,t){return new un({check:`length_equals`,...S(t),length:e})}// @__NO_SIDE_EFFECTS__
97
- function ia(e,t){return new fn({check:`string_format`,format:`regex`,...S(t),pattern:e})}// @__NO_SIDE_EFFECTS__
98
- function aa(e){return new pn({check:`string_format`,format:`lowercase`,...S(e)})}// @__NO_SIDE_EFFECTS__
99
- function oa(e){return new mn({check:`string_format`,format:`uppercase`,...S(e)})}// @__NO_SIDE_EFFECTS__
100
- function sa(e,t){return new hn({check:`string_format`,format:`includes`,...S(t),includes:e})}// @__NO_SIDE_EFFECTS__
101
- function ca(e,t){return new gn({check:`string_format`,format:`starts_with`,...S(t),prefix:e})}// @__NO_SIDE_EFFECTS__
102
- function la(e,t){return new _n({check:`string_format`,format:`ends_with`,...S(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,...S(n)})}// @__NO_SIDE_EFFECTS__
110
- function _a(e,t,n){let r=S(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,...S(n)})}// @__NO_SIDE_EFFECTS__
112
- function ya(e,t){let n=/* @__PURE__ */ ba(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ne(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(Ne(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
113
- function ba(e,t){let n=new A({check:`custom`,...S(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>
55
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=se,c=!O.jitless,l=c&&ce.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Tr([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Or(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=>!C(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=>je(e,r,k())))}),t)}let kr=/*@__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=>h(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Or(t,r,e,i)):Or(o,r,e,i)}}),Ar=/*@__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])=>Mr(e,t,n)):Mr(e,i,a)}});function jr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(le(e)&&le(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=jr(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=jr(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Mr(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=jr(t.value,n.value);if(!c.valid){if(C(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}let Nr=/*@__PURE__*/ E(`$ZodEnum`,(e,t)=>{j.init(e,t);let n=l(t.entries),r=new Set(n);e._zod.values=r,T(e,`pattern`,e=>{let t=l(e.def.entries).filter(e=>de.has(typeof e));return RegExp(t.length?`^(${t.map(e=>fe(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}}),Pr=/*@__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`?fe(e):e?fe(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}}),Fr=/*@__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 Ze(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 Ir(e,t){return e.value=t.issues.length?void 0:t.value,e}let Lr=/*@__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(`^(${h(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=>Ir(e,t)):Ir(e,r)}return t.innerType._zod.run(e,n)}}),Rr=/*@__PURE__*/ E(`$ZodExactOptional`,(e,t)=>{Lr.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)}),zr=/*@__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(`^(${h(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)}),Br=/*@__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=>Vr(e,t)):Vr(r,t)}});function Vr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let Hr=/*@__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))}),Ur=/*@__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=>Wr(t,e)):Wr(i,e)}});function Wr(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 Gr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>je(e,r,k()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}let Kr=/*@__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=>Gr(e,r,t,n)):Gr(e,r,t,n)}}),qr=/*@__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=>Jr(e,t.in,n)):Jr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Jr(e,t.out,n)):Jr(r,t.out,n)}});function Jr(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 Yr=/*@__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(Xr):Xr(r)}});function Xr(e){return e.memo||(e.value=Object.freeze(e.value)),e}let Zr=/*@__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=>Qr(t,n,r,e));Qr(i,n,r,e)}});function Qr(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(Ie(e))}}var $r=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};let ei=`~memo`,ti=[];function ni(e){return typeof e==`object`&&!!e}function ri(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let ii=/*@__PURE__*/ new WeakMap;function ai(e,t,n){let r=ii.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=ai(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?ai(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=te(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?ai(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),oi(e,i)}function oi(e,t){return t!==1&&ii.set(e,t===2),t}function si(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ci,li=[],ui={alloc(e,t,n){let r=ci;if(!r)return n;ci=void 0;let i={value:n,issues:null};return r.set(t.value,i),li.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`&&fi(n,e.value))throw new $r;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=ai(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(!ni(l))return t(s,c);let u=c[ei];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[ei]=u);let d;i===c?d=a:(d=si(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(...ri(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ci=d;let p=li.length,m=t(s,c);ci=void 0;let h=li.length>p?li.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ri(e.issues):ti),e)):(h&&(h.issues=m.issues.length?ri(m.issues):ti),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function di(){return ui}function fi(e,t){let n=e[ei]?.backEdges;return n!==void 0&&ni(t)&&n.has(t)}let pi=()=>{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(Fe(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${pe(e.values[0])}`:`Invalid option: expected one of ${u(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`:``}: ${u(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 mi(){return{localeError:pi()}}var hi,gi=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 _i(){return new gi}(hi=globalThis).__zod_globalRegistry??(hi.__zod_globalRegistry=_i());let vi=globalThis.__zod_globalRegistry;function yi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
56
+ function bi(e,t){return new e(yi({type:`string`,...S(t)}))}// @__NO_SIDE_EFFECTS__
57
+ function xi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
58
+ function Si(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
59
+ function Ci(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
60
+ function wi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...S(t)})}// @__NO_SIDE_EFFECTS__
61
+ function Ti(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...S(t)})}// @__NO_SIDE_EFFECTS__
62
+ function Ei(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...S(t)})}// @__NO_SIDE_EFFECTS__
63
+ function Di(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
64
+ function Oi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
65
+ function ki(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
66
+ function Ai(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
67
+ function ji(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
68
+ function Mi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
69
+ function Ni(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
70
+ function Pi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
71
+ function Fi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
72
+ function Ii(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
73
+ function Li(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
74
+ function Ri(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
75
+ function zi(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
76
+ function Bi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
77
+ function Vi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
78
+ function Hi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...S(t)})}// @__NO_SIDE_EFFECTS__
79
+ function Ui(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...S(t)})}// @__NO_SIDE_EFFECTS__
80
+ function Wi(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...S(t)})}// @__NO_SIDE_EFFECTS__
81
+ function Gi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...S(t)})}// @__NO_SIDE_EFFECTS__
82
+ function Ki(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...S(t)})}// @__NO_SIDE_EFFECTS__
83
+ function qi(e,t){return new e(yi({type:`number`,checks:[],...S(t)}))}// @__NO_SIDE_EFFECTS__
84
+ function Ji(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...S(t)})}// @__NO_SIDE_EFFECTS__
85
+ function Yi(e,t){return new e({type:`boolean`,...S(t)})}// @__NO_SIDE_EFFECTS__
86
+ function Xi(e,t){return new e({type:`null`,...S(t)})}// @__NO_SIDE_EFFECTS__
87
+ function Zi(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
88
+ function Qi(e,t){return new e({type:`never`,...S(t)})}// @__NO_SIDE_EFFECTS__
89
+ function $i(e,t){return new sn({check:`less_than`,...S(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
90
+ function ea(e,t){return new sn({check:`less_than`,...S(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
91
+ function ta(e,t){return new cn({check:`greater_than`,...S(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
92
+ function na(e,t){return new cn({check:`greater_than`,...S(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
93
+ function ra(e,t){return new ln({check:`multiple_of`,...S(t),value:e})}// @__NO_SIDE_EFFECTS__
94
+ function ia(e,t){return new dn({check:`max_length`,...S(t),maximum:e})}// @__NO_SIDE_EFFECTS__
95
+ function aa(e,t){return new fn({check:`min_length`,...S(t),minimum:e})}// @__NO_SIDE_EFFECTS__
96
+ function oa(e,t){return new pn({check:`length_equals`,...S(t),length:e})}// @__NO_SIDE_EFFECTS__
97
+ function sa(e,t){return new hn({check:`string_format`,format:`regex`,...S(t),pattern:e})}// @__NO_SIDE_EFFECTS__
98
+ function ca(e){return new gn({check:`string_format`,format:`lowercase`,...S(e)})}// @__NO_SIDE_EFFECTS__
99
+ function la(e){return new _n({check:`string_format`,format:`uppercase`,...S(e)})}// @__NO_SIDE_EFFECTS__
100
+ function ua(e,t){return new vn({check:`string_format`,format:`includes`,...S(t),includes:e})}// @__NO_SIDE_EFFECTS__
101
+ function da(e,t){return new yn({check:`string_format`,format:`starts_with`,...S(t),prefix:e})}// @__NO_SIDE_EFFECTS__
102
+ function fa(e,t){return new bn({check:`string_format`,format:`ends_with`,...S(t),suffix:e})}// @__NO_SIDE_EFFECTS__
103
+ function pa(e){return new xn({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
104
+ function ma(e){return/* @__PURE__ */ pa(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
105
+ function ha(){return/* @__PURE__ */ pa(e=>e.trim())}// @__NO_SIDE_EFFECTS__
106
+ function ga(){return/* @__PURE__ */ pa(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
107
+ function _a(){return/* @__PURE__ */ pa(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
108
+ function va(){return/* @__PURE__ */ pa(e=>ae(e))}// @__NO_SIDE_EFFECTS__
109
+ function ya(e,t,n){return new e({type:`array`,element:t,...S(n)})}// @__NO_SIDE_EFFECTS__
110
+ function ba(e,t,n){let r=S(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}// @__NO_SIDE_EFFECTS__
111
+ function xa(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...S(n)})}// @__NO_SIDE_EFFECTS__
112
+ function Sa(e,t){let n=/* @__PURE__ */ Ca(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ie(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(Ie(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
113
+ function Ca(e,t){let n=new A({check:`custom`,...S(t)});return n._zod.check=e,n}function wa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&g(e,t,n[t]);return e}function Ta(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??vi,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&&wa(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 Ea(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Da(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}/${Ea(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+Ea(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 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)},Pa=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Fa=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ia=(e,t)=>{Pa(e,`minimum`,t),Fa(e,`maximum`,t)},La=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ra=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},za=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Ba=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Va=(e,t)=>Pa(e,`minimum`,t.minimum),Ha=(e,t)=>Fa(e,`maximum`,t.maximum),Ua=e=>(t,n)=>{Ba(t,n.format);let[r,i]=e[n.format];Pa(t,`minimum`,r),Fa(t,`maximum`,i)},Wa={greater_than:(e,t)=>Pa(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Fa(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>La(e,t.value),number_format:Ua(fe),bigint_format:Ua(pe),min_length:Va,max_length:Ha,length_equals:(e,t)=>Ia(e,t.length),min_size:Va,max_size:Ha,size_equals:(e,t)=>Ia(e,t.size),string_format:(e,t)=>{Ba(e,t.format),t.pattern&&Ra(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)=>za(e,t.mime)};function I(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Wa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Pa(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Pa(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Fa(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Fa(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&La(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&za(t,i.mime);for(let e of i.patterns??[])Ra(t,e);return t}let Ga={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ka=/* @__PURE__ */ new Map([[tr,zt],[rr,Bt]]),qa=e=>Ka.get(e)??e,Ja=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=I(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ga[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(qa);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}))])}},Ya=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=I(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}))])}},Xa=(e,t,n,r)=>{n.type=`boolean`},Za=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Qa=(e,t,n,r)=>{n.not={}},$a=(e,t,n,r)=>{let i=o(e._zod.def.entries);i.length===0?n.not={}:(i.every(e=>typeof e==`number`)&&(n.type=`number`),i.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=i)},eo=(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}},to=(e,t,n,r)=>{N(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},no=(e,t,n,r)=>{N(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},ro=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=I(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 io(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?io(t.out):t.type===`catch`?io(t.innerType):e._zod.optin}let ao=(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`?io(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)},oo=(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},so=(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)},co=(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`}]},lo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},uo=Symbol();function fo(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`),uo):JSON.parse(o)}let 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=fo(i.defaultValue,e,t,n,r);o!==uo&&(n.default=o)},mo=(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=fo(i.defaultValue,e,t,n,r);o!==uo&&(n._prefault=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;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},go=(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},_o=(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},vo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},yo=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function bo(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 L=/*@__PURE__*/ E(`ZodError`,(e,t)=>{et.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);yo.has(n)||(yo.add(n),bo(n,`format`,e=>t=>rt(e,t)),bo(n,`flatten`,e=>t=>nt(e,t)),bo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}),bo(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}),xo=/* @__PURE__ */ at(L),So=/* @__PURE__ */ ot(L),Co=/* @__PURE__ */ st(L),wo=/* @__PURE__ */ lt(L),To=/* @__PURE__ */ ht(L),Eo=/* @__PURE__ */ gt(L),Do=/* @__PURE__ */ _t(L),Oo=/* @__PURE__ */ vt(L),ko=/* @__PURE__ */ yt(L),Ao=/* @__PURE__ */ bt(L),jo=/* @__PURE__ */ xt(L),Mo=/* @__PURE__ */ St(L);function No(){O.localeError||k(di())}function Po(){O.memoizer||k({memoizer:ci()})}let R=/*@__PURE__*/ E(`ZodType`,(e,t)=>(No(),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 x(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ks(e,t))},superRefine(e,t){return this.check(qs(e,t))},overwrite(e){return this.check(/* @__PURE__ */ ua(e))},optional(){return Ds(this)},exactOptional(){return ks(this)},nullable(){return js(this)},nullish(){return Ds(js(this))},nonoptional(e){return Ls(this,e)},array(){return U(this)},or(e){return ys([this,e])},and(e){return xs(this,e)},transform(e){return Vs(this,Ts(e))},default(e){return Ns(this,e)},prefault(e){return Fs(this,e)},catch(e){return zs(this,e)},pipe(e){return Vs(this,e)},readonly(){return Us(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 Fe(this,`~standard`,{...Cn(this),jsonSchema:{input:Na(this,`input`),output:Na(this,`output`)}})},set"~standard"(e){w(this,`~standard`,e)},parse:function e(t,n){return xo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await So(this,t,n,{callee:e})},safeParse(e,t){return Co(this,e,t)},async safeParseAsync(e,t){return wo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){w(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 To(this,t,n,{callee:e})},decode:function e(t,n){return Eo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Do(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Oo(this,t,n,{callee:e})},safeEncode(e,t){return ko(this,e,t)},safeDecode(e,t){return Ao(this,e,t)},async safeEncodeAsync(e,t){return jo(this,e,t)},async safeDecodeAsync(e,t){return Mo(this,e,t)},toJSONSchema(e){return Ma(this,{})(e)},get description(){return hi.get(this)?.description},get _def(){return this._zod.def}}),Fo=/*@__PURE__*/ E(`_ZodString`,(e,t)=>{wn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r)},/*@__PURE__*/ Ie({format:e=>I(e).format??null,minLength:e=>I(e).minimum??null,maxLength:e=>I(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())}})),Io=/*@__PURE__*/ E(`ZodString`,(e,t)=>{wn.init(e,t),Fo.init(e,t)},{email(e){return this.check(/* @__PURE__ */ vi(Vo,e))},url(e){return this.check(/* @__PURE__ */ wi(Wo,e))},jwt(e){return this.check(/* @__PURE__ */ zi(as,e))},emoji(e){return this.check(/* @__PURE__ */ Ti(Go,e))},guid(e){return this.check(/* @__PURE__ */ yi(Ho,e))},uuid(e){return this.check(/* @__PURE__ */ bi(Uo,e))},uuidv4(e){return this.check(/* @__PURE__ */ xi(Uo,e))},uuidv6(e){return this.check(/* @__PURE__ */ Si(Uo,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ci(Uo,e))},nanoid(e){return this.check(/* @__PURE__ */ Ei(Ko,e))},cuid(e){return this.check(/* @__PURE__ */ Di(qo,e))},cuid2(e){return this.check(/* @__PURE__ */ Oi(Jo,e))},ulid(e){return this.check(/* @__PURE__ */ ki(Yo,e))},base64(e){return this.check(/* @__PURE__ */ Ii(ns,e))},base64url(e){return this.check(/* @__PURE__ */ Li(rs,e))},xid(e){return this.check(/* @__PURE__ */ Ai(Xo,e))},ksuid(e){return this.check(/* @__PURE__ */ ji(Zo,e))},ipv4(e){return this.check(/* @__PURE__ */ Mi(Qo,e))},ipv6(e){return this.check(/* @__PURE__ */ Ni($o,e))},cidrv4(e){return this.check(/* @__PURE__ */ Pi(es,e))},cidrv6(e){return this.check(/* @__PURE__ */ Fi(ts,e))},e164(e){return this.check(/* @__PURE__ */ Ri(is,e))},datetime(e){return this.check(/* @__PURE__ */ Bi(Lo,e))},date(e){return this.check(/* @__PURE__ */ Vi(Ro,e))},time(e){return this.check(/* @__PURE__ */ Hi(zo,e))},duration(e){return this.check(/* @__PURE__ */ Ui(Bo,e))}});function z(e){return/* @__PURE__ */ _i(Io,e)}let B=/*@__PURE__*/ E(`ZodStringFormat`,(e,t)=>{M.init(e,t),Fo.init(e,t)}),Lo=/*@__PURE__*/ E(`ZodISODateTime`,(e,t)=>{Un.init(e,t),B.init(e,t)}),Ro=/*@__PURE__*/ E(`ZodISODate`,(e,t)=>{Wn.init(e,t),B.init(e,t)}),zo=/*@__PURE__*/ E(`ZodISOTime`,(e,t)=>{Gn.init(e,t),B.init(e,t)}),Bo=/*@__PURE__*/ E(`ZodISODuration`,(e,t)=>{Kn.init(e,t),B.init(e,t)}),Vo=/*@__PURE__*/ E(`ZodEmail`,(e,t)=>{Dn.init(e,t),B.init(e,t)}),Ho=/*@__PURE__*/ E(`ZodGUID`,(e,t)=>{Tn.init(e,t),B.init(e,t)}),Uo=/*@__PURE__*/ E(`ZodUUID`,(e,t)=>{En.init(e,t),B.init(e,t)}),Wo=/*@__PURE__*/ E(`ZodURL`,(e,t)=>{Fn.init(e,t),B.init(e,t)}),Go=/*@__PURE__*/ E(`ZodEmoji`,(e,t)=>{In.init(e,t),B.init(e,t)}),Ko=/*@__PURE__*/ E(`ZodNanoID`,(e,t)=>{Ln.init(e,t),B.init(e,t)}),qo=/*@__PURE__*/ E(`ZodCUID`,(e,t)=>{Rn.init(e,t),B.init(e,t)}),Jo=/*@__PURE__*/ E(`ZodCUID2`,(e,t)=>{zn.init(e,t),B.init(e,t)}),Yo=/*@__PURE__*/ E(`ZodULID`,(e,t)=>{Bn.init(e,t),B.init(e,t)}),Xo=/*@__PURE__*/ E(`ZodXID`,(e,t)=>{Vn.init(e,t),B.init(e,t)}),Zo=/*@__PURE__*/ E(`ZodKSUID`,(e,t)=>{Hn.init(e,t),B.init(e,t)}),Qo=/*@__PURE__*/ E(`ZodIPv4`,(e,t)=>{qn.init(e,t),B.init(e,t)}),$o=/*@__PURE__*/ E(`ZodIPv6`,(e,t)=>{Xn.init(e,t),B.init(e,t)}),es=/*@__PURE__*/ E(`ZodCIDRv4`,(e,t)=>{Zn.init(e,t),B.init(e,t)}),ts=/*@__PURE__*/ E(`ZodCIDRv6`,(e,t)=>{$n.init(e,t),B.init(e,t)}),ns=/*@__PURE__*/ E(`ZodBase64`,(e,t)=>{nr.init(e,t),B.init(e,t)}),rs=/*@__PURE__*/ E(`ZodBase64URL`,(e,t)=>{ar.init(e,t),B.init(e,t)}),is=/*@__PURE__*/ E(`ZodE164`,(e,t)=>{or.init(e,t),B.init(e,t)}),as=/*@__PURE__*/ E(`ZodJWT`,(e,t)=>{cr.init(e,t),B.init(e,t)}),os=/*@__PURE__*/ E(`ZodNumber`,(e,t)=>{lr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Ie({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=I(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=I(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=I(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>I(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(cs(e))},safe(e){return this.check(cs(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 V(e){return/* @__PURE__ */ Wi(os,e)}let ss=/*@__PURE__*/ E(`ZodNumberFormat`,(e,t)=>{ur.init(e,t),os.init(e,t)});function cs(e){return/* @__PURE__ */ Gi(ss,e)}let ls=/*@__PURE__*/ E(`ZodBoolean`,(e,t)=>{dr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r)});function H(e){return/* @__PURE__ */ Ki(ls,e)}let us=/*@__PURE__*/ E(`ZodNull`,(e,t)=>{fr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r)});function ds(e){return/* @__PURE__ */ qi(us,e)}let fs=/*@__PURE__*/ E(`ZodUnknown`,(e,t)=>{pr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ps(){return/* @__PURE__ */ Ji(fs)}let ms=/*@__PURE__*/ E(`ZodNever`,(e,t)=>{mr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r)});function hs(e){return/* @__PURE__ */ Yi(ms,e)}let gs=/*@__PURE__*/ E(`ZodArray`,(e,t)=>{Po(),vr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(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 U(e,t){return/* @__PURE__ */ ga(gs,e,t)}let _s=/*@__PURE__*/ E(`ZodObject`,(e,t)=>{Po(),wr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),He(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return G(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:ps()}))},loose(){return this.clone(y(this._zod.def,{catchall:ps()}))},strict(){return this.clone(y(this._zod.def,{catchall:hs()}))},strip(){return this.clone(y(this._zod.def,{catchall:void 0}))},extend(e){return _e(this,e)},safeExtend(e){return ye(this,e)},merge(e){return be(this,e)},pick(e){return me(this,e)},omit(e){return ge(this,e)},partial(...e){return xe(Es,this,e[0])},exactPartial(...e){return xe(Os,this,e[0],`exactPartial`)},required(...e){return Se(Is,this,e[0])}});function W(e,t){let n={type:`object`,shape:e??{},...S(t)};return new _s(n)}let vs=/*@__PURE__*/ E(`ZodUnion`,(e,t)=>{Er.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.options=t.options});function ys(e,t){return new vs({type:`union`,options:e,...S(t)})}let bs=/*@__PURE__*/ E(`ZodIntersection`,(e,t)=>{Dr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r)});function xs(e,t){return new bs({type:`intersection`,left:e,right:t})}let Ss=/*@__PURE__*/ E(`ZodEnum`,(e,t)=>{Ar.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(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 Ss({...t,checks:[],...S(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 Ss({...t,checks:[],...S(r),entries:i})}});function G(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ss({type:`enum`,entries:n,...S(t)})}let Cs=/*@__PURE__*/ E(`ZodLiteral`,(e,t)=>{jr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(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 K(e,t){return new Cs({type:`literal`,values:Array.isArray(e)?e:[e],...S(t)})}let ws=/*@__PURE__*/ E(`ZodTransform`,(e,t)=>{Po(),Mr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(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(Ne(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(Ne(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ts(e){return new ws({type:`transform`,transform:e})}let Es=/*@__PURE__*/ E(`ZodOptional`,(e,t)=>{Pr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e){return new Es({type:`optional`,innerType:e})}let Os=/*@__PURE__*/ E(`ZodExactOptional`,(e,t)=>{Fr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ks(e){return new Os({type:`optional`,innerType:e})}let As=/*@__PURE__*/ E(`ZodNullable`,(e,t)=>{Ir.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`nullable`,innerType:e})}let Ms=/*@__PURE__*/ E(`ZodDefault`,(e,t)=>{Lr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ns(e,t){return new Ms({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}let Ps=/*@__PURE__*/ E(`ZodPrefault`,(e,t)=>{zr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fs(e,t){return new Ps({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}let Is=/*@__PURE__*/ E(`ZodNonOptional`,(e,t)=>{Br.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ls(e,t){return new Is({type:`nonoptional`,innerType:e,...S(t)})}let Rs=/*@__PURE__*/ E(`ZodCatch`,(e,t)=>{Ur.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function zs(e,t){return new Rs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ue(t)})}let Bs=/*@__PURE__*/ E(`ZodPipe`,(e,t)=>{Wr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.in=t.in,e.out=t.out});function Vs(e,t){return new Bs({type:`pipe`,in:e,out:t})}let Hs=/*@__PURE__*/ E(`ZodReadonly`,(e,t)=>{Kr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Us(e){return new Hs({type:`readonly`,innerType:e})}let Ws=/*@__PURE__*/ E(`ZodCustom`,(e,t)=>{Jr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r)});function Gs(e,t){return/* @__PURE__ */ _a(Ws,e??(()=>!0),t)}function Ks(e,t={}){return/* @__PURE__ */ va(Ws,e,t)}function qs(e,t){return/* @__PURE__ */ ya(e,t)}let q={step:`data-step`,effect:`data-step-effect`,start:`data-step-start`},Js=[`appear`,`fade`,`fly`,`wipe`,`zoom`],Ys=[`click`,`with`,`after`],Xs=W({x:V().finite(),y:V().finite(),width:V().finite(),height:V().finite()}),Zs=U(W({key:V().int().nonnegative(),control:Xs,target:Xs.nullable(),label:z()})),Qs=V().int().nonnegative(),$s=W({hash:z(),edits:U(ys([W({index:Qs,change:W({kind:K(`attribute`),name:K(`value`),value:z()})}),W({index:Qs,change:W({kind:K(`styles`),declarations:U(W({property:z(),value:z()}))})})]))}).nullable(),J=V().finite(),ec=V().int().nonnegative(),tc=W({hash:z(),gap:W({parent:ec,before:ec.nullable(),row:H(),flow:H(),origin:W({x:J,y:J}),room:J,line:W({x:J,y:J,width:J,height:J})})}).nullable();function nc(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 rc={deg:1,grad:.9,rad:180/Math.PI,turn:360};function ic(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?rc[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function ac(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 oc(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 Y=V().finite(),sc=V().int().nonnegative(),cc=G([`block`,`vertical`,`horizontal`,`wrap`,`grid`]),lc=W({top:Y,right:Y,bottom:Y,left:Y}),uc=W({flow:cc,inline:H(),direction:z(),wrap:z(),justify:z(),alignItems:z(),ownJustify:H(),rowGap:Y,columnGap:Y,padding:lc,parent:cc,parentAlignItems:z(),width:Y,height:Y}),dc=W({width:Y,height:Y}),fc=W({kind:G([`box`,`text`,`media`,`container`]),natural:dc.nullable(),hugsHeight:H(),inset:dc,sizing:W({layout:uc,fills:H()}).nullable()}),pc=W({left:Y,top:Y}),mc=W({x:Y,y:Y,width:Y,height:Y}),hc=U(W({index:sc,box:mc,read:fc.nullable(),placed:pc.nullable(),nested:H(),margin:lc})).nullable(),gc=W({hash:z(),ghosts:U(W({index:sc,box:mc,placed:pc.nullable()}))}).nullable(),_c=U(W({index:sc,right:Y,top:Y})),vc=W({x:Y,y:Y}),yc=U(W({opacity:Y,radius:Y,fontFamily:z(),fontSize:Y,fontWeight:Y,lineHeight:Y.nullable(),letterSpacing:Y,textAlign:z(),textDecorationLine:z(),textTransform:z(),textWrapStyle:z(),truncated:H(),display:z(),color:z(),bordered:H(),borderWidth:Y.nullable(),holdsText:H(),textOnly:H(),text:z(),keepsBreaks:H(),rotation:W({degrees:Y.nullable(),scale:vc.nullable(),own:W({rotate:Y.nullable().optional(),scale:vc.nullable().optional()}),translated:H(),transform:W({own:z(),ruled:H(),reanchors:H()})}),placement:W({free:H(),left:Y,top:Y,width:Y.nullable(),height:Y.nullable(),inline:W({width:z(),height:z()}),wordsLeft:Y.nullable()}),layout:uc,inline:W({color:H(),backgroundColor:H(),background:H(),border:H()}),step:W({step:z().nullable(),effect:z().nullable(),start:z().nullable()})})).nullable(),bc=W({index:sc,hash:z()}).nullable(),xc=ys([W({kind:K(`toggle-play`)}),W({kind:K(`seek`),seconds:V().finite()}),W({kind:K(`toggle-sound`)}),W({kind:K(`set-flag`),name:G([`controls`,`autoplay`,`loop`,`muted`]),on:H()})]),Sc=W({tag:G([`video`,`audio`]),playable:H(),paused:H(),time:V().finite(),length:Gs(e=>typeof e==`number`),muted:H(),mutedInFile:H(),controls:H(),autoplay:H(),loop:H()}).nullable(),Cc=[`camera-orbit`,`max-camera-orbit`,`orientation`,`scale`,`animation-name`,`autoplay`],wc=W({name:G(Cc),value:z().nullable()}),Tc=z().nullable(),Ec=W({src:z(),loaded:H(),clips:U(z()),orbit:W({theta:V().finite(),phi:V().finite()}).nullable(),staged:W({"camera-orbit":Tc,"max-camera-orbit":Tc,orientation:Tc,scale:Tc,"animation-name":Tc,autoplay:Tc})}).nullable(),Dc=W({motion:W({source:G([`hf`,`timelines`,`css`,`model`]),duration:V().finite().nonnegative().nullable()}),span:V().finite().nonnegative()}),X=`frameboard-bridge`,Oc=`data-frameboard-editing`,kc=/* @__PURE__ */ `bindings.content-height.controls.controls-act.controls-edits.element-box.element-boxes.focus-keys.gap-at.hide-controls.hide-scrollbar.hide-strips.hold-animations.keep-previews.keys.live-body.live-element.measure.media.media-act.model.model-stage.motion.motion-moment.motion-release.motion-seek.overflow.page-colors.paint.pick-at.pins.pointer-move.preview-style.restamp.scroll.scroll-act.step-preview.steps.steps-show.takes-clicks.text-caret.text-edit.text-written.theme`.split(`.`);function Ac(e,t){let{data:n}=e;if(e.origin!==t||!Vc(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:X,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`&&kc.includes(n.op)?{tag:X,kind:`request`,id:r,op:n.op,args:n.args}:null;case`reply`:return n.ok===!0?{tag:X,kind:`reply`,id:r,ok:!0,value:n.value}:n.ok===!1&&typeof n.error==`string`?{tag:X,kind:`reply`,id:r,ok:!1,error:n.error}:null;case`push`:return{tag:X,kind:`push`,id:r,value:n.value};case`close`:return{tag:X,kind:`close`,id:r};default:return null}}let Z=V().int().nonnegative(),jc=V().int().nonnegative(),Q=W({}).strict(),Mc=W({index:Z,hash:z()}),Nc=W({x:V().finite(),y:V().finite()}),Pc=W({x:V().finite(),y:V().finite(),width:V().finite(),height:V().finite()}),Fc=W({left:V().finite(),top:V().finite(),right:V().finite(),bottom:V().finite()}),Ic=W({top:V().finite(),size:V().finite()}),Lc=ys([W({kind:K(`commit`),text:z(),breaks:H(),run:V().int().nonnegative().optional()}),W({kind:K(`closed`)})]),Rc={theme:{args:W({theme:G([`light`,`dark`])}),value:H()},"hide-scrollbar":{args:Q,value:H()},scroll:{args:Q,value:Ic.nullable(),push:Ic.nullable()},"scroll-act":{args:ys([W({act:K(`page`),toward:ys([K(-1),K(1)])}),W({act:K(`to`),top:V().finite()})]),value:H()},keys:{args:W({keys:U(z()),keepTyping:H(),keepButtons:H().optional()}),value:H(),push:W({key:z(),repeat:H()})},"focus-keys":{args:Q,value:H(),push:K(!0)},"content-height":{args:Q,value:V().int().positive().nullable()},"element-box":{args:Mc,value:Fc.nullable()},"element-boxes":{args:W({hash:z(),indexes:U(Z)}),value:U(W({index:Z,box:Pc})).nullable()},"live-body":{args:Q,value:bc},"live-element":{args:W({hash:z(),indexes:U(Z)}),value:yc},measure:{args:W({hash:z(),indexes:U(Z)}),value:hc,push:hc},overflow:{args:Q,value:gc,push:gc},pins:{args:W({indexes:U(Z)}),value:_c,push:_c},"pick-at":{args:W({at:Nc}),value:W({hash:z().nullable(),chain:U(W({index:Z,tag:z()}))})},"gap-at":{args:W({at:Nc,carried:Z.optional()}),value:tc},"hide-strips":{args:Q,value:H()},"keep-previews":{args:Q,value:ds()},media:{args:Mc,value:Sc,push:Sc},"media-act":{args:Mc.extend({act:xc}),value:H()},model:{args:Mc,value:Ec,push:Ec},"model-stage":{args:Mc.and(wc),value:H()},paint:{args:W({fill:z()}),value:z().nullable()},"preview-style":{args:W({index:Z,property:z(),value:z().nullable()}),value:ds()},restamp:{args:W({hash:z()}),value:H()},"text-edit":{args:Mc.extend({at:Nc.optional(),empty:H().optional()}),value:H(),push:Lc},"text-caret":{args:W({edit:z(),at:Nc}),value:H()},"text-written":{args:W({edit:z(),written:H()}),value:ds()},steps:{args:W({shown:jc}),value:jc,push:jc},"steps-show":{args:W({steps:z(),shown:jc,entering:Z.nullable()}),value:H()},"step-preview":{args:W({index:Z,effect:G(Js)}),value:H()},"hold-animations":{args:Q,value:H()},"hide-controls":{args:Q,value:H()},"pointer-move":{args:Q,value:H(),push:ds()},motion:{args:Q,value:H(),push:Dc.nullable()},"motion-seek":{args:W({motion:z(),at:V().finite()}),value:H()},"motion-release":{args:W({motion:z()}),value:H()},"motion-moment":{args:Dc,value:V().finite().nonnegative()},controls:{args:Q,value:H(),push:jc},"controls-act":{args:W({controls:z(),act:G([`reset`,`settle`])}),value:H()},"controls-edits":{args:W({controls:z()}),value:$s},"takes-clicks":{args:Q,value:H()},bindings:{args:Q,value:Zs,push:Zs},"page-colors":{args:Q,value:W({fill:z().nullable(),ink:z()})}},zc=Symbol(`refused`);function Bc(e,t){let n=Rc[e].args.safeParse(t);return n.success?n.data:zc}function Vc(e){return typeof e==`object`&&!!e}let Hc=/^http:\/\/(127\.0\.0\.1|localhost)(:\d{1,5})?$/;function Uc(e,t){return e===`null`?!1:e===t||Hc.test(e)}[...[{name:`small-phone`,label:`Small phone`,group:`phone`,width:375,height:667},{name:`iphone-16`,label:`iPhone 16`,group:`phone`,width:393,height:852},{name:`iphone-18-pro`,label:`iPhone 18 Pro`,group:`phone`,width:402,height:874},{name:`android`,label:`Android`,group:`phone`,width:412,height:917},{name:`iphone-16-pro-max`,label:`iPhone 16 Pro Max`,group:`phone`,width:440,height:956},{name:`ipad-mini`,label:`iPad mini`,group:`tablet`,width:744,height:1133},{name:`ipad-pro-12-9`,label:`iPad Pro 12.9`,group:`tablet`,width:1024,height:1366},{name:`macbook-air`,label:`MacBook Air`,group:`desktop`,width:1280,height:832},{name:`full-hd`,label:`Full HD`,group:`desktop`,width:1920,height:1080},{name:`slide-16-9`,label:`Slide 16:9`,group:`slide`,width:1920,height:1080},{name:`slide-4-3`,label:`Slide 4:3`,group:`slide`,width:1024,height:768},{name:`og-card`,label:`Open Graph`,group:`social`,width:1200,height:630},{name:`linkedin-post`,label:`LinkedIn post`,group:`social`,width:1200,height:627},{name:`video-landscape`,label:`Video landscape`,group:`video`,width:1920,height:1080},{name:`video-portrait`,label:`Video portrait`,group:`video`,width:1080,height:1920}].map(e=>e.name)],28+{height:14,reach:.06,radius:10}.height;let Wc={width:81,height:30,top:14};Wc.top+Wc.height+10,Wc.top,Wc.height;function Gc(e=document){let t=e.defaultView,n=e=>e&&t?t.getComputedStyle(e):null,r=n(e.documentElement),i=n(e.body);return{fill:[r?.backgroundColor,i?.backgroundColor].find(e=>e!==void 0&&e!==`transparent`&&!/^rgba\(.*,\s*0\)$/.test(e))??null,ink:i?.color??r?.color??`CanvasText`}}function Kc(){let e=document.documentElement.scrollHeight;return e<=innerHeight+1?null:{top:scrollY/e,size:innerHeight/e}}let qc={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=Kc(),i=()=>{let e=Kc();(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?Jc(document):null,"page-colors":()=>Gc(document)};function Jc(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 Yc=`data-binds`;function Xc(e){let t=e.trim().split(/\s+/),n=t.pop(),r=t.join(` `);return!n||r===``?null:{selector:r,property:n}}function Zc(e){return/^--./.test(e)}function Qc(e){let t=/* @__PURE__ */ new Map;for(let{target:n,property:r,value:i,unit:a}of e){let e=t.get(n)??/* @__PURE__ */ new Map;e.set(r,`${i}${a}`),t.set(n,e)}return[...e.map(({index:e,value:t})=>({index:e,change:{kind:`attribute`,name:`value`,value:t}})),...[...t].map(([e,t])=>({index:e,change:{kind:`styles`,declarations:[...t].map(([e,t])=>({property:e,value:t}))}}))]}let $c=`[${Yc}], label:has([${Yc}]), :not(html, body):has(> [${Yc}], > label > [${Yc}]):not(:has(> :not([${Yc}], label))) { display: none !important }`;function el(e,t){let n=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=t=>{let n=Xc(t.getAttribute(`data-binds`)??``);if(!n||!Zc(n.property))return null;let r;try{r=e.querySelector(n.selector)}catch{return null}return r?{control:t,target:r,property:n.property,unit:t.getAttribute(`data-unit`)??``}:null},o=e=>{let r=n.get(e);n.delete(e);let a=r&&tl(r.target);if(r&&a){let e=[...n.values()].reverse().find(e=>e.target===r.target&&e.property===r.property),t=i.get(r.target)?.get(r.property);e?a.setProperty(r.property,`${e.control.value}${e.unit}`):!t||t.value===``?a.removeProperty(r.property):a.setProperty(r.property,t.value,t.priority)}t(n.size)},s=e=>{let r=e.target;if(!nl(r))return;if(r.value===``){n.has(r)&&o(r);return}let s=a(r),c=s&&tl(s.target);if(!s||!c)return;let l=i.get(s.target)??/* @__PURE__ */ new Map;l.has(s.property)||(l.set(s.property,{value:c.getPropertyValue(s.property),priority:c.getPropertyPriority(s.property)}),i.set(s.target,l)),c.setProperty(s.property,`${r.value}${s.unit}`),n.delete(r),n.set(r,s),t(n.size)};return e.addEventListener(`input`,s,!0),{edits:()=>{let t=[];for(let{control:i,target:a,property:o,unit:s}of n.values()){let n=r(e,i),c=r(e,a);n!==null&&c!==null&&i.value!==``&&t.push({index:n,value:i.value,unit:s,target:c,property:o})}return Qc(t)},reset:()=>{for(let e of n.keys())e.value=e.defaultValue;for(let[e,t]of i){let n=tl(e);for(let[e,{value:r,priority:i}]of t)r===``?n?.removeProperty(e):n?.setProperty(e,r,i)}n.clear(),i.clear(),t(0)},settle:()=>{for(let e of n.keys())e.setAttribute(`value`,e.value);n.clear(),i.clear(),t(0)},detach:()=>e.removeEventListener(`input`,s,!0)}}function tl(e){let t=e.style;return t&&typeof t.setProperty==`function`?t:null}function nl(e){return e!==null&&`hasAttribute`in e&&e.hasAttribute(`data-binds`)&&`value`in e&&`defaultValue`in e}function rl(e){return[...e.querySelectorAll(`[${Yc}]`)].map((t,n)=>{let r=t.getAttribute(`data-binds`)??``,i=Xc(r),a=i&&Zc(i.property)?il(e,i.selector):null,o=i?Zc(i.property)?a?`${i.selector} ${i.property}`:`${i.selector}, no match`:`${i.property}, not a custom property`:`${r.trim()||`data-binds`}, no property`;return{key:n,control:al(t),target:a?al(a):null,label:o}})}function il(e,t){try{return e.querySelector(t)}catch{return null}}function al(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)}}let ol=/* @__PURE__ */ new Map,sl={controls:(e,{id:t,push:n,onClose:r})=>{let i=el(document,e=>n(e));return ol.set(t,i),r(()=>{i.reset(),i.detach(),ol.delete(t)}),!0},"controls-act":({controls:e,act:t})=>{let n=ol.get(e);return n?(t===`reset`?n.reset():n.settle(),!0):!1},"controls-edits":({controls:e})=>{let t=ol.get(e),n=a(document),r=t?.edits()??[];return n===null||r.length===0?null:{hash:n,edits:r}},bindings:(e,{push:t,onClose:n})=>{let r=document.documentElement;if(!r)return[];let i=()=>t(rl(document)),a=new ResizeObserver(i);return a.observe(r),addEventListener(`scroll`,i,!0),n(()=>{a.disconnect(),removeEventListener(`scroll`,i,!0)}),rl(document)}},cl=/* @__PURE__ */ new Set([`html`,`body`]);function ll(e,t){let n=[];for(let i=document.elementFromPoint(e,t);i&&!cl.has(i.localName);i=i.parentElement){let e=r(document,i);e!==null&&n.push({index:e,tag:i.localName})}return n}let ul=/* @__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 dl(e){if(e.localName===`body`)return!0;if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||ul.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 fl(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 pl(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 ml(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 hl(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&&!dl(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}=fl(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})=>ml(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:pl(n),room:Math.max(0,n.clientWidth-p(`left`)-p(`right`)),line:gl(n.getBoundingClientRect(),a,o,s,{after:d?.box,ahead:f?.box})}}function gl(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 _l(e,t){let n=hl(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 vl(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 yl={"pick-at":({at:e})=>({hash:a(document),chain:ll(e.x,e.y)}),"gap-at":({at:e,carried:t})=>{let n=a(document),r=t===void 0?hl(e):_l(e,t);return n&&r?{hash:n,gap:r}:null},paint:({fill:e})=>vl(e)};function bl(e,t){e.readyState===`loading`?e.addEventListener(`DOMContentLoaded`,t,{once:!0}):t()}function xl(e){return a(document)===e.hash?i(document,e.index):null}let Sl=[`Shift`,`Meta`,`Alt`,`Control`],Cl=typeof navigator==`object`?navigator.platform:``,wl=/Mac|iPod|iPhone|iPad/.test(Cl)?`Meta`:`Control`,Tl=Cl===`Win32`?[`Control`,`Alt`]:[`Alt`];function El(e){return!!(e.key&&e.code&&e.getModifierState)}function Dl(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches(`[contenteditable],input,select,textarea`)}function Ol(e,t){return typeof e.getModifierState==`function`?e.getModifierState(t)||Tl.includes(t)&&e.getModifierState(`AltGraph`):!1}function kl(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`?wl:n,t?o.push(n):a.push(n)}return[a,o,i]})}function Al(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=>!Ol(e,t))||Sl.find(a=>!t.includes(a)&&!n.includes(a)&&r!==a&&Ol(e,a)&&!(i&&Tl.includes(a))))}function jl(e,t={}){let n=t.timeout??1e3,r=t.ignore??Dl,i=Object.keys(e).map(t=>[t,kl(t),e[t]]),a=/* @__PURE__ */ new Map,o=null;return e=>{if(!El(e)||r(e))return;let t=[];for(let[n,r,o]of i){let[i,...s]=a.get(n)||r;if(!Al(e,i))Ol(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 Ml(e,t,n={}){let r=n.event??`keydown`,i=jl(t,n);return e.addEventListener(r,i,n.capture),()=>{e.removeEventListener(r,i,n.capture)}}function Nl(e){return(e.code===`Space`||e.key===`Enter`)&&e.target instanceof Element&&e.target.closest(`button`)!==null}function Pl(e,{keepTyping:t,keepButtons:n}){if(e.isComposing||e.defaultPrevented||n&&Nl(e))return!0;if(!t)return!1;let r=e.target;return r instanceof HTMLElement&&(r.isContentEditable||r.matches(`[contenteditable],input,select,textarea`))}let Fl={keys:({keys:e,...t},{push:n,onClose:r})=>(r(Ml(window,Object.fromEntries(e.map(e=>[e,t=>{t.preventDefault(),n({key:e,repeat:t.repeat})}])),{ignore:e=>Pl(e,t)})),!0),"focus-keys":(e,{push:t,onClose:n})=>{let r=()=>t(!0);return window.addEventListener(`keydown`,r,!0),n(()=>window.removeEventListener(`keydown`,r,!0)),!0}};function Il(e){return Math.round(parseFloat(e)*100)/100}function Ll(e,t){let n=e.parentElement,r=n?getComputedStyle(n):null,i=e instanceof HTMLElement?e:null,a=e=>Il(e)||0;return{flow:nc(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?nc(r.display,r.flexDirection,r.flexWrap):`block`,parentAlignItems:r?.alignItems??`normal`,width:Math.round(i?.offsetWidth??0),height:Math.round(i?.offsetHeight??0)}}function Rl(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:Il(t.fontSize),fontWeight:Number(t.fontWeight),lineHeight:t.lineHeight===`normal`?null:Il(t.lineHeight),letterSpacing:t.letterSpacing===`normal`?0:Il(t.letterSpacing),textAlign:Kl(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])?Il(t.borderTopWidth):null,holdsText:n.trim()!==``||zl(e,n),textOnly:e.childElementCount===0&&(n.trim()!==``||zl(e,n)),text:n,keepsBreaks:t.whiteSpace!==`normal`&&t.whiteSpace!==`nowrap`,rotation:{degrees:ic(t.rotate),scale:ac(t.scale),own:Hl(e),translated:oc(t.transform),transform:Ul(e,t)},placement:Bl(e,t),layout:Ll(e,t),inline:Gl(e),step:{step:e.getAttribute(q.step),effect:e.getAttribute(q.effect),start:e.getAttribute(q.start)}}}function zl(e,t){return e.localName===`p`&&e.childElementCount===0&&t.trim()===``}function Bl(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=Vl(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 Vl(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 Hl(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:ic(a.rotate)}:{},...r?{scale:ac(a.scale)}:{}};return i===null?t.removeAttribute(`style`):t.setAttribute(`style`,i),o}function Ul(e,t){let n=e instanceof HTMLElement?e.style.getPropertyValue(`transform`):``;return{own:n,ruled:n===``&&t.transform!==`none`,reanchors:t.transform===`none`&&Wl(e,t)}}function Wl(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 Gl(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 Kl(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}let ql={"live-element":({hash:e,indexes:t})=>{if(a(document)!==e)return null;let n=t.flatMap(e=>{let t=i(document,e);return t?[Rl(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}},Jl=/* @__PURE__ */ new Set([`html`,`body`]),Yl=/* @__PURE__ */ new Set([`img`,`video`,`model-viewer`]);function Xl(e){if(!e||Jl.has(e.localName))return null;if(Yl.has(e.localName))return`media`;let t=(e.textContent??``).trim()!==``;return e.childElementCount>0?t&&[...e.children].every(Zl)?`text`:`container`:t?`text`:e.localName===`div`?`box`:null}function Zl(e){let t=getComputedStyle(e).display;return t===`inline`||t.startsWith(`inline-`)}function Ql(e){let t=Xl(e),n=getComputedStyle(e);return!t||ic(n.rotate)!==0||n.transform.startsWith(`matrix3d(`)||(t===`text`||t===`container`)&&(n.display===`inline`||n.display===`contents`)?null:{kind:t,natural:nu(e),hugsHeight:t===`text`&&!ru(e),inset:tu(n),sizing:t===`container`?eu(e,n):null}}let $l=/* @__PURE__ */ new Set([`vertical`,`horizontal`,`wrap`]);function eu(e,t){let n=Ll(e,t);return{layout:n,fills:$l.has(n.parent)&&(parseFloat(t.flexGrow)||0)>0}}function tu(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 nu(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 ru(e){let t=e instanceof HTMLElement?e.style.height:``;return t!==``&&t!==`auto`}function iu(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 au(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 ou(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 su(e){let t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function cu(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 lu(e,t){return t.map((n,r)=>({index:e[r]??0,box:ou(n),read:Ql(n),placed:iu(n,[]),nested:t.some(e=>e!==n&&e.contains(n)),margin:au(n)}))}function uu(){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)&&!du(n,e)&&(a.push(n),i.push({index:o,box:ou(n),placed:iu(n,[])}))}),i}function du(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 fu(){let e=a(document);return e===null?null:{hash:e,ghosts:uu()}}function pu(e){return e.flatMap(e=>{let t=i(document,e)?.getBoundingClientRect();return t?[{index:e,right:t.right,top:t.top}]:[]})}function mu(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 hu={"element-boxes":({hash:e,indexes:t})=>a(document)===e?t.flatMap(e=>{let t=i(document,e),n=t?su(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=cu(e,t);return i?(r(mu(i,()=>n(lu(t,i)),i.length>1)),lu(t,i)):null},overflow:(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(fu())}))},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)}),fu()},pins:({indexes:e},{push:t,onClose:n})=>(n(mu(e.flatMap(e=>{let t=i(document,e);return t?[t]:[]}),()=>t(pu(e)),!1)),pu(e))},gu=[`play`,`pause`,`timeupdate`,`durationchange`,`loadedmetadata`,`volumechange`,`seeked`,`error`,`emptied`],_u=[`controls`,`autoplay`,`loop`,`muted`];function vu(e){let t=xl(e);return t instanceof HTMLMediaElement?t:null}function yu(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 bu(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 xu=`frameboard-media-strip`;function Su(){if(document.getElementById(xu))return()=>{};let t=document.createElement(`style`);return t.id=xu,t.setAttribute(e,``),t.textContent=`video::-webkit-media-controls { display: none !important }`,document.head?.append(t),()=>t.remove()}let Cu={media:(e,{push:t,onClose:n})=>{let r=vu(e);if(!r)return null;let i=()=>t(yu(r));for(let e of gu)r.addEventListener(e,i);let a=new MutationObserver(i);return a.observe(r,{attributeFilter:[..._u]}),n(()=>{for(let e of gu)r.removeEventListener(e,i);a.disconnect()}),yu(r)},"media-act":({act:e,...t})=>{let n=vu(t);return n?(bu(n,e),!0):!1},"hide-strips":(e,{onClose:t})=>(t(Su()),!0)},wu=[`load`,`error`,`camera-change`];function Tu(e){let t=xl(e);return t instanceof HTMLElement&&t.localName===`model-viewer`?t:null}function Eu(e){let t=Math.round(e*180/Math.PI)%360;return t>180?t-360:t<=-180?t+360:t}function Du(e){let t=e.loaded===!0,n=t?e.getCameraOrbit?.():void 0,r={};for(let t of Cc)r[t]=e.getAttribute(t);return{src:e.getAttribute(`src`)??``,loaded:t,clips:t?[...e.availableAnimations??[]]:[],orbit:n?{theta:Eu(n.theta),phi:Eu(n.phi)}:null,staged:r}}function Ou(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 ku={model:(e,{push:t,onClose:n})=>{let r=Tu(e);if(!r)return null;let i=Du(r),a=JSON.stringify(i),o=()=>{let e=Du(r),n=JSON.stringify(e);n!==a&&(a=n,t(e))};for(let e of wu)r.addEventListener(e,o);let s=new MutationObserver(o);return s.observe(r,{attributeFilter:[`src`,...Cc]}),n(()=>{for(let e of wu)r.removeEventListener(e,o);s.disconnect()}),i},"model-stage":({name:e,value:t,...n})=>{let r=Tu(n);return r?(Ou(r,e,t),!0):!1}};async function Au(e,t){let n=e.performance.now()+t,r=()=>new Promise(t=>e.requestAnimationFrame(()=>t())),i=e=>typeof e==`number`&&Number.isFinite(e)?Math.round(e*1e3):null,a=()=>{let t=e.__hf,n=i(t?.duration);if(typeof t?.seek==`function`&&n!==null&&n>0)return{source:`hf`,duration:n};let r=e.__timelines,a=Object.values(r??{}).filter(e=>typeof e?.seek==`function`);if(a.length>0){let e=a.map(e=>i(typeof e.duration==`function`?e.duration.call(e):e.duration)).filter(e=>e!==null);return{source:`timelines`,duration:e.length===0?null:Math.max(...e)}}let o=e.document.getAnimations();if(o.length>0){let e=o.map(e=>e.effect?.getComputedTiming().endTime).filter(e=>typeof e==`number`&&Number.isFinite(e));return{source:`css`,duration:e.length===0?null:Math.round(Math.max(...e))}}let s=[...e.document.querySelectorAll(`model-viewer`)].map(e=>e).filter(e=>(e.availableAnimations?.length??0)>0);if(s.length>0){let e=s.map(e=>i(e.duration)).filter(e=>e!==null);return{source:`model`,duration:e.length===0?null:Math.max(...e)}}return null};for(await r();;){let t=a();if(t!==null||e.performance.now()>=n)return t;await r()}}async function ju(e,{motion:t,ms:n}){let r=t.duration===null?n:Math.min(Math.max(n,0),t.duration);if(t.source===`hf`)await e.__hf.seek(r/1e3);else if(t.source===`timelines`){let t=e.__timelines;for(let e of Object.values(t))typeof e?.seek==`function`&&(e.pause?.(),await e.seek(r/1e3))}else if(t.source===`css`)for(let t of e.document.getAnimations())t.pause(),t.currentTime=r;for(let t of e.document.querySelectorAll(`model-viewer`)){let e=t;typeof e.pause==`function`&&(e.pause(),e.currentTime=r/1e3)}return await new Promise(t=>e.requestAnimationFrame(()=>e.requestAnimationFrame(()=>t()))),r}let Mu=1e4;async function Nu(e=Mu){let t=await Au(window,e);return t===null?null:{motion:t,span:t.duration??Pu()}}function Pu(){let e=document.getAnimations().map(e=>{let t=e.effect?.getComputedTiming(),n=Number(t?.duration),r=t?.delay??0;return Number.isFinite(n)?r+n:0});return Math.round(Math.max(0,...e))}function Fu(e){let t=null,n=null,r=async()=>{for(;t!==null;){let n=t;t=null,await ju(window,{motion:e,ms:n})}n=null};return e=>(t=e,n??=r(),n)}function Iu(e){if(e.source===`css`)for(let e of document.getAnimations())e.play();else location.reload()}function Lu({motion:e,span:t}){let n=0;if(e.source===`css`){let e=document.getAnimations().map(e=>Number(e.currentTime)).filter(e=>Number.isFinite(e));n=Math.max(0,...e)}else if(e.source===`timelines`){let e=window.__timelines,t=Object.values(e??{}).find(e=>typeof e?.time==`function`),r=t?Number(t.time.call(t)):0;n=Number.isFinite(r)?r*1e3:0}return Math.round(t<=0?n:e.duration===null?n%t:Math.min(n,t))}let Ru=/* @__PURE__ */ new Map;function zu(e){return{motion:(t,n)=>Vu(e,n),"motion-seek":({motion:e,at:t})=>{let n=Ru.get(e);return n?(n.seek(t),!0):!1},"motion-release":({motion:e})=>{let t=Ru.get(e);return t?(Iu(t.found.motion),!0):!1},"motion-moment":e=>Lu(e)}}let Bu=zu(Mu);function Vu(e,{id:t,push:n,onClose:r}){let i=!1;return Nu(e).catch(()=>null).then(e=>{i||(e&&Ru.set(t,{found:e,seek:Fu(e.motion)}),n(e))}),r(()=>{i=!0,Ru.delete(t)}),!0}function Hu(t,n){if(!document.head)return!1;let r=document.createElement(`style`);return r.setAttribute(e,``),r.textContent=t,document.head.append(r),n(()=>r.remove()),!0}let Uu={"hold-animations":(e,{onClose:t})=>Hu(`*, *::before, *::after { animation-play-state: paused !important }`,t),"hide-controls":(e,{onClose:t})=>Hu($c,t),"pointer-move":(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(null)}))};return addEventListener(`pointermove`,i),n(()=>{removeEventListener(`pointermove`,i),cancelAnimationFrame(r)}),!0}},Wu=/* @__PURE__ */ new Map;function Gu(e,t,n){let r=`${e}:${t}`,a=i(document,e),o=a instanceof HTMLElement?a:null,s=Wu.get(r);if(n===null){if(Wu.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&&Wu.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 Ku(t){return{"preview-style":({index:e,property:t,value:n})=>(Gu(e,t,n),null),"keep-previews":()=>(Wu.clear(),null),restamp:({hash:n})=>{let r=document.querySelector(`style[${e}]`);return r?(r.setAttribute(`data-hash`,n),t(),!0):!1}}}function qu(e){return n(e).some(e=>e.matches(`a[href], button, input, select, textarea, summary, [onclick], [tabindex], [contenteditable], video[controls], audio[controls], script`))}let Ju={"takes-clicks":()=>qu(document)},$=`data-frameboard-step`,Yu=`--frameboard-step-delay`,Xu=`frameboard-present-steps`,Zu=`
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 Oa(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;Oa(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 ka=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Aa=[`oneOf`,`anyOf`];function ja(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ma(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ka.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]??ja(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}g(n,r,e.length===1?e[0]:Ma(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=ja(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 Na(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ka)if(t in e)return;let n=t.filter(e=>Aa.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ma(t);else{let e=n[0],i=Aa.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=>Ma([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,wa(e,r))}function Pa(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)):wa(i,s),wa(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())Oa(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)??[])Na(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)}wa(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,g(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:Ia(t,`input`,e.processors),output:Ia(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 Fa=(e,t={})=>n=>{let r=Ta({...n,processors:t});return P(e,r),Da(r,e),Pa(r,e)},Ia=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ta({...i??{},target:a,io:t,processors:n});return P(e,o),Da(o,e),Pa(o,e)},La=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ra=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},za=(e,t)=>{La(e,`minimum`,t),Ra(e,`maximum`,t)},Ba=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Va=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Ha=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Ua=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Wa=(e,t)=>La(e,`minimum`,t.minimum),Ga=(e,t)=>Ra(e,`maximum`,t.maximum),Ka=e=>(t,n)=>{Ua(t,n.format);let[r,i]=e[n.format];La(t,`minimum`,r),Ra(t,`maximum`,i)},qa={greater_than:(e,t)=>La(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ra(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ba(e,t.value),number_format:Ka(he),bigint_format:Ka(ge),min_length:Wa,max_length:Ga,length_equals:(e,t)=>za(e,t.length),min_size:Wa,max_size:Ga,size_equals:(e,t)=>za(e,t.size),string_format:(e,t)=>{Ua(e,t.format),t.pattern&&Va(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)=>Ha(e,t.mime)};function I(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)qa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&La(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&La(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ra(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ra(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ba(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ha(t,i.mime);for(let e of i.patterns??[])Va(t,e);return t}let Ja={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ya=/* @__PURE__ */ new Map([[ir,Ht],[or,Ut]]),Xa=e=>Ya.get(e)??e,Za=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=I(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ja[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(Xa);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}=I(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}))])}},$a=(e,t,n,r)=>{n.type=`boolean`},eo=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},to=(e,t,n,r)=>{n.not={}},no=(e,t,n,r)=>{let i=l(e._zod.def.entries);i.length===0?n.not={}:(i.every(e=>typeof e==`number`)&&(n.type=`number`),i.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=i)},ro=(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}},io=(e,t,n,r)=>{N(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},ao=(e,t,n,r)=>{N(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},oo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=I(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 so(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?so(t.out):t.type===`catch`?so(t.innerType):e._zod.optin}let co=(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)g(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`?so(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)},lo=(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},uo=(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)},fo=(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`}]},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},mo=Symbol();function ho(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`),mo):JSON.parse(o)}let 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;let o=ho(i.defaultValue,e,t,n,r);o!==mo&&(n.default=o)},_o=(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=ho(i.defaultValue,e,t,n,r);o!==mo&&(n._prefault=o)},vo=(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},yo=(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},bo=(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},xo=(e,t,n,r)=>{let i=e._zod.def;P(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},So=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function Co(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 L=/*@__PURE__*/ E(`ZodError`,(e,t)=>{rt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);So.has(n)||(So.add(n),Co(n,`format`,e=>t=>ot(e,t)),Co(n,`flatten`,e=>t=>at(e,t)),Co(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,d,2)}),Co(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,d,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),wo=/* @__PURE__ */ ct(L),To=/* @__PURE__ */ lt(L),Eo=/* @__PURE__ */ ut(L),Do=/* @__PURE__ */ ft(L),Oo=/* @__PURE__ */ vt(L),ko=/* @__PURE__ */ yt(L),Ao=/* @__PURE__ */ bt(L),jo=/* @__PURE__ */ xt(L),Mo=/* @__PURE__ */ St(L),No=/* @__PURE__ */ Ct(L),Po=/* @__PURE__ */ wt(L),Fo=/* @__PURE__ */ Tt(L);function Io(){O.localeError||k(mi())}function Lo(){O.memoizer||k({memoizer:di()})}let R=/*@__PURE__*/ E(`ZodType`,(e,t)=>(Io(),j.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(b(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return x(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ys(e,t))},superRefine(e,t){return this.check(Xs(e,t))},overwrite(e){return this.check(/* @__PURE__ */ pa(e))},optional(){return As(this)},exactOptional(){return Ms(this)},nullable(){return Ps(this)},nullish(){return As(Ps(this))},nonoptional(e){return Bs(this,e)},array(){return U(this)},or(e){return Ss([this,e])},and(e){return ws(this,e)},transform(e){return Ws(this,Os(e))},default(e){return Is(this,e)},prefault(e){return Rs(this,e)},catch(e){return Hs(this,e)},pipe(e){return Ws(this,e)},readonly(){return Ks(this)},describe(e){let t=this.clone();return vi.add(t,{description:e}),t},meta(...e){if(e.length===0)return vi.get(this);let t=this.clone();return vi.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 Re(this,`~standard`,{...En(this),jsonSchema:{input:Ia(this,`input`),output:Ia(this,`output`)}})},set"~standard"(e){w(this,`~standard`,e)},parse:function e(t,n){return wo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await To(this,t,n,{callee:e})},safeParse(e,t){return Eo(this,e,t)},async safeParseAsync(e,t){return Do(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){w(this,`spa`,e)},validate(e,t){return ht(this,e,t)},validateAsync(e,t){return _t(this,e,t)},encode:function e(t,n){return Oo(this,t,n,{callee:e})},decode:function e(t,n){return ko(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Ao(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await jo(this,t,n,{callee:e})},safeEncode(e,t){return Mo(this,e,t)},safeDecode(e,t){return No(this,e,t)},async safeEncodeAsync(e,t){return Po(this,e,t)},async safeDecodeAsync(e,t){return Fo(this,e,t)},toJSONSchema(e){return Fa(this,{})(e)},get description(){return vi.get(this)?.description},get _def(){return this._zod.def}}),Ro=/*@__PURE__*/ E(`_ZodString`,(e,t)=>{Dn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r)},/*@__PURE__*/ ze({format:e=>I(e).format??null,minLength:e=>I(e).minimum??null,maxLength:e=>I(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ sa(...e))},includes(...e){return this.check(/* @__PURE__ */ ua(...e))},startsWith(...e){return this.check(/* @__PURE__ */ da(...e))},endsWith(...e){return this.check(/* @__PURE__ */ fa(...e))},min(...e){return this.check(/* @__PURE__ */ aa(...e))},max(...e){return this.check(/* @__PURE__ */ ia(...e))},length(...e){return this.check(/* @__PURE__ */ oa(...e))},nonempty(...e){return this.check(/* @__PURE__ */ aa(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ ca(e))},uppercase(e){return this.check(/* @__PURE__ */ la(e))},trim(){return this.check(/* @__PURE__ */ ha())},normalize(...e){return this.check(/* @__PURE__ */ ma(...e))},toLowerCase(){return this.check(/* @__PURE__ */ ga())},toUpperCase(){return this.check(/* @__PURE__ */ _a())},slugify(){return this.check(/* @__PURE__ */ va())}})),zo=/*@__PURE__*/ E(`ZodString`,(e,t)=>{Dn.init(e,t),Ro.init(e,t)},{email(e){return this.check(/* @__PURE__ */ xi(Wo,e))},url(e){return this.check(/* @__PURE__ */ Di(qo,e))},jwt(e){return this.check(/* @__PURE__ */ Hi(cs,e))},emoji(e){return this.check(/* @__PURE__ */ Oi(Jo,e))},guid(e){return this.check(/* @__PURE__ */ Si(Go,e))},uuid(e){return this.check(/* @__PURE__ */ Ci(Ko,e))},uuidv4(e){return this.check(/* @__PURE__ */ wi(Ko,e))},uuidv6(e){return this.check(/* @__PURE__ */ Ti(Ko,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ei(Ko,e))},nanoid(e){return this.check(/* @__PURE__ */ ki(Yo,e))},cuid(e){return this.check(/* @__PURE__ */ Ai(Xo,e))},cuid2(e){return this.check(/* @__PURE__ */ ji(Zo,e))},ulid(e){return this.check(/* @__PURE__ */ Mi(Qo,e))},base64(e){return this.check(/* @__PURE__ */ zi(as,e))},base64url(e){return this.check(/* @__PURE__ */ Bi(os,e))},xid(e){return this.check(/* @__PURE__ */ Ni($o,e))},ksuid(e){return this.check(/* @__PURE__ */ Pi(es,e))},ipv4(e){return this.check(/* @__PURE__ */ Fi(ts,e))},ipv6(e){return this.check(/* @__PURE__ */ Ii(ns,e))},cidrv4(e){return this.check(/* @__PURE__ */ Li(rs,e))},cidrv6(e){return this.check(/* @__PURE__ */ Ri(is,e))},e164(e){return this.check(/* @__PURE__ */ Vi(ss,e))},datetime(e){return this.check(/* @__PURE__ */ Ui(Bo,e))},date(e){return this.check(/* @__PURE__ */ Wi(Vo,e))},time(e){return this.check(/* @__PURE__ */ Gi(Ho,e))},duration(e){return this.check(/* @__PURE__ */ Ki(Uo,e))}});function z(e){return/* @__PURE__ */ bi(zo,e)}let B=/*@__PURE__*/ E(`ZodStringFormat`,(e,t)=>{M.init(e,t),Ro.init(e,t)}),Bo=/*@__PURE__*/ E(`ZodISODateTime`,(e,t)=>{Kn.init(e,t),B.init(e,t)}),Vo=/*@__PURE__*/ E(`ZodISODate`,(e,t)=>{qn.init(e,t),B.init(e,t)}),Ho=/*@__PURE__*/ E(`ZodISOTime`,(e,t)=>{Jn.init(e,t),B.init(e,t)}),Uo=/*@__PURE__*/ E(`ZodISODuration`,(e,t)=>{Yn.init(e,t),B.init(e,t)}),Wo=/*@__PURE__*/ E(`ZodEmail`,(e,t)=>{An.init(e,t),B.init(e,t)}),Go=/*@__PURE__*/ E(`ZodGUID`,(e,t)=>{On.init(e,t),B.init(e,t)}),Ko=/*@__PURE__*/ E(`ZodUUID`,(e,t)=>{kn.init(e,t),B.init(e,t)}),qo=/*@__PURE__*/ E(`ZodURL`,(e,t)=>{Rn.init(e,t),B.init(e,t)}),Jo=/*@__PURE__*/ E(`ZodEmoji`,(e,t)=>{zn.init(e,t),B.init(e,t)}),Yo=/*@__PURE__*/ E(`ZodNanoID`,(e,t)=>{Bn.init(e,t),B.init(e,t)}),Xo=/*@__PURE__*/ E(`ZodCUID`,(e,t)=>{Vn.init(e,t),B.init(e,t)}),Zo=/*@__PURE__*/ E(`ZodCUID2`,(e,t)=>{Hn.init(e,t),B.init(e,t)}),Qo=/*@__PURE__*/ E(`ZodULID`,(e,t)=>{Un.init(e,t),B.init(e,t)}),$o=/*@__PURE__*/ E(`ZodXID`,(e,t)=>{Wn.init(e,t),B.init(e,t)}),es=/*@__PURE__*/ E(`ZodKSUID`,(e,t)=>{Gn.init(e,t),B.init(e,t)}),ts=/*@__PURE__*/ E(`ZodIPv4`,(e,t)=>{Xn.init(e,t),B.init(e,t)}),ns=/*@__PURE__*/ E(`ZodIPv6`,(e,t)=>{$n.init(e,t),B.init(e,t)}),rs=/*@__PURE__*/ E(`ZodCIDRv4`,(e,t)=>{er.init(e,t),B.init(e,t)}),is=/*@__PURE__*/ E(`ZodCIDRv6`,(e,t)=>{nr.init(e,t),B.init(e,t)}),as=/*@__PURE__*/ E(`ZodBase64`,(e,t)=>{ar.init(e,t),B.init(e,t)}),os=/*@__PURE__*/ E(`ZodBase64URL`,(e,t)=>{cr.init(e,t),B.init(e,t)}),ss=/*@__PURE__*/ E(`ZodE164`,(e,t)=>{lr.init(e,t),B.init(e,t)}),cs=/*@__PURE__*/ E(`ZodJWT`,(e,t)=>{dr.init(e,t),B.init(e,t)}),ls=/*@__PURE__*/ E(`ZodNumber`,(e,t)=>{fr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ ze({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=I(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=I(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=I(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>I(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ ta(e,t))},gte(e,t){return this.check(/* @__PURE__ */ na(e,t))},min(e,t){return this.check(/* @__PURE__ */ na(e,t))},lt(e,t){return this.check(/* @__PURE__ */ $i(e,t))},lte(e,t){return this.check(/* @__PURE__ */ ea(e,t))},max(e,t){return this.check(/* @__PURE__ */ ea(e,t))},int(e){return this.check(ds(e))},safe(e){return this.check(ds(e))},positive(e){return this.check(/* @__PURE__ */ ta(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ na(0,e))},negative(e){return this.check(/* @__PURE__ */ $i(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ ea(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ ra(e,t))},step(e,t){return this.check(/* @__PURE__ */ ra(e,t))},finite(){return this}}));function V(e){return/* @__PURE__ */ qi(ls,e)}let us=/*@__PURE__*/ E(`ZodNumberFormat`,(e,t)=>{pr.init(e,t),ls.init(e,t)});function ds(e){return/* @__PURE__ */ Ji(us,e)}let fs=/*@__PURE__*/ E(`ZodBoolean`,(e,t)=>{mr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r)});function H(e){return/* @__PURE__ */ Yi(fs,e)}let ps=/*@__PURE__*/ E(`ZodNull`,(e,t)=>{hr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r)});function ms(e){return/* @__PURE__ */ Xi(ps,e)}let hs=/*@__PURE__*/ E(`ZodUnknown`,(e,t)=>{gr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function gs(){return/* @__PURE__ */ Zi(hs)}let _s=/*@__PURE__*/ E(`ZodNever`,(e,t)=>{_r.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r)});function vs(e){return/* @__PURE__ */ Qi(_s,e)}let ys=/*@__PURE__*/ E(`ZodArray`,(e,t)=>{Lo(),xr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ aa(e,t))},nonempty(e){return this.check(/* @__PURE__ */ aa(1,e))},max(e,t){return this.check(/* @__PURE__ */ ia(e,t))},length(e,t){return this.check(/* @__PURE__ */ oa(e,t))},unwrap(){return this.element}});function U(e,t){return/* @__PURE__ */ ya(ys,e,t)}let bs=/*@__PURE__*/ E(`ZodObject`,(e,t)=>{Lo(),Dr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),Ge(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return G(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(b(this._zod.def,{catchall:e}))},passthrough(){return this.clone(b(this._zod.def,{catchall:gs()}))},loose(){return this.clone(b(this._zod.def,{catchall:gs()}))},strict(){return this.clone(b(this._zod.def,{catchall:vs()}))},strip(){return this.clone(b(this._zod.def,{catchall:void 0}))},extend(e){return be(this,e)},safeExtend(e){return Se(this,e)},merge(e){return Ce(this,e)},pick(e){return _e(this,e)},omit(e){return ye(this,e)},partial(...e){return we(ks,this,e[0])},exactPartial(...e){return we(js,this,e[0],`exactPartial`)},required(...e){return Te(zs,this,e[0])}});function W(e,t){let n={type:`object`,shape:e??{},...S(t)};return new bs(n)}let xs=/*@__PURE__*/ E(`ZodUnion`,(e,t)=>{kr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.options=t.options});function Ss(e,t){return new xs({type:`union`,options:e,...S(t)})}let Cs=/*@__PURE__*/ E(`ZodIntersection`,(e,t)=>{Ar.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r)});function ws(e,t){return new Cs({type:`intersection`,left:e,right:t})}let Ts=/*@__PURE__*/ E(`ZodEnum`,(e,t)=>{Nr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(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 Ts({...t,checks:[],...S(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 Ts({...t,checks:[],...S(r),entries:i})}});function G(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ts({type:`enum`,entries:n,...S(t)})}let Es=/*@__PURE__*/ E(`ZodLiteral`,(e,t)=>{Pr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(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 K(e,t){return new Es({type:`literal`,values:Array.isArray(e)?e:[e],...S(t)})}let Ds=/*@__PURE__*/ E(`ZodTransform`,(e,t)=>{Lo(),Fr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ze(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ie(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(Ie(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Os(e){return new Ds({type:`transform`,transform:e})}let ks=/*@__PURE__*/ E(`ZodOptional`,(e,t)=>{Lr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function As(e){return new ks({type:`optional`,innerType:e})}let js=/*@__PURE__*/ E(`ZodExactOptional`,(e,t)=>{Rr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ms(e){return new js({type:`optional`,innerType:e})}let Ns=/*@__PURE__*/ E(`ZodNullable`,(e,t)=>{zr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ps(e){return new Ns({type:`nullable`,innerType:e})}let Fs=/*@__PURE__*/ E(`ZodDefault`,(e,t)=>{Br.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Is(e,t){return new Fs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ue(t)}})}let Ls=/*@__PURE__*/ E(`ZodPrefault`,(e,t)=>{Hr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rs(e,t){return new Ls({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ue(t)}})}let zs=/*@__PURE__*/ E(`ZodNonOptional`,(e,t)=>{Ur.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bs(e,t){return new zs({type:`nonoptional`,innerType:e,...S(t)})}let Vs=/*@__PURE__*/ E(`ZodCatch`,(e,t)=>{Kr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Hs(e,t){return new Vs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ke(t)})}let Us=/*@__PURE__*/ E(`ZodPipe`,(e,t)=>{qr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.in=t.in,e.out=t.out});function Ws(e,t){return new Us({type:`pipe`,in:e,out:t})}let Gs=/*@__PURE__*/ E(`ZodReadonly`,(e,t)=>{Yr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ks(e){return new Gs({type:`readonly`,innerType:e})}let qs=/*@__PURE__*/ E(`ZodCustom`,(e,t)=>{Zr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r)});function Js(e,t){return/* @__PURE__ */ ba(qs,e??(()=>!0),t)}function Ys(e,t={}){return/* @__PURE__ */ xa(qs,e,t)}function Xs(e,t){return/* @__PURE__ */ Sa(e,t)}let q={step:`data-step`,effect:`data-step-effect`,start:`data-step-start`},Zs=[`appear`,`fade`,`fly`,`wipe`,`zoom`],Qs=[`click`,`with`,`after`],$s=W({x:V().finite(),y:V().finite(),width:V().finite(),height:V().finite()}),ec=U(W({key:V().int().nonnegative(),control:$s,target:$s.nullable(),label:z()})),tc=V().int().nonnegative(),nc=W({hash:z(),edits:U(Ss([W({index:tc,change:W({kind:K(`attribute`),name:K(`value`),value:z()})}),W({index:tc,change:W({kind:K(`styles`),declarations:U(W({property:z(),value:z()}))})})]))}).nullable(),J=V().finite(),rc=V().int().nonnegative(),ic=W({hash:z(),gap:W({parent:rc,before:rc.nullable(),row:H(),flow:H(),origin:W({x:J,y:J}),room:J,line:W({x:J,y:J,width:J,height:J})})}).nullable();function ac(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 oc={deg:1,grad:.9,rad:180/Math.PI,turn:360};function sc(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?oc[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function cc(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 lc(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 Y=V().finite(),uc=V().int().nonnegative(),dc=G([`block`,`vertical`,`horizontal`,`wrap`,`grid`]),fc=W({top:Y,right:Y,bottom:Y,left:Y}),pc=W({flow:dc,inline:H(),direction:z(),wrap:z(),justify:z(),alignItems:z(),ownJustify:H(),rowGap:Y,columnGap:Y,padding:fc,parent:dc,parentAlignItems:z(),width:Y,height:Y}),mc=W({width:Y,height:Y}),hc=W({kind:G([`box`,`text`,`media`,`container`]),natural:mc.nullable(),hugsHeight:H(),inset:mc,sizing:W({layout:pc,fills:H()}).nullable()}),gc=W({left:Y,top:Y}),_c=W({x:Y,y:Y,width:Y,height:Y}),vc=U(W({index:uc,box:_c,read:hc.nullable(),placed:gc.nullable(),nested:H(),margin:fc,locked:H().optional(),unboxed:H().optional()})).nullable(),yc=W({hash:z(),ghosts:U(W({index:uc,box:_c,placed:gc.nullable(),locked:H().optional()}))}).nullable(),bc=U(W({index:uc,right:Y,top:Y})),xc=W({x:Y,y:Y}),Sc=U(W({opacity:Y,radius:Y,fontFamily:z(),fontSize:Y,fontWeight:Y,lineHeight:Y.nullable(),letterSpacing:Y,textAlign:z(),textDecorationLine:z(),textTransform:z(),textWrapStyle:z(),truncated:H(),display:z(),color:z(),bordered:H(),borderWidth:Y.nullable(),holdsText:H(),textOnly:H(),text:z(),keepsBreaks:H(),rotation:W({degrees:Y.nullable(),scale:xc.nullable(),own:W({rotate:Y.nullable().optional(),scale:xc.nullable().optional()}),translated:H(),transform:W({own:z(),ruled:H(),reanchors:H()})}),placement:W({free:H(),left:Y,top:Y,width:Y.nullable(),height:Y.nullable(),inline:W({width:z(),height:z()}),wordsLeft:Y.nullable()}),layout:pc,inline:W({color:H(),backgroundColor:H(),background:H(),border:H()}),step:W({step:z().nullable(),effect:z().nullable(),start:z().nullable()})})).nullable(),Cc=W({index:uc,hash:z()}).nullable(),wc=Ss([W({kind:K(`toggle-play`)}),W({kind:K(`seek`),seconds:V().finite()}),W({kind:K(`toggle-sound`)}),W({kind:K(`set-flag`),name:G([`controls`,`autoplay`,`loop`,`muted`]),on:H()})]),Tc=W({tag:G([`video`,`audio`]),playable:H(),paused:H(),time:V().finite(),length:Js(e=>typeof e==`number`),muted:H(),mutedInFile:H(),controls:H(),autoplay:H(),loop:H()}).nullable(),Ec=[`camera-orbit`,`max-camera-orbit`,`orientation`,`scale`,`animation-name`,`autoplay`],Dc=W({name:G(Ec),value:z().nullable()}),Oc=z().nullable(),kc=W({src:z(),loaded:H(),clips:U(z()),orbit:W({theta:V().finite(),phi:V().finite()}).nullable(),staged:W({"camera-orbit":Oc,"max-camera-orbit":Oc,orientation:Oc,scale:Oc,"animation-name":Oc,autoplay:Oc})}).nullable(),Ac=W({motion:W({source:G([`hf`,`timelines`,`css`,`model`]),duration:V().finite().nonnegative().nullable()}),span:V().finite().nonnegative()}),X=`frameboard-bridge`,jc=`data-frameboard-editing`,Mc=/* @__PURE__ */ `bindings.content-height.controls.controls-act.controls-edits.element-box.element-boxes.focus-keys.gap-at.hide-controls.hide-scrollbar.hide-strips.hold-animations.keep-previews.keys.live-body.live-element.measure.media.media-act.model.model-stage.motion.motion-moment.motion-release.motion-seek.overflow.page-colors.paint.pick-at.pins.pointer-move.preview-style.restamp.scroll.scroll-act.step-preview.steps.steps-show.takes-clicks.text-caret.text-edit.text-written.theme`.split(`.`);function Nc(e,t){let{data:n}=e;if(e.origin!==t||!Wc(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:X,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:X,kind:`request`,id:r,op:n.op,args:n.args}:null;case`reply`:return n.ok===!0?{tag:X,kind:`reply`,id:r,ok:!0,value:n.value}:n.ok===!1&&typeof n.error==`string`?{tag:X,kind:`reply`,id:r,ok:!1,error:n.error}:null;case`push`:return{tag:X,kind:`push`,id:r,value:n.value};case`close`:return{tag:X,kind:`close`,id:r};default:return null}}let Z=V().int().nonnegative(),Pc=V().int().nonnegative(),Q=W({}).strict(),Fc=W({index:Z,hash:z()}),Ic=W({x:V().finite(),y:V().finite()}),Lc=W({x:V().finite(),y:V().finite(),width:V().finite(),height:V().finite()}),Rc=W({left:V().finite(),top:V().finite(),right:V().finite(),bottom:V().finite()}),zc=W({top:V().finite(),size:V().finite()}),Bc=Ss([W({kind:K(`commit`),text:z(),breaks:H(),run:V().int().nonnegative().optional()}),W({kind:K(`closed`)})]),Vc={theme:{args:W({theme:G([`light`,`dark`])}),value:H()},"hide-scrollbar":{args:Q,value:H()},scroll:{args:Q,value:zc.nullable(),push:zc.nullable()},"scroll-act":{args:Ss([W({act:K(`page`),toward:Ss([K(-1),K(1)])}),W({act:K(`to`),top:V().finite()})]),value:H()},keys:{args:W({keys:U(z()),keepTyping:H(),keepButtons:H().optional()}),value:H(),push:W({key:z(),repeat:H()})},"focus-keys":{args:Q,value:H(),push:K(!0)},"content-height":{args:Q,value:V().int().positive().nullable()},"element-box":{args:Fc,value:Rc.nullable()},"element-boxes":{args:W({hash:z(),indexes:U(Z)}),value:U(W({index:Z,box:Lc})).nullable()},"live-body":{args:Q,value:Cc},"live-element":{args:W({hash:z(),indexes:U(Z)}),value:Sc},measure:{args:W({hash:z(),indexes:U(Z)}),value:vc,push:vc},overflow:{args:Q,value:yc,push:yc},pins:{args:W({indexes:U(Z)}),value:bc,push:bc},"pick-at":{args:W({at:Ic,unlocked:H().optional()}),value:W({hash:z().nullable(),chain:U(W({index:Z,tag:z()}))})},"gap-at":{args:W({at:Ic,carried:Z.optional()}),value:ic},"hide-strips":{args:Q,value:H()},"keep-previews":{args:Q,value:ms()},media:{args:Fc,value:Tc,push:Tc},"media-act":{args:Fc.extend({act:wc}),value:H()},model:{args:Fc,value:kc,push:kc},"model-stage":{args:Fc.and(Dc),value:H()},paint:{args:W({fill:z()}),value:z().nullable()},"preview-style":{args:W({index:Z,property:z(),value:z().nullable()}),value:ms()},restamp:{args:W({hash:z()}),value:H()},"text-edit":{args:Fc.extend({at:Ic.optional(),empty:H().optional()}),value:H(),push:Bc},"text-caret":{args:W({edit:z(),at:Ic}),value:H()},"text-written":{args:W({edit:z(),written:H()}),value:ms()},steps:{args:W({shown:Pc}),value:Pc,push:Pc},"steps-show":{args:W({steps:z(),shown:Pc,entering:Z.nullable()}),value:H()},"step-preview":{args:W({index:Z,effect:G(Zs)}),value:H()},"hold-animations":{args:Q,value:H()},"hide-controls":{args:Q,value:H()},"pointer-move":{args:Q,value:H(),push:ms()},motion:{args:Q,value:H(),push:Ac.nullable()},"motion-seek":{args:W({motion:z(),at:V().finite()}),value:H()},"motion-release":{args:W({motion:z()}),value:H()},"motion-moment":{args:Ac,value:V().finite().nonnegative()},controls:{args:Q,value:H(),push:Pc},"controls-act":{args:W({controls:z(),act:G([`reset`,`settle`])}),value:H()},"controls-edits":{args:W({controls:z()}),value:nc},"takes-clicks":{args:Q,value:H()},bindings:{args:Q,value:ec,push:ec},"page-colors":{args:Q,value:W({fill:z().nullable(),ink:z()})}},Hc=Symbol(`refused`);function Uc(e,t){let n=Vc[e].args.safeParse(t);return n.success?n.data:Hc}function Wc(e){return typeof e==`object`&&!!e}let Gc=/^http:\/\/(127\.0\.0\.1|localhost)(:\d{1,5})?$/;function Kc(e,t){return e===`null`?!1:e===t||Gc.test(e)}[...[{name:`small-phone`,label:`Small phone`,group:`phone`,width:375,height:667},{name:`iphone-16`,label:`iPhone 16`,group:`phone`,width:393,height:852},{name:`iphone-18-pro`,label:`iPhone 18 Pro`,group:`phone`,width:402,height:874},{name:`android`,label:`Android`,group:`phone`,width:412,height:917},{name:`iphone-16-pro-max`,label:`iPhone 16 Pro Max`,group:`phone`,width:440,height:956},{name:`ipad-mini`,label:`iPad mini`,group:`tablet`,width:744,height:1133},{name:`ipad-pro-12-9`,label:`iPad Pro 12.9`,group:`tablet`,width:1024,height:1366},{name:`macbook-air`,label:`MacBook Air`,group:`desktop`,width:1280,height:832},{name:`full-hd`,label:`Full HD`,group:`desktop`,width:1920,height:1080},{name:`slide-16-9`,label:`Slide 16:9`,group:`slide`,width:1920,height:1080},{name:`slide-4-3`,label:`Slide 4:3`,group:`slide`,width:1024,height:768},{name:`og-card`,label:`Open Graph`,group:`social`,width:1200,height:630},{name:`linkedin-post`,label:`LinkedIn post`,group:`social`,width:1200,height:627},{name:`video-landscape`,label:`Video landscape`,group:`video`,width:1920,height:1080},{name:`video-portrait`,label:`Video portrait`,group:`video`,width:1080,height:1920}].map(e=>e.name)],28+{height:14,reach:.06,radius:10}.height;let qc={body:`#17181b`,base:`#2c2e33`,edge:`#45484f`,island:`#050506`,homeBar:`rgba(128, 128, 128, 0.6)`,button:`#2a2c31`,tabletButton:`#4a4e57`,cameraRing:`#4a4e57`,cameraLens:`#0a0a0c`,cameraGlint:`#5b6170`,islandText:`#ffffff`,islandLive:`#34c759`},Jc={width:81,height:30,top:14};`${qc.cameraGlint}${qc.cameraLens}`,Jc.top+Jc.height+10,Jc.top,Jc.height;function Yc(e=document){let t=e.defaultView,n=e=>e&&t?t.getComputedStyle(e):null,r=n(e.documentElement),i=n(e.body);return{fill:[r?.backgroundColor,i?.backgroundColor].find(e=>e!==void 0&&e!==`transparent`&&!/^rgba\(.*,\s*0\)$/.test(e))??null,ink:i?.color??r?.color??`CanvasText`}}function Xc(){let e=document.documentElement.scrollHeight;return e<=innerHeight+1?null:{top:scrollY/e,size:innerHeight/e}}let Zc={theme:({theme:e})=>(n(document.documentElement,e),!0),"hide-scrollbar":(e,{onClose:n})=>{if(!document.head)return!1;let r=document.createElement(`style`);return r.setAttribute(t,``),r.textContent=`html { scrollbar-width: none }`,document.head.append(r),n(()=>r.remove()),!0},scroll:(e,{push:t,onClose:n})=>{let r=Xc(),i=()=>{let e=Xc();(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?Qc(document):null,"page-colors":()=>Yc(document)};function Qc(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 $c=`data-binds`;function el(e){let t=e.trim().split(/\s+/),n=t.pop(),r=t.join(` `);return!n||r===``?null:{selector:r,property:n}}function tl(e){return/^--./.test(e)}function nl(e){let t=/* @__PURE__ */ new Map;for(let{target:n,property:r,value:i,unit:a}of e){let e=t.get(n)??/* @__PURE__ */ new Map;e.set(r,`${i}${a}`),t.set(n,e)}return[...e.map(({index:e,value:t})=>({index:e,change:{kind:`attribute`,name:`value`,value:t}})),...[...t].map(([e,t])=>({index:e,change:{kind:`styles`,declarations:[...t].map(([e,t])=>({property:e,value:t}))}}))]}let rl=`[${$c}], label:has([${$c}]), :not(html, body):has(> [${$c}], > label > [${$c}]):not(:has(> :not([${$c}], label))) { display: none !important }`;function il(e,t){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,a=t=>{let n=el(t.getAttribute(`data-binds`)??``);if(!n||!tl(n.property))return null;let r;try{r=e.querySelector(n.selector)}catch{return null}return r?{control:t,target:r,property:n.property,unit:t.getAttribute(`data-unit`)??``}:null},o=e=>{let i=n.get(e);n.delete(e);let a=i&&al(i.target);if(i&&a){let e=[...n.values()].reverse().find(e=>e.target===i.target&&e.property===i.property),t=r.get(i.target)?.get(i.property);e?a.setProperty(i.property,`${e.control.value}${e.unit}`):!t||t.value===``?a.removeProperty(i.property):a.setProperty(i.property,t.value,t.priority)}t(n.size)},s=e=>{let i=e.target;if(!ol(i))return;if(i.value===``){n.has(i)&&o(i);return}let s=a(i),c=s&&al(s.target);if(!s||!c)return;let l=r.get(s.target)??/* @__PURE__ */ new Map;l.has(s.property)||(l.set(s.property,{value:c.getPropertyValue(s.property),priority:c.getPropertyPriority(s.property)}),r.set(s.target,l)),c.setProperty(s.property,`${i.value}${s.unit}`),n.delete(i),n.set(i,s),t(n.size)};return e.addEventListener(`input`,s,!0),{edits:()=>{let t=[];for(let{control:r,target:a,property:o,unit:s}of n.values()){let n=i(e,r),c=i(e,a);n!==null&&c!==null&&r.value!==``&&t.push({index:n,value:r.value,unit:s,target:c,property:o})}return nl(t)},reset:()=>{for(let e of n.keys())e.value=e.defaultValue;for(let[e,t]of r){let n=al(e);for(let[e,{value:r,priority:i}]of t)r===``?n?.removeProperty(e):n?.setProperty(e,r,i)}n.clear(),r.clear(),t(0)},settle:()=>{for(let e of n.keys())e.setAttribute(`value`,e.value);n.clear(),r.clear(),t(0)},detach:()=>e.removeEventListener(`input`,s,!0)}}function al(e){let t=e.style;return t&&typeof t.setProperty==`function`?t:null}function ol(e){return e!==null&&`hasAttribute`in e&&e.hasAttribute(`data-binds`)&&`value`in e&&`defaultValue`in e}function sl(e){return[...e.querySelectorAll(`[${$c}]`)].map((t,n)=>{let r=t.getAttribute(`data-binds`)??``,i=el(r),a=i&&tl(i.property)?cl(e,i.selector):null,o=i?tl(i.property)?a?`${i.selector} ${i.property}`:`${i.selector}, no match`:`${i.property}, not a custom property`:`${r.trim()||`data-binds`}, no property`;return{key:n,control:ll(t),target:a?ll(a):null,label:o}})}function cl(e,t){try{return e.querySelector(t)}catch{return null}}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)}}let ul=/* @__PURE__ */ new Map,dl={controls:(e,{id:t,push:n,onClose:r})=>{let i=il(document,e=>n(e));return ul.set(t,i),r(()=>{i.reset(),i.detach(),ul.delete(t)}),!0},"controls-act":({controls:e,act:t})=>{let n=ul.get(e);return n?(t===`reset`?n.reset():n.settle(),!0):!1},"controls-edits":({controls:e})=>{let t=ul.get(e),n=o(document),r=t?.edits()??[];return n===null||r.length===0?null:{hash:n,edits:r}},bindings:(e,{push:t,onClose:n})=>{let r=document.documentElement;if(!r)return[];let i=()=>t(sl(document)),a=new ResizeObserver(i);return a.observe(r),addEventListener(`scroll`,i,!0),n(()=>{a.disconnect(),removeEventListener(`scroll`,i,!0)}),sl(document)}},fl=/* @__PURE__ */ new Set([`html`,`body`]);function pl({x:e,y:t},n){return document.elementsFromPoint(e,t).find(e=>!(n&&s(e)))??null}function ml(e,t){let n=[];for(let r=pl(e,t);r&&!fl.has(r.localName);r=r.parentElement){if(c(r))continue;let e=i(document,r);e!==null&&n.push({index:e,tag:r.localName})}return n}let hl=/* @__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 gl(e){if(e.localName===`body`)return!0;if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||hl.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 _l(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 vl(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 yl(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 bl(e){let t=document.body;if(!t)return null;let n=pl(e,!0);for(n&&t.contains(n)||(n=t);n&&!gl(n);)n=n.parentElement;let r=n&&i(document,n);if(!n||r==null)return null;let a=getComputedStyle(n),{row:o,reverse:s,flow:c}=_l(a),l=[...n.children].flatMap(e=>{let t=i(document,e),n=e.getBoundingClientRect();return t!==null&&(n.width>0||n.height>0)?[{index:t,box:n}]:[]}),u=l.findIndex(({box:t})=>yl(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:r,before:f?.index??null,row:o,flow:c,origin:vl(n),room:Math.max(0,n.clientWidth-p(`left`)-p(`right`)),line:xl(n.getBoundingClientRect(),a,o,s,{after:d?.box,ahead:f?.box})}}function xl(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 Sl(e,t){let n=bl(e),r=a(document,t),o=n?a(document,n.parent):null;if(!n||!r||!o||r.contains(o))return null;let s=r.nextElementSibling;return o===r.parentElement&&(n.before===t||n.before===(s?i(document,s):null))?null:n}function Cl(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 wl={"pick-at":({at:e,unlocked:t})=>({hash:o(document),chain:ml(e,t===!0)}),"gap-at":({at:e,carried:t})=>{let n=o(document),r=t===void 0?bl(e):Sl(e,t);return n&&r?{hash:n,gap:r}:null},paint:({fill:e})=>Cl(e)};function Tl(e,t){e.readyState===`loading`?e.addEventListener(`DOMContentLoaded`,t,{once:!0}):t()}function El(e){return o(document)===e.hash?a(document,e.index):null}let Dl=[`Shift`,`Meta`,`Alt`,`Control`],Ol=typeof navigator==`object`?navigator.platform:``,kl=/Mac|iPod|iPhone|iPad/.test(Ol)?`Meta`:`Control`,Al=Ol===`Win32`?[`Control`,`Alt`]:[`Alt`];function jl(e){return!!(e.key&&e.code&&e.getModifierState)}function Ml(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches(`[contenteditable],input,select,textarea`)}function Nl(e,t){return typeof e.getModifierState==`function`?e.getModifierState(t)||Al.includes(t)&&e.getModifierState(`AltGraph`):!1}function Pl(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`?kl:n,t?o.push(n):a.push(n)}return[a,o,i]})}function Fl(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=>!Nl(e,t))||Dl.find(a=>!t.includes(a)&&!n.includes(a)&&r!==a&&Nl(e,a)&&!(i&&Al.includes(a))))}function Il(e,t={}){let n=t.timeout??1e3,r=t.ignore??Ml,i=Object.keys(e).map(t=>[t,Pl(t),e[t]]),a=/* @__PURE__ */ new Map,o=null;return e=>{if(!jl(e)||r(e))return;let t=[];for(let[n,r,o]of i){let[i,...s]=a.get(n)||r;if(!Fl(e,i))Nl(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 Ll(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 Rl(e){return(e.code===`Space`||e.key===`Enter`)&&e.target instanceof Element&&e.target.closest(`button`)!==null}function zl(e,{keepTyping:t,keepButtons:n}){if(e.isComposing||e.defaultPrevented||n&&Rl(e))return!0;if(!t)return!1;let r=e.target;return r instanceof HTMLElement&&(r.isContentEditable||r.matches(`[contenteditable],input,select,textarea`))}let Bl={keys:({keys:e,...t},{push:n,onClose:r})=>(r(Ll(window,Object.fromEntries(e.map(e=>[e,t=>{t.preventDefault(),n({key:e,repeat:t.repeat})}])),{ignore:e=>zl(e,t)})),!0),"focus-keys":(e,{push:t,onClose:n})=>{let r=()=>t(!0);return window.addEventListener(`keydown`,r,!0),n(()=>window.removeEventListener(`keydown`,r,!0)),!0}};function Vl(e){return Math.round(parseFloat(e)*100)/100}function Hl(e,t){let n=e.parentElement,r=n?getComputedStyle(n):null,i=e instanceof HTMLElement?e:null,a=e=>Vl(e)||0;return{flow:ac(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?ac(r.display,r.flexDirection,r.flexWrap):`block`,parentAlignItems:r?.alignItems??`normal`,width:Math.round(i?.offsetWidth??0),height:Math.round(i?.offsetHeight??0)}}function Ul(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:Vl(t.fontSize),fontWeight:Number(t.fontWeight),lineHeight:t.lineHeight===`normal`?null:Vl(t.lineHeight),letterSpacing:t.letterSpacing===`normal`?0:Vl(t.letterSpacing),textAlign:Zl(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])?Vl(t.borderTopWidth):null,holdsText:n.trim()!==``||Wl(e,n),textOnly:e.childElementCount===0&&(n.trim()!==``||Wl(e,n)),text:n,keepsBreaks:t.whiteSpace!==`normal`&&t.whiteSpace!==`nowrap`,rotation:{degrees:sc(t.rotate),scale:cc(t.scale),own:ql(e),translated:lc(t.transform),transform:Jl(e,t)},placement:Gl(e,t),layout:Hl(e,t),inline:Xl(e),step:{step:e.getAttribute(q.step),effect:e.getAttribute(q.effect),start:e.getAttribute(q.start)}}}function Wl(e,t){return e.localName===`p`&&e.childElementCount===0&&t.trim()===``}function Gl(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=Kl(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 Kl(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 ql(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:sc(a.rotate)}:{},...r?{scale:cc(a.scale)}:{}};return i===null?t.removeAttribute(`style`):t.setAttribute(`style`,i),o}function Jl(e,t){let n=e instanceof HTMLElement?e.style.getPropertyValue(`transform`):``;return{own:n,ruled:n===``&&t.transform!==`none`,reanchors:t.transform===`none`&&Yl(e,t)}}function Yl(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 Xl(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 Zl(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}let Ql={"live-element":({hash:e,indexes:t})=>{if(o(document)!==e)return null;let n=t.flatMap(e=>{let t=a(document,e);return t?[Ul(t)]:[]});return n.length===t.length?n:null},"live-body":()=>{let e=o(document),t=document.body?i(document,document.body):null;return e!==null&&t!==null?{index:t,hash:e}:null}},$l=/* @__PURE__ */ new Set([`html`,`body`]),eu=/* @__PURE__ */ new Set([`img`,`video`,`model-viewer`]);function tu(e){if(!e||$l.has(e.localName))return null;if(eu.has(e.localName))return`media`;let t=(e.textContent??``).trim()!==``;return e.childElementCount>0?t&&[...e.children].every(nu)?`text`:`container`:t?`text`:e.localName===`div`?`box`:null}function nu(e){let t=getComputedStyle(e).display;return t===`inline`||t.startsWith(`inline-`)}function ru(e){let t=tu(e),n=getComputedStyle(e);return!t||sc(n.rotate)!==0||n.transform.startsWith(`matrix3d(`)||(t===`text`||t===`container`)&&(n.display===`inline`||n.display===`contents`)?null:{kind:t,natural:su(e),hugsHeight:t===`text`&&!cu(e),inset:ou(n),sizing:t===`container`?au(e,n):null}}let iu=/* @__PURE__ */ new Set([`vertical`,`horizontal`,`wrap`]);function au(e,t){let n=Hl(e,t);return{layout:n,fills:iu.has(n.parent)&&(parseFloat(t.flexGrow)||0)>0}}function ou(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 su(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 cu(e){let t=e instanceof HTMLElement?e.style.height:``;return t!==``&&t!==`auto`}function lu(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 uu(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 du(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 fu(e){let t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function pu(e,t){if(o(document)!==e)return null;let n=t.flatMap(e=>{let t=a(document,e);return t?[t]:[]});return n.length===t.length?n:null}function mu(e,t){return t.map((n,r)=>({index:e[r]??0,box:du(n),read:ru(n),placed:lu(n,[]),nested:t.some(e=>e!==n&&e.contains(n)),margin:uu(n),...s(n)?{locked:!0}:{},...n.getClientRects().length===0?{unboxed:!0}:{}}))}function hu(){let e=document.body;if(!e)return[];let t=innerWidth,n=innerHeight,i=[],a=[];return r(document).forEach((r,o)=>{if(!e.contains(r)||r===e||a.some(e=>e.contains(r))||getComputedStyle(r).position===`fixed`)return;let c=r.getBoundingClientRect();(c.width!==0||c.height!==0)&&(c.left<-1||c.top<-1||c.right>t+1||c.bottom>n+1)&&!gu(r,e)&&(a.push(r),i.push({index:o,box:du(r),placed:lu(r,[]),...s(r)?{locked:!0}:{}}))}),i}function gu(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 _u(){let e=o(document);return e===null?null:{hash:e,ghosts:hu()}}function vu(e){return e.flatMap(e=>{let t=a(document,e)?.getBoundingClientRect();return t?[{index:e,right:t.right,top:t.top}]:[]})}function yu(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 bu={"element-boxes":({hash:e,indexes:t})=>o(document)===e?t.flatMap(e=>{let t=a(document,e),n=t?fu(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=pu(e,t);return i?(r(yu(i,()=>n(mu(t,i)),i.length>1)),mu(t,i)):null},overflow:(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(_u())}))},a=new MutationObserver(i);return a.observe(document,{attributes:!0,attributeFilter:[`style`],subtree:!0}),addEventListener(`resize`,i),document.fonts.addEventListener(`loadingdone`,i),document.addEventListener(`load`,i,!0),n(()=>{cancelAnimationFrame(r),a.disconnect(),removeEventListener(`resize`,i),document.fonts.removeEventListener(`loadingdone`,i),document.removeEventListener(`load`,i,!0)}),_u()},pins:({indexes:e},{push:t,onClose:n})=>(n(yu(e.flatMap(e=>{let t=a(document,e);return t?[t]:[]}),()=>t(vu(e)),!1)),vu(e))},xu=[`play`,`pause`,`timeupdate`,`durationchange`,`loadedmetadata`,`volumechange`,`seeked`,`error`,`emptied`],Su=[`controls`,`autoplay`,`loop`,`muted`];function Cu(e){let t=El(e);return t instanceof HTMLMediaElement?t:null}function wu(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 Tu(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 Eu=`frameboard-media-strip`;function Du(){if(document.getElementById(Eu))return()=>{};let e=document.createElement(`style`);return e.id=Eu,e.setAttribute(t,``),e.textContent=`video::-webkit-media-controls { display: none !important }`,document.head?.append(e),()=>e.remove()}let Ou={media:(e,{push:t,onClose:n})=>{let r=Cu(e);if(!r)return null;let i=()=>t(wu(r));for(let e of xu)r.addEventListener(e,i);let a=new MutationObserver(i);return a.observe(r,{attributeFilter:[...Su]}),n(()=>{for(let e of xu)r.removeEventListener(e,i);a.disconnect()}),wu(r)},"media-act":({act:e,...t})=>{let n=Cu(t);return n?(Tu(n,e),!0):!1},"hide-strips":(e,{onClose:t})=>(t(Du()),!0)},ku=[`load`,`error`,`camera-change`];function Au(e){let t=El(e);return t instanceof HTMLElement&&t.localName===`model-viewer`?t:null}function ju(e){let t=Math.round(e*180/Math.PI)%360;return t>180?t-360:t<=-180?t+360:t}function Mu(e){let t=e.loaded===!0,n=t?e.getCameraOrbit?.():void 0,r={};for(let t of Ec)r[t]=e.getAttribute(t);return{src:e.getAttribute(`src`)??``,loaded:t,clips:t?[...e.availableAnimations??[]]:[],orbit:n?{theta:ju(n.theta),phi:ju(n.phi)}:null,staged:r}}function Nu(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 Pu={model:(e,{push:t,onClose:n})=>{let r=Au(e);if(!r)return null;let i=Mu(r),a=JSON.stringify(i),o=()=>{let e=Mu(r),n=JSON.stringify(e);n!==a&&(a=n,t(e))};for(let e of ku)r.addEventListener(e,o);let s=new MutationObserver(o);return s.observe(r,{attributeFilter:[`src`,...Ec]}),n(()=>{for(let e of ku)r.removeEventListener(e,o);s.disconnect()}),i},"model-stage":({name:e,value:t,...n})=>{let r=Au(n);return r?(Nu(r,e,t),!0):!1}};async function Fu(e,t){let n=e.performance.now()+t,r=()=>new Promise(t=>e.requestAnimationFrame(()=>t())),i=e=>typeof e==`number`&&Number.isFinite(e)?Math.round(e*1e3):null,a=()=>{let t=e.__hf,n=i(t?.duration);if(typeof t?.seek==`function`&&n!==null&&n>0)return{source:`hf`,duration:n};let r=e.__timelines,a=Object.values(r??{}).filter(e=>typeof e?.seek==`function`);if(a.length>0){let e=a.map(e=>i(typeof e.duration==`function`?e.duration.call(e):e.duration)).filter(e=>e!==null);return{source:`timelines`,duration:e.length===0?null:Math.max(...e)}}let o=e.document.getAnimations();if(o.length>0){let e=o.map(e=>e.effect?.getComputedTiming().endTime).filter(e=>typeof e==`number`&&Number.isFinite(e));return{source:`css`,duration:e.length===0?null:Math.round(Math.max(...e))}}let s=[...e.document.querySelectorAll(`model-viewer`)].map(e=>e).filter(e=>(e.availableAnimations?.length??0)>0);if(s.length>0){let e=s.map(e=>i(e.duration)).filter(e=>e!==null);return{source:`model`,duration:e.length===0?null:Math.max(...e)}}return null};for(await r();;){let t=a();if(t!==null||e.performance.now()>=n)return t;await r()}}async function Iu(e,{motion:t,ms:n}){let r=t.duration===null?n:Math.min(Math.max(n,0),t.duration);if(t.source===`hf`)await e.__hf.seek(r/1e3);else if(t.source===`timelines`){let t=e.__timelines;for(let e of Object.values(t))typeof e?.seek==`function`&&(e.pause?.(),await e.seek(r/1e3))}else if(t.source===`css`)for(let t of e.document.getAnimations())t.pause(),t.currentTime=r;for(let t of e.document.querySelectorAll(`model-viewer`)){let e=t;typeof e.pause==`function`&&(e.pause(),e.currentTime=r/1e3)}return await new Promise(t=>e.requestAnimationFrame(()=>e.requestAnimationFrame(()=>t()))),r}let Lu=1e4;async function Ru(e=Lu){let t=await Fu(window,e);return t===null?null:{motion:t,span:t.duration??zu()}}function zu(){let e=document.getAnimations().map(e=>{let t=e.effect?.getComputedTiming(),n=Number(t?.duration),r=t?.delay??0;return Number.isFinite(n)?r+n:0});return Math.round(Math.max(0,...e))}function Bu(e){let t=null,n=null,r=async()=>{for(;t!==null;){let n=t;t=null,await Iu(window,{motion:e,ms:n})}n=null};return e=>(t=e,n??=r(),n)}function Vu(e){if(e.source===`css`)for(let e of document.getAnimations())e.play();else location.reload()}function Hu({motion:e,span:t}){let n=0;if(e.source===`css`){let e=document.getAnimations().map(e=>Number(e.currentTime)).filter(e=>Number.isFinite(e));n=Math.max(0,...e)}else if(e.source===`timelines`){let e=window.__timelines,t=Object.values(e??{}).find(e=>typeof e?.time==`function`),r=t?Number(t.time.call(t)):0;n=Number.isFinite(r)?r*1e3:0}return Math.round(t<=0?n:e.duration===null?n%t:Math.min(n,t))}let Uu=/* @__PURE__ */ new Map;function Wu(e){return{motion:(t,n)=>Ku(e,n),"motion-seek":({motion:e,at:t})=>{let n=Uu.get(e);return n?(n.seek(t),!0):!1},"motion-release":({motion:e})=>{let t=Uu.get(e);return t?(Vu(t.found.motion),!0):!1},"motion-moment":e=>Hu(e)}}let Gu=Wu(Lu);function Ku(e,{id:t,push:n,onClose:r}){let i=!1;return Ru(e).catch(()=>null).then(e=>{i||(e&&Uu.set(t,{found:e,seek:Bu(e.motion)}),n(e))}),r(()=>{i=!0,Uu.delete(t)}),!0}function qu(e,n){if(!document.head)return!1;let r=document.createElement(`style`);return r.setAttribute(t,``),r.textContent=e,document.head.append(r),n(()=>r.remove()),!0}let Ju={"hold-animations":(e,{onClose:t})=>qu(`*, *::before, *::after { animation-play-state: paused !important }`,t),"hide-controls":(e,{onClose:t})=>qu(rl,t),"pointer-move":(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(null)}))};return addEventListener(`pointermove`,i),n(()=>{removeEventListener(`pointermove`,i),cancelAnimationFrame(r)}),!0}},Yu=/* @__PURE__ */ new Map;function Xu(e,t,n){let r=`${e}:${t}`,i=a(document,e),o=i instanceof HTMLElement?i:null,s=Yu.get(r);if(n===null){if(Yu.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&&Yu.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 Zu(e){return{"preview-style":({index:e,property:t,value:n})=>(Xu(e,t,n),null),"keep-previews":()=>(Yu.clear(),null),restamp:({hash:n})=>{let r=document.querySelector(`style[${t}]`);return r?(r.setAttribute(`data-hash`,n),e(),!0):!1}}}function Qu(e){return r(e).some(e=>e.matches(`a[href], button, input, select, textarea, summary, [onclick], [tabindex], [contenteditable], video[controls], audio[controls], script`))}let $u={"takes-clicks":()=>Qu(document)},$=`data-frameboard-step`,ed=`--frameboard-step-delay`,td=`frameboard-present-steps`,nd=`
116
116
  [${$}='hidden'] { visibility: hidden !important }
117
117
 
118
118
  @keyframes frameboard-step-appear { from { visibility: hidden } to { visibility: visible } }
@@ -126,7 +126,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
126
126
  animation-duration: 400ms;
127
127
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
128
128
  animation-fill-mode: both;
129
- animation-delay: var(${Yu}, 0ms);
129
+ animation-delay: var(${ed}, 0ms);
130
130
  }
131
131
  [${$}='enter'][${$}-effect='appear'] { animation-name: frameboard-step-appear; animation-duration: 1ms }
132
132
  [${$}='enter'][${$}-effect='fade'] { animation-name: frameboard-step-fade }
@@ -134,14 +134,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
134
134
  [${$}='enter'][${$}-effect='wipe'] { animation-name: frameboard-step-wipe }
135
135
  [${$}='enter'][${$}-effect='zoom'] { animation-name: frameboard-step-zoom }
136
136
  }
137
- `;function Qu(e){return e instanceof HTMLElement||e instanceof SVGElement?e.style:void 0}function $u(e){let t=e.getAttribute(q.step)?.trim()??``;if(!/^\d+$/.test(t))return null;let n=Number(t);return n>0?n:null}function ed(e){let t=e.getAttribute(q.effect);return Js.find(e=>e===t)??`appear`}function td(e){let t=e.getAttribute(q.start);return Ys.find(e=>e===t)??`click`}function nd(e){return e===`appear`?0:400}function rd(e){let t=[...e.querySelectorAll(`[${q.step}]`)].map(e=>({element:e,number:$u(e)})).filter(e=>e.number!==null).sort((e,t)=>e.number-t.number),n=[],r=null;for(let e of t){let t=td(e.element),i=ed(e.element),a=n.at(-1),o=a?.at(-1);if(a&&o&&(e.number===r||t!==`click`)){let n=t===`after`?o.delayMs+nd(o.effect):o.delayMs;a.push({element:e.element,effect:i,delayMs:n})}else n.push([{element:e.element,effect:i,delayMs:0}]);r=e.number}return n}let id=`[${q.step}]`;function ad(e){return e.nodeType===1&&(e.matches(id)||e.querySelector(id)!==null)}function od(e){return e.some(e=>e.type===`attributes`||[...e.addedNodes,...e.removedNodes].some(ad))}function sd(e,t,n,r=null){cd(e);for(let[e,i]of t.entries())for(let{element:t,effect:a,delayMs:o}of i){let i=e>=n?`hidden`:e===r?`enter`:`shown`;t.setAttribute($,i),t.setAttribute(`${$}-effect`,a),Qu(t)?.setProperty(Yu,`${o}ms`)}}function cd(t){if(t.getElementById(Xu))return;let n=t.createElement(`style`);n.id=Xu,n.setAttribute(e,``),n.textContent=Zu,t.head?.append(n)}function ld(e,t){let n=e.ownerDocument;cd(n);let r=t===`appear`;e.setAttribute($,r?`hidden`:`enter`),e.setAttribute(`${$}-effect`,t);let i=!1,a=()=>{i||(i=!0,clearTimeout(o),e.removeAttribute($),e.removeAttribute(`${$}-effect`),n.querySelector(`[${$}]`)||n.getElementById(Xu)?.remove())},o=setTimeout(a,r?200:400);return a}let ud=Object.values(q),dd=/* @__PURE__ */ new Map,fd={steps:({shown:e},{id:t,push:n,onClose:r})=>{let i={shown:e,entering:null,groups:rd(document)};sd(document,i.groups,i.shown),dd.set(t,i);let a=new MutationObserver(e=>{od(e)&&(i.groups=rd(document),sd(document,i.groups,i.shown,i.entering),n(i.groups.length))});return a.observe(document.documentElement,{subtree:!0,childList:!0,attributeFilter:ud}),r(()=>{a.disconnect(),dd.delete(t)}),i.groups.length},"steps-show":({steps:e,shown:t,entering:n})=>{let r=dd.get(e);return r?(r.shown=t,r.entering=n,sd(document,r.groups,t,n),!0):!1},"step-preview":({index:e,effect:t},{onClose:n})=>{let r=i(document,e);return r?(n(ld(r,t)),!0):!1}},pd=/\r\n|\r/g,md=/\n+$/,hd=/[\t\n\f\r ]+/g;function gd(e){let{whiteSpace:t}=getComputedStyle(e);return t===`normal`||t===`nowrap`}function _d(e,t,n,r=!1){if(!(e instanceof HTMLElement))return null;if(e.childElementCount>0){let r=n&&bd(e,n);return r?xd(e,r,t):null}let i=(e.textContent??``).trim()===``;if(i&&!r)return null;let a=e,o=a.textContent??``,s=gd(a),c=s?o.replace(hd,` `).trim():o,l=a.style.whiteSpace,u=a.style.minHeight;c!==o&&(a.textContent=c),i&&(a.style.minHeight=`1lh`);let d=!0,f=()=>{d=!1,i&&(a.style.minHeight=u),a.removeAttribute(`contenteditable`),a.removeAttribute(Oc),a.removeEventListener(`keydown`,ee),a.removeEventListener(`paste`,v),a.removeEventListener(`blur`,_),window.removeEventListener(`pagehide`,g)},p=()=>{a.textContent=o,a.style.whiteSpace=l},m=()=>{a.isConnected&&p()},h=()=>{d&&(f(),p())};function g(){f(),t({kind:`closed`},m)}function _(){if(!d)return;f();let e=(a.textContent??``).replace(pd,`
138
- `).replace(md,``);e===c.replace(md,``)?(p(),t({kind:`closed`},m)):(a.textContent=e,t({kind:`commit`,text:e,breaks:s&&e.includes(`
139
- `)},m))}function ee(e){e.key===`Enter`&&(e.preventDefault(),te(`
140
- `)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function v(e){e.preventDefault(),te((e.clipboardData?.getData(`text/plain`)??``).replace(pd,`
141
- `))}let te=e=>{let t=getSelection()?.getRangeAt(0);if(!t||!a.contains(t.commonAncestorContainer))return;s&&e.includes(`
137
+ `;function rd(e){return e instanceof HTMLElement||e instanceof SVGElement?e.style:void 0}function id(e){let t=e.getAttribute(q.step)?.trim()??``;if(!/^\d+$/.test(t))return null;let n=Number(t);return n>0?n:null}function ad(e){let t=e.getAttribute(q.effect);return Zs.find(e=>e===t)??`appear`}function od(e){let t=e.getAttribute(q.start);return Qs.find(e=>e===t)??`click`}function sd(e){return e===`appear`?0:400}function cd(e){let t=[...e.querySelectorAll(`[${q.step}]`)].map(e=>({element:e,number:id(e)})).filter(e=>e.number!==null).sort((e,t)=>e.number-t.number),n=[],r=null;for(let e of t){let t=od(e.element),i=ad(e.element),a=n.at(-1),o=a?.at(-1);if(a&&o&&(e.number===r||t!==`click`)){let n=t===`after`?o.delayMs+sd(o.effect):o.delayMs;a.push({element:e.element,effect:i,delayMs:n})}else n.push([{element:e.element,effect:i,delayMs:0}]);r=e.number}return n}let ld=`[${q.step}]`;function ud(e){return e.nodeType===1&&(e.matches(ld)||e.querySelector(ld)!==null)}function dd(e){return e.some(e=>e.type===`attributes`||[...e.addedNodes,...e.removedNodes].some(ud))}function fd(e,t,n,r=null){pd(e);for(let[e,i]of t.entries())for(let{element:t,effect:a,delayMs:o}of i){let i=e>=n?`hidden`:e===r?`enter`:`shown`;t.setAttribute($,i),t.setAttribute(`${$}-effect`,a),rd(t)?.setProperty(ed,`${o}ms`)}}function pd(e){if(e.getElementById(td))return;let n=e.createElement(`style`);n.id=td,n.setAttribute(t,``),n.textContent=nd,e.head?.append(n)}function md(e,t){let n=e.ownerDocument;pd(n);let r=t===`appear`;e.setAttribute($,r?`hidden`:`enter`),e.setAttribute(`${$}-effect`,t);let i=!1,a=()=>{i||(i=!0,clearTimeout(o),e.removeAttribute($),e.removeAttribute(`${$}-effect`),n.querySelector(`[${$}]`)||n.getElementById(td)?.remove())},o=setTimeout(a,r?200:400);return a}let hd=Object.values(q),gd=/* @__PURE__ */ new Map,_d={steps:({shown:e},{id:t,push:n,onClose:r})=>{let i={shown:e,entering:null,groups:cd(document)};fd(document,i.groups,i.shown),gd.set(t,i);let a=new MutationObserver(e=>{dd(e)&&(i.groups=cd(document),fd(document,i.groups,i.shown,i.entering),n(i.groups.length))});return a.observe(document.documentElement,{subtree:!0,childList:!0,attributeFilter:hd}),r(()=>{a.disconnect(),gd.delete(t)}),i.groups.length},"steps-show":({steps:e,shown:t,entering:n})=>{let r=gd.get(e);return r?(r.shown=t,r.entering=n,fd(document,r.groups,t,n),!0):!1},"step-preview":({index:e,effect:t},{onClose:n})=>{let r=a(document,e);return r?(n(md(r,t)),!0):!1}},vd=/\r\n|\r/g,yd=/\n+$/,bd=/[\t\n\f\r ]+/g;function xd(e){let{whiteSpace:t}=getComputedStyle(e);return t===`normal`||t===`nowrap`}function Sd(e,t,n,r=!1){if(!(e instanceof HTMLElement))return null;if(e.childElementCount>0){let r=n&&Td(e,n);return r?Ed(e,r,t):null}let i=(e.textContent??``).trim()===``;if(i&&!r)return null;let a=e,o=a.textContent??``,s=xd(a),c=s?o.replace(bd,` `).trim():o,l=a.style.whiteSpace,u=a.style.minHeight;c!==o&&(a.textContent=c),i&&(a.style.minHeight=`1lh`);let d=!0,f=()=>{d=!1,i&&(a.style.minHeight=u),a.removeAttribute(`contenteditable`),a.removeAttribute(jc),a.removeEventListener(`keydown`,te),a.removeEventListener(`paste`,_),a.removeEventListener(`blur`,g),window.removeEventListener(`pagehide`,ee)},p=()=>{a.textContent=o,a.style.whiteSpace=l},m=()=>{a.isConnected&&p()},h=()=>{d&&(f(),p())};function ee(){f(),t({kind:`closed`},m)}function g(){if(!d)return;f();let e=(a.textContent??``).replace(vd,`
138
+ `).replace(yd,``);e===c.replace(yd,``)?(p(),t({kind:`closed`},m)):(a.textContent=e,t({kind:`commit`,text:e,breaks:s&&e.includes(`
139
+ `)},m))}function te(e){e.key===`Enter`&&(e.preventDefault(),ne(`
140
+ `)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),g())}function _(e){e.preventDefault(),ne((e.clipboardData?.getData(`text/plain`)??``).replace(vd,`
141
+ `))}let ne=e=>{let t=getSelection()?.getRangeAt(0);if(!t||!a.contains(t.commonAncestorContainer))return;s&&e.includes(`
142
142
  `)&&(a.style.whiteSpace=`pre-line`);let n=(e,t)=>{let n=document.createRange();return n.selectNodeContents(a),n.setEnd(e,t),n.toString().length},r=n(t.startContainer,t.startOffset),i=n(t.endContainer,t.endOffset),o=a.textContent??``,c=o.slice(i),l=c===``&&e.endsWith(`
143
143
  `)?`
144
- `:``;a.textContent=o.slice(0,r)+e+(c||l);let u=document.createRange();u.setStart(a.firstChild??a,r+e.length),u.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(u)},y=({x:e,y:t})=>{let n=vd(e,t);return!d||!n||!a.contains(n.node)?!1:(yd(n.node,n.offset),!0)};a.setAttribute(`contenteditable`,`plaintext-only`),a.setAttribute(Oc,``),a.addEventListener(`keydown`,ee),a.addEventListener(`paste`,v),a.addEventListener(`blur`,_),window.addEventListener(`pagehide`,g),a.focus();let ne=document.createRange();ne.selectNodeContents(a);let re=getSelection();return re?.removeAllRanges(),re?.addRange(ne),{cancel:h,caretAt:y}}function vd(e,t){let n=document.caretPositionFromPoint?.(e,t);if(n)return{node:n.offsetNode,offset:n.offset};let r=document.caretRangeFromPoint?.(e,t);return r?{node:r.startContainer,offset:r.startOffset}:null}function yd(e,t){let n=document.createRange();n.setStart(e,t),n.collapse(!0);let r=getSelection();r?.removeAllRanges(),r?.addRange(n)}function bd(e,{x:t,y:n}){let r=vd(t,n)?.node;return r instanceof Text&&r.parentNode===e&&r.data.trim()!==``?r:null}function xd(e,t,n){let r=[...e.childNodes].filter(e=>e instanceof Text).indexOf(t),i=t.data,a=gd(e),o=a?i.replace(hd,` `):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(Oc);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(pd,`
145
- `);e===o?(p(),n({kind:`closed`},m)):n({kind:`commit`,text:e,breaks:!1,run:r},m)}let ee=e=>a?e.replace(hd,` `):e.replace(pd,`
146
- `);function v(e){e.key===`Enter`&&(e.preventDefault(),a||ie(ne(),`
147
- `)),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)},ae=({x:e,y:n})=>{let r=vd(e,n),i=r&&re(r.node,r.offset);return!u||i==null?!1:(yd(t,i),!0)};for(let{child:e}of s)e.setAttribute(`contenteditable`,`false`);e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(Oc,``),e.addEventListener(`keydown`,v),e.addEventListener(`paste`,te),e.addEventListener(`beforeinput`,y),e.addEventListener(`blur`,_),window.addEventListener(`pagehide`,g),e.focus();let oe=document.createRange();oe.selectNodeContents(t);let b=getSelection();return b?.removeAllRanges(),b?.addRange(oe),{cancel:h,caretAt:ae}}document.currentScript?.remove();let Sd=window.parent,Cd=window.origin,wd=crypto.randomUUID(),Td=/* @__PURE__ */ new Map,Ed=/* @__PURE__ */ new Map,Dd=/* @__PURE__ */ new Map,Od={...qc,...sl,...yl,...Fl,...ql,...hu,...Cu,...ku,...Bu,...Uu,...Ju,...fd,"element-box":e=>{let t=xl(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=xl(e),a=!1,o=i&&_d(i,(e,r)=>{a=!0,Dd.delete(t),e.kind===`commit`&&Ed.set(t,r),n(e)},e.at,e.empty);return o?(Dd.set(t,o.caretAt),r(()=>{Dd.delete(t),a||o.cancel()}),!0):!1},"text-caret":({edit:e,at:t})=>Dd.get(e)?.(t)??!1,"text-written":({edit:e,written:t})=>{let n=Ed.get(e);return Ed.delete(e),t||n?.(),null},...Ku(()=>Ad())};function kd(e,t){Sd.postMessage(e,t)}function Ad(e=a(document)){kd({tag:X,kind:`shown`,page:wd,hash:e},`*`)}function jd(e,t,n,r){let i=Od[e];if(!i)throw Error(`no handler for ${e}`);let a=Bc(e,t);if(a===zc)throw Error(`not the arguments ${e} takes`);return i(a,{id:n,push:e=>kd({tag:X,kind:`push`,id:n,value:e},r),onClose:e=>Td.set(n,e)})}Sd!==window&&(bl(document,()=>Ad()),window.addEventListener(`pagehide`,()=>Ad(null)),window.addEventListener(`message`,e=>{if(e.source!==Sd)return;let{origin:t}=e;if(!Uc(t,Cd))return;let n=Ac(e,t);if(n?.kind===`close`&&(Td.get(n.id)?.(),Td.delete(n.id)),n?.kind!==`request`)return;let{id:r}=n;try{let e=jd(n.op,n.args,r,t);kd({tag:X,kind:`reply`,id:r,ok:!0,value:e},t)}catch(e){let n=e instanceof Error?e.message:String(e);kd({tag:X,kind:`reply`,id:r,ok:!1,error:n},t)}}))})();
144
+ `:``;a.textContent=o.slice(0,r)+e+(c||l);let u=document.createRange();u.setStart(a.firstChild??a,r+e.length),u.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(u)},re=({x:e,y:t})=>{let n=Cd(e,t);return!d||!n||!a.contains(n.node)?!1:(wd(n.node,n.offset),!0)};a.setAttribute(`contenteditable`,`plaintext-only`),a.setAttribute(jc,``),a.addEventListener(`keydown`,te),a.addEventListener(`paste`,_),a.addEventListener(`blur`,g),window.addEventListener(`pagehide`,ee),a.focus();let v=document.createRange();v.selectNodeContents(a);let y=getSelection();return y?.removeAllRanges(),y?.addRange(v),{cancel:h,caretAt:re}}function Cd(e,t){let n=document.caretPositionFromPoint?.(e,t);if(n)return{node:n.offsetNode,offset:n.offset};let r=document.caretRangeFromPoint?.(e,t);return r?{node:r.startContainer,offset:r.startOffset}:null}function wd(e,t){let n=document.createRange();n.setStart(e,t),n.collapse(!0);let r=getSelection();r?.removeAllRanges(),r?.addRange(n)}function Td(e,{x:t,y:n}){let r=Cd(t,n)?.node;return r instanceof Text&&r.parentNode===e&&r.data.trim()!==``?r:null}function Ed(e,t,n){let r=[...e.childNodes].filter(e=>e instanceof Text).indexOf(t),i=t.data,a=xd(e),o=a?i.replace(bd,` `):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(jc);for(let{child:e,editable:t}of s)t===null?e.removeAttribute(`contenteditable`):e.setAttribute(`contenteditable`,t);e.removeEventListener(`keydown`,_),e.removeEventListener(`paste`,ne),e.removeEventListener(`beforeinput`,re),e.removeEventListener(`blur`,g),window.removeEventListener(`pagehide`,ee)},p=()=>{t.data=i},m=()=>{t.isConnected&&p()},h=()=>{u&&(f(),p())};function ee(){f(),n({kind:`closed`},m)}function g(){if(!u)return;f();let e=t.data.replace(vd,`
145
+ `);e===o?(p(),n({kind:`closed`},m)):n({kind:`commit`,text:e,breaks:!1,run:r},m)}let te=e=>a?e.replace(bd,` `):e.replace(vd,`
146
+ `);function _(e){e.key===`Enter`&&(e.preventDefault(),a||b(v(),`
147
+ `)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),g())}function ne(e){e.preventDefault(),b(v(),te(e.clipboardData?.getData(`text/plain`)??``))}function re(e){if(!e.cancelable)return;e.preventDefault();let[t=v()]=e.getTargetRanges();e.inputType.startsWith(`delete`)?b(t,``):e.inputType.startsWith(`insert`)&&b(t,te(e.data??e.dataTransfer?.getData(`text/plain`)??``))}let v=()=>{let e=getSelection();return e&&e.rangeCount>0?e.getRangeAt(0):void 0},y=(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&&y(e.startContainer,e.startOffset),i=e&&y(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)},ie=({x:e,y:n})=>{let r=Cd(e,n),i=r&&y(r.node,r.offset);return!u||i==null?!1:(wd(t,i),!0)};for(let{child:e}of s)e.setAttribute(`contenteditable`,`false`);e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(jc,``),e.addEventListener(`keydown`,_),e.addEventListener(`paste`,ne),e.addEventListener(`beforeinput`,re),e.addEventListener(`blur`,g),window.addEventListener(`pagehide`,ee),e.focus();let ae=document.createRange();ae.selectNodeContents(t);let oe=getSelection();return oe?.removeAllRanges(),oe?.addRange(ae),{cancel:h,caretAt:ie}}document.currentScript?.remove();let Dd=window.parent,Od=window.origin,kd=crypto.randomUUID(),Ad=/* @__PURE__ */ new Map,jd=/* @__PURE__ */ new Map,Md=/* @__PURE__ */ new Map,Nd={...Zc,...dl,...wl,...Bl,...Ql,...bu,...Ou,...Pu,...Gu,...Ju,...$u,..._d,"element-box":e=>{let t=El(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=El(e),a=!1,o=i&&Sd(i,(e,r)=>{a=!0,Md.delete(t),e.kind===`commit`&&jd.set(t,r),n(e)},e.at,e.empty);return o?(Md.set(t,o.caretAt),r(()=>{Md.delete(t),a||o.cancel()}),!0):!1},"text-caret":({edit:e,at:t})=>Md.get(e)?.(t)??!1,"text-written":({edit:e,written:t})=>{let n=jd.get(e);return jd.delete(e),t||n?.(),null},...Zu(()=>Fd())};function Pd(e,t){Dd.postMessage(e,t)}function Fd(e=o(document)){Pd({tag:X,kind:`shown`,page:kd,hash:e},`*`)}function Id(e,t,n,r){let i=Nd[e];if(!i)throw Error(`no handler for ${e}`);let a=Uc(e,t);if(a===Hc)throw Error(`not the arguments ${e} takes`);return i(a,{id:n,push:e=>Pd({tag:X,kind:`push`,id:n,value:e},r),onClose:e=>Ad.set(n,e)})}Dd!==window&&(Tl(document,()=>Fd()),window.addEventListener(`pagehide`,()=>Fd(null)),window.addEventListener(`message`,e=>{if(e.source!==Dd)return;let{origin:t}=e;if(!Kc(t,Od))return;let n=Nc(e,t);if(n?.kind===`close`&&(Ad.get(n.id)?.(),Ad.delete(n.id)),n?.kind!==`request`)return;let{id:r}=n;try{let e=Id(n.op,n.args,r,t);Pd({tag:X,kind:`reply`,id:r,ok:!0,value:e},t)}catch(e){let n=e instanceof Error?e.message:String(e);Pd({tag:X,kind:`reply`,id:r,ok:!1,error:n},t)}}))})();