frameboard 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +201 -37
- package/dist/client/assets/index-D-jPOVe6.css +2 -0
- package/dist/client/assets/index-D_JiNG33.js +180 -0
- package/dist/client/index.html +2 -2
- package/dist/frame-bridge.js +69 -69
- package/package.json +1 -1
- package/dist/client/assets/index-Bc2kMch6.js +0 -174
- package/dist/client/assets/index-DTVg3VZz.css +0 -2
package/dist/frame-bridge.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){let e=`data-frameboard`;function t(t){return[...t.querySelectorAll(`*`)].filter(t=>!t.hasAttribute(e))}function n(e,n){let r=t(e).indexOf(n);return r===-1?null:r}function r(e,n){return t(e)[n]??null}function i(e){return e.querySelector(`style[data-frameboard]`)?.getAttribute(`data-hash`)??null}function a(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function o(e,t=`|`){return e.map(e=>
|
|
2
|
-
function
|
|
3
|
-
function k(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){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.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),Ae(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?Ue(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 A=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},We=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Be=globalThis).__zod_globalConfig??(Be.__zod_globalConfig={});let j=globalThis.__zod_globalConfig;function M(e){return e&&Object.assign(j,e),j}function Ge(){let e=this._zod;return e.message??=JSON.stringify(e.def,s,2),e.message}function Ke(e){this._zod.message=e}let qe={get:Ge,set:Ke,enumerable:!0,configurable:!0},Je={value:void 0,enumerable:!1},Ye=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Xe=/* @__PURE__ */ k(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Je.value=t,Object.defineProperty(e,"issues",Je),Je.value=void 0,Object.defineProperty(e,"message",qe);let n=Object.getPrototypeOf(e);Ye.has(n)||(Ye.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 Ze(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 Qe(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ze(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function $e(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 et(e,t){return{callee:t?.callee??e,Err:t?.Err}}let tt=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 A;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>E(e,o,M())));throw re(n,a?.callee??t),n}return s.value};return t},nt=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=>E(e,o,M())));throw re(n,a?.callee??t),n}return s.value};return t},rt=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 A;return a.issues.length?it(e,a.issues,i):{success:!0,data:a.value}};function it(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>E(e,n,M()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let at=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?it(e,a.issues,i):{success:!0,data:a.value}},ot=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),st=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),ct=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ot)return!0;if(r.definite===!0&&n===void 0)return!1}return lt(e,t,n)});function lt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[st]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new A;return a.issues.length===0}let ut=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},dt=e=>{let t=tt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,et(n,a))};return n},ft=e=>{let t=tt(e),n=(e,r,i,a)=>t(e,r,i,et(n,a));return n},pt=e=>{let t=nt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,et(n,a))};return n},mt=e=>{let t=nt(e),n=async(e,r,i,a)=>await t(e,r,i,et(n,a));return n},ht=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return rt(e)(t,n,i)},gt=e=>(t,n,r)=>rt(e)(t,n,r),_t=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return at(e)(t,n,i)},vt=e=>async(t,n,r)=>at(e)(t,n,r),yt=/^[cC][0-9a-z]{6,}$/,bt=/^[0-9a-z]+$/,xt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,St=/^[0-9a-vA-V]{20}$/,Ct=/^[A-Za-z0-9]{27}$/,wt=/^[a-zA-Z0-9_-]{21}$/;function Tt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let Et=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dt=/^([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})$/,Ot=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)$/,kt=/^(?:[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 At(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}let jt=/^(?:(?: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])$/,Mt=/^(([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}|:))$/,Nt=/^((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])$/,Pt=/^(([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])$/,Ft=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,It=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Lt=/^https?$/,Rt=/^\+[1-9]\d{6,14}$/,zt=`(?:(?:\\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 Bt(e){return RegExp(`^${e}$`)}let Vt=/*@__PURE__*/ Bt(zt);function Ht(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 Ut(e){return RegExp(`^${Ht(e)}$`)}function Wt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ht({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ht({precision:e.precision})}`:n;return RegExp(`^${zt}T(?:${r})$`)}let Gt=/^[\s\S]{0,}$/,Kt=/^-?\d+(?:\.\d+)?$/,qt=/^(?:true|false)$/i,Jt=/^null$/i,Yt=/^[^A-Z]*$/,Xt=/^[^a-z]*$/,N=/*@__PURE__*/ k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Zt=e=>{let t=e.value;return!u(t)&&t.length!==void 0},Qt={number:`number`,bigint:`bigint`,object:`date`},$t=/*@__PURE__*/ k(`$ZodCheckLessThan`,(e,t)=>{N.init(e,t);let n=Qt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Qt[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})}}),en=/*@__PURE__*/ k(`$ZodCheckGreaterThan`,(e,t)=>{N.init(e,t);let n=Qt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Qt[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})}}),tn=/*@__PURE__*/ k(`$ZodCheckMultipleOf`,(e,t)=>{N.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):f(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nn=/*@__PURE__*/ k(`$ZodCheckNumberFormat`,(e,t)=>{N.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=le[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})}}),rn=/*@__PURE__*/ k(`$ZodCheckMaxLength`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ee(r):i)<=t.maximum)return;let a=De(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),an=/*@__PURE__*/ k(`$ZodCheckMinLength`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ee(r):i)>=t.minimum)return;let a=De(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),on=/*@__PURE__*/ k(`$ZodCheckLengthEquals`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ee(r):i;if(a===t.length)return;let o=De(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})}}),sn=/*@__PURE__*/ k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;N.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=()=>{})}),cn=/*@__PURE__*/ k(`$ZodCheckRegex`,(e,t)=>{sn.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})}}),ln=/*@__PURE__*/ k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Yt,sn.init(e,t)}),un=/*@__PURE__*/ k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Xt,sn.init(e,t)}),dn=/*@__PURE__*/ k(`$ZodCheckIncludes`,(e,t)=>{N.init(e,t);let n=S(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})}}),fn=/*@__PURE__*/ k(`$ZodCheckStartsWith`,(e,t)=>{N.init(e,t);let n=RegExp(`^${S(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})}}),pn=/*@__PURE__*/ k(`$ZodCheckEndsWith`,(e,t)=>{N.init(e,t);let n=RegExp(`.*${S(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})}}),mn=/*@__PURE__*/ k(`$ZodCheckOverwrite`,(e,t)=>{N.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var hn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
1
|
+
(function(){let e=`data-frameboard`;function t(t){return[...t.querySelectorAll(`*`)].filter(t=>!t.hasAttribute(e))}function n(e,n){let r=t(e).indexOf(n);return r===-1?null:r}function r(e,n){return t(e)[n]??null}function i(e){return e.querySelector(`style[data-frameboard]`)?.getAttribute(`data-hash`)??null}function a(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function o(e,t=`|`){return e.map(e=>ce(e)).join(t)}function s(e,t){return typeof t==`bigint`?t.toString():t}var c=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function l(e){return new c(e)}function u(e){return e==null}function d(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function f(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function p(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function m(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function h(e){return m(e._zod.def)??e._zod.def.shape}function g(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return p(this,t,e),e},enumerable:!0,configurable:!0})}function _(e,t,n){t in e?p(e,t,n):e[t]=n}function v(e,t,n,r){let i=h(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?g(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):_(e,a,r?r(n.value,a):n.value))}}function ee(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?g(e,n,()=>t[n]):_(e,n,r.value))}}function y(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let ie=/* @__PURE__*/ l(()=>{if(A.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function x(e){if(b(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return b(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ae(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let oe=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function S(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function C(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ce(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function le(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}let ue={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},de={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function fe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return v(i,e,pe(e,t)),S(e,y(n,{shape:i,checks:[]}))}function pe(e,t){let n=h(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function me(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(pe(e,t)),a={};return v(a,e,Reflect.ownKeys(h(e)).filter(e=>!i.has(e))),S(e,y(n,{shape:a,checks:[]}))}function he(e,t){if(!x(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=h(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return S(e,y(e._zod.def,{shape:ge(e,t)}))}function ge(e,t){let n={};return v(n,e,Reflect.ownKeys(h(e))),ee(n,t),n}function _e(e,t){if(!x(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return S(e,y(e._zod.def,{shape:ge(e,t)}))}function ve(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return v(n,e,Reflect.ownKeys(h(e))),v(n,t,Reflect.ownKeys(h(t))),S(e,y(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ye(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(pe(t,n)):void 0,o={};return v(o,t,Reflect.ownKeys(h(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),S(t,y(t._zod.def,{shape:o,checks:[]}))}function be(e,t,n){let r=n?new Set(pe(t,n)):void 0,i={};return v(i,t,Reflect.ownKeys(h(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),S(t,y(t._zod.def,{shape:i}))}function w(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function xe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Se(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ce(e){return typeof e==`string`?e:e?.message}function we(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Te(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function T(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ce(e.inst?._zod.def?.error?.(e))??Ce(a?.(e))??Ce(t?.error?.(e))??Ce(n.customError?.(e))??Ce(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}let Ee=/[\uD800-\uDBFF]/;function De(e){let t=e.length;if(!Ee.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Oe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ke(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ae(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function je(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Pe(e,n,r.value)}}function E(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Me(e,t,n){return E(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
|
|
2
|
+
function Ne(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return E(this,n,r(this))},set(e){E(this,n,e)}})}return t}function Pe(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:E(this,t,n.bind(this))},set(e){E(this,t,e)}})}function Fe(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Ie,Le=!1,Re={configurable:!0,get(){Le=!0}};function D(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Ie!==e._zod?Ie=void 0:(Ie=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Re);let e=Le;Le=!1;try{let r=n(this);return Le?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Le||=e,r}catch(n){throw delete this[t],Le||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function ze(e,t,n,r){let i=Fe(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function Be(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var Ve;let He={value:void 0,enumerable:!1},Ue=`captureStackTrace`in Error?Error:null;function We(e){let t=Ue;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ue=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
|
|
3
|
+
function O(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){He.value=new a(r);try{Object.defineProperty(n,"_zod",He)}finally{He.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),je(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?We(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var k=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Ve=globalThis).__zod_globalConfig??(Ve.__zod_globalConfig={});let A=globalThis.__zod_globalConfig;function j(e){return e&&Object.assign(A,e),A}function Ke(){let e=this._zod;return e.message??=JSON.stringify(e.def,s,2),e.message}function qe(e){this._zod.message=e}let Je={get:Ke,set:qe,enumerable:!0,configurable:!0},Ye={value:void 0,enumerable:!1},Xe=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Ze=/* @__PURE__ */ O(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Ye.value=t,Object.defineProperty(e,"issues",Ye),Ye.value=void 0,Object.defineProperty(e,"message",Je);let n=Object.getPrototypeOf(e);Xe.has(n)||(Xe.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Qe(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function $e(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Qe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function et(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function tt(e,t){return{callee:t?.callee??e,Err:t?.Err}}let nt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new k;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>T(e,o,j())));throw re(n,a?.callee??t),n}return s.value};return t},rt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>T(e,o,j())));throw re(n,a?.callee??t),n}return s.value};return t},it=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new k;return a.issues.length?at(e,a.issues,i):{success:!0,data:a.value}};function at(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>T(e,n,j()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let ot=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?at(e,a.issues,i):{success:!0,data:a.value}},st=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),ct=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),lt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==st)return!0;if(r.definite===!0&&n===void 0)return!1}return ut(e,t,n)});function ut(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[ct]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new k;return a.issues.length===0}let dt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ft=e=>{let t=nt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,tt(n,a))};return n},pt=e=>{let t=nt(e),n=(e,r,i,a)=>t(e,r,i,tt(n,a));return n},mt=e=>{let t=rt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,tt(n,a))};return n},ht=e=>{let t=rt(e),n=async(e,r,i,a)=>await t(e,r,i,tt(n,a));return n},gt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return it(e)(t,n,i)},_t=e=>(t,n,r)=>it(e)(t,n,r),vt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ot(e)(t,n,i)},yt=e=>async(t,n,r)=>ot(e)(t,n,r),bt=/^[cC][0-9a-z]{6,}$/,xt=/^[0-9a-z]+$/,St=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ct=/^[0-9a-vA-V]{20}$/,wt=/^[A-Za-z0-9]{27}$/,Tt=/^[a-zA-Z0-9_-]{21}$/;function Et(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let Dt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ot=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,kt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,At=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function jt(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}let Mt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Nt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Pt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,It=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rt=/^https?$/,zt=/^\+[1-9]\d{6,14}$/,Bt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Vt(e){return RegExp(`^${e}$`)}let Ht=/*@__PURE__*/ Vt(Bt);function Ut(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wt(e){return RegExp(`^${Ut(e)}$`)}function Gt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ut({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ut({precision:e.precision})}`:n;return RegExp(`^${Bt}T(?:${r})$`)}let Kt=/^[\s\S]{0,}$/,qt=/^-?\d+(?:\.\d+)?$/,Jt=/^(?:true|false)$/i,Yt=/^null$/i,Xt=/^[^A-Z]*$/,Zt=/^[^a-z]*$/,M=/*@__PURE__*/ O(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qt=e=>{let t=e.value;return!u(t)&&t.length!==void 0},$t={number:`number`,bigint:`bigint`,object:`date`},en=/*@__PURE__*/ O(`$ZodCheckLessThan`,(e,t)=>{M.init(e,t);let n=$t[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:$t[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tn=/*@__PURE__*/ O(`$ZodCheckGreaterThan`,(e,t)=>{M.init(e,t);let n=$t[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:$t[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nn=/*@__PURE__*/ O(`$ZodCheckMultipleOf`,(e,t)=>{M.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):f(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),rn=/*@__PURE__*/ O(`$ZodCheckNumberFormat`,(e,t)=>{M.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ue[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),an=/*@__PURE__*/ O(`$ZodCheckMaxLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=Qt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?De(r):i)<=t.maximum)return;let a=Oe(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),on=/*@__PURE__*/ O(`$ZodCheckMinLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=Qt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?De(r):i)>=t.minimum)return;let a=Oe(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sn=/*@__PURE__*/ O(`$ZodCheckLengthEquals`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=Qt),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?De(r):i;if(a===t.length)return;let o=Oe(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),cn=/*@__PURE__*/ O(`$ZodCheckStringFormat`,(e,t)=>{var n,r;M.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ln=/*@__PURE__*/ O(`$ZodCheckRegex`,(e,t)=>{cn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),un=/*@__PURE__*/ O(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Xt,cn.init(e,t)}),dn=/*@__PURE__*/ O(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Zt,cn.init(e,t)}),fn=/*@__PURE__*/ O(`$ZodCheckIncludes`,(e,t)=>{M.init(e,t);let n=se(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),pn=/*@__PURE__*/ O(`$ZodCheckStartsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`^${se(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mn=/*@__PURE__*/ O(`$ZodCheckEndsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`.*${se(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),hn=/*@__PURE__*/ O(`$ZodCheckOverwrite`,(e,t)=>{M.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var gn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
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 gn={major:4,minor:6,patch:7},P=/*@__PURE__*/ k(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gn;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=T(t),a;for(let o of n){if(o._zod.def.when){if(be(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 A;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(we(t.issues,n,e),i||=T(t,n))});else{if(t.issues.length===n)continue;we(t.issues,n,e),i||=T(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(T(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new A;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 A;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return je(this,`~standard`,yn(this))},set"~standard"(e){D(this,`~standard`,e)}}),_n=(e,t)=>e.issues.length?{issues:e.issues.map(e=>E(e,t,M()))}:{value:e.value};async function vn(e,t){let n={async:!0};return _n(await e._zod.run({value:t,issues:[]},n),n)}function yn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return _n(r,n)}catch{}return vn(e,t)},vendor:`zod`,version:1}}let bn=/*@__PURE__*/ k(`$ZodString`,(e,t)=>{P.init(e,t),e._zod.pattern=t.pattern??Gt,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}}),F=/*@__PURE__*/ k(`$ZodStringFormat`,(e,t)=>{sn.init(e,t),bn.init(e,t)}),xn=/*@__PURE__*/ k(`$ZodGUID`,(e,t)=>{t.pattern??=Dt,F.init(e,t)}),Sn=/*@__PURE__*/ k(`$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??=Ot(e)}else t.pattern??=Ot();F.init(e,t)}),Cn=/*@__PURE__*/ k(`$ZodEmail`,(e,t)=>{t.pattern??=kt,F.init(e,t)});function wn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Tn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?wn(e)||2:En(e,t)}function En(e,t){if(!t.normalize&&t.protocol?.source===Lt.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 Dn=/[\t\n\r]/g;function On(e){return e.replace(Dn,``)}function kn(e,t){return t.lastIndex=0,t.test(e.hostname)}function An(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}let jn=/*@__PURE__*/ k(`$ZodURL`,(e,t)=>{F.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Tn(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=On(r);return}t.hostname&&!kn(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&&!An(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:On(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Mn=/*@__PURE__*/ k(`$ZodEmoji`,(e,t)=>{t.pattern??=At(),F.init(e,t)}),Nn=/*@__PURE__*/ k(`$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?wt:Tt(t.length),F.init(e,t)}),Pn=/*@__PURE__*/ k(`$ZodCUID`,(e,t)=>{t.pattern??=yt,F.init(e,t)}),Fn=/*@__PURE__*/ k(`$ZodCUID2`,(e,t)=>{t.pattern??=bt,F.init(e,t)}),In=/*@__PURE__*/ k(`$ZodULID`,(e,t)=>{t.pattern??=xt,F.init(e,t)}),Ln=/*@__PURE__*/ k(`$ZodXID`,(e,t)=>{t.pattern??=St,F.init(e,t)}),Rn=/*@__PURE__*/ k(`$ZodKSUID`,(e,t)=>{t.pattern??=Ct,F.init(e,t)}),zn=/*@__PURE__*/ k(`$ZodISODateTime`,(e,t)=>{t.pattern??=Wt(t),F.init(e,t)}),Bn=/*@__PURE__*/ k(`$ZodISODate`,(e,t)=>{t.pattern??=Vt,F.init(e,t)}),Vn=/*@__PURE__*/ k(`$ZodISOTime`,(e,t)=>{t.pattern??=Ut(t),F.init(e,t)}),Hn=/*@__PURE__*/ k(`$ZodISODuration`,(e,t)=>{t.pattern??=Et,F.init(e,t)}),Un=/*@__PURE__*/ k(`$ZodIPv4`,(e,t)=>{t.pattern??=jt,F.init(e,t)}),Wn=/^[0-9a-fA-F:.]+$/;function Gn(e){return Wn.test(e)?wn(`http://[${e}]`):!1}let Kn=/*@__PURE__*/ k(`$ZodIPv6`,(e,t)=>{t.pattern??=Mt,F.init(e,t),e._zod.check=n=>{Gn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),qn=/*@__PURE__*/ k(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Nt,F.init(e,t)});function Jn(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:Gn(n)}let Yn=/*@__PURE__*/ k(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Pt,F.init(e,t),e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Xn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let Zn=/^[0-9a-zA-Z+/]*={0,2}$/,Qn=/*@__PURE__*/ k(`$ZodBase64`,(e,t)=>{t.pattern??=Zn,F.init(e,t),e._zod.check=n=>{Xn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),$n=/^[A-Za-z0-9_-]*$/;function er(e){if(!$n.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Xn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let tr=/*@__PURE__*/ k(`$ZodBase64URL`,(e,t)=>{t.pattern??=$n,F.init(e,t),e._zod.check=n=>{er(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),nr=/*@__PURE__*/ k(`$ZodE164`,(e,t)=>{t.pattern??=Rt,F.init(e,t)});function rr(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 ir=/*@__PURE__*/ k(`$ZodJWT`,(e,t)=>{F.init(e,t),e._zod.check=n=>{rr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ar=/*@__PURE__*/ k(`$ZodNumber`,(e,t)=>{P.init(e,t),e._zod.pattern=Kt,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}}),or=/*@__PURE__*/ k(`$ZodNumberFormat`,(e,t)=>{nn.init(e,t),ar.init(e,t)}),sr=/*@__PURE__*/ k(`$ZodBoolean`,(e,t)=>{P.init(e,t),e._zod.pattern=qt,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}}),cr=/*@__PURE__*/ k(`$ZodNull`,(e,t)=>{P.init(e,t),e._zod.pattern=Jt,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}}),lr=/*@__PURE__*/ k(`$ZodUnknown`,(e,t)=>{P.init(e,t),e._zod.parse=e=>e}),ur=/*@__PURE__*/ k(`$ZodNever`,(e,t)=>{P.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function dr(e,t){let n=Ce(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 Ce(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,we(n.issues,t,e),n}}return i(n,a)}}let fr=e=>Array.isArray(e)?e.length:-1;function pr(e,t,n){e.issues.length&&t.issues.push(...xe(n,e.issues)),t.value[n]=e.value}let mr=/*@__PURE__*/ k(`$ZodArray`,(e,t)=>{P.init(e,t);let n=j.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=>pr(t,r,e)));else if(pr(c,r,e),s&&c.issues.length!==0&&T(c))break}return o.length?Promise.all(o).then(()=>r):r},dr(e,fr)});function hr(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(...xe(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 gr=[];function _r(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:gr,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=ce(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function vr(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(T(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=>hr(e,n,i,t,d,f))):hr(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 yr=/*@__PURE__*/ k(`$ZodObject`,(e,t)=>{P.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=l(()=>_r(t));O(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||p(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=b,o=t.catchall,s,c=j.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(T(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=>hr(n,t,e,r,a,o))):hr(s,t,e,r,a,o)}return o?vr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),br=/*@__PURE__*/ k(`$ZodObjectJIT`,(e,t)=>{yr.init(e,t);let n=e._zod.parse,r=l(()=>_r(t)),i=j.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new hn([`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 _n={major:4,minor:6,patch:7},N=/*@__PURE__*/ O(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_n;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=w(t),a;for(let o of n){if(o._zod.def.when){if(xe(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new k;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Te(t.issues,n,e),i||=w(t,n))});else{if(t.issues.length===n)continue;Te(t.issues,n,e),i||=w(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(w(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new k;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new k;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Me(this,`~standard`,bn(this))},set"~standard"(e){E(this,`~standard`,e)}}),vn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>T(e,t,j()))}:{value:e.value};async function yn(e,t){let n={async:!0};return vn(await e._zod.run({value:t,issues:[]},n),n)}function bn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return vn(r,n)}catch{}return yn(e,t)},vendor:`zod`,version:1}}let xn=/*@__PURE__*/ O(`$ZodString`,(e,t)=>{N.init(e,t),e._zod.pattern=t.pattern??Kt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),P=/*@__PURE__*/ O(`$ZodStringFormat`,(e,t)=>{cn.init(e,t),xn.init(e,t)}),Sn=/*@__PURE__*/ O(`$ZodGUID`,(e,t)=>{t.pattern??=Ot,P.init(e,t)}),Cn=/*@__PURE__*/ O(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=kt(e)}else t.pattern??=kt();P.init(e,t)}),wn=/*@__PURE__*/ O(`$ZodEmail`,(e,t)=>{t.pattern??=At,P.init(e,t)});function Tn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function En(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Tn(e)||2:Dn(e,t)}function Dn(e,t){if(!t.normalize&&t.protocol?.source===Rt.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}let On=/[\t\n\r]/g;function kn(e){return e.replace(On,``)}function An(e,t){return t.lastIndex=0,t.test(e.hostname)}function jn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}let Mn=/*@__PURE__*/ O(`$ZodURL`,(e,t)=>{P.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=En(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=kn(r);return}t.hostname&&!An(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!jn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:kn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Nn=/*@__PURE__*/ O(`$ZodEmoji`,(e,t)=>{t.pattern??=jt(),P.init(e,t)}),Pn=/*@__PURE__*/ O(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Tt:Et(t.length),P.init(e,t)}),Fn=/*@__PURE__*/ O(`$ZodCUID`,(e,t)=>{t.pattern??=bt,P.init(e,t)}),In=/*@__PURE__*/ O(`$ZodCUID2`,(e,t)=>{t.pattern??=xt,P.init(e,t)}),Ln=/*@__PURE__*/ O(`$ZodULID`,(e,t)=>{t.pattern??=St,P.init(e,t)}),Rn=/*@__PURE__*/ O(`$ZodXID`,(e,t)=>{t.pattern??=Ct,P.init(e,t)}),zn=/*@__PURE__*/ O(`$ZodKSUID`,(e,t)=>{t.pattern??=wt,P.init(e,t)}),Bn=/*@__PURE__*/ O(`$ZodISODateTime`,(e,t)=>{t.pattern??=Gt(t),P.init(e,t)}),Vn=/*@__PURE__*/ O(`$ZodISODate`,(e,t)=>{t.pattern??=Ht,P.init(e,t)}),Hn=/*@__PURE__*/ O(`$ZodISOTime`,(e,t)=>{t.pattern??=Wt(t),P.init(e,t)}),Un=/*@__PURE__*/ O(`$ZodISODuration`,(e,t)=>{t.pattern??=Dt,P.init(e,t)}),Wn=/*@__PURE__*/ O(`$ZodIPv4`,(e,t)=>{t.pattern??=Mt,P.init(e,t)}),Gn=/^[0-9a-fA-F:.]+$/;function Kn(e){return Gn.test(e)?Tn(`http://[${e}]`):!1}let qn=/*@__PURE__*/ O(`$ZodIPv6`,(e,t)=>{t.pattern??=Nt,P.init(e,t),e._zod.check=n=>{Kn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Jn=/*@__PURE__*/ O(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Pt,P.init(e,t)});function Yn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Kn(n)}let Xn=/*@__PURE__*/ O(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ft,P.init(e,t),e._zod.check=n=>{Yn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Zn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let Qn=/^[0-9a-zA-Z+/]*={0,2}$/,$n=/*@__PURE__*/ O(`$ZodBase64`,(e,t)=>{t.pattern??=Qn,P.init(e,t),e._zod.check=n=>{Zn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),er=/^[A-Za-z0-9_-]*$/;function tr(e){if(!er.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Zn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let nr=/*@__PURE__*/ O(`$ZodBase64URL`,(e,t)=>{t.pattern??=er,P.init(e,t),e._zod.check=n=>{tr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rr=/*@__PURE__*/ O(`$ZodE164`,(e,t)=>{t.pattern??=zt,P.init(e,t)});function ir(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}let ar=/*@__PURE__*/ O(`$ZodJWT`,(e,t)=>{P.init(e,t),e._zod.check=n=>{ir(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),or=/*@__PURE__*/ O(`$ZodNumber`,(e,t)=>{N.init(e,t),e._zod.pattern=qt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),sr=/*@__PURE__*/ O(`$ZodNumberFormat`,(e,t)=>{rn.init(e,t),or.init(e,t)}),cr=/*@__PURE__*/ O(`$ZodBoolean`,(e,t)=>{N.init(e,t),e._zod.pattern=Jt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),lr=/*@__PURE__*/ O(`$ZodNull`,(e,t)=>{N.init(e,t),e._zod.pattern=Yt,e._zod.values=/* @__PURE__ */ new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),ur=/*@__PURE__*/ O(`$ZodUnknown`,(e,t)=>{N.init(e,t),e._zod.parse=e=>e}),dr=/*@__PURE__*/ O(`$ZodNever`,(e,t)=>{N.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function fr(e,t){let n=we(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of we(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Te(n.issues,t,e),n}}return i(n,a)}}let pr=e=>Array.isArray(e)?e.length:-1;function mr(e,t,n){e.issues.length&&t.issues.push(...Se(n,e.issues)),t.value[n]=e.value}let hr=/*@__PURE__*/ O(`$ZodArray`,(e,t)=>{N.init(e,t);let n=A.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>mr(t,r,e)));else if(mr(c,r,e),s&&c.issues.length!==0&&w(c))break}return o.length?Promise.all(o).then(()=>r):r},fr(e,pr)});function gr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Se(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}let _r=[];function vr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:_r,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=le(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function yr(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(w(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>gr(e,n,i,t,d,f))):gr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}let br=/*@__PURE__*/ O(`$ZodObject`,(e,t)=>{N.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=l(()=>vr(t));D(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||p(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=b,o=t.catchall,s,c=A.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(w(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>gr(n,t,e,r,a,o))):gr(s,t,e,r,a,o)}return o?yr(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),xr=/*@__PURE__*/ O(`$ZodObjectJIT`,(e,t)=>{br.init(e,t);let n=e._zod.parse,r=l(()=>vr(t)),i=A.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new gn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
6
6
|
let ${e}_ab = false;
|
|
7
7
|
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
8
8
|
const iss = ${e}.issues[i];
|
|
@@ -52,74 +52,74 @@ function k(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
|
|
|
52
52
|
newResult[${r}] = ${n}.value;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=b,c=!j.jitless,u=c&&ie.value,d=t.catchall,f;e._zod.parse=(i,l)=>{f??=r.value;let p=i.value;return s(p)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=a(t.shape),i=o(i,l),d?vr([],p,i,l,f,e,l?.abortEarly===!0):i):n(i,l):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function xr(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=>!T(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=>E(e,r,M())))}),t)}let Sr=/*@__PURE__*/ k(`$ZodUnion`,(e,t)=>{P.init(e,t),O(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),O(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),O(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)))}),O(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>d(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>xr(t,r,e,i)):xr(o,r,e,i)}}),Cr=/*@__PURE__*/ k(`$ZodIntersection`,(e,t)=>{P.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])=>Tr(e,t,n)):Tr(e,i,a)}});function wr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(x(e)&&x(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=wr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=wr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Tr(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=wr(t.value,n.value);if(!c.valid){if(T(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}let Er=/*@__PURE__*/ k(`$ZodEnum`,(e,t)=>{P.init(e,t);let n=a(t.entries),r=new Set(n);e._zod.values=r,O(e,`pattern`,e=>{let t=a(e.def.entries).filter(e=>oe.has(typeof e));return RegExp(t.length?`^(${t.map(e=>S(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}}),Dr=/*@__PURE__*/ k(`$ZodLiteral`,(e,t)=>{P.init(e,t);let n=new Set(t.values);e._zod.values=n,O(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?S(e):e?S(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}}),Or=/*@__PURE__*/ k(`$ZodTransform`,(e,t)=>{P.init(e,t),e._zod.optin=`optional`,j.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(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 A;return n.value=i,n}});function kr(e,t){return e.value=t.issues.length?void 0:t.value,e}let Ar=/*@__PURE__*/ k(`$ZodOptional`,(e,t)=>{P.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,O(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),O(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>kr(e,t)):kr(e,r)}return t.innerType._zod.run(e,n)}}),jr=/*@__PURE__*/ k(`$ZodExactOptional`,(e,t)=>{Ar.init(e,t),O(e,`values`,e=>e.def.innerType._zod.values),O(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Mr=/*@__PURE__*/ k(`$ZodNullable`,(e,t)=>{P.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin),O(e,`optout`,e=>e.def.innerType._zod.optout),O(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)}|null)$`):void 0}),O(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)}),Nr=/*@__PURE__*/ k(`$ZodDefault`,(e,t)=>{P.init(e,t),e._zod.optin=`defaulted`,O(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=>Pr(e,t)):Pr(r,t)}});function Pr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let Fr=/*@__PURE__*/ k(`$ZodPrefault`,(e,t)=>{P.init(e,t),e._zod.optin=`defaulted`,O(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))}),Ir=/*@__PURE__*/ k(`$ZodNonOptional`,(e,t)=>{P.init(e,t),O(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=>Lr(t,e)):Lr(i,e)}});function Lr(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 Rr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>E(e,r,M()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}let zr=/*@__PURE__*/ k(`$ZodCatch`,(e,t)=>{P.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),O(e,`optout`,e=>e.def.innerType._zod.optout),O(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=>Rr(e,r,t,n)):Rr(e,r,t,n)}}),Br=/*@__PURE__*/ k(`$ZodPipe`,(e,t)=>{P.init(e,t),O(e,`values`,e=>e.def.in._zod.values),O(e,`optin`,e=>e.def.in._zod.optin),O(e,`optout`,e=>e.def.out._zod.optout),O(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=>Vr(e,t.in,n)):Vr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Vr(e,t.out,n)):Vr(r,t.out,n)}});function Vr(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 Hr=/*@__PURE__*/ k(`$ZodReadonly`,(e,t)=>{P.init(e,t),O(e,`propValues`,e=>e.def.innerType._zod.propValues),O(e,`values`,e=>e.def.innerType._zod.values),O(e,`optin`,e=>e.def.innerType?._zod?.optin),O(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(Ur):Ur(r)}});function Ur(e){return e.memo||(e.value=Object.freeze(e.value)),e}let Wr=/*@__PURE__*/ k(`$ZodCustom`,(e,t)=>{N.init(e,t),P.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=>Gr(t,n,r,e));Gr(i,n,r,e)}});function Gr(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(ke(e))}}var Kr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};let qr=`~memo`,Jr=[];function Yr(e){return typeof e==`object`&&!!e}function Xr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let Zr=/*@__PURE__*/ new WeakMap;function Qr(e,t,n){let r=Zr.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=Qr(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?Qr(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=m(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Qr(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),$r(e,i)}function $r(e,t){return t!==1&&Zr.set(e,t===2),t}function ei(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ti,ni=[],ri={alloc(e,t,n){let r=ti;if(!r)return n;ti=void 0;let i={value:n,issues:null};return r.set(t.value,i),ni.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`&&ai(n,e.value))throw new Kr;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=Qr(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(!Yr(l))return t(s,c);let u=c[qr];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[qr]=u);let d;i===c?d=a:(d=ei(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(...Xr(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ti=d;let p=ni.length,m=t(s,c);ti=void 0;let h=ni.length>p?ni.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Xr(e.issues):Jr),e)):(h&&(h.issues=m.issues.length?Xr(m.issues):Jr),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ii(){return ri}function ai(e,t){let n=e[qr]?.backEdges;return n!==void 0&&Yr(t)&&n.has(t)}let oi=()=>{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(Oe(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${se(e.values[0])}`:`Invalid option: expected one of ${o(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${o(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function si(){return{localeError:oi()}}var ci,li=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 ui(){return new li}(ci=globalThis).__zod_globalRegistry??(ci.__zod_globalRegistry=ui());let di=globalThis.__zod_globalRegistry;function fi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
|
|
56
|
-
function
|
|
57
|
-
function
|
|
58
|
-
function
|
|
59
|
-
function
|
|
60
|
-
function
|
|
61
|
-
function
|
|
62
|
-
function
|
|
63
|
-
function
|
|
64
|
-
function
|
|
65
|
-
function
|
|
66
|
-
function
|
|
67
|
-
function
|
|
68
|
-
function
|
|
69
|
-
function
|
|
70
|
-
function
|
|
71
|
-
function
|
|
72
|
-
function
|
|
73
|
-
function
|
|
74
|
-
function
|
|
75
|
-
function
|
|
76
|
-
function
|
|
77
|
-
function
|
|
78
|
-
function
|
|
79
|
-
function
|
|
80
|
-
function
|
|
81
|
-
function
|
|
82
|
-
function
|
|
83
|
-
function
|
|
84
|
-
function
|
|
85
|
-
function
|
|
86
|
-
function
|
|
87
|
-
function
|
|
88
|
-
function
|
|
89
|
-
function
|
|
90
|
-
function
|
|
91
|
-
function
|
|
92
|
-
function
|
|
93
|
-
function
|
|
94
|
-
function
|
|
95
|
-
function
|
|
96
|
-
function
|
|
97
|
-
function
|
|
98
|
-
function
|
|
99
|
-
function
|
|
100
|
-
function
|
|
101
|
-
function
|
|
102
|
-
function
|
|
103
|
-
function
|
|
104
|
-
function sa(e){return/* @__PURE__ */
|
|
105
|
-
function ca(){return/* @__PURE__ */
|
|
106
|
-
function la(){return/* @__PURE__ */
|
|
107
|
-
function ua(){return/* @__PURE__ */
|
|
108
|
-
function da(){return/* @__PURE__ */
|
|
109
|
-
function fa(e,t,n){return new e({type:`array`,element:t,...
|
|
110
|
-
function pa(e,t,n){let r=
|
|
111
|
-
function ma(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...
|
|
112
|
-
function ha(e,t){let n=/* @__PURE__ */ ga(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(
|
|
113
|
-
function ga(e,t){let n=new
|
|
55
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=b,c=!A.jitless,u=c&&ie.value,d=t.catchall,f;e._zod.parse=(i,l)=>{f??=r.value;let p=i.value;return s(p)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=a(t.shape),i=o(i,l),d?yr([],p,i,l,f,e,l?.abortEarly===!0):i):n(i,l):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Sr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!w(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>T(e,r,j())))}),t)}let Cr=/*@__PURE__*/ O(`$ZodUnion`,(e,t)=>{N.init(e,t),D(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),D(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),D(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),D(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>d(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Sr(t,r,e,i)):Sr(o,r,e,i)}}),wr=/*@__PURE__*/ O(`$ZodIntersection`,(e,t)=>{N.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Er(e,t,n)):Er(e,i,a)}});function Tr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(x(e)&&x(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Tr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Tr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Er(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Tr(t.value,n.value);if(!c.valid){if(w(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}let Dr=/*@__PURE__*/ O(`$ZodEnum`,(e,t)=>{N.init(e,t);let n=a(t.entries),r=new Set(n);e._zod.values=r,D(e,`pattern`,e=>{let t=a(e.def.entries).filter(e=>oe.has(typeof e));return RegExp(t.length?`^(${t.map(e=>se(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Or=/*@__PURE__*/ O(`$ZodLiteral`,(e,t)=>{N.init(e,t);let n=new Set(t.values);e._zod.values=n,D(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?se(e):e?se(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),kr=/*@__PURE__*/ O(`$ZodTransform`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,A.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ge(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new k;return n.value=i,n}});function Ar(e,t){return e.value=t.issues.length?void 0:t.value,e}let jr=/*@__PURE__*/ O(`$ZodOptional`,(e,t)=>{N.init(e,t),D(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,D(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),D(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ar(e,t)):Ar(e,r)}return t.innerType._zod.run(e,n)}}),Mr=/*@__PURE__*/ O(`$ZodExactOptional`,(e,t)=>{jr.init(e,t),D(e,`values`,e=>e.def.innerType._zod.values),D(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Nr=/*@__PURE__*/ O(`$ZodNullable`,(e,t)=>{N.init(e,t),D(e,`optin`,e=>e.def.innerType._zod.optin),D(e,`optout`,e=>e.def.innerType._zod.optout),D(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)}|null)$`):void 0}),D(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pr=/*@__PURE__*/ O(`$ZodDefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,D(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fr(e,t)):Fr(r,t)}});function Fr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let Ir=/*@__PURE__*/ O(`$ZodPrefault`,(e,t)=>{N.init(e,t),e._zod.optin=`defaulted`,D(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Lr=/*@__PURE__*/ O(`$ZodNonOptional`,(e,t)=>{N.init(e,t),D(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Rr(t,e)):Rr(i,e)}});function Rr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function zr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>T(e,r,j()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}let Br=/*@__PURE__*/ O(`$ZodCatch`,(e,t)=>{N.init(e,t),D(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),D(e,`optout`,e=>e.def.innerType._zod.optout),D(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>zr(e,r,t,n)):zr(e,r,t,n)}}),Vr=/*@__PURE__*/ O(`$ZodPipe`,(e,t)=>{N.init(e,t),D(e,`values`,e=>e.def.in._zod.values),D(e,`optin`,e=>e.def.in._zod.optin),D(e,`optout`,e=>e.def.out._zod.optout),D(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Hr(e,t.in,n)):Hr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Hr(e,t.out,n)):Hr(r,t.out,n)}});function Hr(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}let Ur=/*@__PURE__*/ O(`$ZodReadonly`,(e,t)=>{N.init(e,t),D(e,`propValues`,e=>e.def.innerType._zod.propValues),D(e,`values`,e=>e.def.innerType._zod.values),D(e,`optin`,e=>e.def.innerType?._zod?.optin),D(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Wr):Wr(r)}});function Wr(e){return e.memo||(e.value=Object.freeze(e.value)),e}let Gr=/*@__PURE__*/ O(`$ZodCustom`,(e,t)=>{M.init(e,t),N.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Kr(t,n,r,e));Kr(i,n,r,e)}});function Kr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ae(e))}}var qr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};let Jr=`~memo`,Yr=[];function Xr(e){return typeof e==`object`&&!!e}function Zr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let Qr=/*@__PURE__*/ new WeakMap;function $r(e,t,n){let r=Qr.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=$r(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?$r(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=m(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?$r(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ei(e,i)}function ei(e,t){return t!==1&&Qr.set(e,t===2),t}function ti(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ni,ri=[],ii={alloc(e,t,n){let r=ni;if(!r)return n;ni=void 0;let i={value:n,issues:null};return r.set(t.value,i),ri.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&oi(n,e.value))throw new qr;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=$r(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Xr(l))return t(s,c);let u=c[Jr];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Jr]=u);let d;i===c?d=a:(d=ti(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Zr(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ni=d;let p=ri.length,m=t(s,c);ni=void 0;let h=ri.length>p?ri.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Zr(e.issues):Yr),e)):(h&&(h.issues=m.issues.length?Zr(m.issues):Yr),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ai(){return ii}function oi(e,t){let n=e[Jr]?.backEdges;return n!==void 0&&Xr(t)&&n.has(t)}let si=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(ke(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ce(e.values[0])}`:`Invalid option: expected one of ${o(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${o(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function ci(){return{localeError:si()}}var li,ui=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function di(){return new ui}(li=globalThis).__zod_globalRegistry??(li.__zod_globalRegistry=di());let fi=globalThis.__zod_globalRegistry;function pi(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
|
|
56
|
+
function mi(e,t){return new e(pi({type:`string`,...C(t)}))}// @__NO_SIDE_EFFECTS__
|
|
57
|
+
function hi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
58
|
+
function gi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
59
|
+
function _i(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
60
|
+
function vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
61
|
+
function yi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
62
|
+
function bi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
63
|
+
function xi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
64
|
+
function Si(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
65
|
+
function Ci(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
66
|
+
function wi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
67
|
+
function Ti(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
68
|
+
function Ei(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
69
|
+
function Di(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
70
|
+
function Oi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
71
|
+
function ki(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
72
|
+
function Ai(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
73
|
+
function ji(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
74
|
+
function Mi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
75
|
+
function Ni(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
76
|
+
function Pi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
77
|
+
function Fi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
78
|
+
function Ii(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
79
|
+
function Li(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
80
|
+
function Ri(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
81
|
+
function zi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
82
|
+
function Bi(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
83
|
+
function Vi(e,t){return new e(pi({type:`number`,checks:[],...C(t)}))}// @__NO_SIDE_EFFECTS__
|
|
84
|
+
function Hi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
85
|
+
function Ui(e,t){return new e({type:`boolean`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
86
|
+
function Wi(e,t){return new e({type:`null`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
87
|
+
function Gi(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
|
|
88
|
+
function Ki(e,t){return new e({type:`never`,...C(t)})}// @__NO_SIDE_EFFECTS__
|
|
89
|
+
function qi(e,t){return new en({check:`less_than`,...C(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
|
|
90
|
+
function Ji(e,t){return new en({check:`less_than`,...C(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
|
|
91
|
+
function Yi(e,t){return new tn({check:`greater_than`,...C(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
|
|
92
|
+
function Xi(e,t){return new tn({check:`greater_than`,...C(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
|
|
93
|
+
function Zi(e,t){return new nn({check:`multiple_of`,...C(t),value:e})}// @__NO_SIDE_EFFECTS__
|
|
94
|
+
function Qi(e,t){return new an({check:`max_length`,...C(t),maximum:e})}// @__NO_SIDE_EFFECTS__
|
|
95
|
+
function $i(e,t){return new on({check:`min_length`,...C(t),minimum:e})}// @__NO_SIDE_EFFECTS__
|
|
96
|
+
function ea(e,t){return new sn({check:`length_equals`,...C(t),length:e})}// @__NO_SIDE_EFFECTS__
|
|
97
|
+
function ta(e,t){return new ln({check:`string_format`,format:`regex`,...C(t),pattern:e})}// @__NO_SIDE_EFFECTS__
|
|
98
|
+
function na(e){return new un({check:`string_format`,format:`lowercase`,...C(e)})}// @__NO_SIDE_EFFECTS__
|
|
99
|
+
function ra(e){return new dn({check:`string_format`,format:`uppercase`,...C(e)})}// @__NO_SIDE_EFFECTS__
|
|
100
|
+
function ia(e,t){return new fn({check:`string_format`,format:`includes`,...C(t),includes:e})}// @__NO_SIDE_EFFECTS__
|
|
101
|
+
function aa(e,t){return new pn({check:`string_format`,format:`starts_with`,...C(t),prefix:e})}// @__NO_SIDE_EFFECTS__
|
|
102
|
+
function oa(e,t){return new mn({check:`string_format`,format:`ends_with`,...C(t),suffix:e})}// @__NO_SIDE_EFFECTS__
|
|
103
|
+
function F(e){return new hn({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
|
|
104
|
+
function sa(e){return/* @__PURE__ */ F(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
|
|
105
|
+
function ca(){return/* @__PURE__ */ F(e=>e.trim())}// @__NO_SIDE_EFFECTS__
|
|
106
|
+
function la(){return/* @__PURE__ */ F(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
|
|
107
|
+
function ua(){return/* @__PURE__ */ F(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
|
|
108
|
+
function da(){return/* @__PURE__ */ F(e=>ne(e))}// @__NO_SIDE_EFFECTS__
|
|
109
|
+
function fa(e,t,n){return new e({type:`array`,element:t,...C(n)})}// @__NO_SIDE_EFFECTS__
|
|
110
|
+
function pa(e,t,n){let r=C(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}// @__NO_SIDE_EFFECTS__
|
|
111
|
+
function ma(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...C(n)})}// @__NO_SIDE_EFFECTS__
|
|
112
|
+
function ha(e,t){let n=/* @__PURE__ */ ga(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ae(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ae(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
|
|
113
|
+
function ga(e,t){let n=new M({check:`custom`,...C(t)});return n._zod.check=e,n}function _a(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&p(e,t,n[t]);return e}function va(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??fi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function I(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function L(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,L(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&_a(o.schema,c),t.io===`input`&&R(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ya(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ba(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ya(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ya(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
114
114
|
|
|
115
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function xa(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;xa(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}let Sa=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Ca=[`oneOf`,`anyOf`];function wa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ta(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Sa.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??wa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}p(n,r,e.length===1?e[0]:Ta(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=wa(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Ea(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Sa)if(t in e)return;let n=t.filter(e=>Ca.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ta(t);else{let e=n[0],i=Ca.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ta([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,_a(e,r))}function Da(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):_a(i,s),_a(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())xa(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Ea(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}_a(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,p(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ka(t,`input`,e.processors),output:ka(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function R(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return R(r.element,n);if(r.type===`set`)return R(r.valueType,n);if(r.type===`lazy`)return R(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return R(r.innerType,n);if(r.type===`intersection`)return R(r.left,n)||R(r.right,n);if(r.type===`record`||r.type===`map`)return R(r.keyType,n)||R(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:R(r.in,n)||R(r.out,n);if(r.type===`object`){for(let e in r.shape)if(R(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(R(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(R(e,n))return!0;return!!(r.rest&&R(r.rest,n))}return!1}let Oa=(e,t={})=>n=>{let r=va({...n,processors:t});return L(e,r),ba(r,e),Da(r,e)},ka=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=va({...i??{},target:a,io:t,processors:n});return L(e,o),ba(o,e),Da(o,e)},z=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},B=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Aa=(e,t)=>{z(e,`minimum`,t),B(e,`maximum`,t)},ja=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ma=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Na=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Pa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Fa=(e,t)=>z(e,`minimum`,t.minimum),Ia=(e,t)=>B(e,`maximum`,t.maximum),La=e=>(t,n)=>{Pa(t,n.format);let[r,i]=e[n.format];z(t,`minimum`,r),B(t,`maximum`,i)},Ra={greater_than:(e,t)=>z(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>B(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ja(e,t.value),number_format:La(le),bigint_format:La(ue),min_length:Fa,max_length:Ia,length_equals:(e,t)=>Aa(e,t.length),min_size:Fa,max_size:Ia,size_equals:(e,t)=>Aa(e,t.size),string_format:(e,t)=>{Pa(e,t.format),t.pattern&&Ma(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Na(e,t.mime)};function V(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ra[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&z(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&z(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&B(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&B(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ja(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Na(t,i.mime);for(let e of i.patterns??[])Ma(t,e);return t}let za={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ba=/* @__PURE__ */ new Map([[Zn,Ft],[$n,It]]),Va=e=>Ba.get(e)??e,Ha=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=V(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=za[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Va);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ua=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=V(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):I(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Wa=(e,t,n,r)=>{n.type=`boolean`},Ga=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ka=(e,t,n,r)=>{n.not={}},qa=(e,t,n,r)=>{let i=e._zod.def,o=a(i.entries);o.length===0?n.not={}:(o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o)},Ja=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(I(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(I(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ya=(e,t,n,r)=>{I(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Xa=(e,t,n,r)=>{I(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Za=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=V(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=L(a.element,t,{...r,path:[...r.path,`items`]})};function Qa(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Qa(t.out):t.type===`catch`?Qa(t.innerType):e._zod.optin}let $a=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&I(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)p(i.properties,e,L(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Qa(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=L(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},eo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>L(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},to=(e,t,n,r)=>{let i=e._zod.def,a=L(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=L(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},no=(e,t,n,r)=>{let i=e._zod.def,a=L(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ro=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},io=Symbol();function ao(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(I(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),io):JSON.parse(o)}let oo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n.default=o)},so=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n._prefault=o)},co=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{I(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},lo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;L(o,t,r);let s=t.seen.get(e);s.ref=o},uo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},fo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},po=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function mo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let H=/*@__PURE__*/ k(`ZodError`,(e,t)=>{Xe.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);po.has(n)||(po.add(n),mo(n,`format`,e=>t=>$e(e,t)),mo(n,`flatten`,e=>t=>Qe(e,t)),mo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}),mo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ho=/* @__PURE__ */ tt(H),go=/* @__PURE__ */ nt(H),_o=/* @__PURE__ */ rt(H),vo=/* @__PURE__ */ at(H),yo=/* @__PURE__ */ dt(H),bo=/* @__PURE__ */ ft(H),xo=/* @__PURE__ */ pt(H),So=/* @__PURE__ */ mt(H),Co=/* @__PURE__ */ ht(H),wo=/* @__PURE__ */ gt(H),To=/* @__PURE__ */ _t(H),Eo=/* @__PURE__ */ vt(H);function Do(){j.localeError||M(si())}function Oo(){j.memoizer||M({memoizer:ii()})}let U=/*@__PURE__*/ k(`ZodType`,(e,t)=>(Do(),P.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 C(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Hs(e,t))},superRefine(e,t){return this.check(Us(e,t))},overwrite(e){return this.check(/* @__PURE__ */ oa(e))},optional(){return Cs(this)},exactOptional(){return Ts(this)},nullable(){return Ds(this)},nullish(){return Cs(Ds(this))},nonoptional(e){return Ns(this,e)},array(){return J(this)},or(e){return ps([this,e])},and(e){return hs(this,e)},transform(e){return Ls(this,xs(e))},default(e){return ks(this,e)},prefault(e){return js(this,e)},catch(e){return Fs(this,e)},pipe(e){return Ls(this,e)},readonly(){return zs(this)},describe(e){let t=this.clone();return di.add(t,{description:e}),t},meta(...e){if(e.length===0)return di.get(this);let t=this.clone();return di.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 je(this,`~standard`,{...yn(this),jsonSchema:{input:ka(this,`input`),output:ka(this,`output`)}})},set"~standard"(e){D(this,`~standard`,e)},parse:function e(t,n){return ho(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await go(this,t,n,{callee:e})},safeParse(e,t){return _o(this,e,t)},async safeParseAsync(e,t){return vo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){D(this,`spa`,e)},validate(e,t){return ct(this,e,t)},validateAsync(e,t){return ut(this,e,t)},encode:function e(t,n){return yo(this,t,n,{callee:e})},decode:function e(t,n){return bo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await xo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await So(this,t,n,{callee:e})},safeEncode(e,t){return Co(this,e,t)},safeDecode(e,t){return wo(this,e,t)},async safeEncodeAsync(e,t){return To(this,e,t)},async safeDecodeAsync(e,t){return Eo(this,e,t)},toJSONSchema(e){return Oa(this,{})(e)},get description(){return di.get(this)?.description},get _def(){return this._zod.def}}),ko=/*@__PURE__*/ k(`_ZodString`,(e,t)=>{bn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r)},/*@__PURE__*/ Me({format:e=>V(e).format??null,minLength:e=>V(e).minimum??null,maxLength:e=>V(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ ea(...e))},includes(...e){return this.check(/* @__PURE__ */ ra(...e))},startsWith(...e){return this.check(/* @__PURE__ */ ia(...e))},endsWith(...e){return this.check(/* @__PURE__ */ aa(...e))},min(...e){return this.check(/* @__PURE__ */ Qi(...e))},max(...e){return this.check(/* @__PURE__ */ Zi(...e))},length(...e){return this.check(/* @__PURE__ */ $i(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Qi(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ ta(e))},uppercase(e){return this.check(/* @__PURE__ */ na(e))},trim(){return this.check(/* @__PURE__ */ ca())},normalize(...e){return this.check(/* @__PURE__ */ sa(...e))},toLowerCase(){return this.check(/* @__PURE__ */ la())},toUpperCase(){return this.check(/* @__PURE__ */ ua())},slugify(){return this.check(/* @__PURE__ */ da())}})),Ao=/*@__PURE__*/ k(`ZodString`,(e,t)=>{bn.init(e,t),ko.init(e,t)},{email(e){return this.check(/* @__PURE__ */ mi(Fo,e))},url(e){return this.check(/* @__PURE__ */ bi(Ro,e))},jwt(e){return this.check(/* @__PURE__ */ Fi($o,e))},emoji(e){return this.check(/* @__PURE__ */ xi(zo,e))},guid(e){return this.check(/* @__PURE__ */ hi(Io,e))},uuid(e){return this.check(/* @__PURE__ */ gi(Lo,e))},uuidv4(e){return this.check(/* @__PURE__ */ _i(Lo,e))},uuidv6(e){return this.check(/* @__PURE__ */ vi(Lo,e))},uuidv7(e){return this.check(/* @__PURE__ */ yi(Lo,e))},nanoid(e){return this.check(/* @__PURE__ */ Si(Bo,e))},cuid(e){return this.check(/* @__PURE__ */ Ci(Vo,e))},cuid2(e){return this.check(/* @__PURE__ */ wi(Ho,e))},ulid(e){return this.check(/* @__PURE__ */ Ti(Uo,e))},base64(e){return this.check(/* @__PURE__ */ Mi(Xo,e))},base64url(e){return this.check(/* @__PURE__ */ Ni(Zo,e))},xid(e){return this.check(/* @__PURE__ */ Ei(Wo,e))},ksuid(e){return this.check(/* @__PURE__ */ Di(Go,e))},ipv4(e){return this.check(/* @__PURE__ */ Oi(Ko,e))},ipv6(e){return this.check(/* @__PURE__ */ ki(qo,e))},cidrv4(e){return this.check(/* @__PURE__ */ Ai(Jo,e))},cidrv6(e){return this.check(/* @__PURE__ */ ji(Yo,e))},e164(e){return this.check(/* @__PURE__ */ Pi(Qo,e))},datetime(e){return this.check(/* @__PURE__ */ Ii(jo,e))},date(e){return this.check(/* @__PURE__ */ Li(Mo,e))},time(e){return this.check(/* @__PURE__ */ Ri(No,e))},duration(e){return this.check(/* @__PURE__ */ zi(Po,e))}});function W(e){return/* @__PURE__ */ pi(Ao,e)}let G=/*@__PURE__*/ k(`ZodStringFormat`,(e,t)=>{F.init(e,t),ko.init(e,t)}),jo=/*@__PURE__*/ k(`ZodISODateTime`,(e,t)=>{zn.init(e,t),G.init(e,t)}),Mo=/*@__PURE__*/ k(`ZodISODate`,(e,t)=>{Bn.init(e,t),G.init(e,t)}),No=/*@__PURE__*/ k(`ZodISOTime`,(e,t)=>{Vn.init(e,t),G.init(e,t)}),Po=/*@__PURE__*/ k(`ZodISODuration`,(e,t)=>{Hn.init(e,t),G.init(e,t)}),Fo=/*@__PURE__*/ k(`ZodEmail`,(e,t)=>{Cn.init(e,t),G.init(e,t)}),Io=/*@__PURE__*/ k(`ZodGUID`,(e,t)=>{xn.init(e,t),G.init(e,t)}),Lo=/*@__PURE__*/ k(`ZodUUID`,(e,t)=>{Sn.init(e,t),G.init(e,t)}),Ro=/*@__PURE__*/ k(`ZodURL`,(e,t)=>{jn.init(e,t),G.init(e,t)}),zo=/*@__PURE__*/ k(`ZodEmoji`,(e,t)=>{Mn.init(e,t),G.init(e,t)}),Bo=/*@__PURE__*/ k(`ZodNanoID`,(e,t)=>{Nn.init(e,t),G.init(e,t)}),Vo=/*@__PURE__*/ k(`ZodCUID`,(e,t)=>{Pn.init(e,t),G.init(e,t)}),Ho=/*@__PURE__*/ k(`ZodCUID2`,(e,t)=>{Fn.init(e,t),G.init(e,t)}),Uo=/*@__PURE__*/ k(`ZodULID`,(e,t)=>{In.init(e,t),G.init(e,t)}),Wo=/*@__PURE__*/ k(`ZodXID`,(e,t)=>{Ln.init(e,t),G.init(e,t)}),Go=/*@__PURE__*/ k(`ZodKSUID`,(e,t)=>{Rn.init(e,t),G.init(e,t)}),Ko=/*@__PURE__*/ k(`ZodIPv4`,(e,t)=>{Un.init(e,t),G.init(e,t)}),qo=/*@__PURE__*/ k(`ZodIPv6`,(e,t)=>{Kn.init(e,t),G.init(e,t)}),Jo=/*@__PURE__*/ k(`ZodCIDRv4`,(e,t)=>{qn.init(e,t),G.init(e,t)}),Yo=/*@__PURE__*/ k(`ZodCIDRv6`,(e,t)=>{Yn.init(e,t),G.init(e,t)}),Xo=/*@__PURE__*/ k(`ZodBase64`,(e,t)=>{Qn.init(e,t),G.init(e,t)}),Zo=/*@__PURE__*/ k(`ZodBase64URL`,(e,t)=>{tr.init(e,t),G.init(e,t)}),Qo=/*@__PURE__*/ k(`ZodE164`,(e,t)=>{nr.init(e,t),G.init(e,t)}),$o=/*@__PURE__*/ k(`ZodJWT`,(e,t)=>{ir.init(e,t),G.init(e,t)}),es=/*@__PURE__*/ k(`ZodNumber`,(e,t)=>{ar.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Me({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=V(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=V(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=V(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>V(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Ji(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Yi(e,t))},min(e,t){return this.check(/* @__PURE__ */ Yi(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Ki(e,t))},lte(e,t){return this.check(/* @__PURE__ */ qi(e,t))},max(e,t){return this.check(/* @__PURE__ */ qi(e,t))},int(e){return this.check(ns(e))},safe(e){return this.check(ns(e))},positive(e){return this.check(/* @__PURE__ */ Ji(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Yi(0,e))},negative(e){return this.check(/* @__PURE__ */ Ki(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ qi(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},step(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},finite(){return this}}));function K(e){return/* @__PURE__ */ Bi(es,e)}let ts=/*@__PURE__*/ k(`ZodNumberFormat`,(e,t)=>{or.init(e,t),es.init(e,t)});function ns(e){return/* @__PURE__ */ Vi(ts,e)}let rs=/*@__PURE__*/ k(`ZodBoolean`,(e,t)=>{sr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)});function q(e){return/* @__PURE__ */ Hi(rs,e)}let is=/*@__PURE__*/ k(`ZodNull`,(e,t)=>{cr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r)});function as(e){return/* @__PURE__ */ Ui(is,e)}let os=/*@__PURE__*/ k(`ZodUnknown`,(e,t)=>{lr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ss(){return/* @__PURE__ */ Wi(os)}let cs=/*@__PURE__*/ k(`ZodNever`,(e,t)=>{ur.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r)});function ls(e){return/* @__PURE__ */ Gi(cs,e)}let us=/*@__PURE__*/ k(`ZodArray`,(e,t)=>{Oo(),mr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Qi(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Qi(1,e))},max(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},length(e,t){return this.check(/* @__PURE__ */ $i(e,t))},unwrap(){return this.element}});function J(e,t){return/* @__PURE__ */ fa(us,e,t)}let ds=/*@__PURE__*/ k(`ZodObject`,(e,t)=>{Oo(),br.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),Re(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return _s(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y(this._zod.def,{catchall:ss()}))},loose(){return this.clone(y(this._zod.def,{catchall:ss()}))},strict(){return this.clone(y(this._zod.def,{catchall:ls()}))},strip(){return this.clone(y(this._zod.def,{catchall:void 0}))},extend(e){return me(this,e)},safeExtend(e){return ge(this,e)},merge(e){return _e(this,e)},pick(e){return de(this,e)},omit(e){return pe(this,e)},partial(...e){return ve(Ss,this,e[0])},exactPartial(...e){return ve(ws,this,e[0],`exactPartial`)},required(...e){return ye(Ms,this,e[0])}});function Y(e,t){let n={type:`object`,shape:e??{},...w(t)};return new ds(n)}let fs=/*@__PURE__*/ k(`ZodUnion`,(e,t)=>{Sr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e.options=t.options});function ps(e,t){return new fs({type:`union`,options:e,...w(t)})}let ms=/*@__PURE__*/ k(`ZodIntersection`,(e,t)=>{Cr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r)});function hs(e,t){return new ms({type:`intersection`,left:e,right:t})}let gs=/*@__PURE__*/ k(`ZodEnum`,(e,t)=>{Er.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new gs({...t,checks:[],...w(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new gs({...t,checks:[],...w(r),entries:i})}});function _s(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new gs({type:`enum`,entries:n,...w(t)})}let vs=/*@__PURE__*/ k(`ZodLiteral`,(e,t)=>{Dr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ys(e,t){return new vs({type:`literal`,values:Array.isArray(e)?e:[e],...w(t)})}let bs=/*@__PURE__*/ k(`ZodTransform`,(e,t)=>{Oo(),Or.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ke(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(ke(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xs(e){return new bs({type:`transform`,transform:e})}let Ss=/*@__PURE__*/ k(`ZodOptional`,(e,t)=>{Ar.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cs(e){return new Ss({type:`optional`,innerType:e})}let ws=/*@__PURE__*/ k(`ZodExactOptional`,(e,t)=>{jr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ts(e){return new ws({type:`optional`,innerType:e})}let Es=/*@__PURE__*/ k(`ZodNullable`,(e,t)=>{Mr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e){return new Es({type:`nullable`,innerType:e})}let Os=/*@__PURE__*/ k(`ZodDefault`,(e,t)=>{Nr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ks(e,t){return new Os({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ae(t)}})}let As=/*@__PURE__*/ k(`ZodPrefault`,(e,t)=>{Fr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e,t){return new As({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ae(t)}})}let Ms=/*@__PURE__*/ k(`ZodNonOptional`,(e,t)=>{Ir.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ns(e,t){return new Ms({type:`nonoptional`,innerType:e,...w(t)})}let Ps=/*@__PURE__*/ k(`ZodCatch`,(e,t)=>{zr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fs(e,t){return new Ps({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ze(t)})}let Is=/*@__PURE__*/ k(`ZodPipe`,(e,t)=>{Br.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.in=t.in,e.out=t.out});function Ls(e,t){return new Is({type:`pipe`,in:e,out:t})}let Rs=/*@__PURE__*/ k(`ZodReadonly`,(e,t)=>{Hr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zs(e){return new Rs({type:`readonly`,innerType:e})}let Bs=/*@__PURE__*/ k(`ZodCustom`,(e,t)=>{Wr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r)});function Vs(e,t){return/* @__PURE__ */ pa(Bs,e??(()=>!0),t)}function Hs(e,t={}){return/* @__PURE__ */ ma(Bs,e,t)}function Us(e,t){return/* @__PURE__ */ ha(e,t)}let X=K().finite(),Ws=K().int().nonnegative(),Gs=Y({hash:W(),gap:Y({parent:Ws,before:Ws.nullable(),row:q(),flow:q(),origin:Y({x:X,y:X}),room:X,line:Y({x:X,y:X,width:X,height:X})})}).nullable();function Ks(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}let qs={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Js(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?qs[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function Ys(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function Xs(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}let Z=K().finite(),Zs=K().int().nonnegative(),Qs=_s([`block`,`vertical`,`horizontal`,`wrap`,`grid`]),$s=Y({top:Z,right:Z,bottom:Z,left:Z}),ec=Y({flow:Qs,inline:q(),direction:W(),wrap:W(),justify:W(),alignItems:W(),ownJustify:q(),rowGap:Z,columnGap:Z,padding:$s,parent:Qs,parentAlignItems:W(),width:Z,height:Z}),tc=Y({width:Z,height:Z}),nc=Y({kind:_s([`box`,`text`,`media`,`container`]),natural:tc.nullable(),hugsHeight:q(),inset:tc,sizing:Y({layout:ec,fills:q()}).nullable()}),rc=Y({left:Z,top:Z}),ic=Y({x:Z,y:Z,width:Z,height:Z}),ac=J(Y({index:Zs,box:ic,read:nc.nullable(),placed:rc.nullable(),nested:q(),margin:$s})).nullable(),oc=Y({hash:W(),ghosts:J(Y({index:Zs,box:ic,placed:rc.nullable()}))}).nullable(),sc=J(Y({index:Zs,right:Z,top:Z})),cc=Y({x:Z,y:Z}),lc=J(Y({opacity:Z,radius:Z,fontFamily:W(),fontSize:Z,fontWeight:Z,lineHeight:Z.nullable(),letterSpacing:Z,textAlign:W(),textDecorationLine:W(),textTransform:W(),textWrapStyle:W(),truncated:q(),display:W(),color:W(),bordered:q(),borderWidth:Z.nullable(),holdsText:q(),textOnly:q(),text:W(),keepsBreaks:q(),rotation:Y({degrees:Z.nullable(),scale:cc.nullable(),own:Y({rotate:Z.nullable().optional(),scale:cc.nullable().optional()}),translated:q()}),placement:Y({free:q(),left:Z,top:Z,width:Z.nullable(),height:Z.nullable(),inline:Y({width:W(),height:W()}),wordsLeft:Z.nullable()}),layout:ec,inline:Y({color:q(),backgroundColor:q(),background:q(),border:q()}),step:Y({step:W().nullable(),effect:W().nullable(),start:W().nullable()})})).nullable(),uc=Y({index:Zs,hash:W()}).nullable(),dc=ps([Y({kind:ys(`toggle-play`)}),Y({kind:ys(`seek`),seconds:K().finite()}),Y({kind:ys(`toggle-sound`)})]),fc=Y({tag:_s([`video`,`audio`]),playable:q(),paused:q(),time:K().finite(),length:Vs(e=>typeof e==`number`),muted:q(),mutedInFile:q(),controls:q(),autoplay:q(),loop:q()}).nullable(),Q=`frameboard-bridge`,pc=`data-frameboard-editing`,mc=[`element-box`,`element-boxes`,`gap-at`,`hide-strips`,`keep-previews`,`live-body`,`live-element`,`measure`,`media`,`media-act`,`overflow`,`paint`,`pick-at`,`pins`,`preview-style`,`restamp`,`text-edit`,`text-written`];function hc(e,t){let{data:n}=e;if(e.origin!==t||!Tc(n)||n.tag!==`frameboard-bridge`)return null;if(n.kind===`shown`){let{page:e,hash:t}=n;return typeof e==`string`&&e!==``&&(typeof t==`string`||t===null)?{tag:Q,kind:`shown`,page:e,hash:t}:null}if(typeof n.id!=`string`||n.id===``)return null;let{id:r}=n;switch(n.kind){case`request`:return typeof n.op==`string`&&mc.includes(n.op)?{tag:Q,kind:`request`,id:r,op:n.op,args:n.args}:null;case`reply`:return n.ok===!0?{tag:Q,kind:`reply`,id:r,ok:!0,value:n.value}:n.ok===!1&&typeof n.error==`string`?{tag:Q,kind:`reply`,id:r,ok:!1,error:n.error}:null;case`push`:return{tag:Q,kind:`push`,id:r,value:n.value};case`close`:return{tag:Q,kind:`close`,id:r};default:return null}}let $=K().int().nonnegative(),gc=Y({}).strict(),_c=Y({index:$,hash:W()}),vc=Y({x:K().finite(),y:K().finite()}),yc=Y({x:K().finite(),y:K().finite(),width:K().finite(),height:K().finite()}),bc=Y({left:K().finite(),top:K().finite(),right:K().finite(),bottom:K().finite()}),xc=ps([Y({kind:ys(`commit`),text:W(),breaks:q(),run:K().int().nonnegative().optional()}),Y({kind:ys(`closed`)})]),Sc={"element-box":{args:_c,value:bc.nullable()},"element-boxes":{args:Y({hash:W(),indexes:J($)}),value:J(Y({index:$,box:yc})).nullable()},"live-body":{args:gc,value:uc},"live-element":{args:Y({hash:W(),indexes:J($)}),value:lc},measure:{args:Y({hash:W(),indexes:J($)}),value:ac,push:ac},overflow:{args:gc,value:oc,push:oc},pins:{args:Y({indexes:J($)}),value:sc,push:sc},"pick-at":{args:Y({at:vc}),value:Y({hash:W().nullable(),chain:J(Y({index:$,tag:W()}))})},"gap-at":{args:Y({at:vc,carried:$.optional()}),value:Gs},"hide-strips":{args:gc,value:q()},"keep-previews":{args:gc,value:as()},media:{args:_c,value:fc,push:fc},"media-act":{args:_c.extend({act:dc}),value:q()},paint:{args:Y({fill:W()}),value:W().nullable()},"preview-style":{args:Y({index:$,property:W(),value:W().nullable()}),value:as()},restamp:{args:Y({hash:W()}),value:q()},"text-edit":{args:_c.extend({at:vc.optional()}),value:q(),push:xc},"text-written":{args:Y({edit:W(),written:q()}),value:as()}},Cc=Symbol(`refused`);function wc(e,t){let n=Sc[e].args.safeParse(t);return n.success?n.data:Cc}function Tc(e){return typeof e==`object`&&!!e}let Ec=/* @__PURE__ */ new Set([`html`,`body`]);function Dc(e,t){let r=[];for(let i=document.elementFromPoint(e,t);i&&!Ec.has(i.localName);i=i.parentElement){let e=n(document,i);e!==null&&r.push({index:e,tag:i.localName})}return r}let Oc=/* @__PURE__ */ new Set(/* @__PURE__ */ `area.br.col.embed.hr.iframe.img.input.link.meta.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`));function kc(e){if(e.localName===`body`)return!0;if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||Oc.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let t=getComputedStyle(e).display;return t.startsWith(`inline`)||t===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function Ac(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1,flow:!0};if(!t.endsWith(`flex`))return{row:!1,reverse:!1,flow:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`),flow:!0}}function jc(e){let t=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},n=e===document.body||e===document.documentElement?null:e;for(let r=e;r&&!n;)t(r)&&(n=r),r=r.parentElement;if(!n)return{x:0-scrollX,y:0-scrollY};let r=n.getBoundingClientRect();return{x:r.left+n.clientLeft-n.scrollLeft,y:r.top+n.clientTop-n.scrollTop}}function Mc(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function Nc(e){let t=document.body;if(!t)return null;let r=document.elementFromPoint(e.x,e.y);for(r&&t.contains(r)||(r=t);r&&!kc(r);)r=r.parentElement;let i=r&&n(document,r);if(!r||i==null)return null;let a=getComputedStyle(r),{row:o,reverse:s,flow:c}=Ac(a),l=[...r.children].flatMap(e=>{let t=n(document,e),r=e.getBoundingClientRect();return t!==null&&(r.width>0||r.height>0)?[{index:t,box:r}]:[]}),u=l.findIndex(({box:t})=>Mc(e,t,o,s)),d=u===-1?l.at(-1):l[u-1],f=u===-1?void 0:l[u],p=e=>Number.parseFloat(a.getPropertyValue(`padding-${e}`))||0;return{parent:i,before:f?.index??null,row:o,flow:c,origin:jc(r),room:Math.max(0,r.clientWidth-p(`left`)-p(`right`)),line:Pc(r.getBoundingClientRect(),a,o,s,{after:d?.box,ahead:f?.box})}}function Pc(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function Fc(e,t){let i=Nc(e),a=r(document,t),o=i?r(document,i.parent):null;if(!i||!a||!o||a.contains(o))return null;let s=a.nextElementSibling;return o===a.parentElement&&(i.before===t||i.before===(s?n(document,s):null))?null:i}function Ic(e){if(!document.body)return null;let t=document.createElement(`div`);t.style.background=e,document.body.append(t);let n=getComputedStyle(t).backgroundColor;return t.remove(),n}let Lc={"pick-at":({at:e})=>({hash:i(document),chain:Dc(e.x,e.y)}),"gap-at":({at:e,carried:t})=>{let n=i(document),r=t===void 0?Nc(e):Fc(e,t);return n&&r?{hash:n,gap:r}:null},paint:({fill:e})=>Ic(e)};function Rc(e,t){e.readyState===`loading`?e.addEventListener(`DOMContentLoaded`,t,{once:!0}):t()}function zc(e){return i(document)===e.hash?r(document,e.index):null}let Bc={step:`data-step`,effect:`data-step-effect`,start:`data-step-start`};function Vc(e){return Math.round(parseFloat(e)*100)/100}function Hc(e,t){let n=e.parentElement,r=n?getComputedStyle(n):null,i=e instanceof HTMLElement?e:null,a=e=>Vc(e)||0;return{flow:Ks(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!i?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:a(t.rowGap),columnGap:t.columnGap===`normal`?0:a(t.columnGap),padding:{top:a(t.paddingTop),right:a(t.paddingRight),bottom:a(t.paddingBottom),left:a(t.paddingLeft)},parent:r?Ks(r.display,r.flexDirection,r.flexWrap):`block`,parentAlignItems:r?.alignItems??`normal`,width:Math.round(i?.offsetWidth??0),height:Math.round(i?.offsetHeight??0)}}function Uc(e){let t=getComputedStyle(e),n=e.textContent??``,r=[t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth];return{opacity:Number(t.opacity),radius:Math.round(parseFloat(t.borderTopLeftRadius)||0),fontFamily:t.fontFamily,fontSize:Vc(t.fontSize),fontWeight:Number(t.fontWeight),lineHeight:t.lineHeight===`normal`?null:Vc(t.lineHeight),letterSpacing:t.letterSpacing===`normal`?0:Vc(t.letterSpacing),textAlign:Jc(t.textAlign,t.direction),textDecorationLine:t.textDecorationLine,textTransform:t.textTransform,textWrapStyle:t.getPropertyValue(`text-wrap-style`)||`auto`,truncated:t.textOverflow===`ellipsis`&&t.overflowX!==`visible`&&t.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:t.display,color:t.color,bordered:r.some(e=>parseFloat(e)>0),borderWidth:r.every(e=>e===r[0])?Vc(t.borderTopWidth):null,holdsText:n.trim()!==``,textOnly:e.childElementCount===0&&n.trim()!==``,text:n,keepsBreaks:t.whiteSpace!==`normal`&&t.whiteSpace!==`nowrap`,rotation:{degrees:Js(t.rotate),scale:Ys(t.scale),own:Kc(e),translated:Xs(t.transform)},placement:Wc(e,t),layout:Hc(e,t),inline:qc(e),step:{step:e.getAttribute(Bc.step),effect:e.getAttribute(Bc.effect),start:e.getAttribute(Bc.start)}}}function Wc(e,t){let n=t.position===`absolute`||t.position===`fixed`,r=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},i=r(t.width),a=r(t.height),o=e instanceof HTMLElement?e.style:null,s={width:o?.getPropertyValue(`width`)??``,height:o?.getPropertyValue(`height`)??``};if(n&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:n,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:i,height:a,inline:s,wordsLeft:null};let c=e.parentElement,l=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},u=null;if(t.position!==`fixed`){if(!n&&c&&c!==document.body&&c!==document.documentElement)u=c;else for(let e=c;e&&!u;e=e.parentElement)l(e)&&(u=e)}let d=t.position===`fixed`?0:-scrollX,f=t.position===`fixed`?0:-scrollY;if(u){let e=u.getBoundingClientRect();d=e.left+u.clientLeft-u.scrollLeft,f=e.top+u.clientTop-u.scrollTop}let p=e.getBoundingClientRect(),m=parseFloat(t.marginLeft)||0,h=Gc(e,t);return{free:n,left:Math.round(p.left-d-m),top:Math.round(p.top-f-(parseFloat(t.marginTop)||0)),width:i,height:a,inline:s,wordsLeft:h===null?null:Math.round(h-d-m)}}function Gc(e,t){if(!(e.childNodes.length>0&&[...e.childNodes].every(e=>e.nodeType===Node.TEXT_NODE)&&e.textContent?.trim()))return null;let n=document.createRange();n.selectNodeContents(e);let r=(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.paddingLeft)||0);return n.getBoundingClientRect().left-r}function Kc(e){let t=e instanceof HTMLElement?e:null,n=!!t?.style.getPropertyValue(`rotate`),r=!!t?.style.getPropertyValue(`scale`);if(!t||!n&&!r)return{};let i=t.getAttribute(`style`);t.style.removeProperty(`rotate`),t.style.removeProperty(`scale`);let a=getComputedStyle(t),o={...n?{rotate:Js(a.rotate)}:{},...r?{scale:Ys(a.scale)}:{}};return i===null?t.removeAttribute(`style`):t.setAttribute(`style`,i),o}function qc(e){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 Jc(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}let Yc={"live-element":({hash:e,indexes:t})=>{if(i(document)!==e)return null;let n=t.flatMap(e=>{let t=r(document,e);return t?[Uc(t)]:[]});return n.length===t.length?n:null},"live-body":()=>{let e=i(document),t=document.body?n(document,document.body):null;return e!==null&&t!==null?{index:t,hash:e}:null}},Xc=/* @__PURE__ */ new Set([`html`,`body`]);function Zc(e){if(!e||Xc.has(e.localName))return null;if(e.localName===`img`||e.localName===`video`)return`media`;let t=(e.textContent??``).trim()!==``;return e.childElementCount>0?t&&[...e.children].every(Qc)?`text`:`container`:t?`text`:e.localName===`div`?`box`:null}function Qc(e){let t=getComputedStyle(e).display;return t===`inline`||t.startsWith(`inline-`)}function $c(e){let t=Zc(e),n=getComputedStyle(e);return!t||Js(n.rotate)!==0||(t===`text`||t===`container`)&&(n.display===`inline`||n.display===`contents`)?null:{kind:t,natural:rl(e),hugsHeight:t===`text`&&!il(e),inset:nl(n),sizing:t===`container`?tl(e,n):null}}let el=/* @__PURE__ */ new Set([`vertical`,`horizontal`,`wrap`]);function tl(e,t){let n=Hc(e,t);return{layout:n,fills:el.has(n.parent)&&(parseFloat(t.flexGrow)||0)>0}}function nl(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 rl(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 il(e){let t=e instanceof HTMLElement?e.style.height:``;return t!==``&&t!==`auto`}function al(e,t){if(t.some(t=>t!==e&&t.contains(e)))return null;let n=getComputedStyle(e);if(n.position!==`absolute`&&n.position!==`fixed`)return null;let r=parseFloat(n.left),i=parseFloat(n.top);return Number.isNaN(r)||Number.isNaN(i)?null:{left:r,top:i}}function ol(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 sl(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 cl(e){let t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function ll(e,t){if(i(document)!==e)return null;let n=t.flatMap(e=>{let t=r(document,e);return t?[t]:[]});return n.length===t.length?n:null}function ul(e,t){return t.map((n,r)=>({index:e[r]??0,box:sl(n),read:$c(n),placed:al(n,[]),nested:t.some(e=>e!==n&&e.contains(n)),margin:ol(n)}))}function dl(){let e=document.body;if(!e)return[];let n=innerWidth,r=innerHeight,i=[],a=[];return t(document).forEach((t,o)=>{if(!e.contains(t)||t===e||a.some(e=>e.contains(t))||getComputedStyle(t).position===`fixed`)return;let s=t.getBoundingClientRect();(s.width!==0||s.height!==0)&&(s.left<-1||s.top<-1||s.right>n+1||s.bottom>r+1)&&!fl(t,e)&&(a.push(t),i.push({index:o,box:sl(t),placed:al(t,[])}))}),i}function fl(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 pl(){let e=i(document);return e===null?null:{hash:e,ghosts:dl()}}function ml(e){return e.flatMap(e=>{let t=r(document,e)?.getBoundingClientRect();return t?[{index:e,right:t.right,top:t.top}]:[]})}function hl(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 gl={"element-boxes":({hash:e,indexes:t})=>i(document)===e?t.flatMap(e=>{let t=r(document,e),n=t?cl(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=ll(e,t);return i?(r(hl(i,()=>n(ul(t,i)),i.length>1)),ul(t,i)):null},overflow:(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(pl())}))},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)}),pl()},pins:({indexes:e},{push:t,onClose:n})=>(n(hl(e.flatMap(e=>{let t=r(document,e);return t?[t]:[]}),()=>t(ml(e)),!1)),ml(e))},_l=[`play`,`pause`,`timeupdate`,`durationchange`,`loadedmetadata`,`volumechange`,`seeked`,`error`,`emptied`];function vl(e){let t=zc(e);return t instanceof HTMLMediaElement?t:null}function yl(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 bl(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}}let xl=`frameboard-media-strip`;function Sl(){if(document.getElementById(xl))return()=>{};let t=document.createElement(`style`);return t.id=xl,t.setAttribute(e,``),t.textContent=`video::-webkit-media-controls { display: none !important }`,document.head?.append(t),()=>t.remove()}let Cl={media:(e,{push:t,onClose:n})=>{let r=vl(e);if(!r)return null;let i=()=>t(yl(r));for(let e of _l)r.addEventListener(e,i);return n(()=>{for(let e of _l)r.removeEventListener(e,i)}),yl(r)},"media-act":({act:e,...t})=>{let n=vl(t);return n?(bl(n,e),!0):!1},"hide-strips":(e,{onClose:t})=>(t(Sl()),!0)},wl=/* @__PURE__ */ new Map;function Tl(e,t,n){let i=`${e}:${t}`,a=r(document,e),o=a instanceof HTMLElement?a:null,s=wl.get(i);if(n===null){if(wl.delete(i),!s||s.element!==o||!o)return;s.value===``?s.attribute===null?o.removeAttribute(`style`):o.setAttribute(`style`,s.attribute):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&wl.set(i,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),attribute:o.getAttribute(`style`)}),o.style.setProperty(t,n,`important`))}function El(t){return{"preview-style":({index:e,property:t,value:n})=>(Tl(e,t,n),null),"keep-previews":()=>(wl.clear(),null),restamp:({hash:n})=>{let r=document.querySelector(`style[${e}]`);return r?(r.setAttribute(`data-hash`,n),t(),!0):!1}}}let Dl=/\r\n|\r/g,Ol=/\n+$/,kl=/[\t\n\f\r ]+/g;function Al(e){let{whiteSpace:t}=getComputedStyle(e);return t===`normal`||t===`nowrap`}function jl(e,t,n){if(!(e instanceof HTMLElement))return null;if(e.childElementCount>0){let r=n&&Ml(e,n);return r?Nl(e,r,t):null}if((e.textContent??``).trim()===``)return null;let r=e,i=r.textContent??``,a=Al(r),o=a?i.replace(kl,` `).trim():i,s=r.style.whiteSpace;o!==i&&(r.textContent=o);let c=!0,l=()=>{c=!1,r.removeAttribute(`contenteditable`),r.removeAttribute(pc),r.removeEventListener(`keydown`,h),r.removeEventListener(`paste`,g),r.removeEventListener(`blur`,m),window.removeEventListener(`pagehide`,p)},u=()=>{r.textContent=i,r.style.whiteSpace=s},d=()=>{r.isConnected&&u()},f=()=>{c&&(l(),u())};function p(){l(),t({kind:`closed`},d)}function m(){if(!c)return;l();let e=(r.textContent??``).replace(Dl,`
|
|
116
|
-
`).replace(
|
|
115
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function xa(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;xa(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}let Sa=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Ca=[`oneOf`,`anyOf`];function wa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ta(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Sa.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??wa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}p(n,r,e.length===1?e[0]:Ta(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=wa(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Ea(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Sa)if(t in e)return;let n=t.filter(e=>Ca.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ta(t);else{let e=n[0],i=Ca.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ta([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,_a(e,r))}function Da(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):_a(i,s),_a(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())xa(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Ea(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}_a(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,p(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ka(t,`input`,e.processors),output:ka(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function R(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return R(r.element,n);if(r.type===`set`)return R(r.valueType,n);if(r.type===`lazy`)return R(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return R(r.innerType,n);if(r.type===`intersection`)return R(r.left,n)||R(r.right,n);if(r.type===`record`||r.type===`map`)return R(r.keyType,n)||R(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:R(r.in,n)||R(r.out,n);if(r.type===`object`){for(let e in r.shape)if(R(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(R(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(R(e,n))return!0;return!!(r.rest&&R(r.rest,n))}return!1}let Oa=(e,t={})=>n=>{let r=va({...n,processors:t});return L(e,r),ba(r,e),Da(r,e)},ka=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=va({...i??{},target:a,io:t,processors:n});return L(e,o),ba(o,e),Da(o,e)},z=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},B=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Aa=(e,t)=>{z(e,`minimum`,t),B(e,`maximum`,t)},ja=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ma=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Na=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Pa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Fa=(e,t)=>z(e,`minimum`,t.minimum),Ia=(e,t)=>B(e,`maximum`,t.maximum),La=e=>(t,n)=>{Pa(t,n.format);let[r,i]=e[n.format];z(t,`minimum`,r),B(t,`maximum`,i)},Ra={greater_than:(e,t)=>z(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>B(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ja(e,t.value),number_format:La(ue),bigint_format:La(de),min_length:Fa,max_length:Ia,length_equals:(e,t)=>Aa(e,t.length),min_size:Fa,max_size:Ia,size_equals:(e,t)=>Aa(e,t.size),string_format:(e,t)=>{Pa(e,t.format),t.pattern&&Ma(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Na(e,t.mime)};function V(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ra[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&z(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&z(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&B(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&B(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ja(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Na(t,i.mime);for(let e of i.patterns??[])Ma(t,e);return t}let za={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ba=/* @__PURE__ */ new Map([[Qn,It],[er,Lt]]),Va=e=>Ba.get(e)??e,Ha=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=V(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=za[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Va);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ua=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=V(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):I(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Wa=(e,t,n,r)=>{n.type=`boolean`},Ga=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ka=(e,t,n,r)=>{n.not={}},qa=(e,t,n,r)=>{let i=e._zod.def,o=a(i.entries);o.length===0?n.not={}:(o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o)},Ja=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(I(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(I(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ya=(e,t,n,r)=>{I(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Xa=(e,t,n,r)=>{I(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Za=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=V(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=L(a.element,t,{...r,path:[...r.path,`items`]})};function Qa(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Qa(t.out):t.type===`catch`?Qa(t.innerType):e._zod.optin}let $a=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&I(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)p(i.properties,e,L(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Qa(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=L(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},eo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>L(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},to=(e,t,n,r)=>{let i=e._zod.def,a=L(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=L(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},no=(e,t,n,r)=>{let i=e._zod.def,a=L(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ro=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},io=Symbol();function ao(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(I(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),io):JSON.parse(o)}let oo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n.default=o)},so=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ao(i.defaultValue,e,t,n,r);o!==io&&(n._prefault=o)},co=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{I(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},lo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;L(o,t,r);let s=t.seen.get(e);s.ref=o},uo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},fo=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},po=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function mo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let H=/*@__PURE__*/ O(`ZodError`,(e,t)=>{Ze.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);po.has(n)||(po.add(n),mo(n,`format`,e=>t=>et(e,t)),mo(n,`flatten`,e=>t=>$e(e,t)),mo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}),mo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ho=/* @__PURE__ */ nt(H),go=/* @__PURE__ */ rt(H),_o=/* @__PURE__ */ it(H),vo=/* @__PURE__ */ ot(H),yo=/* @__PURE__ */ ft(H),bo=/* @__PURE__ */ pt(H),xo=/* @__PURE__ */ mt(H),So=/* @__PURE__ */ ht(H),Co=/* @__PURE__ */ gt(H),wo=/* @__PURE__ */ _t(H),To=/* @__PURE__ */ vt(H),Eo=/* @__PURE__ */ yt(H);function Do(){A.localeError||j(ci())}function Oo(){A.memoizer||j({memoizer:ai()})}let U=/*@__PURE__*/ O(`ZodType`,(e,t)=>(Do(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(y(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return S(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Hs(e,t))},superRefine(e,t){return this.check(Us(e,t))},overwrite(e){return this.check(/* @__PURE__ */ F(e))},optional(){return Cs(this)},exactOptional(){return Ts(this)},nullable(){return Ds(this)},nullish(){return Cs(Ds(this))},nonoptional(e){return Ns(this,e)},array(){return J(this)},or(e){return ps([this,e])},and(e){return hs(this,e)},transform(e){return Ls(this,xs(e))},default(e){return ks(this,e)},prefault(e){return js(this,e)},catch(e){return Fs(this,e)},pipe(e){return Ls(this,e)},readonly(){return zs(this)},describe(e){let t=this.clone();return fi.add(t,{description:e}),t},meta(...e){if(e.length===0)return fi.get(this);let t=this.clone();return fi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Me(this,`~standard`,{...bn(this),jsonSchema:{input:ka(this,`input`),output:ka(this,`output`)}})},set"~standard"(e){E(this,`~standard`,e)},parse:function e(t,n){return ho(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await go(this,t,n,{callee:e})},safeParse(e,t){return _o(this,e,t)},async safeParseAsync(e,t){return vo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){E(this,`spa`,e)},validate(e,t){return lt(this,e,t)},validateAsync(e,t){return dt(this,e,t)},encode:function e(t,n){return yo(this,t,n,{callee:e})},decode:function e(t,n){return bo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await xo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await So(this,t,n,{callee:e})},safeEncode(e,t){return Co(this,e,t)},safeDecode(e,t){return wo(this,e,t)},async safeEncodeAsync(e,t){return To(this,e,t)},async safeDecodeAsync(e,t){return Eo(this,e,t)},toJSONSchema(e){return Oa(this,{})(e)},get description(){return fi.get(this)?.description},get _def(){return this._zod.def}}),ko=/*@__PURE__*/ O(`_ZodString`,(e,t)=>{xn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r)},/*@__PURE__*/ Ne({format:e=>V(e).format??null,minLength:e=>V(e).minimum??null,maxLength:e=>V(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ ta(...e))},includes(...e){return this.check(/* @__PURE__ */ ia(...e))},startsWith(...e){return this.check(/* @__PURE__ */ aa(...e))},endsWith(...e){return this.check(/* @__PURE__ */ oa(...e))},min(...e){return this.check(/* @__PURE__ */ $i(...e))},max(...e){return this.check(/* @__PURE__ */ Qi(...e))},length(...e){return this.check(/* @__PURE__ */ ea(...e))},nonempty(...e){return this.check(/* @__PURE__ */ $i(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ na(e))},uppercase(e){return this.check(/* @__PURE__ */ ra(e))},trim(){return this.check(/* @__PURE__ */ ca())},normalize(...e){return this.check(/* @__PURE__ */ sa(...e))},toLowerCase(){return this.check(/* @__PURE__ */ la())},toUpperCase(){return this.check(/* @__PURE__ */ ua())},slugify(){return this.check(/* @__PURE__ */ da())}})),Ao=/*@__PURE__*/ O(`ZodString`,(e,t)=>{xn.init(e,t),ko.init(e,t)},{email(e){return this.check(/* @__PURE__ */ hi(Fo,e))},url(e){return this.check(/* @__PURE__ */ xi(Ro,e))},jwt(e){return this.check(/* @__PURE__ */ Ii($o,e))},emoji(e){return this.check(/* @__PURE__ */ Si(zo,e))},guid(e){return this.check(/* @__PURE__ */ gi(Io,e))},uuid(e){return this.check(/* @__PURE__ */ _i(Lo,e))},uuidv4(e){return this.check(/* @__PURE__ */ vi(Lo,e))},uuidv6(e){return this.check(/* @__PURE__ */ yi(Lo,e))},uuidv7(e){return this.check(/* @__PURE__ */ bi(Lo,e))},nanoid(e){return this.check(/* @__PURE__ */ Ci(Bo,e))},cuid(e){return this.check(/* @__PURE__ */ wi(Vo,e))},cuid2(e){return this.check(/* @__PURE__ */ Ti(Ho,e))},ulid(e){return this.check(/* @__PURE__ */ Ei(Uo,e))},base64(e){return this.check(/* @__PURE__ */ Ni(Xo,e))},base64url(e){return this.check(/* @__PURE__ */ Pi(Zo,e))},xid(e){return this.check(/* @__PURE__ */ Di(Wo,e))},ksuid(e){return this.check(/* @__PURE__ */ Oi(Go,e))},ipv4(e){return this.check(/* @__PURE__ */ ki(Ko,e))},ipv6(e){return this.check(/* @__PURE__ */ Ai(qo,e))},cidrv4(e){return this.check(/* @__PURE__ */ ji(Jo,e))},cidrv6(e){return this.check(/* @__PURE__ */ Mi(Yo,e))},e164(e){return this.check(/* @__PURE__ */ Fi(Qo,e))},datetime(e){return this.check(/* @__PURE__ */ Li(jo,e))},date(e){return this.check(/* @__PURE__ */ Ri(Mo,e))},time(e){return this.check(/* @__PURE__ */ zi(No,e))},duration(e){return this.check(/* @__PURE__ */ Bi(Po,e))}});function W(e){return/* @__PURE__ */ mi(Ao,e)}let G=/*@__PURE__*/ O(`ZodStringFormat`,(e,t)=>{P.init(e,t),ko.init(e,t)}),jo=/*@__PURE__*/ O(`ZodISODateTime`,(e,t)=>{Bn.init(e,t),G.init(e,t)}),Mo=/*@__PURE__*/ O(`ZodISODate`,(e,t)=>{Vn.init(e,t),G.init(e,t)}),No=/*@__PURE__*/ O(`ZodISOTime`,(e,t)=>{Hn.init(e,t),G.init(e,t)}),Po=/*@__PURE__*/ O(`ZodISODuration`,(e,t)=>{Un.init(e,t),G.init(e,t)}),Fo=/*@__PURE__*/ O(`ZodEmail`,(e,t)=>{wn.init(e,t),G.init(e,t)}),Io=/*@__PURE__*/ O(`ZodGUID`,(e,t)=>{Sn.init(e,t),G.init(e,t)}),Lo=/*@__PURE__*/ O(`ZodUUID`,(e,t)=>{Cn.init(e,t),G.init(e,t)}),Ro=/*@__PURE__*/ O(`ZodURL`,(e,t)=>{Mn.init(e,t),G.init(e,t)}),zo=/*@__PURE__*/ O(`ZodEmoji`,(e,t)=>{Nn.init(e,t),G.init(e,t)}),Bo=/*@__PURE__*/ O(`ZodNanoID`,(e,t)=>{Pn.init(e,t),G.init(e,t)}),Vo=/*@__PURE__*/ O(`ZodCUID`,(e,t)=>{Fn.init(e,t),G.init(e,t)}),Ho=/*@__PURE__*/ O(`ZodCUID2`,(e,t)=>{In.init(e,t),G.init(e,t)}),Uo=/*@__PURE__*/ O(`ZodULID`,(e,t)=>{Ln.init(e,t),G.init(e,t)}),Wo=/*@__PURE__*/ O(`ZodXID`,(e,t)=>{Rn.init(e,t),G.init(e,t)}),Go=/*@__PURE__*/ O(`ZodKSUID`,(e,t)=>{zn.init(e,t),G.init(e,t)}),Ko=/*@__PURE__*/ O(`ZodIPv4`,(e,t)=>{Wn.init(e,t),G.init(e,t)}),qo=/*@__PURE__*/ O(`ZodIPv6`,(e,t)=>{qn.init(e,t),G.init(e,t)}),Jo=/*@__PURE__*/ O(`ZodCIDRv4`,(e,t)=>{Jn.init(e,t),G.init(e,t)}),Yo=/*@__PURE__*/ O(`ZodCIDRv6`,(e,t)=>{Xn.init(e,t),G.init(e,t)}),Xo=/*@__PURE__*/ O(`ZodBase64`,(e,t)=>{$n.init(e,t),G.init(e,t)}),Zo=/*@__PURE__*/ O(`ZodBase64URL`,(e,t)=>{nr.init(e,t),G.init(e,t)}),Qo=/*@__PURE__*/ O(`ZodE164`,(e,t)=>{rr.init(e,t),G.init(e,t)}),$o=/*@__PURE__*/ O(`ZodJWT`,(e,t)=>{ar.init(e,t),G.init(e,t)}),es=/*@__PURE__*/ O(`ZodNumber`,(e,t)=>{or.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Ne({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=V(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=V(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=V(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>V(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Yi(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},min(e,t){return this.check(/* @__PURE__ */ Xi(e,t))},lt(e,t){return this.check(/* @__PURE__ */ qi(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Ji(e,t))},max(e,t){return this.check(/* @__PURE__ */ Ji(e,t))},int(e){return this.check(ns(e))},safe(e){return this.check(ns(e))},positive(e){return this.check(/* @__PURE__ */ Yi(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Xi(0,e))},negative(e){return this.check(/* @__PURE__ */ qi(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Ji(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},step(e,t){return this.check(/* @__PURE__ */ Zi(e,t))},finite(){return this}}));function K(e){return/* @__PURE__ */ Vi(es,e)}let ts=/*@__PURE__*/ O(`ZodNumberFormat`,(e,t)=>{sr.init(e,t),es.init(e,t)});function ns(e){return/* @__PURE__ */ Hi(ts,e)}let rs=/*@__PURE__*/ O(`ZodBoolean`,(e,t)=>{cr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)});function q(e){return/* @__PURE__ */ Ui(rs,e)}let is=/*@__PURE__*/ O(`ZodNull`,(e,t)=>{lr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r)});function as(e){return/* @__PURE__ */ Wi(is,e)}let os=/*@__PURE__*/ O(`ZodUnknown`,(e,t)=>{ur.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ss(){return/* @__PURE__ */ Gi(os)}let cs=/*@__PURE__*/ O(`ZodNever`,(e,t)=>{dr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r)});function ls(e){return/* @__PURE__ */ Ki(cs,e)}let us=/*@__PURE__*/ O(`ZodArray`,(e,t)=>{Oo(),hr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ $i(e,t))},nonempty(e){return this.check(/* @__PURE__ */ $i(1,e))},max(e,t){return this.check(/* @__PURE__ */ Qi(e,t))},length(e,t){return this.check(/* @__PURE__ */ ea(e,t))},unwrap(){return this.element}});function J(e,t){return/* @__PURE__ */ fa(us,e,t)}let ds=/*@__PURE__*/ O(`ZodObject`,(e,t)=>{Oo(),xr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),ze(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return _s(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y(this._zod.def,{catchall:ss()}))},loose(){return this.clone(y(this._zod.def,{catchall:ss()}))},strict(){return this.clone(y(this._zod.def,{catchall:ls()}))},strip(){return this.clone(y(this._zod.def,{catchall:void 0}))},extend(e){return he(this,e)},safeExtend(e){return _e(this,e)},merge(e){return ve(this,e)},pick(e){return fe(this,e)},omit(e){return me(this,e)},partial(...e){return ye(Ss,this,e[0])},exactPartial(...e){return ye(ws,this,e[0],`exactPartial`)},required(...e){return be(Ms,this,e[0])}});function Y(e,t){let n={type:`object`,shape:e??{},...C(t)};return new ds(n)}let fs=/*@__PURE__*/ O(`ZodUnion`,(e,t)=>{Cr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e.options=t.options});function ps(e,t){return new fs({type:`union`,options:e,...C(t)})}let ms=/*@__PURE__*/ O(`ZodIntersection`,(e,t)=>{wr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r)});function hs(e,t){return new ms({type:`intersection`,left:e,right:t})}let gs=/*@__PURE__*/ O(`ZodEnum`,(e,t)=>{Dr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new gs({...t,checks:[],...C(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new gs({...t,checks:[],...C(r),entries:i})}});function _s(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new gs({type:`enum`,entries:n,...C(t)})}let vs=/*@__PURE__*/ O(`ZodLiteral`,(e,t)=>{Or.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ys(e,t){return new vs({type:`literal`,values:Array.isArray(e)?e:[e],...C(t)})}let bs=/*@__PURE__*/ O(`ZodTransform`,(e,t)=>{Oo(),kr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ge(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ae(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ae(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xs(e){return new bs({type:`transform`,transform:e})}let Ss=/*@__PURE__*/ O(`ZodOptional`,(e,t)=>{jr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cs(e){return new Ss({type:`optional`,innerType:e})}let ws=/*@__PURE__*/ O(`ZodExactOptional`,(e,t)=>{Mr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ts(e){return new ws({type:`optional`,innerType:e})}let Es=/*@__PURE__*/ O(`ZodNullable`,(e,t)=>{Nr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e){return new Es({type:`nullable`,innerType:e})}let Os=/*@__PURE__*/ O(`ZodDefault`,(e,t)=>{Pr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ks(e,t){return new Os({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ae(t)}})}let As=/*@__PURE__*/ O(`ZodPrefault`,(e,t)=>{Ir.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e,t){return new As({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ae(t)}})}let Ms=/*@__PURE__*/ O(`ZodNonOptional`,(e,t)=>{Lr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ns(e,t){return new Ms({type:`nonoptional`,innerType:e,...C(t)})}let Ps=/*@__PURE__*/ O(`ZodCatch`,(e,t)=>{Br.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fs(e,t){return new Ps({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Be(t)})}let Is=/*@__PURE__*/ O(`ZodPipe`,(e,t)=>{Vr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.in=t.in,e.out=t.out});function Ls(e,t){return new Is({type:`pipe`,in:e,out:t})}let Rs=/*@__PURE__*/ O(`ZodReadonly`,(e,t)=>{Ur.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zs(e){return new Rs({type:`readonly`,innerType:e})}let Bs=/*@__PURE__*/ O(`ZodCustom`,(e,t)=>{Gr.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r)});function Vs(e,t){return/* @__PURE__ */ pa(Bs,e??(()=>!0),t)}function Hs(e,t={}){return/* @__PURE__ */ ma(Bs,e,t)}function Us(e,t){return/* @__PURE__ */ ha(e,t)}let X=K().finite(),Ws=K().int().nonnegative(),Gs=Y({hash:W(),gap:Y({parent:Ws,before:Ws.nullable(),row:q(),flow:q(),origin:Y({x:X,y:X}),room:X,line:Y({x:X,y:X,width:X,height:X})})}).nullable();function Ks(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}let qs={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Js(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?qs[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function Ys(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function Xs(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}let Z=K().finite(),Zs=K().int().nonnegative(),Qs=_s([`block`,`vertical`,`horizontal`,`wrap`,`grid`]),$s=Y({top:Z,right:Z,bottom:Z,left:Z}),ec=Y({flow:Qs,inline:q(),direction:W(),wrap:W(),justify:W(),alignItems:W(),ownJustify:q(),rowGap:Z,columnGap:Z,padding:$s,parent:Qs,parentAlignItems:W(),width:Z,height:Z}),tc=Y({width:Z,height:Z}),nc=Y({kind:_s([`box`,`text`,`media`,`container`]),natural:tc.nullable(),hugsHeight:q(),inset:tc,sizing:Y({layout:ec,fills:q()}).nullable()}),rc=Y({left:Z,top:Z}),ic=Y({x:Z,y:Z,width:Z,height:Z}),ac=J(Y({index:Zs,box:ic,read:nc.nullable(),placed:rc.nullable(),nested:q(),margin:$s})).nullable(),oc=Y({hash:W(),ghosts:J(Y({index:Zs,box:ic,placed:rc.nullable()}))}).nullable(),sc=J(Y({index:Zs,right:Z,top:Z})),cc=Y({x:Z,y:Z}),lc=J(Y({opacity:Z,radius:Z,fontFamily:W(),fontSize:Z,fontWeight:Z,lineHeight:Z.nullable(),letterSpacing:Z,textAlign:W(),textDecorationLine:W(),textTransform:W(),textWrapStyle:W(),truncated:q(),display:W(),color:W(),bordered:q(),borderWidth:Z.nullable(),holdsText:q(),textOnly:q(),text:W(),keepsBreaks:q(),rotation:Y({degrees:Z.nullable(),scale:cc.nullable(),own:Y({rotate:Z.nullable().optional(),scale:cc.nullable().optional()}),translated:q(),transform:Y({own:W(),ruled:q(),reanchors:q()})}),placement:Y({free:q(),left:Z,top:Z,width:Z.nullable(),height:Z.nullable(),inline:Y({width:W(),height:W()}),wordsLeft:Z.nullable()}),layout:ec,inline:Y({color:q(),backgroundColor:q(),background:q(),border:q()}),step:Y({step:W().nullable(),effect:W().nullable(),start:W().nullable()})})).nullable(),uc=Y({index:Zs,hash:W()}).nullable(),dc=ps([Y({kind:ys(`toggle-play`)}),Y({kind:ys(`seek`),seconds:K().finite()}),Y({kind:ys(`toggle-sound`)}),Y({kind:ys(`set-flag`),name:_s([`controls`,`autoplay`,`loop`,`muted`]),on:q()})]),fc=Y({tag:_s([`video`,`audio`]),playable:q(),paused:q(),time:K().finite(),length:Vs(e=>typeof e==`number`),muted:q(),mutedInFile:q(),controls:q(),autoplay:q(),loop:q()}).nullable(),Q=`frameboard-bridge`,pc=`data-frameboard-editing`,mc=[`element-box`,`element-boxes`,`gap-at`,`hide-strips`,`keep-previews`,`live-body`,`live-element`,`measure`,`media`,`media-act`,`overflow`,`paint`,`pick-at`,`pins`,`preview-style`,`restamp`,`text-edit`,`text-written`];function hc(e,t){let{data:n}=e;if(e.origin!==t||!Tc(n)||n.tag!==`frameboard-bridge`)return null;if(n.kind===`shown`){let{page:e,hash:t}=n;return typeof e==`string`&&e!==``&&(typeof t==`string`||t===null)?{tag:Q,kind:`shown`,page:e,hash:t}:null}if(typeof n.id!=`string`||n.id===``)return null;let{id:r}=n;switch(n.kind){case`request`:return typeof n.op==`string`&&mc.includes(n.op)?{tag:Q,kind:`request`,id:r,op:n.op,args:n.args}:null;case`reply`:return n.ok===!0?{tag:Q,kind:`reply`,id:r,ok:!0,value:n.value}:n.ok===!1&&typeof n.error==`string`?{tag:Q,kind:`reply`,id:r,ok:!1,error:n.error}:null;case`push`:return{tag:Q,kind:`push`,id:r,value:n.value};case`close`:return{tag:Q,kind:`close`,id:r};default:return null}}let $=K().int().nonnegative(),gc=Y({}).strict(),_c=Y({index:$,hash:W()}),vc=Y({x:K().finite(),y:K().finite()}),yc=Y({x:K().finite(),y:K().finite(),width:K().finite(),height:K().finite()}),bc=Y({left:K().finite(),top:K().finite(),right:K().finite(),bottom:K().finite()}),xc=ps([Y({kind:ys(`commit`),text:W(),breaks:q(),run:K().int().nonnegative().optional()}),Y({kind:ys(`closed`)})]),Sc={"element-box":{args:_c,value:bc.nullable()},"element-boxes":{args:Y({hash:W(),indexes:J($)}),value:J(Y({index:$,box:yc})).nullable()},"live-body":{args:gc,value:uc},"live-element":{args:Y({hash:W(),indexes:J($)}),value:lc},measure:{args:Y({hash:W(),indexes:J($)}),value:ac,push:ac},overflow:{args:gc,value:oc,push:oc},pins:{args:Y({indexes:J($)}),value:sc,push:sc},"pick-at":{args:Y({at:vc}),value:Y({hash:W().nullable(),chain:J(Y({index:$,tag:W()}))})},"gap-at":{args:Y({at:vc,carried:$.optional()}),value:Gs},"hide-strips":{args:gc,value:q()},"keep-previews":{args:gc,value:as()},media:{args:_c,value:fc,push:fc},"media-act":{args:_c.extend({act:dc}),value:q()},paint:{args:Y({fill:W()}),value:W().nullable()},"preview-style":{args:Y({index:$,property:W(),value:W().nullable()}),value:as()},restamp:{args:Y({hash:W()}),value:q()},"text-edit":{args:_c.extend({at:vc.optional()}),value:q(),push:xc},"text-written":{args:Y({edit:W(),written:q()}),value:as()}},Cc=Symbol(`refused`);function wc(e,t){let n=Sc[e].args.safeParse(t);return n.success?n.data:Cc}function Tc(e){return typeof e==`object`&&!!e}let Ec=/* @__PURE__ */ new Set([`html`,`body`]);function Dc(e,t){let r=[];for(let i=document.elementFromPoint(e,t);i&&!Ec.has(i.localName);i=i.parentElement){let e=n(document,i);e!==null&&r.push({index:e,tag:i.localName})}return r}let Oc=/* @__PURE__ */ new Set(/* @__PURE__ */ `area.br.col.embed.hr.iframe.img.input.link.meta.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`));function kc(e){if(e.localName===`body`)return!0;if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||Oc.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let t=getComputedStyle(e).display;return t.startsWith(`inline`)||t===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function Ac(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1,flow:!0};if(!t.endsWith(`flex`))return{row:!1,reverse:!1,flow:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`),flow:!0}}function jc(e){let t=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},n=e===document.body||e===document.documentElement?null:e;for(let r=e;r&&!n;)t(r)&&(n=r),r=r.parentElement;if(!n)return{x:0-scrollX,y:0-scrollY};let r=n.getBoundingClientRect();return{x:r.left+n.clientLeft-n.scrollLeft,y:r.top+n.clientTop-n.scrollTop}}function Mc(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function Nc(e){let t=document.body;if(!t)return null;let r=document.elementFromPoint(e.x,e.y);for(r&&t.contains(r)||(r=t);r&&!kc(r);)r=r.parentElement;let i=r&&n(document,r);if(!r||i==null)return null;let a=getComputedStyle(r),{row:o,reverse:s,flow:c}=Ac(a),l=[...r.children].flatMap(e=>{let t=n(document,e),r=e.getBoundingClientRect();return t!==null&&(r.width>0||r.height>0)?[{index:t,box:r}]:[]}),u=l.findIndex(({box:t})=>Mc(e,t,o,s)),d=u===-1?l.at(-1):l[u-1],f=u===-1?void 0:l[u],p=e=>Number.parseFloat(a.getPropertyValue(`padding-${e}`))||0;return{parent:i,before:f?.index??null,row:o,flow:c,origin:jc(r),room:Math.max(0,r.clientWidth-p(`left`)-p(`right`)),line:Pc(r.getBoundingClientRect(),a,o,s,{after:d?.box,ahead:f?.box})}}function Pc(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function Fc(e,t){let i=Nc(e),a=r(document,t),o=i?r(document,i.parent):null;if(!i||!a||!o||a.contains(o))return null;let s=a.nextElementSibling;return o===a.parentElement&&(i.before===t||i.before===(s?n(document,s):null))?null:i}function Ic(e){if(!document.body)return null;let t=document.createElement(`div`);t.style.background=e,document.body.append(t);let n=getComputedStyle(t).backgroundColor;return t.remove(),n}let Lc={"pick-at":({at:e})=>({hash:i(document),chain:Dc(e.x,e.y)}),"gap-at":({at:e,carried:t})=>{let n=i(document),r=t===void 0?Nc(e):Fc(e,t);return n&&r?{hash:n,gap:r}:null},paint:({fill:e})=>Ic(e)};function Rc(e,t){e.readyState===`loading`?e.addEventListener(`DOMContentLoaded`,t,{once:!0}):t()}function zc(e){return i(document)===e.hash?r(document,e.index):null}let Bc={step:`data-step`,effect:`data-step-effect`,start:`data-step-start`};function Vc(e){return Math.round(parseFloat(e)*100)/100}function Hc(e,t){let n=e.parentElement,r=n?getComputedStyle(n):null,i=e instanceof HTMLElement?e:null,a=e=>Vc(e)||0;return{flow:Ks(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!i?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:a(t.rowGap),columnGap:t.columnGap===`normal`?0:a(t.columnGap),padding:{top:a(t.paddingTop),right:a(t.paddingRight),bottom:a(t.paddingBottom),left:a(t.paddingLeft)},parent:r?Ks(r.display,r.flexDirection,r.flexWrap):`block`,parentAlignItems:r?.alignItems??`normal`,width:Math.round(i?.offsetWidth??0),height:Math.round(i?.offsetHeight??0)}}function Uc(e){let t=getComputedStyle(e),n=e.textContent??``,r=[t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth];return{opacity:Number(t.opacity),radius:Math.round(parseFloat(t.borderTopLeftRadius)||0),fontFamily:t.fontFamily,fontSize:Vc(t.fontSize),fontWeight:Number(t.fontWeight),lineHeight:t.lineHeight===`normal`?null:Vc(t.lineHeight),letterSpacing:t.letterSpacing===`normal`?0:Vc(t.letterSpacing),textAlign:Xc(t.textAlign,t.direction),textDecorationLine:t.textDecorationLine,textTransform:t.textTransform,textWrapStyle:t.getPropertyValue(`text-wrap-style`)||`auto`,truncated:t.textOverflow===`ellipsis`&&t.overflowX!==`visible`&&t.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:t.display,color:t.color,bordered:r.some(e=>parseFloat(e)>0),borderWidth:r.every(e=>e===r[0])?Vc(t.borderTopWidth):null,holdsText:n.trim()!==``,textOnly:e.childElementCount===0&&n.trim()!==``,text:n,keepsBreaks:t.whiteSpace!==`normal`&&t.whiteSpace!==`nowrap`,rotation:{degrees:Js(t.rotate),scale:Ys(t.scale),own:Kc(e),translated:Xs(t.transform),transform:qc(e,t)},placement:Wc(e,t),layout:Hc(e,t),inline:Yc(e),step:{step:e.getAttribute(Bc.step),effect:e.getAttribute(Bc.effect),start:e.getAttribute(Bc.start)}}}function Wc(e,t){let n=t.position===`absolute`||t.position===`fixed`,r=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},i=r(t.width),a=r(t.height),o=e instanceof HTMLElement?e.style:null,s={width:o?.getPropertyValue(`width`)??``,height:o?.getPropertyValue(`height`)??``};if(n&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:n,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:i,height:a,inline:s,wordsLeft:null};let c=e.parentElement,l=e=>{let t=getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},u=null;if(t.position!==`fixed`){if(!n&&c&&c!==document.body&&c!==document.documentElement)u=c;else for(let e=c;e&&!u;e=e.parentElement)l(e)&&(u=e)}let d=t.position===`fixed`?0:-scrollX,f=t.position===`fixed`?0:-scrollY;if(u){let e=u.getBoundingClientRect();d=e.left+u.clientLeft-u.scrollLeft,f=e.top+u.clientTop-u.scrollTop}let p=e.getBoundingClientRect(),m=parseFloat(t.marginLeft)||0,h=Gc(e,t);return{free:n,left:Math.round(p.left-d-m),top:Math.round(p.top-f-(parseFloat(t.marginTop)||0)),width:i,height:a,inline:s,wordsLeft:h===null?null:Math.round(h-d-m)}}function Gc(e,t){if(!(e.childNodes.length>0&&[...e.childNodes].every(e=>e.nodeType===Node.TEXT_NODE)&&e.textContent?.trim()))return null;let n=document.createRange();n.selectNodeContents(e);let r=(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.paddingLeft)||0);return n.getBoundingClientRect().left-r}function Kc(e){let t=e instanceof HTMLElement?e:null,n=!!t?.style.getPropertyValue(`rotate`),r=!!t?.style.getPropertyValue(`scale`);if(!t||!n&&!r)return{};let i=t.getAttribute(`style`);t.style.removeProperty(`rotate`),t.style.removeProperty(`scale`);let a=getComputedStyle(t),o={...n?{rotate:Js(a.rotate)}:{},...r?{scale:Ys(a.scale)}:{}};return i===null?t.removeAttribute(`style`):t.setAttribute(`style`,i),o}function qc(e,t){let n=e instanceof HTMLElement?e.style.getPropertyValue(`transform`):``;return{own:n,ruled:n===``&&t.transform!==`none`,reanchors:t.transform===`none`&&Jc(e,t)}}function Jc(e,t){let n=t.position!==`static`;for(let t of e.querySelectorAll(`*`)){let r=getComputedStyle(t).position;if(r!==`fixed`&&(r!==`absolute`||n))continue;let i=!1;for(let n=t.parentElement;n&&n!==e&&!i;n=n.parentElement){let e=getComputedStyle(n);i=e.transform!==`none`||r===`absolute`&&e.position!==`static`}if(!i)return!0}return!1}function Yc(e){let t=e instanceof HTMLElement?e.style:null,n=t?Array.from({length:t.length},(e,n)=>t.item(n)):[];return{color:n.includes(`color`),backgroundColor:n.includes(`background-color`),background:/(?:^|;)\s*background\s*:/i.test(e.getAttribute(`style`)??``),border:n.some(e=>e.startsWith(`border-`)&&!e.endsWith(`-radius`))}}function Xc(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}let Zc={"live-element":({hash:e,indexes:t})=>{if(i(document)!==e)return null;let n=t.flatMap(e=>{let t=r(document,e);return t?[Uc(t)]:[]});return n.length===t.length?n:null},"live-body":()=>{let e=i(document),t=document.body?n(document,document.body):null;return e!==null&&t!==null?{index:t,hash:e}:null}},Qc=/* @__PURE__ */ new Set([`html`,`body`]);function $c(e){if(!e||Qc.has(e.localName))return null;if(e.localName===`img`||e.localName===`video`)return`media`;let t=(e.textContent??``).trim()!==``;return e.childElementCount>0?t&&[...e.children].every(el)?`text`:`container`:t?`text`:e.localName===`div`?`box`:null}function el(e){let t=getComputedStyle(e).display;return t===`inline`||t.startsWith(`inline-`)}function tl(e){let t=$c(e),n=getComputedStyle(e);return!t||Js(n.rotate)!==0||n.transform.startsWith(`matrix3d(`)||(t===`text`||t===`container`)&&(n.display===`inline`||n.display===`contents`)?null:{kind:t,natural:al(e),hugsHeight:t===`text`&&!ol(e),inset:il(n),sizing:t===`container`?rl(e,n):null}}let nl=/* @__PURE__ */ new Set([`vertical`,`horizontal`,`wrap`]);function rl(e,t){let n=Hc(e,t);return{layout:n,fills:nl.has(n.parent)&&(parseFloat(t.flexGrow)||0)>0}}function il(e){if(e.boxSizing!==`content-box`)return{width:0,height:0};let t=(...e)=>e.reduce((e,t)=>e+(parseFloat(t)||0),0);return{width:t(e.paddingLeft,e.paddingRight,e.borderLeftWidth,e.borderRightWidth),height:t(e.paddingTop,e.paddingBottom,e.borderTopWidth,e.borderBottomWidth)}}function al(e){let[t,n]=e instanceof HTMLImageElement?[e.naturalWidth,e.naturalHeight]:e instanceof HTMLVideoElement?[e.videoWidth,e.videoHeight]:[0,0];return t>0&&n>0?{width:t,height:n}:null}function ol(e){let t=e instanceof HTMLElement?e.style.height:``;return t!==``&&t!==`auto`}function sl(e,t){if(t.some(t=>t!==e&&t.contains(e)))return null;let n=getComputedStyle(e);if(n.position!==`absolute`&&n.position!==`fixed`)return null;let r=parseFloat(n.left),i=parseFloat(n.top);return Number.isNaN(r)||Number.isNaN(i)?null:{left:r,top:i}}function cl(e){let t=getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return{top:n(t.marginTop),right:n(t.marginRight),bottom:n(t.marginBottom),left:n(t.marginLeft)}}function ll(e){let t=e.getBoundingClientRect();return{x:Math.round(t.left),y:Math.round(t.top),width:Math.round(t.width),height:Math.round(t.height)}}function ul(e){let t=e.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function dl(e,t){if(i(document)!==e)return null;let n=t.flatMap(e=>{let t=r(document,e);return t?[t]:[]});return n.length===t.length?n:null}function fl(e,t){return t.map((n,r)=>({index:e[r]??0,box:ll(n),read:tl(n),placed:sl(n,[]),nested:t.some(e=>e!==n&&e.contains(n)),margin:cl(n)}))}function pl(){let e=document.body;if(!e)return[];let n=innerWidth,r=innerHeight,i=[],a=[];return t(document).forEach((t,o)=>{if(!e.contains(t)||t===e||a.some(e=>e.contains(t))||getComputedStyle(t).position===`fixed`)return;let s=t.getBoundingClientRect();(s.width!==0||s.height!==0)&&(s.left<-1||s.top<-1||s.right>n+1||s.bottom>r+1)&&!ml(t,e)&&(a.push(t),i.push({index:o,box:ll(t),placed:sl(t,[])}))}),i}function ml(e,t){let n=e=>{let t=e.parentElement;if(getComputedStyle(e).position!==`absolute`)return t;for(;t&&getComputedStyle(t).position===`static`&&getComputedStyle(t).transform===`none`;)t=t.parentElement;return t};for(let r=n(e);r&&r!==t&&t.contains(r);r=n(r)){let e=getComputedStyle(r);if(e.overflowX!==`visible`||e.overflowY!==`visible`)return!0}return!1}function hl(){let e=i(document);return e===null?null:{hash:e,ghosts:pl()}}function gl(e){return e.flatMap(e=>{let t=r(document,e)?.getBoundingClientRect();return t?[{index:e,right:t.right,top:t.top}]:[]})}function _l(e,t,n){let r=new ResizeObserver(t);for(let t of[...e,document.documentElement])r.observe(t);let i=new MutationObserver(t);if(n)for(let t of e)i.observe(t,{attributes:!0,attributeFilter:[`style`]});return addEventListener(`scroll`,t,!0),addEventListener(`resize`,t),()=>{r.disconnect(),i.disconnect(),removeEventListener(`scroll`,t,!0),removeEventListener(`resize`,t)}}let vl={"element-boxes":({hash:e,indexes:t})=>i(document)===e?t.flatMap(e=>{let t=r(document,e),n=t?ul(t):null;return n&&n.width>0&&n.height>0?[{index:e,box:n}]:[]}):null,measure:({hash:e,indexes:t},{push:n,onClose:r})=>{let i=dl(e,t);return i?(r(_l(i,()=>n(fl(t,i)),i.length>1)),fl(t,i)):null},overflow:(e,{push:t,onClose:n})=>{let r=0,i=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,t(hl())}))},a=new MutationObserver(i);return a.observe(document,{attributes:!0,attributeFilter:[`style`],subtree:!0}),addEventListener(`resize`,i),n(()=>{cancelAnimationFrame(r),a.disconnect(),removeEventListener(`resize`,i)}),hl()},pins:({indexes:e},{push:t,onClose:n})=>(n(_l(e.flatMap(e=>{let t=r(document,e);return t?[t]:[]}),()=>t(gl(e)),!1)),gl(e))},yl=[`play`,`pause`,`timeupdate`,`durationchange`,`loadedmetadata`,`volumechange`,`seeked`,`error`,`emptied`],bl=[`controls`,`autoplay`,`loop`,`muted`];function xl(e){let t=zc(e);return t instanceof HTMLMediaElement?t:null}function Sl(e){let t=e instanceof HTMLVideoElement,n=t&&e.readyState>=1&&e.videoWidth===0;return{tag:t?`video`:`audio`,playable:e.error===null&&!n,paused:e.paused,time:e.currentTime,length:e.duration,muted:e.muted,mutedInFile:e.defaultMuted,controls:e.hasAttribute(`controls`),autoplay:e.hasAttribute(`autoplay`),loop:e.hasAttribute(`loop`)}}function Cl(e,t){switch(t.kind){case`toggle-play`:e.paused?e.play().catch(()=>void 0):e.pause();return;case`seek`:e.currentTime=t.seconds;return;case`toggle-sound`:e.muted=!e.muted;return;case`set-flag`:e.toggleAttribute(t.name,t.on)}}let wl=`frameboard-media-strip`;function Tl(){if(document.getElementById(wl))return()=>{};let t=document.createElement(`style`);return t.id=wl,t.setAttribute(e,``),t.textContent=`video::-webkit-media-controls { display: none !important }`,document.head?.append(t),()=>t.remove()}let El={media:(e,{push:t,onClose:n})=>{let r=xl(e);if(!r)return null;let i=()=>t(Sl(r));for(let e of yl)r.addEventListener(e,i);let a=new MutationObserver(i);return a.observe(r,{attributeFilter:[...bl]}),n(()=>{for(let e of yl)r.removeEventListener(e,i);a.disconnect()}),Sl(r)},"media-act":({act:e,...t})=>{let n=xl(t);return n?(Cl(n,e),!0):!1},"hide-strips":(e,{onClose:t})=>(t(Tl()),!0)},Dl=/* @__PURE__ */ new Map;function Ol(e,t,n){let i=`${e}:${t}`,a=r(document,e),o=a instanceof HTMLElement?a:null,s=Dl.get(i);if(n===null){if(Dl.delete(i),!s||s.element!==o||!o)return;s.value===``?s.attribute===null?o.removeAttribute(`style`):o.setAttribute(`style`,s.attribute):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&Dl.set(i,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),attribute:o.getAttribute(`style`)}),o.style.setProperty(t,n,`important`))}function kl(t){return{"preview-style":({index:e,property:t,value:n})=>(Ol(e,t,n),null),"keep-previews":()=>(Dl.clear(),null),restamp:({hash:n})=>{let r=document.querySelector(`style[${e}]`);return r?(r.setAttribute(`data-hash`,n),t(),!0):!1}}}let Al=/\r\n|\r/g,jl=/\n+$/,Ml=/[\t\n\f\r ]+/g;function Nl(e){let{whiteSpace:t}=getComputedStyle(e);return t===`normal`||t===`nowrap`}function Pl(e,t,n){if(!(e instanceof HTMLElement))return null;if(e.childElementCount>0){let r=n&&Fl(e,n);return r?Il(e,r,t):null}if((e.textContent??``).trim()===``)return null;let r=e,i=r.textContent??``,a=Nl(r),o=a?i.replace(Ml,` `).trim():i,s=r.style.whiteSpace;o!==i&&(r.textContent=o);let c=!0,l=()=>{c=!1,r.removeAttribute(`contenteditable`),r.removeAttribute(pc),r.removeEventListener(`keydown`,h),r.removeEventListener(`paste`,g),r.removeEventListener(`blur`,m),window.removeEventListener(`pagehide`,p)},u=()=>{r.textContent=i,r.style.whiteSpace=s},d=()=>{r.isConnected&&u()},f=()=>{c&&(l(),u())};function p(){l(),t({kind:`closed`},d)}function m(){if(!c)return;l();let e=(r.textContent??``).replace(Al,`
|
|
116
|
+
`).replace(jl,``);e===o.replace(jl,``)?(u(),t({kind:`closed`},d)):(r.textContent=e,t({kind:`commit`,text:e,breaks:a&&e.includes(`
|
|
117
117
|
`)},d))}function h(e){e.key===`Enter`&&(e.preventDefault(),_(`
|
|
118
|
-
`)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m())}function g(e){e.preventDefault(),_((e.clipboardData?.getData(`text/plain`)??``).replace(
|
|
118
|
+
`)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m())}function g(e){e.preventDefault(),_((e.clipboardData?.getData(`text/plain`)??``).replace(Al,`
|
|
119
119
|
`))}let _=e=>{let t=getSelection()?.getRangeAt(0);if(!t||!r.contains(t.commonAncestorContainer))return;a&&e.includes(`
|
|
120
120
|
`)&&(r.style.whiteSpace=`pre-line`);let n=(e,t)=>{let n=document.createRange();return n.selectNodeContents(r),n.setEnd(e,t),n.toString().length},i=n(t.startContainer,t.startOffset),o=n(t.endContainer,t.endOffset),s=r.textContent??``,c=s.slice(o),l=c===``&&e.endsWith(`
|
|
121
121
|
`)?`
|
|
122
|
-
`:``;r.textContent=s.slice(0,i)+e+(c||l);let u=document.createRange();u.setStart(r.firstChild??r,i+e.length),u.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(u)};r.setAttribute(`contenteditable`,`plaintext-only`),r.setAttribute(pc,``),r.addEventListener(`keydown`,h),r.addEventListener(`paste`,g),r.addEventListener(`blur`,m),window.addEventListener(`pagehide`,p),r.focus();let v=document.createRange();v.selectNodeContents(r);let ee=getSelection();return ee?.removeAllRanges(),ee?.addRange(v),f}function
|
|
123
|
-
`);e===o?(p(),n({kind:`closed`},m)):n({kind:`commit`,text:e,breaks:!1,run:r},m)}let v=e=>a?e.replace(
|
|
122
|
+
`:``;r.textContent=s.slice(0,i)+e+(c||l);let u=document.createRange();u.setStart(r.firstChild??r,i+e.length),u.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(u)};r.setAttribute(`contenteditable`,`plaintext-only`),r.setAttribute(pc,``),r.addEventListener(`keydown`,h),r.addEventListener(`paste`,g),r.addEventListener(`blur`,m),window.addEventListener(`pagehide`,p),r.focus();let v=document.createRange();v.selectNodeContents(r);let ee=getSelection();return ee?.removeAllRanges(),ee?.addRange(v),f}function Fl(e,{x:t,y:n}){let r=document.caretPositionFromPoint?.(t,n)?.offsetNode??document.caretRangeFromPoint?.(t,n)?.startContainer;return r instanceof Text&&r.parentNode===e&&r.data.trim()!==``?r:null}function Il(e,t,n){let r=[...e.childNodes].filter(e=>e instanceof Text).indexOf(t),i=t.data,a=Nl(e),o=a?i.replace(Ml,` `):i;o!==i&&(t.data=o);let s=[...e.children].map(e=>({child:e,editable:e.getAttribute(`contenteditable`)})),c=[...e.childNodes],l=c.map(e=>e instanceof Text?e.data:``),u=!0,d=()=>{for(let t of[...e.childNodes])c.includes(t)||t.remove();for(let n=c.length-1;n>=0;n--){let r=c[n];r!==t&&r instanceof Text&&(r.data=l[n]??``);let i=c[n+1];r&&r.parentNode!==e&&e.insertBefore(r,i?.parentNode===e?i:null)}},f=()=>{u=!1,d(),e.removeAttribute(`contenteditable`),e.removeAttribute(pc);for(let{child:e,editable:t}of s)t===null?e.removeAttribute(`contenteditable`):e.setAttribute(`contenteditable`,t);e.removeEventListener(`keydown`,ee),e.removeEventListener(`paste`,y),e.removeEventListener(`beforeinput`,te),e.removeEventListener(`blur`,_),window.removeEventListener(`pagehide`,g)},p=()=>{t.data=i},m=()=>{t.isConnected&&p()},h=()=>{u&&(f(),p())};function g(){f(),n({kind:`closed`},m)}function _(){if(!u)return;f();let e=t.data.replace(Al,`
|
|
123
|
+
`);e===o?(p(),n({kind:`closed`},m)):n({kind:`commit`,text:e,breaks:!1,run:r},m)}let v=e=>a?e.replace(Ml,` `):e.replace(Al,`
|
|
124
124
|
`);function ee(e){e.key===`Enter`&&(e.preventDefault(),a||b(ne(),`
|
|
125
|
-
`)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function y(e){e.preventDefault(),b(ne(),v(e.clipboardData?.getData(`text/plain`)??``))}function te(e){if(!e.cancelable)return;e.preventDefault();let[t=ne()]=e.getTargetRanges();e.inputType.startsWith(`delete`)?b(t,``):e.inputType.startsWith(`insert`)&&b(t,v(e.data??e.dataTransfer?.getData(`text/plain`)??``))}let ne=()=>{let e=getSelection();return e&&e.rangeCount>0?e.getRangeAt(0):void 0},re=(n,r)=>{if(n===t)return r;if(n!==e)return;let i=[...e.childNodes].indexOf(t);return r===i?0:r===i+1?t.length:void 0},b=(e,n)=>{let r=e&&re(e.startContainer,e.startOffset),i=e&&re(e.endContainer,e.endOffset);if(r===void 0||i===void 0)return;t.replaceData(r,i-r,n);let a=document.createRange();a.setStart(t,r+n.length),a.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(a)};for(let{child:e}of s)e.setAttribute(`contenteditable`,`false`);e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(pc,``),e.addEventListener(`keydown`,ee),e.addEventListener(`paste`,y),e.addEventListener(`beforeinput`,te),e.addEventListener(`blur`,_),window.addEventListener(`pagehide`,g),e.focus();let ie=document.createRange();ie.selectNodeContents(t);let x=getSelection();return x?.removeAllRanges(),x?.addRange(ie),h}document.currentScript?.remove();let
|
|
125
|
+
`)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),_())}function y(e){e.preventDefault(),b(ne(),v(e.clipboardData?.getData(`text/plain`)??``))}function te(e){if(!e.cancelable)return;e.preventDefault();let[t=ne()]=e.getTargetRanges();e.inputType.startsWith(`delete`)?b(t,``):e.inputType.startsWith(`insert`)&&b(t,v(e.data??e.dataTransfer?.getData(`text/plain`)??``))}let ne=()=>{let e=getSelection();return e&&e.rangeCount>0?e.getRangeAt(0):void 0},re=(n,r)=>{if(n===t)return r;if(n!==e)return;let i=[...e.childNodes].indexOf(t);return r===i?0:r===i+1?t.length:void 0},b=(e,n)=>{let r=e&&re(e.startContainer,e.startOffset),i=e&&re(e.endContainer,e.endOffset);if(r===void 0||i===void 0)return;t.replaceData(r,i-r,n);let a=document.createRange();a.setStart(t,r+n.length),a.collapse(!0),getSelection()?.removeAllRanges(),getSelection()?.addRange(a)};for(let{child:e}of s)e.setAttribute(`contenteditable`,`false`);e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(pc,``),e.addEventListener(`keydown`,ee),e.addEventListener(`paste`,y),e.addEventListener(`beforeinput`,te),e.addEventListener(`blur`,_),window.addEventListener(`pagehide`,g),e.focus();let ie=document.createRange();ie.selectNodeContents(t);let x=getSelection();return x?.removeAllRanges(),x?.addRange(ie),h}document.currentScript?.remove();let Ll=window.parent,Rl=window.origin,zl=crypto.randomUUID(),Bl=/* @__PURE__ */ new Map,Vl=/* @__PURE__ */ new Map,Hl={...Lc,...Zc,...vl,...El,"element-box":e=>{let t=zc(e);if(!t)return null;let{left:n,top:r,right:i,bottom:a}=t.getBoundingClientRect();return{left:n,top:r,right:i,bottom:a}},"text-edit":(e,{id:t,push:n,onClose:r})=>{let i=zc(e),a=!1,o=i&&Pl(i,(e,r)=>{a=!0,e.kind===`commit`&&Vl.set(t,r),n(e)},e.at);return o?(r(()=>{a||o()}),!0):!1},"text-written":({edit:e,written:t})=>{let n=Vl.get(e);return Vl.delete(e),t||n?.(),null},...kl(()=>Wl())};function Ul(e){Ll.postMessage(e,Rl)}function Wl(e=i(document)){Ul({tag:Q,kind:`shown`,page:zl,hash:e})}function Gl(e,t,n){let r=Hl[e];if(!r)throw Error(`no handler for ${e}`);let i=wc(e,t);if(i===Cc)throw Error(`not the arguments ${e} takes`);return r(i,{id:n,push:e=>Ul({tag:Q,kind:`push`,id:n,value:e}),onClose:e=>Bl.set(n,e)})}Ll!==window&&(Rc(document,()=>Wl()),window.addEventListener(`pagehide`,()=>Wl(null)),window.addEventListener(`message`,e=>{if(e.source!==Ll)return;let t=hc(e,Rl);if(t?.kind===`close`&&(Bl.get(t.id)?.(),Bl.delete(t.id)),t?.kind!==`request`)return;let{id:n}=t;try{let e=Gl(t.op,t.args,n);Ul({tag:Q,kind:`reply`,id:n,ok:!0,value:e})}catch(e){let t=e instanceof Error?e.message:String(e);Ul({tag:Q,kind:`reply`,id:n,ok:!1,error:t})}}))})();
|