@ensembleapp/client-sdk 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ Error generating stack: `+n.message+`
13
13
  ]))`;continue}else if(n[s]==="$"){r+=`($|(?=[\r
14
14
  ]))`;continue}}if(a.s&&n[s]==="."){r+=i?`${n[s]}\r
15
15
  `:`[${n[s]}\r
16
- ]`;continue}r+=n[s],n[s]==="\\"?o=!0:i&&n[s]==="]"?i=!1:!i&&n[s]==="["&&(i=!0)}try{new RegExp(r)}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 r}function ff(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===A.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,r)=>({...n,[r]:te(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",r]})??Qe(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let a={type:"object",additionalProperties:te(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return a;if(e.keyType?._def.typeName===A.ZodString&&e.keyType._def.checks?.length){let{type:n,...r}=df(e.keyType._def,t);return{...a,propertyNames:r}}else{if(e.keyType?._def.typeName===A.ZodEnum)return{...a,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===A.ZodBranded&&e.keyType._def.type._def.typeName===A.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...r}=cf(e.keyType._def,t);return{...a,propertyNames:r}}}return a}function nL(e,t){if(t.mapStrategy==="record")return ff(e,t);let a=te(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Qe(t),n=te(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Qe(t);return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function oL(e){let t=e.values,n=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),r=Array.from(new Set(n.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function iL(e){return e.target==="openAi"?void 0:{not:Qe({...e,currentPath:[...e.currentPath,"not"]})}}function lL(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var iu={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function uL(e,t){if(t.target==="openApi3")return sL(e,t);let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in iu&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=iu[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=a.reduce((r,o)=>{let i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(n.length===a.length){let r=n.filter((o,i,l)=>l.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(o=>!n.includes(o))],[])};return sL(e,t)}var sL=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>te(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return a.length?{anyOf:a}:void 0};function cL(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:iu[e.innerType._def.typeName],nullable:!0}:{type:[iu[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=te(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let a=te(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function dL(e,t){let a={type:"number"};if(!e.checks)return a;for(let n of e.checks)switch(n.kind){case"int":a.type="integer",ev(a,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?we(a,"minimum",n.value,n.message,t):we(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),we(a,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?we(a,"maximum",n.value,n.message,t):we(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),we(a,"maximum",n.value,n.message,t));break;case"multipleOf":we(a,"multipleOf",n.value,n.message,t);break}return a}function fL(e,t){let a=t.target==="openAi",n={type:"object",properties:{}},r=[],o=e.shape();for(let l in o){let s=o[l];if(s===void 0||s._def===void 0)continue;let u=z2(s);u&&a&&(s._def.typeName==="ZodOptional"&&(s=s._def.innerType),s.isNullable()||(s=s.nullable()),u=!1);let c=te(s._def,{...t,currentPath:[...t.currentPath,"properties",l],propertyPath:[...t.currentPath,"properties",l]});c!==void 0&&(n.properties[l]=c,u||r.push(l))}r.length&&(n.required=r);let i=O2(e,t);return i!==void 0&&(n.additionalProperties=i),n}function O2(e,t){if(e.catchall._def.typeName!=="ZodNever")return te(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 z2(e){try{return e.isOptional()}catch{return!0}}var pL=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return te(e.innerType._def,t);let a=te(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return a?{anyOf:[{not:Qe(t)},a]}:Qe(t)};var mL=(e,t)=>{if(t.pipeStrategy==="input")return te(e.in._def,t);if(t.pipeStrategy==="output")return te(e.out._def,t);let a=te(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=te(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function hL(e,t){return te(e.type._def,t)}function gL(e,t){let n={type:"array",uniqueItems:!0,items:te(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&we(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&we(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}function vL(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>te(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:te(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>te(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function yL(e){return{not:Qe(e)}}function xL(e){return Qe(e)}var bL=(e,t)=>te(e.innerType._def,t);var SL=(e,t,a)=>{switch(t){case A.ZodString:return df(e,a);case A.ZodNumber:return dL(e,a);case A.ZodObject:return fL(e,a);case A.ZodBigInt:return X0(e,a);case A.ZodBoolean:return W0();case A.ZodDate:return tv(e,a);case A.ZodUndefined:return yL(a);case A.ZodNull:return lL(a);case A.ZodArray:return J0(e,a);case A.ZodUnion:case A.ZodDiscriminatedUnion:return uL(e,a);case A.ZodIntersection:return tL(e,a);case A.ZodTuple:return vL(e,a);case A.ZodRecord:return ff(e,a);case A.ZodLiteral:return aL(e,a);case A.ZodEnum:return eL(e);case A.ZodNativeEnum:return oL(e);case A.ZodNullable:return cL(e,a);case A.ZodOptional:return pL(e,a);case A.ZodMap:return nL(e,a);case A.ZodSet:return gL(e,a);case A.ZodLazy:return()=>e.getter()._def;case A.ZodPromise:return hL(e,a);case A.ZodNaN:case A.ZodNever:return iL(a);case A.ZodEffects:return Q0(e,a);case A.ZodAny:return Qe(a);case A.ZodUnknown:return xL(a);case A.ZodDefault:return Y0(e,a);case A.ZodBranded:return cf(e,a);case A.ZodReadonly:return bL(e,a);case A.ZodCatch:return K0(e,a);case A.ZodPipeline:return mL(e,a);case A.ZodFunction:case A.ZodVoid:case A.ZodSymbol:return;default:return(n=>{})(t)}};function te(e,t,a=!1){let n=t.seen.get(e);if(t.override){let l=t.override?.(e,t,n,a);if(l!==H0)return l}if(n&&!a){let l=D2(n,t);if(l!==void 0)return l}let r={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,r);let o=SL(e,e.typeName,t),i=typeof o=="function"?te(o(),t):o;if(i&&R2(e,t,i),t.postProcess){let l=t.postProcess(i,e,t);return r.jsonSchema=i,l}return r.jsonSchema=i,i}var D2=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:uf(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((a,n)=>t.currentPath[n]===a)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Qe(t)):t.$refStrategy==="seen"?Qe(t):void 0}},R2=(e,t,a)=>(e.description&&(a.description=e.description,t.markdownDescription&&(a.markdownDescription=e.description)),a);var nv=(e,t)=>{let a=G0(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((s,[u,c])=>({...s,[u]:te(c._def,{...a,currentPath:[...a.basePath,a.definitionPath,u]},!0)??Qe(a)}),{}):void 0,r=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=te(e._def,r===void 0?a:{...a,currentPath:[...a.basePath,a.definitionPath,r]},!1)??Qe(a),i=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;i!==void 0&&(o.title=i),a.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[a.openAiAnyTypeName]||(n[a.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:a.$refStrategy==="relative"?"1":[...a.basePath,a.definitionPath,a.openAiAnyTypeName].join("/")}}));let l=r===void 0?n?{...o,[a.definitionPath]:n}:o:{$ref:[...a.$refStrategy==="relative"?[]:a.basePath,a.definitionPath,r].join("/"),[a.definitionPath]:{...n,[r]:o}};return a.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(a.target==="jsonSchema2019-09"||a.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),a.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l};var $2=nv;async function pf({api:e,threadId:t,widgets:a}){let n=a.map(({widgetType:s,schema:u,enrich:c})=>(u=u.extend({widgetType:q0.literal(s)}),{widgetType:s,schema:$2(u),enrich:c})),{baseUrl:r,token:o,headers:i={}}=e,l=await fetch(`${r}/chat/widgets`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`,"thread-id":t,...i},body:JSON.stringify({widgetSchemas:n})});if(!l.ok){let s=await l.text().catch(()=>l.statusText);throw new Error(`Failed to register chat widgets: ${l.status} ${s}`)}}var hf=_e(Ut());var wL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),P2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase()),ov=e=>{let t=P2(e);return t.charAt(0).toUpperCase()+t.slice(1)},mf=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim(),IL=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var lu=_e(Ut());var kL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var _L=(0,lu.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,lu.createElement)("svg",{ref:s,...kL,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:mf("lucide",r),...!o&&!IL(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,lu.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Ct=(e,t)=>{let a=(0,hf.forwardRef)(({className:n,...r},o)=>(0,hf.createElement)(_L,{ref:o,iconNode:t,className:mf(`lucide-${wL(ov(e))}`,`lucide-${e}`,n),...r}));return a.displayName=ov(e),a};var N2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xo=Ct("chevron-right",N2);var U2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Vn=Ct("circle-stop",U2);var j2=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Wo=Ct("message-square",j2);var B2=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],su=Ct("mic-off",B2);var F2=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],uu=Ct("mic",F2);var q2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],cu=Ct("send",q2);var Z2=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],du=Ct("thumbs-up",Z2);var H2=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],fu=Ct("thumbs-down",H2);var V2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pu=Ct("x",V2);var ke=_e(Ut(),1);function CL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var G2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,X2={};function gf(e,t){return((t||X2).jsx?J2:G2).test(e)}var W2=/[ \t\n\f\r]/g;function iv(e){return typeof e=="object"?e.type==="text"?LL(e.value):!1:LL(e)}function LL(e){return e.replace(W2,"")===""}var Yr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};Yr.prototype.normal={};Yr.prototype.property={};Yr.prototype.space=void 0;function lv(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new Yr(a,n,t)}function mu(e){return e.toLowerCase()}var Lt=class{constructor(t,a){this.attribute=a,this.property=t}};Lt.prototype.attribute="";Lt.prototype.booleanish=!1;Lt.prototype.boolean=!1;Lt.prototype.commaOrSpaceSeparated=!1;Lt.prototype.commaSeparated=!1;Lt.prototype.defined=!1;Lt.prototype.mustUseProperty=!1;Lt.prototype.number=!1;Lt.prototype.overloadedBoolean=!1;Lt.prototype.property="";Lt.prototype.spaceSeparated=!1;Lt.prototype.space=void 0;var hu={};ir(hu,{boolean:()=>ie,booleanish:()=>it,commaOrSpaceSeparated:()=>la,commaSeparated:()=>Gn,number:()=>$,overloadedBoolean:()=>vf,spaceSeparated:()=>ze});var K2=0,ie=Ko(),it=Ko(),vf=Ko(),$=Ko(),ze=Ko(),Gn=Ko(),la=Ko();function Ko(){return 2**++K2}var sv=Object.keys(hu),Yo=class extends Lt{constructor(t,a,n,r){let o=-1;if(super(t,a),TL(this,"space",r),typeof n=="number")for(;++o<sv.length;){let i=sv[o];TL(this,sv[o],(n&hu[i])===hu[i])}}};Yo.prototype.defined=!0;function TL(e,t,a){a&&(e[t]=a)}function Fa(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new Yo(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[mu(n)]=n,a[mu(o.attribute)]=n}return new Yr(t,a,e.space)}var uv=Fa({properties:{ariaActiveDescendant:null,ariaAtomic:it,ariaAutoComplete:null,ariaBusy:it,ariaChecked:it,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:ze,ariaCurrent:null,ariaDescribedBy:ze,ariaDetails:null,ariaDisabled:it,ariaDropEffect:ze,ariaErrorMessage:null,ariaExpanded:it,ariaFlowTo:ze,ariaGrabbed:it,ariaHasPopup:null,ariaHidden:it,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ze,ariaLevel:$,ariaLive:null,ariaModal:it,ariaMultiLine:it,ariaMultiSelectable:it,ariaOrientation:null,ariaOwns:ze,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:it,ariaReadOnly:it,ariaRelevant:null,ariaRequired:it,ariaRoleDescription:ze,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:it,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function yf(e,t){return t in e?e[t]:t}function xf(e,t){return yf(e,t.toLowerCase())}var AL=Fa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gn,acceptCharset:ze,accessKey:ze,action:null,allow:null,allowFullScreen:ie,allowPaymentRequest:ie,allowUserMedia:ie,alt:null,as:null,async:ie,autoCapitalize:null,autoComplete:ze,autoFocus:ie,autoPlay:ie,blocking:ze,capture:null,charSet:null,checked:ie,cite:null,className:ze,cols:$,colSpan:null,content:null,contentEditable:it,controls:ie,controlsList:ze,coords:$|Gn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ie,defer:ie,dir:null,dirName:null,disabled:ie,download:vf,draggable:it,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ie,formTarget:null,headers:ze,height:$,hidden:vf,high:$,href:null,hrefLang:null,htmlFor:ze,httpEquiv:ze,id:null,imageSizes:null,imageSrcSet:null,inert:ie,inputMode:null,integrity:null,is:null,isMap:ie,itemId:null,itemProp:ze,itemRef:ze,itemScope:ie,itemType:ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ie,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:ie,muted:ie,name:null,nonce:null,noModule:ie,noValidate:ie,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:ie,optimum:$,pattern:null,ping:ze,placeholder:null,playsInline:ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ie,referrerPolicy:null,rel:ze,required:ie,reversed:ie,rows:$,rowSpan:$,sandbox:ze,scope:null,scoped:ie,seamless:ie,selected:ie,shadowRootClonable:ie,shadowRootDelegatesFocus:ie,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:it,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:ie,useMap:null,value:it,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ze,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ie,declare:ie,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:ie,noHref:ie,noShade:ie,noWrap:ie,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:it,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ie,disableRemotePlayback:ie,prefix:null,property:null,results:$,security:null,unselectable:null},space:"html",transform:xf});var EL=Fa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-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:la,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,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:Gn,g2:Gn,glyphName:Gn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:la,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,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:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:la,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:la,rev:la,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:la,requiredFeatures:la,requiredFonts:la,requiredFormats:la,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:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:la,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:la,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:la,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yf});var cv=Fa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var dv=Fa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:xf});var fv=Fa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var pv={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"};var Y2=/[A-Z]/g,ML=/-[a-z]/g,Q2=/^data[-\w.:]+$/i;function mv(e,t){let a=mu(t),n=t,r=Lt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Q2.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(ML,tP);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!ML.test(o)){let i=o.replace(Y2,eP);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=Yo}return new r(n,t)}function eP(e){return"-"+e.toLowerCase()}function tP(e){return e.charAt(1).toUpperCase()}var OL=lv([uv,AL,cv,dv,fv],"html"),bf=lv([uv,EL,cv,dv,fv],"svg");function zL(e){return e.join(" ").trim()}var JL=_e(ZL(),1);var wf=HL("end"),Il=HL("start");function HL(e){return t;function t(a){let n=a&&a.position&&a.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function vv(e){let t=Il(e),a=wf(e);if(t&&a)return{start:t,end:a}}function Jn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?VL(e.position):"start"in e||"end"in e?VL(e):"line"in e||"column"in e?yv(e):""}function yv(e){return GL(e&&e.line)+":"+GL(e&&e.column)}function VL(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function GL(e){return e&&typeof e=="number"?e:1}var ft=class extends Error{constructor(t,a,n){super(),typeof a=="string"&&(n=a,a=void 0);let r="",o={},i=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?r=t:!o.cause&&t&&(i=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?o.ruleId=n:(o.source=n.slice(0,s),o.ruleId=n.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){let s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}let l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Jn(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=i&&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}};ft.prototype.file="";ft.prototype.name="";ft.prototype.reason="";ft.prototype.message="";ft.prototype.stack="";ft.prototype.column=void 0;ft.prototype.line=void 0;ft.prototype.ancestors=void 0;ft.prototype.cause=void 0;ft.prototype.fatal=void 0;ft.prototype.place=void 0;ft.prototype.ruleId=void 0;ft.prototype.source=void 0;var xv={}.hasOwnProperty,LP=new Map,TP=/[A-Z]/g,AP=new Set(["table","tbody","thead","tfoot","tr"]),EP=new Set(["td","th"]),XL="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bv(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=NP(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=PP(a,t.jsx,t.jsxs)}let r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?bf:OL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=WL(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function WL(e,t,a){if(t.type==="element")return MP(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return OP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return DP(e,t,a);if(t.type==="mdxjsEsm")return zP(e,t);if(t.type==="root")return RP(e,t,a);if(t.type==="text")return $P(e,t)}function MP(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=bf,e.schema=r),e.ancestors.push(t);let o=YL(e,t.tagName,!1),i=UP(e,t),l=wv(e,t);return AP.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!iv(s):!0})),KL(e,i,o,t),Sv(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function OP(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}vu(e,t.position)}function zP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vu(e,t.position)}function DP(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=bf,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:YL(e,t.name,!0),i=jP(e,t),l=wv(e,t);return KL(e,i,o,t),Sv(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function RP(e,t,a){let n={};return Sv(n,wv(e,t)),e.create(t,e.Fragment,n,a)}function $P(e,t){return t.value}function KL(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function Sv(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function PP(e,t,a){return n;function n(r,o,i,l){let u=Array.isArray(i.children)?a:t;return l?u(o,i,l):u(o,i)}}function NP(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=Il(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function UP(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&xv.call(t.properties,r)){let o=BP(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&EP.has(t.tagName)?n=l:a[i]=l}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function jP(e,t){let a={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let o=n.data.estree.body[0];o.type;let i=o.expression;i.type;let l=i.properties[0];l.type,Object.assign(a,e.evaluater.evaluateExpression(l.argument))}else vu(e,t.position);else{let r=n.name,o;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let l=n.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else vu(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function wv(e,t){let a=[],n=-1,r=e.passKeys?new Map:LP;for(;++n<t.children.length;){let o=t.children[n],i;if(e.passKeys){let s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){let u=r.get(s)||0;i=s+"-"+u,r.set(s,u+1)}}let l=WL(e,o,i);l!==void 0&&a.push(l)}return a}function BP(e,t,a){let n=mv(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?CL(a):zL(a)),n.property==="style"){let r=typeof a=="object"?a:FP(e,String(a));return e.stylePropertyNameCase==="css"&&(r=qP(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?pv[n.property]||n.property:n.attribute,a]}}function FP(e,t){try{return(0,JL.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new ft("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=XL+"#cannot-parse-style-attribute",r}}function YL(e,t,a){let n;if(!a)n={type:"Literal",value:t};else if(t.includes(".")){let r=t.split("."),o=-1,i;for(;++o<r.length;){let l=gf(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};i=i?{type:"MemberExpression",object:i,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}n=i}else n=gf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return xv.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);vu(e)}function vu(e,t){let a=new ft("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=XL+"#cannot-handle-mdx-estrees-without-createevaluater",a}function qP(e){let t={},a;for(a in e)xv.call(e,a)&&(t[ZP(a)]=e[a]);return t}function ZP(e){let t=e.replace(TP,HP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function HP(e){return"-"+e.toLowerCase()}var yu={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"]};var Tl=_e(Bt(),1),L1=_e(Ut(),1);var JP={};function ei(e,t){let a=t||JP,n=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return rT(e,n,r)}function rT(e,t,a){if(XP(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return aT(e.children,t,a)}return Array.isArray(e)?aT(e,t,a):""}function aT(e,t,a){let n=[],r=-1;for(;++r<e.length;)n[r]=rT(e[r],t,a);return n.join("")}function XP(e){return!!(e&&typeof e=="object")}var nT=document.createElement("i");function kl(e){let t="&"+e+";";nT.innerHTML=t;let a=nT.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function pt(e,t,a,n){let r=e.length,o=0,i;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,a=a>0?a:0,n.length<1e4)i=Array.from(n),i.unshift(t,a),e.splice(...i);else for(a&&e.splice(t,a);o<n.length;)i=n.slice(o,o+1e4),i.unshift(t,0),e.splice(...i),o+=1e4,t+=1e4}function Xt(e,t){return e.length>0?(pt(e,e.length,0,t),e):t}var oT={}.hasOwnProperty;function kf(e){let t={},a=-1;for(;++a<e.length;)WP(t,e[a]);return t}function WP(e,t){let a;for(a in t){let r=(oT.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){oT.call(r,i)||(r[i]=[]);let l=o[i];KP(r[i],Array.isArray(l)?l:l?[l]:[])}}}function KP(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);pt(e,0,0,n)}function _f(e,t){let a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"\uFFFD":String.fromCodePoint(a)}function Ft(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var St=Xn(/[A-Za-z]/),lt=Xn(/[\dA-Za-z]/),iT=Xn(/[#-'*+\--9=?A-Z^-~]/);function ti(e){return e!==null&&(e<32||e===127)}var xu=Xn(/\d/),lT=Xn(/[\dA-Fa-f]/),sT=Xn(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}var ai=Xn(/\p{P}|\p{S}/u),vr=Xn(/\s/);function Xn(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function qa(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&lt(e.charCodeAt(a+1))&&lt(e.charCodeAt(a+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){let l=e.charCodeAt(a+1);o<56320&&l>56319&&l<57344?(i=String.fromCharCode(o,l),r=1):i="\uFFFD"}else i=String.fromCharCode(o);i&&(t.push(e.slice(n,a),encodeURIComponent(i)),n=a+r+1,i=""),r&&(a+=r,r=0)}return t.join("")+e.slice(n)}function W(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return Q(s)?(e.enter(a),l(s)):t(s)}function l(s){return Q(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var uT={tokenize:YP};function YP(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),W(e,t,"linePrefix")}function r(l){return e.enter("paragraph"),o(l)}function o(l){let s=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=s),a=s,i(l)}function i(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return H(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var dT={tokenize:QP},cT={tokenize:eN};function QP(e){let t=this,a=[],n=0,r,o,i;return l;function l(g){if(n<a.length){let S=a[n];return t.containerState=S[1],e.attempt(S[0].continuation,s,u)(g)}return u(g)}function s(g){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();let S=t.events.length,L=S,_;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){_=t.events[L][1].end;break}v(n);let T=S;for(;T<t.events.length;)t.events[T][1].end={..._},T++;return pt(t.events,L+1,0,t.events.slice(S)),t.events.length=T,u(g)}return l(g)}function u(g){if(n===a.length){if(!r)return p(g);if(r.currentConstruct&&r.currentConstruct.concrete)return m(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(cT,c,d)(g)}function c(g){return r&&y(),v(n),p(g)}function d(g){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,m(g)}function p(g){return t.containerState={},e.attempt(cT,f,m)(g)}function f(g){return n++,a.push([t.currentConstruct,t.containerState]),p(g)}function m(g){if(g===null){r&&y(),v(0),e.consume(g);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(g)}function x(g){if(g===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(g);return}return H(g)?(e.consume(g),b(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(g),x)}function b(g,S){let L=t.sliceStream(g);if(S&&L.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(L),t.parser.lazy[g.start.line]){let _=r.events.length;for(;_--;)if(r.events[_][1].start.offset<i&&(!r.events[_][1].end||r.events[_][1].end.offset>i))return;let T=t.events.length,O=T,R,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(R){k=t.events[O][1].end;break}R=!0}for(v(n),_=T;_<t.events.length;)t.events[_][1].end={...k},_++;pt(t.events,O+1,0,t.events.slice(T)),t.events.length=_}}function v(g){let S=a.length;for(;S-- >g;){let L=a[S];t.containerState=L[1],L[0].exit.call(t,e)}a.length=g}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function eN(e,t,a){return W(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qr(e){if(e===null||me(e)||vr(e))return 1;if(ai(e))return 2}function Wn(e,t,a){let n=[],r=-1;for(;++r<e.length;){let o=e[r].resolveAll;o&&!n.includes(o)&&(t=o(t,a),n.push(o))}return t}var bu={name:"attention",resolveAll:tN,tokenize:aN};function tN(e,t){let a=-1,n,r,o,i,l,s,u,c;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(n=a;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[n][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[a][1].start};fT(d,-s),fT(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[a][1].start={...l.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=Xt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=Xt(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=Xt(u,Wn(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=Xt(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=Xt(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,pt(e,n-1,a-n+3,u),a=n+u.length-c-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function aN(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=Qr(n),o;return i;function i(s){return o=s,e.enter("attentionSequence"),l(s)}function l(s){if(s===o)return e.consume(s),l;let u=e.exit("attentionSequence"),c=Qr(s),d=!c||c===2&&r||a.includes(s),p=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!p)),u._close=!!(o===42?p:p&&(c||!d)),t(s)}}function fT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Iv={name:"autolink",tokenize:rN};function rN(e,t,a){let n=0;return r;function r(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return St(f)?(e.consume(f),i):f===64?a(f):u(f)}function i(f){return f===43||f===45||f===46||lt(f)?(n=1,l(f)):u(f)}function l(f){return f===58?(e.consume(f),n=0,s):(f===43||f===45||f===46||lt(f))&&n++<32?(e.consume(f),l):(n=0,u(f))}function s(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||ti(f)?a(f):(e.consume(f),s)}function u(f){return f===64?(e.consume(f),c):iT(f)?(e.consume(f),u):a(f)}function c(f){return lt(f)?d(f):a(f)}function d(f){return f===46?(e.consume(f),n=0,c):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||lt(f))&&n++<63){let m=f===45?p:d;return e.consume(f),m}return a(f)}}var yr={partial:!0,tokenize:nN};function nN(e,t,a){return n;function n(o){return Q(o)?W(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||H(o)?t(o):a(o)}}var Cf={continuation:{tokenize:iN},exit:lN,name:"blockQuote",tokenize:oN};function oN(e,t,a){let n=this;return r;function r(i){if(i===62){let l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return a(i)}function o(i){return Q(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function iN(e,t,a){let n=this;return r;function r(i){return Q(i)?W(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Cf,t,a)(i)}}function lN(e){e.exit("blockQuote")}var Lf={name:"characterEscape",tokenize:sN};function sN(e,t,a){return n;function n(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return sT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Tf={name:"characterReference",tokenize:uN};function uN(e,t,a){let n=this,r=0,o,i;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),s}function s(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=lt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=lT,c):(e.enter("characterReferenceValue"),o=7,i=xu,c(d))}function c(d){if(d===59&&r){let p=e.exit("characterReferenceValue");return i===lt&&!kl(n.sliceSerialize(p))?a(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(d)&&r++<o?(e.consume(d),c):a(d)}}var pT={partial:!0,tokenize:dN},Af={concrete:!0,name:"codeFenced",tokenize:cN};function cN(e,t,a){let n=this,r={partial:!0,tokenize:L},o=0,i=0,l;return s;function s(_){return u(_)}function u(_){let T=n.events[n.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(_)}function c(_){return _===l?(i++,e.consume(_),c):i<3?a(_):(e.exit("codeFencedFenceSequence"),Q(_)?W(e,d,"whitespace")(_):d(_))}function d(_){return _===null||H(_)?(e.exit("codeFencedFence"),n.interrupt?t(_):e.check(pT,x,S)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||H(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(_)):Q(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),W(e,f,"whitespace")(_)):_===96&&_===l?a(_):(e.consume(_),p)}function f(_){return _===null||H(_)?d(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===null||H(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(_)):_===96&&_===l?a(_):(e.consume(_),m)}function x(_){return e.attempt(r,S,b)(_)}function b(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),v}function v(_){return o>0&&Q(_)?W(e,y,"linePrefix",o+1)(_):y(_)}function y(_){return _===null||H(_)?e.check(pT,x,S)(_):(e.enter("codeFlowValue"),g(_))}function g(_){return _===null||H(_)?(e.exit("codeFlowValue"),y(_)):(e.consume(_),g)}function S(_){return e.exit("codeFenced"),t(_)}function L(_,T,O){let R=0;return k;function k(F){return _.enter("lineEnding"),_.consume(F),_.exit("lineEnding"),Y}function Y(F){return _.enter("codeFencedFence"),Q(F)?W(_,q,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):q(F)}function q(F){return F===l?(_.enter("codeFencedFenceSequence"),V(F)):O(F)}function V(F){return F===l?(R++,_.consume(F),V):R>=i?(_.exit("codeFencedFenceSequence"),Q(F)?W(_,X,"whitespace")(F):X(F)):O(F)}function X(F){return F===null||H(F)?(_.exit("codeFencedFence"),T(F)):O(F)}}}function dN(e,t,a){let n=this;return r;function r(i){return i===null?a(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}var Su={name:"codeIndented",tokenize:pN},fN={partial:!0,tokenize:mN};function pN(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),W(e,o,"linePrefix",5)(u)}function o(u){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(u):a(u)}function i(u){return u===null?s(u):H(u)?e.attempt(fN,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||H(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function mN(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):W(e,o,"linePrefix",5)(i)}function o(i){let l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):H(i)?r(i):a(i)}}var kv={name:"codeText",previous:gN,resolve:hN,tokenize:vN};function hN(e){let t=e.length-4,a=3,n,r;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=a;++n<t;)if(e[n][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(n=a-1,t++;++n<=t;)r===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(r=n):(n===t||e[n][1].type==="lineEnding")&&(e[r][1].type="codeTextData",n!==r+2&&(e[r][1].end=e[n-1][1].end,e.splice(r+2,n-r-2),t-=n-r-2,n=r+2),r=void 0);return e}function gN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function vN(e,t,a){let n=this,r=0,o,i;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),s(p)}function s(p){return p===96?(e.consume(p),r++,s):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(i=e.enter("codeTextSequence"),o=0,d(p)):H(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||H(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}var Ef=class{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,a){let n=a??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,a,n){let r=a||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&wu(this.left,n),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),wu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),wu(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){let a=this.left.splice(t,Number.POSITIVE_INFINITY);wu(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);wu(this.left,a.reverse())}}};function wu(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function Mf(e){let t={},a=-1,n,r,o,i,l,s,u,c=new Ef(e);for(;++a<c.length;){for(;a in t;)a=t[a];if(n=c.get(a),a&&n[1].type==="chunkFlow"&&c.get(a-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,yN(c,a)),a=t[a],u=!0);else if(n[1]._container){for(o=a,r=void 0;o--;)if(i=c.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,a),l.unshift(n),c.splice(r,a-r+1,l))}}return pt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function yN(e,t){let a=e.get(t)[1],n=e.get(t)[2],r=t-1,o=[],i=a._tokenizer;i||(i=n.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let l=i.events,s=[],u={},c,d,p=-1,f=a,m=0,x=0,b=[x];for(;f;){for(;e.get(++r)[1]!==f;);o.push(r),f._tokenizer||(c=n.sliceStream(f),f.next||c.push(null),d&&i.defineSkip(f.start),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=a;++p<l.length;)l[p][0]==="exit"&&l[p-1][0]==="enter"&&l[p][1].type===l[p-1][1].type&&l[p][1].start.line!==l[p][1].end.line&&(x=p+1,b.push(x),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(i.events=[],f?(f._tokenizer=void 0,f.previous=void 0):b.pop(),p=b.length;p--;){let v=l.slice(b[p],b[p+1]),y=o.pop();s.push([y,y+v.length-1]),e.splice(y,2,v)}for(s.reverse(),p=-1;++p<s.length;)u[m+s[p][0]]=m+s[p][1],m+=s[p][1]-s[p][0]-1;return u}var _v={resolve:bN,tokenize:SN},xN={partial:!0,tokenize:wN};function bN(e){return Mf(e),e}function SN(e,t){let a;return n;function n(l){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?o(l):H(l)?e.check(xN,i,o)(l):(e.consume(l),r)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function i(l){return e.consume(l),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function wN(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),W(e,o,"linePrefix")}function o(i){if(i===null||H(i))return a(i);let l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,a,t)(i)}}function Of(e,t,a,n,r,o,i,l,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(v){return v===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(v),e.exit(o),p):v===null||v===32||v===41||ti(v)?a(v):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(v))}function p(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(l),p(v)):v===null||v===60||H(v)?a(v):(e.consume(v),v===92?m:f)}function m(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function x(v){return!c&&(v===null||v===41||me(v))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(v)):c<u&&v===40?(e.consume(v),c++,x):v===41?(e.consume(v),c--,x):v===null||v===32||v===40||ti(v)?a(v):(e.consume(v),v===92?b:x)}function b(v){return v===40||v===41||v===92?(e.consume(v),x):x(v)}}function zf(e,t,a,n,r,o){let i=this,l=0,s;return u;function u(f){return e.enter(n),e.enter(r),e.consume(f),e.exit(r),e.enter(o),c}function c(f){return l>999||f===null||f===91||f===93&&!s||f===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?a(f):f===93?(e.exit(o),e.enter(r),e.consume(f),e.exit(r),e.exit(n),t):H(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||H(f)||l++>999?(e.exit("chunkString"),c(f)):(e.consume(f),s||(s=!Q(f)),f===92?p:d)}function p(f){return f===91||f===92||f===93?(e.consume(f),l++,d):d(f)}}function Df(e,t,a,n,r,o){let i;return l;function l(p){return p===34||p===39||p===40?(e.enter(n),e.enter(r),e.consume(p),e.exit(r),i=p===40?41:p,s):a(p)}function s(p){return p===i?(e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):(e.enter(o),u(p))}function u(p){return p===i?(e.exit(o),s(i)):p===null?a(p):H(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),W(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===i||p===null||H(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:c)}function d(p){return p===i||p===92?(e.consume(p),c):c(p)}}function ri(e,t){let a;return n;function n(r){return H(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):Q(r)?W(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var Cv={name:"definition",tokenize:kN},IN={partial:!0,tokenize:_N};function kN(e,t,a){let n=this,r;return o;function o(f){return e.enter("definition"),i(f)}function i(f){return zf.call(n,e,l,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return r=Ft(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):a(f)}function s(f){return me(f)?ri(e,u)(f):u(f)}function u(f){return Of(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function c(f){return e.attempt(IN,d,d)(f)}function d(f){return Q(f)?W(e,p,"whitespace")(f):p(f)}function p(f){return f===null||H(f)?(e.exit("definition"),n.parser.defined.push(r),t(f)):a(f)}}function _N(e,t,a){return n;function n(l){return me(l)?ri(e,r)(l):a(l)}function r(l){return Df(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Q(l)?W(e,i,"whitespace")(l):i(l)}function i(l){return l===null||H(l)?t(l):a(l)}}var Lv={name:"hardBreakEscape",tokenize:CN};function CN(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return H(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var Tv={name:"headingAtx",resolve:LN,tokenize:TN};function LN(e,t){let a=e.length-2,n=3,r,o;return e[n][1].type==="whitespace"&&(n+=2),a-2>n&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(n===a-1||a-4>n&&e[a-2][1].type==="whitespace")&&(a-=n+1===a?2:4),a>n&&(r={type:"atxHeadingText",start:e[n][1].start,end:e[a][1].end},o={type:"chunkText",start:e[n][1].start,end:e[a][1].end,contentType:"text"},pt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function TN(e,t,a){let n=0;return r;function r(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&n++<6?(e.consume(c),i):c===null||me(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||H(c)?(e.exit("atxHeading"),t(c)):Q(c)?W(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||me(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var mT=["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"],Av=["pre","script","style","textarea"];var Ev={concrete:!0,name:"htmlFlow",resolveTo:MN,tokenize:ON},AN={partial:!0,tokenize:DN},EN={partial:!0,tokenize:zN};function MN(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 ON(e,t,a){let n=this,r,o,i,l,s;return u;function u(w){return c(w)}function c(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),d}function d(w){return w===33?(e.consume(w),p):w===47?(e.consume(w),o=!0,x):w===63?(e.consume(w),r=3,n.interrupt?t:I):St(w)?(e.consume(w),i=String.fromCharCode(w),b):a(w)}function p(w){return w===45?(e.consume(w),r=2,f):w===91?(e.consume(w),r=5,l=0,m):St(w)?(e.consume(w),r=4,n.interrupt?t:I):a(w)}function f(w){return w===45?(e.consume(w),n.interrupt?t:I):a(w)}function m(w){let Ze="CDATA[";return w===Ze.charCodeAt(l++)?(e.consume(w),l===Ze.length?n.interrupt?t:q:m):a(w)}function x(w){return St(w)?(e.consume(w),i=String.fromCharCode(w),b):a(w)}function b(w){if(w===null||w===47||w===62||me(w)){let Ze=w===47,La=i.toLowerCase();return!Ze&&!o&&Av.includes(La)?(r=1,n.interrupt?t(w):q(w)):mT.includes(i.toLowerCase())?(r=6,Ze?(e.consume(w),v):n.interrupt?t(w):q(w)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(w):o?y(w):g(w))}return w===45||lt(w)?(e.consume(w),i+=String.fromCharCode(w),b):a(w)}function v(w){return w===62?(e.consume(w),n.interrupt?t:q):a(w)}function y(w){return Q(w)?(e.consume(w),y):k(w)}function g(w){return w===47?(e.consume(w),k):w===58||w===95||St(w)?(e.consume(w),S):Q(w)?(e.consume(w),g):k(w)}function S(w){return w===45||w===46||w===58||w===95||lt(w)?(e.consume(w),S):L(w)}function L(w){return w===61?(e.consume(w),_):Q(w)?(e.consume(w),L):g(w)}function _(w){return w===null||w===60||w===61||w===62||w===96?a(w):w===34||w===39?(e.consume(w),s=w,T):Q(w)?(e.consume(w),_):O(w)}function T(w){return w===s?(e.consume(w),s=null,R):w===null||H(w)?a(w):(e.consume(w),T)}function O(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||me(w)?L(w):(e.consume(w),O)}function R(w){return w===47||w===62||Q(w)?g(w):a(w)}function k(w){return w===62?(e.consume(w),Y):a(w)}function Y(w){return w===null||H(w)?q(w):Q(w)?(e.consume(w),Y):a(w)}function q(w){return w===45&&r===2?(e.consume(w),j):w===60&&r===1?(e.consume(w),fe):w===62&&r===4?(e.consume(w),$e):w===63&&r===3?(e.consume(w),I):w===93&&r===5?(e.consume(w),rt):H(w)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(AN,da,V)(w)):w===null||H(w)?(e.exit("htmlFlowData"),V(w)):(e.consume(w),q)}function V(w){return e.check(EN,X,da)(w)}function X(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),F}function F(w){return w===null||H(w)?V(w):(e.enter("htmlFlowData"),q(w))}function j(w){return w===45?(e.consume(w),I):q(w)}function fe(w){return w===47?(e.consume(w),i="",at):q(w)}function at(w){if(w===62){let Ze=i.toLowerCase();return Av.includes(Ze)?(e.consume(w),$e):q(w)}return St(w)&&i.length<8?(e.consume(w),i+=String.fromCharCode(w),at):q(w)}function rt(w){return w===93?(e.consume(w),I):q(w)}function I(w){return w===62?(e.consume(w),$e):w===45&&r===2?(e.consume(w),I):q(w)}function $e(w){return w===null||H(w)?(e.exit("htmlFlowData"),da(w)):(e.consume(w),$e)}function da(w){return e.exit("htmlFlow"),t(w)}}function zN(e,t,a){let n=this;return r;function r(i){return H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):a(i)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}function DN(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(yr,t,a)}}var Mv={name:"htmlText",tokenize:RN};function RN(e,t,a){let n=this,r,o,i;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),s}function s(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),L):I===63?(e.consume(I),g):St(I)?(e.consume(I),O):a(I)}function u(I){return I===45?(e.consume(I),c):I===91?(e.consume(I),o=0,m):St(I)?(e.consume(I),y):a(I)}function c(I){return I===45?(e.consume(I),f):a(I)}function d(I){return I===null?a(I):I===45?(e.consume(I),p):H(I)?(i=d,fe(I)):(e.consume(I),d)}function p(I){return I===45?(e.consume(I),f):d(I)}function f(I){return I===62?j(I):I===45?p(I):d(I)}function m(I){let $e="CDATA[";return I===$e.charCodeAt(o++)?(e.consume(I),o===$e.length?x:m):a(I)}function x(I){return I===null?a(I):I===93?(e.consume(I),b):H(I)?(i=x,fe(I)):(e.consume(I),x)}function b(I){return I===93?(e.consume(I),v):x(I)}function v(I){return I===62?j(I):I===93?(e.consume(I),v):x(I)}function y(I){return I===null||I===62?j(I):H(I)?(i=y,fe(I)):(e.consume(I),y)}function g(I){return I===null?a(I):I===63?(e.consume(I),S):H(I)?(i=g,fe(I)):(e.consume(I),g)}function S(I){return I===62?j(I):g(I)}function L(I){return St(I)?(e.consume(I),_):a(I)}function _(I){return I===45||lt(I)?(e.consume(I),_):T(I)}function T(I){return H(I)?(i=T,fe(I)):Q(I)?(e.consume(I),T):j(I)}function O(I){return I===45||lt(I)?(e.consume(I),O):I===47||I===62||me(I)?R(I):a(I)}function R(I){return I===47?(e.consume(I),j):I===58||I===95||St(I)?(e.consume(I),k):H(I)?(i=R,fe(I)):Q(I)?(e.consume(I),R):j(I)}function k(I){return I===45||I===46||I===58||I===95||lt(I)?(e.consume(I),k):Y(I)}function Y(I){return I===61?(e.consume(I),q):H(I)?(i=Y,fe(I)):Q(I)?(e.consume(I),Y):R(I)}function q(I){return I===null||I===60||I===61||I===62||I===96?a(I):I===34||I===39?(e.consume(I),r=I,V):H(I)?(i=q,fe(I)):Q(I)?(e.consume(I),q):(e.consume(I),X)}function V(I){return I===r?(e.consume(I),r=void 0,F):I===null?a(I):H(I)?(i=V,fe(I)):(e.consume(I),V)}function X(I){return I===null||I===34||I===39||I===60||I===61||I===96?a(I):I===47||I===62||me(I)?R(I):(e.consume(I),X)}function F(I){return I===47||I===62||me(I)?R(I):a(I)}function j(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):a(I)}function fe(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),at}function at(I){return Q(I)?W(e,rt,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):rt(I)}function rt(I){return e.enter("htmlTextData"),i(I)}}var ni={name:"labelEnd",resolveAll:UN,resolveTo:jN,tokenize:BN},$N={tokenize:FN},PN={tokenize:qN},NN={tokenize:ZN};function UN(e){let t=-1,a=[];for(;++t<e.length;){let n=e[t][1];if(a.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let r=n.type==="labelImage"?4:2;n.type="data",t+=r}}return e.length!==a.length&&pt(e,0,e.length,a),e}function jN(e,t){let a=e.length,n=0,r,o,i,l;for(;a--;)if(r=e[a][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(i){if(e[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=a,r.type!=="labelLink")){n=2;break}}else r.type==="labelEnd"&&(i=a);let s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[i-2][1].start}};return l=[["enter",s,t],["enter",u,t]],l=Xt(l,e.slice(o+1,o+n+3)),l=Xt(l,[["enter",c,t]]),l=Xt(l,Wn(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=Xt(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=Xt(l,e.slice(i+1)),l=Xt(l,[["exit",s,t]]),pt(e,o,e.length,l),e}function BN(e,t,a){let n=this,r=n.events.length,o,i;for(;r--;)if((n.events[r][1].type==="labelImage"||n.events[r][1].type==="labelLink")&&!n.events[r][1]._balanced){o=n.events[r][1];break}return l;function l(p){return o?o._inactive?d(p):(i=n.parser.defined.includes(Ft(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):a(p)}function s(p){return p===40?e.attempt($N,c,i?c:d)(p):p===91?e.attempt(PN,c,i?u:d)(p):i?c(p):d(p)}function u(p){return e.attempt(NN,c,d)(p)}function c(p){return t(p)}function d(p){return o._balanced=!0,a(p)}}function FN(e,t,a){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),r}function r(d){return me(d)?ri(e,o)(d):o(d)}function o(d){return d===41?c(d):Of(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return me(d)?ri(e,s)(d):c(d)}function l(d){return a(d)}function s(d){return d===34||d===39||d===40?Df(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return me(d)?ri(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):a(d)}}function qN(e,t,a){let n=this;return r;function r(l){return zf.call(n,e,o,i,"reference","referenceMarker","referenceString")(l)}function o(l){return n.parser.defined.includes(Ft(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function ZN(e,t,a){return n;function n(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}var Ov={name:"labelStartImage",resolveAll:ni.resolveAll,tokenize:HN};function HN(e,t,a){let n=this;return r;function r(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),i):a(l)}function i(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(l):t(l)}}var zv={name:"labelStartLink",resolveAll:ni.resolveAll,tokenize:VN};function VN(e,t,a){let n=this;return r;function r(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),o}function o(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(i):t(i)}}var Iu={name:"lineEnding",tokenize:GN};function GN(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),W(e,t,"linePrefix")}}var oi={name:"thematicBreak",tokenize:JN};function JN(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,l(u)}function l(u){return u===r?(e.enter("thematicBreakSequence"),s(u)):n>=3&&(u===null||H(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),Q(u)?W(e,l,"whitespace")(u):l(u))}}var qt={continuation:{tokenize:YN},exit:e4,name:"list",tokenize:KN},XN={partial:!0,tokenize:t4},WN={partial:!0,tokenize:QN};function KN(e,t,a){let n=this,r=n.events[n.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return l;function l(f){let m=n.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||f===n.containerState.marker:xu(f)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(oi,a,u)(f):u(f);if(!n.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return a(f)}function s(f){return xu(f)&&++i<10?(e.consume(f),s):(!n.interrupt||i<2)&&(n.containerState.marker?f===n.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):a(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||f,e.check(yr,n.interrupt?a:c,e.attempt(XN,p,d))}function c(f){return n.containerState.initialBlankLine=!0,o++,p(f)}function d(f){return Q(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):a(f)}function p(f){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function YN(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(yr,r,o);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,W(e,t,"listItemIndent",n.containerState.size+1)(l)}function o(l){return n.containerState.furtherBlankLines||!Q(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(WN,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,W(e,e.attempt(qt,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function QN(e,t,a){let n=this;return W(e,r,"listItemIndent",n.containerState.size+1);function r(o){let i=n.events[n.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===n.containerState.size?t(o):a(o)}}function e4(e){e.exit(this.containerState.type)}function t4(e,t,a){let n=this;return W(e,r,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){let i=n.events[n.events.length-1];return!Q(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var Rf={name:"setextUnderline",resolveTo:a4,tokenize:r4};function a4(e,t){let a=e.length,n,r,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){n=a;break}e[a][1].type==="paragraph"&&(r=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e}function r4(e,t,a){let n=this,r;return o;function o(u){let c=n.events.length,d;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){d=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),r=u,i(u)):a(u)}function i(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Q(u)?W(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||H(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var hT={tokenize:n4};function n4(e){let t=this,a=e.attempt(yr,n,e.attempt(this.parser.constructs.flowInitial,r,W(e,e.attempt(this.parser.constructs.flow,r,e.attempt(_v,r)),"linePrefix")));return a;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var gT={resolveAll:bT()},vT=xT("string"),yT=xT("text");function xT(e){return{resolveAll:bT(e==="text"?o4:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,i,l);return i;function i(c){return u(c)?o(c):l(c)}function l(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),s}function s(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),s)}function u(c){if(c===null)return!0;let d=r[c],p=-1;if(d)for(;++p<d.length;){let f=d[p];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}function bT(e){return t;function t(a,n){let r=-1,o;for(;++r<=a.length;)o===void 0?a[r]&&a[r][1].type==="data"&&(o=r,r++):(!a[r]||a[r][1].type!=="data")&&(r!==o+2&&(a[o][1].end=a[r-1][1].end,a.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(a,n):a}}function o4(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let n=e[a-1][1],r=t.sliceStream(n),o=r.length,i=-1,l=0,s;for(;o--;){let u=r[o];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)l++,i--;if(i)break;i=-1}else if(u===-2)s=!0,l++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(l=0),l){let u={type:a===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:n.start._bufferIndex+i,_index:n.start._index+o,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(e.splice(a,0,["enter",u,t],["exit",u,t]),a+=2)}a++}return e}var Dv={};ir(Dv,{attentionMarkers:()=>p4,contentInitial:()=>l4,disable:()=>m4,document:()=>i4,flow:()=>u4,flowInitial:()=>s4,insideSpan:()=>f4,string:()=>c4,text:()=>d4});var i4={42:qt,43:qt,45:qt,48:qt,49:qt,50:qt,51:qt,52:qt,53:qt,54:qt,55:qt,56:qt,57:qt,62:Cf},l4={91:Cv},s4={[-2]:Su,[-1]:Su,32:Su},u4={35:Tv,42:oi,45:[Rf,oi],60:Ev,61:Rf,95:oi,96:Af,126:Af},c4={38:Tf,92:Lf},d4={[-5]:Iu,[-4]:Iu,[-3]:Iu,33:Ov,38:Tf,42:bu,60:[Iv,Mv],91:zv,92:[Lv,Lf],93:ni,95:bu,96:kv},f4={null:[bu,gT]},p4={null:[42,95]},m4={null:[]};function ST(e,t,a){let n={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},r={},o=[],i=[],l=[],s=!0,u={attempt:R(T),check:R(O),consume:S,enter:L,exit:_,interrupt:R(O,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:b,parser:e,previous:null,sliceSerialize:m,sliceStream:x,write:f},d=t.tokenize.call(c,u),p;return t.resolveAll&&o.push(t),c;function f(V){return i=Xt(i,V),y(),i[i.length-1]!==null?[]:(k(t,0),c.events=Wn(o,c.events,c),c.events)}function m(V,X){return g4(x(V),X)}function x(V){return h4(i,V)}function b(){let{_bufferIndex:V,_index:X,line:F,column:j,offset:fe}=n;return{_bufferIndex:V,_index:X,line:F,column:j,offset:fe}}function v(V){r[V.line]=V.column,q()}function y(){let V;for(;n._index<i.length;){let X=i[n._index];if(typeof X=="string")for(V=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===V&&n._bufferIndex<X.length;)g(X.charCodeAt(n._bufferIndex));else g(X)}}function g(V){s=void 0,p=V,d=d(V)}function S(V){H(V)?(n.line++,n.column=1,n.offset+=V===-3?2:1,q()):V!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===i[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=V,s=!0}function L(V,X){let F=X||{};return F.type=V,F.start=b(),c.events.push(["enter",F,c]),l.push(F),F}function _(V){let X=l.pop();return X.end=b(),c.events.push(["exit",X,c]),X}function T(V,X){k(V,X.from)}function O(V,X){X.restore()}function R(V,X){return F;function F(j,fe,at){let rt,I,$e,da;return Array.isArray(j)?Ze(j):"tokenize"in j?Ze([j]):w(j);function w(ut){return $t;function $t(At){let Kt=At!==null&&ut[At],pn=At!==null&&ut.null,Yl=[...Array.isArray(Kt)?Kt:Kt?[Kt]:[],...Array.isArray(pn)?pn:pn?[pn]:[]];return Ze(Yl)(At)}}function Ze(ut){return rt=ut,I=0,ut.length===0?at:La(ut[I])}function La(ut){return $t;function $t(At){return da=Y(),$e=ut,ut.partial||(c.currentConstruct=ut),ut.name&&c.parser.constructs.disable.null.includes(ut.name)?_r(At):ut.tokenize.call(X?Object.assign(Object.create(c),X):c,u,fn,_r)(At)}}function fn(ut){return s=!0,V($e,da),fe}function _r(ut){return s=!0,da.restore(),++I<rt.length?La(rt[I]):at}}}function k(V,X){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&pt(c.events,X,c.events.length-X,V.resolve(c.events.slice(X),c)),V.resolveTo&&(c.events=V.resolveTo(c.events,c))}function Y(){let V=b(),X=c.previous,F=c.currentConstruct,j=c.events.length,fe=Array.from(l);return{from:j,restore:at};function at(){n=V,c.previous=X,c.currentConstruct=F,c.events.length=j,l=fe,q()}}function q(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function h4(e,t){let a=t.start._index,n=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex,i;if(a===r)i=[e[a].slice(n,o)];else{if(i=e.slice(a,r),n>-1){let l=i[0];typeof l=="string"?i[0]=l.slice(n):i.shift()}o>0&&i.push(e[r].slice(0,o))}return i}function g4(e,t){let a=-1,n=[],r;for(;++a<e.length;){let o=e[a],i;if(typeof o=="string")i=o;else switch(o){case-5:{i="\r";break}case-4:{i=`
16
+ ]`;continue}r+=n[s],n[s]==="\\"?o=!0:i&&n[s]==="]"?i=!1:!i&&n[s]==="["&&(i=!0)}try{new RegExp(r)}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 r}function ff(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===A.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,r)=>({...n,[r]:te(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",r]})??Qe(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let a={type:"object",additionalProperties:te(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return a;if(e.keyType?._def.typeName===A.ZodString&&e.keyType._def.checks?.length){let{type:n,...r}=df(e.keyType._def,t);return{...a,propertyNames:r}}else{if(e.keyType?._def.typeName===A.ZodEnum)return{...a,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===A.ZodBranded&&e.keyType._def.type._def.typeName===A.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...r}=cf(e.keyType._def,t);return{...a,propertyNames:r}}}return a}function nL(e,t){if(t.mapStrategy==="record")return ff(e,t);let a=te(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Qe(t),n=te(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Qe(t);return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function oL(e){let t=e.values,n=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),r=Array.from(new Set(n.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function iL(e){return e.target==="openAi"?void 0:{not:Qe({...e,currentPath:[...e.currentPath,"not"]})}}function lL(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var iu={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function uL(e,t){if(t.target==="openApi3")return sL(e,t);let a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(n=>n._def.typeName in iu&&(!n._def.checks||!n._def.checks.length))){let n=a.reduce((r,o)=>{let i=iu[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=a.reduce((r,o)=>{let i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(n.length===a.length){let r=n.filter((o,i,l)=>l.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(o=>!n.includes(o))],[])};return sL(e,t)}var sL=(e,t)=>{let a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,r)=>te(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return a.length?{anyOf:a}:void 0};function cL(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:iu[e.innerType._def.typeName],nullable:!0}:{type:[iu[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=te(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let a=te(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function dL(e,t){let a={type:"number"};if(!e.checks)return a;for(let n of e.checks)switch(n.kind){case"int":a.type="integer",ev(a,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?we(a,"minimum",n.value,n.message,t):we(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),we(a,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?we(a,"maximum",n.value,n.message,t):we(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),we(a,"maximum",n.value,n.message,t));break;case"multipleOf":we(a,"multipleOf",n.value,n.message,t);break}return a}function fL(e,t){let a=t.target==="openAi",n={type:"object",properties:{}},r=[],o=e.shape();for(let l in o){let s=o[l];if(s===void 0||s._def===void 0)continue;let u=z2(s);u&&a&&(s._def.typeName==="ZodOptional"&&(s=s._def.innerType),s.isNullable()||(s=s.nullable()),u=!1);let c=te(s._def,{...t,currentPath:[...t.currentPath,"properties",l],propertyPath:[...t.currentPath,"properties",l]});c!==void 0&&(n.properties[l]=c,u||r.push(l))}r.length&&(n.required=r);let i=O2(e,t);return i!==void 0&&(n.additionalProperties=i),n}function O2(e,t){if(e.catchall._def.typeName!=="ZodNever")return te(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 z2(e){try{return e.isOptional()}catch{return!0}}var pL=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return te(e.innerType._def,t);let a=te(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return a?{anyOf:[{not:Qe(t)},a]}:Qe(t)};var mL=(e,t)=>{if(t.pipeStrategy==="input")return te(e.in._def,t);if(t.pipeStrategy==="output")return te(e.out._def,t);let a=te(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=te(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function hL(e,t){return te(e.type._def,t)}function gL(e,t){let n={type:"array",uniqueItems:!0,items:te(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&we(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&we(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}function vL(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((a,n)=>te(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:te(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((a,n)=>te(a._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function yL(e){return{not:Qe(e)}}function xL(e){return Qe(e)}var bL=(e,t)=>te(e.innerType._def,t);var SL=(e,t,a)=>{switch(t){case A.ZodString:return df(e,a);case A.ZodNumber:return dL(e,a);case A.ZodObject:return fL(e,a);case A.ZodBigInt:return X0(e,a);case A.ZodBoolean:return W0();case A.ZodDate:return tv(e,a);case A.ZodUndefined:return yL(a);case A.ZodNull:return lL(a);case A.ZodArray:return J0(e,a);case A.ZodUnion:case A.ZodDiscriminatedUnion:return uL(e,a);case A.ZodIntersection:return tL(e,a);case A.ZodTuple:return vL(e,a);case A.ZodRecord:return ff(e,a);case A.ZodLiteral:return aL(e,a);case A.ZodEnum:return eL(e);case A.ZodNativeEnum:return oL(e);case A.ZodNullable:return cL(e,a);case A.ZodOptional:return pL(e,a);case A.ZodMap:return nL(e,a);case A.ZodSet:return gL(e,a);case A.ZodLazy:return()=>e.getter()._def;case A.ZodPromise:return hL(e,a);case A.ZodNaN:case A.ZodNever:return iL(a);case A.ZodEffects:return Q0(e,a);case A.ZodAny:return Qe(a);case A.ZodUnknown:return xL(a);case A.ZodDefault:return Y0(e,a);case A.ZodBranded:return cf(e,a);case A.ZodReadonly:return bL(e,a);case A.ZodCatch:return K0(e,a);case A.ZodPipeline:return mL(e,a);case A.ZodFunction:case A.ZodVoid:case A.ZodSymbol:return;default:return(n=>{})(t)}};function te(e,t,a=!1){let n=t.seen.get(e);if(t.override){let l=t.override?.(e,t,n,a);if(l!==H0)return l}if(n&&!a){let l=D2(n,t);if(l!==void 0)return l}let r={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,r);let o=SL(e,e.typeName,t),i=typeof o=="function"?te(o(),t):o;if(i&&R2(e,t,i),t.postProcess){let l=t.postProcess(i,e,t);return r.jsonSchema=i,l}return r.jsonSchema=i,i}var D2=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:uf(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((a,n)=>t.currentPath[n]===a)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Qe(t)):t.$refStrategy==="seen"?Qe(t):void 0}},R2=(e,t,a)=>(e.description&&(a.description=e.description,t.markdownDescription&&(a.markdownDescription=e.description)),a);var nv=(e,t)=>{let a=G0(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((s,[u,c])=>({...s,[u]:te(c._def,{...a,currentPath:[...a.basePath,a.definitionPath,u]},!0)??Qe(a)}),{}):void 0,r=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=te(e._def,r===void 0?a:{...a,currentPath:[...a.basePath,a.definitionPath,r]},!1)??Qe(a),i=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;i!==void 0&&(o.title=i),a.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[a.openAiAnyTypeName]||(n[a.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:a.$refStrategy==="relative"?"1":[...a.basePath,a.definitionPath,a.openAiAnyTypeName].join("/")}}));let l=r===void 0?n?{...o,[a.definitionPath]:n}:o:{$ref:[...a.$refStrategy==="relative"?[]:a.basePath,a.definitionPath,r].join("/"),[a.definitionPath]:{...n,[r]:o}};return a.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(a.target==="jsonSchema2019-09"||a.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),a.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l};var $2=nv;async function pf({api:e,threadId:t,widgets:a}){let n=a.map(({widgetType:s,schema:u,enrich:c})=>{let d=u.extend({widgetType:q0.literal(s)});return{widgetType:s,schema:$2(d),enrich:c}}),{baseUrl:r,token:o,headers:i={}}=e,l=await fetch(`${r}/chat/widgets`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`,"thread-id":t,...i},body:JSON.stringify({widgetSchemas:n})});if(!l.ok){let s=await l.text().catch(()=>l.statusText);throw new Error(`Failed to register chat widgets: ${l.status} ${s}`)}}var hf=_e(Ut());var wL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),P2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase()),ov=e=>{let t=P2(e);return t.charAt(0).toUpperCase()+t.slice(1)},mf=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim(),IL=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var lu=_e(Ut());var kL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var _L=(0,lu.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:r="",children:o,iconNode:i,...l},s)=>(0,lu.createElement)("svg",{ref:s,...kL,width:t,height:t,stroke:e,strokeWidth:n?Number(a)*24/Number(t):a,className:mf("lucide",r),...!o&&!IL(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,c])=>(0,lu.createElement)(u,c)),...Array.isArray(o)?o:[o]]));var Ct=(e,t)=>{let a=(0,hf.forwardRef)(({className:n,...r},o)=>(0,hf.createElement)(_L,{ref:o,iconNode:t,className:mf(`lucide-${wL(ov(e))}`,`lucide-${e}`,n),...r}));return a.displayName=ov(e),a};var N2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xo=Ct("chevron-right",N2);var U2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Vn=Ct("circle-stop",U2);var j2=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Wo=Ct("message-square",j2);var B2=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],su=Ct("mic-off",B2);var F2=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],uu=Ct("mic",F2);var q2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],cu=Ct("send",q2);var Z2=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],du=Ct("thumbs-up",Z2);var H2=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],fu=Ct("thumbs-down",H2);var V2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pu=Ct("x",V2);var ke=_e(Ut(),1);function CL(e,t){let a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}var G2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,X2={};function gf(e,t){return((t||X2).jsx?J2:G2).test(e)}var W2=/[ \t\n\f\r]/g;function iv(e){return typeof e=="object"?e.type==="text"?LL(e.value):!1:LL(e)}function LL(e){return e.replace(W2,"")===""}var Yr=class{constructor(t,a,n){this.normal=a,this.property=t,n&&(this.space=n)}};Yr.prototype.normal={};Yr.prototype.property={};Yr.prototype.space=void 0;function lv(e,t){let a={},n={};for(let r of e)Object.assign(a,r.property),Object.assign(n,r.normal);return new Yr(a,n,t)}function mu(e){return e.toLowerCase()}var Lt=class{constructor(t,a){this.attribute=a,this.property=t}};Lt.prototype.attribute="";Lt.prototype.booleanish=!1;Lt.prototype.boolean=!1;Lt.prototype.commaOrSpaceSeparated=!1;Lt.prototype.commaSeparated=!1;Lt.prototype.defined=!1;Lt.prototype.mustUseProperty=!1;Lt.prototype.number=!1;Lt.prototype.overloadedBoolean=!1;Lt.prototype.property="";Lt.prototype.spaceSeparated=!1;Lt.prototype.space=void 0;var hu={};ir(hu,{boolean:()=>ie,booleanish:()=>it,commaOrSpaceSeparated:()=>la,commaSeparated:()=>Gn,number:()=>$,overloadedBoolean:()=>vf,spaceSeparated:()=>ze});var K2=0,ie=Ko(),it=Ko(),vf=Ko(),$=Ko(),ze=Ko(),Gn=Ko(),la=Ko();function Ko(){return 2**++K2}var sv=Object.keys(hu),Yo=class extends Lt{constructor(t,a,n,r){let o=-1;if(super(t,a),TL(this,"space",r),typeof n=="number")for(;++o<sv.length;){let i=sv[o];TL(this,sv[o],(n&hu[i])===hu[i])}}};Yo.prototype.defined=!0;function TL(e,t,a){a&&(e[t]=a)}function Fa(e){let t={},a={};for(let[n,r]of Object.entries(e.properties)){let o=new Yo(n,e.transform(e.attributes||{},n),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,a[mu(n)]=n,a[mu(o.attribute)]=n}return new Yr(t,a,e.space)}var uv=Fa({properties:{ariaActiveDescendant:null,ariaAtomic:it,ariaAutoComplete:null,ariaBusy:it,ariaChecked:it,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:ze,ariaCurrent:null,ariaDescribedBy:ze,ariaDetails:null,ariaDisabled:it,ariaDropEffect:ze,ariaErrorMessage:null,ariaExpanded:it,ariaFlowTo:ze,ariaGrabbed:it,ariaHasPopup:null,ariaHidden:it,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ze,ariaLevel:$,ariaLive:null,ariaModal:it,ariaMultiLine:it,ariaMultiSelectable:it,ariaOrientation:null,ariaOwns:ze,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:it,ariaReadOnly:it,ariaRelevant:null,ariaRequired:it,ariaRoleDescription:ze,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:it,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function yf(e,t){return t in e?e[t]:t}function xf(e,t){return yf(e,t.toLowerCase())}var AL=Fa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gn,acceptCharset:ze,accessKey:ze,action:null,allow:null,allowFullScreen:ie,allowPaymentRequest:ie,allowUserMedia:ie,alt:null,as:null,async:ie,autoCapitalize:null,autoComplete:ze,autoFocus:ie,autoPlay:ie,blocking:ze,capture:null,charSet:null,checked:ie,cite:null,className:ze,cols:$,colSpan:null,content:null,contentEditable:it,controls:ie,controlsList:ze,coords:$|Gn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ie,defer:ie,dir:null,dirName:null,disabled:ie,download:vf,draggable:it,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ie,formTarget:null,headers:ze,height:$,hidden:vf,high:$,href:null,hrefLang:null,htmlFor:ze,httpEquiv:ze,id:null,imageSizes:null,imageSrcSet:null,inert:ie,inputMode:null,integrity:null,is:null,isMap:ie,itemId:null,itemProp:ze,itemRef:ze,itemScope:ie,itemType:ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ie,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:ie,muted:ie,name:null,nonce:null,noModule:ie,noValidate:ie,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:ie,optimum:$,pattern:null,ping:ze,placeholder:null,playsInline:ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ie,referrerPolicy:null,rel:ze,required:ie,reversed:ie,rows:$,rowSpan:$,sandbox:ze,scope:null,scoped:ie,seamless:ie,selected:ie,shadowRootClonable:ie,shadowRootDelegatesFocus:ie,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:it,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:ie,useMap:null,value:it,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ze,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ie,declare:ie,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:ie,noHref:ie,noShade:ie,noWrap:ie,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:it,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ie,disableRemotePlayback:ie,prefix:null,property:null,results:$,security:null,unselectable:null},space:"html",transform:xf});var EL=Fa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-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:la,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,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:Gn,g2:Gn,glyphName:Gn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:la,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,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:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:la,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:la,rev:la,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:la,requiredFeatures:la,requiredFonts:la,requiredFormats:la,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:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:la,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:la,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:la,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yf});var cv=Fa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var dv=Fa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:xf});var fv=Fa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var pv={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"};var Y2=/[A-Z]/g,ML=/-[a-z]/g,Q2=/^data[-\w.:]+$/i;function mv(e,t){let a=mu(t),n=t,r=Lt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Q2.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(ML,tP);n="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!ML.test(o)){let i=o.replace(Y2,eP);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=Yo}return new r(n,t)}function eP(e){return"-"+e.toLowerCase()}function tP(e){return e.charAt(1).toUpperCase()}var OL=lv([uv,AL,cv,dv,fv],"html"),bf=lv([uv,EL,cv,dv,fv],"svg");function zL(e){return e.join(" ").trim()}var JL=_e(ZL(),1);var wf=HL("end"),Il=HL("start");function HL(e){return t;function t(a){let n=a&&a.position&&a.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function vv(e){let t=Il(e),a=wf(e);if(t&&a)return{start:t,end:a}}function Jn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?VL(e.position):"start"in e||"end"in e?VL(e):"line"in e||"column"in e?yv(e):""}function yv(e){return GL(e&&e.line)+":"+GL(e&&e.column)}function VL(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function GL(e){return e&&typeof e=="number"?e:1}var ft=class extends Error{constructor(t,a,n){super(),typeof a=="string"&&(n=a,a=void 0);let r="",o={},i=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?r=t:!o.cause&&t&&(i=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?o.ruleId=n:(o.source=n.slice(0,s),o.ruleId=n.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){let s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}let l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Jn(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=i&&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}};ft.prototype.file="";ft.prototype.name="";ft.prototype.reason="";ft.prototype.message="";ft.prototype.stack="";ft.prototype.column=void 0;ft.prototype.line=void 0;ft.prototype.ancestors=void 0;ft.prototype.cause=void 0;ft.prototype.fatal=void 0;ft.prototype.place=void 0;ft.prototype.ruleId=void 0;ft.prototype.source=void 0;var xv={}.hasOwnProperty,LP=new Map,TP=/[A-Z]/g,AP=new Set(["table","tbody","thead","tfoot","tr"]),EP=new Set(["td","th"]),XL="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bv(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let a=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=NP(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=PP(a,t.jsx,t.jsxs)}let r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?bf:OL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=WL(r,e,void 0);return o&&typeof o!="string"?o:r.create(e,r.Fragment,{children:o||void 0},void 0)}function WL(e,t,a){if(t.type==="element")return MP(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return OP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return DP(e,t,a);if(t.type==="mdxjsEsm")return zP(e,t);if(t.type==="root")return RP(e,t,a);if(t.type==="text")return $P(e,t)}function MP(e,t,a){let n=e.schema,r=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=bf,e.schema=r),e.ancestors.push(t);let o=YL(e,t.tagName,!1),i=UP(e,t),l=wv(e,t);return AP.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!iv(s):!0})),KL(e,i,o,t),Sv(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function OP(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}vu(e,t.position)}function zP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vu(e,t.position)}function DP(e,t,a){let n=e.schema,r=n;t.name==="svg"&&n.space==="html"&&(r=bf,e.schema=r),e.ancestors.push(t);let o=t.name===null?e.Fragment:YL(e,t.name,!0),i=jP(e,t),l=wv(e,t);return KL(e,i,o,t),Sv(i,l),e.ancestors.pop(),e.schema=n,e.create(t,o,i,a)}function RP(e,t,a){let n={};return Sv(n,wv(e,t)),e.create(t,e.Fragment,n,a)}function $P(e,t){return t.value}function KL(e,t,a,n){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=n)}function Sv(e,t){if(t.length>0){let a=t.length>1?t:t[0];a&&(e.children=a)}}function PP(e,t,a){return n;function n(r,o,i,l){let u=Array.isArray(i.children)?a:t;return l?u(o,i,l):u(o,i)}}function NP(e,t){return a;function a(n,r,o,i){let l=Array.isArray(o.children),s=Il(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function UP(e,t){let a={},n,r;for(r in t.properties)if(r!=="children"&&xv.call(t.properties,r)){let o=BP(e,r,t.properties[r]);if(o){let[i,l]=o;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&EP.has(t.tagName)?n=l:a[i]=l}}if(n){let o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return a}function jP(e,t){let a={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let o=n.data.estree.body[0];o.type;let i=o.expression;i.type;let l=i.properties[0];l.type,Object.assign(a,e.evaluater.evaluateExpression(l.argument))}else vu(e,t.position);else{let r=n.name,o;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let l=n.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else vu(e,t.position);else o=n.value===null?!0:n.value;a[r]=o}return a}function wv(e,t){let a=[],n=-1,r=e.passKeys?new Map:LP;for(;++n<t.children.length;){let o=t.children[n],i;if(e.passKeys){let s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){let u=r.get(s)||0;i=s+"-"+u,r.set(s,u+1)}}let l=WL(e,o,i);l!==void 0&&a.push(l)}return a}function BP(e,t,a){let n=mv(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=n.commaSeparated?CL(a):zL(a)),n.property==="style"){let r=typeof a=="object"?a:FP(e,String(a));return e.stylePropertyNameCase==="css"&&(r=qP(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&n.space?pv[n.property]||n.property:n.attribute,a]}}function FP(e,t){try{return(0,JL.default)(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};let n=a,r=new ft("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=XL+"#cannot-parse-style-attribute",r}}function YL(e,t,a){let n;if(!a)n={type:"Literal",value:t};else if(t.includes(".")){let r=t.split("."),o=-1,i;for(;++o<r.length;){let l=gf(r[o])?{type:"Identifier",name:r[o]}:{type:"Literal",value:r[o]};i=i?{type:"MemberExpression",object:i,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}n=i}else n=gf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let r=n.value;return xv.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(n);vu(e)}function vu(e,t){let a=new ft("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=XL+"#cannot-handle-mdx-estrees-without-createevaluater",a}function qP(e){let t={},a;for(a in e)xv.call(e,a)&&(t[ZP(a)]=e[a]);return t}function ZP(e){let t=e.replace(TP,HP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function HP(e){return"-"+e.toLowerCase()}var yu={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"]};var Tl=_e(Bt(),1),L1=_e(Ut(),1);var JP={};function ei(e,t){let a=t||JP,n=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return rT(e,n,r)}function rT(e,t,a){if(XP(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return aT(e.children,t,a)}return Array.isArray(e)?aT(e,t,a):""}function aT(e,t,a){let n=[],r=-1;for(;++r<e.length;)n[r]=rT(e[r],t,a);return n.join("")}function XP(e){return!!(e&&typeof e=="object")}var nT=document.createElement("i");function kl(e){let t="&"+e+";";nT.innerHTML=t;let a=nT.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function pt(e,t,a,n){let r=e.length,o=0,i;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,a=a>0?a:0,n.length<1e4)i=Array.from(n),i.unshift(t,a),e.splice(...i);else for(a&&e.splice(t,a);o<n.length;)i=n.slice(o,o+1e4),i.unshift(t,0),e.splice(...i),o+=1e4,t+=1e4}function Xt(e,t){return e.length>0?(pt(e,e.length,0,t),e):t}var oT={}.hasOwnProperty;function kf(e){let t={},a=-1;for(;++a<e.length;)WP(t,e[a]);return t}function WP(e,t){let a;for(a in t){let r=(oT.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a],i;if(o)for(i in o){oT.call(r,i)||(r[i]=[]);let l=o[i];KP(r[i],Array.isArray(l)?l:l?[l]:[])}}}function KP(e,t){let a=-1,n=[];for(;++a<t.length;)(t[a].add==="after"?e:n).push(t[a]);pt(e,0,0,n)}function _f(e,t){let a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"\uFFFD":String.fromCodePoint(a)}function Ft(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var St=Xn(/[A-Za-z]/),lt=Xn(/[\dA-Za-z]/),iT=Xn(/[#-'*+\--9=?A-Z^-~]/);function ti(e){return e!==null&&(e<32||e===127)}var xu=Xn(/\d/),lT=Xn(/[\dA-Fa-f]/),sT=Xn(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}var ai=Xn(/\p{P}|\p{S}/u),vr=Xn(/\s/);function Xn(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function qa(e){let t=[],a=-1,n=0,r=0;for(;++a<e.length;){let o=e.charCodeAt(a),i="";if(o===37&&lt(e.charCodeAt(a+1))&&lt(e.charCodeAt(a+2)))r=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){let l=e.charCodeAt(a+1);o<56320&&l>56319&&l<57344?(i=String.fromCharCode(o,l),r=1):i="\uFFFD"}else i=String.fromCharCode(o);i&&(t.push(e.slice(n,a),encodeURIComponent(i)),n=a+r+1,i=""),r&&(a+=r,r=0)}return t.join("")+e.slice(n)}function W(e,t,a,n){let r=n?n-1:Number.POSITIVE_INFINITY,o=0;return i;function i(s){return Q(s)?(e.enter(a),l(s)):t(s)}function l(s){return Q(s)&&o++<r?(e.consume(s),l):(e.exit(a),t(s))}}var uT={tokenize:YP};function YP(e){let t=e.attempt(this.parser.constructs.contentInitial,n,r),a;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),W(e,t,"linePrefix")}function r(l){return e.enter("paragraph"),o(l)}function o(l){let s=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=s),a=s,i(l)}function i(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return H(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),i)}}var dT={tokenize:QP},cT={tokenize:eN};function QP(e){let t=this,a=[],n=0,r,o,i;return l;function l(g){if(n<a.length){let S=a[n];return t.containerState=S[1],e.attempt(S[0].continuation,s,u)(g)}return u(g)}function s(g){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();let S=t.events.length,L=S,_;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){_=t.events[L][1].end;break}v(n);let T=S;for(;T<t.events.length;)t.events[T][1].end={..._},T++;return pt(t.events,L+1,0,t.events.slice(S)),t.events.length=T,u(g)}return l(g)}function u(g){if(n===a.length){if(!r)return p(g);if(r.currentConstruct&&r.currentConstruct.concrete)return m(g);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(cT,c,d)(g)}function c(g){return r&&y(),v(n),p(g)}function d(g){return t.parser.lazy[t.now().line]=n!==a.length,i=t.now().offset,m(g)}function p(g){return t.containerState={},e.attempt(cT,f,m)(g)}function f(g){return n++,a.push([t.currentConstruct,t.containerState]),p(g)}function m(g){if(g===null){r&&y(),v(0),e.consume(g);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),x(g)}function x(g){if(g===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(g);return}return H(g)?(e.consume(g),b(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(g),x)}function b(g,S){let L=t.sliceStream(g);if(S&&L.push(null),g.previous=o,o&&(o.next=g),o=g,r.defineSkip(g.start),r.write(L),t.parser.lazy[g.start.line]){let _=r.events.length;for(;_--;)if(r.events[_][1].start.offset<i&&(!r.events[_][1].end||r.events[_][1].end.offset>i))return;let T=t.events.length,O=T,R,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(R){k=t.events[O][1].end;break}R=!0}for(v(n),_=T;_<t.events.length;)t.events[_][1].end={...k},_++;pt(t.events,O+1,0,t.events.slice(T)),t.events.length=_}}function v(g){let S=a.length;for(;S-- >g;){let L=a[S];t.containerState=L[1],L[0].exit.call(t,e)}a.length=g}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function eN(e,t,a){return W(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qr(e){if(e===null||me(e)||vr(e))return 1;if(ai(e))return 2}function Wn(e,t,a){let n=[],r=-1;for(;++r<e.length;){let o=e[r].resolveAll;o&&!n.includes(o)&&(t=o(t,a),n.push(o))}return t}var bu={name:"attention",resolveAll:tN,tokenize:aN};function tN(e,t){let a=-1,n,r,o,i,l,s,u,c;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(n=a;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[n][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[a][1].start};fT(d,-s),fT(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[a][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[a][1].start={...l.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=Xt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=Xt(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),u=Xt(u,Wn(t.parser.constructs.insideSpan.null,e.slice(n+1,a),t)),u=Xt(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[a][1].end.offset-e[a][1].start.offset?(c=2,u=Xt(u,[["enter",e[a][1],t],["exit",e[a][1],t]])):c=0,pt(e,n-1,a-n+3,u),a=n+u.length-c-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function aN(e,t){let a=this.parser.constructs.attentionMarkers.null,n=this.previous,r=Qr(n),o;return i;function i(s){return o=s,e.enter("attentionSequence"),l(s)}function l(s){if(s===o)return e.consume(s),l;let u=e.exit("attentionSequence"),c=Qr(s),d=!c||c===2&&r||a.includes(s),p=!r||r===2&&c||a.includes(n);return u._open=!!(o===42?d:d&&(r||!p)),u._close=!!(o===42?p:p&&(c||!d)),t(s)}}function fT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Iv={name:"autolink",tokenize:rN};function rN(e,t,a){let n=0;return r;function r(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return St(f)?(e.consume(f),i):f===64?a(f):u(f)}function i(f){return f===43||f===45||f===46||lt(f)?(n=1,l(f)):u(f)}function l(f){return f===58?(e.consume(f),n=0,s):(f===43||f===45||f===46||lt(f))&&n++<32?(e.consume(f),l):(n=0,u(f))}function s(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||ti(f)?a(f):(e.consume(f),s)}function u(f){return f===64?(e.consume(f),c):iT(f)?(e.consume(f),u):a(f)}function c(f){return lt(f)?d(f):a(f)}function d(f){return f===46?(e.consume(f),n=0,c):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||lt(f))&&n++<63){let m=f===45?p:d;return e.consume(f),m}return a(f)}}var yr={partial:!0,tokenize:nN};function nN(e,t,a){return n;function n(o){return Q(o)?W(e,r,"linePrefix")(o):r(o)}function r(o){return o===null||H(o)?t(o):a(o)}}var Cf={continuation:{tokenize:iN},exit:lN,name:"blockQuote",tokenize:oN};function oN(e,t,a){let n=this;return r;function r(i){if(i===62){let l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return a(i)}function o(i){return Q(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function iN(e,t,a){let n=this;return r;function r(i){return Q(i)?W(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Cf,t,a)(i)}}function lN(e){e.exit("blockQuote")}var Lf={name:"characterEscape",tokenize:sN};function sN(e,t,a){return n;function n(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return sT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}var Tf={name:"characterReference",tokenize:uN};function uN(e,t,a){let n=this,r=0,o,i;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),s}function s(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=lt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=lT,c):(e.enter("characterReferenceValue"),o=7,i=xu,c(d))}function c(d){if(d===59&&r){let p=e.exit("characterReferenceValue");return i===lt&&!kl(n.sliceSerialize(p))?a(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(d)&&r++<o?(e.consume(d),c):a(d)}}var pT={partial:!0,tokenize:dN},Af={concrete:!0,name:"codeFenced",tokenize:cN};function cN(e,t,a){let n=this,r={partial:!0,tokenize:L},o=0,i=0,l;return s;function s(_){return u(_)}function u(_){let T=n.events[n.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(_)}function c(_){return _===l?(i++,e.consume(_),c):i<3?a(_):(e.exit("codeFencedFenceSequence"),Q(_)?W(e,d,"whitespace")(_):d(_))}function d(_){return _===null||H(_)?(e.exit("codeFencedFence"),n.interrupt?t(_):e.check(pT,x,S)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||H(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(_)):Q(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),W(e,f,"whitespace")(_)):_===96&&_===l?a(_):(e.consume(_),p)}function f(_){return _===null||H(_)?d(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===null||H(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(_)):_===96&&_===l?a(_):(e.consume(_),m)}function x(_){return e.attempt(r,S,b)(_)}function b(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),v}function v(_){return o>0&&Q(_)?W(e,y,"linePrefix",o+1)(_):y(_)}function y(_){return _===null||H(_)?e.check(pT,x,S)(_):(e.enter("codeFlowValue"),g(_))}function g(_){return _===null||H(_)?(e.exit("codeFlowValue"),y(_)):(e.consume(_),g)}function S(_){return e.exit("codeFenced"),t(_)}function L(_,T,O){let R=0;return k;function k(F){return _.enter("lineEnding"),_.consume(F),_.exit("lineEnding"),Y}function Y(F){return _.enter("codeFencedFence"),Q(F)?W(_,q,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):q(F)}function q(F){return F===l?(_.enter("codeFencedFenceSequence"),V(F)):O(F)}function V(F){return F===l?(R++,_.consume(F),V):R>=i?(_.exit("codeFencedFenceSequence"),Q(F)?W(_,X,"whitespace")(F):X(F)):O(F)}function X(F){return F===null||H(F)?(_.exit("codeFencedFence"),T(F)):O(F)}}}function dN(e,t,a){let n=this;return r;function r(i){return i===null?a(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}var Su={name:"codeIndented",tokenize:pN},fN={partial:!0,tokenize:mN};function pN(e,t,a){let n=this;return r;function r(u){return e.enter("codeIndented"),W(e,o,"linePrefix",5)(u)}function o(u){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(u):a(u)}function i(u){return u===null?s(u):H(u)?e.attempt(fN,i,s)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||H(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),l)}function s(u){return e.exit("codeIndented"),t(u)}}function mN(e,t,a){let n=this;return r;function r(i){return n.parser.lazy[n.now().line]?a(i):H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):W(e,o,"linePrefix",5)(i)}function o(i){let l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):H(i)?r(i):a(i)}}var kv={name:"codeText",previous:gN,resolve:hN,tokenize:vN};function hN(e){let t=e.length-4,a=3,n,r;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=a;++n<t;)if(e[n][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(n=a-1,t++;++n<=t;)r===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(r=n):(n===t||e[n][1].type==="lineEnding")&&(e[r][1].type="codeTextData",n!==r+2&&(e[r][1].end=e[n-1][1].end,e.splice(r+2,n-r-2),t-=n-r-2,n=r+2),r=void 0);return e}function gN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function vN(e,t,a){let n=this,r=0,o,i;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),s(p)}function s(p){return p===96?(e.consume(p),r++,s):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(i=e.enter("codeTextSequence"),o=0,d(p)):H(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||H(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}var Ef=class{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,a){let n=a??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,a,n){let r=a||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&wu(this.left,n),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),wu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),wu(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){let a=this.left.splice(t,Number.POSITIVE_INFINITY);wu(this.right,a.reverse())}else{let a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);wu(this.left,a.reverse())}}};function wu(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function Mf(e){let t={},a=-1,n,r,o,i,l,s,u,c=new Ef(e);for(;++a<c.length;){for(;a in t;)a=t[a];if(n=c.get(a),a&&n[1].type==="chunkFlow"&&c.get(a-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,yN(c,a)),a=t[a],u=!0);else if(n[1]._container){for(o=a,r=void 0;o--;)if(i=c.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,a),l.unshift(n),c.splice(r,a-r+1,l))}}return pt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function yN(e,t){let a=e.get(t)[1],n=e.get(t)[2],r=t-1,o=[],i=a._tokenizer;i||(i=n.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let l=i.events,s=[],u={},c,d,p=-1,f=a,m=0,x=0,b=[x];for(;f;){for(;e.get(++r)[1]!==f;);o.push(r),f._tokenizer||(c=n.sliceStream(f),f.next||c.push(null),d&&i.defineSkip(f.start),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=a;++p<l.length;)l[p][0]==="exit"&&l[p-1][0]==="enter"&&l[p][1].type===l[p-1][1].type&&l[p][1].start.line!==l[p][1].end.line&&(x=p+1,b.push(x),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(i.events=[],f?(f._tokenizer=void 0,f.previous=void 0):b.pop(),p=b.length;p--;){let v=l.slice(b[p],b[p+1]),y=o.pop();s.push([y,y+v.length-1]),e.splice(y,2,v)}for(s.reverse(),p=-1;++p<s.length;)u[m+s[p][0]]=m+s[p][1],m+=s[p][1]-s[p][0]-1;return u}var _v={resolve:bN,tokenize:SN},xN={partial:!0,tokenize:wN};function bN(e){return Mf(e),e}function SN(e,t){let a;return n;function n(l){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?o(l):H(l)?e.check(xN,i,o)(l):(e.consume(l),r)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function i(l){return e.consume(l),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function wN(e,t,a){let n=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),W(e,o,"linePrefix")}function o(i){if(i===null||H(i))return a(i);let l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,a,t)(i)}}function Of(e,t,a,n,r,o,i,l,s){let u=s||Number.POSITIVE_INFINITY,c=0;return d;function d(v){return v===60?(e.enter(n),e.enter(r),e.enter(o),e.consume(v),e.exit(o),p):v===null||v===32||v===41||ti(v)?a(v):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(v))}function p(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(r),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(l),p(v)):v===null||v===60||H(v)?a(v):(e.consume(v),v===92?m:f)}function m(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function x(v){return!c&&(v===null||v===41||me(v))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(v)):c<u&&v===40?(e.consume(v),c++,x):v===41?(e.consume(v),c--,x):v===null||v===32||v===40||ti(v)?a(v):(e.consume(v),v===92?b:x)}function b(v){return v===40||v===41||v===92?(e.consume(v),x):x(v)}}function zf(e,t,a,n,r,o){let i=this,l=0,s;return u;function u(f){return e.enter(n),e.enter(r),e.consume(f),e.exit(r),e.enter(o),c}function c(f){return l>999||f===null||f===91||f===93&&!s||f===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?a(f):f===93?(e.exit(o),e.enter(r),e.consume(f),e.exit(r),e.exit(n),t):H(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||H(f)||l++>999?(e.exit("chunkString"),c(f)):(e.consume(f),s||(s=!Q(f)),f===92?p:d)}function p(f){return f===91||f===92||f===93?(e.consume(f),l++,d):d(f)}}function Df(e,t,a,n,r,o){let i;return l;function l(p){return p===34||p===39||p===40?(e.enter(n),e.enter(r),e.consume(p),e.exit(r),i=p===40?41:p,s):a(p)}function s(p){return p===i?(e.enter(r),e.consume(p),e.exit(r),e.exit(n),t):(e.enter(o),u(p))}function u(p){return p===i?(e.exit(o),s(i)):p===null?a(p):H(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),W(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===i||p===null||H(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:c)}function d(p){return p===i||p===92?(e.consume(p),c):c(p)}}function ri(e,t){let a;return n;function n(r){return H(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a=!0,n):Q(r)?W(e,n,a?"linePrefix":"lineSuffix")(r):t(r)}}var Cv={name:"definition",tokenize:kN},IN={partial:!0,tokenize:_N};function kN(e,t,a){let n=this,r;return o;function o(f){return e.enter("definition"),i(f)}function i(f){return zf.call(n,e,l,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return r=Ft(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):a(f)}function s(f){return me(f)?ri(e,u)(f):u(f)}function u(f){return Of(e,c,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function c(f){return e.attempt(IN,d,d)(f)}function d(f){return Q(f)?W(e,p,"whitespace")(f):p(f)}function p(f){return f===null||H(f)?(e.exit("definition"),n.parser.defined.push(r),t(f)):a(f)}}function _N(e,t,a){return n;function n(l){return me(l)?ri(e,r)(l):a(l)}function r(l){return Df(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Q(l)?W(e,i,"whitespace")(l):i(l)}function i(l){return l===null||H(l)?t(l):a(l)}}var Lv={name:"hardBreakEscape",tokenize:CN};function CN(e,t,a){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),r}function r(o){return H(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}var Tv={name:"headingAtx",resolve:LN,tokenize:TN};function LN(e,t){let a=e.length-2,n=3,r,o;return e[n][1].type==="whitespace"&&(n+=2),a-2>n&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(n===a-1||a-4>n&&e[a-2][1].type==="whitespace")&&(a-=n+1===a?2:4),a>n&&(r={type:"atxHeadingText",start:e[n][1].start,end:e[a][1].end},o={type:"chunkText",start:e[n][1].start,end:e[a][1].end,contentType:"text"},pt(e,n,a-n+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function TN(e,t,a){let n=0;return r;function r(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&n++<6?(e.consume(c),i):c===null||me(c)?(e.exit("atxHeadingSequence"),l(c)):a(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||H(c)?(e.exit("atxHeading"),t(c)):Q(c)?W(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||me(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}var mT=["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"],Av=["pre","script","style","textarea"];var Ev={concrete:!0,name:"htmlFlow",resolveTo:MN,tokenize:ON},AN={partial:!0,tokenize:DN},EN={partial:!0,tokenize:zN};function MN(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 ON(e,t,a){let n=this,r,o,i,l,s;return u;function u(w){return c(w)}function c(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),d}function d(w){return w===33?(e.consume(w),p):w===47?(e.consume(w),o=!0,x):w===63?(e.consume(w),r=3,n.interrupt?t:I):St(w)?(e.consume(w),i=String.fromCharCode(w),b):a(w)}function p(w){return w===45?(e.consume(w),r=2,f):w===91?(e.consume(w),r=5,l=0,m):St(w)?(e.consume(w),r=4,n.interrupt?t:I):a(w)}function f(w){return w===45?(e.consume(w),n.interrupt?t:I):a(w)}function m(w){let Ze="CDATA[";return w===Ze.charCodeAt(l++)?(e.consume(w),l===Ze.length?n.interrupt?t:q:m):a(w)}function x(w){return St(w)?(e.consume(w),i=String.fromCharCode(w),b):a(w)}function b(w){if(w===null||w===47||w===62||me(w)){let Ze=w===47,La=i.toLowerCase();return!Ze&&!o&&Av.includes(La)?(r=1,n.interrupt?t(w):q(w)):mT.includes(i.toLowerCase())?(r=6,Ze?(e.consume(w),v):n.interrupt?t(w):q(w)):(r=7,n.interrupt&&!n.parser.lazy[n.now().line]?a(w):o?y(w):g(w))}return w===45||lt(w)?(e.consume(w),i+=String.fromCharCode(w),b):a(w)}function v(w){return w===62?(e.consume(w),n.interrupt?t:q):a(w)}function y(w){return Q(w)?(e.consume(w),y):k(w)}function g(w){return w===47?(e.consume(w),k):w===58||w===95||St(w)?(e.consume(w),S):Q(w)?(e.consume(w),g):k(w)}function S(w){return w===45||w===46||w===58||w===95||lt(w)?(e.consume(w),S):L(w)}function L(w){return w===61?(e.consume(w),_):Q(w)?(e.consume(w),L):g(w)}function _(w){return w===null||w===60||w===61||w===62||w===96?a(w):w===34||w===39?(e.consume(w),s=w,T):Q(w)?(e.consume(w),_):O(w)}function T(w){return w===s?(e.consume(w),s=null,R):w===null||H(w)?a(w):(e.consume(w),T)}function O(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||me(w)?L(w):(e.consume(w),O)}function R(w){return w===47||w===62||Q(w)?g(w):a(w)}function k(w){return w===62?(e.consume(w),Y):a(w)}function Y(w){return w===null||H(w)?q(w):Q(w)?(e.consume(w),Y):a(w)}function q(w){return w===45&&r===2?(e.consume(w),j):w===60&&r===1?(e.consume(w),fe):w===62&&r===4?(e.consume(w),$e):w===63&&r===3?(e.consume(w),I):w===93&&r===5?(e.consume(w),rt):H(w)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(AN,da,V)(w)):w===null||H(w)?(e.exit("htmlFlowData"),V(w)):(e.consume(w),q)}function V(w){return e.check(EN,X,da)(w)}function X(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),F}function F(w){return w===null||H(w)?V(w):(e.enter("htmlFlowData"),q(w))}function j(w){return w===45?(e.consume(w),I):q(w)}function fe(w){return w===47?(e.consume(w),i="",at):q(w)}function at(w){if(w===62){let Ze=i.toLowerCase();return Av.includes(Ze)?(e.consume(w),$e):q(w)}return St(w)&&i.length<8?(e.consume(w),i+=String.fromCharCode(w),at):q(w)}function rt(w){return w===93?(e.consume(w),I):q(w)}function I(w){return w===62?(e.consume(w),$e):w===45&&r===2?(e.consume(w),I):q(w)}function $e(w){return w===null||H(w)?(e.exit("htmlFlowData"),da(w)):(e.consume(w),$e)}function da(w){return e.exit("htmlFlow"),t(w)}}function zN(e,t,a){let n=this;return r;function r(i){return H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):a(i)}function o(i){return n.parser.lazy[n.now().line]?a(i):t(i)}}function DN(e,t,a){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(yr,t,a)}}var Mv={name:"htmlText",tokenize:RN};function RN(e,t,a){let n=this,r,o,i;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),s}function s(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),L):I===63?(e.consume(I),g):St(I)?(e.consume(I),O):a(I)}function u(I){return I===45?(e.consume(I),c):I===91?(e.consume(I),o=0,m):St(I)?(e.consume(I),y):a(I)}function c(I){return I===45?(e.consume(I),f):a(I)}function d(I){return I===null?a(I):I===45?(e.consume(I),p):H(I)?(i=d,fe(I)):(e.consume(I),d)}function p(I){return I===45?(e.consume(I),f):d(I)}function f(I){return I===62?j(I):I===45?p(I):d(I)}function m(I){let $e="CDATA[";return I===$e.charCodeAt(o++)?(e.consume(I),o===$e.length?x:m):a(I)}function x(I){return I===null?a(I):I===93?(e.consume(I),b):H(I)?(i=x,fe(I)):(e.consume(I),x)}function b(I){return I===93?(e.consume(I),v):x(I)}function v(I){return I===62?j(I):I===93?(e.consume(I),v):x(I)}function y(I){return I===null||I===62?j(I):H(I)?(i=y,fe(I)):(e.consume(I),y)}function g(I){return I===null?a(I):I===63?(e.consume(I),S):H(I)?(i=g,fe(I)):(e.consume(I),g)}function S(I){return I===62?j(I):g(I)}function L(I){return St(I)?(e.consume(I),_):a(I)}function _(I){return I===45||lt(I)?(e.consume(I),_):T(I)}function T(I){return H(I)?(i=T,fe(I)):Q(I)?(e.consume(I),T):j(I)}function O(I){return I===45||lt(I)?(e.consume(I),O):I===47||I===62||me(I)?R(I):a(I)}function R(I){return I===47?(e.consume(I),j):I===58||I===95||St(I)?(e.consume(I),k):H(I)?(i=R,fe(I)):Q(I)?(e.consume(I),R):j(I)}function k(I){return I===45||I===46||I===58||I===95||lt(I)?(e.consume(I),k):Y(I)}function Y(I){return I===61?(e.consume(I),q):H(I)?(i=Y,fe(I)):Q(I)?(e.consume(I),Y):R(I)}function q(I){return I===null||I===60||I===61||I===62||I===96?a(I):I===34||I===39?(e.consume(I),r=I,V):H(I)?(i=q,fe(I)):Q(I)?(e.consume(I),q):(e.consume(I),X)}function V(I){return I===r?(e.consume(I),r=void 0,F):I===null?a(I):H(I)?(i=V,fe(I)):(e.consume(I),V)}function X(I){return I===null||I===34||I===39||I===60||I===61||I===96?a(I):I===47||I===62||me(I)?R(I):(e.consume(I),X)}function F(I){return I===47||I===62||me(I)?R(I):a(I)}function j(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):a(I)}function fe(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),at}function at(I){return Q(I)?W(e,rt,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):rt(I)}function rt(I){return e.enter("htmlTextData"),i(I)}}var ni={name:"labelEnd",resolveAll:UN,resolveTo:jN,tokenize:BN},$N={tokenize:FN},PN={tokenize:qN},NN={tokenize:ZN};function UN(e){let t=-1,a=[];for(;++t<e.length;){let n=e[t][1];if(a.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let r=n.type==="labelImage"?4:2;n.type="data",t+=r}}return e.length!==a.length&&pt(e,0,e.length,a),e}function jN(e,t){let a=e.length,n=0,r,o,i,l;for(;a--;)if(r=e[a][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(i){if(e[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=a,r.type!=="labelLink")){n=2;break}}else r.type==="labelEnd"&&(i=a);let s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[o+n+2][1].end},end:{...e[i-2][1].start}};return l=[["enter",s,t],["enter",u,t]],l=Xt(l,e.slice(o+1,o+n+3)),l=Xt(l,[["enter",c,t]]),l=Xt(l,Wn(t.parser.constructs.insideSpan.null,e.slice(o+n+4,i-3),t)),l=Xt(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=Xt(l,e.slice(i+1)),l=Xt(l,[["exit",s,t]]),pt(e,o,e.length,l),e}function BN(e,t,a){let n=this,r=n.events.length,o,i;for(;r--;)if((n.events[r][1].type==="labelImage"||n.events[r][1].type==="labelLink")&&!n.events[r][1]._balanced){o=n.events[r][1];break}return l;function l(p){return o?o._inactive?d(p):(i=n.parser.defined.includes(Ft(n.sliceSerialize({start:o.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):a(p)}function s(p){return p===40?e.attempt($N,c,i?c:d)(p):p===91?e.attempt(PN,c,i?u:d)(p):i?c(p):d(p)}function u(p){return e.attempt(NN,c,d)(p)}function c(p){return t(p)}function d(p){return o._balanced=!0,a(p)}}function FN(e,t,a){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),r}function r(d){return me(d)?ri(e,o)(d):o(d)}function o(d){return d===41?c(d):Of(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return me(d)?ri(e,s)(d):c(d)}function l(d){return a(d)}function s(d){return d===34||d===39||d===40?Df(e,u,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return me(d)?ri(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):a(d)}}function qN(e,t,a){let n=this;return r;function r(l){return zf.call(n,e,o,i,"reference","referenceMarker","referenceString")(l)}function o(l){return n.parser.defined.includes(Ft(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):a(l)}function i(l){return a(l)}}function ZN(e,t,a){return n;function n(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}var Ov={name:"labelStartImage",resolveAll:ni.resolveAll,tokenize:HN};function HN(e,t,a){let n=this;return r;function r(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),i):a(l)}function i(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(l):t(l)}}var zv={name:"labelStartLink",resolveAll:ni.resolveAll,tokenize:VN};function VN(e,t,a){let n=this;return r;function r(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),o}function o(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?a(i):t(i)}}var Iu={name:"lineEnding",tokenize:GN};function GN(e,t){return a;function a(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),W(e,t,"linePrefix")}}var oi={name:"thematicBreak",tokenize:JN};function JN(e,t,a){let n=0,r;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,l(u)}function l(u){return u===r?(e.enter("thematicBreakSequence"),s(u)):n>=3&&(u===null||H(u))?(e.exit("thematicBreak"),t(u)):a(u)}function s(u){return u===r?(e.consume(u),n++,s):(e.exit("thematicBreakSequence"),Q(u)?W(e,l,"whitespace")(u):l(u))}}var qt={continuation:{tokenize:YN},exit:e4,name:"list",tokenize:KN},XN={partial:!0,tokenize:t4},WN={partial:!0,tokenize:QN};function KN(e,t,a){let n=this,r=n.events[n.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return l;function l(f){let m=n.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||f===n.containerState.marker:xu(f)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(oi,a,u)(f):u(f);if(!n.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return a(f)}function s(f){return xu(f)&&++i<10?(e.consume(f),s):(!n.interrupt||i<2)&&(n.containerState.marker?f===n.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):a(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||f,e.check(yr,n.interrupt?a:c,e.attempt(XN,p,d))}function c(f){return n.containerState.initialBlankLine=!0,o++,p(f)}function d(f){return Q(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):a(f)}function p(f){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function YN(e,t,a){let n=this;return n.containerState._closeFlow=void 0,e.check(yr,r,o);function r(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,W(e,t,"listItemIndent",n.containerState.size+1)(l)}function o(l){return n.containerState.furtherBlankLines||!Q(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(WN,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,W(e,e.attempt(qt,t,a),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function QN(e,t,a){let n=this;return W(e,r,"listItemIndent",n.containerState.size+1);function r(o){let i=n.events[n.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===n.containerState.size?t(o):a(o)}}function e4(e){e.exit(this.containerState.type)}function t4(e,t,a){let n=this;return W(e,r,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){let i=n.events[n.events.length-1];return!Q(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}var Rf={name:"setextUnderline",resolveTo:a4,tokenize:r4};function a4(e,t){let a=e.length,n,r,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){n=a;break}e[a][1].type==="paragraph"&&(r=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e}function r4(e,t,a){let n=this,r;return o;function o(u){let c=n.events.length,d;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){d=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),r=u,i(u)):a(u)}function i(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Q(u)?W(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||H(u)?(e.exit("setextHeadingLine"),t(u)):a(u)}}var hT={tokenize:n4};function n4(e){let t=this,a=e.attempt(yr,n,e.attempt(this.parser.constructs.flowInitial,r,W(e,e.attempt(this.parser.constructs.flow,r,e.attempt(_v,r)),"linePrefix")));return a;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}var gT={resolveAll:bT()},vT=xT("string"),yT=xT("text");function xT(e){return{resolveAll:bT(e==="text"?o4:void 0),tokenize:t};function t(a){let n=this,r=this.parser.constructs[e],o=a.attempt(r,i,l);return i;function i(c){return u(c)?o(c):l(c)}function l(c){if(c===null){a.consume(c);return}return a.enter("data"),a.consume(c),s}function s(c){return u(c)?(a.exit("data"),o(c)):(a.consume(c),s)}function u(c){if(c===null)return!0;let d=r[c],p=-1;if(d)for(;++p<d.length;){let f=d[p];if(!f.previous||f.previous.call(n,n.previous))return!0}return!1}}}function bT(e){return t;function t(a,n){let r=-1,o;for(;++r<=a.length;)o===void 0?a[r]&&a[r][1].type==="data"&&(o=r,r++):(!a[r]||a[r][1].type!=="data")&&(r!==o+2&&(a[o][1].end=a[r-1][1].end,a.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(a,n):a}}function o4(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){let n=e[a-1][1],r=t.sliceStream(n),o=r.length,i=-1,l=0,s;for(;o--;){let u=r[o];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)l++,i--;if(i)break;i=-1}else if(u===-2)s=!0,l++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(l=0),l){let u={type:a===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:n.start._bufferIndex+i,_index:n.start._index+o,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(e.splice(a,0,["enter",u,t],["exit",u,t]),a+=2)}a++}return e}var Dv={};ir(Dv,{attentionMarkers:()=>p4,contentInitial:()=>l4,disable:()=>m4,document:()=>i4,flow:()=>u4,flowInitial:()=>s4,insideSpan:()=>f4,string:()=>c4,text:()=>d4});var i4={42:qt,43:qt,45:qt,48:qt,49:qt,50:qt,51:qt,52:qt,53:qt,54:qt,55:qt,56:qt,57:qt,62:Cf},l4={91:Cv},s4={[-2]:Su,[-1]:Su,32:Su},u4={35:Tv,42:oi,45:[Rf,oi],60:Ev,61:Rf,95:oi,96:Af,126:Af},c4={38:Tf,92:Lf},d4={[-5]:Iu,[-4]:Iu,[-3]:Iu,33:Ov,38:Tf,42:bu,60:[Iv,Mv],91:zv,92:[Lv,Lf],93:ni,95:bu,96:kv},f4={null:[bu,gT]},p4={null:[42,95]},m4={null:[]};function ST(e,t,a){let n={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0},r={},o=[],i=[],l=[],s=!0,u={attempt:R(T),check:R(O),consume:S,enter:L,exit:_,interrupt:R(O,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:b,parser:e,previous:null,sliceSerialize:m,sliceStream:x,write:f},d=t.tokenize.call(c,u),p;return t.resolveAll&&o.push(t),c;function f(V){return i=Xt(i,V),y(),i[i.length-1]!==null?[]:(k(t,0),c.events=Wn(o,c.events,c),c.events)}function m(V,X){return g4(x(V),X)}function x(V){return h4(i,V)}function b(){let{_bufferIndex:V,_index:X,line:F,column:j,offset:fe}=n;return{_bufferIndex:V,_index:X,line:F,column:j,offset:fe}}function v(V){r[V.line]=V.column,q()}function y(){let V;for(;n._index<i.length;){let X=i[n._index];if(typeof X=="string")for(V=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===V&&n._bufferIndex<X.length;)g(X.charCodeAt(n._bufferIndex));else g(X)}}function g(V){s=void 0,p=V,d=d(V)}function S(V){H(V)?(n.line++,n.column=1,n.offset+=V===-3?2:1,q()):V!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===i[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=V,s=!0}function L(V,X){let F=X||{};return F.type=V,F.start=b(),c.events.push(["enter",F,c]),l.push(F),F}function _(V){let X=l.pop();return X.end=b(),c.events.push(["exit",X,c]),X}function T(V,X){k(V,X.from)}function O(V,X){X.restore()}function R(V,X){return F;function F(j,fe,at){let rt,I,$e,da;return Array.isArray(j)?Ze(j):"tokenize"in j?Ze([j]):w(j);function w(ut){return $t;function $t(At){let Kt=At!==null&&ut[At],pn=At!==null&&ut.null,Yl=[...Array.isArray(Kt)?Kt:Kt?[Kt]:[],...Array.isArray(pn)?pn:pn?[pn]:[]];return Ze(Yl)(At)}}function Ze(ut){return rt=ut,I=0,ut.length===0?at:La(ut[I])}function La(ut){return $t;function $t(At){return da=Y(),$e=ut,ut.partial||(c.currentConstruct=ut),ut.name&&c.parser.constructs.disable.null.includes(ut.name)?_r(At):ut.tokenize.call(X?Object.assign(Object.create(c),X):c,u,fn,_r)(At)}}function fn(ut){return s=!0,V($e,da),fe}function _r(ut){return s=!0,da.restore(),++I<rt.length?La(rt[I]):at}}}function k(V,X){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&pt(c.events,X,c.events.length-X,V.resolve(c.events.slice(X),c)),V.resolveTo&&(c.events=V.resolveTo(c.events,c))}function Y(){let V=b(),X=c.previous,F=c.currentConstruct,j=c.events.length,fe=Array.from(l);return{from:j,restore:at};function at(){n=V,c.previous=X,c.currentConstruct=F,c.events.length=j,l=fe,q()}}function q(){n.line in r&&n.column<2&&(n.column=r[n.line],n.offset+=r[n.line]-1)}}function h4(e,t){let a=t.start._index,n=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex,i;if(a===r)i=[e[a].slice(n,o)];else{if(i=e.slice(a,r),n>-1){let l=i[0];typeof l=="string"?i[0]=l.slice(n):i.shift()}o>0&&i.push(e[r].slice(0,o))}return i}function g4(e,t){let a=-1,n=[],r;for(;++a<e.length;){let o=e[a],i;if(typeof o=="string")i=o;else switch(o){case-5:{i="\r";break}case-4:{i=`
17
17
  `;break}case-3:{i=`\r
18
18
  `;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&r)continue;i=" ";break}default:i=String.fromCharCode(o)}r=o===-2,n.push(i)}return n.join("")}function Rv(e){let n={constructs:kf([Dv,...(e||{}).extensions||[]]),content:r(uT),defined:[],document:r(dT),flow:r(hT),lazy:{},string:r(vT),text:r(yT)};return n;function r(o){return i;function i(l){return ST(n,o,l)}}}function $v(e){for(;!Mf(e););return e}var wT=/[\0\t\n\r]/g;function Pv(){let e=1,t="",a=!0,n;return r;function r(o,i,l){let s=[],u,c,d,p,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(i||void 0).decode(o)),d=0,t="",a&&(o.charCodeAt(0)===65279&&d++,a=void 0);d<o.length;){if(wT.lastIndex=d,u=wT.exec(o),p=u&&u.index!==void 0?u.index:o.length,f=o.charCodeAt(p),!u){t=o.slice(d);break}if(f===10&&d===p&&n)s.push(-3),n=void 0;else switch(n&&(s.push(-5),n=void 0),d<p&&(s.push(o.slice(d,p)),e+=p-d),f){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:n=!0,e=1}d=p+1}return l&&(n&&s.push(-5),t&&s.push(t),s.push(null)),s}}var v4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function IT(e){return e.replace(v4,y4)}function y4(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){let r=a.charCodeAt(1),o=r===120||r===88;return _f(a.slice(o?2:1),o?16:10)}return kl(a)||e}var _T={}.hasOwnProperty;function Nv(e,t,a){return typeof t!="string"&&(a=t,t=void 0),x4(a)($v(Rv(a).document().write(Pv()(e,t,!0))))}function x4(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(et),autolinkProtocol:R,autolinkEmail:R,atxHeading:o(kc),blockQuote:o(At),characterEscape:R,characterReference:R,codeFenced:o(Kt),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(Kt,i),codeText:o(pn,i),codeTextData:R,data:R,codeFlowValue:R,definition:o(Yl),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o(Ql),hardBreakEscape:o(_c),hardBreakTrailing:o(_c),htmlFlow:o(Si,i),htmlFlowData:R,htmlText:o(Si,i),htmlTextData:R,image:o(xe),label:i,link:o(et),listItem:o(uo),listItemValue:p,listOrdered:o(Zt,d),listUnordered:o(Zt),paragraph:o(co),reference:w,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(kc),strong:o(cm),thematicBreak:o(bz)},exit:{atxHeading:s(),atxHeadingSequence:L,autolink:s(),autolinkEmail:$t,autolinkProtocol:ut,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:La,characterReferenceMarkerNumeric:La,characterReferenceValue:fn,characterReference:_r,codeFenced:s(b),codeFencedFence:x,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:k,codeIndented:s(v),codeText:s(F),codeTextData:k,data:k,definition:s(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:g,emphasis:s(),hardBreakEscape:s(q),hardBreakTrailing:s(q),htmlFlow:s(V),htmlFlowData:k,htmlText:s(X),htmlTextData:k,image:s(fe),label:rt,labelText:at,lineEnding:Y,link:s(j),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:Ze,resourceDestinationString:I,resourceTitleString:$e,resource:da,setextHeading:s(O),setextHeadingLineSequence:T,setextHeadingText:_,strong:s(),thematicBreak:s()}};CT(t,(e||{}).mdastExtensions||[]);let a={};return n;function n(M){let B={type:"root",children:[]},ne={stack:[B],tokenStack:[],config:t,enter:l,exit:u,buffer:i,resume:c,data:a},be=[],Ue=-1;for(;++Ue<M.length;)if(M[Ue][1].type==="listOrdered"||M[Ue][1].type==="listUnordered")if(M[Ue][0]==="enter")be.push(Ue);else{let Ja=be.pop();Ue=r(M,Ja,Ue)}for(Ue=-1;++Ue<M.length;){let Ja=t[M[Ue][0]];_T.call(Ja,M[Ue][1].type)&&Ja[M[Ue][1].type].call(Object.assign({sliceSerialize:M[Ue][2].sliceSerialize},ne),M[Ue][1])}if(ne.tokenStack.length>0){let Ja=ne.tokenStack[ne.tokenStack.length-1];(Ja[1]||kT).call(ne,void 0,Ja[0])}for(B.position={start:Kn(M.length>0?M[0][1].start:{line:1,column:1,offset:0}),end:Kn(M.length>0?M[M.length-2][1].end:{line:1,column:1,offset:0})},Ue=-1;++Ue<t.transforms.length;)B=t.transforms[Ue](B)||B;return B}function r(M,B,ne){let be=B-1,Ue=-1,Ja=!1,fo,Cr,es,ts;for(;++be<=ne;){let fa=M[be];switch(fa[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{fa[0]==="enter"?Ue++:Ue--,ts=void 0;break}case"lineEndingBlank":{fa[0]==="enter"&&(fo&&!ts&&!Ue&&!es&&(es=be),ts=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ts=void 0}if(!Ue&&fa[0]==="enter"&&fa[1].type==="listItemPrefix"||Ue===-1&&fa[0]==="exit"&&(fa[1].type==="listUnordered"||fa[1].type==="listOrdered")){if(fo){let wi=be;for(Cr=void 0;wi--;){let Lr=M[wi];if(Lr[1].type==="lineEnding"||Lr[1].type==="lineEndingBlank"){if(Lr[0]==="exit")continue;Cr&&(M[Cr][1].type="lineEndingBlank",Ja=!0),Lr[1].type="lineEnding",Cr=wi}else if(!(Lr[1].type==="linePrefix"||Lr[1].type==="blockQuotePrefix"||Lr[1].type==="blockQuotePrefixWhitespace"||Lr[1].type==="blockQuoteMarker"||Lr[1].type==="listItemIndent"))break}es&&(!Cr||es<Cr)&&(fo._spread=!0),fo.end=Object.assign({},Cr?M[Cr][1].start:fa[1].end),M.splice(Cr||be,0,["exit",fo,fa[2]]),be++,ne++}if(fa[1].type==="listItemPrefix"){let wi={type:"listItem",_spread:!1,start:Object.assign({},fa[1].start),end:void 0};fo=wi,M.splice(be,0,["enter",wi,fa[2]]),be++,ne++,es=void 0,ts=!0}}}return M[B][1]._spread=Ja,ne}function o(M,B){return ne;function ne(be){l.call(this,M(be),be),B&&B.call(this,be)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(M,B,ne){this.stack[this.stack.length-1].children.push(M),this.stack.push(M),this.tokenStack.push([B,ne||void 0]),M.position={start:Kn(B.start),end:void 0}}function s(M){return B;function B(ne){M&&M.call(this,ne),u.call(this,ne)}}function u(M,B){let ne=this.stack.pop(),be=this.tokenStack.pop();if(be)be[0].type!==M.type&&(B?B.call(this,M,be[0]):(be[1]||kT).call(this,M,be[0]));else throw new Error("Cannot close `"+M.type+"` ("+Jn({start:M.start,end:M.end})+"): it\u2019s not open");ne.position.end=Kn(M.end)}function c(){return ei(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(M){if(this.data.expectingFirstListItemValue){let B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(M),10),this.data.expectingFirstListItemValue=void 0}}function f(){let M=this.resume(),B=this.stack[this.stack.length-1];B.lang=M}function m(){let M=this.resume(),B=this.stack[this.stack.length-1];B.meta=M}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){let M=this.resume(),B=this.stack[this.stack.length-1];B.value=M.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){let M=this.resume(),B=this.stack[this.stack.length-1];B.value=M.replace(/(\r?\n|\r)$/g,"")}function y(M){let B=this.resume(),ne=this.stack[this.stack.length-1];ne.label=B,ne.identifier=Ft(this.sliceSerialize(M)).toLowerCase()}function g(){let M=this.resume(),B=this.stack[this.stack.length-1];B.title=M}function S(){let M=this.resume(),B=this.stack[this.stack.length-1];B.url=M}function L(M){let B=this.stack[this.stack.length-1];if(!B.depth){let ne=this.sliceSerialize(M).length;B.depth=ne}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function T(M){let B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(M).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function R(M){let ne=this.stack[this.stack.length-1].children,be=ne[ne.length-1];(!be||be.type!=="text")&&(be=xz(),be.position={start:Kn(M.start),end:void 0},ne.push(be)),this.stack.push(be)}function k(M){let B=this.stack.pop();B.value+=this.sliceSerialize(M),B.position.end=Kn(M.end)}function Y(M){let B=this.stack[this.stack.length-1];if(this.data.atHardBreak){let ne=B.children[B.children.length-1];ne.position.end=Kn(M.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(B.type)&&(R.call(this,M),k.call(this,M))}function q(){this.data.atHardBreak=!0}function V(){let M=this.resume(),B=this.stack[this.stack.length-1];B.value=M}function X(){let M=this.resume(),B=this.stack[this.stack.length-1];B.value=M}function F(){let M=this.resume(),B=this.stack[this.stack.length-1];B.value=M}function j(){let M=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=B,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function fe(){let M=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=B,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function at(M){let B=this.sliceSerialize(M),ne=this.stack[this.stack.length-2];ne.label=IT(B),ne.identifier=Ft(B).toLowerCase()}function rt(){let M=this.stack[this.stack.length-1],B=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){let be=M.children;ne.children=be}else ne.alt=B}function I(){let M=this.resume(),B=this.stack[this.stack.length-1];B.url=M}function $e(){let M=this.resume(),B=this.stack[this.stack.length-1];B.title=M}function da(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function Ze(M){let B=this.resume(),ne=this.stack[this.stack.length-1];ne.label=B,ne.identifier=Ft(this.sliceSerialize(M)).toLowerCase(),this.data.referenceType="full"}function La(M){this.data.characterReferenceType=M.type}function fn(M){let B=this.sliceSerialize(M),ne=this.data.characterReferenceType,be;ne?(be=_f(B,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=kl(B);let Ue=this.stack[this.stack.length-1];Ue.value+=be}function _r(M){let B=this.stack.pop();B.position.end=Kn(M.end)}function ut(M){k.call(this,M);let B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(M)}function $t(M){k.call(this,M);let B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(M)}function At(){return{type:"blockquote",children:[]}}function Kt(){return{type:"code",lang:null,meta:null,value:""}}function pn(){return{type:"inlineCode",value:""}}function Yl(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ql(){return{type:"emphasis",children:[]}}function kc(){return{type:"heading",depth:0,children:[]}}function _c(){return{type:"break"}}function Si(){return{type:"html",value:""}}function xe(){return{type:"image",title:null,url:"",alt:null}}function et(){return{type:"link",title:null,url:"",children:[]}}function Zt(M){return{type:"list",ordered:M.type==="listOrdered",start:null,spread:M._spread,children:[]}}function uo(M){return{type:"listItem",spread:M._spread,checked:null,children:[]}}function co(){return{type:"paragraph",children:[]}}function cm(){return{type:"strong",children:[]}}function xz(){return{type:"text",value:""}}function bz(){return{type:"thematicBreak"}}}function Kn(e){return{line:e.line,column:e.column,offset:e.offset}}function CT(e,t){let a=-1;for(;++a<t.length;){let n=t[a];Array.isArray(n)?CT(e,n):b4(e,n)}}function b4(e,t){let a;for(a in t)if(_T.call(t,a))switch(a){case"canContainEols":{let n=t[a];n&&e[a].push(...n);break}case"transforms":{let n=t[a];n&&e[a].push(...n);break}case"enter":case"exit":{let n=t[a];n&&Object.assign(e[a],n);break}}}function kT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Jn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Jn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Jn({start:t.start,end:t.end})+") is still open")}function $f(e){let t=this;t.parser=a;function a(n){return Nv(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function LT(e,t){let a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function TT(e,t){let a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
19
19
  `}]}function AT(e,t){let a=t.value?t.value+`
@@ -89,7 +89,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
89
89
 
90
90
  &nbsp;
91
91
 
92
- `)})}var V9=ke.default.memo(H9);function G9({message:e,widgets:t,tagExpansionState:a,onTagToggle:n,feedbackEnabled:r,showFeedback:o,existingRating:i,existingComment:l,feedbackSubmitting:s,requireCommentForNegative:u,onFeedbackSubmit:c}){let d=(f,m)=>{if(f==null)return null;if(typeof f=="string")return(0,ue.jsx)("div",{className:"chat-widget__markdown",children:(0,ue.jsx)(V9,{children:f})},m);if("type"in f&&f.type==="tool-call")return(0,ue.jsx)(vz,{toolCall:f},m);if("widgetType"in f){let x=t?.find(v=>v.widgetType===f.widgetType);if(!x)return(0,ue.jsxs)("span",{children:["[Unknown widget: ",f.widgetType,"]"]},m);let b=f;return(0,ue.jsx)("div",{className:"chat-widget__widget",children:x.render({payload:b.payload,enrichedResult:b.enrichedResult})},m)}return null},p=(f,m)=>{if(f.type==="content")return(0,ue.jsx)("div",{className:or(Ee.messageRow,e.role==="user"?Ee.userMessageRow:Ee.assistantMessageRow),children:(0,ue.jsx)("div",{className:or(Ee.messageBubble,e.role==="user"?Ee.userMessage:Ee.assistantMessage),children:d(f.item,`${e.id}-section-${m}`)})},`${e.id}-section-${m}`);if(f.type==="tag-group"){let{group:x}=f,b=`${e.id}-tag-${x.tagId}`,v=a.get(b)??!0;return(0,ue.jsx)(hz,{tagId:x.tagId,isExpanded:v,onToggle:()=>n(e.id,x.tagId,v),children:x.content.map((y,g)=>{let S=typeof y=="string",L=!S&&"widgetType"in y;return(0,ue.jsx)("div",{className:or("tag-group-item",S&&"tag-group-item--text",L&&"tag-group-item--widget"),children:d(y,`${b}-item-${g}`)},`${b}-item-${g}`)})},b)}return null};return(0,ue.jsxs)("div",{className:Ee.messageWrapper,children:[e.sections.map((f,m)=>p(f,m)),e.role==="assistant"&&e.thoughts&&e.thoughts.length>0&&(0,ue.jsx)("div",{className:Ee.thoughtsContainer,children:(0,ue.jsxs)("details",{className:"chat-widget__details",children:[(0,ue.jsxs)("summary",{className:Ee.thoughtsSummary,children:[(0,ue.jsx)("span",{className:Ee.thoughtsIconContainer,children:(0,ue.jsx)(Xo,{className:Ee.thoughtsIcon})}),(0,ue.jsx)("span",{children:"Thoughts"})]}),(0,ue.jsx)("div",{className:Ee.thoughtsContent,children:(0,ue.jsx)("pre",{className:Ee.thoughtsText,children:e.thoughts.map((f,m)=>d(f,`${e.id}-thought-${m}`))})})]})}),r&&e.role==="assistant"&&e.id!=="welcome-message"&&o&&(0,ue.jsx)(cz,{messageId:e.id,existingRating:i,existingComment:l,isSubmitting:s,requireCommentForNegative:u,onSubmit:c})]})}var J9=ke.default.memo(G9),Ee={container:"chat-widget",header:"chat-widget__header",headerTitle:"chat-widget__title",messagesContainer:"chat-widget__messages",messageWrapper:"chat-widget__message",messageRow:"chat-widget__message-row",userMessageRow:"chat-widget__message-row--user",assistantMessageRow:"chat-widget__message-row--assistant",messageBubble:"chat-widget__bubble",userMessage:"chat-widget__bubble--user",assistantMessage:"chat-widget__bubble--assistant",thoughtsContainer:"chat-widget__thoughts",thoughtsSummary:"chat-widget__thoughts-summary",thoughtsIconContainer:"chat-widget__thoughts-icon-container",thoughtsIcon:"chat-widget__thoughts-icon",thoughtsContent:"chat-widget__thoughts-content",thoughtsText:"chat-widget__thoughts-text",loadingContainer:"chat-widget__loading",loadingBubble:"chat-widget__loading-bubble",loadingDots:"chat-widget__loading-dots",loadingDot:"chat-widget__loading-dot",inputContainer:"chat-widget__input",inputForm:"chat-widget__form",textarea:"chat-widget__textarea",toolbar:"chat-widget__toolbar",submitButton:"chat-widget__submit",sendIcon:"chat-widget__send-icon",voiceControl:"chat-widget__voice",micButton:"chat-widget__mic-button"},X9={primaryColor:"#3b82f6",primaryTextColor:"#ffffff",backgroundColor:"#ffffff",borderColor:"#e5e7eb",headerTextColor:"#ffffff",userBubbleTextColor:"#ffffff",assistantBubbleBackground:"transparent",assistantBubbleTextColor:"#111827",fontFamily:"'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif",borderRadius:"0.75rem",inputBackground:"#ffffff",inputTextColor:"#111827",inputPlaceholderColor:"#6b7280",thoughtsBorderColor:"#d1d5db"},W9=(e,t=.15)=>{let a=e.replace("#","");if(!/^[0-9a-fA-F]{6}$/.test(a))return e;let n=parseInt(a.slice(0,2),16),r=parseInt(a.slice(2,4),16),o=parseInt(a.slice(4,6),16),i=l=>Math.round(l*(1-t));return`#${i(n).toString(16).padStart(2,"0")}${i(r).toString(16).padStart(2,"0")}${i(o).toString(16).padStart(2,"0")}`};function Kl({api:e,threadId:t,agentId:a,agentExecutionId:n,dataContext:r,onError:o,onAuthError:i,onFinish:l,onMessage:s,title:u,introMessage:c,inputPlaceholder:d,className:p,styles:f,voice:m,speechToText:x,widgets:b,feedback:v}){let y=(0,ke.useMemo)(()=>({...X9,...f||{}}),[f]),g=(0,ke.useMemo)(()=>({"--chat-primary":y.primaryColor,"--chat-primary-text":y.primaryTextColor,"--chat-primary-hover":W9(y.primaryColor,.2),"--chat-background":y.backgroundColor,"--chat-border":y.borderColor,"--chat-header-text":y.headerTextColor,"--chat-user-text":y.userBubbleTextColor,"--chat-assistant-bg":y.assistantBubbleBackground,"--chat-assistant-text":y.assistantBubbleTextColor,"--chat-font-family":y.fontFamily,"--chat-radius":y.borderRadius,"--chat-input-bg":y.inputBackground,"--chat-input-text":y.inputTextColor,"--chat-input-placeholder":y.inputPlaceholderColor,"--chat-thought-border":y.thoughtsBorderColor}),[y]),[S,L]=(0,ke.useState)(""),[_,T]=(0,ke.useState)(!1),[O,R]=(0,ke.useState)(!1),k=(0,ke.useRef)(null),Y=(0,ke.useRef)(null),q=(0,ke.useRef)(!0),V=(0,ke.useRef)(null),X=(0,ke.useRef)(!1),{messages:F,status:j,sendMessage:fe,stop:at,setMessages:rt}=QO({api:e,threadId:t,agentId:a??void 0,agentExecutionId:n??void 0,dataContext:r,onError:o,onAuthError:i,onFinish:l,onMessage:s}),I=v?.enabled!==!1,{submitFeedback:$e,getFeedbackForMessage:da,isSubmitting:w}=ez({api:e,threadId:t,agentId:a??void 0,agentExecutionId:n??void 0}),Ze=(0,ke.useCallback)((xe,et,Zt)=>{$e({messageId:xe,rating:et,improvementText:Zt})},[$e]),[La,fn]=(0,ke.useState)(new Map),_r=(0,ke.useCallback)((xe,et,Zt)=>{X.current=!0,fn(uo=>{let co=new Map(uo),cm=`${xe}-tag-${et}`;return co.set(cm,!Zt),co})},[]),ut=(0,ke.useMemo)(()=>{if(!m||m.enabled===!1||!m.url)return null;let xe=m.payload,et=Zt=>xe?typeof xe=="function"?xe(Zt):{message:Zt,...xe}:{message:Zt};return{url:m.url,method:m.method??"POST",autoplayLatest:m.autoplayLatest??!0,headers:{...m.headers??{}},buildPayload:et}},[m]);(0,ke.useEffect)(()=>{c&&F.length===0&&rt([{id:"welcome-message",role:"assistant",parts:[{type:"text",text:c}]}])},[c,F.length,rt]);let $t=(0,ke.useCallback)(()=>{if(!Y.current)return;let{scrollTop:xe,scrollHeight:et,clientHeight:Zt}=Y.current,uo=et-xe-Zt;q.current=uo<100},[]);(0,ke.useEffect)(()=>{if(X.current){X.current=!1;return}let et=F[F.length-1]?.role==="user";(q.current||et)&&k.current?.scrollIntoView({behavior:"smooth"})},[F,j]),(0,ke.useEffect)(()=>{let xe=setTimeout(()=>{V.current?.focus()},150);return()=>clearTimeout(xe)},[]),(0,ke.useEffect)(()=>{j==="ready"&&V.current?.focus(),j!=="streaming"&&R(!1)},[j]);let At=(0,ke.useCallback)(xe=>{let et=(xe??S).trim();return!et||j!=="ready"?!1:(fe({text:et}),L(""),!0)},[S,j,fe,L]),Kt=()=>{At()},pn=xe=>{xe.preventDefault(),Kt()},Yl=xe=>{xe.key==="Enter"&&!xe.shiftKey&&(xe.preventDefault(),Kt())},Ql=x?.enabled!==!1,kc=(0,ke.useCallback)(xe=>{L(xe)},[L]),_c=(0,ke.useCallback)(xe=>{let et=xe?.trim();if(!et||O)return;L(et),At(et)&&R(!0)},[At,L,O]);(0,ke.useEffect)(()=>{Ql||T(!1)},[Ql]);let Si=(0,ke.useRef)({threadId:"",widgets:null});return(0,ke.useEffect)(()=>{!b||b.length===0||Si.current.threadId===t&&Si.current.widgets===b||pf({api:e,threadId:t,widgets:b}).then(()=>{Si.current={threadId:t,widgets:b}}).catch(et=>{console.error("Failed to register chat widgets",et)})},[e,t,b]),(0,ue.jsxs)("div",{className:or(Ee.container,p),style:g,"data-chat-widget":"",children:[u&&(0,ue.jsx)("div",{className:Ee.header,children:(0,ue.jsx)("h3",{className:Ee.headerTitle,children:u})}),(0,ue.jsxs)("div",{className:Ee.messagesContainer,ref:Y,onScroll:$t,children:[F.map((xe,et)=>{let Zt=et===F.length-1,uo=!(j==="streaming"&&Zt),co=da(xe.id);return(0,ue.jsx)(J9,{message:xe,widgets:b,tagExpansionState:La,onTagToggle:_r,feedbackEnabled:I,showFeedback:uo,existingRating:co?.rating,existingComment:co?.comment,feedbackSubmitting:w===xe.id,requireCommentForNegative:v?.requireCommentForNegative,onFeedbackSubmit:Ze},xe.id)}),j==="streaming"&&(0,ue.jsx)("div",{className:Ee.loadingContainer,children:(0,ue.jsx)("div",{className:Ee.loadingBubble,children:(0,ue.jsxs)("div",{className:Ee.loadingDots,children:[(0,ue.jsx)("div",{className:Ee.loadingDot}),(0,ue.jsx)("div",{className:Ee.loadingDot,"data-delay":"1"}),(0,ue.jsx)("div",{className:Ee.loadingDot,"data-delay":"2"})]})})}),(0,ue.jsx)("div",{ref:k})]}),(0,ue.jsx)("div",{className:Ee.inputContainer,children:(0,ue.jsxs)("form",{onSubmit:pn,className:Ee.inputForm,children:[(0,ue.jsx)("textarea",{ref:V,value:S,onChange:xe=>L(xe.target.value),onKeyDown:Yl,placeholder:d,disabled:j!=="ready",rows:1,className:Ee.textarea}),(0,ue.jsx)("div",{className:Ee.toolbar,children:Ql&&(0,ue.jsx)(mz,{className:Ee.micButton,disabled:j!=="ready",silenceTimeout:x?.silenceTimeout,language:x?.language,finalDelay:x?.finalDelay,onInterim:kc,onFinal:_c,onError:x?.onError,onListeningChange:T})}),(0,ue.jsx)("button",{type:"button",onClick:j==="streaming"?at:Kt,disabled:j==="streaming"?!1:!S.trim()||j!=="ready",className:Ee.submitButton,children:j==="streaming"?(0,ue.jsx)(Vn,{className:Ee.sendIcon}):(0,ue.jsx)(cu,{className:Ee.sendIcon})})]})})]})}Xa(`.chat-popup__anchor{position:fixed;inset-block-end:20px;inset-inline-end:20px}.chat-popup--start{inset-inline-end:auto;inset-inline-start:20px}.chat-popup__anchor-button{display:inline-flex;align-items:center;gap:.5rem;padding:.65rem .85rem;background:var(--chat-primary);color:var(--chat-primary-text);border:none;border-radius:999px;box-shadow:0 10px 25px #0f172a33;cursor:pointer;font-weight:600;z-index:99999}.chat-popup__anchor-button:hover{background:var(--chat-primary-hover)}.chat-popup__anchor-icon{width:1.1rem;height:1.1rem}.chat-popup__panel{position:fixed;inset-block-end:20px;inset-inline-end:20px;z-index:99998;transition:opacity .15s ease,visibility .15s ease}.chat-popup--start.chat-popup__panel{inset-inline-end:auto;inset-inline-start:20px}.chat-popup__panel--open{opacity:1;visibility:visible;pointer-events:auto}.chat-popup__panel--closed{opacity:0;visibility:hidden;pointer-events:none}.chat-popup__panel-inner{width:384px;max-width:calc(100vw - 40px);height:500px;max-height:calc(100vh - 140px);box-shadow:0 20px 45px #0f172a1f;border-radius:12px;overflow:visible;background:var(--chat-background);border:1px solid var(--chat-border);position:relative}.chat-popup__close{position:absolute;top:0;z-index:10;transform:translate(30%,-40%)}.chat-popup__close--end{inset-inline-end:0}.chat-popup__close--start{inset-inline-start:0}.chat-popup__close-button{border:none;background:var(--chat-primary);color:var(--chat-primary-text);width:32px;height:32px;border-radius:999px;cursor:pointer;display:grid;place-items:center;box-shadow:0 10px 25px #0f172a33}.chat-popup__close-button:hover{background:var(--chat-primary-hover)}.chat-popup__close-icon{width:16px;height:16px}
92
+ `)})}var V9=ke.default.memo(H9);function G9({message:e,widgets:t,tagExpansionState:a,onTagToggle:n,feedbackEnabled:r,showFeedback:o,existingRating:i,existingComment:l,feedbackSubmitting:s,requireCommentForNegative:u,onFeedbackSubmit:c}){let d=(f,m)=>{if(f==null)return null;if(typeof f=="string")return(0,ue.jsx)("div",{className:"chat-widget__markdown",children:(0,ue.jsx)(V9,{children:f})},m);if("type"in f&&f.type==="tool-call")return(0,ue.jsx)(vz,{toolCall:f},m);if("widgetType"in f){let x=t?.find(v=>v.widgetType===f.widgetType);if(!x)return(0,ue.jsxs)("span",{children:["[Unknown widget: ",f.widgetType,"]"]},m);let b=f;return(0,ue.jsx)("div",{className:"chat-widget__widget",children:x.render(b.payload,b.enriched??{})},m)}return null},p=(f,m)=>{if(f.type==="content")return(0,ue.jsx)("div",{className:or(Ee.messageRow,e.role==="user"?Ee.userMessageRow:Ee.assistantMessageRow),children:(0,ue.jsx)("div",{className:or(Ee.messageBubble,e.role==="user"?Ee.userMessage:Ee.assistantMessage),children:d(f.item,`${e.id}-section-${m}`)})},`${e.id}-section-${m}`);if(f.type==="tag-group"){let{group:x}=f,b=`${e.id}-tag-${x.tagId}`,v=a.get(b)??!0;return(0,ue.jsx)(hz,{tagId:x.tagId,isExpanded:v,onToggle:()=>n(e.id,x.tagId,v),children:x.content.map((y,g)=>{let S=typeof y=="string",L=!S&&"widgetType"in y;return(0,ue.jsx)("div",{className:or("tag-group-item",S&&"tag-group-item--text",L&&"tag-group-item--widget"),children:d(y,`${b}-item-${g}`)},`${b}-item-${g}`)})},b)}return null};return(0,ue.jsxs)("div",{className:Ee.messageWrapper,children:[e.sections.map((f,m)=>p(f,m)),e.role==="assistant"&&e.thoughts&&e.thoughts.length>0&&(0,ue.jsx)("div",{className:Ee.thoughtsContainer,children:(0,ue.jsxs)("details",{className:"chat-widget__details",children:[(0,ue.jsxs)("summary",{className:Ee.thoughtsSummary,children:[(0,ue.jsx)("span",{className:Ee.thoughtsIconContainer,children:(0,ue.jsx)(Xo,{className:Ee.thoughtsIcon})}),(0,ue.jsx)("span",{children:"Thoughts"})]}),(0,ue.jsx)("div",{className:Ee.thoughtsContent,children:(0,ue.jsx)("pre",{className:Ee.thoughtsText,children:e.thoughts.map((f,m)=>d(f,`${e.id}-thought-${m}`))})})]})}),r&&e.role==="assistant"&&e.id!=="welcome-message"&&o&&(0,ue.jsx)(cz,{messageId:e.id,existingRating:i,existingComment:l,isSubmitting:s,requireCommentForNegative:u,onSubmit:c})]})}var J9=ke.default.memo(G9),Ee={container:"chat-widget",header:"chat-widget__header",headerTitle:"chat-widget__title",messagesContainer:"chat-widget__messages",messageWrapper:"chat-widget__message",messageRow:"chat-widget__message-row",userMessageRow:"chat-widget__message-row--user",assistantMessageRow:"chat-widget__message-row--assistant",messageBubble:"chat-widget__bubble",userMessage:"chat-widget__bubble--user",assistantMessage:"chat-widget__bubble--assistant",thoughtsContainer:"chat-widget__thoughts",thoughtsSummary:"chat-widget__thoughts-summary",thoughtsIconContainer:"chat-widget__thoughts-icon-container",thoughtsIcon:"chat-widget__thoughts-icon",thoughtsContent:"chat-widget__thoughts-content",thoughtsText:"chat-widget__thoughts-text",loadingContainer:"chat-widget__loading",loadingBubble:"chat-widget__loading-bubble",loadingDots:"chat-widget__loading-dots",loadingDot:"chat-widget__loading-dot",inputContainer:"chat-widget__input",inputForm:"chat-widget__form",textarea:"chat-widget__textarea",toolbar:"chat-widget__toolbar",submitButton:"chat-widget__submit",sendIcon:"chat-widget__send-icon",voiceControl:"chat-widget__voice",micButton:"chat-widget__mic-button"},X9={primaryColor:"#3b82f6",primaryTextColor:"#ffffff",backgroundColor:"#ffffff",borderColor:"#e5e7eb",headerTextColor:"#ffffff",userBubbleTextColor:"#ffffff",assistantBubbleBackground:"transparent",assistantBubbleTextColor:"#111827",fontFamily:"'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif",borderRadius:"0.75rem",inputBackground:"#ffffff",inputTextColor:"#111827",inputPlaceholderColor:"#6b7280",thoughtsBorderColor:"#d1d5db"},W9=(e,t=.15)=>{let a=e.replace("#","");if(!/^[0-9a-fA-F]{6}$/.test(a))return e;let n=parseInt(a.slice(0,2),16),r=parseInt(a.slice(2,4),16),o=parseInt(a.slice(4,6),16),i=l=>Math.round(l*(1-t));return`#${i(n).toString(16).padStart(2,"0")}${i(r).toString(16).padStart(2,"0")}${i(o).toString(16).padStart(2,"0")}`};function Kl({api:e,threadId:t,agentId:a,agentExecutionId:n,dataContext:r,onError:o,onAuthError:i,onFinish:l,onMessage:s,title:u,introMessage:c,inputPlaceholder:d,className:p,styles:f,voice:m,speechToText:x,widgets:b,feedback:v}){let y=(0,ke.useMemo)(()=>({...X9,...f||{}}),[f]),g=(0,ke.useMemo)(()=>({"--chat-primary":y.primaryColor,"--chat-primary-text":y.primaryTextColor,"--chat-primary-hover":W9(y.primaryColor,.2),"--chat-background":y.backgroundColor,"--chat-border":y.borderColor,"--chat-header-text":y.headerTextColor,"--chat-user-text":y.userBubbleTextColor,"--chat-assistant-bg":y.assistantBubbleBackground,"--chat-assistant-text":y.assistantBubbleTextColor,"--chat-font-family":y.fontFamily,"--chat-radius":y.borderRadius,"--chat-input-bg":y.inputBackground,"--chat-input-text":y.inputTextColor,"--chat-input-placeholder":y.inputPlaceholderColor,"--chat-thought-border":y.thoughtsBorderColor}),[y]),[S,L]=(0,ke.useState)(""),[_,T]=(0,ke.useState)(!1),[O,R]=(0,ke.useState)(!1),k=(0,ke.useRef)(null),Y=(0,ke.useRef)(null),q=(0,ke.useRef)(!0),V=(0,ke.useRef)(null),X=(0,ke.useRef)(!1),{messages:F,status:j,sendMessage:fe,stop:at,setMessages:rt}=QO({api:e,threadId:t,agentId:a??void 0,agentExecutionId:n??void 0,dataContext:r,onError:o,onAuthError:i,onFinish:l,onMessage:s}),I=v?.enabled!==!1,{submitFeedback:$e,getFeedbackForMessage:da,isSubmitting:w}=ez({api:e,threadId:t,agentId:a??void 0,agentExecutionId:n??void 0}),Ze=(0,ke.useCallback)((xe,et,Zt)=>{$e({messageId:xe,rating:et,improvementText:Zt})},[$e]),[La,fn]=(0,ke.useState)(new Map),_r=(0,ke.useCallback)((xe,et,Zt)=>{X.current=!0,fn(uo=>{let co=new Map(uo),cm=`${xe}-tag-${et}`;return co.set(cm,!Zt),co})},[]),ut=(0,ke.useMemo)(()=>{if(!m||m.enabled===!1||!m.url)return null;let xe=m.payload,et=Zt=>xe?typeof xe=="function"?xe(Zt):{message:Zt,...xe}:{message:Zt};return{url:m.url,method:m.method??"POST",autoplayLatest:m.autoplayLatest??!0,headers:{...m.headers??{}},buildPayload:et}},[m]);(0,ke.useEffect)(()=>{c&&F.length===0&&rt([{id:"welcome-message",role:"assistant",parts:[{type:"text",text:c}]}])},[c,F.length,rt]);let $t=(0,ke.useCallback)(()=>{if(!Y.current)return;let{scrollTop:xe,scrollHeight:et,clientHeight:Zt}=Y.current,uo=et-xe-Zt;q.current=uo<100},[]);(0,ke.useEffect)(()=>{if(X.current){X.current=!1;return}let et=F[F.length-1]?.role==="user";(q.current||et)&&k.current?.scrollIntoView({behavior:"smooth"})},[F,j]),(0,ke.useEffect)(()=>{let xe=setTimeout(()=>{V.current?.focus()},150);return()=>clearTimeout(xe)},[]),(0,ke.useEffect)(()=>{j==="ready"&&V.current?.focus(),j!=="streaming"&&R(!1)},[j]);let At=(0,ke.useCallback)(xe=>{let et=(xe??S).trim();return!et||j!=="ready"?!1:(fe({text:et}),L(""),!0)},[S,j,fe,L]),Kt=()=>{At()},pn=xe=>{xe.preventDefault(),Kt()},Yl=xe=>{xe.key==="Enter"&&!xe.shiftKey&&(xe.preventDefault(),Kt())},Ql=x?.enabled!==!1,kc=(0,ke.useCallback)(xe=>{L(xe)},[L]),_c=(0,ke.useCallback)(xe=>{let et=xe?.trim();if(!et||O)return;L(et),At(et)&&R(!0)},[At,L,O]);(0,ke.useEffect)(()=>{Ql||T(!1)},[Ql]);let Si=(0,ke.useRef)({threadId:"",widgets:null});return(0,ke.useEffect)(()=>{!b||b.length===0||Si.current.threadId===t&&Si.current.widgets===b||pf({api:e,threadId:t,widgets:b}).then(()=>{Si.current={threadId:t,widgets:b}}).catch(et=>{console.error("Failed to register chat widgets",et)})},[e,t,b]),(0,ue.jsxs)("div",{className:or(Ee.container,p),style:g,"data-chat-widget":"",children:[u&&(0,ue.jsx)("div",{className:Ee.header,children:(0,ue.jsx)("h3",{className:Ee.headerTitle,children:u})}),(0,ue.jsxs)("div",{className:Ee.messagesContainer,ref:Y,onScroll:$t,children:[F.map((xe,et)=>{let Zt=et===F.length-1,uo=!(j==="streaming"&&Zt),co=da(xe.id);return(0,ue.jsx)(J9,{message:xe,widgets:b,tagExpansionState:La,onTagToggle:_r,feedbackEnabled:I,showFeedback:uo,existingRating:co?.rating,existingComment:co?.comment,feedbackSubmitting:w===xe.id,requireCommentForNegative:v?.requireCommentForNegative,onFeedbackSubmit:Ze},xe.id)}),j==="streaming"&&(0,ue.jsx)("div",{className:Ee.loadingContainer,children:(0,ue.jsx)("div",{className:Ee.loadingBubble,children:(0,ue.jsxs)("div",{className:Ee.loadingDots,children:[(0,ue.jsx)("div",{className:Ee.loadingDot}),(0,ue.jsx)("div",{className:Ee.loadingDot,"data-delay":"1"}),(0,ue.jsx)("div",{className:Ee.loadingDot,"data-delay":"2"})]})})}),(0,ue.jsx)("div",{ref:k})]}),(0,ue.jsx)("div",{className:Ee.inputContainer,children:(0,ue.jsxs)("form",{onSubmit:pn,className:Ee.inputForm,children:[(0,ue.jsx)("textarea",{ref:V,value:S,onChange:xe=>L(xe.target.value),onKeyDown:Yl,placeholder:d,disabled:j!=="ready",rows:1,className:Ee.textarea}),(0,ue.jsx)("div",{className:Ee.toolbar,children:Ql&&(0,ue.jsx)(mz,{className:Ee.micButton,disabled:j!=="ready",silenceTimeout:x?.silenceTimeout,language:x?.language,finalDelay:x?.finalDelay,onInterim:kc,onFinal:_c,onError:x?.onError,onListeningChange:T})}),(0,ue.jsx)("button",{type:"button",onClick:j==="streaming"?at:Kt,disabled:j==="streaming"?!1:!S.trim()||j!=="ready",className:Ee.submitButton,children:j==="streaming"?(0,ue.jsx)(Vn,{className:Ee.sendIcon}):(0,ue.jsx)(cu,{className:Ee.sendIcon})})]})})]})}Xa(`.chat-popup__anchor{position:fixed;inset-block-end:20px;inset-inline-end:20px}.chat-popup--start{inset-inline-end:auto;inset-inline-start:20px}.chat-popup__anchor-button{display:inline-flex;align-items:center;gap:.5rem;padding:.65rem .85rem;background:var(--chat-primary);color:var(--chat-primary-text);border:none;border-radius:999px;box-shadow:0 10px 25px #0f172a33;cursor:pointer;font-weight:600;z-index:99999}.chat-popup__anchor-button:hover{background:var(--chat-primary-hover)}.chat-popup__anchor-icon{width:1.1rem;height:1.1rem}.chat-popup__panel{position:fixed;inset-block-end:20px;inset-inline-end:20px;z-index:99998;transition:opacity .15s ease,visibility .15s ease}.chat-popup--start.chat-popup__panel{inset-inline-end:auto;inset-inline-start:20px}.chat-popup__panel--open{opacity:1;visibility:visible;pointer-events:auto}.chat-popup__panel--closed{opacity:0;visibility:hidden;pointer-events:none}.chat-popup__panel-inner{width:384px;max-width:calc(100vw - 40px);height:500px;max-height:calc(100vh - 140px);box-shadow:0 20px 45px #0f172a1f;border-radius:12px;overflow:visible;background:var(--chat-background);border:1px solid var(--chat-border);position:relative}.chat-popup__close{position:absolute;top:0;z-index:10;transform:translate(30%,-40%)}.chat-popup__close--end{inset-inline-end:0}.chat-popup__close--start{inset-inline-start:0}.chat-popup__close-button{border:none;background:var(--chat-primary);color:var(--chat-primary-text);width:32px;height:32px;border-radius:999px;cursor:pointer;display:grid;place-items:center;box-shadow:0 10px 25px #0f172a33}.chat-popup__close-button:hover{background:var(--chat-primary-hover)}.chat-popup__close-icon{width:16px;height:16px}
93
93
  `);var so=_e(Ut(),1);var Ca=_e(Bt(),1);function sm({anchor:e,...t}){let[a,n]=(0,so.useState)(e?.initiallyOpen??!1),[r,o]=(0,so.useState)(e?.initiallyOpen??!1),i=t.openOverride??a;(0,so.useEffect)(()=>{t.openOverride!==void 0&&(n(t.openOverride),t.openOverride&&o(!0))},[t.openOverride]);let l=()=>{let f=!i;f&&o(!0),t.onToggleOpen?t.onToggleOpen(f):n(f)},s=e?.position==="bottom-start"?"chat-popup--start":"chat-popup--end",u=e?.closeButton??t.closeButton,c=u?.show!==!1,d=(0,so.useMemo)(()=>{let f=t.styles?.primaryColor??"#3b82f6",m=t.styles?.primaryTextColor??"#ffffff",x=t.styles?.backgroundColor??"#ffffff",b=t.styles?.borderColor??"#e5e7eb",v=t.styles?.headerTextColor??"#ffffff";return{"--chat-primary":f,"--chat-primary-hover":((g,S=.15)=>{let L=g.replace("#","");if(!/^[0-9a-fA-F]{6}$/.test(L))return g;let _=parseInt(L.slice(0,2),16),T=parseInt(L.slice(2,4),16),O=parseInt(L.slice(4,6),16),R=k=>Math.round(k*(1-S));return`#${R(_).toString(16).padStart(2,"0")}${R(T).toString(16).padStart(2,"0")}${R(O).toString(16).padStart(2,"0")}`})(f,.2),"--chat-primary-text":m,"--chat-background":x,"--chat-border":b,"--chat-header-text":v}},[t.styles]),p=(0,so.useMemo)(()=>{let f=t.popupSize??{};return{width:f.width??"600px",height:f.height??"500px",maxWidth:f.maxWidth??"calc(100vw - 40px)",maxHeight:f.maxHeight??"calc(100vh - 140px)"}},[t.popupSize]);return(0,Ca.jsxs)("div",{style:d,children:[(0,Ca.jsx)("div",{className:or("chat-popup__anchor",s),children:e?.render?e.render({isOpen:i,toggle:l}):!i&&(0,Ca.jsxs)("button",{type:"button",className:"chat-popup__anchor-button",onClick:l,"aria-expanded":a,"aria-label":e?.label??"Open chat",children:[(0,Ca.jsx)(Wo,{className:"chat-popup__anchor-icon"}),(0,Ca.jsx)("span",{children:e?.label??"Chat"})]})}),(0,Ca.jsx)("div",{className:or("chat-popup__panel",s,i?"chat-popup__panel--open":"chat-popup__panel--closed"),children:(0,Ca.jsxs)("div",{className:"chat-popup__panel-inner",style:p,children:[c&&(0,Ca.jsx)("div",{className:or("chat-popup__close",u?.position==="top-start"?"chat-popup__close--start":"chat-popup__close--end"),children:u?.render?u.render({toggle:l}):(0,Ca.jsx)("button",{type:"button",className:"chat-popup__close-button",onClick:l,"aria-label":"Close chat",children:(0,Ca.jsx)(pu,{className:"chat-popup__close-icon"})})}),r&&(0,Ca.jsx)(Kl,{...t})]})})]})}var um=_e(Bt(),1),jw=class{constructor(t){this.container=null;this.root=null;this.config=t}async init(){if(await this.registerWidgetsIfNeeded(),this.container&&this.config.containerId&&this.container.id!==this.config.containerId&&this.destroy(),this.root&&this.container)return;if(this.config.containerId){if(this.container=document.getElementById(this.config.containerId),!this.container){console.error(`Container with id "${this.config.containerId}" not found`);return}}else this.config.anchor?.enabled?(this.container=document.createElement("div"),document.body.appendChild(this.container)):(this.container=document.createElement("div"),this.container.id="chat-widget-container",this.container.style.cssText=`
94
94
  position: fixed;
95
95
  bottom: 20px;