PageSourceSearch

https://the-self-driving-enterprise-ebook.lovable.app/assets/chat-D-xILJEy.js

js the-self-driving-enterprise-ebook.lovable.app collected 2026-10-03 03:50:11 UTC 256,000 bytes, 60 lines download raw bytes

1import{c as fn,g as or,r as de,j as H,u as ts}from"./index-CAi5u0On.js";const ns=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Mr=fn("loader-circle",ns);const rs=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],is=fn("send",rs);const as=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],wn=fn("sparkles",as);const os=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ss=fn("trash-2",os);var sa="vercel.ai.error",ls=Symbol.for(sa),Rr,$r,De=class la extends($r=Error,Rr=ls,$r){constructor({name:t,message:n,cause:r}){super(n),this[Rr]=!0,this.name=t,this.cause=r}static isInstance(t){return la.hasMarker(t,sa)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};function ua(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var ca="AI_InvalidArgumentError",pa=`vercel.ai.error.${ca}`,us=Symbol.for(pa),Dr,Zr,cs=class extends(Zr=De,Dr=us,Zr){constructor({message:e,cause:t,argument:n}){super({name:ca,message:e,cause:t}),this[Dr]=!0,this.argument=n}static isInstance(e){return De.hasMarker(e,pa)}},da="AI_JSONParseError",fa=`vercel.ai.error.${da}`,ps=Symbol.for(fa),jr,Lr,Fr=class extends(Lr=De,jr=ps,Lr){constructor({text:e,cause:t}){super({name:da,message:`JSON parsing failed: Text: ${e}.
2Error message: ${ua(t)}`,cause:t}),this[jr]=!0,this.text=e}static isInstance(e){return De.hasMarker(e,fa)}},ha="AI_TypeValidationError",ma=`vercel.ai.error.${ha}`,ds=Symbol.for(ma),Br,Ur,vt=class Fn extends(Ur=De,Br=ds,Ur){constructor({value:t,cause:n,context:r}){let i="Type validation failed";if(r?.field&&(i+=` for ${r.field}`),r?.entityName||r?.entityId){i+=" (";const a=[];r.entityName&&a.push(r.entityName),r.entityId&&a.push(`id: "${r.entityId}"`),i+=a.join(", "),i+=")"}super({name:ha,message:`${i}: Value: ${JSON.stringify(t)}.
3Error message: ${ua(n)}`,cause:n}),this[Br]=!0,this.value=t,this.context=r}static isInstance(t){return De.hasMarker(t,ma)}static wrap({value:t,cause:n,context:r}){var i,a,o;return Fn.isInstance(n)&&n.value===t&&((i=n.context)==null?void 0:i.field)===r?.field&&((a=n.context)==null?void 0:a.entityName)===r?.entityName&&((o=n.context)==null?void 0:o.entityId)===r?.entityId?n:new Fn({value:t,cause:n,context:r})}};function _(e,t,n){function r(s,u){var l;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(l=s._zod).traits??(l.traits=new Set),s._zod.traits.add(e),t(s,u);for(const c in o.prototype)c in s||Object.defineProperty(s,c,{value:o.prototype[c].bind(s)});s._zod.constr=o,s._zod.def=u}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(s){var u;const l=n?.Parent?new a:this;r(l,s),(u=l._zod).deferred??(u.deferred=[]);for(const c of l._zod.deferred)c();return l}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class jt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const ga={};function We(e){return ga}function ya(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function fs(e,t){return typeof t=="bigint"?t.toString():t}function sr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function lr(e){return e==null}function ur(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function hs(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return a%o/10**i}function W(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function hn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Et(e){return JSON.stringify(e)}const va=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function on(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ms=sr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function sn(e){if(on(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(on(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const gs=new Set(["string","number","symbol"]);function Ut(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function at(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function O(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new 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 ys(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const vs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function bs(e,t){const n={},r=e._zod.def;for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(n[i]=r.shape[i])}return at(e,{...e._zod.def,shape:n,checks:[]})}function xs(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete n[i]}return at(e,{...e._zod.def,shape:n,checks:[]})}function ws(e,t){if(!sn(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return hn(this,"shape",r),r},checks:[]};return at(e,n)}function ks(e,t){return at(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return hn(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}
vendor: 16,549 bytes, lines 3-5
3function _s(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const a in n){if(!(a in r))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=e?new e({type:"optional",innerType:r[a]}):r[a])}else for(const a in r)i[a]=e?new e({type:"optional",innerType:r[a]}):r[a];return at(t,{...t._zod.def,shape:i,checks:[]})}function Ss(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(const a in r)i[a]=new e({type:"nonoptional",innerType:r[a]});return at(t,{...t._zod.def,shape:i,checks:[]})}function Rt(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Gt(e){return typeof e=="string"?e:e?.message}function Ye(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Gt(e.inst?._zod.def?.error?.(e))??Gt(t?.error?.(e))??Gt(n.customError?.(e))??Gt(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function cr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Lt(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const ba=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,fs,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},xa=_("$ZodError",ba),wa=_("$ZodError",ba,{Parent:Error});function Es(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Is(e,t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(n(o));else{let s=r,u=0;for(;u<o.path.length;){const l=o.path[u];u===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(o))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return i(e),r}const Cs=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new jt;if(o.issues.length){const s=new(i?.Err??e)(o.issues.map(u=>Ye(u,a,We())));throw va(s,i?.callee),s}return o.value},Ts=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const s=new(i?.Err??e)(o.issues.map(u=>Ye(u,a,We())));throw va(s,i?.callee),s}return o.value},ka=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new jt;return a.issues.length?{success:!1,error:new(e??xa)(a.issues.map(o=>Ye(o,i,We())))}:{success:!0,data:a.value}},zs=ka(wa),_a=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>Ye(o,i,We())))}:{success:!0,data:a.value}},As=_a(wa),Ps=/^[cC][^\s-]{8,}$/,Os=/^[0-9a-z]+$/,Ns=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ms=/^[0-9a-vA-V]{20}$/,Rs=/^[A-Za-z0-9]{27}$/,$s=/^[a-zA-Z0-9_-]{21}$/,Ds=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zs=/^([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})$/,Vr=e=>e?new 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)$/,js=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ls="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fs(){return new RegExp(Ls,"u")}const Bs=/^(?:(?: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])$/,Us=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Vs=/^((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])$/,qs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Sa=/^[A-Za-z0-9_-]*$/,Js=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Ws=/^\+(?:[0-9]){6,14}[0-9]$/,Ea="(?:(?:\\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])))",Ys=new RegExp(`^${Ea}$`);function Ia(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Gs(e){return new RegExp(`^${Ia(e)}$`)}function Xs(e){const t=Ia({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Ea}T(?:${r})$`)}const Qs=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ks=/^\d+$/,el=/^-?\d+(?:\.\d+)?/i,tl=/true|false/i,nl=/null/i,rl=/^[^A-Z]*$/,il=/^[^a-z]*$/,be=_("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ca={number:"number",bigint:"bigint",object:"date"},Ta=_("$ZodCheckLessThan",(e,t)=>{be.init(e,t);const n=Ca[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),za=_("$ZodCheckGreaterThan",(e,t)=>{be.init(e,t);const n=Ca[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),al=_("$ZodCheckMultipleOf",(e,t)=>{be.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):hs(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})}}),ol=_("$ZodCheckNumberFormat",(e,t)=>{be.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=vs[t.format];e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,s.minimum=i,s.maximum=a,n&&(s.pattern=Ks)}),e._zod.check=o=>{const s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:"invalid_type",input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,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,inst:e})}}),sl=_("$ZodCheckMaxLength",(e,t)=>{var n;be.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!lr(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=cr(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),ll=_("$ZodCheckMinLength",(e,t)=>{var n;be.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!lr(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=cr(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),ul=_("$ZodCheckLengthEquals",(e,t)=>{var n;be.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!lr(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const o=cr(i),s=a>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),mn=_("$ZodCheckStringFormat",(e,t)=>{var n,r;be.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),cl=_("$ZodCheckRegex",(e,t)=>{mn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pl=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rl),mn.init(e,t)}),dl=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=il),mn.init(e,t)}),fl=_("$ZodCheckIncludes",(e,t)=>{be.init(e,t);const n=Ut(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),hl=_("$ZodCheckStartsWith",(e,t)=>{be.init(e,t);const n=new RegExp(`^${Ut(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ml=_("$ZodCheckEndsWith",(e,t)=>{be.init(e,t);const n=new RegExp(`.*${Ut(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),gl=_("$ZodCheckOverwrite",(e,t)=>{be.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class yl{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
4`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>`  ${a}`)];return new t(...n,i.join(`
5`))}}const vl={major:4,minor:0,patch:0},ne=_("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vl;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(a,o,s)=>{let u=Rt(a),l;for(const c of o){if(c._zod.def.when){if(!c._zod.def.when(a))continue}else if(u)continue;const p=a.issues.length,f=c._zod.check(a);if(f instanceof Promise&&s?.async===!1)throw new jt;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,a.issues.length!==p&&(u||(u=Rt(a,p)))});else{if(a.issues.length===p)continue;u||(u=Rt(a,p))}}return l?l.then(()=>a):a};e._zod.run=(a,o)=>{const s=e._zod.parse(a,o);if(s instanceof Promise){if(o.async===!1)throw new jt;return s.then(u=>i(u,r,o))}return i(s,r,o)}}e["~standard"]={validate:i=>{try{const a=zs(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return As(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),pr=_("$ZodString",(e,t)=>{ne.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qs(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ae=_("$ZodStringFormat",(e,t)=>{mn.init(e,t),pr.init(e,t)}),bl=_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zs),ae.init(e,t)}),xl=_("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Vr(r))}else t.pattern??(t.pattern=Vr());ae.init(e,t)}),wl=_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=js),ae.init(e,t)}),kl=_("$ZodURL",(e,t)=>{ae.init(e,t),e._zod.check=n=>{try{const r=n.value,i=new URL(r),a=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Js.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&a.endsWith("/")?n.value=a.slice(0,-1):n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),_l=_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fs()),ae.init(e,t)}),Sl=_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=$s),ae.init(e,t)}),El=_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ps),ae.init(e,t)}),Il=_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Os),ae.init(e,t)}),Cl=_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ns),ae.init(e,t)}),Tl=_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ms),ae.init(e,t)}),zl=_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Rs),ae.init(e,t)}),Al=_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xs(t)),ae.init(e,t)}),Pl=_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ys),ae.init(e,t)}),Ol=_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Gs(t)),ae.init(e,t)}),Nl=_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ds),ae.init(e,t)}),Ml=_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Bs),ae.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),Rl=_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Us),ae.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$l=_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Vs),ae.init(e,t)}),Dl=_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=qs),ae.init(e,t),e._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Aa(e){if(e==="")return!0;
vendor: 5,225 bytes, lines 5-28
5if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Zl=_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Hs),ae.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Aa(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function jl(e){if(!Sa.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Aa(n)}const Ll=_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Sa),ae.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{jl(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Fl=_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ws),ae.init(e,t)});function Bl(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const Ul=_("$ZodJWT",(e,t)=>{ae.init(e,t),e._zod.check=n=>{Bl(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Pa=_("$ZodNumber",(e,t)=>{ne.init(e,t),e._zod.pattern=e._zod.bag.pattern??el,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),Vl=_("$ZodNumber",(e,t)=>{ol.init(e,t),Pa.init(e,t)}),ql=_("$ZodBoolean",(e,t)=>{ne.init(e,t),e._zod.pattern=tl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Hl=_("$ZodNull",(e,t)=>{ne.init(e,t),e._zod.pattern=nl,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),Jl=_("$ZodUnknown",(e,t)=>{ne.init(e,t),e._zod.parse=n=>n}),Wl=_("$ZodNever",(e,t)=>{ne.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function qr(e,t,n){e.issues.length&&t.issues.push(...tt(n,e.issues)),t.value[n]=e.value}const Yl=_("$ZodArray",(e,t)=>{ne.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const s=i[o],u=t.element._zod.run({value:s,issues:[]},r);u instanceof Promise?a.push(u.then(l=>qr(l,n,o))):qr(u,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function Xt(e,t,n){e.issues.length&&t.issues.push(...tt(n,e.issues)),t.value[n]=e.value}function Hr(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...tt(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const Gl=_("$ZodObject",(e,t)=>{ne.init(e,t);const n=sr(()=>{const p=Object.keys(t.shape);for(const d of p)if(!(t.shape[d]instanceof ne))throw new Error(`Invalid element at key "${d}": expected a Zod schema`);const f=ys(t.shape);return{shape:t.shape,keys:p,keySet:new Set(p),numKeys:p.length,optionalKeys:new Set(f)}});W(e._zod,"propValues",()=>{const p=t.shape,f={};for(const d in p){const m=p[d]._zod;if(m.values){f[d]??(f[d]=new Set);for(const x of m.values)f[d].add(x)}}return f});const r=p=>{const f=new yl(["shape","payload","ctx"]),d=n.value,m=b=>{const h=Et(b);return`shape[${h}]._zod.run({ value: input[${h}], issues: [] }, ctx)`};f.write("const input = payload.value;");const x=Object.create(null);let w=0;for(const b of d.keys)x[b]=`key_${w++}`;f.write("const newResult = {}");for(const b of d.keys)if(d.optionalKeys.has(b)){const h=x[b];f.write(`const ${h} = ${m(b)};`);const E=Et(b);f.write(`
6        if (${h}.issues.length) {
7          if (input[${E}] === undefined) {
8            if (${E} in input) {
9              newResult[${E}] = undefined;
10            }
11          } else {
12            payload.issues = payload.issues.concat(
13              ${h}.issues.map((iss) => ({
14                ...iss,
15                path: iss.path ? [${E}, ...iss.path] : [${E}],
16              }))
17            );
18          }
19        } else if (${h}.value === undefined) {
20          if (${E} in input) newResult[${E}] = undefined;
21        } else {
22          newResult[${E}] = ${h}.value;
23        }
24        `)}else{const h=x[b];f.write(`const ${h} = ${m(b)};`),f.write(`
25          if (${h}.issues.length) payload.issues = payload.issues.concat(${h}.issues.map(iss => ({
26            ...iss,
27            path: iss.path ? [${Et(b)}, ...iss.path] : [${Et(b)}]
28          })));`),f.write(`newResult[${Et(b)}] = ${h}.value`)}f.write("payload.value = newResult;"),f.write("return payload;");const g=f.compile();return(b,h)=>g(p,b,h)};let i;const a=on,o=!ga.jitless,u=o&&ms.value,l=t.catchall;let c;e._zod.parse=(p,f)=>{c??(c=n.value);const d=p.value;if(!a(d))return p.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),p;const m=[];
28if(o&&u&&f?.async===!1&&f.jitless!==!0)i||(i=r(t.shape)),p=i(p,f);else{p.value={};const h=c.shape;for(const E of c.keys){const z=h[E],k=z._zod.run({value:d[E],issues:[]},f),P=z._zod.optin==="optional"&&z._zod.optout==="optional";k instanceof Promise?m.push(k.then($=>P?Hr($,p,E,d):Xt($,p,E))):P?Hr(k,p,E,d):Xt(k,p,E)}}if(!l)return m.length?Promise.all(m).then(()=>p):p;const x=[],w=c.keySet,g=l._zod,b=g.def.type;for(const h of Object.keys(d)){if(w.has(h))continue;if(b==="never"){x.push(h);continue}const E=g.run({value:d[h],issues:[]},f);E instanceof Promise?m.push(E.then(z=>Xt(z,p,h))):Xt(E,p,h)}return x.length&&p.issues.push({code:"unrecognized_keys",keys:x,input:d,inst:e}),m.length?Promise.all(m).then(()=>p):p}});function Jr(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>Ye(a,r,We())))}),t}const Oa=_("$ZodUnion",(e,t)=>{ne.init(e,t),W(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>ur(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let i=!1;const a=[];for(const o of t.options){const s=o._zod.run({value:n.value,issues:[]},r);if(s instanceof Promise)a.push(s),i=!0;else{if(s.issues.length===0)return s;a.push(s)}}return i?Promise.all(a).then(o=>Jr(o,n,e,r)):Jr(a,n,e,r)}}),Xl=_("$ZodDiscriminatedUnion",(e,t)=>{Oa.init(e,t);const n=e._zod.parse;W(e._zod,"propValues",()=>{const i={};for(const a of t.options){const o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[s,u]of Object.entries(o)){i[s]||(i[s]=new Set);for(const l of u)i[s].add(l)}}return i});const r=sr(()=>{const i=t.options,a=new Map;for(const o of i){const s=o._zod.propValues[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const u of s){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,o)}}return a});e._zod.parse=(i,a)=>{const o=i.value;if(!on(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:o,path:[t.discriminator],inst:e}),i)}}),Ql=_("$ZodIntersection",(e,t)=>{ne.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([u,l])=>Wr(n,u,l)):Wr(n,a,o)}});function Bn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(sn(e)&&sn(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const o=Bn(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=t[r],o=Bn(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 Wr(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Rt(e))return e;const r=Bn(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Kl=_("$ZodRecord",(e,t)=>{ne.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!sn(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[];if(t.keyType._zod.values){const o=t.keyType._zod.values;n.value={};for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const l=t.valueType._zod.run({value:i[u],issues:[]},r);l instanceof Promise?a.push(l.then(c=>{c.issues.length&&n.issues.push(...tt(u,c.issues)),n.value[u]=c.value})):(l.issues.length&&n.issues.push(...tt(u,l.issues)),n.value[u]=l.value)}let s;for(const u in i)o.has(u)||(s=s??[],s.push(u));s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:s})}else{n.value={};for(const o of Reflect.ownKeys(i)){if(o==="__proto__")continue;const s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(l
vendor: 9,638 bytes, line 28
28=>Ye(l,r,We())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}const u=t.valueType._zod.run({value:i[o],issues:[]},r);u instanceof Promise?a.push(u.then(l=>{l.issues.length&&n.issues.push(...tt(o,l.issues)),n.value[s.value]=l.value})):(u.issues.length&&n.issues.push(...tt(o,u.issues)),n.value[s.value]=u.value)}}return a.length?Promise.all(a).then(()=>n):n}}),eu=_("$ZodEnum",(e,t)=>{ne.init(e,t);const n=ya(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>gs.has(typeof r)).map(r=>typeof r=="string"?Ut(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{const a=r.value;return e._zod.values.has(a)||r.issues.push({code:"invalid_value",values:n,input:a,inst:e}),r}}),tu=_("$ZodLiteral",(e,t)=>{ne.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ut(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),nu=_("$ZodTransform",(e,t)=>{ne.init(e,t),e._zod.parse=(n,r)=>{const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new jt;return n.value=i,n}}),ru=_("$ZodOptional",(e,t)=>{ne.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ur(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),iu=_("$ZodNullable",(e,t)=>{ne.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ur(n.source)}|null)$`):void 0}),W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),au=_("$ZodDefault",(e,t)=>{ne.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>Yr(a,t)):Yr(i,t)}});function Yr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ou=_("$ZodPrefault",(e,t)=>{ne.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),su=_("$ZodNonOptional",(e,t)=>{ne.init(e,t),W(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>Gr(a,e)):Gr(i,e)}});function Gr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const lu=_("$ZodCatch",(e,t)=>{ne.init(e,t),e._zod.optin="optional",W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(o=>Ye(o,r,We()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Ye(a,r,We()))},input:n.value}),n.issues=[]),n)}}),uu=_("$ZodPipe",(e,t)=>{ne.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>Xr(a,t,r)):Xr(i,t,r)}});function Xr(e,t,n){return Rt(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const cu=_("$ZodReadonly",(e,t)=>{ne.init(e,t),W(e._zod,"propValues",()=>t.innerType._zod.propValues),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(Qr):Qr(i)}});function Qr(e){return e.value=Object.freeze(e.value),e}const pu=_("$ZodLazy",(e,t)=>{ne.init(e,t),W(e._zod,"innerType",()=>t.getter()),W(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),W(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),W(e._zod,"optin",()=>e._zod.innerType._zod.optin),W(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),du=_("$ZodCustom",(e,t)=>{be.init(e,t),ne.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(a=>Kr(a,n,r,e));Kr(i,n,r,e)}});function Kr(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Lt(i))}}class Na{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function fu(){return new Na}const Pt=fu();function hu(e,t){return new e({type:"string",...O(t)})}function mu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...O(t)})}function ei(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...O(t)})}function gu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...O(t)})}function yu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(t)})}function vu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(t)})}function bu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(t)})}function xu(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...O(t)})}function wu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...O(t)})}function ku(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(t)})}function _u(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...O(t)})}function Su(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(t)})}function Eu(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...O(t)})}function Iu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...O(t)})}function Cu(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(t)})}function Tu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(t)})}function zu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(t)})}function Au(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(t)})}function Pu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(t)})}function Ou(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...O(t)})}function Nu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...O(t)})}function Mu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...O(t)})}function Ru(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...O(t)})}function $u(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(t)})}function Du(e,t){return new e({type:"string",format:"date",check:"string_format",...O(t)})}function Zu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...O(t)})}function ju(e,t){return new e({type:"string",format:"duration",check:"string_format",...O(t)})}function Lu(e,t){return new e({type:"number",checks:[],...O(t)})}function Fu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...O(t)})}function Bu(e,t){return new e({type:"boolean",...O(t)})}function Uu(e,t){return new e({type:"null",...O(t)})}function Vu(e){return new e({type:"unknown"})}function qu(e,t){return new e({type:"never",...O(t)})}function ti(e,t){return new Ta({check:"less_than",...O(t),value:e,inclusive:!1})}function kn(e,t){return new Ta({check:"less_than",...O(t),value:e,inclusive:!0})}function ni(e,t){return new za({check:"greater_than",...O(t),value:e,inclusive:!1})}function _n(e,t){return new za({check:"greater_than",...O(t),value:e,inclusive:!0})}function ri(e,t){return new al({check:"multiple_of",...O(t),value:e})}function Ma(e,t){return new sl({check:"max_length",...O(t),maximum:e})}function ln(e,t){return new ll({check:"min_length",...O(t),minimum:e})}function Ra(e,t){return new ul({check:"length_equals",...O(t),length:e})}function Hu(e,t){return new cl({check:"string_format",format:"regex",...O(t),pattern:e})}function Ju(e){return new pl({check:"string_format",format:"lowercase",...O(e)})}
28function Wu(e){return new dl({check:"string_format",format:"uppercase",...O(e)})}function Yu(e,t){return new fl({check:"string_format",format:"includes",...O(t),includes:e})}function Gu(e,t){return new hl({check:"string_format",format:"starts_with",...O(t),prefix:e})}function Xu(e,t){return new ml({check:"string_format",format:"ends_with",...O(t),suffix:e})}function Vt(e){return new gl({check:"overwrite",tx:e})}function Qu(e){return Vt(t=>t.normalize(e))}function Ku(){return Vt(e=>e.trim())}function ec(){return Vt(e=>e.toLowerCase())}function tc(){return Vt(e=>e.toUpperCase())}function nc(e,t,n){return new e({type:"array",element:t,...O(n)})}function rc(e,t,n){const r=O(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function ic(e,t,n){return new e({type:"custom",check:"custom",fn:t,...O(n)})}class ii{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Pt,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var r;const i=t._zod.def,a={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o=this.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,s);const u=t._zod.toJSONSchema?.();if(u)s.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,t],path:n.path},f=t._zod.parent;if(f)s.ref=f,this.process(f,p),this.seen.get(f).isParent=!0;else{const d=s.schema;switch(i.type){case"string":{const m=d;m.type="string";const{minimum:x,maximum:w,format:g,patterns:b,contentEncoding:h}=t._zod.bag;if(typeof x=="number"&&(m.minLength=x),typeof w=="number"&&(m.maxLength=w),g&&(m.format=a[g]??g,m.format===""&&delete m.format),h&&(m.contentEncoding=h),b&&b.size>0){const E=[...b];E.length===1?m.pattern=E[0].source:E.length>1&&(s.schema.allOf=[...E.map(z=>({...this.target==="draft-7"?{type:"string"}:{},pattern:z.source}))])}break}case"number":{const m=d,{minimum:x,maximum:w,format:g,multipleOf:b,exclusiveMaximum:h,exclusiveMinimum:E}=t._zod.bag;typeof g=="string"&&g.includes("int")?m.type="integer":m.type="number",typeof E=="number"&&(m.exclusiveMinimum=E),typeof x=="number"&&(m.minimum=x,typeof E=="number"&&(E>=x?delete m.minimum:delete m.exclusiveMinimum)),typeof h=="number"&&(m.exclusiveMaximum=h),typeof w=="number"&&(m.maximum=w,typeof h=="number"&&(h<=w?delete m.maximum:delete m.exclusiveMaximum)),typeof b=="number"&&(m.multipleOf=b);break}case"boolean":{const m=d;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{d.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{d.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const m=d,{minimum:x,maximum:w}=t._zod.bag;typeof x=="number"&&(m.minItems=x),typeof w=="number"&&(m.maxItems=w),m.type="array",m.items=this.process(i.element,{...p,path:[...p.path,"items"]});break}case"object":{const m=d;m.type="object",m.properties={};const x=i.shape;for(const b in x)m.properties[b]=this.process(x[b],{...p,path:[...p.path,"properties",b]});const w=new Set(Object.keys(x)),g=new Set([...w].filter(b=>{const h=i.shape[b]._zod;return this.io==="input"?h.optin===void 0:h.optout===void 0}));g.size>0&&(m.required=Array.from(g)),i.catchall?._zod.def.type==="never"?m.additionalProperties=!1:i.catchall?i.catchall&&(m.additionalProperties=this.process(i.catchall,{...p,path:[...p.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{const m=d;m.anyOf=i.options.map((x,w)=>this.process(x,{...p,path:[...p.path,"anyOf",w]}));break}case"intersection":{const m=d,x=this.process(i.left,{...p,path:[...p.path,"allOf",0]}),w=this.process(i.right,{...p,path:[...p.path,"allOf",1]}),g=h=>"allOf"in h&&Object.keys(h).length===1,b=[...g(x)?x.allOf:[x],...g(w)?w.allOf:[w]];m.allOf=b;break}case"tuple":{const m=d;m.type="array";const x=i.items.map((b,h)=>this.process(b,{...p,path:[...p.path,"prefixItems",h]}));
28if(this.target==="draft-2020-12"?m.prefixItems=x:m.items=x,i.rest){const b=this.process(i.rest,{...p,path:[...p.path,"items"]});this.target==="draft-2020-12"?m.items=b:m.additionalItems=b}i.rest&&(m.items=this.process(i.rest,{...p,path:[...p.path,"items"]}));const{minimum:w,maximum:g}=t._zod.bag;typeof w=="number"&&(m.minItems=w),typeof g=="number"&&(m.maxItems=g);break}case"record":{const m=d;m.type="object",m.propertyNames=this.process(i.keyType,{...p,path:[...p.path,"propertyNames"]}),m.additionalProperties=this.process(i.valueType,{...p,path:[...p.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const m=d,x=ya(i.entries);x.every(w=>typeof w=="number")&&(m.type="number"),x.every(w=>typeof w=="string")&&(m.type="string"),m.enum=x;break}case"literal":{const m=d,x=[];for(const w of i.values)if(w===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof w=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");x.push(Number(w))}else x.push(w);if(x.length!==0)if(x.length===1){const w=x[0];m.type=w===null?"null":typeof w,m.const=w}else x.every(w=>typeof w=="number")&&(m.type="number"),x.every(w=>typeof w=="string")&&(m.type="string"),x.every(w=>typeof w=="boolean")&&(m.type="string"),x.every(w=>w===null)&&(m.type="null"),m.enum=x;break}case"file":{const m=d,x={type:"string",format:"binary",contentEncoding:"binary"},{minimum:w,maximum:g,mime:b}=t._zod.bag;w!==void 0&&(x.minLength=w),g!==void 0&&(x.maxLength=g),b?b.length===1?(x.contentMediaType=b[0],Object.assign(m,x)):m.anyOf=b.map(h=>({...x,contentMediaType:h})):Object.assign(m,x);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const m=this.process(i.innerType,p);d.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,p),s.ref=i.innerType;break}case"success":{const m=d;m.type="boolean";break}case"default":{this.process(i.innerType,p),s.ref=i.innerType,d.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,p),s.ref=i.innerType,this.io==="input"&&(d._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,p),s.ref=i.innerType;let m;try{m=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}d.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const m=d,x=t._zod.pattern;if(!x)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=x.source;break}case"pipe":{const m=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(m,p),s.ref=m;break}case"readonly":{this.process(i.innerType,p),s.ref=i.innerType,d.readOnly=!0;break}case"promise":{this.process(i.innerType,p),s.ref=i.innerType;break}case"optional":{this.process(i.innerType,p),s.ref=i.innerType;break}case"lazy":{const m=t._zod.innerType;this.process(m,p),s.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const l=this.metadataRegistry.get(t);return l&&Object.assign(s.schema,l),this.io==="input"&&ce(t)&&(delete s.schema.examples,delete s.schema.default),this.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(t).schema}emit(t,n){const r={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},i=this.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=c=>{const p=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const x=r.external.registry.get(c[0])?.id,w=r.external.uri??(b=>b);if(x)return{ref:w(x)};const g=c[1].defId??c[1].schema.id??`schema${this.counter++}`;return c[1].defId=g,{defId:g,ref:`${w("__shared")}#/${p}/${g}`}}if(c[1]===i)return{ref:"#"};const d=`#/${p}/`,m=c[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:d+m}},o=c=>{if(c[1].schema.$ref)return;const p=c[1],{ref:f,defId:d}=a(c);p.def={...p.schema},d&&(p.defId=d);const m=p.schema;for(const x in m)delete m[x];m.$ref=f};if(r.cycles==="throw")for(const c of this.seen.entries()){const p=c[1];if(p.cycle)throw new Error(`Cycle detected: #/${p.cycle?.join("/")}/<root>
29
30Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of this.seen.entries()){const p=c[1];if(t===c[0]){o(c);continue}if(r.external){const d=r.external.registry.get(c[0])?.id;if(t!==c[0]&&d){o(c);continue}}if(this.metadataRegistry.get(c[0])?.id){o(c);continue}if(p.cycle){o(c);continue}if(p.count>1&&r.reused==="ref"){o(c);continue}}const s=(c,p)=>{const f=this.seen.get(c),d=f.def??f.schema,m={...d};if(f.ref===null)return;const x=f.ref;if(f.ref=null,x){s(x,p);const w=this.seen.get(x).schema;w.$ref&&p.target==="draft-7"?(d.allOf=d.allOf??[],d.allOf.push(w)):(Object.assign(d,w),Object.assign(d,m))}f.isParent||this.override({zodSchema:c,jsonSchema:d,path:f.path??[]})};for(const c of[...this.seen.entries()].reverse())s(c[0],{target:this.target});const u={};
30if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){const c=r.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");u.$id=r.external.uri(c)}Object.assign(u,i.def);const l=r.external?.defs??{};for(const c of this.seen.entries()){const p=c[1];p.def&&p.defId&&(l[p.defId]=p.def)}r.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?u.$defs=l:u.definitions=l);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}}function ac(e,t){if(e instanceof Na){const r=new ii(t),i={};for(const s of e._idmap.entries()){const[u,l]=s;r.process(l)}const a={},o={registry:e,uri:t?.uri,defs:i};for(const s of e._idmap.entries()){const[u,l]=s;a[u]=r.emit(l,{...t,external:o})}if(Object.keys(i).length>0){const s=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:i}}return{schemas:a}}const n=new ii(t);return n.process(e),n.emit(e,t)}function ce(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return ce(i.element,n);case"object":{for(const a in i.shape)if(ce(i.shape[a],n))return!0;return!1}case"union":{for(const a of i.options)if(ce(a,n))return!0;return!1}case"intersection":return ce(i.left,n)||ce(i.right,n);case"tuple":{for(const a of i.items)if(ce(a,n))return!0;return!!(i.rest&&ce(i.rest,n))}case"record":return ce(i.keyType,n)||ce(i.valueType,n);case"map":return ce(i.keyType,n)||ce(i.valueType,n);case"set":return ce(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return ce(i.innerType,n);case"lazy":return ce(i.getter(),n);case"default":return ce(i.innerType,n);case"prefault":return ce(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return ce(i.in,n)||ce(i.out,n);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const oc=_("ZodISODateTime",(e,t)=>{Al.init(e,t),se.init(e,t)});function sc(e){return $u(oc,e)}const lc=_("ZodISODate",(e,t)=>{Pl.init(e,t),se.init(e,t)});function uc(e){return Du(lc,e)}const cc=_("ZodISOTime",(e,t)=>{Ol.init(e,t),se.init(e,t)});function pc(e){return Zu(cc,e)}const dc=_("ZodISODuration",(e,t)=>{Nl.init(e,t),se.init(e,t)});function fc(e){return ju(dc,e)}const hc=(e,t)=>{xa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Is(e,n)},flatten:{value:n=>Es(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},gn=_("ZodError",hc,{Parent:Error}),mc=Cs(gn),gc=Ts(gn),yc=ka(gn),$a=_a(gn),oe=_("ZodType",(e,t)=>(ne.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>at(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>mc(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>yc(e,n,r),e.parseAsync=async(n,r)=>gc(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>$a(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(dp(n,r)),e.superRefine=n=>e.check(fp(n)),e.overwrite=n=>e.check(Vt(n)),e.optional=()=>si(e),e.nullable=()=>li(e),e.nullish=()=>si(li(e)),e.nonoptional=n=>rp(e,n),e.array=()=>bt(e),e.or=n=>ge([e,n]),e.and=n=>Jc(e,n),e.transform=n=>ui(e,Xc(n)),e.default=n=>ep(e,n),e.prefault=n=>np(e,n),e.catch=n=>ap(e,n),e.pipe=n=>ui(e,n),e.readonly=()=>lp(e),e.describe=n=>{const r=e.clone();return Pt.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Pt.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Pt.get(e);const r=e.clone();return Pt.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Da=_("_ZodString",(e,t)=>{pr.init(e,t),oe.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Hu(...r)),e.includes=(...r)=>e.check(Yu(...r)),e.startsWith=(...r)=>e.check(Gu(...r)),e.endsWith=(...r)=>e.check(Xu(...r)),e.min=(...r)=>e.check(ln(...r)),e.max=(...r)=>e.check(Ma(...r)),e.length=(...r)=>e.check(Ra(...r)),e.nonempty=(...r)=>e.check(ln(1,...r)),e.lowercase=r=>e.check(Ju(r)),e.uppercase=r=>e.check(Wu(r)),e.trim=()=>e.check(Ku()),e.normalize=(...r)=>e.check(Qu(...r)),e.toLowerCase=()=>e.check(ec()),e.toUpperCase=()=>e.check(tc())}),vc=_("ZodString",(e,t)=>{pr.init(e,t),Da.init(e,t),e.email=n=>e.check(mu(bc,n)),e.url=n=>e.check(xu(xc,n)),e.jwt=n=>e.check(Ru(Rc,n)),e.emoji=n=>e.check(wu(wc,n)),e.guid=n=>
vendor: 4,458 bytes, line 30
30e.check(ei(ai,n)),e.uuid=n=>e.check(gu(Qt,n)),e.uuidv4=n=>e.check(yu(Qt,n)),e.uuidv6=n=>e.check(vu(Qt,n)),e.uuidv7=n=>e.check(bu(Qt,n)),e.nanoid=n=>e.check(ku(kc,n)),e.guid=n=>e.check(ei(ai,n)),e.cuid=n=>e.check(_u(_c,n)),e.cuid2=n=>e.check(Su(Sc,n)),e.ulid=n=>e.check(Eu(Ec,n)),e.base64=n=>e.check(Ou(Oc,n)),e.base64url=n=>e.check(Nu(Nc,n)),e.xid=n=>e.check(Iu(Ic,n)),e.ksuid=n=>e.check(Cu(Cc,n)),e.ipv4=n=>e.check(Tu(Tc,n)),e.ipv6=n=>e.check(zu(zc,n)),e.cidrv4=n=>e.check(Au(Ac,n)),e.cidrv6=n=>e.check(Pu(Pc,n)),e.e164=n=>e.check(Mu(Mc,n)),e.datetime=n=>e.check(sc(n)),e.date=n=>e.check(uc(n)),e.time=n=>e.check(pc(n)),e.duration=n=>e.check(fc(n))});function C(e){return hu(vc,e)}const se=_("ZodStringFormat",(e,t)=>{ae.init(e,t),Da.init(e,t)}),bc=_("ZodEmail",(e,t)=>{wl.init(e,t),se.init(e,t)}),ai=_("ZodGUID",(e,t)=>{bl.init(e,t),se.init(e,t)}),Qt=_("ZodUUID",(e,t)=>{xl.init(e,t),se.init(e,t)}),xc=_("ZodURL",(e,t)=>{kl.init(e,t),se.init(e,t)}),wc=_("ZodEmoji",(e,t)=>{_l.init(e,t),se.init(e,t)}),kc=_("ZodNanoID",(e,t)=>{Sl.init(e,t),se.init(e,t)}),_c=_("ZodCUID",(e,t)=>{El.init(e,t),se.init(e,t)}),Sc=_("ZodCUID2",(e,t)=>{Il.init(e,t),se.init(e,t)}),Ec=_("ZodULID",(e,t)=>{Cl.init(e,t),se.init(e,t)}),Ic=_("ZodXID",(e,t)=>{Tl.init(e,t),se.init(e,t)}),Cc=_("ZodKSUID",(e,t)=>{zl.init(e,t),se.init(e,t)}),Tc=_("ZodIPv4",(e,t)=>{Ml.init(e,t),se.init(e,t)}),zc=_("ZodIPv6",(e,t)=>{Rl.init(e,t),se.init(e,t)}),Ac=_("ZodCIDRv4",(e,t)=>{$l.init(e,t),se.init(e,t)}),Pc=_("ZodCIDRv6",(e,t)=>{Dl.init(e,t),se.init(e,t)}),Oc=_("ZodBase64",(e,t)=>{Zl.init(e,t),se.init(e,t)}),Nc=_("ZodBase64URL",(e,t)=>{Ll.init(e,t),se.init(e,t)}),Mc=_("ZodE164",(e,t)=>{Fl.init(e,t),se.init(e,t)}),Rc=_("ZodJWT",(e,t)=>{Ul.init(e,t),se.init(e,t)}),Za=_("ZodNumber",(e,t)=>{Pa.init(e,t),oe.init(e,t),e.gt=(r,i)=>e.check(ni(r,i)),e.gte=(r,i)=>e.check(_n(r,i)),e.min=(r,i)=>e.check(_n(r,i)),e.lt=(r,i)=>e.check(ti(r,i)),e.lte=(r,i)=>e.check(kn(r,i)),e.max=(r,i)=>e.check(kn(r,i)),e.int=r=>e.check(oi(r)),e.safe=r=>e.check(oi(r)),e.positive=r=>e.check(ni(0,r)),e.nonnegative=r=>e.check(_n(0,r)),e.negative=r=>e.check(ti(0,r)),e.nonpositive=r=>e.check(kn(0,r)),e.multipleOf=(r,i)=>e.check(ri(r,i)),e.step=(r,i)=>e.check(ri(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function $c(e){return Lu(Za,e)}const Dc=_("ZodNumberFormat",(e,t)=>{Vl.init(e,t),Za.init(e,t)});function oi(e){return Fu(Dc,e)}const Zc=_("ZodBoolean",(e,t)=>{ql.init(e,t),oe.init(e,t)});function me(e){return Bu(Zc,e)}const jc=_("ZodNull",(e,t)=>{Hl.init(e,t),oe.init(e,t)});function Lc(e){return Uu(jc,e)}const Fc=_("ZodUnknown",(e,t)=>{Jl.init(e,t),oe.init(e,t)});function Re(){return Vu(Fc)}const Bc=_("ZodNever",(e,t)=>{Wl.init(e,t),oe.init(e,t)});function ja(e){return qu(Bc,e)}const Uc=_("ZodArray",(e,t)=>{Yl.init(e,t),oe.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(ln(n,r)),e.nonempty=n=>e.check(ln(1,n)),e.max=(n,r)=>e.check(Ma(n,r)),e.length=(n,r)=>e.check(Ra(n,r)),e.unwrap=()=>e.element});function bt(e,t){return nc(Uc,e,t)}const La=_("ZodObject",(e,t)=>{Gl.init(e,t),oe.init(e,t),W(e,"shape",()=>t.shape),e.keyof=()=>Ba(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Re()}),e.loose=()=>e.clone({...e._zod.def,catchall:Re()}),e.strict=()=>e.clone({...e._zod.def,catchall:ja()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>ws(e,n),e.merge=n=>ks(e,n),e.pick=n=>bs(e,n),e.omit=n=>xs(e,n),e.partial=(...n)=>_s(Ua,e,n[0]),e.required=(...n)=>Ss(Va,e,n[0])});function Q(e,t){const n={type:"object",get shape(){return hn(this,"shape",{...e}),this.shape},...O(t)};return new La(n)}function re(e,t){return new La({type:"object",get shape(){return hn(this,"shape",{...e}),this.shape},catchall:ja(),...O(t)})}const Fa=_("ZodUnion",(e,t)=>{Oa.init(e,t),oe.init(e,t),e.options=t.options});function ge(e,t){return new Fa({type:"union",options:e,...O(t)})}const Vc=_("ZodDiscriminatedUnion",(e,t)=>{Fa.init(e,t),Xl.init(e,t)});function qc(e,t,n){return new Vc({type:"union",options:t,discriminator:e,...O(n)})}const Hc=_("ZodIntersection",(e,t)=>{Ql.init(e,t),oe.init(e,t)});
30function Jc(e,t){return new Hc({type:"intersection",left:e,right:t})}const Wc=_("ZodRecord",(e,t)=>{Kl.init(e,t),oe.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function nt(e,t,n){return new Wc({type:"record",keyType:e,valueType:t,...O(n)})}const Un=_("ZodEnum",(e,t)=>{eu.init(e,t),oe.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const a={};for(const o of r)if(n.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Un({...t,checks:[],...O(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const o of r)if(n.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Un({...t,checks:[],...O(i),entries:a})}});function Ba(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Un({type:"enum",entries:n,...O(t)})}const Yc=_("ZodLiteral",(e,t)=>{tu.init(e,t),oe.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function R(e,t){return new Yc({type:"literal",values:Array.isArray(e)?e:[e],...O(t)})}const Gc=_("ZodTransform",(e,t)=>{nu.init(e,t),oe.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=a=>{if(typeof a=="string")n.issues.push(Lt(a,n.value,t));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),o.continue??(o.continue=!0),n.issues.push(Lt(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function Xc(e){return new Gc({type:"transform",transform:e})}const Ua=_("ZodOptional",(e,t)=>{ru.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function si(e){return new Ua({type:"optional",innerType:e})}const Qc=_("ZodNullable",(e,t)=>{iu.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function li(e){return new Qc({type:"nullable",innerType:e})}const Kc=_("ZodDefault",(e,t)=>{au.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ep(e,t){return new Kc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const tp=_("ZodPrefault",(e,t)=>{ou.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function np(e,t){return new tp({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Va=_("ZodNonOptional",(e,t)=>{su.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rp(e,t){return new Va({type:"nonoptional",innerType:e,...O(t)})}const ip=_("ZodCatch",(e,t)=>{lu.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ap(e,t){return new ip({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const op=_("ZodPipe",(e,t)=>{uu.init(e,t),oe.init(e,t),e.in=t.in,e.out=t.out});function ui(e,t){return new op({type:"pipe",in:e,out:t})}const sp=_("ZodReadonly",(e,t)=>{cu.init(e,t),oe.init(e,t)});function lp(e){return new sp({type:"readonly",innerType:e})}const up=_("ZodLazy",(e,t)=>{pu.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.getter()});function cp(e){return new up({type:"lazy",getter:e})}const dr=_("ZodCustom",(e,t)=>{du.init(e,t),oe.init(e,t)});function pp(e){const t=new be({check:"custom"});return t._zod.check=e,t}function qa(e,t){return rc(dr,e??(()=>!0),t)}function dp(e,t={}){return ic(dr,e,t)}function fp(e){const t=pp(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Lt(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Lt(i))}},e(n.value,n)));return t}function un(e,t={error:`Input not instance of ${e.name}`}){const n=new dr({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...O(t)});return n._zod.bag.Class=e,n}var L;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(L||(L={}));
vendor: 25,044 bytes, lines 30-43
30class ci extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const pi=10,hp=13,Ke=32;function Sn(e){}function mp(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Sn,onError:n=Sn,onRetry:r=Sn,onComment:i}=e,a=[];let o=!0,s,u="",l=0,c;function p(g){if(o&&(o=!1,g.charCodeAt(0)===239&&g.charCodeAt(1)===187&&g.charCodeAt(2)===191&&(g=g.slice(3))),a.length===0){const E=f(g);E!==""&&a.push(E);return}if(g.indexOf(`
31`)===-1&&g.indexOf("\r")===-1){a.push(g);return}a.push(g);const b=a.join("");a.length=0;const h=f(b);h!==""&&a.push(h)}function f(g){let b=0;if(g.indexOf("\r")===-1){let h=g.indexOf(`
32`,b);for(;h!==-1;){if(b===h){l>0&&t({id:s,event:c,data:u}),s=void 0,u="",l=0,c=void 0,b=h+1,h=g.indexOf(`
33`,b);continue}const E=g.charCodeAt(b);if(di(g,b,E)){const z=g.charCodeAt(b+5)===Ke?b+6:b+5,k=g.slice(z,h);if(l===0&&g.charCodeAt(h+1)===pi){t({id:s,event:c,data:k}),s=void 0,u="",c=void 0,b=h+2,h=g.indexOf(`
34`,b);continue}u=l===0?k:`${u}
35${k}`,l++}else fi(g,b,E)?c=g.slice(g.charCodeAt(b+6)===Ke?b+7:b+6,h)||void 0:d(g,b,h);b=h+1,h=g.indexOf(`
36`,b)}return g.slice(b)}for(;b<g.length;){const h=g.indexOf("\r",b),E=g.indexOf(`
37`,b);let z=-1;if(h!==-1&&E!==-1?z=h<E?h:E:h!==-1?h===g.length-1?z=-1:z=h:E!==-1&&(z=E),z===-1)break;d(g,b,z),b=z+1,g.charCodeAt(b-1)===hp&&g.charCodeAt(b)===pi&&b++}return g.slice(b)}function d(g,b,h){if(b===h){x();return}const E=g.charCodeAt(b);if(di(g,b,E)){const U=g.charCodeAt(b+5)===Ke?b+6:b+5,N=g.slice(U,h);u=l===0?N:`${u}
38${N}`,l++;return}if(fi(g,b,E)){c=g.slice(g.charCodeAt(b+6)===Ke?b+7:b+6,h)||void 0;return}if(E===105&&g.charCodeAt(b+1)===100&&g.charCodeAt(b+2)===58){const U=g.slice(g.charCodeAt(b+3)===Ke?b+4:b+3,h);s=U.includes("\0")?void 0:U;return}if(E===58){if(i){const U=g.slice(b,h);i(U.slice(g.charCodeAt(b+1)===Ke?2:1))}return}const z=g.slice(b,h),k=z.indexOf(":");if(k===-1){m(z,"",z);return}const P=z.slice(0,k),$=z.charCodeAt(k+1)===Ke?2:1,F=z.slice(k+$);m(P,F,z)}function m(g,b,h){switch(g){case"event":c=b||void 0;break;case"data":u=l===0?b:`${u}
39${b}`,l++;break;case"id":s=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?r(parseInt(b,10)):n(new ci(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:h}));break;default:n(new ci(`Unknown field "${g.length>20?`${g.slice(0,20)}…`:g}"`,{type:"unknown-field",field:g,value:b,line:h}));break}}function x(){l>0&&t({id:s,event:c,data:u}),s=void 0,u="",l=0,c=void 0}function w(g={}){if(g.consume&&a.length>0){const b=a.join("");d(b,0,b.length)}o=!0,s=void 0,u="",l=0,c=void 0,a.length=0}return{feed:p,reset:w}}function di(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function fi(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class gp extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let i;super({start(a){i=mp({onEvent:o=>{a.enqueue(o)},onError(o){t==="terminate"?a.error(o):typeof t=="function"&&t(o)},onRetry:n,onComment:r})},transform(a){i.feed(a)}})}}var qt=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const a=n.length,o=new Array(t);for(let s=0;s<t;s++)o[s]=n[Math.random()*a|0];return o.join("")};if(e==null)return i;if(n.includes(r))throw new cs({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},yp=qt();function ct(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((n,r)=>{t[r.toLowerCase()]=n});else{Array.isArray(e)||(e=Object.entries(e));for(const[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}var vp=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,bp=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function hi(e){const t=JSON.parse(e);return t===null||typeof t!="object"||vp.test(e)===!1&&bp.test(e)===!1?t:xp(t)}function xp(e){let t=[e];for(;t.length;){const n=t;t=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const a=r[i];a&&typeof a=="object"&&t.push(a)}}}return e}function wp(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return hi(e)}try{return hi(e)}finally{Error.stackTraceLimit=t}}function fr(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:n}=e;if(n!=null)for(const r of Object.keys(n))n[r]=et(n[r])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(et):et(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(et)),e.allOf!=null&&(e.allOf=e.allOf.map(et)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(et));const{definitions:t}=e;if(t!=null)for(const n of Object.keys(t))t[n]=et(t[n]);return e}function et(e){return typeof e=="boolean"?e:fr(e)}var kp=Symbol("Let zodToJsonSchema decide on which parser to use"),mi={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},_p=e=>typeof e=="string"?{...mi,name:e}:{...mi,...e};function Se(){return{}}function Sp(e,t){var n,r,i;const a={type:"array"};return(n=e.type)!=null&&n._def&&((i=(r=e.type)==null?void 0:r._def)==null?void 0:i.typeName)!==L.ZodAny&&(a.items=Y(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(a.minItems=e.minLength.value),e.maxLength&&(a.maxItems=e.maxLength.value),e.exactLength&&(a.minItems=e.exactLength.value,a.maxItems=e.exactLength.value),a}function Ep(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function Ip(){return{type:"boolean"}}function Ha(e,t){return Y(e.type._def,t)}var Cp=(e,t)=>Y(e.innerType._def,t);function Ja(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>Ja(e,t,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Tp(e)}}var Tp=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function zp(e,t){return{...Y(e.innerType._def,t),default:e.defaultValue()}}function Ap(e,t){return t.effectStrategy==="input"?Y(e.schema._def,t):Se()}function Pp(e){return{type:"string",enum:Array.from(e.values)}}var Op=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Np(e,t){const n=[Y(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Y(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(Op(i))r.push(...i.allOf);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:o,...s}=i;a=s}r.push(a)}}),r.length?{allOf:r}:void 0}function Mp(e){const t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var En=void 0,Pe={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(En===void 0&&(En=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),En),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Wa(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":Oe(n,"email",r.message,t);break;case"format:idn-email":Oe(n,"idn-email",r.message,t);break;case"pattern:zod":he(n,Pe.email,r.message,t);break}break;case"url":Oe(n,"uri",r.message,t);break;case"uuid":Oe(n,"uuid",r.message,t);break;case"regex":he(n,r.regex,r.message,t);break;case"cuid":he(n,Pe.cuid,r.message,t);break;case"cuid2":he(n,Pe.cuid2,r.message,t);break;case"startsWith":he(n,RegExp(`^${In(r.value,t)}`),r.message,t);break;case"endsWith":he(n,RegExp(`${In(r.value,t)}$`),r.message,t);break;case"datetime":Oe(n,"date-time",r.message,t);break;case"date":Oe(n,"date",r.message,t);break;case"time":Oe(n,"time",r.message,t);break;case"duration":Oe(n,"duration",r.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{he(n,RegExp(In(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&Oe(n,"ipv4",r.message,t),r.version!=="v4"&&Oe(n,"ipv6",r.message,t);break}case"base64url":he(n,Pe.base64url,r.message,t);break;case"jwt":he(n,Pe.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&he(n,Pe.ipv4Cidr,r.message,t),r.version!=="v4"&&he(n,Pe.ipv6Cidr,r.message,t);break}case"emoji":he(n,Pe.emoji(),r.message,t);break;case"ulid":{he(n,Pe.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Oe(n,"binary",r.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{he(n,Pe.base64,r.message,t);break}}break}case"nanoid":he(n,Pe.nanoid,r.message,t)}return n}function In(e,t){return t.patternStrategy==="escape"?$p(e):e}var Rp=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function $p(e){let t="";for(let n=0;n<e.length;n++)Rp.has(e[n])||(t+="\\"),t+=e[n];return t}function Oe(e,t,n,r){var i;e.format||(i=e.anyOf)!=null&&i.some(a=>a.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function he(e,t,n,r){var i;e.pattern||(i=e.allOf)!=null&&i.some(a=>a.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:gi(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=gi(t,r)}function gi(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source;let a="",o=!1,s=!1,u=!1;for(let l=0;l<i.length;l++){if(o){a+=i[l],o=!1;continue}if(r.i){if(s){if(i[l].match(/[a-z]/)){u?(a+=i[l],a+=`${i[l-2]}-${i[l]}`.toUpperCase(),u=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(a+=i[l],u=!0):a+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){a+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){a+=`(^|(?<=[\r
40]))`;continue}else if(i[l]==="$"){a+=`($|(?=[\r
41]))`;continue}}if(r.s&&i[l]==="."){a+=s?`${i[l]}\r
42`:`[${i[l]}\r
43]`;continue}a+=i[l],i[l]==="\\"?o=!0:s&&i[l]==="]"?s=!1:!s&&i[l]==="["&&(s=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function Ya(e,t){var n,r,i,a,o,s;const u={type:"object",additionalProperties:(n=Y(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===L.ZodString&&((i=e.keyType._def.checks)!=null&&i.length)){const{type:l,...c}=Wa(e.keyType._def,t);return{...u,propertyNames:c}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===L.ZodEnum)return{...u,propertyNames:{enum:e.keyType._def.values}};if(((o=e.keyType)==null?void 0:o._def.typeName)===L.ZodBranded&&e.keyType._def.type._def.typeName===L.ZodString&&((s=e.keyType._def.type._def.checks)!=null&&s.length)){const{type:l,...c}=Ha(e.keyType._def,t);return{...u,propertyNames:c}}}return u}function Dp(e,t){if(t.mapStrategy==="record")return Ya(e,t);const n=Y(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Se(),r=Y(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Se();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Zp(e){const t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function jp(){return{not:Se()}}function Lp(){return{type:"null"}}var Vn={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Fp(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in Vn&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,a)=>{const o=Vn[a._def.typeName];return o&&!i.includes(o)?[...i,o]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,a)=>{const o=typeof a._def.value;switch(o){case"string":case"number":case"boolean":return[...i,o];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((a,o,s)=>s.indexOf(a)===o);return{type:i.length>1?i:i[0],enum:n.reduce((a,o)=>a.includes(o._def.value)?a:[...a,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return Bp(e,t)}var Bp=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>Y(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Up(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Vn[e.innerType._def.typeName],"null"]};const n=Y(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Vp(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function qp(e,t){const n={type:"object",properties:{}},r=[],i=e.shape();for(const o in i){let s=i[o];if(s===void 0||s._def===void 0)continue;const u=Jp(s),l=Y(s._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});l!==void 0&&(n.properties[o]=l,u||r.push(o))}r.length&&(n.required=r);const a=Hp(e,t);return a!==void 0&&(n.additionalProperties=a),n}function Hp(e,t){if(e.catchall._def.typeName!=="ZodNever")return Y(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function Jp(e){try{return e.isOptional()}catch{return!0}}var Wp=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Y(e.innerType._def,t);const r=Y(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Se()},r]}:Se()},Yp=(e,t)=>{if(t.pipeStrategy==="input")return Y(e.in._def,t);if(t.pipeStrategy==="output")return Y(e.out._def,t);const n=Y(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Y(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function Gp(e,t){return Y(e.type._def,t)}function Xp(e,t){const r={type:"array",uniqueItems:!0,items:Y(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function Qp(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Y(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Y(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Y(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Kp(){return{not:Se()}}function ed(){return Se()}var td=(e,t)=>Y(e.innerType._def,t),nd=(e,t,n)=>{switch(t){case L.ZodString:return Wa(e,n);case L.ZodNumber:return Vp(e);case L.ZodObject:return qp(e,n);case L.ZodBigInt:return Ep(e);case L.ZodBoolean:return Ip();case L.ZodDate:return Ja(e,n);case L.ZodUndefined:return Kp();case L.ZodNull:return Lp();case L.ZodArray:return Sp(e,n);case L.ZodUnion:case L.ZodDiscriminatedUnion:return Fp(e,n);case L.ZodIntersection:return Np(e,n);case L.ZodTuple:return Qp(e,n);case L.ZodRecord:return Ya(e,n);case L.ZodLiteral:return Mp(e);case L.ZodEnum:return Pp(e);case L.ZodNativeEnum:return Zp(e);case L.ZodNullable:return Up(e,n);case L.ZodOptional:return Wp(e,n);case L.ZodMap:return Dp(e,n);case L.ZodSet:return Xp(e,n);case L.ZodLazy:return()=>e.getter()._def;case L.ZodPromise:return Gp(e,n);case L.ZodNaN:case L.ZodNever:return jp();case L.ZodEffects:return Ap(e,n);case L.ZodAny:return Se();case L.ZodUnknown:return ed();case L.ZodDefault:return zp(e,n);case L.ZodBranded:return Ha(e,n);case L.ZodReadonly:return td(e,n);case L.ZodCatch:return Cp(e,n);case L.ZodPipeline:return Yp(e,n);case L.ZodFunction:case L.ZodVoid:case L.ZodSymbol:return;default:return(r=>{})()}},rd=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function Y(e,t,n=!1){var r;const i=t.seen.get(e);if(t.override){const u=(r=t.override)==null?void 0:r.call(t,e,t,i,n);if(u!==kp)return u}if(i&&!n){const u=id(i,t);if(u!==void 0)return u}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const o=nd(e,e.typeName,t),s=typeof o=="function"?Y(o(),t):o;if(s&&ad(e,t,s),t.postProcess){const u=t.postProcess(s,e,t);return a.jsonSchema=s,u}return a.jsonSchema=s,s}var id=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:rd(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Se()):t.$refStrategy==="seen"?Se():void 0}},ad=(e,t,n)=>(e.description&&(n.description=e.description),n),od=e=>{const t=_p(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},sd=(e,t)=>{var n;const r=od(t);let i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((l,[c,p])=>{var f;return{...l,[c]:(f=Y(p._def,{...r,currentPath:[...r.basePath,r.definitionPath,c]},!0))!=null?f:Se()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=(n=Y(e._def,a===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))!=null?n:Se(),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(o.title=s);const u=a===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...i,[a]:o}};return u.$schema="http://json-schema.org/draft-07/schema#",u},qn=Symbol.for("vercel.ai.schema");function ld(e){let t;return()=>(t==null&&(t=e()),t)}function yn(e,{validate:t}={}){return{[qn]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function ud(e){return typeof e=="object"&&e!==null&&qn in e&&e[qn]===!0&&"jsonSchema"in e&&"validate"in e}function hr(e){return e==null?yn({properties:{},additionalProperties:!1}):ud(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?Ga(e):cd(e):e()}function cd(e){return yn(()=>fr(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{const n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new vt({value:t,cause:n.issues})}}})}function pd(e,t){var n;const r=(n=void 0)!=null?n:!1;return yn(()=>sd(e,{$refStrategy:r?"root":"none"}),{validate:async i=>{const a=await e.safeParseAsync(i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function dd(e,t){var n;const r=(n=void 0)!=null?n:!1;return yn(()=>fr(ac(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const a=await $a(e,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function fd(e){return"_zod"in e}function Ga(e,t){return fd(e)?dd(e):pd(e)}async function yi({value:e,schema:t,context:n}){const r=await Ft({value:e,schema:t,context:n});if(!r.success)throw vt.wrap({value:e,cause:r.error,context:n});return r.value}async function Ft({value:e,schema:t,context:n}){const r=hr(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};const i=await r.validate(e);return i.success?{success:!0,value:i.value,rawValue:e}:{success:!1,error:vt.wrap({value:e,cause:i.error,context:n}),rawValue:e}}catch(i){return{success:!1,error:vt.wrap({value:e,cause:i,context:n}),rawValue:e}}}async function rt({text:e,schema:t}){try{const n=wp(e);return t==null?{success:!0,value:n,rawValue:n}:await Ft({value:n,schema:t})}catch(n){return{success:!1,error:Fr.isInstance(n)?n:new Fr({text:e,cause:n}),rawValue:void 0}}}function hd({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new gp).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await rt({text:n,schema:t}))}}))}async function He(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var md=Object.defineProperty,gd=(e,t)=>{for(var n in t)md(e,n,{get:t[n],enumerable:!0})},Xa="AI_NoObjectGeneratedError",Qa=`vercel.ai.error.${Xa}
43`,yd=Symbol.for(Qa),Ka,Je=class extends De{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:Xa,message:e,cause:t}),this[Ka]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return De.hasMarker(e,Qa)}};Ka=yd;var eo="AI_UIMessageStreamError",to=`vercel.ai.error.${eo}`,vd=Symbol.for(to),no,pt=class extends De{constructor({chunkType:e,chunkId:t,message:n}){super({name:eo,message:n}),this[no]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return De.hasMarker(e,to)}};no=vd;var ro=ge([C(),un(Uint8Array),un(ArrayBuffer),qa(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]),it=cp(()=>ge([Lc(),C(),$c(),me(),nt(C(),it.optional()),bt(it)])),V=nt(C(),nt(C(),it.optional())),io=Q({type:R("text"),text:C(),providerOptions:V.optional()}),bd=Q({type:R("image"),image:ge([ro,un(URL)]),mediaType:C().optional(),providerOptions:V.optional()}),ao=Q({type:R("file"),data:ge([ro,un(URL)]),filename:C().optional(),mediaType:C(),providerOptions:V.optional()}),xd=Q({type:R("reasoning"),text:C(),providerOptions:V.optional()}),wd=Q({type:R("tool-call"),toolCallId:C(),toolName:C(),input:Re(),providerOptions:V.optional(),providerExecuted:me().optional()}),kd=qc("type",[Q({type:R("text"),value:C(),providerOptions:V.optional()}),Q({type:R("json"),value:it,providerOptions:V.optional()}),Q({type:R("execution-denied"),reason:C().optional(),providerOptions:V.optional()}),Q({type:R("error-text"),value:C(),providerOptions:V.optional()}),Q({type:R("error-json"),value:it,providerOptions:V.optional()}),Q({type:R("content"),value:bt(ge([Q({type:R("text"),text:C(),providerOptions:V.optional()}),Q({type:R("media"),data:C(),mediaType:C()}),Q({type:R("file-data"),data:C(),mediaType:C(),filename:C().optional(),providerOptions:V.optional()}),Q({type:R("file-url"),url:C(),providerOptions:V.optional()}),Q({type:R("file-id"),fileId:ge([C(),nt(C(),C())]),providerOptions:V.optional()}),Q({type:R("image-data"),data:C(),mediaType:C(),providerOptions:V.optional()}),Q({type:R("image-url"),url:C(),providerOptions:V.optional()}),Q({type:R("image-file-id"),fileId:ge([C(),nt(C(),C())]),providerOptions:V.optional()}),Q({type:R("custom"),providerOptions:V.optional()})]))})]),oo=Q({type:R("tool-result"),toolCallId:C(),toolName:C(),output:kd,providerOptions:V.optional()}),_d=Q({type:R("tool-approval-request"),approvalId:C(),toolCallId:C()}),Sd=Q({type:R("tool-approval-response"),approvalId:C(),approved:me(),reason:C().optional()}),Ed=Q({role:R("system"),content:C(),providerOptions:V.optional()}),Id=Q({role:R("user"),content:ge([C(),bt(ge([io,bd,ao]))]),providerOptions:V.optional()}),Cd=Q({role:R("assistant"),content:ge([C(),bt(ge([io,ao,xd,wd,oo,_d]))]),providerOptions:V.optional()}),Td=Q({role:R("tool"),content:bt(ge([oo,Sd])),providerOptions:V.optional()});ge([Ed,Id,Cd,Td]);function so(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const n={...e};for(const r in t)if(!(r==="__proto__"||r==="constructor"||r==="prototype")&&Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];if(i===void 0)continue;const a=r in e?e[r]:void 0,o=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),s=a!=null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);o&&s?n[r]=so(a,i):n[r]=i}return n}var zd={};gd(zd,{array:()=>Nd,choice:()=>Md,json:()=>Rd,object:()=>Od,text:()=>Pd});function Ad(e){const t=["ROOT"];let n=-1,r=null;function i(u,l,c){switch(u){case'"':{n=l,t.pop(),t.push(c),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,r=l,t.pop(),t.push(c),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l,t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"{":{n=l,t.pop(),t.push(c),t.push("INSIDE_OBJECT_START");break}case"[":{n=l,t.pop(),t.push(c),t.push("INSIDE_ARRAY_START");break}}}function a(u,l){switch(u){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,t.pop();break}}}function o(u,l){switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}}}for(let u=0;u<e.length;u++){const l=e[u];switch(t[t.length-1]){case"ROOT":i(l,u,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=u,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(l,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(l,u);break}case"INSIDE_STRING":{switch(l){case'"':{t.pop(),n=u;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=u}break}case"INSIDE_ARRAY_START":{l==="]"?(n=u,t.pop()):(n=u,i(l,u,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,t.pop();break}default:{n=u;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,u,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=u;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(l,u),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,u);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,u);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(l,u);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const p=e.substring(r,u+1);!"false".startsWith(p)&&!"true".startsWith(p)&&!"null".startsWith(p)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(l,u):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(l,u)):n=u;break}}}let s=e.slice(0,n+1);for(let u=t.length-1;u>=0;u--)switch(t[u]){case"INSIDE_STRING":{s+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{s+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{s+="]";break}case"INSIDE_LITERAL":{const c=e.substring(r,e.length);"true".startsWith(c)?s+="true".slice(c.length):"false".startsWith(c)?s+="false".slice(c.length):"null".startsWith(c)&&(s+="null".slice(c.length))}}return s}async function Ht(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await rt({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await rt({text:Ad(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Pd=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),Od=({schema:e,name:t,description:n})=>{const r=hr(e);return{name:"object",responseFormat:He(r.jsonSchema).then(i=>({type:"json",schema:i,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},a){const o=await rt({text:i});if(!o.success)throw new Je({message:"No object generated: could not parse the response.",cause:o.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const s=await Ft({value:o.value,schema:r});if(!s.success)throw new Je({message:"No object generated: response did not match sc
43hema.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});return s.value},async parsePartialOutput({text:i}){const a=await Ht(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:a.value}}},createElementStreamTransform(){}}},Nd=({element:e,name:t,description:n})=>{const r=hr(e);return{name:"array",responseFormat:He(r.jsonSchema).then(i=>{const{$schema:a,...o}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:o}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},a){const o=await rt({text:i});if(!o.success)throw new Je({message:"No object generated: could not parse the response.",cause:o.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const s=o.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))throw new Je({message:"No object generated: response did not match schema.",cause:new vt({value:s,cause:"response must be an object with an elements array"}),text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});for(const u of s.elements){const l=await Ft({value:u,schema:r});if(!l.success)throw new Je({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason})}return s.elements},async parsePartialOutput({text:i}){const a=await Ht(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const o=a.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))return;const s=a.state==="repaired-parse"&&o.elements.length>0?o.elements.slice(0,-1):o.elements,u=[];for(const l of s){const c=await Ft({value:l,schema:r});c.success&&u.push(c.value)}return{partial:u}}}},createElementStreamTransform(){let i=0;return new TransformStream({transform({partialOutput:a},o){if(a!=null)for(;i<a.length;i++)o.enqueue(a[i])}})}}},Md=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const a=await rt({text:r});if(!a.success)throw new Je({message:"No object generated: could not parse the response.",cause:a.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const o=a.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string"||!e.includes(o.result))throw new Je({message:"No object generated: response did not match schema.",cause:new vt({value:o,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return o.result},async parsePartialOutput({text:r}){const i=await Ht(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string")return;const o=e.filter(s=>s.startsWith(a.result));return i.state==="successful-parse"?o.includes(a.result)?{partial:a.result}:void 0:o.length===1?{partial:o[0]}:void 0}}},createElementStreamTransform(){}}),Rd=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:n},r){const i=await rt({text:n});if(!i.success)throw new Je({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await Ht(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}},createElementStreamTransform(){}});qt({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
44
45`)},flush(e){e.enqueue(`data: [DONE]
46
47`)}})}});var It=nt(C(),it.optional()),$d=ld(()=>Ga(ge([re({type:R("text-start"),id:C(),providerMetadata:V.optional()}),re({type:R("text-delta"),id:C(),delta:C(),providerMetadata:V.optional()}),re({type:R("text-end"),id:C(),providerMetadata:V.optional()}),re({type:R("error"),errorText:C()}),re({type:R("tool-input-start"),toolCallId:C(),toolName:C(),providerExecuted:me().optional(),providerMetadata:V.optional(),toolMetadata:It.optional(),dynamic:me().optional(),title:C().optional()}),re({type:R("tool-input-delta"),toolCallId:C(),inputTextDelta:C()}),re({type:R("tool-input-available"),toolCallId:C(),toolName:C(),input:Re(),providerExecuted:me().optional(),providerMetadata:V.optional(),toolMetadata:It.optional(),dynamic:me().optional(),title:C().optional()}),re({type:R("tool-input-error"),toolCallId:C(),toolName:C(),input:Re(),providerExecuted:me().optional(),providerMetadata:V.optional(),toolMetadata:It.optional(),dynamic:me().optional(),errorText:C(),title:C().optional()}),re({type:R("tool-approval-request"),approvalId:C(),toolCallId:C()}),re({type:R("tool-output-available"),toolCallId:C(),output:Re(),providerExecuted:me().optional(),providerMetadata:V.optional(),toolMetadata:It.optional(),dynamic:me().optional(),preliminary:me().optional()}),re({type:R("tool-output-error"),toolCallId:C(),errorText:C(),providerExecuted:me().optional(),providerMetadata:V.optional(),toolMetadata:It.optional(),dynamic:me().optional()}),re({type:R("tool-output-denied"),toolCallId:C()}),re({type:R("reasoning-start"),id:C(),providerMetadata:V.optional()}),re({type:R("reasoning-delta"),id:C(),delta:C(),providerMetadata:V.optional()}),re({type:R("reasoning-end"),id:C(),providerMetadata:V.optional()}),re({type:R("source-url"),sourceId:C(),url:C(),title:C().optional(),providerMetadata:V.optional()}),re({type:R("source-document"),sourceId:C(),mediaType:C(),title:C(),filename:C().optional(),providerMetadata:V.optional()}),re({type:R("file"),url:C(),mediaType:C(),providerMetadata:V.optional()}),re({type:qa(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:C().optional(),data:Re(),transient:me().optional()}),re({type:R("start-step")}),re({type:R("finish-step")}),re({type:R("start"),messageId:C().optional(),messageMetadata:Re().optional()}),re({type:R("finish"),finishReason:Ba(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Re().optional()}),re({type:R("abort"),reason:C().optional()}),re({type:R("message-metadata"),messageMetadata:Re()})])));function Dd(e){return e.type.startsWith("data-")}function Hn(e){return e.type.startsWith("tool-")}function Zd(e){return e.type==="dynamic-tool"}function cn(e){return Hn(e)||Zd(e)}function vi(e){return e.type.split("-").slice(1).join("-")}
vendor: 25,076 bytes, line 47
47function jd({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Ld({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:o}){return e.pipeThrough(new TransformStream({async transform(s,u){await r(async({state:l,write:c})=>{var p,f,d,m;function x(h){const z=l.message.parts.filter(cn).find(k=>k.toolCallId===h);if(z==null)throw new pt({chunkType:"tool-invocation",chunkId:h,message:`No tool invocation found for tool call ID "${h}".`});return z}function w(h){var E;const z=l.message.parts.find($=>Hn($)&&$.toolCallId===h.toolCallId),k=h,P=z;if(z!=null){z.state=h.state,P.input=k.input,P.output=k.output,P.errorText=k.errorText,P.rawInput=k.rawInput,P.preliminary=k.preliminary,h.title!==void 0&&(P.title=h.title),h.toolMetadata!==void 0&&(P.toolMetadata=h.toolMetadata),P.providerExecuted=(E=k.providerExecuted)!=null?E:z.providerExecuted;const $=k.providerMetadata;if($!=null)if(h.state==="output-available"||h.state==="output-error"){const F=z;F.resultProviderMetadata=$}else z.callProviderMetadata=$}else l.message.parts.push({type:`tool-${h.toolName}`,toolCallId:h.toolCallId,state:h.state,title:h.title,...h.toolMetadata!==void 0?{toolMetadata:h.toolMetadata}:{},input:k.input,output:k.output,rawInput:k.rawInput,errorText:k.errorText,providerExecuted:k.providerExecuted,preliminary:k.preliminary,...k.providerMetadata!=null&&(h.state==="output-available"||h.state==="output-error")?{resultProviderMetadata:k.providerMetadata}:{},...k.providerMetadata!=null&&!(h.state==="output-available"||h.state==="output-error")?{callProviderMetadata:k.providerMetadata}:{}})}function g(h){var E,z;const k=l.message.parts.find(F=>F.type==="dynamic-tool"&&F.toolCallId===h.toolCallId),P=h,$=k;if(k!=null){k.state=h.state,$.toolName=h.toolName,$.input=P.input,$.output=P.output,$.errorText=P.errorText,$.rawInput=(E=P.rawInput)!=null?E:$.rawInput,$.preliminary=P.preliminary,h.title!==void 0&&($.title=h.title),h.toolMetadata!==void 0&&($.toolMetadata=h.toolMetadata),$.providerExecuted=(z=P.providerExecuted)!=null?z:k.providerExecuted;const F=P.providerMetadata;if(F!=null)if(h.state==="output-available"||h.state==="output-error"){const U=k;U.resultProviderMetadata=F}else k.callProviderMetadata=F}else l.message.parts.push({type:"dynamic-tool",toolName:h.toolName,toolCallId:h.toolCallId,state:h.state,input:P.input,output:P.output,errorText:P.errorText,preliminary:P.preliminary,providerExecuted:P.providerExecuted,title:h.title,...h.toolMetadata!==void 0?{toolMetadata:h.toolMetadata}:{},...P.providerMetadata!=null&&(h.state==="output-available"||h.state==="output-error")?{resultProviderMetadata:P.providerMetadata}:{},...P.providerMetadata!=null&&!(h.state==="output-available"||h.state==="output-error")?{callProviderMetadata:P.providerMetadata}:{}})}async function b(h){if(h!=null){const E=l.message.metadata!=null?so(l.message.metadata,h):h;t!=null&&await yi({value:E,schema:t,context:{field:"message.metadata",entityId:l.message.id}}),l.message.metadata=E}}switch(s.type){case"text-start":{const h={type:"text",text:"",providerMetadata:s.providerMetadata,state:"streaming"};l.activeTextParts[s.id]=h,l.message.parts.push(h),c();break}case"text-delta":{const h=l.activeTextParts[s.id];if(h==null)throw new pt({chunkType:"text-delta",chunkId:s.id,message:`Received text-delta for missing text part with ID "${s.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});h.text+=s.delta,h.providerMetadata=(p=s.providerMetadata)!=null?p:h.providerMetadata,c();break}case"text-end":{const h=l.activeTextParts[s.id];if(h==null)throw new pt({chunkType:"text-end",chunkId:s.id,message:`Received text-end for missing text part with ID "${s.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});h.state="done",h.providerMetadata=(f=s.providerMetadata)!=null?f:h.providerMetadata,delete l.activeTextParts[s.id],c();break}case"reasoning-start":{const h={type:"reasoning",text:"",providerMetadata:s.providerMetadata,state:"streaming"};l.activeReasoningParts[s.id]=h,l.message.parts.push(h),c();break}case"reasoning-delta":{const h=l.activeReasoningParts[s.id];if(h==null)throw new pt({chunkType:"reasoning-delta",chunkId:s.id,message:`Received reasoning-delta for missing reasoning part with ID "${s.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});h.text+=s.delta,h.providerMetadata=(d=s.providerMetadata)!=null?d:h.providerMetadata,c();break}case"reasoning-end":{const h=l.activeReasoningParts[s.id];if(h==null)throw new pt({chunkType:"reasoning-end",chunkId:s.id,message:`Received reasoning-end for missing reasoning part with ID "${s.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});h.providerMetadata=(m=s.providerMetadata)!=null?m:h.providerMetadata,h.state="done",delete l.activeReasoningParts[s.id],c();break}case"file":{l.message.parts.push({type:"file",mediaType:s.mediaType,url:s.url,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{}}),c();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:s.sourceId,url:s.url,title:s.title,providerMetadata:s.providerMetadata}),c();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:s.sourceId,mediaType:s.mediaType,title:s.title,filename:s.filename,providerMetadata:s.providerMetadata}),c();break}case"tool-input-start":{const h=l.message.parts.filter(Hn);l.partialToolCalls[s.toolCallId]={text:"",toolName:s.toolName,index:h.length,dynamic:s.dynamic,title:s.title,toolMetadata:s.toolMetadata},s.dynamic?g({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,toolMetadata:s.toolMetadata,providerMetadata:s.providerMetadata}):w({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,toolMetadata:s.toolMetadata,providerMetadata:s.providerMetadata}),c();break}case"tool-input-delta":{const h=l.partialToolCalls[s.toolCallId];if(h==null)throw new pt({chunkType:"tool-input-delta",chunkId:s.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${s.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});h.text+=s.inputTextDelta;const{value:E}=await Ht(h.text);h.dynamic?g({toolCallId:s.toolCallId,toolName:h.toolName,state:"input-streaming",input:E,title:h.title,toolMetadata:h.toolMetadata}):w({toolCallId:s.toolCallId,toolName:h.toolName,state:"input-streaming",input:E,title:h.title,toolMetadata:h.toolMetadata}),c();break}case"tool-input-available":{s.dynamic?g({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title,toolMetadata:s.toolMetadata}):w({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title,toolMetadata:s.toolMetadata}),c(),a&&!s.providerExecuted&&await a({toolCall:s});break}case"tool-input-error":{const h=l.message.parts.filter(cn).find(z=>z.toolCallId===s.toolCallId);(h!=null?h.type==="dynamic-tool":!!s.dynamic)?g({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,toolMetadata:s.toolMetadata}):w({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:void 0,rawInput:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,toolMetadata:s.toolMetadata}),c();break}case"tool-approval-request":{const h=x(s.toolCallId);h.state="approval-requested",h.approval={id:s.approvalId},c();break}case"tool-output-denied":{const h=x(s.toolCallId);h.state="output-denied",c();break}case"tool-output-available":{const h=x(s.toolCallId);h.type==="dynamic-tool"?g({toolCallId:s.toolCallId,toolName:h.toolName,state:"output-available",input:h.input,output:s.output,preliminary:s.preliminary,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:h.title,toolMetadata:h.toolMetadata}):w({toolCallId:s.toolCallId,toolName:vi(h),state:"output-available",input:h.input,output:s.output,providerExecuted:s.providerExecuted,preliminary:s.preliminary,providerMetadata:s.providerMetadata,title:h.title,toolMetadata:h.toolMetadata}),c();break}case"tool-output-error":{const h=x(s.toolCallId);h.type==="dynamic-tool"?g({toolCallId:s.toolCallId,toolName:h.toolName,state:"output-error",input:h.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:h.title,toolMetadata:h.toolMetadata}):w({toolCallId:s.toolCallId,toolName:vi(h),state:"output-error",input:h.input,rawInput:h.rawInput,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:h.title,toolMetadata:h.toolMetadata}),c();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{s.messageId!=null&&(l.message.id=s.messageId),await b(s.messageMetadata),(s.messageId!=null||s.messageMetadata!=null)&&c();break}case"finish":{s.finishReason!=null&&(l.finishReason=s.finishReason),await b(s.messageMetadata),s.messageMetadata!=null&&c();break}case"message-metadata":{await b(s.messageMetadata),s.messageMetadata!=null&&c();break}case"error":{i?.(new Error(s.errorText));break}default:if(Dd(s)){if(n?.[s.type]!=null){const z=l.message.parts.findIndex(P=>"id"in P&&"data"in P&&P.id===s.id&&P.type===s.type),k=z>=0?z:l.message.parts.length;await yi({value:s.data,schema:n[s.type],context:{field:`message.parts[${k}].data`,entityName:s.type,entityId:s.id}})}const h=s;if(h.transient){o?.(h);break}const E=h.id!=null?l.message.parts.find(z=>h.type===z.type&&h.id===z.id):void 0;E!=null?E.data=h.data:l.message.parts.push(h),o?.(h),c()}}u.enqueue(s)})}}))}async function Fd({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){t?.(r)}finally{n.releaseLock()}}qt({prefix:"aitxt",size:24});nt(C(),it.optional());qt({prefix:"aiobj",size:24});var Bd=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(r){n(r)}}),this.processQueue()})}};qt({prefix:"aiobj",size:24});async function Ud(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,i=await new Promise((a,o)=>{const s=new FileReader;s.onload=u=>{var l;a((l=u.target)==null?void 0:l.result)},s.onerror=u=>o(u),s.readAsDataURL(t)});return{type:"file",mediaType:r,filename:n,url:i}}))}var Vd=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=o}async sendMessages({abortSignal:e,...t}){var n,r,i,a,o;const s=await He(this.body),u=await He(this.headers),l=await He(this.credentials),c={...ct(u),...ct(t.headers)},p=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...s,...t.body},headers:c,credentials:l,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),f=(r=p?.api)!=null?r:this.api,d=p?.headers!==void 0?ct(p.headers):c,m=p?.body!==void 0?p.body:{...s,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},x=(i=p?.credentials)!=null?i:l,g=await((a=this.fetch)!=null?a:globalThis.fetch)(f,{method:"POST",headers:{"Content-Type":"application/json",...d},body:JSON.stringify(m),credentials:x,signal:e});if(!g.ok)throw new Error((o=await g.text())!=null?o:"Failed to fetch the chat response.");if(!g.body)throw new Error("The response body is empty.");return this.processResponseStream(g.body)}async reconnectToStream(e){var t,n,r,i,a;const o=await He(this.body),s=await He(this.headers),u=await He(this.credentials),l={...ct(s),...ct(e.headers)},c=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...o,...e.body},headers:l,credentials:u,requestMetadata:e.metadata})),p=(n=c?.api)!=null?n:`${this.api}/${e.chatId}/stream`,f=c?.headers!==void 0?ct(c.headers):l,d=(r=c?.credentials)!=null?r:u,x=await((i=this.fetch)!=null?i:globalThis.fetch)(p,{method:"GET",headers:f,credentials:d});if(x.status===204)return null;if(!x.ok)throw new Error((a=await x.text())!=null?a:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}},lo=class extends Vd{constructor(e={}){super(e)}processResponseStream(e){return hd({stream:e,schema:$d}).pipeThrough(new TransformStream({async transform(t,n){if(!t.success)throw t.error;n.enqueue(t.value)}}))}},qd=class{constructor({generateId:e=yp,id:t=e(),transport:n=new lo,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:o,onToolCall:s,onFinish:u,onData:l,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new Bd,this.sendMessage=async(p,f)=>{var d,m,x,w;if(p==null){await this.makeRequest({trigger:"submit-message",messageId:(d=this.lastMessage)==null?void 0:d.id,...f});return}let g;if("text"in p||"files"in p?g={parts:[...Array.isArray(p.files)?p.files:await Ud(p.files),..."text"in p&&p.text!=null?[{type:"text",text:p.text}]:[]]}:g=p,p.messageId!=null){const b=this.state.messages.findIndex(h=>h.id===p.messageId);if(b===-1)throw new Error(`message with id ${p.messageId} not found`);if(this.state.messages[b].role!=="user")throw new Error(`message with id ${p.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,b+1),this.state.replaceMessage(b,{...g,id:p.messageId,role:(m=g.role)!=null?m:"user",metadata:p.metadata})}else this.state.pushMessage({...g,id:(x=g.id)!=null?x:this.generateId(),role:(w=g.role)!=null?w:"user",metadata:p.metadata});await this.makeRequest({trigger:"submit-message",messageId:p.messageId,...f})},this.regenerate=async({messageId:p,...f}={})=>{const d=p==null?this.state.messages.length-1:this.state.messages.findIndex(m=>m.id===p);if(d===-1)throw new Error(`message ${p} not found`);this.state.messages=this.state.messages.slice(0,this.messages[d].role==="assistant"?d:d+1),await this.makeRequest({trigger:"regenerate-message",messageId:p,...f})},this.resumeStream=async(p={})=>{await this.makeRequest({trigger:"resume-stream",...p})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:p,approved:f,reason:d,options:m})=>this.jobExecutor.run(async()=>{const x=this.state.messages,w=x[x.length-1],g=b=>cn(b)&&b.state==="approval-requested"&&b.approval.id===p?{...b,state:"approval-responded",approval:{id:p,approved:f,reason:d}}:b;this.state.replaceMessage(x.length-1,{...w,parts:w.parts.map(g)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(g)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(b=>{var h;b&&this.makeRequest({trigger:"submit-message",messageId:(h=this.lastMessage)==null?void 0:h.id,...m})})}),this.addToolOutput=async({state:p="output-available",toolCallId:f,output:d,errorText:m,options:x})=>this.jobExecutor.run(async()=>{const w=this.state.messages,g=w[w.length-1],b=h=>cn(h)&&h.toolCallId===f?{...h,state:p,output:d,errorText:m}:h;this.state.replaceMessage(w.length-1,{...g,parts:g.parts.map(b)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(b)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(h=>{var E;h&&this.makeRequest({trigger:"submit-message",messageId:(E=this.lastMessage)==null?void 0:E.id,...x})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var p;this.status!=="streaming"&&this.status!=="submitted"||(p=this.activeResponse)!=null&&p.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=o,this.onToolCall=s,this.onFinish=u,this.onData=l,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var a,o,s;let u;if(e==="resume-stream")try{const d=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(d==null)return;u=d}catch(d){this.onError&&d instanceof Error&&this.onError(d),this.setStatus({status:"error",error:d});return}this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let c=!1,p=!1,f=!1;try{const d={state:jd({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};d.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=d;let m;e==="resume-stream"?m=u:m=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:d.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i});const x=w=>this.jobExecutor.run(()=>w({state:d.state,write:()=>{var g;this.setStatus({status:"streaming"}),d.state.message.id===((g=this.lastMessage)==null?void 0:g.id)?this.state.replaceMessage(this.state.messages.length-1,d.state.message):this.state.pushMessage(d.state.message)}}));await Fd({stream:Ld({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:x,onError:w=>{throw w}}),onError:w=>{throw w}}),this.setStatus({status:"ready"})}catch(d){if(c||d.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;f=!0,d instanceof TypeError&&(d.message.toLowerCase().includes("fetch")||d.message.toLowerCase().includes("network"))&&(p=!0),this.onError&&d instanceof Error&&this.onError(d),this.setStatus({status:"error",error:d})}finally{try{(o=this.onFinish)==null||o.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:p,isError:f,finishReason:(a=this.activeResponse)==null?void 0:a.state.finishReason})}catch(d){console.error(d)}this.activeResponse=void 0}!f&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(s=this.lastMessage)==null?void 0:s.id,metadata:t,headers:n,body:r})}},Cn,bi;function Hd(){if(bi)return Cn;bi=1;function e(t,n){if(typeof t!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);let r,i=0;return function(...o){clearTimeout(r);const s=Date.now(),u=s-i,l=n-u;l<=0?(i=s,t.apply(this,o)):r=setTimeout(()=>{i=Date.now(),t.apply(this,o)},l)}}return Cn=e,Cn}var Jd=Hd();const Wd=or(Jd);var uo=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ie=(e,t,n)=>(uo(e,t,"read from private field"),n?n.call(e):t.get(e)),Ne=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},qe=(e,t,n,r)=>(uo(e,t,"write to private field"),t.set(e,n),n);function Yd(e,t){return t!=null?Wd(e,t):e}var Ee,nn,rn,Ot,Nt,Mt,ht,Jn,Wn,Gd=class{constructor(e=[]){Ne(this,Ee,void 0),Ne(this,nn,"ready"),Ne(this,rn,void 0),Ne(this,Ot,new Set),Ne(this,Nt,new Set),Ne(this,Mt,new Set),this.pushMessage=t=>{qe(this,Ee,ie(this,Ee).concat(t)),ie(this,ht).call(this)},this.popMessage=()=>{qe(this,Ee,ie(this,Ee).slice(0,-1)),ie(this,ht).call(this)},this.replaceMessage=(t,n)=>{qe(this,Ee,[...ie(this,Ee).slice(0,t),this.snapshot(n),...ie(this,Ee).slice(t+1)]),ie(this,ht).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,n)=>{const r=n?Yd(t,n):t;return ie(this,Ot).add(r),()=>{ie(this,Ot).delete(r)}},this["~registerStatusCallback"]=t=>(ie(this,Nt).add(t),()=>{ie(this,Nt).delete(t)}),this["~registerErrorCallback"]=t=>(ie(this,Mt).add(t),()=>{ie(this,Mt).delete(t)}),Ne(this,ht,()=>{ie(this,Ot).forEach(t=>t())}),Ne(this,Jn,()=>{ie(this,Nt).forEach(t=>t())}),Ne(this,Wn,()=>{ie(this,Mt).forEach(t=>t())}),qe(this,Ee,e)}get status(){return ie(this,nn)}set status(e){qe(this,nn,e),ie(this,Jn).call(this)}get error(){return ie(this,rn)}set error(e){qe(this,rn,e),ie(this,Wn).call(this)}get messages(){return ie(this,Ee)}set messages(e){qe(this,Ee,[...e]),ie(this,ht).call(this)}};Ee=new WeakMap;nn=new WeakMap;rn=new WeakMap;Ot=new WeakMap;Nt=new WeakMap;Mt=new WeakMap;ht=new WeakMap;Jn=new WeakMap;Wn=new WeakMap;var mt,xi=class extends qd{constructor({messages:e,...t}){const n=new Gd(e);super({...t,state:n}),Ne(this,mt,void 0),this["~registerMessagesCallback"]=(r,i)=>ie(this,mt)["~registerMessagesCallback"](r,i),this["~registerStatusCallback"]=r=>ie(this,mt)["~registerStatusCallback"](r),this["~registerErrorCallback"]=r=>ie(this,mt)["~registerErrorCallback"](r),qe(this,mt,n)}};mt=new WeakMap;function Xd({experimental_throttle:e,resume:t=!1,...n}={}){const r=de.useRef("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});const i={...n,onToolCall:f=>{var d,m;return(m=(d=r.current).onToolCall)==null?void 0:m.call(d,f)},onData:f=>{var d,m;return(m=(d=r.current).onData)==null?void 0:m.call(d,f)},onFinish:f=>{var d,m;return(m=(d=r.current).onFinish)==null?void 0:m.call(d,f)},onError:f=>{var d,m;return(m=(d=r.current).onError)==null?void 0:m.call(d,f)},sendAutomaticallyWhen:f=>{var d,m,x;return(x=(m=(d=r.current).sendAutomaticallyWhen)==null?void 0:m.call(d,f))!=null?x:!1}},a=de.useRef("chat"in n?n.chat:new xi(i));("chat"in n&&n.chat!==a.current||"id"in n&&a.current.id!==n.id)&&(a.current="chat"in n?n.chat:new xi(i));const s=de.useCallback(f=>a.current["~registerMessagesCallback"](f,e),[e,a.current.id]),u=de.useSyncExternalStore(s,()=>a.current.messages,()=>a.current.messages),l=de.useSyncExternalStore(a.current["~registerStatusCallback"],()=>a.current.status,()=>a.current.status),c=de.useSyncExternalStore(a.current["~registerErrorCallback"],()=>a.current.error,()=>a.current.error),p=de.useCallback(f=>{typeof f=="function"&&(f=f(a.current.messages)),a.current.messages=f},[a]);return de.useEffect(()=>{t&&a.current.resumeStream()},[t,a]),{id:a.current.id,messages:u,setMessages:p,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:c,resumeStream:a.current.resumeStream,status:l,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput,addToolApprovalResponse:a.current.addToolApprovalResponse}}function Qd(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Kd=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ef=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tf={};function wi(e,t){return(tf.jsx?ef:Kd).test(e)}const nf=/[ \t\n\f\r]/g;function rf(e){return typeof e=="object"?e.type==="text"?ki(e.value):!1:ki(e)}function ki(e){return e.replace(nf,"")===""}class Jt{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Jt.prototype.normal={};Jt.prototype.property={};Jt.prototype.space=void 0;function co(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Jt(n,r,t)}function Yn(e){return e.toLowerCase()}class xe{constructor(t,n){this.attribute=n,this.property=t}}xe.prototype.attribute="";xe.prototype.booleanish=!1;xe.prototype.boolean=!1;xe.prototype.commaOrSpaceSeparated=!1;xe.prototype.commaSeparated=!1;xe.prototype.defined=!1;xe.prototype.mustUseProperty=!1;xe.prototype.number=!1;xe.prototype.overloadedBoolean=!1;xe.prototype.property="";xe.prototype.spaceSeparated=!1;xe.prototype.space=void 0;let af=0;
vendor: 4,595 bytes, line 47
47const B=ot(),le=ot(),Gn=ot(),I=ot(),ee=ot(),gt=ot(),ke=ot();function ot(){return 2**++af}const Xn=Object.freeze(Object.defineProperty({__proto__:null,boolean:B,booleanish:le,commaOrSpaceSeparated:ke,commaSeparated:gt,number:I,overloadedBoolean:Gn,spaceSeparated:ee},Symbol.toStringTag,{value:"Module"})),Tn=Object.keys(Xn);class mr extends xe{constructor(t,n,r,i){let a=-1;if(super(t,n),_i(this,"space",i),typeof r=="number")for(;++a<Tn.length;){const o=Tn[a];_i(this,Tn[a],(r&Xn[o])===Xn[o])}}}mr.prototype.defined=!0;function _i(e,t,n){n&&(e[t]=n)}function xt(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new mr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Yn(r)]=r,n[Yn(a.attribute)]=r}return new Jt(t,n,e.space)}const po=xt({properties:{ariaActiveDescendant:null,ariaAtomic:le,ariaAutoComplete:null,ariaBusy:le,ariaChecked:le,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:ee,ariaCurrent:null,ariaDescribedBy:ee,ariaDetails:null,ariaDisabled:le,ariaDropEffect:ee,ariaErrorMessage:null,ariaExpanded:le,ariaFlowTo:ee,ariaGrabbed:le,ariaHasPopup:null,ariaHidden:le,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ee,ariaLevel:I,ariaLive:null,ariaModal:le,ariaMultiLine:le,ariaMultiSelectable:le,ariaOrientation:null,ariaOwns:ee,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:le,ariaReadOnly:le,ariaRelevant:null,ariaRequired:le,ariaRoleDescription:ee,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:le,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function fo(e,t){return t in e?e[t]:t}function ho(e,t){return fo(e,t.toLowerCase())}const of=xt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gt,acceptCharset:ee,accessKey:ee,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:ee,autoFocus:B,autoPlay:B,blocking:ee,capture:null,charSet:null,checked:B,cite:null,className:ee,cols:I,colSpan:null,content:null,contentEditable:le,controls:B,controlsList:ee,coords:I|gt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:Gn,draggable:le,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:ee,height:I,hidden:Gn,high:I,href:null,hrefLang:null,htmlFor:ee,httpEquiv:ee,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:ee,itemRef:ee,itemScope:B,itemType:ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:I,pattern:null,ping:ee,placeholder:null,playsInl
47ine:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:ee,required:B,reversed:B,rows:I,rowSpan:I,sandbox:ee,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:le,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:le,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ee,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:le,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:B,disableRemotePlayback:B,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:ho}),sf=xt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
47-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ke,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:ee,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gt,g2:gt,glyphName:gt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:ke,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 4,650 bytes, lines 47-48
47Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ee,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ke,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ke,rev:ke,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ke,requiredFeatures:ke,requiredFonts:ke,requiredFormats:ke,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:ke,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ke,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ke,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fo}),mo=xt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),go=xt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ho}),yo=xt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lf={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},uf=/[A-Z]/g,Si=/-[a-z]/g,cf=/^data[-\w.:]+$/i;function pf(e,t){const n=Yn(t);let r=t,i=xe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cf.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Si,ff);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Si.test(a)){let o=a.replace(uf,df);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=mr}return new i(r,t)}function df(e){return"-"+e.toLowerCase()}function ff(e){return e.charAt(1).toUpperCase()}const hf=co([po,of,mo,go,yo],"html"),gr=co([po,sf,mo,go,yo],"svg");function mf(e){return e.join(" ").trim()}var dt={},zn,Ei;function gf(){if(Ei)return zn;Ei=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,s=/^\s+|\s+$/g,u=`
48`,l="/",c="*",p="",f="comment",d="declaration";function m(w,g){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];g=g||{};var b=1,h=1;function E(D){var A=D.match(t);A&&(b+=A.length);var G=D.lastIndexOf(u);h=~G?D.length-G:h+D.length}function z(){var D={line:b,column:h};return function(A){return A.position=new k(D),F(),A}}function k(D){this.start=D,this.end={line:b,column:h},this.source=g.source}k.prototype.content=w;function P(D){var A=new Error(g.source+":"+b+":"+h+": "+D);if(A.reason=D,A.filename=g.source,A.line=b,A.column=h,A.source=w,!g.silent)throw A}function $(D){var A=D.exec(w);if(A){var G=A[0];return E(G),w=w.slice(G.length),A}}function F(){$(n)}function U(D){var A;for(D=D||[];A=N();)A!==!1&&D.push(A);return D}function N(){var D=z();
vendor: 4,415 bytes, line 48
48if(!(l!=w.charAt(0)||c!=w.charAt(1))){for(var A=2;p!=w.charAt(A)&&(c!=w.charAt(A)||l!=w.charAt(A+1));)++A;if(A+=2,p===w.charAt(A-1))return P("End of comment missing");var G=w.slice(2,A-2);return h+=2,E(G),w=w.slice(A),h+=2,D({type:f,comment:G})}}function M(){var D=z(),A=$(r);if(A){if(N(),!$(i))return P("property missing ':'");var G=$(a),ue=D({type:d,property:x(A[0].replace(e,p)),value:G?x(G[0].replace(e,p)):p});return $(o),ue}}function K(){var D=[];U(D);for(var A;A=M();)A!==!1&&(D.push(A),U(D));return D}return F(),K()}function x(w){return w?w.replace(s,p):p}return zn=m,zn}var Ii;function yf(){if(Ii)return dt;Ii=1;var e=dt&&dt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dt,"__esModule",{value:!0}),dt.default=n;const t=e(gf());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),s=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:c}=u;s?i(l,c,u):c&&(a=a||{},a[l]=c)}),a}return dt}var Ct={},Ci;function vf(){if(Ci)return Ct;Ci=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(l){return!l||n.test(l)||e.test(l)},o=function(l,c){return c.toUpperCase()},s=function(l,c){return"".concat(c,"-")},u=function(l,c){return c===void 0&&(c={}),a(l)?l:(l=l.toLowerCase(),c.reactCompat?l=l.replace(i,s):l=l.replace(r,s),l.replace(t,o))};return Ct.camelCase=u,Ct}var Tt,Ti;function bf(){if(Ti)return Tt;Ti=1;var e=Tt&&Tt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(yf()),n=vf();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(s,u){s&&u&&(o[(0,n.camelCase)(s,a)]=u)}),o}return r.default=r,Tt=r,Tt}var xf=bf();const wf=or(xf),vo=bo("end"),yr=bo("start");function bo(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function kf(e){const t=yr(e),n=vo(e);if(t&&n)return{start:t,end:n}}function $t(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?zi(e.position):"start"in e||"end"in e?zi(e):"line"in e||"column"in e?Qn(e):""}function Qn(e){return Ai(e&&e.line)+":"+Ai(e&&e.column)}function zi(e){return Qn(e&&e.start)+"-"+Qn(e&&e.end)}function Ai(e){return e&&typeof e=="number"?e:1}class fe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=$t(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fe.prototype.file="";fe.prototype.name="";fe.prototype.reason="";fe.prototype.message="";fe.prototype.stack="";fe.prototype.column=void 0;fe.prototype.line=void 0;fe.prototype.ancestors=void 0;fe.prototype.cause=void 0;fe.prototype.fatal=void 0;fe.prototype.place=void 0;fe.prototype.ruleId=void 0;fe.prototype.source=void 0;const vr={}.hasOwnProperty,_f=new Map,Sf=/[A-Z]/g,Ef=new Set(["table","tbody","thead","tfoot","tr"]),If=new Set(["td","th"]),xo="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Cf(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Rf(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 5,837 bytes, line 48
48if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Mf(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?gr:hf,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=wo(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function wo(e,t,n){if(t.type==="element")return Tf(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zf(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Pf(e,t,n);if(t.type==="mdxjsEsm")return Af(e,t);if(t.type==="root")return Of(e,t,n);if(t.type==="text")return Nf(e,t)}function Tf(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=gr,e.schema=i),e.ancestors.push(t);const a=_o(e,t.tagName,!1),o=$f(e,t);let s=xr(e,t);return Ef.has(t.tagName)&&(s=s.filter(function(u){return typeof u=="string"?!rf(u):!0})),ko(e,o,a,t),br(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function zf(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Bt(e,t.position)}function Af(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bt(e,t.position)}function Pf(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=gr,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:_o(e,t.name,!0),o=Df(e,t),s=xr(e,t);return ko(e,o,a,t),br(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Of(e,t,n){const r={};return br(r,xr(e,t)),e.create(t,e.Fragment,r,n)}function Nf(e,t){return t.value}function ko(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function br(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Mf(e,t,n){return r;function r(i,a,o,s){const l=Array.isArray(o.children)?n:t;return s?l(a,o,s):l(a,o)}}function Rf(e,t){return n;function n(r,i,a,o){const s=Array.isArray(a.children),u=yr(r);return t(i,a,o,s,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function $f(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&vr.call(t.properties,i)){const a=Zf(e,i,t.properties[i]);if(a){const[o,s]=a;e.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&If.has(t.tagName)?r=s:n[o]=s}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Df(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Bt(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else Bt(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function xr(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:_f;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const l=i.get(u)||0;o=u+"-"+l,i.set(u,l+1)}}const s=wo(e,a,o);s!==void 0&&n.push(s)}return n}function Zf(e,t,n){const r=pf(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Qd(n):mf(n)),r.property==="style"){let i=typeof n=="object"?n:jf(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Lf(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?lf[r.property]||r.property:r.attribute,n]}}function jf(e,t){try{return wf(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new fe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=xo+"#cannot-parse-style-attribute",i}}function _o(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const s=wi(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}r=o}else r=wi(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return vr.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bt(e)}function Bt(e,t){const n=new fe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=xo+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Lf(e){const t={};let n;for(n in e)vr.call(e,n)&&(t[Ff(n)]=e[n]);return t}function Ff(e){let t=e.replace(Sf,Bf);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Bf(e){return"-"+e.toLowerCase()}const An={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Uf={};function Vf(e,t){const n=Uf,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;
vendor: 13,445 bytes, line 48
48return So(e,r,i)}function So(e,t,n){if(qf(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Pi(e.children,t,n)}return Array.isArray(e)?Pi(e,t,n):""}function Pi(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=So(e[i],t,n);return r.join("")}function qf(e){return!!(e&&typeof e=="object")}const Oi=document.createElement("i");function wr(e){const t="&"+e+";";Oi.innerHTML=t;const n=Oi.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ze(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Ie(e,t){return e.length>0?(Ze(e,e.length,0,t),e):t}const Ni={}.hasOwnProperty;function Hf(e){const t={};let n=-1;for(;++n<e.length;)Jf(t,e[n]);return t}function Jf(e,t){let n;for(n in t){const i=(Ni.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){Ni.call(i,o)||(i[o]=[]);const s=a[o];Wf(i[o],Array.isArray(s)?s:s?[s]:[])}}}function Wf(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ze(e,0,0,r)}function Eo(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function yt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $e=Ge(/[A-Za-z]/),_e=Ge(/[\dA-Za-z]/),Yf=Ge(/[#-'*+\--9=?A-Z^-~]/);function Kn(e){return e!==null&&(e<32||e===127)}const er=Ge(/\d/),Gf=Ge(/[\dA-Fa-f]/),Xf=Ge(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function ve(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}const Qf=Ge(new RegExp("\\p{P}|\\p{S}","u")),Kf=Ge(/\s/);function Ge(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wt(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&_e(e.charCodeAt(n+1))&&_e(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function te(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return J(u)?(e.enter(n),s(u)):t(u)}function s(u){return J(u)&&a++<i?(e.consume(u),s):(e.exit(n),t(u))}}const eh={tokenize:th};function th(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),te(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),a(s)}function a(s){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(s)}function o(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Z(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),o)}}const nh={tokenize:rh},Mi={tokenize:ih};function rh(e){const t=this,n=[];let r=0,i,a,o;return s;function s(h){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,u,l)(h)}return l(h)}function u(h){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const E=t.events.length;let z=E,k;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){k=t.events[z][1].end;break}g(r);let P=E;for(;P<t.events.length;)t.events[P][1].end={...k},P++;return Ze(t.events,z+1,0,t.events.slice(E)),t.events.length=P,l(h)}return s(h)}function l(h){if(r===n.length){if(!i)return f(h);if(i.currentConstruct&&i.currentConstruct.concrete)return m(h);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Mi,c,p)(h)}function c(h){return i&&b(),g(r),f(h)}function p(h){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(h)}function f(h){return t.containerState={},e.attempt(Mi,d,m)(h)}function d(h){return r++,n.push([t.currentConstruct,t.containerState]),f(h)}function m(h){if(h===null){i&&b(),g(0),e.consume(h);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),x(h)}function x(h){if(h===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(h);return}return Z(h)?(e.consume(h),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(h),x)}function w(h,E){const z=t.sliceStream(h);if(E&&z.push(null),h.previous=a,a&&(a.next=h),a=h,i.defineSkip(h.start),i.write(z),t.parser.lazy[h.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const P=t.events.length;let $=P,F,U;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(F){U=t.events[$][1].end;break}F=!0}for(g(r),k=P;k<t.events.length;)t.events[k][1].end={...U},k++;Ze(t.events,$+1,0,t.events.slice(P)),t.events.length=k}}function g(h){let E=n.length;for(;E-- >h;){const z=n[E];t.containerState=z[1],z[0].exit.call(t,e)}n.length=h}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ih(e,t,n){return te(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ri(e){if(e===null||ve(e)||Kf(e))return 1;if(Qf(e))return 2}function kr(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const tr={name:"attention",resolveAll:ah,tokenize:oh};function ah(e,t){let n=-1,r,i,a,o,s,u,l,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},f={...e[n][1].start};$i(p,-u),$i(f,u),o={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},s={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Ie(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=Ie(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),l=Ie(l,kr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Ie(l,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=Ie(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Ze(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function oh(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ri(r);let a;return o;function o(u){return a=u,e.enter("attentionSequence"),s(u)}function s(u){if(u===a)return e.consume(u),s;const l=e.exit("attentionSequence"),c=Ri(u),p=!c||c===2&&i||n.includes(u),f=!i||i===2&&c||n.includes(r);return l._open=!!(a===42?p:p&&(i||!f)),l._close=!!(a===42?f:f&&(c||!p)),t(u)}}function $i(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const sh={name:"autolink",tokenize:lh};function lh(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(d){return $e(d)?(e.consume(d),o):d===64?n(d):l(d)}function o(d){return d===43||d===45||d===46||_e(d)?(r=1,s(d)):l(d)}function s(d){return d===58?(e.consume(d),r=0,u):(d===43||d===45||d===46||_e(d))&&r++<32?(e.consume(d),s):(r=0,l(d))}function u(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Kn(d)?n(d):(e.consume(d),u)}function l(d){return d===64?(e.consume(d),c):Yf(d)?(e.consume(d),l):n(d)}function c(d){return _e(d)?p(d):n(d)}function p(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):f(d)}function f(d){if((d===45||_e(d))&&r++<63){const m=d===45?f:p;return e.consume(d),m}return n(d)}}const vn={partial:!0,tokenize:uh};function uh(e,t,n){return r;function r(a){return J(a)?te(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Z(a)?t(a):n(a)}}const Io={continuation:{tokenize:ph},exit:dh,name:"blockQuote",tokenize:ch};function ch(e,t,n){const r=this;return i;function i(o){if(o===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return J(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function ph(e,t,n){const r=this;return i;function i(o){return J(o)?te(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(Io,t,n)(o)}}function dh(e){e.exit("blockQuote")}const Co={name:"characterEscape",tokenize:fh};function fh(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Xf(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const To={name:"characterReference",tokenize:hh};function hh(e,t,n){const r=this;let i=0,a,o;return s;function s(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),u}function u(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),a=31,o=_e,c(p))}function l(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Gf,c):(e.enter("characterReferenceValue"),a=7,o=er,c(p))}function c(p){if(p===59&&i){const f=e.exit("characterReferenceValue");return o===_e&&!wr(r.sliceSerialize(f))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&i++<a?(e.consume(p),c):n(p)}}const Di={partial:!0,tokenize:gh},Zi={concrete:!0,name:"codeFenced",tokenize:mh};function mh(e,t,n){const r=this,i={partial:!0,tokenize:z};let a=0,o=0,s;return u;function u(k){return l(k)}function l(k){const P=r.events[r.events.length-1];return a=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,s=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===s?(o++,e.consume(k),c):o<3?n(k):(e.exit("codeFencedFenceSequence"),J(k)?te(e,p,"whitespace")(k):p(k))}function p(k){return k===null||Z(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(Di,x,E)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||Z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(k)):J(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),te(e,d,"whitespace")(k)):k===96&&k===s?n(k):(e.consume(k),f)}function d(k){return k===null||Z(k)?p(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||Z(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(k)):k===96&&k===s?n(k):(e.consume(k),m)}function x(k){return e.attempt(i,E,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return a>0&&J(k)?te(e,b,"linePrefix",a+1)(k):b(k)}function b(k){return k===null||Z(k)?e.check(Di,x,E)(k):(e.enter("codeFlowValue"),h(k))}function h(k){return k===null||Z(k)?(e.exit("codeFlowValue"),b(k)):(e.consume(k),h)}function E(k){return e.exit("codeFenced"),t(k)}function z(k,P,$){let F=0;return U;function U(A){return k.enter("lineEnding"),k.consume(A),k.exit("lineEnding"),N}function N(A){return k.enter("codeFencedFence"),J(A)?te(k,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):M(A)}function M(A){return A===s?(k.enter("codeFencedFenceSequence"),K(A)):$(A)}function K(A){return A===s?(F++,k.consume(A),K):F>=o?(k.exit("codeFencedFenceSequence"),J(A)?te(k,D,"whitespace")(A):D(A)):$(A)}function D(A){return A===null||Z(A)?(k.exit("codeFencedFence"),P(A)):$(A)}}}function gh(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Pn={name:"codeIndented",tokenize:vh},yh={partial:!0,tokenize:bh};function vh(e,t,n){const r=this;return i;
vendor: 5,051 bytes, line 48
48function i(l){return e.enter("codeIndented"),te(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(l):n(l)}function o(l){return l===null?u(l):Z(l)?e.attempt(yh,o,u)(l):(e.enter("codeFlowValue"),s(l))}function s(l){return l===null||Z(l)?(e.exit("codeFlowValue"),o(l)):(e.consume(l),s)}function u(l){return e.exit("codeIndented"),t(l)}}function bh(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):te(e,a,"linePrefix",5)(o)}function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):Z(o)?i(o):n(o)}}const xh={name:"codeText",previous:kh,resolve:wh,tokenize:_h};function wh(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function kh(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _h(e,t,n){let r=0,i,a;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),s(p)}function s(p){return p===96?(e.consume(p),r++,s):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(a=e.enter("codeTextSequence"),i=0,c(p)):Z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),l(p))}function l(p){return p===null||p===32||p===96||Z(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),l)}function c(p){return p===96?(e.consume(p),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",l(p))}}class Sh{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&zt(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),zt(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zt(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);zt(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zt(this.left,n.reverse())}}}function zt(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function zo(e){const t={};let n=-1,r,i,a,o,s,u,l;const c=new Sh(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Eh(c,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=c.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},s=c.slice(i,n),s.unshift(r),c.splice(i,n-i+1,s))}}return Ze(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Eh(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const s=o.events,u=[],l={};let c,p,f=-1,d=n,m=0,x=0;const w=[x];for(;d;){for(;e.get(++i)[1]!==d;);a.push(i),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),p&&o.defineSki
vendor: 18,602 bytes, line 48
48p(d.start),d._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),d._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=d,d=d.next}for(d=n;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(x=f+1,w.push(x),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(o.events=[],d?(d._tokenizer=void 0,d.previous=void 0):w.pop(),f=w.length;f--;){const g=s.slice(w[f],w[f+1]),b=a.pop();u.push([b,b+g.length-1]),e.splice(b,2,g)}for(u.reverse(),f=-1;++f<u.length;)l[m+u[f][0]]=m+u[f][1],m+=u[f][1]-u[f][0]-1;return l}const Ih={resolve:Th,tokenize:zh},Ch={partial:!0,tokenize:Ah};function Th(e){return zo(e),e}function zh(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?a(s):Z(s)?e.check(Ch,o,a)(s):(e.consume(s),i)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function o(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ah(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),te(e,a,"linePrefix")}function a(o){if(o===null||Z(o))return n(o);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Ao(e,t,n,r,i,a,o,s,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return p;function p(g){return g===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(g),e.exit(a),f):g===null||g===32||g===41||Kn(g)?n(g):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),x(g))}function f(g){return g===62?(e.enter(a),e.consume(g),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===62?(e.exit("chunkString"),e.exit(s),f(g)):g===null||g===60||Z(g)?n(g):(e.consume(g),g===92?m:d)}function m(g){return g===60||g===62||g===92?(e.consume(g),d):d(g)}function x(g){return!c&&(g===null||g===41||ve(g))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(g)):c<l&&g===40?(e.consume(g),c++,x):g===41?(e.consume(g),c--,x):g===null||g===32||g===40||Kn(g)?n(g):(e.consume(g),g===92?w:x)}function w(g){return g===40||g===41||g===92?(e.consume(g),x):x(g)}}function Po(e,t,n,r,i,a){const o=this;let s=0,u;return l;function l(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(a),c}function c(d){return s>999||d===null||d===91||d===93&&!u||d===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(d):d===93?(e.exit(a),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):Z(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),p(d))}function p(d){return d===null||d===91||d===93||Z(d)||s++>999?(e.exit("chunkString"),c(d)):(e.consume(d),u||(u=!J(d)),d===92?f:p)}function f(d){return d===91||d===92||d===93?(e.consume(d),s++,p):p(d)}}function Oo(e,t,n,r,i,a){let o;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,u):n(f)}function u(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(a),l(f))}function l(f){return f===o?(e.exit(a),u(o)):f===null?n(f):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),te(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===o||f===null||Z(f)?(e.exit("chunkString"),l(f)):(e.consume(f),f===92?p:c)}function p(f){return f===o||f===92?(e.consume(f),c):c(f)}}function Dt(e,t){let n;return r;function r(i){return Z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):J(i)?te(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Ph={name:"definition",tokenize:Nh},Oh={partial:!0,tokenize:Mh};function Nh(e,t,n){const r=this;let i;return a;function a(d){return e.enter("definition"),o(d)}function o(d){return Po.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=yt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),u):n(d)}function u(d){return ve(d)?Dt(e,l)(d):l(d)}function l(d){return Ao(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(Oh,p,p)(d)}function p(d){return J(d)?te(e,f,"whitespace")(d):f(d)}function f(d){return d===null||Z(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Mh(e,t,n){return r;function r(s){return ve(s)?Dt(e,i)(s):n(s)}function i(s){return Oo(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return J(s)?te(e,o,"whitespace")(s):o(s)}function o(s){return s===null||Z(s)?t(s):n(s)}}const Rh={name:"hardBreakEscape",tokenize:$h};function $h(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Z(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Dh={name:"headingAtx",resolve:Zh,tokenize:jh};function Zh(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ze(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function jh(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),a(c)}function a(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||ve(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||Z(c)?(e.exit("atxHeading"),t(c)):J(c)?te(e,s,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),s(c))}function l(c){return c===null||c===35||ve(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),l)}}const Lh=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ji=["pre","script","style","textarea"],Fh={concrete:!0,name:"htmlFlow",resolveTo:Vh,tokenize:qh},Bh={partial:!0,tokenize:Jh},Uh={partial:!0,tokenize:Hh};function Vh(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qh(e,t,n){const r=this;let i,a,o,s,u;return l;function l(v){return c(v)}function c(v){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(v),p}function p(v){return v===33?(e.consume(v),f):v===47?(e.consume(v),a=!0,x):v===63?(e.consume(v),i=3,r.interrupt?t:y):$e(v)?(e.consume(v),o=String.fromCharCode(v),w):n(v)}function f(v){return v===45?(e.consume(v),i=2,d):v===91?(e.consume(v),i=5,s=0,m):$e(v)?(e.consume(v),i=4,r.interrupt?t:y):n(v)}function d(v){return v===45?(e.consume(v),r.interrupt?t:y):n(v)}function m(v){const ze="CDATA[";return v===ze.charCodeAt(s++)?(e.consume(v),s===ze.length?r.interrupt?t:M:m):n(v)}function x(v){return $e(v)?(e.consume(v),o=String.fromCharCode(v),w):n(v)}function w(v){if(v===null||v===47||v===62||ve(v)){const ze=v===47,Xe=o.toLowerCase();return!ze&&!a&&ji.includes(Xe)?(i=1,r.interrupt?t(v):M(v)):Lh.includes(o.toLowerCase())?(i=6,ze?(e.consume(v),g):r.interrupt?t(v):M(v)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(v):a?b(v):h(v))}return v===45||_e(v)?(e.consume(v),o+=String.fromCharCode(v),w):n(v)}function g(v){return v===62?(e.consume(v),r.interrupt?t:M):n(v)}function b(v){return J(v)?(e.consume(v),b):U(v)}function h(v){return v===47?(e.consume(v),U):v===58||v===95||$e(v)?(e.consume(v),E):J(v)?(e.consume(v),h):U(v)}function E(v){return v===45||v===46||v===58||v===95||_e(v)?(e.consume(v),E):z(v)}function z(v){return v===61?(e.consume(v),k):J(v)?(e.consume(v),z):h(v)}function k(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),u=v,P):J(v)?(e.consume(v),k):$(v)}function P(v){return v===u?(e.consume(v),u=null,F):v===null||Z(v)?n(v):(e.consume(v),P)}function $(v){return v===null||v===34||v===39||v===47||v===60||v===61||v===62||v===96||ve(v)?z(v):(e.consume(v),$)}function F(v){return v===47||v===62||J(v)?h(v):n(v)}function U(v){return v===62?(e.consume(v),N):n(v)}function N(v){return v===null||Z(v)?M(v):J(v)?(e.consume(v),N):n(v)}function M(v){return v===45&&i===2?(e.consume(v),G):v===60&&i===1?(e.consume(v),ue):v===62&&i===4?(e.consume(v),Te):v===63&&i===3?(e.consume(v),y):v===93&&i===5?(e.consume(v),je):Z(v)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Bh,Le,K)(v)):v===null||Z(v)?(e.exit("htmlFlowData"),K(v)):(e.consume(v),M)}function K(v){return e.check(Uh,D,Le)(v)}function D(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),A}function A(v){return v===null||Z(v)?K(v):(e.enter("htmlFlowData"),M(v))}function G(v){return v===45?(e.consume(v),y):M(v)}function ue(v){return v===47?(e.consume(v),o="",Ce):M(v)}function Ce(v){if(v===62){const ze=o.toLowerCase();return ji.includes(ze)?(e.consume(v),Te):M(v)}return $e(v)&&o.length<8?(e.consume(v),o+=String.fromCharCode(v),Ce):M(v)}function je(v){return v===93?(e.consume(v),y):M(v)}function y(v){return v===62?(e.consume(v),Te):v===45&&i===2?(e.consume(v),y):M(v)}function Te(v){return v===null||Z(v)?(e.exit("htmlFlowData"),Le(v)):(e.consume(v),Te)}function Le(v){return e.exit("htmlFlow"),t(v)}}function Hh(e,t,n){const r=this;return i;function i(o){return Z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Jh(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(vn,t,n)}}const Wh={name:"htmlText",tokenize:Yh};function Yh(e,t,n){const r=this;let i,a,o;return s;function s(y){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(y),u}function u(y){return y===33?(e.consume(y),l):y===47?(e.consume(y),z):y===63?(e.consume(y),h):$e(y)?(e.consume(y),$):n(y)}function l(y){return y===45?(e.consume(y),c):y===91?(e.consume(y),a=0,m):$e(y)?(e.consume(y),b):n(y)}function c(y){return y===45?(e.consume(y),d):n(y)}function p(y){return y===null?n(y):y===45?(e.consume(y),f):Z(y)?(o=p,ue(y)):(e.consume(y),p)}function f(y){return y===45?(e.consume(y),d):p(y)}function d(y){return y===62?G(y):y===45?f(y):p(y)}function m(y){const Te="CDATA[";return y===Te.charCodeAt(a++)?(e.consume(y),a===Te.length?x:m):n(y)}function x(y){return y===null?n(y):y===93?(e.consume(y),w):Z(y)?(o=x,ue(y)):(e.consume(y),x)}function w(y){return y===93?(e.consume(y),g):x(y)}function g(y){return y===62?G(y):y===93?(e.consume(y),g):x(y)}function b(y){return y===null||y===62?G(y):Z(y)?(o=b,ue(y)):(e.consume(y),b)}function h(y){return y===null?n(y):y===63?(e.consume(y),E):Z(y)?(o=h,ue(y)):(e.consume(y),h)}function E(y){return y===62?G(y):h(y)}function z(y){return $e(y)?(e.consume(y),k):n(y)}function k(y){return y===45||_e(y)?(e.consume(y),k):P(y)}function P(y){return Z(y)?(o=P,ue(y)):J(y)?(e.consume(y),P):G(y)}function $(y){return y===45||_e(y)?(e.consume(y),$):y===47||y===62||ve(y)?F(y):n(y)}function F(y){return y===47?(e.consume(y),G):y===58||y===95||$e(y)?(e.consume(y),U):Z(y)?(o=F,ue(y)):J(y)?(e.consume(y),F):G(y)}function U(y){return y===45||y===46||y===58||y===95||_e(y)?(e.consume(y),U):N(y)}function N(y){return y===61?(e.consume(y),M):Z(y)?(o=N,ue(y)):J(y)?(e.consume(y),N):F(y)}function M(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),i=y,K):Z(y)?(o=M,ue(y)):J(y)?(e.consume(y),M):(e.consume(y),D)}function K(y){return y===i?(e.consume(y),i=void 0,A):y===null?n(y):Z(y)?(o=K,ue(y)):(e.consume(y),K)}function D(y){return y===null||y===34||y===39||y===60||y===61||y===96?n(y):y===47||y===62||ve(y)?F(y):(e.consume(y),D)}function A(y){return y===47||y===62||ve(y)?F(y):n(y)}function G(y){return y===62?(e.consume(y),e.exit("htmlTextData"),e.exit("htmlText"),t):n(y)}function ue(y){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Ce}function Ce(y){return J(y)?te(e,je,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):je(y)}function je(y){return e.enter("htmlTextData"),o(y)}}const _r={name:"labelEnd",resolveAll:Kh,resolveTo:em,tokenize:tm},Gh={tokenize:nm},Xh={tokenize:rm},Qh={tokenize:im};function Kh(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ze(e,0,e.length,n),e}function em(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const u={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[["enter",u,t],["enter",l,t]],s=Ie(s,e.slice(a+1,a+r+3)),s=Ie(s,[["enter",c,t]]),s=Ie(s,kr(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Ie(s,[["exit",c,t],e[o-2],e[o-1],["exit",l,t]]),s=Ie(s,e.slice(o+1)),s=Ie(s,[["exit",u,t]]),Ze(e,a,e.length,s),e}function tm(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(f){return a?a._inactive?p(f):(o=r.parser.defined.includes(yt(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),u):n(f)}function u(f){return f===40?e.attempt(Gh,c,o?c:p)(f):f===91?e.attempt(Xh,c,o?l:p)(f):o?c(f):p(f)}function l(f){return e.attempt(Qh,c,p)(f)}function c(f){return t(f)}function p(f){return a._balanced=!0,n(f)}}function nm(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return ve(p)?Dt(e,a)(p):a(p)}function a(p){return p===41?c(p):Ao(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return ve(p)?Dt(e,u)(p):c(p)}function s(p){return n(p)}function u(p){return p===34||p===39||p===40?Oo(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):c(p)}function l(p){return ve(p)?Dt(e,c)(p):c(p)}function c(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function rm(e,t,n){const r=this;return i;function i(s){return Po.call(r,e,a,o,"reference","referenceMarker","referenceString")(s)}function a(s){return r.parser.defined.includes(yt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function o(s){return n(s)}}function im(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const am={name:"labelStartImage",resolveAll:_r.resolveAll,tokenize:om};function om(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),o):n(s)}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const sm={name:"labelStartLink",resolveAll:_r.resolveAll,tokenize:lm};function lm(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const On={name:"lineEnding",tokenize:um};function um(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),te(e,t,"linePrefix")}}const an={name:"thematicBreak",tokenize:cm};function cm(e,t,n){let r=0,i;return a;function a(l){return e.enter("thematicBreak"),o(l)}function o(l){return i=l,s(l)}function s(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||Z(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),J(l)?te(e,s,"whitespace")(l):s(l))}}const ye={continuation:{tokenize:hm},exit:gm,name:"list",tokenize:fm},pm={partial:!0,tokenize:ym},dm={partial:!0,tokenize:mm};function fm(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:er(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(an,n,l)(d):l(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(d)}return n(d)}function u(d){return er(d)&&++o<10?(e.consume(d),u):(!r.interrupt||o<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),l(d)):n(d)}function l(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(vn,r.interrupt?n:c,e.attempt(pm,f,p))}function c(d){return r.containerState.initialBlankLine
vendor: 5,300 bytes, line 48
48=!0,a++,f(d)}function p(d){return J(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),f):n(d)}function f(d){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function hm(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(vn,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,te(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!J(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dm,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,te(e,e.attempt(ye,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function mm(e,t,n){const r=this;return te(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function gm(e){e.exit(this.containerState.type)}function ym(e,t,n){const r=this;return te(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!J(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Li={name:"setextUnderline",resolveTo:vm,tokenize:bm};function vm(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function bm(e,t,n){const r=this;let i;return a;function a(l){let c=r.events.length,p;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){p=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=l,o(l)):n(l)}function o(l){return e.enter("setextHeadingLineSequence"),s(l)}function s(l){return l===i?(e.consume(l),s):(e.exit("setextHeadingLineSequence"),J(l)?te(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||Z(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const xm={tokenize:wm};function wm(e){const t=this,n=e.attempt(vn,r,e.attempt(this.parser.constructs.flowInitial,i,te(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ih,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const km={resolveAll:Mo()},_m=No("string"),Sm=No("text");function No(e){return{resolveAll:Mo(e==="text"?Em:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,s);return o;function o(c){return l(c)?a(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return l(c)?(n.exit("data"),a(c)):(n.consume(c),u)}function l(c){if(c===null)return!0;const p=i[c];let f=-1;if(p)for(;++f<p.length;){const d=p[f];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Mo(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function Em(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,s=0,u;for(;a--;){const l=i[a];if(typeof l=="string"){for(o=l.length;l.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(l===-2)u=!0,s++;else if(l!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const l={type:n===e.length||u||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}const Im={42:ye,43:ye,45:ye,48:ye,49:ye,50:ye,51:ye,52:ye,53:ye,54:ye,55:ye,56:ye,57:ye,62:Io},Cm={91:Ph},Tm={[-2]:Pn,[-1]:Pn,32:Pn},zm={35:Dh,42:an,45:[Li,an],60:Fh,61:Li,95:an,96:Zi,126:Zi},Am={38:To,92:Co},Pm={[-5]:On,[-4]:On,[-3]:On,33:am,38:To,42:tr,60:[sh,Wh],91:sm,92:[Rh,Co],93:_r,95:tr,96:xh},Om={null:[tr,km]},Nm={null:[42,95]},Mm={null:[]},Rm=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Nm,contentInitial:Cm,disable:Mm,document:Im,flow:zm,flowInitial:Tm,insideSpan:Om,string:Am,text:Pm},Symbol.toStringTag,{value:"Module"}));function $m(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
vendor: 14,537 bytes, lines 48-50
48olumn:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],s=[];const u={attempt:P(z),check:P(k),consume:b,enter:h,exit:E,interrupt:P(k,{interrupt:!0})},l={code:null,containerState:{},defineSkip:x,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:d,write:p};let c=t.tokenize.call(l,u);return t.resolveAll&&a.push(t),l;function p(N){return o=Ie(o,N),w(),o[o.length-1]!==null?[]:($(t,0),l.events=kr(a,l.events,l),l.events)}function f(N,M){return Zm(d(N),M)}function d(N){return Dm(o,N)}function m(){const{_bufferIndex:N,_index:M,line:K,column:D,offset:A}=r;return{_bufferIndex:N,_index:M,line:K,column:D,offset:A}}function x(N){i[N.line]=N.column,U()}function w(){let N;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<M.length;)g(M.charCodeAt(r._bufferIndex));else g(M)}}function g(N){c=c(N)}function b(N){Z(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,U()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=N}function h(N,M){const K=M||{};return K.type=N,K.start=m(),l.events.push(["enter",K,l]),s.push(K),K}function E(N){const M=s.pop();return M.end=m(),l.events.push(["exit",M,l]),M}function z(N,M){$(N,M.from)}function k(N,M){M.restore()}function P(N,M){return K;function K(D,A,G){let ue,Ce,je,y;return Array.isArray(D)?Le(D):"tokenize"in D?Le([D]):Te(D);function Te(pe){return kt;function kt(Ue){const st=Ue!==null&&pe[Ue],lt=Ue!==null&&pe.null,Yt=[...Array.isArray(st)?st:st?[st]:[],...Array.isArray(lt)?lt:lt?[lt]:[]];return Le(Yt)(Ue)}}function Le(pe){return ue=pe,Ce=0,pe.length===0?G:v(pe[Ce])}function v(pe){return kt;function kt(Ue){return y=F(),je=pe,pe.partial||(l.currentConstruct=pe),pe.name&&l.parser.constructs.disable.null.includes(pe.name)?Xe():pe.tokenize.call(M?Object.assign(Object.create(l),M):l,u,ze,Xe)(Ue)}}function ze(pe){return N(je,y),A}function Xe(pe){return y.restore(),++Ce<ue.length?v(ue[Ce]):G}}}function $(N,M){N.resolveAll&&!a.includes(N)&&a.push(N),N.resolve&&Ze(l.events,M,l.events.length-M,N.resolve(l.events.slice(M),l)),N.resolveTo&&(l.events=N.resolveTo(l.events,l))}function F(){const N=m(),M=l.previous,K=l.currentConstruct,D=l.events.length,A=Array.from(s);return{from:D,restore:G};function G(){r=N,l.previous=M,l.currentConstruct=K,l.events.length=D,s=A,U()}}function U(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Dm(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Zm(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
49`;break}case-3:{o=`\r
50`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function jm(e){const r={constructs:Hf([Rm,...(e||{}).extensions||[]]),content:i(eh),defined:[],document:i(nh),flow:i(xm),lazy:{},string:i(_m),text:i(Sm)};return r;function i(a){return o;function o(s){return $m(r,a,s)}}}function Lm(e){for(;!zo(e););return e}const Fi=/[\0\t\n\r]/g;function Fm(){let e=1,t="",n=!0,r;return i;function i(a,o,s){const u=[];let l,c,p,f,d;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if(Fi.lastIndex=p,l=Fi.exec(a),f=l&&l.index!==void 0?l.index:a.length,d=a.charCodeAt(f),!l){t=a.slice(p);break}if(d===10&&p===f&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<f&&(u.push(a.slice(p,f)),e+=f-p),d){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}p=f+1}return s&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const Bm=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Um(e){return e.replace(Bm,Vm)}function Vm(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return Eo(n.slice(a?2:1),a?16:10)}return wr(n)||e}const Ro={}.hasOwnProperty;function qm(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Hm(n)(Lm(jm(n).document().write(Fm()(e,t,!0))))}function Hm(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Or),autolinkProtocol:F,autolinkEmail:F,atxHeading:a(zr),blockQuote:a(lt),characterEscape:F,characterReference:F,codeFenced:a(Yt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Yt,o),codeText:a(Ho,o),codeTextData:F,data:F,codeFlowValue:F,definition:a(Jo),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Wo),hardBreakEscape:a(Ar),hardBreakTrailing:a(Ar),htmlFlow:a(Pr,o),htmlFlowData:F,htmlText:a(Pr,o),htmlTextData:F,image:a(Yo),label:o,link:a(Or),listItem:a(Go),listItemValue:f,listOrdered:a(Nr,p),listUnordered:a(Nr),paragraph:a(Xo),reference:v,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(zr),strong:a(Qo),thematicBreak:a(es)},exit:{atxHeading:u(),atxHeadingSequence:z,autolink:u(),autolinkEmail:st,autolinkProtocol:Ue,blockQuote:u(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:Xe,characterReferenceMarkerNumeric:Xe,characterReferenceValue:pe,characterReference:kt,codeFenced:u(w),codeFencedFence:x,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:U,codeIndented:u(g),codeText:u(A),codeTextData:U,data:U,definition:u(),definitionDestinationString:E,definitionLabelString:b,definitionTitleString:h,emphasis:u(),hardBreakEscape:u(M),hardBreakTrailing:u(M),htmlFlow:u(K),htmlFlowData:U,htmlText:u(D),htmlTextData:U,image:u(ue),label:je,labelText:Ce,lineEnding:N,link:u(G),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ze,resourceDestinationString:y,resourceTitleString:Te,resource:Le,setextHeading:u($),setextHeadingLineSequence:P,setextHeadingText:k,strong:u(),thematicBreak:u()}};$o(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(S){let T={type:"root",children:[]};const j={stack:[T],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:c,data:n},q=[];let X=-1;for(;++X<S.length;)if(S[X][1].type==="listOrdered"||S[X][1].type==="listUnordered")if(S[X][0]==="enter")q.push(X);else{const Ae=q.pop();X=i(S,Ae,X)}for(X=-1;++X<S.length;){const Ae=t[S[X][0]];Ro.call(Ae,S[X][1].type)&&Ae[S[X][1].type].call(Object.assign({sliceSerialize:S[X][2].sliceSerialize},j),S[X][1])}if(j.tokenStack.length>0){const Ae=j.tokenStack[j.tokenStack.length-1];(Ae[1]||Bi).call(j,void 0,Ae[0])}for(T.position={start:Ve(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:Ve(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},X=-1;++X<t.transforms.length;)T=t.transforms[X](T)||T;return T}function i(S,T,j){let q=T-1,X=-1,Ae=!1,Qe,Fe,_t,St;for(;++q<=j;){const we=S[q];switch(we[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{we[0]==="enter"?X++:X--,St=void 0;break}case"lineEndingBlank":{we[0]==="enter"&&(Qe&&!St&&!X&&!_t&&(_t=q),St=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:St=void 0}if(!X&&we[0]==="enter"&&we[1].type==="listItemPrefix"||X===-1&&we[0]==="exit"&&(we[1].type==="listUnordered"||we[1].type==="listOrdered")){if(Qe){let ut=q;for(Fe=void 0;ut--;){const Be=S[ut];if(Be[1].type==="lineEnding"||Be[1].type==="lineEndingBlank"){if(Be[0]==="exit")continue;Fe&&(S[Fe][1].type="lineEndingBlank",Ae=!0),Be[1].type="lineEnding",Fe=ut}else if(!(Be[1].type==="linePrefix"||Be[1].type==="blockQuotePrefix"||Be[1].type==="blockQuotePrefixWhitespace"||Be[1].type==="blockQuoteMarker"||Be[1].type==="listItemIndent"))break}_t&&(!Fe||_t<Fe)&&(Qe._spread=!0),Qe.end=Object.assign({},Fe?S[Fe][1].start:we[1].end),S.splice(Fe||q,0,["exit",Qe,we[2]]),q++,j++}if(we[1].type==="listItemPrefix"){const ut={type:"listItem",_spread:!1,start:Object.assign({},we[1].start),end:void 0};Qe=ut,S.splice(q,0,["enter",ut,we[2]]),q++,j++,_t=void 0,St=!0}}}return S[T][1]._spread=Ae,j}function a(S,T){return j;function j(q){s.call(this,S(q),q),T&&T.call(this,q)}}function o(){this.stack.push({type:"fragment",children:[]})}function s(S,T,j){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([T,j||void 0]),S.position={start:Ve(T.start),end:void 0}}function u(S){return T;function T(j){S&&S.call(this,j),l.call(this,j)}}function l(S,T){const j=this.stack.pop(),q=this.tokenStack.pop();if(q)q[0].type!==S.type&&(T?T.call(this,S,q[0]):(q[1]||Bi).call(this,S,q[0]));else throw new Error("Cannot close `"+S.type+"` ("+$t({start:S.start,end:S.end})+"): it’s not open");j.position.end=Ve(S.end)}function c(){return Vf(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function f(S){if(this.data.expectingFirstListItemValue){const T=this.stack[this.stack.length-2];T.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function d(){const S=this.resume(),T=this.stack[this.stack.length-1];T.lang=S}function m(){const S=this.resume(),T=this.stack[this.stack.length-1];T.meta=S}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S.replace(/(\r?\n|\r)$/g,"")}function b(S){const T=this.resume(),j=this.stack[this.stack.length-1];j.label=T,j.identifier=yt(this.sliceSerialize(S)).toLowerCase()}function h(){const S=this.resume(),T=this.stack[this.stack.length-1];T.title=S}function E(){const S=this.resume(),T=this.stack[this.stack.length-1];T.url=S}function z(S){const T=this.stack[this.stack.length-1];if(!T.depth){const j=this.sliceSerialize(S).length;T.depth=j}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function P(S){const T=this.stack[this.stack.length-1];T.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function F(S){const j=this.stack[this.stack.length-1].children;let q=j[j.length-1];(!q||q.type!=="text")&&(q=Ko(),q.position={start:Ve(S.start),end:void 0},j.push(q)),this.stack.push(q)}function U(S){const T=this.stack.pop();T.value+=this.sliceSerialize(S),T.position.end=Ve(S.end)}function N(S){const T=this.stack[this.stack.length-1];if(this.data.atHardBreak){const j=T.children[T.children.length-1];j.position.end=Ve(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(T.type)&&(F.call(this,S),U.call(this,S))}function M(){this.data.atHardBreak=!0}function K(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S}function D(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S}function A(){const S=this.resume(),T=this.stack[this.stack.length-1];T.value=S}function G(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=T,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function ue(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=T,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function Ce(S){const T=this.sliceSerialize(S),j=this.stack[this.stack.length-2];j.label=Um(T),j.identifier=yt(T).toLowerCase()}function je(){const S=this.stack[this.stack.length-1],T=this.resume(),j=this.stack[this.stack.length-1];if(this.data.inReference=!0,j.type==="link"){const q=S.children;j.children=q}else j.alt=T}function y(){const S=this.resume(),T=this.stack[this.stack.length-1];T.url=S}function Te(){const S=this.resume(),T=this.stack[this.stack.length-1];T.title=S}function Le(){this.data.inReference=void 0}function v(){this.data.referenceType="collapsed"}function ze(S){const T=this.resume(),j=this.stack[this.stack.length-1];j.label=T,j.identifier=yt(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function Xe(S){this.data.characterReferenceType=S.type}function pe(S){const T=this.sliceSerialize(S),j=this.data.characterReferenceType;let q;j?(q=Eo(T,j==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):q=wr(T);const X=this.stack[this.stack.length-1];X.value+=q}function kt(S){const T=this.stack.pop();T.position.end=Ve(S.end)}function Ue(S){U.call(this,S);const T=this.stack[this.stack.length-1];T.url=this.sliceSerialize(S)}function st(S){U.call(this,S);const T=this.stack[this.stack.length-1];T.url="mailto:"+this.sliceSerialize(S)}function lt(){return{type:"blockquote",children:[]}}function Yt(){return{type:"code",lang:null,meta:null,value:""}}function Ho(){return{type:"inlineCode",value:""}}function Jo(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Wo(){return{type:"emphasis",children:[]}}function zr(){return{type:"heading",depth:0,children:[]}}function Ar(){return{type:"break"}}function Pr(){return{type:"html",value:""}}function Yo(){return{type:"image",title:null,url:"",alt:null}}function Or(){return{type:"link",title:null,url:"",children:[]}}function Nr(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function Go(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function Xo(){return{type:"paragraph",children:[]}}function Qo(){return{type:"strong",children:[]}}function Ko(){return{type:"text",value:""}}function es(){return{type:"thematicBreak"}}}function Ve(e){return{line:e.line,column:e.column,offset:e.offset}}function $o(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?$o(e,r):Jm(e,r)}}function Jm(e,t){let n;for(n in t)if(Ro.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Bi(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$t({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$t({start:t.start,end:t.end}
vendor: 5,966 bytes, lines 50-54
50)+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$t({start:t.start,end:t.end})+") is still open")}function Wm(e){const t=this;t.parser=n;function n(r){return qm(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ym(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Gm(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
51`}]}function Xm(e,t){const n=t.value?t.value+`
52`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Qm(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Km(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eg(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=wt(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,l),e.applyData(t,l)}function tg(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ng(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Do(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function rg(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Do(e,t);const i={src:wt(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function ig(e,t){const n={src:wt(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ag(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function og(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Do(e,t);const i={href:wt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function sg(e,t){const n={href:wt(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lg(e,t,n){const r=e.all(t),i=n?ug(n):Zo(t),a={},o=[];if(typeof t.checked=="boolean"){const c=r[0];let p;c&&c.type==="element"&&c.tagName==="p"?p=c:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const c=r[s];(i||s!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
53`}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
54`});const l={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function ug(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Zo(n[r])}return t}function Zo(e){const t=e.spread;return t??e.children.length>1}function cg(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function pg(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dg(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function fg(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hg(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=yr(t.children[1]),u=vo(t.children[t.children.length-1]);s&&u&&(o.position={start:s,end:u}),i.push(o)}const a={type:"element",tagName:"table",properties:{}
vendor: 1,780 bytes, line 54
54,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function mg(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,s=o?o.length:t.children.length;let u=-1;const l=[];for(;++u<s;){const p=t.children[u],f={},d=o?o[u]:void 0;d&&(f.align=d);let m={type:"element",tagName:a,properties:f,children:[]};p&&(m.children=e.all(p),e.patch(p,m),m=e.applyData(p,m)),l.push(m)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)}function gg(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ui=9,Vi=32;function yg(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(qi(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(qi(t.slice(i),i>0,!1)),a.join("")}function qi(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Ui||a===Vi;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Ui||a===Vi;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function vg(e,t){const n={type:"text",value:yg(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function bg(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const xg={blockquote:Ym,break:Gm,code:Xm,delete:Qm,emphasis:Km,footnoteReference:eg,heading:tg,html:ng,imageReference:rg,image:ig,inlineCode:ag,linkReference:og,link:sg,listItem:lg,list:cg,paragraph:pg,root:dg,strong:fg,table:hg,tableCell:gg,tableRow:mg,text:vg,thematicBreak:bg,toml:Kt,yaml:Kt,definition:Kt,footnoteDefinition:Kt};function Kt(){}const jo=-1,bn=0,Zt=1,pn=2,Sr=3,Er=4,Ir=5,Cr=6,Lo=7,Fo=8,wg=typeof self=="object"?self:globalThis,Hi=(e,t)=>
vendor: 4,583 bytes, lines 54-55
54{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new wg[e](t)},kg=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case bn:case jo:return n(o,i);case Zt:{const s=n([],i);for(const u of o)s.push(r(u));return s}case pn:{const s=n({},i);for(const[u,l]of o)s[r(u)]=r(l);return s}case Sr:return n(new Date(o),i);case Er:{const{source:s,flags:u}=o;return n(new RegExp(s,u),i)}case Ir:{const s=n(new Map,i);for(const[u,l]of o)s.set(r(u),r(l));return s}case Cr:{const s=n(new Set,i);for(const u of o)s.add(r(u));return s}case Lo:{const{name:s,message:u}=o;return n(Hi(s,u),i)}case Fo:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:s}=new Uint8Array(o);return n(new DataView(s),o)}}return n(Hi(a,o),i)};return r},Ji=e=>kg(new Map,e)(0),ft="",{toString:_g}={},{keys:Sg}=Object,At=e=>{const t=typeof e;if(t!=="object"||!e)return[bn,t];const n=_g.call(e).slice(8,-1);switch(n){case"Array":return[Zt,ft];case"Object":return[pn,ft];case"Date":return[Sr,ft];case"RegExp":return[Er,ft];case"Map":return[Ir,ft];case"Set":return[Cr,ft];case"DataView":return[Zt,n]}return n.includes("Array")?[Zt,n]:n.includes("Error")?[Lo,n]:[pn,n]},en=([e,t])=>e===bn&&(t==="function"||t==="symbol"),Eg=(e,t,n,r)=>{const i=(o,s)=>{const u=r.push(o)-1;return n.set(s,u),u},a=o=>{if(n.has(o))return n.get(o);let[s,u]=At(o);switch(s){case bn:{let c=o;switch(u){case"bigint":s=Fo,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([jo],o)}return i([s,c],o)}case Zt:{if(u){let f=o;return u==="DataView"?f=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(f=new Uint8Array(o)),i([u,[...f]],o)}const c=[],p=i([s,c],o);for(const f of o)c.push(a(f));return p}case pn:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const c=[],p=i([s,c],o);for(const f of Sg(o))(e||!en(At(o[f])))&&c.push([a(f),a(o[f])]);return p}case Sr:return i([s,o.toISOString()],o);case Er:{const{source:c,flags:p}=o;return i([s,{source:c,flags:p}],o)}case Ir:{const c=[],p=i([s,c],o);for(const[f,d]of o)(e||!(en(At(f))||en(At(d))))&&c.push([a(f),a(d)]);return p}case Cr:{const c=[],p=i([s,c],o);for(const f of o)(e||!en(At(f)))&&c.push(a(f));return p}}const{message:l}=o;return i([s,{name:u,message:l}],o)};return a},Wi=(e,{json:t,lossy:n}={})=>{const r=[];return Eg(!(t||n),!!t,new Map,r)(e),r},dn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ji(Wi(e,t)):structuredClone(e):(e,t)=>Ji(Wi(e,t));function Ig(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Cg(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Tg(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ig,r=e.options.footnoteBackLabel||Cg,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let u=-1;for(;++u<e.footnoteOrder.length;){const l=e.footnoteById.get(e.footnoteOrder[u]);if(!l)continue;const c=e.all(l),p=String(l.identifier).toUpperCase(),f=wt(p.toLowerCase());let d=0;const m=[],x=e.footnoteCounts.get(p);for(;x!==void 0&&++d<=x;){m.length>0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(u,d);typeof b=="string"&&(b={type:"text",value:b}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,d),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const w=c[c.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const b=w.children[w.children.length-1];b&&b.type==="text"?b.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else c.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(c,!0)};e.patch(l,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...dn(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
55`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)}
vendor: 4,266 bytes, lines 55-60
55,{type:"text",value:`
56`}]}}const Bo=(function(e){if(e==null)return Og;if(typeof e=="function")return xn(e);if(typeof e=="object")return Array.isArray(e)?zg(e):Ag(e);if(typeof e=="string")return Pg(e);throw new Error("Expected function, string, or object as test")});function zg(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Bo(e[n]);return xn(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Ag(e){const t=e;return xn(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Pg(e){return xn(t);function t(n){return n&&n.type===e}}function xn(e){return t;function t(n,r,i){return!!(Ng(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Og(){return!0}function Ng(e){return e!==null&&typeof e=="object"&&"type"in e}const Uo=[],Mg=!0,Yi=!1,Rg="skip";function $g(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Bo(i),o=r?-1:1;s(e,void 0,[])();function s(u,l,c){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const d=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(u.type+(d?"<"+d+">":""))+")"})}return f;function f(){let d=Uo,m,x,w;if((!t||a(u,l,c[c.length-1]||void 0))&&(d=Dg(n(u,c)),d[0]===Yi))return d;if("children"in u&&u.children){const g=u;if(g.children&&d[0]!==Rg)for(x=(r?g.children.length:-1)+o,w=c.concat(g);x>-1&&x<g.children.length;){const b=g.children[x];if(m=s(b,x,w)(),m[0]===Yi)return m;x=typeof m[1]=="number"?m[1]:x+o}}return d}}}function Dg(e){return Array.isArray(e)?e:typeof e=="number"?[Mg,e]:e==null?Uo:[e]}function Vo(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),$g(e,a,s,i);function s(u,l){const c=l[l.length-1],p=c?c.children.indexOf(u):void 0;return o(u,p,c)}}const nr={}.hasOwnProperty,Zg={};function jg(e,t){const n=t||Zg,r=new Map,i=new Map,a=new Map,o={...xg,...n.handlers},s={all:l,applyData:Fg,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:u,options:n,patch:Lg,wrap:Ug};return Vo(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const p=c.type==="definition"?r:i,f=String(c.identifier).toUpperCase();p.has(f)||p.set(f,c)}}),s;function u(c,p){const f=c.type,d=s.handlers[f];if(nr.call(s.handlers,f)&&d)return d(s,c,p);if(s.options.passThrough&&s.options.passThrough.includes(f)){if("children"in c){const{children:x,...w}=c,g=dn(w);return g.children=s.all(c),g}return dn(c)}return(s.options.unknownHandler||Bg)(s,c,p)}function l(c){const p=[];if("children"in c){const f=c.children;let d=-1;for(;++d<f.length;){const m=s.one(f[d],c);if(m){if(d&&f[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Gi(m.value)),!Array.isArray(m)&&m.type==="element")){const x=m.children[0];x&&x.type==="text"&&(x.value=Gi(x.value))}Array.isArray(m)?p.push(...m):p.push(m)}}}return p}}function Lg(e,t){e.position&&(t.position=kf(e))}function Fg(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,dn(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Bg(e,t){const n=t.data||{},r="value"in t&&!(nr.call(n,"hProperties")||nr.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ug(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
57`});++r<e.length;)r&&n.push({type:"text",value:`
58`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
59`}),n}function Gi(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xi(e,t){const n=jg(e,t),r=n.one(e,void 0),i=Tg(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
60`},i),a}function Vg(e,t){return e&&"run"in e?async function(n,r){const i=Xi(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Xi(n,{file:r,...e||t})}}function Qi(e){if(e)throw e}var Nn,Ki;
vendor: 8,898 bytes, line 60
60function qg(){if(Ki)return Nn;Ki=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(l){return typeof Array.isArray=="function"?Array.isArray(l):t.call(l)==="[object Array]"},a=function(l){if(!l||t.call(l)!=="[object Object]")return!1;var c=e.call(l,"constructor"),p=l.constructor&&l.constructor.prototype&&e.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!c&&!p)return!1;var f;for(f in l);return typeof f>"u"||e.call(l,f)},o=function(l,c){n&&c.name==="__proto__"?n(l,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):l[c.name]=c.newValue},s=function(l,c){if(c==="__proto__")if(e.call(l,c)){if(r)return r(l,c).value}else return;return l[c]};return Nn=function u(){var l,c,p,f,d,m,x=arguments[0],w=1,g=arguments.length,b=!1;for(typeof x=="boolean"&&(b=x,x=arguments[1]||{},w=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});w<g;++w)if(l=arguments[w],l!=null)for(c in l)p=s(x,c),f=s(l,c),x!==f&&(b&&f&&(a(f)||(d=i(f)))?(d?(d=!1,m=p&&i(p)?p:[]):m=p&&a(p)?p:{},o(x,{name:c,newValue:u(b,m,f)})):typeof f<"u"&&o(x,{name:c,newValue:f}));return x},Nn}var Hg=qg();const Mn=or(Hg);function rr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Jg(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...i);function s(u,...l){const c=e[++a];let p=-1;if(u){o(u);return}for(;++p<i.length;)(l[p]===null||l[p]===void 0)&&(l[p]=i[p]);i=l,c?Wg(c,s)(...l):o(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Wg(e,t){let n;return r;function r(...o){const s=e.length>o.length;let u;s&&o.push(i);try{u=e.apply(this,o)}catch(l){const c=l;if(s&&n)throw c;return i(c)}s||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...s){n||(n=!0,t(o,...s))}function a(o){i(null,o)}}const Me={basename:Yg,dirname:Gg,extname:Xg,join:Qg,sep:"/"};function Yg(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Wt(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Gg(e){if(Wt(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Xg(e){Wt(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Qg(...e){let t=-1,n;for(;++t<e.length;)Wt(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Kg(n)}function Kg(e){Wt(e);const t=e.codePointAt(0)===47;let n=ey(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ey(e,t){let n="",r=0,i=-1,a=0,o=-1,s,u;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Wt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ty={cwd:ny};function ny(){return"/"}function ir(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ry(e){if(typeof e=="string")e=new URL(e);else if(!ir(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return iy(e)}function iy(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Rn=["history","path","basename","stem","extname","dirname"];class qo{constructor(t){let n;t?ir(t)?n={path:t}:typeof t=="string"||ay(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":ty.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Rn.length;){const a=Rn[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Rn.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Me.basename(this.path):void 0}set basename(t){Dn(t,"basename"),$n(t,"basename"),this.path=Me.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Me.dirname(this.path):void 0}set dirname(t){ea(this.basename,"dirname"),this.path=Me.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Me.extname(this.path):void 0}set extname(t){if($n(t,"extname"),ea(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Me.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ir(t)&&(t=ry(t)),Dn(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Me.basename(this.path,this.extname):void 0}set stem(t){Dn(t,"stem"),$n(t,"stem"),this.path=Me.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new fe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function $n(e,t){if(e&&e.includes(Me.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Me.sep+"`")}function Dn(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ea(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ay(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oy=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),sy={}.hasOwnProperty;class Tr extends oy{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Jg()}copy(){const t=new Tr;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Mn(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ln("data",this.frozen),this.namespace[t]=n,this):sy.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ln("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=tn(t),r=this.parser||this.Parser;return Zn("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zn("process",this.parser||this.Parser),jn("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const s=tn(t),u=r.parse(s);r.run(u,s,function(c,p,f){if(c||!p||!f)return l(c);const d=p,m=r.stringify(d,f);cy(m)?f.value=m:f.result=m,l(c,f)});
vendor: 5,009 bytes, line 60
60function l(c,p){c||!p?o(c):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),Zn("processSync",this.parser||this.Parser),jn("processSync",this.compiler||this.Compiler),this.process(t,i),na("processSync","process",n),r;function i(a,o){n=!0,Qi(a),r=o}}run(t,n,r){ta(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,s){const u=tn(n);i.run(t,u,l);function l(c,p,f){const d=p||t;c?s(c):o?o(d):r(void 0,d,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),na("runSync","run",r),i;function a(o,s){Qi(o),i=s,r=!0}}stringify(t,n){this.freeze();const r=tn(n),i=this.compiler||this.Compiler;return jn("stringify",i),ta(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Ln("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[c,...p]=l;u(c,p)}else o(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function o(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(l.plugins),l.settings&&(i.settings=Mn(!0,i.settings,l.settings))}function s(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){const p=l[c];a(p)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let p=-1,f=-1;for(;++p<r.length;)if(r[p][0]===l){f=p;break}if(f===-1)r.push([l,...c]);else if(c.length>0){let[d,...m]=c;const x=r[f][1];rr(x)&&rr(d)&&(d=Mn(!0,x,d)),r[f]=[l,d,...m]}}}}const ly=new Tr().freeze();function Zn(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function jn(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ln(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ta(e){if(!rr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function na(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tn(e){return uy(e)?e:new qo(e)}function uy(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function cy(e){return typeof e=="string"||py(e)}function py(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dy="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ra=[],ia={allowDangerousHtml:!0},fy=/^(https?|ircs?|mailto|xmpp)$/i,hy=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function my(e){const t=gy(e),n=yy(e);return vy(t.runSync(t.parse(n),n),e)}function gy(e){const t=e.rehypePlugins||ra,n=e.remarkPlugins||ra,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ia}:ia;return ly().use(Wm).use(n).use(Vg,r).use(t)}function yy(e){const t=e.children||"",n=new qo;return typeof t=="string"&&(n.value=t),n}function vy(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,u=t.urlTransform||by;for(const c of hy)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+dy+c.id,void 0);return Vo(e,l),Cf(e,{Fragment:H.Fragment,components:i,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function l(c,p,f){if(c.type==="raw"&&f&&typeof p=="number")return o?f.children.splice(p,1):f.children[p]={type:"text",value:c.value},p;if(c.type==="element"){let d;for(d in An)if(Object.hasOwn(An,d)&&Object.hasOwn(c.properties,d)){const m=c.properties[d],x=An[d];(x===null||x.includes(c.tagName))&&(c.properties[d]=u(String(m||""),d,c))}}
60if(c.type==="element"){let d=n?!n.includes(c.tagName):a?a.includes(c.tagName):!1;if(!d&&r&&typeof p=="number"&&(d=!r(c,p,f)),d&&f&&typeof p=="number")return s&&c.children?f.children.splice(p,1,...c.children):f.children.splice(p,1),p}}}function by(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||fy.test(e.slice(0,t))?e:""}const ar="sde-chat-messages",aa={en:["What is the Steering Wheel and why does it matter?","Explain the Copilot Trap in simple terms.","How does the SDE Blueprint differ from typical AI adoption?","What is 50/50 Mode?"],sv:["Vad är Steering Wheel och varför är det viktigt?","Förklara Copilot Trap enkelt.","Hur skiljer sig SDE Blueprint från vanlig AI-adoption?","Vad är 50/50 Mode?"],no:["Hva er Steering Wheel og hvorfor er det viktig?","Forklar Copilot Trap på en enkel måte.","Hvordan skiller SDE Blueprint seg fra vanlig AI-adopsjon?","Hva er 50/50 Mode?"],fi:["Mikä on Steering Wheel ja miksi sillä on väliä?","Selitä Copilot Trap yksinkertaisesti.","Miten SDE Blueprint eroaa tavallisesta tekoälyn käyttöönotosta?","Mikä on 50/50 Mode?"]},oa={en:{title:"Talk to Your eBook",subtitle:"Ask anything about The Self-Driving Enterprise® — chapters, glossary, personas and agents.",placeholder:"Ask the book a question…",clear:"Clear chat",empty:"Try one of these to get started:",loading:"Thinking…",error:"Something went wrong. Please try again."},sv:{title:"Prata med din e-bok",subtitle:"Fråga vad som helst om The Self-Driving Enterprise® — kapitel, ordlista, roller och agenter.",placeholder:"Ställ en fråga till boken…",clear:"Rensa chatt",empty:"Prova en av dessa för att komma igång:",loading:"Tänker…",error:"Något gick fel. Försök igen."},no:{title:"Snakk med e-boken din",subtitle:"Spør om hva som helst om The Self-Driving Enterprise® — kapitler, ordliste, roller og agenter.",placeholder:"Still boken et spørsmål…",clear:"Tøm chat",empty:"Prøv en av disse for å komme i gang:",loading:"Tenker…",error:"Noe gikk galt. Prøv igjen."},fi:{title:"Keskustele e-kirjasi kanssa",subtitle:"Kysy mitä tahansa kirjasta The Self-Driving Enterprise® — luvut, sanasto, roolit ja agentit.",placeholder:"Esitä kirjalle kysymys…",clear:"Tyhjennä keskustelu",empty:"Aloita kokeilemalla jotain näistä:",loading:"Ajattelen…",error:"Jokin meni pieleen. Yritä uudelleen."}};function xy(){if(typeof window>"u")return[];try{const e=localStorage.getItem(ar);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function ky(){const{locale:e}=ts(),t=oa[e]??oa.en,n=aa[e]??aa.en,[r]=de.useState(()=>xy()),[i,a]=de.useState(""),o=de.useRef(null),s=de.useRef(null),{messages:u,sendMessage:l,status:c,error:p,setMessages:f}=Xd({id:"sde-ebook-chat",messages:r,transport:new lo({api:"/api/chat"})});de.useEffect(()=>{try{localStorage.setItem(ar,JSON.stringify(u))}catch{}},[u]),de.useEffect(()=>{s.current?.scrollTo({top:s.current.scrollHeight,behavior:"smooth"})},[u,c]),de.useEffect(()=>{o.current?.focus()},[]),de.useEffect(()=>{c==="ready"&&o.current?.focus()},[c]);const d=c==="submitted"||c==="streaming",m=async w=>{const g=(w??i).trim();!g||d||(a(""),await l({text:g},{body:{locale:e}}))},x=()=>{f([]);try{localStorage.removeItem(ar)}catch{}};return H.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col px-4 py-8",style:{minHeight:"calc(100vh - 14rem)"},children:[H.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4",children:[H.jsxs("div",{children:[H.jsxs("div",{className:"mb-2 inline-flex items-center gap-2 rounded-full border border-primary/30 bg-secondary px-3 py-1 text-xs font-medium text-deep",children:[H.jsx(wn,{className:"h-3.5 w-3.5 text-primary"}),"AI assistant"]}),H.jsx("h1",{className:"text-3xl font-bold tracking-tight text-deep md:text-4xl",children:t.title}),H.jsx("p",{className:"mt-2 max-w-2xl text-muted-foreground",children:t.subtitle})]}),u.length>0&&H.jsxs("button",{onClick:x,className:"inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-secondary hover:text-deep",children:[H.jsx(ss,{className:"h-3.5 w-3.5"})," ",t.clear]})]}),H.jsx("div",{ref:s,className:"flex-1 overflow-y-auto rounded-xl border border-border bg-card/40 p-4 md:p-6",style:{maxHeight:"60vh",minHeight:"400px"},children:u.length===0?H.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[H.jsx("div",{className:"grid h-14 w-14 place-items-center rounded-full bg-primary/10 text-primary",children:H.jsx(wn,{className:"h-7 w-7"})}),H.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:t.empty}),H.jsx("div",{className:"mt-4 grid w-full max-w-2xl gap-2 sm:grid-cols-2",children:n.map(w=>H.jsx("button",{onClick:()=>m(w),className:"rounded-lg border border-border bg-background px-4 py-3 text-left text-sm text-deep hover:border-primary/50 hover:bg-secondary",children:w}
60,w))})]}):H.jsxs("div",{className:"space-y-5",children:[u.map(w=>{const g=w.parts.map(b=>b.type==="text"?b.text:"").join("");return w.role==="user"?H.jsx("div",{className:"flex justify-end",children:H.jsx("div",{className:"max-w-[85%] rounded-2xl rounded-br-sm bg-primary px-4 py-2.5 text-sm text-primary-foreground",children:g})},w.id):H.jsxs("div",{className:"flex gap-3",children:[H.jsx("div",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-full bg-primary/10 text-primary",children:H.jsx(wn,{className:"h-4 w-4"})}),H.jsx("div",{className:"prose prose-sm max-w-none flex-1 text-foreground prose-headings:text-deep prose-strong:text-deep prose-a:text-primary",children:H.jsx(my,{children:g||"…"})})]},w.id)}),c==="submitted"&&H.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[H.jsx(Mr,{className:"h-4 w-4 animate-spin text-primary"}),t.loading]}),p&&H.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:t.error})]})}),H.jsxs("form",{className:"mt-4 flex items-end gap-2 rounded-xl border border-border bg-background p-2 shadow-sm focus-within:border-primary/50",onSubmit:w=>{w.preventDefault(),m()},children:[H.jsx("textarea",{ref:o,value:i,onChange:w=>a(w.target.value),onKeyDown:w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),m())},placeholder:t.placeholder,rows:1,className:"flex-1 resize-none bg-transparent px-3 py-2 text-sm text-deep placeholder:text-muted-foreground focus:outline-none",style:{maxHeight:"160px"}}),H.jsx("button",{type:"submit",disabled:!i.trim()||d,className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-primary text-primary-foreground transition hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Send",children:d?H.jsx(Mr,{className:"h-4 w-4 animate-spin"}):H.jsx(is,{className:"h-4 w-4"})})]})]})}export{ky as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.