1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CatalogCheckoutEmbed-BIx3NRxE.js","assets/vendor-query-CyuAx_uY.js","assets/vendor-react-zJ7Ub6x4.js","assets/index-DwZYJ2bC.js","assets/vendor-auth-B8PCyEaA.js","assets/vendor-motion-C5NynTTt.js","assets/index-DTWx_HYt.css","assets/shopping-bag-CiTvLakj.js","assets/BridgeEcocreditPaymentEmbed-qxTy6L-w.js","assets/wallet-C9JZKhtR.js","assets/check-CkLN-gph.js","assets/copy-BTnzPkWO.js","assets/external-link-Da-5Kn8q.js","assets/index-C57OvCUA.js","assets/arrow-right-BsXTLaKD.js","assets/circle-check-BPYym6sA.js","assets/circle-alert-Cgz9bng7.js","assets/refresh-cw-C-gHAkai.js","assets/ComputeFundingBanner-CA_Z8o2X.js","assets/useComputeBalance-Cz9fkVHu.js","assets/AddComputeModal-dsQgaaeB.js","assets/browser-M4-a8ILq.js","assets/dijkstra-COg3n3zL.js"])))=>i.map(i=>d[i]); 2import{Z as J,_ as Cn,n as yl}from"./vendor-auth-B8PCyEaA.js";import{j as C,a as Mn}from"./vendor-query-CyuAx_uY.js";import{g as Ar,r as U,h as bl,L as si}from"./vendor-react-zJ7Ub6x4.js";import{u as xl,b as vl,T as li,L as kl,a as ui}from"./index-DwZYJ2bC.js";import{m as Lt}from"./vendor-motion-C5NynTTt.js";import{S as qo}from"./shield-check-BarCkpGe.js";import{W as Ho,S as Wo}from"./wrench-DMQSkjAK.js";import{L as Jo}from"./leaf-Dt5snyIy.js";import{S as wl}from"./search-DZ0XV9Mm.js";import{C as _l}from"./chart-column-BmJ8fEtE.js";import{T as Sl}from"./trophy-D8JZr5Dv.js";import{C as El}from"./coins-1f2zmdAL.js";import{T as Il}from"./TierBadge-CqCnoBTa.js";import{T as Cl}from"./TierBadgeLink-CB-CLbBe.js";import{i as Tl}from"./ownership-nwGmuorL.js";import{a as Al,M as jn}from"./types-BaZwwxOB.js";import{S as ci}from"./shield-L2lsJT2K.js";import{A as zl}from"./arrow-left-O_5z2nOO.js";import{B as pi}from"./brain-DPpPsU4Y.js";import{Z as Pl}from"./zap-CgsbPiXP.js";import{S as Nl}from"./send-DwHfb8L8.js";import"./tiers-BQfiszb8.js";import"./skills-Bm3Q68yA.js";import"./fees-jvdy2nFi.js";var Go="vercel.ai.error",Ol=Symbol.for(Go),fi,hi,Ve=class Yo extends(hi=Error,fi=Ol,hi){constructor({name:t,message:n,cause:r}){super(n),this[fi]=!0,this.name=t,this.cause=r}static isInstance(t){return Yo.hasMarker(t,Go)}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 Ko(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var Xo="AI_InvalidArgumentError",Qo=`vercel.ai.error.${Xo}`,Rl=Symbol.for(Qo),di,mi,Dl=class extends(mi=Ve,di=Rl,mi){constructor({message:e,cause:t,argument:n}){super({name:Xo,message:e,cause:t}),this[di]=!0,this.argument=n}static isInstance(e){return Ve.hasMarker(e,Qo)}},ea="AI_JSONParseError",ta=`vercel.ai.error.${ea}`,$l=Symbol.for(ta),gi,yi,bi=class extends(yi=Ve,gi=$l,yi){constructor({text:e,cause:t}){super({name:ea,message:`JSON parsing failed: Text: ${e}. 3Error message: ${Ko(t)}`,cause:t}),this[gi]=!0,this.text=e}static isInstance(e){return Ve.hasMarker(e,ta)}},na="AI_TypeValidationError",ra=`vercel.ai.error.${na}`,Ml=Symbol.for(ra),xi,vi,_t=class lr extends(vi=Ve,xi=Ml,vi){constructor({value:t,cause:n,context:r}){let i="Type validation failed";if(r!=null&&r.field&&(i+=` for ${r.field}`),r!=null&&r.entityName||r!=null&&r.entityId){i+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),i+=o.join(", "),i+=")"}super({name:na,message:`${i}: Value: ${JSON.stringify(t)}. 4Error message: ${Ko(n)}`,cause:n}),this[xi]=!0,this.value=t,this.context=r}static isInstance(t){return Ve.hasMarker(t,ra)}static wrap({value:t,cause:n,context:r}){var i,o,a;return lr.isInstance(n)&&n.value===t&&((i=n.context)==null?void 0:i.field)===(r==null?void 0:r.field)&&((o=n.context)==null?void 0:o.entityName)===(r==null?void 0:r.entityName)&&((a=n.context)==null?void 0:a.entityId)===(r==null?void 0:r.entityId)?n:new lr({value:t,cause:n,context:r})}};function S(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 p in a.prototype)p in s||Object.defineProperty(s,p,{value:a.prototype[p].bind(s)});s._zod.constr=a,s._zod.def=u}const i=(n==null?void 0:n.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function a(s){var u;const l=n!=null&&n.Parent?new o:this;r(l,s),(u=l._zod).deferred??(u.deferred=[]);for(const p of l._zod.deferred)p();return l}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>{var u,l;return n!=null&&n.Parent&&s instanceof n.Parent?!0:(l=(u=s==null?void 0:s._zod)==null?void 0:u.traits)==null?void 0:l.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}
vendor: 26,912 bytes, lines 4-29
4class qt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const ia={};function et(e){return ia}function oa(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 jl(e,t){return typeof t=="bigint"?t.toString():t}function zr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Pr(e){return e==null}function Nr(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ll(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}function te(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 Tn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zt(e){return JSON.stringify(e)}const aa=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Fl=zr(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function vn(e){if(xn(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(xn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const Zl=new Set(["string","number","symbol"]);function Qt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pt(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function M(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0: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 Bl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Ul={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 Vl(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 pt(e,{...e._zod.def,shape:n,checks:[]})}function ql(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 pt(e,{...e._zod.def,shape:n,checks:[]})}function Hl(e,t){if(!vn(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 Tn(this,"shape",r),r},checks:[]};return pt(e,n)}function Wl(e,t){return pt(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Tn(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function Jl(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=e?new e({type:"optional",innerType:r[o]}):r[o])}else for(const o in r)i[o]=e?new e({type:"optional",innerType:r[o]}):r[o];return pt(t,{...t._zod.def,shape:i,checks:[]})}function Gl(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new e({type:"nonoptional",innerType:r[o]}))}else for(const o in r)i[o]=new e({type:"nonoptional",innerType:r[o]});return pt(t,{...t._zod.def,shape:i,checks:[]})}function Ft(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function lt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function un(e){return typeof e=="string"?e:e==null?void 0:e.message}function tt(e,t,n){var i,o,a,s,u,l;const r={...e,path:e.path??[]};if(!e.message){const p=un((a=(o=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,e))??un((s=t==null?void 0:t.error)==null?void 0:s.call(t,e))??un((u=n.customError)==null?void 0:u.call(n,e))??un((l=n.localeError)==null?void 0:l.call(n,e))??"Invalid input";r.message=p}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Or(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ht(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const sa=(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,jl,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},la=S("$ZodError",sa),ua=S("$ZodError",sa,{Parent:Error});function Yl(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 Kl(e,t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s}));else if(a.code==="invalid_key")i({issues:a.issues});else if(a.code==="invalid_element")i({issues:a.issues});else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;u<a.path.length;){const l=a.path[u];u===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(a))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return i(e),r}const Xl=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new qt;if(a.issues.length){const s=new((i==null?void 0:i.Err)??e)(a.issues.map(u=>tt(u,o,et())));throw aa(s,i==null?void 0:i.callee),s}return a.value},Ql=e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new((i==null?void 0:i.Err)??e)(a.issues.map(u=>tt(u,o,et())));throw aa(s,i==null?void 0:i.callee),s}return a.value},ca=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new qt;return o.issues.length?{success:!1,error:new(e??la)(o.issues.map(a=>tt(a,i,et())))}:{success:!0,data:o.value}},eu=ca(ua),pa=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>tt(a,i,et())))}:{success:!0,data:o.value}},tu=pa(ua),nu=/^[cC][^\s-]{8,}$/,ru=/^[0-9a-z]+$/,iu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ou=/^[0-9a-vA-V]{20}$/,au=/^[A-Za-z0-9]{27}$/,su=/^[a-zA-Z0-9_-]{21}$/,lu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,uu=/^([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})$/,ki=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)$/,cu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function fu(){return new RegExp(pu,"u")}const hu=/^(?:(?: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])$/,du=/^(([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})$/,mu=/^((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])$/,gu=/^(([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])$/,yu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fa=/^[A-Za-z0-9_-]*$/,bu=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,xu=/^\+(?:[0-9]){6,14}[0-9]$/,ha="(?:(?:\\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])))",vu=new RegExp(`^${ha}$`);function da(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 ku(e){return new RegExp(`^${da(e)}$`)}function wu(e){const t=da({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(`^${ha}T(?:${r})$`)}const _u=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Su=/^\d+$/,Eu=/^-?\d+(?:\.\d+)?/i,Iu=/true|false/i,Cu=/null/i,Tu=/^[^A-Z]*$/,Au=/^[^a-z]*$/,Ie=S("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ma={number:"number",bigint:"bigint",object:"date"},ga=S("$ZodCheckLessThan",(e,t)=>{Ie.init(e,t);const n=ma[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(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})}}),ya=S("$ZodCheckGreaterThan",(e,t)=>{Ie.init(e,t);const n=ma[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(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})}}),zu=S("$ZodCheckMultipleOf",(e,t)=>{Ie.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):Ll(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})}}),Pu=S("$ZodCheckNumberFormat",(e,t)=>{var a;Ie.init(e,t),t.format=t.format||"float64";const n=(a=t.format)==null?void 0:a.includes("int"),r=n?"int":"number",[i,o]=Ul[t.format];e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=t.format,u.minimum=i,u.maximum=o,n&&(u.pattern=Su)}),e._zod.check=s=>{const u=s.value;if(n){if(!Number.isInteger(u)){s.issues.push({expected:r,format:t.format,code:"invalid_type",input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):s.issues.push({input:u,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}}u<i&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>o&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:o,inst:e})}}),Nu=S("$ZodCheckMaxLength",(e,t)=>{var n;Ie.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Pr(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 a=Or(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ou=S("$ZodCheckMinLength",(e,t)=>{var n;Ie.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Pr(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 a=Or(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ru=S("$ZodCheckLengthEquals",(e,t)=>{var n;Ie.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Pr(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,o=i.length;if(o===t.length)return;const a=Or(i),s=o>t.length;r.issues.push({origin:a,...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})}}),An=S("$ZodCheckStringFormat",(e,t)=>{var n,r;Ie.init(e,t),e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.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=()=>{})}),Du=S("$ZodCheckRegex",(e,t)=>{An.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})}}),$u=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Tu),An.init(e,t)}),Mu=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Au),An.init(e,t)}),ju=S("$ZodCheckIncludes",(e,t)=>{Ie.init(e,t);const n=Qt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),Lu=S("$ZodCheckStartsWith",(e,t)=>{Ie.init(e,t);const n=new RegExp(`^${Qt(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})}}),Fu=S("$ZodCheckEndsWith",(e,t)=>{Ie.init(e,t);const n=new RegExp(`.*${Qt(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})}}),Zu=S("$ZodCheckOverwrite",(e,t)=>{Ie.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Bu{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(` 5`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const t=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,i.join(` 6`))}}const Uu={major:4,minor:0,patch:0},se=S("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Uu;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const a of o._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,s,u)=>{let l=Ft(a),p;for(const c of s){if(c._zod.def.when){if(!c._zod.def.when(a))continue}else if(l)continue;const h=a.issues.length,f=c._zod.check(a);if(f instanceof Promise&&(u==null?void 0:u.async)===!1)throw new qt;if(p||f instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await f,a.issues.length!==h&&(l||(l=Ft(a,h)))});else{if(a.issues.length===h)continue;l||(l=Ft(a,h))}}return p?p.then(()=>a):a};e._zod.run=(a,s)=>{const u=e._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new qt;return u.then(l=>o(l,r,s))}return o(u,r,s)}}e["~standard"]={validate:o=>{var a;try{const s=eu(e,o);return s.success?{value:s.data}:{issues:(a=s.error)==null?void 0:a.issues}}catch{return tu(e,o).then(u=>{var l;return u.success?{value:u.data}:{issues:(l=u.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}}),Rr=S("$ZodString",(e,t)=>{var n;se.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??_u(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),pe=S("$ZodStringFormat",(e,t)=>{An.init(e,t),Rr.init(e,t)}),Vu=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=uu),pe.init(e,t)}),qu=S("$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=ki(r))}else t.pattern??(t.pattern=ki());pe.init(e,t)}),Hu=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cu),pe.init(e,t)}),Wu=S("$ZodURL",(e,t)=>{pe.init(e,t),e._zod.check=n=>{try{const r=n.value,i=new URL(r),o=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:bu.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("/")&&o.endsWith("/")?n.value=o.slice(0,-1):n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ju=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=fu()),pe.init(e,t)}),Gu=S("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=su),pe.init(e,t)}),Yu=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nu),pe.init(e,t)}),Ku=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ru),pe.init(e,t)}),Xu=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=iu),pe.init(e,t)}),Qu=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ou),pe.init(e,t)}),ec=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=au),pe.init(e,t)}),tc=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=wu(t)),pe.init(e,t)}),nc=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vu),pe.init(e,t)}),rc=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ku(t)),pe.init(e,t)}),ic=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=lu),pe.init(e,t)}),oc=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hu),pe.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),ac=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=du),pe.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})}}}),sc=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=mu),pe.init(e,t)}),lc=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gu),pe.init(e,t),e._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>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 ba(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const uc=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yu),pe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{ba(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function cc(e){if(!fa.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ba(n)}const pc=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=fa),pe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{cc(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),fc=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=xu),pe.init(e,t)});function hc(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==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const dc=S("$ZodJWT",(e,t)=>{pe.init(e,t),e._zod.check=n=>{hc(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),xa=S("$ZodNumber",(e,t)=>{se.init(e,t),e._zod.pattern=e._zod.bag.pattern??Eu,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 o=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,...o?{received:o}:{}}),n}}),mc=S("$ZodNumber",(e,t)=>{Pu.init(e,t),xa.init(e,t)}),gc=S("$ZodBoolean",(e,t)=>{se.init(e,t),e._zod.pattern=Iu,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}}),yc=S("$ZodNull",(e,t)=>{se.init(e,t),e._zod.pattern=Cu,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}}),bc=S("$ZodUnknown",(e,t)=>{se.init(e,t),e._zod.parse=n=>n}),xc=S("$ZodNever",(e,t)=>{se.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function wi(e,t,n){e.issues.length&&t.issues.push(...lt(n,e.issues)),t.value[n]=e.value}const vc=S("$ZodArray",(e,t)=>{se.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 o=[];for(let a=0;a<i.length;a++){const s=i[a],u=t.element._zod.run({value:s,issues:[]},r);u instanceof Promise?o.push(u.then(l=>wi(l,n,a))):wi(u,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function cn(e,t,n){e.issues.length&&t.issues.push(...lt(n,e.issues)),t.value[n]=e.value}function _i(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(...lt(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const kc=S("$ZodObject",(e,t)=>{se.init(e,t);const n=zr(()=>{const c=Object.keys(t.shape);for(const f of c)if(!(t.shape[f]instanceof se))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const h=Bl(t.shape);return{shape:t.shape,keys:c,keySet:new Set(c),numKeys:c.length,optionalKeys:new Set(h)}});te(e._zod,"propValues",()=>{const c=t.shape,h={};for(const f in c){const g=c[f]._zod;if(g.values){h[f]??(h[f]=new Set);for(const k of g.values)h[f].add(k)}}return h});const r=c=>{const h=new Bu(["shape","payload","ctx"]),f=n.value,g=v=>{const m=zt(v);return`shape[${m}]._zod.run({ value: input[${m}], issues: [] }, ctx)`};h.write("const input = payload.value;");const k=Object.create(null);let b=0;for(const v of f.keys)k[v]=`key_${b++}`;h.write("const newResult = {}");for(const v of f.keys)if(f.optionalKeys.has(v)){const m=k[v];h.write(`const ${m} = ${g(v)};`);const I=zt(v);h.write(` 7 if (${m}.issues.length) { 8 if (input[${I}] === undefined) { 9 if (${I} in input) { 10 newResult[${I}] = undefined; 11 } 12 } else { 13 payload.issues = payload.issues.concat( 14 ${m}.issues.map((iss) => ({ 15 ...iss, 16 path: iss.path ? [${I}, ...iss.path] : [${I}], 17 })) 18 ); 19 } 20 } else if (${m}.value === undefined) { 21 if (${I} in input) newResult[${I}] = undefined; 22 } else { 23 newResult[${I}] = ${m}.value; 24 } 25 `)}else{const m=k[v];h.write(`const ${m} = ${g(v)};`),h.write(` 26 if (${m}.issues.length) payload.issues = payload.issues.concat(${m}.issues.map(iss => ({ 27 ...iss, 28 path: iss.path ? [${zt(v)}, ...iss.path] : [${zt(v)}] 29 })));`),h.write(`newResult[${zt(v)}] = ${m}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");const d=h.compile();return(v,m)=>d(c,v,m)};let i;const o=xn,a=!ia.jitless,u=a&&Fl.value,l=t.catchall;let p;e._zod.parse=(c,h)=>{p??(p=n.value);const f=c.value;if(!o(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;const g=[];if(a&&u&&(h==null?void 0:h.async)===!1&&h.jitless!==!0)i||(i=r(t.shape)),c=i(c,h);else{c.value={};const m=p.shape;for(const I of p.keys){const A=m[I],w=A._zod.run({value:f[I],issues:[]},h),z=A._zod.optin==="optional"&&A._zod.optout==="optional";w instanceof Promise?g.push(w.then(j=>z?_i(j,c,I,f):cn(j,c,I))):z?_i(w,c,I,f):cn(w,c,I)}}if(!l)return g.length?Promise.all(g).then(()=>c):c;const k=[],b=p.keySet,d=l._zod,v=d.def.type;for(const m of Object.keys(f)){if(b.has(m))continue;if(v==="never"){k.push(m);continue}const I=d.run({value:f[m],issues:[]},h);I instanceof Promise?g.push(I.then(A=>cn(A,c,m))):cn(I,c,m)}return k.length&&c.issues.push({code:"unrecognized_keys",keys:k,input:f,inst:e}),g.length?Promise.all(g).then(()=>c):c}});function Si(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(o=>tt(o,r,et())))}),t}const va=S("$ZodUnion",(e,t)=>{se.init(e,t),te(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),te(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),te(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),te(e._zod,"pattern",()=>{if(t.options.every(n=>
29n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Nr(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let i=!1;const o=[];for(const a of t.options){const s=a._zod.run({value:n.value,issues:[]},r);if(s instanceof Promise)o.push(s),i=!0;else{if(s.issues.length===0)return s;o.push(s)}}return i?Promise.all(o).then(a=>Si(a,n,e,r)):Si(o,n,e,r)}}),wc=S("$ZodDiscriminatedUnion",(e,t)=>{va.init(e,t);const n=e._zod.parse;te(e._zod,"propValues",()=>{const i={};for(const o of t.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[s,u]of Object.entries(a)){i[s]||(i[s]=new Set);for(const l of u)i[s].add(l)}}return i});const r=zr(()=>{const i=t.options,o=new Map;for(const a of i){const s=a._zod.propValues[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const u of s){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,a)}}return o});e._zod.parse=(i,o)=>{const a=i.value;if(!xn(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;const s=r.value.get(a==null?void 0:a[t.discriminator]);return s?s._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[t.discriminator],inst:e}),i)}}),_c=S("$ZodIntersection",(e,t)=>{se.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,o=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([u,l])=>Ei(n,u,l)):Ei(n,o,a)}});function ur(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(vn(e)&&vn(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};for(const o of r){const a=ur(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.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],o=t[r],a=ur(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ei(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ft(e))return e;const r=ur(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 Sc=S("$ZodRecord",(e,t)=>{se.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!vn(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;n.value={};for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const l=t.valueType._zod.run({value:i[u],issues:[]},r);l instanceof Promise?o.push(l.then(p=>{p.issues.length&&n.issues.push(...lt(u,p.issues)),n.value[u]=p.value})):(l.issues.length&&n.issues.push(...lt(u,l.issues)),n.value[u]=l.value)}let s;for(const u in i)a.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 a of Reflect.ownKeys(i)){if(a==="__proto__")continue;const s=t.keyType._zod.run({value:a,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=>tt(l,r,et())),input:a,path:[a],inst:e}),n.value[s.value]=s.value;continue}const u=t.valueType._zod.run({value:i[a],issues:[]},r);u instanceof Promise?o.push(u.then(l=>{l.issues.length&&n.issues.push(...lt(a,l.issues)),n.value[s.value]=l.value})):(u.issues.length&&n.issues.push(...lt(a,u.issues)),n.value[s.value]=u.value)}}return o.length?Promise.all(o).then(()=>n):n}}),Ec=S("$ZodEnum",(e,t)=>{se.init(e,t);const n=oa(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>Zl.has(typeof r)).map(r=>typeof r=="string"?Qt(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:n,input:o,inst:e}),r}}),Ic=S("$ZodLiteral",(e,t)=>{se.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Qt(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}}),Cc=S("$ZodTransform",(e,t)=>{se.init(e,t),e._zod.parse=(n,r)=>
vendor: 5,667 bytes, line 29
29{const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(n.value=a,n));if(i instanceof Promise)throw new qt;return n.value=i,n}}),Tc=S("$ZodOptional",(e,t)=>{se.init(e,t),e._zod.optin="optional",e._zod.optout="optional",te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),te(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Nr(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)}),Ac=S("$ZodNullable",(e,t)=>{se.init(e,t),te(e._zod,"optin",()=>t.innerType._zod.optin),te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Nr(n.source)}|null)$`):void 0}),te(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)}),zc=S("$ZodDefault",(e,t)=>{se.init(e,t),e._zod.optin="optional",te(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(o=>Ii(o,t)):Ii(i,t)}});function Ii(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Pc=S("$ZodPrefault",(e,t)=>{se.init(e,t),e._zod.optin="optional",te(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))}),Nc=S("$ZodNonOptional",(e,t)=>{se.init(e,t),te(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(o=>Ci(o,e)):Ci(i,e)}});function Ci(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 Oc=S("$ZodCatch",(e,t)=>{se.init(e,t),e._zod.optin="optional",te(e._zod,"optout",()=>t.innerType._zod.optout),te(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(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(a=>tt(a,r,et()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>tt(o,r,et()))},input:n.value}),n.issues=[]),n)}}),Rc=S("$ZodPipe",(e,t)=>{se.init(e,t),te(e._zod,"values",()=>t.in._zod.values),te(e._zod,"optin",()=>t.in._zod.optin),te(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(o=>Ti(o,t,r)):Ti(i,t,r)}});function Ti(e,t,n){return Ft(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const Dc=S("$ZodReadonly",(e,t)=>{se.init(e,t),te(e._zod,"propValues",()=>t.innerType._zod.propValues),te(e._zod,"values",()=>t.innerType._zod.values),te(e._zod,"optin",()=>t.innerType._zod.optin),te(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(Ai):Ai(i)}});function Ai(e){return e.value=Object.freeze(e.value),e}const $c=S("$ZodLazy",(e,t)=>{se.init(e,t),te(e._zod,"innerType",()=>t.getter()),te(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),te(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),te(e._zod,"optin",()=>e._zod.innerType._zod.optin),te(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),Mc=S("$ZodCustom",(e,t)=>{Ie.init(e,t),se.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(o=>zi(o,n,r,e));zi(i,n,r,e)}});function zi(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(Ht(i))}}class ka{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 jc(){return new ka}const Dt=jc();function Lc(e,t){return new e({type:"string",...M(t)})}function Fc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...M(t)})}function Pi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...M(t)})}function Zc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...M(t)})}function Bc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...M(t)})}function Uc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...M(t)})}function Vc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...M(t)})}function qc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...M(t)})}function Hc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...M(t)})}function Wc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...M(t)})}
29function Jc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...M(t)})}function Gc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...M(t)})}function Yc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...M(t)})}function Kc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...M(t)})}function Xc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...M(t)})}function Qc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...M(t)})}function ep(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...M(t)})}function tp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...M(t)})}function np(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...M(t)})}function rp(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...M(t)})}function ip(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...M(t)})}function op(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...M(t)})}function ap(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...M(t)})}function sp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...M(t)})}function lp(e,t){return new e({type:"string",format:"date",check:"string_format",...M(t)})}function up(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...M(t)})}function cp(e,t){return new e({type:"string",format:"duration",check:"string_format",...M(t)})}function pp(e,t){return new e({type:"number",checks:[],...M(t)})}function fp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...M(t)})}function hp(e,t){return new e({type:"boolean",...M(t)})}function dp(e,t){return new e({type:"null",...M(t)})}function mp(e){return new e({type:"unknown"})}function gp(e,t){return new e({type:"never",...M(t)})}function Ni(e,t){return new ga({check:"less_than",...M(t),value:e,inclusive:!1})}function Ln(e,t){return new ga({check:"less_than",...M(t),value:e,inclusive:!0})}function Oi(e,t){return new ya({check:"greater_than",...M(t),value:e,inclusive:!1})}function Fn(e,t){return new ya({check:"greater_than",...M(t),value:e,inclusive:!0})}function Ri(e,t){return new zu({check:"multiple_of",...M(t),value:e})}function wa(e,t){return new Nu({check:"max_length",...M(t),maximum:e})}function kn(e,t){return new Ou({check:"min_length",...M(t),minimum:e})}function _a(e,t){return new Ru({check:"length_equals",...M(t),length:e})}function yp(e,t){return new Du({check:"string_format",format:"regex",...M(t),pattern:e})}function bp(e){return new $u({check:"string_format",format:"lowercase",...M(e)})}function xp(e){return new Mu({check:"string_format",format:"uppercase",...M(e)})}function vp(e,t){return new ju({check:"string_format",format:"includes",...M(t),includes:e})}function kp(e,t){return new Lu({check:"string_format",format:"starts_with",...M(t),prefix:e})}function wp(e,t){return new Fu({check:"string_format",format:"ends_with",...M(t),suffix:e})}function en(e){return new Zu({check:"overwrite",tx:e})}function _p(e){return en(t=>t.normalize(e))}function Sp(){return en(e=>e.trim())}function Ep(){return en(e=>e.toLowerCase())}function Ip(){return en(e=>e.toUpperCase())}function Cp(e,t,n){return new e({type:"array",element:t,...M(n)})}function Tp(e,t,n){const r=M(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Ap(e,t,n){return new e({type:"custom",check:"custom",fn:t,...M(n)})}class Di{constructor(t){this.counter=0,this.metadataRegistry=(t==null?void 0:t.metadata)??Dt,this.target=(t==null?void 0:t.target)??"draft-2020-12",this.unrepresentable=(t==null?void 0:t.unrepresentable)??"throw",this.override=(t==null?void 0:t.override)??(()=>{}),this.io=(t==null?void 0:t.io)??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var c,h,f;var r;const i=t._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(t);if(a)return a.count++,n.schemaPath.includes(t)&&(a.cycle=n.path),a.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,s);const u=(h=(c=t._zod).toJSONSchema)==null?void 0:h.call(c);if(u)s.schema=u;else{const g={...n,schemaPath:[...n.schemaPath,t],path:n.path},k=t._zod.parent;if(k)s.ref=k,this.process(k,g),this.seen.get(k).isParent=!0;else{const b=s.schema;switch(i.type){case"string":{const d=b;d.type="string";const{minimum:v,maximum:m,format:I,patterns:A,contentEncoding:w}=t._zod.bag;if(typeof v=="number"&&(d.minLength=v),typeof m=="number"&&(d.maxLength=m),I&&(
29d.format=o[I]??I,d.format===""&&delete d.format),w&&(d.contentEncoding=w),A&&A.size>0){const z=[...A];z.length===1?d.pattern=z[0].source:z.length>1&&(s.schema.allOf=[...z.map(j=>({...this.target==="draft-7"?{type:"string"}:{},pattern:j.source}))])}break}case"number":{const d=b,{minimum:v,maximum:m,format:I,multipleOf:A,exclusiveMaximum:w,exclusiveMinimum:z}=t._zod.bag;typeof I=="string"&&I.includes("int")?d.type="integer":d.type="number",typeof z=="number"&&(d.exclusiveMinimum=z),typeof v=="number"&&(d.minimum=v,typeof z=="number"&&(z>=v?delete d.minimum:delete d.exclusiveMinimum)),typeof w=="number"&&(d.exclusiveMaximum=w),typeof m=="number"&&(d.maximum=m,typeof w=="number"&&(w<=m?delete d.maximum:delete d.exclusiveMaximum)),typeof A=="number"&&(d.multipleOf=A);break}case"boolean":{const d=b;d.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":{b.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":{b.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const d=b,{minimum:v,maximum:m}=t._zod.bag;typeof v=="number"&&(d.minItems=v),typeof m=="number"&&(d.maxItems=m),d.type="array",d.items=this.process(i.element,{...g,path:[...g.path,"items"]});break}case"object":{const d=b;d.type="object",d.properties={};const v=i.shape;for(const A in v)d.properties[A]=this.process(v[A],{...g,path:[...g.path,"properties",A]});const m=new Set(Object.keys(v)),I=new Set([...m].filter(A=>{const w=i.shape[A]._zod;return this.io==="input"?w.optin===void 0:w.optout===void 0}));I.size>0&&(d.required=Array.from(I)),((f=i.catchall)==null?void 0:f._zod.def.type)==="never"?d.additionalProperties=!1:i.catchall?i.catchall&&(d.additionalProperties=this.process(i.catchall,{...g,path:[...g.path,"additionalProperties"]})):this.io==="output"&&(d.additionalProperties=!1);break}case"union":{const d=b;d.anyOf=i.options.map((v,m)=>this.process(v,{...g,path:[...g.path,"anyOf",m]}));break}case"intersection":{const d=b,v=this.process(i.left,{...g,path:[...g.path,"allOf",0]}),m=this.process(i.right,{...g,path:[...g.path,"allOf",1]}),I=w=>"allOf"in w&&Object.keys(w).length===1,A=[...I(v)?v.allOf:[v],...I(m)?m.allOf:[m]];d.allOf=A;break}case"tuple":{const d=b;d.type="array";const v=i.items.map((A,w)=>this.process(A,{...g,path:[...g.path,"prefixItems",w]}));if(this.target==="draft-2020-12"?d.prefixItems=v:d.items=v,i.rest){const A=this.process(i.rest,{...g,path:[...g.path,"items"]});this.target==="draft-2020-12"?d.items=A:d.additionalItems=A}i.rest&&(d.items=this.process(i.rest,{...g,path:[...g.path,"items"]}));const{minimum:m,maximum:I}=t._zod.bag;typeof m=="number"&&(d.minItems=m),typeof I=="number"&&(d.maxItems=I);break}case"record":{const d=b;d.type="object",d.propertyNames=this.process(i.keyType,{...g,path:[...g.path,"propertyNames"]}),d.additionalProperties=this.process(i.valueType,{...g,path:[...g.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 d=b,v=oa(i.entries);v.every(m=>typeof m=="number")&&(d.type="number"),v.every(m=>typeof m=="string")&&(d.type="string"),d.enum=v;break}case"literal":{const d=b,v=[];for(const m of i.values)if(m===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof m=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");v.push(Number(m))}else v.push(m);if(v.length!==0)if(v.length===1){const m=v[0];d.type=m===null?"null":typeof m,d.const=m}else v.every(m=>typeof m=="number")&&(d.type="number"),v.every(m=>typeof m=="string")&&(d.type="string"),v.every(m=>
29typeof m=="boolean")&&(d.type="string"),v.every(m=>m===null)&&(d.type="null"),d.enum=v;break}case"file":{const d=b,v={type:"string",format:"binary",contentEncoding:"binary"},{minimum:m,maximum:I,mime:A}=t._zod.bag;m!==void 0&&(v.minLength=m),I!==void 0&&(v.maxLength=I),A?A.length===1?(v.contentMediaType=A[0],Object.assign(d,v)):d.anyOf=A.map(w=>({...v,contentMediaType:w})):Object.assign(d,v);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const d=this.process(i.innerType,g);b.anyOf=[d,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,g),s.ref=i.innerType;break}case"success":{const d=b;d.type="boolean";break}case"default":{this.process(i.innerType,g),s.ref=i.innerType,b.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,g),s.ref=i.innerType,this.io==="input"&&(b._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,g),s.ref=i.innerType;let d;try{d=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}b.default=d;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const d=b,v=t._zod.pattern;if(!v)throw new Error("Pattern not found in template literal");d.type="string",d.pattern=v.source;break}case"pipe":{const d=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(d,g),s.ref=d;break}case"readonly":{this.process(i.innerType,g),s.ref=i.innerType,b.readOnly=!0;break}case"promise":{this.process(i.innerType,g),s.ref=i.innerType;break}case"optional":{this.process(i.innerType,g),s.ref=i.innerType;break}case"lazy":{const d=t._zod.innerType;this.process(d,g),s.ref=d;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"&&ge(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){var p,c,h,f,g,k;const r={cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0},i=this.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=b=>{var A;const d=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const w=(A=r.external.registry.get(b[0]))==null?void 0:A.id,z=r.external.uri??(q=>q);if(w)return{ref:z(w)};const j=b[1].defId??b[1].schema.id??`schema${this.counter++}`;return b[1].defId=j,{defId:j,ref:`${z("__shared")}#/${d}/${j}`}}if(b[1]===i)return{ref:"#"};const m=`#/${d}/`,I=b[1].schema.id??`__schema${this.counter++}`;return{defId:I,ref:m+I}},a=b=>{if(b[1].schema.$ref)return;const d=b[1],{ref:v,defId:m}=o(b);d.def={...d.schema},m&&(d.defId=m);const I=d.schema;for(const A in I)delete I[A];I.$ref=v};if(r.cycles==="throw")for(const b of this.seen.entries()){const d=b[1];if(d.cycle)throw new Error(`Cycle detected: #/${(p=d.cycle)==null?void 0:p.join("/")}/<root> 30 31Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const b of this.seen.entries()){const d=b[1];if(t===b[0]){a(b);continue}if(r.external){const m=(c=r.external.registry.get(b[0]))==null?void 0:c.id;if(t!==b[0]&&m){a(b);continue}}if((h=this.metadataRegistry.get(b[0]))==null?void 0:h.id){a(b);continue}if(d.cycle){a(b);continue}if(d.count>1&&r.reused==="ref"){a(b);continue}}const s=(b,d)=>{const v=this.seen.get(b),m=v.def??v.schema,I={...m};if(v.ref===null)return;const A=v.ref;if(v.ref=null,A){s(A,d);const w=this.seen.get(A).schema;w.$ref&&d.target==="draft-7"?(m.allOf=m.allOf??[],m.allOf.push(w)):(Object.assign(m,w),Object.assign(m,I))}v.isParent||this.override({zodSchema:b,jsonSchema:m,path:v.path??[]})};for(const b of[...this.seen.entries()].reverse())s(b[0],{target:this.target});const u={};
31if(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}`),(f=r.external)!=null&&f.uri){const b=(g=r.external.registry.get(t))==null?void 0:g.id;if(!b)throw new Error("Schema is missing an `id` property");u.$id=r.external.uri(b)}Object.assign(u,i.def);const l=((k=r.external)==null?void 0:k.defs)??{};for(const b of this.seen.entries()){const d=b[1];d.def&&d.defId&&(l[d.defId]=d.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 zp(e,t){if(e instanceof ka){const r=new Di(t),i={};for(const s of e._idmap.entries()){const[u,l]=s;r.process(l)}const o={},a={registry:e,uri:t==null?void 0:t.uri,defs:i};for(const s of e._idmap.entries()){const[u,l]=s;o[u]=r.emit(l,{...t,external:a})}if(Object.keys(i).length>0){const s=r.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[s]:i}}return{schemas:o}}const n=new Di(t);return n.process(e),n.emit(e,t)}function ge(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 ge(i.element,n);case"object":{for(const o in i.shape)if(ge(i.shape[o],n))return!0;return!1}case"union":{for(const o of i.options)if(ge(o,n))return!0;return!1}case"intersection":return ge(i.left,n)||ge(i.right,n);case"tuple":{for(const o of i.items)if(ge(o,n))return!0;return!!(i.rest&&ge(i.rest,n))}case"record":return ge(i.keyType,n)||ge(i.valueType,n);case"map":return ge(i.keyType,n)||ge(i.valueType,n);case"set":return ge(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return ge(i.innerType,n);case"lazy":return ge(i.getter(),n);case"default":return ge(i.innerType,n);case"prefault":return ge(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return ge(i.in,n)||ge(i.out,n);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const Pp=S("ZodISODateTime",(e,t)=>{tc.init(e,t),he.init(e,t)});function Np(e){return sp(Pp,e)}const Op=S("ZodISODate",(e,t)=>{nc.init(e,t),he.init(e,t)});function Rp(e){return lp(Op,e)}const Dp=S("ZodISOTime",(e,t)=>{rc.init(e,t),he.init(e,t)});function $p(e){return up(Dp,e)}const Mp=S("ZodISODuration",(e,t)=>{ic.init(e,t),he.init(e,t)});function jp(e){return cp(Mp,e)}const Lp=(e,t)=>{la.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Kl(e,n)},flatten:{value:n=>Yl(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},zn=S("ZodError",Lp,{Parent:Error}),Fp=Xl(zn),Zp=Ql(zn),Bp=ca(zn),Sa=pa(zn),fe=S("ZodType",(e,t)=>(se.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)=>pt(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Fp(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Bp(e,n,r),e.parseAsync=async(n,r)=>Zp(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Sa(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(jf(n,r)),e.superRefine=n=>e.check(Lf(n)),e.overwrite=n=>e.check(en(n)),e.optional=()=>ji(e),e.nullable=()=>Li(e),e.nullish=()=>ji(Li(e)),e.nonoptional=n=>Af(e,n),e.array=()=>Et(e),e.or=n=>_e([e,n]),e.and=n=>xf(e,n),e.transform=n=>Fi(e,_f(n)),e.default=n=>If(e,n),e.prefault=n=>Tf(e,n),e.catch=n=>Pf(e,n),e.pipe=n=>Fi(e,n),e.readonly=()=>Rf(e),e.describe=n=>{const r=e.clone();return Dt.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=Dt.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Dt.get(e);const r=e.clone();return Dt.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ea=S("_ZodString",(e,t)=>{Rr.init(e,t),fe.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(yp(...r)),e.includes=(...r)=>e.check(vp(...r)),e.startsWith=(...r)=>e.check(kp(...r)),e.endsWith=(...r)=>e.check(wp(...r)),e.min=(...r)=>e.check(kn(...r)),e.max=(...r)=>e.check(wa(...r)),e.length=(...r)=>e.check(_a(...r)),e.nonempty=(...r)=>e.check(kn(1,...r)),e.lowercase=r=>e.check(bp(r)),e.uppercase=r=>e.check(xp(r)),e.trim=()=>e.check(Sp()),e.normalize=(...r)=>e.check(_p(...r)),e.toLowerCase=()=>e.check(Ep()),e.toUpperCase=()=>e.check(Ip())}),Up=S("ZodString",(e,t)=>{Rr.init(e,t),Ea.init(e,t),e.email=n=>e.check(Fc(Vp,n)),e.url=n=>e.check(qc(qp,n)),e.jwt=n=>e.check(ap(sf,n)),e.emoji=n=>e.check(Hc(Hp,n)),e.guid=n=>e.check(Pi($i,n)),e.uuid=n=>e.check(Zc(pn,n)),e.uuidv4=n=>e.check(Bc(pn,n)),e.uuidv6=n=>e.check(Uc(pn,n)),e.uuidv7=n=>e.check(Vc(pn,n)),e.nanoid=n=>e.check(Wc(Wp,n)),e.guid=n=>e.check(Pi($i,n)),e.cuid=n=>e.check(Jc(Jp,n)),e.cuid2=n=>e.check(Gc(Gp,n)),e.ulid=n=>e.check(Yc(Yp,n)),e.base64=n=>e.check(rp(rf,n)),e.base64url=n=>e.check(ip(of,n)),e.xid=n=>e.check(Kc(Kp,n)),e.ksuid=n=>e.check(Xc(Xp,n)),e.ipv4=n=>e.check(Qc(Qp,n)),e.ipv6=n=>e.check(ep(ef,n)),e.cidrv4=n=>e.check(tp(tf,n)),e.cidrv6=n=>e.check(np(nf,n)),e.e164=n=>e.check(op(af,n)),e.datetime=n=>e.check(Np(n)),e.date=n=>e.check(Rp(n)),e.time=n=>e.check($p(n)),e.duration=n=>
vendor: 4,841 bytes, line 31
31e.check(jp(n))});function O(e){return Lc(Up,e)}const he=S("ZodStringFormat",(e,t)=>{pe.init(e,t),Ea.init(e,t)}),Vp=S("ZodEmail",(e,t)=>{Hu.init(e,t),he.init(e,t)}),$i=S("ZodGUID",(e,t)=>{Vu.init(e,t),he.init(e,t)}),pn=S("ZodUUID",(e,t)=>{qu.init(e,t),he.init(e,t)}),qp=S("ZodURL",(e,t)=>{Wu.init(e,t),he.init(e,t)}),Hp=S("ZodEmoji",(e,t)=>{Ju.init(e,t),he.init(e,t)}),Wp=S("ZodNanoID",(e,t)=>{Gu.init(e,t),he.init(e,t)}),Jp=S("ZodCUID",(e,t)=>{Yu.init(e,t),he.init(e,t)}),Gp=S("ZodCUID2",(e,t)=>{Ku.init(e,t),he.init(e,t)}),Yp=S("ZodULID",(e,t)=>{Xu.init(e,t),he.init(e,t)}),Kp=S("ZodXID",(e,t)=>{Qu.init(e,t),he.init(e,t)}),Xp=S("ZodKSUID",(e,t)=>{ec.init(e,t),he.init(e,t)}),Qp=S("ZodIPv4",(e,t)=>{oc.init(e,t),he.init(e,t)}),ef=S("ZodIPv6",(e,t)=>{ac.init(e,t),he.init(e,t)}),tf=S("ZodCIDRv4",(e,t)=>{sc.init(e,t),he.init(e,t)}),nf=S("ZodCIDRv6",(e,t)=>{lc.init(e,t),he.init(e,t)}),rf=S("ZodBase64",(e,t)=>{uc.init(e,t),he.init(e,t)}),of=S("ZodBase64URL",(e,t)=>{pc.init(e,t),he.init(e,t)}),af=S("ZodE164",(e,t)=>{fc.init(e,t),he.init(e,t)}),sf=S("ZodJWT",(e,t)=>{dc.init(e,t),he.init(e,t)}),Ia=S("ZodNumber",(e,t)=>{xa.init(e,t),fe.init(e,t),e.gt=(r,i)=>e.check(Oi(r,i)),e.gte=(r,i)=>e.check(Fn(r,i)),e.min=(r,i)=>e.check(Fn(r,i)),e.lt=(r,i)=>e.check(Ni(r,i)),e.lte=(r,i)=>e.check(Ln(r,i)),e.max=(r,i)=>e.check(Ln(r,i)),e.int=r=>e.check(Mi(r)),e.safe=r=>e.check(Mi(r)),e.positive=r=>e.check(Oi(0,r)),e.nonnegative=r=>e.check(Fn(0,r)),e.negative=r=>e.check(Ni(0,r)),e.nonpositive=r=>e.check(Ln(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 lf(e){return pp(Ia,e)}const uf=S("ZodNumberFormat",(e,t)=>{mc.init(e,t),Ia.init(e,t)});function Mi(e){return fp(uf,e)}const cf=S("ZodBoolean",(e,t)=>{gc.init(e,t),fe.init(e,t)});function ke(e){return hp(cf,e)}const pf=S("ZodNull",(e,t)=>{yc.init(e,t),fe.init(e,t)});function ff(e){return dp(pf,e)}const hf=S("ZodUnknown",(e,t)=>{bc.init(e,t),fe.init(e,t)});function Ue(){return mp(hf)}const df=S("ZodNever",(e,t)=>{xc.init(e,t),fe.init(e,t)});function Ca(e){return gp(df,e)}const mf=S("ZodArray",(e,t)=>{vc.init(e,t),fe.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(kn(n,r)),e.nonempty=n=>e.check(kn(1,n)),e.max=(n,r)=>e.check(wa(n,r)),e.length=(n,r)=>e.check(_a(n,r)),e.unwrap=()=>e.element});function Et(e,t){return Cp(mf,e,t)}const Ta=S("ZodObject",(e,t)=>{kc.init(e,t),fe.init(e,t),te(e,"shape",()=>t.shape),e.keyof=()=>za(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ue()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ue()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ca()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Hl(e,n),e.merge=n=>Wl(e,n),e.pick=n=>Vl(e,n),e.omit=n=>ql(e,n),e.partial=(...n)=>Jl(Pa,e,n[0]),e.required=(...n)=>Gl(Na,e,n[0])});function ie(e,t){const n={type:"object",get shape(){return Tn(this,"shape",{...e}),this.shape},...M(t)};return new Ta(n)}function ue(e,t){return new Ta({type:"object",get shape(){return Tn(this,"shape",{...e}),this.shape},catchall:Ca(),...M(t)})}const Aa=S("ZodUnion",(e,t)=>{va.init(e,t),fe.init(e,t),e.options=t.options});function _e(e,t){return new Aa({type:"union",options:e,...M(t)})}const gf=S("ZodDiscriminatedUnion",(e,t)=>{Aa.init(e,t),wc.init(e,t)});function yf(e,t,n){return new gf({type:"union",options:t,discriminator:e,...M(n)})}const bf=S("ZodIntersection",(e,t)=>{_c.init(e,t),fe.init(e,t)});function xf(e,t){return new bf({type:"intersection",left:e,right:t})}const vf=S("ZodRecord",(e,t)=>{Sc.init(e,t),fe.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Wt(e,t,n){return new vf({type:"record",keyType:e,valueType:t,...M(n)})}const cr=S("ZodEnum",(e,t)=>{Ec.init(e,t),fe.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 o={};for(const a of r)if(n.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new cr({...t,checks:[],...M(i),entries:o})},e.exclude=(r,i)=>{const o={...t.entries};for(const a of r)if(n.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new cr({...t,checks:[],...M(i),entries:o})}});function za(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new cr({type:"enum",entries:n,...M(t)})}const kf=S("ZodLiteral",(e,t)=>{Ic.init(e,t),fe.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if
31(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function B(e,t){return new kf({type:"literal",values:Array.isArray(e)?e:[e],...M(t)})}const wf=S("ZodTransform",(e,t)=>{Cc.init(e,t),fe.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=o=>{if(typeof o=="string")n.issues.push(Ht(o,n.value,t));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),a.continue??(a.continue=!0),n.issues.push(Ht(a))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function _f(e){return new wf({type:"transform",transform:e})}const Pa=S("ZodOptional",(e,t)=>{Tc.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ji(e){return new Pa({type:"optional",innerType:e})}const Sf=S("ZodNullable",(e,t)=>{Ac.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Li(e){return new Sf({type:"nullable",innerType:e})}const Ef=S("ZodDefault",(e,t)=>{zc.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function If(e,t){return new Ef({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Cf=S("ZodPrefault",(e,t)=>{Pc.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Tf(e,t){return new Cf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Na=S("ZodNonOptional",(e,t)=>{Nc.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Af(e,t){return new Na({type:"nonoptional",innerType:e,...M(t)})}const zf=S("ZodCatch",(e,t)=>{Oc.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Pf(e,t){return new zf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Nf=S("ZodPipe",(e,t)=>{Rc.init(e,t),fe.init(e,t),e.in=t.in,e.out=t.out});function Fi(e,t){return new Nf({type:"pipe",in:e,out:t})}const Of=S("ZodReadonly",(e,t)=>{Dc.init(e,t),fe.init(e,t)});function Rf(e){return new Of({type:"readonly",innerType:e})}const Df=S("ZodLazy",(e,t)=>{$c.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.getter()});function $f(e){return new Df({type:"lazy",getter:e})}const Dr=S("ZodCustom",(e,t)=>{Mc.init(e,t),fe.init(e,t)});function Mf(e){const t=new Ie({check:"custom"});return t._zod.check=e,t}function Oa(e,t){return Tp(Dr,e??(()=>!0),t)}function jf(e,t={}){return Ap(Dr,e,t)}function Lf(e){const t=Mf(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Ht(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(Ht(i))}},e(n.value,n)));return t}function wn(e,t={error:`Input not instance of ${e.name}`}){const n=new Dr({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...M(t)});return n._zod.bag.Class=e,n}class Zi 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}}function Zn(e){}function Ff(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=Zn,onError:n=Zn,onRetry:r=Zn,onComment:i}=e;let o="",a=!0,s,u="",l="";function p(k){const b=a?k.replace(/^\xEF\xBB\xBF/,""):k,[d,v]=Zf(`${o}${b}`);for(const m of d)c(m);o=v,a=!1}function c(k){if(k===""){f();return}if(k.startsWith(":")){i&&i(k.slice(k.startsWith(": ")?2:1));return}const b=k.indexOf(":");if(b!==-1){const d=k.slice(0,b),v=k[b+1]===" "?2:1,m=k.slice(b+v);h(d,m,k);return}h(k,"",k)}function h(k,b,d){switch(k){case"event":l=b;break;case"data":u=`${u}${b} 32`;break;case"id":s=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?r(parseInt(b,10)):n(new Zi(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:d}));break;default:n(new Zi(`Unknown field "${k.length>20?`${k.slice(0,20)}â¦`:k}"`,{type:"unknown-field",field:k,value:b,line:d}));break}}function f(){u.length>0&&t({id:s,event:l||void 0,data:u.endsWith(` 33`)?u.slice(0,-1):u}),s=void 0,u="",l=""}function g(k={}){o&&k.consume&&c(o),a=!0,s=void 0,u="",l="",o=""}return{feed:p,reset:g}}function Zf(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(` 34`,r);let a=-1;if(i!==-1&&o!==-1?a=Math.min(i,o):i!==-1?i===e.length-1?a=-1:a=i:o!==-1&&(a=o),a===-1){n=e.slice(r);break}else{const s=e.slice(r,a);t.push(s),r=a+1,e[r-1]==="\r"&&e[r]===` 35`&&r++}}return[t,n]}class Bf extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let i;
35super({start(o){i=Ff({onEvent:a=>{o.enqueue(a)},onError(a){t==="terminate"?o.error(a):typeof t=="function"&&t(a)},onRetry:n,onComment:r})},transform(o){i.feed(o)}})}}var tn=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const o=n.length,a=new Array(t);for(let s=0;s<t;s++)a[s]=n[Math.random()*o|0];return a.join("")};if(e==null)return i;if(n.includes(r))throw new Dl({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},Uf=tn();function Bi(e=globalThis){var t,n,r;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(r=(n=e.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function st(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}function Ui(e,...t){const n=new Headers(st(e)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Vf=/"__proto__"\s*:/,qf=/"constructor"\s*:/;function Vi(e){const t=JSON.parse(e);return t===null||typeof t!="object"||Vf.test(e)===!1&&qf.test(e)===!1?t:Hf(t)}function Hf(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")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const o=r[i];o&&typeof o=="object"&&t.push(o)}}}return e}function Wf(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return Vi(e)}try{return Vi(e)}finally{Error.stackTraceLimit=t}}function $r(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]=it(n[r])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(it):it(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(it)),e.allOf!=null&&(e.allOf=e.allOf.map(it)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(it));const{definitions:t}=e;if(t!=null)for(const n of Object.keys(t))t[n]=it(t[n]);return e}function it(e){return typeof e=="boolean"?e:$r(e)}var Jf=Symbol("Let zodToJsonSchema decide on which parser to use"),qi={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"},Gf=e=>typeof e=="string"?{...qi,name:e}:{...qi,...e};function Oe(){return{}}function Yf(e,t){var n,r,i;const o={type:"array"};return(n=e.type)!=null&&n._def&&((i=(r=e.type)==null?void 0:r._def)==null?void 0:i.typeName)!==J.ZodAny&&(o.items=ne(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function Kf(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 Xf(){return{type:"boolean"}}function Ra(e,t){return ne(e.type._def,t)}var Qf=(e,t)=>ne(e.innerType._def,t);function Da(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,o)=>Da(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 eh(e)}}var eh=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 th(e,t){return{...ne(e.innerType._def,t),default:e.defaultValue()}}function nh(e,t){return t.effectStrategy==="input"?ne(e.schema._def,t):Oe()}function rh(e){return{type:"string",enum:Array.from(e.values)}}var ih=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function oh(e,t){const n=[ne(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ne(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];
vendor: 25,084 bytes, lines 35-39
35return n.forEach(i=>{if(ih(i))r.push(...i.allOf);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:a,...s}=i;o=s}r.push(o)}}),r.length?{allOf:r}:void 0}function ah(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 Bn=void 0,Me={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:()=>(Bn===void 0&&(Bn=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Bn),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 $a(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":je(n,"email",r.message,t);break;case"format:idn-email":je(n,"idn-email",r.message,t);break;case"pattern:zod":ve(n,Me.email,r.message,t);break}break;case"url":je(n,"uri",r.message,t);break;case"uuid":je(n,"uuid",r.message,t);break;case"regex":ve(n,r.regex,r.message,t);break;case"cuid":ve(n,Me.cuid,r.message,t);break;case"cuid2":ve(n,Me.cuid2,r.message,t);break;case"startsWith":ve(n,RegExp(`^${Un(r.value,t)}`),r.message,t);break;case"endsWith":ve(n,RegExp(`${Un(r.value,t)}$`),r.message,t);break;case"datetime":je(n,"date-time",r.message,t);break;case"date":je(n,"date",r.message,t);break;case"time":je(n,"time",r.message,t);break;case"duration":je(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":{ve(n,RegExp(Un(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&je(n,"ipv4",r.message,t),r.version!=="v4"&&je(n,"ipv6",r.message,t);break}case"base64url":ve(n,Me.base64url,r.message,t);break;case"jwt":ve(n,Me.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&ve(n,Me.ipv4Cidr,r.message,t),r.version!=="v4"&&ve(n,Me.ipv6Cidr,r.message,t);break}case"emoji":ve(n,Me.emoji(),r.message,t);break;case"ulid":{ve(n,Me.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{je(n,"binary",r.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{ve(n,Me.base64,r.message,t);break}}break}case"nanoid":ve(n,Me.nanoid,r.message,t)}return n}function Un(e,t){return t.patternStrategy==="escape"?lh(e):e}var sh=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function lh(e){let t="";for(let n=0;n<e.length;n++)sh.has(e[n])||(t+="\\"),t+=e[n];return t}function je(e,t,n,r){var i;e.format||(i=e.anyOf)!=null&&i.some(o=>o.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 ve(e,t,n,r){var i;e.pattern||(i=e.allOf)!=null&&i.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Hi(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=Hi(t,r)}function Hi(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 o="",a=!1,s=!1,u=!1;for(let l=0;l<i.length;l++){if(a){o+=i[l],a=!1;continue}if(r.i){if(s){if(i[l].match(/[a-z]/)){u?(o+=i[l],o+=`${i[l-2]}-${i[l]}`.toUpperCase(),u=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(o+=i[l],u=!0):o+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){o+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){o+=`(^|(?<=[\r 36]))`;continue}else if(i[l]==="$"){o+=`($|(?=[\r 37]))`;continue}}if(r.s&&i[l]==="."){o+=s?`${i[l]}\r 38`:`[${i[l]}\r 39]`;continue}o+=i[l],i[l]==="\\"?a=!0:s&&i[l]==="]"?s=!1:!s&&i[l]==="["&&(s=!0)}try{new RegExp(o)}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 o}function Ma(e,t){var n,r,i,o,a,s;const u={type:"object",additionalProperties:(n=ne(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===J.ZodString&&((i=e.keyType._def.checks)!=null&&i.length)){const{type:l,...p}=$a(e.keyType._def,t);return{...u,propertyNames:p}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===J.ZodEnum)return{...u,propertyNames:{enum:e.keyType._def.values}};if(((a=e.keyType)==null?void 0:a._def.typeName)===J.ZodBranded&&e.keyType._def.type._def.typeName===J.ZodString&&((s=e.keyType._def.type._def.checks)!=null&&s.length)){const{type:l,...p}=Ra(e.keyType._def,t);return{...u,propertyNames:p}}}return u}function uh(e,t){if(t.mapStrategy==="record")return Ma(e,t);const n=ne(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Oe(),r=ne(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Oe();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function ch(e){const t=e.values,r=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),i=Array.from(new Set(r.map(o=>typeof o)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function ph(){return{not:Oe()}}function fh(){return{type:"null"}}var pr={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function hh(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in pr&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,o)=>{const a=pr[o._def.typeName];return a&&!i.includes(a)?[...i,a]: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,o)=>{const a=typeof o._def.value;switch(a){case"string":case"number":case"boolean":return[...i,a];case"bigint":return[...i,"integer"];case"object":if(o._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((o,a,s)=>s.indexOf(o)===a);return{type:i.length>1?i:i[0],enum:n.reduce((o,a)=>o.includes(a._def.value)?o:[...o,a._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(o=>!r.includes(o))],[])};return dh(e,t)}var dh=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>ne(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 mh(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[pr[e.innerType._def.typeName],"null"]};const n=ne(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function gh(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 yh(e,t){const n={type:"object",properties:{}},r=[],i=e.shape();for(const a in i){let s=i[a];if(s===void 0||s._def===void 0)continue;const u=xh(s),l=ne(s._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});l!==void 0&&(n.properties[a]=l,u||r.push(a))}r.length&&(n.required=r);const o=bh(e,t);return o!==void 0&&(n.additionalProperties=o),n}function bh(e,t){if(e.catchall._def.typeName!=="ZodNever")return ne(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 xh(e){try{return e.isOptional()}catch{return!0}}var vh=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return ne(e.innerType._def,t);const r=ne(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Oe()},r]}:Oe()},kh=(e,t)=>{if(t.pipeStrategy==="input")return ne(e.in._def,t);if(t.pipeStrategy==="output")return ne(e.out._def,t);const n=ne(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=ne(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function wh(e,t){return ne(e.type._def,t)}function _h(e,t){const r={type:"array",uniqueItems:!0,items:ne(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 Sh(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>ne(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:ne(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>ne(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Eh(){return{not:Oe()}}function Ih(){return Oe()}var Ch=(e,t)=>ne(e.innerType._def,t),Th=(e,t,n)=>{switch(t){case J.ZodString:return $a(e,n);case J.ZodNumber:return gh(e);case J.ZodObject:return yh(e,n);case J.ZodBigInt:return Kf(e);case J.ZodBoolean:return Xf();case J.ZodDate:return Da(e,n);case J.ZodUndefined:return Eh();case J.ZodNull:return fh();case J.ZodArray:return Yf(e,n);case J.ZodUnion:case J.ZodDiscriminatedUnion:return hh(e,n);case J.ZodIntersection:return oh(e,n);case J.ZodTuple:return Sh(e,n);case J.ZodRecord:return Ma(e,n);case J.ZodLiteral:return ah(e);case J.ZodEnum:return rh(e);case J.ZodNativeEnum:return ch(e);case J.ZodNullable:return mh(e,n);case J.ZodOptional:return vh(e,n);case J.ZodMap:return uh(e,n);case J.ZodSet:return _h(e,n);case J.ZodLazy:return()=>e.getter()._def;case J.ZodPromise:return wh(e,n);case J.ZodNaN:case J.ZodNever:return ph();case J.ZodEffects:return nh(e,n);case J.ZodAny:return Oe();case J.ZodUnknown:return Ih();case J.ZodDefault:return th(e,n);case J.ZodBranded:return Ra(e,n);case J.ZodReadonly:return Ch(e,n);case J.ZodCatch:return Qf(e,n);case J.ZodPipeline:return kh(e,n);case J.ZodFunction:case J.ZodVoid:case J.ZodSymbol:return;default:return(r=>{})()}},Ah=(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 ne(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!==Jf)return u}if(i&&!n){const u=zh(i,t);if(u!==void 0)return u}const o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);const a=Th(e,e.typeName,t),s=typeof a=="function"?ne(a(),t):a;if(s&&Ph(e,t,s),t.postProcess){const u=t.postProcess(s,e,t);return o.jsonSchema=s,u}return o.jsonSchema=s,s}var zh=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ah(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`),Oe()):t.$refStrategy==="seen"?Oe():void 0}},Ph=(e,t,n)=>(e.description&&(n.description=e.description),n),Nh=e=>{const t=Gf(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}]))}},Oh=(e,t)=>{var n;const r=Nh(t);let i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((l,[p,c])=>{var h;return{...l,[p]:(h=ne(c._def,{...r,currentPath:[...r.basePath,r.definitionPath,p]},!0))!=null?h:Oe()}},{}):void 0;const o=typeof t=="string"?t:(t==null?void 0:t.nameStrategy)==="title"||t==null?void 0:t.name,a=(n=ne(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1))!=null?n:Oe(),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(a.title=s);const u=o===void 0?i?{...a,[r.definitionPath]:i}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...i,[o]:a}};return u.$schema="http://json-schema.org/draft-07/schema#",u},fr=Symbol.for("vercel.ai.schema");function Rh(e){let t;return()=>(t==null&&(t=e()),t)}function Pn(e,{validate:t}={}){return{[fr]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Dh(e){return typeof e=="object"&&e!==null&&fr in e&&e[fr]===!0&&"jsonSchema"in e&&"validate"in e}function Mr(e){return e==null?Pn({properties:{},additionalProperties:!1}):Dh(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?ja(e):$h(e):e()}function $h(e){return Pn(()=>$r(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 _t({value:t,cause:n.issues})}}})}function Mh(e,t){var n;const r=(n=void 0)!=null?n:!1;return Pn(()=>Oh(e,{$refStrategy:r?"root":"none"}),{validate:async i=>{const o=await e.safeParseAsync(i);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function jh(e,t){var n;const r=(n=void 0)!=null?n:!1;return Pn(()=>$r(zp(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const o=await Sa(e,i);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function Lh(e){return"_zod"in e}function ja(e,t){return Lh(e)?jh(e):Mh(e)}async function Wi({value:e,schema:t,context:n}){const r=await Jt({value:e,schema:t,context:n});if(!r.success)throw _t.wrap({value:e,cause:r.error,context:n});return r.value}async function Jt({value:e,schema:t,context:n}){const r=Mr(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:_t.wrap({value:e,cause:i.error,context:n}),rawValue:e}}catch(i){return{success:!1,error:_t.wrap({value:e,cause:i,context:n}),rawValue:e}}}async function ut({text:e,schema:t}){try{const n=Wf(e);return t==null?{success:!0,value:n,rawValue:n}:await Jt({value:n,schema:t})}catch(n){return{success:!1,error:bi.isInstance(n)?n:new bi({text:e,cause:n}),rawValue:void 0}}}function Fh({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Bf).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await ut({text:n,schema:t}))}}))}async function Ke(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Zh=Object.defineProperty,Bh=(e,t)=>{for(var n in t)Zh(e,n,{get:t[n],enumerable:!0})},La="AI_NoObjectGeneratedError",Fa=`vercel.ai.error.${La}`,Uh=Symbol.for(Fa),Za,Qe=class extends Ve{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:i,finishReason:o}){super({name:La,message:e,cause:t}),this[Za]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=o}static isInstance(e){return Ve.hasMarker(e,Fa)}};Za=Uh;var Ba="AI_UIMessageStreamError",Ua=`vercel.ai.error.${Ba}`,Vh=Symbol.for(Ua),Va,gt=class extends Ve{constructor({chunkType:e,chunkId:t,message:n}){super({name:Ba,message:n}),this[Va]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Ve.hasMarker(e,Ua)}};Va=Vh;var Ji="6.0.90",qa=_e([O(),wn(Uint8Array),wn(ArrayBuffer),Oa(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]),Gt=$f(()=>_e([ff(),O(),lf(),ke(),Wt(O(),Gt.optional()),Et(Gt)])),K=Wt(O(),Wt(O(),Gt.optional())),Ha=ie({type:B("text"),text:O(),providerOptions:K.optional()}),qh=ie({type:B("image"),image:_e([qa,wn(URL)]),mediaType:O().optional(),providerOptions:K.optional()}),Wa=ie({type:B("file"),data:_e([qa,wn(URL)]),filename:O().optional(),mediaType:O(),providerOptions:K.optional()}),Hh=ie({type:B("reasoning"),text:O(),providerOptions:K.optional()}),Wh=ie({type:B("tool-call"),toolCallId:O(),toolName:O(),input:Ue(),providerOptions:K.optional(),providerExecuted:ke().optional()}),Jh=yf("type",[ie({type:B("text"),value:O(),providerOptions:K.optional()}),ie({type:B("json"),value:Gt,providerOptions:K.optional()}),ie({type:B("execution-denied"),reason:O().optional(),providerOptions:K.optional()}),ie({type:B("error-text"),value:O(),providerOptions:K.optional()}),ie({type:B("error-json"),value:Gt,providerOptions:K.optional()}),ie({type:B("content"),value:Et(_e([ie({type:B("text"),text:O(),providerOptions:K.optional()}),ie({type:B("media"),data:O(),mediaType:O()}),ie({type:B("file-data"),data:O(),mediaType:O(),filename:O().optional(),providerOptions:K.optional()}),ie({type:B("file-url"),url:O(),providerOptions:K.optional()}),ie({type:B("file-id"),fileId:_e([O(),Wt(O(),O())]),providerOptions:K.optional()}),ie({type:B("image-data"),data:O(),mediaType:O(),providerOptions:K.optional()}),ie({type:B("image-url"),url:O(),providerOptions:K.optional()}),ie({type:B("image-file-id"),fileId:_e([O(),Wt(O(),O())]),providerOptions:K.optional()}),ie({type:B("custom"),providerOptions:K.optional()})]))})]),Ja=ie({type:B("tool-result"),toolCallId:O(),toolName:O(),output:Jh,providerOptions:K.optional()}),Gh=ie({type:B("tool-approval-request"),approvalId:O(),toolCallId:O()}),Yh=ie({type:B("tool-approval-response"),approvalId:O(),approved:ke(),reason:O().optional()}),Kh=ie({role:B("system"),content:O(),providerOptions:K.optional()}),Xh=ie({role:B("user"),content:_e([O(),Et(_e([Ha,qh,Wa]))]),providerOptions:K.optional()}),Qh=ie({role:B("assistant"),content:_e([O(),Et(_e([Ha,Wa,Hh,Wh,Ja,Gh]))]),providerOptions:K.optional()}),ed=ie({role:B("tool"),content:Et(_e([Ja,Yh])),providerOptions:K.optional()});_e([Kh,Xh,Qh,ed]);function Ga(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(Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];if(i===void 0)continue;const o=r in e?e[r]:void 0,a=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),s=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);a&&s?n[r]=Ga(o,i):n[r]=i}return n}var td={};Bh(td,{array:()=>od,choice:()=>ad,json:()=>sd,object:()=>id,text:()=>rd});function nd(e){const t=["ROOT"];let n=-1,r=null;function i(u,l,p){switch(u){case'"':{n=l,t.pop(),t.push(p),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,r=l,t.pop(),t.push(p),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(p),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(p),t.push("INSIDE_NUMBER");break}case"{":{n=l,t.pop(),t.push(p),t.push("INSIDE_OBJECT_START");break}case"[":{n=l,t.pop(),t.push(p),t.push("INSIDE_ARRAY_START");break}}}function o(u,l){switch(u){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,t.pop();break}}}function a(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":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(l){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(l,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(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":{switch(l){case"]":{n=u,t.pop();break}default:{n=u,i(l,u,"INSIDE_ARRAY_AFTER_VALUE");break}}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"&&a(l,u),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(l,u);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(l,u);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const c=e.substring(r,u+1);!"false".startsWith(c)&&!"true".startsWith(c)&&!"null".startsWith(c)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(l,u):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(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 p=e.substring(r,e.length);"true".startsWith(p)?s+="true".slice(p.length):"false".startsWith(p)?s+="false".slice(p.length):"null".startsWith(p)&&(s+="null".slice(p.length))}}return s}async function nn(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await ut({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await ut({text:nd(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var rd=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),id=({schema:e,name:t,description:n})=>{const r=Mr(e);return{name:"object",responseFormat:Ke(r.jsonSchema).then(i=>({type:"json",schema:i,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},o){const a=await ut({text:i});if(!a.success)throw new Qe({message:"No object generated: could not parse the response.",cause:a.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});const s=await Jt({value:a.value,schema:r});if(!s.success)throw new Qe({message:"No object generated: response did not match sc
39hema.",cause:s.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});return s.value},async parsePartialOutput({text:i}){const o=await nn(i);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},od=({element:e,name:t,description:n})=>{const r=Mr(e);return{name:"array",responseFormat:Ke(r.jsonSchema).then(i=>{const{$schema:o,...a}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},o){const a=await ut({text:i});if(!a.success)throw new Qe({message:"No object generated: could not parse the response.",cause:a.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});const s=a.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))throw new Qe({message:"No object generated: response did not match schema.",cause:new _t({value:s,cause:"response must be an object with an elements array"}),text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});for(const u of s.elements){const l=await Jt({value:u,schema:r});if(!l.success)throw new Qe({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason})}return s.elements},async parsePartialOutput({text:i}){const o=await nn(i);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=o.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const s=o.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,u=[];for(const l of s){const p=await Jt({value:l,schema:r});p.success&&u.push(p.value)}return{partial:u}}}},createElementStreamTransform(){let i=0;return new TransformStream({transform({partialOutput:o},a){if(o!=null)for(;i<o.length;i++)a.enqueue(o[i])}})}}},ad=({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 o=await ut({text:r});if(!o.success)throw new Qe({message:"No object generated: could not parse the response.",cause:o.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const a=o.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!e.includes(a.result))throw new Qe({message:"No object generated: response did not match schema.",cause:new _t({value:a,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return a.result},async parsePartialOutput({text:r}){const i=await nn(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const o=i.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;const a=e.filter(s=>s.startsWith(o.result));return i.state==="successful-parse"?a.includes(o.result)?{partial:o.result}:void 0:a.length===1?{partial:a[0]}:void 0}}},createElementStreamTransform(){}}),sd=({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 ut({text:n});if(!i.success)throw new Qe({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 nn(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(){}});tn({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)} 40 41`)},flush(e){e.enqueue(`data: [DONE] 42 43`)}})}});var ld=Rh(()=>ja(_e([ue({type:B("text-start"),id:O(),providerMetadata:K.optional()}),ue({type:B("text-delta"),id:O(),delta:O(),providerMetadata:K.optional()}),ue({type:B("text-end"),id:O(),providerMetadata:K.optional()}),ue({type:B("error"),errorText:O()}),ue({type:B("tool-input-start"),toolCallId:O(),toolName:O(),providerExecuted:ke().optional(),providerMetadata:K.optional(),dynamic:ke().optional(),title:O().optional()}),ue({type:B("tool-input-delta"),toolCallId:O(),inputTextDelta:O()}),ue({type:B("tool-input-available"),toolCallId:O(),toolName:O(),input
vendor: 7,531 bytes, line 43
43:Ue(),providerExecuted:ke().optional(),providerMetadata:K.optional(),dynamic:ke().optional(),title:O().optional()}),ue({type:B("tool-input-error"),toolCallId:O(),toolName:O(),input:Ue(),providerExecuted:ke().optional(),providerMetadata:K.optional(),dynamic:ke().optional(),errorText:O(),title:O().optional()}),ue({type:B("tool-approval-request"),approvalId:O(),toolCallId:O()}),ue({type:B("tool-output-available"),toolCallId:O(),output:Ue(),providerExecuted:ke().optional(),dynamic:ke().optional(),preliminary:ke().optional()}),ue({type:B("tool-output-error"),toolCallId:O(),errorText:O(),providerExecuted:ke().optional(),dynamic:ke().optional()}),ue({type:B("tool-output-denied"),toolCallId:O()}),ue({type:B("reasoning-start"),id:O(),providerMetadata:K.optional()}),ue({type:B("reasoning-delta"),id:O(),delta:O(),providerMetadata:K.optional()}),ue({type:B("reasoning-end"),id:O(),providerMetadata:K.optional()}),ue({type:B("source-url"),sourceId:O(),url:O(),title:O().optional(),providerMetadata:K.optional()}),ue({type:B("source-document"),sourceId:O(),mediaType:O(),title:O(),filename:O().optional(),providerMetadata:K.optional()}),ue({type:B("file"),url:O(),mediaType:O(),providerMetadata:K.optional()}),ue({type:Oa(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:O().optional(),data:Ue(),transient:ke().optional()}),ue({type:B("start-step")}),ue({type:B("finish-step")}),ue({type:B("start"),messageId:O().optional(),messageMetadata:Ue().optional()}),ue({type:B("finish"),finishReason:za(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Ue().optional()}),ue({type:B("abort"),reason:O().optional()}),ue({type:B("message-metadata"),messageMetadata:Ue()})])));function ud(e){return e.type.startsWith("data-")}function hr(e){return e.type.startsWith("tool-")}function Ya(e){return e.type==="dynamic-tool"}function _n(e){return hr(e)||Ya(e)}function dr(e){return e.type.split("-").slice(1).join("-")}function cd(e){return Ya(e)?e.toolName:dr(e)}function pd({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function fd({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:o,onData:a}){return e.pipeThrough(new TransformStream({async transform(s,u){await r(async({state:l,write:p})=>{var c,h,f,g;function k(m){const A=l.message.parts.filter(_n).find(w=>w.toolCallId===m);if(A==null)throw new gt({chunkType:"tool-invocation",chunkId:m,message:`No tool invocation found for tool call ID "${m}".`});return A}function b(m){var I;const A=l.message.parts.find(j=>hr(j)&&j.toolCallId===m.toolCallId),w=m,z=A;A!=null?(A.state=m.state,z.input=w.input,z.output=w.output,z.errorText=w.errorText,z.rawInput=w.rawInput,z.preliminary=w.preliminary,m.title!==void 0&&(z.title=m.title),z.providerExecuted=(I=w.providerExecuted)!=null?I:A.providerExecuted,w.providerMetadata!=null&&(A.callProviderMetadata=w.providerMetadata)):l.message.parts.push({type:`tool-${m.toolName}`,toolCallId:m.toolCallId,state:m.state,title:m.title,input:w.input,output:w.output,rawInput:w.rawInput,errorText:w.errorText,providerExecuted:w.providerExecuted,preliminary:w.preliminary,...w.providerMetadata!=null?{callProviderMetadata:w.providerMetadata}:{}})}function d(m){var I,A;const w=l.message.parts.find(q=>q.type==="dynamic-tool"&&q.toolCallId===m.toolCallId),z=m,j=w;w!=null?(w.state=m.state,j.toolName=m.toolName,j.input=z.input,j.output=z.output,j.errorText=z.errorText,j.rawInput=(I=z.rawInput)!=null?I:j.rawInput,j.preliminary=z.preliminary,m.title!==void 0&&(j.title=m.title),j.providerExecuted=(A=z.providerExecuted)!=null?A:w.providerExecuted,z.providerMetadata!=null&&(w.callProviderMetadata=z.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:m.toolName,toolCallId:m.toolCallId,state:m.state,input:z.input,output:z.output,errorText:z.errorText,preliminary:z.preliminary,providerExecuted:z.providerExecuted,title:m.title,...z.providerMetadata!=null?{callProviderMetadata:z.providerMetadata}:{}})}async function v(m){if(m!=null){const I=l.message.metadata!=null?Ga(l.message.metadata,m):m;t!=null&&await Wi({value:I,schema:t,context:{field:"message.metadata",entityId:l.message.id}}),l.message.metadata=I}}switch(s.type){case"text-start":{const m={type:"text",text:"",providerMetadata:s.providerMetadata,state:"streaming"};l.activeTextParts[s.id]=m,l.message.parts.push(m),p();break}case"text-delta":{const m=l.activeTextParts[s.id];if(m==null)throw new gt({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.`});m.text+=s.delta,m.providerMetadata=(c=s.providerMetadata)!=null?c:m.providerMetadata,p();break}case"text-end":{const m=l.activeTextParts[s.id];if(m==null)throw new gt({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.`});m.state="done",m.providerMetadata=(h=s.providerMetadata)!=null?h:m.providerMetadata,delete l.activeTextParts[s.id],p();break}case"reasoning-start":{const m={type:"reasoning",text:"",providerMetadata:s.providerMetadata,state:"streaming"};l.activeReasoningParts[s.id]=m,l.message.parts.push(m),p();break}case"reasoning-delta":{const m=l.activeReasoningParts[s.id];if(m==null)throw new gt({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.`});m.text+=s.delta,m.providerMetadata=(f=s.providerMetadata)!=null?f:m.providerMetadata,p();break}case"reasoning-end":{const m=l.activeReasoningParts[s.id];if(m==null)throw new gt({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.`});m.providerMetadata=(g=s.providerMetadata)!=null?g:m.providerMetadata,m.state="done",delete l.activeReasoningParts[s.id],p();break}case"file":{l.message.parts.push({type:"file",mediaType:s.mediaType,url:s.url}),p();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:s.sourceId,url:s.url,title:s.title,providerMetadata:s.providerMetadata}),p();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}),p();break}case"tool-input-start":{const m=l.message.parts.filter(hr);l.partialToolCalls[s.toolCallId]={text:"",toolName:s.toolName,index:m.length,dynamic:s.dynamic,title:s.title},s.dynamic?d({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}):b({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}),p();break}case"tool-input-delta":{const m=l.partialToolCalls[s.toolCallId];if(m==null)throw new gt({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.`});m.text+=s.inputTextDelta;
43const{value:I}=await nn(m.text);m.dynamic?d({toolCallId:s.toolCallId,toolName:m.toolName,state:"input-streaming",input:I,title:m.title}):b({toolCallId:s.toolCallId,toolName:m.toolName,state:"input-streaming",input:I,title:m.title}),p();break}case"tool-input-available":{s.dynamic?d({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}):b({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}),p(),o&&!s.providerExecuted&&await o({toolCall:s});break}case"tool-input-error":{s.dynamic?d({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}):b({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:void 0,rawInput:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}),p();break}case"tool-approval-request":{const m=k(s.toolCallId);m.state="approval-requested",m.approval={id:s.approvalId},p();break}case"tool-output-denied":{const m=k(s.toolCallId);m.state="output-denied",p();break}case"tool-output-available":{const m=k(s.toolCallId);m.type==="dynamic-tool"?d({toolCallId:s.toolCallId,toolName:m.toolName,state:"output-available",input:m.input,output:s.output,preliminary:s.preliminary,providerExecuted:s.providerExecuted,title:m.title}):b({toolCallId:s.toolCallId,toolName:dr(m),state:"output-available",input:m.input,output:s.output,providerExecuted:s.providerExecuted,preliminary:s.preliminary,title:m.title}),p();break}case"tool-output-error":{const m=k(s.toolCallId);m.type==="dynamic-tool"?d({toolCallId:s.toolCallId,toolName:m.toolName,state:"output-error",input:m.input,errorText:s.errorText,providerExecuted:s.providerExecuted,title:m.title}):b({toolCallId:s.toolCallId,toolName:dr(m),state:"output-error",input:m.input,rawInput:m.rawInput,errorText:s.errorText,providerExecuted:s.providerExecuted,title:m.title}),p();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 v(s.messageMetadata),(s.messageId!=null||s.messageMetadata!=null)&&p();break}case"finish":{s.finishReason!=null&&(l.finishReason=s.finishReason),await v(s.messageMetadata),s.messageMetadata!=null&&p();break}case"message-metadata":{await v(s.messageMetadata),s.messageMetadata!=null&&p();break}case"error":{i==null||i(new Error(s.errorText));break}default:if(ud(s)){if((n==null?void 0:n[s.type])!=null){const A=l.message.parts.findIndex(z=>"id"in z&&"data"in z&&z.id===s.id&&z.type===s.type),w=A>=0?A:l.message.parts.length;await Wi({value:s.data,schema:n[s.type],context:{field:`message.parts[${w}].data`,entityName:s.type,entityId:s.id}})}const m=s;if(m.transient){a==null||a(m);break}const I=m.id!=null?l.message.parts.find(A=>m.type===A.type&&m.id===A.id):void 0;I!=null?I.data=m.data:l.message.parts.push(m),a==null||a(m),p()}}u.enqueue(s)})}}))}async function hd({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){t==null||t(r)}finally{n.releaseLock()}}tn({prefix:"aitxt",size:24});tn({prefix:"aiobj",size:24});var dd=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()})}};tn({prefix:"aiobj",size:24});async function md(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((o,a)=>{const s=new FileReader;s.onload=u=>{var l;o((l=u.target)==null?void 0:l.result)},s.onerror=u=>a(u),s.readAsDataURL(t)});return{type:"file",mediaType:r,filename:n,url:i}}))}var gd=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:a}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:e,...t}){var n,r,i,o,a;const s=await Ke(this.body),u=await Ke(this.headers),l=await Ke(this.credentials),p={...st(u),...st(t.headers)},c=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...s,...t.body},headers:p,credentials:l,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),h=(r=c==null?void 0:c.api)!=null?r:this.api,f=(c==null?void 0:c.headers)!==void 0?st(c.headers):p,g=(c==null?void 0:c.body)!==void 0?c.body:{...s,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},k=(i=c==null?void 0:c.credentials)!=null?i:l,d=await((o=this.fetch)!=null?o:globalThis.fetch)(h,{method:"POST",headers:Ui({"Content-Type":"application/json",...f},`ai-sdk/${Ji}`,Bi()),body:JSON.stringify(g),credentials:k,signal:e});if(!d.ok)throw new Error((a=await d.text())!=null?a:"Failed to fetch the chat response.");if(!d.body)throw new Error("The response body is empty.");return this.processResponseStream(d.body)}async reconnectToStream(e){var t,n,r,i,o;const a=await Ke(this.body),s=await Ke(this.headers),u=await Ke(this.credentials),l={...st(s),...st(e.headers)},p=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...a,...e.body},headers:l,credentials:u,requestMetadata:e.metadata})),c=(n=p==null?void 0:p.api)!=null?n:`${this.api}/${e.chatId}/stream`,h=(p==null?void 0:p.headers)!==void 0?st(p.headers):l,f=(r=p==null?void 0:p.credentials)!=null?r:u,k=await((i=this.fetch)!=null?i:globalThis.fetch)(c,{method:"GET",headers:Ui(h,`ai-sdk/${Ji}`,Bi()),credentials:f});if(k.status===204)return null;if(!k.ok)throw new Error((o=await k.text())!=null?o:"Failed to fetch the chat response.");if(!k.body)throw new Error("The response body is empty.");return this.processResponseStream(k.body)}},Ka=class extends gd{constructor(e={}){super(e)}processResponseStream(e){return Fh({stream:e,schema:ld}).pipeThrough(new TransformStream({async transform(t,n){if(!t.success)throw t.error;n.enqueue(t.value)}}))}},yd=class{constructor({generateId:e=Uf,id:t=e(),transport:n=new Ka,messageMetadataSchema:r,dataPartSchemas:i,state:o,onError:a,onToolCall:s,onFinish:u,onData:l,sendAutomaticallyWhen:p}){this.activeResponse=void 0,this.jobExecutor=new dd,this.sendMessage=async(c,h)=>{var f,g,k,b;
vendor: 10,536 bytes, line 43
43if(c==null){await this.makeRequest({trigger:"submit-message",messageId:(f=this.lastMessage)==null?void 0:f.id,...h});return}let d;if("text"in c||"files"in c?d={parts:[...Array.isArray(c.files)?c.files:await md(c.files),..."text"in c&&c.text!=null?[{type:"text",text:c.text}]:[]]}:d=c,c.messageId!=null){const v=this.state.messages.findIndex(m=>m.id===c.messageId);if(v===-1)throw new Error(`message with id ${c.messageId} not found`);if(this.state.messages[v].role!=="user")throw new Error(`message with id ${c.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,v+1),this.state.replaceMessage(v,{...d,id:c.messageId,role:(g=d.role)!=null?g:"user",metadata:c.metadata})}else this.state.pushMessage({...d,id:(k=d.id)!=null?k:this.generateId(),role:(b=d.role)!=null?b:"user",metadata:c.metadata});await this.makeRequest({trigger:"submit-message",messageId:c.messageId,...h})},this.regenerate=async({messageId:c,...h}={})=>{const f=c==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===c);if(f===-1)throw new Error(`message ${c} not found`);this.state.messages=this.state.messages.slice(0,this.messages[f].role==="assistant"?f:f+1),await this.makeRequest({trigger:"regenerate-message",messageId:c,...h})},this.resumeStream=async(c={})=>{await this.makeRequest({trigger:"resume-stream",...c})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:c,approved:h,reason:f})=>this.jobExecutor.run(async()=>{const g=this.state.messages,k=g[g.length-1],b=d=>_n(d)&&d.state==="approval-requested"&&d.approval.id===c?{...d,state:"approval-responded",approval:{id:c,approved:h,reason:f}}:d;this.state.replaceMessage(g.length-1,{...k,parts:k.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(d=>{var v;d&&this.makeRequest({trigger:"submit-message",messageId:(v=this.lastMessage)==null?void 0:v.id})})}),this.addToolOutput=async({state:c="output-available",tool:h,toolCallId:f,output:g,errorText:k})=>this.jobExecutor.run(async()=>{const b=this.state.messages,d=b[b.length-1],v=m=>_n(m)&&m.toolCallId===f?{...m,state:c,output:g,errorText:k}:m;this.state.replaceMessage(b.length-1,{...d,parts:d.parts.map(v)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(v)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(m=>{var I;m&&this.makeRequest({trigger:"submit-message",messageId:(I=this.lastMessage)==null?void 0:I.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var c;this.status!=="streaming"&&this.status!=="submitted"||(c=this.activeResponse)!=null&&c.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=o,this.onError=a,this.onToolCall=s,this.onFinish=u,this.onData=l,this.sendAutomaticallyWhen=p}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 o,a,s;let u;if(e==="resume-stream")try{const f=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(f==null)return;u=f}catch(f){this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f});return}this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let p=!1,c=!1,h=!1;try{const f={state:pd({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};f.abortController.signal.addEventListener("abort",()=>{p=!0}),this.activeResponse=f;let g;e==="resume-stream"?g=u:g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:f.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i});const k=b=>this.jobExecutor.run(()=>b({state:f.state,write:()=>{var d;this.setStatus({status:"streaming"}),f.state.message.id===((d=this.lastMessage)==null?void 0:d.id)?this.state.replaceMessage(this.state.messages.length-1,f.state.message):this.state.pushMessage(f.state.message)}}));await hd({stream:fd({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:k,onError:b=>{throw b}}),onError:b=>{throw b}}),this.setStatus({status:"ready"})}catch(f){if(p||f.name==="AbortError")return p=!0,this.setStatus({status:"ready"}),null;h=!0,f instanceof TypeError&&(f.message.toLowerCase().includes("fetch")||f.message.toLowerCase().includes("network"))&&(c=!0),this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:p,isDisconnect:c,isError:h,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(f){console.error(f)}this.activeResponse=void 0}!h&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(s=this.lastMessage)==null?void 0:s.id,metadata:t,headers:n,body:r})}},Vn,Gi;function bd(){if(Gi)return Vn;Gi=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(...a){clearTimeout(r);const s=Date.now(),u=s-i,l=n-u;l<=0?(i=s,t.apply(this,a)):r=setTimeout(()=>{i=Date.now(),t.apply(this,a)},l)}}return Vn=e,Vn}var xd=bd();const vd=Ar(xd);var Xa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ce=(e,t,n)=>(Xa(e,t,"read from private field"),n?n.call(e):t.get(e)),Ze=(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)},Ye=(e,t,n,r)=>(Xa(e,t,"write to private field"),t.set(e,n),n);function kd(e,t){return t!=null?vd(e,t):e}var Re,gn,yn,$t,Mt,jt,xt,mr,gr,wd=class{constructor(e=[]){Ze(this,Re,void 0),Ze(this,gn,"ready"),Ze(this,yn,void 0),Ze(this,$t,new Set),Ze(this,Mt,new Set),Ze(this,jt,new Set),this.pushMessage=t=>{Ye(this,Re,ce(this,Re).concat(t)),ce(this,xt).call(this)},this.popMessage=()=>{Ye(this,Re,ce(this,Re).slice(0,-1)),ce(this,xt).call(this)},this.replaceMessage=(t,n)=>{Ye(this,Re,[...ce(this,Re).slice(0,t),this.snapshot(n),...ce(this,Re).slice(t+1)]),ce(this,xt).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,n)=>{const r=n?kd(t,n):t;return ce(this,$t).add(r),()=>{ce(this,$t).delete(r)}},this["~registerStatusCallback"]=t=>(ce(this,Mt).add(t),()=>{ce(this,Mt).delete(t)}),this["~registerErrorCallback"]=t=>(ce(this,jt).add(t),()=>{ce(this,jt).delete(t)}),Ze(this,xt,()=>{ce(this,$t).forEach(t=>t())}),Ze(this,mr,()=>{ce(this,Mt).forEach(t=>t())}),Ze(this,gr,()=>{ce(this,jt).forEach(t=>t())}),Ye(this,Re,e)}get status(){return ce(this,gn)}set status(e){Ye(this,gn,e),ce(this,mr).call(this)}get error(){return ce(this,yn)}set error(e){Ye(this,yn,e),ce(this,gr).call(this)}get messages(){return ce(this,Re)}set messages(e){Ye(this,Re,[...e]),ce(this,xt).call(this)}};Re=new WeakMap;gn=new WeakMap;yn=new WeakMap;$t=new WeakMap;Mt=new WeakMap;jt=new WeakMap;xt=new WeakMap;mr=new WeakMap;gr=new WeakMap;var vt,Yi=class extends yd{constructor({messages:e,...t}){const n=new wd(e);super({...t,state:n}),Ze(this,vt,void 0),this["~registerMessagesCallback"]=(r,i)=>ce(this,vt)["~registerMessagesCallback"](r,i),this["~registerStatusCallback"]=r=>ce(this,vt)["~registerStatusCallback"](r),this["~registerErrorCallback"]=r=>ce(this,vt)["~registerErrorCallback"](r),Ye(this,vt,n)}};vt=new WeakMap;function _d({experimental_throttle:e,resume:t=!1,...n}={}){const r=U.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:h=>{var f,g;return(g=(f=r.current).onToolCall)==null?void 0:g.call(f,h)},onData:h=>{var f,g;return(g=(f=r.current).onData)==null?void 0:g.call(f,h)},onFinish:h=>{var f,g;return(g=(f=r.current).onFinish)==null?void 0:g.call(f,h)},onError:h=>{var f,g;return(g=(f=r.current).onError)==null?void 0:g.call(f,h)},sendAutomaticallyWhen:h=>{var f,g,k;return(k=(g=(f=r.current).sendAutomaticallyWhen)==null?void 0:g.call(f,h))!=null?k:!1}},o=U.useRef("chat"in n?n.chat:new Yi(i));("chat"in n&&n.chat!==o.current||"id"in n&&o.current.id!==n.id)&&(o.current="chat"in n?n.chat:new Yi(i));const s=U.useCallback(h=>o.current["~registerMessagesCallback"](h,e),[e,o.current.id]),u=U.useSyncExternalStore(s,()=>o.current.messages,()=>o.current.messages),l=U.useSyncExternalStore(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),p=U.useSyncExternalStore(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),c=U.useCallback(h=>{typeof h=="function"&&(h=h(o.current.messages)),o.current.messages=h},[o]);return U.useEffect(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:u,setMessages:c,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:p,resumeStream:o.current.resumeStream,status:l,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}function Ki(e){return[...e].sort((t,n)=>t.id-n.id)}const Xi="Chat cleared on screen, but the saved copy could not be wiped â reloading may restore this conversation.";function Sd(e,t){const n={};return t&&(n["X-CSRF-Token"]=t),{url:`/api/runtime/agents/${e}/history`,method:"DELETE",headers:n}}function Ed(e,t,n,r){const[i,o]=U.useState(null),[a,s]=U.useState(!1),[u,l]=U.useState(null),[p,
43c]=U.useState(!1),h=U.useRef(n);h.current=n;const f=U.useRef(null),g=U.useRef(null),k=U.useRef(!1),b=U.useRef(r);b.current=r;const{messages:d,sendMessage:v,status:m,error:I,setMessages:A}=_d({transport:new Ka({api:`/api/runtime/agents/${e}/chat`,headers:{...t?{"X-CSRF-Token":t}:{},Accept:"text/event-stream"},prepareSendMessagesRequest:({messages:T,headers:R})=>{const H=T.findLast(le=>le.role==="user"),ee={...R};return h.current&&(ee["X-Wallet-Address"]=h.current),{body:{messages:H?[{role:"user",content:yr(H)}]:[]},headers:ee}}}),onFinish:({message:T})=>{const R=T.metadata;R!=null&&R.warningMessage&&o(R.warningMessage)},onError:T=>{if(!k.current&&b.current&&g.current&&Ad(T==null?void 0:T.message)){k.current=!0;const R=g.current;b.current().then(H=>{H&&f.current&&R&&f.current({text:R})}).catch(()=>{})}}});f.current=v;const w=U.useRef(!1),z=U.useRef(new Set);U.useEffect(()=>{w.current||(w.current=!0,fetch(`/api/runtime/agents/${e}/history?limit=50`).then(T=>T.ok?T.json():null).then(T=>{var le;const R=T;if(!((le=R==null?void 0:R.messages)!=null&&le.length))return;const H=Ki(R.messages),ee=H.filter(y=>y.role==="user"||y.role==="assistant").map(y=>({id:String(y.id),role:y.role,parts:[{type:"text",text:y.content}],createdAt:new Date(y.created_at*1e3)}));ee.length>0&&(ee.forEach(y=>z.current.add(y.id)),A(ee),l(H[0].id),s(!!R.hasMore))}).catch(()=>{}))},[e,A]);const j=U.useMemo(()=>d.filter(T=>T.role==="user"||T.role==="assistant").map(T=>{var le;const R=[];let H=!1;for(const y of T.parts)if(_n(y)){H=!0;const xe=cd(y),Se=y.state==="output-available"||y.state==="output-error";R.push({toolName:xe,state:Se?"result":"call",args:y.input,result:y.state==="output-available"?String(y.output??""):y.state==="output-error"?`Error: ${y.errorText}`:void 0})}const ee=T.metadata;return(le=ee==null?void 0:ee.usage)!=null&&le.toolsUsed&&(H=!0),{id:T.id,role:T.role,content:T.role==="assistant"?$d(T):yr(T),timestamp:Date.now(),toolsUsed:H,toolInvocations:R.length>0?R:void 0,fresh:!z.current.has(T.id)}}),[d]),{quota:q,lastUsage:_}=U.useMemo(()=>{const T=d.findLast(le=>le.role==="assistant"),R=T==null?void 0:T.metadata,H=R!=null&&R.quota?{messagesUsed:R.quota.messagesUsed,messagesLimit:R.quota.messagesLimit,billingType:R.quota.billingType,computeBalanceUsd:R.quota.computeBalanceUsd}:null,ee=R!=null&&R.usage&&R.model?{model:R.model,inputTokens:R.usage.inputTokens,outputTokens:R.usage.outputTokens,costUsd:R.usage.costUsd,toolsUsed:R.usage.toolsUsed??!1}:null;return{quota:H,lastUsage:ee}},[d]),D=U.useCallback(async T=>{T.trim()&&(o(null),g.current=T.trim(),k.current=!1,await v({text:T.trim()}))},[v]),$=U.useCallback(async()=>{var T;if(!(!a||p||u==null)){c(!0);try{const R=await fetch(`/api/runtime/agents/${e}/history?before=${u}&limit=50`);if(!R.ok)return;const H=await R.json();if(!((T=H.messages)!=null&&T.length)){s(!1);return}const ee=Ki(H.messages),le=ee.filter(y=>y.role==="user"||y.role==="assistant").map(y=>({id:String(y.id),role:y.role,parts:[{type:"text",text:y.content}],createdAt:new Date(y.created_at*1e3)}));le.length>0?(le.forEach(y=>z.current.add(y.id)),A(y=>[...le,...y]),l(ee[0].id),s(!!H.hasMore)):s(!1)}finally{c(!1)}}},[e,a,u,p,A]),X=m==="submitted"||m==="streaming",L=U.useCallback(async()=>{A([]),o(null);try{const{url:T,method:R,headers:H}=Sd(e,t);(await fetch(T,{method:R,headers:H})).ok||o(Xi)}catch{o(Xi)}},[e,t,A]);return{messages:j,send:D,isStreaming:X,quota:q,lastUsage:_,error:I?zd(I.message):null,warning:i,clearMessages:L,hasMore:a,isLoadingOlder:p,loadOlder:$}}const Id="This agent is out of 0G compute credits. Refill its compute balance to continue using decentralized compute.",Cd="This agent is out of included messages. Upgrade your plan to keep chatting.",Td="0G compute is funded, but provider setup is still being finalized. Please try again in a moment.";function Ad(e){if(!e)return!1;const t=Qa(e),n=[e,t==null?void 0:t.error,t==null?void 0:t.code,t==null?void 0:t.message].filter(r=>typeof r=="string").join(" ").toLowerCase();return n.includes("chat is private")||n.includes("unauthorized")||n.includes("forbidden")||n.includes("401")||n.includes("403")}function zd(e){const t=Qa(e),n=t!=null&&t.error&&typeof t.error=="object"&&!Array.isArray(t.error)?t.error:null,r=[e,t==null?void 0:t.error,t==null?void 0:t.code,t==null?void 0:t.message,t==null?void 0:t.content,t==null?void 0:t.action,n==null?void 0:n.code,n==null?void 0:n.message].filter(i=>typeof i=="string").join(" ").toLowerCase();return r.includes("fundraiser_fallback")&&typeof(t==null?void 0:t.message)=="str
43ing"&&t.message.length>0?t.message:Pd(r)?Td:Nd(r)?Cd:Od(r)?Id:r.includes("rate limit")||r.includes("rate_limited")||r.includes("too many messages")||r.includes("429")?"Too many messages â please wait a moment before trying again.":r.includes("502")||r.includes("inference")?"The AI service is temporarily unavailable â please try again shortly.":t||e.startsWith("{")||e.startsWith("[")||e.includes('"code":')?"I'm having trouble connecting right now â please try again in a moment.":e}function Pd(e){return e.includes("provider setup")||e.includes("provider sub-account")||e.includes("sub-account is being initialized")||e.includes("being finalized")}function Nd(e){return e.includes("trial_exhausted")||e.includes("insufficient_balance")||e.includes("daily_cap_exceeded")||e.includes("key_cap_exceeded")||e.includes("end_user_cap_exceeded")||e.includes("402")&&e.includes("payment required")}function Od(e){return e.includes("fund_wallet")||e.includes("fund compute")||e.includes("compute balance")||e.includes("compute credits")||e.includes("0g compute")||e.includes("quota_exceeded")}function Qa(e){const t=e.trim(),n=[t],r=t.indexOf("{"),i=t.lastIndexOf("}");r>=0&&i>r&&n.push(t.slice(r,i+1));for(const o of n)try{const a=JSON.parse(o);if(a&&typeof a=="object"&&!Array.isArray(a))return a}catch{}return null}function Rd(e){return e.replace(/[\u{1F600}-\u{1F64F}]/gu,"").replace(/[\u{1F300}-\u{1F5FF}]/gu,"").replace(/[\u{1F680}-\u{1F6FF}]/gu,"").replace(/[\u{1F1E0}-\u{1F1FF}]/gu,"").replace(/[\u{2600}-\u{26FF}]/gu,"").replace(/[\u{2700}-\u{27BF}]/gu,"").replace(/[\u{FE00}-\u{FE0F}]/gu,"").replace(/[\u{1F900}-\u{1F9FF}]/gu,"").replace(/[\u{1FA00}-\u{1FA6F}]/gu,"").replace(/[\u{1FA70}-\u{1FAFF}]/gu,"").replace(/[\u{200D}]/gu,"").replace(/[\u{20E3}]/gu,"").replace(/ +/g," ").trim()}function yr(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function Dd(e){let t=e;return t=t.replace(/^(?:\|[^\n]*\|[ \t]*\n?)+/gm,n=>{const r=n.trim().split(` 44`).filter(o=>o.trim()),i=[];for(const o of r){const a=o.split("|").map(s=>s.trim()).filter(Boolean);a.every(s=>/^[-:]+$/.test(s))||i.push(a.join(" â "))}return i.length>0?i.join(". ")+`. 45`:""}),t=t.replace(/^#{1,4}\s+/gm,""),t=t.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,"$1"),t=t.replace(/\*\*(\S[\s\S]*?)\*\*/g,"$1"),t=t.replace(new RegExp("(?<!\\*)\\*(\\S[^*\\n]*?)\\*(?!\\*)","g"),"$1"),t=t.replace(/(^|[^\w])__(\S[\s\S]*?)__(?!\w)/g,"$1$2"),t=t.replace(/(^|[^\w])_(\S[^_\n]*?)_(?!\w)/g,"$1$2"),t=t.replace(/~~(\S[\s\S]*?)~~/g,"$1"),t=t.replace(/```[a-z]*\n?([\s\S]*?)```/gi,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t=t.replace(/\[([^\]\n]+)\]\((https?:\/\/[^)\s]+)\)/g,"$1 ($2)"),t=t.replace(/\n+(?:(?:let me know|feel free|don't hesitate|do not hesitate|if you(?:'d| would) like|happy to help|i(?:'m| am) here|reach out|just ask)[^\n]*\.?\s*)+$/i,""),t=t.replace(/\{[\s\S]*?"name"\s*:\s*"[a-z_]+"[\s\S]*?"parameters"\s*:\s*\{[\s\S]*?\}\s*\}/gi,""),t=t.replace(/\n{3,}/g,` 46 47`),t.trim()}function $d(e){return Dd(Rd(yr(e)))}function Md(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jd=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ld=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fd={};function Qi(e,t){return(Fd.jsx?Ld:jd).test(e)}const Zd=/[ \t\n\f\r]/g;function Bd(e){return typeof e=="object"?e.type==="text"?eo(e.value):!1:eo(e)}function eo(e){return e.replace(Zd,"")===""}class rn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}rn.prototype.normal={};rn.prototype.property={};rn.prototype.space=void 0;function es(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new rn(n,r,t)}function br(e){return e.toLowerCase()}class Ce{constructor(t,n){this.attribute=n,this.property=t}}Ce.prototype.attribute="";Ce.prototype.booleanish=!1;Ce.prototype.boolean=!1;Ce.prototype.commaOrSpaceSeparated=!1;Ce.prototype.commaSeparated=!1;Ce.prototype.defined=!1;Ce.prototype.mustUseProperty=!1;Ce.prototype.number=!1;Ce.prototype.overloadedBoolean=!1;Ce.prototype.property="";Ce.prototype.spaceSeparated=!1;Ce.prototype.space=void 0;let Ud=0;const W=ft(),me=ft(),xr=ft(),P=ft(),ae=ft(),wt=ft(),Pe=ft();function ft(){return 2**++Ud}const vr=Object.freeze(Object.defineProperty({__proto__:null,boolean:W,booleanish:me,commaOrSpaceSeparated:Pe,commaSeparated:wt,number:P,overloadedBoolean:xr,spaceSeparated:ae},Symbol.toStringTag,{value:"Module"})),qn=Object.keys(vr);class jr extends Ce{constructor(t,n,r,i){let o=-1;if(super(t,n),to(this,"space",i),typeof r=="number")for(;++o<qn.length;){const a=qn[o];to(this,qn[o],(r&vr[a])===vr[a])}}}jr.prototype.defined=!0;function to(e,t,n){n&&(e[t]=n)}function It(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new jr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[br(r)]=r,n[br(o.attribute)]=r}return new rn(t,n,e.space)}const ts=It({properties:{ariaActiveDescendant:null,ariaAtomic:me,ariaAutoComplete:null,ariaBusy:me,ariaChecked:me,ariaColCount:P,ariaColIndex:P,ariaColSpan:P,ariaControl
vendor: 5,361 bytes, line 47
47s:ae,ariaCurrent:null,ariaDescribedBy:ae,ariaDetails:null,ariaDisabled:me,ariaDropEffect:ae,ariaErrorMessage:null,ariaExpanded:me,ariaFlowTo:ae,ariaGrabbed:me,ariaHasPopup:null,ariaHidden:me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ae,ariaLevel:P,ariaLive:null,ariaModal:me,ariaMultiLine:me,ariaMultiSelectable:me,ariaOrientation:null,ariaOwns:ae,ariaPlaceholder:null,ariaPosInSet:P,ariaPressed:me,ariaReadOnly:me,ariaRelevant:null,ariaRequired:me,ariaRoleDescription:ae,ariaRowCount:P,ariaRowIndex:P,ariaRowSpan:P,ariaSelected:me,ariaSetSize:P,ariaSort:null,ariaValueMax:P,ariaValueMin:P,ariaValueNow:P,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ns(e,t){return t in e?e[t]:t}function rs(e,t){return ns(e,t.toLowerCase())}const Vd=It({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:wt,acceptCharset:ae,accessKey:ae,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:ae,autoFocus:W,autoPlay:W,blocking:ae,capture:null,charSet:null,checked:W,cite:null,className:ae,cols:P,colSpan:null,content:null,contentEditable:me,controls:W,controlsList:ae,coords:P|wt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:xr,draggable:me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:ae,height:P,hidden:xr,high:P,href:null,hrefLang:null,htmlFor:ae,httpEquiv:ae,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:ae,itemRef:ae,itemScope:W,itemType:ae,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:P,manifest:null,max:null,maxLength:P,media:null,method:null,min:null,minLength:P,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,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:W,optimum:P,pattern:null,ping:ae,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:ae,required:W,reversed:W,rows:P,rowSpan:P,sandbox:ae,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shape:null,size:P,sizes:null,slot:null,span:P,spellCheck:me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:P,step:null,style:null,tabIndex:P,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:me,width:P,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ae,axis:null,background:null,bgColor:null,border:P,borderColor:null,bottomMargin:P,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:P,leftMargin:P,link:null,longDesc:null,lowSrc:null,marginHeight:P,marginWidth:P,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:P,rules:null,scheme:null,scrolling:me,standby:null,summary:null,text:null,topMargin:P,valueType:null,version:null,vAlign:null,vLink:null,vSpace:P,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:W,disableRemotePlayback:W,prefix:null,property:null,results:P,security:null,unselectable:null},space:"html",transform:rs}),qd=It({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",colorRen
47dering:"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-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:Pe,accentHeight:P,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:P,amplitude:P,arabicForm:null,ascent:P,attributeName:null,attributeType:null,azimuth:P,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:P,by:null,calcMode:null,capHeight:P,className:ae,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRen
47dering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:P,diffuseConstant:P,direction:null,display:null,dur:null,divisor:P,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:P,enableBackground:null,end:null,event:null,exponent:P,externalResourcesRequired:null,fill:null,fillOpacity:P,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:wt,g2:wt,glyphName:wt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:P,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:P,horizOriginX:P,horizOriginY:P,id:null,ideographic:P,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:P,k:P,k1:P,k2:P,k3:P,k4:P,kernelMatrix:Pe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:P,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:P,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,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:P,overlineThickness:P,paintOrder:null,panose1:null,path:null,pathLength:P,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ae,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:P,pointsAtY:P,pointsAtZ:P,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pe,rev:Pe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pe,requiredFeatures:Pe,requiredFonts:Pe,requiredFormats:Pe,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:P,specularExponent:P,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:P,strikethroughThickness:P,string:null,stroke:null,strokeDashArray:Pe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:P,strokeOpacity:P,strokeWidth:null,style:null,surfaceScale:P,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pe,tabIndex:P,tableValues:null,target:null,targetX:P,targetY:P,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:P,underlineThickness:P,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:P,values:null,vAlphabetic:P,vMathematical:P,vectorEffect:null,vHanging:P,vIdeographic:P,version:null,vertAdvY:P,vertOriginX:P,vertOriginY:P,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:P,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ns}),is=It({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}
vendor: 4,084 bytes, lines 47-48
47,space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),os=It({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rs}),as=It({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Hd={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"},Wd=/[A-Z]/g,no=/-[a-z]/g,Jd=/^data[-\w.:]+$/i;function Gd(e,t){const n=br(t);let r=t,i=Ce;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Jd.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(no,Kd);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!no.test(o)){let a=o.replace(Wd,Yd);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=jr}return new i(r,t)}function Yd(e){return"-"+e.toLowerCase()}function Kd(e){return e.charAt(1).toUpperCase()}const Xd=es([ts,Vd,is,os,as],"html"),Lr=es([ts,qd,is,os,as],"svg");function Qd(e){return e.join(" ").trim()}var yt={},Hn,ro;function em(){if(ro)return Hn;ro=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,u=` 48`,l="/",p="*",c="",h="comment",f="declaration";function g(b,d){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];d=d||{};var v=1,m=1;function I(L){var T=L.match(t);T&&(v+=T.length);var R=L.lastIndexOf(u);m=~R?L.length-R:m+L.length}function A(){var L={line:v,column:m};return function(T){return T.position=new w(L),q(),T}}function w(L){this.start=L,this.end={line:v,column:m},this.source=d.source}w.prototype.content=b;function z(L){var T=new Error(d.source+":"+v+":"+m+": "+L);if(T.reason=L,T.filename=d.source,T.line=v,T.column=m,T.source=b,!d.silent)throw T}function j(L){var T=L.exec(b);if(T){var R=T[0];return I(R),b=b.slice(R.length),T}}function q(){j(n)}function _(L){var T;for(L=L||[];T=D();)T!==!1&&L.push(T);return L}function D(){var L=A();if(!(l!=b.charAt(0)||p!=b.charAt(1))){for(var T=2;c!=b.charAt(T)&&(p!=b.charAt(T)||l!=b.charAt(T+1));)++T;if(T+=2,c===b.charAt(T-1))return z("End of comment missing");var R=b.slice(2,T-2);return m+=2,I(R),b=b.slice(T),m+=2,L({type:h,comment:R})}}function $(){var L=A(),T=j(r);if(T){if(D(),!j(i))return z("property missing ':'");var R=j(o),H=L({type:f,property:k(T[0].replace(e,c)),value:R?k(R[0].replace(e,c)):c});return j(a),H}}function X(){var L=[];_(L);for(var T;T=$();)T!==!1&&(L.push(T),_(L));return L}return q(),X()}function k(b){return b?b.replace(s,c):c}return Hn=g,Hn}var io;function tm(){if(io)return yt;io=1;var e=yt&&yt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yt,"__esModule",{value:!0}),yt.default=n;const t=e(em());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),s=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:p}=u;s?i(l,p,u):p&&(o=o||{},o[l]=p)}),o}return yt}var Pt={},oo;function nm(){if(oo)return Pt;oo=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(l){return!l||n.test(l)||e.test(l)},a=function(l,p){return p.toUpperCase()},s=function(l,p){return"".concat(p,"-")},u=function(l,p){return p===void 0&&(p={}),o(l)?l:(l=l.toLowerCase(),p.reactCompat?l=l.replace(i,s):l=l.replace(r,s),l.replace(t,a))};return Pt.camelCase=u,Pt}var Nt,ao;function rm(){if(ao)return Nt;ao=1;var e=Nt&&Nt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(tm()),n=nm();function r(i,o){var a={};
vendor: 2,733 bytes, line 48
48return!i||typeof i!="string"||(0,t.default)(i,function(s,u){s&&u&&(a[(0,n.camelCase)(s,o)]=u)}),a}return r.default=r,Nt=r,Nt}var im=rm();const om=Ar(im),ss=ls("end"),Fr=ls("start");function ls(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 us(e){const t=Fr(e),n=ss(e);if(t&&n)return{start:t,end:n}}function Zt(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?so(e.position):"start"in e||"end"in e?so(e):"line"in e||"column"in e?kr(e):""}function kr(e){return lo(e&&e.line)+":"+lo(e&&e.column)}function so(e){return kr(e&&e.start)+"-"+kr(e&&e.end)}function lo(e){return e&&typeof e=="number"?e:1}class be extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.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=Zt(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}be.prototype.file="";be.prototype.name="";be.prototype.reason="";be.prototype.message="";be.prototype.stack="";be.prototype.column=void 0;be.prototype.line=void 0;be.prototype.ancestors=void 0;be.prototype.cause=void 0;be.prototype.fatal=void 0;be.prototype.place=void 0;be.prototype.ruleId=void 0;be.prototype.source=void 0;const Zr={}.hasOwnProperty,am=new Map,sm=/[A-Z]/g,lm=new Set(["table","tbody","thead","tfoot","tr"]),um=new Set(["td","th"]),cs="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cm(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=bm(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,302 bytes, line 48
48if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=ym(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"?Lr:Xd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=ps(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function ps(e,t,n){if(t.type==="element")return pm(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fm(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return dm(e,t,n);if(t.type==="mdxjsEsm")return hm(e,t);if(t.type==="root")return mm(e,t,n);if(t.type==="text")return gm(e,t)}function pm(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Lr,e.schema=i),e.ancestors.push(t);const o=hs(e,t.tagName,!1),a=xm(e,t);let s=Ur(e,t);return lm.has(t.tagName)&&(s=s.filter(function(u){return typeof u=="string"?!Bd(u):!0})),fs(e,a,o,t),Br(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function fm(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)}Yt(e,t.position)}function hm(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Yt(e,t.position)}function dm(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Lr,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:hs(e,t.name,!0),a=vm(e,t),s=Ur(e,t);return fs(e,a,o,t),Br(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function mm(e,t,n){const r={};return Br(r,Ur(e,t)),e.create(t,e.Fragment,r,n)}function gm(e,t){return t.value}function fs(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 ym(e,t,n){return r;function r(i,o,a,s){const l=Array.isArray(a.children)?n:t;return s?l(o,a,s):l(o,a)}}function bm(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),u=Fr(r);return t(i,o,a,s,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function xm(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Zr.call(t.properties,i)){const o=km(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&um.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vm(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Yt(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(s.expression)}else Yt(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Ur(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:am;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const l=i.get(u)||0;a=u+"-"+l,i.set(u,l+1)}}const s=ps(e,o,a);s!==void 0&&n.push(s)}return n}function km(e,t,n){const r=Gd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Md(n):Qd(n)),r.property==="style"){let i=typeof n=="object"?n:wm(e,String(n));return e.stylePropertyNameCase==="css"&&(i=_m(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Hd[r.property]||r.property:r.attribute,n]}}function wm(e,t){try{return om(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new be("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=cs+"#cannot-parse-style-attribute",i}}function hs(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Qi(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Qi(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Zr.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yt(e)}function Yt(e,t){const n=new be("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=cs+"#cannot-handle-mdx-estrees-without-createevaluater",n}function _m(e){const t={};let n;for(n in e)Zr.call(e,n)&&(t[Sm(n)]=e[n]);return t}function Sm(e){let t=e.replace(sm,Em);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Em(e){return"-"+e.toLowerCase()}const Wn={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"]},Im={};function Vr(e,t){const n=Im,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ds(e,r,i)}function ds(e,t,n){if(Cm(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 uo(e.children,t,n)}return Array.isArray(e)?uo(e,t,n):""}function uo(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ds(e[i],t,n);return r.join("")}function Cm(e){return!!(e&&typeof e=="object")}const co=document.createElement("i");function qr(e){const t="&"+e+";";co.innerHTML=t;const n=co.textContent;
vendor: 10,865 bytes, line 48
48return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ne(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function De(e,t){return e.length>0?(Ne(e,e.length,0,t),e):t}const po={}.hasOwnProperty;function ms(e){const t={};let n=-1;for(;++n<e.length;)Tm(t,e[n]);return t}function Tm(e,t){let n;for(n in t){const i=(po.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){po.call(i,a)||(i[a]=[]);const s=o[a];Am(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Am(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ne(e,0,0,r)}function gs(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 Le(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const we=nt(/[A-Za-z]/),ye=nt(/[\dA-Za-z]/),zm=nt(/[#-'*+\--9=?A-Z^-~]/);function Sn(e){return e!==null&&(e<32||e===127)}const wr=nt(/\d/),Pm=nt(/[\dA-Fa-f]/),Nm=nt(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function oe(e){return e!==null&&(e<0||e===32)}function G(e){return e===-2||e===-1||e===32}const Nn=nt(new RegExp("\\p{P}|\\p{S}","u")),ct=nt(/\s/);function nt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ct(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&ye(e.charCodeAt(n+1))&&ye(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Q(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(u){return G(u)?(e.enter(n),s(u)):t(u)}function s(u){return G(u)&&o++<i?(e.consume(u),s):(e.exit(n),t(u))}}const Om={tokenize:Rm};function Rm(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"),Q(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Z(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const Dm={tokenize:$m},fo={tokenize:Mm};function $m(e){const t=this,n=[];let r=0,i,o,a;return s;function s(m){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,u,l)(m)}return l(m)}function u(m){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const I=t.events.length;let A=I,w;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){w=t.events[A][1].end;break}d(r);let z=I;for(;z<t.events.length;)t.events[z][1].end={...w},z++;return Ne(t.events,A+1,0,t.events.slice(I)),t.events.length=z,l(m)}return s(m)}function l(m){if(r===n.length){if(!i)return h(m);if(i.currentConstruct&&i.currentConstruct.concrete)return g(m);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fo,p,c)(m)}function p(m){return i&&v(),d(r),h(m)}function c(m){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(m)}function h(m){return t.containerState={},e.attempt(fo,f,g)(m)}function f(m){return r++,n.push([t.currentConstruct,t.containerState]),h(m)}function g(m){if(m===null){i&&v(),d(0),e.consume(m);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),k(m)}function k(m){if(m===null){b(e.exit("chunkFlow"),!0),d(0),e.consume(m);return}return Z(m)?(e.consume(m),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(m),k)}function b(m,I){const A=t.sliceStream(m);if(I&&A.push(null),m.previous=o,o&&(o.next=m),o=m,i.defineSkip(m.start),i.write(A),t.parser.lazy[m.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<a&&(!i.events[w][1].end||i.events[w][1].end.offset>a))return;const z=t.events.length;let j=z,q,_;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(q){_=t.events[j][1].end;break}q=!0}for(d(r),w=z;w<t.events.length;)t.events[w][1].end={..._},w++;Ne(t.events,j+1,0,t.events.slice(z)),t.events.length=w}}function d(m){let I=n.length;for(;I-- >m;){const A=n[I];t.containerState=A[1],A[0].exit.call(t,e)}n.length=m}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mm(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function St(e){if(e===null||oe(e)||ct(e))return 1;if(Nn(e))return 2}function On(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _r={name:"attention",resolveAll:jm,tokenize:Lm};function jm(e,t){let n=-1,r,i,o,a,s,u,l,p;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 c={...e[r][1].end},h={...e[n][1].start};ho(c,-u),ho(h,u),a={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},s={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=De(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=De(l,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),l=De(l,On(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=De(l,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,l=De(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ne(e,r-1,n-r+3,l),n=r+l.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Lm(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=St(r);let o;return a;function a(u){return o=u,e.enter("attentionSequence"),s(u)}function s(u){if(u===o)return e.consume(u),s;const l=e.exit("attentionSequence"),p=St(u),c=!p||p===2&&i||n.includes(u),h=!i||i===2&&p||n.includes(r);return l._open=!!(o===42?c:c&&(i||!h)),l._close=!!(o===42?h:h&&(p||!c)),t(u)}}function ho(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Fm={name:"autolink",tokenize:Zm};function Zm(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return we(f)?(e.consume(f),a):f===64?n(f):l(f)}function a(f){return f===43||f===45||f===46||ye(f)?(r=1,s(f)):l(f)}function s(f){return f===58?(e.consume(f),r=0,u):(f===43||f===45||f===46||ye(f))&&r++<32?(e.consume(f),s):(r=0,l(f))}function u(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Sn(f)?n(f):(e.consume(f),u)}function l(f){return f===64?(e.consume(f),p):zm(f)?(e.consume(f),l):n(f)}function p(f){return ye(f)?c(f):n(f)}function c(f){return f===46?(e.consume(f),r=0,p):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||ye(f))&&r++<63){const g=f===45?h:c;return e.consume(f),g}return n(f)}}const on={partial:!0,tokenize:Bm};function Bm(e,t,n){return r;function r(o){return G(o)?Q(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Z(o)?t(o):n(o)}}const ys={continuation:{tokenize:Vm},exit:qm,name:"blockQuote",tokenize:Um};function Um(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return G(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Vm(e,t,n){const r=this;return i;function i(a){return G(a)?Q(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(ys,t,n)(a)}}function qm(e){e.exit("blockQuote")}const bs={name:"characterEscape",tokenize:Hm};function Hm(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Nm(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const xs={name:"characterReference",tokenize:Wm};function Wm(e,t,n){const r=this;let i=0,o,a;return s;function s(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,a=ye,p(c))}function l(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Pm,p):(e.enter("characterReferenceValue"),o=7,a=wr,p(c))}function p(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return a===ye&&!qr(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<o?(e.consume(c),p):n(c)}}const mo={partial:!0,tokenize:Gm},go={concrete:!0,name:"codeFenced",tokenize:Jm};function Jm(e,t,n){const r=this,i={partial:!0,tokenize:A};let o=0,a=0,s;return u;function u(w){return l(w)}function l(w){const z=r.events[r.events.length-1];return o=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,s=w,e.enter("co
48deFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(w)}function p(w){return w===s?(a++,e.consume(w),p):a<3?n(w):(e.exit("codeFencedFenceSequence"),G(w)?Q(e,c,"whitespace")(w):c(w))}function c(w){return w===null||Z(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(mo,k,I)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||Z(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(w)):G(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Q(e,f,"whitespace")(w)):w===96&&w===s?n(w):(e.consume(w),h)}function f(w){return w===null||Z(w)?c(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||Z(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(w)):w===96&&w===s?n(w):(e.consume(w),g)}function k(w){return e.attempt(i,I,b)(w)}function b(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),d}function d(w){return o>0&&G(w)?Q(e,v,"linePrefix",o+1)(w):v(w)}function v(w){return w===null||Z(w)?e.check(mo,k,I)(w):(e.enter("codeFlowValue"),m(w))}function m(w){return w===null||Z(w)?(e.exit("codeFlowValue"),v(w)):(e.consume(w),m)}function I(w){return e.exit("codeFenced"),t(w)}function A(w,z,j){let q=0;return _;function _(T){return w.enter("lineEnding"),w.consume(T),w.exit("lineEnding"),D}function D(T){return w.enter("codeFencedFence"),G(T)?Q(w,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):$(T)}function $(T){return T===s?(w.enter("codeFencedFenceSequence"),X(T)):j(T)}function X(T){return T===s?(q++,w.consume(T),X):q>=a?(w.exit("codeFencedFenceSequence"),G(T)?Q(w,L,"whitespace")(T):L(T)):j(T)}function L(T){return T===null||Z(T)?(w.exit("codeFencedFence"),z(T)):j(T)}}}function Gm(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Jn={name:"codeIndented",tokenize:Km},Ym={partial:!0,tokenize:Xm};function Km(e,t,n){const r=this;return i;function i(l){return e.enter("codeIndented"),Q(e,o,"linePrefix",5)(l)}function o(l){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(l):n(l)}function a(l){return l===null?u(l):Z(l)?e.attempt(Ym,a,u)(l):(e.enter("codeFlowValue"),s(l))}function s(l){return l===null||Z(l)?(e.exit("codeFlowValue"),a(l)):(e.consume(l),s)}function u(l){return e.exit("codeIndented"),t(l)}}function Xm(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Z(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Q(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):Z(a)?i(a):n(a)}}const Qm={name:"codeText",previous:tg,resolve:eg,tokenize:ng};function eg(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 tg(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ng(e,t,n){let r=0,i,o;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),s(c)}function s(c){return c===96?(e.consume(c),r++,s):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,p(c)):Z(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),l(c))}function l(c){return c===null||c===32||c===96||Z(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),l)}function p(c){return c===96?(e.consume(c),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",l(c))}}class rg{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 o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ot(this.left,r),o.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),Ot(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ot(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);Ot(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ot(this.left,n.reverse())}}}function Ot(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 vs(e){const t={};let n=-1,r,i,o,a,s,u,l;const p=new rg(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ig(p,n)),n=t[n],l=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=p.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},s=p.slice(i,n),s.unshift(r),p.splice(i,n-i+1,s))}}return Ne(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!l}function ig(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,u=[],l={};let p,c,h=-1,f=n,g=0,k=0;const b=[k];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(p=r.sliceStream(f),f.next||p.push(null),c&&a.defineSki
vendor: 18,527 bytes, line 48
48p(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=f,f=f.next}for(f=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(k=h+1,b.push(k),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):b.pop(),h=b.length;h--;){const d=s.slice(b[h],b[h+1]),v=o.pop();u.push([v,v+d.length-1]),e.splice(v,2,d)}for(u.reverse(),h=-1;++h<u.length;)l[g+u[h][0]]=g+u[h][1],g+=u[h][1]-u[h][0]-1;return l}const og={resolve:sg,tokenize:lg},ag={partial:!0,tokenize:ug};function sg(e){return vs(e),e}function lg(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?o(s):Z(s)?e.check(ag,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ug(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Q(e,o,"linePrefix")}function o(a){if(a===null||Z(a))return n(a);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(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function ks(e,t,n,r,i,o,a,s,u){const l=u||Number.POSITIVE_INFINITY;let p=0;return c;function c(d){return d===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(d),e.exit(o),h):d===null||d===32||d===41||Sn(d)?n(d):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),k(d))}function h(d){return d===62?(e.enter(o),e.consume(d),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===62?(e.exit("chunkString"),e.exit(s),h(d)):d===null||d===60||Z(d)?n(d):(e.consume(d),d===92?g:f)}function g(d){return d===60||d===62||d===92?(e.consume(d),f):f(d)}function k(d){return!p&&(d===null||d===41||oe(d))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(d)):p<l&&d===40?(e.consume(d),p++,k):d===41?(e.consume(d),p--,k):d===null||d===32||d===40||Sn(d)?n(d):(e.consume(d),d===92?b:k)}function b(d){return d===40||d===41||d===92?(e.consume(d),k):k(d)}}function ws(e,t,n,r,i,o){const a=this;let s=0,u;return l;function l(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),p}function p(f){return s>999||f===null||f===91||f===93&&!u||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):Z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||Z(f)||s++>999?(e.exit("chunkString"),p(f)):(e.consume(f),u||(u=!G(f)),f===92?h:c)}function h(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function _s(e,t,n,r,i,o){let a;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,u):n(h)}function u(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),l(h))}function l(h){return h===a?(e.exit(o),u(a)):h===null?n(h):Z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Q(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===a||h===null||Z(h)?(e.exit("chunkString"),l(h)):(e.consume(h),h===92?c:p)}function c(h){return h===a||h===92?(e.consume(h),p):p(h)}}function Bt(e,t){let n;return r;function r(i){return Z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):G(i)?Q(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const cg={name:"definition",tokenize:fg},pg={partial:!0,tokenize:hg};function fg(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),a(f)}function a(f){return ws.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return oe(f)?Bt(e,l)(f):l(f)}function l(f){return ks(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function p(f){return e.attempt(pg,c,c)(f)}function c(f){return G(f)?Q(e,h,"whitespace")(f):h(f)}function h(f){return f===null||Z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function hg(e,t,n){return r;function r(s){return oe(s)?Bt(e,i)(s):n(s)}function i(s){return _s(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return G(s)?Q(e,a,"whitespace")(s):a(s)}function a(s){return s===null||Z(s)?t(s):n(s)}}const dg={name:"hardBreakEscape",tokenize:mg};function mg(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const gg={name:"headingAtx",resolve:yg,tokenize:bg};function yg(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ne(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function bg(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||oe(p)?(e.exit("atxHeadingSequence"),s(p)):n(p)}function s(p){return p===35?(e.enter("atxHeadingSequence"),u(p)):p===null||Z(p)?(e.exit("atxHeading"),t(p)):G(p)?Q(e,s,"whitespace")(p):(e.enter("atxHeadingText"),l(p))}function u(p){return p===35?(e.consume(p),u):(e.exit("atxHeadingSequence"),s(p))}function l(p){return p===null||p===35||oe(p)?(e.exit("atxHeadingText"),s(p)):(e.consume(p),l)}}const xg=["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"],yo=["pre","script","style","textarea"],vg={concrete:!0,name:"htmlFlow",resolveTo:_g,tokenize:Sg},kg={partial:!0,tokenize:Ig},wg={partial:!0,tokenize:Eg};function _g(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 Sg(e,t,n){const r=this;let i,o,a,s,u;return l;function l(x){return p(x)}function p(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),h):x===47?(e.consume(x),o=!0,k):x===63?(e.consume(x),i=3,r.interrupt?t:y):we(x)?(e.consume(x),a=String.fromCharCode(x),b):n(x)}function h(x){return x===45?(e.consume(x),i=2,f):x===91?(e.consume(x),i=5,s=0,g):we(x)?(e.consume(x),i=4,r.interrupt?t:y):n(x)}function f(x){return x===45?(e.consume(x),r.interrupt?t:y):n(x)}function g(x){const Te="CDATA[";return x===Te.charCodeAt(s++)?(e.consume(x),s===Te.length?r.interrupt?t:$:g):n(x)}function k(x){return we(x)?(e.consume(x),a=String.fromCharCode(x),b):n(x)}function b(x){if(x===null||x===47||x===62||oe(x)){const Te=x===47,Fe=a.toLowerCase();return!Te&&!o&&yo.includes(Fe)?(i=1,r.interrupt?t(x):$(x)):xg.includes(a.toLowerCase())?(i=6,Te?(e.consume(x),d):r.interrupt?t(x):$(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):o?v(x):m(x))}return x===45||ye(x)?(e.consume(x),a+=String.fromCharCode(x),b):n(x)}function d(x){return x===62?(e.consume(x),r.interrupt?t:$):n(x)}function v(x){return G(x)?(e.consume(x),v):_(x)}function m(x){return x===47?(e.consume(x),_):x===58||x===95||we(x)?(e.consume(x),I):G(x)?(e.consume(x),m):_(x)}function I(x){return x===45||x===46||x===58||x===95||ye(x)?(e.consume(x),I):A(x)}function A(x){return x===61?(e.consume(x),w):G(x)?(e.consume(x),A):m(x)}function w(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,z):G(x)?(e.consume(x),w):j(x)}function z(x){return x===u?(e.consume(x),u=null,q):x===null||Z(x)?n(x):(e.consume(x),z)}function j(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||oe(x)?A(x):(e.consume(x),j)}function q(x){return x===47||x===62||G(x)?m(x):n(x)}function _(x){return x===62?(e.consume(x),D):n(x)}function D(x){return x===null||Z(x)?$(x):G(x)?(e.consume(x),D):n(x)}function $(x){return x===45&&i===2?(e.consume(x),R):x===60&&i===1?(e.consume(x),H):x===62&&i===4?(e.consume(x),xe):x===63&&i===3?(e.consume(x),y):x===93&&i===5?(e.consume(x),le):Z(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(kg,Se,X)(x)):x===null||Z(x)?(e.exit("htmlFlowData"),X(x)):(e.consume(x),$)}function X(x){return e.check(wg,L,Se)(x)}function L(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),T}function T(x){return x===null||Z(x)?X(x):(e.enter("htmlFlowData"),$(x))}function R(x){return x===45?(e.consume(x),y):$(x)}function H(x){return x===47?(e.consume(x),a="",ee):$(x)}function ee(x){if(x===62){const Te=a.toLowerCase();return yo.includes(Te)?(e.consume(x),xe):$(x)}return we(x)&&a.length<8?(e.consume(x),a+=String.fromCharCode(x),ee):$(x)}function le(x){return x===93?(e.consume(x),y):$(x)}function y(x){return x===62?(e.consume(x),xe):x===45&&i===2?(e.consume(x),y):$(x)}function xe(x){return x===null||Z(x)?(e.exit("htmlFlowData"),Se(x)):(e.consume(x),xe)}function Se(x){return e.exit("htmlFlow"),t(x)}}function Eg(e,t,n){const r=this;return i;function i(a){return Z(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Ig(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(on,t,n)}}const Cg={name:"htmlText",tokenize:Tg};function Tg(e,t,n){const r=this;let i,o,a;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),A):y===63?(e.consume(y),m):we(y)?(e.consume(y),j):n(y)}function l(y){return y===45?(e.consume(y),p):y===91?(e.consume(y),o=0,g):we(y)?(e.consume(y),v):n(y)}function p(y){return y===45?(e.consume(y),f):n(y)}function c(y){return y===null?n(y):y===45?(e.consume(y),h):Z(y)?(a=c,H(y)):(e.consume(y),c)}function h(y){return y===45?(e.consume(y),f):c(y)}function f(y){return y===62?R(y):y===45?h(y):c(y)}function g(y){const xe="CDATA[";return y===xe.charCodeAt(o++)?(e.consume(y),o===xe.length?k:g):n(y)}function k(y){return y===null?n(y):y===93?(e.consume(y),b):Z(y)?(a=k,H(y)):(e.consume(y),k)}function b(y){return y===93?(e.consume(y),d):k(y)}function d(y){return y===62?R(y):y===93?(e.consume(y),d):k(y)}function v(y){return y===null||y===62?R(y):Z(y)?(a=v,H(y)):(e.consume(y),v)}function m(y){return y===null?n(y):y===63?(e.consume(y),I):Z(y)?(a=m,H(y)):(e.consume(y),m)}function I(y){return y===62?R(y):m(y)}function A(y){return we(y)?(e.consume(y),w):n(y)}function w(y){return y===45||ye(y)?(e.consume(y),w):z(y)}function z(y){return Z(y)?(a=z,H(y)):G(y)?(e.consume(y),z):R(y)}function j(y){return y===45||ye(y)?(e.consume(y),j):y===47||y===62||oe(y)?q(y):n(y)}function q(y){return y===47?(e.consume(y),R):y===58||y===95||we(y)?(e.consume(y),_):Z(y)?(a=q,H(y)):G(y)?(e.consume(y),q):R(y)}function _(y){return y===45||y===46||y===58||y===95||ye(y)?(e.consume(y),_):D(y)}function D(y){return y===61?(e.consume(y),$):Z(y)?(a=D,H(y)):G(y)?(e.consume(y),D):q(y)}function $(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),i=y,X):Z(y)?(a=$,H(y)):G(y)?(e.consume(y),$):(e.consume(y),L)}function X(y){return y===i?(e.consume(y),i=void 0,T):y===null?n(y):Z(y)?(a=X,H(y)):(e.consume(y),X)}function L(y){return y===null||y===34||y===39||y===60||y===61||y===96?n(y):y===47||y===62||oe(y)?q(y):(e.consume(y),L)}function T(y){return y===47||y===62||oe(y)?q(y):n(y)}function R(y){return y===62?(e.consume(y),e.exit("htmlTextData"),e.exit("htmlText"),t):n(y)}function H(y){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),ee}function ee(y){return G(y)?Q(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):le(y)}function le(y){return e.enter("htmlTextData"),a(y)}}const Hr={name:"labelEnd",resolveAll:Ng,resolveTo:Og,tokenize:Rg},Ag={tokenize:Dg},zg={tokenize:$g},Pg={tokenize:Mg};function Ng(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&&Ne(e,0,e.length,n),e}function Og(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",u,t],["enter",l,t]],s=De(s,e.slice(o+1,o+r+3)),s=De(s,[["enter",p,t]]),s=De(s,On(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=De(s,[["exit",p,t],e[a-2],e[a-1],["exit",l,t]]),s=De(s,e.slice(a+1)),s=De(s,[["exit",u,t]]),Ne(e,o,e.length,s),e}function Rg(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(h){return o?o._inactive?c(h):(a=r.parser.defined.includes(Le(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(Ag,p,a?p:c)(h):h===91?e.attempt(zg,p,a?l:c)(h):a?p(h):c(h)}function l(h){return e.attempt(Pg,p,c)(h)}function p(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function Dg(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return oe(c)?Bt(e,o)(c):o(c)}function o(c){return c===41?p(c):ks(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return oe(c)?Bt(e,u)(c):p(c)}function s(c){return n(c)}function u(c){return c===34||c===39||c===40?_s(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):p(c)}function l(c){return oe(c)?Bt(e,p)(c):p(c)}function p(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function $g(e,t,n){const r=this;return i;function i(s){return ws.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function Mg(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const jg={name:"labelStartImage",resolveAll:Hr.resolveAll,tokenize:Lg};function Lg(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Fg={name:"labelStartLink",resolveAll:Hr.resolveAll,tokenize:Zg};function Zg(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Gn={name:"lineEnding",tokenize:Bg};function Bg(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Q(e,t,"linePrefix")}}const bn={name:"thematicBreak",tokenize:Ug};function Ug(e,t,n){let r=0,i;return o;function o(l){return e.enter("thematicBreak"),a(l)}function a(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"),G(l)?Q(e,s,"whitespace")(l):s(l))}}const Ee={continuation:{tokenize:Wg},exit:Gg,name:"list",tokenize:Hg},Vg={partial:!0,tokenize:Yg},qg={partial:!0,tokenize:Jg};function Hg(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:wr(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(bn,n,l)(f):l(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return wr(f)&&++a<10?(e.consume(f),u):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),l(f)):n(f)}function l(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(on,r.interrupt?n:p,e.attempt(Vg,h,c))}
vendor: 8,907 bytes, lines 48-50
48function p(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function c(f){return G(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Wg(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(on,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!G(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qg,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(Ee,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Jg(e,t,n){const r=this;return Q(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Gg(e){e.exit(this.containerState.type)}function Yg(e,t,n){const r=this;return Q(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!G(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const bo={name:"setextUnderline",resolveTo:Kg,tokenize:Xg};function Kg(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Xg(e,t,n){const r=this;let i;return o;function o(l){let p=r.events.length,c;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){c=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=l,a(l)):n(l)}function a(l){return e.enter("setextHeadingLineSequence"),s(l)}function s(l){return l===i?(e.consume(l),s):(e.exit("setextHeadingLineSequence"),G(l)?Q(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||Z(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const Qg={tokenize:ey};function ey(e){const t=this,n=e.attempt(on,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(og,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ty={resolveAll:Es()},ny=Ss("string"),ry=Ss("text");function Ss(e){return{resolveAll:Es(e==="text"?iy:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(p){return l(p)?o(p):s(p)}function s(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return l(p)?(n.exit("data"),o(p)):(n.consume(p),u)}function l(p){if(p===null)return!0;const c=i[p];let h=-1;if(c)for(;++h<c.length;){const f=c[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Es(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function iy(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 o=i.length,a=-1,s=0,u;for(;o--;){const l=i[o];if(typeof l=="string"){for(a=l.length;l.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(l===-2)u=!0,s++;else if(l!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const l={type:n===e.length||u||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,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 oy={42:Ee,43:Ee,45:Ee,48:Ee,49:Ee,50:Ee,51:Ee,52:Ee,53:Ee,54:Ee,55:Ee,56:Ee,57:Ee,62:ys},ay={91:cg},sy={[-2]:Jn,[-1]:Jn,32:Jn},ly={35:gg,42:bn,45:[bo,bn],60:vg,61:bo,95:bn,96:go,126:go},uy={38:xs,92:bs},cy={[-5]:Gn,[-4]:Gn,[-3]:Gn,33:jg,38:xs,42:_r,60:[Fm,Cg],91:Fg,92:[dg,bs],93:Hr,95:_r,96:Qm},py={null:[_r,ty]},fy={null:[42,95]},hy={null:[]},dy=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fy,contentInitial:ay,disable:hy,document:oy,flow:ly,flowInitial:sy,insideSpan:py,string:uy,text:cy},Symbol.toStringTag,{value:"Module"}));function my(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const u={attempt:z(A),check:z(w),consume:v,enter:m,exit:I,interrupt:z(w,{interrupt:!0})},l={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:c};let p=t.tokenize.call(l,u);return t.resolveAll&&o.push(t),l;function c(D){return a=De(a,D),b(),a[a.length-1]!==null?[]:(j(t,0),l.events=On(o,l.events,l),l.events)}function h(D,$){return yy(f(D),$)}function f(D){return gy(a,D)}function g(){const{_bufferIndex:D,_index:$,line:X,column:L,offset:T}=r;return{_bufferIndex:D,_index:$,line:X,column:L,offset:T}}function k(D){i[D.line]=D.column,_()}function b(){let D;for(;r._index<a.length;){const $=a[r._index];if(typeof $=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<$.length;)d($.charCodeAt(r._bufferIndex));else d($)}}function d(D){p=p(D)}function v(D){Z(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,_()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=D}function m(D,$){const X=$||{};return X.type=D,X.start=g(),l.events.push(["enter",X,l]),s.push(X),X}function I(D){const $=s.pop();return $.end=g(),l.events.push(["exit",$,l]),$}function A(D,$){j(D,$.from)}function w(D,$){$.restore()}function z(D,$){return X;function X(L,T,R){let H,ee,le,y;return Array.isArray(L)?Se(L):"tokenize"in L?Se([L]):xe(L);function xe(de){return F;function F(Ae){const ht=Ae!==null&&de[Ae],dt=Ae!==null&&de.null,ln=[...Array.isArray(ht)?ht:ht?[ht]:[],...Array.isArray(dt)?dt:dt?[dt]:[]];return Se(ln)(Ae)}}function Se(de){return H=de,ee=0,de.length===0?R:x(de[ee])}function x(de){return F;function F(Ae){return y=q(),le=de,de.partial||(l.currentConstruct=de),de.name&&l.parser.constructs.disable.null.includes(de.name)?Fe():de.tokenize.call($?Object.assign(Object.create(l),$):l,u,Te,Fe)(Ae)}}function Te(de){return D(le,y),T}function Fe(de){return y.restore(),++ee<H.length?x(H[ee]):R}}}function j(D,$){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&Ne(l.events,$,l.events.length-$,D.resolve(l.events.slice($),l)),D.resolveTo&&(l.events=D.resolveTo(l.events,l))}function q(){const D=g(),$=l.previous,X=l.currentConstruct,L=l.events.length,T=Array.from(s);return{from:L,restore:R};function R(){r=D,l.previous=$,l.currentConstruct=X,l.events.length=L,s=T,_()}}function _(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function gy(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function yy(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=` 49`;break}case-3:{a=`\r 50`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function by(e){const r={constructs:ms([dy,...(e||{}).extensions||[]]),content:i(Om),defined:[],document:i(Dm),flow:i(Qg),lazy:{},string:i(ny),text:i(ry)};return r;function i(o){return a;function a(s){return my(r,o,s)}}}function xy(e){for(;!vs(e););return e}const xo=/[\0\t\n\r]/g;function vy(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const u=[];let l,p,c,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),c=0,t="",n&&(o.charCo
vendor: 10,989 bytes, line 50
50deAt(0)===65279&&c++,n=void 0);c<o.length;){if(xo.lastIndex=c,l=xo.exec(o),h=l&&l.index!==void 0?l.index:o.length,f=o.charCodeAt(h),!l){t=o.slice(c);break}if(f===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(o.slice(c,h)),e+=h-c),f){case 0:{u.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,u.push(-2);e++<p;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return s&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const ky=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wy(e){return e.replace(ky,_y)}function _y(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return gs(n.slice(o?2:1),o?16:10)}return qr(n)||e}const Is={}.hasOwnProperty;function Sy(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Ey(n)(xy(by(n).document().write(vy()(e,t,!0))))}function Ey(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(oi),autolinkProtocol:q,autolinkEmail:q,atxHeading:o(ni),blockQuote:o(dt),characterEscape:q,characterReference:q,codeFenced:o(ln),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(ln,a),codeText:o(ll,a),codeTextData:q,data:q,codeFlowValue:q,definition:o(ul),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(cl),hardBreakEscape:o(ri),hardBreakTrailing:o(ri),htmlFlow:o(ii,a),htmlFlowData:q,htmlText:o(ii,a),htmlTextData:q,image:o(pl),label:a,link:o(oi),listItem:o(fl),listItemValue:h,listOrdered:o(ai,c),listUnordered:o(ai),paragraph:o(hl),reference:x,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(ni),strong:o(dl),thematicBreak:o(gl)},exit:{atxHeading:u(),atxHeadingSequence:A,autolink:u(),autolinkEmail:ht,autolinkProtocol:Ae,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:Fe,characterReferenceMarkerNumeric:Fe,characterReferenceValue:de,characterReference:F,codeFenced:u(b),codeFencedFence:k,codeFencedFenceInfo:f,codeFencedFenceMeta:g,codeFlowValue:_,codeIndented:u(d),codeText:u(T),codeTextData:_,data:_,definition:u(),definitionDestinationString:I,definitionLabelString:v,definitionTitleString:m,emphasis:u(),hardBreakEscape:u($),hardBreakTrailing:u($),htmlFlow:u(X),htmlFlowData:_,htmlText:u(L),htmlTextData:_,image:u(H),label:le,labelText:ee,lineEnding:D,link:u(R),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Te,resourceDestinationString:y,resourceTitleString:xe,resource:Se,setextHeading:u(j),setextHeadingLineSequence:z,setextHeadingText:w,strong:u(),thematicBreak:u()}};Cs(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(E){let N={type:"root",children:[]};const V={stack:[N],tokenStack:[],config:t,enter:s,exit:l,buffer:a,resume:p,data:n},Y=[];let re=-1;for(;++re<E.length;)if(E[re][1].type==="listOrdered"||E[re][1].type==="listUnordered")if(E[re][0]==="enter")Y.push(re);else{const $e=Y.pop();re=i(E,$e,re)}for(re=-1;++re<E.length;){const $e=t[E[re][0]];Is.call($e,E[re][1].type)&&$e[E[re][1].type].call(Object.assign({sliceSerialize:E[re][2].sliceSerialize},V),E[re][1])}if(V.tokenStack.length>0){const $e=V.tokenStack[V.tokenStack.length-1];($e[1]||vo).call(V,void 0,$e[0])}for(N.position={start:Ge(E.length>0?E[0][1].start:{line:1,column:1,offset:0}),end:Ge(E.length>0?E[E.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re<t.transforms.length;)N=t.transforms[re](N)||N;return N}function i(E,N,V){let Y=N-1,re=-1,$e=!1,rt,He,Tt,At;for(;++Y<=V;){const ze=E[Y];switch(ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ze[0]==="enter"?re++:re--,At=void 0;break}case"lineEndingBlank":{ze[0]==="enter"&&(rt&&!At&&!re&&!Tt&&(Tt=Y),At=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:At=void 0}if(!re&&ze[0]==="enter"&&ze[1].type==="listItemPrefix"||re===-1&&ze[0]==="exit"&&(ze[1].type==="listUnordered"||ze[1].type==="listOrdered")){if(rt){let mt=Y;for(He=void 0;mt--;){const We=E[mt];if(We[1].type==="lineEnding"||We[1].type==="lineEndingBlank"){if(We[0]==="exit")continue;He&&(E[He][1].type="lineEndingBlank",$e=!0),We[1].type="lineEnding",He=mt}else if(!(We[1].type==="linePrefix"||We[1].type==="blockQuotePrefix"||We[1].type==="blockQuotePrefixWhitespace"||We[1].type==="blockQuoteMarker"||We[1].type==="listItemIndent"))break}Tt&&(!He||Tt<He)&&(rt._spread=!0),rt.end=Object.assign({},He?E[He][1].start:ze[1].end),E.splice(He||Y,0,["exit",rt,ze[2]]),Y++,V++}if(ze[1].type==="listItemPrefix"){const mt={type:"listItem",_spread:!1,start:Object.assign({},ze[1].start),end:void 0};rt=mt,E.splice(Y,0,["enter",mt,ze[2]]),Y++,V++,Tt=void 0,At=!0}}}return E[N][1]._spread=$e,V}function o(E,N){return V;function V(Y){s.call(this,E(Y),Y),N&&N.call(this,Y)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(E,N,V){this.stack[this.stack.length-1].children.push(E),this.stack.push(E),this.tokenStack.push([N,V||void 0]),E.position={start:Ge(N.start),end:void 0}}function u(E){return N;function N(V){E&&E.call(this,V),l.call(this,V)}}function l(E,N){const V=this.stack.pop(),Y=this.tokenStack.pop();if(Y)Y[0].type!==E.type&&(N?N.call(this,E,Y[0]):(Y[1]||vo).call(this,E,Y[0]));else throw new Error("Cannot close `"+E.type+"` ("+Zt({start:E.start,end:E.end})+"): itâs not open");V.position.end=Ge(E.end)}function p(){return Vr(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(E){if(this.data.expectingFirstListItemValue){const N=this.stack[this.stack.length-2];N.start=Number.parseInt(this.sliceSerialize(E),10),this.data.expectingFirstListItemValue=void 0}}function f(){const E=this.resume(),N=this.stack[this.stack.length-1];N.lang=E}function g(){const E=this.resume(),N=this.stack[this.stack.length-1];N.meta=E}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const E=this.resume(),N=this.stack[this.stack.length-1];N.value=E.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function d(){const E=this.resume(),N=this.stack[this.stack.length-1];N.value=E.replace(/(\r?\n|\r)$/g,"")}function v(E){const N=this.resume(),V=this.stack[this.stack.length-1];V.label=N,V.identifier=Le(this.sliceSerialize(E)).toLowerCase()}function m(){const E=this.resume(),N=this.stack[this.stack.length-1];N.title=E}function I(){const E=this.resume(),N=this.stack[this.stack.length-1];N.url=E}function A(E){const N=this.stack[this.stack.length-1];if(!N.depth){const V=this.sliceSerialize(E).length;N.depth=V}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function z(E){const N=this.stack[this.stack.length-1];N.depth=this.sliceSerialize(E).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function q(E){const V=this.stack[this.stack.length-1].children;let Y=V[V.length-1];(!Y||Y.type!=="text")&&(Y=ml(),Y.position={start:Ge(E.start),end:void 0},V.push(Y)),this.stack.push(Y)}function _(E){const N=this.stack.pop();N.value+=this.sliceSerialize(E),N.position.end=Ge(E.end)}function D(E){const N=this.stack[this.stack.length-1];if(this.data.atHardBreak){const V=N.children[N.children.length-1];V.position.end=Ge(E.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(N.type)&&(q.call(this,E),_.call(this,E))}function $(){this.data.atHardBreak=!0}function X(){const E=this.resume(),N=this.stack[this.stack.length-1];N.value=E}function L(){const E=this.resume(),N=this.stack[this.stack.length-1];N.value=E}function T(){const E=this.resume(),N=this.stack[this.stack.length-1];N.value=E}function R(){const E=this.stack[this.stack.length-1];if(this.data.inReference){const N=this.data.referenceType||"shortcut";E.type+="Reference",E.referenceType=N,delete E.url,delete E.title}else delete E.identifier,delete E.label;this.data.referenceType=void 0}function H(){const E=this.stack[this.stack.length-1];if(this.data.inReference){const N=this.data.referenceType||"shortcut";E.type+="Reference",E.referenceType=N,delete E.url,delete E.title}else delete E.identifier,delete E.label;this.data.referenceType=void 0}function ee(E){const N=this.sliceSerialize(E),V=this.stack[this.stack.length-2];V.label=wy(N),V.identifier=Le(N).toLowerCase()}function le(){const E=this.stack[this.stack.length-1],N=this.resume(),V=this.stack[this.stack.length-1];if(this.data.inReference=!0,V.type==="link"){const Y=E.children;V.children=Y}else V.alt=N}function y(){const E=this.resume(),N=this.stack[this.stack.length-1];N.url=E}function xe(){const E=this.resume(),N=this.stack[this.stack.length-1];N.title=E}function Se(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function Te(E){const N=this.resume(),V=this.stack[this.stack.length-1];V.label=N,V.identifier=Le(this.sliceSerialize(E)).toLowerCase(),this.data.referenceType="full"}function Fe(E){this.data.characterReferenceType=E.type}function de(E){const N=this.sliceSerialize(E),V=this.data.characterReferenceType;let Y;V?(Y=gs(N,V==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Y=qr(N);const re=this.stack[this.stack.length-1];re.value+=Y}function F(E){const N=this.stack.pop();N.position.end=Ge(E.end)}function Ae(E){_.call(this,E);const N=this.stack[this.stack.length-1];N.url=this.sliceSerialize(E)}function ht(E){_.call(this,E);const N=this.stack[this.stack.length-1];N.url="mailto:"+this.sliceSerialize(E)}function dt(){return{type:"blockquote",children:[]}}function ln(){return{type:"code",lang:null,meta:null,value:""}}function ll(){return{type:"inlineCode",value:""}}function ul(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function cl(){return{type:"emphasis",children:[]}}function ni(){return{type:"heading",depth:0,children:[]}}function ri(){return{type:"break"}}function ii(){return{type:"html",value:""}}function pl(){return{type:"image",title:null,url:"",alt:null}}function oi(){return{type:"link",title:null,url:"",children:[]}}function ai(E){return{type:"list",ordered:E.type==="listOrdered",start:null,spread:E._spread,children:[]}}function fl(E){return{type:"listItem",spread:E._spread,checked:null,children:[]}}function hl(){return{type:"paragraph",children:[]}}function dl(){return{type:"strong",children:[]}}function ml(){return{type:"text",value:""}}function gl(){return{type:"thematicBreak"}}}function Ge(e){return{line:e.line,column:e.column,offset:e.offset}}function Cs(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Cs(e,r):Iy(e,r)}}function Iy(e,t){let n;for(n in t)if(Is.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 vo(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Zt({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Zt({start:t.start,end:t.end}
vendor: 10,608 bytes, lines 50-54
50)+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Zt({start:t.start,end:t.end})+") is still open")}function Cy(e){const t=this;t.parser=n;function n(r){return Sy(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ty(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 Ay(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` 51`}]}function zy(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 o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Py(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ny(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oy(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ct(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+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(a)}]};e.patch(t,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,l),e.applyData(t,l)}function Ry(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 Dy(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ts(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function $y(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ts(e,t);const i={src:Ct(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function My(e,t){const n={src:Ct(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 jy(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 Ly(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ts(e,t);const i={href:Ct(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Fy(e,t){const n={href:Ct(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 Zy(e,t,n){const r=e.all(t),i=n?By(n):As(t),o={},a=[];if(typeof t.checked=="boolean"){const p=r[0];let c;p&&p.type==="element"&&p.tagName==="p"?c=p:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const p=r[s];(i||s!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:` 53`}),p.type==="element"&&p.tagName==="p"&&!i?a.push(...p.children):a.push(p)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:` 54`});const l={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,l),e.applyData(t,l)}function By(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=As(n[r])}return t}function As(e){const t=e.spread;return t??e.children.length>1}function Uy(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 a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function Vy(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qy(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Hy(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wy(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Fr(t.children[1]),u=ss(t.children[t.children.length-1]);s&&u&&(a.position={start:s,end:u}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Jy(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let u=-1;const l=[];for(;++u<s;){const c=t.children[u],h={},f=a?a[u]:void 0;f&&(h.align=f);let g={type:"element",tagName:o,properties:h,children:[]};c&&(g.children=e.all(c),e.patch(c,g),g=e.applyData(c,g)),l.push(g)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,p),e.applyData(t,p)}function Gy(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ko=9,wo=32;function Yy(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(_o(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(_o(t.slice(i),i>0,!1)),o.join("")}function _o(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===ko||o===wo;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===ko||o===wo;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ky(e,t){const n={type:"text",value:Yy(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Xy(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Qy={blockquote:Ty,break:Ay,code:zy,delete:Py,emphasis:Ny,footnoteReference:Oy,heading:Ry,html:Dy,imageReference:$y,image:My,inlineCode:jy,linkReference:Ly,link:Fy,listItem:Zy,list:Uy,paragraph:Vy,root:qy,strong:Hy,table:Wy,tableCell:Gy,tableRow:Jy,text:Ky,thematicBreak:Xy,toml:fn,yaml:fn,definition:fn,footnoteDefinition:fn};function fn(){}const zs=-1,Rn=0,Ut=1,En=2,Wr=3,Jr=4,Gr=5,Yr=6,Ps=7,Ns=8,So=typeof self=="object"?self:globalThis,eb=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Rn:case zs:return n(a,i);case Ut:{const s=n([],i);for(const u of a)s.push(r(u));return s}case En:{const s=n({},i);for(const[u,l]of a)s[r(u)]=r(l);return s}case Wr:return n(new Date(a),i);case Jr:{const{source:s,flags:u}=a;return n(new RegExp(s,u),i)}case Gr:{const s=n(new Map,i);for(const[u,l]of a)s.set(r(u),r(l));return s}case Yr:{const s=n(new Set,i);for(const u of a)s.add(r(u));return s}case Ps:{const{name:s,message:u}=a;return n(new So[s](u),i)}case Ns:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(new So[o](a),i)};return r},Eo=e=>eb(new Map,e)(0),bt="",{toString:tb}={},{keys:nb}=Object,Rt=e=>{const t=typeof e;if(t!=="object"||!e)return[Rn,t];const n=tb.call(e).slice(8,-1);switch(n){case"Array":return[Ut,bt];case"Object":return[En,bt];case"Date":return[Wr,bt];case"RegExp":return[Jr,bt];case"Map":return[Gr,bt];case"Set":return[Yr,bt];case"DataView":return[Ut,n]}return n.includes("Array")?[Ut,n]:n.includes("Error")?[Ps,n]:[En,n]},hn=([e,t])=>e===Rn&&(t==="function"||t==="symbol"),rb=(e,t,n,r)=>{const i=(a,s)=>{const u=r.push(a)-1;return n.set(s,u),u},o=a=>{if(n.has(a))return n.get(a);let[s,u]=Rt(a);switch(s){case Rn:{let p=a;switch(u){case"bigint":s=Ns,p=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);p=null;break;case"undefined":return i([zs],a)}return i([s,p],a)}case Ut:{if(u){let h=a;return u==="DataView"?h=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(a)),i([u,[...h]],a)}const p=[],c=i([s,p],a);for(const h of a)p.push(o(h));return c}case En:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const p=[],c=i([s,p],a);for(const h of nb(a))(e||!hn(Rt(a[h])))&&p.push([o(h),o(a[h])]);return c}case Wr:return i([s,a.toISOString()],a);case Jr:{const{source:p,flags:c}=a;return i([s,{source:p,flags:c}],a)}case Gr:{const p=[],c=i([s,p],a);for(const[h,f]of a)(e||!(hn(Rt(h))||hn(Rt(f))))&&p.push([o(h),o(f)]);return c}case Yr:{const p=[],c=i([s,p],a);for(const h of a)(e||!hn(Rt(h)))&&p.push(o(h));return c}}const{message:l}=a;return i([s,{name:u,message:l}],a)};return o},Io=(e,{json:t,lossy:n}={})=>{const r=[];return rb(!(t||n),!!t,new Map,r)(e),r},Kt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Eo(Io(e,t)):structuredClone(e):(e,t)=>Eo(Io(e,t));function ib(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 ob(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}
vendor: 7,109 bytes, lines 54-60
54function ab(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ib,r=e.options.footnoteBackLabel||ob,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=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 p=e.all(l),c=String(l.identifier).toUpperCase(),h=Ct(c.toLowerCase());let f=0;const g=[],k=e.footnoteCounts.get(c);for(;k!==void 0&&++f<=k;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(u,f);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,f),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const b=p[p.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const v=b.children[b.children.length-1];v&&v.type==="text"?v.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else p.push(...g);const d={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(p,!0)};e.patch(l,d),s.push(d)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Kt(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` 55`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` 56`}]}}const Dn=(function(e){if(e==null)return cb;if(typeof e=="function")return $n(e);if(typeof e=="object")return Array.isArray(e)?sb(e):lb(e);if(typeof e=="string")return ub(e);throw new Error("Expected function, string, or object as test")});function sb(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Dn(e[n]);return $n(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function lb(e){const t=e;return $n(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ub(e){return $n(t);function t(n){return n&&n.type===e}}function $n(e){return t;function t(n,r,i){return!!(pb(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function cb(){return!0}function pb(e){return e!==null&&typeof e=="object"&&"type"in e}const Os=[],fb=!0,Sr=!1,hb="skip";function Rs(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Dn(i),a=r?-1:1;s(e,void 0,[])();function s(u,l,p){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const f=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=Os,g,k,b;if((!t||o(u,l,p[p.length-1]||void 0))&&(f=db(n(u,p)),f[0]===Sr))return f;if("children"in u&&u.children){const d=u;if(d.children&&f[0]!==hb)for(k=(r?d.children.length:-1)+a,b=p.concat(d);k>-1&&k<d.children.length;){const v=d.children[k];if(g=s(v,k,b)(),g[0]===Sr)return g;k=typeof g[1]=="number"?g[1]:k+a}}return f}}}function db(e){return Array.isArray(e)?e:typeof e=="number"?[fb,e]:e==null?Os:[e]}function Kr(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),Rs(e,o,s,i);function s(u,l){const p=l[l.length-1],c=p?p.children.indexOf(u):void 0;return a(u,c,p)}}const Er={}.hasOwnProperty,mb={};function gb(e,t){const n=t||mb,r=new Map,i=new Map,o=new Map,a={...Qy,...n.handlers},s={all:l,applyData:bb,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:u,options:n,patch:yb,wrap:vb};return Kr(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const c=p.type==="definition"?r:i,h=String(p.identifier).toUpperCase();c.has(h)||c.set(h,p)}}),s;function u(p,c){const h=p.type,f=s.handlers[h];if(Er.call(s.handlers,h)&&f)return f(s,p,c);if(s.options.passThrough&&s.options.passThrough.includes(h)){if("children"in p){const{children:k,...b}=p,d=Kt(b);return d.children=s.all(p),d}return Kt(p)}return(s.options.unknownHandler||xb)(s,p,c)}function l(p){const c=[];if("children"in p){const h=p.children;let f=-1;for(;++f<h.length;){const g=s.one(h[f],p);if(g){if(f&&h[f-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Co(g.value)),!Array.isArray(g)&&g.type==="element")){const k=g.children[0];k&&k.type==="text"&&(k.value=Co(k.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function yb(e,t){e.position&&(t.position=us(e))}function bb(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,Kt(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function xb(e,t){const n=t.data||{},r="value"in t&&!(Er.call(n,"hProperties")||Er.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 vb(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 Co(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function To(e,t){const n=gb(e,t),r=n.one(e,void 0),i=ab(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` 60`},i),o}function kb(e,t){return e&&"run"in e?async function(n,r){const i=To(n,{file:r,...t});await e.run(i,r)}:function(n,r){return To(n,{file:r,...e||t})}}function Ao(e){if(e)throw e}var Yn,zo;function wb(){if(zo)return Yn;zo=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]"},o=function(l){if(!l||t.call(l)!=="[object Object]")return!1;var p=e.call(l,"constructor"),c=l.constructor&&l.constructor.prototype&&e.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!p&&!c)return!1;var h;for(h in l);return typeof h>"u"||e.call(l,h)},a=function(l,p){n&&p.name==="__proto__"?n(l,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):l[p.name]=p.newValue},s=function(l,p){if(p==="__proto__")if(e.call(l,p)){if(r)return r(l,p).value}else return;return l[p]};return Yn=function u(){var l,p,c,h,f,g,k=arguments[0],b=1,d=arguments.length,v=!1;for(typeof k=="boolean"&&(v=k,k=arguments[1]||{},b=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});b<d;++b)if(l=arguments[b],l!=null)for(p in l)c=s(k,p),h=s(l,p),k!==h&&(v&&h&&(o(h)||(f=i(h)))?(f?(f=!1,g=c&&i(c)?c:[]):g=c&&o(c)?c:{},a(k,{name:p,newValue:u(v,g,h)})):typeof h<"u"&&a(k,{name:p,newValue:h}));return k},Yn}var _b=wb();const Kn=Ar(_b);function Ir(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);
vendor: 4,451 bytes, line 60
60return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Sb(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(u,...l){const p=e[++o];let c=-1;if(u){a(u);return}for(;++c<i.length;)(l[c]===null||l[c]===void 0)&&(l[c]=i[c]);i=l,p?Eb(p,s)(...l):a(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 Eb(e,t){let n;return r;function r(...a){const s=e.length>a.length;let u;s&&a.push(i);try{u=e.apply(this,a)}catch(l){const p=l;if(s&&n)throw p;return i(p)}s||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const Be={basename:Ib,dirname:Cb,extname:Tb,join:Ab,sep:"/"};function Ib(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');an(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Cb(e){if(an(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 Tb(e){an(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Ab(...e){let t=-1,n;for(;++t<e.length;)an(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zb(n)}function zb(e){an(e);const t=e.codePointAt(0)===47;let n=Pb(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Pb(e,t){let n="",r=0,i=-1,o=0,a=-1,s,u;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===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=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function an(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Nb={cwd:Ob};function Ob(){return"/"}function Cr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Rb(e){if(typeof e=="string")e=new URL(e);else if(!Cr(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 Db(e)}function Db(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 Xn=["history","path","basename","stem","extname","dirname"];class Ds{constructor(t){let n;t?Cr(t)?n={path:t}:typeof t=="string"||$b(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Nb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Xn.length;){const o=Xn[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Xn.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Be.basename(this.path):void 0}
vendor: 18,248 bytes, line 60
60set basename(t){er(t,"basename"),Qn(t,"basename"),this.path=Be.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Be.dirname(this.path):void 0}set dirname(t){Po(this.basename,"dirname"),this.path=Be.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Be.extname(this.path):void 0}set extname(t){if(Qn(t,"extname"),Po(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=Be.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Cr(t)&&(t=Rb(t)),er(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Be.basename(this.path,this.extname):void 0}set stem(t){er(t,"stem"),Qn(t,"stem"),this.path=Be.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 be(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 Qn(e,t){if(e&&e.includes(Be.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Be.sep+"`")}function er(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Po(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function $b(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Mb=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),jb={}.hasOwnProperty;class Xr extends Mb{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=Sb()}copy(){const t=new Xr;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Kn(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(rr("data",this.frozen),this.namespace[t]=n,this):jb.call(this.namespace,t)&&this.namespace[t]||void 0:t?(rr("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=dn(t),r=this.parser||this.Parser;return tr("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),tr("process",this.parser||this.Parser),nr("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=dn(t),u=r.parse(s);r.run(u,s,function(p,c,h){if(p||!c||!h)return l(p);const f=c,g=r.stringify(f,h);Zb(g)?h.value=g:h.result=g,l(p,h)});function l(p,c){p||!c?a(p):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),tr("processSync",this.parser||this.Parser),nr("processSync",this.compiler||this.Compiler),this.process(t,i),Oo("processSync","process",n),r;function i(o,a){n=!0,Ao(o),r=a}}run(t,n,r){No(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const u=dn(n);i.run(t,u,l);function l(p,c,h){const f=c||t;p?s(p):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Oo("runSync","run",r),i;function o(a,s){Ao(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=dn(n),i=this.compiler||this.Compiler;return nr("stringify",i),No(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(rr("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[p,...c]=l;u(p,c)}else a(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function a(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=Kn(!0,i.settings,l.settings))}function s(l){let p=-1;if(l!=null)if(Array.isArray(l))for(;++p<l.length;){const c=l[p];o(c)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,p){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===l){h=c;break}if(h===-1)r.push([l,...p]);else if(p.length>0){let[f,...g]=p;const k=r[h][1];Ir(k)&&Ir(f)&&(f=Kn(!0,k,f)),r[h]=[l,f,...g]}}}}const Lb=new Xr().freeze();function tr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function nr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function rr(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 No(e){if(!Ir(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Oo(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function dn(e){return Fb(e)?e:new Ds(e)}function Fb(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Zb(e){return typeof e=="string"||Bb(e)}function Bb(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ub="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ro=[],Do={allowDangerousHtml:!0},Vb=/^(https?|ircs?|mailto|xmpp)$/i,qb=[{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 Hb(e){const t=Wb(e),n=Jb(e);return Gb(t.runSync(t.parse(n),n),e)}function Wb(e){const t=e.rehypePlugins||Ro,n=e.remarkPlugins||Ro,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Do}:Do;return Lb().use(Cy).use(n).use(kb,r).use(t)}function Jb(e){const t=e.children||"",n=new Ds;return typeof t=="string"&&(n.value=t),n}function Gb(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,u=t.urlTransform||Yb;for(const p of qb)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Ub+p.id,void 0);return Kr(e,l),cm(e,{Fragment:C.Fragment,components:i,ignoreInvalidStyle:!0,jsx:C.jsx,jsxs:C.jsxs,passKeys:!0,passNode:!0});function l(p,c,h){if(p.type==="raw"&&h&&typeof c=="number")return a?h.children.splice(c,1):h.children[c]={type:"text",value:p.value},c;if(p.type==="element"){let f;for(f in Wn)if(Object.hasOwn(Wn,f)&&Object.hasOwn(p.properties,f)){const g=p.properties[f],k=Wn[f];(k===null||k.includes(p.tagName))&&(p.properties[f]=u(String(g||""),f,p))}}if(p.type==="element"){let f=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!f&&r&&typeof c=="number"&&(f=!r(p,c,h)),f&&h&&typeof c=="number")return s&&p.children?h.children.splice(c,1,...p.children):h.children.splice(c,1),c}}}function Yb(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||Vb.test(e.slice(0,t))?e:""}const ot=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Vt={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...ot,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...ot],h2:[["className","sr-only"]],img:[...ot,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...ot,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...ot],table:[...ot],ul:[...ot,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Xe={}.hasOwnProperty;function Kb(e,t){let n={type:"root",children:[]};const r={schema:t?{...Vt,...t}:Vt,stack:[]},i=$s(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function $s(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return Xb(e,n);case"doctype":return Qb(e,n);case"element":return ex(e,n);case"root":return tx(e,n);case"text":return nx(e,n)}}}function Xb(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),o={type:"comment",value:r<0?n:n.slice(0,r)};return sn(o,t),o}}function Qb(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return sn(n,t),n}}function ex(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Ms(e,t.children),i=rx(e,t.properties);e.stack.pop();let o=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&Xe.call(e.schema.ancestors,n))){const s=e.schema.ancestors[n];let u=-1;for(o=!1;++u<s.length;)e.stack.includes(s[u])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:i,children:r};return sn(a,t),a}function tx(e,t){const r={type:"root",children:Ms(e,t.children)};return sn(r,t),r}function nx(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return sn(r,t),r}function Ms(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const o=$s(e,r[i]);o&&(Array.isArray(o)?n.push(...o):n.push(o))}}return n}function rx(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,o=r&&Xe.call(r,n)?r[n]:void 0,a=r&&Xe.call(r,"*")?r["*"]:void 0,s=t&&typeof t=="object"?t:{},u={};let l;for(l in s)if(Xe.call(s,l)){const p=s[l];let c=$o(e,Mo(o,l),l,p);c==null&&(c=$o(e,Mo(a,l),l,p)),c!=null&&(u[l]=c)}if(i&&Xe.call(i,n)){const p=i[n];for(l in p)Xe.call(p,l)&&!Xe.call(u,l)&&(u[l]=p[l])}return u}function $o(e,t,n,r){return t?Array.isArray(r)?ix(e,t,n,r):js(e,t,n,r):void 0}function ix(e,t,n,r){let i=-1;const o=[];for(;++i<r.length;){const a=js(e,t,n,r[i]);(typeof a=="number"||typeof a=="string")&&o.push(a)}return o}function js(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&ox(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,o=0;for(;++o<t.length;){const a=t[o];if(a&&typeof a=="object"&&"flags"in a){if(a.test(String(r))){i=!0;break}}else if(a===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function ox(e,t,n){const r=e.schema.protocols&&Xe.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),o=i.indexOf(":"),a=i.indexOf("?"),s=i.indexOf("#"),u=i.indexOf("/");if(o<0||u>-1&&o>u||a>-1&&o>a||s>-1&&o>s)return!0;let l=-1;for(;++l<r.length;){const p=r[l];if(o===p.length&&i.slice(0,p.length)===p)return!0}return!1}function sn(e,t){const n=us(t);t.data&&(e.data=Kt(t.data)),n&&(e.position=n)}function Mo(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],o=typeof i=="string"?i:i[0];if(o===t)return i;o==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function ax(e){return function(t){return Kb(t,e)}}function jo(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function sx(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lx(e,t,n){const i=Dn((n||{}).ignore||[]),o=ux(t);let a=-1;for(;++a<o.length;)Rs(e,"text",s);function s(l,p){let c=-1,h;for(;++c<p.length;){const f=p[c],g=h?h.children:void 0;if(i(f,g?g.indexOf(f):void 0,h))return;h=f}if(h)return u(l,p)}function u(l,p){const c=p[p.length-1],h=o[a][0],f=o[a][1];let g=0;const b=c.children.indexOf(l);let d=!1,v=[];h.lastIndex=0;let m=h.exec(l.value);for(;m;){const I=m.index,A={index:m.index,input:m.input,stack:[...p,l]};let w=f(...m,A);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?h.lastIndex=I+1:(g!==I&&v.push({type:"text",value:l.value.slice(g,I)}),Array.isArray(w)?v.push(...w):w&&v.push(w),g=I+m[0].length,d=!0),!h.global)break;m=h.exec(l.value)}return d?(g<l.value.length&&v.push({type:"text",value:l.value.slice(g)}),c.children.splice(b,1,...v)):v=[l],b+v.length}}function ux(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([cx(i[0]),px(i[1])])}return t}function cx(e){return typeof e=="string"?new RegExp(sx(e),"g"):e}function px(e){return typeof e=="function"?e:function(){return e}}const ir="phrasing",or=["autolink","link","image","label"];function fx(){return{transforms:[xx],enter:{literalAutolink:dx,literalAutolinkEmail:ar,literalAutolinkHttp:ar,literalAutolinkWww:ar},exit:{literalAutolink:bx,literalAutolinkEmail:yx,literalAutolinkHttp:mx,literalAutolinkWww:gx}}}function hx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ir,notInConstruct:or},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ir,notInConstruct:or},{character:":",before:"[ps]",after:"\\/",inConstruct:ir,notInConstruct:or}]}}function dx(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ar(e){this.config.enter.autolinkProtocol.call(this,e)}function mx(e){this.config.exit.autolinkProtocol.call(this,e)}function gx(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function yx(e){this.config.exit.autolinkEmail.call(this,e)}function bx(e){this.exit(e)}function xx(e){lx(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),kx]],{ignore:["link","linkReference"]})}function vx(e,t,n,r,i){let o="";if(!Ls(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!wx(n)))return!1;const a=_x(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function kx(e,t,n,r){return!Ls(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function wx(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _x(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=jo(e,"(");let o=jo(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Ls(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ct(n)||Nn(n))&&(!t||n!==47)}Fs.peek=Nx;function Sx(){this.buffer()}function Ex(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ix(){this.buffer()}function Cx(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Tx(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Le(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ax(e){this.exit(e)}function zx(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Le(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Px(e){this.exit(e)}function Nx(){return"["}function Fs(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}
vendor: 1,904 bytes, lines 60-61
60function Ox(){return{enter:{gfmFootnoteCallString:Sx,gfmFootnoteCall:Ex,gfmFootnoteDefinitionLabelString:Ix,gfmFootnoteDefinition:Cx},exit:{gfmFootnoteCallString:Tx,gfmFootnoteCall:Ax,gfmFootnoteDefinitionLabelString:zx,gfmFootnoteDefinition:Px}}}function Rx(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fs},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let u=s.move("[^");const l=o.enter("footnoteDefinition"),p=o.enter("label");return u+=s.move(o.safe(o.associationId(r),{before:u,after:"]"})),p(),u+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),u+=s.move((t?` 61`:" ")+o.indentLines(o.containerFlow(r,s.current()),t?Zs:Dx))),l(),u}}function Dx(e,t,n){return t===0?e:Zs(e,t,n)}function Zs(e,t,n){return(n?"":" ")+e}const $x=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Bs.peek=Zx;function Mx(){return{canContainEols:["delete"],enter:{strikethrough:Lx},exit:{strikethrough:Fx}}}function jx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$x}],handlers:{delete:Bs}}}function Lx(e){this.enter({type:"delete",children:[]},e)}function Fx(e){this.exit(e)}function Bs(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Zx(){return"~"}function Bx(e){return e.length}function Ux(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Bx,o=[],a=[],s=[],u=[];let l=0,p=-1;for(;++p<e.length;){const k=[],b=[];let d=-1;for(e[p].length>l&&(l=e[p].length);++d<e[p].length;){const v=Vx(e[p][d]);if(n.alignDelimiters!==!1){const m=i(v);b[d]=m,(u[d]===void 0||m>u[d])&&(u[d]=m)}k.push(v)}a[p]=k,s[p]=b}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<l;)o[c]=Lo(r[c]);
vendor: 10,832 bytes, lines 61-73
61else{const k=Lo(r);for(;++c<l;)o[c]=k}c=-1;const h=[],f=[];for(;++c<l;){const k=o[c];let b="",d="";k===99?(b=":",d=":"):k===108?b=":":k===114&&(d=":");let v=n.alignDelimiters===!1?1:Math.max(1,u[c]-b.length-d.length);const m=b+"-".repeat(v)+d;n.alignDelimiters!==!1&&(v=b.length+v+d.length,v>u[c]&&(u[c]=v),f[c]=v),h[c]=m}a.splice(1,0,h),s.splice(1,0,f),p=-1;const g=[];for(;++p<a.length;){const k=a[p],b=s[p];c=-1;const d=[];for(;++c<l;){const v=k[c]||"";let m="",I="";if(n.alignDelimiters!==!1){const A=u[c]-(b[c]||0),w=o[c];w===114?m=" ".repeat(A):w===99?A%2?(m=" ".repeat(A/2+.5),I=" ".repeat(A/2-.5)):(m=" ".repeat(A/2),I=m):I=" ".repeat(A)}n.delimiterStart!==!1&&!c&&d.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||c)&&d.push(" "),n.alignDelimiters!==!1&&d.push(m),d.push(v),n.alignDelimiters!==!1&&d.push(I),n.padding!==!1&&d.push(" "),(n.delimiterEnd!==!1||c!==l-1)&&d.push("|")}g.push(n.delimiterEnd===!1?d.join("").replace(/ +$/,""):d.join(""))}return g.join(` 62`)}function Vx(e){return e==null?"":String(e)}function Lo(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function qx(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Hx);return i(),a}function Hx(e,t,n){return">"+(n?"":" ")+e}function Wx(e,t){return Fo(e,t.inConstruct,!0)&&!Fo(e,t.notInConstruct,!1)}function Fo(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Zo(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===` 63`&&Wx(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\ 64`}function Jx(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function Gx(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Yx(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Kx(e,t,n,r){const i=Yx(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Gx(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,Xx);return c(),h}const s=n.createTracker(r),u=i.repeat(Math.max(Jx(o,i)+1,3)),l=n.enter("codeFenced");let p=s.move(u);if(e.lang){const c=n.enter(`codeFencedLang${a}`);p+=s.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...s.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${a}`);p+=s.move(" "),p+=s.move(n.safe(e.meta,{before:p,after:` 65`,encode:["`"],...s.current()})),c()}return p+=s.move(` 66`),o&&(p+=s.move(o+` 67`)),p+=s.move(u),l(),p}function Xx(e,t,n){return(n?"":" ")+e}function Qr(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Qx(e,t,n,r){const i=Qr(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const u=n.createTracker(r);let l=u.move("[");return l+=u.move(n.safe(n.associationId(e),{before:l,after:"]",...u.current()})),l+=u.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(s=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":` 68`,...u.current()}))),s(),e.title&&(s=n.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),s()),a(),l}function ev(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xt(e){return"&#x"+e.toString(16).toUpperCase()+";"}function In(e,t,n){const r=St(e),i=St(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Us.peek=tv;function Us(e,t,n,r){const i=ev(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let u=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const l=u.charCodeAt(0),p=In(r.before.charCodeAt(r.before.length-1),l,i);p.inside&&(u=Xt(l)+u.slice(1));const c=u.charCodeAt(u.length-1),h=In(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Xt(c));const f=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:p.outside},s+u+f}function tv(e,t,n){return n.options.emphasis||"*"}function nv(e,t){let n=!1;return Kr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Sr}),!!((!e.depth||e.depth<3)&&Vr(e)&&(t.options.setext||n))}function rv(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(nv(e,n)){const p=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:` 69`,after:` 70`});return c(),p(),h+` 71`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` 72`))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),u=n.enter("phrasing");o.move(a+" ");let l=n.containerPhrasing(e,{before:"# ",after:` 73`,...o.current()});return/^[\t ]/.test(l)&&(l=Xt(l.charCodeAt(0))+l.slice(1)),l=l?a+" "+l:a,n.options.closeAtx&&(l+=" "+a),u(),s(),l}Vs.peek=iv;function Vs(e){return e.value||""}function iv(){return"<"}qs.peek=ov;function qs(e,t,n,r){const i=Qr(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const u=n.createTracker(r);let l=u.move("![");return l+=u.move(n.safe(e.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(s=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":")",...u.current()}))),s(),e.title&&(s=n.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),s()),l+=u.move(")"),a(),l}function ov(){return"!"}Hs.peek=av;function Hs(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let u=s.move("![");const l=n.safe(e.alt,{before:u,after:"]",...s.current()});u+=s.move(l+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:u,after:"]",...s.current()});return a(),n.stack=p,o(),i==="full"||!l||l!==c?u+=s.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=s.move("]"),u}function av(){return"!"}Ws.peek=sv;function Ws(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let u;if(a.atBreak)for(;u=s.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function sv(){return"`"}function Js(e,t){const n=Vr(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Gs.peek=lv;function Gs(e,t,n,r){const i=Qr(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,u;if(Js(e,n)){const p=n.stack;n.stack=[],s=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(e,{before:c,after:">",...a.current()})),c+=a.move(">"),s(),n.stack=p,c}s=n.enter("link"),u=n.enter("label");let l=a.move("[");return l+=a.move(n.containerPhrasing(e,{before:l,after:"](",...a.current()})),l+=a.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),l+=a.move("<"),l+=a.move(n.safe(e.url,{before:l,after:">",...a.current()})),l+=a.move(">")):(u=n.enter("destinationRaw"),l+=a.move(n.safe(e.url,{before:l,after:e.title?" ":")",...a.current()}))),u(),e.title&&(u=n.enter(`title${o}`),l+=a.move(" "+i),l+=a.move(n.safe(e.title,{before:l,after:i,...a.current()})),l+=a.move(i),u()),l+=a.move(")"),s(),l}function lv(e,t,n){return Js(e,n)?"<":"["}Ys.peek=uv;function Ys(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let u=s.move("[");const l=n.containerPhrasing(e,{before:u,after:"]",...s.current()});u+=s.move(l+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:u,after:"]",...s.current()});return a(),n.stack=p,o(),i==="full"||!l||l!==c?u+=s.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=s.move("]"),u}function uv(){return"["}function ei(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function cv(e){const t=ei(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function pv(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ks(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function fv(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?pv(n):ei(n);const s=e.ordered?a==="."?")":".":cv(n);let u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Ks(n)===a&&p){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=s),n.bulletCurrent=a;const l=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),l}function hv(e){const t=e.options.listItemIndent||"one";
vendor: 8,253 bytes, lines 73-75
73if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function dv(e,t,n,r){const i=hv(n);let o=n.bulletCurrent||ei(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const u=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,s.current()),p);return u(),l;function p(c,h,f){return h?(f?"":" ".repeat(a))+c:(f?o:o+" ".repeat(a-o.length))+c}}function mv(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const gv=Dn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function yv(e,t,n,r){return(e.children.some(function(a){return gv(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function bv(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Xs.peek=xv;function Xs(e,t,n,r){const i=bv(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let u=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const l=u.charCodeAt(0),p=In(r.before.charCodeAt(r.before.length-1),l,i);p.inside&&(u=Xt(l)+u.slice(1));const c=u.charCodeAt(u.length-1),h=In(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Xt(c));const f=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:p.outside},s+u+f}function xv(e,t,n){return n.options.strong||"*"}function vv(e,t,n,r){return n.safe(e.value,r)}function kv(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function wv(e,t,n){const r=(Ks(n)+(n.options.ruleSpaces?" ":"")).repeat(kv(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Qs={blockquote:qx,break:Zo,code:Kx,definition:Qx,emphasis:Us,hardBreak:Zo,heading:rv,html:Vs,image:qs,imageReference:Hs,inlineCode:Ws,link:Gs,linkReference:Ys,list:fv,listItem:dv,paragraph:mv,root:yv,strong:Xs,text:vv,thematicBreak:wv};function _v(){return{enter:{table:Sv,tableData:Bo,tableHeader:Bo,tableRow:Iv},exit:{codeText:Cv,table:Ev,tableData:sr,tableHeader:sr,tableRow:sr}}}function Sv(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Ev(e){this.exit(e),this.data.inTable=void 0}function Iv(e){this.enter({type:"tableRow",children:[]},e)}function sr(e){this.exit(e)}function Bo(e){this.enter({type:"tableCell",children:[]},e)}function Cv(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Tv));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Tv(e,t){return t==="|"?t:e}function Av(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` 74`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:u,tableRow:s}};function a(f,g,k,b){return l(p(f,k,b),f.align)}function s(f,g,k,b){const d=c(f,k,b),v=l([d]);return v.slice(0,v.indexOf(` 75`))}function u(f,g,k,b){const d=k.enter("tableCell"),v=k.enter("phrasing"),m=k.containerPhrasing(f,{...b,before:o,after:o});return v(),d(),m}function l(f,g){return Ux(f,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function p(f,g,k){const b=f.children;let d=-1;const v=[],m=g.enter("table");for(;++d<b.length;)v[d]=c(b[d],g,k);return m(),v}function c(f,g,k){const b=f.children;let d=-1;const v=[],m=g.enter("tableRow");for(;++d<b.length;)v[d]=u(b[d],f,g,k);return m(),v}function h(f,g,k){let b=Qs.inlineCode(f,g,k);return k.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function zv(){return{exit:{taskListCheckValueChecked:Uo,taskListCheckValueUnchecked:Uo,paragraph:Nv}}}function Pv(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ov}}}function Uo(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Nv(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Ov(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let u=Qs.listItem(e,t,n,{...r,...s.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(p){return p+a}}function Rv(){return[fx(),Ox(),Mx(),_v(),zv()]}function Dv(e){return{extensions:[hx(),Rx(e),jx(),Av(e),Pv()]}}const $v={tokenize:Bv,partial:!0},el={tokenize:Uv,partial:!0},tl={tokenize:Vv,partial:!0},nl={tokenize:qv,partial:!0},Mv={tokenize:Hv,partial:!0},rl={name:"wwwAutolink",tokenize:Fv,previous:ol},il={name:"protocolAutolink",tokenize:Zv,previous:al},Je={name:"emailAutolink",tokenize:Lv,previous:sl},qe={};function jv(){return{text:qe}}let at=48;for(;at<123;)qe[at]=Je,at++,at===58?at=65:at===91&&(at=97);qe[43]=Je;qe[45]=Je;qe[46]=Je;qe[95]=Je;qe[72]=[Je,il];qe[104]=[Je,il];qe[87]=[Je,rl];qe[119]=[Je,rl];function Lv(e,t,n){const r=this;let i,o;return a;function a(c){return!Tr(c)||!sl.call(r,r.previous)||ti(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(c))}function s(c){return Tr(c)?(e.consume(c),s):c===64?(e.consume(c),u):n(c)}function u(c){return c===46?e.check(Mv,p,l)(c):c===45||c===95||ye(c)?(o=!0,e.consume(c),u):p(c)}function l(c){return e.consume(c),i=!0,u}function p(c){return o&&i&&we(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Fv(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!ol.call(r,r.previous)||ti(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($v,e.attempt(el,e.attempt(tl,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Zv(e,t,n){const r=this;let i="",o=!1;return a;function a(c){return(c===72||c===104)&&al.call(r,r.previous)&&!ti(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),s):n(c)}function s(c){if(we(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),s;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),u}return n(c)}function u(c){return c===47?(e.consume(c),o?l:(o=!0,u)):n(c)}function l(c){return c===null||Sn(c)||oe(c)||ct(c)||Nn(c)?n(c):e.attempt(el,e.attempt(tl,p),n)(c)}function p(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Bv(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function Uv(e,t,n){let r,i,o;return a;function a(l){return l===46||l===95?e.check(nl,u,s)(l):l===null||oe(l)||ct(l)||l!==45&&Nn(l)?u(l):(o=!0,e.consume(l),a)}function s(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),a}function u(l){return i||r||!o?n(l):t(l)}}function Vv(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(nl,t,o)(a):a===null||oe(a)||ct(a)?t(a
vendor: 4,923 bytes, line 75
75):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function qv(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||oe(s)||ct(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||oe(s)||ct(s)?t(s):r(s)}function o(s){return we(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):we(s)?(e.consume(s),a):n(s)}}function Hv(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return ye(o)?n(o):t(o)}}function ol(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||oe(e)}function al(e){return!we(e)}function sl(e){return!(e===47||Tr(e))}function Tr(e){return e===43||e===45||e===46||e===95||ye(e)}function ti(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Wv={tokenize:tk,partial:!0};function Jv(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Xv,continuation:{tokenize:Qv},exit:ek}},text:{91:{name:"gfmFootnoteCall",tokenize:Kv},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Gv,resolveTo:Yv}}}}function Gv(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return s;function s(u){if(!a||!a._balanced)return n(u);const l=Le(r.sliceSerialize({start:a.end,end:r.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Yv(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function Kv(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(c){if(o>999||c===93&&!a||c===null||c===91||oe(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Le(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return oe(c)||(a=!0),o++,e.consume(c),c===92?p:l}function p(c){return c===91||c===92||c===93?(e.consume(c),o++,l):l(c)}}function Xv(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(g)}function p(g){if(a>999||g===93&&!s||g===null||g===91||oe(g))return n(g);if(g===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=Le(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return oe(g)||(s=!0),a++,e.consume(g),g===92?c:p}function c(g){return g===91||g===92||g===93?(e.consume(g),a++,p):p(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),Q(e,f,"gfmFootnoteDefinitionWhitespace")):n(g)}function f(g){return t(g)}}function Qv(e,t,n){return e.check(on,t,e.attempt(Wv,t,n))}function ek(e){e.exit("gfmFootnoteDefinition")}
vendor: 6,591 bytes, line 75
75function tk(e,t,n){const r=this;return Q(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function nk(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let l=u;for(;l--;)if(a[l][0]==="exit"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[l][1].end.offset-a[l][1].start.offset){a[u][1].type="strikethroughSequence",a[l][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[l][1].start),end:Object.assign({},a[u][1].end)},c={type:"strikethroughText",start:Object.assign({},a[l][1].end),end:Object.assign({},a[u][1].start)},h=[["enter",p,s],["enter",a[l][1],s],["exit",a[l][1],s],["enter",c,s]],f=s.parser.constructs.insideSpan.null;f&&Ne(h,h.length,0,On(f,a.slice(l+1,u),s)),Ne(h,h.length,0,[["exit",c,s],["enter",a[u][1],s],["exit",a[u][1],s],["exit",p,s]]),Ne(a,l-1,u-l+3,h),u=l+h.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function o(a,s,u){const l=this.previous,p=this.events;let c=0;return h;function h(g){return l===126&&p[p.length-1][1].type!=="characterEscape"?u(g):(a.enter("strikethroughSequenceTemporary"),f(g))}function f(g){const k=St(l);if(g===126)return c>1?u(g):(a.consume(g),c++,f);if(c<2&&!n)return u(g);const b=a.exit("strikethroughSequenceTemporary"),d=St(g);return b._open=!d||d===2&&!!k,b._close=!k||k===2&&!!d,s(g)}}}class rk{constructor(){this.map=[]}add(t,n,r){ik(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function ik(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function ok(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function ak(){return{flow:{null:{name:"table",tokenize:sk,resolveAll:lk}}}}function sk(e,t,n){const r=this;let i=0,o=0,a;return s;function s(_){let D=r.events.length-1;for(;D>-1;){const L=r.events[D][1].type;if(L==="lineEnding"||L==="linePrefix")D--;else break}const $=D>-1?r.events[D][1].type:null,X=$==="tableHead"||$==="tableRow"?w:u;return X===w&&r.parser.lazy[r.now().line]?n(_):X(_)}function u(_){return e.enter("tableHead"),e.enter("tableRow"),l(_)}function l(_){return _===124||(a=!0,o+=1),p(_)}function p(_){return _===null?n(_):Z(_)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),f):n(_):G(_)?Q(e,p,"whitespace")(_):(o+=1,a&&(a=!1,i+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),a=!0,p):(e.enter("data"),c(_)))}function c(_){return _===null||_===124||oe(_)?(e.exit("data"),p(_)):(e.consume(_),_===92?h:c)}function h(_){return _===92||_===124?(e.consume(_),c):c(_)}function f(_){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(_):(e.enter("tableDelimiterRow"),a=!1,G(_)?Q(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):g(_))}function g(_){return _===45||_===58?b(_):_===124?(a=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),k):A(_)}function k(_){return G(_)?Q(e,b,"whitespace")(_):b(_)}function b(_){return _===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),d):_===45?(o+=1,d(_)):_===null||Z(_)?I(_):A(_)}function d(_){return _===45?(e.enter("tableDelimiterFiller"),v(_)):A(_)}function v(_){return _===45?(e.consume(_),v):_===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),m):(e.exit("tableDelimiterFiller"),m(_))}function m(_){return G(_)?Q(e,I,"whitespace")(_):I(_)}function I(_){return _===124?g(_):_===null||Z(_)?!a||i!==o?A(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):A(_)}function A(_){return n(_)}function w(_){return e.enter("tableRow"),z(_)}function z(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),z):_===null||Z(_)?(e.exit("tableRow"),t(_)):G(_)?Q(e,z,"whitespace")(_):(e.enter("data"),j(_))}function j(_){return _===null||_===124||oe(_)?(e.exit("data"),z(_)):(e.consume(_),_===92?q:j)}function q(_){return _===92||_===124?(e.consume(_),j):j(_)}}function lk(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,u=0,l,p,c;const h=new rk;for(;++n<e.length;){const f=e[n],g=f[1];f[0]==="enter"?g.type==="tableHead"?(s=!1,u!==0&&(Vo(h,t,u,l,p),p=void 0,u=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",l,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,p={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",p,t]])),i=g.type==="tableDelimiterRow"?2:p?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],c=mn(h,t,o,i,void 0,c),o=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],c=mn(h,t,o,i,void 0,c)),o=a,a=[o[1],n,0,0])):g.type==="tableHead"?(s=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,o[1]!==0?(a[0]=a[1],c=mn(h,t,o,i,n,c)):a[1]!==0&&(c=mn(h,t,a,i,n,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Vo(h,t,u,l,p),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=ok(t.events,n))}return e}function mn(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({}
75,kt(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=kt(t.events,n[1]);if(o={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const l=kt(t.events,n[2]),p=kt(t.events,n[3]),c={type:s,start:Object.assign({},l),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,k=n[3]-n[2]-1;e.add(g,k,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},kt(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Vo(e,t,n,r,i){const o=[],a=kt(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function kt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const uk={name:"tasklistCheck",tokenize:pk};function ck(){return{text:{91:uk}}}function pk(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return oe(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(u)}function s(u){return Z(u)?t(u):G(u)?e.check({tokenize:fk},t,n)(u):n(u)}}function fk(e,t,n){return Q(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function hk(e){return ms([jv(),Jv(),nk(e),ak(),ck()])}const dk={};function mk(e){const t=this,n=e||dk,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(hk(n)),o.push(Rv()),a.push(Dv(n))}const gk=U.lazy(()=>Cn(()=>import("./CatalogCheckoutEmbed-BIx3NRxE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>({default:e.CatalogCheckoutEmbed}))),yk=U.lazy(()=>Cn(()=>import("./BridgeEcocreditPaymentEmbed-qxTy6L-w.js"),__vite__mapDeps([8,1,2,3,4,5,6,9,10,11,12])).then(e=>({default:e.BridgeEcocreditPaymentEmbed}))),bk=U.lazy(()=>Cn(()=>import("./index-C57OvCUA.js"),__vite__mapDeps([13,1,2,3,4,5,6,14,15,16,17])).then(e=>({default:e.KhalaniSwapEmbed}))),xk={...Vt,tagNames:[...Vt.tagNames??[],"table","thead","tbody","tr","th","td"],attributes:{...Vt.attributes,th:["align"],td:["align"]}},vk={hidden:{opacity:0,y:8},visible:{opacity:1,y:0,transition:{duration:.3,ease:[.25,.46,.45,.94]}}},kk={p:({children:e})=>C.jsx("p",{className:"mb-2 last:mb-0 leading-relaxed",children:e}),strong:({children:e})=>C.jsx("strong",{className:"font-semibold text-text-primary",children:e}),em:({children:e})=>C.jsx("em",{className:"italic",children:e}),ul:({children:e})=>C.jsx("ul",{className:"mb-2 ml-4 list-disc space-y-0.5 last:mb-0",children:e}),ol:({children:e})=>C.jsx("ol",{className:"mb-2 ml-4 list-decimal space-y-0.5 last:mb-0",children:e}),li:({children:e})=>C.jsx("li",{className:"leading-relaxed",children:e}),code:({className:e,children:t})=>typeof e=="string"&&e.startsWith("language-")?C.jsx("code",{className:"block bg-surface rounded-lg p-3 font-mono text-sm overflow-x-auto my-2",children:t}):C.jsx("code",{className:"rounded bg-surface px-1.5 py-0.5 font-mono text-[0.85em]",children:t}),pre:({children:e})=>C.jsx("pre",{className:"my-2",children:e}),a:({href:e,children:t})=>C.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-impact underline underline-offset-2 hover:text-impact-muted transition-colors",children:t}),table:({children:e})=>C.jsx("div",{className:"my-2 overflow-x-auto rounded-lg border border-border",children:C.jsx("table",{className:"w-full text-sm",children:e})}),thead:({children:e})=>C.jsx("thead",{className:"bg-surface-raised text-text-secondary",children:e}),tbody:({children:e})=>C.jsx("tbody",{className:"divide-y divide-border",children:e}),tr:({children:e})=>C.jsx("tr",{className:"divide-x divide-border",children:e}),th:({children:e})=>C.jsx("th",{className:"px-3 py-1.5 text-left text-xs font-semibold",children:e}),td:({children:e})=>C.jsx("td",{className:"px-3 py-1.5",children:e})};function wk(){return C.jsx("span",{className:"inline-flex items-center gap-0.5 ml-0.5","aria-label":"Typing",children:[0,1,2].map(e=>C.jsx(Lt.span,{className:"inline-block h-1 w-1 rounded-full bg-text-muted",animate:{o
75pacity:[.3,1,.3],scale:[.85,1,.85]},transition:{duration:1.2,repeat:1/0,delay:e*.2,ease:"easeInOut"},"aria-hidden":"true"},e))})}function _k(e){return new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}function Sk({role:e,content:t,isStreaming:n=!1,timestamp:r,toolsUsed:i=!1,toolInvocations:o,verifiedInference:a=!1}){const s=e==="user";return C.jsx(Lt.div,{className:`flex ${s?"justify-end":"justify-start"} mb-3`,variants:vk,initial:"hidden",animate:"visible",children:C.jsxs("div",{className:`max-w-[85%] min-w-0 ${s?"items-end":"items-start"} flex flex-col`,children:[C.jsx("div",{className:` 76 px-4 py-2.5 text-[17px] leading-relaxed break-words overflow-hidden 77 ${s?"bg-impact/8 border border-impact/15 rounded-2xl rounded-br-lg text-text-primary":"bg-surface-elevated border border-border-strong rounded-2xl rounded-bl-lg text-text-primary shadow-sm shadow-black/30"} 78 `,children:s?C.jsx("p",{className:"whitespace-pre-wrap break-words",children:t}):C.jsxs("div",{className:"prose-chat min-w-0",children:[t?C.jsx(Hb,{components:kk,remarkPlugins:[mk],rehypePlugins:[[ax,xk]],children:t}):null,n&&C.jsx(wk,{})]})}),!s&&a&&!n&&C.jsxs(Lt.span,{className:`inline-flex items-center gap-1 mt-1 px-2 py-0.5 rounded-full 79 border border-impact/20 bg-impact/8 text-[10px] font-medium text-impact 80 self-start`,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.3,delay:.1},title:"This response was generated inside a 0G Trusted Execution Environment and is cryptographically attested.",children:[C.jsx(qo,{className:"h-2.5 w-2.5"}),"Verified inference · TEE-attested"]}),!s&&i&&!n&&C.jsxs(Lt.span,{className:`inline-flex items-center gap-1 mt-1 px-2 py-0.5 rounded-full 81 border border-purple-500/20 bg-purple-500/8 text-[10px] font-medium text-purple-400 82 self-start`,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.3,delay:.15},children:[C.jsx(Ho,{className:"h-2.5 w-2.5"}),"Used platform tools"]}),!s&&!n&&(o==null?void 0:o.map(u=>{var l,p,c;if(u.toolName!=="generate_checkout_link"||u.state!=="result")return null;try{const h=JSON.parse(u.result||"{}");return h.status!=="ready"||!((l=h.listing)!=null&&l.id)?null:C.jsx(U.Suspense,{fallback:null,children:C.jsx(gk,{listing:h.listing,agentTokenId:((p=h.checkoutParams)==null?void 0:p.agentTokenId)??h.agentTokenId,amountUsd:h.amountUsd??((c=h.checkoutParams)==null?void 0:c.amountUsd)})},`${u.toolName}-${h.listing.id}`)}catch{return null}})),!s&&!n&&(o==null?void 0:o.map(u=>{var l;if(u.toolName!=="prepare_bridge_ecocredit_payment"||u.state!=="result")return null;try{const p=JSON.parse(u.result||"{}");return p.status!=="ready_to_pay"||!p.project||!((l=p.payment)!=null&&l.to)?null:C.jsx(U.Suspense,{fallback:null,children:C.jsx(yk,{project:p.project,payment:p.payment,bridgeUrl:p.bridgeUrl,reviewSummary:typeof p.reviewSummary=="string"?p.reviewSummary:void 0})},`${u.toolName}-${p.project.id}`)}catch{return null}})),!s&&!n&&(o==null?void 0:o.map(u=>{if(u.toolName!=="build_swap_deposit"||u.state!=="result")return null;try{const l=JSON.parse(u.result||"{}");return l.status!=="ready_to_sign"||!Array.isArray(l.actions)||l.actions.length===0||typeof l.agentTokenId!="number"?null:C.jsx(U.Suspense,{fallback:null,children:C.jsx(bk,{tokenId:l.agentTokenId,fromChainId:l.fromChainId,fromTokenAddress:l.fromToken,fromSymbol:l.fromSymbol,toChainId:l.toChainId,toTokenAddress:l.toToken,toSymbol:l.toSymbol,inputAmount:l.inputAmount,outputAmount:l.outputAmount,quoteId:l.quoteId,routeType:l.routeType,actions:l.actions,summary:l.summary})},`khalani-${l.quoteId??l.fromToken}-${l.toToken}`)}catch{return null}})),r&&!n&&C.jsx("span",{className:`text-[10px] text-text-muted mt-1 px-1 ${s?"text-right":"text-left"}`,children:_k(r)})]})})}const Ek=[{icon:_l,label:"Show stats",prompt:"What are your current stats? How much impact have you raised?",color:"text-impact",border:"border-impact/15",bg:"bg-impact/5",hoverBg:"hover:bg-impact/10"},{icon:Sl,label:"Leaderboard",prompt:"Show me the top agents on the leaderboard. How do you rank?",color:"text-rwi",border:"border-rwi/15",bg:"bg-rwi/5",hoverBg:"hover:bg-rwi/10"},{icon:El,label:"RWI rate",prompt:"What's the current RWI token rate? How much RWI would I get for $50?",color:"text-purple-400",border:"border-purple-500/15",bg:"bg-purple-500/5",hoverBg:"hover:bg-purple-500/10"},{icon:Wo,label:"Donate",prompt:"I'd like to make an impact purchase. Can you generate a checkout link for me?",color:"text-blue-400",border:"border-blue-500/15",bg:"bg-blue-500/5",hoverBg:"hover:bg-blue-500/10"}],Ik=[{icon:Jo,label:"Browse projects",prompt:"Show me carbon credit projects available right now. Use the live registry and rank them by quality per dollar.",color:"text-impact",border:"border-impact/15",bg:"bg-impact/5",hoverBg:"hover:bg-impact/10"},{icon:wl,label:"Cheapest per tonne",prompt:"What's the cheapest verified carbon credit per tonne available right now? Note any quality tradeoffs.",color:"text-text-primary",border:"border-border",bg:"bg-surface",hoverBg:"hover:bg-surface-overlay"},{icon:Wo,label:"Retire 1 tonne",prompt:"I want to retire 1 tonne of CO2. Walk me through the highest-quality option, payment, and verification.",color:"text-blue-400",border:"border-blue-500/15",bg:"bg-blue-500/5",hoverBg:"hover:bg-blue-500/10"},{icon:qo,label:"Verify a tx",prompt:"I sent a payment for credits â can you verify retirement status from the transaction hash?",color:"text-rwi",border:"border-rwi/15",bg:"bg-rwi/5",hoverBg:"hover:bg-rwi/10"}];function Ck(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("carbon")||t.includes("ecocredit")||t.includes("climate")}const Tk={hidden:{opacity:0,y:8},visible:e=>({opacity:1,y:0,transition:{duration:.3,delay:.05*e,ease:[.25,.46,.45,.94]}})};function Ak({agentName:e,causeFocus:t,onSelect:n,disabled:r=!1}){const i=Ck(t)?Ik:Ek;return C.jsx("div",{className:"flex flex-wrap justify-center gap-2 mt-3 max-w-sm mx-auto",children:i.map((o,a)=>{const s=o.icon;return C.jsxs(Lt.button,{custom:a,variants:Tk,initial:"hidden",animate:"visible",onClick:()=>!r&&n(o.prompt),disabled:r,className:` 83 inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 84 text-[11px] font-medium transition-colors cursor-pointer 85 disabled:opacity-40 disabled:cursor-not-allowed 86 ${o.border} ${o.bg} ${o.color} ${o.hoverBg} 87 `,whileHover:{scale:1.03},whileTap:{scale:.97},children:[C.jsx(s,{className:"h-3 w-3"}),o.label]},o.label)})})}const zk=U.lazy(()=>Cn(()=>import("./ComputeFundingBanner-CA_Z8o2X.js"),__vite__mapDeps([18,1,2,19,20,21,22,4,3,5,6,15,10,11,9,17])).then(e=>({default:e.ComputeFundingBanner})));function tw(){const{tokenId:e}=bl(),t=Number(e),n=Number.isFinite(t)&&t>0,{wallets:r}=yl(),{walletAddress:i,privyUserId:o,csrfToken:a,refreshSession:s}=xl(),u=r.find(F=>F.walletClientType==="privy")??r[0],{data:l}=Mn({queryKey:["agent",t],queryFn:()=>ui.agents.get(t),enabled:n}),{data:p}=Mn({queryKey:["living-state",t],queryFn:()=>ui.living.state(t),enabled:n,refetchInterval:3e4}),{data:c}=Mn({queryKey:["agent-stats",t],queryFn:async()=>{const F=await fetch(`/api/agents/${t}`);return F.ok?F.json():null},enabled:n,refetchInterval:6e4}),{messages:h,send:f,isStreaming:g,quota:k,lastUsage:b,error:d,warning:v,clearMessages:m,hasMore:I,isLoadingOlder:A,loadOlder:w}=Ed(t,a,u==null?void 0:u.address,s),[z,j]=U.useState(""),q=vl(),_=U.useRef(null),D=U.useRef(null),$=U.useRef(null),X=U.useRef(!1),L=(l==null?void 0:l.name)||(n?`Agent #${t}`:"Chat"),T=(l==null?void 0:l.tier)||"starter",R=Tl(l,{privyUserId:o,walletAddress:i}),H=!!(l!=null&&l.public_chat_enabled)||R,ee=R&&T!=="elite",le=(l==null?void 0:l.cause_focus)??null,y=(c==null?void 0:c.inference_mode)==="private";U.useLayoutEffect(()=>{if(X.current||h.length===0)return;const F=D.current;F&&(F.scrollTop=F.scrollHeight,X.current=!0)},[h.length]),U.useEffect(()=>{if(h.length===0)return;const F=D.current;F&&(F.scrollTop=F.scrollHeight)},[h]);const xe=U.useCallback(async()=>{const F=D.current;$.current=F?F.scrollHeight-F.scrollTop:null,await w()},[w]);U.useLayoutEffect(()=>{const F=D.current,Ae=$.current;F&&Ae!=null&&(F.scrollTop=F.scrollHeight-Ae,$.current=null)},[h.length]),U.useEffect(()=>{var F;(F=_.current)==null||F.focus()},[]);const Se=U.useCallback(()=>{const F=_.current;F&&(F.style.height="auto",F.style.height=`${Math.min(F.scrollHeight,120)}px`)},[]);U.useEffect(()=>{Se()},[z,Se]);const x=U.useCallback(async()=>
87{if(!z.trim()||g)return;const F=z;j(""),_.current&&(_.current.style.height="auto"),await f(F)},[z,g,f]),Te=U.useCallback(F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),x())},[x]),Fe=k?Math.min(k.messagesUsed/k.messagesLimit*100,100):0,de=Fe>=80;return n?l&&!H?C.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-3 px-4 text-center",children:[C.jsx(ci,{className:"h-6 w-6 text-text-muted"}),C.jsx("p",{className:"text-sm text-text-secondary",children:"Chat is not enabled for this agent."}),C.jsxs(si,{to:`/agent/${t}`,className:"text-xs text-impact hover:underline",children:["â Back to ",L]})]}):C.jsxs("div",{className:"flex flex-col h-[calc(100dvh-72px)] min-h-0",children:[C.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 md:px-5 py-3 border-b border-border bg-surface-raised",children:[C.jsx(si,{to:`/agent/${t}`,className:"flex items-center justify-center h-8 w-8 rounded-lg text-text-muted hover:text-text-primary hover:bg-surface-overlay transition-colors","aria-label":`Back to ${L}`,children:C.jsx(zl,{className:"h-4 w-4"})}),C.jsx("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:C.jsxs("div",{className:"min-w-0 flex-1",children:[C.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C.jsx("h2",{className:"text-sm font-semibold truncate",children:L}),ee?C.jsx(Cl,{tier:T,tokenId:t,size:"sm"}):C.jsx(Il,{tier:T,size:"sm"}),(p==null?void 0:p.mood)&&C.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium shrink-0",style:{color:jn[p.mood]||"#6b7280",backgroundColor:`${jn[p.mood]||"#6b7280"}15`},children:[C.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:jn[p.mood]||"#6b7280"},"aria-hidden":"true"}),Al[p.mood]||p.mood]})]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 mt-0.5",children:[b&&C.jsx("p",{className:"text-[10px] text-text-muted font-mono truncate max-w-[140px]",children:b.model.split("/").pop()}),(p==null?void 0:p.conversationCount)!=null&&p.conversationCount>0?C.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-purple-400",children:[C.jsx(pi,{className:"h-2.5 w-2.5"}),"Remembers you · ",p.conversationCount," chats"]}):C.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-text-muted",children:[C.jsx(pi,{className:"h-2.5 w-2.5"}),"New connection"]}),C.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-impact",children:[C.jsx(ci,{className:"h-2.5 w-2.5"}),"Guardrails active"]}),C.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-purple-400",children:[C.jsx(Ho,{className:"h-2.5 w-2.5"}),"Tools active"]})]})]})})]}),c&&C.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 px-4 md:px-5 py-1.5 bg-impact/[0.04] border-b border-impact/10 text-[10px]",children:[C.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 min-w-0",children:[C.jsxs("span",{className:"inline-flex items-center gap-1 text-impact font-medium",children:[C.jsx(Jo,{className:"h-2.5 w-2.5"}),"Impact"]}),c.total_raised_usd>0&&C.jsxs("span",{className:"text-text-secondary",children:[C.jsxs("span",{className:"text-impact font-semibold",children:["$",c.total_raised_usd.toFixed(2)]})," raised"]}),c.total_rwi_earned>0&&C.jsxs("span",{className:"text-text-secondary",children:[C.jsx("span",{className:"text-impact font-semibold",children:c.total_rwi_earned.toLocaleString()})," RWI"]}),c.total_conversions>0&&C.jsxs("span",{className:"text-text-secondary",children:[C.jsx("span",{className:"font-semibold",children:c.total_conversions})," ",c.total_conversions===1?"contribution":"contributions"]}),c.total_raised_usd===0&&c.total_rwi_earned===0&&C.jsx("span",{className:"text-text-muted",children:"Every conversation funds real-world change"})]}),C.jsx("a",{href:"https://climate.0g.ai",target:"_blank",rel:"noopener noreferrer",className:"text-text-muted hover:text-impact transition-colors",children:"Verify â"})]}),C.jsxs("div",{ref:D,className:"flex-1 min-h-0 overflow-y-auto px-4 py-4",role:"log","aria-live":"polite",children:[h.length===0&&C.jsxs("div",{className:"space-y-3",children:[(p==null?void 0:p.energy)&&C.jsx("div",{className:"flex flex-wrap items-center gap-2 text-[11px]",children:C.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 border border-border-subtle",children:[C.jsx(Pl,{className:"h-2.5 w-2.5",style:{color:p.energy.color}}),p.energy.pct,"% energy"]})}),C.jsx(Ak,{agentName:L,causeFocus:le,onSelect:F=>{j(""),f(F)},disabled:g})]}),I&&h.length>0&&C.jsx("button",{onClick:xe,disabled:A,className:"mx-auto mb-3 block px-3 py-1 text-xs text-text-muted hover:text-text-primary rounded-full border border-border-subtle disabled:opacity-50",children:A?"Loadingâ¦":"Load older messages"}),h.map((F,Ae)=>C.jsx(Sk,{role:F.role,content:F.content,isStreaming:g&&F.role==="assistant"&&Ae===h.length-1,timestamp:F.timestamp,toolsUsed:F.toolsUsed,toolInvocations:F.toolInvocations,verifiedInference:y&&F.role==="assistant"&&F.fresh===!0},F.id))]}),i&&C.jsx("div",{className:"mx-4 mb-2",children:C.jsx(U.Suspense,{fallback:null,children:C.jsx(zk,{isPrivate:y})})}),d&&C.jsxs("div",{className:"mx-4 mb-2 flex items-start gap-2 rounded-md border border-red-500/30 bg-red-500/5 px-3 py-2 text-xs text-red-400",children:[C.jsx(li,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),C.jsx("span",{className:"leading-relaxed",children:d})]}),v&&!d&&C.jsxs("div",{className:"mx-4 mb-2 flex items-start gap-2 rounded-md border border-yellow-500/30 bg-yellow-500/5 px-3 py-2 text-xs text-yellow-400",children:[C.jsx(li,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),C.jsx("span",{className:"leading-relaxed",children:v})]}),k&&C.jsxs("div",{className:"px-4 pb-1",children:[C.jsxs("div",{className:"flex items-center justify-between text-[10px] text-text-muted mb-1",children:[C.jsxs("span",{children:[k.messagesUsed," / ",k.messagesLimit," messages this period"]}),de&&C.jsx("span",{className:"text-yellow-400",children:"approaching limit"})]}),C.jsx("div",{className:"h-1 rounded-full bg-surface-overlay overflow-hidden",children:C.jsx("div",{className:`h-full ${de?"bg-yellow-400":"bg-impact"}`,style:{width:`${Fe}%`}})})]}),C.jsxs("div",{className:`border-t border-border bg-surface-raised px-4 py-3 ${q?"mb-16":""}`,children:[C.jsxs("div",{className:"flex items-end gap-2",children:[C.jsx("textarea",{ref:_,value:z,onChange:F=>j(F.target.value),onKeyDown:Te,placeholder:g?"Waiting for responseâ¦":"Type a messageâ¦",disabled:g,rows:1,className:"flex-1 resize-none rounded-lg border border-border bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-impact focus:outline-none disabled:opacity-50"}),C.jsx("button",{onClick:x,disabled:!z.trim()||g,className:"flex items-center justify-center h-9 w-9 rounded-lg bg-impact text-surface hover:bg-impact-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Send message",children:g?C.jsx(kl,{className:"h-4 w-4 animate-spin"}):C.jsx(Nl,{className:"h-4 w-4"})})]}),h.length>0&&C.jsx("button",{onClick:m,disabled:g,className:"mt-2 text-[10px] text-text-muted hover:text-text-primary transition-colors disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-text-muted",children:"Clear conversation"})]})]}):C.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:C.jsx("p",{className:"text-text-muted font-mono",children:"Invalid agent."})})}export{tw as AgentChat};
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.