@agentica/chat 0.38.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1580,16 +1580,16 @@ You have been provided with \`IValidation.IError[][]\` containing **previous his
1580
1580
  - Redesign the entire AST structure using proper architectural patterns
1581
1581
  - Enhance with comprehensive business context and realistic data
1582
1582
 
1583
- **Success means: the error path never appears in future correction cycles.**`};var dBn={};const pBn=new EOe(()=>{var o;return cOe()?((o=dBn.LANG)==null?void 0:o.split(".")[0])??"en-US":navigator.language}),gBn=new EOe(()=>Intl.DateTimeFormat().resolvedOptions().timeZone);function bBn(o){var y;if(((y=o==null?void 0:o.systemPrompt)==null?void 0:y.common)!==void 0)return o.systemPrompt.common(o);const s=(o==null?void 0:o.locale)??pBn.get(),d=(o==null?void 0:o.timezone)??gBn.get();return k6.COMMON.replace("${locale}",s).replace("${timezone}",d).replace("${datetime}",new Date().toISOString())}const JF={write:bBn};function mBn(o){return typeof o.initialize=="function"}function TOe(o){const s=async(d,y,S=0)=>{try{return await d(y)}catch(N){if(S>=o-1)throw N;return s(d,N,S+1)}};return s}class zQ extends Error{constructor(){super();const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s}}class Tmt extends zQ{constructor(s){super(),this.reasoning=s}}var hFt;(o=>{function s(d){return new TextDecoder().decode(d)}o.toUtf8=s})(hFt||(hFt={}));function kOe(o,s){return{accepted_prediction_tokens:(o.accepted_prediction_tokens??0)+(s.accepted_prediction_tokens??0),reasoning_tokens:(o.reasoning_tokens??0)+(s.reasoning_tokens??0),rejected_prediction_tokens:(o.rejected_prediction_tokens??0)+(s.rejected_prediction_tokens??0)}}function COe(o,s){return{audio_tokens:(o.audio_tokens??0)+(s.audio_tokens??0),cached_tokens:(o.cached_tokens??0)+(s.cached_tokens??0)}}function yBn(o,s){return{prompt_tokens:(o.prompt_tokens??0)+(s.prompt_tokens??0),completion_tokens:(o.completion_tokens??0)+(s.completion_tokens??0),total_tokens:(o.total_tokens??0)+(s.total_tokens??0),completion_tokens_details:kOe(o.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0},s.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0}),prompt_tokens_details:COe(o.prompt_tokens_details??{audio_tokens:0,cached_tokens:0},s.prompt_tokens_details??{audio_tokens:0,cached_tokens:0})}}const wBn={sum:yBn,sumCompletionTokenDetail:kOe,sumPromptTokenDetail:COe};var $bt={},SOe={},l$t={};Object.defineProperty(l$t,"__esModule",{value:!0});l$t.addMissingBraces=vBn;function vBn(o){const s={s:"OUT",stack:[],line:1,col:0,edits:[]},d=Array.from(o).reduce((S,N,B)=>{var H;const et=N===`
1584
- `?Object.assign(Object.assign({},S),{line:S.line+1,col:0}):Object.assign(Object.assign({},S),{col:S.col+1}),W=EBn(N),nt=(H=TBn[et.s])===null||H===void 0?void 0:H[W];return nt?nt(et,N,B):et},s);if(d.s!=="OUT")return o;const y=d.stack.length===0?d:(()=>{const S=d.stack.slice().reverse().map(N=>AOe[N.type]).join("");return Object.assign(Object.assign({},d),{edits:[...d.edits,{op:"insert",index:o.length,text:S}],stack:[]})})();return _Bn(o,y.edits)}function _Bn(o,s){const y=[...s].sort((S,N)=>S.index-N.index).reduce((S,N)=>{const B=o.slice(S.cursor,N.index),H={out:S.out+B,cursor:N.index};return N.op==="delete"?{out:H.out,cursor:H.cursor+1}:N.op==="replace"?{out:H.out+N.text,cursor:H.cursor+1}:{out:H.out+N.text,cursor:H.cursor}},{out:"",cursor:0});return y.out+o.slice(y.cursor)}const xBn=Object.freeze({"}":"{","]":"["}),AOe=Object.freeze({"{":"}","[":"]"}),EBn=o=>{switch(o){case'"':return"DQUOTE";case"\\":return"BSLASH";case"{":return"OCB";case"[":return"OSB";case"}":return"CCB";case"]":return"CSB";case`
1585
- `:return"NEWLINE";default:return"CHAR"}},c9e=(o,s,d)=>Object.assign(Object.assign({},o),{stack:[...o.stack,{type:s,index:d}]}),u9e=(o,s)=>Object.assign(Object.assign({},o),{edits:[...o.edits,s]}),l9e=(o,s,d)=>(()=>{if(o.stack.length===0)return u9e(o,{op:"delete",index:d});const y=o.stack[o.stack.length-1];if(y!==void 0&&y.type!==xBn[s]){const S=AOe[y.type];return u9e(Object.assign(Object.assign({},o),{stack:o.stack.slice(0,-1)}),{op:"replace",index:d,text:S})}return Object.assign(Object.assign({},o),{stack:o.stack.slice(0,-1)})})(),TBn={OUT:{DQUOTE:o=>Object.assign(Object.assign({},o),{s:"IN"}),OCB:(o,s,d)=>c9e(o,"{",d),OSB:(o,s,d)=>c9e(o,"[",d),CCB:(o,s,d)=>l9e(o,"}",d),CSB:(o,s,d)=>l9e(o,"]",d)},IN:{BSLASH:o=>Object.assign(Object.assign({},o),{s:"ESC"}),DQUOTE:o=>Object.assign(Object.assign({},o),{s:"OUT"})},ESC:{DQUOTE:o=>Object.assign(Object.assign({},o),{s:"IN"}),BSLASH:o=>Object.assign(Object.assign({},o),{s:"IN"}),OCB:o=>Object.assign(Object.assign({},o),{s:"IN"}),OSB:o=>Object.assign(Object.assign({},o),{s:"IN"}),CCB:o=>Object.assign(Object.assign({},o),{s:"IN"}),CSB:o=>Object.assign(Object.assign({},o),{s:"IN"}),CHAR:o=>Object.assign(Object.assign({},o),{s:"IN"}),NEWLINE:o=>Object.assign(Object.assign({},o),{s:"IN"})}};var h$t={};Object.defineProperty(h$t,"__esModule",{value:!0});h$t.removeEmptyObjectPrefix=kBn;function kBn(o){return RegExp("^{}.").test(o)===!0?o.substring(2):o}var f$t={};Object.defineProperty(f$t,"__esModule",{value:!0});f$t.removeTrailingCommas=CBn;function CBn(o){const s=Array.from(o),d=W=>W==='"',y=W=>W==="\\",S=W=>/\s/.test(W),N=W=>W==="]"||W==="}",B=(W,nt)=>nt>=W.length||W[nt]===void 0?null:S(W[nt])||W[nt]===","?B(W,nt+1):W[nt],H={out:"",inString:!1,escaping:!1,skippingTrailingCommas:!1};return s.reduce((W,nt,K,Q)=>{if(W.inString){const at=W.out+nt;return y(nt)?Object.assign(Object.assign({},W),{out:at,escaping:!W.escaping}):d(nt)&&!W.escaping?Object.assign(Object.assign({},W),{out:at,inString:!1,escaping:!1}):Object.assign(Object.assign({},W),{out:at,escaping:!1})}if(W.skippingTrailingCommas){if(nt===",")return W;if(S(nt)){const at=B(Q,K+1);return N(at)?Object.assign(Object.assign({},W),{out:W.out+nt}):W}return N(nt)?Object.assign(Object.assign({},W),{out:W.out+nt,skippingTrailingCommas:!1}):Object.assign(Object.assign({},W),{out:W.out+nt,skippingTrailingCommas:!1})}if(d(nt))return Object.assign(Object.assign({},W),{out:W.out+nt,inString:!0,escaping:!1});if(nt===","){const at=B(Q,K+1);if(N(at))return Object.assign(Object.assign({},W),{skippingTrailingCommas:!0})}return Object.assign(Object.assign({},W),{out:W.out+nt})},H).out}(function(o){var s=A1&&A1.__createBinding||(Object.create?function(y,S,N,B){B===void 0&&(B=N);var H=Object.getOwnPropertyDescriptor(S,N);(!H||("get"in H?!S.__esModule:H.writable||H.configurable))&&(H={enumerable:!0,get:function(){return S[N]}}),Object.defineProperty(y,B,H)}:function(y,S,N,B){B===void 0&&(B=N),y[B]=S[N]}),d=A1&&A1.__exportStar||function(y,S){for(var N in y)N!=="default"&&!Object.prototype.hasOwnProperty.call(S,N)&&s(S,y,N)};Object.defineProperty(o,"__esModule",{value:!0}),d(l$t,o),d(h$t,o),d(f$t,o)})(SOe);(function(o){var s=A1&&A1.__createBinding||(Object.create?function(y,S,N,B){B===void 0&&(B=N);var H=Object.getOwnPropertyDescriptor(S,N);(!H||("get"in H?!S.__esModule:H.writable||H.configurable))&&(H={enumerable:!0,get:function(){return S[N]}}),Object.defineProperty(y,B,H)}:function(y,S,N,B){B===void 0&&(B=N),y[B]=S[N]}),d=A1&&A1.__exportStar||function(y,S){for(var N in y)N!=="default"&&!Object.prototype.hasOwnProperty.call(S,N)&&s(S,y,N)};Object.defineProperty(o,"__esModule",{value:!0}),d(SOe,o)})($bt);class vF extends Error{constructor(s,d){super(`${s} at position ${d}`),this.position=d}}const IOe=32,SBn=10,OOe=9,NOe=13,ABn=160,IBn=8192,OBn=8202,NBn=8239,LBn=8287,MBn=12288;function PBn(o){return/^[0-9A-Fa-f]$/.test(o)}function qN(o){return o>="0"&&o<="9"}function RBn(o){return o>=" "}function Tbt(o){return`,:[]/{}()
1583
+ **Success means: the error path never appears in future correction cycles.**`};var dBn={};const pBn=new EOe(()=>{var o;return cOe()?((o=dBn.LANG)==null?void 0:o.split(".")[0])??"en-US":navigator.language}),gBn=new EOe(()=>Intl.DateTimeFormat().resolvedOptions().timeZone);function bBn(o){var y;if(((y=o==null?void 0:o.systemPrompt)==null?void 0:y.common)!==void 0)return o.systemPrompt.common(o);const s=(o==null?void 0:o.locale)??pBn.get(),d=(o==null?void 0:o.timezone)??gBn.get();return k6.COMMON.replace("${locale}",s).replace("${timezone}",d).replace("${datetime}",new Date().toISOString())}const JF={write:bBn};function mBn(o){return typeof o.initialize=="function"}class yBn extends Error{constructor(s){super(`Invalid JSON format. The parsing failed after ${fk.RETRY} retries.`);const d=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,d):this.__proto__=d,this.arguments=s.arguments,this.reason=s.reason}get name(){return"AgenticaJsonParseError"}toJSON(){return{name:"AgenticaJsonParseError",message:this.message,arguments:this.arguments,reason:this.reason}}}class wBn extends Error{constructor(s){super(`Invalid arguments. The validation failed after ${fk.RETRY} retries.`);const d=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,d):this.__proto__=d,this.arguments=s.arguments,this.errors=s.errors}get name(){return"AgenticaValidationError"}toJSON(){return{name:"AgenticaValidationError",message:this.message,arguments:this.arguments,errors:this.errors}}}function TOe(o){const s=async(d,y,S=0)=>{try{return await d(y)}catch(N){if(S>=o-1)throw N;return s(d,N,S+1)}};return s}class zQ extends Error{constructor(){super();const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s}}class Tmt extends zQ{constructor(s){super(),this.reasoning=s}}var hFt;(o=>{function s(d){return new TextDecoder().decode(d)}o.toUtf8=s})(hFt||(hFt={}));function kOe(o,s){return{accepted_prediction_tokens:(o.accepted_prediction_tokens??0)+(s.accepted_prediction_tokens??0),reasoning_tokens:(o.reasoning_tokens??0)+(s.reasoning_tokens??0),rejected_prediction_tokens:(o.rejected_prediction_tokens??0)+(s.rejected_prediction_tokens??0)}}function COe(o,s){return{audio_tokens:(o.audio_tokens??0)+(s.audio_tokens??0),cached_tokens:(o.cached_tokens??0)+(s.cached_tokens??0)}}function vBn(o,s){return{prompt_tokens:(o.prompt_tokens??0)+(s.prompt_tokens??0),completion_tokens:(o.completion_tokens??0)+(s.completion_tokens??0),total_tokens:(o.total_tokens??0)+(s.total_tokens??0),completion_tokens_details:kOe(o.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0},s.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0}),prompt_tokens_details:COe(o.prompt_tokens_details??{audio_tokens:0,cached_tokens:0},s.prompt_tokens_details??{audio_tokens:0,cached_tokens:0})}}const _Bn={sum:vBn,sumCompletionTokenDetail:kOe,sumPromptTokenDetail:COe};var $bt={},SOe={},l$t={};Object.defineProperty(l$t,"__esModule",{value:!0});l$t.addMissingBraces=xBn;function xBn(o){const s={s:"OUT",stack:[],line:1,col:0,edits:[]},d=Array.from(o).reduce((S,N,B)=>{var H;const et=N===`
1584
+ `?Object.assign(Object.assign({},S),{line:S.line+1,col:0}):Object.assign(Object.assign({},S),{col:S.col+1}),W=kBn(N),nt=(H=CBn[et.s])===null||H===void 0?void 0:H[W];return nt?nt(et,N,B):et},s);if(d.s!=="OUT")return o;const y=d.stack.length===0?d:(()=>{const S=d.stack.slice().reverse().map(N=>AOe[N.type]).join("");return Object.assign(Object.assign({},d),{edits:[...d.edits,{op:"insert",index:o.length,text:S}],stack:[]})})();return EBn(o,y.edits)}function EBn(o,s){const y=[...s].sort((S,N)=>S.index-N.index).reduce((S,N)=>{const B=o.slice(S.cursor,N.index),H={out:S.out+B,cursor:N.index};return N.op==="delete"?{out:H.out,cursor:H.cursor+1}:N.op==="replace"?{out:H.out+N.text,cursor:H.cursor+1}:{out:H.out+N.text,cursor:H.cursor}},{out:"",cursor:0});return y.out+o.slice(y.cursor)}const TBn=Object.freeze({"}":"{","]":"["}),AOe=Object.freeze({"{":"}","[":"]"}),kBn=o=>{switch(o){case'"':return"DQUOTE";case"\\":return"BSLASH";case"{":return"OCB";case"[":return"OSB";case"}":return"CCB";case"]":return"CSB";case`
1585
+ `:return"NEWLINE";default:return"CHAR"}},c9e=(o,s,d)=>Object.assign(Object.assign({},o),{stack:[...o.stack,{type:s,index:d}]}),u9e=(o,s)=>Object.assign(Object.assign({},o),{edits:[...o.edits,s]}),l9e=(o,s,d)=>(()=>{if(o.stack.length===0)return u9e(o,{op:"delete",index:d});const y=o.stack[o.stack.length-1];if(y!==void 0&&y.type!==TBn[s]){const S=AOe[y.type];return u9e(Object.assign(Object.assign({},o),{stack:o.stack.slice(0,-1)}),{op:"replace",index:d,text:S})}return Object.assign(Object.assign({},o),{stack:o.stack.slice(0,-1)})})(),CBn={OUT:{DQUOTE:o=>Object.assign(Object.assign({},o),{s:"IN"}),OCB:(o,s,d)=>c9e(o,"{",d),OSB:(o,s,d)=>c9e(o,"[",d),CCB:(o,s,d)=>l9e(o,"}",d),CSB:(o,s,d)=>l9e(o,"]",d)},IN:{BSLASH:o=>Object.assign(Object.assign({},o),{s:"ESC"}),DQUOTE:o=>Object.assign(Object.assign({},o),{s:"OUT"})},ESC:{DQUOTE:o=>Object.assign(Object.assign({},o),{s:"IN"}),BSLASH:o=>Object.assign(Object.assign({},o),{s:"IN"}),OCB:o=>Object.assign(Object.assign({},o),{s:"IN"}),OSB:o=>Object.assign(Object.assign({},o),{s:"IN"}),CCB:o=>Object.assign(Object.assign({},o),{s:"IN"}),CSB:o=>Object.assign(Object.assign({},o),{s:"IN"}),CHAR:o=>Object.assign(Object.assign({},o),{s:"IN"}),NEWLINE:o=>Object.assign(Object.assign({},o),{s:"IN"})}};var h$t={};Object.defineProperty(h$t,"__esModule",{value:!0});h$t.removeEmptyObjectPrefix=SBn;function SBn(o){return RegExp("^{}.").test(o)===!0?o.substring(2):o}var f$t={};Object.defineProperty(f$t,"__esModule",{value:!0});f$t.removeTrailingCommas=ABn;function ABn(o){const s=Array.from(o),d=W=>W==='"',y=W=>W==="\\",S=W=>/\s/.test(W),N=W=>W==="]"||W==="}",B=(W,nt)=>nt>=W.length||W[nt]===void 0?null:S(W[nt])||W[nt]===","?B(W,nt+1):W[nt],H={out:"",inString:!1,escaping:!1,skippingTrailingCommas:!1};return s.reduce((W,nt,K,Q)=>{if(W.inString){const at=W.out+nt;return y(nt)?Object.assign(Object.assign({},W),{out:at,escaping:!W.escaping}):d(nt)&&!W.escaping?Object.assign(Object.assign({},W),{out:at,inString:!1,escaping:!1}):Object.assign(Object.assign({},W),{out:at,escaping:!1})}if(W.skippingTrailingCommas){if(nt===",")return W;if(S(nt)){const at=B(Q,K+1);return N(at)?Object.assign(Object.assign({},W),{out:W.out+nt}):W}return N(nt)?Object.assign(Object.assign({},W),{out:W.out+nt,skippingTrailingCommas:!1}):Object.assign(Object.assign({},W),{out:W.out+nt,skippingTrailingCommas:!1})}if(d(nt))return Object.assign(Object.assign({},W),{out:W.out+nt,inString:!0,escaping:!1});if(nt===","){const at=B(Q,K+1);if(N(at))return Object.assign(Object.assign({},W),{skippingTrailingCommas:!0})}return Object.assign(Object.assign({},W),{out:W.out+nt})},H).out}(function(o){var s=A1&&A1.__createBinding||(Object.create?function(y,S,N,B){B===void 0&&(B=N);var H=Object.getOwnPropertyDescriptor(S,N);(!H||("get"in H?!S.__esModule:H.writable||H.configurable))&&(H={enumerable:!0,get:function(){return S[N]}}),Object.defineProperty(y,B,H)}:function(y,S,N,B){B===void 0&&(B=N),y[B]=S[N]}),d=A1&&A1.__exportStar||function(y,S){for(var N in y)N!=="default"&&!Object.prototype.hasOwnProperty.call(S,N)&&s(S,y,N)};Object.defineProperty(o,"__esModule",{value:!0}),d(l$t,o),d(h$t,o),d(f$t,o)})(SOe);(function(o){var s=A1&&A1.__createBinding||(Object.create?function(y,S,N,B){B===void 0&&(B=N);var H=Object.getOwnPropertyDescriptor(S,N);(!H||("get"in H?!S.__esModule:H.writable||H.configurable))&&(H={enumerable:!0,get:function(){return S[N]}}),Object.defineProperty(y,B,H)}:function(y,S,N,B){B===void 0&&(B=N),y[B]=S[N]}),d=A1&&A1.__exportStar||function(y,S){for(var N in y)N!=="default"&&!Object.prototype.hasOwnProperty.call(S,N)&&s(S,y,N)};Object.defineProperty(o,"__esModule",{value:!0}),d(SOe,o)})($bt);class vF extends Error{constructor(s,d){super(`${s} at position ${d}`),this.position=d}}const IOe=32,IBn=10,OOe=9,NOe=13,OBn=160,NBn=8192,LBn=8202,MBn=8239,PBn=8287,RBn=12288;function DBn(o){return/^[0-9A-Fa-f]$/.test(o)}function qN(o){return o>="0"&&o<="9"}function BBn(o){return o>=" "}function Tbt(o){return`,:[]/{}()
1586
1586
  +`.includes(o)}function h9e(o){return o>="a"&&o<="z"||o>="A"&&o<="Z"||o==="_"||o==="$"}function f9e(o){return o>="a"&&o<="z"||o>="A"&&o<="Z"||o==="_"||o==="$"||o>="0"&&o<="9"}const d9e=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,p9e=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function g9e(o){return`,[]/{}
1587
- +`.includes(o)}function b9e(o){return jbt(o)||DBn.test(o)}const DBn=/^[[{\w-]$/;function BBn(o){return o===`
1588
- `||o==="\r"||o===" "||o==="\b"||o==="\f"}function GN(o,s){const d=o.charCodeAt(s);return d===IOe||d===SBn||d===OOe||d===NOe}function FBn(o,s){const d=o.charCodeAt(s);return d===IOe||d===OOe||d===NOe}function $Bn(o,s){const d=o.charCodeAt(s);return d===ABn||d>=IBn&&d<=OBn||d===NBn||d===LBn||d===MBn}function jbt(o){return LOe(o)||fFt(o)}function LOe(o){return o==='"'||o==="“"||o==="”"}function m9e(o){return o==='"'}function fFt(o){return o==="'"||o==="‘"||o==="’"||o==="`"||o==="´"}function y9e(o){return o==="'"}function rQ(o,s){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const y=o.lastIndexOf(s);return y!==-1?o.substring(0,y)+(d?"":o.substring(y+1)):o}function V_(o,s){let d=o.length;if(!GN(o,d-1))return o+s;for(;GN(o,d-1);)d--;return o.substring(0,d)+s+o.substring(d)}function jBn(o,s,d){return o.substring(0,s)+o.substring(s+d)}function HBn(o){return/[,\n][ \t\r]*$/.test(o)}const zBn={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},UBn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
1589
- `,r:"\r",t:" "};function qBn(o){let s=0,d="";W(["```","[```","{```"]),N()||gi(),W(["```","```]","```}"]);const S=K(",");for(S&&B(),b9e(o[s])&&HBn(d)?(S||(d=V_(d,",")),Mt()):S&&(d=rQ(d,","));o[s]==="}"||o[s]==="]";)s++,B();if(s>=o.length)return d;di();function N(){B();const fr=Lt()||Pt()||ie()||ve()||gn()||cn(!1)||sr();return B(),fr}function B(){let fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const yr=s;let Oe=H(fr);do Oe=et(),Oe&&(Oe=H(fr));while(Oe);return s>yr}function H(fr){const yr=fr?GN:FBn;let Oe="";for(;;)if(yr(o,s))Oe+=o[s],s++;else if($Bn(o,s))Oe+=" ",s++;else break;return Oe.length>0?(d+=Oe,!0):!1}function et(){if(o[s]==="/"&&o[s+1]==="*"){for(;s<o.length&&!WBn(o,s);)s++;return s+=2,!0}if(o[s]==="/"&&o[s+1]==="/"){for(;s<o.length&&o[s]!==`
1587
+ +`.includes(o)}function b9e(o){return jbt(o)||FBn.test(o)}const FBn=/^[[{\w-]$/;function $Bn(o){return o===`
1588
+ `||o==="\r"||o===" "||o==="\b"||o==="\f"}function GN(o,s){const d=o.charCodeAt(s);return d===IOe||d===IBn||d===OOe||d===NOe}function jBn(o,s){const d=o.charCodeAt(s);return d===IOe||d===OOe||d===NOe}function HBn(o,s){const d=o.charCodeAt(s);return d===OBn||d>=NBn&&d<=LBn||d===MBn||d===PBn||d===RBn}function jbt(o){return LOe(o)||fFt(o)}function LOe(o){return o==='"'||o==="“"||o==="”"}function m9e(o){return o==='"'}function fFt(o){return o==="'"||o==="‘"||o==="’"||o==="`"||o==="´"}function y9e(o){return o==="'"}function rQ(o,s){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const y=o.lastIndexOf(s);return y!==-1?o.substring(0,y)+(d?"":o.substring(y+1)):o}function V_(o,s){let d=o.length;if(!GN(o,d-1))return o+s;for(;GN(o,d-1);)d--;return o.substring(0,d)+s+o.substring(d)}function zBn(o,s,d){return o.substring(0,s)+o.substring(s+d)}function UBn(o){return/[,\n][ \t\r]*$/.test(o)}const qBn={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},WBn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
1589
+ `,r:"\r",t:" "};function KBn(o){let s=0,d="";W(["```","[```","{```"]),N()||gi(),W(["```","```]","```}"]);const S=K(",");for(S&&B(),b9e(o[s])&&UBn(d)?(S||(d=V_(d,",")),Mt()):S&&(d=rQ(d,","));o[s]==="}"||o[s]==="]";)s++,B();if(s>=o.length)return d;di();function N(){B();const fr=Lt()||Pt()||ie()||ve()||gn()||cn(!1)||sr();return B(),fr}function B(){let fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const yr=s;let Oe=H(fr);do Oe=et(),Oe&&(Oe=H(fr));while(Oe);return s>yr}function H(fr){const yr=fr?GN:jBn;let Oe="";for(;;)if(yr(o,s))Oe+=o[s],s++;else if(HBn(o,s))Oe+=" ",s++;else break;return Oe.length>0?(d+=Oe,!0):!1}function et(){if(o[s]==="/"&&o[s+1]==="*"){for(;s<o.length&&!YBn(o,s);)s++;return s+=2,!0}if(o[s]==="/"&&o[s+1]==="/"){for(;s<o.length&&o[s]!==`
1590
1590
  `;)s++;return!0}return!1}function W(fr){if(nt(fr)){if(h9e(o[s]))for(;s<o.length&&f9e(o[s]);)s++;return B(),!0}return!1}function nt(fr){H(!0);for(const yr of fr){const Oe=s+yr.length;if(o.slice(s,Oe)===yr)return s=Oe,!0}return!1}function K(fr){return o[s]===fr?(d+=o[s],s++,!0):!1}function Q(fr){return o[s]===fr?(s++,!0):!1}function at(){return Q("\\")}function mt(){return B(),o[s]==="."&&o[s+1]==="."&&o[s+2]==="."?(s+=3,B(),Q(","),!0):!1}function Lt(){if(o[s]==="{"){d+="{",s++,B(),Q(",")&&B();let fr=!0;for(;s<o.length&&o[s]!=="}";){let yr;if(fr?(yr=!0,fr=!1):(yr=K(","),yr||(d=V_(d,",")),B()),mt(),!(ie()||cn(!0))){o[s]==="}"||o[s]==="{"||o[s]==="]"||o[s]==="["||o[s]===void 0?d=rQ(d,","):Ar();break}B();const ka=K(":"),rs=s>=o.length;ka||(b9e(o[s])||rs?d=V_(d,":"):hi()),N()||(ka||rs?d+="null":hi())}return o[s]==="}"?(d+="}",s++):d=V_(d,"}"),!0}return!1}function Pt(){if(o[s]==="["){d+="[",s++,B(),Q(",")&&B();let fr=!0;for(;s<o.length&&o[s]!=="]";)if(fr?fr=!1:K(",")||(d=V_(d,",")),mt(),!N()){d=rQ(d,",");break}return o[s]==="]"?(d+="]",s++):d=V_(d,"]"),!0}return!1}function Mt(){let fr=!0,yr=!0;for(;yr;)fr?fr=!1:K(",")||(d=V_(d,",")),yr=N();yr||(d=rQ(d,",")),d=`[
1591
1591
  ${d}
1592
- ]`}function ie(){let fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,yr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,Oe=o[s]==="\\";if(Oe&&(s++,Oe=!0),jbt(o[s])){const ka=m9e(o[s])?m9e:y9e(o[s])?y9e:fFt(o[s])?fFt:LOe,rs=s,We=d.length;let za='"';for(s++;;){if(s>=o.length){const Fa=Fn(s-1);return!fr&&Tbt(o.charAt(Fa))?(s=rs,d=d.substring(0,We),ie(!0)):(za=V_(za,'"'),d+=za,!0)}if(s===yr)return za=V_(za,'"'),d+=za,!0;if(ka(o[s])){const Fa=s,Sa=za.length;if(za+='"',s++,d+=za,B(!1),fr||s>=o.length||Tbt(o[s])||jbt(o[s])||qN(o[s]))return se(),!0;const $s=Fn(Fa-1),su=o.charAt($s);if(su===",")return s=rs,d=d.substring(0,We),ie(!1,$s);if(Tbt(su))return s=rs,d=d.substring(0,We),ie(!0);d=d.substring(0,We),s=Fa+1,za=`${za.substring(0,Sa)}\\${za.substring(Sa)}`}else if(fr&&g9e(o[s])){if(o[s-1]===":"&&d9e.test(o.substring(rs+1,s+2)))for(;s<o.length&&p9e.test(o[s]);)za+=o[s],s++;return za=V_(za,'"'),d+=za,se(),!0}else if(o[s]==="\\"){const Fa=o.charAt(s+1);if(UBn[Fa]!==void 0)za+=o.slice(s,s+2),s+=2;else if(Fa==="u"){let $s=2;for(;$s<6&&PBn(o[s+$s]);)$s++;$s===6?(za+=o.slice(s,s+6),s+=6):s+$s>=o.length?s=o.length:_a()}else za+=Fa,s+=2}else{const Fa=o.charAt(s);Fa==='"'&&o[s-1]!=="\\"?(za+=`\\${Fa}`,s++):BBn(Fa)?(za+=zBn[Fa],s++):(RBn(Fa)||hr(Fa),za+=Fa,s++)}Oe&&at()}}return!1}function se(){let fr=!1;for(B();o[s]==="+";){fr=!0,s++,B(),d=rQ(d,'"',!0);const yr=d.length;ie()?d=jBn(d,yr,1):d=V_(d,'"')}return fr}function ve(){const fr=s;if(o[s]==="-"){if(s++,qn())return nr(fr),!0;if(!qN(o[s]))return s=fr,!1}for(;qN(o[s]);)s++;if(o[s]==="."){if(s++,qn())return nr(fr),!0;if(!qN(o[s]))return s=fr,!1;for(;qN(o[s]);)s++}if(o[s]==="e"||o[s]==="E"){if(s++,(o[s]==="-"||o[s]==="+")&&s++,qn())return nr(fr),!0;if(!qN(o[s]))return s=fr,!1;for(;qN(o[s]);)s++}if(!qn())return s=fr,!1;if(s>fr){const yr=o.slice(fr,s),Oe=/^0\d/.test(yr);return d+=Oe?`"${yr}"`:yr,!0}return!1}function gn(){return fe("true","true")||fe("false","false")||fe("null","null")||fe("True","true")||fe("False","false")||fe("None","null")}function fe(fr,yr){return o.slice(s,s+fr.length)===fr?(d+=yr,s+=fr.length,!0):!1}function cn(fr){const yr=s;if(h9e(o[s])){for(;s<o.length&&f9e(o[s]);)s++;let Oe=s;for(;GN(o,Oe);)Oe++;if(o[Oe]==="(")return s=Oe+1,N(),o[s]===")"&&(s++,o[s]===";"&&s++),!0}for(;s<o.length&&!g9e(o[s])&&!jbt(o[s])&&(!fr||o[s]!==":");)s++;if(o[s-1]===":"&&d9e.test(o.substring(yr,s+2)))for(;s<o.length&&p9e.test(o[s]);)s++;if(s>yr){for(;GN(o,s-1)&&s>0;)s--;const Oe=o.slice(yr,s);return d+=Oe==="undefined"?"null":JSON.stringify(Oe),o[s]==='"'&&s++,!0}}function sr(){if(o[s]==="/"){const fr=s;for(s++;s<o.length&&(o[s]!=="/"||o[s-1]==="\\");)s++;return s++,d+=`"${o.substring(fr,s)}"`,!0}}function Fn(fr){let yr=fr;for(;yr>0&&GN(o,yr);)yr--;return yr}function qn(){return s>=o.length||Tbt(o[s])||GN(o,s)}function nr(fr){d+=`${o.slice(fr,s)}0`}function hr(fr){throw new vF(`Invalid character ${JSON.stringify(fr)}`,s)}function di(){throw new vF(`Unexpected character ${JSON.stringify(o[s])}`,s)}function gi(){throw new vF("Unexpected end of json string",o.length)}function Ar(){throw new vF("Object key expected",s)}function hi(){throw new vF("Colon expected",s)}function _a(){const fr=o.slice(s,s+6);throw new vF(`Invalid unicode character "${fr}"`,s)}}function WBn(o,s){return o[s]==="*"&&o[s+1]==="/"}var dFt;(function(o){o.variable=s=>o.reserved(s)===!1&&/^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(s),o.reserved=s=>KBn.has(s)})(dFt||(dFt={}));const KBn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","module","new","null","package","public","private","protected","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]),WF={parse:GBn,stringifyValidateFailure:VBn},YBn=(...o)=>s=>o.reduce((d,y)=>y(d),s);function GBn(o){return o=YBn($bt.removeEmptyObjectPrefix,$bt.addMissingBraces,$bt.removeTrailingCommas,qBn)(o),JSON.parse(o)}function VBn(o){const s=new Set,d=Hbt({value:o.data,errors:o.errors,path:"$input",tab:0,inArray:!1,inToJson:!1,usedErrors:s}),y=o.errors.filter(S=>!s.has(S));return y.length>0?`\`\`\`json
1592
+ ]`}function ie(){let fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,yr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,Oe=o[s]==="\\";if(Oe&&(s++,Oe=!0),jbt(o[s])){const ka=m9e(o[s])?m9e:y9e(o[s])?y9e:fFt(o[s])?fFt:LOe,rs=s,We=d.length;let za='"';for(s++;;){if(s>=o.length){const Fa=Fn(s-1);return!fr&&Tbt(o.charAt(Fa))?(s=rs,d=d.substring(0,We),ie(!0)):(za=V_(za,'"'),d+=za,!0)}if(s===yr)return za=V_(za,'"'),d+=za,!0;if(ka(o[s])){const Fa=s,Sa=za.length;if(za+='"',s++,d+=za,B(!1),fr||s>=o.length||Tbt(o[s])||jbt(o[s])||qN(o[s]))return se(),!0;const $s=Fn(Fa-1),su=o.charAt($s);if(su===",")return s=rs,d=d.substring(0,We),ie(!1,$s);if(Tbt(su))return s=rs,d=d.substring(0,We),ie(!0);d=d.substring(0,We),s=Fa+1,za=`${za.substring(0,Sa)}\\${za.substring(Sa)}`}else if(fr&&g9e(o[s])){if(o[s-1]===":"&&d9e.test(o.substring(rs+1,s+2)))for(;s<o.length&&p9e.test(o[s]);)za+=o[s],s++;return za=V_(za,'"'),d+=za,se(),!0}else if(o[s]==="\\"){const Fa=o.charAt(s+1);if(WBn[Fa]!==void 0)za+=o.slice(s,s+2),s+=2;else if(Fa==="u"){let $s=2;for(;$s<6&&DBn(o[s+$s]);)$s++;$s===6?(za+=o.slice(s,s+6),s+=6):s+$s>=o.length?s=o.length:_a()}else za+=Fa,s+=2}else{const Fa=o.charAt(s);Fa==='"'&&o[s-1]!=="\\"?(za+=`\\${Fa}`,s++):$Bn(Fa)?(za+=qBn[Fa],s++):(BBn(Fa)||hr(Fa),za+=Fa,s++)}Oe&&at()}}return!1}function se(){let fr=!1;for(B();o[s]==="+";){fr=!0,s++,B(),d=rQ(d,'"',!0);const yr=d.length;ie()?d=zBn(d,yr,1):d=V_(d,'"')}return fr}function ve(){const fr=s;if(o[s]==="-"){if(s++,qn())return nr(fr),!0;if(!qN(o[s]))return s=fr,!1}for(;qN(o[s]);)s++;if(o[s]==="."){if(s++,qn())return nr(fr),!0;if(!qN(o[s]))return s=fr,!1;for(;qN(o[s]);)s++}if(o[s]==="e"||o[s]==="E"){if(s++,(o[s]==="-"||o[s]==="+")&&s++,qn())return nr(fr),!0;if(!qN(o[s]))return s=fr,!1;for(;qN(o[s]);)s++}if(!qn())return s=fr,!1;if(s>fr){const yr=o.slice(fr,s),Oe=/^0\d/.test(yr);return d+=Oe?`"${yr}"`:yr,!0}return!1}function gn(){return fe("true","true")||fe("false","false")||fe("null","null")||fe("True","true")||fe("False","false")||fe("None","null")}function fe(fr,yr){return o.slice(s,s+fr.length)===fr?(d+=yr,s+=fr.length,!0):!1}function cn(fr){const yr=s;if(h9e(o[s])){for(;s<o.length&&f9e(o[s]);)s++;let Oe=s;for(;GN(o,Oe);)Oe++;if(o[Oe]==="(")return s=Oe+1,N(),o[s]===")"&&(s++,o[s]===";"&&s++),!0}for(;s<o.length&&!g9e(o[s])&&!jbt(o[s])&&(!fr||o[s]!==":");)s++;if(o[s-1]===":"&&d9e.test(o.substring(yr,s+2)))for(;s<o.length&&p9e.test(o[s]);)s++;if(s>yr){for(;GN(o,s-1)&&s>0;)s--;const Oe=o.slice(yr,s);return d+=Oe==="undefined"?"null":JSON.stringify(Oe),o[s]==='"'&&s++,!0}}function sr(){if(o[s]==="/"){const fr=s;for(s++;s<o.length&&(o[s]!=="/"||o[s-1]==="\\");)s++;return s++,d+=`"${o.substring(fr,s)}"`,!0}}function Fn(fr){let yr=fr;for(;yr>0&&GN(o,yr);)yr--;return yr}function qn(){return s>=o.length||Tbt(o[s])||GN(o,s)}function nr(fr){d+=`${o.slice(fr,s)}0`}function hr(fr){throw new vF(`Invalid character ${JSON.stringify(fr)}`,s)}function di(){throw new vF(`Unexpected character ${JSON.stringify(o[s])}`,s)}function gi(){throw new vF("Unexpected end of json string",o.length)}function Ar(){throw new vF("Object key expected",s)}function hi(){throw new vF("Colon expected",s)}function _a(){const fr=o.slice(s,s+6);throw new vF(`Invalid unicode character "${fr}"`,s)}}function YBn(o,s){return o[s]==="*"&&o[s+1]==="/"}var dFt;(function(o){o.variable=s=>o.reserved(s)===!1&&/^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(s),o.reserved=s=>GBn.has(s)})(dFt||(dFt={}));const GBn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","module","new","null","package","public","private","protected","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]),WF={parse:XBn,stringifyValidateFailure:QBn},VBn=(...o)=>s=>o.reduce((d,y)=>y(d),s);function XBn(o){return o=VBn($bt.removeEmptyObjectPrefix,$bt.addMissingBraces,$bt.removeTrailingCommas,KBn)(o),JSON.parse(o)}function QBn(o){const s=new Set,d=Hbt({value:o.data,errors:o.errors,path:"$input",tab:0,inArray:!1,inToJson:!1,usedErrors:s}),y=o.errors.filter(S=>!s.has(S));return y.length>0?`\`\`\`json
1593
1593
  ${d}
1594
1594
  \`\`\`
1595
1595
 
@@ -1602,16 +1602,16 @@ ${d}
1602
1602
  \`\`\``}function Hbt(o){const{value:s,errors:d,path:y,tab:S,inArray:N,inToJson:B,usedErrors:H}=o,et=" ".repeat(S),W=w9e(y,d,H);if(N&&s===void 0)return`${et}undefined${W}`;if(Array.isArray(s)){if(s.length===0)return`${et}[]${W}`;const K=[];return K.push(`${et}[${W}`),s.forEach((Q,at)=>{const mt=`${y}[${at}]`;let Lt=Hbt({value:Q,errors:d,path:mt,tab:S+1,inArray:!0,inToJson:!1,usedErrors:H});if(at<s.length-1){const Pt=Lt.split(`
1603
1603
  `),Mt=Pt[Pt.length-1],ie=Mt.indexOf(" //");ie!==-1?Pt[Pt.length-1]=`${Mt.slice(0,ie)},${Mt.slice(ie)}`:Pt[Pt.length-1]+=",",Lt=Pt.join(`
1604
1604
  `)}K.push(Lt)}),K.push(`${et}]`),K.join(`
1605
- `)}if(typeof s=="object"&&s!==null){if(!B&&typeof s.toJSON=="function"){const Lt=s.toJSON();return Hbt({value:Lt,errors:d,path:y,tab:S,inArray:N,inToJson:!0,usedErrors:H})}const K=Object.entries(s).filter(([Lt,Pt])=>Pt!==void 0),Q=XBn(y,s,d),at=[...K.map(([Lt])=>Lt),...Q];if(at.length===0)return`${et}{}${W}`;const mt=[];return mt.push(`${et}{${W}`),at.forEach((Lt,Pt,Mt)=>{const ie=dFt.variable(Lt)?`${y}.${Lt}`:`${y}[${JSON.stringify(Lt)}]`,se=" ".repeat(S+1),ve=Q.includes(Lt)?void 0:s[Lt];if(ve==null||typeof ve=="boolean"||typeof ve=="number"||typeof ve=="string"){const gn=w9e(ie,d,H),fe=ve===void 0?`${se}"${Lt}": undefined`:`${se}"${Lt}": ${JSON.stringify(ve)}`,sr=(Pt<Mt.length-1?`${fe},`:fe)+gn;mt.push(sr)}else{const gn=`${se}"${Lt}": `;let fe=Hbt({value:ve,errors:d,path:ie,tab:S+1,inArray:!1,inToJson:!1,usedErrors:H});const cn=fe.trimStart();if(Pt<Mt.length-1){const Fn=cn.split(`
1605
+ `)}if(typeof s=="object"&&s!==null){if(!B&&typeof s.toJSON=="function"){const Lt=s.toJSON();return Hbt({value:Lt,errors:d,path:y,tab:S,inArray:N,inToJson:!0,usedErrors:H})}const K=Object.entries(s).filter(([Lt,Pt])=>Pt!==void 0),Q=JBn(y,s,d),at=[...K.map(([Lt])=>Lt),...Q];if(at.length===0)return`${et}{}${W}`;const mt=[];return mt.push(`${et}{${W}`),at.forEach((Lt,Pt,Mt)=>{const ie=dFt.variable(Lt)?`${y}.${Lt}`:`${y}[${JSON.stringify(Lt)}]`,se=" ".repeat(S+1),ve=Q.includes(Lt)?void 0:s[Lt];if(ve==null||typeof ve=="boolean"||typeof ve=="number"||typeof ve=="string"){const gn=w9e(ie,d,H),fe=ve===void 0?`${se}"${Lt}": undefined`:`${se}"${Lt}": ${JSON.stringify(ve)}`,sr=(Pt<Mt.length-1?`${fe},`:fe)+gn;mt.push(sr)}else{const gn=`${se}"${Lt}": `;let fe=Hbt({value:ve,errors:d,path:ie,tab:S+1,inArray:!1,inToJson:!1,usedErrors:H});const cn=fe.trimStart();if(Pt<Mt.length-1){const Fn=cn.split(`
1606
1606
  `),qn=Fn[Fn.length-1],nr=qn.indexOf(" //");nr!==-1?Fn[Fn.length-1]=`${qn.slice(0,nr)},${qn.slice(nr)}`:Fn[Fn.length-1]+=",",fe=Fn.join(`
1607
1607
  `)}else fe=cn;const sr=gn+fe;mt.push(sr)}}),mt.push(`${et}}`),mt.join(`
1608
- `)}const nt=s===void 0?"undefined":JSON.stringify(s)??String(s);return`${et}${nt}${W}`}function w9e(o,s,d){const y=s.filter(S=>S.path===o);return y.length===0?"":(y.forEach(S=>d.add(S)),` // ❌ ${JSON.stringify(y.map(S=>({path:S.path,expected:S.expected,description:S.description})))}`)}function XBn(o,s,d){const y=new Set;for(const S of d){const N=QBn(o,S.path);N!==null&&(N in s||y.add(N))}return Array.from(y)}function QBn(o,s){if(!s.startsWith(o))return null;const y=s.slice(o.length).match(/^\.([^.[\]]+)$/);return y!==null?y[1]:null}function JBn(o){const s=o instanceof Uint8Array?hFt.toUtf8(o):o;return WF.parse(s)}function MOe(o,s){const d=o.choices;s.choices.forEach(S=>{const N=d[S.index];if(N!=null){d[S.index]=POe(N,S);return}d[S.index]={index:S.index,finish_reason:S.finish_reason??null,logprobs:S.logprobs??null,message:{tool_calls:S.delta.tool_calls!==void 0?S.delta.tool_calls.reduce((B,H)=>{var et,W;return B[H.index]={id:H.id??"",type:"function",function:{name:((et=H.function)==null?void 0:et.name)??"",arguments:((W=H.function)==null?void 0:W.arguments)??""}},B},[]):void 0,content:S.delta.content??null,refusal:S.delta.refusal??null,role:"assistant",reasoning:S.delta.reasoning??null}}});const y=s.usage==null?o.usage:o.usage==null?s.usage:wBn.sum(o.usage,s.usage);return{...o,choices:d,usage:y}}function ZBn(o){const s=o[0];if(s===void 0)throw new Error("No chunks received");const d=o.reduce(MOe,{id:s.id,choices:[],created:s.created,model:s.model,object:"chat.completion",usage:void 0,service_tier:s.service_tier,system_fingerprint:s.system_fingerprint});return d.choices.forEach(y=>{var S;(S=y.message.tool_calls)==null||S.filter(N=>N.type==="function").forEach(N=>{N.function.arguments===""&&(N.function.arguments="{}")})}),d}function POe(o,s){var d;if(o.finish_reason==null&&s.finish_reason!=null&&(o.finish_reason=s.finish_reason),o.logprobs==null&&s.logprobs!=null&&(o.logprobs=s.logprobs),s.delta.content!=null&&(o.message.content==null?o.message.content=s.delta.content:o.message.content+=s.delta.content),s.delta.refusal!=null&&(o.message.refusal==null?o.message.refusal=s.delta.refusal:o.message.refusal+=s.delta.refusal),s.delta.reasoning!=null&&(o.message.reasoning==null?o.message.reasoning=s.delta.reasoning:o.message.reasoning+=s.delta.reasoning),s.delta.tool_calls!=null){(d=o.message).tool_calls??(d.tool_calls=[]);const y=o.message.tool_calls;s.delta.tool_calls.forEach(S=>{var B,H;const N=y[S.index];if(N!=null&&N.type==="function"){y[S.index]=ROe(N,S);return}y[S.index]={id:S.id??"",type:"function",function:{name:((B=S.function)==null?void 0:B.name)??"",arguments:((H=S.function)==null?void 0:H.arguments)??""}}})}return o}function ROe(o,s){return s.function!=null&&(o.function.arguments+=s.function.arguments??"",o.function.name+=s.function.name??""),o.id+=s.id??"",o}const rL={transformCompletionChunk:JBn,accumulate:MOe,merge:ZBn,mergeChoice:POe,mergeToolCalls:ROe};class tFn extends Error{constructor(s){super(s),this.name="AsyncQueueClosedError"}}class eFn{constructor(){this.queue=[],this.resolvers=[],this.closeResolvers=[],this.emptyResolvers=[],this.closed=!1}enqueue(s){var d;if(this.closed){console.error(new tFn("Cannot enqueue item: queue is closed."));return}this.queue.push(s),this.resolvers.length>0&&((d=this.resolvers.shift())==null||d({value:this.queue.shift(),done:!1}))}async dequeue(){const s=this.isEmpty()?this.isClosed()?{value:void 0,done:!0}:null:{value:this.queue.shift(),done:!1};return this.isEmpty()&&this.emptyResolvers.length!==0&&(this.emptyResolvers.forEach(d=>d()),this.emptyResolvers=[]),s!==null?s:new Promise(d=>this.resolvers.push(d))}isEmpty(){return this.queue.length===0}isClosed(){return this.closed}done(){return this.isClosed()&&this.isEmpty()}close(){var s;for(this.closed=!0;this.resolvers.length>0;)(s=this.resolvers.shift())==null||s({value:void 0,done:!0});this.closeResolvers.forEach(d=>d())}async waitUntilEmpty(){return this.isEmpty()?Promise.resolve():new Promise(s=>{this.emptyResolvers.push(s)})}async waitClosed(){return this.isClosed()?Promise.resolve():new Promise(s=>{this.closeResolvers.push(s)})}}class nFn{constructor(){this.queue=new eFn,this.consumer=new ReadableStream({start:async s=>{for(;;){const{value:d,done:y}=await this.queue.dequeue();if(y===!0){s.close();return}s.enqueue(d)}}})}produce(s){this.queue.enqueue(s)}close(){this.queue.close()}done(){return this.queue.done()}async waitClosed(){await this.queue.waitClosed()}async waitUntilEmpty(){await this.queue.waitUntilEmpty()}}async function rFn(o,s){const d=o.getReader(),y=[];for(;;){const{done:S,value:N}=await d.read();if(S||(s==null?void 0:s.aborted)===!0)break;y.push(N)}return y}async function iFn(o,s,d){var B;const y=o.getReader(),S=p$t(y);let N=d.initial??null;for await(const H of S){if(((B=d.abortSignal)==null?void 0:B.aborted)===!0)break;if(N===null){N=H;continue}N=s(N,H)}return N}function aFn(...o){return new ReadableStream({start:d=>{o.forEach(y=>d.enqueue(y)),d.close()}})}async function*d$t(o){yield o}async function*p$t(o,s){for(;;){const{done:d,value:y}=await o.read();if(d||(s==null?void 0:s.aborted)===!0)break;yield y}}function sFn(o,s,d){const y=o.getReader();return new ReadableStream({pull:async S=>{const{done:N,value:B}=await y.read();if(N===!0||(d==null?void 0:d.aborted)===!0){S.close();return}S.enqueue(s(B))}})}const UQ={readAll:rFn,reduce:iFn,from:aFn,transform:sFn};async function t2t(o,s,d){const y=new Map,S=await UQ.reduce(o,async(N,B)=>{const H=await N,et=W=>{for(const nt of W){if(nt.delta.content!=null&&nt.delta.content!=="")if(y.has(nt.index)){const K=y.get(nt.index);K.content+=nt.delta.content,K.mpsc.produce(nt.delta.content)}else{const K=new nFn;y.set(nt.index,{content:nt.delta.content,mpsc:K}),K.produce(nt.delta.content),s({stream:p$t(K.consumer.getReader()),done:()=>K.done(),get:()=>{var Q;return((Q=y.get(nt.index))==null?void 0:Q.content)??""},join:async()=>(await K.waitClosed(),y.get(nt.index).content)})}if(nt.finish_reason!=null){const K=y.get(nt.index);K!=null&&K.mpsc.close()}}};return H.object==="chat.completion.chunk"?(et([H,B].flatMap(W=>W.choices)),rL.merge([H,B])):(et(B.choices),rL.accumulate(H,B))},{abortSignal:d});if(S==null)throw new Error(`StreamUtil.reduce did not produce a ChatCompletion. Possible causes: the input stream was empty, invalid, or closed prematurely. To debug: check that the stream is properly initialized and contains valid ChatCompletionChunk data. You may also enable verbose logging upstream to inspect the stream contents. Stream locked: ${o.locked}.`);if(S.object==="chat.completion.chunk"){const N=rL.merge([S]);return N.choices.forEach(B=>{B.message.content!=null&&B.message.content!==""&&s({stream:d$t(B.message.content),done:()=>!0,get:()=>B.message.content,join:async()=>B.message.content})}),N}return S}function e2t(o){return{operation:o.operation,reason:o.reason,toJSON:()=>({operation:o.operation.toJSON(),reason:o.reason})}}function DOe(o,s){const d=o.stack.findIndex(N=>N.operation.name===s.name);if(d===-1)return;const y=o.stack[d];o.stack.splice(d,1);const S=aDn({selection:e2t({operation:y.operation,reason:s.reason})});o.dispatch(S).catch(()=>{})}async function oFn(o,s){var H;const d=TOe(1),S=await(async et=>d(et).catch(W=>{if(W instanceof zQ)return Symbol("emptyAssistantMessage");throw W}))(async et=>{var Q,at,mt,Lt,Pt,Mt,ie;const W=await o.request("call",{messages:[{role:"system",content:JF.write(o.config)},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},...et instanceof Tmt?[{role:"assistant",content:et.reasoning}]:[],...((at=(Q=o.config)==null?void 0:Q.systemPrompt)==null?void 0:at.execute)===null?[]:[{role:"system",content:((Pt=(Lt=(mt=o.config)==null?void 0:mt.systemPrompt)==null?void 0:Lt.execute)==null?void 0:Pt.call(Lt,o.histories))??k6.EXECUTE}]],tools:s.map(se=>({type:"function",function:{name:se.name,description:se.function.description,parameters:"separated"in se.function&&se.function.separated!==void 0?se.function.separated.llm??{type:"object",properties:{},required:[],additionalProperties:!1,$defs:{}}:se.function.parameters}})),tool_choice:"auto"}),nt=await t2t(W,se=>{const ve=HQ(se);o.dispatch(ve).catch(()=>{})});if(nt.choices.every(se=>se.message.tool_calls==null&&se.message.content==="")){const se=nt.choices.at(0);throw((Mt=se==null?void 0:se.message)==null?void 0:Mt.reasoning)!=null?new Tmt(((ie=se==null?void 0:se.message)==null?void 0:ie.reasoning)??""):new zQ}return nt});if(typeof S=="symbol"){const et=HQ({stream:d$t(""),done:()=>!0,get:()=>"",join:async()=>""});return o.dispatch(et).catch(()=>{}),[]}const N=[],B=((H=o.config)==null?void 0:H.retry)??fk.RETRY;for(const et of S.choices)for(const W of et.message.tool_calls??[])if(W.type==="function"){const nt=s.find(Q=>Q.name===W.function.name);if(nt===void 0)continue;const K=await BOe(o,nt,W,[],B);await o.dispatch(K),N.push(K),mBn(o)&&DOe(o,{name:K.operation.name,reason:"completed"})}return N}async function BOe(o,s,d,y,S){const N=lFn(s,d,S);if(await o.dispatch(N),N.type==="jsonParseError")return uFn(o,d,N,y,S-1);const B=s.function.validate(N.arguments);if(B.success===!1){const H=cDn({call_id:d.id,operation:s,result:B,life:S});return await o.dispatch(H),cFn(o,N,H,[...y,H],S-1)}return hFn(N,s)}async function cFn(o,s,d,y,S){var N,B,H;return FOe(o,{giveUp:()=>wmt({call_id:s.id,operation:s.operation,arguments:s.arguments,value:{name:"ValidationError",message:`Invalid arguments. The validation failed after ${fk.RETRY} retries.`,errors:d.result.errors},success:!1}),operation:s.operation,toolCall:{id:s.id,arguments:JSON.stringify(s.arguments),result:["🚨 VALIDATION FAILURE: Your function arguments do not conform to the required schema.","","The validation errors below represent computed absolute truth from rigorous type validation.","Each error is marked with ❌ comments showing the exact location, expected type, and actual value.","","You must fix ALL errors to achieve 100% schema compliance.","",WF.stringifyValidateFailure(d.result)].join(`
1608
+ `)}const nt=s===void 0?"undefined":JSON.stringify(s)??String(s);return`${et}${nt}${W}`}function w9e(o,s,d){const y=s.filter(S=>S.path===o);return y.length===0?"":(y.forEach(S=>d.add(S)),` // ❌ ${JSON.stringify(y.map(S=>({path:S.path,expected:S.expected,description:S.description})))}`)}function JBn(o,s,d){const y=new Set;for(const S of d){const N=ZBn(o,S.path);N!==null&&(N in s||y.add(N))}return Array.from(y)}function ZBn(o,s){if(!s.startsWith(o))return null;const y=s.slice(o.length).match(/^\.([^.[\]]+)$/);return y!==null?y[1]:null}function tFn(o){const s=o instanceof Uint8Array?hFt.toUtf8(o):o;return WF.parse(s)}function MOe(o,s){const d=o.choices;s.choices.forEach(S=>{const N=d[S.index];if(N!=null){d[S.index]=POe(N,S);return}d[S.index]={index:S.index,finish_reason:S.finish_reason??null,logprobs:S.logprobs??null,message:{tool_calls:S.delta.tool_calls!==void 0?S.delta.tool_calls.reduce((B,H)=>{var et,W;return B[H.index]={id:H.id??"",type:"function",function:{name:((et=H.function)==null?void 0:et.name)??"",arguments:((W=H.function)==null?void 0:W.arguments)??""}},B},[]):void 0,content:S.delta.content??null,refusal:S.delta.refusal??null,role:"assistant",reasoning:S.delta.reasoning??null}}});const y=s.usage==null?o.usage:o.usage==null?s.usage:_Bn.sum(o.usage,s.usage);return{...o,choices:d,usage:y}}function eFn(o){const s=o[0];if(s===void 0)throw new Error("No chunks received");const d=o.reduce(MOe,{id:s.id,choices:[],created:s.created,model:s.model,object:"chat.completion",usage:void 0,service_tier:s.service_tier,system_fingerprint:s.system_fingerprint});return d.choices.forEach(y=>{var S;(S=y.message.tool_calls)==null||S.filter(N=>N.type==="function").forEach(N=>{N.function.arguments===""&&(N.function.arguments="{}")})}),d}function POe(o,s){var d;if(o.finish_reason==null&&s.finish_reason!=null&&(o.finish_reason=s.finish_reason),o.logprobs==null&&s.logprobs!=null&&(o.logprobs=s.logprobs),s.delta.content!=null&&(o.message.content==null?o.message.content=s.delta.content:o.message.content+=s.delta.content),s.delta.refusal!=null&&(o.message.refusal==null?o.message.refusal=s.delta.refusal:o.message.refusal+=s.delta.refusal),s.delta.reasoning!=null&&(o.message.reasoning==null?o.message.reasoning=s.delta.reasoning:o.message.reasoning+=s.delta.reasoning),s.delta.tool_calls!=null){(d=o.message).tool_calls??(d.tool_calls=[]);const y=o.message.tool_calls;s.delta.tool_calls.forEach(S=>{var B,H;const N=y[S.index];if(N!=null&&N.type==="function"){y[S.index]=ROe(N,S);return}y[S.index]={id:S.id??"",type:"function",function:{name:((B=S.function)==null?void 0:B.name)??"",arguments:((H=S.function)==null?void 0:H.arguments)??""}}})}return o}function ROe(o,s){return s.function!=null&&(o.function.arguments+=s.function.arguments??"",o.function.name+=s.function.name??""),o.id+=s.id??"",o}const rL={transformCompletionChunk:tFn,accumulate:MOe,merge:eFn,mergeChoice:POe,mergeToolCalls:ROe};class nFn extends Error{constructor(s){super(s),this.name="AsyncQueueClosedError"}}class rFn{constructor(){this.queue=[],this.resolvers=[],this.closeResolvers=[],this.emptyResolvers=[],this.closed=!1}enqueue(s){var d;if(this.closed){console.error(new nFn("Cannot enqueue item: queue is closed."));return}this.queue.push(s),this.resolvers.length>0&&((d=this.resolvers.shift())==null||d({value:this.queue.shift(),done:!1}))}async dequeue(){const s=this.isEmpty()?this.isClosed()?{value:void 0,done:!0}:null:{value:this.queue.shift(),done:!1};return this.isEmpty()&&this.emptyResolvers.length!==0&&(this.emptyResolvers.forEach(d=>d()),this.emptyResolvers=[]),s!==null?s:new Promise(d=>this.resolvers.push(d))}isEmpty(){return this.queue.length===0}isClosed(){return this.closed}done(){return this.isClosed()&&this.isEmpty()}close(){var s;for(this.closed=!0;this.resolvers.length>0;)(s=this.resolvers.shift())==null||s({value:void 0,done:!0});this.closeResolvers.forEach(d=>d())}async waitUntilEmpty(){return this.isEmpty()?Promise.resolve():new Promise(s=>{this.emptyResolvers.push(s)})}async waitClosed(){return this.isClosed()?Promise.resolve():new Promise(s=>{this.closeResolvers.push(s)})}}class iFn{constructor(){this.queue=new rFn,this.consumer=new ReadableStream({start:async s=>{for(;;){const{value:d,done:y}=await this.queue.dequeue();if(y===!0){s.close();return}s.enqueue(d)}}})}produce(s){this.queue.enqueue(s)}close(){this.queue.close()}done(){return this.queue.done()}async waitClosed(){await this.queue.waitClosed()}async waitUntilEmpty(){await this.queue.waitUntilEmpty()}}async function aFn(o,s){const d=o.getReader(),y=[];for(;;){const{done:S,value:N}=await d.read();if(S||(s==null?void 0:s.aborted)===!0)break;y.push(N)}return y}async function sFn(o,s,d){var B;const y=o.getReader(),S=p$t(y);let N=d.initial??null;for await(const H of S){if(((B=d.abortSignal)==null?void 0:B.aborted)===!0)break;if(N===null){N=H;continue}N=s(N,H)}return N}function oFn(...o){return new ReadableStream({start:d=>{o.forEach(y=>d.enqueue(y)),d.close()}})}async function*d$t(o){yield o}async function*p$t(o,s){for(;;){const{done:d,value:y}=await o.read();if(d||(s==null?void 0:s.aborted)===!0)break;yield y}}function cFn(o,s,d){const y=o.getReader();return new ReadableStream({pull:async S=>{const{done:N,value:B}=await y.read();if(N===!0||(d==null?void 0:d.aborted)===!0){S.close();return}S.enqueue(s(B))}})}const UQ={readAll:aFn,reduce:sFn,from:oFn,transform:cFn};async function t2t(o,s,d){const y=new Map,S=await UQ.reduce(o,async(N,B)=>{const H=await N,et=W=>{for(const nt of W){if(nt.delta.content!=null&&nt.delta.content!=="")if(y.has(nt.index)){const K=y.get(nt.index);K.content+=nt.delta.content,K.mpsc.produce(nt.delta.content)}else{const K=new iFn;y.set(nt.index,{content:nt.delta.content,mpsc:K}),K.produce(nt.delta.content),s({stream:p$t(K.consumer.getReader()),done:()=>K.done(),get:()=>{var Q;return((Q=y.get(nt.index))==null?void 0:Q.content)??""},join:async()=>(await K.waitClosed(),y.get(nt.index).content)})}if(nt.finish_reason!=null){const K=y.get(nt.index);K!=null&&K.mpsc.close()}}};return H.object==="chat.completion.chunk"?(et([H,B].flatMap(W=>W.choices)),rL.merge([H,B])):(et(B.choices),rL.accumulate(H,B))},{abortSignal:d});if(S==null)throw new Error(`StreamUtil.reduce did not produce a ChatCompletion. Possible causes: the input stream was empty, invalid, or closed prematurely. To debug: check that the stream is properly initialized and contains valid ChatCompletionChunk data. You may also enable verbose logging upstream to inspect the stream contents. Stream locked: ${o.locked}.`);if(S.object==="chat.completion.chunk"){const N=rL.merge([S]);return N.choices.forEach(B=>{B.message.content!=null&&B.message.content!==""&&s({stream:d$t(B.message.content),done:()=>!0,get:()=>B.message.content,join:async()=>B.message.content})}),N}return S}function e2t(o){return{operation:o.operation,reason:o.reason,toJSON:()=>({operation:o.operation.toJSON(),reason:o.reason})}}function DOe(o,s){const d=o.stack.findIndex(N=>N.operation.name===s.name);if(d===-1)return;const y=o.stack[d];o.stack.splice(d,1);const S=aDn({selection:e2t({operation:y.operation,reason:s.reason})});o.dispatch(S).catch(()=>{})}async function uFn(o,s){var H;const d=TOe(1),S=await(async et=>d(et).catch(W=>{if(W instanceof zQ)return Symbol("emptyAssistantMessage");throw W}))(async et=>{var Q,at,mt,Lt,Pt,Mt,ie;const W=await o.request("call",{messages:[{role:"system",content:JF.write(o.config)},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},...et instanceof Tmt?[{role:"assistant",content:et.reasoning}]:[],...((at=(Q=o.config)==null?void 0:Q.systemPrompt)==null?void 0:at.execute)===null?[]:[{role:"system",content:((Pt=(Lt=(mt=o.config)==null?void 0:mt.systemPrompt)==null?void 0:Lt.execute)==null?void 0:Pt.call(Lt,o.histories))??k6.EXECUTE}]],tools:s.map(se=>({type:"function",function:{name:se.name,description:se.function.description,parameters:"separated"in se.function&&se.function.separated!==void 0?se.function.separated.llm??{type:"object",properties:{},required:[],additionalProperties:!1,$defs:{}}:se.function.parameters}})),tool_choice:"auto"}),nt=await t2t(W,se=>{const ve=HQ(se);o.dispatch(ve).catch(()=>{})});if(nt.choices.every(se=>se.message.tool_calls==null&&se.message.content==="")){const se=nt.choices.at(0);throw((Mt=se==null?void 0:se.message)==null?void 0:Mt.reasoning)!=null?new Tmt(((ie=se==null?void 0:se.message)==null?void 0:ie.reasoning)??""):new zQ}return nt});if(typeof S=="symbol"){const et=HQ({stream:d$t(""),done:()=>!0,get:()=>"",join:async()=>""});return o.dispatch(et).catch(()=>{}),[]}const N=[],B=((H=o.config)==null?void 0:H.retry)??fk.RETRY;for(const et of S.choices)for(const W of et.message.tool_calls??[])if(W.type==="function"){const nt=s.find(Q=>Q.name===W.function.name);if(nt===void 0)continue;const K=await BOe(o,nt,W,[],B);await o.dispatch(K),N.push(K),mBn(o)&&DOe(o,{name:K.operation.name,reason:"completed"})}return N}async function BOe(o,s,d,y,S){const N=fFn(s,d,S);if(await o.dispatch(N),N.type==="jsonParseError")return hFn(o,d,N,y,S-1);const B=s.function.validate(N.arguments);if(B.success===!1){const H=cDn({call_id:d.id,operation:s,result:B,life:S});return await o.dispatch(H),lFn(o,N,H,[...y,H],S-1)}return dFn(N,s)}async function lFn(o,s,d,y,S){var N,B,H;return FOe(o,{giveUp:()=>wmt({call_id:s.id,operation:s.operation,arguments:s.arguments,value:new wBn({arguments:s.arguments,errors:d.result.errors}),success:!1}),operation:s.operation,toolCall:{id:s.id,arguments:JSON.stringify(s.arguments),result:["🚨 VALIDATION FAILURE: Your function arguments do not conform to the required schema.","","The validation errors below represent computed absolute truth from rigorous type validation.","Each error is marked with ❌ comments showing the exact location, expected type, and actual value.","","You must fix ALL errors to achieve 100% schema compliance.","",WF.stringifyValidateFailure(d.result)].join(`
1609
1609
  `)},systemPrompt:((H=(B=(N=o.config)==null?void 0:N.systemPrompt)==null?void 0:B.validate)==null?void 0:H.call(B,y.slice(0,-1)))??[k6.VALIDATE,...y.length>1?["",k6.VALIDATE_REPEATED.replace("${{HISTORICAL_ERRORS}}",y.slice(0,-1).map((et,W)=>[`### ${W+1}. Previous Validation Error`,"",WF.stringifyValidateFailure(et.result)].join(`
1610
1610
  `)).join(`
1611
1611
 
1612
1612
  `))]:[]].join(`
1613
- `),life:S,previousValidationErrors:y})}async function uFn(o,s,d,y,S){var N,B,H;return FOe(o,{giveUp:()=>wmt({call_id:s.id,operation:d.operation,arguments:{},value:{name:"JsonParseError",message:`Invalid JSON format. The parsing failed after ${fk.RETRY} retries.`,arguments:d.arguments,errorMessage:d.errorMessage},success:!1}),operation:d.operation,toolCall:{id:d.id,arguments:d.arguments,result:d.errorMessage},systemPrompt:((H=(B=(N=o.config)==null?void 0:N.systemPrompt)==null?void 0:B.jsonParseError)==null?void 0:H.call(B,d))??k6.JSON_PARSE_ERROR.replace("${{ERROR_MESSAGE}}",d.errorMessage),life:S,previousValidationErrors:y})}function lFn(o,s,d){try{const y=WF.parse(s.function.arguments);return sDn({id:s.id,operation:o,arguments:y})}catch(y){return oDn({call_id:s.id,operation:o,arguments:s.function.arguments,errorMessage:y instanceof Error?y.message:String(y),life:d})}}async function FOe(o,s){var B,H,et,W,nt,K;if(s.life<=0)return s.giveUp();const d=await o.request("call",{messages:[{role:"system",content:JF.write(o.config)},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},{role:"system",content:((et=(H=(B=o.config)==null?void 0:B.systemPrompt)==null?void 0:H.execute)==null?void 0:et.call(H,o.histories))??k6.EXECUTE},{role:"assistant",tool_calls:[{type:"function",id:s.toolCall.id,function:{name:s.operation.name,arguments:s.toolCall.arguments}}]},{role:"tool",content:s.toolCall.result,tool_call_id:s.toolCall.id},{role:"system",content:s.systemPrompt}],tools:[{type:"function",function:{name:s.operation.name,description:s.operation.function.description,parameters:"separated"in s.operation.function&&s.operation.function.separated!==void 0?((W=s.operation.function.separated)==null?void 0:W.llm)??{$defs:{},type:"object",properties:{},additionalProperties:!1,required:[]}:s.operation.function.parameters}}],tool_choice:"required"}),y=await UQ.readAll(d),N=(K=(nt=rL.merge(y).choices[0])==null?void 0:nt.message.tool_calls)==null?void 0:K.filter(Q=>Q.type==="function").find(Q=>Q.function.name===s.operation.name);return N===void 0?s.giveUp():BOe(o,s.operation,N,s.previousValidationErrors,s.life)}async function hFn(o,s){try{const d=await(async()=>{switch(s.protocol){case"class":return fFn(o,s);case"http":return dFn(o,s);case"mcp":return pFn(o,s);default:throw new Error("Unknown protocol")}})();return wmt({call_id:o.id,operation:o.operation,arguments:o.arguments,value:d,success:!0})}catch(d){return wmt({call_id:o.id,operation:o.operation,arguments:o.arguments,value:d instanceof Error?{...d,name:d.name,message:d.message,stack:d.stack}:d,success:!1})}}async function fFn(o,s){const d=s.controller.execute;return typeof d=="function"?await d({application:s.controller.application,function:s.function,arguments:o.arguments}):await d[s.function.name](o.arguments)}async function dFn(o,s){const d=s.controller.execute;return typeof d=="function"?await d({connection:s.controller.connection,application:s.controller.application,function:s.function,arguments:o.arguments}):await lFt.propagate({connection:s.controller.connection,application:s.controller.application,function:s.function,input:o.arguments})}async function pFn(o,s){return s.controller.client.callTool({method:s.function.name,name:s.function.name,arguments:o.arguments}).then(d=>d.content)}var g$t={};Object.defineProperty(g$t,"__esModule",{value:!0});var ZF=g$t._validateReport=void 0;const gFn=o=>{const s=d=>{if(o.length===0)return!0;const y=o[o.length-1].path;return d.length>y.length||y.substring(0,d.length)!==d};return(d,y)=>{var S;return d&&s(y.path)&&(y.value===void 0&&((S=y.description)!==null&&S!==void 0||(y.description=["The value at this path is `undefined`.","",`Please fill the \`${y.expected}\` typed value next time.`].join(`
1614
- `))),o.push(y)),!1}};ZF=g$t._validateReport=gFn;const ZDt={functions:[{name:"cancelFunctions",parameters:{description:"Current Type: {@link __IChatFunctionReference.IProps}",type:"object",properties:{functions:{description:"List of target functions.",type:"array",items:{$ref:"#/$defs/___IChatFunctionReference"}}},required:["functions"],additionalProperties:!1,$defs:{___IChatFunctionReference:{type:"object",properties:{reason:{description:`The reason of the function selection.
1613
+ `),life:S,previousValidationErrors:y})}async function hFn(o,s,d,y,S){var N,B,H;return FOe(o,{giveUp:()=>wmt({call_id:s.id,operation:d.operation,arguments:{},value:new yBn({arguments:d.arguments,reason:d.errorMessage}),success:!1}),operation:d.operation,toolCall:{id:d.id,arguments:d.arguments,result:d.errorMessage},systemPrompt:((H=(B=(N=o.config)==null?void 0:N.systemPrompt)==null?void 0:B.jsonParseError)==null?void 0:H.call(B,d))??k6.JSON_PARSE_ERROR.replace("${{ERROR_MESSAGE}}",d.errorMessage),life:S,previousValidationErrors:y})}function fFn(o,s,d){try{const y=WF.parse(s.function.arguments);return sDn({id:s.id,operation:o,arguments:y})}catch(y){return oDn({call_id:s.id,operation:o,arguments:s.function.arguments,errorMessage:y instanceof Error?y.message:String(y),life:d})}}async function FOe(o,s){var B,H,et,W,nt,K;if(s.life<=0)return s.giveUp();const d=await o.request("call",{messages:[{role:"system",content:JF.write(o.config)},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},{role:"system",content:((et=(H=(B=o.config)==null?void 0:B.systemPrompt)==null?void 0:H.execute)==null?void 0:et.call(H,o.histories))??k6.EXECUTE},{role:"assistant",tool_calls:[{type:"function",id:s.toolCall.id,function:{name:s.operation.name,arguments:s.toolCall.arguments}}]},{role:"tool",content:s.toolCall.result,tool_call_id:s.toolCall.id},{role:"system",content:s.systemPrompt}],tools:[{type:"function",function:{name:s.operation.name,description:s.operation.function.description,parameters:"separated"in s.operation.function&&s.operation.function.separated!==void 0?((W=s.operation.function.separated)==null?void 0:W.llm)??{$defs:{},type:"object",properties:{},additionalProperties:!1,required:[]}:s.operation.function.parameters}}],tool_choice:"required"}),y=await UQ.readAll(d),N=(K=(nt=rL.merge(y).choices[0])==null?void 0:nt.message.tool_calls)==null?void 0:K.filter(Q=>Q.type==="function").find(Q=>Q.function.name===s.operation.name);return N===void 0?s.giveUp():BOe(o,s.operation,N,s.previousValidationErrors,s.life)}async function dFn(o,s){try{const d=await(async()=>{switch(s.protocol){case"class":return pFn(o,s);case"http":return gFn(o,s);case"mcp":return bFn(o,s);default:throw new Error("Unknown protocol")}})();return wmt({call_id:o.id,operation:o.operation,arguments:o.arguments,value:d,success:!0})}catch(d){return wmt({call_id:o.id,operation:o.operation,arguments:o.arguments,value:d instanceof Error?{...d,name:d.name,message:d.message,stack:d.stack}:d,success:!1})}}async function pFn(o,s){const d=s.controller.execute;return typeof d=="function"?await d({application:s.controller.application,function:s.function,arguments:o.arguments}):await d[s.function.name](o.arguments)}async function gFn(o,s){const d=s.controller.execute;return typeof d=="function"?await d({connection:s.controller.connection,application:s.controller.application,function:s.function,arguments:o.arguments}):await lFt.propagate({connection:s.controller.connection,application:s.controller.application,function:s.function,input:o.arguments})}async function bFn(o,s){return s.controller.client.callTool({method:s.function.name,name:s.function.name,arguments:o.arguments}).then(d=>d.content)}var g$t={};Object.defineProperty(g$t,"__esModule",{value:!0});var ZF=g$t._validateReport=void 0;const mFn=o=>{const s=d=>{if(o.length===0)return!0;const y=o[o.length-1].path;return d.length>y.length||y.substring(0,d.length)!==d};return(d,y)=>{var S;return d&&s(y.path)&&(y.value===void 0&&((S=y.description)!==null&&S!==void 0||(y.description=["The value at this path is `undefined`.","",`Please fill the \`${y.expected}\` typed value next time.`].join(`
1614
+ `))),o.push(y)),!1}};ZF=g$t._validateReport=mFn;const ZDt={functions:[{name:"cancelFunctions",parameters:{description:"Current Type: {@link __IChatFunctionReference.IProps}",type:"object",properties:{functions:{description:"List of target functions.",type:"array",items:{$ref:"#/$defs/___IChatFunctionReference"}}},required:["functions"],additionalProperties:!1,$defs:{___IChatFunctionReference:{type:"object",properties:{reason:{description:`The reason of the function selection.
1615
1615
 
1616
1616
  Just write the reason why you've determined to select this function.`,type:"string"},name:{description:"Name of the target function to call.",type:"string"}},required:["reason","name"]}}},description:`Cancel a function from the candidate list to call.
1617
1617
 
@@ -1626,8 +1626,8 @@ agent selects multiple candidate functions because the A.I. agent can't specify
1626
1626
  only one thing due to lack of specificity or homogeneity of candidate functions.
1627
1627
 
1628
1628
  Additionally, if you A.I. agent wants to cancel same function multiply, you can
1629
- do it by assigning the same function name multiply in the \`functions\` property.`,validate:(()=>{const o=H=>Array.isArray(H.functions)&&H.functions.every(et=>typeof et=="object"&&et!==null&&s(et)),s=H=>typeof H.reason=="string"&&typeof H.name=="string",d=(H,et,W=!0)=>[(Array.isArray(H.functions)||B(W,{path:et+".functions",expected:"Array<___IChatFunctionReference>",value:H.functions}))&&H.functions.map((nt,K)=>(typeof nt=="object"&&nt!==null||B(W,{path:et+".functions["+K+"]",expected:"___IChatFunctionReference",value:nt}))&&y(nt,et+".functions["+K+"]",W)||B(W,{path:et+".functions["+K+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||B(W,{path:et+".functions",expected:"Array<___IChatFunctionReference>",value:H.functions})].every(nt=>nt),y=(H,et,W=!0)=>[typeof H.reason=="string"||B(W,{path:et+".reason",expected:"string",value:H.reason}),typeof H.name=="string"||B(W,{path:et+".name",expected:"string",value:H.name})].every(nt=>nt),S=H=>typeof H=="object"&&H!==null&&o(H);let N,B;return H=>{if(S(H)===!1){N=[],B=ZF(N),((W,nt,K=!0)=>(typeof W=="object"&&W!==null||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:W}))&&d(W,nt+"",!0)||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:W}))(H,"$input",!0);const et=N.length===0;return et?{success:et,data:H}:{success:et,errors:N,data:H}}return{success:!0,data:H}}})()}]};async function bFn(o){var y;if(o.operations.divided===void 0)return zbt(o,o.operations.array,0);const s=o.operations.divided.map(()=>[]),d=[];if(await Promise.all(o.operations.divided.map(async(S,N)=>zbt({...o,stack:s[N],dispatch:async B=>{d.push(B)}},S,0))),(((y=o.config)==null?void 0:y.eliticism)??fk.ELITICISM)===!0&&s.some(S=>S.length!==0))return zbt(o,s.flat().map(S=>o.operations.group.get(S.operation.controller.name).get(S.operation.function.name)),0);{const S=d.filter(N=>N.type==="cancel");(S.length!==0?S:d).forEach(N=>{o.dispatch(N).catch(()=>{})})}}async function zbt(o,s,d,y){var H,et,W,nt;const S=await o.request("cancel",{messages:[{role:"system",content:JF.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(s.map(K=>({name:K.name,description:K.function.description,...K.protocol==="http"?{method:K.function.method,path:K.function.path,tags:K.function.tags}:{}})))},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},{role:"system",content:((W=(et=(H=o.config)==null?void 0:H.systemPrompt)==null?void 0:et.cancel)==null?void 0:W.call(et,o.histories))??k6.CANCEL},...mFn(y??[])],tools:[{type:"function",function:{name:ZDt.functions[0].name,description:ZDt.functions[0].description,parameters:ZDt.functions[0].parameters}}],tool_choice:d===0?"auto":"required"}),N=await UQ.readAll(S,o.abortSignal),B=rL.merge(N);if(d++<(((nt=o.config)==null?void 0:nt.retry)??fk.RETRY)){const K=[];for(const Q of B.choices)for(const at of Q.message.tool_calls??[]){if(at.type!=="function"||at.function.name!=="cancelFunctions")continue;const mt=WF.parse(at.function.arguments),Lt=(()=>{const Pt=cn=>Array.isArray(cn.functions)&&cn.functions.every(sr=>typeof sr=="object"&&sr!==null&&Mt(sr)),Mt=cn=>typeof cn.reason=="string"&&typeof cn.name=="string",ie=(cn,sr,Fn=!0)=>[(Array.isArray(cn.functions)||fe(Fn,{path:sr+".functions",expected:"Array<___IChatFunctionReference>",value:cn.functions}))&&cn.functions.map((qn,nr)=>(typeof qn=="object"&&qn!==null||fe(Fn,{path:sr+".functions["+nr+"]",expected:"___IChatFunctionReference",value:qn}))&&se(qn,sr+".functions["+nr+"]",Fn)||fe(Fn,{path:sr+".functions["+nr+"]",expected:"___IChatFunctionReference",value:qn})).every(qn=>qn)||fe(Fn,{path:sr+".functions",expected:"Array<___IChatFunctionReference>",value:cn.functions})].every(qn=>qn),se=(cn,sr,Fn=!0)=>[typeof cn.reason=="string"||fe(Fn,{path:sr+".reason",expected:"string",value:cn.reason}),typeof cn.name=="string"||fe(Fn,{path:sr+".name",expected:"string",value:cn.name})].every(qn=>qn),ve=cn=>typeof cn=="object"&&cn!==null&&Pt(cn);let gn,fe;return cn=>{if(ve(cn)===!1){gn=[],fe=ZF(gn),((Fn,qn,nr=!0)=>(typeof Fn=="object"&&Fn!==null||fe(!0,{path:qn+"",expected:"__IChatFunctionReference.IProps",value:Fn}))&&ie(Fn,qn+"",!0)||fe(!0,{path:qn+"",expected:"__IChatFunctionReference.IProps",value:Fn}))(cn,"$input",!0);const sr=gn.length===0;return sr?{success:sr,data:cn}:{success:sr,errors:gn,data:cn}}return{success:!0,data:cn}}})()(mt);Lt.success===!1&&K.push({id:at.id,name:at.function.name,validation:Lt})}if(K.length>0)return zbt(o,s,d,K)}for(const K of B.choices)if(K.message.tool_calls!=null)for(const Q of K.message.tool_calls){if(Q.type!=="function")continue;if(Q.function.name!=="cancelFunctions")continue;const at=(()=>{const mt=Mt=>Array.isArray(Mt.functions)&&Mt.functions.every(ie=>typeof ie=="object"&&ie!==null&&Lt(ie)),Lt=Mt=>typeof Mt.reason=="string"&&typeof Mt.name=="string",Pt=Mt=>typeof Mt=="object"&&Mt!==null&&mt(Mt);return Mt=>(Mt=JSON.parse(Mt),Pt(Mt)?Mt:null)})()(Q.function.arguments);if(at!==null)for(const mt of at.functions)DOe(o,mt)}}function mFn(o){return o.map(s=>[{role:"assistant",tool_calls:[{type:"function",id:s.id,function:{name:s.name,arguments:JSON.stringify(s.validation.data)}}]},{role:"tool",content:JSON.stringify(s.validation.errors),tool_call_id:s.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
1630
- `)}]).flat()}async function yFn(o,s){var y,S,N;if(s.length===0)return;const d=await o.request("describe",{messages:[{role:"system",content:JF.write(o.config)},...s.map(XF).flat(),{role:"system",content:((N=(S=(y=o.config)==null?void 0:y.systemPrompt)==null?void 0:S.describe)==null?void 0:N.call(S,s))??k6.DESCRIBE}]});await t2t(d,B=>{const H=lDn({executes:s,...B});o.dispatch(H).catch(()=>{})},o.abortSignal)}const kbt=[{name:"getApiFunctions",parameters:{description:"Current Type: {@link object}",type:"object",properties:{},required:[],additionalProperties:!1,$defs:{IHttpLlmFunction:{description:`LLM function calling schema from HTTP (OpenAPI) operation.
1629
+ do it by assigning the same function name multiply in the \`functions\` property.`,validate:(()=>{const o=H=>Array.isArray(H.functions)&&H.functions.every(et=>typeof et=="object"&&et!==null&&s(et)),s=H=>typeof H.reason=="string"&&typeof H.name=="string",d=(H,et,W=!0)=>[(Array.isArray(H.functions)||B(W,{path:et+".functions",expected:"Array<___IChatFunctionReference>",value:H.functions}))&&H.functions.map((nt,K)=>(typeof nt=="object"&&nt!==null||B(W,{path:et+".functions["+K+"]",expected:"___IChatFunctionReference",value:nt}))&&y(nt,et+".functions["+K+"]",W)||B(W,{path:et+".functions["+K+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||B(W,{path:et+".functions",expected:"Array<___IChatFunctionReference>",value:H.functions})].every(nt=>nt),y=(H,et,W=!0)=>[typeof H.reason=="string"||B(W,{path:et+".reason",expected:"string",value:H.reason}),typeof H.name=="string"||B(W,{path:et+".name",expected:"string",value:H.name})].every(nt=>nt),S=H=>typeof H=="object"&&H!==null&&o(H);let N,B;return H=>{if(S(H)===!1){N=[],B=ZF(N),((W,nt,K=!0)=>(typeof W=="object"&&W!==null||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:W}))&&d(W,nt+"",!0)||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:W}))(H,"$input",!0);const et=N.length===0;return et?{success:et,data:H}:{success:et,errors:N,data:H}}return{success:!0,data:H}}})()}]};async function yFn(o){var y;if(o.operations.divided===void 0)return zbt(o,o.operations.array,0);const s=o.operations.divided.map(()=>[]),d=[];if(await Promise.all(o.operations.divided.map(async(S,N)=>zbt({...o,stack:s[N],dispatch:async B=>{d.push(B)}},S,0))),(((y=o.config)==null?void 0:y.eliticism)??fk.ELITICISM)===!0&&s.some(S=>S.length!==0))return zbt(o,s.flat().map(S=>o.operations.group.get(S.operation.controller.name).get(S.operation.function.name)),0);{const S=d.filter(N=>N.type==="cancel");(S.length!==0?S:d).forEach(N=>{o.dispatch(N).catch(()=>{})})}}async function zbt(o,s,d,y){var H,et,W,nt;const S=await o.request("cancel",{messages:[{role:"system",content:JF.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(s.map(K=>({name:K.name,description:K.function.description,...K.protocol==="http"?{method:K.function.method,path:K.function.path,tags:K.function.tags}:{}})))},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},{role:"system",content:((W=(et=(H=o.config)==null?void 0:H.systemPrompt)==null?void 0:et.cancel)==null?void 0:W.call(et,o.histories))??k6.CANCEL},...wFn(y??[])],tools:[{type:"function",function:{name:ZDt.functions[0].name,description:ZDt.functions[0].description,parameters:ZDt.functions[0].parameters}}],tool_choice:d===0?"auto":"required"}),N=await UQ.readAll(S,o.abortSignal),B=rL.merge(N);if(d++<(((nt=o.config)==null?void 0:nt.retry)??fk.RETRY)){const K=[];for(const Q of B.choices)for(const at of Q.message.tool_calls??[]){if(at.type!=="function"||at.function.name!=="cancelFunctions")continue;const mt=WF.parse(at.function.arguments),Lt=(()=>{const Pt=cn=>Array.isArray(cn.functions)&&cn.functions.every(sr=>typeof sr=="object"&&sr!==null&&Mt(sr)),Mt=cn=>typeof cn.reason=="string"&&typeof cn.name=="string",ie=(cn,sr,Fn=!0)=>[(Array.isArray(cn.functions)||fe(Fn,{path:sr+".functions",expected:"Array<___IChatFunctionReference>",value:cn.functions}))&&cn.functions.map((qn,nr)=>(typeof qn=="object"&&qn!==null||fe(Fn,{path:sr+".functions["+nr+"]",expected:"___IChatFunctionReference",value:qn}))&&se(qn,sr+".functions["+nr+"]",Fn)||fe(Fn,{path:sr+".functions["+nr+"]",expected:"___IChatFunctionReference",value:qn})).every(qn=>qn)||fe(Fn,{path:sr+".functions",expected:"Array<___IChatFunctionReference>",value:cn.functions})].every(qn=>qn),se=(cn,sr,Fn=!0)=>[typeof cn.reason=="string"||fe(Fn,{path:sr+".reason",expected:"string",value:cn.reason}),typeof cn.name=="string"||fe(Fn,{path:sr+".name",expected:"string",value:cn.name})].every(qn=>qn),ve=cn=>typeof cn=="object"&&cn!==null&&Pt(cn);let gn,fe;return cn=>{if(ve(cn)===!1){gn=[],fe=ZF(gn),((Fn,qn,nr=!0)=>(typeof Fn=="object"&&Fn!==null||fe(!0,{path:qn+"",expected:"__IChatFunctionReference.IProps",value:Fn}))&&ie(Fn,qn+"",!0)||fe(!0,{path:qn+"",expected:"__IChatFunctionReference.IProps",value:Fn}))(cn,"$input",!0);const sr=gn.length===0;return sr?{success:sr,data:cn}:{success:sr,errors:gn,data:cn}}return{success:!0,data:cn}}})()(mt);Lt.success===!1&&K.push({id:at.id,name:at.function.name,validation:Lt})}if(K.length>0)return zbt(o,s,d,K)}for(const K of B.choices)if(K.message.tool_calls!=null)for(const Q of K.message.tool_calls){if(Q.type!=="function")continue;if(Q.function.name!=="cancelFunctions")continue;const at=(()=>{const mt=Mt=>Array.isArray(Mt.functions)&&Mt.functions.every(ie=>typeof ie=="object"&&ie!==null&&Lt(ie)),Lt=Mt=>typeof Mt.reason=="string"&&typeof Mt.name=="string",Pt=Mt=>typeof Mt=="object"&&Mt!==null&&mt(Mt);return Mt=>(Mt=JSON.parse(Mt),Pt(Mt)?Mt:null)})()(Q.function.arguments);if(at!==null)for(const mt of at.functions)DOe(o,mt)}}function wFn(o){return o.map(s=>[{role:"assistant",tool_calls:[{type:"function",id:s.id,function:{name:s.name,arguments:JSON.stringify(s.validation.data)}}]},{role:"tool",content:JSON.stringify(s.validation.errors),tool_call_id:s.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
1630
+ `)}]).flat()}async function vFn(o,s){var y,S,N;if(s.length===0)return;const d=await o.request("describe",{messages:[{role:"system",content:JF.write(o.config)},...s.map(XF).flat(),{role:"system",content:((N=(S=(y=o.config)==null?void 0:y.systemPrompt)==null?void 0:S.describe)==null?void 0:N.call(S,s))??k6.DESCRIBE}]});await t2t(d,B=>{const H=lDn({executes:s,...B});o.dispatch(H).catch(()=>{})},o.abortSignal)}const kbt=[{name:"getApiFunctions",parameters:{description:"Current Type: {@link object}",type:"object",properties:{},required:[],additionalProperties:!1,$defs:{IHttpLlmFunction:{description:`LLM function calling schema from HTTP (OpenAPI) operation.
1631
1631
 
1632
1632
  \`IHttpLlmFunction\` is a data structure representing a function converted from
1633
1633
  the {@link OpenApi.IOperation OpenAPI operation}, used for the LLM (Large
@@ -1873,7 +1873,7 @@ call this \`getApiFunctions()\` to get the list of candidate API functions
1873
1873
  provided from this application.
1874
1874
 
1875
1875
  Also, user just wants to list up every remote API functions that can be
1876
- called from the backend server, utilize this function too.`,validate:(()=>{const o=N=>!0,s=(N,B,H=!0)=>!0,d=N=>typeof N=="object"&&N!==null&&Array.isArray(N)===!1&&o();let y,S;return N=>{if(d(N)===!1){y=[],S=ZF(y),((H,et,W=!0)=>(typeof H=="object"&&H!==null&&Array.isArray(H)===!1||S(!0,{path:et+"",expected:"object",value:H}))&&s(H,et+"",!0)||S(!0,{path:et+"",expected:"object",value:H}))(N,"$input",!0);const B=y.length===0;return B?{success:B,data:N}:{success:B,errors:y,data:N}}return{success:!0,data:N}}})()}][0];async function wFn(o){var y,S,N;const s=await o.request("initialize",{messages:[{role:"system",content:JF.write(o.config)},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},{role:"system",content:((N=(S=(y=o.config)==null?void 0:y.systemPrompt)==null?void 0:S.initialize)==null?void 0:N.call(S,o.histories))??k6.INITIALIZE}],tools:[{type:"function",function:{name:kbt.name,description:kbt.description,parameters:kbt.parameters}}],tool_choice:"auto"}),d=await t2t(s,B=>{const H=HQ(B);o.dispatch(H).catch(()=>{})},o.abortSignal);if(d===null)throw new Error("No completion received");d.choices.some(B=>B.message.tool_calls!=null&&B.message.tool_calls.some(H=>H.type==="function"&&H.function.name===kbt.name))&&await o.initialize()}function vFn(o,s){const d=o.operations.flat.get(s.name);if(d===void 0)return;const y=e2t({operation:d,reason:s.reason});o.stack.push(y);const S=iDn({selection:y});o.dispatch(S).catch(()=>{})}const tBt={functions:[{name:"selectFunctions",parameters:{description:"Current Type: {@link __IChatFunctionReference.IProps}",type:"object",properties:{functions:{description:"List of target functions.",type:"array",items:{$ref:"#/$defs/___IChatFunctionReference"}}},required:["functions"],additionalProperties:!1,$defs:{___IChatFunctionReference:{type:"object",properties:{reason:{description:`The reason of the function selection.
1876
+ called from the backend server, utilize this function too.`,validate:(()=>{const o=N=>!0,s=(N,B,H=!0)=>!0,d=N=>typeof N=="object"&&N!==null&&Array.isArray(N)===!1&&o();let y,S;return N=>{if(d(N)===!1){y=[],S=ZF(y),((H,et,W=!0)=>(typeof H=="object"&&H!==null&&Array.isArray(H)===!1||S(!0,{path:et+"",expected:"object",value:H}))&&s(H,et+"",!0)||S(!0,{path:et+"",expected:"object",value:H}))(N,"$input",!0);const B=y.length===0;return B?{success:B,data:N}:{success:B,errors:y,data:N}}return{success:!0,data:N}}})()}][0];async function _Fn(o){var y,S,N;const s=await o.request("initialize",{messages:[{role:"system",content:JF.write(o.config)},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},{role:"system",content:((N=(S=(y=o.config)==null?void 0:y.systemPrompt)==null?void 0:S.initialize)==null?void 0:N.call(S,o.histories))??k6.INITIALIZE}],tools:[{type:"function",function:{name:kbt.name,description:kbt.description,parameters:kbt.parameters}}],tool_choice:"auto"}),d=await t2t(s,B=>{const H=HQ(B);o.dispatch(H).catch(()=>{})},o.abortSignal);if(d===null)throw new Error("No completion received");d.choices.some(B=>B.message.tool_calls!=null&&B.message.tool_calls.some(H=>H.type==="function"&&H.function.name===kbt.name))&&await o.initialize()}function xFn(o,s){const d=o.operations.flat.get(s.name);if(d===void 0)return;const y=e2t({operation:d,reason:s.reason});o.stack.push(y);const S=iDn({selection:y});o.dispatch(S).catch(()=>{})}const tBt={functions:[{name:"selectFunctions",parameters:{description:"Current Type: {@link __IChatFunctionReference.IProps}",type:"object",properties:{functions:{description:"List of target functions.",type:"array",items:{$ref:"#/$defs/___IChatFunctionReference"}}},required:["functions"],additionalProperties:!1,$defs:{___IChatFunctionReference:{type:"object",properties:{reason:{description:`The reason of the function selection.
1877
1877
 
1878
1878
  Just write the reason why you've determined to select this function.`,type:"string"},name:{description:"Name of the target function to call.",type:"string"}},required:["reason","name"]}}},description:`Select proper API functions to call.
1879
1879
 
@@ -1889,21 +1889,21 @@ them all into the \`functions\` property.
1889
1889
  Also, if you A.I. agent can't specify a specific function to call due to lack
1890
1890
  of specificity or homogeneity of candidate functions, just assign all of them
1891
1891
  by in the\` functions\` property\` too. Instead, when you A.I. agent can specify
1892
- a specific function to call, the others would be eliminated.`,validate:(()=>{const o=H=>Array.isArray(H.functions)&&H.functions.every(et=>typeof et=="object"&&et!==null&&s(et)),s=H=>typeof H.reason=="string"&&typeof H.name=="string",d=(H,et,W=!0)=>[(Array.isArray(H.functions)||B(W,{path:et+".functions",expected:"Array<___IChatFunctionReference>",value:H.functions}))&&H.functions.map((nt,K)=>(typeof nt=="object"&&nt!==null||B(W,{path:et+".functions["+K+"]",expected:"___IChatFunctionReference",value:nt}))&&y(nt,et+".functions["+K+"]",W)||B(W,{path:et+".functions["+K+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||B(W,{path:et+".functions",expected:"Array<___IChatFunctionReference>",value:H.functions})].every(nt=>nt),y=(H,et,W=!0)=>[typeof H.reason=="string"||B(W,{path:et+".reason",expected:"string",value:H.reason}),typeof H.name=="string"||B(W,{path:et+".name",expected:"string",value:H.name})].every(nt=>nt),S=H=>typeof H=="object"&&H!==null&&o(H);let N,B;return H=>{if(S(H)===!1){N=[],B=ZF(N),((W,nt,K=!0)=>(typeof W=="object"&&W!==null||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:W}))&&d(W,nt+"",!0)||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:W}))(H,"$input",!0);const et=N.length===0;return et?{success:et,data:H}:{success:et,errors:N,data:H}}return{success:!0,data:H}}})()}]};async function _Fn(o){var y;if(o.operations.divided===void 0)return Ubt(o,o.operations.array,0);const s=o.operations.divided.map(()=>[]),d=[];if(await Promise.all(o.operations.divided.map(async(S,N)=>Ubt({...o,stack:s[N],dispatch:async B=>{d.push(B)}},S,0))),(((y=o.config)==null?void 0:y.eliticism)??fk.ELITICISM)===!0&&s.some(S=>S.length!==0))return Ubt(o,s.flat().map(S=>o.operations.group.get(S.operation.controller.name).get(S.operation.function.name)),0);{const S=d.filter(N=>N.type==="select");(S.length!==0?S:d).forEach(N=>{o.dispatch(N).catch(()=>{})})}}async function Ubt(o,s,d,y){var H;const S=TOe(1),B=await(async et=>S(et).catch(W=>{if(W instanceof zQ)return Symbol("emptyAssistantMessage");throw W}))(async et=>{var Q,at,mt,Lt,Pt;const W=await o.request("select",{messages:[{role:"system",content:JF.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(s.map(Mt=>({name:Mt.name,description:Mt.function.description,...Mt.protocol==="http"?{method:Mt.function.method,path:Mt.function.path,tags:Mt.function.tags}:{}})))},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},...et instanceof Tmt?[{role:"assistant",content:et.reasoning}]:[],{role:"system",content:((mt=(at=(Q=o.config)==null?void 0:Q.systemPrompt)==null?void 0:at.select)==null?void 0:mt.call(at,o.histories))??k6.SELECT},...xFn(y??[])],tools:[{type:"function",function:{name:tBt.functions[0].name,description:tBt.functions[0].description,parameters:tBt.functions[0].parameters}}],tool_choice:d===0?"auto":"required"}),nt=await t2t(W,Mt=>{const ie=HQ(Mt);o.dispatch(ie).catch(()=>{})},o.abortSignal);if(nt.choices.every(Mt=>Mt.message.tool_calls==null&&Mt.message.content==="")){const Mt=nt.choices.at(0);throw((Lt=Mt==null?void 0:Mt.message)==null?void 0:Lt.reasoning)!=null?new Tmt(((Pt=Mt==null?void 0:Mt.message)==null?void 0:Pt.reasoning)??""):new zQ}return nt});if(typeof B=="symbol"){const et=HQ({stream:d$t(""),done:()=>!0,get:()=>"",join:async()=>""});o.dispatch(et).catch(()=>{});return}if(d++<(((H=o.config)==null?void 0:H.retry)??fk.RETRY)){const et=[];for(const W of B.choices)for(const nt of W.message.tool_calls??[]){if(nt.type!=="function"||nt.function.name!=="selectFunctions")continue;const K=WF.parse(nt.function.arguments),Q=(()=>{const at=ve=>Array.isArray(ve.functions)&&ve.functions.every(gn=>typeof gn=="object"&&gn!==null&&mt(gn)),mt=ve=>typeof ve.reason=="string"&&typeof ve.name=="string",Lt=(ve,gn,fe=!0)=>[(Array.isArray(ve.functions)||se(fe,{path:gn+".functions",expected:"Array<___IChatFunctionReference>",value:ve.functions}))&&ve.functions.map((cn,sr)=>(typeof cn=="object"&&cn!==null||se(fe,{path:gn+".functions["+sr+"]",expected:"___IChatFunctionReference",value:cn}))&&Pt(cn,gn+".functions["+sr+"]",fe)||se(fe,{path:gn+".functions["+sr+"]",expected:"___IChatFunctionReference",value:cn})).every(cn=>cn)||se(fe,{path:gn+".functions",expected:"Array<___IChatFunctionReference>",value:ve.functions})].every(cn=>cn),Pt=(ve,gn,fe=!0)=>[typeof ve.reason=="string"||se(fe,{path:gn+".reason",expected:"string",value:ve.reason}),typeof ve.name=="string"||se(fe,{path:gn+".name",expected:"string",value:ve.name})].every(cn=>cn),Mt=ve=>typeof ve=="object"&&ve!==null&&at(ve);let ie,se;return ve=>{if(Mt(ve)===!1){ie=[],se=ZF(ie),((fe,cn,sr=!0)=>(typeof fe=="object"&&fe!==null||se(!0,{path:cn+"",expected:"__IChatFunctionReference.IProps",value:fe}))&&Lt(fe,cn+"",!0)||se(!0,{path:cn+"",expected:"__IChatFunctionReference.IProps",value:fe}))(ve,"$input",!0);const gn=ie.length===0;return gn?{success:gn,data:ve}:{success:gn,errors:ie,data:ve}}return{success:!0,data:ve}}})()(K);Q.success===!1&&et.push({id:nt.id,name:nt.function.name,validation:Q})}if(et.length>0)return Ubt(o,s,d,et)}for(const et of B.choices)if(et.message.tool_calls!=null)for(const W of et.message.tool_calls){if(W.type!=="function")continue;if(W.function.name!=="selectFunctions")continue;const nt=(()=>{const K=mt=>Array.isArray(mt.functions)&&mt.functions.every(Lt=>typeof Lt=="object"&&Lt!==null&&Q(Lt)),Q=mt=>typeof mt.reason=="string"&&typeof mt.name=="string",at=mt=>typeof mt=="object"&&mt!==null&&K(mt);return mt=>(mt=JSON.parse(mt),at(mt)?mt:null)})()(W.function.arguments);if(nt!==null)for(const K of nt.functions)vFn(o,K)}}function xFn(o){return o.map(s=>[{role:"assistant",tool_calls:[{type:"function",id:s.id,function:{name:s.name,arguments:JSON.stringify(s.validation.data)}}]},{role:"tool",content:JSON.stringify(s.validation.errors),tool_call_id:s.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
1893
- `)}]).flat()}function EFn(o){return async s=>{if(s.ready()===!1){if((o==null?void 0:o.initialize)!==!0&&typeof(o==null?void 0:o.initialize)!="function")await s.initialize();else if(await(typeof(o==null?void 0:o.initialize)=="function"?o.initialize:wFn)(s),s.ready()===!1)return}if(s.stack.length!==0&&await((o==null?void 0:o.cancel)??bFn)(s),await((o==null?void 0:o.select)??_Fn)(s),s.stack.length!==0)for(;;){const d=await((o==null?void 0:o.call)??oFn)(s,s.stack.map(y=>y.operation));if((o==null?void 0:o.describe)!==null&&(o==null?void 0:o.describe)!==!1&&await(typeof(o==null?void 0:o.describe)=="function"?o.describe:yFn)(s,d),d.length===0||s.stack.length===0)break}}}function TFn(o){return o.history.type==="userMessage"?SFn({history:o.history}):o.history.type==="assistantMessage"?kFn({history:o.history}):o.history.type==="systemMessage"?CFn({history:o.history}):o.history.type==="select"?AFn({operations:o.operations,history:o.history}):o.history.type==="cancel"?IFn({operations:o.operations,history:o.history}):o.history.type==="execute"?$Oe({operations:o.operations,history:o.history}):OFn({operations:o.operations,history:o.history})}function kFn(o){return ZRn(o.history)}function CFn(o){return tDn(o.history)}function SFn(o){return vOe(o.history)}function AFn(o){return _Oe({id:o.history.id,created_at:o.history.created_at,selection:e2t({operation:b$t({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function IFn(o){return nDn({id:o.history.id,created_at:o.history.created_at,selection:e2t({operation:b$t({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function $Oe(o){return xOe({id:o.history.id,created_at:o.history.created_at,operation:b$t({operations:o.operations,input:o.history.operation}),arguments:o.history.arguments,value:o.history.value,success:o.history.success})}function OFn(o){return eDn({id:o.history.id,created_at:o.history.created_at,text:o.history.text,executes:o.history.executes.map(s=>$Oe({operations:o.operations,history:s}))})}function b$t(o){var d;const s=(d=o.operations.get(o.input.controller))==null?void 0:d.get(o.input.function);if(s===void 0)throw new Error(`No operation found: (controller: ${o.input.controller}, function: ${o.input.function})`);return s}function NFn(o){return async(s,d)=>{var Q;const y=hDn({source:s,body:{...d,model:o.vendor.model,stream:!0,stream_options:{include_usage:!0}},options:{...o.vendor.options,signal:o.abortSignal}});await o.dispatch(y);const S=((Q=o.config)==null?void 0:Q.backoffStrategy)??(at=>{throw at.error}),N=await(async()=>{let at=0;for(;;)try{return await o.vendor.api.chat.completions.create(y.body,y.options)}catch(mt){const Lt=S({count:at,error:mt});await new Promise(Pt=>setTimeout(Pt,Lt)),at++}})(),[B,H]=UQ.transform(N.toReadableStream(),at=>rL.transformCompletionChunk(at),o.abortSignal).tee(),[et,W]=H.tee();(async()=>{var mt;const at=et.getReader();for(;;){const Lt=await at.read();if(Lt.done||((mt=o.abortSignal)==null?void 0:mt.aborted)===!0)break;Lt.value.usage!=null&&yOe.aggregate({kind:s,completionUsage:Lt.value.usage,usage:o.usage})}})().catch(()=>{});const[nt,K]=B.tee();return o.dispatch({id:r5(),type:"response",request_id:y.id,source:s,stream:p$t(nt.getReader(),o.abortSignal),body:y.body,options:y.options,join:async()=>{const at=await UQ.readAll(K,o.abortSignal);return rL.merge(at)},created_at:new Date().toISOString()}).catch(()=>{}),W}}class kmt{constructor(s){var d,y;this.props=s,this.operations_=YRn.compose({controllers:s.controllers,config:s.config}),this.stack_=[],this.listeners_=new Map,this.histories_=(s.histories??[]).map(S=>TFn({operations:this.operations_.group,history:S})),this.executor_=typeof((d=s.config)==null?void 0:d.executor)=="function"?s.config.executor:EFn(((y=s.config)==null?void 0:y.executor)??null),this.semaphore_=s.vendor.semaphore!=null?typeof s.vendor.semaphore=="object"?s.vendor.semaphore:new BBt(s.vendor.semaphore):null,this.token_usage_=this.props.tokenUsage!==void 0?this.props.tokenUsage instanceof eL?this.props.tokenUsage:new eL(this.props.tokenUsage):eL.zero(),this.ready_=!1}clone(){var s;return new kmt({...this.props,histories:(s=this.props.histories)==null?void 0:s.slice()})}async conversate(s,d={}){const y=[],S=async H=>{try{await this.dispatch(H),"toHistory"in H&&("join"in H?y.push(async()=>(await H.join(),H.toHistory())):y.push(async()=>H.toHistory()))}catch{}},N=uDn({contents:Array.isArray(s)?s:typeof s=="string"?[{type:"text",text:s}]:[s]});S(N).catch(()=>{}),await this.executor_(this.getContext({dispatch:S,prompt:N.toHistory(),abortSignal:d.abortSignal,usage:this.token_usage_}));const B=await Promise.all(y.map(async H=>H()));return this.histories_.push(...B),B}getConfig(){return this.props.config}getVendor(){return this.props.vendor}getControllers(){return this.props.controllers}getOperations(){return this.operations_.array}getHistories(){return this.histories_}getTokenUsage(){return this.token_usage_}getContext(s){const d=NFn({vendor:this.props.vendor,config:this.props.config,dispatch:s.dispatch,abortSignal:s.abortSignal,usage:this.token_usage_});return{operations:this.operations_,config:this.props.config,histories:this.histories_,stack:this.stack_,ready:()=>this.ready_,prompt:s.prompt,abortSignal:s.abortSignal,dispatch:s.dispatch,request:this.semaphore_===null?d:async(y,S)=>{await this.semaphore_.acquire();try{return await d(y,S)}finally{this.semaphore_.release().catch(()=>{})}},initialize:async()=>{this.ready_=!0,s.dispatch(rDn()).catch(()=>{})}}}on(s,d){return wOe(this.listeners_,s,()=>new Set).add(d),this}off(s,d){const y=this.listeners_.get(s);return y!==void 0&&(y.delete(d),y.size===0&&this.listeners_.delete(s)),this}async dispatch(s){const d=this.listeners_.get(s.type);d!==void 0&&await Promise.all(Array.from(d).map(async y=>{try{await y(s)}catch{}}))}}function qo(o,s,d,y,S){if(typeof s=="function"?o!==s||!0:!s.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s.set(o,d),d}function lr(o,s,d,y){if(d==="a"&&!y)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?o!==s||!y:!s.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return d==="m"?y:d==="a"?y.call(o):y?y.value:s.get(o)}let jOe=function(){const{crypto:o}=globalThis;if(o!=null&&o.randomUUID)return jOe=o.randomUUID.bind(o),o.randomUUID();const s=new Uint8Array(1),d=o?()=>o.getRandomValues(s)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,y=>(+y^d()&15>>+y/4).toString(16))};function pFt(o){return typeof o=="object"&&o!==null&&("name"in o&&o.name==="AbortError"||"message"in o&&String(o.message).includes("FetchRequestCanceledException"))}const gFt=o=>{if(o instanceof Error)return o;if(typeof o=="object"&&o!==null){try{if(Object.prototype.toString.call(o)==="[object Error]"){const s=new Error(o.message,o.cause?{cause:o.cause}:{});return o.stack&&(s.stack=o.stack),o.cause&&!s.cause&&(s.cause=o.cause),o.name&&(s.name=o.name),s}}catch{}try{return new Error(JSON.stringify(o))}catch{}}return new Error(o)};class ro extends Error{}class Mg extends ro{constructor(s,d,y,S){super(`${Mg.makeMessage(s,d,y)}`),this.status=s,this.headers=S,this.requestID=S==null?void 0:S.get("x-request-id"),this.error=d;const N=d;this.code=N==null?void 0:N.code,this.param=N==null?void 0:N.param,this.type=N==null?void 0:N.type}static makeMessage(s,d,y){const S=d!=null&&d.message?typeof d.message=="string"?d.message:JSON.stringify(d.message):d?JSON.stringify(d):y;return s&&S?`${s} ${S}`:s?`${s} status code (no body)`:S||"(no status code or body)"}static generate(s,d,y,S){if(!s||!S)return new n2t({message:y,cause:gFt(d)});const N=d==null?void 0:d.error;return s===400?new HOe(s,N,y,S):s===401?new zOe(s,N,y,S):s===403?new UOe(s,N,y,S):s===404?new qOe(s,N,y,S):s===409?new WOe(s,N,y,S):s===422?new KOe(s,N,y,S):s===429?new YOe(s,N,y,S):s>=500?new GOe(s,N,y,S):new Mg(s,N,y,S)}}class A3 extends Mg{constructor({message:s}={}){super(void 0,void 0,s||"Request was aborted.",void 0)}}class n2t extends Mg{constructor({message:s,cause:d}){super(void 0,void 0,s||"Connection error.",void 0),d&&(this.cause=d)}}class m$t extends n2t{constructor({message:s}={}){super({message:s??"Request timed out."})}}class HOe extends Mg{}class zOe extends Mg{}class UOe extends Mg{}class qOe extends Mg{}class WOe extends Mg{}class KOe extends Mg{}class YOe extends Mg{}class GOe extends Mg{}class VOe extends ro{constructor(){super("Could not parse response content as the length limit was reached")}}class XOe extends ro{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class hQ extends Error{constructor(s){super(s)}}const LFn=/^[a-z][a-z0-9+.-]*:/i,MFn=o=>LFn.test(o);let X2=o=>(X2=Array.isArray,X2(o)),v9e=X2;function QOe(o){return typeof o!="object"?{}:o??{}}function PFn(o){if(!o)return!0;for(const s in o)return!1;return!0}function RFn(o,s){return Object.prototype.hasOwnProperty.call(o,s)}function eBt(o){return o!=null&&typeof o=="object"&&!Array.isArray(o)}const DFn=(o,s)=>{if(typeof s!="number"||!Number.isInteger(s))throw new ro(`${o} must be an integer`);if(s<0)throw new ro(`${o} must be a positive integer`);return s},BFn=o=>{try{return JSON.parse(o)}catch{return}},JQ=o=>new Promise(s=>setTimeout(s,o)),AF="6.15.0",FFn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function $Fn(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const jFn=()=>{var d;const o=$Fn();if(o==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":x9e(Deno.build.os),"X-Stainless-Arch":_9e(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:((d=Deno.version)==null?void 0:d.deno)??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(o==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":x9e(globalThis.process.platform??"unknown"),"X-Stainless-Arch":_9e(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const s=HFn();return s?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${s.browser}`,"X-Stainless-Runtime-Version":s.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function HFn(){if(typeof navigator>"u"||!navigator)return null;const o=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:s,pattern:d}of o){const y=d.exec(navigator.userAgent);if(y){const S=y[1]||0,N=y[2]||0,B=y[3]||0;return{browser:s,version:`${S}.${N}.${B}`}}}return null}const _9e=o=>o==="x32"?"x32":o==="x86_64"||o==="x64"?"x64":o==="arm"?"arm":o==="aarch64"||o==="arm64"?"arm64":o?`other:${o}`:"unknown",x9e=o=>(o=o.toLowerCase(),o.includes("ios")?"iOS":o==="android"?"Android":o==="darwin"?"MacOS":o==="win32"?"Windows":o==="freebsd"?"FreeBSD":o==="openbsd"?"OpenBSD":o==="linux"?"Linux":o?`Other:${o}`:"Unknown");let E9e;const zFn=()=>E9e??(E9e=jFn());function UFn(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function JOe(...o){const s=globalThis.ReadableStream;if(typeof s>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new s(...o)}function ZOe(o){let s=Symbol.asyncIterator in o?o[Symbol.asyncIterator]():o[Symbol.iterator]();return JOe({start(){},async pull(d){const{done:y,value:S}=await s.next();y?d.close():d.enqueue(S)},async cancel(){var d;await((d=s.return)==null?void 0:d.call(s))}})}function tNe(o){if(o[Symbol.asyncIterator])return o;const s=o.getReader();return{async next(){try{const d=await s.read();return d!=null&&d.done&&s.releaseLock(),d}catch(d){throw s.releaseLock(),d}},async return(){const d=s.cancel();return s.releaseLock(),await d,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function qFn(o){var y,S;if(o===null||typeof o!="object")return;if(o[Symbol.asyncIterator]){await((S=(y=o[Symbol.asyncIterator]()).return)==null?void 0:S.call(y));return}const s=o.getReader(),d=s.cancel();s.releaseLock(),await d}const WFn=({headers:o,body:s})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(s)}),eNe="RFC3986",nNe=o=>String(o),T9e={RFC1738:o=>String(o).replace(/%20/g,"+"),RFC3986:nNe},KFn="RFC1738";let bFt=(o,s)=>(bFt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),bFt(o,s));const b6=(()=>{const o=[];for(let s=0;s<256;++s)o.push("%"+((s<16?"0":"")+s.toString(16)).toUpperCase());return o})(),nBt=1024,YFn=(o,s,d,y,S)=>{if(o.length===0)return o;let N=o;if(typeof o=="symbol"?N=Symbol.prototype.toString.call(o):typeof o!="string"&&(N=String(o)),d==="iso-8859-1")return escape(N).replace(/%u[0-9a-f]{4}/gi,function(H){return"%26%23"+parseInt(H.slice(2),16)+"%3B"});let B="";for(let H=0;H<N.length;H+=nBt){const et=N.length>=nBt?N.slice(H,H+nBt):N,W=[];for(let nt=0;nt<et.length;++nt){let K=et.charCodeAt(nt);if(K===45||K===46||K===95||K===126||K>=48&&K<=57||K>=65&&K<=90||K>=97&&K<=122||S===KFn&&(K===40||K===41)){W[W.length]=et.charAt(nt);continue}if(K<128){W[W.length]=b6[K];continue}if(K<2048){W[W.length]=b6[192|K>>6]+b6[128|K&63];continue}if(K<55296||K>=57344){W[W.length]=b6[224|K>>12]+b6[128|K>>6&63]+b6[128|K&63];continue}nt+=1,K=65536+((K&1023)<<10|et.charCodeAt(nt)&1023),W[W.length]=b6[240|K>>18]+b6[128|K>>12&63]+b6[128|K>>6&63]+b6[128|K&63]}B+=W.join("")}return B};function GFn(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function k9e(o,s){if(X2(o)){const d=[];for(let y=0;y<o.length;y+=1)d.push(s(o[y]));return d}return s(o)}const rNe={brackets(o){return String(o)+"[]"},comma:"comma",indices(o,s){return String(o)+"["+s+"]"},repeat(o){return String(o)}},iNe=function(o,s){Array.prototype.push.apply(o,X2(s)?s:[s])};let C9e;const ep={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:YFn,encodeValuesOnly:!1,format:eNe,formatter:nNe,indices:!1,serializeDate(o){return(C9e??(C9e=Function.prototype.call.bind(Date.prototype.toISOString)))(o)},skipNulls:!1,strictNullHandling:!1};function VFn(o){return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}const rBt={};function aNe(o,s,d,y,S,N,B,H,et,W,nt,K,Q,at,mt,Lt,Pt,Mt){let ie=o,se=Mt,ve=0,gn=!1;for(;(se=se.get(rBt))!==void 0&&!gn;){const qn=se.get(o);if(ve+=1,typeof qn<"u"){if(qn===ve)throw new RangeError("Cyclic object value");gn=!0}typeof se.get(rBt)>"u"&&(ve=0)}if(typeof W=="function"?ie=W(s,ie):ie instanceof Date?ie=Q==null?void 0:Q(ie):d==="comma"&&X2(ie)&&(ie=k9e(ie,function(qn){return qn instanceof Date?Q==null?void 0:Q(qn):qn})),ie===null){if(N)return et&&!Lt?et(s,ep.encoder,Pt,"key",at):s;ie=""}if(VFn(ie)||GFn(ie)){if(et){const qn=Lt?s:et(s,ep.encoder,Pt,"key",at);return[(mt==null?void 0:mt(qn))+"="+(mt==null?void 0:mt(et(ie,ep.encoder,Pt,"value",at)))]}return[(mt==null?void 0:mt(s))+"="+(mt==null?void 0:mt(String(ie)))]}const fe=[];if(typeof ie>"u")return fe;let cn;if(d==="comma"&&X2(ie))Lt&&et&&(ie=k9e(ie,et)),cn=[{value:ie.length>0?ie.join(",")||null:void 0}];else if(X2(W))cn=W;else{const qn=Object.keys(ie);cn=nt?qn.sort(nt):qn}const sr=H?String(s).replace(/\./g,"%2E"):String(s),Fn=y&&X2(ie)&&ie.length===1?sr+"[]":sr;if(S&&X2(ie)&&ie.length===0)return Fn+"[]";for(let qn=0;qn<cn.length;++qn){const nr=cn[qn],hr=typeof nr=="object"&&typeof nr.value<"u"?nr.value:ie[nr];if(B&&hr===null)continue;const di=K&&H?nr.replace(/\./g,"%2E"):nr,gi=X2(ie)?typeof d=="function"?d(Fn,di):Fn:Fn+(K?"."+di:"["+di+"]");Mt.set(o,ve);const Ar=new WeakMap;Ar.set(rBt,Mt),iNe(fe,aNe(hr,gi,d,y,S,N,B,H,d==="comma"&&Lt&&X2(ie)?null:et,W,nt,K,Q,at,mt,Lt,Pt,Ar))}return fe}function XFn(o=ep){if(typeof o.allowEmptyArrays<"u"&&typeof o.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof o.encodeDotInKeys<"u"&&typeof o.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(o.encoder!==null&&typeof o.encoder<"u"&&typeof o.encoder!="function")throw new TypeError("Encoder has to be a function.");const s=o.charset||ep.charset;if(typeof o.charset<"u"&&o.charset!=="utf-8"&&o.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let d=eNe;if(typeof o.format<"u"){if(!bFt(T9e,o.format))throw new TypeError("Unknown format option provided.");d=o.format}const y=T9e[d];let S=ep.filter;(typeof o.filter=="function"||X2(o.filter))&&(S=o.filter);let N;if(o.arrayFormat&&o.arrayFormat in rNe?N=o.arrayFormat:"indices"in o?N=o.indices?"indices":"repeat":N=ep.arrayFormat,"commaRoundTrip"in o&&typeof o.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const B=typeof o.allowDots>"u"?o.encodeDotInKeys?!0:ep.allowDots:!!o.allowDots;return{addQueryPrefix:typeof o.addQueryPrefix=="boolean"?o.addQueryPrefix:ep.addQueryPrefix,allowDots:B,allowEmptyArrays:typeof o.allowEmptyArrays=="boolean"?!!o.allowEmptyArrays:ep.allowEmptyArrays,arrayFormat:N,charset:s,charsetSentinel:typeof o.charsetSentinel=="boolean"?o.charsetSentinel:ep.charsetSentinel,commaRoundTrip:!!o.commaRoundTrip,delimiter:typeof o.delimiter>"u"?ep.delimiter:o.delimiter,encode:typeof o.encode=="boolean"?o.encode:ep.encode,encodeDotInKeys:typeof o.encodeDotInKeys=="boolean"?o.encodeDotInKeys:ep.encodeDotInKeys,encoder:typeof o.encoder=="function"?o.encoder:ep.encoder,encodeValuesOnly:typeof o.encodeValuesOnly=="boolean"?o.encodeValuesOnly:ep.encodeValuesOnly,filter:S,format:d,formatter:y,serializeDate:typeof o.serializeDate=="function"?o.serializeDate:ep.serializeDate,skipNulls:typeof o.skipNulls=="boolean"?o.skipNulls:ep.skipNulls,sort:typeof o.sort=="function"?o.sort:null,strictNullHandling:typeof o.strictNullHandling=="boolean"?o.strictNullHandling:ep.strictNullHandling}}function QFn(o,s={}){let d=o;const y=XFn(s);let S,N;typeof y.filter=="function"?(N=y.filter,d=N("",d)):X2(y.filter)&&(N=y.filter,S=N);const B=[];if(typeof d!="object"||d===null)return"";const H=rNe[y.arrayFormat],et=H==="comma"&&y.commaRoundTrip;S||(S=Object.keys(d)),y.sort&&S.sort(y.sort);const W=new WeakMap;for(let Q=0;Q<S.length;++Q){const at=S[Q];y.skipNulls&&d[at]===null||iNe(B,aNe(d[at],at,H,et,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,W))}const nt=B.join(y.delimiter);let K=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?K+="utf8=%26%2310003%3B&":K+="utf8=%E2%9C%93&"),nt.length>0?K+nt:""}function JFn(o){let s=0;for(const S of o)s+=S.length;const d=new Uint8Array(s);let y=0;for(const S of o)d.set(S,y),y+=S.length;return d}let S9e;function y$t(o){let s;return(S9e??(s=new globalThis.TextEncoder,S9e=s.encode.bind(s)))(o)}let A9e;function I9e(o){let s;return(A9e??(s=new globalThis.TextDecoder,A9e=s.decode.bind(s)))(o)}var vw,_w;class r2t{constructor(){vw.set(this,void 0),_w.set(this,void 0),qo(this,vw,new Uint8Array),qo(this,_w,null)}decode(s){if(s==null)return[];const d=s instanceof ArrayBuffer?new Uint8Array(s):typeof s=="string"?y$t(s):s;qo(this,vw,JFn([lr(this,vw,"f"),d]));const y=[];let S;for(;(S=ZFn(lr(this,vw,"f"),lr(this,_w,"f")))!=null;){if(S.carriage&&lr(this,_w,"f")==null){qo(this,_w,S.index);continue}if(lr(this,_w,"f")!=null&&(S.index!==lr(this,_w,"f")+1||S.carriage)){y.push(I9e(lr(this,vw,"f").subarray(0,lr(this,_w,"f")-1))),qo(this,vw,lr(this,vw,"f").subarray(lr(this,_w,"f"))),qo(this,_w,null);continue}const N=lr(this,_w,"f")!==null?S.preceding-1:S.preceding,B=I9e(lr(this,vw,"f").subarray(0,N));y.push(B),qo(this,vw,lr(this,vw,"f").subarray(S.index)),qo(this,_w,null)}return y}flush(){return lr(this,vw,"f").length?this.decode(`
1892
+ a specific function to call, the others would be eliminated.`,validate:(()=>{const o=H=>Array.isArray(H.functions)&&H.functions.every(et=>typeof et=="object"&&et!==null&&s(et)),s=H=>typeof H.reason=="string"&&typeof H.name=="string",d=(H,et,W=!0)=>[(Array.isArray(H.functions)||B(W,{path:et+".functions",expected:"Array<___IChatFunctionReference>",value:H.functions}))&&H.functions.map((nt,K)=>(typeof nt=="object"&&nt!==null||B(W,{path:et+".functions["+K+"]",expected:"___IChatFunctionReference",value:nt}))&&y(nt,et+".functions["+K+"]",W)||B(W,{path:et+".functions["+K+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||B(W,{path:et+".functions",expected:"Array<___IChatFunctionReference>",value:H.functions})].every(nt=>nt),y=(H,et,W=!0)=>[typeof H.reason=="string"||B(W,{path:et+".reason",expected:"string",value:H.reason}),typeof H.name=="string"||B(W,{path:et+".name",expected:"string",value:H.name})].every(nt=>nt),S=H=>typeof H=="object"&&H!==null&&o(H);let N,B;return H=>{if(S(H)===!1){N=[],B=ZF(N),((W,nt,K=!0)=>(typeof W=="object"&&W!==null||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:W}))&&d(W,nt+"",!0)||B(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:W}))(H,"$input",!0);const et=N.length===0;return et?{success:et,data:H}:{success:et,errors:N,data:H}}return{success:!0,data:H}}})()}]};async function EFn(o){var y;if(o.operations.divided===void 0)return Ubt(o,o.operations.array,0);const s=o.operations.divided.map(()=>[]),d=[];if(await Promise.all(o.operations.divided.map(async(S,N)=>Ubt({...o,stack:s[N],dispatch:async B=>{d.push(B)}},S,0))),(((y=o.config)==null?void 0:y.eliticism)??fk.ELITICISM)===!0&&s.some(S=>S.length!==0))return Ubt(o,s.flat().map(S=>o.operations.group.get(S.operation.controller.name).get(S.operation.function.name)),0);{const S=d.filter(N=>N.type==="select");(S.length!==0?S:d).forEach(N=>{o.dispatch(N).catch(()=>{})})}}async function Ubt(o,s,d,y){var H;const S=TOe(1),B=await(async et=>S(et).catch(W=>{if(W instanceof zQ)return Symbol("emptyAssistantMessage");throw W}))(async et=>{var Q,at,mt,Lt,Pt;const W=await o.request("select",{messages:[{role:"system",content:JF.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(s.map(Mt=>({name:Mt.name,description:Mt.function.description,...Mt.protocol==="http"?{method:Mt.function.method,path:Mt.function.path,tags:Mt.function.tags}:{}})))},...o.histories.map(XF).flat(),{role:"user",content:o.prompt.contents.map(QF)},...et instanceof Tmt?[{role:"assistant",content:et.reasoning}]:[],{role:"system",content:((mt=(at=(Q=o.config)==null?void 0:Q.systemPrompt)==null?void 0:at.select)==null?void 0:mt.call(at,o.histories))??k6.SELECT},...TFn(y??[])],tools:[{type:"function",function:{name:tBt.functions[0].name,description:tBt.functions[0].description,parameters:tBt.functions[0].parameters}}],tool_choice:d===0?"auto":"required"}),nt=await t2t(W,Mt=>{const ie=HQ(Mt);o.dispatch(ie).catch(()=>{})},o.abortSignal);if(nt.choices.every(Mt=>Mt.message.tool_calls==null&&Mt.message.content==="")){const Mt=nt.choices.at(0);throw((Lt=Mt==null?void 0:Mt.message)==null?void 0:Lt.reasoning)!=null?new Tmt(((Pt=Mt==null?void 0:Mt.message)==null?void 0:Pt.reasoning)??""):new zQ}return nt});if(typeof B=="symbol"){const et=HQ({stream:d$t(""),done:()=>!0,get:()=>"",join:async()=>""});o.dispatch(et).catch(()=>{});return}if(d++<(((H=o.config)==null?void 0:H.retry)??fk.RETRY)){const et=[];for(const W of B.choices)for(const nt of W.message.tool_calls??[]){if(nt.type!=="function"||nt.function.name!=="selectFunctions")continue;const K=WF.parse(nt.function.arguments),Q=(()=>{const at=ve=>Array.isArray(ve.functions)&&ve.functions.every(gn=>typeof gn=="object"&&gn!==null&&mt(gn)),mt=ve=>typeof ve.reason=="string"&&typeof ve.name=="string",Lt=(ve,gn,fe=!0)=>[(Array.isArray(ve.functions)||se(fe,{path:gn+".functions",expected:"Array<___IChatFunctionReference>",value:ve.functions}))&&ve.functions.map((cn,sr)=>(typeof cn=="object"&&cn!==null||se(fe,{path:gn+".functions["+sr+"]",expected:"___IChatFunctionReference",value:cn}))&&Pt(cn,gn+".functions["+sr+"]",fe)||se(fe,{path:gn+".functions["+sr+"]",expected:"___IChatFunctionReference",value:cn})).every(cn=>cn)||se(fe,{path:gn+".functions",expected:"Array<___IChatFunctionReference>",value:ve.functions})].every(cn=>cn),Pt=(ve,gn,fe=!0)=>[typeof ve.reason=="string"||se(fe,{path:gn+".reason",expected:"string",value:ve.reason}),typeof ve.name=="string"||se(fe,{path:gn+".name",expected:"string",value:ve.name})].every(cn=>cn),Mt=ve=>typeof ve=="object"&&ve!==null&&at(ve);let ie,se;return ve=>{if(Mt(ve)===!1){ie=[],se=ZF(ie),((fe,cn,sr=!0)=>(typeof fe=="object"&&fe!==null||se(!0,{path:cn+"",expected:"__IChatFunctionReference.IProps",value:fe}))&&Lt(fe,cn+"",!0)||se(!0,{path:cn+"",expected:"__IChatFunctionReference.IProps",value:fe}))(ve,"$input",!0);const gn=ie.length===0;return gn?{success:gn,data:ve}:{success:gn,errors:ie,data:ve}}return{success:!0,data:ve}}})()(K);Q.success===!1&&et.push({id:nt.id,name:nt.function.name,validation:Q})}if(et.length>0)return Ubt(o,s,d,et)}for(const et of B.choices)if(et.message.tool_calls!=null)for(const W of et.message.tool_calls){if(W.type!=="function")continue;if(W.function.name!=="selectFunctions")continue;const nt=(()=>{const K=mt=>Array.isArray(mt.functions)&&mt.functions.every(Lt=>typeof Lt=="object"&&Lt!==null&&Q(Lt)),Q=mt=>typeof mt.reason=="string"&&typeof mt.name=="string",at=mt=>typeof mt=="object"&&mt!==null&&K(mt);return mt=>(mt=JSON.parse(mt),at(mt)?mt:null)})()(W.function.arguments);if(nt!==null)for(const K of nt.functions)xFn(o,K)}}function TFn(o){return o.map(s=>[{role:"assistant",tool_calls:[{type:"function",id:s.id,function:{name:s.name,arguments:JSON.stringify(s.validation.data)}}]},{role:"tool",content:JSON.stringify(s.validation.errors),tool_call_id:s.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
1893
+ `)}]).flat()}function kFn(o){return async s=>{if(s.ready()===!1){if((o==null?void 0:o.initialize)!==!0&&typeof(o==null?void 0:o.initialize)!="function")await s.initialize();else if(await(typeof(o==null?void 0:o.initialize)=="function"?o.initialize:_Fn)(s),s.ready()===!1)return}if(s.stack.length!==0&&await((o==null?void 0:o.cancel)??yFn)(s),await((o==null?void 0:o.select)??EFn)(s),s.stack.length!==0)for(;;){const d=await((o==null?void 0:o.call)??uFn)(s,s.stack.map(y=>y.operation));if((o==null?void 0:o.describe)!==null&&(o==null?void 0:o.describe)!==!1&&await(typeof(o==null?void 0:o.describe)=="function"?o.describe:vFn)(s,d),d.length===0||s.stack.length===0)break}}}function CFn(o){return o.history.type==="userMessage"?IFn({history:o.history}):o.history.type==="assistantMessage"?SFn({history:o.history}):o.history.type==="systemMessage"?AFn({history:o.history}):o.history.type==="select"?OFn({operations:o.operations,history:o.history}):o.history.type==="cancel"?NFn({operations:o.operations,history:o.history}):o.history.type==="execute"?$Oe({operations:o.operations,history:o.history}):LFn({operations:o.operations,history:o.history})}function SFn(o){return ZRn(o.history)}function AFn(o){return tDn(o.history)}function IFn(o){return vOe(o.history)}function OFn(o){return _Oe({id:o.history.id,created_at:o.history.created_at,selection:e2t({operation:b$t({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function NFn(o){return nDn({id:o.history.id,created_at:o.history.created_at,selection:e2t({operation:b$t({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function $Oe(o){return xOe({id:o.history.id,created_at:o.history.created_at,operation:b$t({operations:o.operations,input:o.history.operation}),arguments:o.history.arguments,value:o.history.value,success:o.history.success})}function LFn(o){return eDn({id:o.history.id,created_at:o.history.created_at,text:o.history.text,executes:o.history.executes.map(s=>$Oe({operations:o.operations,history:s}))})}function b$t(o){var d;const s=(d=o.operations.get(o.input.controller))==null?void 0:d.get(o.input.function);if(s===void 0)throw new Error(`No operation found: (controller: ${o.input.controller}, function: ${o.input.function})`);return s}function MFn(o){return async(s,d)=>{var Q;const y=hDn({source:s,body:{...d,model:o.vendor.model,stream:!0,stream_options:{include_usage:!0}},options:{...o.vendor.options,signal:o.abortSignal}});await o.dispatch(y);const S=((Q=o.config)==null?void 0:Q.backoffStrategy)??(at=>{throw at.error}),N=await(async()=>{let at=0;for(;;)try{return await o.vendor.api.chat.completions.create(y.body,y.options)}catch(mt){const Lt=S({count:at,error:mt});await new Promise(Pt=>setTimeout(Pt,Lt)),at++}})(),[B,H]=UQ.transform(N.toReadableStream(),at=>rL.transformCompletionChunk(at),o.abortSignal).tee(),[et,W]=H.tee();(async()=>{var mt;const at=et.getReader();for(;;){const Lt=await at.read();if(Lt.done||((mt=o.abortSignal)==null?void 0:mt.aborted)===!0)break;Lt.value.usage!=null&&yOe.aggregate({kind:s,completionUsage:Lt.value.usage,usage:o.usage})}})().catch(()=>{});const[nt,K]=B.tee();return o.dispatch({id:r5(),type:"response",request_id:y.id,source:s,stream:p$t(nt.getReader(),o.abortSignal),body:y.body,options:y.options,join:async()=>{const at=await UQ.readAll(K,o.abortSignal);return rL.merge(at)},created_at:new Date().toISOString()}).catch(()=>{}),W}}class kmt{constructor(s){var d,y;this.props=s,this.operations_=YRn.compose({controllers:s.controllers,config:s.config}),this.stack_=[],this.listeners_=new Map,this.histories_=(s.histories??[]).map(S=>CFn({operations:this.operations_.group,history:S})),this.executor_=typeof((d=s.config)==null?void 0:d.executor)=="function"?s.config.executor:kFn(((y=s.config)==null?void 0:y.executor)??null),this.semaphore_=s.vendor.semaphore!=null?typeof s.vendor.semaphore=="object"?s.vendor.semaphore:new BBt(s.vendor.semaphore):null,this.token_usage_=this.props.tokenUsage!==void 0?this.props.tokenUsage instanceof eL?this.props.tokenUsage:new eL(this.props.tokenUsage):eL.zero(),this.ready_=!1}clone(){var s;return new kmt({...this.props,histories:(s=this.props.histories)==null?void 0:s.slice()})}async conversate(s,d={}){const y=[],S=async H=>{try{await this.dispatch(H),"toHistory"in H&&("join"in H?y.push(async()=>(await H.join(),H.toHistory())):y.push(async()=>H.toHistory()))}catch{}},N=uDn({contents:Array.isArray(s)?s:typeof s=="string"?[{type:"text",text:s}]:[s]});S(N).catch(()=>{}),await this.executor_(this.getContext({dispatch:S,prompt:N.toHistory(),abortSignal:d.abortSignal,usage:this.token_usage_}));const B=await Promise.all(y.map(async H=>H()));return this.histories_.push(...B),B}getConfig(){return this.props.config}getVendor(){return this.props.vendor}getControllers(){return this.props.controllers}getOperations(){return this.operations_.array}getHistories(){return this.histories_}getTokenUsage(){return this.token_usage_}getContext(s){const d=MFn({vendor:this.props.vendor,config:this.props.config,dispatch:s.dispatch,abortSignal:s.abortSignal,usage:this.token_usage_});return{operations:this.operations_,config:this.props.config,histories:this.histories_,stack:this.stack_,ready:()=>this.ready_,prompt:s.prompt,abortSignal:s.abortSignal,dispatch:s.dispatch,request:this.semaphore_===null?d:async(y,S)=>{await this.semaphore_.acquire();try{return await d(y,S)}finally{this.semaphore_.release().catch(()=>{})}},initialize:async()=>{this.ready_=!0,s.dispatch(rDn()).catch(()=>{})}}}on(s,d){return wOe(this.listeners_,s,()=>new Set).add(d),this}off(s,d){const y=this.listeners_.get(s);return y!==void 0&&(y.delete(d),y.size===0&&this.listeners_.delete(s)),this}async dispatch(s){const d=this.listeners_.get(s.type);d!==void 0&&await Promise.all(Array.from(d).map(async y=>{try{await y(s)}catch{}}))}}function qo(o,s,d,y,S){if(typeof s=="function"?o!==s||!0:!s.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s.set(o,d),d}function lr(o,s,d,y){if(d==="a"&&!y)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?o!==s||!y:!s.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return d==="m"?y:d==="a"?y.call(o):y?y.value:s.get(o)}let jOe=function(){const{crypto:o}=globalThis;if(o!=null&&o.randomUUID)return jOe=o.randomUUID.bind(o),o.randomUUID();const s=new Uint8Array(1),d=o?()=>o.getRandomValues(s)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,y=>(+y^d()&15>>+y/4).toString(16))};function pFt(o){return typeof o=="object"&&o!==null&&("name"in o&&o.name==="AbortError"||"message"in o&&String(o.message).includes("FetchRequestCanceledException"))}const gFt=o=>{if(o instanceof Error)return o;if(typeof o=="object"&&o!==null){try{if(Object.prototype.toString.call(o)==="[object Error]"){const s=new Error(o.message,o.cause?{cause:o.cause}:{});return o.stack&&(s.stack=o.stack),o.cause&&!s.cause&&(s.cause=o.cause),o.name&&(s.name=o.name),s}}catch{}try{return new Error(JSON.stringify(o))}catch{}}return new Error(o)};class ro extends Error{}class Mg extends ro{constructor(s,d,y,S){super(`${Mg.makeMessage(s,d,y)}`),this.status=s,this.headers=S,this.requestID=S==null?void 0:S.get("x-request-id"),this.error=d;const N=d;this.code=N==null?void 0:N.code,this.param=N==null?void 0:N.param,this.type=N==null?void 0:N.type}static makeMessage(s,d,y){const S=d!=null&&d.message?typeof d.message=="string"?d.message:JSON.stringify(d.message):d?JSON.stringify(d):y;return s&&S?`${s} ${S}`:s?`${s} status code (no body)`:S||"(no status code or body)"}static generate(s,d,y,S){if(!s||!S)return new n2t({message:y,cause:gFt(d)});const N=d==null?void 0:d.error;return s===400?new HOe(s,N,y,S):s===401?new zOe(s,N,y,S):s===403?new UOe(s,N,y,S):s===404?new qOe(s,N,y,S):s===409?new WOe(s,N,y,S):s===422?new KOe(s,N,y,S):s===429?new YOe(s,N,y,S):s>=500?new GOe(s,N,y,S):new Mg(s,N,y,S)}}class A3 extends Mg{constructor({message:s}={}){super(void 0,void 0,s||"Request was aborted.",void 0)}}class n2t extends Mg{constructor({message:s,cause:d}){super(void 0,void 0,s||"Connection error.",void 0),d&&(this.cause=d)}}class m$t extends n2t{constructor({message:s}={}){super({message:s??"Request timed out."})}}class HOe extends Mg{}class zOe extends Mg{}class UOe extends Mg{}class qOe extends Mg{}class WOe extends Mg{}class KOe extends Mg{}class YOe extends Mg{}class GOe extends Mg{}class VOe extends ro{constructor(){super("Could not parse response content as the length limit was reached")}}class XOe extends ro{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class hQ extends Error{constructor(s){super(s)}}const PFn=/^[a-z][a-z0-9+.-]*:/i,RFn=o=>PFn.test(o);let X2=o=>(X2=Array.isArray,X2(o)),v9e=X2;function QOe(o){return typeof o!="object"?{}:o??{}}function DFn(o){if(!o)return!0;for(const s in o)return!1;return!0}function BFn(o,s){return Object.prototype.hasOwnProperty.call(o,s)}function eBt(o){return o!=null&&typeof o=="object"&&!Array.isArray(o)}const FFn=(o,s)=>{if(typeof s!="number"||!Number.isInteger(s))throw new ro(`${o} must be an integer`);if(s<0)throw new ro(`${o} must be a positive integer`);return s},$Fn=o=>{try{return JSON.parse(o)}catch{return}},JQ=o=>new Promise(s=>setTimeout(s,o)),AF="6.15.0",jFn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function HFn(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const zFn=()=>{var d;const o=HFn();if(o==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":x9e(Deno.build.os),"X-Stainless-Arch":_9e(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:((d=Deno.version)==null?void 0:d.deno)??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(o==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":x9e(globalThis.process.platform??"unknown"),"X-Stainless-Arch":_9e(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const s=UFn();return s?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${s.browser}`,"X-Stainless-Runtime-Version":s.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":AF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function UFn(){if(typeof navigator>"u"||!navigator)return null;const o=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:s,pattern:d}of o){const y=d.exec(navigator.userAgent);if(y){const S=y[1]||0,N=y[2]||0,B=y[3]||0;return{browser:s,version:`${S}.${N}.${B}`}}}return null}const _9e=o=>o==="x32"?"x32":o==="x86_64"||o==="x64"?"x64":o==="arm"?"arm":o==="aarch64"||o==="arm64"?"arm64":o?`other:${o}`:"unknown",x9e=o=>(o=o.toLowerCase(),o.includes("ios")?"iOS":o==="android"?"Android":o==="darwin"?"MacOS":o==="win32"?"Windows":o==="freebsd"?"FreeBSD":o==="openbsd"?"OpenBSD":o==="linux"?"Linux":o?`Other:${o}`:"Unknown");let E9e;const qFn=()=>E9e??(E9e=zFn());function WFn(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function JOe(...o){const s=globalThis.ReadableStream;if(typeof s>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new s(...o)}function ZOe(o){let s=Symbol.asyncIterator in o?o[Symbol.asyncIterator]():o[Symbol.iterator]();return JOe({start(){},async pull(d){const{done:y,value:S}=await s.next();y?d.close():d.enqueue(S)},async cancel(){var d;await((d=s.return)==null?void 0:d.call(s))}})}function tNe(o){if(o[Symbol.asyncIterator])return o;const s=o.getReader();return{async next(){try{const d=await s.read();return d!=null&&d.done&&s.releaseLock(),d}catch(d){throw s.releaseLock(),d}},async return(){const d=s.cancel();return s.releaseLock(),await d,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function KFn(o){var y,S;if(o===null||typeof o!="object")return;if(o[Symbol.asyncIterator]){await((S=(y=o[Symbol.asyncIterator]()).return)==null?void 0:S.call(y));return}const s=o.getReader(),d=s.cancel();s.releaseLock(),await d}const YFn=({headers:o,body:s})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(s)}),eNe="RFC3986",nNe=o=>String(o),T9e={RFC1738:o=>String(o).replace(/%20/g,"+"),RFC3986:nNe},GFn="RFC1738";let bFt=(o,s)=>(bFt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),bFt(o,s));const b6=(()=>{const o=[];for(let s=0;s<256;++s)o.push("%"+((s<16?"0":"")+s.toString(16)).toUpperCase());return o})(),nBt=1024,VFn=(o,s,d,y,S)=>{if(o.length===0)return o;let N=o;if(typeof o=="symbol"?N=Symbol.prototype.toString.call(o):typeof o!="string"&&(N=String(o)),d==="iso-8859-1")return escape(N).replace(/%u[0-9a-f]{4}/gi,function(H){return"%26%23"+parseInt(H.slice(2),16)+"%3B"});let B="";for(let H=0;H<N.length;H+=nBt){const et=N.length>=nBt?N.slice(H,H+nBt):N,W=[];for(let nt=0;nt<et.length;++nt){let K=et.charCodeAt(nt);if(K===45||K===46||K===95||K===126||K>=48&&K<=57||K>=65&&K<=90||K>=97&&K<=122||S===GFn&&(K===40||K===41)){W[W.length]=et.charAt(nt);continue}if(K<128){W[W.length]=b6[K];continue}if(K<2048){W[W.length]=b6[192|K>>6]+b6[128|K&63];continue}if(K<55296||K>=57344){W[W.length]=b6[224|K>>12]+b6[128|K>>6&63]+b6[128|K&63];continue}nt+=1,K=65536+((K&1023)<<10|et.charCodeAt(nt)&1023),W[W.length]=b6[240|K>>18]+b6[128|K>>12&63]+b6[128|K>>6&63]+b6[128|K&63]}B+=W.join("")}return B};function XFn(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function k9e(o,s){if(X2(o)){const d=[];for(let y=0;y<o.length;y+=1)d.push(s(o[y]));return d}return s(o)}const rNe={brackets(o){return String(o)+"[]"},comma:"comma",indices(o,s){return String(o)+"["+s+"]"},repeat(o){return String(o)}},iNe=function(o,s){Array.prototype.push.apply(o,X2(s)?s:[s])};let C9e;const ep={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:VFn,encodeValuesOnly:!1,format:eNe,formatter:nNe,indices:!1,serializeDate(o){return(C9e??(C9e=Function.prototype.call.bind(Date.prototype.toISOString)))(o)},skipNulls:!1,strictNullHandling:!1};function QFn(o){return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}const rBt={};function aNe(o,s,d,y,S,N,B,H,et,W,nt,K,Q,at,mt,Lt,Pt,Mt){let ie=o,se=Mt,ve=0,gn=!1;for(;(se=se.get(rBt))!==void 0&&!gn;){const qn=se.get(o);if(ve+=1,typeof qn<"u"){if(qn===ve)throw new RangeError("Cyclic object value");gn=!0}typeof se.get(rBt)>"u"&&(ve=0)}if(typeof W=="function"?ie=W(s,ie):ie instanceof Date?ie=Q==null?void 0:Q(ie):d==="comma"&&X2(ie)&&(ie=k9e(ie,function(qn){return qn instanceof Date?Q==null?void 0:Q(qn):qn})),ie===null){if(N)return et&&!Lt?et(s,ep.encoder,Pt,"key",at):s;ie=""}if(QFn(ie)||XFn(ie)){if(et){const qn=Lt?s:et(s,ep.encoder,Pt,"key",at);return[(mt==null?void 0:mt(qn))+"="+(mt==null?void 0:mt(et(ie,ep.encoder,Pt,"value",at)))]}return[(mt==null?void 0:mt(s))+"="+(mt==null?void 0:mt(String(ie)))]}const fe=[];if(typeof ie>"u")return fe;let cn;if(d==="comma"&&X2(ie))Lt&&et&&(ie=k9e(ie,et)),cn=[{value:ie.length>0?ie.join(",")||null:void 0}];else if(X2(W))cn=W;else{const qn=Object.keys(ie);cn=nt?qn.sort(nt):qn}const sr=H?String(s).replace(/\./g,"%2E"):String(s),Fn=y&&X2(ie)&&ie.length===1?sr+"[]":sr;if(S&&X2(ie)&&ie.length===0)return Fn+"[]";for(let qn=0;qn<cn.length;++qn){const nr=cn[qn],hr=typeof nr=="object"&&typeof nr.value<"u"?nr.value:ie[nr];if(B&&hr===null)continue;const di=K&&H?nr.replace(/\./g,"%2E"):nr,gi=X2(ie)?typeof d=="function"?d(Fn,di):Fn:Fn+(K?"."+di:"["+di+"]");Mt.set(o,ve);const Ar=new WeakMap;Ar.set(rBt,Mt),iNe(fe,aNe(hr,gi,d,y,S,N,B,H,d==="comma"&&Lt&&X2(ie)?null:et,W,nt,K,Q,at,mt,Lt,Pt,Ar))}return fe}function JFn(o=ep){if(typeof o.allowEmptyArrays<"u"&&typeof o.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof o.encodeDotInKeys<"u"&&typeof o.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(o.encoder!==null&&typeof o.encoder<"u"&&typeof o.encoder!="function")throw new TypeError("Encoder has to be a function.");const s=o.charset||ep.charset;if(typeof o.charset<"u"&&o.charset!=="utf-8"&&o.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let d=eNe;if(typeof o.format<"u"){if(!bFt(T9e,o.format))throw new TypeError("Unknown format option provided.");d=o.format}const y=T9e[d];let S=ep.filter;(typeof o.filter=="function"||X2(o.filter))&&(S=o.filter);let N;if(o.arrayFormat&&o.arrayFormat in rNe?N=o.arrayFormat:"indices"in o?N=o.indices?"indices":"repeat":N=ep.arrayFormat,"commaRoundTrip"in o&&typeof o.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const B=typeof o.allowDots>"u"?o.encodeDotInKeys?!0:ep.allowDots:!!o.allowDots;return{addQueryPrefix:typeof o.addQueryPrefix=="boolean"?o.addQueryPrefix:ep.addQueryPrefix,allowDots:B,allowEmptyArrays:typeof o.allowEmptyArrays=="boolean"?!!o.allowEmptyArrays:ep.allowEmptyArrays,arrayFormat:N,charset:s,charsetSentinel:typeof o.charsetSentinel=="boolean"?o.charsetSentinel:ep.charsetSentinel,commaRoundTrip:!!o.commaRoundTrip,delimiter:typeof o.delimiter>"u"?ep.delimiter:o.delimiter,encode:typeof o.encode=="boolean"?o.encode:ep.encode,encodeDotInKeys:typeof o.encodeDotInKeys=="boolean"?o.encodeDotInKeys:ep.encodeDotInKeys,encoder:typeof o.encoder=="function"?o.encoder:ep.encoder,encodeValuesOnly:typeof o.encodeValuesOnly=="boolean"?o.encodeValuesOnly:ep.encodeValuesOnly,filter:S,format:d,formatter:y,serializeDate:typeof o.serializeDate=="function"?o.serializeDate:ep.serializeDate,skipNulls:typeof o.skipNulls=="boolean"?o.skipNulls:ep.skipNulls,sort:typeof o.sort=="function"?o.sort:null,strictNullHandling:typeof o.strictNullHandling=="boolean"?o.strictNullHandling:ep.strictNullHandling}}function ZFn(o,s={}){let d=o;const y=JFn(s);let S,N;typeof y.filter=="function"?(N=y.filter,d=N("",d)):X2(y.filter)&&(N=y.filter,S=N);const B=[];if(typeof d!="object"||d===null)return"";const H=rNe[y.arrayFormat],et=H==="comma"&&y.commaRoundTrip;S||(S=Object.keys(d)),y.sort&&S.sort(y.sort);const W=new WeakMap;for(let Q=0;Q<S.length;++Q){const at=S[Q];y.skipNulls&&d[at]===null||iNe(B,aNe(d[at],at,H,et,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,W))}const nt=B.join(y.delimiter);let K=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?K+="utf8=%26%2310003%3B&":K+="utf8=%E2%9C%93&"),nt.length>0?K+nt:""}function t$n(o){let s=0;for(const S of o)s+=S.length;const d=new Uint8Array(s);let y=0;for(const S of o)d.set(S,y),y+=S.length;return d}let S9e;function y$t(o){let s;return(S9e??(s=new globalThis.TextEncoder,S9e=s.encode.bind(s)))(o)}let A9e;function I9e(o){let s;return(A9e??(s=new globalThis.TextDecoder,A9e=s.decode.bind(s)))(o)}var vw,_w;class r2t{constructor(){vw.set(this,void 0),_w.set(this,void 0),qo(this,vw,new Uint8Array),qo(this,_w,null)}decode(s){if(s==null)return[];const d=s instanceof ArrayBuffer?new Uint8Array(s):typeof s=="string"?y$t(s):s;qo(this,vw,t$n([lr(this,vw,"f"),d]));const y=[];let S;for(;(S=e$n(lr(this,vw,"f"),lr(this,_w,"f")))!=null;){if(S.carriage&&lr(this,_w,"f")==null){qo(this,_w,S.index);continue}if(lr(this,_w,"f")!=null&&(S.index!==lr(this,_w,"f")+1||S.carriage)){y.push(I9e(lr(this,vw,"f").subarray(0,lr(this,_w,"f")-1))),qo(this,vw,lr(this,vw,"f").subarray(lr(this,_w,"f"))),qo(this,_w,null);continue}const N=lr(this,_w,"f")!==null?S.preceding-1:S.preceding,B=I9e(lr(this,vw,"f").subarray(0,N));y.push(B),qo(this,vw,lr(this,vw,"f").subarray(S.index)),qo(this,_w,null)}return y}flush(){return lr(this,vw,"f").length?this.decode(`
1894
1894
  `):[]}}vw=new WeakMap,_w=new WeakMap;r2t.NEWLINE_CHARS=new Set([`
1895
- `,"\r"]);r2t.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function ZFn(o,s){for(let S=s??0;S<o.length;S++){if(o[S]===10)return{preceding:S,index:S+1,carriage:!1};if(o[S]===13)return{preceding:S,index:S+1,carriage:!0}}return null}function t$n(o){for(let y=0;y<o.length-1;y++){if(o[y]===10&&o[y+1]===10||o[y]===13&&o[y+1]===13)return y+2;if(o[y]===13&&o[y+1]===10&&y+3<o.length&&o[y+2]===13&&o[y+3]===10)return y+4}return-1}const Cmt={off:0,error:200,warn:300,info:400,debug:500},O9e=(o,s,d)=>{if(o){if(RFn(Cmt,o))return o;Ng(d).warn(`${s} was set to ${JSON.stringify(o)}, expected one of ${JSON.stringify(Object.keys(Cmt))}`)}};function fQ(){}function Cbt(o,s,d){return!s||Cmt[o]>Cmt[d]?fQ:s[o].bind(s)}const e$n={error:fQ,warn:fQ,info:fQ,debug:fQ};let N9e=new WeakMap;function Ng(o){const s=o.logger,d=o.logLevel??"off";if(!s)return e$n;const y=N9e.get(s);if(y&&y[0]===d)return y[1];const S={error:Cbt("error",s,d),warn:Cbt("warn",s,d),info:Cbt("info",s,d),debug:Cbt("debug",s,d)};return N9e.set(s,[d,S]),S}const YN=o=>(o.options&&(o.options={...o.options},delete o.options.headers),o.headers&&(o.headers=Object.fromEntries((o.headers instanceof Headers?[...o.headers]:Object.entries(o.headers)).map(([s,d])=>[s,s.toLowerCase()==="authorization"||s.toLowerCase()==="cookie"||s.toLowerCase()==="set-cookie"?"***":d]))),"retryOfRequestLogID"in o&&(o.retryOfRequestLogID&&(o.retryOf=o.retryOfRequestLogID),delete o.retryOfRequestLogID),o);var iQ;class E6{constructor(s,d,y){this.iterator=s,iQ.set(this,void 0),this.controller=d,qo(this,iQ,y)}static fromSSEResponse(s,d,y){let S=!1;const N=y?Ng(y):console;async function*B(){if(S)throw new ro("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");S=!0;let H=!1;try{for await(const et of n$n(s,d))if(!H){if(et.data.startsWith("[DONE]")){H=!0;continue}if(et.event===null||!et.event.startsWith("thread.")){let W;try{W=JSON.parse(et.data)}catch(nt){throw N.error("Could not parse message into JSON:",et.data),N.error("From chunk:",et.raw),nt}if(W&&W.error)throw new Mg(void 0,W.error,void 0,s.headers);yield W}else{let W;try{W=JSON.parse(et.data)}catch(nt){throw console.error("Could not parse message into JSON:",et.data),console.error("From chunk:",et.raw),nt}if(et.event=="error")throw new Mg(void 0,W.error,W.message,void 0);yield{event:et.event,data:W}}}H=!0}catch(et){if(pFt(et))return;throw et}finally{H||d.abort()}}return new E6(B,d,y)}static fromReadableStream(s,d,y){let S=!1;async function*N(){const H=new r2t,et=tNe(s);for await(const W of et)for(const nt of H.decode(W))yield nt;for(const W of H.flush())yield W}async function*B(){if(S)throw new ro("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");S=!0;let H=!1;try{for await(const et of N())H||et&&(yield JSON.parse(et));H=!0}catch(et){if(pFt(et))return;throw et}finally{H||d.abort()}}return new E6(B,d,y)}[(iQ=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const s=[],d=[],y=this.iterator(),S=N=>({next:()=>{if(N.length===0){const B=y.next();s.push(B),d.push(B)}return N.shift()}});return[new E6(()=>S(s),this.controller,lr(this,iQ,"f")),new E6(()=>S(d),this.controller,lr(this,iQ,"f"))]}toReadableStream(){const s=this;let d;return JOe({async start(){d=s[Symbol.asyncIterator]()},async pull(y){try{const{value:S,done:N}=await d.next();if(N)return y.close();const B=y$t(JSON.stringify(S)+`
1896
- `);y.enqueue(B)}catch(S){y.error(S)}},async cancel(){var y;await((y=d.return)==null?void 0:y.call(d))}})}}async function*n$n(o,s){if(!o.body)throw s.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new ro("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new ro("Attempted to iterate over a response with no body");const d=new i$n,y=new r2t,S=tNe(o.body);for await(const N of r$n(S))for(const B of y.decode(N)){const H=d.decode(B);H&&(yield H)}for(const N of y.flush()){const B=d.decode(N);B&&(yield B)}}async function*r$n(o){let s=new Uint8Array;for await(const d of o){if(d==null)continue;const y=d instanceof ArrayBuffer?new Uint8Array(d):typeof d=="string"?y$t(d):d;let S=new Uint8Array(s.length+y.length);S.set(s),S.set(y,s.length),s=S;let N;for(;(N=t$n(s))!==-1;)yield s.slice(0,N),s=s.slice(N)}s.length>0&&(yield s)}class i$n{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(s){if(s.endsWith("\r")&&(s=s.substring(0,s.length-1)),!s){if(!this.event&&!this.data.length)return null;const N={event:this.event,data:this.data.join(`
1897
- `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],N}if(this.chunks.push(s),s.startsWith(":"))return null;let[d,y,S]=a$n(s,":");return S.startsWith(" ")&&(S=S.substring(1)),d==="event"?this.event=S:d==="data"&&this.data.push(S),null}}function a$n(o,s){const d=o.indexOf(s);return d!==-1?[o.substring(0,d),s,o.substring(d+s.length)]:[o,"",""]}async function sNe(o,s){const{response:d,requestLogID:y,retryOfRequestLogID:S,startTime:N}=s,B=await(async()=>{var K;if(s.options.stream)return Ng(o).debug("response",d.status,d.url,d.headers,d.body),s.options.__streamClass?s.options.__streamClass.fromSSEResponse(d,s.controller,o):E6.fromSSEResponse(d,s.controller,o);if(d.status===204)return null;if(s.options.__binaryResponse)return d;const H=d.headers.get("content-type"),et=(K=H==null?void 0:H.split(";")[0])==null?void 0:K.trim();if((et==null?void 0:et.includes("application/json"))||(et==null?void 0:et.endsWith("+json"))){const Q=await d.json();return oNe(Q,d)}return await d.text()})();return Ng(o).debug(`[${y}] response parsed`,YN({retryOfRequestLogID:S,url:d.url,status:d.status,body:B,durationMs:Date.now()-N})),B}function oNe(o,s){return!o||typeof o!="object"||Array.isArray(o)?o:Object.defineProperty(o,"_request_id",{value:s.headers.get("x-request-id"),enumerable:!1})}var dQ;class i2t extends Promise{constructor(s,d,y=sNe){super(S=>{S(null)}),this.responsePromise=d,this.parseResponse=y,dQ.set(this,void 0),qo(this,dQ,s)}_thenUnwrap(s){return new i2t(lr(this,dQ,"f"),this.responsePromise,async(d,y)=>oNe(s(await this.parseResponse(d,y),y),y.response))}asResponse(){return this.responsePromise.then(s=>s.response)}async withResponse(){const[s,d]=await Promise.all([this.parse(),this.asResponse()]);return{data:s,response:d,request_id:d.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(s=>this.parseResponse(lr(this,dQ,"f"),s))),this.parsedPromise}then(s,d){return this.parse().then(s,d)}catch(s){return this.parse().catch(s)}finally(s){return this.parse().finally(s)}}dQ=new WeakMap;var Sbt;class w$t{constructor(s,d,y,S){Sbt.set(this,void 0),qo(this,Sbt,s),this.options=S,this.response=d,this.body=y}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const s=this.nextPageRequestOptions();if(!s)throw new ro("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await lr(this,Sbt,"f").requestAPIList(this.constructor,s)}async*iterPages(){let s=this;for(yield s;s.hasNextPage();)s=await s.getNextPage(),yield s}async*[(Sbt=new WeakMap,Symbol.asyncIterator)](){for await(const s of this.iterPages())for(const d of s.getPaginatedItems())yield d}}class s$n extends i2t{constructor(s,d,y){super(s,d,async(S,N)=>new y(S,N.response,await sNe(S,N),N.options))}async*[Symbol.asyncIterator](){const s=await this;for await(const d of s)yield d}}class a2t extends w$t{constructor(s,d,y,S){super(s,d,y,S),this.data=y.data||[],this.object=y.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class h0 extends w$t{constructor(s,d,y,S){super(s,d,y,S),this.data=y.data||[],this.has_more=y.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){var y;const s=this.getPaginatedItems(),d=(y=s[s.length-1])==null?void 0:y.id;return d?{...this.options,query:{...QOe(this.options.query),after:d}}:null}}class Smt extends w$t{constructor(s,d,y,S){super(s,d,y,S),this.data=y.data||[],this.has_more=y.has_more||!1,this.last_id=y.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const s=this.last_id;return s?{...this.options,query:{...QOe(this.options.query),after:s}}:null}}const cNe=()=>{var o;if(typeof File>"u"){const{process:s}=globalThis,d=typeof((o=s==null?void 0:s.versions)==null?void 0:o.node)=="string"&&parseInt(s.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(d?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function CQ(o,s,d){return cNe(),new File(o,s??"unknown_file",d)}function qbt(o){return(typeof o=="object"&&o!==null&&("name"in o&&o.name&&String(o.name)||"url"in o&&o.url&&String(o.url)||"filename"in o&&o.filename&&String(o.filename)||"path"in o&&o.path&&String(o.path))||"").split(/[\\/]/).pop()||void 0}const v$t=o=>o!=null&&typeof o=="object"&&typeof o[Symbol.asyncIterator]=="function",L9e=async(o,s)=>mFt(o.body)?{...o,body:await uNe(o.body,s)}:o,cL=async(o,s)=>({...o,body:await uNe(o.body,s)}),M9e=new WeakMap;function o$n(o){const s=typeof o=="function"?o:o.fetch,d=M9e.get(s);if(d)return d;const y=(async()=>{try{const S="Response"in s?s.Response:(await s("data:,")).constructor,N=new FormData;return N.toString()!==await new S(N).text()}catch{return!0}})();return M9e.set(s,y),y}const uNe=async(o,s)=>{if(!await o$n(s))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const d=new FormData;return await Promise.all(Object.entries(o||{}).map(([y,S])=>yFt(d,y,S))),d},lNe=o=>o instanceof Blob&&"name"in o,c$n=o=>typeof o=="object"&&o!==null&&(o instanceof Response||v$t(o)||lNe(o)),mFt=o=>{if(c$n(o))return!0;if(Array.isArray(o))return o.some(mFt);if(o&&typeof o=="object"){for(const s in o)if(mFt(o[s]))return!0}return!1},yFt=async(o,s,d)=>{if(d!==void 0){if(d==null)throw new TypeError(`Received null for "${s}"; to pass null in FormData, you must use the string 'null'`);if(typeof d=="string"||typeof d=="number"||typeof d=="boolean")o.append(s,String(d));else if(d instanceof Response)o.append(s,CQ([await d.blob()],qbt(d)));else if(v$t(d))o.append(s,CQ([await new Response(ZOe(d)).blob()],qbt(d)));else if(lNe(d))o.append(s,d,qbt(d));else if(Array.isArray(d))await Promise.all(d.map(y=>yFt(o,s+"[]",y)));else if(typeof d=="object")await Promise.all(Object.entries(d).map(([y,S])=>yFt(o,`${s}[${y}]`,S)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${d} instead`)}},hNe=o=>o!=null&&typeof o=="object"&&typeof o.size=="number"&&typeof o.type=="string"&&typeof o.text=="function"&&typeof o.slice=="function"&&typeof o.arrayBuffer=="function",u$n=o=>o!=null&&typeof o=="object"&&typeof o.name=="string"&&typeof o.lastModified=="number"&&hNe(o),l$n=o=>o!=null&&typeof o=="object"&&typeof o.url=="string"&&typeof o.blob=="function";async function h$n(o,s,d){if(cNe(),o=await o,u$n(o))return o instanceof File?o:CQ([await o.arrayBuffer()],o.name);if(l$n(o)){const S=await o.blob();return s||(s=new URL(o.url).pathname.split(/[\\/]/).pop()),CQ(await wFt(S),s,d)}const y=await wFt(o);if(s||(s=qbt(o)),!(d!=null&&d.type)){const S=y.find(N=>typeof N=="object"&&"type"in N&&N.type);typeof S=="string"&&(d={...d,type:S})}return CQ(y,s,d)}async function wFt(o){var d;let s=[];if(typeof o=="string"||ArrayBuffer.isView(o)||o instanceof ArrayBuffer)s.push(o);else if(hNe(o))s.push(o instanceof Blob?o:await o.arrayBuffer());else if(v$t(o))for await(const y of o)s.push(...await wFt(y));else{const y=(d=o==null?void 0:o.constructor)==null?void 0:d.name;throw new Error(`Unexpected data type: ${typeof o}${y?`; constructor: ${y}`:""}${f$n(o)}`)}return s}function f$n(o){return typeof o!="object"||o===null?"":`; props: [${Object.getOwnPropertyNames(o).map(d=>`"${d}"`).join(", ")}]`}class Fs{constructor(s){this._client=s}}function fNe(o){return o.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const P9e=Object.freeze(Object.create(null)),d$n=(o=fNe)=>function(d,...y){if(d.length===1)return d[0];let S=!1;const N=[],B=d.reduce((nt,K,Q)=>{var Lt;/[?#]/.test(K)&&(S=!0);const at=y[Q];let mt=(S?encodeURIComponent:o)(""+at);return Q!==y.length&&(at==null||typeof at=="object"&&at.toString===((Lt=Object.getPrototypeOf(Object.getPrototypeOf(at.hasOwnProperty??P9e)??P9e))==null?void 0:Lt.toString))&&(mt=at+"",N.push({start:nt.length+K.length,length:mt.length,error:`Value of type ${Object.prototype.toString.call(at).slice(8,-1)} is not a valid path parameter`})),nt+K+(Q===y.length?"":mt)},""),H=B.split(/[?#]/,1)[0],et=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let W;for(;(W=et.exec(H))!==null;)N.push({start:W.index,length:W[0].length,error:`Value "${W[0]}" can't be safely passed as a path parameter`});if(N.sort((nt,K)=>nt.start-K.start),N.length>0){let nt=0;const K=N.reduce((Q,at)=>{const mt=" ".repeat(at.start-nt),Lt="^".repeat(at.length);return nt=at.start+at.length,Q+mt+Lt},"");throw new ro(`Path parameters result in path with invalid segments:
1895
+ `,"\r"]);r2t.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function e$n(o,s){for(let S=s??0;S<o.length;S++){if(o[S]===10)return{preceding:S,index:S+1,carriage:!1};if(o[S]===13)return{preceding:S,index:S+1,carriage:!0}}return null}function n$n(o){for(let y=0;y<o.length-1;y++){if(o[y]===10&&o[y+1]===10||o[y]===13&&o[y+1]===13)return y+2;if(o[y]===13&&o[y+1]===10&&y+3<o.length&&o[y+2]===13&&o[y+3]===10)return y+4}return-1}const Cmt={off:0,error:200,warn:300,info:400,debug:500},O9e=(o,s,d)=>{if(o){if(BFn(Cmt,o))return o;Ng(d).warn(`${s} was set to ${JSON.stringify(o)}, expected one of ${JSON.stringify(Object.keys(Cmt))}`)}};function fQ(){}function Cbt(o,s,d){return!s||Cmt[o]>Cmt[d]?fQ:s[o].bind(s)}const r$n={error:fQ,warn:fQ,info:fQ,debug:fQ};let N9e=new WeakMap;function Ng(o){const s=o.logger,d=o.logLevel??"off";if(!s)return r$n;const y=N9e.get(s);if(y&&y[0]===d)return y[1];const S={error:Cbt("error",s,d),warn:Cbt("warn",s,d),info:Cbt("info",s,d),debug:Cbt("debug",s,d)};return N9e.set(s,[d,S]),S}const YN=o=>(o.options&&(o.options={...o.options},delete o.options.headers),o.headers&&(o.headers=Object.fromEntries((o.headers instanceof Headers?[...o.headers]:Object.entries(o.headers)).map(([s,d])=>[s,s.toLowerCase()==="authorization"||s.toLowerCase()==="cookie"||s.toLowerCase()==="set-cookie"?"***":d]))),"retryOfRequestLogID"in o&&(o.retryOfRequestLogID&&(o.retryOf=o.retryOfRequestLogID),delete o.retryOfRequestLogID),o);var iQ;class E6{constructor(s,d,y){this.iterator=s,iQ.set(this,void 0),this.controller=d,qo(this,iQ,y)}static fromSSEResponse(s,d,y){let S=!1;const N=y?Ng(y):console;async function*B(){if(S)throw new ro("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");S=!0;let H=!1;try{for await(const et of i$n(s,d))if(!H){if(et.data.startsWith("[DONE]")){H=!0;continue}if(et.event===null||!et.event.startsWith("thread.")){let W;try{W=JSON.parse(et.data)}catch(nt){throw N.error("Could not parse message into JSON:",et.data),N.error("From chunk:",et.raw),nt}if(W&&W.error)throw new Mg(void 0,W.error,void 0,s.headers);yield W}else{let W;try{W=JSON.parse(et.data)}catch(nt){throw console.error("Could not parse message into JSON:",et.data),console.error("From chunk:",et.raw),nt}if(et.event=="error")throw new Mg(void 0,W.error,W.message,void 0);yield{event:et.event,data:W}}}H=!0}catch(et){if(pFt(et))return;throw et}finally{H||d.abort()}}return new E6(B,d,y)}static fromReadableStream(s,d,y){let S=!1;async function*N(){const H=new r2t,et=tNe(s);for await(const W of et)for(const nt of H.decode(W))yield nt;for(const W of H.flush())yield W}async function*B(){if(S)throw new ro("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");S=!0;let H=!1;try{for await(const et of N())H||et&&(yield JSON.parse(et));H=!0}catch(et){if(pFt(et))return;throw et}finally{H||d.abort()}}return new E6(B,d,y)}[(iQ=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const s=[],d=[],y=this.iterator(),S=N=>({next:()=>{if(N.length===0){const B=y.next();s.push(B),d.push(B)}return N.shift()}});return[new E6(()=>S(s),this.controller,lr(this,iQ,"f")),new E6(()=>S(d),this.controller,lr(this,iQ,"f"))]}toReadableStream(){const s=this;let d;return JOe({async start(){d=s[Symbol.asyncIterator]()},async pull(y){try{const{value:S,done:N}=await d.next();if(N)return y.close();const B=y$t(JSON.stringify(S)+`
1896
+ `);y.enqueue(B)}catch(S){y.error(S)}},async cancel(){var y;await((y=d.return)==null?void 0:y.call(d))}})}}async function*i$n(o,s){if(!o.body)throw s.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new ro("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new ro("Attempted to iterate over a response with no body");const d=new s$n,y=new r2t,S=tNe(o.body);for await(const N of a$n(S))for(const B of y.decode(N)){const H=d.decode(B);H&&(yield H)}for(const N of y.flush()){const B=d.decode(N);B&&(yield B)}}async function*a$n(o){let s=new Uint8Array;for await(const d of o){if(d==null)continue;const y=d instanceof ArrayBuffer?new Uint8Array(d):typeof d=="string"?y$t(d):d;let S=new Uint8Array(s.length+y.length);S.set(s),S.set(y,s.length),s=S;let N;for(;(N=n$n(s))!==-1;)yield s.slice(0,N),s=s.slice(N)}s.length>0&&(yield s)}class s$n{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(s){if(s.endsWith("\r")&&(s=s.substring(0,s.length-1)),!s){if(!this.event&&!this.data.length)return null;const N={event:this.event,data:this.data.join(`
1897
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],N}if(this.chunks.push(s),s.startsWith(":"))return null;let[d,y,S]=o$n(s,":");return S.startsWith(" ")&&(S=S.substring(1)),d==="event"?this.event=S:d==="data"&&this.data.push(S),null}}function o$n(o,s){const d=o.indexOf(s);return d!==-1?[o.substring(0,d),s,o.substring(d+s.length)]:[o,"",""]}async function sNe(o,s){const{response:d,requestLogID:y,retryOfRequestLogID:S,startTime:N}=s,B=await(async()=>{var K;if(s.options.stream)return Ng(o).debug("response",d.status,d.url,d.headers,d.body),s.options.__streamClass?s.options.__streamClass.fromSSEResponse(d,s.controller,o):E6.fromSSEResponse(d,s.controller,o);if(d.status===204)return null;if(s.options.__binaryResponse)return d;const H=d.headers.get("content-type"),et=(K=H==null?void 0:H.split(";")[0])==null?void 0:K.trim();if((et==null?void 0:et.includes("application/json"))||(et==null?void 0:et.endsWith("+json"))){const Q=await d.json();return oNe(Q,d)}return await d.text()})();return Ng(o).debug(`[${y}] response parsed`,YN({retryOfRequestLogID:S,url:d.url,status:d.status,body:B,durationMs:Date.now()-N})),B}function oNe(o,s){return!o||typeof o!="object"||Array.isArray(o)?o:Object.defineProperty(o,"_request_id",{value:s.headers.get("x-request-id"),enumerable:!1})}var dQ;class i2t extends Promise{constructor(s,d,y=sNe){super(S=>{S(null)}),this.responsePromise=d,this.parseResponse=y,dQ.set(this,void 0),qo(this,dQ,s)}_thenUnwrap(s){return new i2t(lr(this,dQ,"f"),this.responsePromise,async(d,y)=>oNe(s(await this.parseResponse(d,y),y),y.response))}asResponse(){return this.responsePromise.then(s=>s.response)}async withResponse(){const[s,d]=await Promise.all([this.parse(),this.asResponse()]);return{data:s,response:d,request_id:d.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(s=>this.parseResponse(lr(this,dQ,"f"),s))),this.parsedPromise}then(s,d){return this.parse().then(s,d)}catch(s){return this.parse().catch(s)}finally(s){return this.parse().finally(s)}}dQ=new WeakMap;var Sbt;class w$t{constructor(s,d,y,S){Sbt.set(this,void 0),qo(this,Sbt,s),this.options=S,this.response=d,this.body=y}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const s=this.nextPageRequestOptions();if(!s)throw new ro("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await lr(this,Sbt,"f").requestAPIList(this.constructor,s)}async*iterPages(){let s=this;for(yield s;s.hasNextPage();)s=await s.getNextPage(),yield s}async*[(Sbt=new WeakMap,Symbol.asyncIterator)](){for await(const s of this.iterPages())for(const d of s.getPaginatedItems())yield d}}class c$n extends i2t{constructor(s,d,y){super(s,d,async(S,N)=>new y(S,N.response,await sNe(S,N),N.options))}async*[Symbol.asyncIterator](){const s=await this;for await(const d of s)yield d}}class a2t extends w$t{constructor(s,d,y,S){super(s,d,y,S),this.data=y.data||[],this.object=y.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class h0 extends w$t{constructor(s,d,y,S){super(s,d,y,S),this.data=y.data||[],this.has_more=y.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){var y;const s=this.getPaginatedItems(),d=(y=s[s.length-1])==null?void 0:y.id;return d?{...this.options,query:{...QOe(this.options.query),after:d}}:null}}class Smt extends w$t{constructor(s,d,y,S){super(s,d,y,S),this.data=y.data||[],this.has_more=y.has_more||!1,this.last_id=y.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const s=this.last_id;return s?{...this.options,query:{...QOe(this.options.query),after:s}}:null}}const cNe=()=>{var o;if(typeof File>"u"){const{process:s}=globalThis,d=typeof((o=s==null?void 0:s.versions)==null?void 0:o.node)=="string"&&parseInt(s.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(d?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function CQ(o,s,d){return cNe(),new File(o,s??"unknown_file",d)}function qbt(o){return(typeof o=="object"&&o!==null&&("name"in o&&o.name&&String(o.name)||"url"in o&&o.url&&String(o.url)||"filename"in o&&o.filename&&String(o.filename)||"path"in o&&o.path&&String(o.path))||"").split(/[\\/]/).pop()||void 0}const v$t=o=>o!=null&&typeof o=="object"&&typeof o[Symbol.asyncIterator]=="function",L9e=async(o,s)=>mFt(o.body)?{...o,body:await uNe(o.body,s)}:o,cL=async(o,s)=>({...o,body:await uNe(o.body,s)}),M9e=new WeakMap;function u$n(o){const s=typeof o=="function"?o:o.fetch,d=M9e.get(s);if(d)return d;const y=(async()=>{try{const S="Response"in s?s.Response:(await s("data:,")).constructor,N=new FormData;return N.toString()!==await new S(N).text()}catch{return!0}})();return M9e.set(s,y),y}const uNe=async(o,s)=>{if(!await u$n(s))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const d=new FormData;return await Promise.all(Object.entries(o||{}).map(([y,S])=>yFt(d,y,S))),d},lNe=o=>o instanceof Blob&&"name"in o,l$n=o=>typeof o=="object"&&o!==null&&(o instanceof Response||v$t(o)||lNe(o)),mFt=o=>{if(l$n(o))return!0;if(Array.isArray(o))return o.some(mFt);if(o&&typeof o=="object"){for(const s in o)if(mFt(o[s]))return!0}return!1},yFt=async(o,s,d)=>{if(d!==void 0){if(d==null)throw new TypeError(`Received null for "${s}"; to pass null in FormData, you must use the string 'null'`);if(typeof d=="string"||typeof d=="number"||typeof d=="boolean")o.append(s,String(d));else if(d instanceof Response)o.append(s,CQ([await d.blob()],qbt(d)));else if(v$t(d))o.append(s,CQ([await new Response(ZOe(d)).blob()],qbt(d)));else if(lNe(d))o.append(s,d,qbt(d));else if(Array.isArray(d))await Promise.all(d.map(y=>yFt(o,s+"[]",y)));else if(typeof d=="object")await Promise.all(Object.entries(d).map(([y,S])=>yFt(o,`${s}[${y}]`,S)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${d} instead`)}},hNe=o=>o!=null&&typeof o=="object"&&typeof o.size=="number"&&typeof o.type=="string"&&typeof o.text=="function"&&typeof o.slice=="function"&&typeof o.arrayBuffer=="function",h$n=o=>o!=null&&typeof o=="object"&&typeof o.name=="string"&&typeof o.lastModified=="number"&&hNe(o),f$n=o=>o!=null&&typeof o=="object"&&typeof o.url=="string"&&typeof o.blob=="function";async function d$n(o,s,d){if(cNe(),o=await o,h$n(o))return o instanceof File?o:CQ([await o.arrayBuffer()],o.name);if(f$n(o)){const S=await o.blob();return s||(s=new URL(o.url).pathname.split(/[\\/]/).pop()),CQ(await wFt(S),s,d)}const y=await wFt(o);if(s||(s=qbt(o)),!(d!=null&&d.type)){const S=y.find(N=>typeof N=="object"&&"type"in N&&N.type);typeof S=="string"&&(d={...d,type:S})}return CQ(y,s,d)}async function wFt(o){var d;let s=[];if(typeof o=="string"||ArrayBuffer.isView(o)||o instanceof ArrayBuffer)s.push(o);else if(hNe(o))s.push(o instanceof Blob?o:await o.arrayBuffer());else if(v$t(o))for await(const y of o)s.push(...await wFt(y));else{const y=(d=o==null?void 0:o.constructor)==null?void 0:d.name;throw new Error(`Unexpected data type: ${typeof o}${y?`; constructor: ${y}`:""}${p$n(o)}`)}return s}function p$n(o){return typeof o!="object"||o===null?"":`; props: [${Object.getOwnPropertyNames(o).map(d=>`"${d}"`).join(", ")}]`}class Fs{constructor(s){this._client=s}}function fNe(o){return o.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const P9e=Object.freeze(Object.create(null)),g$n=(o=fNe)=>function(d,...y){if(d.length===1)return d[0];let S=!1;const N=[],B=d.reduce((nt,K,Q)=>{var Lt;/[?#]/.test(K)&&(S=!0);const at=y[Q];let mt=(S?encodeURIComponent:o)(""+at);return Q!==y.length&&(at==null||typeof at=="object"&&at.toString===((Lt=Object.getPrototypeOf(Object.getPrototypeOf(at.hasOwnProperty??P9e)??P9e))==null?void 0:Lt.toString))&&(mt=at+"",N.push({start:nt.length+K.length,length:mt.length,error:`Value of type ${Object.prototype.toString.call(at).slice(8,-1)} is not a valid path parameter`})),nt+K+(Q===y.length?"":mt)},""),H=B.split(/[?#]/,1)[0],et=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let W;for(;(W=et.exec(H))!==null;)N.push({start:W.index,length:W[0].length,error:`Value "${W[0]}" can't be safely passed as a path parameter`});if(N.sort((nt,K)=>nt.start-K.start),N.length>0){let nt=0;const K=N.reduce((Q,at)=>{const mt=" ".repeat(at.start-nt),Lt="^".repeat(at.length);return nt=at.start+at.length,Q+mt+Lt},"");throw new ro(`Path parameters result in path with invalid segments:
1898
1898
  ${N.map(Q=>Q.error).join(`
1899
1899
  `)}
1900
1900
  ${B}
1901
- ${K}`)}return B},Ji=d$n(fNe);let dNe=class extends Fs{list(s,d={},y){return this._client.getAPIList(Ji`/chat/completions/${s}/messages`,h0,{query:d,...y})}};function Amt(o){return o!==void 0&&"function"in o&&o.function!==void 0}function _$t(o){return(o==null?void 0:o.$brand)==="auto-parseable-response-format"}function ZQ(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function p$n(o,s){return!s||!pNe(s)?{...o,choices:o.choices.map(d=>(gNe(d.message.tool_calls),{...d,message:{...d.message,parsed:null,...d.message.tool_calls?{tool_calls:d.message.tool_calls}:void 0}}))}:x$t(o,s)}function x$t(o,s){const d=o.choices.map(y=>{var S;if(y.finish_reason==="length")throw new VOe;if(y.finish_reason==="content_filter")throw new XOe;return gNe(y.message.tool_calls),{...y,message:{...y.message,...y.message.tool_calls?{tool_calls:((S=y.message.tool_calls)==null?void 0:S.map(N=>b$n(s,N)))??void 0}:void 0,parsed:y.message.content&&!y.message.refusal?g$n(s,y.message.content):null}}});return{...o,choices:d}}function g$n(o,s){var d,y;return((d=o.response_format)==null?void 0:d.type)!=="json_schema"?null:((y=o.response_format)==null?void 0:y.type)==="json_schema"?"$parseRaw"in o.response_format?o.response_format.$parseRaw(s):JSON.parse(s):null}function b$n(o,s){var y;const d=(y=o.tools)==null?void 0:y.find(S=>{var N;return Amt(S)&&((N=S.function)==null?void 0:N.name)===s.function.name});return{...s,function:{...s.function,parsed_arguments:ZQ(d)?d.$parseRaw(s.function.arguments):d!=null&&d.function.strict?JSON.parse(s.function.arguments):null}}}function m$n(o,s){var y;if(!o||!("tools"in o)||!o.tools)return!1;const d=(y=o.tools)==null?void 0:y.find(S=>{var N;return Amt(S)&&((N=S.function)==null?void 0:N.name)===s.function.name});return Amt(d)&&(ZQ(d)||(d==null?void 0:d.function.strict)||!1)}function pNe(o){var s;return _$t(o.response_format)?!0:((s=o.tools)==null?void 0:s.some(d=>ZQ(d)||d.type==="function"&&d.function.strict===!0))??!1}function gNe(o){for(const s of o||[])if(s.type!=="function")throw new ro(`Currently only \`function\` tool calls are supported; Received \`${s.type}\``)}function y$n(o){for(const s of o??[]){if(s.type!=="function")throw new ro(`Currently only \`function\` tool types support auto-parsing; Received \`${s.type}\``);if(s.function.strict!==!0)throw new ro(`The \`${s.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}const Imt=o=>(o==null?void 0:o.role)==="assistant",bNe=o=>(o==null?void 0:o.role)==="tool";var vFt,Wbt,Kbt,pQ,gQ,Ybt,bQ,ck,mQ,Omt,Nmt,IF,mNe;class E$t{constructor(){vFt.add(this),this.controller=new AbortController,Wbt.set(this,void 0),Kbt.set(this,()=>{}),pQ.set(this,()=>{}),gQ.set(this,void 0),Ybt.set(this,()=>{}),bQ.set(this,()=>{}),ck.set(this,{}),mQ.set(this,!1),Omt.set(this,!1),Nmt.set(this,!1),IF.set(this,!1),qo(this,Wbt,new Promise((s,d)=>{qo(this,Kbt,s,"f"),qo(this,pQ,d,"f")})),qo(this,gQ,new Promise((s,d)=>{qo(this,Ybt,s,"f"),qo(this,bQ,d,"f")})),lr(this,Wbt,"f").catch(()=>{}),lr(this,gQ,"f").catch(()=>{})}_run(s){setTimeout(()=>{s().then(()=>{this._emitFinal(),this._emit("end")},lr(this,vFt,"m",mNe).bind(this))},0)}_connected(){this.ended||(lr(this,Kbt,"f").call(this),this._emit("connect"))}get ended(){return lr(this,mQ,"f")}get errored(){return lr(this,Omt,"f")}get aborted(){return lr(this,Nmt,"f")}abort(){this.controller.abort()}on(s,d){return(lr(this,ck,"f")[s]||(lr(this,ck,"f")[s]=[])).push({listener:d}),this}off(s,d){const y=lr(this,ck,"f")[s];if(!y)return this;const S=y.findIndex(N=>N.listener===d);return S>=0&&y.splice(S,1),this}once(s,d){return(lr(this,ck,"f")[s]||(lr(this,ck,"f")[s]=[])).push({listener:d,once:!0}),this}emitted(s){return new Promise((d,y)=>{qo(this,IF,!0),s!=="error"&&this.once("error",y),this.once(s,d)})}async done(){qo(this,IF,!0),await lr(this,gQ,"f")}_emit(s,...d){if(lr(this,mQ,"f"))return;s==="end"&&(qo(this,mQ,!0),lr(this,Ybt,"f").call(this));const y=lr(this,ck,"f")[s];if(y&&(lr(this,ck,"f")[s]=y.filter(S=>!S.once),y.forEach(({listener:S})=>S(...d))),s==="abort"){const S=d[0];!lr(this,IF,"f")&&!(y!=null&&y.length)&&Promise.reject(S),lr(this,pQ,"f").call(this,S),lr(this,bQ,"f").call(this,S),this._emit("end");return}if(s==="error"){const S=d[0];!lr(this,IF,"f")&&!(y!=null&&y.length)&&Promise.reject(S),lr(this,pQ,"f").call(this,S),lr(this,bQ,"f").call(this,S),this._emit("end")}}_emitFinal(){}}Wbt=new WeakMap,Kbt=new WeakMap,pQ=new WeakMap,gQ=new WeakMap,Ybt=new WeakMap,bQ=new WeakMap,ck=new WeakMap,mQ=new WeakMap,Omt=new WeakMap,Nmt=new WeakMap,IF=new WeakMap,vFt=new WeakSet,mNe=function(s){if(qo(this,Omt,!0),s instanceof Error&&s.name==="AbortError"&&(s=new A3),s instanceof A3)return qo(this,Nmt,!0),this._emit("abort",s);if(s instanceof ro)return this._emit("error",s);if(s instanceof Error){const d=new ro(s.message);return d.cause=s,this._emit("error",d)}return this._emit("error",new ro(String(s)))};function w$n(o){return typeof o.parse=="function"}var km,_Ft,Lmt,xFt,EFt,TFt,yNe,wNe;const v$n=10;class vNe extends E$t{constructor(){super(...arguments),km.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(s){var y;this._chatCompletions.push(s),this._emit("chatCompletion",s);const d=(y=s.choices[0])==null?void 0:y.message;return d&&this._addMessage(d),s}_addMessage(s,d=!0){if("content"in s||(s.content=null),this.messages.push(s),d){if(this._emit("message",s),bNe(s)&&s.content)this._emit("functionToolCallResult",s.content);else if(Imt(s)&&s.tool_calls)for(const y of s.tool_calls)y.type==="function"&&this._emit("functionToolCall",y.function)}}async finalChatCompletion(){await this.done();const s=this._chatCompletions[this._chatCompletions.length-1];if(!s)throw new ro("stream ended without producing a ChatCompletion");return s}async finalContent(){return await this.done(),lr(this,km,"m",_Ft).call(this)}async finalMessage(){return await this.done(),lr(this,km,"m",Lmt).call(this)}async finalFunctionToolCall(){return await this.done(),lr(this,km,"m",xFt).call(this)}async finalFunctionToolCallResult(){return await this.done(),lr(this,km,"m",EFt).call(this)}async totalUsage(){return await this.done(),lr(this,km,"m",TFt).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const s=this._chatCompletions[this._chatCompletions.length-1];s&&this._emit("finalChatCompletion",s);const d=lr(this,km,"m",Lmt).call(this);d&&this._emit("finalMessage",d);const y=lr(this,km,"m",_Ft).call(this);y&&this._emit("finalContent",y);const S=lr(this,km,"m",xFt).call(this);S&&this._emit("finalFunctionToolCall",S);const N=lr(this,km,"m",EFt).call(this);N!=null&&this._emit("finalFunctionToolCallResult",N),this._chatCompletions.some(B=>B.usage)&&this._emit("totalUsage",lr(this,km,"m",TFt).call(this))}async _createChatCompletion(s,d,y){const S=y==null?void 0:y.signal;S&&(S.aborted&&this.controller.abort(),S.addEventListener("abort",()=>this.controller.abort())),lr(this,km,"m",yNe).call(this,d);const N=await s.chat.completions.create({...d,stream:!1},{...y,signal:this.controller.signal});return this._connected(),this._addChatCompletion(x$t(N,d))}async _runChatCompletion(s,d,y){for(const S of d.messages)this._addMessage(S,!1);return await this._createChatCompletion(s,d,y)}async _runTools(s,d,y){var at,mt,Lt;const S="tool",{tool_choice:N="auto",stream:B,...H}=d,et=typeof N!="string"&&N.type==="function"&&((at=N==null?void 0:N.function)==null?void 0:at.name),{maxChatCompletions:W=v$n}=y||{},nt=d.tools.map(Pt=>{if(ZQ(Pt)){if(!Pt.$callback)throw new ro("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:Pt.$callback,name:Pt.function.name,description:Pt.function.description||"",parameters:Pt.function.parameters,parse:Pt.$parseRaw,strict:!0}}}return Pt}),K={};for(const Pt of nt)Pt.type==="function"&&(K[Pt.function.name||Pt.function.function.name]=Pt.function);const Q="tools"in d?nt.map(Pt=>Pt.type==="function"?{type:"function",function:{name:Pt.function.name||Pt.function.function.name,parameters:Pt.function.parameters,description:Pt.function.description,strict:Pt.function.strict}}:Pt):void 0;for(const Pt of d.messages)this._addMessage(Pt,!1);for(let Pt=0;Pt<W;++Pt){const ie=(mt=(await this._createChatCompletion(s,{...H,tool_choice:N,tools:Q,messages:[...this.messages]},y)).choices[0])==null?void 0:mt.message;if(!ie)throw new ro("missing message in ChatCompletion response");if(!((Lt=ie.tool_calls)!=null&&Lt.length))return;for(const se of ie.tool_calls){if(se.type!=="function")continue;const ve=se.id,{name:gn,arguments:fe}=se.function,cn=K[gn];if(cn){if(et&&et!==gn){const nr=`Invalid tool_call: ${JSON.stringify(gn)}. ${JSON.stringify(et)} requested. Please try again`;this._addMessage({role:S,tool_call_id:ve,content:nr});continue}}else{const nr=`Invalid tool_call: ${JSON.stringify(gn)}. Available options are: ${Object.keys(K).map(hr=>JSON.stringify(hr)).join(", ")}. Please try again`;this._addMessage({role:S,tool_call_id:ve,content:nr});continue}let sr;try{sr=w$n(cn)?await cn.parse(fe):fe}catch(nr){const hr=nr instanceof Error?nr.message:String(nr);this._addMessage({role:S,tool_call_id:ve,content:hr});continue}const Fn=await cn.function(sr,this),qn=lr(this,km,"m",wNe).call(this,Fn);if(this._addMessage({role:S,tool_call_id:ve,content:qn}),et)return}}}}km=new WeakSet,_Ft=function(){return lr(this,km,"m",Lmt).call(this).content??null},Lmt=function(){let s=this.messages.length;for(;s-- >0;){const d=this.messages[s];if(Imt(d))return{...d,content:d.content??null,refusal:d.refusal??null}}throw new ro("stream ended without producing a ChatCompletionMessage with role=assistant")},xFt=function(){var s,d;for(let y=this.messages.length-1;y>=0;y--){const S=this.messages[y];if(Imt(S)&&((s=S==null?void 0:S.tool_calls)!=null&&s.length))return(d=S.tool_calls.filter(N=>N.type==="function").at(-1))==null?void 0:d.function}},EFt=function(){for(let s=this.messages.length-1;s>=0;s--){const d=this.messages[s];if(bNe(d)&&d.content!=null&&typeof d.content=="string"&&this.messages.some(y=>{var S;return y.role==="assistant"&&((S=y.tool_calls)==null?void 0:S.some(N=>N.type==="function"&&N.id===d.tool_call_id))}))return d.content}},TFt=function(){const s={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:d}of this._chatCompletions)d&&(s.completion_tokens+=d.completion_tokens,s.prompt_tokens+=d.prompt_tokens,s.total_tokens+=d.total_tokens);return s},yNe=function(s){if(s.n!=null&&s.n>1)throw new ro("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},wNe=function(s){return typeof s=="string"?s:s===void 0?"undefined":JSON.stringify(s)};class T$t extends vNe{static runTools(s,d,y){const S=new T$t,N={...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"runTools"}};return S._run(()=>S._runTools(s,d,N)),S}_addMessage(s,d=!0){super._addMessage(s,d),Imt(s)&&s.content&&this._emit("content",s.content)}}const _Ne=1,xNe=2,ENe=4,TNe=8,kNe=16,CNe=32,SNe=64,ANe=128,INe=256,ONe=ANe|INe,NNe=kNe|CNe|ONe|SNe,LNe=_Ne|xNe|NNe,MNe=ENe|TNe,_$n=LNe|MNe,qp={STR:_Ne,NUM:xNe,ARR:ENe,OBJ:TNe,NULL:kNe,BOOL:CNe,NAN:SNe,INFINITY:ANe,MINUS_INFINITY:INe,INF:ONe,SPECIAL:NNe,ATOM:LNe,COLLECTION:MNe,ALL:_$n};class x$n extends Error{}class E$n extends Error{}function T$n(o,s=qp.ALL){if(typeof o!="string")throw new TypeError(`expecting str, got ${typeof o}`);if(!o.trim())throw new Error(`${o} is empty`);return k$n(o.trim(),s)}const k$n=(o,s)=>{const d=o.length;let y=0;const S=Q=>{throw new x$n(`${Q} at position ${y}`)},N=Q=>{throw new E$n(`${Q} at position ${y}`)},B=()=>(K(),y>=d&&S("Unexpected end of input"),o[y]==='"'?H():o[y]==="{"?et():o[y]==="["?W():o.substring(y,y+4)==="null"||qp.NULL&s&&d-y<4&&"null".startsWith(o.substring(y))?(y+=4,null):o.substring(y,y+4)==="true"||qp.BOOL&s&&d-y<4&&"true".startsWith(o.substring(y))?(y+=4,!0):o.substring(y,y+5)==="false"||qp.BOOL&s&&d-y<5&&"false".startsWith(o.substring(y))?(y+=5,!1):o.substring(y,y+8)==="Infinity"||qp.INFINITY&s&&d-y<8&&"Infinity".startsWith(o.substring(y))?(y+=8,1/0):o.substring(y,y+9)==="-Infinity"||qp.MINUS_INFINITY&s&&1<d-y&&d-y<9&&"-Infinity".startsWith(o.substring(y))?(y+=9,-1/0):o.substring(y,y+3)==="NaN"||qp.NAN&s&&d-y<3&&"NaN".startsWith(o.substring(y))?(y+=3,NaN):nt()),H=()=>{const Q=y;let at=!1;for(y++;y<d&&(o[y]!=='"'||at&&o[y-1]==="\\");)at=o[y]==="\\"?!at:!1,y++;if(o.charAt(y)=='"')try{return JSON.parse(o.substring(Q,++y-Number(at)))}catch(mt){N(String(mt))}else if(qp.STR&s)try{return JSON.parse(o.substring(Q,y-Number(at))+'"')}catch{return JSON.parse(o.substring(Q,o.lastIndexOf("\\"))+'"')}S("Unterminated string literal")},et=()=>{y++,K();const Q={};try{for(;o[y]!=="}";){if(K(),y>=d&&qp.OBJ&s)return Q;const at=H();K(),y++;try{const mt=B();Object.defineProperty(Q,at,{value:mt,writable:!0,enumerable:!0,configurable:!0})}catch(mt){if(qp.OBJ&s)return Q;throw mt}K(),o[y]===","&&y++}}catch{if(qp.OBJ&s)return Q;S("Expected '}' at end of object")}return y++,Q},W=()=>{y++;const Q=[];try{for(;o[y]!=="]";)Q.push(B()),K(),o[y]===","&&y++}catch{if(qp.ARR&s)return Q;S("Expected ']' at end of array")}return y++,Q},nt=()=>{if(y===0){o==="-"&&qp.NUM&s&&S("Not sure what '-' is");try{return JSON.parse(o)}catch(at){if(qp.NUM&s)try{return o[o.length-1]==="."?JSON.parse(o.substring(0,o.lastIndexOf("."))):JSON.parse(o.substring(0,o.lastIndexOf("e")))}catch{}N(String(at))}}const Q=y;for(o[y]==="-"&&y++;o[y]&&!",]}".includes(o[y]);)y++;y==d&&!(qp.NUM&s)&&S("Unterminated number literal");try{return JSON.parse(o.substring(Q,y))}catch{o.substring(Q,y)==="-"&&qp.NUM&s&&S("Not sure what '-' is");try{return JSON.parse(o.substring(Q,o.lastIndexOf("e")))}catch(mt){N(String(mt))}}},K=()=>{for(;y<d&&`
1902
- \r `.includes(o[y]);)y++};return B()},R9e=o=>T$n(o,qp.ALL^qp.NUM);var tp,ok,_F,VS,iBt,Abt,aBt,sBt,oBt,Ibt,cBt,D9e;class qQ extends vNe{constructor(s){super(),tp.add(this),ok.set(this,void 0),_F.set(this,void 0),VS.set(this,void 0),qo(this,ok,s),qo(this,_F,[])}get currentChatCompletionSnapshot(){return lr(this,VS,"f")}static fromReadableStream(s){const d=new qQ(null);return d._run(()=>d._fromReadableStream(s)),d}static createChatCompletion(s,d,y){const S=new qQ(d);return S._run(()=>S._runChatCompletion(s,{...d,stream:!0},{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),S}async _createChatCompletion(s,d,y){var B;super._createChatCompletion;const S=y==null?void 0:y.signal;S&&(S.aborted&&this.controller.abort(),S.addEventListener("abort",()=>this.controller.abort())),lr(this,tp,"m",iBt).call(this);const N=await s.chat.completions.create({...d,stream:!0},{...y,signal:this.controller.signal});this._connected();for await(const H of N)lr(this,tp,"m",aBt).call(this,H);if((B=N.controller.signal)!=null&&B.aborted)throw new A3;return this._addChatCompletion(lr(this,tp,"m",Ibt).call(this))}async _fromReadableStream(s,d){var B;const y=d==null?void 0:d.signal;y&&(y.aborted&&this.controller.abort(),y.addEventListener("abort",()=>this.controller.abort())),lr(this,tp,"m",iBt).call(this),this._connected();const S=E6.fromReadableStream(s,this.controller);let N;for await(const H of S)N&&N!==H.id&&this._addChatCompletion(lr(this,tp,"m",Ibt).call(this)),lr(this,tp,"m",aBt).call(this,H),N=H.id;if((B=S.controller.signal)!=null&&B.aborted)throw new A3;return this._addChatCompletion(lr(this,tp,"m",Ibt).call(this))}[(ok=new WeakMap,_F=new WeakMap,VS=new WeakMap,tp=new WeakSet,iBt=function(){this.ended||qo(this,VS,void 0)},Abt=function(d){let y=lr(this,_F,"f")[d.index];return y||(y={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},lr(this,_F,"f")[d.index]=y,y)},aBt=function(d){var S,N,B,H,et,W,nt,K,Q,at,mt,Lt,Pt,Mt,ie;if(this.ended)return;const y=lr(this,tp,"m",D9e).call(this,d);this._emit("chunk",d,y);for(const se of d.choices){const ve=y.choices[se.index];se.delta.content!=null&&((S=ve.message)==null?void 0:S.role)==="assistant"&&((N=ve.message)!=null&&N.content)&&(this._emit("content",se.delta.content,ve.message.content),this._emit("content.delta",{delta:se.delta.content,snapshot:ve.message.content,parsed:ve.message.parsed})),se.delta.refusal!=null&&((B=ve.message)==null?void 0:B.role)==="assistant"&&((H=ve.message)!=null&&H.refusal)&&this._emit("refusal.delta",{delta:se.delta.refusal,snapshot:ve.message.refusal}),((et=se.logprobs)==null?void 0:et.content)!=null&&((W=ve.message)==null?void 0:W.role)==="assistant"&&this._emit("logprobs.content.delta",{content:(nt=se.logprobs)==null?void 0:nt.content,snapshot:((K=ve.logprobs)==null?void 0:K.content)??[]}),((Q=se.logprobs)==null?void 0:Q.refusal)!=null&&((at=ve.message)==null?void 0:at.role)==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:(mt=se.logprobs)==null?void 0:mt.refusal,snapshot:((Lt=ve.logprobs)==null?void 0:Lt.refusal)??[]});const gn=lr(this,tp,"m",Abt).call(this,ve);ve.finish_reason&&(lr(this,tp,"m",oBt).call(this,ve),gn.current_tool_call_index!=null&&lr(this,tp,"m",sBt).call(this,ve,gn.current_tool_call_index));for(const fe of se.delta.tool_calls??[])gn.current_tool_call_index!==fe.index&&(lr(this,tp,"m",oBt).call(this,ve),gn.current_tool_call_index!=null&&lr(this,tp,"m",sBt).call(this,ve,gn.current_tool_call_index)),gn.current_tool_call_index=fe.index;for(const fe of se.delta.tool_calls??[]){const cn=(Pt=ve.message.tool_calls)==null?void 0:Pt[fe.index];cn!=null&&cn.type&&((cn==null?void 0:cn.type)==="function"?this._emit("tool_calls.function.arguments.delta",{name:(Mt=cn.function)==null?void 0:Mt.name,index:fe.index,arguments:cn.function.arguments,parsed_arguments:cn.function.parsed_arguments,arguments_delta:((ie=fe.function)==null?void 0:ie.arguments)??""}):(cn==null||cn.type,void 0))}}},sBt=function(d,y){var B,H,et;if(lr(this,tp,"m",Abt).call(this,d).done_tool_calls.has(y))return;const N=(B=d.message.tool_calls)==null?void 0:B[y];if(!N)throw new Error("no tool call snapshot");if(!N.type)throw new Error("tool call snapshot missing `type`");if(N.type==="function"){const W=(et=(H=lr(this,ok,"f"))==null?void 0:H.tools)==null?void 0:et.find(nt=>Amt(nt)&&nt.function.name===N.function.name);this._emit("tool_calls.function.arguments.done",{name:N.function.name,index:y,arguments:N.function.arguments,parsed_arguments:ZQ(W)?W.$parseRaw(N.function.arguments):W!=null&&W.function.strict?JSON.parse(N.function.arguments):null})}else N.type},oBt=function(d){var S,N;const y=lr(this,tp,"m",Abt).call(this,d);if(d.message.content&&!y.content_done){y.content_done=!0;const B=lr(this,tp,"m",cBt).call(this);this._emit("content.done",{content:d.message.content,parsed:B?B.$parseRaw(d.message.content):null})}d.message.refusal&&!y.refusal_done&&(y.refusal_done=!0,this._emit("refusal.done",{refusal:d.message.refusal})),(S=d.logprobs)!=null&&S.content&&!y.logprobs_content_done&&(y.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:d.logprobs.content})),(N=d.logprobs)!=null&&N.refusal&&!y.logprobs_refusal_done&&(y.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:d.logprobs.refusal}))},Ibt=function(){if(this.ended)throw new ro("stream has ended, this shouldn't happen");const d=lr(this,VS,"f");if(!d)throw new ro("request ended without sending any chunks");return qo(this,VS,void 0),qo(this,_F,[]),C$n(d,lr(this,ok,"f"))},cBt=function(){var y;const d=(y=lr(this,ok,"f"))==null?void 0:y.response_format;return _$t(d)?d:null},D9e=function(d){var y,S,N,B;let H=lr(this,VS,"f");const{choices:et,...W}=d;H?Object.assign(H,W):H=qo(this,VS,{...W,choices:[]});for(const{delta:nt,finish_reason:K,index:Q,logprobs:at=null,...mt}of d.choices){let Lt=H.choices[Q];if(Lt||(Lt=H.choices[Q]={finish_reason:K,index:Q,message:{},logprobs:at,...mt}),at)if(!Lt.logprobs)Lt.logprobs=Object.assign({},at);else{const{content:fe,refusal:cn,...sr}=at;Object.assign(Lt.logprobs,sr),fe&&((y=Lt.logprobs).content??(y.content=[]),Lt.logprobs.content.push(...fe)),cn&&((S=Lt.logprobs).refusal??(S.refusal=[]),Lt.logprobs.refusal.push(...cn))}if(K&&(Lt.finish_reason=K,lr(this,ok,"f")&&pNe(lr(this,ok,"f")))){if(K==="length")throw new VOe;if(K==="content_filter")throw new XOe}if(Object.assign(Lt,mt),!nt)continue;const{content:Pt,refusal:Mt,function_call:ie,role:se,tool_calls:ve,...gn}=nt;if(Object.assign(Lt.message,gn),Mt&&(Lt.message.refusal=(Lt.message.refusal||"")+Mt),se&&(Lt.message.role=se),ie&&(Lt.message.function_call?(ie.name&&(Lt.message.function_call.name=ie.name),ie.arguments&&((N=Lt.message.function_call).arguments??(N.arguments=""),Lt.message.function_call.arguments+=ie.arguments)):Lt.message.function_call=ie),Pt&&(Lt.message.content=(Lt.message.content||"")+Pt,!Lt.message.refusal&&lr(this,tp,"m",cBt).call(this)&&(Lt.message.parsed=R9e(Lt.message.content))),ve){Lt.message.tool_calls||(Lt.message.tool_calls=[]);for(const{index:fe,id:cn,type:sr,function:Fn,...qn}of ve){const nr=(B=Lt.message.tool_calls)[fe]??(B[fe]={});Object.assign(nr,qn),cn&&(nr.id=cn),sr&&(nr.type=sr),Fn&&(nr.function??(nr.function={name:Fn.name??"",arguments:""})),Fn!=null&&Fn.name&&(nr.function.name=Fn.name),Fn!=null&&Fn.arguments&&(nr.function.arguments+=Fn.arguments,m$n(lr(this,ok,"f"),nr)&&(nr.function.parsed_arguments=R9e(nr.function.arguments)))}}}return H},Symbol.asyncIterator)](){const s=[],d=[];let y=!1;return this.on("chunk",S=>{const N=d.shift();N?N.resolve(S):s.push(S)}),this.on("end",()=>{y=!0;for(const S of d)S.resolve(void 0);d.length=0}),this.on("abort",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),this.on("error",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,B)=>d.push({resolve:N,reject:B})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new E6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function C$n(o,s){const{id:d,choices:y,created:S,model:N,system_fingerprint:B,...H}=o,et={...H,id:d,choices:y.map(({message:W,finish_reason:nt,index:K,logprobs:Q,...at})=>{if(!nt)throw new ro(`missing finish_reason for choice ${K}`);const{content:mt=null,function_call:Lt,tool_calls:Pt,...Mt}=W,ie=W.role;if(!ie)throw new ro(`missing role for choice ${K}`);if(Lt){const{arguments:se,name:ve}=Lt;if(se==null)throw new ro(`missing function_call.arguments for choice ${K}`);if(!ve)throw new ro(`missing function_call.name for choice ${K}`);return{...at,message:{content:mt,function_call:{arguments:se,name:ve},role:ie,refusal:W.refusal??null},finish_reason:nt,index:K,logprobs:Q}}return Pt?{...at,index:K,finish_reason:nt,logprobs:Q,message:{...Mt,role:ie,content:mt,refusal:W.refusal??null,tool_calls:Pt.map((se,ve)=>{const{function:gn,type:fe,id:cn,...sr}=se,{arguments:Fn,name:qn,...nr}=gn||{};if(cn==null)throw new ro(`missing choices[${K}].tool_calls[${ve}].id
1901
+ ${K}`)}return B},Ji=g$n(fNe);let dNe=class extends Fs{list(s,d={},y){return this._client.getAPIList(Ji`/chat/completions/${s}/messages`,h0,{query:d,...y})}};function Amt(o){return o!==void 0&&"function"in o&&o.function!==void 0}function _$t(o){return(o==null?void 0:o.$brand)==="auto-parseable-response-format"}function ZQ(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function b$n(o,s){return!s||!pNe(s)?{...o,choices:o.choices.map(d=>(gNe(d.message.tool_calls),{...d,message:{...d.message,parsed:null,...d.message.tool_calls?{tool_calls:d.message.tool_calls}:void 0}}))}:x$t(o,s)}function x$t(o,s){const d=o.choices.map(y=>{var S;if(y.finish_reason==="length")throw new VOe;if(y.finish_reason==="content_filter")throw new XOe;return gNe(y.message.tool_calls),{...y,message:{...y.message,...y.message.tool_calls?{tool_calls:((S=y.message.tool_calls)==null?void 0:S.map(N=>y$n(s,N)))??void 0}:void 0,parsed:y.message.content&&!y.message.refusal?m$n(s,y.message.content):null}}});return{...o,choices:d}}function m$n(o,s){var d,y;return((d=o.response_format)==null?void 0:d.type)!=="json_schema"?null:((y=o.response_format)==null?void 0:y.type)==="json_schema"?"$parseRaw"in o.response_format?o.response_format.$parseRaw(s):JSON.parse(s):null}function y$n(o,s){var y;const d=(y=o.tools)==null?void 0:y.find(S=>{var N;return Amt(S)&&((N=S.function)==null?void 0:N.name)===s.function.name});return{...s,function:{...s.function,parsed_arguments:ZQ(d)?d.$parseRaw(s.function.arguments):d!=null&&d.function.strict?JSON.parse(s.function.arguments):null}}}function w$n(o,s){var y;if(!o||!("tools"in o)||!o.tools)return!1;const d=(y=o.tools)==null?void 0:y.find(S=>{var N;return Amt(S)&&((N=S.function)==null?void 0:N.name)===s.function.name});return Amt(d)&&(ZQ(d)||(d==null?void 0:d.function.strict)||!1)}function pNe(o){var s;return _$t(o.response_format)?!0:((s=o.tools)==null?void 0:s.some(d=>ZQ(d)||d.type==="function"&&d.function.strict===!0))??!1}function gNe(o){for(const s of o||[])if(s.type!=="function")throw new ro(`Currently only \`function\` tool calls are supported; Received \`${s.type}\``)}function v$n(o){for(const s of o??[]){if(s.type!=="function")throw new ro(`Currently only \`function\` tool types support auto-parsing; Received \`${s.type}\``);if(s.function.strict!==!0)throw new ro(`The \`${s.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}const Imt=o=>(o==null?void 0:o.role)==="assistant",bNe=o=>(o==null?void 0:o.role)==="tool";var vFt,Wbt,Kbt,pQ,gQ,Ybt,bQ,ck,mQ,Omt,Nmt,IF,mNe;class E$t{constructor(){vFt.add(this),this.controller=new AbortController,Wbt.set(this,void 0),Kbt.set(this,()=>{}),pQ.set(this,()=>{}),gQ.set(this,void 0),Ybt.set(this,()=>{}),bQ.set(this,()=>{}),ck.set(this,{}),mQ.set(this,!1),Omt.set(this,!1),Nmt.set(this,!1),IF.set(this,!1),qo(this,Wbt,new Promise((s,d)=>{qo(this,Kbt,s,"f"),qo(this,pQ,d,"f")})),qo(this,gQ,new Promise((s,d)=>{qo(this,Ybt,s,"f"),qo(this,bQ,d,"f")})),lr(this,Wbt,"f").catch(()=>{}),lr(this,gQ,"f").catch(()=>{})}_run(s){setTimeout(()=>{s().then(()=>{this._emitFinal(),this._emit("end")},lr(this,vFt,"m",mNe).bind(this))},0)}_connected(){this.ended||(lr(this,Kbt,"f").call(this),this._emit("connect"))}get ended(){return lr(this,mQ,"f")}get errored(){return lr(this,Omt,"f")}get aborted(){return lr(this,Nmt,"f")}abort(){this.controller.abort()}on(s,d){return(lr(this,ck,"f")[s]||(lr(this,ck,"f")[s]=[])).push({listener:d}),this}off(s,d){const y=lr(this,ck,"f")[s];if(!y)return this;const S=y.findIndex(N=>N.listener===d);return S>=0&&y.splice(S,1),this}once(s,d){return(lr(this,ck,"f")[s]||(lr(this,ck,"f")[s]=[])).push({listener:d,once:!0}),this}emitted(s){return new Promise((d,y)=>{qo(this,IF,!0),s!=="error"&&this.once("error",y),this.once(s,d)})}async done(){qo(this,IF,!0),await lr(this,gQ,"f")}_emit(s,...d){if(lr(this,mQ,"f"))return;s==="end"&&(qo(this,mQ,!0),lr(this,Ybt,"f").call(this));const y=lr(this,ck,"f")[s];if(y&&(lr(this,ck,"f")[s]=y.filter(S=>!S.once),y.forEach(({listener:S})=>S(...d))),s==="abort"){const S=d[0];!lr(this,IF,"f")&&!(y!=null&&y.length)&&Promise.reject(S),lr(this,pQ,"f").call(this,S),lr(this,bQ,"f").call(this,S),this._emit("end");return}if(s==="error"){const S=d[0];!lr(this,IF,"f")&&!(y!=null&&y.length)&&Promise.reject(S),lr(this,pQ,"f").call(this,S),lr(this,bQ,"f").call(this,S),this._emit("end")}}_emitFinal(){}}Wbt=new WeakMap,Kbt=new WeakMap,pQ=new WeakMap,gQ=new WeakMap,Ybt=new WeakMap,bQ=new WeakMap,ck=new WeakMap,mQ=new WeakMap,Omt=new WeakMap,Nmt=new WeakMap,IF=new WeakMap,vFt=new WeakSet,mNe=function(s){if(qo(this,Omt,!0),s instanceof Error&&s.name==="AbortError"&&(s=new A3),s instanceof A3)return qo(this,Nmt,!0),this._emit("abort",s);if(s instanceof ro)return this._emit("error",s);if(s instanceof Error){const d=new ro(s.message);return d.cause=s,this._emit("error",d)}return this._emit("error",new ro(String(s)))};function _$n(o){return typeof o.parse=="function"}var km,_Ft,Lmt,xFt,EFt,TFt,yNe,wNe;const x$n=10;class vNe extends E$t{constructor(){super(...arguments),km.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(s){var y;this._chatCompletions.push(s),this._emit("chatCompletion",s);const d=(y=s.choices[0])==null?void 0:y.message;return d&&this._addMessage(d),s}_addMessage(s,d=!0){if("content"in s||(s.content=null),this.messages.push(s),d){if(this._emit("message",s),bNe(s)&&s.content)this._emit("functionToolCallResult",s.content);else if(Imt(s)&&s.tool_calls)for(const y of s.tool_calls)y.type==="function"&&this._emit("functionToolCall",y.function)}}async finalChatCompletion(){await this.done();const s=this._chatCompletions[this._chatCompletions.length-1];if(!s)throw new ro("stream ended without producing a ChatCompletion");return s}async finalContent(){return await this.done(),lr(this,km,"m",_Ft).call(this)}async finalMessage(){return await this.done(),lr(this,km,"m",Lmt).call(this)}async finalFunctionToolCall(){return await this.done(),lr(this,km,"m",xFt).call(this)}async finalFunctionToolCallResult(){return await this.done(),lr(this,km,"m",EFt).call(this)}async totalUsage(){return await this.done(),lr(this,km,"m",TFt).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const s=this._chatCompletions[this._chatCompletions.length-1];s&&this._emit("finalChatCompletion",s);const d=lr(this,km,"m",Lmt).call(this);d&&this._emit("finalMessage",d);const y=lr(this,km,"m",_Ft).call(this);y&&this._emit("finalContent",y);const S=lr(this,km,"m",xFt).call(this);S&&this._emit("finalFunctionToolCall",S);const N=lr(this,km,"m",EFt).call(this);N!=null&&this._emit("finalFunctionToolCallResult",N),this._chatCompletions.some(B=>B.usage)&&this._emit("totalUsage",lr(this,km,"m",TFt).call(this))}async _createChatCompletion(s,d,y){const S=y==null?void 0:y.signal;S&&(S.aborted&&this.controller.abort(),S.addEventListener("abort",()=>this.controller.abort())),lr(this,km,"m",yNe).call(this,d);const N=await s.chat.completions.create({...d,stream:!1},{...y,signal:this.controller.signal});return this._connected(),this._addChatCompletion(x$t(N,d))}async _runChatCompletion(s,d,y){for(const S of d.messages)this._addMessage(S,!1);return await this._createChatCompletion(s,d,y)}async _runTools(s,d,y){var at,mt,Lt;const S="tool",{tool_choice:N="auto",stream:B,...H}=d,et=typeof N!="string"&&N.type==="function"&&((at=N==null?void 0:N.function)==null?void 0:at.name),{maxChatCompletions:W=x$n}=y||{},nt=d.tools.map(Pt=>{if(ZQ(Pt)){if(!Pt.$callback)throw new ro("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:Pt.$callback,name:Pt.function.name,description:Pt.function.description||"",parameters:Pt.function.parameters,parse:Pt.$parseRaw,strict:!0}}}return Pt}),K={};for(const Pt of nt)Pt.type==="function"&&(K[Pt.function.name||Pt.function.function.name]=Pt.function);const Q="tools"in d?nt.map(Pt=>Pt.type==="function"?{type:"function",function:{name:Pt.function.name||Pt.function.function.name,parameters:Pt.function.parameters,description:Pt.function.description,strict:Pt.function.strict}}:Pt):void 0;for(const Pt of d.messages)this._addMessage(Pt,!1);for(let Pt=0;Pt<W;++Pt){const ie=(mt=(await this._createChatCompletion(s,{...H,tool_choice:N,tools:Q,messages:[...this.messages]},y)).choices[0])==null?void 0:mt.message;if(!ie)throw new ro("missing message in ChatCompletion response");if(!((Lt=ie.tool_calls)!=null&&Lt.length))return;for(const se of ie.tool_calls){if(se.type!=="function")continue;const ve=se.id,{name:gn,arguments:fe}=se.function,cn=K[gn];if(cn){if(et&&et!==gn){const nr=`Invalid tool_call: ${JSON.stringify(gn)}. ${JSON.stringify(et)} requested. Please try again`;this._addMessage({role:S,tool_call_id:ve,content:nr});continue}}else{const nr=`Invalid tool_call: ${JSON.stringify(gn)}. Available options are: ${Object.keys(K).map(hr=>JSON.stringify(hr)).join(", ")}. Please try again`;this._addMessage({role:S,tool_call_id:ve,content:nr});continue}let sr;try{sr=_$n(cn)?await cn.parse(fe):fe}catch(nr){const hr=nr instanceof Error?nr.message:String(nr);this._addMessage({role:S,tool_call_id:ve,content:hr});continue}const Fn=await cn.function(sr,this),qn=lr(this,km,"m",wNe).call(this,Fn);if(this._addMessage({role:S,tool_call_id:ve,content:qn}),et)return}}}}km=new WeakSet,_Ft=function(){return lr(this,km,"m",Lmt).call(this).content??null},Lmt=function(){let s=this.messages.length;for(;s-- >0;){const d=this.messages[s];if(Imt(d))return{...d,content:d.content??null,refusal:d.refusal??null}}throw new ro("stream ended without producing a ChatCompletionMessage with role=assistant")},xFt=function(){var s,d;for(let y=this.messages.length-1;y>=0;y--){const S=this.messages[y];if(Imt(S)&&((s=S==null?void 0:S.tool_calls)!=null&&s.length))return(d=S.tool_calls.filter(N=>N.type==="function").at(-1))==null?void 0:d.function}},EFt=function(){for(let s=this.messages.length-1;s>=0;s--){const d=this.messages[s];if(bNe(d)&&d.content!=null&&typeof d.content=="string"&&this.messages.some(y=>{var S;return y.role==="assistant"&&((S=y.tool_calls)==null?void 0:S.some(N=>N.type==="function"&&N.id===d.tool_call_id))}))return d.content}},TFt=function(){const s={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:d}of this._chatCompletions)d&&(s.completion_tokens+=d.completion_tokens,s.prompt_tokens+=d.prompt_tokens,s.total_tokens+=d.total_tokens);return s},yNe=function(s){if(s.n!=null&&s.n>1)throw new ro("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},wNe=function(s){return typeof s=="string"?s:s===void 0?"undefined":JSON.stringify(s)};class T$t extends vNe{static runTools(s,d,y){const S=new T$t,N={...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"runTools"}};return S._run(()=>S._runTools(s,d,N)),S}_addMessage(s,d=!0){super._addMessage(s,d),Imt(s)&&s.content&&this._emit("content",s.content)}}const _Ne=1,xNe=2,ENe=4,TNe=8,kNe=16,CNe=32,SNe=64,ANe=128,INe=256,ONe=ANe|INe,NNe=kNe|CNe|ONe|SNe,LNe=_Ne|xNe|NNe,MNe=ENe|TNe,E$n=LNe|MNe,qp={STR:_Ne,NUM:xNe,ARR:ENe,OBJ:TNe,NULL:kNe,BOOL:CNe,NAN:SNe,INFINITY:ANe,MINUS_INFINITY:INe,INF:ONe,SPECIAL:NNe,ATOM:LNe,COLLECTION:MNe,ALL:E$n};class T$n extends Error{}class k$n extends Error{}function C$n(o,s=qp.ALL){if(typeof o!="string")throw new TypeError(`expecting str, got ${typeof o}`);if(!o.trim())throw new Error(`${o} is empty`);return S$n(o.trim(),s)}const S$n=(o,s)=>{const d=o.length;let y=0;const S=Q=>{throw new T$n(`${Q} at position ${y}`)},N=Q=>{throw new k$n(`${Q} at position ${y}`)},B=()=>(K(),y>=d&&S("Unexpected end of input"),o[y]==='"'?H():o[y]==="{"?et():o[y]==="["?W():o.substring(y,y+4)==="null"||qp.NULL&s&&d-y<4&&"null".startsWith(o.substring(y))?(y+=4,null):o.substring(y,y+4)==="true"||qp.BOOL&s&&d-y<4&&"true".startsWith(o.substring(y))?(y+=4,!0):o.substring(y,y+5)==="false"||qp.BOOL&s&&d-y<5&&"false".startsWith(o.substring(y))?(y+=5,!1):o.substring(y,y+8)==="Infinity"||qp.INFINITY&s&&d-y<8&&"Infinity".startsWith(o.substring(y))?(y+=8,1/0):o.substring(y,y+9)==="-Infinity"||qp.MINUS_INFINITY&s&&1<d-y&&d-y<9&&"-Infinity".startsWith(o.substring(y))?(y+=9,-1/0):o.substring(y,y+3)==="NaN"||qp.NAN&s&&d-y<3&&"NaN".startsWith(o.substring(y))?(y+=3,NaN):nt()),H=()=>{const Q=y;let at=!1;for(y++;y<d&&(o[y]!=='"'||at&&o[y-1]==="\\");)at=o[y]==="\\"?!at:!1,y++;if(o.charAt(y)=='"')try{return JSON.parse(o.substring(Q,++y-Number(at)))}catch(mt){N(String(mt))}else if(qp.STR&s)try{return JSON.parse(o.substring(Q,y-Number(at))+'"')}catch{return JSON.parse(o.substring(Q,o.lastIndexOf("\\"))+'"')}S("Unterminated string literal")},et=()=>{y++,K();const Q={};try{for(;o[y]!=="}";){if(K(),y>=d&&qp.OBJ&s)return Q;const at=H();K(),y++;try{const mt=B();Object.defineProperty(Q,at,{value:mt,writable:!0,enumerable:!0,configurable:!0})}catch(mt){if(qp.OBJ&s)return Q;throw mt}K(),o[y]===","&&y++}}catch{if(qp.OBJ&s)return Q;S("Expected '}' at end of object")}return y++,Q},W=()=>{y++;const Q=[];try{for(;o[y]!=="]";)Q.push(B()),K(),o[y]===","&&y++}catch{if(qp.ARR&s)return Q;S("Expected ']' at end of array")}return y++,Q},nt=()=>{if(y===0){o==="-"&&qp.NUM&s&&S("Not sure what '-' is");try{return JSON.parse(o)}catch(at){if(qp.NUM&s)try{return o[o.length-1]==="."?JSON.parse(o.substring(0,o.lastIndexOf("."))):JSON.parse(o.substring(0,o.lastIndexOf("e")))}catch{}N(String(at))}}const Q=y;for(o[y]==="-"&&y++;o[y]&&!",]}".includes(o[y]);)y++;y==d&&!(qp.NUM&s)&&S("Unterminated number literal");try{return JSON.parse(o.substring(Q,y))}catch{o.substring(Q,y)==="-"&&qp.NUM&s&&S("Not sure what '-' is");try{return JSON.parse(o.substring(Q,o.lastIndexOf("e")))}catch(mt){N(String(mt))}}},K=()=>{for(;y<d&&`
1902
+ \r `.includes(o[y]);)y++};return B()},R9e=o=>C$n(o,qp.ALL^qp.NUM);var tp,ok,_F,VS,iBt,Abt,aBt,sBt,oBt,Ibt,cBt,D9e;class qQ extends vNe{constructor(s){super(),tp.add(this),ok.set(this,void 0),_F.set(this,void 0),VS.set(this,void 0),qo(this,ok,s),qo(this,_F,[])}get currentChatCompletionSnapshot(){return lr(this,VS,"f")}static fromReadableStream(s){const d=new qQ(null);return d._run(()=>d._fromReadableStream(s)),d}static createChatCompletion(s,d,y){const S=new qQ(d);return S._run(()=>S._runChatCompletion(s,{...d,stream:!0},{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),S}async _createChatCompletion(s,d,y){var B;super._createChatCompletion;const S=y==null?void 0:y.signal;S&&(S.aborted&&this.controller.abort(),S.addEventListener("abort",()=>this.controller.abort())),lr(this,tp,"m",iBt).call(this);const N=await s.chat.completions.create({...d,stream:!0},{...y,signal:this.controller.signal});this._connected();for await(const H of N)lr(this,tp,"m",aBt).call(this,H);if((B=N.controller.signal)!=null&&B.aborted)throw new A3;return this._addChatCompletion(lr(this,tp,"m",Ibt).call(this))}async _fromReadableStream(s,d){var B;const y=d==null?void 0:d.signal;y&&(y.aborted&&this.controller.abort(),y.addEventListener("abort",()=>this.controller.abort())),lr(this,tp,"m",iBt).call(this),this._connected();const S=E6.fromReadableStream(s,this.controller);let N;for await(const H of S)N&&N!==H.id&&this._addChatCompletion(lr(this,tp,"m",Ibt).call(this)),lr(this,tp,"m",aBt).call(this,H),N=H.id;if((B=S.controller.signal)!=null&&B.aborted)throw new A3;return this._addChatCompletion(lr(this,tp,"m",Ibt).call(this))}[(ok=new WeakMap,_F=new WeakMap,VS=new WeakMap,tp=new WeakSet,iBt=function(){this.ended||qo(this,VS,void 0)},Abt=function(d){let y=lr(this,_F,"f")[d.index];return y||(y={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},lr(this,_F,"f")[d.index]=y,y)},aBt=function(d){var S,N,B,H,et,W,nt,K,Q,at,mt,Lt,Pt,Mt,ie;if(this.ended)return;const y=lr(this,tp,"m",D9e).call(this,d);this._emit("chunk",d,y);for(const se of d.choices){const ve=y.choices[se.index];se.delta.content!=null&&((S=ve.message)==null?void 0:S.role)==="assistant"&&((N=ve.message)!=null&&N.content)&&(this._emit("content",se.delta.content,ve.message.content),this._emit("content.delta",{delta:se.delta.content,snapshot:ve.message.content,parsed:ve.message.parsed})),se.delta.refusal!=null&&((B=ve.message)==null?void 0:B.role)==="assistant"&&((H=ve.message)!=null&&H.refusal)&&this._emit("refusal.delta",{delta:se.delta.refusal,snapshot:ve.message.refusal}),((et=se.logprobs)==null?void 0:et.content)!=null&&((W=ve.message)==null?void 0:W.role)==="assistant"&&this._emit("logprobs.content.delta",{content:(nt=se.logprobs)==null?void 0:nt.content,snapshot:((K=ve.logprobs)==null?void 0:K.content)??[]}),((Q=se.logprobs)==null?void 0:Q.refusal)!=null&&((at=ve.message)==null?void 0:at.role)==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:(mt=se.logprobs)==null?void 0:mt.refusal,snapshot:((Lt=ve.logprobs)==null?void 0:Lt.refusal)??[]});const gn=lr(this,tp,"m",Abt).call(this,ve);ve.finish_reason&&(lr(this,tp,"m",oBt).call(this,ve),gn.current_tool_call_index!=null&&lr(this,tp,"m",sBt).call(this,ve,gn.current_tool_call_index));for(const fe of se.delta.tool_calls??[])gn.current_tool_call_index!==fe.index&&(lr(this,tp,"m",oBt).call(this,ve),gn.current_tool_call_index!=null&&lr(this,tp,"m",sBt).call(this,ve,gn.current_tool_call_index)),gn.current_tool_call_index=fe.index;for(const fe of se.delta.tool_calls??[]){const cn=(Pt=ve.message.tool_calls)==null?void 0:Pt[fe.index];cn!=null&&cn.type&&((cn==null?void 0:cn.type)==="function"?this._emit("tool_calls.function.arguments.delta",{name:(Mt=cn.function)==null?void 0:Mt.name,index:fe.index,arguments:cn.function.arguments,parsed_arguments:cn.function.parsed_arguments,arguments_delta:((ie=fe.function)==null?void 0:ie.arguments)??""}):(cn==null||cn.type,void 0))}}},sBt=function(d,y){var B,H,et;if(lr(this,tp,"m",Abt).call(this,d).done_tool_calls.has(y))return;const N=(B=d.message.tool_calls)==null?void 0:B[y];if(!N)throw new Error("no tool call snapshot");if(!N.type)throw new Error("tool call snapshot missing `type`");if(N.type==="function"){const W=(et=(H=lr(this,ok,"f"))==null?void 0:H.tools)==null?void 0:et.find(nt=>Amt(nt)&&nt.function.name===N.function.name);this._emit("tool_calls.function.arguments.done",{name:N.function.name,index:y,arguments:N.function.arguments,parsed_arguments:ZQ(W)?W.$parseRaw(N.function.arguments):W!=null&&W.function.strict?JSON.parse(N.function.arguments):null})}else N.type},oBt=function(d){var S,N;const y=lr(this,tp,"m",Abt).call(this,d);if(d.message.content&&!y.content_done){y.content_done=!0;const B=lr(this,tp,"m",cBt).call(this);this._emit("content.done",{content:d.message.content,parsed:B?B.$parseRaw(d.message.content):null})}d.message.refusal&&!y.refusal_done&&(y.refusal_done=!0,this._emit("refusal.done",{refusal:d.message.refusal})),(S=d.logprobs)!=null&&S.content&&!y.logprobs_content_done&&(y.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:d.logprobs.content})),(N=d.logprobs)!=null&&N.refusal&&!y.logprobs_refusal_done&&(y.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:d.logprobs.refusal}))},Ibt=function(){if(this.ended)throw new ro("stream has ended, this shouldn't happen");const d=lr(this,VS,"f");if(!d)throw new ro("request ended without sending any chunks");return qo(this,VS,void 0),qo(this,_F,[]),A$n(d,lr(this,ok,"f"))},cBt=function(){var y;const d=(y=lr(this,ok,"f"))==null?void 0:y.response_format;return _$t(d)?d:null},D9e=function(d){var y,S,N,B;let H=lr(this,VS,"f");const{choices:et,...W}=d;H?Object.assign(H,W):H=qo(this,VS,{...W,choices:[]});for(const{delta:nt,finish_reason:K,index:Q,logprobs:at=null,...mt}of d.choices){let Lt=H.choices[Q];if(Lt||(Lt=H.choices[Q]={finish_reason:K,index:Q,message:{},logprobs:at,...mt}),at)if(!Lt.logprobs)Lt.logprobs=Object.assign({},at);else{const{content:fe,refusal:cn,...sr}=at;Object.assign(Lt.logprobs,sr),fe&&((y=Lt.logprobs).content??(y.content=[]),Lt.logprobs.content.push(...fe)),cn&&((S=Lt.logprobs).refusal??(S.refusal=[]),Lt.logprobs.refusal.push(...cn))}if(K&&(Lt.finish_reason=K,lr(this,ok,"f")&&pNe(lr(this,ok,"f")))){if(K==="length")throw new VOe;if(K==="content_filter")throw new XOe}if(Object.assign(Lt,mt),!nt)continue;const{content:Pt,refusal:Mt,function_call:ie,role:se,tool_calls:ve,...gn}=nt;if(Object.assign(Lt.message,gn),Mt&&(Lt.message.refusal=(Lt.message.refusal||"")+Mt),se&&(Lt.message.role=se),ie&&(Lt.message.function_call?(ie.name&&(Lt.message.function_call.name=ie.name),ie.arguments&&((N=Lt.message.function_call).arguments??(N.arguments=""),Lt.message.function_call.arguments+=ie.arguments)):Lt.message.function_call=ie),Pt&&(Lt.message.content=(Lt.message.content||"")+Pt,!Lt.message.refusal&&lr(this,tp,"m",cBt).call(this)&&(Lt.message.parsed=R9e(Lt.message.content))),ve){Lt.message.tool_calls||(Lt.message.tool_calls=[]);for(const{index:fe,id:cn,type:sr,function:Fn,...qn}of ve){const nr=(B=Lt.message.tool_calls)[fe]??(B[fe]={});Object.assign(nr,qn),cn&&(nr.id=cn),sr&&(nr.type=sr),Fn&&(nr.function??(nr.function={name:Fn.name??"",arguments:""})),Fn!=null&&Fn.name&&(nr.function.name=Fn.name),Fn!=null&&Fn.arguments&&(nr.function.arguments+=Fn.arguments,w$n(lr(this,ok,"f"),nr)&&(nr.function.parsed_arguments=R9e(nr.function.arguments)))}}}return H},Symbol.asyncIterator)](){const s=[],d=[];let y=!1;return this.on("chunk",S=>{const N=d.shift();N?N.resolve(S):s.push(S)}),this.on("end",()=>{y=!0;for(const S of d)S.resolve(void 0);d.length=0}),this.on("abort",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),this.on("error",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,B)=>d.push({resolve:N,reject:B})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new E6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function A$n(o,s){const{id:d,choices:y,created:S,model:N,system_fingerprint:B,...H}=o,et={...H,id:d,choices:y.map(({message:W,finish_reason:nt,index:K,logprobs:Q,...at})=>{if(!nt)throw new ro(`missing finish_reason for choice ${K}`);const{content:mt=null,function_call:Lt,tool_calls:Pt,...Mt}=W,ie=W.role;if(!ie)throw new ro(`missing role for choice ${K}`);if(Lt){const{arguments:se,name:ve}=Lt;if(se==null)throw new ro(`missing function_call.arguments for choice ${K}`);if(!ve)throw new ro(`missing function_call.name for choice ${K}`);return{...at,message:{content:mt,function_call:{arguments:se,name:ve},role:ie,refusal:W.refusal??null},finish_reason:nt,index:K,logprobs:Q}}return Pt?{...at,index:K,finish_reason:nt,logprobs:Q,message:{...Mt,role:ie,content:mt,refusal:W.refusal??null,tool_calls:Pt.map((se,ve)=>{const{function:gn,type:fe,id:cn,...sr}=se,{arguments:Fn,name:qn,...nr}=gn||{};if(cn==null)throw new ro(`missing choices[${K}].tool_calls[${ve}].id
1903
1903
  ${Obt(o)}`);if(fe==null)throw new ro(`missing choices[${K}].tool_calls[${ve}].type
1904
1904
  ${Obt(o)}`);if(qn==null)throw new ro(`missing choices[${K}].tool_calls[${ve}].function.name
1905
1905
  ${Obt(o)}`);if(Fn==null)throw new ro(`missing choices[${K}].tool_calls[${ve}].function.arguments
1906
- ${Obt(o)}`);return{...sr,id:cn,type:fe,function:{...nr,name:qn,arguments:Fn}}})}}:{...at,message:{...Mt,content:mt,role:ie,refusal:W.refusal??null},finish_reason:nt,index:K,logprobs:Q}}),created:S,model:N,object:"chat.completion",...B?{system_fingerprint:B}:{}};return p$n(et,s)}function Obt(o){return JSON.stringify(o)}class Mmt extends qQ{static fromReadableStream(s){const d=new Mmt(null);return d._run(()=>d._fromReadableStream(s)),d}static runTools(s,d,y){const S=new Mmt(d),N={...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"runTools"}};return S._run(()=>S._runTools(s,d,N)),S}}let k$t=class extends Fs{constructor(){super(...arguments),this.messages=new dNe(this._client)}create(s,d){return this._client.post("/chat/completions",{body:s,...d,stream:s.stream??!1})}retrieve(s,d){return this._client.get(Ji`/chat/completions/${s}`,d)}update(s,d,y){return this._client.post(Ji`/chat/completions/${s}`,{body:d,...y})}list(s={},d){return this._client.getAPIList("/chat/completions",h0,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/chat/completions/${s}`,d)}parse(s,d){return y$n(s.tools),this._client.chat.completions.create(s,{...d,headers:{...d==null?void 0:d.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(y=>x$t(y,s))}runTools(s,d){return s.stream?Mmt.runTools(this._client,s,d):T$t.runTools(this._client,s,d)}stream(s,d){return qQ.createChatCompletion(this._client,s,d)}};k$t.Messages=dNe;class C$t extends Fs{constructor(){super(...arguments),this.completions=new k$t(this._client)}}C$t.Completions=k$t;const PNe=Symbol("brand.privateNullableHeaders");function*S$n(o){if(!o)return;if(PNe in o){const{values:y,nulls:S}=o;yield*y.entries();for(const N of S)yield[N,null];return}let s=!1,d;o instanceof Headers?d=o.entries():v9e(o)?d=o:(s=!0,d=Object.entries(o??{}));for(let y of d){const S=y[0];if(typeof S!="string")throw new TypeError("expected header name to be a string");const N=v9e(y[1])?y[1]:[y[1]];let B=!1;for(const H of N)H!==void 0&&(s&&!B&&(B=!0,yield[S,null]),yield[S,H])}}const hs=o=>{const s=new Headers,d=new Set;for(const y of o){const S=new Set;for(const[N,B]of S$n(y)){const H=N.toLowerCase();S.has(H)||(s.delete(N),S.add(H)),B===null?(s.delete(N),d.add(H)):(s.append(N,B),d.delete(H))}}return{[PNe]:!0,values:s,nulls:d}};class RNe extends Fs{create(s,d){return this._client.post("/audio/speech",{body:s,...d,headers:hs([{Accept:"application/octet-stream"},d==null?void 0:d.headers]),__binaryResponse:!0})}}class DNe extends Fs{create(s,d){return this._client.post("/audio/transcriptions",cL({body:s,...d,stream:s.stream??!1,__metadata:{model:s.model}},this._client))}}class BNe extends Fs{create(s,d){return this._client.post("/audio/translations",cL({body:s,...d,__metadata:{model:s.model}},this._client))}}class tJ extends Fs{constructor(){super(...arguments),this.transcriptions=new DNe(this._client),this.translations=new BNe(this._client),this.speech=new RNe(this._client)}}tJ.Transcriptions=DNe;tJ.Translations=BNe;tJ.Speech=RNe;class FNe extends Fs{create(s,d){return this._client.post("/batches",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/batches/${s}`,d)}list(s={},d){return this._client.getAPIList("/batches",h0,{query:s,...d})}cancel(s,d){return this._client.post(Ji`/batches/${s}/cancel`,d)}}class $Ne extends Fs{create(s,d){return this._client.post("/assistants",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}retrieve(s,d){return this._client.get(Ji`/assistants/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}update(s,d,y){return this._client.post(Ji`/assistants/${s}`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s={},d){return this._client.getAPIList("/assistants",h0,{query:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}delete(s,d){return this._client.delete(Ji`/assistants/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}}let jNe=class extends Fs{create(s,d){return this._client.post("/realtime/sessions",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}};class HNe extends Fs{create(s,d){return this._client.post("/realtime/transcription_sessions",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}}let s2t=class extends Fs{constructor(){super(...arguments),this.sessions=new jNe(this._client),this.transcriptionSessions=new HNe(this._client)}};s2t.Sessions=jNe;s2t.TranscriptionSessions=HNe;class zNe extends Fs{create(s,d){return this._client.post("/chatkit/sessions",{body:s,...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}cancel(s,d){return this._client.post(Ji`/chatkit/sessions/${s}/cancel`,{...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}}let UNe=class extends Fs{retrieve(s,d){return this._client.get(Ji`/chatkit/threads/${s}`,{...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}list(s={},d){return this._client.getAPIList("/chatkit/threads",Smt,{query:s,...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}delete(s,d){return this._client.delete(Ji`/chatkit/threads/${s}`,{...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}listItems(s,d={},y){return this._client.getAPIList(Ji`/chatkit/threads/${s}/items`,Smt,{query:d,...y,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},y==null?void 0:y.headers])})}};class o2t extends Fs{constructor(){super(...arguments),this.sessions=new zNe(this._client),this.threads=new UNe(this._client)}}o2t.Sessions=zNe;o2t.Threads=UNe;class qNe extends Fs{create(s,d,y){return this._client.post(Ji`/threads/${s}/messages`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,d,y){const{thread_id:S}=d;return this._client.get(Ji`/threads/${S}/messages/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,d,y){const{thread_id:S,...N}=d;return this._client.post(Ji`/threads/${S}/messages/${s}`,{body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,d={},y){return this._client.getAPIList(Ji`/threads/${s}/messages`,h0,{query:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,d,y){const{thread_id:S}=d;return this._client.delete(Ji`/threads/${S}/messages/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}class WNe extends Fs{retrieve(s,d,y){const{thread_id:S,run_id:N,...B}=d;return this._client.get(Ji`/threads/${S}/runs/${N}/steps/${s}`,{query:B,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,d,y){const{thread_id:S,...N}=d;return this._client.getAPIList(Ji`/threads/${S}/runs/${s}/steps`,h0,{query:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}const A$n=o=>{if(typeof Buffer<"u"){const s=Buffer.from(o,"base64");return Array.from(new Float32Array(s.buffer,s.byteOffset,s.length/Float32Array.BYTES_PER_ELEMENT))}else{const s=atob(o),d=s.length,y=new Uint8Array(d);for(let S=0;S<d;S++)y[S]=s.charCodeAt(S);return Array.from(new Float32Array(y.buffer))}};var uBt={};const xF=o=>{var s,d,y,S;if(typeof globalThis.process<"u")return((s=uBt==null?void 0:uBt[o])==null?void 0:s.trim())??void 0;if(typeof globalThis.Deno<"u")return(S=(y=(d=globalThis.Deno.env)==null?void 0:d.get)==null?void 0:y.call(d,o))==null?void 0:S.trim()};var Lg,JN,kFt,w6,Gbt,X_,ZN,LF,VN,Pmt,Tw,Vbt,Xbt,SQ,yQ,wQ,B9e,F9e,$9e,j9e,H9e,z9e,U9e;class AQ extends E$t{constructor(){super(...arguments),Lg.add(this),kFt.set(this,[]),w6.set(this,{}),Gbt.set(this,{}),X_.set(this,void 0),ZN.set(this,void 0),LF.set(this,void 0),VN.set(this,void 0),Pmt.set(this,void 0),Tw.set(this,void 0),Vbt.set(this,void 0),Xbt.set(this,void 0),SQ.set(this,void 0)}[(kFt=new WeakMap,w6=new WeakMap,Gbt=new WeakMap,X_=new WeakMap,ZN=new WeakMap,LF=new WeakMap,VN=new WeakMap,Pmt=new WeakMap,Tw=new WeakMap,Vbt=new WeakMap,Xbt=new WeakMap,SQ=new WeakMap,Lg=new WeakSet,Symbol.asyncIterator)](){const s=[],d=[];let y=!1;return this.on("event",S=>{const N=d.shift();N?N.resolve(S):s.push(S)}),this.on("end",()=>{y=!0;for(const S of d)S.resolve(void 0);d.length=0}),this.on("abort",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),this.on("error",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,B)=>d.push({resolve:N,reject:B})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(s){const d=new JN;return d._run(()=>d._fromReadableStream(s)),d}async _fromReadableStream(s,d){var N;const y=d==null?void 0:d.signal;y&&(y.aborted&&this.controller.abort(),y.addEventListener("abort",()=>this.controller.abort())),this._connected();const S=E6.fromReadableStream(s,this.controller);for await(const B of S)lr(this,Lg,"m",yQ).call(this,B);if((N=S.controller.signal)!=null&&N.aborted)throw new A3;return this._addRun(lr(this,Lg,"m",wQ).call(this))}toReadableStream(){return new E6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(s,d,y,S){const N=new JN;return N._run(()=>N._runToolAssistantStream(s,d,y,{...S,headers:{...S==null?void 0:S.headers,"X-Stainless-Helper-Method":"stream"}})),N}async _createToolAssistantStream(s,d,y,S){var et;const N=S==null?void 0:S.signal;N&&(N.aborted&&this.controller.abort(),N.addEventListener("abort",()=>this.controller.abort()));const B={...y,stream:!0},H=await s.submitToolOutputs(d,B,{...S,signal:this.controller.signal});this._connected();for await(const W of H)lr(this,Lg,"m",yQ).call(this,W);if((et=H.controller.signal)!=null&&et.aborted)throw new A3;return this._addRun(lr(this,Lg,"m",wQ).call(this))}static createThreadAssistantStream(s,d,y){const S=new JN;return S._run(()=>S._threadAssistantStream(s,d,{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),S}static createAssistantStream(s,d,y,S){const N=new JN;return N._run(()=>N._runAssistantStream(s,d,y,{...S,headers:{...S==null?void 0:S.headers,"X-Stainless-Helper-Method":"stream"}})),N}currentEvent(){return lr(this,Vbt,"f")}currentRun(){return lr(this,Xbt,"f")}currentMessageSnapshot(){return lr(this,X_,"f")}currentRunStepSnapshot(){return lr(this,SQ,"f")}async finalRunSteps(){return await this.done(),Object.values(lr(this,w6,"f"))}async finalMessages(){return await this.done(),Object.values(lr(this,Gbt,"f"))}async finalRun(){if(await this.done(),!lr(this,ZN,"f"))throw Error("Final run was not received.");return lr(this,ZN,"f")}async _createThreadAssistantStream(s,d,y){var H;const S=y==null?void 0:y.signal;S&&(S.aborted&&this.controller.abort(),S.addEventListener("abort",()=>this.controller.abort()));const N={...d,stream:!0},B=await s.createAndRun(N,{...y,signal:this.controller.signal});this._connected();for await(const et of B)lr(this,Lg,"m",yQ).call(this,et);if((H=B.controller.signal)!=null&&H.aborted)throw new A3;return this._addRun(lr(this,Lg,"m",wQ).call(this))}async _createAssistantStream(s,d,y,S){var et;const N=S==null?void 0:S.signal;N&&(N.aborted&&this.controller.abort(),N.addEventListener("abort",()=>this.controller.abort()));const B={...y,stream:!0},H=await s.create(d,B,{...S,signal:this.controller.signal});this._connected();for await(const W of H)lr(this,Lg,"m",yQ).call(this,W);if((et=H.controller.signal)!=null&&et.aborted)throw new A3;return this._addRun(lr(this,Lg,"m",wQ).call(this))}static accumulateDelta(s,d){for(const[y,S]of Object.entries(d)){if(!s.hasOwnProperty(y)){s[y]=S;continue}let N=s[y];if(N==null){s[y]=S;continue}if(y==="index"||y==="type"){s[y]=S;continue}if(typeof N=="string"&&typeof S=="string")N+=S;else if(typeof N=="number"&&typeof S=="number")N+=S;else if(eBt(N)&&eBt(S))N=this.accumulateDelta(N,S);else if(Array.isArray(N)&&Array.isArray(S)){if(N.every(B=>typeof B=="string"||typeof B=="number")){N.push(...S);continue}for(const B of S){if(!eBt(B))throw new Error(`Expected array delta entry to be an object but got: ${B}`);const H=B.index;if(H==null)throw console.error(B),new Error("Expected array delta entry to have an `index` property");if(typeof H!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${H}`);const et=N[H];et==null?N.push(B):N[H]=this.accumulateDelta(et,B)}continue}else throw Error(`Unhandled record type: ${y}, deltaValue: ${S}, accValue: ${N}`);s[y]=N}return s}_addRun(s){return s}async _threadAssistantStream(s,d,y){return await this._createThreadAssistantStream(d,s,y)}async _runAssistantStream(s,d,y,S){return await this._createAssistantStream(d,s,y,S)}async _runToolAssistantStream(s,d,y,S){return await this._createToolAssistantStream(d,s,y,S)}}JN=AQ,yQ=function(s){if(!this.ended)switch(qo(this,Vbt,s),lr(this,Lg,"m",$9e).call(this,s),s.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":lr(this,Lg,"m",U9e).call(this,s);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":lr(this,Lg,"m",F9e).call(this,s);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":lr(this,Lg,"m",B9e).call(this,s);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},wQ=function(){if(this.ended)throw new ro("stream has ended, this shouldn't happen");if(!lr(this,ZN,"f"))throw Error("Final run has not been received");return lr(this,ZN,"f")},B9e=function(s){const[d,y]=lr(this,Lg,"m",H9e).call(this,s,lr(this,X_,"f"));qo(this,X_,d),lr(this,Gbt,"f")[d.id]=d;for(const S of y){const N=d.content[S.index];(N==null?void 0:N.type)=="text"&&this._emit("textCreated",N.text)}switch(s.event){case"thread.message.created":this._emit("messageCreated",s.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",s.data.delta,d),s.data.delta.content)for(const S of s.data.delta.content){if(S.type=="text"&&S.text){let N=S.text,B=d.content[S.index];if(B&&B.type=="text")this._emit("textDelta",N,B.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(S.index!=lr(this,LF,"f")){if(lr(this,VN,"f"))switch(lr(this,VN,"f").type){case"text":this._emit("textDone",lr(this,VN,"f").text,lr(this,X_,"f"));break;case"image_file":this._emit("imageFileDone",lr(this,VN,"f").image_file,lr(this,X_,"f"));break}qo(this,LF,S.index)}qo(this,VN,d.content[S.index])}break;case"thread.message.completed":case"thread.message.incomplete":if(lr(this,LF,"f")!==void 0){const S=s.data.content[lr(this,LF,"f")];if(S)switch(S.type){case"image_file":this._emit("imageFileDone",S.image_file,lr(this,X_,"f"));break;case"text":this._emit("textDone",S.text,lr(this,X_,"f"));break}}lr(this,X_,"f")&&this._emit("messageDone",s.data),qo(this,X_,void 0)}},F9e=function(s){const d=lr(this,Lg,"m",j9e).call(this,s);switch(qo(this,SQ,d),s.event){case"thread.run.step.created":this._emit("runStepCreated",s.data);break;case"thread.run.step.delta":const y=s.data.delta;if(y.step_details&&y.step_details.type=="tool_calls"&&y.step_details.tool_calls&&d.step_details.type=="tool_calls")for(const N of y.step_details.tool_calls)N.index==lr(this,Pmt,"f")?this._emit("toolCallDelta",N,d.step_details.tool_calls[N.index]):(lr(this,Tw,"f")&&this._emit("toolCallDone",lr(this,Tw,"f")),qo(this,Pmt,N.index),qo(this,Tw,d.step_details.tool_calls[N.index]),lr(this,Tw,"f")&&this._emit("toolCallCreated",lr(this,Tw,"f")));this._emit("runStepDelta",s.data.delta,d);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":qo(this,SQ,void 0),s.data.step_details.type=="tool_calls"&&lr(this,Tw,"f")&&(this._emit("toolCallDone",lr(this,Tw,"f")),qo(this,Tw,void 0)),this._emit("runStepDone",s.data,d);break}},$9e=function(s){lr(this,kFt,"f").push(s),this._emit("event",s)},j9e=function(s){switch(s.event){case"thread.run.step.created":return lr(this,w6,"f")[s.data.id]=s.data,s.data;case"thread.run.step.delta":let d=lr(this,w6,"f")[s.data.id];if(!d)throw Error("Received a RunStepDelta before creation of a snapshot");let y=s.data;if(y.delta){const S=JN.accumulateDelta(d,y.delta);lr(this,w6,"f")[s.data.id]=S}return lr(this,w6,"f")[s.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":lr(this,w6,"f")[s.data.id]=s.data;break}if(lr(this,w6,"f")[s.data.id])return lr(this,w6,"f")[s.data.id];throw new Error("No snapshot available")},H9e=function(s,d){let y=[];switch(s.event){case"thread.message.created":return[s.data,y];case"thread.message.delta":if(!d)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let S=s.data;if(S.delta.content)for(const N of S.delta.content)if(N.index in d.content){let B=d.content[N.index];d.content[N.index]=lr(this,Lg,"m",z9e).call(this,N,B)}else d.content[N.index]=N,y.push(N);return[d,y];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(d)return[d,y];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},z9e=function(s,d){return JN.accumulateDelta(d,s)},U9e=function(s){switch(qo(this,Xbt,s.data),s.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":qo(this,ZN,s.data),lr(this,Tw,"f")&&(this._emit("toolCallDone",lr(this,Tw,"f")),qo(this,Tw,void 0));break}};let S$t=class extends Fs{constructor(){super(...arguments),this.steps=new WNe(this._client)}create(s,d,y){const{include:S,...N}=d;return this._client.post(Ji`/threads/${s}/runs`,{query:{include:S},body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers]),stream:d.stream??!1})}retrieve(s,d,y){const{thread_id:S}=d;return this._client.get(Ji`/threads/${S}/runs/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,d,y){const{thread_id:S,...N}=d;return this._client.post(Ji`/threads/${S}/runs/${s}`,{body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,d={},y){return this._client.getAPIList(Ji`/threads/${s}/runs`,h0,{query:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}cancel(s,d,y){const{thread_id:S}=d;return this._client.post(Ji`/threads/${S}/runs/${s}/cancel`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,d,y){const S=await this.create(s,d,y);return await this.poll(S.id,{thread_id:s},y)}createAndStream(s,d,y){return AQ.createAssistantStream(s,this._client.beta.threads.runs,d,y)}async poll(s,d,y){var N;const S=hs([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const{data:B,response:H}=await this.retrieve(s,d,{...y,headers:{...y==null?void 0:y.headers,...S}}).withResponse();switch(B.status){case"queued":case"in_progress":case"cancelling":let et=5e3;if(y!=null&&y.pollIntervalMs)et=y.pollIntervalMs;else{const W=H.headers.get("openai-poll-after-ms");if(W){const nt=parseInt(W);isNaN(nt)||(et=nt)}}await JQ(et);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return B}}}stream(s,d,y){return AQ.createAssistantStream(s,this._client.beta.threads.runs,d,y)}submitToolOutputs(s,d,y){const{thread_id:S,...N}=d;return this._client.post(Ji`/threads/${S}/runs/${s}/submit_tool_outputs`,{body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers]),stream:d.stream??!1})}async submitToolOutputsAndPoll(s,d,y){const S=await this.submitToolOutputs(s,d,y);return await this.poll(S.id,d,y)}submitToolOutputsStream(s,d,y){return AQ.createToolAssistantStream(s,this._client.beta.threads.runs,d,y)}};S$t.Steps=WNe;class c2t extends Fs{constructor(){super(...arguments),this.runs=new S$t(this._client),this.messages=new qNe(this._client)}create(s={},d){return this._client.post("/threads",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}retrieve(s,d){return this._client.get(Ji`/threads/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}update(s,d,y){return this._client.post(Ji`/threads/${s}`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,d){return this._client.delete(Ji`/threads/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}createAndRun(s,d){return this._client.post("/threads/runs",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers]),stream:s.stream??!1})}async createAndRunPoll(s,d){const y=await this.createAndRun(s,d);return await this.runs.poll(y.id,{thread_id:y.thread_id},d)}createAndRunStream(s,d){return AQ.createThreadAssistantStream(s,this._client.beta.threads,d)}}c2t.Runs=S$t;c2t.Messages=qNe;class t$ extends Fs{constructor(){super(...arguments),this.realtime=new s2t(this._client),this.chatkit=new o2t(this._client),this.assistants=new $Ne(this._client),this.threads=new c2t(this._client)}}t$.Realtime=s2t;t$.ChatKit=o2t;t$.Assistants=$Ne;t$.Threads=c2t;class KNe extends Fs{create(s,d){return this._client.post("/completions",{body:s,...d,stream:s.stream??!1})}}class YNe extends Fs{retrieve(s,d,y){const{container_id:S}=d;return this._client.get(Ji`/containers/${S}/files/${s}/content`,{...y,headers:hs([{Accept:"application/binary"},y==null?void 0:y.headers]),__binaryResponse:!0})}}let A$t=class extends Fs{constructor(){super(...arguments),this.content=new YNe(this._client)}create(s,d,y){return this._client.post(Ji`/containers/${s}/files`,cL({body:d,...y},this._client))}retrieve(s,d,y){const{container_id:S}=d;return this._client.get(Ji`/containers/${S}/files/${s}`,y)}list(s,d={},y){return this._client.getAPIList(Ji`/containers/${s}/files`,h0,{query:d,...y})}delete(s,d,y){const{container_id:S}=d;return this._client.delete(Ji`/containers/${S}/files/${s}`,{...y,headers:hs([{Accept:"*/*"},y==null?void 0:y.headers])})}};A$t.Content=YNe;class I$t extends Fs{constructor(){super(...arguments),this.files=new A$t(this._client)}create(s,d){return this._client.post("/containers",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/containers/${s}`,d)}list(s={},d){return this._client.getAPIList("/containers",h0,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/containers/${s}`,{...d,headers:hs([{Accept:"*/*"},d==null?void 0:d.headers])})}}I$t.Files=A$t;class GNe extends Fs{create(s,d,y){const{include:S,...N}=d;return this._client.post(Ji`/conversations/${s}/items`,{query:{include:S},body:N,...y})}retrieve(s,d,y){const{conversation_id:S,...N}=d;return this._client.get(Ji`/conversations/${S}/items/${s}`,{query:N,...y})}list(s,d={},y){return this._client.getAPIList(Ji`/conversations/${s}/items`,Smt,{query:d,...y})}delete(s,d,y){const{conversation_id:S}=d;return this._client.delete(Ji`/conversations/${S}/items/${s}`,y)}}class O$t extends Fs{constructor(){super(...arguments),this.items=new GNe(this._client)}create(s={},d){return this._client.post("/conversations",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/conversations/${s}`,d)}update(s,d,y){return this._client.post(Ji`/conversations/${s}`,{body:d,...y})}delete(s,d){return this._client.delete(Ji`/conversations/${s}`,d)}}O$t.Items=GNe;class VNe extends Fs{create(s,d){const y=!!s.encoding_format;let S=y?s.encoding_format:"base64";y&&Ng(this._client).debug("embeddings/user defined encoding_format:",s.encoding_format);const N=this._client.post("/embeddings",{body:{...s,encoding_format:S},...d});return y?N:(Ng(this._client).debug("embeddings/decoding base64 embeddings from base64"),N._thenUnwrap(B=>(B&&B.data&&B.data.forEach(H=>{const et=H.embedding;H.embedding=A$n(et)}),B)))}}class XNe extends Fs{retrieve(s,d,y){const{eval_id:S,run_id:N}=d;return this._client.get(Ji`/evals/${S}/runs/${N}/output_items/${s}`,y)}list(s,d,y){const{eval_id:S,...N}=d;return this._client.getAPIList(Ji`/evals/${S}/runs/${s}/output_items`,h0,{query:N,...y})}}class N$t extends Fs{constructor(){super(...arguments),this.outputItems=new XNe(this._client)}create(s,d,y){return this._client.post(Ji`/evals/${s}/runs`,{body:d,...y})}retrieve(s,d,y){const{eval_id:S}=d;return this._client.get(Ji`/evals/${S}/runs/${s}`,y)}list(s,d={},y){return this._client.getAPIList(Ji`/evals/${s}/runs`,h0,{query:d,...y})}delete(s,d,y){const{eval_id:S}=d;return this._client.delete(Ji`/evals/${S}/runs/${s}`,y)}cancel(s,d,y){const{eval_id:S}=d;return this._client.post(Ji`/evals/${S}/runs/${s}`,y)}}N$t.OutputItems=XNe;class L$t extends Fs{constructor(){super(...arguments),this.runs=new N$t(this._client)}create(s,d){return this._client.post("/evals",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/evals/${s}`,d)}update(s,d,y){return this._client.post(Ji`/evals/${s}`,{body:d,...y})}list(s={},d){return this._client.getAPIList("/evals",h0,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/evals/${s}`,d)}}L$t.Runs=N$t;let QNe=class extends Fs{create(s,d){return this._client.post("/files",cL({body:s,...d},this._client))}retrieve(s,d){return this._client.get(Ji`/files/${s}`,d)}list(s={},d){return this._client.getAPIList("/files",h0,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/files/${s}`,d)}content(s,d){return this._client.get(Ji`/files/${s}/content`,{...d,headers:hs([{Accept:"application/binary"},d==null?void 0:d.headers]),__binaryResponse:!0})}async waitForProcessing(s,{pollInterval:d=5e3,maxWait:y=30*60*1e3}={}){const S=new Set(["processed","error","deleted"]),N=Date.now();let B=await this.retrieve(s);for(;!B.status||!S.has(B.status);)if(await JQ(d),B=await this.retrieve(s),Date.now()-N>y)throw new m$t({message:`Giving up on waiting for file ${s} to finish processing after ${y} milliseconds.`});return B}};class JNe extends Fs{}let ZNe=class extends Fs{run(s,d){return this._client.post("/fine_tuning/alpha/graders/run",{body:s,...d})}validate(s,d){return this._client.post("/fine_tuning/alpha/graders/validate",{body:s,...d})}};class M$t extends Fs{constructor(){super(...arguments),this.graders=new ZNe(this._client)}}M$t.Graders=ZNe;class tLe extends Fs{create(s,d,y){return this._client.getAPIList(Ji`/fine_tuning/checkpoints/${s}/permissions`,a2t,{body:d,method:"post",...y})}retrieve(s,d={},y){return this._client.get(Ji`/fine_tuning/checkpoints/${s}/permissions`,{query:d,...y})}delete(s,d,y){const{fine_tuned_model_checkpoint:S}=d;return this._client.delete(Ji`/fine_tuning/checkpoints/${S}/permissions/${s}`,y)}}let P$t=class extends Fs{constructor(){super(...arguments),this.permissions=new tLe(this._client)}};P$t.Permissions=tLe;class eLe extends Fs{list(s,d={},y){return this._client.getAPIList(Ji`/fine_tuning/jobs/${s}/checkpoints`,h0,{query:d,...y})}}class R$t extends Fs{constructor(){super(...arguments),this.checkpoints=new eLe(this._client)}create(s,d){return this._client.post("/fine_tuning/jobs",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/fine_tuning/jobs/${s}`,d)}list(s={},d){return this._client.getAPIList("/fine_tuning/jobs",h0,{query:s,...d})}cancel(s,d){return this._client.post(Ji`/fine_tuning/jobs/${s}/cancel`,d)}listEvents(s,d={},y){return this._client.getAPIList(Ji`/fine_tuning/jobs/${s}/events`,h0,{query:d,...y})}pause(s,d){return this._client.post(Ji`/fine_tuning/jobs/${s}/pause`,d)}resume(s,d){return this._client.post(Ji`/fine_tuning/jobs/${s}/resume`,d)}}R$t.Checkpoints=eLe;class e$ extends Fs{constructor(){super(...arguments),this.methods=new JNe(this._client),this.jobs=new R$t(this._client),this.checkpoints=new P$t(this._client),this.alpha=new M$t(this._client)}}e$.Methods=JNe;e$.Jobs=R$t;e$.Checkpoints=P$t;e$.Alpha=M$t;class nLe extends Fs{}class D$t extends Fs{constructor(){super(...arguments),this.graderModels=new nLe(this._client)}}D$t.GraderModels=nLe;class rLe extends Fs{createVariation(s,d){return this._client.post("/images/variations",cL({body:s,...d},this._client))}edit(s,d){return this._client.post("/images/edits",cL({body:s,...d,stream:s.stream??!1},this._client))}generate(s,d){return this._client.post("/images/generations",{body:s,...d,stream:s.stream??!1})}}class iLe extends Fs{retrieve(s,d){return this._client.get(Ji`/models/${s}`,d)}list(s){return this._client.getAPIList("/models",a2t,s)}delete(s,d){return this._client.delete(Ji`/models/${s}`,d)}}class aLe extends Fs{create(s,d){return this._client.post("/moderations",{body:s,...d})}}class sLe extends Fs{accept(s,d,y){return this._client.post(Ji`/realtime/calls/${s}/accept`,{body:d,...y,headers:hs([{Accept:"*/*"},y==null?void 0:y.headers])})}hangup(s,d){return this._client.post(Ji`/realtime/calls/${s}/hangup`,{...d,headers:hs([{Accept:"*/*"},d==null?void 0:d.headers])})}refer(s,d,y){return this._client.post(Ji`/realtime/calls/${s}/refer`,{body:d,...y,headers:hs([{Accept:"*/*"},y==null?void 0:y.headers])})}reject(s,d={},y){return this._client.post(Ji`/realtime/calls/${s}/reject`,{body:d,...y,headers:hs([{Accept:"*/*"},y==null?void 0:y.headers])})}}class oLe extends Fs{create(s,d){return this._client.post("/realtime/client_secrets",{body:s,...d})}}class u2t extends Fs{constructor(){super(...arguments),this.clientSecrets=new oLe(this._client),this.calls=new sLe(this._client)}}u2t.ClientSecrets=oLe;u2t.Calls=sLe;function I$n(o,s){return!s||!N$n(s)?{...o,output_parsed:null,output:o.output.map(d=>d.type==="function_call"?{...d,parsed_arguments:null}:d.type==="message"?{...d,content:d.content.map(y=>({...y,parsed:null}))}:d)}:cLe(o,s)}function cLe(o,s){const d=o.output.map(S=>{if(S.type==="function_call")return{...S,parsed_arguments:P$n(s,S)};if(S.type==="message"){const N=S.content.map(B=>B.type==="output_text"?{...B,parsed:O$n(s,B.text)}:B);return{...S,content:N}}return S}),y=Object.assign({},o,{output:d});return Object.getOwnPropertyDescriptor(o,"output_text")||CFt(y),Object.defineProperty(y,"output_parsed",{enumerable:!0,get(){for(const S of y.output)if(S.type==="message"){for(const N of S.content)if(N.type==="output_text"&&N.parsed!==null)return N.parsed}return null}}),y}function O$n(o,s){var d,y,S,N;return((y=(d=o.text)==null?void 0:d.format)==null?void 0:y.type)!=="json_schema"?null:"$parseRaw"in((S=o.text)==null?void 0:S.format)?((N=o.text)==null?void 0:N.format).$parseRaw(s):JSON.parse(s)}function N$n(o){var s;return!!_$t((s=o.text)==null?void 0:s.format)}function L$n(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function M$n(o,s){return o.find(d=>d.type==="function"&&d.name===s)}function P$n(o,s){const d=M$n(o.tools??[],s.name);return{...s,...s,parsed_arguments:L$n(d)?d.$parseRaw(s.arguments):d!=null&&d.strict?JSON.parse(s.arguments):null}}function CFt(o){const s=[];for(const d of o.output)if(d.type==="message")for(const y of d.content)y.type==="output_text"&&s.push(y.text);o.output_text=s.join("")}var EF,Nbt,XS,Lbt,q9e,W9e,K9e,Y9e;class B$t extends E$t{constructor(s){super(),EF.add(this),Nbt.set(this,void 0),XS.set(this,void 0),Lbt.set(this,void 0),qo(this,Nbt,s)}static createResponse(s,d,y){const S=new B$t(d);return S._run(()=>S._createOrRetrieveResponse(s,d,{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),S}async _createOrRetrieveResponse(s,d,y){var H;const S=y==null?void 0:y.signal;S&&(S.aborted&&this.controller.abort(),S.addEventListener("abort",()=>this.controller.abort())),lr(this,EF,"m",q9e).call(this);let N,B=null;"response_id"in d?(N=await s.responses.retrieve(d.response_id,{stream:!0},{...y,signal:this.controller.signal,stream:!0}),B=d.starting_after??null):N=await s.responses.create({...d,stream:!0},{...y,signal:this.controller.signal}),this._connected();for await(const et of N)lr(this,EF,"m",W9e).call(this,et,B);if((H=N.controller.signal)!=null&&H.aborted)throw new A3;return lr(this,EF,"m",K9e).call(this)}[(Nbt=new WeakMap,XS=new WeakMap,Lbt=new WeakMap,EF=new WeakSet,q9e=function(){this.ended||qo(this,XS,void 0)},W9e=function(d,y){if(this.ended)return;const S=(B,H)=>{(y==null||H.sequence_number>y)&&this._emit(B,H)},N=lr(this,EF,"m",Y9e).call(this,d);switch(S("event",d),d.type){case"response.output_text.delta":{const B=N.output[d.output_index];if(!B)throw new ro(`missing output at index ${d.output_index}`);if(B.type==="message"){const H=B.content[d.content_index];if(!H)throw new ro(`missing content at index ${d.content_index}`);if(H.type!=="output_text")throw new ro(`expected content to be 'output_text', got ${H.type}`);S("response.output_text.delta",{...d,snapshot:H.text})}break}case"response.function_call_arguments.delta":{const B=N.output[d.output_index];if(!B)throw new ro(`missing output at index ${d.output_index}`);B.type==="function_call"&&S("response.function_call_arguments.delta",{...d,snapshot:B.arguments});break}default:S(d.type,d);break}},K9e=function(){if(this.ended)throw new ro("stream has ended, this shouldn't happen");const d=lr(this,XS,"f");if(!d)throw new ro("request ended without sending any events");qo(this,XS,void 0);const y=R$n(d,lr(this,Nbt,"f"));return qo(this,Lbt,y),y},Y9e=function(d){var S;let y=lr(this,XS,"f");if(!y){if(d.type!=="response.created")throw new ro(`When snapshot hasn't been set yet, expected 'response.created' event, got ${d.type}`);return y=qo(this,XS,d.response),y}switch(d.type){case"response.output_item.added":{y.output.push(d.item);break}case"response.content_part.added":{const N=y.output[d.output_index];if(!N)throw new ro(`missing output at index ${d.output_index}`);const B=N.type,H=d.part;B==="message"&&H.type!=="reasoning_text"?N.content.push(H):B==="reasoning"&&H.type==="reasoning_text"&&(N.content||(N.content=[]),N.content.push(H));break}case"response.output_text.delta":{const N=y.output[d.output_index];if(!N)throw new ro(`missing output at index ${d.output_index}`);if(N.type==="message"){const B=N.content[d.content_index];if(!B)throw new ro(`missing content at index ${d.content_index}`);if(B.type!=="output_text")throw new ro(`expected content to be 'output_text', got ${B.type}`);B.text+=d.delta}break}case"response.function_call_arguments.delta":{const N=y.output[d.output_index];if(!N)throw new ro(`missing output at index ${d.output_index}`);N.type==="function_call"&&(N.arguments+=d.delta);break}case"response.reasoning_text.delta":{const N=y.output[d.output_index];if(!N)throw new ro(`missing output at index ${d.output_index}`);if(N.type==="reasoning"){const B=(S=N.content)==null?void 0:S[d.content_index];if(!B)throw new ro(`missing content at index ${d.content_index}`);if(B.type!=="reasoning_text")throw new ro(`expected content to be 'reasoning_text', got ${B.type}`);B.text+=d.delta}break}case"response.completed":{qo(this,XS,d.response);break}}return y},Symbol.asyncIterator)](){const s=[],d=[];let y=!1;return this.on("event",S=>{const N=d.shift();N?N.resolve(S):s.push(S)}),this.on("end",()=>{y=!0;for(const S of d)S.resolve(void 0);d.length=0}),this.on("abort",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),this.on("error",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,B)=>d.push({resolve:N,reject:B})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const s=lr(this,Lbt,"f");if(!s)throw new ro("stream ended without producing a ChatCompletion");return s}}function R$n(o,s){return I$n(o,s)}class uLe extends Fs{list(s,d={},y){return this._client.getAPIList(Ji`/responses/${s}/input_items`,h0,{query:d,...y})}}class lLe extends Fs{count(s={},d){return this._client.post("/responses/input_tokens",{body:s,...d})}}class l2t extends Fs{constructor(){super(...arguments),this.inputItems=new uLe(this._client),this.inputTokens=new lLe(this._client)}create(s,d){return this._client.post("/responses",{body:s,...d,stream:s.stream??!1})._thenUnwrap(y=>("object"in y&&y.object==="response"&&CFt(y),y))}retrieve(s,d={},y){return this._client.get(Ji`/responses/${s}`,{query:d,...y,stream:(d==null?void 0:d.stream)??!1})._thenUnwrap(S=>("object"in S&&S.object==="response"&&CFt(S),S))}delete(s,d){return this._client.delete(Ji`/responses/${s}`,{...d,headers:hs([{Accept:"*/*"},d==null?void 0:d.headers])})}parse(s,d){return this._client.responses.create(s,d)._thenUnwrap(y=>cLe(y,s))}stream(s,d){return B$t.createResponse(this._client,s,d)}cancel(s,d){return this._client.post(Ji`/responses/${s}/cancel`,d)}compact(s,d){return this._client.post("/responses/compact",{body:s,...d})}}l2t.InputItems=uLe;l2t.InputTokens=lLe;class hLe extends Fs{create(s,d,y){return this._client.post(Ji`/uploads/${s}/parts`,cL({body:d,...y},this._client))}}class F$t extends Fs{constructor(){super(...arguments),this.parts=new hLe(this._client)}create(s,d){return this._client.post("/uploads",{body:s,...d})}cancel(s,d){return this._client.post(Ji`/uploads/${s}/cancel`,d)}complete(s,d,y){return this._client.post(Ji`/uploads/${s}/complete`,{body:d,...y})}}F$t.Parts=hLe;const D$n=async o=>{const s=await Promise.allSettled(o),d=s.filter(S=>S.status==="rejected");if(d.length){for(const S of d)console.error(S.reason);throw new Error(`${d.length} promise(s) failed - see the above errors`)}const y=[];for(const S of s)S.status==="fulfilled"&&y.push(S.value);return y};class fLe extends Fs{create(s,d,y){return this._client.post(Ji`/vector_stores/${s}/file_batches`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,d,y){const{vector_store_id:S}=d;return this._client.get(Ji`/vector_stores/${S}/file_batches/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}cancel(s,d,y){const{vector_store_id:S}=d;return this._client.post(Ji`/vector_stores/${S}/file_batches/${s}/cancel`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,d,y){const S=await this.create(s,d);return await this.poll(s,S.id,y)}listFiles(s,d,y){const{vector_store_id:S,...N}=d;return this._client.getAPIList(Ji`/vector_stores/${S}/file_batches/${s}/files`,h0,{query:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async poll(s,d,y){var N;const S=hs([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const{data:B,response:H}=await this.retrieve(d,{vector_store_id:s},{...y,headers:S}).withResponse();switch(B.status){case"in_progress":let et=5e3;if(y!=null&&y.pollIntervalMs)et=y.pollIntervalMs;else{const W=H.headers.get("openai-poll-after-ms");if(W){const nt=parseInt(W);isNaN(nt)||(et=nt)}}await JQ(et);break;case"failed":case"cancelled":case"completed":return B}}}async uploadAndPoll(s,{files:d,fileIds:y=[]},S){if(d==null||d.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const N=(S==null?void 0:S.maxConcurrency)??5,B=Math.min(N,d.length),H=this._client,et=d.values(),W=[...y];async function nt(Q){for(let at of Q){const mt=await H.files.create({file:at,purpose:"assistants"},S);W.push(mt.id)}}const K=Array(B).fill(et).map(nt);return await D$n(K),await this.createAndPoll(s,{file_ids:W})}}class dLe extends Fs{create(s,d,y){return this._client.post(Ji`/vector_stores/${s}/files`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,d,y){const{vector_store_id:S}=d;return this._client.get(Ji`/vector_stores/${S}/files/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,d,y){const{vector_store_id:S,...N}=d;return this._client.post(Ji`/vector_stores/${S}/files/${s}`,{body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,d={},y){return this._client.getAPIList(Ji`/vector_stores/${s}/files`,h0,{query:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,d,y){const{vector_store_id:S}=d;return this._client.delete(Ji`/vector_stores/${S}/files/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,d,y){const S=await this.create(s,d,y);return await this.poll(s,S.id,y)}async poll(s,d,y){var N;const S=hs([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const B=await this.retrieve(d,{vector_store_id:s},{...y,headers:S}).withResponse(),H=B.data;switch(H.status){case"in_progress":let et=5e3;if(y!=null&&y.pollIntervalMs)et=y.pollIntervalMs;else{const W=B.response.headers.get("openai-poll-after-ms");if(W){const nt=parseInt(W);isNaN(nt)||(et=nt)}}await JQ(et);break;case"failed":case"completed":return H}}}async upload(s,d,y){const S=await this._client.files.create({file:d,purpose:"assistants"},y);return this.create(s,{file_id:S.id},y)}async uploadAndPoll(s,d,y){const S=await this.upload(s,d,y);return await this.poll(s,S.id,y)}content(s,d,y){const{vector_store_id:S}=d;return this._client.getAPIList(Ji`/vector_stores/${S}/files/${s}/content`,a2t,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}class h2t extends Fs{constructor(){super(...arguments),this.files=new dLe(this._client),this.fileBatches=new fLe(this._client)}create(s,d){return this._client.post("/vector_stores",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}retrieve(s,d){return this._client.get(Ji`/vector_stores/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}update(s,d,y){return this._client.post(Ji`/vector_stores/${s}`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s={},d){return this._client.getAPIList("/vector_stores",h0,{query:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}delete(s,d){return this._client.delete(Ji`/vector_stores/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}search(s,d,y){return this._client.getAPIList(Ji`/vector_stores/${s}/search`,a2t,{body:d,method:"post",...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}h2t.Files=dLe;h2t.FileBatches=fLe;class pLe extends Fs{create(s,d){return this._client.post("/videos",L9e({body:s,...d},this._client))}retrieve(s,d){return this._client.get(Ji`/videos/${s}`,d)}list(s={},d){return this._client.getAPIList("/videos",Smt,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/videos/${s}`,d)}downloadContent(s,d={},y){return this._client.get(Ji`/videos/${s}/content`,{query:d,...y,headers:hs([{Accept:"application/binary"},y==null?void 0:y.headers]),__binaryResponse:!0})}remix(s,d,y){return this._client.post(Ji`/videos/${s}/remix`,L9e({body:d,...y},this._client))}}var OF,gLe,Qbt;class bLe extends Fs{constructor(){super(...arguments),OF.add(this)}async unwrap(s,d,y=this._client.webhookSecret,S=300){return await this.verifySignature(s,d,y,S),JSON.parse(s)}async verifySignature(s,d,y=this._client.webhookSecret,S=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");lr(this,OF,"m",gLe).call(this,y);const N=hs([d]).values,B=lr(this,OF,"m",Qbt).call(this,N,"webhook-signature"),H=lr(this,OF,"m",Qbt).call(this,N,"webhook-timestamp"),et=lr(this,OF,"m",Qbt).call(this,N,"webhook-id"),W=parseInt(H,10);if(isNaN(W))throw new hQ("Invalid webhook timestamp format");const nt=Math.floor(Date.now()/1e3);if(nt-W>S)throw new hQ("Webhook timestamp is too old");if(W>nt+S)throw new hQ("Webhook timestamp is too new");const K=B.split(" ").map(Lt=>Lt.startsWith("v1,")?Lt.substring(3):Lt),Q=y.startsWith("whsec_")?Buffer.from(y.replace("whsec_",""),"base64"):Buffer.from(y,"utf-8"),at=et?`${et}.${H}.${s}`:`${H}.${s}`,mt=await crypto.subtle.importKey("raw",Q,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(const Lt of K)try{const Pt=Buffer.from(Lt,"base64");if(await crypto.subtle.verify("HMAC",mt,Pt,new TextEncoder().encode(at)))return}catch{continue}throw new hQ("The given webhook signature does not match the expected signature")}}OF=new WeakSet,gLe=function(s){if(typeof s!="string"||s.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},Qbt=function(s,d){if(!s)throw new Error("Headers are required");const y=s.get(d);if(y==null)throw new Error(`Missing required header: ${d}`);return y};var SFt,$$t,Jbt,mLe;class bu{constructor({baseURL:s=xF("OPENAI_BASE_URL"),apiKey:d=xF("OPENAI_API_KEY"),organization:y=xF("OPENAI_ORG_ID")??null,project:S=xF("OPENAI_PROJECT_ID")??null,webhookSecret:N=xF("OPENAI_WEBHOOK_SECRET")??null,...B}={}){if(SFt.add(this),Jbt.set(this,void 0),this.completions=new KNe(this),this.chat=new C$t(this),this.embeddings=new VNe(this),this.files=new QNe(this),this.images=new rLe(this),this.audio=new tJ(this),this.moderations=new aLe(this),this.models=new iLe(this),this.fineTuning=new e$(this),this.graders=new D$t(this),this.vectorStores=new h2t(this),this.webhooks=new bLe(this),this.beta=new t$(this),this.batches=new FNe(this),this.uploads=new F$t(this),this.responses=new l2t(this),this.realtime=new u2t(this),this.conversations=new O$t(this),this.evals=new L$t(this),this.containers=new I$t(this),this.videos=new pLe(this),d===void 0)throw new ro("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");const H={apiKey:d,organization:y,project:S,webhookSecret:N,...B,baseURL:s||"https://api.openai.com/v1"};if(!H.dangerouslyAllowBrowser&&FFn())throw new ro(`It looks like you're running in a browser-like environment.
1906
+ ${Obt(o)}`);return{...sr,id:cn,type:fe,function:{...nr,name:qn,arguments:Fn}}})}}:{...at,message:{...Mt,content:mt,role:ie,refusal:W.refusal??null},finish_reason:nt,index:K,logprobs:Q}}),created:S,model:N,object:"chat.completion",...B?{system_fingerprint:B}:{}};return b$n(et,s)}function Obt(o){return JSON.stringify(o)}class Mmt extends qQ{static fromReadableStream(s){const d=new Mmt(null);return d._run(()=>d._fromReadableStream(s)),d}static runTools(s,d,y){const S=new Mmt(d),N={...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"runTools"}};return S._run(()=>S._runTools(s,d,N)),S}}let k$t=class extends Fs{constructor(){super(...arguments),this.messages=new dNe(this._client)}create(s,d){return this._client.post("/chat/completions",{body:s,...d,stream:s.stream??!1})}retrieve(s,d){return this._client.get(Ji`/chat/completions/${s}`,d)}update(s,d,y){return this._client.post(Ji`/chat/completions/${s}`,{body:d,...y})}list(s={},d){return this._client.getAPIList("/chat/completions",h0,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/chat/completions/${s}`,d)}parse(s,d){return v$n(s.tools),this._client.chat.completions.create(s,{...d,headers:{...d==null?void 0:d.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(y=>x$t(y,s))}runTools(s,d){return s.stream?Mmt.runTools(this._client,s,d):T$t.runTools(this._client,s,d)}stream(s,d){return qQ.createChatCompletion(this._client,s,d)}};k$t.Messages=dNe;class C$t extends Fs{constructor(){super(...arguments),this.completions=new k$t(this._client)}}C$t.Completions=k$t;const PNe=Symbol("brand.privateNullableHeaders");function*I$n(o){if(!o)return;if(PNe in o){const{values:y,nulls:S}=o;yield*y.entries();for(const N of S)yield[N,null];return}let s=!1,d;o instanceof Headers?d=o.entries():v9e(o)?d=o:(s=!0,d=Object.entries(o??{}));for(let y of d){const S=y[0];if(typeof S!="string")throw new TypeError("expected header name to be a string");const N=v9e(y[1])?y[1]:[y[1]];let B=!1;for(const H of N)H!==void 0&&(s&&!B&&(B=!0,yield[S,null]),yield[S,H])}}const hs=o=>{const s=new Headers,d=new Set;for(const y of o){const S=new Set;for(const[N,B]of I$n(y)){const H=N.toLowerCase();S.has(H)||(s.delete(N),S.add(H)),B===null?(s.delete(N),d.add(H)):(s.append(N,B),d.delete(H))}}return{[PNe]:!0,values:s,nulls:d}};class RNe extends Fs{create(s,d){return this._client.post("/audio/speech",{body:s,...d,headers:hs([{Accept:"application/octet-stream"},d==null?void 0:d.headers]),__binaryResponse:!0})}}class DNe extends Fs{create(s,d){return this._client.post("/audio/transcriptions",cL({body:s,...d,stream:s.stream??!1,__metadata:{model:s.model}},this._client))}}class BNe extends Fs{create(s,d){return this._client.post("/audio/translations",cL({body:s,...d,__metadata:{model:s.model}},this._client))}}class tJ extends Fs{constructor(){super(...arguments),this.transcriptions=new DNe(this._client),this.translations=new BNe(this._client),this.speech=new RNe(this._client)}}tJ.Transcriptions=DNe;tJ.Translations=BNe;tJ.Speech=RNe;class FNe extends Fs{create(s,d){return this._client.post("/batches",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/batches/${s}`,d)}list(s={},d){return this._client.getAPIList("/batches",h0,{query:s,...d})}cancel(s,d){return this._client.post(Ji`/batches/${s}/cancel`,d)}}class $Ne extends Fs{create(s,d){return this._client.post("/assistants",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}retrieve(s,d){return this._client.get(Ji`/assistants/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}update(s,d,y){return this._client.post(Ji`/assistants/${s}`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s={},d){return this._client.getAPIList("/assistants",h0,{query:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}delete(s,d){return this._client.delete(Ji`/assistants/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}}let jNe=class extends Fs{create(s,d){return this._client.post("/realtime/sessions",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}};class HNe extends Fs{create(s,d){return this._client.post("/realtime/transcription_sessions",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}}let s2t=class extends Fs{constructor(){super(...arguments),this.sessions=new jNe(this._client),this.transcriptionSessions=new HNe(this._client)}};s2t.Sessions=jNe;s2t.TranscriptionSessions=HNe;class zNe extends Fs{create(s,d){return this._client.post("/chatkit/sessions",{body:s,...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}cancel(s,d){return this._client.post(Ji`/chatkit/sessions/${s}/cancel`,{...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}}let UNe=class extends Fs{retrieve(s,d){return this._client.get(Ji`/chatkit/threads/${s}`,{...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}list(s={},d){return this._client.getAPIList("/chatkit/threads",Smt,{query:s,...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}delete(s,d){return this._client.delete(Ji`/chatkit/threads/${s}`,{...d,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},d==null?void 0:d.headers])})}listItems(s,d={},y){return this._client.getAPIList(Ji`/chatkit/threads/${s}/items`,Smt,{query:d,...y,headers:hs([{"OpenAI-Beta":"chatkit_beta=v1"},y==null?void 0:y.headers])})}};class o2t extends Fs{constructor(){super(...arguments),this.sessions=new zNe(this._client),this.threads=new UNe(this._client)}}o2t.Sessions=zNe;o2t.Threads=UNe;class qNe extends Fs{create(s,d,y){return this._client.post(Ji`/threads/${s}/messages`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,d,y){const{thread_id:S}=d;return this._client.get(Ji`/threads/${S}/messages/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,d,y){const{thread_id:S,...N}=d;return this._client.post(Ji`/threads/${S}/messages/${s}`,{body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,d={},y){return this._client.getAPIList(Ji`/threads/${s}/messages`,h0,{query:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,d,y){const{thread_id:S}=d;return this._client.delete(Ji`/threads/${S}/messages/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}class WNe extends Fs{retrieve(s,d,y){const{thread_id:S,run_id:N,...B}=d;return this._client.get(Ji`/threads/${S}/runs/${N}/steps/${s}`,{query:B,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,d,y){const{thread_id:S,...N}=d;return this._client.getAPIList(Ji`/threads/${S}/runs/${s}/steps`,h0,{query:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}const O$n=o=>{if(typeof Buffer<"u"){const s=Buffer.from(o,"base64");return Array.from(new Float32Array(s.buffer,s.byteOffset,s.length/Float32Array.BYTES_PER_ELEMENT))}else{const s=atob(o),d=s.length,y=new Uint8Array(d);for(let S=0;S<d;S++)y[S]=s.charCodeAt(S);return Array.from(new Float32Array(y.buffer))}};var uBt={};const xF=o=>{var s,d,y,S;if(typeof globalThis.process<"u")return((s=uBt==null?void 0:uBt[o])==null?void 0:s.trim())??void 0;if(typeof globalThis.Deno<"u")return(S=(y=(d=globalThis.Deno.env)==null?void 0:d.get)==null?void 0:y.call(d,o))==null?void 0:S.trim()};var Lg,JN,kFt,w6,Gbt,X_,ZN,LF,VN,Pmt,Tw,Vbt,Xbt,SQ,yQ,wQ,B9e,F9e,$9e,j9e,H9e,z9e,U9e;class AQ extends E$t{constructor(){super(...arguments),Lg.add(this),kFt.set(this,[]),w6.set(this,{}),Gbt.set(this,{}),X_.set(this,void 0),ZN.set(this,void 0),LF.set(this,void 0),VN.set(this,void 0),Pmt.set(this,void 0),Tw.set(this,void 0),Vbt.set(this,void 0),Xbt.set(this,void 0),SQ.set(this,void 0)}[(kFt=new WeakMap,w6=new WeakMap,Gbt=new WeakMap,X_=new WeakMap,ZN=new WeakMap,LF=new WeakMap,VN=new WeakMap,Pmt=new WeakMap,Tw=new WeakMap,Vbt=new WeakMap,Xbt=new WeakMap,SQ=new WeakMap,Lg=new WeakSet,Symbol.asyncIterator)](){const s=[],d=[];let y=!1;return this.on("event",S=>{const N=d.shift();N?N.resolve(S):s.push(S)}),this.on("end",()=>{y=!0;for(const S of d)S.resolve(void 0);d.length=0}),this.on("abort",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),this.on("error",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,B)=>d.push({resolve:N,reject:B})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(s){const d=new JN;return d._run(()=>d._fromReadableStream(s)),d}async _fromReadableStream(s,d){var N;const y=d==null?void 0:d.signal;y&&(y.aborted&&this.controller.abort(),y.addEventListener("abort",()=>this.controller.abort())),this._connected();const S=E6.fromReadableStream(s,this.controller);for await(const B of S)lr(this,Lg,"m",yQ).call(this,B);if((N=S.controller.signal)!=null&&N.aborted)throw new A3;return this._addRun(lr(this,Lg,"m",wQ).call(this))}toReadableStream(){return new E6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(s,d,y,S){const N=new JN;return N._run(()=>N._runToolAssistantStream(s,d,y,{...S,headers:{...S==null?void 0:S.headers,"X-Stainless-Helper-Method":"stream"}})),N}async _createToolAssistantStream(s,d,y,S){var et;const N=S==null?void 0:S.signal;N&&(N.aborted&&this.controller.abort(),N.addEventListener("abort",()=>this.controller.abort()));const B={...y,stream:!0},H=await s.submitToolOutputs(d,B,{...S,signal:this.controller.signal});this._connected();for await(const W of H)lr(this,Lg,"m",yQ).call(this,W);if((et=H.controller.signal)!=null&&et.aborted)throw new A3;return this._addRun(lr(this,Lg,"m",wQ).call(this))}static createThreadAssistantStream(s,d,y){const S=new JN;return S._run(()=>S._threadAssistantStream(s,d,{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),S}static createAssistantStream(s,d,y,S){const N=new JN;return N._run(()=>N._runAssistantStream(s,d,y,{...S,headers:{...S==null?void 0:S.headers,"X-Stainless-Helper-Method":"stream"}})),N}currentEvent(){return lr(this,Vbt,"f")}currentRun(){return lr(this,Xbt,"f")}currentMessageSnapshot(){return lr(this,X_,"f")}currentRunStepSnapshot(){return lr(this,SQ,"f")}async finalRunSteps(){return await this.done(),Object.values(lr(this,w6,"f"))}async finalMessages(){return await this.done(),Object.values(lr(this,Gbt,"f"))}async finalRun(){if(await this.done(),!lr(this,ZN,"f"))throw Error("Final run was not received.");return lr(this,ZN,"f")}async _createThreadAssistantStream(s,d,y){var H;const S=y==null?void 0:y.signal;S&&(S.aborted&&this.controller.abort(),S.addEventListener("abort",()=>this.controller.abort()));const N={...d,stream:!0},B=await s.createAndRun(N,{...y,signal:this.controller.signal});this._connected();for await(const et of B)lr(this,Lg,"m",yQ).call(this,et);if((H=B.controller.signal)!=null&&H.aborted)throw new A3;return this._addRun(lr(this,Lg,"m",wQ).call(this))}async _createAssistantStream(s,d,y,S){var et;const N=S==null?void 0:S.signal;N&&(N.aborted&&this.controller.abort(),N.addEventListener("abort",()=>this.controller.abort()));const B={...y,stream:!0},H=await s.create(d,B,{...S,signal:this.controller.signal});this._connected();for await(const W of H)lr(this,Lg,"m",yQ).call(this,W);if((et=H.controller.signal)!=null&&et.aborted)throw new A3;return this._addRun(lr(this,Lg,"m",wQ).call(this))}static accumulateDelta(s,d){for(const[y,S]of Object.entries(d)){if(!s.hasOwnProperty(y)){s[y]=S;continue}let N=s[y];if(N==null){s[y]=S;continue}if(y==="index"||y==="type"){s[y]=S;continue}if(typeof N=="string"&&typeof S=="string")N+=S;else if(typeof N=="number"&&typeof S=="number")N+=S;else if(eBt(N)&&eBt(S))N=this.accumulateDelta(N,S);else if(Array.isArray(N)&&Array.isArray(S)){if(N.every(B=>typeof B=="string"||typeof B=="number")){N.push(...S);continue}for(const B of S){if(!eBt(B))throw new Error(`Expected array delta entry to be an object but got: ${B}`);const H=B.index;if(H==null)throw console.error(B),new Error("Expected array delta entry to have an `index` property");if(typeof H!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${H}`);const et=N[H];et==null?N.push(B):N[H]=this.accumulateDelta(et,B)}continue}else throw Error(`Unhandled record type: ${y}, deltaValue: ${S}, accValue: ${N}`);s[y]=N}return s}_addRun(s){return s}async _threadAssistantStream(s,d,y){return await this._createThreadAssistantStream(d,s,y)}async _runAssistantStream(s,d,y,S){return await this._createAssistantStream(d,s,y,S)}async _runToolAssistantStream(s,d,y,S){return await this._createToolAssistantStream(d,s,y,S)}}JN=AQ,yQ=function(s){if(!this.ended)switch(qo(this,Vbt,s),lr(this,Lg,"m",$9e).call(this,s),s.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":lr(this,Lg,"m",U9e).call(this,s);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":lr(this,Lg,"m",F9e).call(this,s);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":lr(this,Lg,"m",B9e).call(this,s);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},wQ=function(){if(this.ended)throw new ro("stream has ended, this shouldn't happen");if(!lr(this,ZN,"f"))throw Error("Final run has not been received");return lr(this,ZN,"f")},B9e=function(s){const[d,y]=lr(this,Lg,"m",H9e).call(this,s,lr(this,X_,"f"));qo(this,X_,d),lr(this,Gbt,"f")[d.id]=d;for(const S of y){const N=d.content[S.index];(N==null?void 0:N.type)=="text"&&this._emit("textCreated",N.text)}switch(s.event){case"thread.message.created":this._emit("messageCreated",s.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",s.data.delta,d),s.data.delta.content)for(const S of s.data.delta.content){if(S.type=="text"&&S.text){let N=S.text,B=d.content[S.index];if(B&&B.type=="text")this._emit("textDelta",N,B.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(S.index!=lr(this,LF,"f")){if(lr(this,VN,"f"))switch(lr(this,VN,"f").type){case"text":this._emit("textDone",lr(this,VN,"f").text,lr(this,X_,"f"));break;case"image_file":this._emit("imageFileDone",lr(this,VN,"f").image_file,lr(this,X_,"f"));break}qo(this,LF,S.index)}qo(this,VN,d.content[S.index])}break;case"thread.message.completed":case"thread.message.incomplete":if(lr(this,LF,"f")!==void 0){const S=s.data.content[lr(this,LF,"f")];if(S)switch(S.type){case"image_file":this._emit("imageFileDone",S.image_file,lr(this,X_,"f"));break;case"text":this._emit("textDone",S.text,lr(this,X_,"f"));break}}lr(this,X_,"f")&&this._emit("messageDone",s.data),qo(this,X_,void 0)}},F9e=function(s){const d=lr(this,Lg,"m",j9e).call(this,s);switch(qo(this,SQ,d),s.event){case"thread.run.step.created":this._emit("runStepCreated",s.data);break;case"thread.run.step.delta":const y=s.data.delta;if(y.step_details&&y.step_details.type=="tool_calls"&&y.step_details.tool_calls&&d.step_details.type=="tool_calls")for(const N of y.step_details.tool_calls)N.index==lr(this,Pmt,"f")?this._emit("toolCallDelta",N,d.step_details.tool_calls[N.index]):(lr(this,Tw,"f")&&this._emit("toolCallDone",lr(this,Tw,"f")),qo(this,Pmt,N.index),qo(this,Tw,d.step_details.tool_calls[N.index]),lr(this,Tw,"f")&&this._emit("toolCallCreated",lr(this,Tw,"f")));this._emit("runStepDelta",s.data.delta,d);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":qo(this,SQ,void 0),s.data.step_details.type=="tool_calls"&&lr(this,Tw,"f")&&(this._emit("toolCallDone",lr(this,Tw,"f")),qo(this,Tw,void 0)),this._emit("runStepDone",s.data,d);break}},$9e=function(s){lr(this,kFt,"f").push(s),this._emit("event",s)},j9e=function(s){switch(s.event){case"thread.run.step.created":return lr(this,w6,"f")[s.data.id]=s.data,s.data;case"thread.run.step.delta":let d=lr(this,w6,"f")[s.data.id];if(!d)throw Error("Received a RunStepDelta before creation of a snapshot");let y=s.data;if(y.delta){const S=JN.accumulateDelta(d,y.delta);lr(this,w6,"f")[s.data.id]=S}return lr(this,w6,"f")[s.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":lr(this,w6,"f")[s.data.id]=s.data;break}if(lr(this,w6,"f")[s.data.id])return lr(this,w6,"f")[s.data.id];throw new Error("No snapshot available")},H9e=function(s,d){let y=[];switch(s.event){case"thread.message.created":return[s.data,y];case"thread.message.delta":if(!d)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let S=s.data;if(S.delta.content)for(const N of S.delta.content)if(N.index in d.content){let B=d.content[N.index];d.content[N.index]=lr(this,Lg,"m",z9e).call(this,N,B)}else d.content[N.index]=N,y.push(N);return[d,y];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(d)return[d,y];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},z9e=function(s,d){return JN.accumulateDelta(d,s)},U9e=function(s){switch(qo(this,Xbt,s.data),s.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":qo(this,ZN,s.data),lr(this,Tw,"f")&&(this._emit("toolCallDone",lr(this,Tw,"f")),qo(this,Tw,void 0));break}};let S$t=class extends Fs{constructor(){super(...arguments),this.steps=new WNe(this._client)}create(s,d,y){const{include:S,...N}=d;return this._client.post(Ji`/threads/${s}/runs`,{query:{include:S},body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers]),stream:d.stream??!1})}retrieve(s,d,y){const{thread_id:S}=d;return this._client.get(Ji`/threads/${S}/runs/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,d,y){const{thread_id:S,...N}=d;return this._client.post(Ji`/threads/${S}/runs/${s}`,{body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,d={},y){return this._client.getAPIList(Ji`/threads/${s}/runs`,h0,{query:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}cancel(s,d,y){const{thread_id:S}=d;return this._client.post(Ji`/threads/${S}/runs/${s}/cancel`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,d,y){const S=await this.create(s,d,y);return await this.poll(S.id,{thread_id:s},y)}createAndStream(s,d,y){return AQ.createAssistantStream(s,this._client.beta.threads.runs,d,y)}async poll(s,d,y){var N;const S=hs([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const{data:B,response:H}=await this.retrieve(s,d,{...y,headers:{...y==null?void 0:y.headers,...S}}).withResponse();switch(B.status){case"queued":case"in_progress":case"cancelling":let et=5e3;if(y!=null&&y.pollIntervalMs)et=y.pollIntervalMs;else{const W=H.headers.get("openai-poll-after-ms");if(W){const nt=parseInt(W);isNaN(nt)||(et=nt)}}await JQ(et);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return B}}}stream(s,d,y){return AQ.createAssistantStream(s,this._client.beta.threads.runs,d,y)}submitToolOutputs(s,d,y){const{thread_id:S,...N}=d;return this._client.post(Ji`/threads/${S}/runs/${s}/submit_tool_outputs`,{body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers]),stream:d.stream??!1})}async submitToolOutputsAndPoll(s,d,y){const S=await this.submitToolOutputs(s,d,y);return await this.poll(S.id,d,y)}submitToolOutputsStream(s,d,y){return AQ.createToolAssistantStream(s,this._client.beta.threads.runs,d,y)}};S$t.Steps=WNe;class c2t extends Fs{constructor(){super(...arguments),this.runs=new S$t(this._client),this.messages=new qNe(this._client)}create(s={},d){return this._client.post("/threads",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}retrieve(s,d){return this._client.get(Ji`/threads/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}update(s,d,y){return this._client.post(Ji`/threads/${s}`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,d){return this._client.delete(Ji`/threads/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}createAndRun(s,d){return this._client.post("/threads/runs",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers]),stream:s.stream??!1})}async createAndRunPoll(s,d){const y=await this.createAndRun(s,d);return await this.runs.poll(y.id,{thread_id:y.thread_id},d)}createAndRunStream(s,d){return AQ.createThreadAssistantStream(s,this._client.beta.threads,d)}}c2t.Runs=S$t;c2t.Messages=qNe;class t$ extends Fs{constructor(){super(...arguments),this.realtime=new s2t(this._client),this.chatkit=new o2t(this._client),this.assistants=new $Ne(this._client),this.threads=new c2t(this._client)}}t$.Realtime=s2t;t$.ChatKit=o2t;t$.Assistants=$Ne;t$.Threads=c2t;class KNe extends Fs{create(s,d){return this._client.post("/completions",{body:s,...d,stream:s.stream??!1})}}class YNe extends Fs{retrieve(s,d,y){const{container_id:S}=d;return this._client.get(Ji`/containers/${S}/files/${s}/content`,{...y,headers:hs([{Accept:"application/binary"},y==null?void 0:y.headers]),__binaryResponse:!0})}}let A$t=class extends Fs{constructor(){super(...arguments),this.content=new YNe(this._client)}create(s,d,y){return this._client.post(Ji`/containers/${s}/files`,cL({body:d,...y},this._client))}retrieve(s,d,y){const{container_id:S}=d;return this._client.get(Ji`/containers/${S}/files/${s}`,y)}list(s,d={},y){return this._client.getAPIList(Ji`/containers/${s}/files`,h0,{query:d,...y})}delete(s,d,y){const{container_id:S}=d;return this._client.delete(Ji`/containers/${S}/files/${s}`,{...y,headers:hs([{Accept:"*/*"},y==null?void 0:y.headers])})}};A$t.Content=YNe;class I$t extends Fs{constructor(){super(...arguments),this.files=new A$t(this._client)}create(s,d){return this._client.post("/containers",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/containers/${s}`,d)}list(s={},d){return this._client.getAPIList("/containers",h0,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/containers/${s}`,{...d,headers:hs([{Accept:"*/*"},d==null?void 0:d.headers])})}}I$t.Files=A$t;class GNe extends Fs{create(s,d,y){const{include:S,...N}=d;return this._client.post(Ji`/conversations/${s}/items`,{query:{include:S},body:N,...y})}retrieve(s,d,y){const{conversation_id:S,...N}=d;return this._client.get(Ji`/conversations/${S}/items/${s}`,{query:N,...y})}list(s,d={},y){return this._client.getAPIList(Ji`/conversations/${s}/items`,Smt,{query:d,...y})}delete(s,d,y){const{conversation_id:S}=d;return this._client.delete(Ji`/conversations/${S}/items/${s}`,y)}}class O$t extends Fs{constructor(){super(...arguments),this.items=new GNe(this._client)}create(s={},d){return this._client.post("/conversations",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/conversations/${s}`,d)}update(s,d,y){return this._client.post(Ji`/conversations/${s}`,{body:d,...y})}delete(s,d){return this._client.delete(Ji`/conversations/${s}`,d)}}O$t.Items=GNe;class VNe extends Fs{create(s,d){const y=!!s.encoding_format;let S=y?s.encoding_format:"base64";y&&Ng(this._client).debug("embeddings/user defined encoding_format:",s.encoding_format);const N=this._client.post("/embeddings",{body:{...s,encoding_format:S},...d});return y?N:(Ng(this._client).debug("embeddings/decoding base64 embeddings from base64"),N._thenUnwrap(B=>(B&&B.data&&B.data.forEach(H=>{const et=H.embedding;H.embedding=O$n(et)}),B)))}}class XNe extends Fs{retrieve(s,d,y){const{eval_id:S,run_id:N}=d;return this._client.get(Ji`/evals/${S}/runs/${N}/output_items/${s}`,y)}list(s,d,y){const{eval_id:S,...N}=d;return this._client.getAPIList(Ji`/evals/${S}/runs/${s}/output_items`,h0,{query:N,...y})}}class N$t extends Fs{constructor(){super(...arguments),this.outputItems=new XNe(this._client)}create(s,d,y){return this._client.post(Ji`/evals/${s}/runs`,{body:d,...y})}retrieve(s,d,y){const{eval_id:S}=d;return this._client.get(Ji`/evals/${S}/runs/${s}`,y)}list(s,d={},y){return this._client.getAPIList(Ji`/evals/${s}/runs`,h0,{query:d,...y})}delete(s,d,y){const{eval_id:S}=d;return this._client.delete(Ji`/evals/${S}/runs/${s}`,y)}cancel(s,d,y){const{eval_id:S}=d;return this._client.post(Ji`/evals/${S}/runs/${s}`,y)}}N$t.OutputItems=XNe;class L$t extends Fs{constructor(){super(...arguments),this.runs=new N$t(this._client)}create(s,d){return this._client.post("/evals",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/evals/${s}`,d)}update(s,d,y){return this._client.post(Ji`/evals/${s}`,{body:d,...y})}list(s={},d){return this._client.getAPIList("/evals",h0,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/evals/${s}`,d)}}L$t.Runs=N$t;let QNe=class extends Fs{create(s,d){return this._client.post("/files",cL({body:s,...d},this._client))}retrieve(s,d){return this._client.get(Ji`/files/${s}`,d)}list(s={},d){return this._client.getAPIList("/files",h0,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/files/${s}`,d)}content(s,d){return this._client.get(Ji`/files/${s}/content`,{...d,headers:hs([{Accept:"application/binary"},d==null?void 0:d.headers]),__binaryResponse:!0})}async waitForProcessing(s,{pollInterval:d=5e3,maxWait:y=30*60*1e3}={}){const S=new Set(["processed","error","deleted"]),N=Date.now();let B=await this.retrieve(s);for(;!B.status||!S.has(B.status);)if(await JQ(d),B=await this.retrieve(s),Date.now()-N>y)throw new m$t({message:`Giving up on waiting for file ${s} to finish processing after ${y} milliseconds.`});return B}};class JNe extends Fs{}let ZNe=class extends Fs{run(s,d){return this._client.post("/fine_tuning/alpha/graders/run",{body:s,...d})}validate(s,d){return this._client.post("/fine_tuning/alpha/graders/validate",{body:s,...d})}};class M$t extends Fs{constructor(){super(...arguments),this.graders=new ZNe(this._client)}}M$t.Graders=ZNe;class tLe extends Fs{create(s,d,y){return this._client.getAPIList(Ji`/fine_tuning/checkpoints/${s}/permissions`,a2t,{body:d,method:"post",...y})}retrieve(s,d={},y){return this._client.get(Ji`/fine_tuning/checkpoints/${s}/permissions`,{query:d,...y})}delete(s,d,y){const{fine_tuned_model_checkpoint:S}=d;return this._client.delete(Ji`/fine_tuning/checkpoints/${S}/permissions/${s}`,y)}}let P$t=class extends Fs{constructor(){super(...arguments),this.permissions=new tLe(this._client)}};P$t.Permissions=tLe;class eLe extends Fs{list(s,d={},y){return this._client.getAPIList(Ji`/fine_tuning/jobs/${s}/checkpoints`,h0,{query:d,...y})}}class R$t extends Fs{constructor(){super(...arguments),this.checkpoints=new eLe(this._client)}create(s,d){return this._client.post("/fine_tuning/jobs",{body:s,...d})}retrieve(s,d){return this._client.get(Ji`/fine_tuning/jobs/${s}`,d)}list(s={},d){return this._client.getAPIList("/fine_tuning/jobs",h0,{query:s,...d})}cancel(s,d){return this._client.post(Ji`/fine_tuning/jobs/${s}/cancel`,d)}listEvents(s,d={},y){return this._client.getAPIList(Ji`/fine_tuning/jobs/${s}/events`,h0,{query:d,...y})}pause(s,d){return this._client.post(Ji`/fine_tuning/jobs/${s}/pause`,d)}resume(s,d){return this._client.post(Ji`/fine_tuning/jobs/${s}/resume`,d)}}R$t.Checkpoints=eLe;class e$ extends Fs{constructor(){super(...arguments),this.methods=new JNe(this._client),this.jobs=new R$t(this._client),this.checkpoints=new P$t(this._client),this.alpha=new M$t(this._client)}}e$.Methods=JNe;e$.Jobs=R$t;e$.Checkpoints=P$t;e$.Alpha=M$t;class nLe extends Fs{}class D$t extends Fs{constructor(){super(...arguments),this.graderModels=new nLe(this._client)}}D$t.GraderModels=nLe;class rLe extends Fs{createVariation(s,d){return this._client.post("/images/variations",cL({body:s,...d},this._client))}edit(s,d){return this._client.post("/images/edits",cL({body:s,...d,stream:s.stream??!1},this._client))}generate(s,d){return this._client.post("/images/generations",{body:s,...d,stream:s.stream??!1})}}class iLe extends Fs{retrieve(s,d){return this._client.get(Ji`/models/${s}`,d)}list(s){return this._client.getAPIList("/models",a2t,s)}delete(s,d){return this._client.delete(Ji`/models/${s}`,d)}}class aLe extends Fs{create(s,d){return this._client.post("/moderations",{body:s,...d})}}class sLe extends Fs{accept(s,d,y){return this._client.post(Ji`/realtime/calls/${s}/accept`,{body:d,...y,headers:hs([{Accept:"*/*"},y==null?void 0:y.headers])})}hangup(s,d){return this._client.post(Ji`/realtime/calls/${s}/hangup`,{...d,headers:hs([{Accept:"*/*"},d==null?void 0:d.headers])})}refer(s,d,y){return this._client.post(Ji`/realtime/calls/${s}/refer`,{body:d,...y,headers:hs([{Accept:"*/*"},y==null?void 0:y.headers])})}reject(s,d={},y){return this._client.post(Ji`/realtime/calls/${s}/reject`,{body:d,...y,headers:hs([{Accept:"*/*"},y==null?void 0:y.headers])})}}class oLe extends Fs{create(s,d){return this._client.post("/realtime/client_secrets",{body:s,...d})}}class u2t extends Fs{constructor(){super(...arguments),this.clientSecrets=new oLe(this._client),this.calls=new sLe(this._client)}}u2t.ClientSecrets=oLe;u2t.Calls=sLe;function N$n(o,s){return!s||!M$n(s)?{...o,output_parsed:null,output:o.output.map(d=>d.type==="function_call"?{...d,parsed_arguments:null}:d.type==="message"?{...d,content:d.content.map(y=>({...y,parsed:null}))}:d)}:cLe(o,s)}function cLe(o,s){const d=o.output.map(S=>{if(S.type==="function_call")return{...S,parsed_arguments:D$n(s,S)};if(S.type==="message"){const N=S.content.map(B=>B.type==="output_text"?{...B,parsed:L$n(s,B.text)}:B);return{...S,content:N}}return S}),y=Object.assign({},o,{output:d});return Object.getOwnPropertyDescriptor(o,"output_text")||CFt(y),Object.defineProperty(y,"output_parsed",{enumerable:!0,get(){for(const S of y.output)if(S.type==="message"){for(const N of S.content)if(N.type==="output_text"&&N.parsed!==null)return N.parsed}return null}}),y}function L$n(o,s){var d,y,S,N;return((y=(d=o.text)==null?void 0:d.format)==null?void 0:y.type)!=="json_schema"?null:"$parseRaw"in((S=o.text)==null?void 0:S.format)?((N=o.text)==null?void 0:N.format).$parseRaw(s):JSON.parse(s)}function M$n(o){var s;return!!_$t((s=o.text)==null?void 0:s.format)}function P$n(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function R$n(o,s){return o.find(d=>d.type==="function"&&d.name===s)}function D$n(o,s){const d=R$n(o.tools??[],s.name);return{...s,...s,parsed_arguments:P$n(d)?d.$parseRaw(s.arguments):d!=null&&d.strict?JSON.parse(s.arguments):null}}function CFt(o){const s=[];for(const d of o.output)if(d.type==="message")for(const y of d.content)y.type==="output_text"&&s.push(y.text);o.output_text=s.join("")}var EF,Nbt,XS,Lbt,q9e,W9e,K9e,Y9e;class B$t extends E$t{constructor(s){super(),EF.add(this),Nbt.set(this,void 0),XS.set(this,void 0),Lbt.set(this,void 0),qo(this,Nbt,s)}static createResponse(s,d,y){const S=new B$t(d);return S._run(()=>S._createOrRetrieveResponse(s,d,{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),S}async _createOrRetrieveResponse(s,d,y){var H;const S=y==null?void 0:y.signal;S&&(S.aborted&&this.controller.abort(),S.addEventListener("abort",()=>this.controller.abort())),lr(this,EF,"m",q9e).call(this);let N,B=null;"response_id"in d?(N=await s.responses.retrieve(d.response_id,{stream:!0},{...y,signal:this.controller.signal,stream:!0}),B=d.starting_after??null):N=await s.responses.create({...d,stream:!0},{...y,signal:this.controller.signal}),this._connected();for await(const et of N)lr(this,EF,"m",W9e).call(this,et,B);if((H=N.controller.signal)!=null&&H.aborted)throw new A3;return lr(this,EF,"m",K9e).call(this)}[(Nbt=new WeakMap,XS=new WeakMap,Lbt=new WeakMap,EF=new WeakSet,q9e=function(){this.ended||qo(this,XS,void 0)},W9e=function(d,y){if(this.ended)return;const S=(B,H)=>{(y==null||H.sequence_number>y)&&this._emit(B,H)},N=lr(this,EF,"m",Y9e).call(this,d);switch(S("event",d),d.type){case"response.output_text.delta":{const B=N.output[d.output_index];if(!B)throw new ro(`missing output at index ${d.output_index}`);if(B.type==="message"){const H=B.content[d.content_index];if(!H)throw new ro(`missing content at index ${d.content_index}`);if(H.type!=="output_text")throw new ro(`expected content to be 'output_text', got ${H.type}`);S("response.output_text.delta",{...d,snapshot:H.text})}break}case"response.function_call_arguments.delta":{const B=N.output[d.output_index];if(!B)throw new ro(`missing output at index ${d.output_index}`);B.type==="function_call"&&S("response.function_call_arguments.delta",{...d,snapshot:B.arguments});break}default:S(d.type,d);break}},K9e=function(){if(this.ended)throw new ro("stream has ended, this shouldn't happen");const d=lr(this,XS,"f");if(!d)throw new ro("request ended without sending any events");qo(this,XS,void 0);const y=B$n(d,lr(this,Nbt,"f"));return qo(this,Lbt,y),y},Y9e=function(d){var S;let y=lr(this,XS,"f");if(!y){if(d.type!=="response.created")throw new ro(`When snapshot hasn't been set yet, expected 'response.created' event, got ${d.type}`);return y=qo(this,XS,d.response),y}switch(d.type){case"response.output_item.added":{y.output.push(d.item);break}case"response.content_part.added":{const N=y.output[d.output_index];if(!N)throw new ro(`missing output at index ${d.output_index}`);const B=N.type,H=d.part;B==="message"&&H.type!=="reasoning_text"?N.content.push(H):B==="reasoning"&&H.type==="reasoning_text"&&(N.content||(N.content=[]),N.content.push(H));break}case"response.output_text.delta":{const N=y.output[d.output_index];if(!N)throw new ro(`missing output at index ${d.output_index}`);if(N.type==="message"){const B=N.content[d.content_index];if(!B)throw new ro(`missing content at index ${d.content_index}`);if(B.type!=="output_text")throw new ro(`expected content to be 'output_text', got ${B.type}`);B.text+=d.delta}break}case"response.function_call_arguments.delta":{const N=y.output[d.output_index];if(!N)throw new ro(`missing output at index ${d.output_index}`);N.type==="function_call"&&(N.arguments+=d.delta);break}case"response.reasoning_text.delta":{const N=y.output[d.output_index];if(!N)throw new ro(`missing output at index ${d.output_index}`);if(N.type==="reasoning"){const B=(S=N.content)==null?void 0:S[d.content_index];if(!B)throw new ro(`missing content at index ${d.content_index}`);if(B.type!=="reasoning_text")throw new ro(`expected content to be 'reasoning_text', got ${B.type}`);B.text+=d.delta}break}case"response.completed":{qo(this,XS,d.response);break}}return y},Symbol.asyncIterator)](){const s=[],d=[];let y=!1;return this.on("event",S=>{const N=d.shift();N?N.resolve(S):s.push(S)}),this.on("end",()=>{y=!0;for(const S of d)S.resolve(void 0);d.length=0}),this.on("abort",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),this.on("error",S=>{y=!0;for(const N of d)N.reject(S);d.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,B)=>d.push({resolve:N,reject:B})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const s=lr(this,Lbt,"f");if(!s)throw new ro("stream ended without producing a ChatCompletion");return s}}function B$n(o,s){return N$n(o,s)}class uLe extends Fs{list(s,d={},y){return this._client.getAPIList(Ji`/responses/${s}/input_items`,h0,{query:d,...y})}}class lLe extends Fs{count(s={},d){return this._client.post("/responses/input_tokens",{body:s,...d})}}class l2t extends Fs{constructor(){super(...arguments),this.inputItems=new uLe(this._client),this.inputTokens=new lLe(this._client)}create(s,d){return this._client.post("/responses",{body:s,...d,stream:s.stream??!1})._thenUnwrap(y=>("object"in y&&y.object==="response"&&CFt(y),y))}retrieve(s,d={},y){return this._client.get(Ji`/responses/${s}`,{query:d,...y,stream:(d==null?void 0:d.stream)??!1})._thenUnwrap(S=>("object"in S&&S.object==="response"&&CFt(S),S))}delete(s,d){return this._client.delete(Ji`/responses/${s}`,{...d,headers:hs([{Accept:"*/*"},d==null?void 0:d.headers])})}parse(s,d){return this._client.responses.create(s,d)._thenUnwrap(y=>cLe(y,s))}stream(s,d){return B$t.createResponse(this._client,s,d)}cancel(s,d){return this._client.post(Ji`/responses/${s}/cancel`,d)}compact(s,d){return this._client.post("/responses/compact",{body:s,...d})}}l2t.InputItems=uLe;l2t.InputTokens=lLe;class hLe extends Fs{create(s,d,y){return this._client.post(Ji`/uploads/${s}/parts`,cL({body:d,...y},this._client))}}class F$t extends Fs{constructor(){super(...arguments),this.parts=new hLe(this._client)}create(s,d){return this._client.post("/uploads",{body:s,...d})}cancel(s,d){return this._client.post(Ji`/uploads/${s}/cancel`,d)}complete(s,d,y){return this._client.post(Ji`/uploads/${s}/complete`,{body:d,...y})}}F$t.Parts=hLe;const F$n=async o=>{const s=await Promise.allSettled(o),d=s.filter(S=>S.status==="rejected");if(d.length){for(const S of d)console.error(S.reason);throw new Error(`${d.length} promise(s) failed - see the above errors`)}const y=[];for(const S of s)S.status==="fulfilled"&&y.push(S.value);return y};class fLe extends Fs{create(s,d,y){return this._client.post(Ji`/vector_stores/${s}/file_batches`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,d,y){const{vector_store_id:S}=d;return this._client.get(Ji`/vector_stores/${S}/file_batches/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}cancel(s,d,y){const{vector_store_id:S}=d;return this._client.post(Ji`/vector_stores/${S}/file_batches/${s}/cancel`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,d,y){const S=await this.create(s,d);return await this.poll(s,S.id,y)}listFiles(s,d,y){const{vector_store_id:S,...N}=d;return this._client.getAPIList(Ji`/vector_stores/${S}/file_batches/${s}/files`,h0,{query:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async poll(s,d,y){var N;const S=hs([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const{data:B,response:H}=await this.retrieve(d,{vector_store_id:s},{...y,headers:S}).withResponse();switch(B.status){case"in_progress":let et=5e3;if(y!=null&&y.pollIntervalMs)et=y.pollIntervalMs;else{const W=H.headers.get("openai-poll-after-ms");if(W){const nt=parseInt(W);isNaN(nt)||(et=nt)}}await JQ(et);break;case"failed":case"cancelled":case"completed":return B}}}async uploadAndPoll(s,{files:d,fileIds:y=[]},S){if(d==null||d.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const N=(S==null?void 0:S.maxConcurrency)??5,B=Math.min(N,d.length),H=this._client,et=d.values(),W=[...y];async function nt(Q){for(let at of Q){const mt=await H.files.create({file:at,purpose:"assistants"},S);W.push(mt.id)}}const K=Array(B).fill(et).map(nt);return await F$n(K),await this.createAndPoll(s,{file_ids:W})}}class dLe extends Fs{create(s,d,y){return this._client.post(Ji`/vector_stores/${s}/files`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,d,y){const{vector_store_id:S}=d;return this._client.get(Ji`/vector_stores/${S}/files/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,d,y){const{vector_store_id:S,...N}=d;return this._client.post(Ji`/vector_stores/${S}/files/${s}`,{body:N,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,d={},y){return this._client.getAPIList(Ji`/vector_stores/${s}/files`,h0,{query:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,d,y){const{vector_store_id:S}=d;return this._client.delete(Ji`/vector_stores/${S}/files/${s}`,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,d,y){const S=await this.create(s,d,y);return await this.poll(s,S.id,y)}async poll(s,d,y){var N;const S=hs([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const B=await this.retrieve(d,{vector_store_id:s},{...y,headers:S}).withResponse(),H=B.data;switch(H.status){case"in_progress":let et=5e3;if(y!=null&&y.pollIntervalMs)et=y.pollIntervalMs;else{const W=B.response.headers.get("openai-poll-after-ms");if(W){const nt=parseInt(W);isNaN(nt)||(et=nt)}}await JQ(et);break;case"failed":case"completed":return H}}}async upload(s,d,y){const S=await this._client.files.create({file:d,purpose:"assistants"},y);return this.create(s,{file_id:S.id},y)}async uploadAndPoll(s,d,y){const S=await this.upload(s,d,y);return await this.poll(s,S.id,y)}content(s,d,y){const{vector_store_id:S}=d;return this._client.getAPIList(Ji`/vector_stores/${S}/files/${s}/content`,a2t,{...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}class h2t extends Fs{constructor(){super(...arguments),this.files=new dLe(this._client),this.fileBatches=new fLe(this._client)}create(s,d){return this._client.post("/vector_stores",{body:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}retrieve(s,d){return this._client.get(Ji`/vector_stores/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}update(s,d,y){return this._client.post(Ji`/vector_stores/${s}`,{body:d,...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s={},d){return this._client.getAPIList("/vector_stores",h0,{query:s,...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}delete(s,d){return this._client.delete(Ji`/vector_stores/${s}`,{...d,headers:hs([{"OpenAI-Beta":"assistants=v2"},d==null?void 0:d.headers])})}search(s,d,y){return this._client.getAPIList(Ji`/vector_stores/${s}/search`,a2t,{body:d,method:"post",...y,headers:hs([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}h2t.Files=dLe;h2t.FileBatches=fLe;class pLe extends Fs{create(s,d){return this._client.post("/videos",L9e({body:s,...d},this._client))}retrieve(s,d){return this._client.get(Ji`/videos/${s}`,d)}list(s={},d){return this._client.getAPIList("/videos",Smt,{query:s,...d})}delete(s,d){return this._client.delete(Ji`/videos/${s}`,d)}downloadContent(s,d={},y){return this._client.get(Ji`/videos/${s}/content`,{query:d,...y,headers:hs([{Accept:"application/binary"},y==null?void 0:y.headers]),__binaryResponse:!0})}remix(s,d,y){return this._client.post(Ji`/videos/${s}/remix`,L9e({body:d,...y},this._client))}}var OF,gLe,Qbt;class bLe extends Fs{constructor(){super(...arguments),OF.add(this)}async unwrap(s,d,y=this._client.webhookSecret,S=300){return await this.verifySignature(s,d,y,S),JSON.parse(s)}async verifySignature(s,d,y=this._client.webhookSecret,S=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");lr(this,OF,"m",gLe).call(this,y);const N=hs([d]).values,B=lr(this,OF,"m",Qbt).call(this,N,"webhook-signature"),H=lr(this,OF,"m",Qbt).call(this,N,"webhook-timestamp"),et=lr(this,OF,"m",Qbt).call(this,N,"webhook-id"),W=parseInt(H,10);if(isNaN(W))throw new hQ("Invalid webhook timestamp format");const nt=Math.floor(Date.now()/1e3);if(nt-W>S)throw new hQ("Webhook timestamp is too old");if(W>nt+S)throw new hQ("Webhook timestamp is too new");const K=B.split(" ").map(Lt=>Lt.startsWith("v1,")?Lt.substring(3):Lt),Q=y.startsWith("whsec_")?Buffer.from(y.replace("whsec_",""),"base64"):Buffer.from(y,"utf-8"),at=et?`${et}.${H}.${s}`:`${H}.${s}`,mt=await crypto.subtle.importKey("raw",Q,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(const Lt of K)try{const Pt=Buffer.from(Lt,"base64");if(await crypto.subtle.verify("HMAC",mt,Pt,new TextEncoder().encode(at)))return}catch{continue}throw new hQ("The given webhook signature does not match the expected signature")}}OF=new WeakSet,gLe=function(s){if(typeof s!="string"||s.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},Qbt=function(s,d){if(!s)throw new Error("Headers are required");const y=s.get(d);if(y==null)throw new Error(`Missing required header: ${d}`);return y};var SFt,$$t,Jbt,mLe;class bu{constructor({baseURL:s=xF("OPENAI_BASE_URL"),apiKey:d=xF("OPENAI_API_KEY"),organization:y=xF("OPENAI_ORG_ID")??null,project:S=xF("OPENAI_PROJECT_ID")??null,webhookSecret:N=xF("OPENAI_WEBHOOK_SECRET")??null,...B}={}){if(SFt.add(this),Jbt.set(this,void 0),this.completions=new KNe(this),this.chat=new C$t(this),this.embeddings=new VNe(this),this.files=new QNe(this),this.images=new rLe(this),this.audio=new tJ(this),this.moderations=new aLe(this),this.models=new iLe(this),this.fineTuning=new e$(this),this.graders=new D$t(this),this.vectorStores=new h2t(this),this.webhooks=new bLe(this),this.beta=new t$(this),this.batches=new FNe(this),this.uploads=new F$t(this),this.responses=new l2t(this),this.realtime=new u2t(this),this.conversations=new O$t(this),this.evals=new L$t(this),this.containers=new I$t(this),this.videos=new pLe(this),d===void 0)throw new ro("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");const H={apiKey:d,organization:y,project:S,webhookSecret:N,...B,baseURL:s||"https://api.openai.com/v1"};if(!H.dangerouslyAllowBrowser&&jFn())throw new ro(`It looks like you're running in a browser-like environment.
1907
1907
 
1908
1908
  This is disabled by default, as it risks exposing your secret API credentials to attackers.
1909
1909
  If you understand the risks and have appropriate mitigations in place,
@@ -1912,22 +1912,22 @@ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
1912
1912
  new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
1913
1913
 
1914
1914
  https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
1915
- `);this.baseURL=H.baseURL,this.timeout=H.timeout??$$t.DEFAULT_TIMEOUT,this.logger=H.logger??console;const et="warn";this.logLevel=et,this.logLevel=O9e(H.logLevel,"ClientOptions.logLevel",this)??O9e(xF("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??et,this.fetchOptions=H.fetchOptions,this.maxRetries=H.maxRetries??2,this.fetch=H.fetch??UFn(),qo(this,Jbt,WFn),this._options=H,this.apiKey=typeof d=="string"?d:"Missing Key",this.organization=y,this.project=S,this.webhookSecret=N}withOptions(s){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...s})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:s,nulls:d}){}async authHeaders(s){return hs([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(s){return QFn(s,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${AF}`}defaultIdempotencyKey(){return`stainless-node-retry-${jOe()}`}makeStatusError(s,d,y,S){return Mg.generate(s,d,y,S)}async _callApiKey(){const s=this._options.apiKey;if(typeof s!="function")return!1;let d;try{d=await s()}catch(y){throw y instanceof ro?y:new ro(`Failed to get token from 'apiKey' function: ${y.message}`,{cause:y})}if(typeof d!="string"||!d)throw new ro(`Expected 'apiKey' function argument to return a string but it returned ${d}`);return this.apiKey=d,!0}buildURL(s,d,y){const S=!lr(this,SFt,"m",mLe).call(this)&&y||this.baseURL,N=MFn(s)?new URL(s):new URL(S+(S.endsWith("/")&&s.startsWith("/")?s.slice(1):s)),B=this.defaultQuery();return PFn(B)||(d={...B,...d}),typeof d=="object"&&d&&!Array.isArray(d)&&(N.search=this.stringifyQuery(d)),N.toString()}async prepareOptions(s){await this._callApiKey()}async prepareRequest(s,{url:d,options:y}){}get(s,d){return this.methodRequest("get",s,d)}post(s,d){return this.methodRequest("post",s,d)}patch(s,d){return this.methodRequest("patch",s,d)}put(s,d){return this.methodRequest("put",s,d)}delete(s,d){return this.methodRequest("delete",s,d)}methodRequest(s,d,y){return this.request(Promise.resolve(y).then(S=>({method:s,path:d,...S})))}request(s,d=null){return new i2t(this,this.makeRequest(s,d,void 0))}async makeRequest(s,d,y){var Mt,ie;const S=await s,N=S.maxRetries??this.maxRetries;d==null&&(d=N),await this.prepareOptions(S);const{req:B,url:H,timeout:et}=await this.buildRequest(S,{retryCount:N-d});await this.prepareRequest(B,{url:H,options:S});const W="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),nt=y===void 0?"":`, retryOf: ${y}`,K=Date.now();if(Ng(this).debug(`[${W}] sending request`,YN({retryOfRequestLogID:y,method:S.method,url:H,options:S,headers:B.headers})),(Mt=S.signal)!=null&&Mt.aborted)throw new A3;const Q=new AbortController,at=await this.fetchWithTimeout(H,B,et,Q).catch(gFt),mt=Date.now();if(at instanceof globalThis.Error){const se=`retrying, ${d} attempts remaining`;if((ie=S.signal)!=null&&ie.aborted)throw new A3;const ve=pFt(at)||/timed? ?out/i.test(String(at)+("cause"in at?String(at.cause):""));if(d)return Ng(this).info(`[${W}] connection ${ve?"timed out":"failed"} - ${se}`),Ng(this).debug(`[${W}] connection ${ve?"timed out":"failed"} (${se})`,YN({retryOfRequestLogID:y,url:H,durationMs:mt-K,message:at.message})),this.retryRequest(S,d,y??W);throw Ng(this).info(`[${W}] connection ${ve?"timed out":"failed"} - error; no more retries left`),Ng(this).debug(`[${W}] connection ${ve?"timed out":"failed"} (error; no more retries left)`,YN({retryOfRequestLogID:y,url:H,durationMs:mt-K,message:at.message})),ve?new m$t:new n2t({cause:at})}const Lt=[...at.headers.entries()].filter(([se])=>se==="x-request-id").map(([se,ve])=>", "+se+": "+JSON.stringify(ve)).join(""),Pt=`[${W}${nt}${Lt}] ${B.method} ${H} ${at.ok?"succeeded":"failed"} with status ${at.status} in ${mt-K}ms`;if(!at.ok){const se=await this.shouldRetry(at);if(d&&se){const Fn=`retrying, ${d} attempts remaining`;return await qFn(at.body),Ng(this).info(`${Pt} - ${Fn}`),Ng(this).debug(`[${W}] response error (${Fn})`,YN({retryOfRequestLogID:y,url:at.url,status:at.status,headers:at.headers,durationMs:mt-K})),this.retryRequest(S,d,y??W,at.headers)}const ve=se?"error; no more retries left":"error; not retryable";Ng(this).info(`${Pt} - ${ve}`);const gn=await at.text().catch(Fn=>gFt(Fn).message),fe=BFn(gn),cn=fe?void 0:gn;throw Ng(this).debug(`[${W}] response error (${ve})`,YN({retryOfRequestLogID:y,url:at.url,status:at.status,headers:at.headers,message:cn,durationMs:Date.now()-K})),this.makeStatusError(at.status,fe,cn,at.headers)}return Ng(this).info(Pt),Ng(this).debug(`[${W}] response start`,YN({retryOfRequestLogID:y,url:at.url,status:at.status,headers:at.headers,durationMs:mt-K})),{response:at,options:S,controller:Q,requestLogID:W,retryOfRequestLogID:y,startTime:K}}getAPIList(s,d,y){return this.requestAPIList(d,{method:"get",path:s,...y})}requestAPIList(s,d){const y=this.makeRequest(d,null,void 0);return new s$n(this,y,s)}async fetchWithTimeout(s,d,y,S){const{signal:N,method:B,...H}=d||{};N&&N.addEventListener("abort",()=>S.abort());const et=setTimeout(()=>S.abort(),y),W=globalThis.ReadableStream&&H.body instanceof globalThis.ReadableStream||typeof H.body=="object"&&H.body!==null&&Symbol.asyncIterator in H.body,nt={signal:S.signal,...W?{duplex:"half"}:{},method:"GET",...H};B&&(nt.method=B.toUpperCase());try{return await this.fetch.call(void 0,s,nt)}finally{clearTimeout(et)}}async shouldRetry(s){const d=s.headers.get("x-should-retry");return d==="true"?!0:d==="false"?!1:s.status===408||s.status===409||s.status===429||s.status>=500}async retryRequest(s,d,y,S){let N;const B=S==null?void 0:S.get("retry-after-ms");if(B){const et=parseFloat(B);Number.isNaN(et)||(N=et)}const H=S==null?void 0:S.get("retry-after");if(H&&!N){const et=parseFloat(H);Number.isNaN(et)?N=Date.parse(H)-Date.now():N=et*1e3}if(!(N&&0<=N&&N<60*1e3)){const et=s.maxRetries??this.maxRetries;N=this.calculateDefaultRetryTimeoutMillis(d,et)}return await JQ(N),this.makeRequest(s,d-1,y)}calculateDefaultRetryTimeoutMillis(s,d){const N=d-s,B=Math.min(.5*Math.pow(2,N),8),H=1-Math.random()*.25;return B*H*1e3}async buildRequest(s,{retryCount:d=0}={}){const y={...s},{method:S,path:N,query:B,defaultBaseURL:H}=y,et=this.buildURL(N,B,H);"timeout"in y&&DFn("timeout",y.timeout),y.timeout=y.timeout??this.timeout;const{bodyHeaders:W,body:nt}=this.buildBody({options:y}),K=await this.buildHeaders({options:s,method:S,bodyHeaders:W,retryCount:d});return{req:{method:S,headers:K,...y.signal&&{signal:y.signal},...globalThis.ReadableStream&&nt instanceof globalThis.ReadableStream&&{duplex:"half"},...nt&&{body:nt},...this.fetchOptions??{},...y.fetchOptions??{}},url:et,timeout:y.timeout}}async buildHeaders({options:s,method:d,bodyHeaders:y,retryCount:S}){let N={};this.idempotencyHeader&&d!=="get"&&(s.idempotencyKey||(s.idempotencyKey=this.defaultIdempotencyKey()),N[this.idempotencyHeader]=s.idempotencyKey);const B=hs([N,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(S),...s.timeout?{"X-Stainless-Timeout":String(Math.trunc(s.timeout/1e3))}:{},...zFn(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(s),this._options.defaultHeaders,y,s.headers]);return this.validateHeaders(B),B.values}buildBody({options:{body:s,headers:d}}){if(!s)return{bodyHeaders:void 0,body:void 0};const y=hs([d]);return ArrayBuffer.isView(s)||s instanceof ArrayBuffer||s instanceof DataView||typeof s=="string"&&y.values.has("content-type")||globalThis.Blob&&s instanceof globalThis.Blob||s instanceof FormData||s instanceof URLSearchParams||globalThis.ReadableStream&&s instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:s}:typeof s=="object"&&(Symbol.asyncIterator in s||Symbol.iterator in s&&"next"in s&&typeof s.next=="function")?{bodyHeaders:void 0,body:ZOe(s)}:lr(this,Jbt,"f").call(this,{body:s,headers:y})}}$$t=bu,Jbt=new WeakMap,SFt=new WeakSet,mLe=function(){return this.baseURL!=="https://api.openai.com/v1"};bu.OpenAI=$$t;bu.DEFAULT_TIMEOUT=6e5;bu.OpenAIError=ro;bu.APIError=Mg;bu.APIConnectionError=n2t;bu.APIConnectionTimeoutError=m$t;bu.APIUserAbortError=A3;bu.NotFoundError=qOe;bu.ConflictError=WOe;bu.RateLimitError=YOe;bu.BadRequestError=HOe;bu.AuthenticationError=zOe;bu.InternalServerError=GOe;bu.PermissionDeniedError=UOe;bu.UnprocessableEntityError=KOe;bu.InvalidWebhookSignatureError=hQ;bu.toFile=h$n;bu.Completions=KNe;bu.Chat=C$t;bu.Embeddings=VNe;bu.Files=QNe;bu.Images=rLe;bu.Audio=tJ;bu.Moderations=aLe;bu.Models=iLe;bu.FineTuning=e$;bu.Graders=D$t;bu.VectorStores=h2t;bu.Webhooks=bLe;bu.Beta=t$;bu.Batches=FNe;bu.Uploads=F$t;bu.Responses=l2t;bu.Realtime=u2t;bu.Conversations=O$t;bu.Evals=L$t;bu.Containers=I$t;bu.Videos=pLe;const G9e=n5(pe.jsx("path",{d:"M3 4V1h2v3h3v2H5v3H3V6H0V4zm3 6V7h3V4h7l1.83 2H21c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V10zm7 9c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5m-3.2-5c0 1.77 1.43 3.2 3.2 3.2s3.2-1.43 3.2-3.2-1.43-3.2-3.2-3.2-3.2 1.43-3.2 3.2"}),"AddAPhoto"),B$n=n5([pe.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),pe.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong"),F$n=n5(pe.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send");function $$n(o,s){if(o.match(/^[a-z]+:\/\//i))return o;if(o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i))return o;const d=document.implementation.createHTMLDocument(),y=d.createElement("base"),S=d.createElement("a");return d.head.appendChild(y),d.body.appendChild(S),s&&(y.href=s),S.href=o,S.href}const j$n=(()=>{let o=0;const s=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(o+=1,`u${s()}${o}`)})();function a7(o){const s=[];for(let d=0,y=o.length;d<y;d++)s.push(o[d]);return s}let TF=null;function yLe(o={}){return TF||(o.includeStyleProperties?(TF=o.includeStyleProperties,TF):(TF=a7(window.getComputedStyle(document.documentElement)),TF))}function Rmt(o,s){const y=(o.ownerDocument.defaultView||window).getComputedStyle(o).getPropertyValue(s);return y?parseFloat(y.replace("px","")):0}function H$n(o){const s=Rmt(o,"border-left-width"),d=Rmt(o,"border-right-width");return o.clientWidth+s+d}function z$n(o){const s=Rmt(o,"border-top-width"),d=Rmt(o,"border-bottom-width");return o.clientHeight+s+d}function wLe(o,s={}){const d=s.width||H$n(o),y=s.height||z$n(o);return{width:d,height:y}}function U$n(){let o,s;try{s=process}catch{}const d=s&&s.env?s.env.devicePixelRatio:null;return d&&(o=parseInt(d,10),Number.isNaN(o)&&(o=1)),o||window.devicePixelRatio||1}const ww=16384;function q$n(o){(o.width>ww||o.height>ww)&&(o.width>ww&&o.height>ww?o.width>o.height?(o.height*=ww/o.width,o.width=ww):(o.width*=ww/o.height,o.height=ww):o.width>ww?(o.height*=ww/o.width,o.width=ww):(o.width*=ww/o.height,o.height=ww))}function Dmt(o){return new Promise((s,d)=>{const y=new Image;y.onload=()=>{y.decode().then(()=>{requestAnimationFrame(()=>s(y))})},y.onerror=d,y.crossOrigin="anonymous",y.decoding="async",y.src=o})}async function W$n(o){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(o)).then(encodeURIComponent).then(s=>`data:image/svg+xml;charset=utf-8,${s}`)}async function K$n(o,s,d){const y="http://www.w3.org/2000/svg",S=document.createElementNS(y,"svg"),N=document.createElementNS(y,"foreignObject");return S.setAttribute("width",`${s}`),S.setAttribute("height",`${d}`),S.setAttribute("viewBox",`0 0 ${s} ${d}`),N.setAttribute("width","100%"),N.setAttribute("height","100%"),N.setAttribute("x","0"),N.setAttribute("y","0"),N.setAttribute("externalResourcesRequired","true"),S.appendChild(N),N.appendChild(o),W$n(S)}const J2=(o,s)=>{if(o instanceof s)return!0;const d=Object.getPrototypeOf(o);return d===null?!1:d.constructor.name===s.name||J2(d,s)};function Y$n(o){const s=o.getPropertyValue("content");return`${o.cssText} content: '${s.replace(/'|"/g,"")}';`}function G$n(o,s){return yLe(s).map(d=>{const y=o.getPropertyValue(d),S=o.getPropertyPriority(d);return`${d}: ${y}${S?" !important":""};`}).join(" ")}function V$n(o,s,d,y){const S=`.${o}:${s}`,N=d.cssText?Y$n(d):G$n(d,y);return document.createTextNode(`${S}{${N}}`)}function V9e(o,s,d,y){const S=window.getComputedStyle(o,d),N=S.getPropertyValue("content");if(N===""||N==="none")return;const B=j$n();try{s.className=`${s.className} ${B}`}catch{return}const H=document.createElement("style");H.appendChild(V$n(B,d,S,y)),s.appendChild(H)}function X$n(o,s,d){V9e(o,s,":before",d),V9e(o,s,":after",d)}const X9e="application/font-woff",Q9e="image/jpeg",Q$n={woff:X9e,woff2:X9e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Q9e,jpeg:Q9e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function J$n(o){const s=/\.([^./]*?)$/g.exec(o);return s?s[1]:""}function j$t(o){const s=J$n(o).toLowerCase();return Q$n[s]||""}function Z$n(o){return o.split(/,/)[1]}function AFt(o){return o.search(/^(data:)/)!==-1}function tjn(o,s){return`data:${s};base64,${o}`}async function vLe(o,s,d){const y=await fetch(o,s);if(y.status===404)throw new Error(`Resource "${y.url}" not found`);const S=await y.blob();return new Promise((N,B)=>{const H=new FileReader;H.onerror=B,H.onloadend=()=>{try{N(d({res:y,result:H.result}))}catch(et){B(et)}},H.readAsDataURL(S)})}const lBt={};function ejn(o,s,d){let y=o.replace(/\?.*/,"");return d&&(y=o),/ttf|otf|eot|woff2?/i.test(y)&&(y=y.replace(/.*\//,"")),s?`[${s}]${y}`:y}async function H$t(o,s,d){const y=ejn(o,s,d.includeQueryParams);if(lBt[y]!=null)return lBt[y];d.cacheBust&&(o+=(/\?/.test(o)?"&":"?")+new Date().getTime());let S;try{const N=await vLe(o,d.fetchRequestInit,({res:B,result:H})=>(s||(s=B.headers.get("Content-Type")||""),Z$n(H)));S=tjn(N,s)}catch(N){S=d.imagePlaceholder||"";let B=`Failed to fetch resource: ${o}`;N&&(B=typeof N=="string"?N:N.message),B&&console.warn(B)}return lBt[y]=S,S}async function njn(o){const s=o.toDataURL();return s==="data:,"?o.cloneNode(!1):Dmt(s)}async function rjn(o,s){if(o.currentSrc){const N=document.createElement("canvas"),B=N.getContext("2d");N.width=o.clientWidth,N.height=o.clientHeight,B==null||B.drawImage(o,0,0,N.width,N.height);const H=N.toDataURL();return Dmt(H)}const d=o.poster,y=j$t(d),S=await H$t(d,y,s);return Dmt(S)}async function ijn(o,s){var d;try{if(!((d=o==null?void 0:o.contentDocument)===null||d===void 0)&&d.body)return await f2t(o.contentDocument.body,s,!0)}catch{}return o.cloneNode(!1)}async function ajn(o,s){return J2(o,HTMLCanvasElement)?njn(o):J2(o,HTMLVideoElement)?rjn(o,s):J2(o,HTMLIFrameElement)?ijn(o,s):o.cloneNode(_Le(o))}const sjn=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SLOT",_Le=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SVG";async function ojn(o,s,d){var y,S;if(_Le(s))return s;let N=[];return sjn(o)&&o.assignedNodes?N=a7(o.assignedNodes()):J2(o,HTMLIFrameElement)&&(!((y=o.contentDocument)===null||y===void 0)&&y.body)?N=a7(o.contentDocument.body.childNodes):N=a7(((S=o.shadowRoot)!==null&&S!==void 0?S:o).childNodes),N.length===0||J2(o,HTMLVideoElement)||await N.reduce((B,H)=>B.then(()=>f2t(H,d)).then(et=>{et&&s.appendChild(et)}),Promise.resolve()),s}function cjn(o,s,d){const y=s.style;if(!y)return;const S=window.getComputedStyle(o);S.cssText?(y.cssText=S.cssText,y.transformOrigin=S.transformOrigin):yLe(d).forEach(N=>{let B=S.getPropertyValue(N);N==="font-size"&&B.endsWith("px")&&(B=`${Math.floor(parseFloat(B.substring(0,B.length-2)))-.1}px`),J2(o,HTMLIFrameElement)&&N==="display"&&B==="inline"&&(B="block"),N==="d"&&s.getAttribute("d")&&(B=`path(${s.getAttribute("d")})`),y.setProperty(N,B,S.getPropertyPriority(N))})}function ujn(o,s){J2(o,HTMLTextAreaElement)&&(s.innerHTML=o.value),J2(o,HTMLInputElement)&&s.setAttribute("value",o.value)}function ljn(o,s){if(J2(o,HTMLSelectElement)){const d=s,y=Array.from(d.children).find(S=>o.value===S.getAttribute("value"));y&&y.setAttribute("selected","")}}function hjn(o,s,d){return J2(s,Element)&&(cjn(o,s,d),X$n(o,s,d),ujn(o,s),ljn(o,s)),s}async function fjn(o,s){const d=o.querySelectorAll?o.querySelectorAll("use"):[];if(d.length===0)return o;const y={};for(let N=0;N<d.length;N++){const H=d[N].getAttribute("xlink:href");if(H){const et=o.querySelector(H),W=document.querySelector(H);!et&&W&&!y[H]&&(y[H]=await f2t(W,s,!0))}}const S=Object.values(y);if(S.length){const N="http://www.w3.org/1999/xhtml",B=document.createElementNS(N,"svg");B.setAttribute("xmlns",N),B.style.position="absolute",B.style.width="0",B.style.height="0",B.style.overflow="hidden",B.style.display="none";const H=document.createElementNS(N,"defs");B.appendChild(H);for(let et=0;et<S.length;et++)H.appendChild(S[et]);o.appendChild(B)}return o}async function f2t(o,s,d){return!d&&s.filter&&!s.filter(o)?null:Promise.resolve(o).then(y=>ajn(y,s)).then(y=>ojn(o,y,s)).then(y=>hjn(o,y,s)).then(y=>fjn(y,s))}const xLe=/url\((['"]?)([^'"]+?)\1\)/g,djn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,pjn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function gjn(o){const s=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${s})(['"]?\\))`,"g")}function bjn(o){const s=[];return o.replace(xLe,(d,y,S)=>(s.push(S),d)),s.filter(d=>!AFt(d))}async function mjn(o,s,d,y,S){try{const N=d?$$n(s,d):s,B=j$t(s);let H;return S||(H=await H$t(N,B,y)),o.replace(gjn(s),`$1${H}$3`)}catch{}return o}function yjn(o,{preferredFontFormat:s}){return s?o.replace(pjn,d=>{for(;;){const[y,,S]=djn.exec(d)||[];if(!S)return"";if(S===s)return`src: ${y};`}}):o}function ELe(o){return o.search(xLe)!==-1}async function TLe(o,s,d){if(!ELe(o))return o;const y=yjn(o,d);return bjn(y).reduce((N,B)=>N.then(H=>mjn(H,B,s,d)),Promise.resolve(y))}async function kF(o,s,d){var y;const S=(y=s.style)===null||y===void 0?void 0:y.getPropertyValue(o);if(S){const N=await TLe(S,null,d);return s.style.setProperty(o,N,s.style.getPropertyPriority(o)),!0}return!1}async function wjn(o,s){await kF("background",o,s)||await kF("background-image",o,s),await kF("mask",o,s)||await kF("-webkit-mask",o,s)||await kF("mask-image",o,s)||await kF("-webkit-mask-image",o,s)}async function vjn(o,s){const d=J2(o,HTMLImageElement);if(!(d&&!AFt(o.src))&&!(J2(o,SVGImageElement)&&!AFt(o.href.baseVal)))return;const y=d?o.src:o.href.baseVal,S=await H$t(y,j$t(y),s);await new Promise((N,B)=>{o.onload=N,o.onerror=s.onImageErrorHandler?(...et)=>{try{N(s.onImageErrorHandler(...et))}catch(W){B(W)}}:B;const H=o;H.decode&&(H.decode=N),H.loading==="lazy"&&(H.loading="eager"),d?(o.srcset="",o.src=S):o.href.baseVal=S})}async function _jn(o,s){const y=a7(o.childNodes).map(S=>kLe(S,s));await Promise.all(y).then(()=>o)}async function kLe(o,s){J2(o,Element)&&(await wjn(o,s),await vjn(o,s),await _jn(o,s))}function xjn(o,s){const{style:d}=o;s.backgroundColor&&(d.backgroundColor=s.backgroundColor),s.width&&(d.width=`${s.width}px`),s.height&&(d.height=`${s.height}px`);const y=s.style;return y!=null&&Object.keys(y).forEach(S=>{d[S]=y[S]}),o}const J9e={};async function Z9e(o){let s=J9e[o];if(s!=null)return s;const y=await(await fetch(o)).text();return s={url:o,cssText:y},J9e[o]=s,s}async function tAe(o,s){let d=o.cssText;const y=/url\(["']?([^"')]+)["']?\)/g,N=(d.match(/url\([^)]+\)/g)||[]).map(async B=>{let H=B.replace(y,"$1");return H.startsWith("https://")||(H=new URL(H,o.url).href),vLe(H,s.fetchRequestInit,({result:et})=>(d=d.replace(B,`url(${et})`),[B,et]))});return Promise.all(N).then(()=>d)}function eAe(o){if(o==null)return[];const s=[],d=/(\/\*[\s\S]*?\*\/)/gi;let y=o.replace(d,"");const S=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const et=S.exec(y);if(et===null)break;s.push(et[0])}y=y.replace(S,"");const N=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,B="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",H=new RegExp(B,"gi");for(;;){let et=N.exec(y);if(et===null){if(et=H.exec(y),et===null)break;N.lastIndex=H.lastIndex}else H.lastIndex=N.lastIndex;s.push(et[0])}return s}async function Ejn(o,s){const d=[],y=[];return o.forEach(S=>{if("cssRules"in S)try{a7(S.cssRules||[]).forEach((N,B)=>{if(N.type===CSSRule.IMPORT_RULE){let H=B+1;const et=N.href,W=Z9e(et).then(nt=>tAe(nt,s)).then(nt=>eAe(nt).forEach(K=>{try{S.insertRule(K,K.startsWith("@import")?H+=1:S.cssRules.length)}catch(Q){console.error("Error inserting rule from remote css",{rule:K,error:Q})}})).catch(nt=>{console.error("Error loading remote css",nt.toString())});y.push(W)}})}catch(N){const B=o.find(H=>H.href==null)||document.styleSheets[0];S.href!=null&&y.push(Z9e(S.href).then(H=>tAe(H,s)).then(H=>eAe(H).forEach(et=>{B.insertRule(et,B.cssRules.length)})).catch(H=>{console.error("Error loading remote stylesheet",H)})),console.error("Error inlining remote css file",N)}}),Promise.all(y).then(()=>(o.forEach(S=>{if("cssRules"in S)try{a7(S.cssRules||[]).forEach(N=>{d.push(N)})}catch(N){console.error(`Error while reading CSS rules from ${S.href}`,N)}}),d))}function Tjn(o){return o.filter(s=>s.type===CSSRule.FONT_FACE_RULE).filter(s=>ELe(s.style.getPropertyValue("src")))}async function kjn(o,s){if(o.ownerDocument==null)throw new Error("Provided element is not within a Document");const d=a7(o.ownerDocument.styleSheets),y=await Ejn(d,s);return Tjn(y)}function CLe(o){return o.trim().replace(/["']/g,"")}function Cjn(o){const s=new Set;function d(y){(y.style.fontFamily||getComputedStyle(y).fontFamily).split(",").forEach(N=>{s.add(CLe(N))}),Array.from(y.children).forEach(N=>{N instanceof HTMLElement&&d(N)})}return d(o),s}async function Sjn(o,s){const d=await kjn(o,s),y=Cjn(o);return(await Promise.all(d.filter(N=>y.has(CLe(N.style.fontFamily))).map(N=>{const B=N.parentStyleSheet?N.parentStyleSheet.href:null;return TLe(N.cssText,B,s)}))).join(`
1916
- `)}async function Ajn(o,s){const d=s.fontEmbedCSS!=null?s.fontEmbedCSS:s.skipFonts?null:await Sjn(o,s);if(d){const y=document.createElement("style"),S=document.createTextNode(d);y.appendChild(S),o.firstChild?o.insertBefore(y,o.firstChild):o.appendChild(y)}}async function Ijn(o,s={}){const{width:d,height:y}=wLe(o,s),S=await f2t(o,s,!0);return await Ajn(S,s),await kLe(S,s),xjn(S,s),await K$n(S,d,y)}async function Ojn(o,s={}){const{width:d,height:y}=wLe(o,s),S=await Ijn(o,s),N=await Dmt(S),B=document.createElement("canvas"),H=B.getContext("2d"),et=s.pixelRatio||U$n(),W=s.canvasWidth||d,nt=s.canvasHeight||y;return B.width=W*et,B.height=nt*et,s.skipAutoScale||q$n(B),B.style.width=`${W}`,B.style.height=`${nt}`,s.backgroundColor&&(H.fillStyle=s.backgroundColor,H.fillRect(0,0,B.width,B.height)),H.drawImage(N,0,0,B.width,B.height),B}async function Njn(o,s={}){return(await Ojn(o,s)).toDataURL()}const SLe=n5(pe.jsx("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13"}),"SmartToy");function nAe(o){const s=[],d=String(o||"");let y=d.indexOf(","),S=0,N=!1;for(;!N;){y===-1&&(y=d.length,N=!0);const B=d.slice(S,y).trim();(B||!N)&&s.push(B),S=y+1,y=d.indexOf(",",S)}return s}function z$t(o,s){const d=s||{};return(o[o.length-1]===""?[...o,""]:o).join((d.padRight?" ":"")+","+(d.padLeft===!1?"":" ")).trim()}const Ljn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mjn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pjn={};function rAe(o,s){return(Pjn.jsx?Mjn:Ljn).test(o)}const Rjn=/[ \t\n\f\r]/g;function d2t(o){return typeof o=="object"?o.type==="text"?iAe(o.value):!1:iAe(o)}function iAe(o){return o.replace(Rjn,"")===""}let eJ=class{constructor(s,d,y){this.normal=d,this.property=s,y&&(this.space=y)}};eJ.prototype.normal={};eJ.prototype.property={};eJ.prototype.space=void 0;function ALe(o,s){const d={},y={};for(const S of o)Object.assign(d,S.property),Object.assign(y,S.normal);return new eJ(d,y,s)}function WQ(o){return o.toLowerCase()}let ny=class{constructor(s,d){this.attribute=d,this.property=s}};ny.prototype.attribute="";ny.prototype.booleanish=!1;ny.prototype.boolean=!1;ny.prototype.commaOrSpaceSeparated=!1;ny.prototype.commaSeparated=!1;ny.prototype.defined=!1;ny.prototype.mustUseProperty=!1;ny.prototype.number=!1;ny.prototype.overloadedBoolean=!1;ny.prototype.property="";ny.prototype.spaceSeparated=!1;ny.prototype.space=void 0;let Djn=0;const $c=lL(),o0=lL(),ILe=lL(),la=lL(),rf=lL(),PF=lL(),xw=lL();function lL(){return 2**++Djn}const IFt=Object.freeze(Object.defineProperty({__proto__:null,boolean:$c,booleanish:o0,commaOrSpaceSeparated:xw,commaSeparated:PF,number:la,overloadedBoolean:ILe,spaceSeparated:rf},Symbol.toStringTag,{value:"Module"})),hBt=Object.keys(IFt);let U$t=class extends ny{constructor(s,d,y,S){let N=-1;if(super(s,d),aAe(this,"space",S),typeof y=="number")for(;++N<hBt.length;){const B=hBt[N];aAe(this,hBt[N],(y&IFt[B])===IFt[B])}}};U$t.prototype.defined=!0;function aAe(o,s,d){d&&(o[s]=d)}function n$(o){const s={},d={};for(const[y,S]of Object.entries(o.properties)){const N=new U$t(y,o.transform(o.attributes||{},y),S,o.space);o.mustUseProperty&&o.mustUseProperty.includes(y)&&(N.mustUseProperty=!0),s[y]=N,d[WQ(y)]=y,d[WQ(N.attribute)]=y}return new eJ(s,d,o.space)}const OLe=n$({properties:{ariaActiveDescendant:null,ariaAtomic:o0,ariaAutoComplete:null,ariaBusy:o0,ariaChecked:o0,ariaColCount:la,ariaColIndex:la,ariaColSpan:la,ariaControls:rf,ariaCurrent:null,ariaDescribedBy:rf,ariaDetails:null,ariaDisabled:o0,ariaDropEffect:rf,ariaErrorMessage:null,ariaExpanded:o0,ariaFlowTo:rf,ariaGrabbed:o0,ariaHasPopup:null,ariaHidden:o0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rf,ariaLevel:la,ariaLive:null,ariaModal:o0,ariaMultiLine:o0,ariaMultiSelectable:o0,ariaOrientation:null,ariaOwns:rf,ariaPlaceholder:null,ariaPosInSet:la,ariaPressed:o0,ariaReadOnly:o0,ariaRelevant:null,ariaRequired:o0,ariaRoleDescription:rf,ariaRowCount:la,ariaRowIndex:la,ariaRowSpan:la,ariaSelected:o0,ariaSetSize:la,ariaSort:null,ariaValueMax:la,ariaValueMin:la,ariaValueNow:la,ariaValueText:null,role:null},transform(o,s){return s==="role"?s:"aria-"+s.slice(4).toLowerCase()}});function NLe(o,s){return s in o?o[s]:s}function LLe(o,s){return NLe(o,s.toLowerCase())}const Bjn=n$({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:PF,acceptCharset:rf,accessKey:rf,action:null,allow:null,allowFullScreen:$c,allowPaymentRequest:$c,allowUserMedia:$c,alt:null,as:null,async:$c,autoCapitalize:null,autoComplete:rf,autoFocus:$c,autoPlay:$c,blocking:rf,capture:null,charSet:null,checked:$c,cite:null,className:rf,cols:la,colSpan:null,content:null,contentEditable:o0,controls:$c,controlsList:rf,coords:la|PF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$c,defer:$c,dir:null,dirName:null,disabled:$c,download:ILe,draggable:o0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$c,formTarget:null,headers:rf,height:la,hidden:$c,high:la,href:null,hrefLang:null,htmlFor:rf,httpEquiv:rf,id:null,imageSizes:null,imageSrcSet:null,inert:$c,inputMode:null,integrity:null,is:null,isMap:$c,itemId:null,itemProp:rf,itemRef:rf,itemScope:$c,itemType:rf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$c,low:la,manifest:null,max:null,maxLength:la,media:null,method:null,min:null,minLength:la,multiple:$c,muted:$c,name:null,nonce:null,noModule:$c,noValidate:$c,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:$c,optimum:la,pattern:null,ping:rf,placeholder:null,playsInline:$c,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$c,referrerPolicy:null,rel:rf,required:$c,reversed:$c,rows:la,rowSpan:la,sandbox:rf,scope:null,scoped:$c,seamless:$c,selected:$c,shadowRootClonable:$c,shadowRootDelegatesFocus:$c,shadowRootMode:null,shape:null,size:la,sizes:null,slot:null,span:la,spellCheck:o0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:la,step:null,style:null,tabIndex:la,target:null,title:null,translate:null,type:null,typeMustMatch:$c,useMap:null,value:o0,width:la,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rf,axis:null,background:null,bgColor:null,border:la,borderColor:null,bottomMargin:la,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$c,declare:$c,event:null,face:null,frame:null,frameBorder:null,hSpace:la,leftMargin:la,link:null,longDesc:null,lowSrc:null,marginHeight:la,marginWidth:la,noResize:$c,noHref:$c,noShade:$c,noWrap:$c,object:null,profile:null,prompt:null,rev:null,rightMargin:la,rules:null,scheme:null,scrolling:o0,standby:null,summary:null,text:null,topMargin:la,valueType:null,version:null,vAlign:null,vLink:null,vSpace:la,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$c,disableRemotePlayback:$c,prefix:null,property:null,results:la,security:null,unselectable:null},space:"html",transform:LLe}),Fjn=n$({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:xw,accentHeight:la,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:la,amplitude:la,arabicForm:null,ascent:la,attributeName:null,attributeType:null,azimuth:la,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:la,by:null,calcMode:null,capHeight:la,className:rf,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:la,diffuseConstant:la,direction:null,display:null,dur:null,divisor:la,dominantBaseline:null,download:$c,dx:null,dy:null,edgeMode:null,editable:null,elevation:la,enableBackground:null,end:null,event:null,exponent:la,externalResourcesRequired:null,fill:null,fillOpacity:la,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:PF,g2:PF,glyphName:PF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:la,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:la,horizOriginX:la,horizOriginY:la,id:null,ideographic:la,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:la,k:la,k1:la,k2:la,k3:la,k4:la,kernelMatrix:xw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:la,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:la,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:la,overlineThickness:la,paintOrder:null,panose1:null,path:null,pathLength:la,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:la,pointsAtY:la,pointsAtZ:la,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xw,rev:xw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xw,requiredFeatures:xw,requiredFonts:xw,requiredFormats:xw,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:la,specularExponent:la,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:la,strikethroughThickness:la,string:null,stroke:null,strokeDashArray:xw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:la,strokeOpacity:la,strokeWidth:null,style:null,surfaceScale:la,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xw,tabIndex:la,tableValues:null,target:null,targetX:la,targetY:la,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:la,underlineThickness:la,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:la,values:null,vAlphabetic:la,vMathematical:la,vectorEffect:null,vHanging:la,vIdeographic:la,version:null,vertAdvY:la,vertOriginX:la,vertOriginY:la,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:la,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:NLe}),MLe=n$({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(o,s){return"xlink:"+s.slice(5).toLowerCase()}}),PLe=n$({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:LLe}),RLe=n$({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(o,s){return"xml:"+s.slice(3).toLowerCase()}}),$jn={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"},jjn=/[A-Z]/g,sAe=/-[a-z]/g,Hjn=/^data[-\w.:]+$/i;function p2t(o,s){const d=WQ(s);let y=s,S=ny;if(d in o.normal)return o.property[o.normal[d]];if(d.length>4&&d.slice(0,4)==="data"&&Hjn.test(s)){if(s.charAt(4)==="-"){const N=s.slice(5).replace(sAe,Ujn);y="data"+N.charAt(0).toUpperCase()+N.slice(1)}else{const N=s.slice(4);if(!sAe.test(N)){let B=N.replace(jjn,zjn);B.charAt(0)!=="-"&&(B="-"+B),s="data"+B}}S=U$t}return new S(y,s)}function zjn(o){return"-"+o.toLowerCase()}function Ujn(o){return o.charAt(1).toUpperCase()}const nJ=ALe([OLe,Bjn,MLe,PLe,RLe],"html"),c7=ALe([OLe,Fjn,MLe,PLe,RLe],"svg");function oAe(o){const s=String(o||"").trim();return s?s.split(/[ \t\n\r\f]+/g):[]}function q$t(o){return o.join(" ").trim()}var W$t={},cAe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,qjn=/\n/g,Wjn=/^\s*/,Kjn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Yjn=/^:\s*/,Gjn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vjn=/^[;\s]*/,Xjn=/^\s+|\s+$/g,Qjn=`
1917
- `,uAe="/",lAe="*",XN="",Jjn="comment",Zjn="declaration",tHn=function(o,s){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];s=s||{};var d=1,y=1;function S(mt){var Lt=mt.match(qjn);Lt&&(d+=Lt.length);var Pt=mt.lastIndexOf(Qjn);y=~Pt?mt.length-Pt:y+mt.length}function N(){var mt={line:d,column:y};return function(Lt){return Lt.position=new B(mt),W(),Lt}}function B(mt){this.start=mt,this.end={line:d,column:y},this.source=s.source}B.prototype.content=o;function H(mt){var Lt=new Error(s.source+":"+d+":"+y+": "+mt);if(Lt.reason=mt,Lt.filename=s.source,Lt.line=d,Lt.column=y,Lt.source=o,!s.silent)throw Lt}function et(mt){var Lt=mt.exec(o);if(Lt){var Pt=Lt[0];return S(Pt),o=o.slice(Pt.length),Lt}}function W(){et(Wjn)}function nt(mt){var Lt;for(mt=mt||[];Lt=K();)Lt!==!1&&mt.push(Lt);return mt}function K(){var mt=N();if(!(uAe!=o.charAt(0)||lAe!=o.charAt(1))){for(var Lt=2;XN!=o.charAt(Lt)&&(lAe!=o.charAt(Lt)||uAe!=o.charAt(Lt+1));)++Lt;if(Lt+=2,XN===o.charAt(Lt-1))return H("End of comment missing");var Pt=o.slice(2,Lt-2);return y+=2,S(Pt),o=o.slice(Lt),y+=2,mt({type:Jjn,comment:Pt})}}function Q(){var mt=N(),Lt=et(Kjn);if(Lt){if(K(),!et(Yjn))return H("property missing ':'");var Pt=et(Gjn),Mt=mt({type:Zjn,property:hAe(Lt[0].replace(cAe,XN)),value:Pt?hAe(Pt[0].replace(cAe,XN)):XN});return et(Vjn),Mt}}function at(){var mt=[];nt(mt);for(var Lt;Lt=Q();)Lt!==!1&&(mt.push(Lt),nt(mt));return mt}return W(),at()};function hAe(o){return o?o.replace(Xjn,XN):XN}var eHn=A1&&A1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(W$t,"__esModule",{value:!0});W$t.default=rHn;var nHn=eHn(tHn);function rHn(o,s){var d=null;if(!o||typeof o!="string")return d;var y=(0,nHn.default)(o),S=typeof s=="function";return y.forEach(function(N){if(N.type==="declaration"){var B=N.property,H=N.value;S?s(B,H,N):H&&(d=d||{},d[B]=H)}}),d}var g2t={};Object.defineProperty(g2t,"__esModule",{value:!0});g2t.camelCase=void 0;var iHn=/^--[a-zA-Z0-9_-]+$/,aHn=/-([a-z])/g,sHn=/^[^-]+$/,oHn=/^-(webkit|moz|ms|o|khtml)-/,cHn=/^-(ms)-/,uHn=function(o){return!o||sHn.test(o)||iHn.test(o)},lHn=function(o,s){return s.toUpperCase()},fAe=function(o,s){return"".concat(s,"-")},hHn=function(o,s){return s===void 0&&(s={}),uHn(o)?o:(o=o.toLowerCase(),s.reactCompat?o=o.replace(cHn,fAe):o=o.replace(oHn,fAe),o.replace(aHn,lHn))};g2t.camelCase=hHn;var fHn=A1&&A1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},dHn=fHn(W$t),pHn=g2t;function OFt(o,s){var d={};return!o||typeof o!="string"||(0,dHn.default)(o,function(y,S){y&&S&&(d[(0,pHn.camelCase)(y,s)]=S)}),d}OFt.default=OFt;var gHn=OFt;const bHn=OIe(gHn),b2t=DLe("end"),A6=DLe("start");function DLe(o){return s;function s(d){const y=d&&d.position&&d.position[o]||{};if(typeof y.line=="number"&&y.line>0&&typeof y.column=="number"&&y.column>0)return{line:y.line,column:y.column,offset:typeof y.offset=="number"&&y.offset>-1?y.offset:void 0}}}function mHn(o){const s=A6(o),d=b2t(o);if(s&&d)return{start:s,end:d}}function IQ(o){return!o||typeof o!="object"?"":"position"in o||"type"in o?dAe(o.position):"start"in o||"end"in o?dAe(o):"line"in o||"column"in o?NFt(o):""}function NFt(o){return pAe(o&&o.line)+":"+pAe(o&&o.column)}function dAe(o){return NFt(o&&o.start)+"-"+NFt(o&&o.end)}function pAe(o){return o&&typeof o=="number"?o:1}class Eb extends Error{constructor(s,d,y){super(),typeof d=="string"&&(y=d,d=void 0);let S="",N={},B=!1;if(d&&("line"in d&&"column"in d?N={place:d}:"start"in d&&"end"in d?N={place:d}:"type"in d?N={ancestors:[d],place:d.position}:N={...d}),typeof s=="string"?S=s:!N.cause&&s&&(B=!0,S=s.message,N.cause=s),!N.ruleId&&!N.source&&typeof y=="string"){const et=y.indexOf(":");et===-1?N.ruleId=y:(N.source=y.slice(0,et),N.ruleId=y.slice(et+1))}if(!N.place&&N.ancestors&&N.ancestors){const et=N.ancestors[N.ancestors.length-1];et&&(N.place=et.position)}const H=N.place&&"start"in N.place?N.place.start:N.place;this.ancestors=N.ancestors||void 0,this.cause=N.cause||void 0,this.column=H?H.column:void 0,this.fatal=void 0,this.file,this.message=S,this.line=H?H.line:void 0,this.name=IQ(N.place)||"1:1",this.place=N.place||void 0,this.reason=this.message,this.ruleId=N.ruleId||void 0,this.source=N.source||void 0,this.stack=B&&N.cause&&typeof N.cause.stack=="string"?N.cause.stack:"",this.actual,this.expected,this.note,this.url}}Eb.prototype.file="";Eb.prototype.name="";Eb.prototype.reason="";Eb.prototype.message="";Eb.prototype.stack="";Eb.prototype.column=void 0;Eb.prototype.line=void 0;Eb.prototype.ancestors=void 0;Eb.prototype.cause=void 0;Eb.prototype.fatal=void 0;Eb.prototype.place=void 0;Eb.prototype.ruleId=void 0;Eb.prototype.source=void 0;const K$t={}.hasOwnProperty,yHn=new Map,wHn=/[A-Z]/g,vHn=new Set(["table","tbody","thead","tfoot","tr"]),_Hn=new Set(["td","th"]),BLe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xHn(o,s){if(!s||s.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const d=s.filePath||void 0;let y;if(s.development){if(typeof s.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");y=OHn(d,s.jsxDEV)}else{if(typeof s.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof s.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");y=IHn(d,s.jsx,s.jsxs)}const S={Fragment:s.Fragment,ancestors:[],components:s.components||{},create:y,elementAttributeNameCase:s.elementAttributeNameCase||"react",evaluater:s.createEvaluater?s.createEvaluater():void 0,filePath:d,ignoreInvalidStyle:s.ignoreInvalidStyle||!1,passKeys:s.passKeys!==!1,passNode:s.passNode||!1,schema:s.space==="svg"?c7:nJ,stylePropertyNameCase:s.stylePropertyNameCase||"dom",tableCellAlignToStyle:s.tableCellAlignToStyle!==!1},N=FLe(S,o,void 0);return N&&typeof N!="string"?N:S.create(o,S.Fragment,{children:N||void 0},void 0)}function FLe(o,s,d){if(s.type==="element")return EHn(o,s,d);if(s.type==="mdxFlowExpression"||s.type==="mdxTextExpression")return THn(o,s);if(s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement")return CHn(o,s,d);if(s.type==="mdxjsEsm")return kHn(o,s);if(s.type==="root")return SHn(o,s,d);if(s.type==="text")return AHn(o,s)}function EHn(o,s,d){const y=o.schema;let S=y;s.tagName.toLowerCase()==="svg"&&y.space==="html"&&(S=c7,o.schema=S),o.ancestors.push(s);const N=jLe(o,s.tagName,!1),B=NHn(o,s);let H=G$t(o,s);return vHn.has(s.tagName)&&(H=H.filter(function(et){return typeof et=="string"?!d2t(et):!0})),$Le(o,B,N,s),Y$t(B,H),o.ancestors.pop(),o.schema=y,o.create(s,N,B,d)}function THn(o,s){if(s.data&&s.data.estree&&o.evaluater){const y=s.data.estree.body[0];return y.type,o.evaluater.evaluateExpression(y.expression)}KQ(o,s.position)}function kHn(o,s){if(s.data&&s.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(s.data.estree);KQ(o,s.position)}function CHn(o,s,d){const y=o.schema;let S=y;s.name==="svg"&&y.space==="html"&&(S=c7,o.schema=S),o.ancestors.push(s);const N=s.name===null?o.Fragment:jLe(o,s.name,!0),B=LHn(o,s),H=G$t(o,s);return $Le(o,B,N,s),Y$t(B,H),o.ancestors.pop(),o.schema=y,o.create(s,N,B,d)}function SHn(o,s,d){const y={};return Y$t(y,G$t(o,s)),o.create(s,o.Fragment,y,d)}function AHn(o,s){return s.value}function $Le(o,s,d,y){typeof d!="string"&&d!==o.Fragment&&o.passNode&&(s.node=y)}function Y$t(o,s){if(s.length>0){const d=s.length>1?s:s[0];d&&(o.children=d)}}function IHn(o,s,d){return y;function y(S,N,B,H){const W=Array.isArray(B.children)?d:s;return H?W(N,B,H):W(N,B)}}function OHn(o,s){return d;function d(y,S,N,B){const H=Array.isArray(N.children),et=A6(y);return s(S,N,B,H,{columnNumber:et?et.column-1:void 0,fileName:o,lineNumber:et?et.line:void 0},void 0)}}function NHn(o,s){const d={};let y,S;for(S in s.properties)if(S!=="children"&&K$t.call(s.properties,S)){const N=MHn(o,S,s.properties[S]);if(N){const[B,H]=N;o.tableCellAlignToStyle&&B==="align"&&typeof H=="string"&&_Hn.has(s.tagName)?y=H:d[B]=H}}if(y){const N=d.style||(d.style={});N[o.stylePropertyNameCase==="css"?"text-align":"textAlign"]=y}return d}function LHn(o,s){const d={};for(const y of s.attributes)if(y.type==="mdxJsxExpressionAttribute")if(y.data&&y.data.estree&&o.evaluater){const N=y.data.estree.body[0];N.type;const B=N.expression;B.type;const H=B.properties[0];H.type,Object.assign(d,o.evaluater.evaluateExpression(H.argument))}else KQ(o,s.position);else{const S=y.name;let N;if(y.value&&typeof y.value=="object")if(y.value.data&&y.value.data.estree&&o.evaluater){const H=y.value.data.estree.body[0];H.type,N=o.evaluater.evaluateExpression(H.expression)}else KQ(o,s.position);else N=y.value===null?!0:y.value;d[S]=N}return d}function G$t(o,s){const d=[];let y=-1;const S=o.passKeys?new Map:yHn;for(;++y<s.children.length;){const N=s.children[y];let B;if(o.passKeys){const et=N.type==="element"?N.tagName:N.type==="mdxJsxFlowElement"||N.type==="mdxJsxTextElement"?N.name:void 0;if(et){const W=S.get(et)||0;B=et+"-"+W,S.set(et,W+1)}}const H=FLe(o,N,B);H!==void 0&&d.push(H)}return d}function MHn(o,s,d){const y=p2t(o.schema,s);if(!(d==null||typeof d=="number"&&Number.isNaN(d))){if(Array.isArray(d)&&(d=y.commaSeparated?z$t(d):q$t(d)),y.property==="style"){let S=typeof d=="object"?d:PHn(o,String(d));return o.stylePropertyNameCase==="css"&&(S=RHn(S)),["style",S]}return[o.elementAttributeNameCase==="react"&&y.space?$jn[y.property]||y.property:y.attribute,d]}}function PHn(o,s){try{return bHn(s,{reactCompat:!0})}catch(d){if(o.ignoreInvalidStyle)return{};const y=d,S=new Eb("Cannot parse `style` attribute",{ancestors:o.ancestors,cause:y,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw S.file=o.filePath||void 0,S.url=BLe+"#cannot-parse-style-attribute",S}}function jLe(o,s,d){let y;if(!d)y={type:"Literal",value:s};else if(s.includes(".")){const S=s.split(".");let N=-1,B;for(;++N<S.length;){const H=rAe(S[N])?{type:"Identifier",name:S[N]}:{type:"Literal",value:S[N]};B=B?{type:"MemberExpression",object:B,property:H,computed:!!(N&&H.type==="Literal"),optional:!1}:H}y=B}else y=rAe(s)&&!/^[a-z]/.test(s)?{type:"Identifier",name:s}:{type:"Literal",value:s};if(y.type==="Literal"){const S=y.value;return K$t.call(o.components,S)?o.components[S]:S}if(o.evaluater)return o.evaluater.evaluateExpression(y);KQ(o)}function KQ(o,s){const d=new Eb("Cannot handle MDX estrees without `createEvaluater`",{ancestors:o.ancestors,place:s,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw d.file=o.filePath||void 0,d.url=BLe+"#cannot-handle-mdx-estrees-without-createevaluater",d}function RHn(o){const s={};let d;for(d in o)K$t.call(o,d)&&(s[DHn(d)]=o[d]);return s}function DHn(o){let s=o.replace(wHn,BHn);return s.slice(0,3)==="ms-"&&(s="-"+s),s}function BHn(o){return"-"+o.toLowerCase()}const fBt={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"]},FHn={};function $Hn(o,s){const d=FHn,y=typeof d.includeImageAlt=="boolean"?d.includeImageAlt:!0,S=typeof d.includeHtml=="boolean"?d.includeHtml:!0;return HLe(o,y,S)}function HLe(o,s,d){if(jHn(o)){if("value"in o)return o.type==="html"&&!d?"":o.value;if(s&&"alt"in o&&o.alt)return o.alt;if("children"in o)return gAe(o.children,s,d)}return Array.isArray(o)?gAe(o,s,d):""}function gAe(o,s,d){const y=[];let S=-1;for(;++S<o.length;)y[S]=HLe(o[S],s,d);return y.join("")}function jHn(o){return!!(o&&typeof o=="object")}const bAe=document.createElement("i");function V$t(o){const s="&"+o+";";bAe.innerHTML=s;const d=bAe.textContent;return d.charCodeAt(d.length-1)===59&&o!=="semi"||d===s?!1:d}function C6(o,s,d,y){const S=o.length;let N=0,B;if(s<0?s=-s>S?0:S+s:s=s>S?S:s,d=d>0?d:0,y.length<1e4)B=Array.from(y),B.unshift(s,d),o.splice(...B);else for(d&&o.splice(s,d);N<y.length;)B=y.slice(N,N+1e4),B.unshift(s,0),o.splice(...B),N+=1e4,s+=1e4}function k3(o,s){return o.length>0?(C6(o,o.length,0,s),o):s}const mAe={}.hasOwnProperty;function HHn(o){const s={};let d=-1;for(;++d<o.length;)zHn(s,o[d]);return s}function zHn(o,s){let d;for(d in s){const S=(mAe.call(o,d)?o[d]:void 0)||(o[d]={}),N=s[d];let B;if(N)for(B in N){mAe.call(S,B)||(S[B]=[]);const H=N[B];UHn(S[B],Array.isArray(H)?H:H?[H]:[])}}}function UHn(o,s){let d=-1;const y=[];for(;++d<s.length;)(s[d].add==="after"?o:y).push(s[d]);C6(o,0,0,y)}function zLe(o,s){const d=Number.parseInt(o,s);return d<9||d===11||d>13&&d<32||d>126&&d<160||d>55295&&d<57344||d>64975&&d<65008||(d&65535)===65535||(d&65535)===65534||d>1114111?"�":String.fromCodePoint(d)}function RF(o){return o.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _6=u7(/[A-Za-z]/),Sw=u7(/[\dA-Za-z]/),qHn=u7(/[#-'*+\--9=?A-Z^-~]/);function LFt(o){return o!==null&&(o<32||o===127)}const MFt=u7(/\d/),WHn=u7(/[\dA-Fa-f]/),KHn=u7(/[!-/:-@[-`{-~]/);function nc(o){return o!==null&&o<-2}function Z2(o){return o!==null&&(o<0||o===32)}function Hl(o){return o===-2||o===-1||o===32}const YHn=u7(new RegExp("\\p{P}|\\p{S}","u")),GHn=u7(/\s/);function u7(o){return s;function s(d){return d!==null&&d>-1&&o.test(String.fromCharCode(d))}}function r$(o){const s=[];let d=-1,y=0,S=0;for(;++d<o.length;){const N=o.charCodeAt(d);let B="";if(N===37&&Sw(o.charCodeAt(d+1))&&Sw(o.charCodeAt(d+2)))S=2;else if(N<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(N))||(B=String.fromCharCode(N));else if(N>55295&&N<57344){const H=o.charCodeAt(d+1);N<56320&&H>56319&&H<57344?(B=String.fromCharCode(N,H),S=1):B="�"}else B=String.fromCharCode(N);B&&(s.push(o.slice(y,d),encodeURIComponent(B)),y=d+S+1,B=""),S&&(d+=S,S=0)}return s.join("")+o.slice(y)}function sf(o,s,d,y){const S=y?y-1:Number.POSITIVE_INFINITY;let N=0;return B;function B(et){return Hl(et)?(o.enter(d),H(et)):s(et)}function H(et){return Hl(et)&&N++<S?(o.consume(et),H):(o.exit(d),s(et))}}const VHn={tokenize:XHn};function XHn(o){const s=o.attempt(this.parser.constructs.contentInitial,y,S);let d;return s;function y(H){if(H===null){o.consume(H);return}return o.enter("lineEnding"),o.consume(H),o.exit("lineEnding"),sf(o,s,"linePrefix")}function S(H){return o.enter("paragraph"),N(H)}function N(H){const et=o.enter("chunkText",{contentType:"text",previous:d});return d&&(d.next=et),d=et,B(H)}function B(H){if(H===null){o.exit("chunkText"),o.exit("paragraph"),o.consume(H);return}return nc(H)?(o.consume(H),o.exit("chunkText"),N):(o.consume(H),B)}}const QHn={tokenize:JHn},yAe={tokenize:ZHn};function JHn(o){const s=this,d=[];let y=0,S,N,B;return H;function H(se){if(y<d.length){const ve=d[y];return s.containerState=ve[1],o.attempt(ve[0].continuation,et,W)(se)}return W(se)}function et(se){if(y++,s.containerState._closeFlow){s.containerState._closeFlow=void 0,S&&ie();const ve=s.events.length;let gn=ve,fe;for(;gn--;)if(s.events[gn][0]==="exit"&&s.events[gn][1].type==="chunkFlow"){fe=s.events[gn][1].end;break}Mt(y);let cn=ve;for(;cn<s.events.length;)s.events[cn][1].end={...fe},cn++;return C6(s.events,gn+1,0,s.events.slice(ve)),s.events.length=cn,W(se)}return H(se)}function W(se){if(y===d.length){if(!S)return Q(se);if(S.currentConstruct&&S.currentConstruct.concrete)return mt(se);s.interrupt=!!(S.currentConstruct&&!S._gfmTableDynamicInterruptHack)}return s.containerState={},o.check(yAe,nt,K)(se)}function nt(se){return S&&ie(),Mt(y),Q(se)}function K(se){return s.parser.lazy[s.now().line]=y!==d.length,B=s.now().offset,mt(se)}function Q(se){return s.containerState={},o.attempt(yAe,at,mt)(se)}function at(se){return y++,d.push([s.currentConstruct,s.containerState]),Q(se)}function mt(se){if(se===null){S&&ie(),Mt(0),o.consume(se);return}return S=S||s.parser.flow(s.now()),o.enter("chunkFlow",{_tokenizer:S,contentType:"flow",previous:N}),Lt(se)}function Lt(se){if(se===null){Pt(o.exit("chunkFlow"),!0),Mt(0),o.consume(se);return}return nc(se)?(o.consume(se),Pt(o.exit("chunkFlow")),y=0,s.interrupt=void 0,H):(o.consume(se),Lt)}function Pt(se,ve){const gn=s.sliceStream(se);if(ve&&gn.push(null),se.previous=N,N&&(N.next=se),N=se,S.defineSkip(se.start),S.write(gn),s.parser.lazy[se.start.line]){let fe=S.events.length;for(;fe--;)if(S.events[fe][1].start.offset<B&&(!S.events[fe][1].end||S.events[fe][1].end.offset>B))return;const cn=s.events.length;let sr=cn,Fn,qn;for(;sr--;)if(s.events[sr][0]==="exit"&&s.events[sr][1].type==="chunkFlow"){if(Fn){qn=s.events[sr][1].end;break}Fn=!0}for(Mt(y),fe=cn;fe<s.events.length;)s.events[fe][1].end={...qn},fe++;C6(s.events,sr+1,0,s.events.slice(cn)),s.events.length=fe}}function Mt(se){let ve=d.length;for(;ve-- >se;){const gn=d[ve];s.containerState=gn[1],gn[0].exit.call(s,o)}d.length=se}function ie(){S.write([null]),N=void 0,S=void 0,s.containerState._closeFlow=void 0}}function ZHn(o,s,d){return sf(o,o.attempt(this.parser.constructs.document,s,d),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wAe(o){if(o===null||Z2(o)||GHn(o))return 1;if(YHn(o))return 2}function X$t(o,s,d){const y=[];let S=-1;for(;++S<o.length;){const N=o[S].resolveAll;N&&!y.includes(N)&&(s=N(s,d),y.push(N))}return s}const PFt={name:"attention",resolveAll:tzn,tokenize:ezn};function tzn(o,s){let d=-1,y,S,N,B,H,et,W,nt;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="attentionSequence"&&o[d][1]._close){for(y=d;y--;)if(o[y][0]==="exit"&&o[y][1].type==="attentionSequence"&&o[y][1]._open&&s.sliceSerialize(o[y][1]).charCodeAt(0)===s.sliceSerialize(o[d][1]).charCodeAt(0)){if((o[y][1]._close||o[d][1]._open)&&(o[d][1].end.offset-o[d][1].start.offset)%3&&!((o[y][1].end.offset-o[y][1].start.offset+o[d][1].end.offset-o[d][1].start.offset)%3))continue;et=o[y][1].end.offset-o[y][1].start.offset>1&&o[d][1].end.offset-o[d][1].start.offset>1?2:1;const K={...o[y][1].end},Q={...o[d][1].start};vAe(K,-et),vAe(Q,et),B={type:et>1?"strongSequence":"emphasisSequence",start:K,end:{...o[y][1].end}},H={type:et>1?"strongSequence":"emphasisSequence",start:{...o[d][1].start},end:Q},N={type:et>1?"strongText":"emphasisText",start:{...o[y][1].end},end:{...o[d][1].start}},S={type:et>1?"strong":"emphasis",start:{...B.start},end:{...H.end}},o[y][1].end={...B.start},o[d][1].start={...H.end},W=[],o[y][1].end.offset-o[y][1].start.offset&&(W=k3(W,[["enter",o[y][1],s],["exit",o[y][1],s]])),W=k3(W,[["enter",S,s],["enter",B,s],["exit",B,s],["enter",N,s]]),W=k3(W,X$t(s.parser.constructs.insideSpan.null,o.slice(y+1,d),s)),W=k3(W,[["exit",N,s],["enter",H,s],["exit",H,s],["exit",S,s]]),o[d][1].end.offset-o[d][1].start.offset?(nt=2,W=k3(W,[["enter",o[d][1],s],["exit",o[d][1],s]])):nt=0,C6(o,y-1,d-y+3,W),d=y+W.length-nt-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="attentionSequence"&&(o[d][1].type="data");return o}function ezn(o,s){const d=this.parser.constructs.attentionMarkers.null,y=this.previous,S=wAe(y);let N;return B;function B(et){return N=et,o.enter("attentionSequence"),H(et)}function H(et){if(et===N)return o.consume(et),H;const W=o.exit("attentionSequence"),nt=wAe(et),K=!nt||nt===2&&S||d.includes(et),Q=!S||S===2&&nt||d.includes(y);return W._open=!!(N===42?K:K&&(S||!Q)),W._close=!!(N===42?Q:Q&&(nt||!K)),s(et)}}function vAe(o,s){o.column+=s,o.offset+=s,o._bufferIndex+=s}const nzn={name:"autolink",tokenize:rzn};function rzn(o,s,d){let y=0;return S;function S(at){return o.enter("autolink"),o.enter("autolinkMarker"),o.consume(at),o.exit("autolinkMarker"),o.enter("autolinkProtocol"),N}function N(at){return _6(at)?(o.consume(at),B):at===64?d(at):W(at)}function B(at){return at===43||at===45||at===46||Sw(at)?(y=1,H(at)):W(at)}function H(at){return at===58?(o.consume(at),y=0,et):(at===43||at===45||at===46||Sw(at))&&y++<32?(o.consume(at),H):(y=0,W(at))}function et(at){return at===62?(o.exit("autolinkProtocol"),o.enter("autolinkMarker"),o.consume(at),o.exit("autolinkMarker"),o.exit("autolink"),s):at===null||at===32||at===60||LFt(at)?d(at):(o.consume(at),et)}function W(at){return at===64?(o.consume(at),nt):qHn(at)?(o.consume(at),W):d(at)}function nt(at){return Sw(at)?K(at):d(at)}function K(at){return at===46?(o.consume(at),y=0,nt):at===62?(o.exit("autolinkProtocol").type="autolinkEmail",o.enter("autolinkMarker"),o.consume(at),o.exit("autolinkMarker"),o.exit("autolink"),s):Q(at)}function Q(at){if((at===45||Sw(at))&&y++<63){const mt=at===45?Q:K;return o.consume(at),mt}return d(at)}}const m2t={partial:!0,tokenize:izn};function izn(o,s,d){return y;function y(N){return Hl(N)?sf(o,S,"linePrefix")(N):S(N)}function S(N){return N===null||nc(N)?s(N):d(N)}}const ULe={continuation:{tokenize:szn},exit:ozn,name:"blockQuote",tokenize:azn};function azn(o,s,d){const y=this;return S;function S(B){if(B===62){const H=y.containerState;return H.open||(o.enter("blockQuote",{_container:!0}),H.open=!0),o.enter("blockQuotePrefix"),o.enter("blockQuoteMarker"),o.consume(B),o.exit("blockQuoteMarker"),N}return d(B)}function N(B){return Hl(B)?(o.enter("blockQuotePrefixWhitespace"),o.consume(B),o.exit("blockQuotePrefixWhitespace"),o.exit("blockQuotePrefix"),s):(o.exit("blockQuotePrefix"),s(B))}}function szn(o,s,d){const y=this;return S;function S(B){return Hl(B)?sf(o,N,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):N(B)}function N(B){return o.attempt(ULe,s,d)(B)}}function ozn(o){o.exit("blockQuote")}const qLe={name:"characterEscape",tokenize:czn};function czn(o,s,d){return y;function y(N){return o.enter("characterEscape"),o.enter("escapeMarker"),o.consume(N),o.exit("escapeMarker"),S}function S(N){return KHn(N)?(o.enter("characterEscapeValue"),o.consume(N),o.exit("characterEscapeValue"),o.exit("characterEscape"),s):d(N)}}const WLe={name:"characterReference",tokenize:uzn};function uzn(o,s,d){const y=this;let S=0,N,B;return H;function H(K){return o.enter("characterReference"),o.enter("characterReferenceMarker"),o.consume(K),o.exit("characterReferenceMarker"),et}function et(K){return K===35?(o.enter("characterReferenceMarkerNumeric"),o.consume(K),o.exit("characterReferenceMarkerNumeric"),W):(o.enter("characterReferenceValue"),N=31,B=Sw,nt(K))}function W(K){return K===88||K===120?(o.enter("characterReferenceMarkerHexadecimal"),o.consume(K),o.exit("characterReferenceMarkerHexadecimal"),o.enter("characterReferenceValue"),N=6,B=WHn,nt):(o.enter("characterReferenceValue"),N=7,B=MFt,nt(K))}function nt(K){if(K===59&&S){const Q=o.exit("characterReferenceValue");return B===Sw&&!V$t(y.sliceSerialize(Q))?d(K):(o.enter("characterReferenceMarker"),o.consume(K),o.exit("characterReferenceMarker"),o.exit("characterReference"),s)}return B(K)&&S++<N?(o.consume(K),nt):d(K)}}const _Ae={partial:!0,tokenize:hzn},xAe={concrete:!0,name:"codeFenced",tokenize:lzn};function lzn(o,s,d){const y=this,S={partial:!0,tokenize:gn};let N=0,B=0,H;return et;function et(fe){return W(fe)}function W(fe){const cn=y.events[y.events.length-1];return N=cn&&cn[1].type==="linePrefix"?cn[2].sliceSerialize(cn[1],!0).length:0,H=fe,o.enter("codeFenced"),o.enter("codeFencedFence"),o.enter("codeFencedFenceSequence"),nt(fe)}function nt(fe){return fe===H?(B++,o.consume(fe),nt):B<3?d(fe):(o.exit("codeFencedFenceSequence"),Hl(fe)?sf(o,K,"whitespace")(fe):K(fe))}function K(fe){return fe===null||nc(fe)?(o.exit("codeFencedFence"),y.interrupt?s(fe):o.check(_Ae,Lt,ve)(fe)):(o.enter("codeFencedFenceInfo"),o.enter("chunkString",{contentType:"string"}),Q(fe))}function Q(fe){return fe===null||nc(fe)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),K(fe)):Hl(fe)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),sf(o,at,"whitespace")(fe)):fe===96&&fe===H?d(fe):(o.consume(fe),Q)}function at(fe){return fe===null||nc(fe)?K(fe):(o.enter("codeFencedFenceMeta"),o.enter("chunkString",{contentType:"string"}),mt(fe))}function mt(fe){return fe===null||nc(fe)?(o.exit("chunkString"),o.exit("codeFencedFenceMeta"),K(fe)):fe===96&&fe===H?d(fe):(o.consume(fe),mt)}function Lt(fe){return o.attempt(S,ve,Pt)(fe)}function Pt(fe){return o.enter("lineEnding"),o.consume(fe),o.exit("lineEnding"),Mt}function Mt(fe){return N>0&&Hl(fe)?sf(o,ie,"linePrefix",N+1)(fe):ie(fe)}function ie(fe){return fe===null||nc(fe)?o.check(_Ae,Lt,ve)(fe):(o.enter("codeFlowValue"),se(fe))}function se(fe){return fe===null||nc(fe)?(o.exit("codeFlowValue"),ie(fe)):(o.consume(fe),se)}function ve(fe){return o.exit("codeFenced"),s(fe)}function gn(fe,cn,sr){let Fn=0;return qn;function qn(Ar){return fe.enter("lineEnding"),fe.consume(Ar),fe.exit("lineEnding"),nr}function nr(Ar){return fe.enter("codeFencedFence"),Hl(Ar)?sf(fe,hr,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ar):hr(Ar)}function hr(Ar){return Ar===H?(fe.enter("codeFencedFenceSequence"),di(Ar)):sr(Ar)}function di(Ar){return Ar===H?(Fn++,fe.consume(Ar),di):Fn>=B?(fe.exit("codeFencedFenceSequence"),Hl(Ar)?sf(fe,gi,"whitespace")(Ar):gi(Ar)):sr(Ar)}function gi(Ar){return Ar===null||nc(Ar)?(fe.exit("codeFencedFence"),cn(Ar)):sr(Ar)}}}function hzn(o,s,d){const y=this;return S;function S(B){return B===null?d(B):(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),N)}function N(B){return y.parser.lazy[y.now().line]?d(B):s(B)}}const dBt={name:"codeIndented",tokenize:dzn},fzn={partial:!0,tokenize:pzn};function dzn(o,s,d){const y=this;return S;function S(W){return o.enter("codeIndented"),sf(o,N,"linePrefix",5)(W)}function N(W){const nt=y.events[y.events.length-1];return nt&&nt[1].type==="linePrefix"&&nt[2].sliceSerialize(nt[1],!0).length>=4?B(W):d(W)}function B(W){return W===null?et(W):nc(W)?o.attempt(fzn,B,et)(W):(o.enter("codeFlowValue"),H(W))}function H(W){return W===null||nc(W)?(o.exit("codeFlowValue"),B(W)):(o.consume(W),H)}function et(W){return o.exit("codeIndented"),s(W)}}function pzn(o,s,d){const y=this;return S;function S(B){return y.parser.lazy[y.now().line]?d(B):nc(B)?(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),S):sf(o,N,"linePrefix",5)(B)}function N(B){const H=y.events[y.events.length-1];return H&&H[1].type==="linePrefix"&&H[2].sliceSerialize(H[1],!0).length>=4?s(B):nc(B)?S(B):d(B)}}const gzn={name:"codeText",previous:mzn,resolve:bzn,tokenize:yzn};function bzn(o){let s=o.length-4,d=3,y,S;if((o[d][1].type==="lineEnding"||o[d][1].type==="space")&&(o[s][1].type==="lineEnding"||o[s][1].type==="space")){for(y=d;++y<s;)if(o[y][1].type==="codeTextData"){o[d][1].type="codeTextPadding",o[s][1].type="codeTextPadding",d+=2,s-=2;break}}for(y=d-1,s++;++y<=s;)S===void 0?y!==s&&o[y][1].type!=="lineEnding"&&(S=y):(y===s||o[y][1].type==="lineEnding")&&(o[S][1].type="codeTextData",y!==S+2&&(o[S][1].end=o[y-1][1].end,o.splice(S+2,y-S-2),s-=y-S-2,y=S+2),S=void 0);return o}function mzn(o){return o!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yzn(o,s,d){let y=0,S,N;return B;function B(K){return o.enter("codeText"),o.enter("codeTextSequence"),H(K)}function H(K){return K===96?(o.consume(K),y++,H):(o.exit("codeTextSequence"),et(K))}function et(K){return K===null?d(K):K===32?(o.enter("space"),o.consume(K),o.exit("space"),et):K===96?(N=o.enter("codeTextSequence"),S=0,nt(K)):nc(K)?(o.enter("lineEnding"),o.consume(K),o.exit("lineEnding"),et):(o.enter("codeTextData"),W(K))}function W(K){return K===null||K===32||K===96||nc(K)?(o.exit("codeTextData"),et(K)):(o.consume(K),W)}function nt(K){return K===96?(o.consume(K),S++,nt):S===y?(o.exit("codeTextSequence"),o.exit("codeText"),s(K)):(N.type="codeTextData",W(K))}}class wzn{constructor(s){this.left=s?[...s]:[],this.right=[]}get(s){if(s<0||s>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+s+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return s<this.left.length?this.left[s]:this.right[this.right.length-s+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(s,d){const y=d??Number.POSITIVE_INFINITY;return y<this.left.length?this.left.slice(s,y):s>this.left.length?this.right.slice(this.right.length-y+this.left.length,this.right.length-s+this.left.length).reverse():this.left.slice(s).concat(this.right.slice(this.right.length-y+this.left.length).reverse())}splice(s,d,y){const S=d||0;this.setCursor(Math.trunc(s));const N=this.right.splice(this.right.length-S,Number.POSITIVE_INFINITY);return y&&aQ(this.left,y),N.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(s){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(s)}pushMany(s){this.setCursor(Number.POSITIVE_INFINITY),aQ(this.left,s)}unshift(s){this.setCursor(0),this.right.push(s)}unshiftMany(s){this.setCursor(0),aQ(this.right,s.reverse())}setCursor(s){if(!(s===this.left.length||s>this.left.length&&this.right.length===0||s<0&&this.left.length===0))if(s<this.left.length){const d=this.left.splice(s,Number.POSITIVE_INFINITY);aQ(this.right,d.reverse())}else{const d=this.right.splice(this.left.length+this.right.length-s,Number.POSITIVE_INFINITY);aQ(this.left,d.reverse())}}}function aQ(o,s){let d=0;if(s.length<1e4)o.push(...s);else for(;d<s.length;)o.push(...s.slice(d,d+1e4)),d+=1e4}function KLe(o){const s={};let d=-1,y,S,N,B,H,et,W;const nt=new wzn(o);for(;++d<nt.length;){for(;d in s;)d=s[d];if(y=nt.get(d),d&&y[1].type==="chunkFlow"&&nt.get(d-1)[1].type==="listItemPrefix"&&(et=y[1]._tokenizer.events,N=0,N<et.length&&et[N][1].type==="lineEndingBlank"&&(N+=2),N<et.length&&et[N][1].type==="content"))for(;++N<et.length&&et[N][1].type!=="content";)et[N][1].type==="chunkText"&&(et[N][1]._isInFirstContentOfListItem=!0,N++);if(y[0]==="enter")y[1].contentType&&(Object.assign(s,vzn(nt,d)),d=s[d],W=!0);else if(y[1]._container){for(N=d,S=void 0;N--;)if(B=nt.get(N),B[1].type==="lineEnding"||B[1].type==="lineEndingBlank")B[0]==="enter"&&(S&&(nt.get(S)[1].type="lineEndingBlank"),B[1].type="lineEnding",S=N);else if(!(B[1].type==="linePrefix"||B[1].type==="listItemIndent"))break;S&&(y[1].end={...nt.get(S)[1].start},H=nt.slice(S,d),H.unshift(y),nt.splice(S,d-S+1,H))}}return C6(o,0,Number.POSITIVE_INFINITY,nt.slice(0)),!W}function vzn(o,s){const d=o.get(s)[1],y=o.get(s)[2];let S=s-1;const N=[];let B=d._tokenizer;B||(B=y.parser[d.contentType](d.start),d._contentTypeTextTrailing&&(B._contentTypeTextTrailing=!0));const H=B.events,et=[],W={};let nt,K,Q=-1,at=d,mt=0,Lt=0;const Pt=[Lt];for(;at;){for(;o.get(++S)[1]!==at;);N.push(S),at._tokenizer||(nt=y.sliceStream(at),at.next||nt.push(null),K&&B.defineSkip(at.start),at._isInFirstContentOfListItem&&(B._gfmTasklistFirstContentOfListItem=!0),B.write(nt),at._isInFirstContentOfListItem&&(B._gfmTasklistFirstContentOfListItem=void 0)),K=at,at=at.next}for(at=d;++Q<H.length;)H[Q][0]==="exit"&&H[Q-1][0]==="enter"&&H[Q][1].type===H[Q-1][1].type&&H[Q][1].start.line!==H[Q][1].end.line&&(Lt=Q+1,Pt.push(Lt),at._tokenizer=void 0,at.previous=void 0,at=at.next);for(B.events=[],at?(at._tokenizer=void 0,at.previous=void 0):Pt.pop(),Q=Pt.length;Q--;){const Mt=H.slice(Pt[Q],Pt[Q+1]),ie=N.pop();et.push([ie,ie+Mt.length-1]),o.splice(ie,2,Mt)}for(et.reverse(),Q=-1;++Q<et.length;)W[mt+et[Q][0]]=mt+et[Q][1],mt+=et[Q][1]-et[Q][0]-1;return W}const _zn={resolve:Ezn,tokenize:Tzn},xzn={partial:!0,tokenize:kzn};function Ezn(o){return KLe(o),o}function Tzn(o,s){let d;return y;function y(H){return o.enter("content"),d=o.enter("chunkContent",{contentType:"content"}),S(H)}function S(H){return H===null?N(H):nc(H)?o.check(xzn,B,N)(H):(o.consume(H),S)}function N(H){return o.exit("chunkContent"),o.exit("content"),s(H)}function B(H){return o.consume(H),o.exit("chunkContent"),d.next=o.enter("chunkContent",{contentType:"content",previous:d}),d=d.next,S}}function kzn(o,s,d){const y=this;return S;function S(B){return o.exit("chunkContent"),o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),sf(o,N,"linePrefix")}function N(B){if(B===null||nc(B))return d(B);const H=y.events[y.events.length-1];return!y.parser.constructs.disable.null.includes("codeIndented")&&H&&H[1].type==="linePrefix"&&H[2].sliceSerialize(H[1],!0).length>=4?s(B):o.interrupt(y.parser.constructs.flow,d,s)(B)}}function YLe(o,s,d,y,S,N,B,H,et){const W=et||Number.POSITIVE_INFINITY;let nt=0;return K;function K(Mt){return Mt===60?(o.enter(y),o.enter(S),o.enter(N),o.consume(Mt),o.exit(N),Q):Mt===null||Mt===32||Mt===41||LFt(Mt)?d(Mt):(o.enter(y),o.enter(B),o.enter(H),o.enter("chunkString",{contentType:"string"}),Lt(Mt))}function Q(Mt){return Mt===62?(o.enter(N),o.consume(Mt),o.exit(N),o.exit(S),o.exit(y),s):(o.enter(H),o.enter("chunkString",{contentType:"string"}),at(Mt))}function at(Mt){return Mt===62?(o.exit("chunkString"),o.exit(H),Q(Mt)):Mt===null||Mt===60||nc(Mt)?d(Mt):(o.consume(Mt),Mt===92?mt:at)}function mt(Mt){return Mt===60||Mt===62||Mt===92?(o.consume(Mt),at):at(Mt)}function Lt(Mt){return!nt&&(Mt===null||Mt===41||Z2(Mt))?(o.exit("chunkString"),o.exit(H),o.exit(B),o.exit(y),s(Mt)):nt<W&&Mt===40?(o.consume(Mt),nt++,Lt):Mt===41?(o.consume(Mt),nt--,Lt):Mt===null||Mt===32||Mt===40||LFt(Mt)?d(Mt):(o.consume(Mt),Mt===92?Pt:Lt)}function Pt(Mt){return Mt===40||Mt===41||Mt===92?(o.consume(Mt),Lt):Lt(Mt)}}function GLe(o,s,d,y,S,N){const B=this;let H=0,et;return W;function W(at){return o.enter(y),o.enter(S),o.consume(at),o.exit(S),o.enter(N),nt}function nt(at){return H>999||at===null||at===91||at===93&&!et||at===94&&!H&&"_hiddenFootnoteSupport"in B.parser.constructs?d(at):at===93?(o.exit(N),o.enter(S),o.consume(at),o.exit(S),o.exit(y),s):nc(at)?(o.enter("lineEnding"),o.consume(at),o.exit("lineEnding"),nt):(o.enter("chunkString",{contentType:"string"}),K(at))}function K(at){return at===null||at===91||at===93||nc(at)||H++>999?(o.exit("chunkString"),nt(at)):(o.consume(at),et||(et=!Hl(at)),at===92?Q:K)}function Q(at){return at===91||at===92||at===93?(o.consume(at),H++,K):K(at)}}function VLe(o,s,d,y,S,N){let B;return H;function H(Q){return Q===34||Q===39||Q===40?(o.enter(y),o.enter(S),o.consume(Q),o.exit(S),B=Q===40?41:Q,et):d(Q)}function et(Q){return Q===B?(o.enter(S),o.consume(Q),o.exit(S),o.exit(y),s):(o.enter(N),W(Q))}function W(Q){return Q===B?(o.exit(N),et(B)):Q===null?d(Q):nc(Q)?(o.enter("lineEnding"),o.consume(Q),o.exit("lineEnding"),sf(o,W,"linePrefix")):(o.enter("chunkString",{contentType:"string"}),nt(Q))}function nt(Q){return Q===B||Q===null||nc(Q)?(o.exit("chunkString"),W(Q)):(o.consume(Q),Q===92?K:nt)}function K(Q){return Q===B||Q===92?(o.consume(Q),nt):nt(Q)}}function OQ(o,s){let d;return y;function y(S){return nc(S)?(o.enter("lineEnding"),o.consume(S),o.exit("lineEnding"),d=!0,y):Hl(S)?sf(o,y,d?"linePrefix":"lineSuffix")(S):s(S)}}const Czn={name:"definition",tokenize:Azn},Szn={partial:!0,tokenize:Izn};function Azn(o,s,d){const y=this;let S;return N;function N(at){return o.enter("definition"),B(at)}function B(at){return GLe.call(y,o,H,d,"definitionLabel","definitionLabelMarker","definitionLabelString")(at)}function H(at){return S=RF(y.sliceSerialize(y.events[y.events.length-1][1]).slice(1,-1)),at===58?(o.enter("definitionMarker"),o.consume(at),o.exit("definitionMarker"),et):d(at)}function et(at){return Z2(at)?OQ(o,W)(at):W(at)}function W(at){return YLe(o,nt,d,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(at)}function nt(at){return o.attempt(Szn,K,K)(at)}function K(at){return Hl(at)?sf(o,Q,"whitespace")(at):Q(at)}function Q(at){return at===null||nc(at)?(o.exit("definition"),y.parser.defined.push(S),s(at)):d(at)}}function Izn(o,s,d){return y;function y(H){return Z2(H)?OQ(o,S)(H):d(H)}function S(H){return VLe(o,N,d,"definitionTitle","definitionTitleMarker","definitionTitleString")(H)}function N(H){return Hl(H)?sf(o,B,"whitespace")(H):B(H)}function B(H){return H===null||nc(H)?s(H):d(H)}}const Ozn={name:"hardBreakEscape",tokenize:Nzn};function Nzn(o,s,d){return y;function y(N){return o.enter("hardBreakEscape"),o.consume(N),S}function S(N){return nc(N)?(o.exit("hardBreakEscape"),s(N)):d(N)}}const Lzn={name:"headingAtx",resolve:Mzn,tokenize:Pzn};function Mzn(o,s){let d=o.length-2,y=3,S,N;return o[y][1].type==="whitespace"&&(y+=2),d-2>y&&o[d][1].type==="whitespace"&&(d-=2),o[d][1].type==="atxHeadingSequence"&&(y===d-1||d-4>y&&o[d-2][1].type==="whitespace")&&(d-=y+1===d?2:4),d>y&&(S={type:"atxHeadingText",start:o[y][1].start,end:o[d][1].end},N={type:"chunkText",start:o[y][1].start,end:o[d][1].end,contentType:"text"},C6(o,y,d-y+1,[["enter",S,s],["enter",N,s],["exit",N,s],["exit",S,s]])),o}function Pzn(o,s,d){let y=0;return S;function S(nt){return o.enter("atxHeading"),N(nt)}function N(nt){return o.enter("atxHeadingSequence"),B(nt)}function B(nt){return nt===35&&y++<6?(o.consume(nt),B):nt===null||Z2(nt)?(o.exit("atxHeadingSequence"),H(nt)):d(nt)}function H(nt){return nt===35?(o.enter("atxHeadingSequence"),et(nt)):nt===null||nc(nt)?(o.exit("atxHeading"),s(nt)):Hl(nt)?sf(o,H,"whitespace")(nt):(o.enter("atxHeadingText"),W(nt))}function et(nt){return nt===35?(o.consume(nt),et):(o.exit("atxHeadingSequence"),H(nt))}function W(nt){return nt===null||nt===35||Z2(nt)?(o.exit("atxHeadingText"),H(nt)):(o.consume(nt),W)}}const Rzn=["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"],EAe=["pre","script","style","textarea"],Dzn={concrete:!0,name:"htmlFlow",resolveTo:$zn,tokenize:jzn},Bzn={partial:!0,tokenize:zzn},Fzn={partial:!0,tokenize:Hzn};function $zn(o){let s=o.length;for(;s--&&!(o[s][0]==="enter"&&o[s][1].type==="htmlFlow"););return s>1&&o[s-2][1].type==="linePrefix"&&(o[s][1].start=o[s-2][1].start,o[s+1][1].start=o[s-2][1].start,o.splice(s-2,2)),o}function jzn(o,s,d){const y=this;let S,N,B,H,et;return W;function W(We){return nt(We)}function nt(We){return o.enter("htmlFlow"),o.enter("htmlFlowData"),o.consume(We),K}function K(We){return We===33?(o.consume(We),Q):We===47?(o.consume(We),N=!0,Lt):We===63?(o.consume(We),S=3,y.interrupt?s:Oe):_6(We)?(o.consume(We),B=String.fromCharCode(We),Pt):d(We)}function Q(We){return We===45?(o.consume(We),S=2,at):We===91?(o.consume(We),S=5,H=0,mt):_6(We)?(o.consume(We),S=4,y.interrupt?s:Oe):d(We)}function at(We){return We===45?(o.consume(We),y.interrupt?s:Oe):d(We)}function mt(We){const za="CDATA[";return We===za.charCodeAt(H++)?(o.consume(We),H===za.length?y.interrupt?s:hr:mt):d(We)}function Lt(We){return _6(We)?(o.consume(We),B=String.fromCharCode(We),Pt):d(We)}function Pt(We){if(We===null||We===47||We===62||Z2(We)){const za=We===47,Fa=B.toLowerCase();return!za&&!N&&EAe.includes(Fa)?(S=1,y.interrupt?s(We):hr(We)):Rzn.includes(B.toLowerCase())?(S=6,za?(o.consume(We),Mt):y.interrupt?s(We):hr(We)):(S=7,y.interrupt&&!y.parser.lazy[y.now().line]?d(We):N?ie(We):se(We))}return We===45||Sw(We)?(o.consume(We),B+=String.fromCharCode(We),Pt):d(We)}function Mt(We){return We===62?(o.consume(We),y.interrupt?s:hr):d(We)}function ie(We){return Hl(We)?(o.consume(We),ie):qn(We)}function se(We){return We===47?(o.consume(We),qn):We===58||We===95||_6(We)?(o.consume(We),ve):Hl(We)?(o.consume(We),se):qn(We)}function ve(We){return We===45||We===46||We===58||We===95||Sw(We)?(o.consume(We),ve):gn(We)}function gn(We){return We===61?(o.consume(We),fe):Hl(We)?(o.consume(We),gn):se(We)}function fe(We){return We===null||We===60||We===61||We===62||We===96?d(We):We===34||We===39?(o.consume(We),et=We,cn):Hl(We)?(o.consume(We),fe):sr(We)}function cn(We){return We===et?(o.consume(We),et=null,Fn):We===null||nc(We)?d(We):(o.consume(We),cn)}function sr(We){return We===null||We===34||We===39||We===47||We===60||We===61||We===62||We===96||Z2(We)?gn(We):(o.consume(We),sr)}function Fn(We){return We===47||We===62||Hl(We)?se(We):d(We)}function qn(We){return We===62?(o.consume(We),nr):d(We)}function nr(We){return We===null||nc(We)?hr(We):Hl(We)?(o.consume(We),nr):d(We)}function hr(We){return We===45&&S===2?(o.consume(We),hi):We===60&&S===1?(o.consume(We),_a):We===62&&S===4?(o.consume(We),ka):We===63&&S===3?(o.consume(We),Oe):We===93&&S===5?(o.consume(We),yr):nc(We)&&(S===6||S===7)?(o.exit("htmlFlowData"),o.check(Bzn,rs,di)(We)):We===null||nc(We)?(o.exit("htmlFlowData"),di(We)):(o.consume(We),hr)}function di(We){return o.check(Fzn,gi,rs)(We)}function gi(We){return o.enter("lineEnding"),o.consume(We),o.exit("lineEnding"),Ar}function Ar(We){return We===null||nc(We)?di(We):(o.enter("htmlFlowData"),hr(We))}function hi(We){return We===45?(o.consume(We),Oe):hr(We)}function _a(We){return We===47?(o.consume(We),B="",fr):hr(We)}function fr(We){if(We===62){const za=B.toLowerCase();return EAe.includes(za)?(o.consume(We),ka):hr(We)}return _6(We)&&B.length<8?(o.consume(We),B+=String.fromCharCode(We),fr):hr(We)}function yr(We){return We===93?(o.consume(We),Oe):hr(We)}function Oe(We){return We===62?(o.consume(We),ka):We===45&&S===2?(o.consume(We),Oe):hr(We)}function ka(We){return We===null||nc(We)?(o.exit("htmlFlowData"),rs(We)):(o.consume(We),ka)}function rs(We){return o.exit("htmlFlow"),s(We)}}function Hzn(o,s,d){const y=this;return S;function S(B){return nc(B)?(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),N):d(B)}function N(B){return y.parser.lazy[y.now().line]?d(B):s(B)}}function zzn(o,s,d){return y;function y(S){return o.enter("lineEnding"),o.consume(S),o.exit("lineEnding"),o.attempt(m2t,s,d)}}const Uzn={name:"htmlText",tokenize:qzn};function qzn(o,s,d){const y=this;let S,N,B;return H;function H(Oe){return o.enter("htmlText"),o.enter("htmlTextData"),o.consume(Oe),et}function et(Oe){return Oe===33?(o.consume(Oe),W):Oe===47?(o.consume(Oe),gn):Oe===63?(o.consume(Oe),se):_6(Oe)?(o.consume(Oe),sr):d(Oe)}function W(Oe){return Oe===45?(o.consume(Oe),nt):Oe===91?(o.consume(Oe),N=0,mt):_6(Oe)?(o.consume(Oe),ie):d(Oe)}function nt(Oe){return Oe===45?(o.consume(Oe),at):d(Oe)}function K(Oe){return Oe===null?d(Oe):Oe===45?(o.consume(Oe),Q):nc(Oe)?(B=K,_a(Oe)):(o.consume(Oe),K)}function Q(Oe){return Oe===45?(o.consume(Oe),at):K(Oe)}function at(Oe){return Oe===62?hi(Oe):Oe===45?Q(Oe):K(Oe)}function mt(Oe){const ka="CDATA[";return Oe===ka.charCodeAt(N++)?(o.consume(Oe),N===ka.length?Lt:mt):d(Oe)}function Lt(Oe){return Oe===null?d(Oe):Oe===93?(o.consume(Oe),Pt):nc(Oe)?(B=Lt,_a(Oe)):(o.consume(Oe),Lt)}function Pt(Oe){return Oe===93?(o.consume(Oe),Mt):Lt(Oe)}function Mt(Oe){return Oe===62?hi(Oe):Oe===93?(o.consume(Oe),Mt):Lt(Oe)}function ie(Oe){return Oe===null||Oe===62?hi(Oe):nc(Oe)?(B=ie,_a(Oe)):(o.consume(Oe),ie)}function se(Oe){return Oe===null?d(Oe):Oe===63?(o.consume(Oe),ve):nc(Oe)?(B=se,_a(Oe)):(o.consume(Oe),se)}function ve(Oe){return Oe===62?hi(Oe):se(Oe)}function gn(Oe){return _6(Oe)?(o.consume(Oe),fe):d(Oe)}function fe(Oe){return Oe===45||Sw(Oe)?(o.consume(Oe),fe):cn(Oe)}function cn(Oe){return nc(Oe)?(B=cn,_a(Oe)):Hl(Oe)?(o.consume(Oe),cn):hi(Oe)}function sr(Oe){return Oe===45||Sw(Oe)?(o.consume(Oe),sr):Oe===47||Oe===62||Z2(Oe)?Fn(Oe):d(Oe)}function Fn(Oe){return Oe===47?(o.consume(Oe),hi):Oe===58||Oe===95||_6(Oe)?(o.consume(Oe),qn):nc(Oe)?(B=Fn,_a(Oe)):Hl(Oe)?(o.consume(Oe),Fn):hi(Oe)}function qn(Oe){return Oe===45||Oe===46||Oe===58||Oe===95||Sw(Oe)?(o.consume(Oe),qn):nr(Oe)}function nr(Oe){return Oe===61?(o.consume(Oe),hr):nc(Oe)?(B=nr,_a(Oe)):Hl(Oe)?(o.consume(Oe),nr):Fn(Oe)}function hr(Oe){return Oe===null||Oe===60||Oe===61||Oe===62||Oe===96?d(Oe):Oe===34||Oe===39?(o.consume(Oe),S=Oe,di):nc(Oe)?(B=hr,_a(Oe)):Hl(Oe)?(o.consume(Oe),hr):(o.consume(Oe),gi)}function di(Oe){return Oe===S?(o.consume(Oe),S=void 0,Ar):Oe===null?d(Oe):nc(Oe)?(B=di,_a(Oe)):(o.consume(Oe),di)}function gi(Oe){return Oe===null||Oe===34||Oe===39||Oe===60||Oe===61||Oe===96?d(Oe):Oe===47||Oe===62||Z2(Oe)?Fn(Oe):(o.consume(Oe),gi)}function Ar(Oe){return Oe===47||Oe===62||Z2(Oe)?Fn(Oe):d(Oe)}function hi(Oe){return Oe===62?(o.consume(Oe),o.exit("htmlTextData"),o.exit("htmlText"),s):d(Oe)}function _a(Oe){return o.exit("htmlTextData"),o.enter("lineEnding"),o.consume(Oe),o.exit("lineEnding"),fr}function fr(Oe){return Hl(Oe)?sf(o,yr,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Oe):yr(Oe)}function yr(Oe){return o.enter("htmlTextData"),B(Oe)}}const Q$t={name:"labelEnd",resolveAll:Gzn,resolveTo:Vzn,tokenize:Xzn},Wzn={tokenize:Qzn},Kzn={tokenize:Jzn},Yzn={tokenize:Zzn};function Gzn(o){let s=-1;const d=[];for(;++s<o.length;){const y=o[s][1];if(d.push(o[s]),y.type==="labelImage"||y.type==="labelLink"||y.type==="labelEnd"){const S=y.type==="labelImage"?4:2;y.type="data",s+=S}}return o.length!==d.length&&C6(o,0,o.length,d),o}function Vzn(o,s){let d=o.length,y=0,S,N,B,H;for(;d--;)if(S=o[d][1],N){if(S.type==="link"||S.type==="labelLink"&&S._inactive)break;o[d][0]==="enter"&&S.type==="labelLink"&&(S._inactive=!0)}else if(B){if(o[d][0]==="enter"&&(S.type==="labelImage"||S.type==="labelLink")&&!S._balanced&&(N=d,S.type!=="labelLink")){y=2;break}}else S.type==="labelEnd"&&(B=d);const et={type:o[N][1].type==="labelLink"?"link":"image",start:{...o[N][1].start},end:{...o[o.length-1][1].end}},W={type:"label",start:{...o[N][1].start},end:{...o[B][1].end}},nt={type:"labelText",start:{...o[N+y+2][1].end},end:{...o[B-2][1].start}};return H=[["enter",et,s],["enter",W,s]],H=k3(H,o.slice(N+1,N+y+3)),H=k3(H,[["enter",nt,s]]),H=k3(H,X$t(s.parser.constructs.insideSpan.null,o.slice(N+y+4,B-3),s)),H=k3(H,[["exit",nt,s],o[B-2],o[B-1],["exit",W,s]]),H=k3(H,o.slice(B+1)),H=k3(H,[["exit",et,s]]),C6(o,N,o.length,H),o}function Xzn(o,s,d){const y=this;let S=y.events.length,N,B;for(;S--;)if((y.events[S][1].type==="labelImage"||y.events[S][1].type==="labelLink")&&!y.events[S][1]._balanced){N=y.events[S][1];break}return H;function H(Q){return N?N._inactive?K(Q):(B=y.parser.defined.includes(RF(y.sliceSerialize({start:N.end,end:y.now()}))),o.enter("labelEnd"),o.enter("labelMarker"),o.consume(Q),o.exit("labelMarker"),o.exit("labelEnd"),et):d(Q)}function et(Q){return Q===40?o.attempt(Wzn,nt,B?nt:K)(Q):Q===91?o.attempt(Kzn,nt,B?W:K)(Q):B?nt(Q):K(Q)}function W(Q){return o.attempt(Yzn,nt,K)(Q)}function nt(Q){return s(Q)}function K(Q){return N._balanced=!0,d(Q)}}function Qzn(o,s,d){return y;function y(K){return o.enter("resource"),o.enter("resourceMarker"),o.consume(K),o.exit("resourceMarker"),S}function S(K){return Z2(K)?OQ(o,N)(K):N(K)}function N(K){return K===41?nt(K):YLe(o,B,H,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(K)}function B(K){return Z2(K)?OQ(o,et)(K):nt(K)}function H(K){return d(K)}function et(K){return K===34||K===39||K===40?VLe(o,W,d,"resourceTitle","resourceTitleMarker","resourceTitleString")(K):nt(K)}function W(K){return Z2(K)?OQ(o,nt)(K):nt(K)}function nt(K){return K===41?(o.enter("resourceMarker"),o.consume(K),o.exit("resourceMarker"),o.exit("resource"),s):d(K)}}function Jzn(o,s,d){const y=this;return S;function S(H){return GLe.call(y,o,N,B,"reference","referenceMarker","referenceString")(H)}function N(H){return y.parser.defined.includes(RF(y.sliceSerialize(y.events[y.events.length-1][1]).slice(1,-1)))?s(H):d(H)}function B(H){return d(H)}}function Zzn(o,s,d){return y;function y(N){return o.enter("reference"),o.enter("referenceMarker"),o.consume(N),o.exit("referenceMarker"),S}function S(N){return N===93?(o.enter("referenceMarker"),o.consume(N),o.exit("referenceMarker"),o.exit("reference"),s):d(N)}}const tUn={name:"labelStartImage",resolveAll:Q$t.resolveAll,tokenize:eUn};function eUn(o,s,d){const y=this;return S;function S(H){return o.enter("labelImage"),o.enter("labelImageMarker"),o.consume(H),o.exit("labelImageMarker"),N}function N(H){return H===91?(o.enter("labelMarker"),o.consume(H),o.exit("labelMarker"),o.exit("labelImage"),B):d(H)}function B(H){return H===94&&"_hiddenFootnoteSupport"in y.parser.constructs?d(H):s(H)}}const nUn={name:"labelStartLink",resolveAll:Q$t.resolveAll,tokenize:rUn};function rUn(o,s,d){const y=this;return S;function S(B){return o.enter("labelLink"),o.enter("labelMarker"),o.consume(B),o.exit("labelMarker"),o.exit("labelLink"),N}function N(B){return B===94&&"_hiddenFootnoteSupport"in y.parser.constructs?d(B):s(B)}}const pBt={name:"lineEnding",tokenize:iUn};function iUn(o,s){return d;function d(y){return o.enter("lineEnding"),o.consume(y),o.exit("lineEnding"),sf(o,s,"linePrefix")}}const Zbt={name:"thematicBreak",tokenize:aUn};function aUn(o,s,d){let y=0,S;return N;function N(W){return o.enter("thematicBreak"),B(W)}function B(W){return S=W,H(W)}function H(W){return W===S?(o.enter("thematicBreakSequence"),et(W)):y>=3&&(W===null||nc(W))?(o.exit("thematicBreak"),s(W)):d(W)}function et(W){return W===S?(o.consume(W),y++,et):(o.exit("thematicBreakSequence"),Hl(W)?sf(o,H,"whitespace")(W):H(W))}}const V2={continuation:{tokenize:uUn},exit:hUn,name:"list",tokenize:cUn},sUn={partial:!0,tokenize:fUn},oUn={partial:!0,tokenize:lUn};function cUn(o,s,d){const y=this,S=y.events[y.events.length-1];let N=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,B=0;return H;function H(at){const mt=y.containerState.type||(at===42||at===43||at===45?"listUnordered":"listOrdered");if(mt==="listUnordered"?!y.containerState.marker||at===y.containerState.marker:MFt(at)){if(y.containerState.type||(y.containerState.type=mt,o.enter(mt,{_container:!0})),mt==="listUnordered")return o.enter("listItemPrefix"),at===42||at===45?o.check(Zbt,d,W)(at):W(at);if(!y.interrupt||at===49)return o.enter("listItemPrefix"),o.enter("listItemValue"),et(at)}return d(at)}function et(at){return MFt(at)&&++B<10?(o.consume(at),et):(!y.interrupt||B<2)&&(y.containerState.marker?at===y.containerState.marker:at===41||at===46)?(o.exit("listItemValue"),W(at)):d(at)}function W(at){return o.enter("listItemMarker"),o.consume(at),o.exit("listItemMarker"),y.containerState.marker=y.containerState.marker||at,o.check(m2t,y.interrupt?d:nt,o.attempt(sUn,Q,K))}function nt(at){return y.containerState.initialBlankLine=!0,N++,Q(at)}function K(at){return Hl(at)?(o.enter("listItemPrefixWhitespace"),o.consume(at),o.exit("listItemPrefixWhitespace"),Q):d(at)}function Q(at){return y.containerState.size=N+y.sliceSerialize(o.exit("listItemPrefix"),!0).length,s(at)}}function uUn(o,s,d){const y=this;return y.containerState._closeFlow=void 0,o.check(m2t,S,N);function S(H){return y.containerState.furtherBlankLines=y.containerState.furtherBlankLines||y.containerState.initialBlankLine,sf(o,s,"listItemIndent",y.containerState.size+1)(H)}function N(H){return y.containerState.furtherBlankLines||!Hl(H)?(y.containerState.furtherBlankLines=void 0,y.containerState.initialBlankLine=void 0,B(H)):(y.containerState.furtherBlankLines=void 0,y.containerState.initialBlankLine=void 0,o.attempt(oUn,s,B)(H))}function B(H){return y.containerState._closeFlow=!0,y.interrupt=void 0,sf(o,o.attempt(V2,s,d),"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H)}}function lUn(o,s,d){const y=this;return sf(o,S,"listItemIndent",y.containerState.size+1);function S(N){const B=y.events[y.events.length-1];return B&&B[1].type==="listItemIndent"&&B[2].sliceSerialize(B[1],!0).length===y.containerState.size?s(N):d(N)}}function hUn(o){o.exit(this.containerState.type)}function fUn(o,s,d){const y=this;return sf(o,S,"listItemPrefixWhitespace",y.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function S(N){const B=y.events[y.events.length-1];return!Hl(N)&&B&&B[1].type==="listItemPrefixWhitespace"?s(N):d(N)}}const TAe={name:"setextUnderline",resolveTo:dUn,tokenize:pUn};function dUn(o,s){let d=o.length,y,S,N;for(;d--;)if(o[d][0]==="enter"){if(o[d][1].type==="content"){y=d;break}o[d][1].type==="paragraph"&&(S=d)}else o[d][1].type==="content"&&o.splice(d,1),!N&&o[d][1].type==="definition"&&(N=d);const B={type:"setextHeading",start:{...o[y][1].start},end:{...o[o.length-1][1].end}};return o[S][1].type="setextHeadingText",N?(o.splice(S,0,["enter",B,s]),o.splice(N+1,0,["exit",o[y][1],s]),o[y][1].end={...o[N][1].end}):o[y][1]=B,o.push(["exit",B,s]),o}function pUn(o,s,d){const y=this;let S;return N;function N(W){let nt=y.events.length,K;for(;nt--;)if(y.events[nt][1].type!=="lineEnding"&&y.events[nt][1].type!=="linePrefix"&&y.events[nt][1].type!=="content"){K=y.events[nt][1].type==="paragraph";break}return!y.parser.lazy[y.now().line]&&(y.interrupt||K)?(o.enter("setextHeadingLine"),S=W,B(W)):d(W)}function B(W){return o.enter("setextHeadingLineSequence"),H(W)}function H(W){return W===S?(o.consume(W),H):(o.exit("setextHeadingLineSequence"),Hl(W)?sf(o,et,"lineSuffix")(W):et(W))}function et(W){return W===null||nc(W)?(o.exit("setextHeadingLine"),s(W)):d(W)}}const gUn={tokenize:bUn};function bUn(o){const s=this,d=o.attempt(m2t,y,o.attempt(this.parser.constructs.flowInitial,S,sf(o,o.attempt(this.parser.constructs.flow,S,o.attempt(_zn,S)),"linePrefix")));return d;function y(N){if(N===null){o.consume(N);return}return o.enter("lineEndingBlank"),o.consume(N),o.exit("lineEndingBlank"),s.currentConstruct=void 0,d}function S(N){if(N===null){o.consume(N);return}return o.enter("lineEnding"),o.consume(N),o.exit("lineEnding"),s.currentConstruct=void 0,d}}const mUn={resolveAll:QLe()},yUn=XLe("string"),wUn=XLe("text");function XLe(o){return{resolveAll:QLe(o==="text"?vUn:void 0),tokenize:s};function s(d){const y=this,S=this.parser.constructs[o],N=d.attempt(S,B,H);return B;function B(nt){return W(nt)?N(nt):H(nt)}function H(nt){if(nt===null){d.consume(nt);return}return d.enter("data"),d.consume(nt),et}function et(nt){return W(nt)?(d.exit("data"),N(nt)):(d.consume(nt),et)}function W(nt){if(nt===null)return!0;const K=S[nt];let Q=-1;if(K)for(;++Q<K.length;){const at=K[Q];if(!at.previous||at.previous.call(y,y.previous))return!0}return!1}}}function QLe(o){return s;function s(d,y){let S=-1,N;for(;++S<=d.length;)N===void 0?d[S]&&d[S][1].type==="data"&&(N=S,S++):(!d[S]||d[S][1].type!=="data")&&(S!==N+2&&(d[N][1].end=d[S-1][1].end,d.splice(N+2,S-N-2),S=N+2),N=void 0);return o?o(d,y):d}}function vUn(o,s){let d=0;for(;++d<=o.length;)if((d===o.length||o[d][1].type==="lineEnding")&&o[d-1][1].type==="data"){const y=o[d-1][1],S=s.sliceStream(y);let N=S.length,B=-1,H=0,et;for(;N--;){const W=S[N];if(typeof W=="string"){for(B=W.length;W.charCodeAt(B-1)===32;)H++,B--;if(B)break;B=-1}else if(W===-2)et=!0,H++;else if(W!==-1){N++;break}}if(s._contentTypeTextTrailing&&d===o.length&&(H=0),H){const W={type:d===o.length||et||H<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:N?B:y.start._bufferIndex+B,_index:y.start._index+N,line:y.end.line,column:y.end.column-H,offset:y.end.offset-H},end:{...y.end}};y.end={...W.start},y.start.offset===y.end.offset?Object.assign(y,W):(o.splice(d,0,["enter",W,s],["exit",W,s]),d+=2)}d++}return o}const _Un={42:V2,43:V2,45:V2,48:V2,49:V2,50:V2,51:V2,52:V2,53:V2,54:V2,55:V2,56:V2,57:V2,62:ULe},xUn={91:Czn},EUn={[-2]:dBt,[-1]:dBt,32:dBt},TUn={35:Lzn,42:Zbt,45:[TAe,Zbt],60:Dzn,61:TAe,95:Zbt,96:xAe,126:xAe},kUn={38:WLe,92:qLe},CUn={[-5]:pBt,[-4]:pBt,[-3]:pBt,33:tUn,38:WLe,42:PFt,60:[nzn,Uzn],91:nUn,92:[Ozn,qLe],93:Q$t,95:PFt,96:gzn},SUn={null:[PFt,mUn]},AUn={null:[42,95]},IUn={null:[]},OUn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:AUn,contentInitial:xUn,disable:IUn,document:_Un,flow:TUn,flowInitial:EUn,insideSpan:SUn,string:kUn,text:CUn},Symbol.toStringTag,{value:"Module"}));function NUn(o,s,d){let y={_bufferIndex:-1,_index:0,line:d&&d.line||1,column:d&&d.column||1,offset:d&&d.offset||0};const S={},N=[];let B=[],H=[];const et={attempt:cn(gn),check:cn(fe),consume:ie,enter:se,exit:ve,interrupt:cn(fe,{interrupt:!0})},W={code:null,containerState:{},defineSkip:Lt,events:[],now:mt,parser:o,previous:null,sliceSerialize:Q,sliceStream:at,write:K};let nt=s.tokenize.call(W,et);return s.resolveAll&&N.push(s),W;function K(nr){return B=k3(B,nr),Pt(),B[B.length-1]!==null?[]:(sr(s,0),W.events=X$t(N,W.events,W),W.events)}function Q(nr,hr){return MUn(at(nr),hr)}function at(nr){return LUn(B,nr)}function mt(){const{_bufferIndex:nr,_index:hr,line:di,column:gi,offset:Ar}=y;return{_bufferIndex:nr,_index:hr,line:di,column:gi,offset:Ar}}function Lt(nr){S[nr.line]=nr.column,qn()}function Pt(){let nr;for(;y._index<B.length;){const hr=B[y._index];if(typeof hr=="string")for(nr=y._index,y._bufferIndex<0&&(y._bufferIndex=0);y._index===nr&&y._bufferIndex<hr.length;)Mt(hr.charCodeAt(y._bufferIndex));else Mt(hr)}}function Mt(nr){nt=nt(nr)}function ie(nr){nc(nr)?(y.line++,y.column=1,y.offset+=nr===-3?2:1,qn()):nr!==-1&&(y.column++,y.offset++),y._bufferIndex<0?y._index++:(y._bufferIndex++,y._bufferIndex===B[y._index].length&&(y._bufferIndex=-1,y._index++)),W.previous=nr}function se(nr,hr){const di=hr||{};return di.type=nr,di.start=mt(),W.events.push(["enter",di,W]),H.push(di),di}function ve(nr){const hr=H.pop();return hr.end=mt(),W.events.push(["exit",hr,W]),hr}function gn(nr,hr){sr(nr,hr.from)}function fe(nr,hr){hr.restore()}function cn(nr,hr){return di;function di(gi,Ar,hi){let _a,fr,yr,Oe;return Array.isArray(gi)?rs(gi):"tokenize"in gi?rs([gi]):ka(gi);function ka(Sa){return $s;function $s(su){const mu=su!==null&&Sa[su],js=su!==null&&Sa.null,pc=[...Array.isArray(mu)?mu:mu?[mu]:[],...Array.isArray(js)?js:js?[js]:[]];return rs(pc)(su)}}function rs(Sa){return _a=Sa,fr=0,Sa.length===0?hi:We(Sa[fr])}function We(Sa){return $s;function $s(su){return Oe=Fn(),yr=Sa,Sa.partial||(W.currentConstruct=Sa),Sa.name&&W.parser.constructs.disable.null.includes(Sa.name)?Fa():Sa.tokenize.call(hr?Object.assign(Object.create(W),hr):W,et,za,Fa)(su)}}function za(Sa){return nr(yr,Oe),Ar}function Fa(Sa){return Oe.restore(),++fr<_a.length?We(_a[fr]):hi}}}function sr(nr,hr){nr.resolveAll&&!N.includes(nr)&&N.push(nr),nr.resolve&&C6(W.events,hr,W.events.length-hr,nr.resolve(W.events.slice(hr),W)),nr.resolveTo&&(W.events=nr.resolveTo(W.events,W))}function Fn(){const nr=mt(),hr=W.previous,di=W.currentConstruct,gi=W.events.length,Ar=Array.from(H);return{from:gi,restore:hi};function hi(){y=nr,W.previous=hr,W.currentConstruct=di,W.events.length=gi,H=Ar,qn()}}function qn(){y.line in S&&y.column<2&&(y.column=S[y.line],y.offset+=S[y.line]-1)}}function LUn(o,s){const d=s.start._index,y=s.start._bufferIndex,S=s.end._index,N=s.end._bufferIndex;let B;if(d===S)B=[o[d].slice(y,N)];else{if(B=o.slice(d,S),y>-1){const H=B[0];typeof H=="string"?B[0]=H.slice(y):B.shift()}N>0&&B.push(o[S].slice(0,N))}return B}function MUn(o,s){let d=-1;const y=[];let S;for(;++d<o.length;){const N=o[d];let B;if(typeof N=="string")B=N;else switch(N){case-5:{B="\r";break}case-4:{B=`
1915
+ `);this.baseURL=H.baseURL,this.timeout=H.timeout??$$t.DEFAULT_TIMEOUT,this.logger=H.logger??console;const et="warn";this.logLevel=et,this.logLevel=O9e(H.logLevel,"ClientOptions.logLevel",this)??O9e(xF("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??et,this.fetchOptions=H.fetchOptions,this.maxRetries=H.maxRetries??2,this.fetch=H.fetch??WFn(),qo(this,Jbt,YFn),this._options=H,this.apiKey=typeof d=="string"?d:"Missing Key",this.organization=y,this.project=S,this.webhookSecret=N}withOptions(s){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...s})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:s,nulls:d}){}async authHeaders(s){return hs([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(s){return ZFn(s,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${AF}`}defaultIdempotencyKey(){return`stainless-node-retry-${jOe()}`}makeStatusError(s,d,y,S){return Mg.generate(s,d,y,S)}async _callApiKey(){const s=this._options.apiKey;if(typeof s!="function")return!1;let d;try{d=await s()}catch(y){throw y instanceof ro?y:new ro(`Failed to get token from 'apiKey' function: ${y.message}`,{cause:y})}if(typeof d!="string"||!d)throw new ro(`Expected 'apiKey' function argument to return a string but it returned ${d}`);return this.apiKey=d,!0}buildURL(s,d,y){const S=!lr(this,SFt,"m",mLe).call(this)&&y||this.baseURL,N=RFn(s)?new URL(s):new URL(S+(S.endsWith("/")&&s.startsWith("/")?s.slice(1):s)),B=this.defaultQuery();return DFn(B)||(d={...B,...d}),typeof d=="object"&&d&&!Array.isArray(d)&&(N.search=this.stringifyQuery(d)),N.toString()}async prepareOptions(s){await this._callApiKey()}async prepareRequest(s,{url:d,options:y}){}get(s,d){return this.methodRequest("get",s,d)}post(s,d){return this.methodRequest("post",s,d)}patch(s,d){return this.methodRequest("patch",s,d)}put(s,d){return this.methodRequest("put",s,d)}delete(s,d){return this.methodRequest("delete",s,d)}methodRequest(s,d,y){return this.request(Promise.resolve(y).then(S=>({method:s,path:d,...S})))}request(s,d=null){return new i2t(this,this.makeRequest(s,d,void 0))}async makeRequest(s,d,y){var Mt,ie;const S=await s,N=S.maxRetries??this.maxRetries;d==null&&(d=N),await this.prepareOptions(S);const{req:B,url:H,timeout:et}=await this.buildRequest(S,{retryCount:N-d});await this.prepareRequest(B,{url:H,options:S});const W="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),nt=y===void 0?"":`, retryOf: ${y}`,K=Date.now();if(Ng(this).debug(`[${W}] sending request`,YN({retryOfRequestLogID:y,method:S.method,url:H,options:S,headers:B.headers})),(Mt=S.signal)!=null&&Mt.aborted)throw new A3;const Q=new AbortController,at=await this.fetchWithTimeout(H,B,et,Q).catch(gFt),mt=Date.now();if(at instanceof globalThis.Error){const se=`retrying, ${d} attempts remaining`;if((ie=S.signal)!=null&&ie.aborted)throw new A3;const ve=pFt(at)||/timed? ?out/i.test(String(at)+("cause"in at?String(at.cause):""));if(d)return Ng(this).info(`[${W}] connection ${ve?"timed out":"failed"} - ${se}`),Ng(this).debug(`[${W}] connection ${ve?"timed out":"failed"} (${se})`,YN({retryOfRequestLogID:y,url:H,durationMs:mt-K,message:at.message})),this.retryRequest(S,d,y??W);throw Ng(this).info(`[${W}] connection ${ve?"timed out":"failed"} - error; no more retries left`),Ng(this).debug(`[${W}] connection ${ve?"timed out":"failed"} (error; no more retries left)`,YN({retryOfRequestLogID:y,url:H,durationMs:mt-K,message:at.message})),ve?new m$t:new n2t({cause:at})}const Lt=[...at.headers.entries()].filter(([se])=>se==="x-request-id").map(([se,ve])=>", "+se+": "+JSON.stringify(ve)).join(""),Pt=`[${W}${nt}${Lt}] ${B.method} ${H} ${at.ok?"succeeded":"failed"} with status ${at.status} in ${mt-K}ms`;if(!at.ok){const se=await this.shouldRetry(at);if(d&&se){const Fn=`retrying, ${d} attempts remaining`;return await KFn(at.body),Ng(this).info(`${Pt} - ${Fn}`),Ng(this).debug(`[${W}] response error (${Fn})`,YN({retryOfRequestLogID:y,url:at.url,status:at.status,headers:at.headers,durationMs:mt-K})),this.retryRequest(S,d,y??W,at.headers)}const ve=se?"error; no more retries left":"error; not retryable";Ng(this).info(`${Pt} - ${ve}`);const gn=await at.text().catch(Fn=>gFt(Fn).message),fe=$Fn(gn),cn=fe?void 0:gn;throw Ng(this).debug(`[${W}] response error (${ve})`,YN({retryOfRequestLogID:y,url:at.url,status:at.status,headers:at.headers,message:cn,durationMs:Date.now()-K})),this.makeStatusError(at.status,fe,cn,at.headers)}return Ng(this).info(Pt),Ng(this).debug(`[${W}] response start`,YN({retryOfRequestLogID:y,url:at.url,status:at.status,headers:at.headers,durationMs:mt-K})),{response:at,options:S,controller:Q,requestLogID:W,retryOfRequestLogID:y,startTime:K}}getAPIList(s,d,y){return this.requestAPIList(d,{method:"get",path:s,...y})}requestAPIList(s,d){const y=this.makeRequest(d,null,void 0);return new c$n(this,y,s)}async fetchWithTimeout(s,d,y,S){const{signal:N,method:B,...H}=d||{};N&&N.addEventListener("abort",()=>S.abort());const et=setTimeout(()=>S.abort(),y),W=globalThis.ReadableStream&&H.body instanceof globalThis.ReadableStream||typeof H.body=="object"&&H.body!==null&&Symbol.asyncIterator in H.body,nt={signal:S.signal,...W?{duplex:"half"}:{},method:"GET",...H};B&&(nt.method=B.toUpperCase());try{return await this.fetch.call(void 0,s,nt)}finally{clearTimeout(et)}}async shouldRetry(s){const d=s.headers.get("x-should-retry");return d==="true"?!0:d==="false"?!1:s.status===408||s.status===409||s.status===429||s.status>=500}async retryRequest(s,d,y,S){let N;const B=S==null?void 0:S.get("retry-after-ms");if(B){const et=parseFloat(B);Number.isNaN(et)||(N=et)}const H=S==null?void 0:S.get("retry-after");if(H&&!N){const et=parseFloat(H);Number.isNaN(et)?N=Date.parse(H)-Date.now():N=et*1e3}if(!(N&&0<=N&&N<60*1e3)){const et=s.maxRetries??this.maxRetries;N=this.calculateDefaultRetryTimeoutMillis(d,et)}return await JQ(N),this.makeRequest(s,d-1,y)}calculateDefaultRetryTimeoutMillis(s,d){const N=d-s,B=Math.min(.5*Math.pow(2,N),8),H=1-Math.random()*.25;return B*H*1e3}async buildRequest(s,{retryCount:d=0}={}){const y={...s},{method:S,path:N,query:B,defaultBaseURL:H}=y,et=this.buildURL(N,B,H);"timeout"in y&&FFn("timeout",y.timeout),y.timeout=y.timeout??this.timeout;const{bodyHeaders:W,body:nt}=this.buildBody({options:y}),K=await this.buildHeaders({options:s,method:S,bodyHeaders:W,retryCount:d});return{req:{method:S,headers:K,...y.signal&&{signal:y.signal},...globalThis.ReadableStream&&nt instanceof globalThis.ReadableStream&&{duplex:"half"},...nt&&{body:nt},...this.fetchOptions??{},...y.fetchOptions??{}},url:et,timeout:y.timeout}}async buildHeaders({options:s,method:d,bodyHeaders:y,retryCount:S}){let N={};this.idempotencyHeader&&d!=="get"&&(s.idempotencyKey||(s.idempotencyKey=this.defaultIdempotencyKey()),N[this.idempotencyHeader]=s.idempotencyKey);const B=hs([N,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(S),...s.timeout?{"X-Stainless-Timeout":String(Math.trunc(s.timeout/1e3))}:{},...qFn(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(s),this._options.defaultHeaders,y,s.headers]);return this.validateHeaders(B),B.values}buildBody({options:{body:s,headers:d}}){if(!s)return{bodyHeaders:void 0,body:void 0};const y=hs([d]);return ArrayBuffer.isView(s)||s instanceof ArrayBuffer||s instanceof DataView||typeof s=="string"&&y.values.has("content-type")||globalThis.Blob&&s instanceof globalThis.Blob||s instanceof FormData||s instanceof URLSearchParams||globalThis.ReadableStream&&s instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:s}:typeof s=="object"&&(Symbol.asyncIterator in s||Symbol.iterator in s&&"next"in s&&typeof s.next=="function")?{bodyHeaders:void 0,body:ZOe(s)}:lr(this,Jbt,"f").call(this,{body:s,headers:y})}}$$t=bu,Jbt=new WeakMap,SFt=new WeakSet,mLe=function(){return this.baseURL!=="https://api.openai.com/v1"};bu.OpenAI=$$t;bu.DEFAULT_TIMEOUT=6e5;bu.OpenAIError=ro;bu.APIError=Mg;bu.APIConnectionError=n2t;bu.APIConnectionTimeoutError=m$t;bu.APIUserAbortError=A3;bu.NotFoundError=qOe;bu.ConflictError=WOe;bu.RateLimitError=YOe;bu.BadRequestError=HOe;bu.AuthenticationError=zOe;bu.InternalServerError=GOe;bu.PermissionDeniedError=UOe;bu.UnprocessableEntityError=KOe;bu.InvalidWebhookSignatureError=hQ;bu.toFile=d$n;bu.Completions=KNe;bu.Chat=C$t;bu.Embeddings=VNe;bu.Files=QNe;bu.Images=rLe;bu.Audio=tJ;bu.Moderations=aLe;bu.Models=iLe;bu.FineTuning=e$;bu.Graders=D$t;bu.VectorStores=h2t;bu.Webhooks=bLe;bu.Beta=t$;bu.Batches=FNe;bu.Uploads=F$t;bu.Responses=l2t;bu.Realtime=u2t;bu.Conversations=O$t;bu.Evals=L$t;bu.Containers=I$t;bu.Videos=pLe;const G9e=n5(pe.jsx("path",{d:"M3 4V1h2v3h3v2H5v3H3V6H0V4zm3 6V7h3V4h7l1.83 2H21c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V10zm7 9c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5m-3.2-5c0 1.77 1.43 3.2 3.2 3.2s3.2-1.43 3.2-3.2-1.43-3.2-3.2-3.2-3.2 1.43-3.2 3.2"}),"AddAPhoto"),$$n=n5([pe.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),pe.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong"),j$n=n5(pe.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send");function H$n(o,s){if(o.match(/^[a-z]+:\/\//i))return o;if(o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i))return o;const d=document.implementation.createHTMLDocument(),y=d.createElement("base"),S=d.createElement("a");return d.head.appendChild(y),d.body.appendChild(S),s&&(y.href=s),S.href=o,S.href}const z$n=(()=>{let o=0;const s=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(o+=1,`u${s()}${o}`)})();function a7(o){const s=[];for(let d=0,y=o.length;d<y;d++)s.push(o[d]);return s}let TF=null;function yLe(o={}){return TF||(o.includeStyleProperties?(TF=o.includeStyleProperties,TF):(TF=a7(window.getComputedStyle(document.documentElement)),TF))}function Rmt(o,s){const y=(o.ownerDocument.defaultView||window).getComputedStyle(o).getPropertyValue(s);return y?parseFloat(y.replace("px","")):0}function U$n(o){const s=Rmt(o,"border-left-width"),d=Rmt(o,"border-right-width");return o.clientWidth+s+d}function q$n(o){const s=Rmt(o,"border-top-width"),d=Rmt(o,"border-bottom-width");return o.clientHeight+s+d}function wLe(o,s={}){const d=s.width||U$n(o),y=s.height||q$n(o);return{width:d,height:y}}function W$n(){let o,s;try{s=process}catch{}const d=s&&s.env?s.env.devicePixelRatio:null;return d&&(o=parseInt(d,10),Number.isNaN(o)&&(o=1)),o||window.devicePixelRatio||1}const ww=16384;function K$n(o){(o.width>ww||o.height>ww)&&(o.width>ww&&o.height>ww?o.width>o.height?(o.height*=ww/o.width,o.width=ww):(o.width*=ww/o.height,o.height=ww):o.width>ww?(o.height*=ww/o.width,o.width=ww):(o.width*=ww/o.height,o.height=ww))}function Dmt(o){return new Promise((s,d)=>{const y=new Image;y.onload=()=>{y.decode().then(()=>{requestAnimationFrame(()=>s(y))})},y.onerror=d,y.crossOrigin="anonymous",y.decoding="async",y.src=o})}async function Y$n(o){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(o)).then(encodeURIComponent).then(s=>`data:image/svg+xml;charset=utf-8,${s}`)}async function G$n(o,s,d){const y="http://www.w3.org/2000/svg",S=document.createElementNS(y,"svg"),N=document.createElementNS(y,"foreignObject");return S.setAttribute("width",`${s}`),S.setAttribute("height",`${d}`),S.setAttribute("viewBox",`0 0 ${s} ${d}`),N.setAttribute("width","100%"),N.setAttribute("height","100%"),N.setAttribute("x","0"),N.setAttribute("y","0"),N.setAttribute("externalResourcesRequired","true"),S.appendChild(N),N.appendChild(o),Y$n(S)}const J2=(o,s)=>{if(o instanceof s)return!0;const d=Object.getPrototypeOf(o);return d===null?!1:d.constructor.name===s.name||J2(d,s)};function V$n(o){const s=o.getPropertyValue("content");return`${o.cssText} content: '${s.replace(/'|"/g,"")}';`}function X$n(o,s){return yLe(s).map(d=>{const y=o.getPropertyValue(d),S=o.getPropertyPriority(d);return`${d}: ${y}${S?" !important":""};`}).join(" ")}function Q$n(o,s,d,y){const S=`.${o}:${s}`,N=d.cssText?V$n(d):X$n(d,y);return document.createTextNode(`${S}{${N}}`)}function V9e(o,s,d,y){const S=window.getComputedStyle(o,d),N=S.getPropertyValue("content");if(N===""||N==="none")return;const B=z$n();try{s.className=`${s.className} ${B}`}catch{return}const H=document.createElement("style");H.appendChild(Q$n(B,d,S,y)),s.appendChild(H)}function J$n(o,s,d){V9e(o,s,":before",d),V9e(o,s,":after",d)}const X9e="application/font-woff",Q9e="image/jpeg",Z$n={woff:X9e,woff2:X9e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Q9e,jpeg:Q9e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function tjn(o){const s=/\.([^./]*?)$/g.exec(o);return s?s[1]:""}function j$t(o){const s=tjn(o).toLowerCase();return Z$n[s]||""}function ejn(o){return o.split(/,/)[1]}function AFt(o){return o.search(/^(data:)/)!==-1}function njn(o,s){return`data:${s};base64,${o}`}async function vLe(o,s,d){const y=await fetch(o,s);if(y.status===404)throw new Error(`Resource "${y.url}" not found`);const S=await y.blob();return new Promise((N,B)=>{const H=new FileReader;H.onerror=B,H.onloadend=()=>{try{N(d({res:y,result:H.result}))}catch(et){B(et)}},H.readAsDataURL(S)})}const lBt={};function rjn(o,s,d){let y=o.replace(/\?.*/,"");return d&&(y=o),/ttf|otf|eot|woff2?/i.test(y)&&(y=y.replace(/.*\//,"")),s?`[${s}]${y}`:y}async function H$t(o,s,d){const y=rjn(o,s,d.includeQueryParams);if(lBt[y]!=null)return lBt[y];d.cacheBust&&(o+=(/\?/.test(o)?"&":"?")+new Date().getTime());let S;try{const N=await vLe(o,d.fetchRequestInit,({res:B,result:H})=>(s||(s=B.headers.get("Content-Type")||""),ejn(H)));S=njn(N,s)}catch(N){S=d.imagePlaceholder||"";let B=`Failed to fetch resource: ${o}`;N&&(B=typeof N=="string"?N:N.message),B&&console.warn(B)}return lBt[y]=S,S}async function ijn(o){const s=o.toDataURL();return s==="data:,"?o.cloneNode(!1):Dmt(s)}async function ajn(o,s){if(o.currentSrc){const N=document.createElement("canvas"),B=N.getContext("2d");N.width=o.clientWidth,N.height=o.clientHeight,B==null||B.drawImage(o,0,0,N.width,N.height);const H=N.toDataURL();return Dmt(H)}const d=o.poster,y=j$t(d),S=await H$t(d,y,s);return Dmt(S)}async function sjn(o,s){var d;try{if(!((d=o==null?void 0:o.contentDocument)===null||d===void 0)&&d.body)return await f2t(o.contentDocument.body,s,!0)}catch{}return o.cloneNode(!1)}async function ojn(o,s){return J2(o,HTMLCanvasElement)?ijn(o):J2(o,HTMLVideoElement)?ajn(o,s):J2(o,HTMLIFrameElement)?sjn(o,s):o.cloneNode(_Le(o))}const cjn=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SLOT",_Le=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SVG";async function ujn(o,s,d){var y,S;if(_Le(s))return s;let N=[];return cjn(o)&&o.assignedNodes?N=a7(o.assignedNodes()):J2(o,HTMLIFrameElement)&&(!((y=o.contentDocument)===null||y===void 0)&&y.body)?N=a7(o.contentDocument.body.childNodes):N=a7(((S=o.shadowRoot)!==null&&S!==void 0?S:o).childNodes),N.length===0||J2(o,HTMLVideoElement)||await N.reduce((B,H)=>B.then(()=>f2t(H,d)).then(et=>{et&&s.appendChild(et)}),Promise.resolve()),s}function ljn(o,s,d){const y=s.style;if(!y)return;const S=window.getComputedStyle(o);S.cssText?(y.cssText=S.cssText,y.transformOrigin=S.transformOrigin):yLe(d).forEach(N=>{let B=S.getPropertyValue(N);N==="font-size"&&B.endsWith("px")&&(B=`${Math.floor(parseFloat(B.substring(0,B.length-2)))-.1}px`),J2(o,HTMLIFrameElement)&&N==="display"&&B==="inline"&&(B="block"),N==="d"&&s.getAttribute("d")&&(B=`path(${s.getAttribute("d")})`),y.setProperty(N,B,S.getPropertyPriority(N))})}function hjn(o,s){J2(o,HTMLTextAreaElement)&&(s.innerHTML=o.value),J2(o,HTMLInputElement)&&s.setAttribute("value",o.value)}function fjn(o,s){if(J2(o,HTMLSelectElement)){const d=s,y=Array.from(d.children).find(S=>o.value===S.getAttribute("value"));y&&y.setAttribute("selected","")}}function djn(o,s,d){return J2(s,Element)&&(ljn(o,s,d),J$n(o,s,d),hjn(o,s),fjn(o,s)),s}async function pjn(o,s){const d=o.querySelectorAll?o.querySelectorAll("use"):[];if(d.length===0)return o;const y={};for(let N=0;N<d.length;N++){const H=d[N].getAttribute("xlink:href");if(H){const et=o.querySelector(H),W=document.querySelector(H);!et&&W&&!y[H]&&(y[H]=await f2t(W,s,!0))}}const S=Object.values(y);if(S.length){const N="http://www.w3.org/1999/xhtml",B=document.createElementNS(N,"svg");B.setAttribute("xmlns",N),B.style.position="absolute",B.style.width="0",B.style.height="0",B.style.overflow="hidden",B.style.display="none";const H=document.createElementNS(N,"defs");B.appendChild(H);for(let et=0;et<S.length;et++)H.appendChild(S[et]);o.appendChild(B)}return o}async function f2t(o,s,d){return!d&&s.filter&&!s.filter(o)?null:Promise.resolve(o).then(y=>ojn(y,s)).then(y=>ujn(o,y,s)).then(y=>djn(o,y,s)).then(y=>pjn(y,s))}const xLe=/url\((['"]?)([^'"]+?)\1\)/g,gjn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,bjn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mjn(o){const s=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${s})(['"]?\\))`,"g")}function yjn(o){const s=[];return o.replace(xLe,(d,y,S)=>(s.push(S),d)),s.filter(d=>!AFt(d))}async function wjn(o,s,d,y,S){try{const N=d?H$n(s,d):s,B=j$t(s);let H;return S||(H=await H$t(N,B,y)),o.replace(mjn(s),`$1${H}$3`)}catch{}return o}function vjn(o,{preferredFontFormat:s}){return s?o.replace(bjn,d=>{for(;;){const[y,,S]=gjn.exec(d)||[];if(!S)return"";if(S===s)return`src: ${y};`}}):o}function ELe(o){return o.search(xLe)!==-1}async function TLe(o,s,d){if(!ELe(o))return o;const y=vjn(o,d);return yjn(y).reduce((N,B)=>N.then(H=>wjn(H,B,s,d)),Promise.resolve(y))}async function kF(o,s,d){var y;const S=(y=s.style)===null||y===void 0?void 0:y.getPropertyValue(o);if(S){const N=await TLe(S,null,d);return s.style.setProperty(o,N,s.style.getPropertyPriority(o)),!0}return!1}async function _jn(o,s){await kF("background",o,s)||await kF("background-image",o,s),await kF("mask",o,s)||await kF("-webkit-mask",o,s)||await kF("mask-image",o,s)||await kF("-webkit-mask-image",o,s)}async function xjn(o,s){const d=J2(o,HTMLImageElement);if(!(d&&!AFt(o.src))&&!(J2(o,SVGImageElement)&&!AFt(o.href.baseVal)))return;const y=d?o.src:o.href.baseVal,S=await H$t(y,j$t(y),s);await new Promise((N,B)=>{o.onload=N,o.onerror=s.onImageErrorHandler?(...et)=>{try{N(s.onImageErrorHandler(...et))}catch(W){B(W)}}:B;const H=o;H.decode&&(H.decode=N),H.loading==="lazy"&&(H.loading="eager"),d?(o.srcset="",o.src=S):o.href.baseVal=S})}async function Ejn(o,s){const y=a7(o.childNodes).map(S=>kLe(S,s));await Promise.all(y).then(()=>o)}async function kLe(o,s){J2(o,Element)&&(await _jn(o,s),await xjn(o,s),await Ejn(o,s))}function Tjn(o,s){const{style:d}=o;s.backgroundColor&&(d.backgroundColor=s.backgroundColor),s.width&&(d.width=`${s.width}px`),s.height&&(d.height=`${s.height}px`);const y=s.style;return y!=null&&Object.keys(y).forEach(S=>{d[S]=y[S]}),o}const J9e={};async function Z9e(o){let s=J9e[o];if(s!=null)return s;const y=await(await fetch(o)).text();return s={url:o,cssText:y},J9e[o]=s,s}async function tAe(o,s){let d=o.cssText;const y=/url\(["']?([^"')]+)["']?\)/g,N=(d.match(/url\([^)]+\)/g)||[]).map(async B=>{let H=B.replace(y,"$1");return H.startsWith("https://")||(H=new URL(H,o.url).href),vLe(H,s.fetchRequestInit,({result:et})=>(d=d.replace(B,`url(${et})`),[B,et]))});return Promise.all(N).then(()=>d)}function eAe(o){if(o==null)return[];const s=[],d=/(\/\*[\s\S]*?\*\/)/gi;let y=o.replace(d,"");const S=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const et=S.exec(y);if(et===null)break;s.push(et[0])}y=y.replace(S,"");const N=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,B="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",H=new RegExp(B,"gi");for(;;){let et=N.exec(y);if(et===null){if(et=H.exec(y),et===null)break;N.lastIndex=H.lastIndex}else H.lastIndex=N.lastIndex;s.push(et[0])}return s}async function kjn(o,s){const d=[],y=[];return o.forEach(S=>{if("cssRules"in S)try{a7(S.cssRules||[]).forEach((N,B)=>{if(N.type===CSSRule.IMPORT_RULE){let H=B+1;const et=N.href,W=Z9e(et).then(nt=>tAe(nt,s)).then(nt=>eAe(nt).forEach(K=>{try{S.insertRule(K,K.startsWith("@import")?H+=1:S.cssRules.length)}catch(Q){console.error("Error inserting rule from remote css",{rule:K,error:Q})}})).catch(nt=>{console.error("Error loading remote css",nt.toString())});y.push(W)}})}catch(N){const B=o.find(H=>H.href==null)||document.styleSheets[0];S.href!=null&&y.push(Z9e(S.href).then(H=>tAe(H,s)).then(H=>eAe(H).forEach(et=>{B.insertRule(et,B.cssRules.length)})).catch(H=>{console.error("Error loading remote stylesheet",H)})),console.error("Error inlining remote css file",N)}}),Promise.all(y).then(()=>(o.forEach(S=>{if("cssRules"in S)try{a7(S.cssRules||[]).forEach(N=>{d.push(N)})}catch(N){console.error(`Error while reading CSS rules from ${S.href}`,N)}}),d))}function Cjn(o){return o.filter(s=>s.type===CSSRule.FONT_FACE_RULE).filter(s=>ELe(s.style.getPropertyValue("src")))}async function Sjn(o,s){if(o.ownerDocument==null)throw new Error("Provided element is not within a Document");const d=a7(o.ownerDocument.styleSheets),y=await kjn(d,s);return Cjn(y)}function CLe(o){return o.trim().replace(/["']/g,"")}function Ajn(o){const s=new Set;function d(y){(y.style.fontFamily||getComputedStyle(y).fontFamily).split(",").forEach(N=>{s.add(CLe(N))}),Array.from(y.children).forEach(N=>{N instanceof HTMLElement&&d(N)})}return d(o),s}async function Ijn(o,s){const d=await Sjn(o,s),y=Ajn(o);return(await Promise.all(d.filter(N=>y.has(CLe(N.style.fontFamily))).map(N=>{const B=N.parentStyleSheet?N.parentStyleSheet.href:null;return TLe(N.cssText,B,s)}))).join(`
1916
+ `)}async function Ojn(o,s){const d=s.fontEmbedCSS!=null?s.fontEmbedCSS:s.skipFonts?null:await Ijn(o,s);if(d){const y=document.createElement("style"),S=document.createTextNode(d);y.appendChild(S),o.firstChild?o.insertBefore(y,o.firstChild):o.appendChild(y)}}async function Njn(o,s={}){const{width:d,height:y}=wLe(o,s),S=await f2t(o,s,!0);return await Ojn(S,s),await kLe(S,s),Tjn(S,s),await G$n(S,d,y)}async function Ljn(o,s={}){const{width:d,height:y}=wLe(o,s),S=await Njn(o,s),N=await Dmt(S),B=document.createElement("canvas"),H=B.getContext("2d"),et=s.pixelRatio||W$n(),W=s.canvasWidth||d,nt=s.canvasHeight||y;return B.width=W*et,B.height=nt*et,s.skipAutoScale||K$n(B),B.style.width=`${W}`,B.style.height=`${nt}`,s.backgroundColor&&(H.fillStyle=s.backgroundColor,H.fillRect(0,0,B.width,B.height)),H.drawImage(N,0,0,B.width,B.height),B}async function Mjn(o,s={}){return(await Ljn(o,s)).toDataURL()}const SLe=n5(pe.jsx("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13"}),"SmartToy");function nAe(o){const s=[],d=String(o||"");let y=d.indexOf(","),S=0,N=!1;for(;!N;){y===-1&&(y=d.length,N=!0);const B=d.slice(S,y).trim();(B||!N)&&s.push(B),S=y+1,y=d.indexOf(",",S)}return s}function z$t(o,s){const d=s||{};return(o[o.length-1]===""?[...o,""]:o).join((d.padRight?" ":"")+","+(d.padLeft===!1?"":" ")).trim()}const Pjn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rjn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Djn={};function rAe(o,s){return(Djn.jsx?Rjn:Pjn).test(o)}const Bjn=/[ \t\n\f\r]/g;function d2t(o){return typeof o=="object"?o.type==="text"?iAe(o.value):!1:iAe(o)}function iAe(o){return o.replace(Bjn,"")===""}let eJ=class{constructor(s,d,y){this.normal=d,this.property=s,y&&(this.space=y)}};eJ.prototype.normal={};eJ.prototype.property={};eJ.prototype.space=void 0;function ALe(o,s){const d={},y={};for(const S of o)Object.assign(d,S.property),Object.assign(y,S.normal);return new eJ(d,y,s)}function WQ(o){return o.toLowerCase()}let ny=class{constructor(s,d){this.attribute=d,this.property=s}};ny.prototype.attribute="";ny.prototype.booleanish=!1;ny.prototype.boolean=!1;ny.prototype.commaOrSpaceSeparated=!1;ny.prototype.commaSeparated=!1;ny.prototype.defined=!1;ny.prototype.mustUseProperty=!1;ny.prototype.number=!1;ny.prototype.overloadedBoolean=!1;ny.prototype.property="";ny.prototype.spaceSeparated=!1;ny.prototype.space=void 0;let Fjn=0;const $c=lL(),o0=lL(),ILe=lL(),la=lL(),rf=lL(),PF=lL(),xw=lL();function lL(){return 2**++Fjn}const IFt=Object.freeze(Object.defineProperty({__proto__:null,boolean:$c,booleanish:o0,commaOrSpaceSeparated:xw,commaSeparated:PF,number:la,overloadedBoolean:ILe,spaceSeparated:rf},Symbol.toStringTag,{value:"Module"})),hBt=Object.keys(IFt);let U$t=class extends ny{constructor(s,d,y,S){let N=-1;if(super(s,d),aAe(this,"space",S),typeof y=="number")for(;++N<hBt.length;){const B=hBt[N];aAe(this,hBt[N],(y&IFt[B])===IFt[B])}}};U$t.prototype.defined=!0;function aAe(o,s,d){d&&(o[s]=d)}function n$(o){const s={},d={};for(const[y,S]of Object.entries(o.properties)){const N=new U$t(y,o.transform(o.attributes||{},y),S,o.space);o.mustUseProperty&&o.mustUseProperty.includes(y)&&(N.mustUseProperty=!0),s[y]=N,d[WQ(y)]=y,d[WQ(N.attribute)]=y}return new eJ(s,d,o.space)}const OLe=n$({properties:{ariaActiveDescendant:null,ariaAtomic:o0,ariaAutoComplete:null,ariaBusy:o0,ariaChecked:o0,ariaColCount:la,ariaColIndex:la,ariaColSpan:la,ariaControls:rf,ariaCurrent:null,ariaDescribedBy:rf,ariaDetails:null,ariaDisabled:o0,ariaDropEffect:rf,ariaErrorMessage:null,ariaExpanded:o0,ariaFlowTo:rf,ariaGrabbed:o0,ariaHasPopup:null,ariaHidden:o0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rf,ariaLevel:la,ariaLive:null,ariaModal:o0,ariaMultiLine:o0,ariaMultiSelectable:o0,ariaOrientation:null,ariaOwns:rf,ariaPlaceholder:null,ariaPosInSet:la,ariaPressed:o0,ariaReadOnly:o0,ariaRelevant:null,ariaRequired:o0,ariaRoleDescription:rf,ariaRowCount:la,ariaRowIndex:la,ariaRowSpan:la,ariaSelected:o0,ariaSetSize:la,ariaSort:null,ariaValueMax:la,ariaValueMin:la,ariaValueNow:la,ariaValueText:null,role:null},transform(o,s){return s==="role"?s:"aria-"+s.slice(4).toLowerCase()}});function NLe(o,s){return s in o?o[s]:s}function LLe(o,s){return NLe(o,s.toLowerCase())}const $jn=n$({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:PF,acceptCharset:rf,accessKey:rf,action:null,allow:null,allowFullScreen:$c,allowPaymentRequest:$c,allowUserMedia:$c,alt:null,as:null,async:$c,autoCapitalize:null,autoComplete:rf,autoFocus:$c,autoPlay:$c,blocking:rf,capture:null,charSet:null,checked:$c,cite:null,className:rf,cols:la,colSpan:null,content:null,contentEditable:o0,controls:$c,controlsList:rf,coords:la|PF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$c,defer:$c,dir:null,dirName:null,disabled:$c,download:ILe,draggable:o0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$c,formTarget:null,headers:rf,height:la,hidden:$c,high:la,href:null,hrefLang:null,htmlFor:rf,httpEquiv:rf,id:null,imageSizes:null,imageSrcSet:null,inert:$c,inputMode:null,integrity:null,is:null,isMap:$c,itemId:null,itemProp:rf,itemRef:rf,itemScope:$c,itemType:rf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$c,low:la,manifest:null,max:null,maxLength:la,media:null,method:null,min:null,minLength:la,multiple:$c,muted:$c,name:null,nonce:null,noModule:$c,noValidate:$c,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:$c,optimum:la,pattern:null,ping:rf,placeholder:null,playsInline:$c,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$c,referrerPolicy:null,rel:rf,required:$c,reversed:$c,rows:la,rowSpan:la,sandbox:rf,scope:null,scoped:$c,seamless:$c,selected:$c,shadowRootClonable:$c,shadowRootDelegatesFocus:$c,shadowRootMode:null,shape:null,size:la,sizes:null,slot:null,span:la,spellCheck:o0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:la,step:null,style:null,tabIndex:la,target:null,title:null,translate:null,type:null,typeMustMatch:$c,useMap:null,value:o0,width:la,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rf,axis:null,background:null,bgColor:null,border:la,borderColor:null,bottomMargin:la,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$c,declare:$c,event:null,face:null,frame:null,frameBorder:null,hSpace:la,leftMargin:la,link:null,longDesc:null,lowSrc:null,marginHeight:la,marginWidth:la,noResize:$c,noHref:$c,noShade:$c,noWrap:$c,object:null,profile:null,prompt:null,rev:null,rightMargin:la,rules:null,scheme:null,scrolling:o0,standby:null,summary:null,text:null,topMargin:la,valueType:null,version:null,vAlign:null,vLink:null,vSpace:la,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$c,disableRemotePlayback:$c,prefix:null,property:null,results:la,security:null,unselectable:null},space:"html",transform:LLe}),jjn=n$({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:xw,accentHeight:la,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:la,amplitude:la,arabicForm:null,ascent:la,attributeName:null,attributeType:null,azimuth:la,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:la,by:null,calcMode:null,capHeight:la,className:rf,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:la,diffuseConstant:la,direction:null,display:null,dur:null,divisor:la,dominantBaseline:null,download:$c,dx:null,dy:null,edgeMode:null,editable:null,elevation:la,enableBackground:null,end:null,event:null,exponent:la,externalResourcesRequired:null,fill:null,fillOpacity:la,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:PF,g2:PF,glyphName:PF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:la,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:la,horizOriginX:la,horizOriginY:la,id:null,ideographic:la,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:la,k:la,k1:la,k2:la,k3:la,k4:la,kernelMatrix:xw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:la,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:la,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:la,overlineThickness:la,paintOrder:null,panose1:null,path:null,pathLength:la,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:la,pointsAtY:la,pointsAtZ:la,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xw,rev:xw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xw,requiredFeatures:xw,requiredFonts:xw,requiredFormats:xw,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:la,specularExponent:la,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:la,strikethroughThickness:la,string:null,stroke:null,strokeDashArray:xw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:la,strokeOpacity:la,strokeWidth:null,style:null,surfaceScale:la,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xw,tabIndex:la,tableValues:null,target:null,targetX:la,targetY:la,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:la,underlineThickness:la,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:la,values:null,vAlphabetic:la,vMathematical:la,vectorEffect:null,vHanging:la,vIdeographic:la,version:null,vertAdvY:la,vertOriginX:la,vertOriginY:la,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:la,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:NLe}),MLe=n$({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(o,s){return"xlink:"+s.slice(5).toLowerCase()}}),PLe=n$({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:LLe}),RLe=n$({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(o,s){return"xml:"+s.slice(3).toLowerCase()}}),Hjn={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"},zjn=/[A-Z]/g,sAe=/-[a-z]/g,Ujn=/^data[-\w.:]+$/i;function p2t(o,s){const d=WQ(s);let y=s,S=ny;if(d in o.normal)return o.property[o.normal[d]];if(d.length>4&&d.slice(0,4)==="data"&&Ujn.test(s)){if(s.charAt(4)==="-"){const N=s.slice(5).replace(sAe,Wjn);y="data"+N.charAt(0).toUpperCase()+N.slice(1)}else{const N=s.slice(4);if(!sAe.test(N)){let B=N.replace(zjn,qjn);B.charAt(0)!=="-"&&(B="-"+B),s="data"+B}}S=U$t}return new S(y,s)}function qjn(o){return"-"+o.toLowerCase()}function Wjn(o){return o.charAt(1).toUpperCase()}const nJ=ALe([OLe,$jn,MLe,PLe,RLe],"html"),c7=ALe([OLe,jjn,MLe,PLe,RLe],"svg");function oAe(o){const s=String(o||"").trim();return s?s.split(/[ \t\n\r\f]+/g):[]}function q$t(o){return o.join(" ").trim()}var W$t={},cAe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Kjn=/\n/g,Yjn=/^\s*/,Gjn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Vjn=/^:\s*/,Xjn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Qjn=/^[;\s]*/,Jjn=/^\s+|\s+$/g,Zjn=`
1917
+ `,uAe="/",lAe="*",XN="",tHn="comment",eHn="declaration",nHn=function(o,s){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];s=s||{};var d=1,y=1;function S(mt){var Lt=mt.match(Kjn);Lt&&(d+=Lt.length);var Pt=mt.lastIndexOf(Zjn);y=~Pt?mt.length-Pt:y+mt.length}function N(){var mt={line:d,column:y};return function(Lt){return Lt.position=new B(mt),W(),Lt}}function B(mt){this.start=mt,this.end={line:d,column:y},this.source=s.source}B.prototype.content=o;function H(mt){var Lt=new Error(s.source+":"+d+":"+y+": "+mt);if(Lt.reason=mt,Lt.filename=s.source,Lt.line=d,Lt.column=y,Lt.source=o,!s.silent)throw Lt}function et(mt){var Lt=mt.exec(o);if(Lt){var Pt=Lt[0];return S(Pt),o=o.slice(Pt.length),Lt}}function W(){et(Yjn)}function nt(mt){var Lt;for(mt=mt||[];Lt=K();)Lt!==!1&&mt.push(Lt);return mt}function K(){var mt=N();if(!(uAe!=o.charAt(0)||lAe!=o.charAt(1))){for(var Lt=2;XN!=o.charAt(Lt)&&(lAe!=o.charAt(Lt)||uAe!=o.charAt(Lt+1));)++Lt;if(Lt+=2,XN===o.charAt(Lt-1))return H("End of comment missing");var Pt=o.slice(2,Lt-2);return y+=2,S(Pt),o=o.slice(Lt),y+=2,mt({type:tHn,comment:Pt})}}function Q(){var mt=N(),Lt=et(Gjn);if(Lt){if(K(),!et(Vjn))return H("property missing ':'");var Pt=et(Xjn),Mt=mt({type:eHn,property:hAe(Lt[0].replace(cAe,XN)),value:Pt?hAe(Pt[0].replace(cAe,XN)):XN});return et(Qjn),Mt}}function at(){var mt=[];nt(mt);for(var Lt;Lt=Q();)Lt!==!1&&(mt.push(Lt),nt(mt));return mt}return W(),at()};function hAe(o){return o?o.replace(Jjn,XN):XN}var rHn=A1&&A1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(W$t,"__esModule",{value:!0});W$t.default=aHn;var iHn=rHn(nHn);function aHn(o,s){var d=null;if(!o||typeof o!="string")return d;var y=(0,iHn.default)(o),S=typeof s=="function";return y.forEach(function(N){if(N.type==="declaration"){var B=N.property,H=N.value;S?s(B,H,N):H&&(d=d||{},d[B]=H)}}),d}var g2t={};Object.defineProperty(g2t,"__esModule",{value:!0});g2t.camelCase=void 0;var sHn=/^--[a-zA-Z0-9_-]+$/,oHn=/-([a-z])/g,cHn=/^[^-]+$/,uHn=/^-(webkit|moz|ms|o|khtml)-/,lHn=/^-(ms)-/,hHn=function(o){return!o||cHn.test(o)||sHn.test(o)},fHn=function(o,s){return s.toUpperCase()},fAe=function(o,s){return"".concat(s,"-")},dHn=function(o,s){return s===void 0&&(s={}),hHn(o)?o:(o=o.toLowerCase(),s.reactCompat?o=o.replace(lHn,fAe):o=o.replace(uHn,fAe),o.replace(oHn,fHn))};g2t.camelCase=dHn;var pHn=A1&&A1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},gHn=pHn(W$t),bHn=g2t;function OFt(o,s){var d={};return!o||typeof o!="string"||(0,gHn.default)(o,function(y,S){y&&S&&(d[(0,bHn.camelCase)(y,s)]=S)}),d}OFt.default=OFt;var mHn=OFt;const yHn=OIe(mHn),b2t=DLe("end"),A6=DLe("start");function DLe(o){return s;function s(d){const y=d&&d.position&&d.position[o]||{};if(typeof y.line=="number"&&y.line>0&&typeof y.column=="number"&&y.column>0)return{line:y.line,column:y.column,offset:typeof y.offset=="number"&&y.offset>-1?y.offset:void 0}}}function wHn(o){const s=A6(o),d=b2t(o);if(s&&d)return{start:s,end:d}}function IQ(o){return!o||typeof o!="object"?"":"position"in o||"type"in o?dAe(o.position):"start"in o||"end"in o?dAe(o):"line"in o||"column"in o?NFt(o):""}function NFt(o){return pAe(o&&o.line)+":"+pAe(o&&o.column)}function dAe(o){return NFt(o&&o.start)+"-"+NFt(o&&o.end)}function pAe(o){return o&&typeof o=="number"?o:1}class Eb extends Error{constructor(s,d,y){super(),typeof d=="string"&&(y=d,d=void 0);let S="",N={},B=!1;if(d&&("line"in d&&"column"in d?N={place:d}:"start"in d&&"end"in d?N={place:d}:"type"in d?N={ancestors:[d],place:d.position}:N={...d}),typeof s=="string"?S=s:!N.cause&&s&&(B=!0,S=s.message,N.cause=s),!N.ruleId&&!N.source&&typeof y=="string"){const et=y.indexOf(":");et===-1?N.ruleId=y:(N.source=y.slice(0,et),N.ruleId=y.slice(et+1))}if(!N.place&&N.ancestors&&N.ancestors){const et=N.ancestors[N.ancestors.length-1];et&&(N.place=et.position)}const H=N.place&&"start"in N.place?N.place.start:N.place;this.ancestors=N.ancestors||void 0,this.cause=N.cause||void 0,this.column=H?H.column:void 0,this.fatal=void 0,this.file,this.message=S,this.line=H?H.line:void 0,this.name=IQ(N.place)||"1:1",this.place=N.place||void 0,this.reason=this.message,this.ruleId=N.ruleId||void 0,this.source=N.source||void 0,this.stack=B&&N.cause&&typeof N.cause.stack=="string"?N.cause.stack:"",this.actual,this.expected,this.note,this.url}}Eb.prototype.file="";Eb.prototype.name="";Eb.prototype.reason="";Eb.prototype.message="";Eb.prototype.stack="";Eb.prototype.column=void 0;Eb.prototype.line=void 0;Eb.prototype.ancestors=void 0;Eb.prototype.cause=void 0;Eb.prototype.fatal=void 0;Eb.prototype.place=void 0;Eb.prototype.ruleId=void 0;Eb.prototype.source=void 0;const K$t={}.hasOwnProperty,vHn=new Map,_Hn=/[A-Z]/g,xHn=new Set(["table","tbody","thead","tfoot","tr"]),EHn=new Set(["td","th"]),BLe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function THn(o,s){if(!s||s.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const d=s.filePath||void 0;let y;if(s.development){if(typeof s.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");y=LHn(d,s.jsxDEV)}else{if(typeof s.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof s.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");y=NHn(d,s.jsx,s.jsxs)}const S={Fragment:s.Fragment,ancestors:[],components:s.components||{},create:y,elementAttributeNameCase:s.elementAttributeNameCase||"react",evaluater:s.createEvaluater?s.createEvaluater():void 0,filePath:d,ignoreInvalidStyle:s.ignoreInvalidStyle||!1,passKeys:s.passKeys!==!1,passNode:s.passNode||!1,schema:s.space==="svg"?c7:nJ,stylePropertyNameCase:s.stylePropertyNameCase||"dom",tableCellAlignToStyle:s.tableCellAlignToStyle!==!1},N=FLe(S,o,void 0);return N&&typeof N!="string"?N:S.create(o,S.Fragment,{children:N||void 0},void 0)}function FLe(o,s,d){if(s.type==="element")return kHn(o,s,d);if(s.type==="mdxFlowExpression"||s.type==="mdxTextExpression")return CHn(o,s);if(s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement")return AHn(o,s,d);if(s.type==="mdxjsEsm")return SHn(o,s);if(s.type==="root")return IHn(o,s,d);if(s.type==="text")return OHn(o,s)}function kHn(o,s,d){const y=o.schema;let S=y;s.tagName.toLowerCase()==="svg"&&y.space==="html"&&(S=c7,o.schema=S),o.ancestors.push(s);const N=jLe(o,s.tagName,!1),B=MHn(o,s);let H=G$t(o,s);return xHn.has(s.tagName)&&(H=H.filter(function(et){return typeof et=="string"?!d2t(et):!0})),$Le(o,B,N,s),Y$t(B,H),o.ancestors.pop(),o.schema=y,o.create(s,N,B,d)}function CHn(o,s){if(s.data&&s.data.estree&&o.evaluater){const y=s.data.estree.body[0];return y.type,o.evaluater.evaluateExpression(y.expression)}KQ(o,s.position)}function SHn(o,s){if(s.data&&s.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(s.data.estree);KQ(o,s.position)}function AHn(o,s,d){const y=o.schema;let S=y;s.name==="svg"&&y.space==="html"&&(S=c7,o.schema=S),o.ancestors.push(s);const N=s.name===null?o.Fragment:jLe(o,s.name,!0),B=PHn(o,s),H=G$t(o,s);return $Le(o,B,N,s),Y$t(B,H),o.ancestors.pop(),o.schema=y,o.create(s,N,B,d)}function IHn(o,s,d){const y={};return Y$t(y,G$t(o,s)),o.create(s,o.Fragment,y,d)}function OHn(o,s){return s.value}function $Le(o,s,d,y){typeof d!="string"&&d!==o.Fragment&&o.passNode&&(s.node=y)}function Y$t(o,s){if(s.length>0){const d=s.length>1?s:s[0];d&&(o.children=d)}}function NHn(o,s,d){return y;function y(S,N,B,H){const W=Array.isArray(B.children)?d:s;return H?W(N,B,H):W(N,B)}}function LHn(o,s){return d;function d(y,S,N,B){const H=Array.isArray(N.children),et=A6(y);return s(S,N,B,H,{columnNumber:et?et.column-1:void 0,fileName:o,lineNumber:et?et.line:void 0},void 0)}}function MHn(o,s){const d={};let y,S;for(S in s.properties)if(S!=="children"&&K$t.call(s.properties,S)){const N=RHn(o,S,s.properties[S]);if(N){const[B,H]=N;o.tableCellAlignToStyle&&B==="align"&&typeof H=="string"&&EHn.has(s.tagName)?y=H:d[B]=H}}if(y){const N=d.style||(d.style={});N[o.stylePropertyNameCase==="css"?"text-align":"textAlign"]=y}return d}function PHn(o,s){const d={};for(const y of s.attributes)if(y.type==="mdxJsxExpressionAttribute")if(y.data&&y.data.estree&&o.evaluater){const N=y.data.estree.body[0];N.type;const B=N.expression;B.type;const H=B.properties[0];H.type,Object.assign(d,o.evaluater.evaluateExpression(H.argument))}else KQ(o,s.position);else{const S=y.name;let N;if(y.value&&typeof y.value=="object")if(y.value.data&&y.value.data.estree&&o.evaluater){const H=y.value.data.estree.body[0];H.type,N=o.evaluater.evaluateExpression(H.expression)}else KQ(o,s.position);else N=y.value===null?!0:y.value;d[S]=N}return d}function G$t(o,s){const d=[];let y=-1;const S=o.passKeys?new Map:vHn;for(;++y<s.children.length;){const N=s.children[y];let B;if(o.passKeys){const et=N.type==="element"?N.tagName:N.type==="mdxJsxFlowElement"||N.type==="mdxJsxTextElement"?N.name:void 0;if(et){const W=S.get(et)||0;B=et+"-"+W,S.set(et,W+1)}}const H=FLe(o,N,B);H!==void 0&&d.push(H)}return d}function RHn(o,s,d){const y=p2t(o.schema,s);if(!(d==null||typeof d=="number"&&Number.isNaN(d))){if(Array.isArray(d)&&(d=y.commaSeparated?z$t(d):q$t(d)),y.property==="style"){let S=typeof d=="object"?d:DHn(o,String(d));return o.stylePropertyNameCase==="css"&&(S=BHn(S)),["style",S]}return[o.elementAttributeNameCase==="react"&&y.space?Hjn[y.property]||y.property:y.attribute,d]}}function DHn(o,s){try{return yHn(s,{reactCompat:!0})}catch(d){if(o.ignoreInvalidStyle)return{};const y=d,S=new Eb("Cannot parse `style` attribute",{ancestors:o.ancestors,cause:y,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw S.file=o.filePath||void 0,S.url=BLe+"#cannot-parse-style-attribute",S}}function jLe(o,s,d){let y;if(!d)y={type:"Literal",value:s};else if(s.includes(".")){const S=s.split(".");let N=-1,B;for(;++N<S.length;){const H=rAe(S[N])?{type:"Identifier",name:S[N]}:{type:"Literal",value:S[N]};B=B?{type:"MemberExpression",object:B,property:H,computed:!!(N&&H.type==="Literal"),optional:!1}:H}y=B}else y=rAe(s)&&!/^[a-z]/.test(s)?{type:"Identifier",name:s}:{type:"Literal",value:s};if(y.type==="Literal"){const S=y.value;return K$t.call(o.components,S)?o.components[S]:S}if(o.evaluater)return o.evaluater.evaluateExpression(y);KQ(o)}function KQ(o,s){const d=new Eb("Cannot handle MDX estrees without `createEvaluater`",{ancestors:o.ancestors,place:s,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw d.file=o.filePath||void 0,d.url=BLe+"#cannot-handle-mdx-estrees-without-createevaluater",d}function BHn(o){const s={};let d;for(d in o)K$t.call(o,d)&&(s[FHn(d)]=o[d]);return s}function FHn(o){let s=o.replace(_Hn,$Hn);return s.slice(0,3)==="ms-"&&(s="-"+s),s}function $Hn(o){return"-"+o.toLowerCase()}const fBt={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"]},jHn={};function HHn(o,s){const d=jHn,y=typeof d.includeImageAlt=="boolean"?d.includeImageAlt:!0,S=typeof d.includeHtml=="boolean"?d.includeHtml:!0;return HLe(o,y,S)}function HLe(o,s,d){if(zHn(o)){if("value"in o)return o.type==="html"&&!d?"":o.value;if(s&&"alt"in o&&o.alt)return o.alt;if("children"in o)return gAe(o.children,s,d)}return Array.isArray(o)?gAe(o,s,d):""}function gAe(o,s,d){const y=[];let S=-1;for(;++S<o.length;)y[S]=HLe(o[S],s,d);return y.join("")}function zHn(o){return!!(o&&typeof o=="object")}const bAe=document.createElement("i");function V$t(o){const s="&"+o+";";bAe.innerHTML=s;const d=bAe.textContent;return d.charCodeAt(d.length-1)===59&&o!=="semi"||d===s?!1:d}function C6(o,s,d,y){const S=o.length;let N=0,B;if(s<0?s=-s>S?0:S+s:s=s>S?S:s,d=d>0?d:0,y.length<1e4)B=Array.from(y),B.unshift(s,d),o.splice(...B);else for(d&&o.splice(s,d);N<y.length;)B=y.slice(N,N+1e4),B.unshift(s,0),o.splice(...B),N+=1e4,s+=1e4}function k3(o,s){return o.length>0?(C6(o,o.length,0,s),o):s}const mAe={}.hasOwnProperty;function UHn(o){const s={};let d=-1;for(;++d<o.length;)qHn(s,o[d]);return s}function qHn(o,s){let d;for(d in s){const S=(mAe.call(o,d)?o[d]:void 0)||(o[d]={}),N=s[d];let B;if(N)for(B in N){mAe.call(S,B)||(S[B]=[]);const H=N[B];WHn(S[B],Array.isArray(H)?H:H?[H]:[])}}}function WHn(o,s){let d=-1;const y=[];for(;++d<s.length;)(s[d].add==="after"?o:y).push(s[d]);C6(o,0,0,y)}function zLe(o,s){const d=Number.parseInt(o,s);return d<9||d===11||d>13&&d<32||d>126&&d<160||d>55295&&d<57344||d>64975&&d<65008||(d&65535)===65535||(d&65535)===65534||d>1114111?"�":String.fromCodePoint(d)}function RF(o){return o.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _6=u7(/[A-Za-z]/),Sw=u7(/[\dA-Za-z]/),KHn=u7(/[#-'*+\--9=?A-Z^-~]/);function LFt(o){return o!==null&&(o<32||o===127)}const MFt=u7(/\d/),YHn=u7(/[\dA-Fa-f]/),GHn=u7(/[!-/:-@[-`{-~]/);function nc(o){return o!==null&&o<-2}function Z2(o){return o!==null&&(o<0||o===32)}function Hl(o){return o===-2||o===-1||o===32}const VHn=u7(new RegExp("\\p{P}|\\p{S}","u")),XHn=u7(/\s/);function u7(o){return s;function s(d){return d!==null&&d>-1&&o.test(String.fromCharCode(d))}}function r$(o){const s=[];let d=-1,y=0,S=0;for(;++d<o.length;){const N=o.charCodeAt(d);let B="";if(N===37&&Sw(o.charCodeAt(d+1))&&Sw(o.charCodeAt(d+2)))S=2;else if(N<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(N))||(B=String.fromCharCode(N));else if(N>55295&&N<57344){const H=o.charCodeAt(d+1);N<56320&&H>56319&&H<57344?(B=String.fromCharCode(N,H),S=1):B="�"}else B=String.fromCharCode(N);B&&(s.push(o.slice(y,d),encodeURIComponent(B)),y=d+S+1,B=""),S&&(d+=S,S=0)}return s.join("")+o.slice(y)}function sf(o,s,d,y){const S=y?y-1:Number.POSITIVE_INFINITY;let N=0;return B;function B(et){return Hl(et)?(o.enter(d),H(et)):s(et)}function H(et){return Hl(et)&&N++<S?(o.consume(et),H):(o.exit(d),s(et))}}const QHn={tokenize:JHn};function JHn(o){const s=o.attempt(this.parser.constructs.contentInitial,y,S);let d;return s;function y(H){if(H===null){o.consume(H);return}return o.enter("lineEnding"),o.consume(H),o.exit("lineEnding"),sf(o,s,"linePrefix")}function S(H){return o.enter("paragraph"),N(H)}function N(H){const et=o.enter("chunkText",{contentType:"text",previous:d});return d&&(d.next=et),d=et,B(H)}function B(H){if(H===null){o.exit("chunkText"),o.exit("paragraph"),o.consume(H);return}return nc(H)?(o.consume(H),o.exit("chunkText"),N):(o.consume(H),B)}}const ZHn={tokenize:tzn},yAe={tokenize:ezn};function tzn(o){const s=this,d=[];let y=0,S,N,B;return H;function H(se){if(y<d.length){const ve=d[y];return s.containerState=ve[1],o.attempt(ve[0].continuation,et,W)(se)}return W(se)}function et(se){if(y++,s.containerState._closeFlow){s.containerState._closeFlow=void 0,S&&ie();const ve=s.events.length;let gn=ve,fe;for(;gn--;)if(s.events[gn][0]==="exit"&&s.events[gn][1].type==="chunkFlow"){fe=s.events[gn][1].end;break}Mt(y);let cn=ve;for(;cn<s.events.length;)s.events[cn][1].end={...fe},cn++;return C6(s.events,gn+1,0,s.events.slice(ve)),s.events.length=cn,W(se)}return H(se)}function W(se){if(y===d.length){if(!S)return Q(se);if(S.currentConstruct&&S.currentConstruct.concrete)return mt(se);s.interrupt=!!(S.currentConstruct&&!S._gfmTableDynamicInterruptHack)}return s.containerState={},o.check(yAe,nt,K)(se)}function nt(se){return S&&ie(),Mt(y),Q(se)}function K(se){return s.parser.lazy[s.now().line]=y!==d.length,B=s.now().offset,mt(se)}function Q(se){return s.containerState={},o.attempt(yAe,at,mt)(se)}function at(se){return y++,d.push([s.currentConstruct,s.containerState]),Q(se)}function mt(se){if(se===null){S&&ie(),Mt(0),o.consume(se);return}return S=S||s.parser.flow(s.now()),o.enter("chunkFlow",{_tokenizer:S,contentType:"flow",previous:N}),Lt(se)}function Lt(se){if(se===null){Pt(o.exit("chunkFlow"),!0),Mt(0),o.consume(se);return}return nc(se)?(o.consume(se),Pt(o.exit("chunkFlow")),y=0,s.interrupt=void 0,H):(o.consume(se),Lt)}function Pt(se,ve){const gn=s.sliceStream(se);if(ve&&gn.push(null),se.previous=N,N&&(N.next=se),N=se,S.defineSkip(se.start),S.write(gn),s.parser.lazy[se.start.line]){let fe=S.events.length;for(;fe--;)if(S.events[fe][1].start.offset<B&&(!S.events[fe][1].end||S.events[fe][1].end.offset>B))return;const cn=s.events.length;let sr=cn,Fn,qn;for(;sr--;)if(s.events[sr][0]==="exit"&&s.events[sr][1].type==="chunkFlow"){if(Fn){qn=s.events[sr][1].end;break}Fn=!0}for(Mt(y),fe=cn;fe<s.events.length;)s.events[fe][1].end={...qn},fe++;C6(s.events,sr+1,0,s.events.slice(cn)),s.events.length=fe}}function Mt(se){let ve=d.length;for(;ve-- >se;){const gn=d[ve];s.containerState=gn[1],gn[0].exit.call(s,o)}d.length=se}function ie(){S.write([null]),N=void 0,S=void 0,s.containerState._closeFlow=void 0}}function ezn(o,s,d){return sf(o,o.attempt(this.parser.constructs.document,s,d),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wAe(o){if(o===null||Z2(o)||XHn(o))return 1;if(VHn(o))return 2}function X$t(o,s,d){const y=[];let S=-1;for(;++S<o.length;){const N=o[S].resolveAll;N&&!y.includes(N)&&(s=N(s,d),y.push(N))}return s}const PFt={name:"attention",resolveAll:nzn,tokenize:rzn};function nzn(o,s){let d=-1,y,S,N,B,H,et,W,nt;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="attentionSequence"&&o[d][1]._close){for(y=d;y--;)if(o[y][0]==="exit"&&o[y][1].type==="attentionSequence"&&o[y][1]._open&&s.sliceSerialize(o[y][1]).charCodeAt(0)===s.sliceSerialize(o[d][1]).charCodeAt(0)){if((o[y][1]._close||o[d][1]._open)&&(o[d][1].end.offset-o[d][1].start.offset)%3&&!((o[y][1].end.offset-o[y][1].start.offset+o[d][1].end.offset-o[d][1].start.offset)%3))continue;et=o[y][1].end.offset-o[y][1].start.offset>1&&o[d][1].end.offset-o[d][1].start.offset>1?2:1;const K={...o[y][1].end},Q={...o[d][1].start};vAe(K,-et),vAe(Q,et),B={type:et>1?"strongSequence":"emphasisSequence",start:K,end:{...o[y][1].end}},H={type:et>1?"strongSequence":"emphasisSequence",start:{...o[d][1].start},end:Q},N={type:et>1?"strongText":"emphasisText",start:{...o[y][1].end},end:{...o[d][1].start}},S={type:et>1?"strong":"emphasis",start:{...B.start},end:{...H.end}},o[y][1].end={...B.start},o[d][1].start={...H.end},W=[],o[y][1].end.offset-o[y][1].start.offset&&(W=k3(W,[["enter",o[y][1],s],["exit",o[y][1],s]])),W=k3(W,[["enter",S,s],["enter",B,s],["exit",B,s],["enter",N,s]]),W=k3(W,X$t(s.parser.constructs.insideSpan.null,o.slice(y+1,d),s)),W=k3(W,[["exit",N,s],["enter",H,s],["exit",H,s],["exit",S,s]]),o[d][1].end.offset-o[d][1].start.offset?(nt=2,W=k3(W,[["enter",o[d][1],s],["exit",o[d][1],s]])):nt=0,C6(o,y-1,d-y+3,W),d=y+W.length-nt-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="attentionSequence"&&(o[d][1].type="data");return o}function rzn(o,s){const d=this.parser.constructs.attentionMarkers.null,y=this.previous,S=wAe(y);let N;return B;function B(et){return N=et,o.enter("attentionSequence"),H(et)}function H(et){if(et===N)return o.consume(et),H;const W=o.exit("attentionSequence"),nt=wAe(et),K=!nt||nt===2&&S||d.includes(et),Q=!S||S===2&&nt||d.includes(y);return W._open=!!(N===42?K:K&&(S||!Q)),W._close=!!(N===42?Q:Q&&(nt||!K)),s(et)}}function vAe(o,s){o.column+=s,o.offset+=s,o._bufferIndex+=s}const izn={name:"autolink",tokenize:azn};function azn(o,s,d){let y=0;return S;function S(at){return o.enter("autolink"),o.enter("autolinkMarker"),o.consume(at),o.exit("autolinkMarker"),o.enter("autolinkProtocol"),N}function N(at){return _6(at)?(o.consume(at),B):at===64?d(at):W(at)}function B(at){return at===43||at===45||at===46||Sw(at)?(y=1,H(at)):W(at)}function H(at){return at===58?(o.consume(at),y=0,et):(at===43||at===45||at===46||Sw(at))&&y++<32?(o.consume(at),H):(y=0,W(at))}function et(at){return at===62?(o.exit("autolinkProtocol"),o.enter("autolinkMarker"),o.consume(at),o.exit("autolinkMarker"),o.exit("autolink"),s):at===null||at===32||at===60||LFt(at)?d(at):(o.consume(at),et)}function W(at){return at===64?(o.consume(at),nt):KHn(at)?(o.consume(at),W):d(at)}function nt(at){return Sw(at)?K(at):d(at)}function K(at){return at===46?(o.consume(at),y=0,nt):at===62?(o.exit("autolinkProtocol").type="autolinkEmail",o.enter("autolinkMarker"),o.consume(at),o.exit("autolinkMarker"),o.exit("autolink"),s):Q(at)}function Q(at){if((at===45||Sw(at))&&y++<63){const mt=at===45?Q:K;return o.consume(at),mt}return d(at)}}const m2t={partial:!0,tokenize:szn};function szn(o,s,d){return y;function y(N){return Hl(N)?sf(o,S,"linePrefix")(N):S(N)}function S(N){return N===null||nc(N)?s(N):d(N)}}const ULe={continuation:{tokenize:czn},exit:uzn,name:"blockQuote",tokenize:ozn};function ozn(o,s,d){const y=this;return S;function S(B){if(B===62){const H=y.containerState;return H.open||(o.enter("blockQuote",{_container:!0}),H.open=!0),o.enter("blockQuotePrefix"),o.enter("blockQuoteMarker"),o.consume(B),o.exit("blockQuoteMarker"),N}return d(B)}function N(B){return Hl(B)?(o.enter("blockQuotePrefixWhitespace"),o.consume(B),o.exit("blockQuotePrefixWhitespace"),o.exit("blockQuotePrefix"),s):(o.exit("blockQuotePrefix"),s(B))}}function czn(o,s,d){const y=this;return S;function S(B){return Hl(B)?sf(o,N,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):N(B)}function N(B){return o.attempt(ULe,s,d)(B)}}function uzn(o){o.exit("blockQuote")}const qLe={name:"characterEscape",tokenize:lzn};function lzn(o,s,d){return y;function y(N){return o.enter("characterEscape"),o.enter("escapeMarker"),o.consume(N),o.exit("escapeMarker"),S}function S(N){return GHn(N)?(o.enter("characterEscapeValue"),o.consume(N),o.exit("characterEscapeValue"),o.exit("characterEscape"),s):d(N)}}const WLe={name:"characterReference",tokenize:hzn};function hzn(o,s,d){const y=this;let S=0,N,B;return H;function H(K){return o.enter("characterReference"),o.enter("characterReferenceMarker"),o.consume(K),o.exit("characterReferenceMarker"),et}function et(K){return K===35?(o.enter("characterReferenceMarkerNumeric"),o.consume(K),o.exit("characterReferenceMarkerNumeric"),W):(o.enter("characterReferenceValue"),N=31,B=Sw,nt(K))}function W(K){return K===88||K===120?(o.enter("characterReferenceMarkerHexadecimal"),o.consume(K),o.exit("characterReferenceMarkerHexadecimal"),o.enter("characterReferenceValue"),N=6,B=YHn,nt):(o.enter("characterReferenceValue"),N=7,B=MFt,nt(K))}function nt(K){if(K===59&&S){const Q=o.exit("characterReferenceValue");return B===Sw&&!V$t(y.sliceSerialize(Q))?d(K):(o.enter("characterReferenceMarker"),o.consume(K),o.exit("characterReferenceMarker"),o.exit("characterReference"),s)}return B(K)&&S++<N?(o.consume(K),nt):d(K)}}const _Ae={partial:!0,tokenize:dzn},xAe={concrete:!0,name:"codeFenced",tokenize:fzn};function fzn(o,s,d){const y=this,S={partial:!0,tokenize:gn};let N=0,B=0,H;return et;function et(fe){return W(fe)}function W(fe){const cn=y.events[y.events.length-1];return N=cn&&cn[1].type==="linePrefix"?cn[2].sliceSerialize(cn[1],!0).length:0,H=fe,o.enter("codeFenced"),o.enter("codeFencedFence"),o.enter("codeFencedFenceSequence"),nt(fe)}function nt(fe){return fe===H?(B++,o.consume(fe),nt):B<3?d(fe):(o.exit("codeFencedFenceSequence"),Hl(fe)?sf(o,K,"whitespace")(fe):K(fe))}function K(fe){return fe===null||nc(fe)?(o.exit("codeFencedFence"),y.interrupt?s(fe):o.check(_Ae,Lt,ve)(fe)):(o.enter("codeFencedFenceInfo"),o.enter("chunkString",{contentType:"string"}),Q(fe))}function Q(fe){return fe===null||nc(fe)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),K(fe)):Hl(fe)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),sf(o,at,"whitespace")(fe)):fe===96&&fe===H?d(fe):(o.consume(fe),Q)}function at(fe){return fe===null||nc(fe)?K(fe):(o.enter("codeFencedFenceMeta"),o.enter("chunkString",{contentType:"string"}),mt(fe))}function mt(fe){return fe===null||nc(fe)?(o.exit("chunkString"),o.exit("codeFencedFenceMeta"),K(fe)):fe===96&&fe===H?d(fe):(o.consume(fe),mt)}function Lt(fe){return o.attempt(S,ve,Pt)(fe)}function Pt(fe){return o.enter("lineEnding"),o.consume(fe),o.exit("lineEnding"),Mt}function Mt(fe){return N>0&&Hl(fe)?sf(o,ie,"linePrefix",N+1)(fe):ie(fe)}function ie(fe){return fe===null||nc(fe)?o.check(_Ae,Lt,ve)(fe):(o.enter("codeFlowValue"),se(fe))}function se(fe){return fe===null||nc(fe)?(o.exit("codeFlowValue"),ie(fe)):(o.consume(fe),se)}function ve(fe){return o.exit("codeFenced"),s(fe)}function gn(fe,cn,sr){let Fn=0;return qn;function qn(Ar){return fe.enter("lineEnding"),fe.consume(Ar),fe.exit("lineEnding"),nr}function nr(Ar){return fe.enter("codeFencedFence"),Hl(Ar)?sf(fe,hr,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ar):hr(Ar)}function hr(Ar){return Ar===H?(fe.enter("codeFencedFenceSequence"),di(Ar)):sr(Ar)}function di(Ar){return Ar===H?(Fn++,fe.consume(Ar),di):Fn>=B?(fe.exit("codeFencedFenceSequence"),Hl(Ar)?sf(fe,gi,"whitespace")(Ar):gi(Ar)):sr(Ar)}function gi(Ar){return Ar===null||nc(Ar)?(fe.exit("codeFencedFence"),cn(Ar)):sr(Ar)}}}function dzn(o,s,d){const y=this;return S;function S(B){return B===null?d(B):(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),N)}function N(B){return y.parser.lazy[y.now().line]?d(B):s(B)}}const dBt={name:"codeIndented",tokenize:gzn},pzn={partial:!0,tokenize:bzn};function gzn(o,s,d){const y=this;return S;function S(W){return o.enter("codeIndented"),sf(o,N,"linePrefix",5)(W)}function N(W){const nt=y.events[y.events.length-1];return nt&&nt[1].type==="linePrefix"&&nt[2].sliceSerialize(nt[1],!0).length>=4?B(W):d(W)}function B(W){return W===null?et(W):nc(W)?o.attempt(pzn,B,et)(W):(o.enter("codeFlowValue"),H(W))}function H(W){return W===null||nc(W)?(o.exit("codeFlowValue"),B(W)):(o.consume(W),H)}function et(W){return o.exit("codeIndented"),s(W)}}function bzn(o,s,d){const y=this;return S;function S(B){return y.parser.lazy[y.now().line]?d(B):nc(B)?(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),S):sf(o,N,"linePrefix",5)(B)}function N(B){const H=y.events[y.events.length-1];return H&&H[1].type==="linePrefix"&&H[2].sliceSerialize(H[1],!0).length>=4?s(B):nc(B)?S(B):d(B)}}const mzn={name:"codeText",previous:wzn,resolve:yzn,tokenize:vzn};function yzn(o){let s=o.length-4,d=3,y,S;if((o[d][1].type==="lineEnding"||o[d][1].type==="space")&&(o[s][1].type==="lineEnding"||o[s][1].type==="space")){for(y=d;++y<s;)if(o[y][1].type==="codeTextData"){o[d][1].type="codeTextPadding",o[s][1].type="codeTextPadding",d+=2,s-=2;break}}for(y=d-1,s++;++y<=s;)S===void 0?y!==s&&o[y][1].type!=="lineEnding"&&(S=y):(y===s||o[y][1].type==="lineEnding")&&(o[S][1].type="codeTextData",y!==S+2&&(o[S][1].end=o[y-1][1].end,o.splice(S+2,y-S-2),s-=y-S-2,y=S+2),S=void 0);return o}function wzn(o){return o!==96||this.events[this.events.length-1][1].type==="characterEscape"}function vzn(o,s,d){let y=0,S,N;return B;function B(K){return o.enter("codeText"),o.enter("codeTextSequence"),H(K)}function H(K){return K===96?(o.consume(K),y++,H):(o.exit("codeTextSequence"),et(K))}function et(K){return K===null?d(K):K===32?(o.enter("space"),o.consume(K),o.exit("space"),et):K===96?(N=o.enter("codeTextSequence"),S=0,nt(K)):nc(K)?(o.enter("lineEnding"),o.consume(K),o.exit("lineEnding"),et):(o.enter("codeTextData"),W(K))}function W(K){return K===null||K===32||K===96||nc(K)?(o.exit("codeTextData"),et(K)):(o.consume(K),W)}function nt(K){return K===96?(o.consume(K),S++,nt):S===y?(o.exit("codeTextSequence"),o.exit("codeText"),s(K)):(N.type="codeTextData",W(K))}}class _zn{constructor(s){this.left=s?[...s]:[],this.right=[]}get(s){if(s<0||s>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+s+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return s<this.left.length?this.left[s]:this.right[this.right.length-s+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(s,d){const y=d??Number.POSITIVE_INFINITY;return y<this.left.length?this.left.slice(s,y):s>this.left.length?this.right.slice(this.right.length-y+this.left.length,this.right.length-s+this.left.length).reverse():this.left.slice(s).concat(this.right.slice(this.right.length-y+this.left.length).reverse())}splice(s,d,y){const S=d||0;this.setCursor(Math.trunc(s));const N=this.right.splice(this.right.length-S,Number.POSITIVE_INFINITY);return y&&aQ(this.left,y),N.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(s){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(s)}pushMany(s){this.setCursor(Number.POSITIVE_INFINITY),aQ(this.left,s)}unshift(s){this.setCursor(0),this.right.push(s)}unshiftMany(s){this.setCursor(0),aQ(this.right,s.reverse())}setCursor(s){if(!(s===this.left.length||s>this.left.length&&this.right.length===0||s<0&&this.left.length===0))if(s<this.left.length){const d=this.left.splice(s,Number.POSITIVE_INFINITY);aQ(this.right,d.reverse())}else{const d=this.right.splice(this.left.length+this.right.length-s,Number.POSITIVE_INFINITY);aQ(this.left,d.reverse())}}}function aQ(o,s){let d=0;if(s.length<1e4)o.push(...s);else for(;d<s.length;)o.push(...s.slice(d,d+1e4)),d+=1e4}function KLe(o){const s={};let d=-1,y,S,N,B,H,et,W;const nt=new _zn(o);for(;++d<nt.length;){for(;d in s;)d=s[d];if(y=nt.get(d),d&&y[1].type==="chunkFlow"&&nt.get(d-1)[1].type==="listItemPrefix"&&(et=y[1]._tokenizer.events,N=0,N<et.length&&et[N][1].type==="lineEndingBlank"&&(N+=2),N<et.length&&et[N][1].type==="content"))for(;++N<et.length&&et[N][1].type!=="content";)et[N][1].type==="chunkText"&&(et[N][1]._isInFirstContentOfListItem=!0,N++);if(y[0]==="enter")y[1].contentType&&(Object.assign(s,xzn(nt,d)),d=s[d],W=!0);else if(y[1]._container){for(N=d,S=void 0;N--;)if(B=nt.get(N),B[1].type==="lineEnding"||B[1].type==="lineEndingBlank")B[0]==="enter"&&(S&&(nt.get(S)[1].type="lineEndingBlank"),B[1].type="lineEnding",S=N);else if(!(B[1].type==="linePrefix"||B[1].type==="listItemIndent"))break;S&&(y[1].end={...nt.get(S)[1].start},H=nt.slice(S,d),H.unshift(y),nt.splice(S,d-S+1,H))}}return C6(o,0,Number.POSITIVE_INFINITY,nt.slice(0)),!W}function xzn(o,s){const d=o.get(s)[1],y=o.get(s)[2];let S=s-1;const N=[];let B=d._tokenizer;B||(B=y.parser[d.contentType](d.start),d._contentTypeTextTrailing&&(B._contentTypeTextTrailing=!0));const H=B.events,et=[],W={};let nt,K,Q=-1,at=d,mt=0,Lt=0;const Pt=[Lt];for(;at;){for(;o.get(++S)[1]!==at;);N.push(S),at._tokenizer||(nt=y.sliceStream(at),at.next||nt.push(null),K&&B.defineSkip(at.start),at._isInFirstContentOfListItem&&(B._gfmTasklistFirstContentOfListItem=!0),B.write(nt),at._isInFirstContentOfListItem&&(B._gfmTasklistFirstContentOfListItem=void 0)),K=at,at=at.next}for(at=d;++Q<H.length;)H[Q][0]==="exit"&&H[Q-1][0]==="enter"&&H[Q][1].type===H[Q-1][1].type&&H[Q][1].start.line!==H[Q][1].end.line&&(Lt=Q+1,Pt.push(Lt),at._tokenizer=void 0,at.previous=void 0,at=at.next);for(B.events=[],at?(at._tokenizer=void 0,at.previous=void 0):Pt.pop(),Q=Pt.length;Q--;){const Mt=H.slice(Pt[Q],Pt[Q+1]),ie=N.pop();et.push([ie,ie+Mt.length-1]),o.splice(ie,2,Mt)}for(et.reverse(),Q=-1;++Q<et.length;)W[mt+et[Q][0]]=mt+et[Q][1],mt+=et[Q][1]-et[Q][0]-1;return W}const Ezn={resolve:kzn,tokenize:Czn},Tzn={partial:!0,tokenize:Szn};function kzn(o){return KLe(o),o}function Czn(o,s){let d;return y;function y(H){return o.enter("content"),d=o.enter("chunkContent",{contentType:"content"}),S(H)}function S(H){return H===null?N(H):nc(H)?o.check(Tzn,B,N)(H):(o.consume(H),S)}function N(H){return o.exit("chunkContent"),o.exit("content"),s(H)}function B(H){return o.consume(H),o.exit("chunkContent"),d.next=o.enter("chunkContent",{contentType:"content",previous:d}),d=d.next,S}}function Szn(o,s,d){const y=this;return S;function S(B){return o.exit("chunkContent"),o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),sf(o,N,"linePrefix")}function N(B){if(B===null||nc(B))return d(B);const H=y.events[y.events.length-1];return!y.parser.constructs.disable.null.includes("codeIndented")&&H&&H[1].type==="linePrefix"&&H[2].sliceSerialize(H[1],!0).length>=4?s(B):o.interrupt(y.parser.constructs.flow,d,s)(B)}}function YLe(o,s,d,y,S,N,B,H,et){const W=et||Number.POSITIVE_INFINITY;let nt=0;return K;function K(Mt){return Mt===60?(o.enter(y),o.enter(S),o.enter(N),o.consume(Mt),o.exit(N),Q):Mt===null||Mt===32||Mt===41||LFt(Mt)?d(Mt):(o.enter(y),o.enter(B),o.enter(H),o.enter("chunkString",{contentType:"string"}),Lt(Mt))}function Q(Mt){return Mt===62?(o.enter(N),o.consume(Mt),o.exit(N),o.exit(S),o.exit(y),s):(o.enter(H),o.enter("chunkString",{contentType:"string"}),at(Mt))}function at(Mt){return Mt===62?(o.exit("chunkString"),o.exit(H),Q(Mt)):Mt===null||Mt===60||nc(Mt)?d(Mt):(o.consume(Mt),Mt===92?mt:at)}function mt(Mt){return Mt===60||Mt===62||Mt===92?(o.consume(Mt),at):at(Mt)}function Lt(Mt){return!nt&&(Mt===null||Mt===41||Z2(Mt))?(o.exit("chunkString"),o.exit(H),o.exit(B),o.exit(y),s(Mt)):nt<W&&Mt===40?(o.consume(Mt),nt++,Lt):Mt===41?(o.consume(Mt),nt--,Lt):Mt===null||Mt===32||Mt===40||LFt(Mt)?d(Mt):(o.consume(Mt),Mt===92?Pt:Lt)}function Pt(Mt){return Mt===40||Mt===41||Mt===92?(o.consume(Mt),Lt):Lt(Mt)}}function GLe(o,s,d,y,S,N){const B=this;let H=0,et;return W;function W(at){return o.enter(y),o.enter(S),o.consume(at),o.exit(S),o.enter(N),nt}function nt(at){return H>999||at===null||at===91||at===93&&!et||at===94&&!H&&"_hiddenFootnoteSupport"in B.parser.constructs?d(at):at===93?(o.exit(N),o.enter(S),o.consume(at),o.exit(S),o.exit(y),s):nc(at)?(o.enter("lineEnding"),o.consume(at),o.exit("lineEnding"),nt):(o.enter("chunkString",{contentType:"string"}),K(at))}function K(at){return at===null||at===91||at===93||nc(at)||H++>999?(o.exit("chunkString"),nt(at)):(o.consume(at),et||(et=!Hl(at)),at===92?Q:K)}function Q(at){return at===91||at===92||at===93?(o.consume(at),H++,K):K(at)}}function VLe(o,s,d,y,S,N){let B;return H;function H(Q){return Q===34||Q===39||Q===40?(o.enter(y),o.enter(S),o.consume(Q),o.exit(S),B=Q===40?41:Q,et):d(Q)}function et(Q){return Q===B?(o.enter(S),o.consume(Q),o.exit(S),o.exit(y),s):(o.enter(N),W(Q))}function W(Q){return Q===B?(o.exit(N),et(B)):Q===null?d(Q):nc(Q)?(o.enter("lineEnding"),o.consume(Q),o.exit("lineEnding"),sf(o,W,"linePrefix")):(o.enter("chunkString",{contentType:"string"}),nt(Q))}function nt(Q){return Q===B||Q===null||nc(Q)?(o.exit("chunkString"),W(Q)):(o.consume(Q),Q===92?K:nt)}function K(Q){return Q===B||Q===92?(o.consume(Q),nt):nt(Q)}}function OQ(o,s){let d;return y;function y(S){return nc(S)?(o.enter("lineEnding"),o.consume(S),o.exit("lineEnding"),d=!0,y):Hl(S)?sf(o,y,d?"linePrefix":"lineSuffix")(S):s(S)}}const Azn={name:"definition",tokenize:Ozn},Izn={partial:!0,tokenize:Nzn};function Ozn(o,s,d){const y=this;let S;return N;function N(at){return o.enter("definition"),B(at)}function B(at){return GLe.call(y,o,H,d,"definitionLabel","definitionLabelMarker","definitionLabelString")(at)}function H(at){return S=RF(y.sliceSerialize(y.events[y.events.length-1][1]).slice(1,-1)),at===58?(o.enter("definitionMarker"),o.consume(at),o.exit("definitionMarker"),et):d(at)}function et(at){return Z2(at)?OQ(o,W)(at):W(at)}function W(at){return YLe(o,nt,d,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(at)}function nt(at){return o.attempt(Izn,K,K)(at)}function K(at){return Hl(at)?sf(o,Q,"whitespace")(at):Q(at)}function Q(at){return at===null||nc(at)?(o.exit("definition"),y.parser.defined.push(S),s(at)):d(at)}}function Nzn(o,s,d){return y;function y(H){return Z2(H)?OQ(o,S)(H):d(H)}function S(H){return VLe(o,N,d,"definitionTitle","definitionTitleMarker","definitionTitleString")(H)}function N(H){return Hl(H)?sf(o,B,"whitespace")(H):B(H)}function B(H){return H===null||nc(H)?s(H):d(H)}}const Lzn={name:"hardBreakEscape",tokenize:Mzn};function Mzn(o,s,d){return y;function y(N){return o.enter("hardBreakEscape"),o.consume(N),S}function S(N){return nc(N)?(o.exit("hardBreakEscape"),s(N)):d(N)}}const Pzn={name:"headingAtx",resolve:Rzn,tokenize:Dzn};function Rzn(o,s){let d=o.length-2,y=3,S,N;return o[y][1].type==="whitespace"&&(y+=2),d-2>y&&o[d][1].type==="whitespace"&&(d-=2),o[d][1].type==="atxHeadingSequence"&&(y===d-1||d-4>y&&o[d-2][1].type==="whitespace")&&(d-=y+1===d?2:4),d>y&&(S={type:"atxHeadingText",start:o[y][1].start,end:o[d][1].end},N={type:"chunkText",start:o[y][1].start,end:o[d][1].end,contentType:"text"},C6(o,y,d-y+1,[["enter",S,s],["enter",N,s],["exit",N,s],["exit",S,s]])),o}function Dzn(o,s,d){let y=0;return S;function S(nt){return o.enter("atxHeading"),N(nt)}function N(nt){return o.enter("atxHeadingSequence"),B(nt)}function B(nt){return nt===35&&y++<6?(o.consume(nt),B):nt===null||Z2(nt)?(o.exit("atxHeadingSequence"),H(nt)):d(nt)}function H(nt){return nt===35?(o.enter("atxHeadingSequence"),et(nt)):nt===null||nc(nt)?(o.exit("atxHeading"),s(nt)):Hl(nt)?sf(o,H,"whitespace")(nt):(o.enter("atxHeadingText"),W(nt))}function et(nt){return nt===35?(o.consume(nt),et):(o.exit("atxHeadingSequence"),H(nt))}function W(nt){return nt===null||nt===35||Z2(nt)?(o.exit("atxHeadingText"),H(nt)):(o.consume(nt),W)}}const Bzn=["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"],EAe=["pre","script","style","textarea"],Fzn={concrete:!0,name:"htmlFlow",resolveTo:Hzn,tokenize:zzn},$zn={partial:!0,tokenize:qzn},jzn={partial:!0,tokenize:Uzn};function Hzn(o){let s=o.length;for(;s--&&!(o[s][0]==="enter"&&o[s][1].type==="htmlFlow"););return s>1&&o[s-2][1].type==="linePrefix"&&(o[s][1].start=o[s-2][1].start,o[s+1][1].start=o[s-2][1].start,o.splice(s-2,2)),o}function zzn(o,s,d){const y=this;let S,N,B,H,et;return W;function W(We){return nt(We)}function nt(We){return o.enter("htmlFlow"),o.enter("htmlFlowData"),o.consume(We),K}function K(We){return We===33?(o.consume(We),Q):We===47?(o.consume(We),N=!0,Lt):We===63?(o.consume(We),S=3,y.interrupt?s:Oe):_6(We)?(o.consume(We),B=String.fromCharCode(We),Pt):d(We)}function Q(We){return We===45?(o.consume(We),S=2,at):We===91?(o.consume(We),S=5,H=0,mt):_6(We)?(o.consume(We),S=4,y.interrupt?s:Oe):d(We)}function at(We){return We===45?(o.consume(We),y.interrupt?s:Oe):d(We)}function mt(We){const za="CDATA[";return We===za.charCodeAt(H++)?(o.consume(We),H===za.length?y.interrupt?s:hr:mt):d(We)}function Lt(We){return _6(We)?(o.consume(We),B=String.fromCharCode(We),Pt):d(We)}function Pt(We){if(We===null||We===47||We===62||Z2(We)){const za=We===47,Fa=B.toLowerCase();return!za&&!N&&EAe.includes(Fa)?(S=1,y.interrupt?s(We):hr(We)):Bzn.includes(B.toLowerCase())?(S=6,za?(o.consume(We),Mt):y.interrupt?s(We):hr(We)):(S=7,y.interrupt&&!y.parser.lazy[y.now().line]?d(We):N?ie(We):se(We))}return We===45||Sw(We)?(o.consume(We),B+=String.fromCharCode(We),Pt):d(We)}function Mt(We){return We===62?(o.consume(We),y.interrupt?s:hr):d(We)}function ie(We){return Hl(We)?(o.consume(We),ie):qn(We)}function se(We){return We===47?(o.consume(We),qn):We===58||We===95||_6(We)?(o.consume(We),ve):Hl(We)?(o.consume(We),se):qn(We)}function ve(We){return We===45||We===46||We===58||We===95||Sw(We)?(o.consume(We),ve):gn(We)}function gn(We){return We===61?(o.consume(We),fe):Hl(We)?(o.consume(We),gn):se(We)}function fe(We){return We===null||We===60||We===61||We===62||We===96?d(We):We===34||We===39?(o.consume(We),et=We,cn):Hl(We)?(o.consume(We),fe):sr(We)}function cn(We){return We===et?(o.consume(We),et=null,Fn):We===null||nc(We)?d(We):(o.consume(We),cn)}function sr(We){return We===null||We===34||We===39||We===47||We===60||We===61||We===62||We===96||Z2(We)?gn(We):(o.consume(We),sr)}function Fn(We){return We===47||We===62||Hl(We)?se(We):d(We)}function qn(We){return We===62?(o.consume(We),nr):d(We)}function nr(We){return We===null||nc(We)?hr(We):Hl(We)?(o.consume(We),nr):d(We)}function hr(We){return We===45&&S===2?(o.consume(We),hi):We===60&&S===1?(o.consume(We),_a):We===62&&S===4?(o.consume(We),ka):We===63&&S===3?(o.consume(We),Oe):We===93&&S===5?(o.consume(We),yr):nc(We)&&(S===6||S===7)?(o.exit("htmlFlowData"),o.check($zn,rs,di)(We)):We===null||nc(We)?(o.exit("htmlFlowData"),di(We)):(o.consume(We),hr)}function di(We){return o.check(jzn,gi,rs)(We)}function gi(We){return o.enter("lineEnding"),o.consume(We),o.exit("lineEnding"),Ar}function Ar(We){return We===null||nc(We)?di(We):(o.enter("htmlFlowData"),hr(We))}function hi(We){return We===45?(o.consume(We),Oe):hr(We)}function _a(We){return We===47?(o.consume(We),B="",fr):hr(We)}function fr(We){if(We===62){const za=B.toLowerCase();return EAe.includes(za)?(o.consume(We),ka):hr(We)}return _6(We)&&B.length<8?(o.consume(We),B+=String.fromCharCode(We),fr):hr(We)}function yr(We){return We===93?(o.consume(We),Oe):hr(We)}function Oe(We){return We===62?(o.consume(We),ka):We===45&&S===2?(o.consume(We),Oe):hr(We)}function ka(We){return We===null||nc(We)?(o.exit("htmlFlowData"),rs(We)):(o.consume(We),ka)}function rs(We){return o.exit("htmlFlow"),s(We)}}function Uzn(o,s,d){const y=this;return S;function S(B){return nc(B)?(o.enter("lineEnding"),o.consume(B),o.exit("lineEnding"),N):d(B)}function N(B){return y.parser.lazy[y.now().line]?d(B):s(B)}}function qzn(o,s,d){return y;function y(S){return o.enter("lineEnding"),o.consume(S),o.exit("lineEnding"),o.attempt(m2t,s,d)}}const Wzn={name:"htmlText",tokenize:Kzn};function Kzn(o,s,d){const y=this;let S,N,B;return H;function H(Oe){return o.enter("htmlText"),o.enter("htmlTextData"),o.consume(Oe),et}function et(Oe){return Oe===33?(o.consume(Oe),W):Oe===47?(o.consume(Oe),gn):Oe===63?(o.consume(Oe),se):_6(Oe)?(o.consume(Oe),sr):d(Oe)}function W(Oe){return Oe===45?(o.consume(Oe),nt):Oe===91?(o.consume(Oe),N=0,mt):_6(Oe)?(o.consume(Oe),ie):d(Oe)}function nt(Oe){return Oe===45?(o.consume(Oe),at):d(Oe)}function K(Oe){return Oe===null?d(Oe):Oe===45?(o.consume(Oe),Q):nc(Oe)?(B=K,_a(Oe)):(o.consume(Oe),K)}function Q(Oe){return Oe===45?(o.consume(Oe),at):K(Oe)}function at(Oe){return Oe===62?hi(Oe):Oe===45?Q(Oe):K(Oe)}function mt(Oe){const ka="CDATA[";return Oe===ka.charCodeAt(N++)?(o.consume(Oe),N===ka.length?Lt:mt):d(Oe)}function Lt(Oe){return Oe===null?d(Oe):Oe===93?(o.consume(Oe),Pt):nc(Oe)?(B=Lt,_a(Oe)):(o.consume(Oe),Lt)}function Pt(Oe){return Oe===93?(o.consume(Oe),Mt):Lt(Oe)}function Mt(Oe){return Oe===62?hi(Oe):Oe===93?(o.consume(Oe),Mt):Lt(Oe)}function ie(Oe){return Oe===null||Oe===62?hi(Oe):nc(Oe)?(B=ie,_a(Oe)):(o.consume(Oe),ie)}function se(Oe){return Oe===null?d(Oe):Oe===63?(o.consume(Oe),ve):nc(Oe)?(B=se,_a(Oe)):(o.consume(Oe),se)}function ve(Oe){return Oe===62?hi(Oe):se(Oe)}function gn(Oe){return _6(Oe)?(o.consume(Oe),fe):d(Oe)}function fe(Oe){return Oe===45||Sw(Oe)?(o.consume(Oe),fe):cn(Oe)}function cn(Oe){return nc(Oe)?(B=cn,_a(Oe)):Hl(Oe)?(o.consume(Oe),cn):hi(Oe)}function sr(Oe){return Oe===45||Sw(Oe)?(o.consume(Oe),sr):Oe===47||Oe===62||Z2(Oe)?Fn(Oe):d(Oe)}function Fn(Oe){return Oe===47?(o.consume(Oe),hi):Oe===58||Oe===95||_6(Oe)?(o.consume(Oe),qn):nc(Oe)?(B=Fn,_a(Oe)):Hl(Oe)?(o.consume(Oe),Fn):hi(Oe)}function qn(Oe){return Oe===45||Oe===46||Oe===58||Oe===95||Sw(Oe)?(o.consume(Oe),qn):nr(Oe)}function nr(Oe){return Oe===61?(o.consume(Oe),hr):nc(Oe)?(B=nr,_a(Oe)):Hl(Oe)?(o.consume(Oe),nr):Fn(Oe)}function hr(Oe){return Oe===null||Oe===60||Oe===61||Oe===62||Oe===96?d(Oe):Oe===34||Oe===39?(o.consume(Oe),S=Oe,di):nc(Oe)?(B=hr,_a(Oe)):Hl(Oe)?(o.consume(Oe),hr):(o.consume(Oe),gi)}function di(Oe){return Oe===S?(o.consume(Oe),S=void 0,Ar):Oe===null?d(Oe):nc(Oe)?(B=di,_a(Oe)):(o.consume(Oe),di)}function gi(Oe){return Oe===null||Oe===34||Oe===39||Oe===60||Oe===61||Oe===96?d(Oe):Oe===47||Oe===62||Z2(Oe)?Fn(Oe):(o.consume(Oe),gi)}function Ar(Oe){return Oe===47||Oe===62||Z2(Oe)?Fn(Oe):d(Oe)}function hi(Oe){return Oe===62?(o.consume(Oe),o.exit("htmlTextData"),o.exit("htmlText"),s):d(Oe)}function _a(Oe){return o.exit("htmlTextData"),o.enter("lineEnding"),o.consume(Oe),o.exit("lineEnding"),fr}function fr(Oe){return Hl(Oe)?sf(o,yr,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Oe):yr(Oe)}function yr(Oe){return o.enter("htmlTextData"),B(Oe)}}const Q$t={name:"labelEnd",resolveAll:Xzn,resolveTo:Qzn,tokenize:Jzn},Yzn={tokenize:Zzn},Gzn={tokenize:tUn},Vzn={tokenize:eUn};function Xzn(o){let s=-1;const d=[];for(;++s<o.length;){const y=o[s][1];if(d.push(o[s]),y.type==="labelImage"||y.type==="labelLink"||y.type==="labelEnd"){const S=y.type==="labelImage"?4:2;y.type="data",s+=S}}return o.length!==d.length&&C6(o,0,o.length,d),o}function Qzn(o,s){let d=o.length,y=0,S,N,B,H;for(;d--;)if(S=o[d][1],N){if(S.type==="link"||S.type==="labelLink"&&S._inactive)break;o[d][0]==="enter"&&S.type==="labelLink"&&(S._inactive=!0)}else if(B){if(o[d][0]==="enter"&&(S.type==="labelImage"||S.type==="labelLink")&&!S._balanced&&(N=d,S.type!=="labelLink")){y=2;break}}else S.type==="labelEnd"&&(B=d);const et={type:o[N][1].type==="labelLink"?"link":"image",start:{...o[N][1].start},end:{...o[o.length-1][1].end}},W={type:"label",start:{...o[N][1].start},end:{...o[B][1].end}},nt={type:"labelText",start:{...o[N+y+2][1].end},end:{...o[B-2][1].start}};return H=[["enter",et,s],["enter",W,s]],H=k3(H,o.slice(N+1,N+y+3)),H=k3(H,[["enter",nt,s]]),H=k3(H,X$t(s.parser.constructs.insideSpan.null,o.slice(N+y+4,B-3),s)),H=k3(H,[["exit",nt,s],o[B-2],o[B-1],["exit",W,s]]),H=k3(H,o.slice(B+1)),H=k3(H,[["exit",et,s]]),C6(o,N,o.length,H),o}function Jzn(o,s,d){const y=this;let S=y.events.length,N,B;for(;S--;)if((y.events[S][1].type==="labelImage"||y.events[S][1].type==="labelLink")&&!y.events[S][1]._balanced){N=y.events[S][1];break}return H;function H(Q){return N?N._inactive?K(Q):(B=y.parser.defined.includes(RF(y.sliceSerialize({start:N.end,end:y.now()}))),o.enter("labelEnd"),o.enter("labelMarker"),o.consume(Q),o.exit("labelMarker"),o.exit("labelEnd"),et):d(Q)}function et(Q){return Q===40?o.attempt(Yzn,nt,B?nt:K)(Q):Q===91?o.attempt(Gzn,nt,B?W:K)(Q):B?nt(Q):K(Q)}function W(Q){return o.attempt(Vzn,nt,K)(Q)}function nt(Q){return s(Q)}function K(Q){return N._balanced=!0,d(Q)}}function Zzn(o,s,d){return y;function y(K){return o.enter("resource"),o.enter("resourceMarker"),o.consume(K),o.exit("resourceMarker"),S}function S(K){return Z2(K)?OQ(o,N)(K):N(K)}function N(K){return K===41?nt(K):YLe(o,B,H,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(K)}function B(K){return Z2(K)?OQ(o,et)(K):nt(K)}function H(K){return d(K)}function et(K){return K===34||K===39||K===40?VLe(o,W,d,"resourceTitle","resourceTitleMarker","resourceTitleString")(K):nt(K)}function W(K){return Z2(K)?OQ(o,nt)(K):nt(K)}function nt(K){return K===41?(o.enter("resourceMarker"),o.consume(K),o.exit("resourceMarker"),o.exit("resource"),s):d(K)}}function tUn(o,s,d){const y=this;return S;function S(H){return GLe.call(y,o,N,B,"reference","referenceMarker","referenceString")(H)}function N(H){return y.parser.defined.includes(RF(y.sliceSerialize(y.events[y.events.length-1][1]).slice(1,-1)))?s(H):d(H)}function B(H){return d(H)}}function eUn(o,s,d){return y;function y(N){return o.enter("reference"),o.enter("referenceMarker"),o.consume(N),o.exit("referenceMarker"),S}function S(N){return N===93?(o.enter("referenceMarker"),o.consume(N),o.exit("referenceMarker"),o.exit("reference"),s):d(N)}}const nUn={name:"labelStartImage",resolveAll:Q$t.resolveAll,tokenize:rUn};function rUn(o,s,d){const y=this;return S;function S(H){return o.enter("labelImage"),o.enter("labelImageMarker"),o.consume(H),o.exit("labelImageMarker"),N}function N(H){return H===91?(o.enter("labelMarker"),o.consume(H),o.exit("labelMarker"),o.exit("labelImage"),B):d(H)}function B(H){return H===94&&"_hiddenFootnoteSupport"in y.parser.constructs?d(H):s(H)}}const iUn={name:"labelStartLink",resolveAll:Q$t.resolveAll,tokenize:aUn};function aUn(o,s,d){const y=this;return S;function S(B){return o.enter("labelLink"),o.enter("labelMarker"),o.consume(B),o.exit("labelMarker"),o.exit("labelLink"),N}function N(B){return B===94&&"_hiddenFootnoteSupport"in y.parser.constructs?d(B):s(B)}}const pBt={name:"lineEnding",tokenize:sUn};function sUn(o,s){return d;function d(y){return o.enter("lineEnding"),o.consume(y),o.exit("lineEnding"),sf(o,s,"linePrefix")}}const Zbt={name:"thematicBreak",tokenize:oUn};function oUn(o,s,d){let y=0,S;return N;function N(W){return o.enter("thematicBreak"),B(W)}function B(W){return S=W,H(W)}function H(W){return W===S?(o.enter("thematicBreakSequence"),et(W)):y>=3&&(W===null||nc(W))?(o.exit("thematicBreak"),s(W)):d(W)}function et(W){return W===S?(o.consume(W),y++,et):(o.exit("thematicBreakSequence"),Hl(W)?sf(o,H,"whitespace")(W):H(W))}}const V2={continuation:{tokenize:hUn},exit:dUn,name:"list",tokenize:lUn},cUn={partial:!0,tokenize:pUn},uUn={partial:!0,tokenize:fUn};function lUn(o,s,d){const y=this,S=y.events[y.events.length-1];let N=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,B=0;return H;function H(at){const mt=y.containerState.type||(at===42||at===43||at===45?"listUnordered":"listOrdered");if(mt==="listUnordered"?!y.containerState.marker||at===y.containerState.marker:MFt(at)){if(y.containerState.type||(y.containerState.type=mt,o.enter(mt,{_container:!0})),mt==="listUnordered")return o.enter("listItemPrefix"),at===42||at===45?o.check(Zbt,d,W)(at):W(at);if(!y.interrupt||at===49)return o.enter("listItemPrefix"),o.enter("listItemValue"),et(at)}return d(at)}function et(at){return MFt(at)&&++B<10?(o.consume(at),et):(!y.interrupt||B<2)&&(y.containerState.marker?at===y.containerState.marker:at===41||at===46)?(o.exit("listItemValue"),W(at)):d(at)}function W(at){return o.enter("listItemMarker"),o.consume(at),o.exit("listItemMarker"),y.containerState.marker=y.containerState.marker||at,o.check(m2t,y.interrupt?d:nt,o.attempt(cUn,Q,K))}function nt(at){return y.containerState.initialBlankLine=!0,N++,Q(at)}function K(at){return Hl(at)?(o.enter("listItemPrefixWhitespace"),o.consume(at),o.exit("listItemPrefixWhitespace"),Q):d(at)}function Q(at){return y.containerState.size=N+y.sliceSerialize(o.exit("listItemPrefix"),!0).length,s(at)}}function hUn(o,s,d){const y=this;return y.containerState._closeFlow=void 0,o.check(m2t,S,N);function S(H){return y.containerState.furtherBlankLines=y.containerState.furtherBlankLines||y.containerState.initialBlankLine,sf(o,s,"listItemIndent",y.containerState.size+1)(H)}function N(H){return y.containerState.furtherBlankLines||!Hl(H)?(y.containerState.furtherBlankLines=void 0,y.containerState.initialBlankLine=void 0,B(H)):(y.containerState.furtherBlankLines=void 0,y.containerState.initialBlankLine=void 0,o.attempt(uUn,s,B)(H))}function B(H){return y.containerState._closeFlow=!0,y.interrupt=void 0,sf(o,o.attempt(V2,s,d),"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H)}}function fUn(o,s,d){const y=this;return sf(o,S,"listItemIndent",y.containerState.size+1);function S(N){const B=y.events[y.events.length-1];return B&&B[1].type==="listItemIndent"&&B[2].sliceSerialize(B[1],!0).length===y.containerState.size?s(N):d(N)}}function dUn(o){o.exit(this.containerState.type)}function pUn(o,s,d){const y=this;return sf(o,S,"listItemPrefixWhitespace",y.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function S(N){const B=y.events[y.events.length-1];return!Hl(N)&&B&&B[1].type==="listItemPrefixWhitespace"?s(N):d(N)}}const TAe={name:"setextUnderline",resolveTo:gUn,tokenize:bUn};function gUn(o,s){let d=o.length,y,S,N;for(;d--;)if(o[d][0]==="enter"){if(o[d][1].type==="content"){y=d;break}o[d][1].type==="paragraph"&&(S=d)}else o[d][1].type==="content"&&o.splice(d,1),!N&&o[d][1].type==="definition"&&(N=d);const B={type:"setextHeading",start:{...o[y][1].start},end:{...o[o.length-1][1].end}};return o[S][1].type="setextHeadingText",N?(o.splice(S,0,["enter",B,s]),o.splice(N+1,0,["exit",o[y][1],s]),o[y][1].end={...o[N][1].end}):o[y][1]=B,o.push(["exit",B,s]),o}function bUn(o,s,d){const y=this;let S;return N;function N(W){let nt=y.events.length,K;for(;nt--;)if(y.events[nt][1].type!=="lineEnding"&&y.events[nt][1].type!=="linePrefix"&&y.events[nt][1].type!=="content"){K=y.events[nt][1].type==="paragraph";break}return!y.parser.lazy[y.now().line]&&(y.interrupt||K)?(o.enter("setextHeadingLine"),S=W,B(W)):d(W)}function B(W){return o.enter("setextHeadingLineSequence"),H(W)}function H(W){return W===S?(o.consume(W),H):(o.exit("setextHeadingLineSequence"),Hl(W)?sf(o,et,"lineSuffix")(W):et(W))}function et(W){return W===null||nc(W)?(o.exit("setextHeadingLine"),s(W)):d(W)}}const mUn={tokenize:yUn};function yUn(o){const s=this,d=o.attempt(m2t,y,o.attempt(this.parser.constructs.flowInitial,S,sf(o,o.attempt(this.parser.constructs.flow,S,o.attempt(Ezn,S)),"linePrefix")));return d;function y(N){if(N===null){o.consume(N);return}return o.enter("lineEndingBlank"),o.consume(N),o.exit("lineEndingBlank"),s.currentConstruct=void 0,d}function S(N){if(N===null){o.consume(N);return}return o.enter("lineEnding"),o.consume(N),o.exit("lineEnding"),s.currentConstruct=void 0,d}}const wUn={resolveAll:QLe()},vUn=XLe("string"),_Un=XLe("text");function XLe(o){return{resolveAll:QLe(o==="text"?xUn:void 0),tokenize:s};function s(d){const y=this,S=this.parser.constructs[o],N=d.attempt(S,B,H);return B;function B(nt){return W(nt)?N(nt):H(nt)}function H(nt){if(nt===null){d.consume(nt);return}return d.enter("data"),d.consume(nt),et}function et(nt){return W(nt)?(d.exit("data"),N(nt)):(d.consume(nt),et)}function W(nt){if(nt===null)return!0;const K=S[nt];let Q=-1;if(K)for(;++Q<K.length;){const at=K[Q];if(!at.previous||at.previous.call(y,y.previous))return!0}return!1}}}function QLe(o){return s;function s(d,y){let S=-1,N;for(;++S<=d.length;)N===void 0?d[S]&&d[S][1].type==="data"&&(N=S,S++):(!d[S]||d[S][1].type!=="data")&&(S!==N+2&&(d[N][1].end=d[S-1][1].end,d.splice(N+2,S-N-2),S=N+2),N=void 0);return o?o(d,y):d}}function xUn(o,s){let d=0;for(;++d<=o.length;)if((d===o.length||o[d][1].type==="lineEnding")&&o[d-1][1].type==="data"){const y=o[d-1][1],S=s.sliceStream(y);let N=S.length,B=-1,H=0,et;for(;N--;){const W=S[N];if(typeof W=="string"){for(B=W.length;W.charCodeAt(B-1)===32;)H++,B--;if(B)break;B=-1}else if(W===-2)et=!0,H++;else if(W!==-1){N++;break}}if(s._contentTypeTextTrailing&&d===o.length&&(H=0),H){const W={type:d===o.length||et||H<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:N?B:y.start._bufferIndex+B,_index:y.start._index+N,line:y.end.line,column:y.end.column-H,offset:y.end.offset-H},end:{...y.end}};y.end={...W.start},y.start.offset===y.end.offset?Object.assign(y,W):(o.splice(d,0,["enter",W,s],["exit",W,s]),d+=2)}d++}return o}const EUn={42:V2,43:V2,45:V2,48:V2,49:V2,50:V2,51:V2,52:V2,53:V2,54:V2,55:V2,56:V2,57:V2,62:ULe},TUn={91:Azn},kUn={[-2]:dBt,[-1]:dBt,32:dBt},CUn={35:Pzn,42:Zbt,45:[TAe,Zbt],60:Fzn,61:TAe,95:Zbt,96:xAe,126:xAe},SUn={38:WLe,92:qLe},AUn={[-5]:pBt,[-4]:pBt,[-3]:pBt,33:nUn,38:WLe,42:PFt,60:[izn,Wzn],91:iUn,92:[Lzn,qLe],93:Q$t,95:PFt,96:mzn},IUn={null:[PFt,wUn]},OUn={null:[42,95]},NUn={null:[]},LUn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:OUn,contentInitial:TUn,disable:NUn,document:EUn,flow:CUn,flowInitial:kUn,insideSpan:IUn,string:SUn,text:AUn},Symbol.toStringTag,{value:"Module"}));function MUn(o,s,d){let y={_bufferIndex:-1,_index:0,line:d&&d.line||1,column:d&&d.column||1,offset:d&&d.offset||0};const S={},N=[];let B=[],H=[];const et={attempt:cn(gn),check:cn(fe),consume:ie,enter:se,exit:ve,interrupt:cn(fe,{interrupt:!0})},W={code:null,containerState:{},defineSkip:Lt,events:[],now:mt,parser:o,previous:null,sliceSerialize:Q,sliceStream:at,write:K};let nt=s.tokenize.call(W,et);return s.resolveAll&&N.push(s),W;function K(nr){return B=k3(B,nr),Pt(),B[B.length-1]!==null?[]:(sr(s,0),W.events=X$t(N,W.events,W),W.events)}function Q(nr,hr){return RUn(at(nr),hr)}function at(nr){return PUn(B,nr)}function mt(){const{_bufferIndex:nr,_index:hr,line:di,column:gi,offset:Ar}=y;return{_bufferIndex:nr,_index:hr,line:di,column:gi,offset:Ar}}function Lt(nr){S[nr.line]=nr.column,qn()}function Pt(){let nr;for(;y._index<B.length;){const hr=B[y._index];if(typeof hr=="string")for(nr=y._index,y._bufferIndex<0&&(y._bufferIndex=0);y._index===nr&&y._bufferIndex<hr.length;)Mt(hr.charCodeAt(y._bufferIndex));else Mt(hr)}}function Mt(nr){nt=nt(nr)}function ie(nr){nc(nr)?(y.line++,y.column=1,y.offset+=nr===-3?2:1,qn()):nr!==-1&&(y.column++,y.offset++),y._bufferIndex<0?y._index++:(y._bufferIndex++,y._bufferIndex===B[y._index].length&&(y._bufferIndex=-1,y._index++)),W.previous=nr}function se(nr,hr){const di=hr||{};return di.type=nr,di.start=mt(),W.events.push(["enter",di,W]),H.push(di),di}function ve(nr){const hr=H.pop();return hr.end=mt(),W.events.push(["exit",hr,W]),hr}function gn(nr,hr){sr(nr,hr.from)}function fe(nr,hr){hr.restore()}function cn(nr,hr){return di;function di(gi,Ar,hi){let _a,fr,yr,Oe;return Array.isArray(gi)?rs(gi):"tokenize"in gi?rs([gi]):ka(gi);function ka(Sa){return $s;function $s(su){const mu=su!==null&&Sa[su],js=su!==null&&Sa.null,pc=[...Array.isArray(mu)?mu:mu?[mu]:[],...Array.isArray(js)?js:js?[js]:[]];return rs(pc)(su)}}function rs(Sa){return _a=Sa,fr=0,Sa.length===0?hi:We(Sa[fr])}function We(Sa){return $s;function $s(su){return Oe=Fn(),yr=Sa,Sa.partial||(W.currentConstruct=Sa),Sa.name&&W.parser.constructs.disable.null.includes(Sa.name)?Fa():Sa.tokenize.call(hr?Object.assign(Object.create(W),hr):W,et,za,Fa)(su)}}function za(Sa){return nr(yr,Oe),Ar}function Fa(Sa){return Oe.restore(),++fr<_a.length?We(_a[fr]):hi}}}function sr(nr,hr){nr.resolveAll&&!N.includes(nr)&&N.push(nr),nr.resolve&&C6(W.events,hr,W.events.length-hr,nr.resolve(W.events.slice(hr),W)),nr.resolveTo&&(W.events=nr.resolveTo(W.events,W))}function Fn(){const nr=mt(),hr=W.previous,di=W.currentConstruct,gi=W.events.length,Ar=Array.from(H);return{from:gi,restore:hi};function hi(){y=nr,W.previous=hr,W.currentConstruct=di,W.events.length=gi,H=Ar,qn()}}function qn(){y.line in S&&y.column<2&&(y.column=S[y.line],y.offset+=S[y.line]-1)}}function PUn(o,s){const d=s.start._index,y=s.start._bufferIndex,S=s.end._index,N=s.end._bufferIndex;let B;if(d===S)B=[o[d].slice(y,N)];else{if(B=o.slice(d,S),y>-1){const H=B[0];typeof H=="string"?B[0]=H.slice(y):B.shift()}N>0&&B.push(o[S].slice(0,N))}return B}function RUn(o,s){let d=-1;const y=[];let S;for(;++d<o.length;){const N=o[d];let B;if(typeof N=="string")B=N;else switch(N){case-5:{B="\r";break}case-4:{B=`
1918
1918
  `;break}case-3:{B=`\r
1919
- `;break}case-2:{B=s?" ":" ";break}case-1:{if(!s&&S)continue;B=" ";break}default:B=String.fromCharCode(N)}S=N===-2,y.push(B)}return y.join("")}function PUn(o){const y={constructs:HHn([OUn,...(o||{}).extensions||[]]),content:S(VHn),defined:[],document:S(QHn),flow:S(gUn),lazy:{},string:S(yUn),text:S(wUn)};return y;function S(N){return B;function B(H){return NUn(y,N,H)}}}function RUn(o){for(;!KLe(o););return o}const kAe=/[\0\t\n\r]/g;function DUn(){let o=1,s="",d=!0,y;return S;function S(N,B,H){const et=[];let W,nt,K,Q,at;for(N=s+(typeof N=="string"?N.toString():new TextDecoder(B||void 0).decode(N)),K=0,s="",d&&(N.charCodeAt(0)===65279&&K++,d=void 0);K<N.length;){if(kAe.lastIndex=K,W=kAe.exec(N),Q=W&&W.index!==void 0?W.index:N.length,at=N.charCodeAt(Q),!W){s=N.slice(K);break}if(at===10&&K===Q&&y)et.push(-3),y=void 0;else switch(y&&(et.push(-5),y=void 0),K<Q&&(et.push(N.slice(K,Q)),o+=Q-K),at){case 0:{et.push(65533),o++;break}case 9:{for(nt=Math.ceil(o/4)*4,et.push(-2);o++<nt;)et.push(-1);break}case 10:{et.push(-4),o=1;break}default:y=!0,o=1}K=Q+1}return H&&(y&&et.push(-5),s&&et.push(s),et.push(null)),et}}const BUn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FUn(o){return o.replace(BUn,$Un)}function $Un(o,s,d){if(s)return s;if(d.charCodeAt(0)===35){const S=d.charCodeAt(1),N=S===120||S===88;return zLe(d.slice(N?2:1),N?16:10)}return V$t(d)||o}const JLe={}.hasOwnProperty;function jUn(o,s,d){return typeof s!="string"&&(d=s,s=void 0),HUn(d)(RUn(PUn(d).document().write(DUn()(o,s,!0))))}function HUn(o){const s={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:N(ry),autolinkProtocol:Fn,autolinkEmail:Fn,atxHeading:N(Ph),blockQuote:N(js),characterEscape:Fn,characterReference:Fn,codeFenced:N(pc),codeFencedFenceInfo:B,codeFencedFenceMeta:B,codeIndented:N(pc,B),codeText:N(yu,B),codeTextData:Fn,data:Fn,codeFlowValue:Fn,definition:N(O1),definitionDestinationString:B,definitionLabelString:B,definitionTitleString:B,emphasis:N(il),hardBreakEscape:N(Pg),hardBreakTrailing:N(Pg),htmlFlow:N(Rg,B),htmlFlowData:Fn,htmlText:N(Rg,B),htmlTextData:Fn,image:N(Dg),label:B,link:N(ry),listItem:N(md),listItemValue:Q,listOrdered:N(Yp,K),listUnordered:N(Yp),paragraph:N(Gp),reference:We,referenceString:B,resourceDestinationString:B,resourceTitleString:B,setextHeading:N(Ph),strong:N(Aw),thematicBreak:N(M3)},exit:{atxHeading:et(),atxHeadingSequence:gn,autolink:et(),autolinkEmail:mu,autolinkProtocol:su,blockQuote:et(),characterEscapeValue:qn,characterReferenceMarkerHexadecimal:Fa,characterReferenceMarkerNumeric:Fa,characterReferenceValue:Sa,characterReference:$s,codeFenced:et(Pt),codeFencedFence:Lt,codeFencedFenceInfo:at,codeFencedFenceMeta:mt,codeFlowValue:qn,codeIndented:et(Mt),codeText:et(Ar),codeTextData:qn,data:qn,definition:et(),definitionDestinationString:ve,definitionLabelString:ie,definitionTitleString:se,emphasis:et(),hardBreakEscape:et(hr),hardBreakTrailing:et(hr),htmlFlow:et(di),htmlFlowData:qn,htmlText:et(gi),htmlTextData:qn,image:et(_a),label:yr,labelText:fr,lineEnding:nr,link:et(hi),listItem:et(),listOrdered:et(),listUnordered:et(),paragraph:et(),referenceString:za,resourceDestinationString:Oe,resourceTitleString:ka,resource:rs,setextHeading:et(sr),setextHeadingLineSequence:cn,setextHeadingText:fe,strong:et(),thematicBreak:et()}};ZLe(s,(o||{}).mdastExtensions||[]);const d={};return y;function y(zr){let pa={type:"root",children:[]};const Vs={stack:[pa],tokenStack:[],config:s,enter:H,exit:W,buffer:B,resume:nt,data:d},gc=[];let Iu=-1;for(;++Iu<zr.length;)if(zr[Iu][1].type==="listOrdered"||zr[Iu][1].type==="listUnordered")if(zr[Iu][0]==="enter")gc.push(Iu);else{const ou=gc.pop();Iu=S(zr,ou,Iu)}for(Iu=-1;++Iu<zr.length;){const ou=s[zr[Iu][0]];JLe.call(ou,zr[Iu][1].type)&&ou[zr[Iu][1].type].call(Object.assign({sliceSerialize:zr[Iu][2].sliceSerialize},Vs),zr[Iu][1])}if(Vs.tokenStack.length>0){const ou=Vs.tokenStack[Vs.tokenStack.length-1];(ou[1]||CAe).call(Vs,void 0,ou[0])}for(pa.position={start:QS(zr.length>0?zr[0][1].start:{line:1,column:1,offset:0}),end:QS(zr.length>0?zr[zr.length-2][1].end:{line:1,column:1,offset:0})},Iu=-1;++Iu<s.transforms.length;)pa=s.transforms[Iu](pa)||pa;return pa}function S(zr,pa,Vs){let gc=pa-1,Iu=-1,ou=!1,Bg,f0,a5,Ms;for(;++gc<=Vs;){const zc=zr[gc];switch(zc[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{zc[0]==="enter"?Iu++:Iu--,Ms=void 0;break}case"lineEndingBlank":{zc[0]==="enter"&&(Bg&&!Ms&&!Iu&&!a5&&(a5=gc),Ms=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ms=void 0}if(!Iu&&zc[0]==="enter"&&zc[1].type==="listItemPrefix"||Iu===-1&&zc[0]==="exit"&&(zc[1].type==="listUnordered"||zc[1].type==="listOrdered")){if(Bg){let Rh=gc;for(f0=void 0;Rh--;){const ip=zr[Rh];if(ip[1].type==="lineEnding"||ip[1].type==="lineEndingBlank"){if(ip[0]==="exit")continue;f0&&(zr[f0][1].type="lineEndingBlank",ou=!0),ip[1].type="lineEnding",f0=Rh}else if(!(ip[1].type==="linePrefix"||ip[1].type==="blockQuotePrefix"||ip[1].type==="blockQuotePrefixWhitespace"||ip[1].type==="blockQuoteMarker"||ip[1].type==="listItemIndent"))break}a5&&(!f0||a5<f0)&&(Bg._spread=!0),Bg.end=Object.assign({},f0?zr[f0][1].start:zc[1].end),zr.splice(f0||gc,0,["exit",Bg,zc[2]]),gc++,Vs++}if(zc[1].type==="listItemPrefix"){const Rh={type:"listItem",_spread:!1,start:Object.assign({},zc[1].start),end:void 0};Bg=Rh,zr.splice(gc,0,["enter",Rh,zc[2]]),gc++,Vs++,a5=void 0,Ms=!0}}}return zr[pa][1]._spread=ou,Vs}function N(zr,pa){return Vs;function Vs(gc){H.call(this,zr(gc),gc),pa&&pa.call(this,gc)}}function B(){this.stack.push({type:"fragment",children:[]})}function H(zr,pa,Vs){this.stack[this.stack.length-1].children.push(zr),this.stack.push(zr),this.tokenStack.push([pa,Vs||void 0]),zr.position={start:QS(pa.start),end:void 0}}function et(zr){return pa;function pa(Vs){zr&&zr.call(this,Vs),W.call(this,Vs)}}function W(zr,pa){const Vs=this.stack.pop(),gc=this.tokenStack.pop();if(gc)gc[0].type!==zr.type&&(pa?pa.call(this,zr,gc[0]):(gc[1]||CAe).call(this,zr,gc[0]));else throw new Error("Cannot close `"+zr.type+"` ("+IQ({start:zr.start,end:zr.end})+"): it’s not open");Vs.position.end=QS(zr.end)}function nt(){return $Hn(this.stack.pop())}function K(){this.data.expectingFirstListItemValue=!0}function Q(zr){if(this.data.expectingFirstListItemValue){const pa=this.stack[this.stack.length-2];pa.start=Number.parseInt(this.sliceSerialize(zr),10),this.data.expectingFirstListItemValue=void 0}}function at(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.lang=zr}function mt(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.meta=zr}function Lt(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function Pt(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function Mt(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr.replace(/(\r?\n|\r)$/g,"")}function ie(zr){const pa=this.resume(),Vs=this.stack[this.stack.length-1];Vs.label=pa,Vs.identifier=RF(this.sliceSerialize(zr)).toLowerCase()}function se(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.title=zr}function ve(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.url=zr}function gn(zr){const pa=this.stack[this.stack.length-1];if(!pa.depth){const Vs=this.sliceSerialize(zr).length;pa.depth=Vs}}function fe(){this.data.setextHeadingSlurpLineEnding=!0}function cn(zr){const pa=this.stack[this.stack.length-1];pa.depth=this.sliceSerialize(zr).codePointAt(0)===61?1:2}function sr(){this.data.setextHeadingSlurpLineEnding=void 0}function Fn(zr){const Vs=this.stack[this.stack.length-1].children;let gc=Vs[Vs.length-1];(!gc||gc.type!=="text")&&(gc=Xd(),gc.position={start:QS(zr.start),end:void 0},Vs.push(gc)),this.stack.push(gc)}function qn(zr){const pa=this.stack.pop();pa.value+=this.sliceSerialize(zr),pa.position.end=QS(zr.end)}function nr(zr){const pa=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Vs=pa.children[pa.children.length-1];Vs.position.end=QS(zr.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&s.canContainEols.includes(pa.type)&&(Fn.call(this,zr),qn.call(this,zr))}function hr(){this.data.atHardBreak=!0}function di(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr}function gi(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr}function Ar(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr}function hi(){const zr=this.stack[this.stack.length-1];if(this.data.inReference){const pa=this.data.referenceType||"shortcut";zr.type+="Reference",zr.referenceType=pa,delete zr.url,delete zr.title}else delete zr.identifier,delete zr.label;this.data.referenceType=void 0}function _a(){const zr=this.stack[this.stack.length-1];if(this.data.inReference){const pa=this.data.referenceType||"shortcut";zr.type+="Reference",zr.referenceType=pa,delete zr.url,delete zr.title}else delete zr.identifier,delete zr.label;this.data.referenceType=void 0}function fr(zr){const pa=this.sliceSerialize(zr),Vs=this.stack[this.stack.length-2];Vs.label=FUn(pa),Vs.identifier=RF(pa).toLowerCase()}function yr(){const zr=this.stack[this.stack.length-1],pa=this.resume(),Vs=this.stack[this.stack.length-1];if(this.data.inReference=!0,Vs.type==="link"){const gc=zr.children;Vs.children=gc}else Vs.alt=pa}function Oe(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.url=zr}function ka(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.title=zr}function rs(){this.data.inReference=void 0}function We(){this.data.referenceType="collapsed"}function za(zr){const pa=this.resume(),Vs=this.stack[this.stack.length-1];Vs.label=pa,Vs.identifier=RF(this.sliceSerialize(zr)).toLowerCase(),this.data.referenceType="full"}function Fa(zr){this.data.characterReferenceType=zr.type}function Sa(zr){const pa=this.sliceSerialize(zr),Vs=this.data.characterReferenceType;let gc;Vs?(gc=zLe(pa,Vs==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):gc=V$t(pa);const Iu=this.stack[this.stack.length-1];Iu.value+=gc}function $s(zr){const pa=this.stack.pop();pa.position.end=QS(zr.end)}function su(zr){qn.call(this,zr);const pa=this.stack[this.stack.length-1];pa.url=this.sliceSerialize(zr)}function mu(zr){qn.call(this,zr);const pa=this.stack[this.stack.length-1];pa.url="mailto:"+this.sliceSerialize(zr)}function js(){return{type:"blockquote",children:[]}}function pc(){return{type:"code",lang:null,meta:null,value:""}}function yu(){return{type:"inlineCode",value:""}}function O1(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function il(){return{type:"emphasis",children:[]}}function Ph(){return{type:"heading",depth:0,children:[]}}function Pg(){return{type:"break"}}function Rg(){return{type:"html",value:""}}function Dg(){return{type:"image",title:null,url:"",alt:null}}function ry(){return{type:"link",title:null,url:"",children:[]}}function Yp(zr){return{type:"list",ordered:zr.type==="listOrdered",start:null,spread:zr._spread,children:[]}}function md(zr){return{type:"listItem",spread:zr._spread,checked:null,children:[]}}function Gp(){return{type:"paragraph",children:[]}}function Aw(){return{type:"strong",children:[]}}function Xd(){return{type:"text",value:""}}function M3(){return{type:"thematicBreak"}}}function QS(o){return{line:o.line,column:o.column,offset:o.offset}}function ZLe(o,s){let d=-1;for(;++d<s.length;){const y=s[d];Array.isArray(y)?ZLe(o,y):zUn(o,y)}}function zUn(o,s){let d;for(d in s)if(JLe.call(s,d))switch(d){case"canContainEols":{const y=s[d];y&&o[d].push(...y);break}case"transforms":{const y=s[d];y&&o[d].push(...y);break}case"enter":case"exit":{const y=s[d];y&&Object.assign(o[d],y);break}}}function CAe(o,s){throw o?new Error("Cannot close `"+o.type+"` ("+IQ({start:o.start,end:o.end})+"): a different token (`"+s.type+"`, "+IQ({start:s.start,end:s.end})+") is open"):new Error("Cannot close document, a token (`"+s.type+"`, "+IQ({start:s.start,end:s.end})+") is still open")}function UUn(o){const s=this;s.parser=d;function d(y){return jUn(y,{...s.data("settings"),...o,extensions:s.data("micromarkExtensions")||[],mdastExtensions:s.data("fromMarkdownExtensions")||[]})}}function qUn(o,s){const d={type:"element",tagName:"blockquote",properties:{},children:o.wrap(o.all(s),!0)};return o.patch(s,d),o.applyData(s,d)}function WUn(o,s){const d={type:"element",tagName:"br",properties:{},children:[]};return o.patch(s,d),[o.applyData(s,d),{type:"text",value:`
1920
- `}]}function KUn(o,s){const d=s.value?s.value+`
1921
- `:"",y={};s.lang&&(y.className=["language-"+s.lang]);let S={type:"element",tagName:"code",properties:y,children:[{type:"text",value:d}]};return s.meta&&(S.data={meta:s.meta}),o.patch(s,S),S=o.applyData(s,S),S={type:"element",tagName:"pre",properties:{},children:[S]},o.patch(s,S),S}function YUn(o,s){const d={type:"element",tagName:"del",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function GUn(o,s){const d={type:"element",tagName:"em",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function VUn(o,s){const d=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",y=String(s.identifier).toUpperCase(),S=r$(y.toLowerCase()),N=o.footnoteOrder.indexOf(y);let B,H=o.footnoteCounts.get(y);H===void 0?(H=0,o.footnoteOrder.push(y),B=o.footnoteOrder.length):B=N+1,H+=1,o.footnoteCounts.set(y,H);const et={type:"element",tagName:"a",properties:{href:"#"+d+"fn-"+S,id:d+"fnref-"+S+(H>1?"-"+H:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(B)}]};o.patch(s,et);const W={type:"element",tagName:"sup",properties:{},children:[et]};return o.patch(s,W),o.applyData(s,W)}function XUn(o,s){const d={type:"element",tagName:"h"+s.depth,properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function QUn(o,s){if(o.options.allowDangerousHtml){const d={type:"raw",value:s.value};return o.patch(s,d),o.applyData(s,d)}}function tMe(o,s){const d=s.referenceType;let y="]";if(d==="collapsed"?y+="[]":d==="full"&&(y+="["+(s.label||s.identifier)+"]"),s.type==="imageReference")return[{type:"text",value:"!["+s.alt+y}];const S=o.all(s),N=S[0];N&&N.type==="text"?N.value="["+N.value:S.unshift({type:"text",value:"["});const B=S[S.length-1];return B&&B.type==="text"?B.value+=y:S.push({type:"text",value:y}),S}function JUn(o,s){const d=String(s.identifier).toUpperCase(),y=o.definitionById.get(d);if(!y)return tMe(o,s);const S={src:r$(y.url||""),alt:s.alt};y.title!==null&&y.title!==void 0&&(S.title=y.title);const N={type:"element",tagName:"img",properties:S,children:[]};return o.patch(s,N),o.applyData(s,N)}function ZUn(o,s){const d={src:r$(s.url)};s.alt!==null&&s.alt!==void 0&&(d.alt=s.alt),s.title!==null&&s.title!==void 0&&(d.title=s.title);const y={type:"element",tagName:"img",properties:d,children:[]};return o.patch(s,y),o.applyData(s,y)}function tqn(o,s){const d={type:"text",value:s.value.replace(/\r?\n|\r/g," ")};o.patch(s,d);const y={type:"element",tagName:"code",properties:{},children:[d]};return o.patch(s,y),o.applyData(s,y)}function eqn(o,s){const d=String(s.identifier).toUpperCase(),y=o.definitionById.get(d);if(!y)return tMe(o,s);const S={href:r$(y.url||"")};y.title!==null&&y.title!==void 0&&(S.title=y.title);const N={type:"element",tagName:"a",properties:S,children:o.all(s)};return o.patch(s,N),o.applyData(s,N)}function nqn(o,s){const d={href:r$(s.url)};s.title!==null&&s.title!==void 0&&(d.title=s.title);const y={type:"element",tagName:"a",properties:d,children:o.all(s)};return o.patch(s,y),o.applyData(s,y)}function rqn(o,s,d){const y=o.all(s),S=d?iqn(d):eMe(s),N={},B=[];if(typeof s.checked=="boolean"){const nt=y[0];let K;nt&&nt.type==="element"&&nt.tagName==="p"?K=nt:(K={type:"element",tagName:"p",properties:{},children:[]},y.unshift(K)),K.children.length>0&&K.children.unshift({type:"text",value:" "}),K.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:s.checked,disabled:!0},children:[]}),N.className=["task-list-item"]}let H=-1;for(;++H<y.length;){const nt=y[H];(S||H!==0||nt.type!=="element"||nt.tagName!=="p")&&B.push({type:"text",value:`
1919
+ `;break}case-2:{B=s?" ":" ";break}case-1:{if(!s&&S)continue;B=" ";break}default:B=String.fromCharCode(N)}S=N===-2,y.push(B)}return y.join("")}function DUn(o){const y={constructs:UHn([LUn,...(o||{}).extensions||[]]),content:S(QHn),defined:[],document:S(ZHn),flow:S(mUn),lazy:{},string:S(vUn),text:S(_Un)};return y;function S(N){return B;function B(H){return MUn(y,N,H)}}}function BUn(o){for(;!KLe(o););return o}const kAe=/[\0\t\n\r]/g;function FUn(){let o=1,s="",d=!0,y;return S;function S(N,B,H){const et=[];let W,nt,K,Q,at;for(N=s+(typeof N=="string"?N.toString():new TextDecoder(B||void 0).decode(N)),K=0,s="",d&&(N.charCodeAt(0)===65279&&K++,d=void 0);K<N.length;){if(kAe.lastIndex=K,W=kAe.exec(N),Q=W&&W.index!==void 0?W.index:N.length,at=N.charCodeAt(Q),!W){s=N.slice(K);break}if(at===10&&K===Q&&y)et.push(-3),y=void 0;else switch(y&&(et.push(-5),y=void 0),K<Q&&(et.push(N.slice(K,Q)),o+=Q-K),at){case 0:{et.push(65533),o++;break}case 9:{for(nt=Math.ceil(o/4)*4,et.push(-2);o++<nt;)et.push(-1);break}case 10:{et.push(-4),o=1;break}default:y=!0,o=1}K=Q+1}return H&&(y&&et.push(-5),s&&et.push(s),et.push(null)),et}}const $Un=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jUn(o){return o.replace($Un,HUn)}function HUn(o,s,d){if(s)return s;if(d.charCodeAt(0)===35){const S=d.charCodeAt(1),N=S===120||S===88;return zLe(d.slice(N?2:1),N?16:10)}return V$t(d)||o}const JLe={}.hasOwnProperty;function zUn(o,s,d){return typeof s!="string"&&(d=s,s=void 0),UUn(d)(BUn(DUn(d).document().write(FUn()(o,s,!0))))}function UUn(o){const s={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:N(ry),autolinkProtocol:Fn,autolinkEmail:Fn,atxHeading:N(Ph),blockQuote:N(js),characterEscape:Fn,characterReference:Fn,codeFenced:N(pc),codeFencedFenceInfo:B,codeFencedFenceMeta:B,codeIndented:N(pc,B),codeText:N(yu,B),codeTextData:Fn,data:Fn,codeFlowValue:Fn,definition:N(O1),definitionDestinationString:B,definitionLabelString:B,definitionTitleString:B,emphasis:N(il),hardBreakEscape:N(Pg),hardBreakTrailing:N(Pg),htmlFlow:N(Rg,B),htmlFlowData:Fn,htmlText:N(Rg,B),htmlTextData:Fn,image:N(Dg),label:B,link:N(ry),listItem:N(md),listItemValue:Q,listOrdered:N(Yp,K),listUnordered:N(Yp),paragraph:N(Gp),reference:We,referenceString:B,resourceDestinationString:B,resourceTitleString:B,setextHeading:N(Ph),strong:N(Aw),thematicBreak:N(M3)},exit:{atxHeading:et(),atxHeadingSequence:gn,autolink:et(),autolinkEmail:mu,autolinkProtocol:su,blockQuote:et(),characterEscapeValue:qn,characterReferenceMarkerHexadecimal:Fa,characterReferenceMarkerNumeric:Fa,characterReferenceValue:Sa,characterReference:$s,codeFenced:et(Pt),codeFencedFence:Lt,codeFencedFenceInfo:at,codeFencedFenceMeta:mt,codeFlowValue:qn,codeIndented:et(Mt),codeText:et(Ar),codeTextData:qn,data:qn,definition:et(),definitionDestinationString:ve,definitionLabelString:ie,definitionTitleString:se,emphasis:et(),hardBreakEscape:et(hr),hardBreakTrailing:et(hr),htmlFlow:et(di),htmlFlowData:qn,htmlText:et(gi),htmlTextData:qn,image:et(_a),label:yr,labelText:fr,lineEnding:nr,link:et(hi),listItem:et(),listOrdered:et(),listUnordered:et(),paragraph:et(),referenceString:za,resourceDestinationString:Oe,resourceTitleString:ka,resource:rs,setextHeading:et(sr),setextHeadingLineSequence:cn,setextHeadingText:fe,strong:et(),thematicBreak:et()}};ZLe(s,(o||{}).mdastExtensions||[]);const d={};return y;function y(zr){let pa={type:"root",children:[]};const Vs={stack:[pa],tokenStack:[],config:s,enter:H,exit:W,buffer:B,resume:nt,data:d},gc=[];let Iu=-1;for(;++Iu<zr.length;)if(zr[Iu][1].type==="listOrdered"||zr[Iu][1].type==="listUnordered")if(zr[Iu][0]==="enter")gc.push(Iu);else{const ou=gc.pop();Iu=S(zr,ou,Iu)}for(Iu=-1;++Iu<zr.length;){const ou=s[zr[Iu][0]];JLe.call(ou,zr[Iu][1].type)&&ou[zr[Iu][1].type].call(Object.assign({sliceSerialize:zr[Iu][2].sliceSerialize},Vs),zr[Iu][1])}if(Vs.tokenStack.length>0){const ou=Vs.tokenStack[Vs.tokenStack.length-1];(ou[1]||CAe).call(Vs,void 0,ou[0])}for(pa.position={start:QS(zr.length>0?zr[0][1].start:{line:1,column:1,offset:0}),end:QS(zr.length>0?zr[zr.length-2][1].end:{line:1,column:1,offset:0})},Iu=-1;++Iu<s.transforms.length;)pa=s.transforms[Iu](pa)||pa;return pa}function S(zr,pa,Vs){let gc=pa-1,Iu=-1,ou=!1,Bg,f0,a5,Ms;for(;++gc<=Vs;){const zc=zr[gc];switch(zc[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{zc[0]==="enter"?Iu++:Iu--,Ms=void 0;break}case"lineEndingBlank":{zc[0]==="enter"&&(Bg&&!Ms&&!Iu&&!a5&&(a5=gc),Ms=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ms=void 0}if(!Iu&&zc[0]==="enter"&&zc[1].type==="listItemPrefix"||Iu===-1&&zc[0]==="exit"&&(zc[1].type==="listUnordered"||zc[1].type==="listOrdered")){if(Bg){let Rh=gc;for(f0=void 0;Rh--;){const ip=zr[Rh];if(ip[1].type==="lineEnding"||ip[1].type==="lineEndingBlank"){if(ip[0]==="exit")continue;f0&&(zr[f0][1].type="lineEndingBlank",ou=!0),ip[1].type="lineEnding",f0=Rh}else if(!(ip[1].type==="linePrefix"||ip[1].type==="blockQuotePrefix"||ip[1].type==="blockQuotePrefixWhitespace"||ip[1].type==="blockQuoteMarker"||ip[1].type==="listItemIndent"))break}a5&&(!f0||a5<f0)&&(Bg._spread=!0),Bg.end=Object.assign({},f0?zr[f0][1].start:zc[1].end),zr.splice(f0||gc,0,["exit",Bg,zc[2]]),gc++,Vs++}if(zc[1].type==="listItemPrefix"){const Rh={type:"listItem",_spread:!1,start:Object.assign({},zc[1].start),end:void 0};Bg=Rh,zr.splice(gc,0,["enter",Rh,zc[2]]),gc++,Vs++,a5=void 0,Ms=!0}}}return zr[pa][1]._spread=ou,Vs}function N(zr,pa){return Vs;function Vs(gc){H.call(this,zr(gc),gc),pa&&pa.call(this,gc)}}function B(){this.stack.push({type:"fragment",children:[]})}function H(zr,pa,Vs){this.stack[this.stack.length-1].children.push(zr),this.stack.push(zr),this.tokenStack.push([pa,Vs||void 0]),zr.position={start:QS(pa.start),end:void 0}}function et(zr){return pa;function pa(Vs){zr&&zr.call(this,Vs),W.call(this,Vs)}}function W(zr,pa){const Vs=this.stack.pop(),gc=this.tokenStack.pop();if(gc)gc[0].type!==zr.type&&(pa?pa.call(this,zr,gc[0]):(gc[1]||CAe).call(this,zr,gc[0]));else throw new Error("Cannot close `"+zr.type+"` ("+IQ({start:zr.start,end:zr.end})+"): it’s not open");Vs.position.end=QS(zr.end)}function nt(){return HHn(this.stack.pop())}function K(){this.data.expectingFirstListItemValue=!0}function Q(zr){if(this.data.expectingFirstListItemValue){const pa=this.stack[this.stack.length-2];pa.start=Number.parseInt(this.sliceSerialize(zr),10),this.data.expectingFirstListItemValue=void 0}}function at(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.lang=zr}function mt(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.meta=zr}function Lt(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function Pt(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function Mt(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr.replace(/(\r?\n|\r)$/g,"")}function ie(zr){const pa=this.resume(),Vs=this.stack[this.stack.length-1];Vs.label=pa,Vs.identifier=RF(this.sliceSerialize(zr)).toLowerCase()}function se(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.title=zr}function ve(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.url=zr}function gn(zr){const pa=this.stack[this.stack.length-1];if(!pa.depth){const Vs=this.sliceSerialize(zr).length;pa.depth=Vs}}function fe(){this.data.setextHeadingSlurpLineEnding=!0}function cn(zr){const pa=this.stack[this.stack.length-1];pa.depth=this.sliceSerialize(zr).codePointAt(0)===61?1:2}function sr(){this.data.setextHeadingSlurpLineEnding=void 0}function Fn(zr){const Vs=this.stack[this.stack.length-1].children;let gc=Vs[Vs.length-1];(!gc||gc.type!=="text")&&(gc=Xd(),gc.position={start:QS(zr.start),end:void 0},Vs.push(gc)),this.stack.push(gc)}function qn(zr){const pa=this.stack.pop();pa.value+=this.sliceSerialize(zr),pa.position.end=QS(zr.end)}function nr(zr){const pa=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Vs=pa.children[pa.children.length-1];Vs.position.end=QS(zr.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&s.canContainEols.includes(pa.type)&&(Fn.call(this,zr),qn.call(this,zr))}function hr(){this.data.atHardBreak=!0}function di(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr}function gi(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr}function Ar(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.value=zr}function hi(){const zr=this.stack[this.stack.length-1];if(this.data.inReference){const pa=this.data.referenceType||"shortcut";zr.type+="Reference",zr.referenceType=pa,delete zr.url,delete zr.title}else delete zr.identifier,delete zr.label;this.data.referenceType=void 0}function _a(){const zr=this.stack[this.stack.length-1];if(this.data.inReference){const pa=this.data.referenceType||"shortcut";zr.type+="Reference",zr.referenceType=pa,delete zr.url,delete zr.title}else delete zr.identifier,delete zr.label;this.data.referenceType=void 0}function fr(zr){const pa=this.sliceSerialize(zr),Vs=this.stack[this.stack.length-2];Vs.label=jUn(pa),Vs.identifier=RF(pa).toLowerCase()}function yr(){const zr=this.stack[this.stack.length-1],pa=this.resume(),Vs=this.stack[this.stack.length-1];if(this.data.inReference=!0,Vs.type==="link"){const gc=zr.children;Vs.children=gc}else Vs.alt=pa}function Oe(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.url=zr}function ka(){const zr=this.resume(),pa=this.stack[this.stack.length-1];pa.title=zr}function rs(){this.data.inReference=void 0}function We(){this.data.referenceType="collapsed"}function za(zr){const pa=this.resume(),Vs=this.stack[this.stack.length-1];Vs.label=pa,Vs.identifier=RF(this.sliceSerialize(zr)).toLowerCase(),this.data.referenceType="full"}function Fa(zr){this.data.characterReferenceType=zr.type}function Sa(zr){const pa=this.sliceSerialize(zr),Vs=this.data.characterReferenceType;let gc;Vs?(gc=zLe(pa,Vs==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):gc=V$t(pa);const Iu=this.stack[this.stack.length-1];Iu.value+=gc}function $s(zr){const pa=this.stack.pop();pa.position.end=QS(zr.end)}function su(zr){qn.call(this,zr);const pa=this.stack[this.stack.length-1];pa.url=this.sliceSerialize(zr)}function mu(zr){qn.call(this,zr);const pa=this.stack[this.stack.length-1];pa.url="mailto:"+this.sliceSerialize(zr)}function js(){return{type:"blockquote",children:[]}}function pc(){return{type:"code",lang:null,meta:null,value:""}}function yu(){return{type:"inlineCode",value:""}}function O1(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function il(){return{type:"emphasis",children:[]}}function Ph(){return{type:"heading",depth:0,children:[]}}function Pg(){return{type:"break"}}function Rg(){return{type:"html",value:""}}function Dg(){return{type:"image",title:null,url:"",alt:null}}function ry(){return{type:"link",title:null,url:"",children:[]}}function Yp(zr){return{type:"list",ordered:zr.type==="listOrdered",start:null,spread:zr._spread,children:[]}}function md(zr){return{type:"listItem",spread:zr._spread,checked:null,children:[]}}function Gp(){return{type:"paragraph",children:[]}}function Aw(){return{type:"strong",children:[]}}function Xd(){return{type:"text",value:""}}function M3(){return{type:"thematicBreak"}}}function QS(o){return{line:o.line,column:o.column,offset:o.offset}}function ZLe(o,s){let d=-1;for(;++d<s.length;){const y=s[d];Array.isArray(y)?ZLe(o,y):qUn(o,y)}}function qUn(o,s){let d;for(d in s)if(JLe.call(s,d))switch(d){case"canContainEols":{const y=s[d];y&&o[d].push(...y);break}case"transforms":{const y=s[d];y&&o[d].push(...y);break}case"enter":case"exit":{const y=s[d];y&&Object.assign(o[d],y);break}}}function CAe(o,s){throw o?new Error("Cannot close `"+o.type+"` ("+IQ({start:o.start,end:o.end})+"): a different token (`"+s.type+"`, "+IQ({start:s.start,end:s.end})+") is open"):new Error("Cannot close document, a token (`"+s.type+"`, "+IQ({start:s.start,end:s.end})+") is still open")}function WUn(o){const s=this;s.parser=d;function d(y){return zUn(y,{...s.data("settings"),...o,extensions:s.data("micromarkExtensions")||[],mdastExtensions:s.data("fromMarkdownExtensions")||[]})}}function KUn(o,s){const d={type:"element",tagName:"blockquote",properties:{},children:o.wrap(o.all(s),!0)};return o.patch(s,d),o.applyData(s,d)}function YUn(o,s){const d={type:"element",tagName:"br",properties:{},children:[]};return o.patch(s,d),[o.applyData(s,d),{type:"text",value:`
1920
+ `}]}function GUn(o,s){const d=s.value?s.value+`
1921
+ `:"",y={};s.lang&&(y.className=["language-"+s.lang]);let S={type:"element",tagName:"code",properties:y,children:[{type:"text",value:d}]};return s.meta&&(S.data={meta:s.meta}),o.patch(s,S),S=o.applyData(s,S),S={type:"element",tagName:"pre",properties:{},children:[S]},o.patch(s,S),S}function VUn(o,s){const d={type:"element",tagName:"del",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function XUn(o,s){const d={type:"element",tagName:"em",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function QUn(o,s){const d=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",y=String(s.identifier).toUpperCase(),S=r$(y.toLowerCase()),N=o.footnoteOrder.indexOf(y);let B,H=o.footnoteCounts.get(y);H===void 0?(H=0,o.footnoteOrder.push(y),B=o.footnoteOrder.length):B=N+1,H+=1,o.footnoteCounts.set(y,H);const et={type:"element",tagName:"a",properties:{href:"#"+d+"fn-"+S,id:d+"fnref-"+S+(H>1?"-"+H:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(B)}]};o.patch(s,et);const W={type:"element",tagName:"sup",properties:{},children:[et]};return o.patch(s,W),o.applyData(s,W)}function JUn(o,s){const d={type:"element",tagName:"h"+s.depth,properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function ZUn(o,s){if(o.options.allowDangerousHtml){const d={type:"raw",value:s.value};return o.patch(s,d),o.applyData(s,d)}}function tMe(o,s){const d=s.referenceType;let y="]";if(d==="collapsed"?y+="[]":d==="full"&&(y+="["+(s.label||s.identifier)+"]"),s.type==="imageReference")return[{type:"text",value:"!["+s.alt+y}];const S=o.all(s),N=S[0];N&&N.type==="text"?N.value="["+N.value:S.unshift({type:"text",value:"["});const B=S[S.length-1];return B&&B.type==="text"?B.value+=y:S.push({type:"text",value:y}),S}function tqn(o,s){const d=String(s.identifier).toUpperCase(),y=o.definitionById.get(d);if(!y)return tMe(o,s);const S={src:r$(y.url||""),alt:s.alt};y.title!==null&&y.title!==void 0&&(S.title=y.title);const N={type:"element",tagName:"img",properties:S,children:[]};return o.patch(s,N),o.applyData(s,N)}function eqn(o,s){const d={src:r$(s.url)};s.alt!==null&&s.alt!==void 0&&(d.alt=s.alt),s.title!==null&&s.title!==void 0&&(d.title=s.title);const y={type:"element",tagName:"img",properties:d,children:[]};return o.patch(s,y),o.applyData(s,y)}function nqn(o,s){const d={type:"text",value:s.value.replace(/\r?\n|\r/g," ")};o.patch(s,d);const y={type:"element",tagName:"code",properties:{},children:[d]};return o.patch(s,y),o.applyData(s,y)}function rqn(o,s){const d=String(s.identifier).toUpperCase(),y=o.definitionById.get(d);if(!y)return tMe(o,s);const S={href:r$(y.url||"")};y.title!==null&&y.title!==void 0&&(S.title=y.title);const N={type:"element",tagName:"a",properties:S,children:o.all(s)};return o.patch(s,N),o.applyData(s,N)}function iqn(o,s){const d={href:r$(s.url)};s.title!==null&&s.title!==void 0&&(d.title=s.title);const y={type:"element",tagName:"a",properties:d,children:o.all(s)};return o.patch(s,y),o.applyData(s,y)}function aqn(o,s,d){const y=o.all(s),S=d?sqn(d):eMe(s),N={},B=[];if(typeof s.checked=="boolean"){const nt=y[0];let K;nt&&nt.type==="element"&&nt.tagName==="p"?K=nt:(K={type:"element",tagName:"p",properties:{},children:[]},y.unshift(K)),K.children.length>0&&K.children.unshift({type:"text",value:" "}),K.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:s.checked,disabled:!0},children:[]}),N.className=["task-list-item"]}let H=-1;for(;++H<y.length;){const nt=y[H];(S||H!==0||nt.type!=="element"||nt.tagName!=="p")&&B.push({type:"text",value:`
1922
1922
  `}),nt.type==="element"&&nt.tagName==="p"&&!S?B.push(...nt.children):B.push(nt)}const et=y[y.length-1];et&&(S||et.type!=="element"||et.tagName!=="p")&&B.push({type:"text",value:`
1923
- `});const W={type:"element",tagName:"li",properties:N,children:B};return o.patch(s,W),o.applyData(s,W)}function iqn(o){let s=!1;if(o.type==="list"){s=o.spread||!1;const d=o.children;let y=-1;for(;!s&&++y<d.length;)s=eMe(d[y])}return s}function eMe(o){const s=o.spread;return s??o.children.length>1}function aqn(o,s){const d={},y=o.all(s);let S=-1;for(typeof s.start=="number"&&s.start!==1&&(d.start=s.start);++S<y.length;){const B=y[S];if(B.type==="element"&&B.tagName==="li"&&B.properties&&Array.isArray(B.properties.className)&&B.properties.className.includes("task-list-item")){d.className=["contains-task-list"];break}}const N={type:"element",tagName:s.ordered?"ol":"ul",properties:d,children:o.wrap(y,!0)};return o.patch(s,N),o.applyData(s,N)}function sqn(o,s){const d={type:"element",tagName:"p",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function oqn(o,s){const d={type:"root",children:o.wrap(o.all(s))};return o.patch(s,d),o.applyData(s,d)}function cqn(o,s){const d={type:"element",tagName:"strong",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function uqn(o,s){const d=o.all(s),y=d.shift(),S=[];if(y){const B={type:"element",tagName:"thead",properties:{},children:o.wrap([y],!0)};o.patch(s.children[0],B),S.push(B)}if(d.length>0){const B={type:"element",tagName:"tbody",properties:{},children:o.wrap(d,!0)},H=A6(s.children[1]),et=b2t(s.children[s.children.length-1]);H&&et&&(B.position={start:H,end:et}),S.push(B)}const N={type:"element",tagName:"table",properties:{},children:o.wrap(S,!0)};return o.patch(s,N),o.applyData(s,N)}function lqn(o,s,d){const y=d?d.children:void 0,N=(y?y.indexOf(s):1)===0?"th":"td",B=d&&d.type==="table"?d.align:void 0,H=B?B.length:s.children.length;let et=-1;const W=[];for(;++et<H;){const K=s.children[et],Q={},at=B?B[et]:void 0;at&&(Q.align=at);let mt={type:"element",tagName:N,properties:Q,children:[]};K&&(mt.children=o.all(K),o.patch(K,mt),mt=o.applyData(K,mt)),W.push(mt)}const nt={type:"element",tagName:"tr",properties:{},children:o.wrap(W,!0)};return o.patch(s,nt),o.applyData(s,nt)}function hqn(o,s){const d={type:"element",tagName:"td",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}const SAe=9,AAe=32;function fqn(o){const s=String(o),d=/\r?\n|\r/g;let y=d.exec(s),S=0;const N=[];for(;y;)N.push(IAe(s.slice(S,y.index),S>0,!0),y[0]),S=y.index+y[0].length,y=d.exec(s);return N.push(IAe(s.slice(S),S>0,!1)),N.join("")}function IAe(o,s,d){let y=0,S=o.length;if(s){let N=o.codePointAt(y);for(;N===SAe||N===AAe;)y++,N=o.codePointAt(y)}if(d){let N=o.codePointAt(S-1);for(;N===SAe||N===AAe;)S--,N=o.codePointAt(S-1)}return S>y?o.slice(y,S):""}function dqn(o,s){const d={type:"text",value:fqn(String(s.value))};return o.patch(s,d),o.applyData(s,d)}function pqn(o,s){const d={type:"element",tagName:"hr",properties:{},children:[]};return o.patch(s,d),o.applyData(s,d)}const gqn={blockquote:qUn,break:WUn,code:KUn,delete:YUn,emphasis:GUn,footnoteReference:VUn,heading:XUn,html:QUn,imageReference:JUn,image:ZUn,inlineCode:tqn,linkReference:eqn,link:nqn,listItem:rqn,list:aqn,paragraph:sqn,root:oqn,strong:cqn,table:uqn,tableCell:hqn,tableRow:lqn,text:dqn,thematicBreak:pqn,toml:Mbt,yaml:Mbt,definition:Mbt,footnoteDefinition:Mbt};function Mbt(){}const nMe=-1,y2t=0,NQ=1,Bmt=2,J$t=3,Z$t=4,tjt=5,ejt=6,rMe=7,iMe=8,OAe=typeof self=="object"?self:globalThis,bqn=(o,s)=>{const d=(S,N)=>(o.set(N,S),S),y=S=>{if(o.has(S))return o.get(S);const[N,B]=s[S];switch(N){case y2t:case nMe:return d(B,S);case NQ:{const H=d([],S);for(const et of B)H.push(y(et));return H}case Bmt:{const H=d({},S);for(const[et,W]of B)H[y(et)]=y(W);return H}case J$t:return d(new Date(B),S);case Z$t:{const{source:H,flags:et}=B;return d(new RegExp(H,et),S)}case tjt:{const H=d(new Map,S);for(const[et,W]of B)H.set(y(et),y(W));return H}case ejt:{const H=d(new Set,S);for(const et of B)H.add(y(et));return H}case rMe:{const{name:H,message:et}=B;return d(new OAe[H](et),S)}case iMe:return d(BigInt(B),S);case"BigInt":return d(Object(BigInt(B)),S);case"ArrayBuffer":return d(new Uint8Array(B).buffer,B);case"DataView":{const{buffer:H}=new Uint8Array(B);return d(new DataView(H),B)}}return d(new OAe[N](B),S)};return y},NAe=o=>bqn(new Map,o)(0),CF="",{toString:mqn}={},{keys:yqn}=Object,sQ=o=>{const s=typeof o;if(s!=="object"||!o)return[y2t,s];const d=mqn.call(o).slice(8,-1);switch(d){case"Array":return[NQ,CF];case"Object":return[Bmt,CF];case"Date":return[J$t,CF];case"RegExp":return[Z$t,CF];case"Map":return[tjt,CF];case"Set":return[ejt,CF];case"DataView":return[NQ,d]}return d.includes("Array")?[NQ,d]:d.includes("Error")?[rMe,d]:[Bmt,d]},Pbt=([o,s])=>o===y2t&&(s==="function"||s==="symbol"),wqn=(o,s,d,y)=>{const S=(B,H)=>{const et=y.push(B)-1;return d.set(H,et),et},N=B=>{if(d.has(B))return d.get(B);let[H,et]=sQ(B);switch(H){case y2t:{let nt=B;switch(et){case"bigint":H=iMe,nt=B.toString();break;case"function":case"symbol":if(o)throw new TypeError("unable to serialize "+et);nt=null;break;case"undefined":return S([nMe],B)}return S([H,nt],B)}case NQ:{if(et){let Q=B;return et==="DataView"?Q=new Uint8Array(B.buffer):et==="ArrayBuffer"&&(Q=new Uint8Array(B)),S([et,[...Q]],B)}const nt=[],K=S([H,nt],B);for(const Q of B)nt.push(N(Q));return K}case Bmt:{if(et)switch(et){case"BigInt":return S([et,B.toString()],B);case"Boolean":case"Number":case"String":return S([et,B.valueOf()],B)}if(s&&"toJSON"in B)return N(B.toJSON());const nt=[],K=S([H,nt],B);for(const Q of yqn(B))(o||!Pbt(sQ(B[Q])))&&nt.push([N(Q),N(B[Q])]);return K}case J$t:return S([H,B.toISOString()],B);case Z$t:{const{source:nt,flags:K}=B;return S([H,{source:nt,flags:K}],B)}case tjt:{const nt=[],K=S([H,nt],B);for(const[Q,at]of B)(o||!(Pbt(sQ(Q))||Pbt(sQ(at))))&&nt.push([N(Q),N(at)]);return K}case ejt:{const nt=[],K=S([H,nt],B);for(const Q of B)(o||!Pbt(sQ(Q)))&&nt.push(N(Q));return K}}const{message:W}=B;return S([H,{name:et,message:W}],B)};return N},LAe=(o,{json:s,lossy:d}={})=>{const y=[];return wqn(!(s||d),!!s,new Map,y)(o),y},KF=typeof structuredClone=="function"?(o,s)=>s&&("json"in s||"lossy"in s)?NAe(LAe(o,s)):structuredClone(o):(o,s)=>NAe(LAe(o,s));function vqn(o,s){const d=[{type:"text",value:"↩"}];return s>1&&d.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(s)}]}),d}function _qn(o,s){return"Back to reference "+(o+1)+(s>1?"-"+s:"")}function xqn(o){const s=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",d=o.options.footnoteBackContent||vqn,y=o.options.footnoteBackLabel||_qn,S=o.options.footnoteLabel||"Footnotes",N=o.options.footnoteLabelTagName||"h2",B=o.options.footnoteLabelProperties||{className:["sr-only"]},H=[];let et=-1;for(;++et<o.footnoteOrder.length;){const W=o.footnoteById.get(o.footnoteOrder[et]);if(!W)continue;const nt=o.all(W),K=String(W.identifier).toUpperCase(),Q=r$(K.toLowerCase());let at=0;const mt=[],Lt=o.footnoteCounts.get(K);for(;Lt!==void 0&&++at<=Lt;){mt.length>0&&mt.push({type:"text",value:" "});let ie=typeof d=="string"?d:d(et,at);typeof ie=="string"&&(ie={type:"text",value:ie}),mt.push({type:"element",tagName:"a",properties:{href:"#"+s+"fnref-"+Q+(at>1?"-"+at:""),dataFootnoteBackref:"",ariaLabel:typeof y=="string"?y:y(et,at),className:["data-footnote-backref"]},children:Array.isArray(ie)?ie:[ie]})}const Pt=nt[nt.length-1];if(Pt&&Pt.type==="element"&&Pt.tagName==="p"){const ie=Pt.children[Pt.children.length-1];ie&&ie.type==="text"?ie.value+=" ":Pt.children.push({type:"text",value:" "}),Pt.children.push(...mt)}else nt.push(...mt);const Mt={type:"element",tagName:"li",properties:{id:s+"fn-"+Q},children:o.wrap(nt,!0)};o.patch(W,Mt),H.push(Mt)}if(H.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:N,properties:{...KF(B),id:"footnote-label"},children:[{type:"text",value:S}]},{type:"text",value:`
1923
+ `});const W={type:"element",tagName:"li",properties:N,children:B};return o.patch(s,W),o.applyData(s,W)}function sqn(o){let s=!1;if(o.type==="list"){s=o.spread||!1;const d=o.children;let y=-1;for(;!s&&++y<d.length;)s=eMe(d[y])}return s}function eMe(o){const s=o.spread;return s??o.children.length>1}function oqn(o,s){const d={},y=o.all(s);let S=-1;for(typeof s.start=="number"&&s.start!==1&&(d.start=s.start);++S<y.length;){const B=y[S];if(B.type==="element"&&B.tagName==="li"&&B.properties&&Array.isArray(B.properties.className)&&B.properties.className.includes("task-list-item")){d.className=["contains-task-list"];break}}const N={type:"element",tagName:s.ordered?"ol":"ul",properties:d,children:o.wrap(y,!0)};return o.patch(s,N),o.applyData(s,N)}function cqn(o,s){const d={type:"element",tagName:"p",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function uqn(o,s){const d={type:"root",children:o.wrap(o.all(s))};return o.patch(s,d),o.applyData(s,d)}function lqn(o,s){const d={type:"element",tagName:"strong",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}function hqn(o,s){const d=o.all(s),y=d.shift(),S=[];if(y){const B={type:"element",tagName:"thead",properties:{},children:o.wrap([y],!0)};o.patch(s.children[0],B),S.push(B)}if(d.length>0){const B={type:"element",tagName:"tbody",properties:{},children:o.wrap(d,!0)},H=A6(s.children[1]),et=b2t(s.children[s.children.length-1]);H&&et&&(B.position={start:H,end:et}),S.push(B)}const N={type:"element",tagName:"table",properties:{},children:o.wrap(S,!0)};return o.patch(s,N),o.applyData(s,N)}function fqn(o,s,d){const y=d?d.children:void 0,N=(y?y.indexOf(s):1)===0?"th":"td",B=d&&d.type==="table"?d.align:void 0,H=B?B.length:s.children.length;let et=-1;const W=[];for(;++et<H;){const K=s.children[et],Q={},at=B?B[et]:void 0;at&&(Q.align=at);let mt={type:"element",tagName:N,properties:Q,children:[]};K&&(mt.children=o.all(K),o.patch(K,mt),mt=o.applyData(K,mt)),W.push(mt)}const nt={type:"element",tagName:"tr",properties:{},children:o.wrap(W,!0)};return o.patch(s,nt),o.applyData(s,nt)}function dqn(o,s){const d={type:"element",tagName:"td",properties:{},children:o.all(s)};return o.patch(s,d),o.applyData(s,d)}const SAe=9,AAe=32;function pqn(o){const s=String(o),d=/\r?\n|\r/g;let y=d.exec(s),S=0;const N=[];for(;y;)N.push(IAe(s.slice(S,y.index),S>0,!0),y[0]),S=y.index+y[0].length,y=d.exec(s);return N.push(IAe(s.slice(S),S>0,!1)),N.join("")}function IAe(o,s,d){let y=0,S=o.length;if(s){let N=o.codePointAt(y);for(;N===SAe||N===AAe;)y++,N=o.codePointAt(y)}if(d){let N=o.codePointAt(S-1);for(;N===SAe||N===AAe;)S--,N=o.codePointAt(S-1)}return S>y?o.slice(y,S):""}function gqn(o,s){const d={type:"text",value:pqn(String(s.value))};return o.patch(s,d),o.applyData(s,d)}function bqn(o,s){const d={type:"element",tagName:"hr",properties:{},children:[]};return o.patch(s,d),o.applyData(s,d)}const mqn={blockquote:KUn,break:YUn,code:GUn,delete:VUn,emphasis:XUn,footnoteReference:QUn,heading:JUn,html:ZUn,imageReference:tqn,image:eqn,inlineCode:nqn,linkReference:rqn,link:iqn,listItem:aqn,list:oqn,paragraph:cqn,root:uqn,strong:lqn,table:hqn,tableCell:dqn,tableRow:fqn,text:gqn,thematicBreak:bqn,toml:Mbt,yaml:Mbt,definition:Mbt,footnoteDefinition:Mbt};function Mbt(){}const nMe=-1,y2t=0,NQ=1,Bmt=2,J$t=3,Z$t=4,tjt=5,ejt=6,rMe=7,iMe=8,OAe=typeof self=="object"?self:globalThis,yqn=(o,s)=>{const d=(S,N)=>(o.set(N,S),S),y=S=>{if(o.has(S))return o.get(S);const[N,B]=s[S];switch(N){case y2t:case nMe:return d(B,S);case NQ:{const H=d([],S);for(const et of B)H.push(y(et));return H}case Bmt:{const H=d({},S);for(const[et,W]of B)H[y(et)]=y(W);return H}case J$t:return d(new Date(B),S);case Z$t:{const{source:H,flags:et}=B;return d(new RegExp(H,et),S)}case tjt:{const H=d(new Map,S);for(const[et,W]of B)H.set(y(et),y(W));return H}case ejt:{const H=d(new Set,S);for(const et of B)H.add(y(et));return H}case rMe:{const{name:H,message:et}=B;return d(new OAe[H](et),S)}case iMe:return d(BigInt(B),S);case"BigInt":return d(Object(BigInt(B)),S);case"ArrayBuffer":return d(new Uint8Array(B).buffer,B);case"DataView":{const{buffer:H}=new Uint8Array(B);return d(new DataView(H),B)}}return d(new OAe[N](B),S)};return y},NAe=o=>yqn(new Map,o)(0),CF="",{toString:wqn}={},{keys:vqn}=Object,sQ=o=>{const s=typeof o;if(s!=="object"||!o)return[y2t,s];const d=wqn.call(o).slice(8,-1);switch(d){case"Array":return[NQ,CF];case"Object":return[Bmt,CF];case"Date":return[J$t,CF];case"RegExp":return[Z$t,CF];case"Map":return[tjt,CF];case"Set":return[ejt,CF];case"DataView":return[NQ,d]}return d.includes("Array")?[NQ,d]:d.includes("Error")?[rMe,d]:[Bmt,d]},Pbt=([o,s])=>o===y2t&&(s==="function"||s==="symbol"),_qn=(o,s,d,y)=>{const S=(B,H)=>{const et=y.push(B)-1;return d.set(H,et),et},N=B=>{if(d.has(B))return d.get(B);let[H,et]=sQ(B);switch(H){case y2t:{let nt=B;switch(et){case"bigint":H=iMe,nt=B.toString();break;case"function":case"symbol":if(o)throw new TypeError("unable to serialize "+et);nt=null;break;case"undefined":return S([nMe],B)}return S([H,nt],B)}case NQ:{if(et){let Q=B;return et==="DataView"?Q=new Uint8Array(B.buffer):et==="ArrayBuffer"&&(Q=new Uint8Array(B)),S([et,[...Q]],B)}const nt=[],K=S([H,nt],B);for(const Q of B)nt.push(N(Q));return K}case Bmt:{if(et)switch(et){case"BigInt":return S([et,B.toString()],B);case"Boolean":case"Number":case"String":return S([et,B.valueOf()],B)}if(s&&"toJSON"in B)return N(B.toJSON());const nt=[],K=S([H,nt],B);for(const Q of vqn(B))(o||!Pbt(sQ(B[Q])))&&nt.push([N(Q),N(B[Q])]);return K}case J$t:return S([H,B.toISOString()],B);case Z$t:{const{source:nt,flags:K}=B;return S([H,{source:nt,flags:K}],B)}case tjt:{const nt=[],K=S([H,nt],B);for(const[Q,at]of B)(o||!(Pbt(sQ(Q))||Pbt(sQ(at))))&&nt.push([N(Q),N(at)]);return K}case ejt:{const nt=[],K=S([H,nt],B);for(const Q of B)(o||!Pbt(sQ(Q)))&&nt.push(N(Q));return K}}const{message:W}=B;return S([H,{name:et,message:W}],B)};return N},LAe=(o,{json:s,lossy:d}={})=>{const y=[];return _qn(!(s||d),!!s,new Map,y)(o),y},KF=typeof structuredClone=="function"?(o,s)=>s&&("json"in s||"lossy"in s)?NAe(LAe(o,s)):structuredClone(o):(o,s)=>NAe(LAe(o,s));function xqn(o,s){const d=[{type:"text",value:"↩"}];return s>1&&d.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(s)}]}),d}function Eqn(o,s){return"Back to reference "+(o+1)+(s>1?"-"+s:"")}function Tqn(o){const s=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",d=o.options.footnoteBackContent||xqn,y=o.options.footnoteBackLabel||Eqn,S=o.options.footnoteLabel||"Footnotes",N=o.options.footnoteLabelTagName||"h2",B=o.options.footnoteLabelProperties||{className:["sr-only"]},H=[];let et=-1;for(;++et<o.footnoteOrder.length;){const W=o.footnoteById.get(o.footnoteOrder[et]);if(!W)continue;const nt=o.all(W),K=String(W.identifier).toUpperCase(),Q=r$(K.toLowerCase());let at=0;const mt=[],Lt=o.footnoteCounts.get(K);for(;Lt!==void 0&&++at<=Lt;){mt.length>0&&mt.push({type:"text",value:" "});let ie=typeof d=="string"?d:d(et,at);typeof ie=="string"&&(ie={type:"text",value:ie}),mt.push({type:"element",tagName:"a",properties:{href:"#"+s+"fnref-"+Q+(at>1?"-"+at:""),dataFootnoteBackref:"",ariaLabel:typeof y=="string"?y:y(et,at),className:["data-footnote-backref"]},children:Array.isArray(ie)?ie:[ie]})}const Pt=nt[nt.length-1];if(Pt&&Pt.type==="element"&&Pt.tagName==="p"){const ie=Pt.children[Pt.children.length-1];ie&&ie.type==="text"?ie.value+=" ":Pt.children.push({type:"text",value:" "}),Pt.children.push(...mt)}else nt.push(...mt);const Mt={type:"element",tagName:"li",properties:{id:s+"fn-"+Q},children:o.wrap(nt,!0)};o.patch(W,Mt),H.push(Mt)}if(H.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:N,properties:{...KF(B),id:"footnote-label"},children:[{type:"text",value:S}]},{type:"text",value:`
1924
1924
  `},{type:"element",tagName:"ol",properties:{},children:o.wrap(H,!0)},{type:"text",value:`
1925
- `}]}}const aMe=function(o){if(o==null)return Cqn;if(typeof o=="function")return w2t(o);if(typeof o=="object")return Array.isArray(o)?Eqn(o):Tqn(o);if(typeof o=="string")return kqn(o);throw new Error("Expected function, string, or object as test")};function Eqn(o){const s=[];let d=-1;for(;++d<o.length;)s[d]=aMe(o[d]);return w2t(y);function y(...S){let N=-1;for(;++N<s.length;)if(s[N].apply(this,S))return!0;return!1}}function Tqn(o){const s=o;return w2t(d);function d(y){const S=y;let N;for(N in o)if(S[N]!==s[N])return!1;return!0}}function kqn(o){return w2t(s);function s(d){return d&&d.type===o}}function w2t(o){return s;function s(d,y,S){return!!(Sqn(d)&&o.call(this,d,typeof y=="number"?y:void 0,S||void 0))}}function Cqn(){return!0}function Sqn(o){return o!==null&&typeof o=="object"&&"type"in o}const sMe=[],Aqn=!0,MAe=!1,Iqn="skip";function Oqn(o,s,d,y){let S;typeof s=="function"&&typeof d!="function"?(y=d,d=s):S=s;const N=aMe(S),B=y?-1:1;H(o,void 0,[])();function H(et,W,nt){const K=et&&typeof et=="object"?et:{};if(typeof K.type=="string"){const at=typeof K.tagName=="string"?K.tagName:typeof K.name=="string"?K.name:void 0;Object.defineProperty(Q,"name",{value:"node ("+(et.type+(at?"<"+at+">":""))+")"})}return Q;function Q(){let at=sMe,mt,Lt,Pt;if((!s||N(et,W,nt[nt.length-1]||void 0))&&(at=Nqn(d(et,nt)),at[0]===MAe))return at;if("children"in et&&et.children){const Mt=et;if(Mt.children&&at[0]!==Iqn)for(Lt=(y?Mt.children.length:-1)+B,Pt=nt.concat(Mt);Lt>-1&&Lt<Mt.children.length;){const ie=Mt.children[Lt];if(mt=H(ie,Lt,Pt)(),mt[0]===MAe)return mt;Lt=typeof mt[1]=="number"?mt[1]:Lt+B}}return at}}}function Nqn(o){return Array.isArray(o)?o:typeof o=="number"?[Aqn,o]:o==null?sMe:[o]}function njt(o,s,d,y){let S,N,B;typeof s=="function"&&typeof d!="function"?(N=void 0,B=s,S=d):(N=s,B=d,S=y),Oqn(o,N,H,S);function H(et,W){const nt=W[W.length-1],K=nt?nt.children.indexOf(et):void 0;return B(et,K,nt)}}const RFt={}.hasOwnProperty,Lqn={};function Mqn(o,s){const d=s||Lqn,y=new Map,S=new Map,N=new Map,B={...gqn,...d.handlers},H={all:W,applyData:Rqn,definitionById:y,footnoteById:S,footnoteCounts:N,footnoteOrder:[],handlers:B,one:et,options:d,patch:Pqn,wrap:Bqn};return njt(o,function(nt){if(nt.type==="definition"||nt.type==="footnoteDefinition"){const K=nt.type==="definition"?y:S,Q=String(nt.identifier).toUpperCase();K.has(Q)||K.set(Q,nt)}}),H;function et(nt,K){const Q=nt.type,at=H.handlers[Q];if(RFt.call(H.handlers,Q)&&at)return at(H,nt,K);if(H.options.passThrough&&H.options.passThrough.includes(Q)){if("children"in nt){const{children:Lt,...Pt}=nt,Mt=KF(Pt);return Mt.children=H.all(nt),Mt}return KF(nt)}return(H.options.unknownHandler||Dqn)(H,nt,K)}function W(nt){const K=[];if("children"in nt){const Q=nt.children;let at=-1;for(;++at<Q.length;){const mt=H.one(Q[at],nt);if(mt){if(at&&Q[at-1].type==="break"&&(!Array.isArray(mt)&&mt.type==="text"&&(mt.value=PAe(mt.value)),!Array.isArray(mt)&&mt.type==="element")){const Lt=mt.children[0];Lt&&Lt.type==="text"&&(Lt.value=PAe(Lt.value))}Array.isArray(mt)?K.push(...mt):K.push(mt)}}}return K}}function Pqn(o,s){o.position&&(s.position=mHn(o))}function Rqn(o,s){let d=s;if(o&&o.data){const y=o.data.hName,S=o.data.hChildren,N=o.data.hProperties;if(typeof y=="string")if(d.type==="element")d.tagName=y;else{const B="children"in d?d.children:[d];d={type:"element",tagName:y,properties:{},children:B}}d.type==="element"&&N&&Object.assign(d.properties,KF(N)),"children"in d&&d.children&&S!==null&&S!==void 0&&(d.children=S)}return d}function Dqn(o,s){const d=s.data||{},y="value"in s&&!(RFt.call(d,"hProperties")||RFt.call(d,"hChildren"))?{type:"text",value:s.value}:{type:"element",tagName:"div",properties:{},children:o.all(s)};return o.patch(s,y),o.applyData(s,y)}function Bqn(o,s){const d=[];let y=-1;for(s&&d.push({type:"text",value:`
1925
+ `}]}}const aMe=function(o){if(o==null)return Aqn;if(typeof o=="function")return w2t(o);if(typeof o=="object")return Array.isArray(o)?kqn(o):Cqn(o);if(typeof o=="string")return Sqn(o);throw new Error("Expected function, string, or object as test")};function kqn(o){const s=[];let d=-1;for(;++d<o.length;)s[d]=aMe(o[d]);return w2t(y);function y(...S){let N=-1;for(;++N<s.length;)if(s[N].apply(this,S))return!0;return!1}}function Cqn(o){const s=o;return w2t(d);function d(y){const S=y;let N;for(N in o)if(S[N]!==s[N])return!1;return!0}}function Sqn(o){return w2t(s);function s(d){return d&&d.type===o}}function w2t(o){return s;function s(d,y,S){return!!(Iqn(d)&&o.call(this,d,typeof y=="number"?y:void 0,S||void 0))}}function Aqn(){return!0}function Iqn(o){return o!==null&&typeof o=="object"&&"type"in o}const sMe=[],Oqn=!0,MAe=!1,Nqn="skip";function Lqn(o,s,d,y){let S;typeof s=="function"&&typeof d!="function"?(y=d,d=s):S=s;const N=aMe(S),B=y?-1:1;H(o,void 0,[])();function H(et,W,nt){const K=et&&typeof et=="object"?et:{};if(typeof K.type=="string"){const at=typeof K.tagName=="string"?K.tagName:typeof K.name=="string"?K.name:void 0;Object.defineProperty(Q,"name",{value:"node ("+(et.type+(at?"<"+at+">":""))+")"})}return Q;function Q(){let at=sMe,mt,Lt,Pt;if((!s||N(et,W,nt[nt.length-1]||void 0))&&(at=Mqn(d(et,nt)),at[0]===MAe))return at;if("children"in et&&et.children){const Mt=et;if(Mt.children&&at[0]!==Nqn)for(Lt=(y?Mt.children.length:-1)+B,Pt=nt.concat(Mt);Lt>-1&&Lt<Mt.children.length;){const ie=Mt.children[Lt];if(mt=H(ie,Lt,Pt)(),mt[0]===MAe)return mt;Lt=typeof mt[1]=="number"?mt[1]:Lt+B}}return at}}}function Mqn(o){return Array.isArray(o)?o:typeof o=="number"?[Oqn,o]:o==null?sMe:[o]}function njt(o,s,d,y){let S,N,B;typeof s=="function"&&typeof d!="function"?(N=void 0,B=s,S=d):(N=s,B=d,S=y),Lqn(o,N,H,S);function H(et,W){const nt=W[W.length-1],K=nt?nt.children.indexOf(et):void 0;return B(et,K,nt)}}const RFt={}.hasOwnProperty,Pqn={};function Rqn(o,s){const d=s||Pqn,y=new Map,S=new Map,N=new Map,B={...mqn,...d.handlers},H={all:W,applyData:Bqn,definitionById:y,footnoteById:S,footnoteCounts:N,footnoteOrder:[],handlers:B,one:et,options:d,patch:Dqn,wrap:$qn};return njt(o,function(nt){if(nt.type==="definition"||nt.type==="footnoteDefinition"){const K=nt.type==="definition"?y:S,Q=String(nt.identifier).toUpperCase();K.has(Q)||K.set(Q,nt)}}),H;function et(nt,K){const Q=nt.type,at=H.handlers[Q];if(RFt.call(H.handlers,Q)&&at)return at(H,nt,K);if(H.options.passThrough&&H.options.passThrough.includes(Q)){if("children"in nt){const{children:Lt,...Pt}=nt,Mt=KF(Pt);return Mt.children=H.all(nt),Mt}return KF(nt)}return(H.options.unknownHandler||Fqn)(H,nt,K)}function W(nt){const K=[];if("children"in nt){const Q=nt.children;let at=-1;for(;++at<Q.length;){const mt=H.one(Q[at],nt);if(mt){if(at&&Q[at-1].type==="break"&&(!Array.isArray(mt)&&mt.type==="text"&&(mt.value=PAe(mt.value)),!Array.isArray(mt)&&mt.type==="element")){const Lt=mt.children[0];Lt&&Lt.type==="text"&&(Lt.value=PAe(Lt.value))}Array.isArray(mt)?K.push(...mt):K.push(mt)}}}return K}}function Dqn(o,s){o.position&&(s.position=wHn(o))}function Bqn(o,s){let d=s;if(o&&o.data){const y=o.data.hName,S=o.data.hChildren,N=o.data.hProperties;if(typeof y=="string")if(d.type==="element")d.tagName=y;else{const B="children"in d?d.children:[d];d={type:"element",tagName:y,properties:{},children:B}}d.type==="element"&&N&&Object.assign(d.properties,KF(N)),"children"in d&&d.children&&S!==null&&S!==void 0&&(d.children=S)}return d}function Fqn(o,s){const d=s.data||{},y="value"in s&&!(RFt.call(d,"hProperties")||RFt.call(d,"hChildren"))?{type:"text",value:s.value}:{type:"element",tagName:"div",properties:{},children:o.all(s)};return o.patch(s,y),o.applyData(s,y)}function $qn(o,s){const d=[];let y=-1;for(s&&d.push({type:"text",value:`
1926
1926
  `});++y<o.length;)y&&d.push({type:"text",value:`
1927
1927
  `}),d.push(o[y]);return s&&o.length>0&&d.push({type:"text",value:`
1928
- `}),d}function PAe(o){let s=0,d=o.charCodeAt(s);for(;d===9||d===32;)s++,d=o.charCodeAt(s);return o.slice(s)}function RAe(o,s){const d=Mqn(o,s),y=d.one(o,void 0),S=xqn(d),N=Array.isArray(y)?{type:"root",children:y}:y||{type:"root",children:[]};return S&&N.children.push({type:"text",value:`
1929
- `},S),N}function Fqn(o,s){return o&&"run"in o?async function(d,y){const S=RAe(d,{file:y,...s});await o.run(S,y)}:function(d,y){return RAe(d,{file:y,...o||s})}}function DAe(o){if(o)throw o}var tmt=Object.prototype.hasOwnProperty,oMe=Object.prototype.toString,BAe=Object.defineProperty,FAe=Object.getOwnPropertyDescriptor,$Ae=function(s){return typeof Array.isArray=="function"?Array.isArray(s):oMe.call(s)==="[object Array]"},jAe=function(s){if(!s||oMe.call(s)!=="[object Object]")return!1;var d=tmt.call(s,"constructor"),y=s.constructor&&s.constructor.prototype&&tmt.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!d&&!y)return!1;var S;for(S in s);return typeof S>"u"||tmt.call(s,S)},HAe=function(s,d){BAe&&d.name==="__proto__"?BAe(s,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):s[d.name]=d.newValue},zAe=function(s,d){if(d==="__proto__")if(tmt.call(s,d)){if(FAe)return FAe(s,d).value}else return;return s[d]},$qn=function o(){var s,d,y,S,N,B,H=arguments[0],et=1,W=arguments.length,nt=!1;for(typeof H=="boolean"&&(nt=H,H=arguments[1]||{},et=2),(H==null||typeof H!="object"&&typeof H!="function")&&(H={});et<W;++et)if(s=arguments[et],s!=null)for(d in s)y=zAe(H,d),S=zAe(s,d),H!==S&&(nt&&S&&(jAe(S)||(N=$Ae(S)))?(N?(N=!1,B=y&&$Ae(y)?y:[]):B=y&&jAe(y)?y:{},HAe(H,{name:d,newValue:o(nt,B,S)})):typeof S<"u"&&HAe(H,{name:d,newValue:S}));return H};const gBt=OIe($qn);function DFt(o){if(typeof o!="object"||o===null)return!1;const s=Object.getPrototypeOf(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)}function jqn(){const o=[],s={run:d,use:y};return s;function d(...S){let N=-1;const B=S.pop();if(typeof B!="function")throw new TypeError("Expected function as last argument, not "+B);H(null,...S);function H(et,...W){const nt=o[++N];let K=-1;if(et){B(et);return}for(;++K<S.length;)(W[K]===null||W[K]===void 0)&&(W[K]=S[K]);S=W,nt?Hqn(nt,H)(...W):B(null,...W)}}function y(S){if(typeof S!="function")throw new TypeError("Expected `middelware` to be a function, not "+S);return o.push(S),s}}function Hqn(o,s){let d;return y;function y(...B){const H=o.length>B.length;let et;H&&B.push(S);try{et=o.apply(this,B)}catch(W){const nt=W;if(H&&d)throw nt;return S(nt)}H||(et&&et.then&&typeof et.then=="function"?et.then(N,S):et instanceof Error?S(et):N(et))}function S(B,...H){d||(d=!0,s(B,...H))}function N(B){S(null,B)}}const m6={basename:zqn,dirname:Uqn,extname:qqn,join:Wqn,sep:"/"};function zqn(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');rJ(o);let d=0,y=-1,S=o.length,N;if(s===void 0||s.length===0||s.length>o.length){for(;S--;)if(o.codePointAt(S)===47){if(N){d=S+1;break}}else y<0&&(N=!0,y=S+1);return y<0?"":o.slice(d,y)}if(s===o)return"";let B=-1,H=s.length-1;for(;S--;)if(o.codePointAt(S)===47){if(N){d=S+1;break}}else B<0&&(N=!0,B=S+1),H>-1&&(o.codePointAt(S)===s.codePointAt(H--)?H<0&&(y=S):(H=-1,y=B));return d===y?y=B:y<0&&(y=o.length),o.slice(d,y)}function Uqn(o){if(rJ(o),o.length===0)return".";let s=-1,d=o.length,y;for(;--d;)if(o.codePointAt(d)===47){if(y){s=d;break}}else y||(y=!0);return s<0?o.codePointAt(0)===47?"/":".":s===1&&o.codePointAt(0)===47?"//":o.slice(0,s)}function qqn(o){rJ(o);let s=o.length,d=-1,y=0,S=-1,N=0,B;for(;s--;){const H=o.codePointAt(s);if(H===47){if(B){y=s+1;break}continue}d<0&&(B=!0,d=s+1),H===46?S<0?S=s:N!==1&&(N=1):S>-1&&(N=-1)}return S<0||d<0||N===0||N===1&&S===d-1&&S===y+1?"":o.slice(S,d)}function Wqn(...o){let s=-1,d;for(;++s<o.length;)rJ(o[s]),o[s]&&(d=d===void 0?o[s]:d+"/"+o[s]);return d===void 0?".":Kqn(d)}function Kqn(o){rJ(o);const s=o.codePointAt(0)===47;let d=Yqn(o,!s);return d.length===0&&!s&&(d="."),d.length>0&&o.codePointAt(o.length-1)===47&&(d+="/"),s?"/"+d:d}function Yqn(o,s){let d="",y=0,S=-1,N=0,B=-1,H,et;for(;++B<=o.length;){if(B<o.length)H=o.codePointAt(B);else{if(H===47)break;H=47}if(H===47){if(!(S===B-1||N===1))if(S!==B-1&&N===2){if(d.length<2||y!==2||d.codePointAt(d.length-1)!==46||d.codePointAt(d.length-2)!==46){if(d.length>2){if(et=d.lastIndexOf("/"),et!==d.length-1){et<0?(d="",y=0):(d=d.slice(0,et),y=d.length-1-d.lastIndexOf("/")),S=B,N=0;continue}}else if(d.length>0){d="",y=0,S=B,N=0;continue}}s&&(d=d.length>0?d+"/..":"..",y=2)}else d.length>0?d+="/"+o.slice(S+1,B):d=o.slice(S+1,B),y=B-S-1;S=B,N=0}else H===46&&N>-1?N++:N=-1}return d}function rJ(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}const Gqn={cwd:Vqn};function Vqn(){return"/"}function BFt(o){return!!(o!==null&&typeof o=="object"&&"href"in o&&o.href&&"protocol"in o&&o.protocol&&o.auth===void 0)}function Xqn(o){if(typeof o=="string")o=new URL(o);else if(!BFt(o)){const s=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+o+"`");throw s.code="ERR_INVALID_ARG_TYPE",s}if(o.protocol!=="file:"){const s=new TypeError("The URL must be of scheme file");throw s.code="ERR_INVALID_URL_SCHEME",s}return Qqn(o)}function Qqn(o){if(o.hostname!==""){const y=new TypeError('File URL host must be "localhost" or empty on darwin');throw y.code="ERR_INVALID_FILE_URL_HOST",y}const s=o.pathname;let d=-1;for(;++d<s.length;)if(s.codePointAt(d)===37&&s.codePointAt(d+1)===50){const y=s.codePointAt(d+2);if(y===70||y===102){const S=new TypeError("File URL path must not include encoded / characters");throw S.code="ERR_INVALID_FILE_URL_PATH",S}}return decodeURIComponent(s)}const bBt=["history","path","basename","stem","extname","dirname"];class cMe{constructor(s){let d;s?BFt(s)?d={path:s}:typeof s=="string"||Jqn(s)?d={value:s}:d=s:d={},this.cwd="cwd"in d?"":Gqn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let y=-1;for(;++y<bBt.length;){const N=bBt[y];N in d&&d[N]!==void 0&&d[N]!==null&&(this[N]=N==="history"?[...d[N]]:d[N])}let S;for(S in d)bBt.includes(S)||(this[S]=d[S])}get basename(){return typeof this.path=="string"?m6.basename(this.path):void 0}set basename(s){yBt(s,"basename"),mBt(s,"basename"),this.path=m6.join(this.dirname||"",s)}get dirname(){return typeof this.path=="string"?m6.dirname(this.path):void 0}set dirname(s){UAe(this.basename,"dirname"),this.path=m6.join(s||"",this.basename)}get extname(){return typeof this.path=="string"?m6.extname(this.path):void 0}set extname(s){if(mBt(s,"extname"),UAe(this.dirname,"extname"),s){if(s.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(s.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=m6.join(this.dirname,this.stem+(s||""))}get path(){return this.history[this.history.length-1]}set path(s){BFt(s)&&(s=Xqn(s)),yBt(s,"path"),this.path!==s&&this.history.push(s)}get stem(){return typeof this.path=="string"?m6.basename(this.path,this.extname):void 0}set stem(s){yBt(s,"stem"),mBt(s,"stem"),this.path=m6.join(this.dirname||"",s+(this.extname||""))}fail(s,d,y){const S=this.message(s,d,y);throw S.fatal=!0,S}info(s,d,y){const S=this.message(s,d,y);return S.fatal=void 0,S}message(s,d,y){const S=new Eb(s,d,y);return this.path&&(S.name=this.path+":"+S.name,S.file=this.path),S.fatal=!1,this.messages.push(S),S}toString(s){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(s||void 0).decode(this.value)}}function mBt(o,s){if(o&&o.includes(m6.sep))throw new Error("`"+s+"` cannot be a path: did not expect `"+m6.sep+"`")}function yBt(o,s){if(!o)throw new Error("`"+s+"` cannot be empty")}function UAe(o,s){if(!o)throw new Error("Setting `"+s+"` requires `path` to be set too")}function Jqn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const Zqn=function(o){const y=this.constructor.prototype,S=y[o],N=function(){return S.apply(N,arguments)};return Object.setPrototypeOf(N,y),N},tWn={}.hasOwnProperty;class rjt extends Zqn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=jqn()}copy(){const s=new rjt;let d=-1;for(;++d<this.attachers.length;){const y=this.attachers[d];s.use(...y)}return s.data(gBt(!0,{},this.namespace)),s}data(s,d){return typeof s=="string"?arguments.length===2?(_Bt("data",this.frozen),this.namespace[s]=d,this):tWn.call(this.namespace,s)&&this.namespace[s]||void 0:s?(_Bt("data",this.frozen),this.namespace=s,this):this.namespace}freeze(){if(this.frozen)return this;const s=this;for(;++this.freezeIndex<this.attachers.length;){const[d,...y]=this.attachers[this.freezeIndex];if(y[0]===!1)continue;y[0]===!0&&(y[0]=void 0);const S=d.call(s,...y);typeof S=="function"&&this.transformers.use(S)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(s){this.freeze();const d=Rbt(s),y=this.parser||this.Parser;return wBt("parse",y),y(String(d),d)}process(s,d){const y=this;return this.freeze(),wBt("process",this.parser||this.Parser),vBt("process",this.compiler||this.Compiler),d?S(void 0,d):new Promise(S);function S(N,B){const H=Rbt(s),et=y.parse(H);y.run(et,H,function(nt,K,Q){if(nt||!K||!Q)return W(nt);const at=K,mt=y.stringify(at,Q);rWn(mt)?Q.value=mt:Q.result=mt,W(nt,Q)});function W(nt,K){nt||!K?B(nt):N?N(K):d(void 0,K)}}}processSync(s){let d=!1,y;return this.freeze(),wBt("processSync",this.parser||this.Parser),vBt("processSync",this.compiler||this.Compiler),this.process(s,S),WAe("processSync","process",d),y;function S(N,B){d=!0,DAe(N),y=B}}run(s,d,y){qAe(s),this.freeze();const S=this.transformers;return!y&&typeof d=="function"&&(y=d,d=void 0),y?N(void 0,y):new Promise(N);function N(B,H){const et=Rbt(d);S.run(s,et,W);function W(nt,K,Q){const at=K||s;nt?H(nt):B?B(at):y(void 0,at,Q)}}}runSync(s,d){let y=!1,S;return this.run(s,d,N),WAe("runSync","run",y),S;function N(B,H){DAe(B),S=H,y=!0}}stringify(s,d){this.freeze();const y=Rbt(d),S=this.compiler||this.Compiler;return vBt("stringify",S),qAe(s),S(s,y)}use(s,...d){const y=this.attachers,S=this.namespace;if(_Bt("use",this.frozen),s!=null)if(typeof s=="function")et(s,d);else if(typeof s=="object")Array.isArray(s)?H(s):B(s);else throw new TypeError("Expected usable value, not `"+s+"`");return this;function N(W){if(typeof W=="function")et(W,[]);else if(typeof W=="object")if(Array.isArray(W)){const[nt,...K]=W;et(nt,K)}else B(W);else throw new TypeError("Expected usable value, not `"+W+"`")}function B(W){if(!("plugins"in W)&&!("settings"in W))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");H(W.plugins),W.settings&&(S.settings=gBt(!0,S.settings,W.settings))}function H(W){let nt=-1;if(W!=null)if(Array.isArray(W))for(;++nt<W.length;){const K=W[nt];N(K)}else throw new TypeError("Expected a list of plugins, not `"+W+"`")}function et(W,nt){let K=-1,Q=-1;for(;++K<y.length;)if(y[K][0]===W){Q=K;break}if(Q===-1)y.push([W,...nt]);else if(nt.length>0){let[at,...mt]=nt;const Lt=y[Q][1];DFt(Lt)&&DFt(at)&&(at=gBt(!0,Lt,at)),y[Q]=[W,at,...mt]}}}}const eWn=new rjt().freeze();function wBt(o,s){if(typeof s!="function")throw new TypeError("Cannot `"+o+"` without `parser`")}function vBt(o,s){if(typeof s!="function")throw new TypeError("Cannot `"+o+"` without `compiler`")}function _Bt(o,s){if(s)throw new Error("Cannot call `"+o+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qAe(o){if(!DFt(o)||typeof o.type!="string")throw new TypeError("Expected node, got `"+o+"`")}function WAe(o,s,d){if(!d)throw new Error("`"+o+"` finished async. Use `"+s+"` instead")}function Rbt(o){return nWn(o)?o:new cMe(o)}function nWn(o){return!!(o&&typeof o=="object"&&"message"in o&&"messages"in o)}function rWn(o){return typeof o=="string"||iWn(o)}function iWn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const aWn="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",KAe=[],YAe={allowDangerousHtml:!0},sWn=/^(https?|ircs?|mailto|xmpp)$/i,oWn=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cWn(o){const s=uWn(o),d=lWn(o);return hWn(s.runSync(s.parse(d),d),o)}function uWn(o){const s=o.rehypePlugins||KAe,d=o.remarkPlugins||KAe,y=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...YAe}:YAe;return eWn().use(UUn).use(d).use(Fqn,y).use(s)}function lWn(o){const s=o.children||"",d=new cMe;return typeof s=="string"&&(d.value=s),d}function hWn(o,s){const d=s.allowedElements,y=s.allowElement,S=s.components,N=s.disallowedElements,B=s.skipHtml,H=s.unwrapDisallowed,et=s.urlTransform||fWn;for(const nt of oWn)Object.hasOwn(s,nt.from)&&(""+nt.from+(nt.to?"use `"+nt.to+"` instead":"remove it")+aWn+nt.id,void 0);return s.className&&(o={type:"element",tagName:"div",properties:{className:s.className},children:o.type==="root"?o.children:[o]}),njt(o,W),xHn(o,{Fragment:pe.Fragment,components:S,ignoreInvalidStyle:!0,jsx:pe.jsx,jsxs:pe.jsxs,passKeys:!0,passNode:!0});function W(nt,K,Q){if(nt.type==="raw"&&Q&&typeof K=="number")return B?Q.children.splice(K,1):Q.children[K]={type:"text",value:nt.value},K;if(nt.type==="element"){let at;for(at in fBt)if(Object.hasOwn(fBt,at)&&Object.hasOwn(nt.properties,at)){const mt=nt.properties[at],Lt=fBt[at];(Lt===null||Lt.includes(nt.tagName))&&(nt.properties[at]=et(String(mt||""),at,nt))}}if(nt.type==="element"){let at=d?!d.includes(nt.tagName):N?N.includes(nt.tagName):!1;if(!at&&y&&typeof K=="number"&&(at=!y(nt,K,Q)),at&&Q&&typeof K=="number")return H&&nt.children?Q.children.splice(K,1,...nt.children):Q.children.splice(K,1),K}}}function fWn(o){const s=o.indexOf(":"),d=o.indexOf("?"),y=o.indexOf("#"),S=o.indexOf("/");return s===-1||S!==-1&&s>S||d!==-1&&s>d||y!==-1&&s>y||sWn.test(o.slice(0,s))?o:""}const GAe=/[#.]/g;function dWn(o,s){const d=o||"",y={};let S=0,N,B;for(;S<d.length;){GAe.lastIndex=S;const H=GAe.exec(d),et=d.slice(S,H?H.index:d.length);et&&(N?N==="#"?y.id=et:Array.isArray(y.className)?y.className.push(et):y.className=[et]:B=et,S+=et.length),H&&(N=H[0],S++)}return{type:"element",tagName:B||s||"div",properties:y,children:[]}}function uMe(o,s,d){const y=d?mWn(d):void 0;function S(N,B,...H){let et;if(N==null){et={type:"root",children:[]};const W=B;H.unshift(W)}else{et=dWn(N,s);const W=et.tagName.toLowerCase(),nt=y?y.get(W):void 0;if(et.tagName=nt||W,pWn(B))H.unshift(B);else for(const[K,Q]of Object.entries(B))gWn(o,et.properties,K,Q)}for(const W of H)FFt(et.children,W);return et.type==="element"&&et.tagName==="template"&&(et.content={type:"root",children:et.children},et.children=[]),et}return S}function pWn(o){if(o===null||typeof o!="object"||Array.isArray(o))return!0;if(typeof o.type!="string")return!1;const s=o,d=Object.keys(o);for(const y of d){const S=s[y];if(S&&typeof S=="object"){if(!Array.isArray(S))return!0;const N=S;for(const B of N)if(typeof B!="number"&&typeof B!="string")return!0}}return!!("children"in o&&Array.isArray(o.children))}function gWn(o,s,d,y){const S=p2t(o,d);let N;if(y!=null){if(typeof y=="number"){if(Number.isNaN(y))return;N=y}else typeof y=="boolean"?N=y:typeof y=="string"?S.spaceSeparated?N=oAe(y):S.commaSeparated?N=nAe(y):S.commaOrSpaceSeparated?N=oAe(nAe(y).join(" ")):N=VAe(S,S.property,y):Array.isArray(y)?N=[...y]:N=S.property==="style"?bWn(y):String(y);if(Array.isArray(N)){const B=[];for(const H of N)B.push(VAe(S,S.property,H));N=B}S.property==="className"&&Array.isArray(s.className)&&(N=s.className.concat(N)),s[S.property]=N}}function FFt(o,s){if(s!=null)if(typeof s=="number"||typeof s=="string")o.push({type:"text",value:String(s)});else if(Array.isArray(s))for(const d of s)FFt(o,d);else if(typeof s=="object"&&"type"in s)s.type==="root"?FFt(o,s.children):o.push(s);else throw new Error("Expected node, nodes, or string, got `"+s+"`")}function VAe(o,s,d){if(typeof d=="string"){if(o.number&&d&&!Number.isNaN(Number(d)))return Number(d);if((o.boolean||o.overloadedBoolean)&&(d===""||WQ(d)===WQ(s)))return!0}return d}function bWn(o){const s=[];for(const[d,y]of Object.entries(o))s.push([d,y].join(": "));return s.join("; ")}function mWn(o){const s=new Map;for(const d of o)s.set(d.toLowerCase(),d);return s}const yWn=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],wWn=uMe(nJ,"div"),vWn=uMe(c7,"g",yWn);function _Wn(o){const s=String(o),d=[];return{toOffset:S,toPoint:y};function y(N){if(typeof N=="number"&&N>-1&&N<=s.length){let B=0;for(;;){let H=d[B];if(H===void 0){const et=XAe(s,d[B-1]);H=et===-1?s.length+1:et+1,d[B]=H}if(H>N)return{line:B+1,column:N-(B>0?d[B-1]:0)+1,offset:N};B++}}}function S(N){if(N&&typeof N.line=="number"&&typeof N.column=="number"&&!Number.isNaN(N.line)&&!Number.isNaN(N.column)){for(;d.length<N.line;){const H=d[d.length-1],et=XAe(s,H),W=et===-1?s.length+1:et+1;if(H===W)break;d.push(W)}const B=(N.line>1?d[N.line-2]:0)+N.column-1;if(B<d[N.line-1])return B}}}function XAe(o,s){const d=o.indexOf("\r",s),y=o.indexOf(`
1930
- `,s);return y===-1?d:d===-1||d+1===y?y:d<y?d:y}const tL={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},lMe={}.hasOwnProperty,xWn=Object.prototype;function EWn(o,s){const d=s||{};return ijt({file:d.file||void 0,location:!1,schema:d.space==="svg"?c7:nJ,verbose:d.verbose||!1},o)}function ijt(o,s){let d;switch(s.nodeName){case"#comment":{const y=s;return d={type:"comment",value:y.data},emt(o,y,d),d}case"#document":case"#document-fragment":{const y=s,S="mode"in y?y.mode==="quirks"||y.mode==="limited-quirks":!1;if(d={type:"root",children:hMe(o,s.childNodes),data:{quirksMode:S}},o.file&&o.location){const N=String(o.file),B=_Wn(N),H=B.toPoint(0),et=B.toPoint(N.length);d.position={start:H,end:et}}return d}case"#documentType":{const y=s;return d={type:"doctype"},emt(o,y,d),d}case"#text":{const y=s;return d={type:"text",value:y.value},emt(o,y,d),d}default:return d=TWn(o,s),d}}function hMe(o,s){let d=-1;const y=[];for(;++d<s.length;){const S=ijt(o,s[d]);y.push(S)}return y}function TWn(o,s){const d=o.schema;o.schema=s.namespaceURI===tL.svg?c7:nJ;let y=-1;const S={};for(;++y<s.attrs.length;){const H=s.attrs[y],et=(H.prefix?H.prefix+":":"")+H.name;lMe.call(xWn,et)||(S[et]=H.value)}const B=(o.schema.space==="svg"?vWn:wWn)(s.tagName,S,hMe(o,s.childNodes));if(emt(o,s,B),B.tagName==="template"){const H=s,et=H.sourceCodeLocation,W=et&&et.startTag&&MF(et.startTag),nt=et&&et.endTag&&MF(et.endTag),K=ijt(o,H.content);W&&nt&&o.file&&(K.position={start:W.end,end:nt.start}),B.content=K}return o.schema=d,B}function emt(o,s,d){if("sourceCodeLocation"in s&&s.sourceCodeLocation&&o.file){const y=kWn(o,d,s.sourceCodeLocation);y&&(o.location=!0,d.position=y)}}function kWn(o,s,d){const y=MF(d);if(s.type==="element"){const S=s.children[s.children.length-1];if(y&&!d.endTag&&S&&S.position&&S.position.end&&(y.end=Object.assign({},S.position.end)),o.verbose){const N={};let B;if(d.attrs)for(B in d.attrs)lMe.call(d.attrs,B)&&(N[p2t(o.schema,B).property]=MF(d.attrs[B]));d.startTag;const H=MF(d.startTag),et=d.endTag?MF(d.endTag):void 0,W={opening:H};et&&(W.closing=et),W.properties=N,s.data={position:W}}}return y}function MF(o){const s=QAe({line:o.startLine,column:o.startCol,offset:o.startOffset}),d=QAe({line:o.endLine,column:o.endCol,offset:o.endOffset});return s||d?{start:s,end:d}:void 0}function QAe(o){return o.line&&o.column?o:void 0}class iJ{constructor(s,d,y){this.property=s,this.normal=d,y&&(this.space=y)}}iJ.prototype.property={};iJ.prototype.normal={};iJ.prototype.space=null;function fMe(o,s){const d={},y={};let S=-1;for(;++S<o.length;)Object.assign(d,o[S].property),Object.assign(y,o[S].normal);return new iJ(d,y,s)}function $Ft(o){return o.toLowerCase()}class L3{constructor(s,d){this.property=s,this.attribute=d}}L3.prototype.space=null;L3.prototype.boolean=!1;L3.prototype.booleanish=!1;L3.prototype.overloadedBoolean=!1;L3.prototype.number=!1;L3.prototype.commaSeparated=!1;L3.prototype.spaceSeparated=!1;L3.prototype.commaOrSpaceSeparated=!1;L3.prototype.mustUseProperty=!1;L3.prototype.defined=!1;let CWn=0;const jc=hL(),c0=hL(),dMe=hL(),ha=hL(),af=hL(),DF=hL(),Ew=hL();function hL(){return 2**++CWn}const jFt=Object.freeze(Object.defineProperty({__proto__:null,boolean:jc,booleanish:c0,commaOrSpaceSeparated:Ew,commaSeparated:DF,number:ha,overloadedBoolean:dMe,spaceSeparated:af},Symbol.toStringTag,{value:"Module"})),xBt=Object.keys(jFt);class ajt extends L3{constructor(s,d,y,S){let N=-1;if(super(s,d),JAe(this,"space",S),typeof y=="number")for(;++N<xBt.length;){const B=xBt[N];JAe(this,xBt[N],(y&jFt[B])===jFt[B])}}}ajt.prototype.defined=!0;function JAe(o,s,d){d&&(o[s]=d)}const SWn={}.hasOwnProperty;function i$(o){const s={},d={};let y;for(y in o.properties)if(SWn.call(o.properties,y)){const S=o.properties[y],N=new ajt(y,o.transform(o.attributes||{},y),S,o.space);o.mustUseProperty&&o.mustUseProperty.includes(y)&&(N.mustUseProperty=!0),s[y]=N,d[$Ft(y)]=y,d[$Ft(N.attribute)]=y}return new iJ(s,d,o.space)}const pMe=i$({space:"xlink",transform(o,s){return"xlink:"+s.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),gMe=i$({space:"xml",transform(o,s){return"xml:"+s.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function bMe(o,s){return s in o?o[s]:s}function mMe(o,s){return bMe(o,s.toLowerCase())}const yMe=i$({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:mMe,properties:{xmlns:null,xmlnsXLink:null}}),wMe=i$({transform(o,s){return s==="role"?s:"aria-"+s.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:c0,ariaAutoComplete:null,ariaBusy:c0,ariaChecked:c0,ariaColCount:ha,ariaColIndex:ha,ariaColSpan:ha,ariaControls:af,ariaCurrent:null,ariaDescribedBy:af,ariaDetails:null,ariaDisabled:c0,ariaDropEffect:af,ariaErrorMessage:null,ariaExpanded:c0,ariaFlowTo:af,ariaGrabbed:c0,ariaHasPopup:null,ariaHidden:c0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:af,ariaLevel:ha,ariaLive:null,ariaModal:c0,ariaMultiLine:c0,ariaMultiSelectable:c0,ariaOrientation:null,ariaOwns:af,ariaPlaceholder:null,ariaPosInSet:ha,ariaPressed:c0,ariaReadOnly:c0,ariaRelevant:null,ariaRequired:c0,ariaRoleDescription:af,ariaRowCount:ha,ariaRowIndex:ha,ariaRowSpan:ha,ariaSelected:c0,ariaSetSize:ha,ariaSort:null,ariaValueMax:ha,ariaValueMin:ha,ariaValueNow:ha,ariaValueText:null,role:null}}),AWn=i$({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:mMe,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:DF,acceptCharset:af,accessKey:af,action:null,allow:null,allowFullScreen:jc,allowPaymentRequest:jc,allowUserMedia:jc,alt:null,as:null,async:jc,autoCapitalize:null,autoComplete:af,autoFocus:jc,autoPlay:jc,blocking:af,capture:null,charSet:null,checked:jc,cite:null,className:af,cols:ha,colSpan:null,content:null,contentEditable:c0,controls:jc,controlsList:af,coords:ha|DF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:jc,defer:jc,dir:null,dirName:null,disabled:jc,download:dMe,draggable:c0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:jc,formTarget:null,headers:af,height:ha,hidden:jc,high:ha,href:null,hrefLang:null,htmlFor:af,httpEquiv:af,id:null,imageSizes:null,imageSrcSet:null,inert:jc,inputMode:null,integrity:null,is:null,isMap:jc,itemId:null,itemProp:af,itemRef:af,itemScope:jc,itemType:af,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:jc,low:ha,manifest:null,max:null,maxLength:ha,media:null,method:null,min:null,minLength:ha,multiple:jc,muted:jc,name:null,nonce:null,noModule:jc,noValidate:jc,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:jc,optimum:ha,pattern:null,ping:af,placeholder:null,playsInline:jc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:jc,referrerPolicy:null,rel:af,required:jc,reversed:jc,rows:ha,rowSpan:ha,sandbox:af,scope:null,scoped:jc,seamless:jc,selected:jc,shadowRootClonable:jc,shadowRootDelegatesFocus:jc,shadowRootMode:null,shape:null,size:ha,sizes:null,slot:null,span:ha,spellCheck:c0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ha,step:null,style:null,tabIndex:ha,target:null,title:null,translate:null,type:null,typeMustMatch:jc,useMap:null,value:c0,width:ha,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:af,axis:null,background:null,bgColor:null,border:ha,borderColor:null,bottomMargin:ha,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:jc,declare:jc,event:null,face:null,frame:null,frameBorder:null,hSpace:ha,leftMargin:ha,link:null,longDesc:null,lowSrc:null,marginHeight:ha,marginWidth:ha,noResize:jc,noHref:jc,noShade:jc,noWrap:jc,object:null,profile:null,prompt:null,rev:null,rightMargin:ha,rules:null,scheme:null,scrolling:c0,standby:null,summary:null,text:null,topMargin:ha,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ha,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:jc,disableRemotePlayback:jc,prefix:null,property:null,results:ha,security:null,unselectable:null}}),IWn=i$({space:"svg",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"},transform:bMe,properties:{about:Ew,accentHeight:ha,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ha,amplitude:ha,arabicForm:null,ascent:ha,attributeName:null,attributeType:null,azimuth:ha,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ha,by:null,calcMode:null,capHeight:ha,className:af,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:ha,diffuseConstant:ha,direction:null,display:null,dur:null,divisor:ha,dominantBaseline:null,download:jc,dx:null,dy:null,edgeMode:null,editable:null,elevation:ha,enableBackground:null,end:null,event:null,exponent:ha,externalResourcesRequired:null,fill:null,fillOpacity:ha,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:DF,g2:DF,glyphName:DF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ha,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ha,horizOriginX:ha,horizOriginY:ha,id:null,ideographic:ha,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ha,k:ha,k1:ha,k2:ha,k3:ha,k4:ha,kernelMatrix:Ew,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ha,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:ha,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:ha,overlineThickness:ha,paintOrder:null,panose1:null,path:null,pathLength:ha,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:af,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ha,pointsAtY:ha,pointsAtZ:ha,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ew,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ew,rev:Ew,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ew,requiredFeatures:Ew,requiredFonts:Ew,requiredFormats:Ew,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:ha,specularExponent:ha,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ha,strikethroughThickness:ha,string:null,stroke:null,strokeDashArray:Ew,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ha,strokeOpacity:ha,strokeWidth:null,style:null,surfaceScale:ha,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ew,tabIndex:ha,tableValues:null,target:null,targetX:ha,targetY:ha,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ew,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ha,underlineThickness:ha,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ha,values:null,vAlphabetic:ha,vMathematical:ha,vectorEffect:null,vHanging:ha,vIdeographic:ha,version:null,vertAdvY:ha,vertOriginX:ha,vertOriginY:ha,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ha,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),OWn=/^data[-\w.:]+$/i,ZAe=/-[a-z]/g,NWn=/[A-Z]/g;function LWn(o,s){const d=$Ft(s);let y=s,S=L3;if(d in o.normal)return o.property[o.normal[d]];if(d.length>4&&d.slice(0,4)==="data"&&OWn.test(s)){if(s.charAt(4)==="-"){const N=s.slice(5).replace(ZAe,PWn);y="data"+N.charAt(0).toUpperCase()+N.slice(1)}else{const N=s.slice(4);if(!ZAe.test(N)){let B=N.replace(NWn,MWn);B.charAt(0)!=="-"&&(B="-"+B),s="data"+B}}S=ajt}return new S(y,s)}function MWn(o){return"-"+o.toLowerCase()}function PWn(o){return o.charAt(1).toUpperCase()}const RWn=fMe([gMe,pMe,yMe,wMe,AWn],"html"),vMe=fMe([gMe,pMe,yMe,wMe,IWn],"svg"),tIe={}.hasOwnProperty;function sjt(o,s){const d=s||{};function y(S,...N){let B=y.invalid;const H=y.handlers;if(S&&tIe.call(S,o)){const et=String(S[o]);B=tIe.call(H,et)?H[et]:y.unknown}if(B)return B.call(this,S,...N)}return y.handlers=d.handlers||{},y.invalid=d.invalid,y.unknown=d.unknown,y}const DWn={},BWn={}.hasOwnProperty,_Me=sjt("type",{handlers:{root:$Wn,element:qWn,text:zWn,comment:UWn,doctype:HWn}});function FWn(o,s){const y=(s||DWn).space;return _Me(o,y==="svg"?vMe:RWn)}function $Wn(o,s){const d={nodeName:"#document",mode:(o.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return d.childNodes=ojt(o.children,d,s),a$(o,d),d}function jWn(o,s){const d={nodeName:"#document-fragment",childNodes:[]};return d.childNodes=ojt(o.children,d,s),a$(o,d),d}function HWn(o){const s={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return a$(o,s),s}function zWn(o){const s={nodeName:"#text",value:o.value,parentNode:null};return a$(o,s),s}function UWn(o){const s={nodeName:"#comment",data:o.value,parentNode:null};return a$(o,s),s}function qWn(o,s){const d=s;let y=d;o.type==="element"&&o.tagName.toLowerCase()==="svg"&&d.space==="html"&&(y=vMe);const S=[];let N;if(o.properties){for(N in o.properties)if(N!=="children"&&BWn.call(o.properties,N)){const et=WWn(y,N,o.properties[N]);et&&S.push(et)}}const B=y.space,H={nodeName:o.tagName,tagName:o.tagName,attrs:S,namespaceURI:tL[B],childNodes:[],parentNode:null};return H.childNodes=ojt(o.children,H,y),a$(o,H),o.tagName==="template"&&o.content&&(H.content=jWn(o.content,y)),H}function WWn(o,s,d){const y=LWn(o,s);if(d===!1||d===null||d===void 0||typeof d=="number"&&Number.isNaN(d)||!d&&y.boolean)return;Array.isArray(d)&&(d=y.commaSeparated?z$t(d):q$t(d));const S={name:y.attribute,value:d===!0?"":String(d)};if(y.space&&y.space!=="html"&&y.space!=="svg"){const N=S.name.indexOf(":");N<0?S.prefix="":(S.name=S.name.slice(N+1),S.prefix=y.attribute.slice(0,N)),S.namespace=tL[y.space]}return S}function ojt(o,s,d){let y=-1;const S=[];if(o)for(;++y<o.length;){const N=_Me(o[y],d);N.parentNode=s,S.push(N)}return S}function a$(o,s){const d=o.position;d&&d.start&&d.end&&(d.start.offset,d.end.offset,s.sourceCodeLocation={startLine:d.start.line,startCol:d.start.column,startOffset:d.start.offset,endLine:d.end.line,endCol:d.end.column,endOffset:d.end.offset})}const xMe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],KWn=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Yf="�";var _e;(function(o){o[o.EOF=-1]="EOF",o[o.NULL=0]="NULL",o[o.TABULATION=9]="TABULATION",o[o.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",o[o.LINE_FEED=10]="LINE_FEED",o[o.FORM_FEED=12]="FORM_FEED",o[o.SPACE=32]="SPACE",o[o.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",o[o.QUOTATION_MARK=34]="QUOTATION_MARK",o[o.AMPERSAND=38]="AMPERSAND",o[o.APOSTROPHE=39]="APOSTROPHE",o[o.HYPHEN_MINUS=45]="HYPHEN_MINUS",o[o.SOLIDUS=47]="SOLIDUS",o[o.DIGIT_0=48]="DIGIT_0",o[o.DIGIT_9=57]="DIGIT_9",o[o.SEMICOLON=59]="SEMICOLON",o[o.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",o[o.EQUALS_SIGN=61]="EQUALS_SIGN",o[o.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",o[o.QUESTION_MARK=63]="QUESTION_MARK",o[o.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",o[o.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",o[o.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",o[o.GRAVE_ACCENT=96]="GRAVE_ACCENT",o[o.LATIN_SMALL_A=97]="LATIN_SMALL_A",o[o.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(_e||(_e={}));const G2={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function EMe(o){return o>=55296&&o<=57343}function YWn(o){return o>=56320&&o<=57343}function GWn(o,s){return(o-55296)*1024+9216+s}function TMe(o){return o!==32&&o!==10&&o!==13&&o!==9&&o!==12&&o>=1&&o<=31||o>=127&&o<=159}function kMe(o){return o>=64976&&o<=65007||KWn.has(o)}var Dr;(function(o){o.controlCharacterInInputStream="control-character-in-input-stream",o.noncharacterInInputStream="noncharacter-in-input-stream",o.surrogateInInputStream="surrogate-in-input-stream",o.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",o.endTagWithAttributes="end-tag-with-attributes",o.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",o.unexpectedSolidusInTag="unexpected-solidus-in-tag",o.unexpectedNullCharacter="unexpected-null-character",o.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",o.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",o.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",o.missingEndTagName="missing-end-tag-name",o.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",o.unknownNamedCharacterReference="unknown-named-character-reference",o.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",o.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",o.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",o.eofBeforeTagName="eof-before-tag-name",o.eofInTag="eof-in-tag",o.missingAttributeValue="missing-attribute-value",o.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",o.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",o.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",o.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",o.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",o.missingDoctypePublicIdentifier="missing-doctype-public-identifier",o.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",o.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",o.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",o.cdataInHtmlContent="cdata-in-html-content",o.incorrectlyOpenedComment="incorrectly-opened-comment",o.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",o.eofInDoctype="eof-in-doctype",o.nestedComment="nested-comment",o.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",o.eofInComment="eof-in-comment",o.incorrectlyClosedComment="incorrectly-closed-comment",o.eofInCdata="eof-in-cdata",o.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",o.nullCharacterReference="null-character-reference",o.surrogateCharacterReference="surrogate-character-reference",o.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",o.controlCharacterReference="control-character-reference",o.noncharacterCharacterReference="noncharacter-character-reference",o.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",o.missingDoctypeName="missing-doctype-name",o.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",o.duplicateAttribute="duplicate-attribute",o.nonConformingDoctype="non-conforming-doctype",o.missingDoctype="missing-doctype",o.misplacedDoctype="misplaced-doctype",o.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",o.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",o.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",o.openElementsLeftAfterEof="open-elements-left-after-eof",o.abandonedHeadElementChild="abandoned-head-element-child",o.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",o.nestedNoscriptInHead="nested-noscript-in-head",o.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Dr||(Dr={}));const VWn=65536;class XWn{constructor(s){this.handler=s,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=VWn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(s,d){const{line:y,col:S,offset:N}=this,B=S+d,H=N+d;return{code:s,startLine:y,endLine:y,startCol:B,endCol:B,startOffset:H,endOffset:H}}_err(s){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(s,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(s){if(this.pos!==this.html.length-1){const d=this.html.charCodeAt(this.pos+1);if(YWn(d))return this.pos++,this._addGap(),GWn(s,d)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,_e.EOF;return this._err(Dr.surrogateInInputStream),s}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(s,d){this.html.length>0?this.html+=s:this.html=s,this.endOfChunkHit=!1,this.lastChunkWritten=d}insertHtmlAtCurrentPos(s){this.html=this.html.substring(0,this.pos+1)+s+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(s,d){if(this.pos+s.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(d)return this.html.startsWith(s,this.pos);for(let y=0;y<s.length;y++)if((this.html.charCodeAt(this.pos+y)|32)!==s.charCodeAt(y))return!1;return!0}peek(s){const d=this.pos+s;if(d>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,_e.EOF;const y=this.html.charCodeAt(d);return y===_e.CARRIAGE_RETURN?_e.LINE_FEED:y}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,_e.EOF;let s=this.html.charCodeAt(this.pos);return s===_e.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,_e.LINE_FEED):s===_e.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,EMe(s)&&(s=this._processSurrogate(s)),this.handler.onParseError===null||s>31&&s<127||s===_e.LINE_FEED||s===_e.CARRIAGE_RETURN||s>159&&s<64976||this._checkForProblematicCharacters(s),s)}_checkForProblematicCharacters(s){TMe(s)?this._err(Dr.controlCharacterInInputStream):kMe(s)&&this._err(Dr.noncharacterInInputStream)}retreat(s){for(this.pos-=s;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Su;(function(o){o[o.CHARACTER=0]="CHARACTER",o[o.NULL_CHARACTER=1]="NULL_CHARACTER",o[o.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",o[o.START_TAG=3]="START_TAG",o[o.END_TAG=4]="END_TAG",o[o.COMMENT=5]="COMMENT",o[o.DOCTYPE=6]="DOCTYPE",o[o.EOF=7]="EOF",o[o.HIBERNATION=8]="HIBERNATION"})(Su||(Su={}));function CMe(o,s){for(let d=o.attrs.length-1;d>=0;d--)if(o.attrs[d].name===s)return o.attrs[d].value;return null}const SMe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(o=>o.charCodeAt(0))),QWn=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(o=>o.charCodeAt(0)));var EBt;const JWn=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),ZWn=(EBt=String.fromCodePoint)!==null&&EBt!==void 0?EBt:function(o){let s="";return o>65535&&(o-=65536,s+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),s+=String.fromCharCode(o),s};function tKn(o){var s;return o>=55296&&o<=57343||o>1114111?65533:(s=JWn.get(o))!==null&&s!==void 0?s:o}var Kp;(function(o){o[o.NUM=35]="NUM",o[o.SEMI=59]="SEMI",o[o.EQUALS=61]="EQUALS",o[o.ZERO=48]="ZERO",o[o.NINE=57]="NINE",o[o.LOWER_A=97]="LOWER_A",o[o.LOWER_F=102]="LOWER_F",o[o.LOWER_X=120]="LOWER_X",o[o.LOWER_Z=122]="LOWER_Z",o[o.UPPER_A=65]="UPPER_A",o[o.UPPER_F=70]="UPPER_F",o[o.UPPER_Z=90]="UPPER_Z"})(Kp||(Kp={}));const eKn=32;var n7;(function(o){o[o.VALUE_LENGTH=49152]="VALUE_LENGTH",o[o.BRANCH_LENGTH=16256]="BRANCH_LENGTH",o[o.JUMP_TABLE=127]="JUMP_TABLE"})(n7||(n7={}));function HFt(o){return o>=Kp.ZERO&&o<=Kp.NINE}function nKn(o){return o>=Kp.UPPER_A&&o<=Kp.UPPER_F||o>=Kp.LOWER_A&&o<=Kp.LOWER_F}function rKn(o){return o>=Kp.UPPER_A&&o<=Kp.UPPER_Z||o>=Kp.LOWER_A&&o<=Kp.LOWER_Z||HFt(o)}function iKn(o){return o===Kp.EQUALS||rKn(o)}var zp;(function(o){o[o.EntityStart=0]="EntityStart",o[o.NumericStart=1]="NumericStart",o[o.NumericDecimal=2]="NumericDecimal",o[o.NumericHex=3]="NumericHex",o[o.NamedEntity=4]="NamedEntity"})(zp||(zp={}));var uk;(function(o){o[o.Legacy=0]="Legacy",o[o.Strict=1]="Strict",o[o.Attribute=2]="Attribute"})(uk||(uk={}));class AMe{constructor(s,d,y){this.decodeTree=s,this.emitCodePoint=d,this.errors=y,this.state=zp.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=uk.Strict}startEntity(s){this.decodeMode=s,this.state=zp.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(s,d){switch(this.state){case zp.EntityStart:return s.charCodeAt(d)===Kp.NUM?(this.state=zp.NumericStart,this.consumed+=1,this.stateNumericStart(s,d+1)):(this.state=zp.NamedEntity,this.stateNamedEntity(s,d));case zp.NumericStart:return this.stateNumericStart(s,d);case zp.NumericDecimal:return this.stateNumericDecimal(s,d);case zp.NumericHex:return this.stateNumericHex(s,d);case zp.NamedEntity:return this.stateNamedEntity(s,d)}}stateNumericStart(s,d){return d>=s.length?-1:(s.charCodeAt(d)|eKn)===Kp.LOWER_X?(this.state=zp.NumericHex,this.consumed+=1,this.stateNumericHex(s,d+1)):(this.state=zp.NumericDecimal,this.stateNumericDecimal(s,d))}addToNumericResult(s,d,y,S){if(d!==y){const N=y-d;this.result=this.result*Math.pow(S,N)+parseInt(s.substr(d,N),S),this.consumed+=N}}stateNumericHex(s,d){const y=d;for(;d<s.length;){const S=s.charCodeAt(d);if(HFt(S)||nKn(S))d+=1;else return this.addToNumericResult(s,y,d,16),this.emitNumericEntity(S,3)}return this.addToNumericResult(s,y,d,16),-1}stateNumericDecimal(s,d){const y=d;for(;d<s.length;){const S=s.charCodeAt(d);if(HFt(S))d+=1;else return this.addToNumericResult(s,y,d,10),this.emitNumericEntity(S,2)}return this.addToNumericResult(s,y,d,10),-1}emitNumericEntity(s,d){var y;if(this.consumed<=d)return(y=this.errors)===null||y===void 0||y.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(s===Kp.SEMI)this.consumed+=1;else if(this.decodeMode===uk.Strict)return 0;return this.emitCodePoint(tKn(this.result),this.consumed),this.errors&&(s!==Kp.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(s,d){const{decodeTree:y}=this;let S=y[this.treeIndex],N=(S&n7.VALUE_LENGTH)>>14;for(;d<s.length;d++,this.excess++){const B=s.charCodeAt(d);if(this.treeIndex=aKn(y,S,this.treeIndex+Math.max(1,N),B),this.treeIndex<0)return this.result===0||this.decodeMode===uk.Attribute&&(N===0||iKn(B))?0:this.emitNotTerminatedNamedEntity();if(S=y[this.treeIndex],N=(S&n7.VALUE_LENGTH)>>14,N!==0){if(B===Kp.SEMI)return this.emitNamedEntityData(this.treeIndex,N,this.consumed+this.excess);this.decodeMode!==uk.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var s;const{result:d,decodeTree:y}=this,S=(y[d]&n7.VALUE_LENGTH)>>14;return this.emitNamedEntityData(d,S,this.consumed),(s=this.errors)===null||s===void 0||s.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(s,d,y){const{decodeTree:S}=this;return this.emitCodePoint(d===1?S[s]&~n7.VALUE_LENGTH:S[s+1],y),d===3&&this.emitCodePoint(S[s+2],y),y}end(){var s;switch(this.state){case zp.NamedEntity:return this.result!==0&&(this.decodeMode!==uk.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case zp.NumericDecimal:return this.emitNumericEntity(0,2);case zp.NumericHex:return this.emitNumericEntity(0,3);case zp.NumericStart:return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case zp.EntityStart:return 0}}}function IMe(o){let s="";const d=new AMe(o,y=>s+=ZWn(y));return function(S,N){let B=0,H=0;for(;(H=S.indexOf("&",H))>=0;){s+=S.slice(B,H),d.startEntity(N);const W=d.write(S,H+1);if(W<0){B=H+d.end();break}B=H+W,H=W===0?B+1:B}const et=s+S.slice(B);return s="",et}}function aKn(o,s,d,y){const S=(s&n7.BRANCH_LENGTH)>>7,N=s&n7.JUMP_TABLE;if(S===0)return N!==0&&y===N?d:-1;if(N){const et=y-N;return et<0||et>=S?-1:o[d+et]-1}let B=d,H=B+S-1;for(;B<=H;){const et=B+H>>>1,W=o[et];if(W<y)B=et+1;else if(W>y)H=et-1;else return o[et+S]}return-1}IMe(SMe);IMe(QWn);var Bi;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.MATHML="http://www.w3.org/1998/Math/MathML",o.SVG="http://www.w3.org/2000/svg",o.XLINK="http://www.w3.org/1999/xlink",o.XML="http://www.w3.org/XML/1998/namespace",o.XMLNS="http://www.w3.org/2000/xmlns/"})(Bi||(Bi={}));var iL;(function(o){o.TYPE="type",o.ACTION="action",o.ENCODING="encoding",o.PROMPT="prompt",o.NAME="name",o.COLOR="color",o.FACE="face",o.SIZE="size"})(iL||(iL={}));var C3;(function(o){o.NO_QUIRKS="no-quirks",o.QUIRKS="quirks",o.LIMITED_QUIRKS="limited-quirks"})(C3||(C3={}));var tr;(function(o){o.A="a",o.ADDRESS="address",o.ANNOTATION_XML="annotation-xml",o.APPLET="applet",o.AREA="area",o.ARTICLE="article",o.ASIDE="aside",o.B="b",o.BASE="base",o.BASEFONT="basefont",o.BGSOUND="bgsound",o.BIG="big",o.BLOCKQUOTE="blockquote",o.BODY="body",o.BR="br",o.BUTTON="button",o.CAPTION="caption",o.CENTER="center",o.CODE="code",o.COL="col",o.COLGROUP="colgroup",o.DD="dd",o.DESC="desc",o.DETAILS="details",o.DIALOG="dialog",o.DIR="dir",o.DIV="div",o.DL="dl",o.DT="dt",o.EM="em",o.EMBED="embed",o.FIELDSET="fieldset",o.FIGCAPTION="figcaption",o.FIGURE="figure",o.FONT="font",o.FOOTER="footer",o.FOREIGN_OBJECT="foreignObject",o.FORM="form",o.FRAME="frame",o.FRAMESET="frameset",o.H1="h1",o.H2="h2",o.H3="h3",o.H4="h4",o.H5="h5",o.H6="h6",o.HEAD="head",o.HEADER="header",o.HGROUP="hgroup",o.HR="hr",o.HTML="html",o.I="i",o.IMG="img",o.IMAGE="image",o.INPUT="input",o.IFRAME="iframe",o.KEYGEN="keygen",o.LABEL="label",o.LI="li",o.LINK="link",o.LISTING="listing",o.MAIN="main",o.MALIGNMARK="malignmark",o.MARQUEE="marquee",o.MATH="math",o.MENU="menu",o.META="meta",o.MGLYPH="mglyph",o.MI="mi",o.MO="mo",o.MN="mn",o.MS="ms",o.MTEXT="mtext",o.NAV="nav",o.NOBR="nobr",o.NOFRAMES="noframes",o.NOEMBED="noembed",o.NOSCRIPT="noscript",o.OBJECT="object",o.OL="ol",o.OPTGROUP="optgroup",o.OPTION="option",o.P="p",o.PARAM="param",o.PLAINTEXT="plaintext",o.PRE="pre",o.RB="rb",o.RP="rp",o.RT="rt",o.RTC="rtc",o.RUBY="ruby",o.S="s",o.SCRIPT="script",o.SEARCH="search",o.SECTION="section",o.SELECT="select",o.SOURCE="source",o.SMALL="small",o.SPAN="span",o.STRIKE="strike",o.STRONG="strong",o.STYLE="style",o.SUB="sub",o.SUMMARY="summary",o.SUP="sup",o.TABLE="table",o.TBODY="tbody",o.TEMPLATE="template",o.TEXTAREA="textarea",o.TFOOT="tfoot",o.TD="td",o.TH="th",o.THEAD="thead",o.TITLE="title",o.TR="tr",o.TRACK="track",o.TT="tt",o.U="u",o.UL="ul",o.SVG="svg",o.VAR="var",o.WBR="wbr",o.XMP="xmp"})(tr||(tr={}));var ft;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.A=1]="A",o[o.ADDRESS=2]="ADDRESS",o[o.ANNOTATION_XML=3]="ANNOTATION_XML",o[o.APPLET=4]="APPLET",o[o.AREA=5]="AREA",o[o.ARTICLE=6]="ARTICLE",o[o.ASIDE=7]="ASIDE",o[o.B=8]="B",o[o.BASE=9]="BASE",o[o.BASEFONT=10]="BASEFONT",o[o.BGSOUND=11]="BGSOUND",o[o.BIG=12]="BIG",o[o.BLOCKQUOTE=13]="BLOCKQUOTE",o[o.BODY=14]="BODY",o[o.BR=15]="BR",o[o.BUTTON=16]="BUTTON",o[o.CAPTION=17]="CAPTION",o[o.CENTER=18]="CENTER",o[o.CODE=19]="CODE",o[o.COL=20]="COL",o[o.COLGROUP=21]="COLGROUP",o[o.DD=22]="DD",o[o.DESC=23]="DESC",o[o.DETAILS=24]="DETAILS",o[o.DIALOG=25]="DIALOG",o[o.DIR=26]="DIR",o[o.DIV=27]="DIV",o[o.DL=28]="DL",o[o.DT=29]="DT",o[o.EM=30]="EM",o[o.EMBED=31]="EMBED",o[o.FIELDSET=32]="FIELDSET",o[o.FIGCAPTION=33]="FIGCAPTION",o[o.FIGURE=34]="FIGURE",o[o.FONT=35]="FONT",o[o.FOOTER=36]="FOOTER",o[o.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",o[o.FORM=38]="FORM",o[o.FRAME=39]="FRAME",o[o.FRAMESET=40]="FRAMESET",o[o.H1=41]="H1",o[o.H2=42]="H2",o[o.H3=43]="H3",o[o.H4=44]="H4",o[o.H5=45]="H5",o[o.H6=46]="H6",o[o.HEAD=47]="HEAD",o[o.HEADER=48]="HEADER",o[o.HGROUP=49]="HGROUP",o[o.HR=50]="HR",o[o.HTML=51]="HTML",o[o.I=52]="I",o[o.IMG=53]="IMG",o[o.IMAGE=54]="IMAGE",o[o.INPUT=55]="INPUT",o[o.IFRAME=56]="IFRAME",o[o.KEYGEN=57]="KEYGEN",o[o.LABEL=58]="LABEL",o[o.LI=59]="LI",o[o.LINK=60]="LINK",o[o.LISTING=61]="LISTING",o[o.MAIN=62]="MAIN",o[o.MALIGNMARK=63]="MALIGNMARK",o[o.MARQUEE=64]="MARQUEE",o[o.MATH=65]="MATH",o[o.MENU=66]="MENU",o[o.META=67]="META",o[o.MGLYPH=68]="MGLYPH",o[o.MI=69]="MI",o[o.MO=70]="MO",o[o.MN=71]="MN",o[o.MS=72]="MS",o[o.MTEXT=73]="MTEXT",o[o.NAV=74]="NAV",o[o.NOBR=75]="NOBR",o[o.NOFRAMES=76]="NOFRAMES",o[o.NOEMBED=77]="NOEMBED",o[o.NOSCRIPT=78]="NOSCRIPT",o[o.OBJECT=79]="OBJECT",o[o.OL=80]="OL",o[o.OPTGROUP=81]="OPTGROUP",o[o.OPTION=82]="OPTION",o[o.P=83]="P",o[o.PARAM=84]="PARAM",o[o.PLAINTEXT=85]="PLAINTEXT",o[o.PRE=86]="PRE",o[o.RB=87]="RB",o[o.RP=88]="RP",o[o.RT=89]="RT",o[o.RTC=90]="RTC",o[o.RUBY=91]="RUBY",o[o.S=92]="S",o[o.SCRIPT=93]="SCRIPT",o[o.SEARCH=94]="SEARCH",o[o.SECTION=95]="SECTION",o[o.SELECT=96]="SELECT",o[o.SOURCE=97]="SOURCE",o[o.SMALL=98]="SMALL",o[o.SPAN=99]="SPAN",o[o.STRIKE=100]="STRIKE",o[o.STRONG=101]="STRONG",o[o.STYLE=102]="STYLE",o[o.SUB=103]="SUB",o[o.SUMMARY=104]="SUMMARY",o[o.SUP=105]="SUP",o[o.TABLE=106]="TABLE",o[o.TBODY=107]="TBODY",o[o.TEMPLATE=108]="TEMPLATE",o[o.TEXTAREA=109]="TEXTAREA",o[o.TFOOT=110]="TFOOT",o[o.TD=111]="TD",o[o.TH=112]="TH",o[o.THEAD=113]="THEAD",o[o.TITLE=114]="TITLE",o[o.TR=115]="TR",o[o.TRACK=116]="TRACK",o[o.TT=117]="TT",o[o.U=118]="U",o[o.UL=119]="UL",o[o.SVG=120]="SVG",o[o.VAR=121]="VAR",o[o.WBR=122]="WBR",o[o.XMP=123]="XMP"})(ft||(ft={}));const sKn=new Map([[tr.A,ft.A],[tr.ADDRESS,ft.ADDRESS],[tr.ANNOTATION_XML,ft.ANNOTATION_XML],[tr.APPLET,ft.APPLET],[tr.AREA,ft.AREA],[tr.ARTICLE,ft.ARTICLE],[tr.ASIDE,ft.ASIDE],[tr.B,ft.B],[tr.BASE,ft.BASE],[tr.BASEFONT,ft.BASEFONT],[tr.BGSOUND,ft.BGSOUND],[tr.BIG,ft.BIG],[tr.BLOCKQUOTE,ft.BLOCKQUOTE],[tr.BODY,ft.BODY],[tr.BR,ft.BR],[tr.BUTTON,ft.BUTTON],[tr.CAPTION,ft.CAPTION],[tr.CENTER,ft.CENTER],[tr.CODE,ft.CODE],[tr.COL,ft.COL],[tr.COLGROUP,ft.COLGROUP],[tr.DD,ft.DD],[tr.DESC,ft.DESC],[tr.DETAILS,ft.DETAILS],[tr.DIALOG,ft.DIALOG],[tr.DIR,ft.DIR],[tr.DIV,ft.DIV],[tr.DL,ft.DL],[tr.DT,ft.DT],[tr.EM,ft.EM],[tr.EMBED,ft.EMBED],[tr.FIELDSET,ft.FIELDSET],[tr.FIGCAPTION,ft.FIGCAPTION],[tr.FIGURE,ft.FIGURE],[tr.FONT,ft.FONT],[tr.FOOTER,ft.FOOTER],[tr.FOREIGN_OBJECT,ft.FOREIGN_OBJECT],[tr.FORM,ft.FORM],[tr.FRAME,ft.FRAME],[tr.FRAMESET,ft.FRAMESET],[tr.H1,ft.H1],[tr.H2,ft.H2],[tr.H3,ft.H3],[tr.H4,ft.H4],[tr.H5,ft.H5],[tr.H6,ft.H6],[tr.HEAD,ft.HEAD],[tr.HEADER,ft.HEADER],[tr.HGROUP,ft.HGROUP],[tr.HR,ft.HR],[tr.HTML,ft.HTML],[tr.I,ft.I],[tr.IMG,ft.IMG],[tr.IMAGE,ft.IMAGE],[tr.INPUT,ft.INPUT],[tr.IFRAME,ft.IFRAME],[tr.KEYGEN,ft.KEYGEN],[tr.LABEL,ft.LABEL],[tr.LI,ft.LI],[tr.LINK,ft.LINK],[tr.LISTING,ft.LISTING],[tr.MAIN,ft.MAIN],[tr.MALIGNMARK,ft.MALIGNMARK],[tr.MARQUEE,ft.MARQUEE],[tr.MATH,ft.MATH],[tr.MENU,ft.MENU],[tr.META,ft.META],[tr.MGLYPH,ft.MGLYPH],[tr.MI,ft.MI],[tr.MO,ft.MO],[tr.MN,ft.MN],[tr.MS,ft.MS],[tr.MTEXT,ft.MTEXT],[tr.NAV,ft.NAV],[tr.NOBR,ft.NOBR],[tr.NOFRAMES,ft.NOFRAMES],[tr.NOEMBED,ft.NOEMBED],[tr.NOSCRIPT,ft.NOSCRIPT],[tr.OBJECT,ft.OBJECT],[tr.OL,ft.OL],[tr.OPTGROUP,ft.OPTGROUP],[tr.OPTION,ft.OPTION],[tr.P,ft.P],[tr.PARAM,ft.PARAM],[tr.PLAINTEXT,ft.PLAINTEXT],[tr.PRE,ft.PRE],[tr.RB,ft.RB],[tr.RP,ft.RP],[tr.RT,ft.RT],[tr.RTC,ft.RTC],[tr.RUBY,ft.RUBY],[tr.S,ft.S],[tr.SCRIPT,ft.SCRIPT],[tr.SEARCH,ft.SEARCH],[tr.SECTION,ft.SECTION],[tr.SELECT,ft.SELECT],[tr.SOURCE,ft.SOURCE],[tr.SMALL,ft.SMALL],[tr.SPAN,ft.SPAN],[tr.STRIKE,ft.STRIKE],[tr.STRONG,ft.STRONG],[tr.STYLE,ft.STYLE],[tr.SUB,ft.SUB],[tr.SUMMARY,ft.SUMMARY],[tr.SUP,ft.SUP],[tr.TABLE,ft.TABLE],[tr.TBODY,ft.TBODY],[tr.TEMPLATE,ft.TEMPLATE],[tr.TEXTAREA,ft.TEXTAREA],[tr.TFOOT,ft.TFOOT],[tr.TD,ft.TD],[tr.TH,ft.TH],[tr.THEAD,ft.THEAD],[tr.TITLE,ft.TITLE],[tr.TR,ft.TR],[tr.TRACK,ft.TRACK],[tr.TT,ft.TT],[tr.U,ft.U],[tr.UL,ft.UL],[tr.SVG,ft.SVG],[tr.VAR,ft.VAR],[tr.WBR,ft.WBR],[tr.XMP,ft.XMP]]);function s$(o){var s;return(s=sKn.get(o))!==null&&s!==void 0?s:ft.UNKNOWN}const Qi=ft,oKn={[Bi.HTML]:new Set([Qi.ADDRESS,Qi.APPLET,Qi.AREA,Qi.ARTICLE,Qi.ASIDE,Qi.BASE,Qi.BASEFONT,Qi.BGSOUND,Qi.BLOCKQUOTE,Qi.BODY,Qi.BR,Qi.BUTTON,Qi.CAPTION,Qi.CENTER,Qi.COL,Qi.COLGROUP,Qi.DD,Qi.DETAILS,Qi.DIR,Qi.DIV,Qi.DL,Qi.DT,Qi.EMBED,Qi.FIELDSET,Qi.FIGCAPTION,Qi.FIGURE,Qi.FOOTER,Qi.FORM,Qi.FRAME,Qi.FRAMESET,Qi.H1,Qi.H2,Qi.H3,Qi.H4,Qi.H5,Qi.H6,Qi.HEAD,Qi.HEADER,Qi.HGROUP,Qi.HR,Qi.HTML,Qi.IFRAME,Qi.IMG,Qi.INPUT,Qi.LI,Qi.LINK,Qi.LISTING,Qi.MAIN,Qi.MARQUEE,Qi.MENU,Qi.META,Qi.NAV,Qi.NOEMBED,Qi.NOFRAMES,Qi.NOSCRIPT,Qi.OBJECT,Qi.OL,Qi.P,Qi.PARAM,Qi.PLAINTEXT,Qi.PRE,Qi.SCRIPT,Qi.SECTION,Qi.SELECT,Qi.SOURCE,Qi.STYLE,Qi.SUMMARY,Qi.TABLE,Qi.TBODY,Qi.TD,Qi.TEMPLATE,Qi.TEXTAREA,Qi.TFOOT,Qi.TH,Qi.THEAD,Qi.TITLE,Qi.TR,Qi.TRACK,Qi.UL,Qi.WBR,Qi.XMP]),[Bi.MATHML]:new Set([Qi.MI,Qi.MO,Qi.MN,Qi.MS,Qi.MTEXT,Qi.ANNOTATION_XML]),[Bi.SVG]:new Set([Qi.TITLE,Qi.FOREIGN_OBJECT,Qi.DESC]),[Bi.XLINK]:new Set,[Bi.XML]:new Set,[Bi.XMLNS]:new Set},zFt=new Set([Qi.H1,Qi.H2,Qi.H3,Qi.H4,Qi.H5,Qi.H6]);tr.STYLE,tr.SCRIPT,tr.XMP,tr.IFRAME,tr.NOEMBED,tr.NOFRAMES,tr.PLAINTEXT;var je;(function(o){o[o.DATA=0]="DATA",o[o.RCDATA=1]="RCDATA",o[o.RAWTEXT=2]="RAWTEXT",o[o.SCRIPT_DATA=3]="SCRIPT_DATA",o[o.PLAINTEXT=4]="PLAINTEXT",o[o.TAG_OPEN=5]="TAG_OPEN",o[o.END_TAG_OPEN=6]="END_TAG_OPEN",o[o.TAG_NAME=7]="TAG_NAME",o[o.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",o[o.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",o[o.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",o[o.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",o[o.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",o[o.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",o[o.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",o[o.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",o[o.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",o[o.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",o[o.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",o[o.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",o[o.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",o[o.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",o[o.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",o[o.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",o[o.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",o[o.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",o[o.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",o[o.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",o[o.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",o[o.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",o[o.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",o[o.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",o[o.BOGUS_COMMENT=40]="BOGUS_COMMENT",o[o.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",o[o.COMMENT_START=42]="COMMENT_START",o[o.COMMENT_START_DASH=43]="COMMENT_START_DASH",o[o.COMMENT=44]="COMMENT",o[o.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",o[o.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",o[o.COMMENT_END_DASH=49]="COMMENT_END_DASH",o[o.COMMENT_END=50]="COMMENT_END",o[o.COMMENT_END_BANG=51]="COMMENT_END_BANG",o[o.DOCTYPE=52]="DOCTYPE",o[o.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",o[o.DOCTYPE_NAME=54]="DOCTYPE_NAME",o[o.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",o[o.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",o[o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",o[o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",o[o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",o[o.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",o[o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",o[o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",o[o.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",o[o.CDATA_SECTION=68]="CDATA_SECTION",o[o.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",o[o.CDATA_SECTION_END=70]="CDATA_SECTION_END",o[o.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",o[o.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(je||(je={}));const I1={DATA:je.DATA,RCDATA:je.RCDATA,RAWTEXT:je.RAWTEXT,SCRIPT_DATA:je.SCRIPT_DATA,PLAINTEXT:je.PLAINTEXT,CDATA_SECTION:je.CDATA_SECTION};function cKn(o){return o>=_e.DIGIT_0&&o<=_e.DIGIT_9}function vQ(o){return o>=_e.LATIN_CAPITAL_A&&o<=_e.LATIN_CAPITAL_Z}function uKn(o){return o>=_e.LATIN_SMALL_A&&o<=_e.LATIN_SMALL_Z}function JS(o){return uKn(o)||vQ(o)}function eIe(o){return JS(o)||cKn(o)}function Dbt(o){return o+32}function OMe(o){return o===_e.SPACE||o===_e.LINE_FEED||o===_e.TABULATION||o===_e.FORM_FEED}function nIe(o){return OMe(o)||o===_e.SOLIDUS||o===_e.GREATER_THAN_SIGN}function lKn(o){return o===_e.NULL?Dr.nullCharacterReference:o>1114111?Dr.characterReferenceOutsideUnicodeRange:EMe(o)?Dr.surrogateCharacterReference:kMe(o)?Dr.noncharacterCharacterReference:TMe(o)||o===_e.CARRIAGE_RETURN?Dr.controlCharacterReference:null}class hKn{constructor(s,d){this.options=s,this.handler=d,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=je.DATA,this.returnState=je.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new XWn(d),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new AMe(SMe,(y,S)=>{this.preprocessor.pos=this.entityStartPos+S-1,this._flushCodePointConsumedAsCharacterReference(y)},d.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Dr.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:y=>{this._err(Dr.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+y)},validateNumericCharacterReference:y=>{const S=lKn(y);S&&this._err(S,1)}}:void 0)}_err(s,d=0){var y,S;(S=(y=this.handler).onParseError)===null||S===void 0||S.call(y,this.preprocessor.getError(s,d))}getCurrentLocation(s){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-s,startOffset:this.preprocessor.offset-s,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const s=this._consume();this._ensureHibernation()||this._callState(s)}this.inLoop=!1}}pause(){this.paused=!0}resume(s){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||s==null||s())}write(s,d,y){this.active=!0,this.preprocessor.write(s,d),this._runParsingLoop(),this.paused||y==null||y()}insertHtmlAtCurrentPos(s){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(s),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(s){this.consumedAfterSnapshot+=s;for(let d=0;d<s;d++)this.preprocessor.advance()}_consumeSequenceIfMatch(s,d){return this.preprocessor.startsWith(s,d)?(this._advanceBy(s.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Su.START_TAG,tagName:"",tagID:ft.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Su.END_TAG,tagName:"",tagID:ft.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(s){this.currentToken={type:Su.COMMENT,data:"",location:this.getCurrentLocation(s)}}_createDoctypeToken(s){this.currentToken={type:Su.DOCTYPE,name:s,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(s,d){this.currentCharacterToken={type:s,chars:d,location:this.currentLocation}}_createAttr(s){this.currentAttr={name:s,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var s,d;const y=this.currentToken;if(CMe(y,this.currentAttr.name)===null){if(y.attrs.push(this.currentAttr),y.location&&this.currentLocation){const S=(s=(d=y.location).attrs)!==null&&s!==void 0?s:d.attrs=Object.create(null);S[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Dr.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(s){this._emitCurrentCharacterToken(s.location),this.currentToken=null,s.location&&(s.location.endLine=this.preprocessor.line,s.location.endCol=this.preprocessor.col+1,s.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const s=this.currentToken;this.prepareToken(s),s.tagID=s$(s.tagName),s.type===Su.START_TAG?(this.lastStartTagName=s.tagName,this.handler.onStartTag(s)):(s.attrs.length>0&&this._err(Dr.endTagWithAttributes),s.selfClosing&&this._err(Dr.endTagWithTrailingSolidus),this.handler.onEndTag(s)),this.preprocessor.dropParsedChunk()}emitCurrentComment(s){this.prepareToken(s),this.handler.onComment(s),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(s){this.prepareToken(s),this.handler.onDoctype(s),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(s){if(this.currentCharacterToken){switch(s&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=s.startLine,this.currentCharacterToken.location.endCol=s.startCol,this.currentCharacterToken.location.endOffset=s.startOffset),this.currentCharacterToken.type){case Su.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Su.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Su.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const s=this.getCurrentLocation(0);s&&(s.endLine=s.startLine,s.endCol=s.startCol,s.endOffset=s.startOffset),this._emitCurrentCharacterToken(s),this.handler.onEof({type:Su.EOF,location:s}),this.active=!1}_appendCharToCurrentCharacterToken(s,d){if(this.currentCharacterToken)if(this.currentCharacterToken.type===s){this.currentCharacterToken.chars+=d;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(s,d)}_emitCodePoint(s){const d=OMe(s)?Su.WHITESPACE_CHARACTER:s===_e.NULL?Su.NULL_CHARACTER:Su.CHARACTER;this._appendCharToCurrentCharacterToken(d,String.fromCodePoint(s))}_emitChars(s){this._appendCharToCurrentCharacterToken(Su.CHARACTER,s)}_startCharacterReference(){this.returnState=this.state,this.state=je.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?uk.Attribute:uk.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===je.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===je.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===je.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(s){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(s):this._emitCodePoint(s)}_callState(s){switch(this.state){case je.DATA:{this._stateData(s);break}case je.RCDATA:{this._stateRcdata(s);break}case je.RAWTEXT:{this._stateRawtext(s);break}case je.SCRIPT_DATA:{this._stateScriptData(s);break}case je.PLAINTEXT:{this._statePlaintext(s);break}case je.TAG_OPEN:{this._stateTagOpen(s);break}case je.END_TAG_OPEN:{this._stateEndTagOpen(s);break}case je.TAG_NAME:{this._stateTagName(s);break}case je.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(s);break}case je.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(s);break}case je.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(s);break}case je.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(s);break}case je.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(s);break}case je.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(s);break}case je.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(s);break}case je.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(s);break}case je.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(s);break}case je.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(s);break}case je.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(s);break}case je.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(s);break}case je.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(s);break}case je.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(s);break}case je.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(s);break}case je.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(s);break}case je.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(s);break}case je.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(s);break}case je.ATTRIBUTE_NAME:{this._stateAttributeName(s);break}case je.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(s);break}case je.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(s);break}case je.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(s);break}case je.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(s);break}case je.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(s);break}case je.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(s);break}case je.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(s);break}case je.BOGUS_COMMENT:{this._stateBogusComment(s);break}case je.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(s);break}case je.COMMENT_START:{this._stateCommentStart(s);break}case je.COMMENT_START_DASH:{this._stateCommentStartDash(s);break}case je.COMMENT:{this._stateComment(s);break}case je.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(s);break}case je.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(s);break}case je.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(s);break}case je.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(s);break}case je.COMMENT_END_DASH:{this._stateCommentEndDash(s);break}case je.COMMENT_END:{this._stateCommentEnd(s);break}case je.COMMENT_END_BANG:{this._stateCommentEndBang(s);break}case je.DOCTYPE:{this._stateDoctype(s);break}case je.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(s);break}case je.DOCTYPE_NAME:{this._stateDoctypeName(s);break}case je.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(s);break}case je.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(s);break}case je.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(s);break}case je.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(s);break}case je.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(s);break}case je.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(s);break}case je.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(s);break}case je.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(s);break}case je.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(s);break}case je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(s);break}case je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(s);break}case je.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(s);break}case je.BOGUS_DOCTYPE:{this._stateBogusDoctype(s);break}case je.CDATA_SECTION:{this._stateCdataSection(s);break}case je.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(s);break}case je.CDATA_SECTION_END:{this._stateCdataSectionEnd(s);break}case je.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case je.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(s);break}default:throw new Error("Unknown state")}}_stateData(s){switch(s){case _e.LESS_THAN_SIGN:{this.state=je.TAG_OPEN;break}case _e.AMPERSAND:{this._startCharacterReference();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitCodePoint(s);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateRcdata(s){switch(s){case _e.AMPERSAND:{this._startCharacterReference();break}case _e.LESS_THAN_SIGN:{this.state=je.RCDATA_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateRawtext(s){switch(s){case _e.LESS_THAN_SIGN:{this.state=je.RAWTEXT_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptData(s){switch(s){case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_statePlaintext(s){switch(s){case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateTagOpen(s){if(JS(s))this._createStartTagToken(),this.state=je.TAG_NAME,this._stateTagName(s);else switch(s){case _e.EXCLAMATION_MARK:{this.state=je.MARKUP_DECLARATION_OPEN;break}case _e.SOLIDUS:{this.state=je.END_TAG_OPEN;break}case _e.QUESTION_MARK:{this._err(Dr.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=je.BOGUS_COMMENT,this._stateBogusComment(s);break}case _e.EOF:{this._err(Dr.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Dr.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=je.DATA,this._stateData(s)}}_stateEndTagOpen(s){if(JS(s))this._createEndTagToken(),this.state=je.TAG_NAME,this._stateTagName(s);else switch(s){case _e.GREATER_THAN_SIGN:{this._err(Dr.missingEndTagName),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Dr.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=je.BOGUS_COMMENT,this._stateBogusComment(s)}}_stateTagName(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BEFORE_ATTRIBUTE_NAME;break}case _e.SOLIDUS:{this.state=je.SELF_CLOSING_START_TAG;break}case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentTagToken();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.tagName+=Yf;break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:d.tagName+=String.fromCodePoint(vQ(s)?Dbt(s):s)}}_stateRcdataLessThanSign(s){s===_e.SOLIDUS?this.state=je.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=je.RCDATA,this._stateRcdata(s))}_stateRcdataEndTagOpen(s){JS(s)?(this.state=je.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(s)):(this._emitChars("</"),this.state=je.RCDATA,this._stateRcdata(s))}handleSpecialEndTag(s){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const d=this.currentToken;switch(d.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=je.BEFORE_ATTRIBUTE_NAME,!1;case _e.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=je.SELF_CLOSING_START_TAG,!1;case _e.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=je.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=je.RCDATA,this._stateRcdata(s))}_stateRawtextLessThanSign(s){s===_e.SOLIDUS?this.state=je.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=je.RAWTEXT,this._stateRawtext(s))}_stateRawtextEndTagOpen(s){JS(s)?(this.state=je.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(s)):(this._emitChars("</"),this.state=je.RAWTEXT,this._stateRawtext(s))}_stateRawtextEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=je.RAWTEXT,this._stateRawtext(s))}_stateScriptDataLessThanSign(s){switch(s){case _e.SOLIDUS:{this.state=je.SCRIPT_DATA_END_TAG_OPEN;break}case _e.EXCLAMATION_MARK:{this.state=je.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=je.SCRIPT_DATA,this._stateScriptData(s)}}_stateScriptDataEndTagOpen(s){JS(s)?(this.state=je.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(s)):(this._emitChars("</"),this.state=je.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=je.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscapeStart(s){s===_e.HYPHEN_MINUS?(this.state=je.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=je.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscapeStartDash(s){s===_e.HYPHEN_MINUS?(this.state=je.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=je.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscaped(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptDataEscapedDash(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.state=je.SCRIPT_DATA_ESCAPED,this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=je.SCRIPT_DATA_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataEscapedDashDash(s){switch(s){case _e.HYPHEN_MINUS:{this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _e.GREATER_THAN_SIGN:{this.state=je.SCRIPT_DATA,this._emitChars(">");break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.state=je.SCRIPT_DATA_ESCAPED,this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=je.SCRIPT_DATA_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataEscapedLessThanSign(s){s===_e.SOLIDUS?this.state=je.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:JS(s)?(this._emitChars("<"),this.state=je.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(s)):(this._emitChars("<"),this.state=je.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataEscapedEndTagOpen(s){JS(s)?(this.state=je.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(s)):(this._emitChars("</"),this.state=je.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataEscapedEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=je.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataDoubleEscapeStart(s){if(this.preprocessor.startsWith(G2.SCRIPT,!1)&&nIe(this.preprocessor.peek(G2.SCRIPT.length))){this._emitCodePoint(s);for(let d=0;d<G2.SCRIPT.length;d++)this._emitCodePoint(this._consume());this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=je.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataDoubleEscaped(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedDash(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedDashDash(s){switch(s){case _e.HYPHEN_MINUS:{this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _e.GREATER_THAN_SIGN:{this.state=je.SCRIPT_DATA,this._emitChars(">");break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedLessThanSign(s){s===_e.SOLIDUS?(this.state=je.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(s))}_stateScriptDataDoubleEscapeEnd(s){if(this.preprocessor.startsWith(G2.SCRIPT,!1)&&nIe(this.preprocessor.peek(G2.SCRIPT.length))){this._emitCodePoint(s);for(let d=0;d<G2.SCRIPT.length;d++)this._emitCodePoint(this._consume());this.state=je.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(s))}_stateBeforeAttributeName(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.SOLIDUS:case _e.GREATER_THAN_SIGN:case _e.EOF:{this.state=je.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(s);break}case _e.EQUALS_SIGN:{this._err(Dr.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=je.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=je.ATTRIBUTE_NAME,this._stateAttributeName(s)}}_stateAttributeName(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:case _e.SOLIDUS:case _e.GREATER_THAN_SIGN:case _e.EOF:{this._leaveAttrName(),this.state=je.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(s);break}case _e.EQUALS_SIGN:{this._leaveAttrName(),this.state=je.BEFORE_ATTRIBUTE_VALUE;break}case _e.QUOTATION_MARK:case _e.APOSTROPHE:case _e.LESS_THAN_SIGN:{this._err(Dr.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(s);break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.currentAttr.name+=Yf;break}default:this.currentAttr.name+=String.fromCodePoint(vQ(s)?Dbt(s):s)}}_stateAfterAttributeName(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.SOLIDUS:{this.state=je.SELF_CLOSING_START_TAG;break}case _e.EQUALS_SIGN:{this.state=je.BEFORE_ATTRIBUTE_VALUE;break}case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentTagToken();break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=je.ATTRIBUTE_NAME,this._stateAttributeName(s)}}_stateBeforeAttributeValue(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.QUOTATION_MARK:{this.state=je.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{this.state=je.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingAttributeValue),this.state=je.DATA,this.emitCurrentTagToken();break}default:this.state=je.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(s)}}_stateAttributeValueDoubleQuoted(s){switch(s){case _e.QUOTATION_MARK:{this.state=je.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case _e.AMPERSAND:{this._startCharacterReference();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.currentAttr.value+=Yf;break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAttributeValueSingleQuoted(s){switch(s){case _e.APOSTROPHE:{this.state=je.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case _e.AMPERSAND:{this._startCharacterReference();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.currentAttr.value+=Yf;break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAttributeValueUnquoted(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this._leaveAttrValue(),this.state=je.BEFORE_ATTRIBUTE_NAME;break}case _e.AMPERSAND:{this._startCharacterReference();break}case _e.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=je.DATA,this.emitCurrentTagToken();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.currentAttr.value+=Yf;break}case _e.QUOTATION_MARK:case _e.APOSTROPHE:case _e.LESS_THAN_SIGN:case _e.EQUALS_SIGN:case _e.GRAVE_ACCENT:{this._err(Dr.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(s);break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAfterAttributeValueQuoted(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this._leaveAttrValue(),this.state=je.BEFORE_ATTRIBUTE_NAME;break}case _e.SOLIDUS:{this._leaveAttrValue(),this.state=je.SELF_CLOSING_START_TAG;break}case _e.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=je.DATA,this.emitCurrentTagToken();break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this._err(Dr.missingWhitespaceBetweenAttributes),this.state=je.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(s)}}_stateSelfClosingStartTag(s){switch(s){case _e.GREATER_THAN_SIGN:{const d=this.currentToken;d.selfClosing=!0,this.state=je.DATA,this.emitCurrentTagToken();break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this._err(Dr.unexpectedSolidusInTag),this.state=je.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(s)}}_stateBogusComment(s){const d=this.currentToken;switch(s){case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentComment(d);break}case _e.EOF:{this.emitCurrentComment(d),this._emitEOFToken();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.data+=Yf;break}default:d.data+=String.fromCodePoint(s)}}_stateMarkupDeclarationOpen(s){this._consumeSequenceIfMatch(G2.DASH_DASH,!0)?(this._createCommentToken(G2.DASH_DASH.length+1),this.state=je.COMMENT_START):this._consumeSequenceIfMatch(G2.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(G2.DOCTYPE.length+1),this.state=je.DOCTYPE):this._consumeSequenceIfMatch(G2.CDATA_START,!0)?this.inForeignNode?this.state=je.CDATA_SECTION:(this._err(Dr.cdataInHtmlContent),this._createCommentToken(G2.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=je.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Dr.incorrectlyOpenedComment),this._createCommentToken(2),this.state=je.BOGUS_COMMENT,this._stateBogusComment(s))}_stateCommentStart(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.COMMENT_START_DASH;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptClosingOfEmptyComment),this.state=je.DATA;const d=this.currentToken;this.emitCurrentComment(d);break}default:this.state=je.COMMENT,this._stateComment(s)}}_stateCommentStartDash(s){const d=this.currentToken;switch(s){case _e.HYPHEN_MINUS:{this.state=je.COMMENT_END;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptClosingOfEmptyComment),this.state=je.DATA,this.emitCurrentComment(d);break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+="-",this.state=je.COMMENT,this._stateComment(s)}}_stateComment(s){const d=this.currentToken;switch(s){case _e.HYPHEN_MINUS:{this.state=je.COMMENT_END_DASH;break}case _e.LESS_THAN_SIGN:{d.data+="<",this.state=je.COMMENT_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.data+=Yf;break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+=String.fromCodePoint(s)}}_stateCommentLessThanSign(s){const d=this.currentToken;switch(s){case _e.EXCLAMATION_MARK:{d.data+="!",this.state=je.COMMENT_LESS_THAN_SIGN_BANG;break}case _e.LESS_THAN_SIGN:{d.data+="<";break}default:this.state=je.COMMENT,this._stateComment(s)}}_stateCommentLessThanSignBang(s){s===_e.HYPHEN_MINUS?this.state=je.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=je.COMMENT,this._stateComment(s))}_stateCommentLessThanSignBangDash(s){s===_e.HYPHEN_MINUS?this.state=je.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=je.COMMENT_END_DASH,this._stateCommentEndDash(s))}_stateCommentLessThanSignBangDashDash(s){s!==_e.GREATER_THAN_SIGN&&s!==_e.EOF&&this._err(Dr.nestedComment),this.state=je.COMMENT_END,this._stateCommentEnd(s)}_stateCommentEndDash(s){const d=this.currentToken;switch(s){case _e.HYPHEN_MINUS:{this.state=je.COMMENT_END;break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+="-",this.state=je.COMMENT,this._stateComment(s)}}_stateCommentEnd(s){const d=this.currentToken;switch(s){case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentComment(d);break}case _e.EXCLAMATION_MARK:{this.state=je.COMMENT_END_BANG;break}case _e.HYPHEN_MINUS:{d.data+="-";break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+="--",this.state=je.COMMENT,this._stateComment(s)}}_stateCommentEndBang(s){const d=this.currentToken;switch(s){case _e.HYPHEN_MINUS:{d.data+="--!",this.state=je.COMMENT_END_DASH;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.incorrectlyClosedComment),this.state=je.DATA,this.emitCurrentComment(d);break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+="--!",this.state=je.COMMENT,this._stateComment(s)}}_stateDoctype(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BEFORE_DOCTYPE_NAME;break}case _e.GREATER_THAN_SIGN:{this.state=je.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(s);break}case _e.EOF:{this._err(Dr.eofInDoctype),this._createDoctypeToken(null);const d=this.currentToken;d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingWhitespaceBeforeDoctypeName),this.state=je.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(s)}}_stateBeforeDoctypeName(s){if(vQ(s))this._createDoctypeToken(String.fromCharCode(Dbt(s))),this.state=je.DOCTYPE_NAME;else switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._createDoctypeToken(Yf),this.state=je.DOCTYPE_NAME;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypeName),this._createDoctypeToken(null);const d=this.currentToken;d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),this._createDoctypeToken(null);const d=this.currentToken;d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(s)),this.state=je.DOCTYPE_NAME}}_stateDoctypeName(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.AFTER_DOCTYPE_NAME;break}case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.name+=Yf;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.name+=String.fromCodePoint(vQ(s)?Dbt(s):s)}}_stateAfterDoctypeName(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(G2.PUBLIC,!1)?this.state=je.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(G2.SYSTEM,!1)?this.state=je.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Dr.invalidCharacterSequenceAfterDoctypeName),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s))}}_stateAfterDoctypePublicKeyword(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case _e.QUOTATION_MARK:{this._err(Dr.missingWhitespaceAfterDoctypePublicKeyword),d.publicId="",this.state=je.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{this._err(Dr.missingWhitespaceAfterDoctypePublicKeyword),d.publicId="",this.state=je.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypePublicIdentifier),d.forceQuirks=!0,this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypePublicIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBeforeDoctypePublicIdentifier(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.QUOTATION_MARK:{d.publicId="",this.state=je.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{d.publicId="",this.state=je.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypePublicIdentifier),d.forceQuirks=!0,this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypePublicIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateDoctypePublicIdentifierDoubleQuoted(s){const d=this.currentToken;switch(s){case _e.QUOTATION_MARK:{this.state=je.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.publicId+=Yf;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptDoctypePublicIdentifier),d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.publicId+=String.fromCodePoint(s)}}_stateDoctypePublicIdentifierSingleQuoted(s){const d=this.currentToken;switch(s){case _e.APOSTROPHE:{this.state=je.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.publicId+=Yf;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptDoctypePublicIdentifier),d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.publicId+=String.fromCodePoint(s)}}_stateAfterDoctypePublicIdentifier(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.QUOTATION_MARK:{this._err(Dr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{this._err(Dr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBetweenDoctypePublicAndSystemIdentifiers(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.GREATER_THAN_SIGN:{this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.QUOTATION_MARK:{d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateAfterDoctypeSystemKeyword(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case _e.QUOTATION_MARK:{this._err(Dr.missingWhitespaceAfterDoctypeSystemKeyword),d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{this._err(Dr.missingWhitespaceAfterDoctypeSystemKeyword),d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBeforeDoctypeSystemIdentifier(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.QUOTATION_MARK:{d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateDoctypeSystemIdentifierDoubleQuoted(s){const d=this.currentToken;switch(s){case _e.QUOTATION_MARK:{this.state=je.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.systemId+=Yf;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptDoctypeSystemIdentifier),d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.systemId+=String.fromCodePoint(s)}}_stateDoctypeSystemIdentifierSingleQuoted(s){const d=this.currentToken;switch(s){case _e.APOSTROPHE:{this.state=je.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.systemId+=Yf;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptDoctypeSystemIdentifier),d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.systemId+=String.fromCodePoint(s)}}_stateAfterDoctypeSystemIdentifier(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.GREATER_THAN_SIGN:{this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBogusDoctype(s){const d=this.currentToken;switch(s){case _e.GREATER_THAN_SIGN:{this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter);break}case _e.EOF:{this.emitCurrentDoctype(d),this._emitEOFToken();break}}}_stateCdataSection(s){switch(s){case _e.RIGHT_SQUARE_BRACKET:{this.state=je.CDATA_SECTION_BRACKET;break}case _e.EOF:{this._err(Dr.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateCdataSectionBracket(s){s===_e.RIGHT_SQUARE_BRACKET?this.state=je.CDATA_SECTION_END:(this._emitChars("]"),this.state=je.CDATA_SECTION,this._stateCdataSection(s))}_stateCdataSectionEnd(s){switch(s){case _e.GREATER_THAN_SIGN:{this.state=je.DATA;break}case _e.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=je.CDATA_SECTION,this._stateCdataSection(s)}}_stateCharacterReference(){let s=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(s<0)if(this.preprocessor.lastChunkWritten)s=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}s===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(_e.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&eIe(this.preprocessor.peek(1))?je.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(s){eIe(s)?this._flushCodePointConsumedAsCharacterReference(s):(s===_e.SEMICOLON&&this._err(Dr.unknownNamedCharacterReference),this.state=this.returnState,this._callState(s))}}const NMe=new Set([ft.DD,ft.DT,ft.LI,ft.OPTGROUP,ft.OPTION,ft.P,ft.RB,ft.RP,ft.RT,ft.RTC]),rIe=new Set([...NMe,ft.CAPTION,ft.COLGROUP,ft.TBODY,ft.TD,ft.TFOOT,ft.TH,ft.THEAD,ft.TR]),Fmt=new Set([ft.APPLET,ft.CAPTION,ft.HTML,ft.MARQUEE,ft.OBJECT,ft.TABLE,ft.TD,ft.TEMPLATE,ft.TH]),fKn=new Set([...Fmt,ft.OL,ft.UL]),dKn=new Set([...Fmt,ft.BUTTON]),iIe=new Set([ft.ANNOTATION_XML,ft.MI,ft.MN,ft.MO,ft.MS,ft.MTEXT]),aIe=new Set([ft.DESC,ft.FOREIGN_OBJECT,ft.TITLE]),pKn=new Set([ft.TR,ft.TEMPLATE,ft.HTML]),gKn=new Set([ft.TBODY,ft.TFOOT,ft.THEAD,ft.TEMPLATE,ft.HTML]),bKn=new Set([ft.TABLE,ft.TEMPLATE,ft.HTML]),mKn=new Set([ft.TD,ft.TH]);class yKn{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(s,d,y){this.treeAdapter=d,this.handler=y,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=ft.UNKNOWN,this.current=s}_indexOf(s){return this.items.lastIndexOf(s,this.stackTop)}_isInTemplate(){return this.currentTagId===ft.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Bi.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(s,d){this.stackTop++,this.items[this.stackTop]=s,this.current=s,this.tagIDs[this.stackTop]=d,this.currentTagId=d,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(s,d,!0)}pop(){const s=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(s,!0)}replace(s,d){const y=this._indexOf(s);this.items[y]=d,y===this.stackTop&&(this.current=d)}insertAfter(s,d,y){const S=this._indexOf(s)+1;this.items.splice(S,0,d),this.tagIDs.splice(S,0,y),this.stackTop++,S===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,S===this.stackTop)}popUntilTagNamePopped(s){let d=this.stackTop+1;do d=this.tagIDs.lastIndexOf(s,d-1);while(d>0&&this.treeAdapter.getNamespaceURI(this.items[d])!==Bi.HTML);this.shortenToLength(d<0?0:d)}shortenToLength(s){for(;this.stackTop>=s;){const d=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(d,this.stackTop<s)}}popUntilElementPopped(s){const d=this._indexOf(s);this.shortenToLength(d<0?0:d)}popUntilPopped(s,d){const y=this._indexOfTagNames(s,d);this.shortenToLength(y<0?0:y)}popUntilNumberedHeaderPopped(){this.popUntilPopped(zFt,Bi.HTML)}popUntilTableCellPopped(){this.popUntilPopped(mKn,Bi.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(s,d){for(let y=this.stackTop;y>=0;y--)if(s.has(this.tagIDs[y])&&this.treeAdapter.getNamespaceURI(this.items[y])===d)return y;return-1}clearBackTo(s,d){const y=this._indexOfTagNames(s,d);this.shortenToLength(y+1)}clearBackToTableContext(){this.clearBackTo(bKn,Bi.HTML)}clearBackToTableBodyContext(){this.clearBackTo(gKn,Bi.HTML)}clearBackToTableRowContext(){this.clearBackTo(pKn,Bi.HTML)}remove(s){const d=this._indexOf(s);d>=0&&(d===this.stackTop?this.pop():(this.items.splice(d,1),this.tagIDs.splice(d,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(s,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===ft.BODY?this.items[1]:null}contains(s){return this._indexOf(s)>-1}getCommonAncestor(s){const d=this._indexOf(s)-1;return d>=0?this.items[d]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===ft.HTML}hasInDynamicScope(s,d){for(let y=this.stackTop;y>=0;y--){const S=this.tagIDs[y];switch(this.treeAdapter.getNamespaceURI(this.items[y])){case Bi.HTML:{if(S===s)return!0;if(d.has(S))return!1;break}case Bi.SVG:{if(aIe.has(S))return!1;break}case Bi.MATHML:{if(iIe.has(S))return!1;break}}}return!0}hasInScope(s){return this.hasInDynamicScope(s,Fmt)}hasInListItemScope(s){return this.hasInDynamicScope(s,fKn)}hasInButtonScope(s){return this.hasInDynamicScope(s,dKn)}hasNumberedHeaderInScope(){for(let s=this.stackTop;s>=0;s--){const d=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case Bi.HTML:{if(zFt.has(d))return!0;if(Fmt.has(d))return!1;break}case Bi.SVG:{if(aIe.has(d))return!1;break}case Bi.MATHML:{if(iIe.has(d))return!1;break}}}return!0}hasInTableScope(s){for(let d=this.stackTop;d>=0;d--)if(this.treeAdapter.getNamespaceURI(this.items[d])===Bi.HTML)switch(this.tagIDs[d]){case s:return!0;case ft.TABLE:case ft.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let s=this.stackTop;s>=0;s--)if(this.treeAdapter.getNamespaceURI(this.items[s])===Bi.HTML)switch(this.tagIDs[s]){case ft.TBODY:case ft.THEAD:case ft.TFOOT:return!0;case ft.TABLE:case ft.HTML:return!1}return!0}hasInSelectScope(s){for(let d=this.stackTop;d>=0;d--)if(this.treeAdapter.getNamespaceURI(this.items[d])===Bi.HTML)switch(this.tagIDs[d]){case s:return!0;case ft.OPTION:case ft.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;NMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;rIe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(s){for(;this.currentTagId!==s&&rIe.has(this.currentTagId);)this.pop()}}const TBt=3;var v6;(function(o){o[o.Marker=0]="Marker",o[o.Element=1]="Element"})(v6||(v6={}));const sIe={type:v6.Marker};class wKn{constructor(s){this.treeAdapter=s,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(s,d){const y=[],S=d.length,N=this.treeAdapter.getTagName(s),B=this.treeAdapter.getNamespaceURI(s);for(let H=0;H<this.entries.length;H++){const et=this.entries[H];if(et.type===v6.Marker)break;const{element:W}=et;if(this.treeAdapter.getTagName(W)===N&&this.treeAdapter.getNamespaceURI(W)===B){const nt=this.treeAdapter.getAttrList(W);nt.length===S&&y.push({idx:H,attrs:nt})}}return y}_ensureNoahArkCondition(s){if(this.entries.length<TBt)return;const d=this.treeAdapter.getAttrList(s),y=this._getNoahArkConditionCandidates(s,d);if(y.length<TBt)return;const S=new Map(d.map(B=>[B.name,B.value]));let N=0;for(let B=0;B<y.length;B++){const H=y[B];H.attrs.every(et=>S.get(et.name)===et.value)&&(N+=1,N>=TBt&&this.entries.splice(H.idx,1))}}insertMarker(){this.entries.unshift(sIe)}pushElement(s,d){this._ensureNoahArkCondition(s),this.entries.unshift({type:v6.Element,element:s,token:d})}insertElementAfterBookmark(s,d){const y=this.entries.indexOf(this.bookmark);this.entries.splice(y,0,{type:v6.Element,element:s,token:d})}removeEntry(s){const d=this.entries.indexOf(s);d>=0&&this.entries.splice(d,1)}clearToLastMarker(){const s=this.entries.indexOf(sIe);s>=0?this.entries.splice(0,s+1):this.entries.length=0}getElementEntryInScopeWithTagName(s){const d=this.entries.find(y=>y.type===v6.Marker||this.treeAdapter.getTagName(y.element)===s);return d&&d.type===v6.Element?d:null}getElementEntry(s){return this.entries.find(d=>d.type===v6.Element&&d.element===s)}}const ZS={createDocument(){return{nodeName:"#document",mode:C3.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(o,s,d){return{nodeName:o,tagName:o,attrs:d,namespaceURI:s,childNodes:[],parentNode:null}},createCommentNode(o){return{nodeName:"#comment",data:o,parentNode:null}},createTextNode(o){return{nodeName:"#text",value:o,parentNode:null}},appendChild(o,s){o.childNodes.push(s),s.parentNode=o},insertBefore(o,s,d){const y=o.childNodes.indexOf(d);o.childNodes.splice(y,0,s),s.parentNode=o},setTemplateContent(o,s){o.content=s},getTemplateContent(o){return o.content},setDocumentType(o,s,d,y){const S=o.childNodes.find(N=>N.nodeName==="#documentType");if(S)S.name=s,S.publicId=d,S.systemId=y;else{const N={nodeName:"#documentType",name:s,publicId:d,systemId:y,parentNode:null};ZS.appendChild(o,N)}},setDocumentMode(o,s){o.mode=s},getDocumentMode(o){return o.mode},detachNode(o){if(o.parentNode){const s=o.parentNode.childNodes.indexOf(o);o.parentNode.childNodes.splice(s,1),o.parentNode=null}},insertText(o,s){if(o.childNodes.length>0){const d=o.childNodes[o.childNodes.length-1];if(ZS.isTextNode(d)){d.value+=s;return}}ZS.appendChild(o,ZS.createTextNode(s))},insertTextBefore(o,s,d){const y=o.childNodes[o.childNodes.indexOf(d)-1];y&&ZS.isTextNode(y)?y.value+=s:ZS.insertBefore(o,ZS.createTextNode(s),d)},adoptAttributes(o,s){const d=new Set(o.attrs.map(y=>y.name));for(let y=0;y<s.length;y++)d.has(s[y].name)||o.attrs.push(s[y])},getFirstChild(o){return o.childNodes[0]},getChildNodes(o){return o.childNodes},getParentNode(o){return o.parentNode},getAttrList(o){return o.attrs},getTagName(o){return o.tagName},getNamespaceURI(o){return o.namespaceURI},getTextNodeContent(o){return o.value},getCommentNodeContent(o){return o.data},getDocumentTypeNodeName(o){return o.name},getDocumentTypeNodePublicId(o){return o.publicId},getDocumentTypeNodeSystemId(o){return o.systemId},isTextNode(o){return o.nodeName==="#text"},isCommentNode(o){return o.nodeName==="#comment"},isDocumentTypeNode(o){return o.nodeName==="#documentType"},isElementNode(o){return Object.prototype.hasOwnProperty.call(o,"tagName")},setNodeSourceCodeLocation(o,s){o.sourceCodeLocation=s},getNodeSourceCodeLocation(o){return o.sourceCodeLocation},updateNodeSourceCodeLocation(o,s){o.sourceCodeLocation={...o.sourceCodeLocation,...s}}},LMe="html",vKn="about:legacy-compat",_Kn="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",MMe=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],xKn=[...MMe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],EKn=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),PMe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],TKn=[...PMe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function oIe(o,s){return s.some(d=>o.startsWith(d))}function kKn(o){return o.name===LMe&&o.publicId===null&&(o.systemId===null||o.systemId===vKn)}function CKn(o){if(o.name!==LMe)return C3.QUIRKS;const{systemId:s}=o;if(s&&s.toLowerCase()===_Kn)return C3.QUIRKS;let{publicId:d}=o;if(d!==null){if(d=d.toLowerCase(),EKn.has(d))return C3.QUIRKS;let y=s===null?xKn:MMe;if(oIe(d,y))return C3.QUIRKS;if(y=s===null?PMe:TKn,oIe(d,y))return C3.LIMITED_QUIRKS}return C3.NO_QUIRKS}const cIe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},SKn="definitionurl",AKn="definitionURL",IKn=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(o=>[o.toLowerCase(),o])),OKn=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Bi.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Bi.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Bi.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Bi.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Bi.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Bi.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Bi.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Bi.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Bi.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Bi.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Bi.XMLNS}]]),NKn=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(o=>[o.toLowerCase(),o])),LKn=new Set([ft.B,ft.BIG,ft.BLOCKQUOTE,ft.BODY,ft.BR,ft.CENTER,ft.CODE,ft.DD,ft.DIV,ft.DL,ft.DT,ft.EM,ft.EMBED,ft.H1,ft.H2,ft.H3,ft.H4,ft.H5,ft.H6,ft.HEAD,ft.HR,ft.I,ft.IMG,ft.LI,ft.LISTING,ft.MENU,ft.META,ft.NOBR,ft.OL,ft.P,ft.PRE,ft.RUBY,ft.S,ft.SMALL,ft.SPAN,ft.STRONG,ft.STRIKE,ft.SUB,ft.SUP,ft.TABLE,ft.TT,ft.U,ft.UL,ft.VAR]);function MKn(o){const s=o.tagID;return s===ft.FONT&&o.attrs.some(({name:y})=>y===iL.COLOR||y===iL.SIZE||y===iL.FACE)||LKn.has(s)}function RMe(o){for(let s=0;s<o.attrs.length;s++)if(o.attrs[s].name===SKn){o.attrs[s].name=AKn;break}}function DMe(o){for(let s=0;s<o.attrs.length;s++){const d=IKn.get(o.attrs[s].name);d!=null&&(o.attrs[s].name=d)}}function cjt(o){for(let s=0;s<o.attrs.length;s++){const d=OKn.get(o.attrs[s].name);d&&(o.attrs[s].prefix=d.prefix,o.attrs[s].name=d.name,o.attrs[s].namespace=d.namespace)}}function PKn(o){const s=NKn.get(o.tagName);s!=null&&(o.tagName=s,o.tagID=s$(o.tagName))}function RKn(o,s){return s===Bi.MATHML&&(o===ft.MI||o===ft.MO||o===ft.MN||o===ft.MS||o===ft.MTEXT)}function DKn(o,s,d){if(s===Bi.MATHML&&o===ft.ANNOTATION_XML){for(let y=0;y<d.length;y++)if(d[y].name===iL.ENCODING){const S=d[y].value.toLowerCase();return S===cIe.TEXT_HTML||S===cIe.APPLICATION_XML}}return s===Bi.SVG&&(o===ft.FOREIGN_OBJECT||o===ft.DESC||o===ft.TITLE)}function BKn(o,s,d,y){return(!y||y===Bi.HTML)&&DKn(o,s,d)||(!y||y===Bi.MATHML)&&RKn(o,s)}const FKn="hidden",$Kn=8,jKn=3;var Qe;(function(o){o[o.INITIAL=0]="INITIAL",o[o.BEFORE_HTML=1]="BEFORE_HTML",o[o.BEFORE_HEAD=2]="BEFORE_HEAD",o[o.IN_HEAD=3]="IN_HEAD",o[o.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",o[o.AFTER_HEAD=5]="AFTER_HEAD",o[o.IN_BODY=6]="IN_BODY",o[o.TEXT=7]="TEXT",o[o.IN_TABLE=8]="IN_TABLE",o[o.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",o[o.IN_CAPTION=10]="IN_CAPTION",o[o.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",o[o.IN_TABLE_BODY=12]="IN_TABLE_BODY",o[o.IN_ROW=13]="IN_ROW",o[o.IN_CELL=14]="IN_CELL",o[o.IN_SELECT=15]="IN_SELECT",o[o.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",o[o.IN_TEMPLATE=17]="IN_TEMPLATE",o[o.AFTER_BODY=18]="AFTER_BODY",o[o.IN_FRAMESET=19]="IN_FRAMESET",o[o.AFTER_FRAMESET=20]="AFTER_FRAMESET",o[o.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",o[o.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(Qe||(Qe={}));const HKn={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},BMe=new Set([ft.TABLE,ft.TBODY,ft.TFOOT,ft.THEAD,ft.TR]),uIe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ZS,onParseError:null};class lIe{constructor(s,d,y=null,S=null){this.fragmentContext=y,this.scriptHandler=S,this.currentToken=null,this.stopped=!1,this.insertionMode=Qe.INITIAL,this.originalInsertionMode=Qe.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...uIe,...s},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=d??this.treeAdapter.createDocument(),this.tokenizer=new hKn(this.options,this),this.activeFormattingElements=new wKn(this.treeAdapter),this.fragmentContextID=y?s$(this.treeAdapter.getTagName(y)):ft.UNKNOWN,this._setContextModes(y??this.document,this.fragmentContextID),this.openElements=new yKn(this.document,this.treeAdapter,this)}static parse(s,d){const y=new this(d);return y.tokenizer.write(s,!0),y.document}static getFragmentParser(s,d){const y={...uIe,...d};s??(s=y.treeAdapter.createElement(tr.TEMPLATE,Bi.HTML,[]));const S=y.treeAdapter.createElement("documentmock",Bi.HTML,[]),N=new this(y,S,s);return N.fragmentContextID===ft.TEMPLATE&&N.tmplInsertionModeStack.unshift(Qe.IN_TEMPLATE),N._initTokenizerForFragmentParsing(),N._insertFakeRootElement(),N._resetInsertionMode(),N._findFormInFragmentContext(),N}getFragment(){const s=this.treeAdapter.getFirstChild(this.document),d=this.treeAdapter.createDocumentFragment();return this._adoptNodes(s,d),d}_err(s,d,y){var S;if(!this.onParseError)return;const N=(S=s.location)!==null&&S!==void 0?S:HKn,B={code:d,startLine:N.startLine,startCol:N.startCol,startOffset:N.startOffset,endLine:y?N.startLine:N.endLine,endCol:y?N.startCol:N.endCol,endOffset:y?N.startOffset:N.endOffset};this.onParseError(B)}onItemPush(s,d,y){var S,N;(N=(S=this.treeAdapter).onItemPush)===null||N===void 0||N.call(S,s),y&&this.openElements.stackTop>0&&this._setContextModes(s,d)}onItemPop(s,d){var y,S;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(s,this.currentToken),(S=(y=this.treeAdapter).onItemPop)===null||S===void 0||S.call(y,s,this.openElements.current),d){let N,B;this.openElements.stackTop===0&&this.fragmentContext?(N=this.fragmentContext,B=this.fragmentContextID):{current:N,currentTagId:B}=this.openElements,this._setContextModes(N,B)}}_setContextModes(s,d){const y=s===this.document||this.treeAdapter.getNamespaceURI(s)===Bi.HTML;this.currentNotInHTML=!y,this.tokenizer.inForeignNode=!y&&!this._isIntegrationPoint(d,s)}_switchToTextParsing(s,d){this._insertElement(s,Bi.HTML),this.tokenizer.state=d,this.originalInsertionMode=this.insertionMode,this.insertionMode=Qe.TEXT}switchToPlaintextParsing(){this.insertionMode=Qe.TEXT,this.originalInsertionMode=Qe.IN_BODY,this.tokenizer.state=I1.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let s=this.fragmentContext;for(;s;){if(this.treeAdapter.getTagName(s)===tr.FORM){this.formElement=s;break}s=this.treeAdapter.getParentNode(s)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Bi.HTML))switch(this.fragmentContextID){case ft.TITLE:case ft.TEXTAREA:{this.tokenizer.state=I1.RCDATA;break}case ft.STYLE:case ft.XMP:case ft.IFRAME:case ft.NOEMBED:case ft.NOFRAMES:case ft.NOSCRIPT:{this.tokenizer.state=I1.RAWTEXT;break}case ft.SCRIPT:{this.tokenizer.state=I1.SCRIPT_DATA;break}case ft.PLAINTEXT:{this.tokenizer.state=I1.PLAINTEXT;break}}}_setDocumentType(s){const d=s.name||"",y=s.publicId||"",S=s.systemId||"";if(this.treeAdapter.setDocumentType(this.document,d,y,S),s.location){const B=this.treeAdapter.getChildNodes(this.document).find(H=>this.treeAdapter.isDocumentTypeNode(H));B&&this.treeAdapter.setNodeSourceCodeLocation(B,s.location)}}_attachElementToTree(s,d){if(this.options.sourceCodeLocationInfo){const y=d&&{...d,startTag:d};this.treeAdapter.setNodeSourceCodeLocation(s,y)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(s);else{const y=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(y,s)}}_appendElement(s,d){const y=this.treeAdapter.createElement(s.tagName,d,s.attrs);this._attachElementToTree(y,s.location)}_insertElement(s,d){const y=this.treeAdapter.createElement(s.tagName,d,s.attrs);this._attachElementToTree(y,s.location),this.openElements.push(y,s.tagID)}_insertFakeElement(s,d){const y=this.treeAdapter.createElement(s,Bi.HTML,[]);this._attachElementToTree(y,null),this.openElements.push(y,d)}_insertTemplate(s){const d=this.treeAdapter.createElement(s.tagName,Bi.HTML,s.attrs),y=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(d,y),this._attachElementToTree(d,s.location),this.openElements.push(d,s.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(y,null)}_insertFakeRootElement(){const s=this.treeAdapter.createElement(tr.HTML,Bi.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null),this.treeAdapter.appendChild(this.openElements.current,s),this.openElements.push(s,ft.HTML)}_appendCommentNode(s,d){const y=this.treeAdapter.createCommentNode(s.data);this.treeAdapter.appendChild(d,y),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(y,s.location)}_insertCharacters(s){let d,y;if(this._shouldFosterParentOnInsertion()?({parent:d,beforeElement:y}=this._findFosterParentingLocation(),y?this.treeAdapter.insertTextBefore(d,s.chars,y):this.treeAdapter.insertText(d,s.chars)):(d=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(d,s.chars)),!s.location)return;const S=this.treeAdapter.getChildNodes(d),N=y?S.lastIndexOf(y):S.length,B=S[N-1];if(this.treeAdapter.getNodeSourceCodeLocation(B)){const{endLine:et,endCol:W,endOffset:nt}=s.location;this.treeAdapter.updateNodeSourceCodeLocation(B,{endLine:et,endCol:W,endOffset:nt})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(B,s.location)}_adoptNodes(s,d){for(let y=this.treeAdapter.getFirstChild(s);y;y=this.treeAdapter.getFirstChild(s))this.treeAdapter.detachNode(y),this.treeAdapter.appendChild(d,y)}_setEndLocation(s,d){if(this.treeAdapter.getNodeSourceCodeLocation(s)&&d.location){const y=d.location,S=this.treeAdapter.getTagName(s),N=d.type===Su.END_TAG&&S===d.tagName?{endTag:{...y},endLine:y.endLine,endCol:y.endCol,endOffset:y.endOffset}:{endLine:y.startLine,endCol:y.startCol,endOffset:y.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(s,N)}}shouldProcessStartTagTokenInForeignContent(s){if(!this.currentNotInHTML)return!1;let d,y;return this.openElements.stackTop===0&&this.fragmentContext?(d=this.fragmentContext,y=this.fragmentContextID):{current:d,currentTagId:y}=this.openElements,s.tagID===ft.SVG&&this.treeAdapter.getTagName(d)===tr.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(d)===Bi.MATHML?!1:this.tokenizer.inForeignNode||(s.tagID===ft.MGLYPH||s.tagID===ft.MALIGNMARK)&&!this._isIntegrationPoint(y,d,Bi.HTML)}_processToken(s){switch(s.type){case Su.CHARACTER:{this.onCharacter(s);break}case Su.NULL_CHARACTER:{this.onNullCharacter(s);break}case Su.COMMENT:{this.onComment(s);break}case Su.DOCTYPE:{this.onDoctype(s);break}case Su.START_TAG:{this._processStartTag(s);break}case Su.END_TAG:{this.onEndTag(s);break}case Su.EOF:{this.onEof(s);break}case Su.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(s);break}}}_isIntegrationPoint(s,d,y){const S=this.treeAdapter.getNamespaceURI(d),N=this.treeAdapter.getAttrList(d);return BKn(s,S,N,y)}_reconstructActiveFormattingElements(){const s=this.activeFormattingElements.entries.length;if(s){const d=this.activeFormattingElements.entries.findIndex(S=>S.type===v6.Marker||this.openElements.contains(S.element)),y=d<0?s-1:d-1;for(let S=y;S>=0;S--){const N=this.activeFormattingElements.entries[S];this._insertElement(N.token,this.treeAdapter.getNamespaceURI(N.element)),N.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Qe.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(ft.P),this.openElements.popUntilTagNamePopped(ft.P)}_resetInsertionMode(){for(let s=this.openElements.stackTop;s>=0;s--)switch(s===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[s]){case ft.TR:{this.insertionMode=Qe.IN_ROW;return}case ft.TBODY:case ft.THEAD:case ft.TFOOT:{this.insertionMode=Qe.IN_TABLE_BODY;return}case ft.CAPTION:{this.insertionMode=Qe.IN_CAPTION;return}case ft.COLGROUP:{this.insertionMode=Qe.IN_COLUMN_GROUP;return}case ft.TABLE:{this.insertionMode=Qe.IN_TABLE;return}case ft.BODY:{this.insertionMode=Qe.IN_BODY;return}case ft.FRAMESET:{this.insertionMode=Qe.IN_FRAMESET;return}case ft.SELECT:{this._resetInsertionModeForSelect(s);return}case ft.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case ft.HTML:{this.insertionMode=this.headElement?Qe.AFTER_HEAD:Qe.BEFORE_HEAD;return}case ft.TD:case ft.TH:{if(s>0){this.insertionMode=Qe.IN_CELL;return}break}case ft.HEAD:{if(s>0){this.insertionMode=Qe.IN_HEAD;return}break}}this.insertionMode=Qe.IN_BODY}_resetInsertionModeForSelect(s){if(s>0)for(let d=s-1;d>0;d--){const y=this.openElements.tagIDs[d];if(y===ft.TEMPLATE)break;if(y===ft.TABLE){this.insertionMode=Qe.IN_SELECT_IN_TABLE;return}}this.insertionMode=Qe.IN_SELECT}_isElementCausesFosterParenting(s){return BMe.has(s)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let s=this.openElements.stackTop;s>=0;s--){const d=this.openElements.items[s];switch(this.openElements.tagIDs[s]){case ft.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(d)===Bi.HTML)return{parent:this.treeAdapter.getTemplateContent(d),beforeElement:null};break}case ft.TABLE:{const y=this.treeAdapter.getParentNode(d);return y?{parent:y,beforeElement:d}:{parent:this.openElements.items[s-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(s){const d=this._findFosterParentingLocation();d.beforeElement?this.treeAdapter.insertBefore(d.parent,s,d.beforeElement):this.treeAdapter.appendChild(d.parent,s)}_isSpecialElement(s,d){const y=this.treeAdapter.getNamespaceURI(s);return oKn[y].has(d)}onCharacter(s){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){mGn(this,s);return}switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{LQ(this,s);break}case Qe.BEFORE_HEAD:{MQ(this,s);break}case Qe.IN_HEAD:{PQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{RQ(this,s);break}case Qe.AFTER_HEAD:{DQ(this,s);break}case Qe.IN_BODY:case Qe.IN_CAPTION:case Qe.IN_CELL:case Qe.IN_TEMPLATE:{$Me(this,s);break}case Qe.TEXT:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:{this._insertCharacters(s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{kBt(this,s);break}case Qe.IN_TABLE_TEXT:{WMe(this,s);break}case Qe.IN_COLUMN_GROUP:{$mt(this,s);break}case Qe.AFTER_BODY:{jmt(this,s);break}case Qe.AFTER_AFTER_BODY:{nmt(this,s);break}}}onNullCharacter(s){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){bGn(this,s);return}switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{LQ(this,s);break}case Qe.BEFORE_HEAD:{MQ(this,s);break}case Qe.IN_HEAD:{PQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{RQ(this,s);break}case Qe.AFTER_HEAD:{DQ(this,s);break}case Qe.TEXT:{this._insertCharacters(s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{kBt(this,s);break}case Qe.IN_COLUMN_GROUP:{$mt(this,s);break}case Qe.AFTER_BODY:{jmt(this,s);break}case Qe.AFTER_AFTER_BODY:{nmt(this,s);break}}}onComment(s){if(this.skipNextNewLine=!1,this.currentNotInHTML){UFt(this,s);return}switch(this.insertionMode){case Qe.INITIAL:case Qe.BEFORE_HTML:case Qe.BEFORE_HEAD:case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:case Qe.IN_BODY:case Qe.IN_TABLE:case Qe.IN_CAPTION:case Qe.IN_COLUMN_GROUP:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:case Qe.IN_CELL:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:case Qe.IN_TEMPLATE:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:{UFt(this,s);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}case Qe.AFTER_BODY:{GKn(this,s);break}case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{VKn(this,s);break}}}onDoctype(s){switch(this.skipNextNewLine=!1,this.insertionMode){case Qe.INITIAL:{XKn(this,s);break}case Qe.BEFORE_HEAD:case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:{this._err(s,Dr.misplacedDoctype);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}}}onStartTag(s){this.skipNextNewLine=!1,this.currentToken=s,this._processStartTag(s),s.selfClosing&&!s.ackSelfClosing&&this._err(s,Dr.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(s){this.shouldProcessStartTagTokenInForeignContent(s)?yGn(this,s):this._startTagOutsideForeignContent(s)}_startTagOutsideForeignContent(s){switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{QKn(this,s);break}case Qe.BEFORE_HEAD:{ZKn(this,s);break}case Qe.IN_HEAD:{i5(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{nYn(this,s);break}case Qe.AFTER_HEAD:{iYn(this,s);break}case Qe.IN_BODY:{Tb(this,s);break}case Qe.IN_TABLE:{YF(this,s);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}case Qe.IN_CAPTION:{tGn(this,s);break}case Qe.IN_COLUMN_GROUP:{hjt(this,s);break}case Qe.IN_TABLE_BODY:{x2t(this,s);break}case Qe.IN_ROW:{E2t(this,s);break}case Qe.IN_CELL:{rGn(this,s);break}case Qe.IN_SELECT:{GMe(this,s);break}case Qe.IN_SELECT_IN_TABLE:{aGn(this,s);break}case Qe.IN_TEMPLATE:{oGn(this,s);break}case Qe.AFTER_BODY:{uGn(this,s);break}case Qe.IN_FRAMESET:{lGn(this,s);break}case Qe.AFTER_FRAMESET:{fGn(this,s);break}case Qe.AFTER_AFTER_BODY:{pGn(this,s);break}case Qe.AFTER_AFTER_FRAMESET:{gGn(this,s);break}}}onEndTag(s){this.skipNextNewLine=!1,this.currentToken=s,this.currentNotInHTML?wGn(this,s):this._endTagOutsideForeignContent(s)}_endTagOutsideForeignContent(s){switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{JKn(this,s);break}case Qe.BEFORE_HEAD:{tYn(this,s);break}case Qe.IN_HEAD:{eYn(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{rYn(this,s);break}case Qe.AFTER_HEAD:{aYn(this,s);break}case Qe.IN_BODY:{_2t(this,s);break}case Qe.TEXT:{qYn(this,s);break}case Qe.IN_TABLE:{YQ(this,s);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}case Qe.IN_CAPTION:{eGn(this,s);break}case Qe.IN_COLUMN_GROUP:{nGn(this,s);break}case Qe.IN_TABLE_BODY:{qFt(this,s);break}case Qe.IN_ROW:{YMe(this,s);break}case Qe.IN_CELL:{iGn(this,s);break}case Qe.IN_SELECT:{VMe(this,s);break}case Qe.IN_SELECT_IN_TABLE:{sGn(this,s);break}case Qe.IN_TEMPLATE:{cGn(this,s);break}case Qe.AFTER_BODY:{QMe(this,s);break}case Qe.IN_FRAMESET:{hGn(this,s);break}case Qe.AFTER_FRAMESET:{dGn(this,s);break}case Qe.AFTER_AFTER_BODY:{nmt(this,s);break}}}onEof(s){switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{LQ(this,s);break}case Qe.BEFORE_HEAD:{MQ(this,s);break}case Qe.IN_HEAD:{PQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{RQ(this,s);break}case Qe.AFTER_HEAD:{DQ(this,s);break}case Qe.IN_BODY:case Qe.IN_TABLE:case Qe.IN_CAPTION:case Qe.IN_COLUMN_GROUP:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:case Qe.IN_CELL:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:{UMe(this,s);break}case Qe.TEXT:{WYn(this,s);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}case Qe.IN_TEMPLATE:{XMe(this,s);break}case Qe.AFTER_BODY:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{ljt(this,s);break}}}onWhitespaceCharacter(s){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,s.chars.charCodeAt(0)===_e.LINE_FEED)){if(s.chars.length===1)return;s.chars=s.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(s);return}switch(this.insertionMode){case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:case Qe.TEXT:case Qe.IN_COLUMN_GROUP:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:{this._insertCharacters(s);break}case Qe.IN_BODY:case Qe.IN_CAPTION:case Qe.IN_CELL:case Qe.IN_TEMPLATE:case Qe.AFTER_BODY:case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{FMe(this,s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{kBt(this,s);break}case Qe.IN_TABLE_TEXT:{qMe(this,s);break}}}}function zKn(o,s){let d=o.activeFormattingElements.getElementEntryInScopeWithTagName(s.tagName);return d?o.openElements.contains(d.element)?o.openElements.hasInScope(s.tagID)||(d=null):(o.activeFormattingElements.removeEntry(d),d=null):zMe(o,s),d}function UKn(o,s){let d=null,y=o.openElements.stackTop;for(;y>=0;y--){const S=o.openElements.items[y];if(S===s.element)break;o._isSpecialElement(S,o.openElements.tagIDs[y])&&(d=S)}return d||(o.openElements.shortenToLength(y<0?0:y),o.activeFormattingElements.removeEntry(s)),d}function qKn(o,s,d){let y=s,S=o.openElements.getCommonAncestor(s);for(let N=0,B=S;B!==d;N++,B=S){S=o.openElements.getCommonAncestor(B);const H=o.activeFormattingElements.getElementEntry(B),et=H&&N>=jKn;!H||et?(et&&o.activeFormattingElements.removeEntry(H),o.openElements.remove(B)):(B=WKn(o,H),y===s&&(o.activeFormattingElements.bookmark=H),o.treeAdapter.detachNode(y),o.treeAdapter.appendChild(B,y),y=B)}return y}function WKn(o,s){const d=o.treeAdapter.getNamespaceURI(s.element),y=o.treeAdapter.createElement(s.token.tagName,d,s.token.attrs);return o.openElements.replace(s.element,y),s.element=y,y}function KKn(o,s,d){const y=o.treeAdapter.getTagName(s),S=s$(y);if(o._isElementCausesFosterParenting(S))o._fosterParentElement(d);else{const N=o.treeAdapter.getNamespaceURI(s);S===ft.TEMPLATE&&N===Bi.HTML&&(s=o.treeAdapter.getTemplateContent(s)),o.treeAdapter.appendChild(s,d)}}function YKn(o,s,d){const y=o.treeAdapter.getNamespaceURI(d.element),{token:S}=d,N=o.treeAdapter.createElement(S.tagName,y,S.attrs);o._adoptNodes(s,N),o.treeAdapter.appendChild(s,N),o.activeFormattingElements.insertElementAfterBookmark(N,S),o.activeFormattingElements.removeEntry(d),o.openElements.remove(d.element),o.openElements.insertAfter(s,N,S.tagID)}function ujt(o,s){for(let d=0;d<$Kn;d++){const y=zKn(o,s);if(!y)break;const S=UKn(o,y);if(!S)break;o.activeFormattingElements.bookmark=y;const N=qKn(o,S,y.element),B=o.openElements.getCommonAncestor(y.element);o.treeAdapter.detachNode(N),B&&KKn(o,B,N),YKn(o,S,y)}}function UFt(o,s){o._appendCommentNode(s,o.openElements.currentTmplContentOrNode)}function GKn(o,s){o._appendCommentNode(s,o.openElements.items[0])}function VKn(o,s){o._appendCommentNode(s,o.document)}function ljt(o,s){if(o.stopped=!0,s.location){const d=o.fragmentContext?0:2;for(let y=o.openElements.stackTop;y>=d;y--)o._setEndLocation(o.openElements.items[y],s);if(!o.fragmentContext&&o.openElements.stackTop>=0){const y=o.openElements.items[0],S=o.treeAdapter.getNodeSourceCodeLocation(y);if(S&&!S.endTag&&(o._setEndLocation(y,s),o.openElements.stackTop>=1)){const N=o.openElements.items[1],B=o.treeAdapter.getNodeSourceCodeLocation(N);B&&!B.endTag&&o._setEndLocation(N,s)}}}}function XKn(o,s){o._setDocumentType(s);const d=s.forceQuirks?C3.QUIRKS:CKn(s);kKn(s)||o._err(s,Dr.nonConformingDoctype),o.treeAdapter.setDocumentMode(o.document,d),o.insertionMode=Qe.BEFORE_HTML}function oQ(o,s){o._err(s,Dr.missingDoctype,!0),o.treeAdapter.setDocumentMode(o.document,C3.QUIRKS),o.insertionMode=Qe.BEFORE_HTML,o._processToken(s)}function QKn(o,s){s.tagID===ft.HTML?(o._insertElement(s,Bi.HTML),o.insertionMode=Qe.BEFORE_HEAD):LQ(o,s)}function JKn(o,s){const d=s.tagID;(d===ft.HTML||d===ft.HEAD||d===ft.BODY||d===ft.BR)&&LQ(o,s)}function LQ(o,s){o._insertFakeRootElement(),o.insertionMode=Qe.BEFORE_HEAD,o._processToken(s)}function ZKn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.HEAD:{o._insertElement(s,Bi.HTML),o.headElement=o.openElements.current,o.insertionMode=Qe.IN_HEAD;break}default:MQ(o,s)}}function tYn(o,s){const d=s.tagID;d===ft.HEAD||d===ft.BODY||d===ft.HTML||d===ft.BR?MQ(o,s):o._err(s,Dr.endTagWithoutMatchingOpenElement)}function MQ(o,s){o._insertFakeElement(tr.HEAD,ft.HEAD),o.headElement=o.openElements.current,o.insertionMode=Qe.IN_HEAD,o._processToken(s)}function i5(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.BASE:case ft.BASEFONT:case ft.BGSOUND:case ft.LINK:case ft.META:{o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0;break}case ft.TITLE:{o._switchToTextParsing(s,I1.RCDATA);break}case ft.NOSCRIPT:{o.options.scriptingEnabled?o._switchToTextParsing(s,I1.RAWTEXT):(o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_HEAD_NO_SCRIPT);break}case ft.NOFRAMES:case ft.STYLE:{o._switchToTextParsing(s,I1.RAWTEXT);break}case ft.SCRIPT:{o._switchToTextParsing(s,I1.SCRIPT_DATA);break}case ft.TEMPLATE:{o._insertTemplate(s),o.activeFormattingElements.insertMarker(),o.framesetOk=!1,o.insertionMode=Qe.IN_TEMPLATE,o.tmplInsertionModeStack.unshift(Qe.IN_TEMPLATE);break}case ft.HEAD:{o._err(s,Dr.misplacedStartTagForHeadElement);break}default:PQ(o,s)}}function eYn(o,s){switch(s.tagID){case ft.HEAD:{o.openElements.pop(),o.insertionMode=Qe.AFTER_HEAD;break}case ft.BODY:case ft.BR:case ft.HTML:{PQ(o,s);break}case ft.TEMPLATE:{fL(o,s);break}default:o._err(s,Dr.endTagWithoutMatchingOpenElement)}}function fL(o,s){o.openElements.tmplCount>0?(o.openElements.generateImpliedEndTagsThoroughly(),o.openElements.currentTagId!==ft.TEMPLATE&&o._err(s,Dr.closingOfElementWithOpenChildElements),o.openElements.popUntilTagNamePopped(ft.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode()):o._err(s,Dr.endTagWithoutMatchingOpenElement)}function PQ(o,s){o.openElements.pop(),o.insertionMode=Qe.AFTER_HEAD,o._processToken(s)}function nYn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.BASEFONT:case ft.BGSOUND:case ft.HEAD:case ft.LINK:case ft.META:case ft.NOFRAMES:case ft.STYLE:{i5(o,s);break}case ft.NOSCRIPT:{o._err(s,Dr.nestedNoscriptInHead);break}default:RQ(o,s)}}function rYn(o,s){switch(s.tagID){case ft.NOSCRIPT:{o.openElements.pop(),o.insertionMode=Qe.IN_HEAD;break}case ft.BR:{RQ(o,s);break}default:o._err(s,Dr.endTagWithoutMatchingOpenElement)}}function RQ(o,s){const d=s.type===Su.EOF?Dr.openElementsLeftAfterEof:Dr.disallowedContentInNoscriptInHead;o._err(s,d),o.openElements.pop(),o.insertionMode=Qe.IN_HEAD,o._processToken(s)}function iYn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.BODY:{o._insertElement(s,Bi.HTML),o.framesetOk=!1,o.insertionMode=Qe.IN_BODY;break}case ft.FRAMESET:{o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_FRAMESET;break}case ft.BASE:case ft.BASEFONT:case ft.BGSOUND:case ft.LINK:case ft.META:case ft.NOFRAMES:case ft.SCRIPT:case ft.STYLE:case ft.TEMPLATE:case ft.TITLE:{o._err(s,Dr.abandonedHeadElementChild),o.openElements.push(o.headElement,ft.HEAD),i5(o,s),o.openElements.remove(o.headElement);break}case ft.HEAD:{o._err(s,Dr.misplacedStartTagForHeadElement);break}default:DQ(o,s)}}function aYn(o,s){switch(s.tagID){case ft.BODY:case ft.HTML:case ft.BR:{DQ(o,s);break}case ft.TEMPLATE:{fL(o,s);break}default:o._err(s,Dr.endTagWithoutMatchingOpenElement)}}function DQ(o,s){o._insertFakeElement(tr.BODY,ft.BODY),o.insertionMode=Qe.IN_BODY,v2t(o,s)}function v2t(o,s){switch(s.type){case Su.CHARACTER:{$Me(o,s);break}case Su.WHITESPACE_CHARACTER:{FMe(o,s);break}case Su.COMMENT:{UFt(o,s);break}case Su.START_TAG:{Tb(o,s);break}case Su.END_TAG:{_2t(o,s);break}case Su.EOF:{UMe(o,s);break}}}function FMe(o,s){o._reconstructActiveFormattingElements(),o._insertCharacters(s)}function $Me(o,s){o._reconstructActiveFormattingElements(),o._insertCharacters(s),o.framesetOk=!1}function sYn(o,s){o.openElements.tmplCount===0&&o.treeAdapter.adoptAttributes(o.openElements.items[0],s.attrs)}function oYn(o,s){const d=o.openElements.tryPeekProperlyNestedBodyElement();d&&o.openElements.tmplCount===0&&(o.framesetOk=!1,o.treeAdapter.adoptAttributes(d,s.attrs))}function cYn(o,s){const d=o.openElements.tryPeekProperlyNestedBodyElement();o.framesetOk&&d&&(o.treeAdapter.detachNode(d),o.openElements.popAllUpToHtmlElement(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_FRAMESET)}function uYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML)}function lYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),zFt.has(o.openElements.currentTagId)&&o.openElements.pop(),o._insertElement(s,Bi.HTML)}function hYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML),o.skipNextNewLine=!0,o.framesetOk=!1}function fYn(o,s){const d=o.openElements.tmplCount>0;(!o.formElement||d)&&(o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML),d||(o.formElement=o.openElements.current))}function dYn(o,s){o.framesetOk=!1;const d=s.tagID;for(let y=o.openElements.stackTop;y>=0;y--){const S=o.openElements.tagIDs[y];if(d===ft.LI&&S===ft.LI||(d===ft.DD||d===ft.DT)&&(S===ft.DD||S===ft.DT)){o.openElements.generateImpliedEndTagsWithExclusion(S),o.openElements.popUntilTagNamePopped(S);break}if(S!==ft.ADDRESS&&S!==ft.DIV&&S!==ft.P&&o._isSpecialElement(o.openElements.items[y],S))break}o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML)}function pYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML),o.tokenizer.state=I1.PLAINTEXT}function gYn(o,s){o.openElements.hasInScope(ft.BUTTON)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(ft.BUTTON)),o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.framesetOk=!1}function bYn(o,s){const d=o.activeFormattingElements.getElementEntryInScopeWithTagName(tr.A);d&&(ujt(o,s),o.openElements.remove(d.element),o.activeFormattingElements.removeEntry(d)),o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function mYn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function yYn(o,s){o._reconstructActiveFormattingElements(),o.openElements.hasInScope(ft.NOBR)&&(ujt(o,s),o._reconstructActiveFormattingElements()),o._insertElement(s,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function wYn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.activeFormattingElements.insertMarker(),o.framesetOk=!1}function vYn(o,s){o.treeAdapter.getDocumentMode(o.document)!==C3.QUIRKS&&o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML),o.framesetOk=!1,o.insertionMode=Qe.IN_TABLE}function jMe(o,s){o._reconstructActiveFormattingElements(),o._appendElement(s,Bi.HTML),o.framesetOk=!1,s.ackSelfClosing=!0}function HMe(o){const s=CMe(o,iL.TYPE);return s!=null&&s.toLowerCase()===FKn}function _Yn(o,s){o._reconstructActiveFormattingElements(),o._appendElement(s,Bi.HTML),HMe(s)||(o.framesetOk=!1),s.ackSelfClosing=!0}function xYn(o,s){o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0}function EYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._appendElement(s,Bi.HTML),o.framesetOk=!1,s.ackSelfClosing=!0}function TYn(o,s){s.tagName=tr.IMG,s.tagID=ft.IMG,jMe(o,s)}function kYn(o,s){o._insertElement(s,Bi.HTML),o.skipNextNewLine=!0,o.tokenizer.state=I1.RCDATA,o.originalInsertionMode=o.insertionMode,o.framesetOk=!1,o.insertionMode=Qe.TEXT}function CYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._reconstructActiveFormattingElements(),o.framesetOk=!1,o._switchToTextParsing(s,I1.RAWTEXT)}function SYn(o,s){o.framesetOk=!1,o._switchToTextParsing(s,I1.RAWTEXT)}function hIe(o,s){o._switchToTextParsing(s,I1.RAWTEXT)}function AYn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.framesetOk=!1,o.insertionMode=o.insertionMode===Qe.IN_TABLE||o.insertionMode===Qe.IN_CAPTION||o.insertionMode===Qe.IN_TABLE_BODY||o.insertionMode===Qe.IN_ROW||o.insertionMode===Qe.IN_CELL?Qe.IN_SELECT_IN_TABLE:Qe.IN_SELECT}function IYn(o,s){o.openElements.currentTagId===ft.OPTION&&o.openElements.pop(),o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML)}function OYn(o,s){o.openElements.hasInScope(ft.RUBY)&&o.openElements.generateImpliedEndTags(),o._insertElement(s,Bi.HTML)}function NYn(o,s){o.openElements.hasInScope(ft.RUBY)&&o.openElements.generateImpliedEndTagsWithExclusion(ft.RTC),o._insertElement(s,Bi.HTML)}function LYn(o,s){o._reconstructActiveFormattingElements(),RMe(s),cjt(s),s.selfClosing?o._appendElement(s,Bi.MATHML):o._insertElement(s,Bi.MATHML),s.ackSelfClosing=!0}function MYn(o,s){o._reconstructActiveFormattingElements(),DMe(s),cjt(s),s.selfClosing?o._appendElement(s,Bi.SVG):o._insertElement(s,Bi.SVG),s.ackSelfClosing=!0}function fIe(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML)}function Tb(o,s){switch(s.tagID){case ft.I:case ft.S:case ft.B:case ft.U:case ft.EM:case ft.TT:case ft.BIG:case ft.CODE:case ft.FONT:case ft.SMALL:case ft.STRIKE:case ft.STRONG:{mYn(o,s);break}case ft.A:{bYn(o,s);break}case ft.H1:case ft.H2:case ft.H3:case ft.H4:case ft.H5:case ft.H6:{lYn(o,s);break}case ft.P:case ft.DL:case ft.OL:case ft.UL:case ft.DIV:case ft.DIR:case ft.NAV:case ft.MAIN:case ft.MENU:case ft.ASIDE:case ft.CENTER:case ft.FIGURE:case ft.FOOTER:case ft.HEADER:case ft.HGROUP:case ft.DIALOG:case ft.DETAILS:case ft.ADDRESS:case ft.ARTICLE:case ft.SEARCH:case ft.SECTION:case ft.SUMMARY:case ft.FIELDSET:case ft.BLOCKQUOTE:case ft.FIGCAPTION:{uYn(o,s);break}case ft.LI:case ft.DD:case ft.DT:{dYn(o,s);break}case ft.BR:case ft.IMG:case ft.WBR:case ft.AREA:case ft.EMBED:case ft.KEYGEN:{jMe(o,s);break}case ft.HR:{EYn(o,s);break}case ft.RB:case ft.RTC:{OYn(o,s);break}case ft.RT:case ft.RP:{NYn(o,s);break}case ft.PRE:case ft.LISTING:{hYn(o,s);break}case ft.XMP:{CYn(o,s);break}case ft.SVG:{MYn(o,s);break}case ft.HTML:{sYn(o,s);break}case ft.BASE:case ft.LINK:case ft.META:case ft.STYLE:case ft.TITLE:case ft.SCRIPT:case ft.BGSOUND:case ft.BASEFONT:case ft.TEMPLATE:{i5(o,s);break}case ft.BODY:{oYn(o,s);break}case ft.FORM:{fYn(o,s);break}case ft.NOBR:{yYn(o,s);break}case ft.MATH:{LYn(o,s);break}case ft.TABLE:{vYn(o,s);break}case ft.INPUT:{_Yn(o,s);break}case ft.PARAM:case ft.TRACK:case ft.SOURCE:{xYn(o,s);break}case ft.IMAGE:{TYn(o,s);break}case ft.BUTTON:{gYn(o,s);break}case ft.APPLET:case ft.OBJECT:case ft.MARQUEE:{wYn(o,s);break}case ft.IFRAME:{SYn(o,s);break}case ft.SELECT:{AYn(o,s);break}case ft.OPTION:case ft.OPTGROUP:{IYn(o,s);break}case ft.NOEMBED:case ft.NOFRAMES:{hIe(o,s);break}case ft.FRAMESET:{cYn(o,s);break}case ft.TEXTAREA:{kYn(o,s);break}case ft.NOSCRIPT:{o.options.scriptingEnabled?hIe(o,s):fIe(o,s);break}case ft.PLAINTEXT:{pYn(o,s);break}case ft.COL:case ft.TH:case ft.TD:case ft.TR:case ft.HEAD:case ft.FRAME:case ft.TBODY:case ft.TFOOT:case ft.THEAD:case ft.CAPTION:case ft.COLGROUP:break;default:fIe(o,s)}}function PYn(o,s){if(o.openElements.hasInScope(ft.BODY)&&(o.insertionMode=Qe.AFTER_BODY,o.options.sourceCodeLocationInfo)){const d=o.openElements.tryPeekProperlyNestedBodyElement();d&&o._setEndLocation(d,s)}}function RYn(o,s){o.openElements.hasInScope(ft.BODY)&&(o.insertionMode=Qe.AFTER_BODY,QMe(o,s))}function DYn(o,s){const d=s.tagID;o.openElements.hasInScope(d)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(d))}function BYn(o){const s=o.openElements.tmplCount>0,{formElement:d}=o;s||(o.formElement=null),(d||s)&&o.openElements.hasInScope(ft.FORM)&&(o.openElements.generateImpliedEndTags(),s?o.openElements.popUntilTagNamePopped(ft.FORM):d&&o.openElements.remove(d))}function FYn(o){o.openElements.hasInButtonScope(ft.P)||o._insertFakeElement(tr.P,ft.P),o._closePElement()}function $Yn(o){o.openElements.hasInListItemScope(ft.LI)&&(o.openElements.generateImpliedEndTagsWithExclusion(ft.LI),o.openElements.popUntilTagNamePopped(ft.LI))}function jYn(o,s){const d=s.tagID;o.openElements.hasInScope(d)&&(o.openElements.generateImpliedEndTagsWithExclusion(d),o.openElements.popUntilTagNamePopped(d))}function HYn(o){o.openElements.hasNumberedHeaderInScope()&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilNumberedHeaderPopped())}function zYn(o,s){const d=s.tagID;o.openElements.hasInScope(d)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(d),o.activeFormattingElements.clearToLastMarker())}function UYn(o){o._reconstructActiveFormattingElements(),o._insertFakeElement(tr.BR,ft.BR),o.openElements.pop(),o.framesetOk=!1}function zMe(o,s){const d=s.tagName,y=s.tagID;for(let S=o.openElements.stackTop;S>0;S--){const N=o.openElements.items[S],B=o.openElements.tagIDs[S];if(y===B&&(y!==ft.UNKNOWN||o.treeAdapter.getTagName(N)===d)){o.openElements.generateImpliedEndTagsWithExclusion(y),o.openElements.stackTop>=S&&o.openElements.shortenToLength(S);break}if(o._isSpecialElement(N,B))break}}function _2t(o,s){switch(s.tagID){case ft.A:case ft.B:case ft.I:case ft.S:case ft.U:case ft.EM:case ft.TT:case ft.BIG:case ft.CODE:case ft.FONT:case ft.NOBR:case ft.SMALL:case ft.STRIKE:case ft.STRONG:{ujt(o,s);break}case ft.P:{FYn(o);break}case ft.DL:case ft.UL:case ft.OL:case ft.DIR:case ft.DIV:case ft.NAV:case ft.PRE:case ft.MAIN:case ft.MENU:case ft.ASIDE:case ft.BUTTON:case ft.CENTER:case ft.FIGURE:case ft.FOOTER:case ft.HEADER:case ft.HGROUP:case ft.DIALOG:case ft.ADDRESS:case ft.ARTICLE:case ft.DETAILS:case ft.SEARCH:case ft.SECTION:case ft.SUMMARY:case ft.LISTING:case ft.FIELDSET:case ft.BLOCKQUOTE:case ft.FIGCAPTION:{DYn(o,s);break}case ft.LI:{$Yn(o);break}case ft.DD:case ft.DT:{jYn(o,s);break}case ft.H1:case ft.H2:case ft.H3:case ft.H4:case ft.H5:case ft.H6:{HYn(o);break}case ft.BR:{UYn(o);break}case ft.BODY:{PYn(o,s);break}case ft.HTML:{RYn(o,s);break}case ft.FORM:{BYn(o);break}case ft.APPLET:case ft.OBJECT:case ft.MARQUEE:{zYn(o,s);break}case ft.TEMPLATE:{fL(o,s);break}default:zMe(o,s)}}function UMe(o,s){o.tmplInsertionModeStack.length>0?XMe(o,s):ljt(o,s)}function qYn(o,s){var d;s.tagID===ft.SCRIPT&&((d=o.scriptHandler)===null||d===void 0||d.call(o,o.openElements.current)),o.openElements.pop(),o.insertionMode=o.originalInsertionMode}function WYn(o,s){o._err(s,Dr.eofInElementThatCanContainOnlyText),o.openElements.pop(),o.insertionMode=o.originalInsertionMode,o.onEof(s)}function kBt(o,s){if(BMe.has(o.openElements.currentTagId))switch(o.pendingCharacterTokens.length=0,o.hasNonWhitespacePendingCharacterToken=!1,o.originalInsertionMode=o.insertionMode,o.insertionMode=Qe.IN_TABLE_TEXT,s.type){case Su.CHARACTER:{WMe(o,s);break}case Su.WHITESPACE_CHARACTER:{qMe(o,s);break}}else aJ(o,s)}function KYn(o,s){o.openElements.clearBackToTableContext(),o.activeFormattingElements.insertMarker(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_CAPTION}function YYn(o,s){o.openElements.clearBackToTableContext(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_COLUMN_GROUP}function GYn(o,s){o.openElements.clearBackToTableContext(),o._insertFakeElement(tr.COLGROUP,ft.COLGROUP),o.insertionMode=Qe.IN_COLUMN_GROUP,hjt(o,s)}function VYn(o,s){o.openElements.clearBackToTableContext(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_TABLE_BODY}function XYn(o,s){o.openElements.clearBackToTableContext(),o._insertFakeElement(tr.TBODY,ft.TBODY),o.insertionMode=Qe.IN_TABLE_BODY,x2t(o,s)}function QYn(o,s){o.openElements.hasInTableScope(ft.TABLE)&&(o.openElements.popUntilTagNamePopped(ft.TABLE),o._resetInsertionMode(),o._processStartTag(s))}function JYn(o,s){HMe(s)?o._appendElement(s,Bi.HTML):aJ(o,s),s.ackSelfClosing=!0}function ZYn(o,s){!o.formElement&&o.openElements.tmplCount===0&&(o._insertElement(s,Bi.HTML),o.formElement=o.openElements.current,o.openElements.pop())}function YF(o,s){switch(s.tagID){case ft.TD:case ft.TH:case ft.TR:{XYn(o,s);break}case ft.STYLE:case ft.SCRIPT:case ft.TEMPLATE:{i5(o,s);break}case ft.COL:{GYn(o,s);break}case ft.FORM:{ZYn(o,s);break}case ft.TABLE:{QYn(o,s);break}case ft.TBODY:case ft.TFOOT:case ft.THEAD:{VYn(o,s);break}case ft.INPUT:{JYn(o,s);break}case ft.CAPTION:{KYn(o,s);break}case ft.COLGROUP:{YYn(o,s);break}default:aJ(o,s)}}function YQ(o,s){switch(s.tagID){case ft.TABLE:{o.openElements.hasInTableScope(ft.TABLE)&&(o.openElements.popUntilTagNamePopped(ft.TABLE),o._resetInsertionMode());break}case ft.TEMPLATE:{fL(o,s);break}case ft.BODY:case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.HTML:case ft.TBODY:case ft.TD:case ft.TFOOT:case ft.TH:case ft.THEAD:case ft.TR:break;default:aJ(o,s)}}function aJ(o,s){const d=o.fosterParentingEnabled;o.fosterParentingEnabled=!0,v2t(o,s),o.fosterParentingEnabled=d}function qMe(o,s){o.pendingCharacterTokens.push(s)}function WMe(o,s){o.pendingCharacterTokens.push(s),o.hasNonWhitespacePendingCharacterToken=!0}function cQ(o,s){let d=0;if(o.hasNonWhitespacePendingCharacterToken)for(;d<o.pendingCharacterTokens.length;d++)aJ(o,o.pendingCharacterTokens[d]);else for(;d<o.pendingCharacterTokens.length;d++)o._insertCharacters(o.pendingCharacterTokens[d]);o.insertionMode=o.originalInsertionMode,o._processToken(s)}const KMe=new Set([ft.CAPTION,ft.COL,ft.COLGROUP,ft.TBODY,ft.TD,ft.TFOOT,ft.TH,ft.THEAD,ft.TR]);function tGn(o,s){const d=s.tagID;KMe.has(d)?o.openElements.hasInTableScope(ft.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(ft.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_TABLE,YF(o,s)):Tb(o,s)}function eGn(o,s){const d=s.tagID;switch(d){case ft.CAPTION:case ft.TABLE:{o.openElements.hasInTableScope(ft.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(ft.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_TABLE,d===ft.TABLE&&YQ(o,s));break}case ft.BODY:case ft.COL:case ft.COLGROUP:case ft.HTML:case ft.TBODY:case ft.TD:case ft.TFOOT:case ft.TH:case ft.THEAD:case ft.TR:break;default:_2t(o,s)}}function hjt(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.COL:{o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0;break}case ft.TEMPLATE:{i5(o,s);break}default:$mt(o,s)}}function nGn(o,s){switch(s.tagID){case ft.COLGROUP:{o.openElements.currentTagId===ft.COLGROUP&&(o.openElements.pop(),o.insertionMode=Qe.IN_TABLE);break}case ft.TEMPLATE:{fL(o,s);break}case ft.COL:break;default:$mt(o,s)}}function $mt(o,s){o.openElements.currentTagId===ft.COLGROUP&&(o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,o._processToken(s))}function x2t(o,s){switch(s.tagID){case ft.TR:{o.openElements.clearBackToTableBodyContext(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_ROW;break}case ft.TH:case ft.TD:{o.openElements.clearBackToTableBodyContext(),o._insertFakeElement(tr.TR,ft.TR),o.insertionMode=Qe.IN_ROW,E2t(o,s);break}case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.TBODY:case ft.TFOOT:case ft.THEAD:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,YF(o,s));break}default:YF(o,s)}}function qFt(o,s){const d=s.tagID;switch(s.tagID){case ft.TBODY:case ft.TFOOT:case ft.THEAD:{o.openElements.hasInTableScope(d)&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE);break}case ft.TABLE:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,YQ(o,s));break}case ft.BODY:case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.HTML:case ft.TD:case ft.TH:case ft.TR:break;default:YQ(o,s)}}function E2t(o,s){switch(s.tagID){case ft.TH:case ft.TD:{o.openElements.clearBackToTableRowContext(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_CELL,o.activeFormattingElements.insertMarker();break}case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.TBODY:case ft.TFOOT:case ft.THEAD:case ft.TR:{o.openElements.hasInTableScope(ft.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,x2t(o,s));break}default:YF(o,s)}}function YMe(o,s){switch(s.tagID){case ft.TR:{o.openElements.hasInTableScope(ft.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY);break}case ft.TABLE:{o.openElements.hasInTableScope(ft.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,qFt(o,s));break}case ft.TBODY:case ft.TFOOT:case ft.THEAD:{(o.openElements.hasInTableScope(s.tagID)||o.openElements.hasInTableScope(ft.TR))&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,qFt(o,s));break}case ft.BODY:case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.HTML:case ft.TD:case ft.TH:break;default:YQ(o,s)}}function rGn(o,s){const d=s.tagID;KMe.has(d)?(o.openElements.hasInTableScope(ft.TD)||o.openElements.hasInTableScope(ft.TH))&&(o._closeTableCell(),E2t(o,s)):Tb(o,s)}function iGn(o,s){const d=s.tagID;switch(d){case ft.TD:case ft.TH:{o.openElements.hasInTableScope(d)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(d),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_ROW);break}case ft.TABLE:case ft.TBODY:case ft.TFOOT:case ft.THEAD:case ft.TR:{o.openElements.hasInTableScope(d)&&(o._closeTableCell(),YMe(o,s));break}case ft.BODY:case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.HTML:break;default:_2t(o,s)}}function GMe(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.OPTION:{o.openElements.currentTagId===ft.OPTION&&o.openElements.pop(),o._insertElement(s,Bi.HTML);break}case ft.OPTGROUP:{o.openElements.currentTagId===ft.OPTION&&o.openElements.pop(),o.openElements.currentTagId===ft.OPTGROUP&&o.openElements.pop(),o._insertElement(s,Bi.HTML);break}case ft.HR:{o.openElements.currentTagId===ft.OPTION&&o.openElements.pop(),o.openElements.currentTagId===ft.OPTGROUP&&o.openElements.pop(),o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0;break}case ft.INPUT:case ft.KEYGEN:case ft.TEXTAREA:case ft.SELECT:{o.openElements.hasInSelectScope(ft.SELECT)&&(o.openElements.popUntilTagNamePopped(ft.SELECT),o._resetInsertionMode(),s.tagID!==ft.SELECT&&o._processStartTag(s));break}case ft.SCRIPT:case ft.TEMPLATE:{i5(o,s);break}}}function VMe(o,s){switch(s.tagID){case ft.OPTGROUP:{o.openElements.stackTop>0&&o.openElements.currentTagId===ft.OPTION&&o.openElements.tagIDs[o.openElements.stackTop-1]===ft.OPTGROUP&&o.openElements.pop(),o.openElements.currentTagId===ft.OPTGROUP&&o.openElements.pop();break}case ft.OPTION:{o.openElements.currentTagId===ft.OPTION&&o.openElements.pop();break}case ft.SELECT:{o.openElements.hasInSelectScope(ft.SELECT)&&(o.openElements.popUntilTagNamePopped(ft.SELECT),o._resetInsertionMode());break}case ft.TEMPLATE:{fL(o,s);break}}}function aGn(o,s){const d=s.tagID;d===ft.CAPTION||d===ft.TABLE||d===ft.TBODY||d===ft.TFOOT||d===ft.THEAD||d===ft.TR||d===ft.TD||d===ft.TH?(o.openElements.popUntilTagNamePopped(ft.SELECT),o._resetInsertionMode(),o._processStartTag(s)):GMe(o,s)}function sGn(o,s){const d=s.tagID;d===ft.CAPTION||d===ft.TABLE||d===ft.TBODY||d===ft.TFOOT||d===ft.THEAD||d===ft.TR||d===ft.TD||d===ft.TH?o.openElements.hasInTableScope(d)&&(o.openElements.popUntilTagNamePopped(ft.SELECT),o._resetInsertionMode(),o.onEndTag(s)):VMe(o,s)}function oGn(o,s){switch(s.tagID){case ft.BASE:case ft.BASEFONT:case ft.BGSOUND:case ft.LINK:case ft.META:case ft.NOFRAMES:case ft.SCRIPT:case ft.STYLE:case ft.TEMPLATE:case ft.TITLE:{i5(o,s);break}case ft.CAPTION:case ft.COLGROUP:case ft.TBODY:case ft.TFOOT:case ft.THEAD:{o.tmplInsertionModeStack[0]=Qe.IN_TABLE,o.insertionMode=Qe.IN_TABLE,YF(o,s);break}case ft.COL:{o.tmplInsertionModeStack[0]=Qe.IN_COLUMN_GROUP,o.insertionMode=Qe.IN_COLUMN_GROUP,hjt(o,s);break}case ft.TR:{o.tmplInsertionModeStack[0]=Qe.IN_TABLE_BODY,o.insertionMode=Qe.IN_TABLE_BODY,x2t(o,s);break}case ft.TD:case ft.TH:{o.tmplInsertionModeStack[0]=Qe.IN_ROW,o.insertionMode=Qe.IN_ROW,E2t(o,s);break}default:o.tmplInsertionModeStack[0]=Qe.IN_BODY,o.insertionMode=Qe.IN_BODY,Tb(o,s)}}function cGn(o,s){s.tagID===ft.TEMPLATE&&fL(o,s)}function XMe(o,s){o.openElements.tmplCount>0?(o.openElements.popUntilTagNamePopped(ft.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode(),o.onEof(s)):ljt(o,s)}function uGn(o,s){s.tagID===ft.HTML?Tb(o,s):jmt(o,s)}function QMe(o,s){var d;if(s.tagID===ft.HTML){if(o.fragmentContext||(o.insertionMode=Qe.AFTER_AFTER_BODY),o.options.sourceCodeLocationInfo&&o.openElements.tagIDs[0]===ft.HTML){o._setEndLocation(o.openElements.items[0],s);const y=o.openElements.items[1];y&&!(!((d=o.treeAdapter.getNodeSourceCodeLocation(y))===null||d===void 0)&&d.endTag)&&o._setEndLocation(y,s)}}else jmt(o,s)}function jmt(o,s){o.insertionMode=Qe.IN_BODY,v2t(o,s)}function lGn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.FRAMESET:{o._insertElement(s,Bi.HTML);break}case ft.FRAME:{o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0;break}case ft.NOFRAMES:{i5(o,s);break}}}function hGn(o,s){s.tagID===ft.FRAMESET&&!o.openElements.isRootHtmlElementCurrent()&&(o.openElements.pop(),!o.fragmentContext&&o.openElements.currentTagId!==ft.FRAMESET&&(o.insertionMode=Qe.AFTER_FRAMESET))}function fGn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.NOFRAMES:{i5(o,s);break}}}function dGn(o,s){s.tagID===ft.HTML&&(o.insertionMode=Qe.AFTER_AFTER_FRAMESET)}function pGn(o,s){s.tagID===ft.HTML?Tb(o,s):nmt(o,s)}function nmt(o,s){o.insertionMode=Qe.IN_BODY,v2t(o,s)}function gGn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.NOFRAMES:{i5(o,s);break}}}function bGn(o,s){s.chars=Yf,o._insertCharacters(s)}function mGn(o,s){o._insertCharacters(s),o.framesetOk=!1}function JMe(o){for(;o.treeAdapter.getNamespaceURI(o.openElements.current)!==Bi.HTML&&!o._isIntegrationPoint(o.openElements.currentTagId,o.openElements.current);)o.openElements.pop()}function yGn(o,s){if(MKn(s))JMe(o),o._startTagOutsideForeignContent(s);else{const d=o._getAdjustedCurrentElement(),y=o.treeAdapter.getNamespaceURI(d);y===Bi.MATHML?RMe(s):y===Bi.SVG&&(PKn(s),DMe(s)),cjt(s),s.selfClosing?o._appendElement(s,y):o._insertElement(s,y),s.ackSelfClosing=!0}}function wGn(o,s){if(s.tagID===ft.P||s.tagID===ft.BR){JMe(o),o._endTagOutsideForeignContent(s);return}for(let d=o.openElements.stackTop;d>0;d--){const y=o.openElements.items[d];if(o.treeAdapter.getNamespaceURI(y)===Bi.HTML){o._endTagOutsideForeignContent(s);break}const S=o.treeAdapter.getTagName(y);if(S.toLowerCase()===s.tagName){s.tagName=S,o.openElements.shortenToLength(d);break}}}tr.AREA,tr.BASE,tr.BASEFONT,tr.BGSOUND,tr.BR,tr.COL,tr.EMBED,tr.FRAME,tr.HR,tr.IMG,tr.INPUT,tr.KEYGEN,tr.LINK,tr.META,tr.PARAM,tr.SOURCE,tr.TRACK,tr.WBR;const vGn=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,_Gn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),dIe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function ZMe(o,s){const d=NGn(o),y=sjt("type",{handlers:{root:xGn,element:EGn,text:TGn,comment:ePe,doctype:kGn,raw:SGn},unknown:AGn}),S={parser:d?new lIe(dIe):lIe.getFragmentParser(void 0,dIe),handle(H){y(H,S)},stitches:!1,options:s||{}};y(o,S),o$(S,A6());const N=d?S.parser.document:S.parser.getFragment(),B=EWn(N,{file:S.options.file});return S.stitches&&njt(B,"comment",function(H,et,W){const nt=H;if(nt.value.stitch&&W&&et!==void 0){const K=W.children;return K[et]=nt.value.stitch,et}}),B.type==="root"&&B.children.length===1&&B.children[0].type===o.type?B.children[0]:B}function tPe(o,s){let d=-1;if(o)for(;++d<o.length;)s.handle(o[d])}function xGn(o,s){tPe(o.children,s)}function EGn(o,s){IGn(o,s),tPe(o.children,s),OGn(o,s)}function TGn(o,s){s.parser.tokenizer.state>4&&(s.parser.tokenizer.state=0);const d={type:Su.CHARACTER,chars:o.value,location:sJ(o)};o$(s,A6(o)),s.parser.currentToken=d,s.parser._processToken(s.parser.currentToken)}function kGn(o,s){const d={type:Su.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:sJ(o)};o$(s,A6(o)),s.parser.currentToken=d,s.parser._processToken(s.parser.currentToken)}function CGn(o,s){s.stitches=!0;const d=LGn(o);if("children"in o&&"children"in d){const y=ZMe({type:"root",children:o.children},s.options);d.children=y.children}ePe({type:"comment",value:{stitch:d}},s)}function ePe(o,s){const d=o.value,y={type:Su.COMMENT,data:d,location:sJ(o)};o$(s,A6(o)),s.parser.currentToken=y,s.parser._processToken(s.parser.currentToken)}function SGn(o,s){if(s.parser.tokenizer.preprocessor.html="",s.parser.tokenizer.preprocessor.pos=-1,s.parser.tokenizer.preprocessor.lastGapPos=-2,s.parser.tokenizer.preprocessor.gapStack=[],s.parser.tokenizer.preprocessor.skipNextNewLine=!1,s.parser.tokenizer.preprocessor.lastChunkWritten=!1,s.parser.tokenizer.preprocessor.endOfChunkHit=!1,s.parser.tokenizer.preprocessor.isEol=!1,nPe(s,A6(o)),s.parser.tokenizer.write(s.options.tagfilter?o.value.replace(vGn,"&lt;$1$2"):o.value,!1),s.parser.tokenizer._runParsingLoop(),s.parser.tokenizer.state===72||s.parser.tokenizer.state===78){s.parser.tokenizer.preprocessor.lastChunkWritten=!0;const d=s.parser.tokenizer._consume();s.parser.tokenizer._callState(d)}}function AGn(o,s){const d=o;if(s.options.passThrough&&s.options.passThrough.includes(d.type))CGn(d,s);else{let y="";throw _Gn.has(d.type)&&(y=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+d.type+"` node"+y)}}function o$(o,s){nPe(o,s);const d=o.parser.tokenizer.currentCharacterToken;d&&d.location&&(d.location.endLine=o.parser.tokenizer.preprocessor.line,d.location.endCol=o.parser.tokenizer.preprocessor.col+1,d.location.endOffset=o.parser.tokenizer.preprocessor.offset+1,o.parser.currentToken=d,o.parser._processToken(o.parser.currentToken)),o.parser.tokenizer.paused=!1,o.parser.tokenizer.inLoop=!1,o.parser.tokenizer.active=!1,o.parser.tokenizer.returnState=I1.DATA,o.parser.tokenizer.charRefCode=-1,o.parser.tokenizer.consumedAfterSnapshot=-1,o.parser.tokenizer.currentLocation=null,o.parser.tokenizer.currentCharacterToken=null,o.parser.tokenizer.currentToken=null,o.parser.tokenizer.currentAttr={name:"",value:""}}function nPe(o,s){if(s&&s.offset!==void 0){const d={startLine:s.line,startCol:s.column,startOffset:s.offset,endLine:-1,endCol:-1,endOffset:-1};o.parser.tokenizer.preprocessor.lineStartPos=-s.column+1,o.parser.tokenizer.preprocessor.droppedBufferSize=s.offset,o.parser.tokenizer.preprocessor.line=s.line,o.parser.tokenizer.currentLocation=d}}function IGn(o,s){const d=o.tagName.toLowerCase();if(s.parser.tokenizer.state===I1.PLAINTEXT)return;o$(s,A6(o));const y=s.parser.openElements.current;let S="namespaceURI"in y?y.namespaceURI:tL.html;S===tL.html&&d==="svg"&&(S=tL.svg);const N=FWn({...o,children:[]},{space:S===tL.svg?"svg":"html"}),B={type:Su.START_TAG,tagName:d,tagID:s$(d),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in N?N.attrs:[],location:sJ(o)};s.parser.currentToken=B,s.parser._processToken(s.parser.currentToken),s.parser.tokenizer.lastStartTagName=d}function OGn(o,s){const d=o.tagName.toLowerCase();if(!s.parser.tokenizer.inForeignNode&&xMe.includes(d)||s.parser.tokenizer.state===I1.PLAINTEXT)return;o$(s,b2t(o));const y={type:Su.END_TAG,tagName:d,tagID:s$(d),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:sJ(o)};s.parser.currentToken=y,s.parser._processToken(s.parser.currentToken),d===s.parser.tokenizer.lastStartTagName&&(s.parser.tokenizer.state===I1.RCDATA||s.parser.tokenizer.state===I1.RAWTEXT||s.parser.tokenizer.state===I1.SCRIPT_DATA)&&(s.parser.tokenizer.state=I1.DATA)}function NGn(o){const s=o.type==="root"?o.children[0]:o;return!!(s&&(s.type==="doctype"||s.type==="element"&&s.tagName.toLowerCase()==="html"))}function sJ(o){const s=A6(o)||{line:void 0,column:void 0,offset:void 0},d=b2t(o)||{line:void 0,column:void 0,offset:void 0};return{startLine:s.line,startCol:s.column,startOffset:s.offset,endLine:d.line,endCol:d.column,endOffset:d.offset}}function LGn(o){return"children"in o?KF({...o,children:[]}):KF(o)}function MGn(o){return function(s,d){return ZMe(s,{...o,file:d})}}const PGn=/["&'<>`]/g,RGn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,DGn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,BGn=/[|\\{}()[\]^$+*?.]/g,pIe=new WeakMap;function FGn(o,s){if(o=o.replace(s.subset?$Gn(s.subset):PGn,y),s.subset||s.escapeOnly)return o;return o.replace(RGn,d).replace(DGn,y);function d(S,N,B){return s.format((S.charCodeAt(0)-55296)*1024+S.charCodeAt(1)-56320+65536,B.charCodeAt(N+2),s)}function y(S,N,B){return s.format(S.charCodeAt(0),B.charCodeAt(N+1),s)}}function $Gn(o){let s=pIe.get(o);return s||(s=jGn(o),pIe.set(o,s)),s}function jGn(o){const s=[];let d=-1;for(;++d<o.length;)s.push(o[d].replace(BGn,"\\$&"));return new RegExp("(?:"+s.join("|")+")","g")}const HGn=/[\dA-Fa-f]/;function zGn(o,s,d){const y="&#x"+o.toString(16).toUpperCase();return d&&s&&!HGn.test(String.fromCharCode(s))?y:y+";"}const UGn=/\d/;function qGn(o,s,d){const y="&#"+String(o);return d&&s&&!UGn.test(String.fromCharCode(s))?y:y+";"}const WGn=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],CBt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},KGn=["cent","copy","divide","gt","lt","not","para","times"],rPe={}.hasOwnProperty,WFt={};let Bbt;for(Bbt in CBt)rPe.call(CBt,Bbt)&&(WFt[CBt[Bbt]]=Bbt);const YGn=/[^\dA-Za-z]/;function GGn(o,s,d,y){const S=String.fromCharCode(o);if(rPe.call(WFt,S)){const N=WFt[S],B="&"+N;return d&&WGn.includes(N)&&!KGn.includes(N)&&(!y||s&&s!==61&&YGn.test(String.fromCharCode(s)))?B:B+";"}return""}function VGn(o,s,d){let y=zGn(o,s,d.omitOptionalSemicolons),S;if((d.useNamedReferences||d.useShortestReferences)&&(S=GGn(o,s,d.omitOptionalSemicolons,d.attribute)),(d.useShortestReferences||!S)&&d.useShortestReferences){const N=qGn(o,s,d.omitOptionalSemicolons);N.length<y.length&&(y=N)}return S&&(!d.useShortestReferences||S.length<y.length)?S:y}function BF(o,s){return FGn(o,Object.assign({format:VGn},s))}const XGn=/^>|^->|<!--|-->|--!>|<!-$/g,QGn=[">"],JGn=["<",">"];function ZGn(o,s,d,y){return y.settings.bogusComments?"<?"+BF(o.value,Object.assign({},y.settings.characterReferences,{subset:QGn}))+">":"<!--"+o.value.replace(XGn,S)+"-->";function S(N){return BF(N,Object.assign({},y.settings.characterReferences,{subset:JGn}))}}function tVn(o,s,d,y){return"<!"+(y.settings.upperDoctype?"DOCTYPE":"doctype")+(y.settings.tightDoctype?"":" ")+"html>"}function gIe(o,s){const d=String(o);if(typeof s!="string")throw new TypeError("Expected character");let y=0,S=d.indexOf(s);for(;S!==-1;)y++,S=d.indexOf(s,S+s.length);return y}const rp=aPe(1),iPe=aPe(-1),eVn=[];function aPe(o){return s;function s(d,y,S){const N=d?d.children:eVn;let B=(y||0)+o,H=N[B];if(!S)for(;H&&d2t(H);)B+=o,H=N[B];return H}}const nVn={}.hasOwnProperty;function sPe(o){return s;function s(d,y,S){return nVn.call(o,d.tagName)&&o[d.tagName](d,y,S)}}const fjt=sPe({body:iVn,caption:SBt,colgroup:SBt,dd:cVn,dt:oVn,head:SBt,html:rVn,li:sVn,optgroup:uVn,option:lVn,p:aVn,rp:bIe,rt:bIe,tbody:fVn,td:mIe,tfoot:dVn,th:mIe,thead:hVn,tr:pVn});function SBt(o,s,d){const y=rp(d,s,!0);return!y||y.type!=="comment"&&!(y.type==="text"&&d2t(y.value.charAt(0)))}function rVn(o,s,d){const y=rp(d,s);return!y||y.type!=="comment"}function iVn(o,s,d){const y=rp(d,s);return!y||y.type!=="comment"}function aVn(o,s,d){const y=rp(d,s);return y?y.type==="element"&&(y.tagName==="address"||y.tagName==="article"||y.tagName==="aside"||y.tagName==="blockquote"||y.tagName==="details"||y.tagName==="div"||y.tagName==="dl"||y.tagName==="fieldset"||y.tagName==="figcaption"||y.tagName==="figure"||y.tagName==="footer"||y.tagName==="form"||y.tagName==="h1"||y.tagName==="h2"||y.tagName==="h3"||y.tagName==="h4"||y.tagName==="h5"||y.tagName==="h6"||y.tagName==="header"||y.tagName==="hgroup"||y.tagName==="hr"||y.tagName==="main"||y.tagName==="menu"||y.tagName==="nav"||y.tagName==="ol"||y.tagName==="p"||y.tagName==="pre"||y.tagName==="section"||y.tagName==="table"||y.tagName==="ul"):!d||!(d.type==="element"&&(d.tagName==="a"||d.tagName==="audio"||d.tagName==="del"||d.tagName==="ins"||d.tagName==="map"||d.tagName==="noscript"||d.tagName==="video"))}function sVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&y.tagName==="li"}function oVn(o,s,d){const y=rp(d,s);return!!(y&&y.type==="element"&&(y.tagName==="dt"||y.tagName==="dd"))}function cVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="dt"||y.tagName==="dd")}function bIe(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="rp"||y.tagName==="rt")}function uVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&y.tagName==="optgroup"}function lVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="option"||y.tagName==="optgroup")}function hVn(o,s,d){const y=rp(d,s);return!!(y&&y.type==="element"&&(y.tagName==="tbody"||y.tagName==="tfoot"))}function fVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="tbody"||y.tagName==="tfoot")}function dVn(o,s,d){return!rp(d,s)}function pVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&y.tagName==="tr"}function mIe(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="td"||y.tagName==="th")}const gVn=sPe({body:yVn,colgroup:wVn,head:mVn,html:bVn,tbody:vVn});function bVn(o){const s=rp(o,-1);return!s||s.type!=="comment"}function mVn(o){const s=new Set;for(const y of o.children)if(y.type==="element"&&(y.tagName==="base"||y.tagName==="title")){if(s.has(y.tagName))return!1;s.add(y.tagName)}const d=o.children[0];return!d||d.type==="element"}function yVn(o){const s=rp(o,-1,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&d2t(s.value.charAt(0)))&&!(s.type==="element"&&(s.tagName==="meta"||s.tagName==="link"||s.tagName==="script"||s.tagName==="style"||s.tagName==="template"))}function wVn(o,s,d){const y=iPe(d,s),S=rp(o,-1,!0);return d&&y&&y.type==="element"&&y.tagName==="colgroup"&&fjt(y,d.children.indexOf(y),d)?!1:!!(S&&S.type==="element"&&S.tagName==="col")}function vVn(o,s,d){const y=iPe(d,s),S=rp(o,-1);return d&&y&&y.type==="element"&&(y.tagName==="thead"||y.tagName==="tbody")&&fjt(y,d.children.indexOf(y),d)?!1:!!(S&&S.type==="element"&&S.tagName==="tr")}const Fbt={name:[[`
1928
+ `}),d}function PAe(o){let s=0,d=o.charCodeAt(s);for(;d===9||d===32;)s++,d=o.charCodeAt(s);return o.slice(s)}function RAe(o,s){const d=Rqn(o,s),y=d.one(o,void 0),S=Tqn(d),N=Array.isArray(y)?{type:"root",children:y}:y||{type:"root",children:[]};return S&&N.children.push({type:"text",value:`
1929
+ `},S),N}function jqn(o,s){return o&&"run"in o?async function(d,y){const S=RAe(d,{file:y,...s});await o.run(S,y)}:function(d,y){return RAe(d,{file:y,...o||s})}}function DAe(o){if(o)throw o}var tmt=Object.prototype.hasOwnProperty,oMe=Object.prototype.toString,BAe=Object.defineProperty,FAe=Object.getOwnPropertyDescriptor,$Ae=function(s){return typeof Array.isArray=="function"?Array.isArray(s):oMe.call(s)==="[object Array]"},jAe=function(s){if(!s||oMe.call(s)!=="[object Object]")return!1;var d=tmt.call(s,"constructor"),y=s.constructor&&s.constructor.prototype&&tmt.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!d&&!y)return!1;var S;for(S in s);return typeof S>"u"||tmt.call(s,S)},HAe=function(s,d){BAe&&d.name==="__proto__"?BAe(s,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):s[d.name]=d.newValue},zAe=function(s,d){if(d==="__proto__")if(tmt.call(s,d)){if(FAe)return FAe(s,d).value}else return;return s[d]},Hqn=function o(){var s,d,y,S,N,B,H=arguments[0],et=1,W=arguments.length,nt=!1;for(typeof H=="boolean"&&(nt=H,H=arguments[1]||{},et=2),(H==null||typeof H!="object"&&typeof H!="function")&&(H={});et<W;++et)if(s=arguments[et],s!=null)for(d in s)y=zAe(H,d),S=zAe(s,d),H!==S&&(nt&&S&&(jAe(S)||(N=$Ae(S)))?(N?(N=!1,B=y&&$Ae(y)?y:[]):B=y&&jAe(y)?y:{},HAe(H,{name:d,newValue:o(nt,B,S)})):typeof S<"u"&&HAe(H,{name:d,newValue:S}));return H};const gBt=OIe(Hqn);function DFt(o){if(typeof o!="object"||o===null)return!1;const s=Object.getPrototypeOf(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)}function zqn(){const o=[],s={run:d,use:y};return s;function d(...S){let N=-1;const B=S.pop();if(typeof B!="function")throw new TypeError("Expected function as last argument, not "+B);H(null,...S);function H(et,...W){const nt=o[++N];let K=-1;if(et){B(et);return}for(;++K<S.length;)(W[K]===null||W[K]===void 0)&&(W[K]=S[K]);S=W,nt?Uqn(nt,H)(...W):B(null,...W)}}function y(S){if(typeof S!="function")throw new TypeError("Expected `middelware` to be a function, not "+S);return o.push(S),s}}function Uqn(o,s){let d;return y;function y(...B){const H=o.length>B.length;let et;H&&B.push(S);try{et=o.apply(this,B)}catch(W){const nt=W;if(H&&d)throw nt;return S(nt)}H||(et&&et.then&&typeof et.then=="function"?et.then(N,S):et instanceof Error?S(et):N(et))}function S(B,...H){d||(d=!0,s(B,...H))}function N(B){S(null,B)}}const m6={basename:qqn,dirname:Wqn,extname:Kqn,join:Yqn,sep:"/"};function qqn(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');rJ(o);let d=0,y=-1,S=o.length,N;if(s===void 0||s.length===0||s.length>o.length){for(;S--;)if(o.codePointAt(S)===47){if(N){d=S+1;break}}else y<0&&(N=!0,y=S+1);return y<0?"":o.slice(d,y)}if(s===o)return"";let B=-1,H=s.length-1;for(;S--;)if(o.codePointAt(S)===47){if(N){d=S+1;break}}else B<0&&(N=!0,B=S+1),H>-1&&(o.codePointAt(S)===s.codePointAt(H--)?H<0&&(y=S):(H=-1,y=B));return d===y?y=B:y<0&&(y=o.length),o.slice(d,y)}function Wqn(o){if(rJ(o),o.length===0)return".";let s=-1,d=o.length,y;for(;--d;)if(o.codePointAt(d)===47){if(y){s=d;break}}else y||(y=!0);return s<0?o.codePointAt(0)===47?"/":".":s===1&&o.codePointAt(0)===47?"//":o.slice(0,s)}function Kqn(o){rJ(o);let s=o.length,d=-1,y=0,S=-1,N=0,B;for(;s--;){const H=o.codePointAt(s);if(H===47){if(B){y=s+1;break}continue}d<0&&(B=!0,d=s+1),H===46?S<0?S=s:N!==1&&(N=1):S>-1&&(N=-1)}return S<0||d<0||N===0||N===1&&S===d-1&&S===y+1?"":o.slice(S,d)}function Yqn(...o){let s=-1,d;for(;++s<o.length;)rJ(o[s]),o[s]&&(d=d===void 0?o[s]:d+"/"+o[s]);return d===void 0?".":Gqn(d)}function Gqn(o){rJ(o);const s=o.codePointAt(0)===47;let d=Vqn(o,!s);return d.length===0&&!s&&(d="."),d.length>0&&o.codePointAt(o.length-1)===47&&(d+="/"),s?"/"+d:d}function Vqn(o,s){let d="",y=0,S=-1,N=0,B=-1,H,et;for(;++B<=o.length;){if(B<o.length)H=o.codePointAt(B);else{if(H===47)break;H=47}if(H===47){if(!(S===B-1||N===1))if(S!==B-1&&N===2){if(d.length<2||y!==2||d.codePointAt(d.length-1)!==46||d.codePointAt(d.length-2)!==46){if(d.length>2){if(et=d.lastIndexOf("/"),et!==d.length-1){et<0?(d="",y=0):(d=d.slice(0,et),y=d.length-1-d.lastIndexOf("/")),S=B,N=0;continue}}else if(d.length>0){d="",y=0,S=B,N=0;continue}}s&&(d=d.length>0?d+"/..":"..",y=2)}else d.length>0?d+="/"+o.slice(S+1,B):d=o.slice(S+1,B),y=B-S-1;S=B,N=0}else H===46&&N>-1?N++:N=-1}return d}function rJ(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}const Xqn={cwd:Qqn};function Qqn(){return"/"}function BFt(o){return!!(o!==null&&typeof o=="object"&&"href"in o&&o.href&&"protocol"in o&&o.protocol&&o.auth===void 0)}function Jqn(o){if(typeof o=="string")o=new URL(o);else if(!BFt(o)){const s=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+o+"`");throw s.code="ERR_INVALID_ARG_TYPE",s}if(o.protocol!=="file:"){const s=new TypeError("The URL must be of scheme file");throw s.code="ERR_INVALID_URL_SCHEME",s}return Zqn(o)}function Zqn(o){if(o.hostname!==""){const y=new TypeError('File URL host must be "localhost" or empty on darwin');throw y.code="ERR_INVALID_FILE_URL_HOST",y}const s=o.pathname;let d=-1;for(;++d<s.length;)if(s.codePointAt(d)===37&&s.codePointAt(d+1)===50){const y=s.codePointAt(d+2);if(y===70||y===102){const S=new TypeError("File URL path must not include encoded / characters");throw S.code="ERR_INVALID_FILE_URL_PATH",S}}return decodeURIComponent(s)}const bBt=["history","path","basename","stem","extname","dirname"];class cMe{constructor(s){let d;s?BFt(s)?d={path:s}:typeof s=="string"||tWn(s)?d={value:s}:d=s:d={},this.cwd="cwd"in d?"":Xqn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let y=-1;for(;++y<bBt.length;){const N=bBt[y];N in d&&d[N]!==void 0&&d[N]!==null&&(this[N]=N==="history"?[...d[N]]:d[N])}let S;for(S in d)bBt.includes(S)||(this[S]=d[S])}get basename(){return typeof this.path=="string"?m6.basename(this.path):void 0}set basename(s){yBt(s,"basename"),mBt(s,"basename"),this.path=m6.join(this.dirname||"",s)}get dirname(){return typeof this.path=="string"?m6.dirname(this.path):void 0}set dirname(s){UAe(this.basename,"dirname"),this.path=m6.join(s||"",this.basename)}get extname(){return typeof this.path=="string"?m6.extname(this.path):void 0}set extname(s){if(mBt(s,"extname"),UAe(this.dirname,"extname"),s){if(s.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(s.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=m6.join(this.dirname,this.stem+(s||""))}get path(){return this.history[this.history.length-1]}set path(s){BFt(s)&&(s=Jqn(s)),yBt(s,"path"),this.path!==s&&this.history.push(s)}get stem(){return typeof this.path=="string"?m6.basename(this.path,this.extname):void 0}set stem(s){yBt(s,"stem"),mBt(s,"stem"),this.path=m6.join(this.dirname||"",s+(this.extname||""))}fail(s,d,y){const S=this.message(s,d,y);throw S.fatal=!0,S}info(s,d,y){const S=this.message(s,d,y);return S.fatal=void 0,S}message(s,d,y){const S=new Eb(s,d,y);return this.path&&(S.name=this.path+":"+S.name,S.file=this.path),S.fatal=!1,this.messages.push(S),S}toString(s){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(s||void 0).decode(this.value)}}function mBt(o,s){if(o&&o.includes(m6.sep))throw new Error("`"+s+"` cannot be a path: did not expect `"+m6.sep+"`")}function yBt(o,s){if(!o)throw new Error("`"+s+"` cannot be empty")}function UAe(o,s){if(!o)throw new Error("Setting `"+s+"` requires `path` to be set too")}function tWn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const eWn=function(o){const y=this.constructor.prototype,S=y[o],N=function(){return S.apply(N,arguments)};return Object.setPrototypeOf(N,y),N},nWn={}.hasOwnProperty;class rjt extends eWn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zqn()}copy(){const s=new rjt;let d=-1;for(;++d<this.attachers.length;){const y=this.attachers[d];s.use(...y)}return s.data(gBt(!0,{},this.namespace)),s}data(s,d){return typeof s=="string"?arguments.length===2?(_Bt("data",this.frozen),this.namespace[s]=d,this):nWn.call(this.namespace,s)&&this.namespace[s]||void 0:s?(_Bt("data",this.frozen),this.namespace=s,this):this.namespace}freeze(){if(this.frozen)return this;const s=this;for(;++this.freezeIndex<this.attachers.length;){const[d,...y]=this.attachers[this.freezeIndex];if(y[0]===!1)continue;y[0]===!0&&(y[0]=void 0);const S=d.call(s,...y);typeof S=="function"&&this.transformers.use(S)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(s){this.freeze();const d=Rbt(s),y=this.parser||this.Parser;return wBt("parse",y),y(String(d),d)}process(s,d){const y=this;return this.freeze(),wBt("process",this.parser||this.Parser),vBt("process",this.compiler||this.Compiler),d?S(void 0,d):new Promise(S);function S(N,B){const H=Rbt(s),et=y.parse(H);y.run(et,H,function(nt,K,Q){if(nt||!K||!Q)return W(nt);const at=K,mt=y.stringify(at,Q);aWn(mt)?Q.value=mt:Q.result=mt,W(nt,Q)});function W(nt,K){nt||!K?B(nt):N?N(K):d(void 0,K)}}}processSync(s){let d=!1,y;return this.freeze(),wBt("processSync",this.parser||this.Parser),vBt("processSync",this.compiler||this.Compiler),this.process(s,S),WAe("processSync","process",d),y;function S(N,B){d=!0,DAe(N),y=B}}run(s,d,y){qAe(s),this.freeze();const S=this.transformers;return!y&&typeof d=="function"&&(y=d,d=void 0),y?N(void 0,y):new Promise(N);function N(B,H){const et=Rbt(d);S.run(s,et,W);function W(nt,K,Q){const at=K||s;nt?H(nt):B?B(at):y(void 0,at,Q)}}}runSync(s,d){let y=!1,S;return this.run(s,d,N),WAe("runSync","run",y),S;function N(B,H){DAe(B),S=H,y=!0}}stringify(s,d){this.freeze();const y=Rbt(d),S=this.compiler||this.Compiler;return vBt("stringify",S),qAe(s),S(s,y)}use(s,...d){const y=this.attachers,S=this.namespace;if(_Bt("use",this.frozen),s!=null)if(typeof s=="function")et(s,d);else if(typeof s=="object")Array.isArray(s)?H(s):B(s);else throw new TypeError("Expected usable value, not `"+s+"`");return this;function N(W){if(typeof W=="function")et(W,[]);else if(typeof W=="object")if(Array.isArray(W)){const[nt,...K]=W;et(nt,K)}else B(W);else throw new TypeError("Expected usable value, not `"+W+"`")}function B(W){if(!("plugins"in W)&&!("settings"in W))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");H(W.plugins),W.settings&&(S.settings=gBt(!0,S.settings,W.settings))}function H(W){let nt=-1;if(W!=null)if(Array.isArray(W))for(;++nt<W.length;){const K=W[nt];N(K)}else throw new TypeError("Expected a list of plugins, not `"+W+"`")}function et(W,nt){let K=-1,Q=-1;for(;++K<y.length;)if(y[K][0]===W){Q=K;break}if(Q===-1)y.push([W,...nt]);else if(nt.length>0){let[at,...mt]=nt;const Lt=y[Q][1];DFt(Lt)&&DFt(at)&&(at=gBt(!0,Lt,at)),y[Q]=[W,at,...mt]}}}}const rWn=new rjt().freeze();function wBt(o,s){if(typeof s!="function")throw new TypeError("Cannot `"+o+"` without `parser`")}function vBt(o,s){if(typeof s!="function")throw new TypeError("Cannot `"+o+"` without `compiler`")}function _Bt(o,s){if(s)throw new Error("Cannot call `"+o+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qAe(o){if(!DFt(o)||typeof o.type!="string")throw new TypeError("Expected node, got `"+o+"`")}function WAe(o,s,d){if(!d)throw new Error("`"+o+"` finished async. Use `"+s+"` instead")}function Rbt(o){return iWn(o)?o:new cMe(o)}function iWn(o){return!!(o&&typeof o=="object"&&"message"in o&&"messages"in o)}function aWn(o){return typeof o=="string"||sWn(o)}function sWn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const oWn="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",KAe=[],YAe={allowDangerousHtml:!0},cWn=/^(https?|ircs?|mailto|xmpp)$/i,uWn=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function lWn(o){const s=hWn(o),d=fWn(o);return dWn(s.runSync(s.parse(d),d),o)}function hWn(o){const s=o.rehypePlugins||KAe,d=o.remarkPlugins||KAe,y=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...YAe}:YAe;return rWn().use(WUn).use(d).use(jqn,y).use(s)}function fWn(o){const s=o.children||"",d=new cMe;return typeof s=="string"&&(d.value=s),d}function dWn(o,s){const d=s.allowedElements,y=s.allowElement,S=s.components,N=s.disallowedElements,B=s.skipHtml,H=s.unwrapDisallowed,et=s.urlTransform||pWn;for(const nt of uWn)Object.hasOwn(s,nt.from)&&(""+nt.from+(nt.to?"use `"+nt.to+"` instead":"remove it")+oWn+nt.id,void 0);return s.className&&(o={type:"element",tagName:"div",properties:{className:s.className},children:o.type==="root"?o.children:[o]}),njt(o,W),THn(o,{Fragment:pe.Fragment,components:S,ignoreInvalidStyle:!0,jsx:pe.jsx,jsxs:pe.jsxs,passKeys:!0,passNode:!0});function W(nt,K,Q){if(nt.type==="raw"&&Q&&typeof K=="number")return B?Q.children.splice(K,1):Q.children[K]={type:"text",value:nt.value},K;if(nt.type==="element"){let at;for(at in fBt)if(Object.hasOwn(fBt,at)&&Object.hasOwn(nt.properties,at)){const mt=nt.properties[at],Lt=fBt[at];(Lt===null||Lt.includes(nt.tagName))&&(nt.properties[at]=et(String(mt||""),at,nt))}}if(nt.type==="element"){let at=d?!d.includes(nt.tagName):N?N.includes(nt.tagName):!1;if(!at&&y&&typeof K=="number"&&(at=!y(nt,K,Q)),at&&Q&&typeof K=="number")return H&&nt.children?Q.children.splice(K,1,...nt.children):Q.children.splice(K,1),K}}}function pWn(o){const s=o.indexOf(":"),d=o.indexOf("?"),y=o.indexOf("#"),S=o.indexOf("/");return s===-1||S!==-1&&s>S||d!==-1&&s>d||y!==-1&&s>y||cWn.test(o.slice(0,s))?o:""}const GAe=/[#.]/g;function gWn(o,s){const d=o||"",y={};let S=0,N,B;for(;S<d.length;){GAe.lastIndex=S;const H=GAe.exec(d),et=d.slice(S,H?H.index:d.length);et&&(N?N==="#"?y.id=et:Array.isArray(y.className)?y.className.push(et):y.className=[et]:B=et,S+=et.length),H&&(N=H[0],S++)}return{type:"element",tagName:B||s||"div",properties:y,children:[]}}function uMe(o,s,d){const y=d?wWn(d):void 0;function S(N,B,...H){let et;if(N==null){et={type:"root",children:[]};const W=B;H.unshift(W)}else{et=gWn(N,s);const W=et.tagName.toLowerCase(),nt=y?y.get(W):void 0;if(et.tagName=nt||W,bWn(B))H.unshift(B);else for(const[K,Q]of Object.entries(B))mWn(o,et.properties,K,Q)}for(const W of H)FFt(et.children,W);return et.type==="element"&&et.tagName==="template"&&(et.content={type:"root",children:et.children},et.children=[]),et}return S}function bWn(o){if(o===null||typeof o!="object"||Array.isArray(o))return!0;if(typeof o.type!="string")return!1;const s=o,d=Object.keys(o);for(const y of d){const S=s[y];if(S&&typeof S=="object"){if(!Array.isArray(S))return!0;const N=S;for(const B of N)if(typeof B!="number"&&typeof B!="string")return!0}}return!!("children"in o&&Array.isArray(o.children))}function mWn(o,s,d,y){const S=p2t(o,d);let N;if(y!=null){if(typeof y=="number"){if(Number.isNaN(y))return;N=y}else typeof y=="boolean"?N=y:typeof y=="string"?S.spaceSeparated?N=oAe(y):S.commaSeparated?N=nAe(y):S.commaOrSpaceSeparated?N=oAe(nAe(y).join(" ")):N=VAe(S,S.property,y):Array.isArray(y)?N=[...y]:N=S.property==="style"?yWn(y):String(y);if(Array.isArray(N)){const B=[];for(const H of N)B.push(VAe(S,S.property,H));N=B}S.property==="className"&&Array.isArray(s.className)&&(N=s.className.concat(N)),s[S.property]=N}}function FFt(o,s){if(s!=null)if(typeof s=="number"||typeof s=="string")o.push({type:"text",value:String(s)});else if(Array.isArray(s))for(const d of s)FFt(o,d);else if(typeof s=="object"&&"type"in s)s.type==="root"?FFt(o,s.children):o.push(s);else throw new Error("Expected node, nodes, or string, got `"+s+"`")}function VAe(o,s,d){if(typeof d=="string"){if(o.number&&d&&!Number.isNaN(Number(d)))return Number(d);if((o.boolean||o.overloadedBoolean)&&(d===""||WQ(d)===WQ(s)))return!0}return d}function yWn(o){const s=[];for(const[d,y]of Object.entries(o))s.push([d,y].join(": "));return s.join("; ")}function wWn(o){const s=new Map;for(const d of o)s.set(d.toLowerCase(),d);return s}const vWn=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],_Wn=uMe(nJ,"div"),xWn=uMe(c7,"g",vWn);function EWn(o){const s=String(o),d=[];return{toOffset:S,toPoint:y};function y(N){if(typeof N=="number"&&N>-1&&N<=s.length){let B=0;for(;;){let H=d[B];if(H===void 0){const et=XAe(s,d[B-1]);H=et===-1?s.length+1:et+1,d[B]=H}if(H>N)return{line:B+1,column:N-(B>0?d[B-1]:0)+1,offset:N};B++}}}function S(N){if(N&&typeof N.line=="number"&&typeof N.column=="number"&&!Number.isNaN(N.line)&&!Number.isNaN(N.column)){for(;d.length<N.line;){const H=d[d.length-1],et=XAe(s,H),W=et===-1?s.length+1:et+1;if(H===W)break;d.push(W)}const B=(N.line>1?d[N.line-2]:0)+N.column-1;if(B<d[N.line-1])return B}}}function XAe(o,s){const d=o.indexOf("\r",s),y=o.indexOf(`
1930
+ `,s);return y===-1?d:d===-1||d+1===y?y:d<y?d:y}const tL={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},lMe={}.hasOwnProperty,TWn=Object.prototype;function kWn(o,s){const d=s||{};return ijt({file:d.file||void 0,location:!1,schema:d.space==="svg"?c7:nJ,verbose:d.verbose||!1},o)}function ijt(o,s){let d;switch(s.nodeName){case"#comment":{const y=s;return d={type:"comment",value:y.data},emt(o,y,d),d}case"#document":case"#document-fragment":{const y=s,S="mode"in y?y.mode==="quirks"||y.mode==="limited-quirks":!1;if(d={type:"root",children:hMe(o,s.childNodes),data:{quirksMode:S}},o.file&&o.location){const N=String(o.file),B=EWn(N),H=B.toPoint(0),et=B.toPoint(N.length);d.position={start:H,end:et}}return d}case"#documentType":{const y=s;return d={type:"doctype"},emt(o,y,d),d}case"#text":{const y=s;return d={type:"text",value:y.value},emt(o,y,d),d}default:return d=CWn(o,s),d}}function hMe(o,s){let d=-1;const y=[];for(;++d<s.length;){const S=ijt(o,s[d]);y.push(S)}return y}function CWn(o,s){const d=o.schema;o.schema=s.namespaceURI===tL.svg?c7:nJ;let y=-1;const S={};for(;++y<s.attrs.length;){const H=s.attrs[y],et=(H.prefix?H.prefix+":":"")+H.name;lMe.call(TWn,et)||(S[et]=H.value)}const B=(o.schema.space==="svg"?xWn:_Wn)(s.tagName,S,hMe(o,s.childNodes));if(emt(o,s,B),B.tagName==="template"){const H=s,et=H.sourceCodeLocation,W=et&&et.startTag&&MF(et.startTag),nt=et&&et.endTag&&MF(et.endTag),K=ijt(o,H.content);W&&nt&&o.file&&(K.position={start:W.end,end:nt.start}),B.content=K}return o.schema=d,B}function emt(o,s,d){if("sourceCodeLocation"in s&&s.sourceCodeLocation&&o.file){const y=SWn(o,d,s.sourceCodeLocation);y&&(o.location=!0,d.position=y)}}function SWn(o,s,d){const y=MF(d);if(s.type==="element"){const S=s.children[s.children.length-1];if(y&&!d.endTag&&S&&S.position&&S.position.end&&(y.end=Object.assign({},S.position.end)),o.verbose){const N={};let B;if(d.attrs)for(B in d.attrs)lMe.call(d.attrs,B)&&(N[p2t(o.schema,B).property]=MF(d.attrs[B]));d.startTag;const H=MF(d.startTag),et=d.endTag?MF(d.endTag):void 0,W={opening:H};et&&(W.closing=et),W.properties=N,s.data={position:W}}}return y}function MF(o){const s=QAe({line:o.startLine,column:o.startCol,offset:o.startOffset}),d=QAe({line:o.endLine,column:o.endCol,offset:o.endOffset});return s||d?{start:s,end:d}:void 0}function QAe(o){return o.line&&o.column?o:void 0}class iJ{constructor(s,d,y){this.property=s,this.normal=d,y&&(this.space=y)}}iJ.prototype.property={};iJ.prototype.normal={};iJ.prototype.space=null;function fMe(o,s){const d={},y={};let S=-1;for(;++S<o.length;)Object.assign(d,o[S].property),Object.assign(y,o[S].normal);return new iJ(d,y,s)}function $Ft(o){return o.toLowerCase()}class L3{constructor(s,d){this.property=s,this.attribute=d}}L3.prototype.space=null;L3.prototype.boolean=!1;L3.prototype.booleanish=!1;L3.prototype.overloadedBoolean=!1;L3.prototype.number=!1;L3.prototype.commaSeparated=!1;L3.prototype.spaceSeparated=!1;L3.prototype.commaOrSpaceSeparated=!1;L3.prototype.mustUseProperty=!1;L3.prototype.defined=!1;let AWn=0;const jc=hL(),c0=hL(),dMe=hL(),ha=hL(),af=hL(),DF=hL(),Ew=hL();function hL(){return 2**++AWn}const jFt=Object.freeze(Object.defineProperty({__proto__:null,boolean:jc,booleanish:c0,commaOrSpaceSeparated:Ew,commaSeparated:DF,number:ha,overloadedBoolean:dMe,spaceSeparated:af},Symbol.toStringTag,{value:"Module"})),xBt=Object.keys(jFt);class ajt extends L3{constructor(s,d,y,S){let N=-1;if(super(s,d),JAe(this,"space",S),typeof y=="number")for(;++N<xBt.length;){const B=xBt[N];JAe(this,xBt[N],(y&jFt[B])===jFt[B])}}}ajt.prototype.defined=!0;function JAe(o,s,d){d&&(o[s]=d)}const IWn={}.hasOwnProperty;function i$(o){const s={},d={};let y;for(y in o.properties)if(IWn.call(o.properties,y)){const S=o.properties[y],N=new ajt(y,o.transform(o.attributes||{},y),S,o.space);o.mustUseProperty&&o.mustUseProperty.includes(y)&&(N.mustUseProperty=!0),s[y]=N,d[$Ft(y)]=y,d[$Ft(N.attribute)]=y}return new iJ(s,d,o.space)}const pMe=i$({space:"xlink",transform(o,s){return"xlink:"+s.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),gMe=i$({space:"xml",transform(o,s){return"xml:"+s.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function bMe(o,s){return s in o?o[s]:s}function mMe(o,s){return bMe(o,s.toLowerCase())}const yMe=i$({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:mMe,properties:{xmlns:null,xmlnsXLink:null}}),wMe=i$({transform(o,s){return s==="role"?s:"aria-"+s.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:c0,ariaAutoComplete:null,ariaBusy:c0,ariaChecked:c0,ariaColCount:ha,ariaColIndex:ha,ariaColSpan:ha,ariaControls:af,ariaCurrent:null,ariaDescribedBy:af,ariaDetails:null,ariaDisabled:c0,ariaDropEffect:af,ariaErrorMessage:null,ariaExpanded:c0,ariaFlowTo:af,ariaGrabbed:c0,ariaHasPopup:null,ariaHidden:c0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:af,ariaLevel:ha,ariaLive:null,ariaModal:c0,ariaMultiLine:c0,ariaMultiSelectable:c0,ariaOrientation:null,ariaOwns:af,ariaPlaceholder:null,ariaPosInSet:ha,ariaPressed:c0,ariaReadOnly:c0,ariaRelevant:null,ariaRequired:c0,ariaRoleDescription:af,ariaRowCount:ha,ariaRowIndex:ha,ariaRowSpan:ha,ariaSelected:c0,ariaSetSize:ha,ariaSort:null,ariaValueMax:ha,ariaValueMin:ha,ariaValueNow:ha,ariaValueText:null,role:null}}),OWn=i$({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:mMe,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:DF,acceptCharset:af,accessKey:af,action:null,allow:null,allowFullScreen:jc,allowPaymentRequest:jc,allowUserMedia:jc,alt:null,as:null,async:jc,autoCapitalize:null,autoComplete:af,autoFocus:jc,autoPlay:jc,blocking:af,capture:null,charSet:null,checked:jc,cite:null,className:af,cols:ha,colSpan:null,content:null,contentEditable:c0,controls:jc,controlsList:af,coords:ha|DF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:jc,defer:jc,dir:null,dirName:null,disabled:jc,download:dMe,draggable:c0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:jc,formTarget:null,headers:af,height:ha,hidden:jc,high:ha,href:null,hrefLang:null,htmlFor:af,httpEquiv:af,id:null,imageSizes:null,imageSrcSet:null,inert:jc,inputMode:null,integrity:null,is:null,isMap:jc,itemId:null,itemProp:af,itemRef:af,itemScope:jc,itemType:af,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:jc,low:ha,manifest:null,max:null,maxLength:ha,media:null,method:null,min:null,minLength:ha,multiple:jc,muted:jc,name:null,nonce:null,noModule:jc,noValidate:jc,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:jc,optimum:ha,pattern:null,ping:af,placeholder:null,playsInline:jc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:jc,referrerPolicy:null,rel:af,required:jc,reversed:jc,rows:ha,rowSpan:ha,sandbox:af,scope:null,scoped:jc,seamless:jc,selected:jc,shadowRootClonable:jc,shadowRootDelegatesFocus:jc,shadowRootMode:null,shape:null,size:ha,sizes:null,slot:null,span:ha,spellCheck:c0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ha,step:null,style:null,tabIndex:ha,target:null,title:null,translate:null,type:null,typeMustMatch:jc,useMap:null,value:c0,width:ha,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:af,axis:null,background:null,bgColor:null,border:ha,borderColor:null,bottomMargin:ha,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:jc,declare:jc,event:null,face:null,frame:null,frameBorder:null,hSpace:ha,leftMargin:ha,link:null,longDesc:null,lowSrc:null,marginHeight:ha,marginWidth:ha,noResize:jc,noHref:jc,noShade:jc,noWrap:jc,object:null,profile:null,prompt:null,rev:null,rightMargin:ha,rules:null,scheme:null,scrolling:c0,standby:null,summary:null,text:null,topMargin:ha,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ha,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:jc,disableRemotePlayback:jc,prefix:null,property:null,results:ha,security:null,unselectable:null}}),NWn=i$({space:"svg",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"},transform:bMe,properties:{about:Ew,accentHeight:ha,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ha,amplitude:ha,arabicForm:null,ascent:ha,attributeName:null,attributeType:null,azimuth:ha,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ha,by:null,calcMode:null,capHeight:ha,className:af,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:ha,diffuseConstant:ha,direction:null,display:null,dur:null,divisor:ha,dominantBaseline:null,download:jc,dx:null,dy:null,edgeMode:null,editable:null,elevation:ha,enableBackground:null,end:null,event:null,exponent:ha,externalResourcesRequired:null,fill:null,fillOpacity:ha,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:DF,g2:DF,glyphName:DF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ha,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ha,horizOriginX:ha,horizOriginY:ha,id:null,ideographic:ha,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ha,k:ha,k1:ha,k2:ha,k3:ha,k4:ha,kernelMatrix:Ew,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ha,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:ha,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:ha,overlineThickness:ha,paintOrder:null,panose1:null,path:null,pathLength:ha,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:af,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ha,pointsAtY:ha,pointsAtZ:ha,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ew,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ew,rev:Ew,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ew,requiredFeatures:Ew,requiredFonts:Ew,requiredFormats:Ew,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:ha,specularExponent:ha,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ha,strikethroughThickness:ha,string:null,stroke:null,strokeDashArray:Ew,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ha,strokeOpacity:ha,strokeWidth:null,style:null,surfaceScale:ha,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ew,tabIndex:ha,tableValues:null,target:null,targetX:ha,targetY:ha,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ew,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ha,underlineThickness:ha,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ha,values:null,vAlphabetic:ha,vMathematical:ha,vectorEffect:null,vHanging:ha,vIdeographic:ha,version:null,vertAdvY:ha,vertOriginX:ha,vertOriginY:ha,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ha,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),LWn=/^data[-\w.:]+$/i,ZAe=/-[a-z]/g,MWn=/[A-Z]/g;function PWn(o,s){const d=$Ft(s);let y=s,S=L3;if(d in o.normal)return o.property[o.normal[d]];if(d.length>4&&d.slice(0,4)==="data"&&LWn.test(s)){if(s.charAt(4)==="-"){const N=s.slice(5).replace(ZAe,DWn);y="data"+N.charAt(0).toUpperCase()+N.slice(1)}else{const N=s.slice(4);if(!ZAe.test(N)){let B=N.replace(MWn,RWn);B.charAt(0)!=="-"&&(B="-"+B),s="data"+B}}S=ajt}return new S(y,s)}function RWn(o){return"-"+o.toLowerCase()}function DWn(o){return o.charAt(1).toUpperCase()}const BWn=fMe([gMe,pMe,yMe,wMe,OWn],"html"),vMe=fMe([gMe,pMe,yMe,wMe,NWn],"svg"),tIe={}.hasOwnProperty;function sjt(o,s){const d=s||{};function y(S,...N){let B=y.invalid;const H=y.handlers;if(S&&tIe.call(S,o)){const et=String(S[o]);B=tIe.call(H,et)?H[et]:y.unknown}if(B)return B.call(this,S,...N)}return y.handlers=d.handlers||{},y.invalid=d.invalid,y.unknown=d.unknown,y}const FWn={},$Wn={}.hasOwnProperty,_Me=sjt("type",{handlers:{root:HWn,element:KWn,text:qWn,comment:WWn,doctype:UWn}});function jWn(o,s){const y=(s||FWn).space;return _Me(o,y==="svg"?vMe:BWn)}function HWn(o,s){const d={nodeName:"#document",mode:(o.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return d.childNodes=ojt(o.children,d,s),a$(o,d),d}function zWn(o,s){const d={nodeName:"#document-fragment",childNodes:[]};return d.childNodes=ojt(o.children,d,s),a$(o,d),d}function UWn(o){const s={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return a$(o,s),s}function qWn(o){const s={nodeName:"#text",value:o.value,parentNode:null};return a$(o,s),s}function WWn(o){const s={nodeName:"#comment",data:o.value,parentNode:null};return a$(o,s),s}function KWn(o,s){const d=s;let y=d;o.type==="element"&&o.tagName.toLowerCase()==="svg"&&d.space==="html"&&(y=vMe);const S=[];let N;if(o.properties){for(N in o.properties)if(N!=="children"&&$Wn.call(o.properties,N)){const et=YWn(y,N,o.properties[N]);et&&S.push(et)}}const B=y.space,H={nodeName:o.tagName,tagName:o.tagName,attrs:S,namespaceURI:tL[B],childNodes:[],parentNode:null};return H.childNodes=ojt(o.children,H,y),a$(o,H),o.tagName==="template"&&o.content&&(H.content=zWn(o.content,y)),H}function YWn(o,s,d){const y=PWn(o,s);if(d===!1||d===null||d===void 0||typeof d=="number"&&Number.isNaN(d)||!d&&y.boolean)return;Array.isArray(d)&&(d=y.commaSeparated?z$t(d):q$t(d));const S={name:y.attribute,value:d===!0?"":String(d)};if(y.space&&y.space!=="html"&&y.space!=="svg"){const N=S.name.indexOf(":");N<0?S.prefix="":(S.name=S.name.slice(N+1),S.prefix=y.attribute.slice(0,N)),S.namespace=tL[y.space]}return S}function ojt(o,s,d){let y=-1;const S=[];if(o)for(;++y<o.length;){const N=_Me(o[y],d);N.parentNode=s,S.push(N)}return S}function a$(o,s){const d=o.position;d&&d.start&&d.end&&(d.start.offset,d.end.offset,s.sourceCodeLocation={startLine:d.start.line,startCol:d.start.column,startOffset:d.start.offset,endLine:d.end.line,endCol:d.end.column,endOffset:d.end.offset})}const xMe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],GWn=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Yf="�";var _e;(function(o){o[o.EOF=-1]="EOF",o[o.NULL=0]="NULL",o[o.TABULATION=9]="TABULATION",o[o.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",o[o.LINE_FEED=10]="LINE_FEED",o[o.FORM_FEED=12]="FORM_FEED",o[o.SPACE=32]="SPACE",o[o.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",o[o.QUOTATION_MARK=34]="QUOTATION_MARK",o[o.AMPERSAND=38]="AMPERSAND",o[o.APOSTROPHE=39]="APOSTROPHE",o[o.HYPHEN_MINUS=45]="HYPHEN_MINUS",o[o.SOLIDUS=47]="SOLIDUS",o[o.DIGIT_0=48]="DIGIT_0",o[o.DIGIT_9=57]="DIGIT_9",o[o.SEMICOLON=59]="SEMICOLON",o[o.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",o[o.EQUALS_SIGN=61]="EQUALS_SIGN",o[o.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",o[o.QUESTION_MARK=63]="QUESTION_MARK",o[o.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",o[o.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",o[o.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",o[o.GRAVE_ACCENT=96]="GRAVE_ACCENT",o[o.LATIN_SMALL_A=97]="LATIN_SMALL_A",o[o.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(_e||(_e={}));const G2={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function EMe(o){return o>=55296&&o<=57343}function VWn(o){return o>=56320&&o<=57343}function XWn(o,s){return(o-55296)*1024+9216+s}function TMe(o){return o!==32&&o!==10&&o!==13&&o!==9&&o!==12&&o>=1&&o<=31||o>=127&&o<=159}function kMe(o){return o>=64976&&o<=65007||GWn.has(o)}var Dr;(function(o){o.controlCharacterInInputStream="control-character-in-input-stream",o.noncharacterInInputStream="noncharacter-in-input-stream",o.surrogateInInputStream="surrogate-in-input-stream",o.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",o.endTagWithAttributes="end-tag-with-attributes",o.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",o.unexpectedSolidusInTag="unexpected-solidus-in-tag",o.unexpectedNullCharacter="unexpected-null-character",o.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",o.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",o.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",o.missingEndTagName="missing-end-tag-name",o.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",o.unknownNamedCharacterReference="unknown-named-character-reference",o.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",o.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",o.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",o.eofBeforeTagName="eof-before-tag-name",o.eofInTag="eof-in-tag",o.missingAttributeValue="missing-attribute-value",o.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",o.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",o.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",o.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",o.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",o.missingDoctypePublicIdentifier="missing-doctype-public-identifier",o.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",o.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",o.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",o.cdataInHtmlContent="cdata-in-html-content",o.incorrectlyOpenedComment="incorrectly-opened-comment",o.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",o.eofInDoctype="eof-in-doctype",o.nestedComment="nested-comment",o.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",o.eofInComment="eof-in-comment",o.incorrectlyClosedComment="incorrectly-closed-comment",o.eofInCdata="eof-in-cdata",o.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",o.nullCharacterReference="null-character-reference",o.surrogateCharacterReference="surrogate-character-reference",o.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",o.controlCharacterReference="control-character-reference",o.noncharacterCharacterReference="noncharacter-character-reference",o.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",o.missingDoctypeName="missing-doctype-name",o.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",o.duplicateAttribute="duplicate-attribute",o.nonConformingDoctype="non-conforming-doctype",o.missingDoctype="missing-doctype",o.misplacedDoctype="misplaced-doctype",o.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",o.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",o.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",o.openElementsLeftAfterEof="open-elements-left-after-eof",o.abandonedHeadElementChild="abandoned-head-element-child",o.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",o.nestedNoscriptInHead="nested-noscript-in-head",o.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Dr||(Dr={}));const QWn=65536;class JWn{constructor(s){this.handler=s,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=QWn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(s,d){const{line:y,col:S,offset:N}=this,B=S+d,H=N+d;return{code:s,startLine:y,endLine:y,startCol:B,endCol:B,startOffset:H,endOffset:H}}_err(s){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(s,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(s){if(this.pos!==this.html.length-1){const d=this.html.charCodeAt(this.pos+1);if(VWn(d))return this.pos++,this._addGap(),XWn(s,d)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,_e.EOF;return this._err(Dr.surrogateInInputStream),s}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(s,d){this.html.length>0?this.html+=s:this.html=s,this.endOfChunkHit=!1,this.lastChunkWritten=d}insertHtmlAtCurrentPos(s){this.html=this.html.substring(0,this.pos+1)+s+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(s,d){if(this.pos+s.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(d)return this.html.startsWith(s,this.pos);for(let y=0;y<s.length;y++)if((this.html.charCodeAt(this.pos+y)|32)!==s.charCodeAt(y))return!1;return!0}peek(s){const d=this.pos+s;if(d>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,_e.EOF;const y=this.html.charCodeAt(d);return y===_e.CARRIAGE_RETURN?_e.LINE_FEED:y}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,_e.EOF;let s=this.html.charCodeAt(this.pos);return s===_e.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,_e.LINE_FEED):s===_e.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,EMe(s)&&(s=this._processSurrogate(s)),this.handler.onParseError===null||s>31&&s<127||s===_e.LINE_FEED||s===_e.CARRIAGE_RETURN||s>159&&s<64976||this._checkForProblematicCharacters(s),s)}_checkForProblematicCharacters(s){TMe(s)?this._err(Dr.controlCharacterInInputStream):kMe(s)&&this._err(Dr.noncharacterInInputStream)}retreat(s){for(this.pos-=s;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Su;(function(o){o[o.CHARACTER=0]="CHARACTER",o[o.NULL_CHARACTER=1]="NULL_CHARACTER",o[o.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",o[o.START_TAG=3]="START_TAG",o[o.END_TAG=4]="END_TAG",o[o.COMMENT=5]="COMMENT",o[o.DOCTYPE=6]="DOCTYPE",o[o.EOF=7]="EOF",o[o.HIBERNATION=8]="HIBERNATION"})(Su||(Su={}));function CMe(o,s){for(let d=o.attrs.length-1;d>=0;d--)if(o.attrs[d].name===s)return o.attrs[d].value;return null}const SMe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(o=>o.charCodeAt(0))),ZWn=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(o=>o.charCodeAt(0)));var EBt;const tKn=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),eKn=(EBt=String.fromCodePoint)!==null&&EBt!==void 0?EBt:function(o){let s="";return o>65535&&(o-=65536,s+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),s+=String.fromCharCode(o),s};function nKn(o){var s;return o>=55296&&o<=57343||o>1114111?65533:(s=tKn.get(o))!==null&&s!==void 0?s:o}var Kp;(function(o){o[o.NUM=35]="NUM",o[o.SEMI=59]="SEMI",o[o.EQUALS=61]="EQUALS",o[o.ZERO=48]="ZERO",o[o.NINE=57]="NINE",o[o.LOWER_A=97]="LOWER_A",o[o.LOWER_F=102]="LOWER_F",o[o.LOWER_X=120]="LOWER_X",o[o.LOWER_Z=122]="LOWER_Z",o[o.UPPER_A=65]="UPPER_A",o[o.UPPER_F=70]="UPPER_F",o[o.UPPER_Z=90]="UPPER_Z"})(Kp||(Kp={}));const rKn=32;var n7;(function(o){o[o.VALUE_LENGTH=49152]="VALUE_LENGTH",o[o.BRANCH_LENGTH=16256]="BRANCH_LENGTH",o[o.JUMP_TABLE=127]="JUMP_TABLE"})(n7||(n7={}));function HFt(o){return o>=Kp.ZERO&&o<=Kp.NINE}function iKn(o){return o>=Kp.UPPER_A&&o<=Kp.UPPER_F||o>=Kp.LOWER_A&&o<=Kp.LOWER_F}function aKn(o){return o>=Kp.UPPER_A&&o<=Kp.UPPER_Z||o>=Kp.LOWER_A&&o<=Kp.LOWER_Z||HFt(o)}function sKn(o){return o===Kp.EQUALS||aKn(o)}var zp;(function(o){o[o.EntityStart=0]="EntityStart",o[o.NumericStart=1]="NumericStart",o[o.NumericDecimal=2]="NumericDecimal",o[o.NumericHex=3]="NumericHex",o[o.NamedEntity=4]="NamedEntity"})(zp||(zp={}));var uk;(function(o){o[o.Legacy=0]="Legacy",o[o.Strict=1]="Strict",o[o.Attribute=2]="Attribute"})(uk||(uk={}));class AMe{constructor(s,d,y){this.decodeTree=s,this.emitCodePoint=d,this.errors=y,this.state=zp.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=uk.Strict}startEntity(s){this.decodeMode=s,this.state=zp.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(s,d){switch(this.state){case zp.EntityStart:return s.charCodeAt(d)===Kp.NUM?(this.state=zp.NumericStart,this.consumed+=1,this.stateNumericStart(s,d+1)):(this.state=zp.NamedEntity,this.stateNamedEntity(s,d));case zp.NumericStart:return this.stateNumericStart(s,d);case zp.NumericDecimal:return this.stateNumericDecimal(s,d);case zp.NumericHex:return this.stateNumericHex(s,d);case zp.NamedEntity:return this.stateNamedEntity(s,d)}}stateNumericStart(s,d){return d>=s.length?-1:(s.charCodeAt(d)|rKn)===Kp.LOWER_X?(this.state=zp.NumericHex,this.consumed+=1,this.stateNumericHex(s,d+1)):(this.state=zp.NumericDecimal,this.stateNumericDecimal(s,d))}addToNumericResult(s,d,y,S){if(d!==y){const N=y-d;this.result=this.result*Math.pow(S,N)+parseInt(s.substr(d,N),S),this.consumed+=N}}stateNumericHex(s,d){const y=d;for(;d<s.length;){const S=s.charCodeAt(d);if(HFt(S)||iKn(S))d+=1;else return this.addToNumericResult(s,y,d,16),this.emitNumericEntity(S,3)}return this.addToNumericResult(s,y,d,16),-1}stateNumericDecimal(s,d){const y=d;for(;d<s.length;){const S=s.charCodeAt(d);if(HFt(S))d+=1;else return this.addToNumericResult(s,y,d,10),this.emitNumericEntity(S,2)}return this.addToNumericResult(s,y,d,10),-1}emitNumericEntity(s,d){var y;if(this.consumed<=d)return(y=this.errors)===null||y===void 0||y.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(s===Kp.SEMI)this.consumed+=1;else if(this.decodeMode===uk.Strict)return 0;return this.emitCodePoint(nKn(this.result),this.consumed),this.errors&&(s!==Kp.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(s,d){const{decodeTree:y}=this;let S=y[this.treeIndex],N=(S&n7.VALUE_LENGTH)>>14;for(;d<s.length;d++,this.excess++){const B=s.charCodeAt(d);if(this.treeIndex=oKn(y,S,this.treeIndex+Math.max(1,N),B),this.treeIndex<0)return this.result===0||this.decodeMode===uk.Attribute&&(N===0||sKn(B))?0:this.emitNotTerminatedNamedEntity();if(S=y[this.treeIndex],N=(S&n7.VALUE_LENGTH)>>14,N!==0){if(B===Kp.SEMI)return this.emitNamedEntityData(this.treeIndex,N,this.consumed+this.excess);this.decodeMode!==uk.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var s;const{result:d,decodeTree:y}=this,S=(y[d]&n7.VALUE_LENGTH)>>14;return this.emitNamedEntityData(d,S,this.consumed),(s=this.errors)===null||s===void 0||s.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(s,d,y){const{decodeTree:S}=this;return this.emitCodePoint(d===1?S[s]&~n7.VALUE_LENGTH:S[s+1],y),d===3&&this.emitCodePoint(S[s+2],y),y}end(){var s;switch(this.state){case zp.NamedEntity:return this.result!==0&&(this.decodeMode!==uk.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case zp.NumericDecimal:return this.emitNumericEntity(0,2);case zp.NumericHex:return this.emitNumericEntity(0,3);case zp.NumericStart:return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case zp.EntityStart:return 0}}}function IMe(o){let s="";const d=new AMe(o,y=>s+=eKn(y));return function(S,N){let B=0,H=0;for(;(H=S.indexOf("&",H))>=0;){s+=S.slice(B,H),d.startEntity(N);const W=d.write(S,H+1);if(W<0){B=H+d.end();break}B=H+W,H=W===0?B+1:B}const et=s+S.slice(B);return s="",et}}function oKn(o,s,d,y){const S=(s&n7.BRANCH_LENGTH)>>7,N=s&n7.JUMP_TABLE;if(S===0)return N!==0&&y===N?d:-1;if(N){const et=y-N;return et<0||et>=S?-1:o[d+et]-1}let B=d,H=B+S-1;for(;B<=H;){const et=B+H>>>1,W=o[et];if(W<y)B=et+1;else if(W>y)H=et-1;else return o[et+S]}return-1}IMe(SMe);IMe(ZWn);var Bi;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.MATHML="http://www.w3.org/1998/Math/MathML",o.SVG="http://www.w3.org/2000/svg",o.XLINK="http://www.w3.org/1999/xlink",o.XML="http://www.w3.org/XML/1998/namespace",o.XMLNS="http://www.w3.org/2000/xmlns/"})(Bi||(Bi={}));var iL;(function(o){o.TYPE="type",o.ACTION="action",o.ENCODING="encoding",o.PROMPT="prompt",o.NAME="name",o.COLOR="color",o.FACE="face",o.SIZE="size"})(iL||(iL={}));var C3;(function(o){o.NO_QUIRKS="no-quirks",o.QUIRKS="quirks",o.LIMITED_QUIRKS="limited-quirks"})(C3||(C3={}));var tr;(function(o){o.A="a",o.ADDRESS="address",o.ANNOTATION_XML="annotation-xml",o.APPLET="applet",o.AREA="area",o.ARTICLE="article",o.ASIDE="aside",o.B="b",o.BASE="base",o.BASEFONT="basefont",o.BGSOUND="bgsound",o.BIG="big",o.BLOCKQUOTE="blockquote",o.BODY="body",o.BR="br",o.BUTTON="button",o.CAPTION="caption",o.CENTER="center",o.CODE="code",o.COL="col",o.COLGROUP="colgroup",o.DD="dd",o.DESC="desc",o.DETAILS="details",o.DIALOG="dialog",o.DIR="dir",o.DIV="div",o.DL="dl",o.DT="dt",o.EM="em",o.EMBED="embed",o.FIELDSET="fieldset",o.FIGCAPTION="figcaption",o.FIGURE="figure",o.FONT="font",o.FOOTER="footer",o.FOREIGN_OBJECT="foreignObject",o.FORM="form",o.FRAME="frame",o.FRAMESET="frameset",o.H1="h1",o.H2="h2",o.H3="h3",o.H4="h4",o.H5="h5",o.H6="h6",o.HEAD="head",o.HEADER="header",o.HGROUP="hgroup",o.HR="hr",o.HTML="html",o.I="i",o.IMG="img",o.IMAGE="image",o.INPUT="input",o.IFRAME="iframe",o.KEYGEN="keygen",o.LABEL="label",o.LI="li",o.LINK="link",o.LISTING="listing",o.MAIN="main",o.MALIGNMARK="malignmark",o.MARQUEE="marquee",o.MATH="math",o.MENU="menu",o.META="meta",o.MGLYPH="mglyph",o.MI="mi",o.MO="mo",o.MN="mn",o.MS="ms",o.MTEXT="mtext",o.NAV="nav",o.NOBR="nobr",o.NOFRAMES="noframes",o.NOEMBED="noembed",o.NOSCRIPT="noscript",o.OBJECT="object",o.OL="ol",o.OPTGROUP="optgroup",o.OPTION="option",o.P="p",o.PARAM="param",o.PLAINTEXT="plaintext",o.PRE="pre",o.RB="rb",o.RP="rp",o.RT="rt",o.RTC="rtc",o.RUBY="ruby",o.S="s",o.SCRIPT="script",o.SEARCH="search",o.SECTION="section",o.SELECT="select",o.SOURCE="source",o.SMALL="small",o.SPAN="span",o.STRIKE="strike",o.STRONG="strong",o.STYLE="style",o.SUB="sub",o.SUMMARY="summary",o.SUP="sup",o.TABLE="table",o.TBODY="tbody",o.TEMPLATE="template",o.TEXTAREA="textarea",o.TFOOT="tfoot",o.TD="td",o.TH="th",o.THEAD="thead",o.TITLE="title",o.TR="tr",o.TRACK="track",o.TT="tt",o.U="u",o.UL="ul",o.SVG="svg",o.VAR="var",o.WBR="wbr",o.XMP="xmp"})(tr||(tr={}));var ft;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.A=1]="A",o[o.ADDRESS=2]="ADDRESS",o[o.ANNOTATION_XML=3]="ANNOTATION_XML",o[o.APPLET=4]="APPLET",o[o.AREA=5]="AREA",o[o.ARTICLE=6]="ARTICLE",o[o.ASIDE=7]="ASIDE",o[o.B=8]="B",o[o.BASE=9]="BASE",o[o.BASEFONT=10]="BASEFONT",o[o.BGSOUND=11]="BGSOUND",o[o.BIG=12]="BIG",o[o.BLOCKQUOTE=13]="BLOCKQUOTE",o[o.BODY=14]="BODY",o[o.BR=15]="BR",o[o.BUTTON=16]="BUTTON",o[o.CAPTION=17]="CAPTION",o[o.CENTER=18]="CENTER",o[o.CODE=19]="CODE",o[o.COL=20]="COL",o[o.COLGROUP=21]="COLGROUP",o[o.DD=22]="DD",o[o.DESC=23]="DESC",o[o.DETAILS=24]="DETAILS",o[o.DIALOG=25]="DIALOG",o[o.DIR=26]="DIR",o[o.DIV=27]="DIV",o[o.DL=28]="DL",o[o.DT=29]="DT",o[o.EM=30]="EM",o[o.EMBED=31]="EMBED",o[o.FIELDSET=32]="FIELDSET",o[o.FIGCAPTION=33]="FIGCAPTION",o[o.FIGURE=34]="FIGURE",o[o.FONT=35]="FONT",o[o.FOOTER=36]="FOOTER",o[o.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",o[o.FORM=38]="FORM",o[o.FRAME=39]="FRAME",o[o.FRAMESET=40]="FRAMESET",o[o.H1=41]="H1",o[o.H2=42]="H2",o[o.H3=43]="H3",o[o.H4=44]="H4",o[o.H5=45]="H5",o[o.H6=46]="H6",o[o.HEAD=47]="HEAD",o[o.HEADER=48]="HEADER",o[o.HGROUP=49]="HGROUP",o[o.HR=50]="HR",o[o.HTML=51]="HTML",o[o.I=52]="I",o[o.IMG=53]="IMG",o[o.IMAGE=54]="IMAGE",o[o.INPUT=55]="INPUT",o[o.IFRAME=56]="IFRAME",o[o.KEYGEN=57]="KEYGEN",o[o.LABEL=58]="LABEL",o[o.LI=59]="LI",o[o.LINK=60]="LINK",o[o.LISTING=61]="LISTING",o[o.MAIN=62]="MAIN",o[o.MALIGNMARK=63]="MALIGNMARK",o[o.MARQUEE=64]="MARQUEE",o[o.MATH=65]="MATH",o[o.MENU=66]="MENU",o[o.META=67]="META",o[o.MGLYPH=68]="MGLYPH",o[o.MI=69]="MI",o[o.MO=70]="MO",o[o.MN=71]="MN",o[o.MS=72]="MS",o[o.MTEXT=73]="MTEXT",o[o.NAV=74]="NAV",o[o.NOBR=75]="NOBR",o[o.NOFRAMES=76]="NOFRAMES",o[o.NOEMBED=77]="NOEMBED",o[o.NOSCRIPT=78]="NOSCRIPT",o[o.OBJECT=79]="OBJECT",o[o.OL=80]="OL",o[o.OPTGROUP=81]="OPTGROUP",o[o.OPTION=82]="OPTION",o[o.P=83]="P",o[o.PARAM=84]="PARAM",o[o.PLAINTEXT=85]="PLAINTEXT",o[o.PRE=86]="PRE",o[o.RB=87]="RB",o[o.RP=88]="RP",o[o.RT=89]="RT",o[o.RTC=90]="RTC",o[o.RUBY=91]="RUBY",o[o.S=92]="S",o[o.SCRIPT=93]="SCRIPT",o[o.SEARCH=94]="SEARCH",o[o.SECTION=95]="SECTION",o[o.SELECT=96]="SELECT",o[o.SOURCE=97]="SOURCE",o[o.SMALL=98]="SMALL",o[o.SPAN=99]="SPAN",o[o.STRIKE=100]="STRIKE",o[o.STRONG=101]="STRONG",o[o.STYLE=102]="STYLE",o[o.SUB=103]="SUB",o[o.SUMMARY=104]="SUMMARY",o[o.SUP=105]="SUP",o[o.TABLE=106]="TABLE",o[o.TBODY=107]="TBODY",o[o.TEMPLATE=108]="TEMPLATE",o[o.TEXTAREA=109]="TEXTAREA",o[o.TFOOT=110]="TFOOT",o[o.TD=111]="TD",o[o.TH=112]="TH",o[o.THEAD=113]="THEAD",o[o.TITLE=114]="TITLE",o[o.TR=115]="TR",o[o.TRACK=116]="TRACK",o[o.TT=117]="TT",o[o.U=118]="U",o[o.UL=119]="UL",o[o.SVG=120]="SVG",o[o.VAR=121]="VAR",o[o.WBR=122]="WBR",o[o.XMP=123]="XMP"})(ft||(ft={}));const cKn=new Map([[tr.A,ft.A],[tr.ADDRESS,ft.ADDRESS],[tr.ANNOTATION_XML,ft.ANNOTATION_XML],[tr.APPLET,ft.APPLET],[tr.AREA,ft.AREA],[tr.ARTICLE,ft.ARTICLE],[tr.ASIDE,ft.ASIDE],[tr.B,ft.B],[tr.BASE,ft.BASE],[tr.BASEFONT,ft.BASEFONT],[tr.BGSOUND,ft.BGSOUND],[tr.BIG,ft.BIG],[tr.BLOCKQUOTE,ft.BLOCKQUOTE],[tr.BODY,ft.BODY],[tr.BR,ft.BR],[tr.BUTTON,ft.BUTTON],[tr.CAPTION,ft.CAPTION],[tr.CENTER,ft.CENTER],[tr.CODE,ft.CODE],[tr.COL,ft.COL],[tr.COLGROUP,ft.COLGROUP],[tr.DD,ft.DD],[tr.DESC,ft.DESC],[tr.DETAILS,ft.DETAILS],[tr.DIALOG,ft.DIALOG],[tr.DIR,ft.DIR],[tr.DIV,ft.DIV],[tr.DL,ft.DL],[tr.DT,ft.DT],[tr.EM,ft.EM],[tr.EMBED,ft.EMBED],[tr.FIELDSET,ft.FIELDSET],[tr.FIGCAPTION,ft.FIGCAPTION],[tr.FIGURE,ft.FIGURE],[tr.FONT,ft.FONT],[tr.FOOTER,ft.FOOTER],[tr.FOREIGN_OBJECT,ft.FOREIGN_OBJECT],[tr.FORM,ft.FORM],[tr.FRAME,ft.FRAME],[tr.FRAMESET,ft.FRAMESET],[tr.H1,ft.H1],[tr.H2,ft.H2],[tr.H3,ft.H3],[tr.H4,ft.H4],[tr.H5,ft.H5],[tr.H6,ft.H6],[tr.HEAD,ft.HEAD],[tr.HEADER,ft.HEADER],[tr.HGROUP,ft.HGROUP],[tr.HR,ft.HR],[tr.HTML,ft.HTML],[tr.I,ft.I],[tr.IMG,ft.IMG],[tr.IMAGE,ft.IMAGE],[tr.INPUT,ft.INPUT],[tr.IFRAME,ft.IFRAME],[tr.KEYGEN,ft.KEYGEN],[tr.LABEL,ft.LABEL],[tr.LI,ft.LI],[tr.LINK,ft.LINK],[tr.LISTING,ft.LISTING],[tr.MAIN,ft.MAIN],[tr.MALIGNMARK,ft.MALIGNMARK],[tr.MARQUEE,ft.MARQUEE],[tr.MATH,ft.MATH],[tr.MENU,ft.MENU],[tr.META,ft.META],[tr.MGLYPH,ft.MGLYPH],[tr.MI,ft.MI],[tr.MO,ft.MO],[tr.MN,ft.MN],[tr.MS,ft.MS],[tr.MTEXT,ft.MTEXT],[tr.NAV,ft.NAV],[tr.NOBR,ft.NOBR],[tr.NOFRAMES,ft.NOFRAMES],[tr.NOEMBED,ft.NOEMBED],[tr.NOSCRIPT,ft.NOSCRIPT],[tr.OBJECT,ft.OBJECT],[tr.OL,ft.OL],[tr.OPTGROUP,ft.OPTGROUP],[tr.OPTION,ft.OPTION],[tr.P,ft.P],[tr.PARAM,ft.PARAM],[tr.PLAINTEXT,ft.PLAINTEXT],[tr.PRE,ft.PRE],[tr.RB,ft.RB],[tr.RP,ft.RP],[tr.RT,ft.RT],[tr.RTC,ft.RTC],[tr.RUBY,ft.RUBY],[tr.S,ft.S],[tr.SCRIPT,ft.SCRIPT],[tr.SEARCH,ft.SEARCH],[tr.SECTION,ft.SECTION],[tr.SELECT,ft.SELECT],[tr.SOURCE,ft.SOURCE],[tr.SMALL,ft.SMALL],[tr.SPAN,ft.SPAN],[tr.STRIKE,ft.STRIKE],[tr.STRONG,ft.STRONG],[tr.STYLE,ft.STYLE],[tr.SUB,ft.SUB],[tr.SUMMARY,ft.SUMMARY],[tr.SUP,ft.SUP],[tr.TABLE,ft.TABLE],[tr.TBODY,ft.TBODY],[tr.TEMPLATE,ft.TEMPLATE],[tr.TEXTAREA,ft.TEXTAREA],[tr.TFOOT,ft.TFOOT],[tr.TD,ft.TD],[tr.TH,ft.TH],[tr.THEAD,ft.THEAD],[tr.TITLE,ft.TITLE],[tr.TR,ft.TR],[tr.TRACK,ft.TRACK],[tr.TT,ft.TT],[tr.U,ft.U],[tr.UL,ft.UL],[tr.SVG,ft.SVG],[tr.VAR,ft.VAR],[tr.WBR,ft.WBR],[tr.XMP,ft.XMP]]);function s$(o){var s;return(s=cKn.get(o))!==null&&s!==void 0?s:ft.UNKNOWN}const Qi=ft,uKn={[Bi.HTML]:new Set([Qi.ADDRESS,Qi.APPLET,Qi.AREA,Qi.ARTICLE,Qi.ASIDE,Qi.BASE,Qi.BASEFONT,Qi.BGSOUND,Qi.BLOCKQUOTE,Qi.BODY,Qi.BR,Qi.BUTTON,Qi.CAPTION,Qi.CENTER,Qi.COL,Qi.COLGROUP,Qi.DD,Qi.DETAILS,Qi.DIR,Qi.DIV,Qi.DL,Qi.DT,Qi.EMBED,Qi.FIELDSET,Qi.FIGCAPTION,Qi.FIGURE,Qi.FOOTER,Qi.FORM,Qi.FRAME,Qi.FRAMESET,Qi.H1,Qi.H2,Qi.H3,Qi.H4,Qi.H5,Qi.H6,Qi.HEAD,Qi.HEADER,Qi.HGROUP,Qi.HR,Qi.HTML,Qi.IFRAME,Qi.IMG,Qi.INPUT,Qi.LI,Qi.LINK,Qi.LISTING,Qi.MAIN,Qi.MARQUEE,Qi.MENU,Qi.META,Qi.NAV,Qi.NOEMBED,Qi.NOFRAMES,Qi.NOSCRIPT,Qi.OBJECT,Qi.OL,Qi.P,Qi.PARAM,Qi.PLAINTEXT,Qi.PRE,Qi.SCRIPT,Qi.SECTION,Qi.SELECT,Qi.SOURCE,Qi.STYLE,Qi.SUMMARY,Qi.TABLE,Qi.TBODY,Qi.TD,Qi.TEMPLATE,Qi.TEXTAREA,Qi.TFOOT,Qi.TH,Qi.THEAD,Qi.TITLE,Qi.TR,Qi.TRACK,Qi.UL,Qi.WBR,Qi.XMP]),[Bi.MATHML]:new Set([Qi.MI,Qi.MO,Qi.MN,Qi.MS,Qi.MTEXT,Qi.ANNOTATION_XML]),[Bi.SVG]:new Set([Qi.TITLE,Qi.FOREIGN_OBJECT,Qi.DESC]),[Bi.XLINK]:new Set,[Bi.XML]:new Set,[Bi.XMLNS]:new Set},zFt=new Set([Qi.H1,Qi.H2,Qi.H3,Qi.H4,Qi.H5,Qi.H6]);tr.STYLE,tr.SCRIPT,tr.XMP,tr.IFRAME,tr.NOEMBED,tr.NOFRAMES,tr.PLAINTEXT;var je;(function(o){o[o.DATA=0]="DATA",o[o.RCDATA=1]="RCDATA",o[o.RAWTEXT=2]="RAWTEXT",o[o.SCRIPT_DATA=3]="SCRIPT_DATA",o[o.PLAINTEXT=4]="PLAINTEXT",o[o.TAG_OPEN=5]="TAG_OPEN",o[o.END_TAG_OPEN=6]="END_TAG_OPEN",o[o.TAG_NAME=7]="TAG_NAME",o[o.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",o[o.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",o[o.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",o[o.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",o[o.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",o[o.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",o[o.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",o[o.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",o[o.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",o[o.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",o[o.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",o[o.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",o[o.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",o[o.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",o[o.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",o[o.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",o[o.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",o[o.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",o[o.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",o[o.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",o[o.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",o[o.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",o[o.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",o[o.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",o[o.BOGUS_COMMENT=40]="BOGUS_COMMENT",o[o.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",o[o.COMMENT_START=42]="COMMENT_START",o[o.COMMENT_START_DASH=43]="COMMENT_START_DASH",o[o.COMMENT=44]="COMMENT",o[o.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",o[o.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",o[o.COMMENT_END_DASH=49]="COMMENT_END_DASH",o[o.COMMENT_END=50]="COMMENT_END",o[o.COMMENT_END_BANG=51]="COMMENT_END_BANG",o[o.DOCTYPE=52]="DOCTYPE",o[o.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",o[o.DOCTYPE_NAME=54]="DOCTYPE_NAME",o[o.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",o[o.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",o[o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",o[o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",o[o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",o[o.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",o[o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",o[o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",o[o.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",o[o.CDATA_SECTION=68]="CDATA_SECTION",o[o.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",o[o.CDATA_SECTION_END=70]="CDATA_SECTION_END",o[o.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",o[o.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(je||(je={}));const I1={DATA:je.DATA,RCDATA:je.RCDATA,RAWTEXT:je.RAWTEXT,SCRIPT_DATA:je.SCRIPT_DATA,PLAINTEXT:je.PLAINTEXT,CDATA_SECTION:je.CDATA_SECTION};function lKn(o){return o>=_e.DIGIT_0&&o<=_e.DIGIT_9}function vQ(o){return o>=_e.LATIN_CAPITAL_A&&o<=_e.LATIN_CAPITAL_Z}function hKn(o){return o>=_e.LATIN_SMALL_A&&o<=_e.LATIN_SMALL_Z}function JS(o){return hKn(o)||vQ(o)}function eIe(o){return JS(o)||lKn(o)}function Dbt(o){return o+32}function OMe(o){return o===_e.SPACE||o===_e.LINE_FEED||o===_e.TABULATION||o===_e.FORM_FEED}function nIe(o){return OMe(o)||o===_e.SOLIDUS||o===_e.GREATER_THAN_SIGN}function fKn(o){return o===_e.NULL?Dr.nullCharacterReference:o>1114111?Dr.characterReferenceOutsideUnicodeRange:EMe(o)?Dr.surrogateCharacterReference:kMe(o)?Dr.noncharacterCharacterReference:TMe(o)||o===_e.CARRIAGE_RETURN?Dr.controlCharacterReference:null}class dKn{constructor(s,d){this.options=s,this.handler=d,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=je.DATA,this.returnState=je.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new JWn(d),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new AMe(SMe,(y,S)=>{this.preprocessor.pos=this.entityStartPos+S-1,this._flushCodePointConsumedAsCharacterReference(y)},d.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Dr.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:y=>{this._err(Dr.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+y)},validateNumericCharacterReference:y=>{const S=fKn(y);S&&this._err(S,1)}}:void 0)}_err(s,d=0){var y,S;(S=(y=this.handler).onParseError)===null||S===void 0||S.call(y,this.preprocessor.getError(s,d))}getCurrentLocation(s){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-s,startOffset:this.preprocessor.offset-s,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const s=this._consume();this._ensureHibernation()||this._callState(s)}this.inLoop=!1}}pause(){this.paused=!0}resume(s){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||s==null||s())}write(s,d,y){this.active=!0,this.preprocessor.write(s,d),this._runParsingLoop(),this.paused||y==null||y()}insertHtmlAtCurrentPos(s){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(s),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(s){this.consumedAfterSnapshot+=s;for(let d=0;d<s;d++)this.preprocessor.advance()}_consumeSequenceIfMatch(s,d){return this.preprocessor.startsWith(s,d)?(this._advanceBy(s.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Su.START_TAG,tagName:"",tagID:ft.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Su.END_TAG,tagName:"",tagID:ft.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(s){this.currentToken={type:Su.COMMENT,data:"",location:this.getCurrentLocation(s)}}_createDoctypeToken(s){this.currentToken={type:Su.DOCTYPE,name:s,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(s,d){this.currentCharacterToken={type:s,chars:d,location:this.currentLocation}}_createAttr(s){this.currentAttr={name:s,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var s,d;const y=this.currentToken;if(CMe(y,this.currentAttr.name)===null){if(y.attrs.push(this.currentAttr),y.location&&this.currentLocation){const S=(s=(d=y.location).attrs)!==null&&s!==void 0?s:d.attrs=Object.create(null);S[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Dr.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(s){this._emitCurrentCharacterToken(s.location),this.currentToken=null,s.location&&(s.location.endLine=this.preprocessor.line,s.location.endCol=this.preprocessor.col+1,s.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const s=this.currentToken;this.prepareToken(s),s.tagID=s$(s.tagName),s.type===Su.START_TAG?(this.lastStartTagName=s.tagName,this.handler.onStartTag(s)):(s.attrs.length>0&&this._err(Dr.endTagWithAttributes),s.selfClosing&&this._err(Dr.endTagWithTrailingSolidus),this.handler.onEndTag(s)),this.preprocessor.dropParsedChunk()}emitCurrentComment(s){this.prepareToken(s),this.handler.onComment(s),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(s){this.prepareToken(s),this.handler.onDoctype(s),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(s){if(this.currentCharacterToken){switch(s&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=s.startLine,this.currentCharacterToken.location.endCol=s.startCol,this.currentCharacterToken.location.endOffset=s.startOffset),this.currentCharacterToken.type){case Su.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Su.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Su.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const s=this.getCurrentLocation(0);s&&(s.endLine=s.startLine,s.endCol=s.startCol,s.endOffset=s.startOffset),this._emitCurrentCharacterToken(s),this.handler.onEof({type:Su.EOF,location:s}),this.active=!1}_appendCharToCurrentCharacterToken(s,d){if(this.currentCharacterToken)if(this.currentCharacterToken.type===s){this.currentCharacterToken.chars+=d;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(s,d)}_emitCodePoint(s){const d=OMe(s)?Su.WHITESPACE_CHARACTER:s===_e.NULL?Su.NULL_CHARACTER:Su.CHARACTER;this._appendCharToCurrentCharacterToken(d,String.fromCodePoint(s))}_emitChars(s){this._appendCharToCurrentCharacterToken(Su.CHARACTER,s)}_startCharacterReference(){this.returnState=this.state,this.state=je.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?uk.Attribute:uk.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===je.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===je.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===je.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(s){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(s):this._emitCodePoint(s)}_callState(s){switch(this.state){case je.DATA:{this._stateData(s);break}case je.RCDATA:{this._stateRcdata(s);break}case je.RAWTEXT:{this._stateRawtext(s);break}case je.SCRIPT_DATA:{this._stateScriptData(s);break}case je.PLAINTEXT:{this._statePlaintext(s);break}case je.TAG_OPEN:{this._stateTagOpen(s);break}case je.END_TAG_OPEN:{this._stateEndTagOpen(s);break}case je.TAG_NAME:{this._stateTagName(s);break}case je.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(s);break}case je.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(s);break}case je.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(s);break}case je.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(s);break}case je.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(s);break}case je.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(s);break}case je.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(s);break}case je.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(s);break}case je.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(s);break}case je.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(s);break}case je.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(s);break}case je.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(s);break}case je.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(s);break}case je.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(s);break}case je.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(s);break}case je.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(s);break}case je.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(s);break}case je.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(s);break}case je.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(s);break}case je.ATTRIBUTE_NAME:{this._stateAttributeName(s);break}case je.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(s);break}case je.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(s);break}case je.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(s);break}case je.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(s);break}case je.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(s);break}case je.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(s);break}case je.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(s);break}case je.BOGUS_COMMENT:{this._stateBogusComment(s);break}case je.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(s);break}case je.COMMENT_START:{this._stateCommentStart(s);break}case je.COMMENT_START_DASH:{this._stateCommentStartDash(s);break}case je.COMMENT:{this._stateComment(s);break}case je.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(s);break}case je.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(s);break}case je.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(s);break}case je.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(s);break}case je.COMMENT_END_DASH:{this._stateCommentEndDash(s);break}case je.COMMENT_END:{this._stateCommentEnd(s);break}case je.COMMENT_END_BANG:{this._stateCommentEndBang(s);break}case je.DOCTYPE:{this._stateDoctype(s);break}case je.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(s);break}case je.DOCTYPE_NAME:{this._stateDoctypeName(s);break}case je.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(s);break}case je.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(s);break}case je.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(s);break}case je.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(s);break}case je.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(s);break}case je.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(s);break}case je.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(s);break}case je.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(s);break}case je.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(s);break}case je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(s);break}case je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(s);break}case je.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(s);break}case je.BOGUS_DOCTYPE:{this._stateBogusDoctype(s);break}case je.CDATA_SECTION:{this._stateCdataSection(s);break}case je.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(s);break}case je.CDATA_SECTION_END:{this._stateCdataSectionEnd(s);break}case je.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case je.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(s);break}default:throw new Error("Unknown state")}}_stateData(s){switch(s){case _e.LESS_THAN_SIGN:{this.state=je.TAG_OPEN;break}case _e.AMPERSAND:{this._startCharacterReference();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitCodePoint(s);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateRcdata(s){switch(s){case _e.AMPERSAND:{this._startCharacterReference();break}case _e.LESS_THAN_SIGN:{this.state=je.RCDATA_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateRawtext(s){switch(s){case _e.LESS_THAN_SIGN:{this.state=je.RAWTEXT_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptData(s){switch(s){case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_statePlaintext(s){switch(s){case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateTagOpen(s){if(JS(s))this._createStartTagToken(),this.state=je.TAG_NAME,this._stateTagName(s);else switch(s){case _e.EXCLAMATION_MARK:{this.state=je.MARKUP_DECLARATION_OPEN;break}case _e.SOLIDUS:{this.state=je.END_TAG_OPEN;break}case _e.QUESTION_MARK:{this._err(Dr.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=je.BOGUS_COMMENT,this._stateBogusComment(s);break}case _e.EOF:{this._err(Dr.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Dr.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=je.DATA,this._stateData(s)}}_stateEndTagOpen(s){if(JS(s))this._createEndTagToken(),this.state=je.TAG_NAME,this._stateTagName(s);else switch(s){case _e.GREATER_THAN_SIGN:{this._err(Dr.missingEndTagName),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Dr.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=je.BOGUS_COMMENT,this._stateBogusComment(s)}}_stateTagName(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BEFORE_ATTRIBUTE_NAME;break}case _e.SOLIDUS:{this.state=je.SELF_CLOSING_START_TAG;break}case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentTagToken();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.tagName+=Yf;break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:d.tagName+=String.fromCodePoint(vQ(s)?Dbt(s):s)}}_stateRcdataLessThanSign(s){s===_e.SOLIDUS?this.state=je.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=je.RCDATA,this._stateRcdata(s))}_stateRcdataEndTagOpen(s){JS(s)?(this.state=je.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(s)):(this._emitChars("</"),this.state=je.RCDATA,this._stateRcdata(s))}handleSpecialEndTag(s){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const d=this.currentToken;switch(d.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=je.BEFORE_ATTRIBUTE_NAME,!1;case _e.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=je.SELF_CLOSING_START_TAG,!1;case _e.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=je.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=je.RCDATA,this._stateRcdata(s))}_stateRawtextLessThanSign(s){s===_e.SOLIDUS?this.state=je.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=je.RAWTEXT,this._stateRawtext(s))}_stateRawtextEndTagOpen(s){JS(s)?(this.state=je.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(s)):(this._emitChars("</"),this.state=je.RAWTEXT,this._stateRawtext(s))}_stateRawtextEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=je.RAWTEXT,this._stateRawtext(s))}_stateScriptDataLessThanSign(s){switch(s){case _e.SOLIDUS:{this.state=je.SCRIPT_DATA_END_TAG_OPEN;break}case _e.EXCLAMATION_MARK:{this.state=je.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=je.SCRIPT_DATA,this._stateScriptData(s)}}_stateScriptDataEndTagOpen(s){JS(s)?(this.state=je.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(s)):(this._emitChars("</"),this.state=je.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=je.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscapeStart(s){s===_e.HYPHEN_MINUS?(this.state=je.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=je.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscapeStartDash(s){s===_e.HYPHEN_MINUS?(this.state=je.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=je.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscaped(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptDataEscapedDash(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.state=je.SCRIPT_DATA_ESCAPED,this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=je.SCRIPT_DATA_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataEscapedDashDash(s){switch(s){case _e.HYPHEN_MINUS:{this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _e.GREATER_THAN_SIGN:{this.state=je.SCRIPT_DATA,this._emitChars(">");break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.state=je.SCRIPT_DATA_ESCAPED,this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=je.SCRIPT_DATA_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataEscapedLessThanSign(s){s===_e.SOLIDUS?this.state=je.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:JS(s)?(this._emitChars("<"),this.state=je.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(s)):(this._emitChars("<"),this.state=je.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataEscapedEndTagOpen(s){JS(s)?(this.state=je.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(s)):(this._emitChars("</"),this.state=je.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataEscapedEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=je.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataDoubleEscapeStart(s){if(this.preprocessor.startsWith(G2.SCRIPT,!1)&&nIe(this.preprocessor.peek(G2.SCRIPT.length))){this._emitCodePoint(s);for(let d=0;d<G2.SCRIPT.length;d++)this._emitCodePoint(this._consume());this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=je.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataDoubleEscaped(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedDash(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedDashDash(s){switch(s){case _e.HYPHEN_MINUS:{this._emitChars("-");break}case _e.LESS_THAN_SIGN:{this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _e.GREATER_THAN_SIGN:{this.state=je.SCRIPT_DATA,this._emitChars(">");break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Yf);break}case _e.EOF:{this._err(Dr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedLessThanSign(s){s===_e.SOLIDUS?(this.state=je.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(s))}_stateScriptDataDoubleEscapeEnd(s){if(this.preprocessor.startsWith(G2.SCRIPT,!1)&&nIe(this.preprocessor.peek(G2.SCRIPT.length))){this._emitCodePoint(s);for(let d=0;d<G2.SCRIPT.length;d++)this._emitCodePoint(this._consume());this.state=je.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=je.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(s))}_stateBeforeAttributeName(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.SOLIDUS:case _e.GREATER_THAN_SIGN:case _e.EOF:{this.state=je.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(s);break}case _e.EQUALS_SIGN:{this._err(Dr.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=je.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=je.ATTRIBUTE_NAME,this._stateAttributeName(s)}}_stateAttributeName(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:case _e.SOLIDUS:case _e.GREATER_THAN_SIGN:case _e.EOF:{this._leaveAttrName(),this.state=je.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(s);break}case _e.EQUALS_SIGN:{this._leaveAttrName(),this.state=je.BEFORE_ATTRIBUTE_VALUE;break}case _e.QUOTATION_MARK:case _e.APOSTROPHE:case _e.LESS_THAN_SIGN:{this._err(Dr.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(s);break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.currentAttr.name+=Yf;break}default:this.currentAttr.name+=String.fromCodePoint(vQ(s)?Dbt(s):s)}}_stateAfterAttributeName(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.SOLIDUS:{this.state=je.SELF_CLOSING_START_TAG;break}case _e.EQUALS_SIGN:{this.state=je.BEFORE_ATTRIBUTE_VALUE;break}case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentTagToken();break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=je.ATTRIBUTE_NAME,this._stateAttributeName(s)}}_stateBeforeAttributeValue(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.QUOTATION_MARK:{this.state=je.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{this.state=je.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingAttributeValue),this.state=je.DATA,this.emitCurrentTagToken();break}default:this.state=je.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(s)}}_stateAttributeValueDoubleQuoted(s){switch(s){case _e.QUOTATION_MARK:{this.state=je.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case _e.AMPERSAND:{this._startCharacterReference();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.currentAttr.value+=Yf;break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAttributeValueSingleQuoted(s){switch(s){case _e.APOSTROPHE:{this.state=je.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case _e.AMPERSAND:{this._startCharacterReference();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.currentAttr.value+=Yf;break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAttributeValueUnquoted(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this._leaveAttrValue(),this.state=je.BEFORE_ATTRIBUTE_NAME;break}case _e.AMPERSAND:{this._startCharacterReference();break}case _e.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=je.DATA,this.emitCurrentTagToken();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this.currentAttr.value+=Yf;break}case _e.QUOTATION_MARK:case _e.APOSTROPHE:case _e.LESS_THAN_SIGN:case _e.EQUALS_SIGN:case _e.GRAVE_ACCENT:{this._err(Dr.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(s);break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAfterAttributeValueQuoted(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this._leaveAttrValue(),this.state=je.BEFORE_ATTRIBUTE_NAME;break}case _e.SOLIDUS:{this._leaveAttrValue(),this.state=je.SELF_CLOSING_START_TAG;break}case _e.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=je.DATA,this.emitCurrentTagToken();break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this._err(Dr.missingWhitespaceBetweenAttributes),this.state=je.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(s)}}_stateSelfClosingStartTag(s){switch(s){case _e.GREATER_THAN_SIGN:{const d=this.currentToken;d.selfClosing=!0,this.state=je.DATA,this.emitCurrentTagToken();break}case _e.EOF:{this._err(Dr.eofInTag),this._emitEOFToken();break}default:this._err(Dr.unexpectedSolidusInTag),this.state=je.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(s)}}_stateBogusComment(s){const d=this.currentToken;switch(s){case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentComment(d);break}case _e.EOF:{this.emitCurrentComment(d),this._emitEOFToken();break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.data+=Yf;break}default:d.data+=String.fromCodePoint(s)}}_stateMarkupDeclarationOpen(s){this._consumeSequenceIfMatch(G2.DASH_DASH,!0)?(this._createCommentToken(G2.DASH_DASH.length+1),this.state=je.COMMENT_START):this._consumeSequenceIfMatch(G2.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(G2.DOCTYPE.length+1),this.state=je.DOCTYPE):this._consumeSequenceIfMatch(G2.CDATA_START,!0)?this.inForeignNode?this.state=je.CDATA_SECTION:(this._err(Dr.cdataInHtmlContent),this._createCommentToken(G2.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=je.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Dr.incorrectlyOpenedComment),this._createCommentToken(2),this.state=je.BOGUS_COMMENT,this._stateBogusComment(s))}_stateCommentStart(s){switch(s){case _e.HYPHEN_MINUS:{this.state=je.COMMENT_START_DASH;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptClosingOfEmptyComment),this.state=je.DATA;const d=this.currentToken;this.emitCurrentComment(d);break}default:this.state=je.COMMENT,this._stateComment(s)}}_stateCommentStartDash(s){const d=this.currentToken;switch(s){case _e.HYPHEN_MINUS:{this.state=je.COMMENT_END;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptClosingOfEmptyComment),this.state=je.DATA,this.emitCurrentComment(d);break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+="-",this.state=je.COMMENT,this._stateComment(s)}}_stateComment(s){const d=this.currentToken;switch(s){case _e.HYPHEN_MINUS:{this.state=je.COMMENT_END_DASH;break}case _e.LESS_THAN_SIGN:{d.data+="<",this.state=je.COMMENT_LESS_THAN_SIGN;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.data+=Yf;break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+=String.fromCodePoint(s)}}_stateCommentLessThanSign(s){const d=this.currentToken;switch(s){case _e.EXCLAMATION_MARK:{d.data+="!",this.state=je.COMMENT_LESS_THAN_SIGN_BANG;break}case _e.LESS_THAN_SIGN:{d.data+="<";break}default:this.state=je.COMMENT,this._stateComment(s)}}_stateCommentLessThanSignBang(s){s===_e.HYPHEN_MINUS?this.state=je.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=je.COMMENT,this._stateComment(s))}_stateCommentLessThanSignBangDash(s){s===_e.HYPHEN_MINUS?this.state=je.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=je.COMMENT_END_DASH,this._stateCommentEndDash(s))}_stateCommentLessThanSignBangDashDash(s){s!==_e.GREATER_THAN_SIGN&&s!==_e.EOF&&this._err(Dr.nestedComment),this.state=je.COMMENT_END,this._stateCommentEnd(s)}_stateCommentEndDash(s){const d=this.currentToken;switch(s){case _e.HYPHEN_MINUS:{this.state=je.COMMENT_END;break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+="-",this.state=je.COMMENT,this._stateComment(s)}}_stateCommentEnd(s){const d=this.currentToken;switch(s){case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentComment(d);break}case _e.EXCLAMATION_MARK:{this.state=je.COMMENT_END_BANG;break}case _e.HYPHEN_MINUS:{d.data+="-";break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+="--",this.state=je.COMMENT,this._stateComment(s)}}_stateCommentEndBang(s){const d=this.currentToken;switch(s){case _e.HYPHEN_MINUS:{d.data+="--!",this.state=je.COMMENT_END_DASH;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.incorrectlyClosedComment),this.state=je.DATA,this.emitCurrentComment(d);break}case _e.EOF:{this._err(Dr.eofInComment),this.emitCurrentComment(d),this._emitEOFToken();break}default:d.data+="--!",this.state=je.COMMENT,this._stateComment(s)}}_stateDoctype(s){switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BEFORE_DOCTYPE_NAME;break}case _e.GREATER_THAN_SIGN:{this.state=je.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(s);break}case _e.EOF:{this._err(Dr.eofInDoctype),this._createDoctypeToken(null);const d=this.currentToken;d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingWhitespaceBeforeDoctypeName),this.state=je.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(s)}}_stateBeforeDoctypeName(s){if(vQ(s))this._createDoctypeToken(String.fromCharCode(Dbt(s))),this.state=je.DOCTYPE_NAME;else switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.NULL:{this._err(Dr.unexpectedNullCharacter),this._createDoctypeToken(Yf),this.state=je.DOCTYPE_NAME;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypeName),this._createDoctypeToken(null);const d=this.currentToken;d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),this._createDoctypeToken(null);const d=this.currentToken;d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(s)),this.state=je.DOCTYPE_NAME}}_stateDoctypeName(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.AFTER_DOCTYPE_NAME;break}case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.name+=Yf;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.name+=String.fromCodePoint(vQ(s)?Dbt(s):s)}}_stateAfterDoctypeName(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(G2.PUBLIC,!1)?this.state=je.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(G2.SYSTEM,!1)?this.state=je.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Dr.invalidCharacterSequenceAfterDoctypeName),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s))}}_stateAfterDoctypePublicKeyword(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case _e.QUOTATION_MARK:{this._err(Dr.missingWhitespaceAfterDoctypePublicKeyword),d.publicId="",this.state=je.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{this._err(Dr.missingWhitespaceAfterDoctypePublicKeyword),d.publicId="",this.state=je.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypePublicIdentifier),d.forceQuirks=!0,this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypePublicIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBeforeDoctypePublicIdentifier(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.QUOTATION_MARK:{d.publicId="",this.state=je.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{d.publicId="",this.state=je.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypePublicIdentifier),d.forceQuirks=!0,this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypePublicIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateDoctypePublicIdentifierDoubleQuoted(s){const d=this.currentToken;switch(s){case _e.QUOTATION_MARK:{this.state=je.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.publicId+=Yf;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptDoctypePublicIdentifier),d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.publicId+=String.fromCodePoint(s)}}_stateDoctypePublicIdentifierSingleQuoted(s){const d=this.currentToken;switch(s){case _e.APOSTROPHE:{this.state=je.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.publicId+=Yf;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptDoctypePublicIdentifier),d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.publicId+=String.fromCodePoint(s)}}_stateAfterDoctypePublicIdentifier(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case _e.GREATER_THAN_SIGN:{this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.QUOTATION_MARK:{this._err(Dr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{this._err(Dr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBetweenDoctypePublicAndSystemIdentifiers(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.GREATER_THAN_SIGN:{this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.QUOTATION_MARK:{d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateAfterDoctypeSystemKeyword(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:{this.state=je.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case _e.QUOTATION_MARK:{this._err(Dr.missingWhitespaceAfterDoctypeSystemKeyword),d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{this._err(Dr.missingWhitespaceAfterDoctypeSystemKeyword),d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBeforeDoctypeSystemIdentifier(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.QUOTATION_MARK:{d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _e.APOSTROPHE:{d.systemId="",this.state=je.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.missingDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.DATA,this.emitCurrentDoctype(d);break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.missingQuoteBeforeDoctypeSystemIdentifier),d.forceQuirks=!0,this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateDoctypeSystemIdentifierDoubleQuoted(s){const d=this.currentToken;switch(s){case _e.QUOTATION_MARK:{this.state=je.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.systemId+=Yf;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptDoctypeSystemIdentifier),d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.systemId+=String.fromCodePoint(s)}}_stateDoctypeSystemIdentifierSingleQuoted(s){const d=this.currentToken;switch(s){case _e.APOSTROPHE:{this.state=je.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter),d.systemId+=Yf;break}case _e.GREATER_THAN_SIGN:{this._err(Dr.abruptDoctypeSystemIdentifier),d.forceQuirks=!0,this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:d.systemId+=String.fromCodePoint(s)}}_stateAfterDoctypeSystemIdentifier(s){const d=this.currentToken;switch(s){case _e.SPACE:case _e.LINE_FEED:case _e.TABULATION:case _e.FORM_FEED:break;case _e.GREATER_THAN_SIGN:{this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.EOF:{this._err(Dr.eofInDoctype),d.forceQuirks=!0,this.emitCurrentDoctype(d),this._emitEOFToken();break}default:this._err(Dr.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=je.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBogusDoctype(s){const d=this.currentToken;switch(s){case _e.GREATER_THAN_SIGN:{this.emitCurrentDoctype(d),this.state=je.DATA;break}case _e.NULL:{this._err(Dr.unexpectedNullCharacter);break}case _e.EOF:{this.emitCurrentDoctype(d),this._emitEOFToken();break}}}_stateCdataSection(s){switch(s){case _e.RIGHT_SQUARE_BRACKET:{this.state=je.CDATA_SECTION_BRACKET;break}case _e.EOF:{this._err(Dr.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateCdataSectionBracket(s){s===_e.RIGHT_SQUARE_BRACKET?this.state=je.CDATA_SECTION_END:(this._emitChars("]"),this.state=je.CDATA_SECTION,this._stateCdataSection(s))}_stateCdataSectionEnd(s){switch(s){case _e.GREATER_THAN_SIGN:{this.state=je.DATA;break}case _e.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=je.CDATA_SECTION,this._stateCdataSection(s)}}_stateCharacterReference(){let s=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(s<0)if(this.preprocessor.lastChunkWritten)s=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}s===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(_e.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&eIe(this.preprocessor.peek(1))?je.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(s){eIe(s)?this._flushCodePointConsumedAsCharacterReference(s):(s===_e.SEMICOLON&&this._err(Dr.unknownNamedCharacterReference),this.state=this.returnState,this._callState(s))}}const NMe=new Set([ft.DD,ft.DT,ft.LI,ft.OPTGROUP,ft.OPTION,ft.P,ft.RB,ft.RP,ft.RT,ft.RTC]),rIe=new Set([...NMe,ft.CAPTION,ft.COLGROUP,ft.TBODY,ft.TD,ft.TFOOT,ft.TH,ft.THEAD,ft.TR]),Fmt=new Set([ft.APPLET,ft.CAPTION,ft.HTML,ft.MARQUEE,ft.OBJECT,ft.TABLE,ft.TD,ft.TEMPLATE,ft.TH]),pKn=new Set([...Fmt,ft.OL,ft.UL]),gKn=new Set([...Fmt,ft.BUTTON]),iIe=new Set([ft.ANNOTATION_XML,ft.MI,ft.MN,ft.MO,ft.MS,ft.MTEXT]),aIe=new Set([ft.DESC,ft.FOREIGN_OBJECT,ft.TITLE]),bKn=new Set([ft.TR,ft.TEMPLATE,ft.HTML]),mKn=new Set([ft.TBODY,ft.TFOOT,ft.THEAD,ft.TEMPLATE,ft.HTML]),yKn=new Set([ft.TABLE,ft.TEMPLATE,ft.HTML]),wKn=new Set([ft.TD,ft.TH]);class vKn{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(s,d,y){this.treeAdapter=d,this.handler=y,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=ft.UNKNOWN,this.current=s}_indexOf(s){return this.items.lastIndexOf(s,this.stackTop)}_isInTemplate(){return this.currentTagId===ft.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Bi.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(s,d){this.stackTop++,this.items[this.stackTop]=s,this.current=s,this.tagIDs[this.stackTop]=d,this.currentTagId=d,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(s,d,!0)}pop(){const s=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(s,!0)}replace(s,d){const y=this._indexOf(s);this.items[y]=d,y===this.stackTop&&(this.current=d)}insertAfter(s,d,y){const S=this._indexOf(s)+1;this.items.splice(S,0,d),this.tagIDs.splice(S,0,y),this.stackTop++,S===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,S===this.stackTop)}popUntilTagNamePopped(s){let d=this.stackTop+1;do d=this.tagIDs.lastIndexOf(s,d-1);while(d>0&&this.treeAdapter.getNamespaceURI(this.items[d])!==Bi.HTML);this.shortenToLength(d<0?0:d)}shortenToLength(s){for(;this.stackTop>=s;){const d=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(d,this.stackTop<s)}}popUntilElementPopped(s){const d=this._indexOf(s);this.shortenToLength(d<0?0:d)}popUntilPopped(s,d){const y=this._indexOfTagNames(s,d);this.shortenToLength(y<0?0:y)}popUntilNumberedHeaderPopped(){this.popUntilPopped(zFt,Bi.HTML)}popUntilTableCellPopped(){this.popUntilPopped(wKn,Bi.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(s,d){for(let y=this.stackTop;y>=0;y--)if(s.has(this.tagIDs[y])&&this.treeAdapter.getNamespaceURI(this.items[y])===d)return y;return-1}clearBackTo(s,d){const y=this._indexOfTagNames(s,d);this.shortenToLength(y+1)}clearBackToTableContext(){this.clearBackTo(yKn,Bi.HTML)}clearBackToTableBodyContext(){this.clearBackTo(mKn,Bi.HTML)}clearBackToTableRowContext(){this.clearBackTo(bKn,Bi.HTML)}remove(s){const d=this._indexOf(s);d>=0&&(d===this.stackTop?this.pop():(this.items.splice(d,1),this.tagIDs.splice(d,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(s,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===ft.BODY?this.items[1]:null}contains(s){return this._indexOf(s)>-1}getCommonAncestor(s){const d=this._indexOf(s)-1;return d>=0?this.items[d]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===ft.HTML}hasInDynamicScope(s,d){for(let y=this.stackTop;y>=0;y--){const S=this.tagIDs[y];switch(this.treeAdapter.getNamespaceURI(this.items[y])){case Bi.HTML:{if(S===s)return!0;if(d.has(S))return!1;break}case Bi.SVG:{if(aIe.has(S))return!1;break}case Bi.MATHML:{if(iIe.has(S))return!1;break}}}return!0}hasInScope(s){return this.hasInDynamicScope(s,Fmt)}hasInListItemScope(s){return this.hasInDynamicScope(s,pKn)}hasInButtonScope(s){return this.hasInDynamicScope(s,gKn)}hasNumberedHeaderInScope(){for(let s=this.stackTop;s>=0;s--){const d=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case Bi.HTML:{if(zFt.has(d))return!0;if(Fmt.has(d))return!1;break}case Bi.SVG:{if(aIe.has(d))return!1;break}case Bi.MATHML:{if(iIe.has(d))return!1;break}}}return!0}hasInTableScope(s){for(let d=this.stackTop;d>=0;d--)if(this.treeAdapter.getNamespaceURI(this.items[d])===Bi.HTML)switch(this.tagIDs[d]){case s:return!0;case ft.TABLE:case ft.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let s=this.stackTop;s>=0;s--)if(this.treeAdapter.getNamespaceURI(this.items[s])===Bi.HTML)switch(this.tagIDs[s]){case ft.TBODY:case ft.THEAD:case ft.TFOOT:return!0;case ft.TABLE:case ft.HTML:return!1}return!0}hasInSelectScope(s){for(let d=this.stackTop;d>=0;d--)if(this.treeAdapter.getNamespaceURI(this.items[d])===Bi.HTML)switch(this.tagIDs[d]){case s:return!0;case ft.OPTION:case ft.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;NMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;rIe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(s){for(;this.currentTagId!==s&&rIe.has(this.currentTagId);)this.pop()}}const TBt=3;var v6;(function(o){o[o.Marker=0]="Marker",o[o.Element=1]="Element"})(v6||(v6={}));const sIe={type:v6.Marker};class _Kn{constructor(s){this.treeAdapter=s,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(s,d){const y=[],S=d.length,N=this.treeAdapter.getTagName(s),B=this.treeAdapter.getNamespaceURI(s);for(let H=0;H<this.entries.length;H++){const et=this.entries[H];if(et.type===v6.Marker)break;const{element:W}=et;if(this.treeAdapter.getTagName(W)===N&&this.treeAdapter.getNamespaceURI(W)===B){const nt=this.treeAdapter.getAttrList(W);nt.length===S&&y.push({idx:H,attrs:nt})}}return y}_ensureNoahArkCondition(s){if(this.entries.length<TBt)return;const d=this.treeAdapter.getAttrList(s),y=this._getNoahArkConditionCandidates(s,d);if(y.length<TBt)return;const S=new Map(d.map(B=>[B.name,B.value]));let N=0;for(let B=0;B<y.length;B++){const H=y[B];H.attrs.every(et=>S.get(et.name)===et.value)&&(N+=1,N>=TBt&&this.entries.splice(H.idx,1))}}insertMarker(){this.entries.unshift(sIe)}pushElement(s,d){this._ensureNoahArkCondition(s),this.entries.unshift({type:v6.Element,element:s,token:d})}insertElementAfterBookmark(s,d){const y=this.entries.indexOf(this.bookmark);this.entries.splice(y,0,{type:v6.Element,element:s,token:d})}removeEntry(s){const d=this.entries.indexOf(s);d>=0&&this.entries.splice(d,1)}clearToLastMarker(){const s=this.entries.indexOf(sIe);s>=0?this.entries.splice(0,s+1):this.entries.length=0}getElementEntryInScopeWithTagName(s){const d=this.entries.find(y=>y.type===v6.Marker||this.treeAdapter.getTagName(y.element)===s);return d&&d.type===v6.Element?d:null}getElementEntry(s){return this.entries.find(d=>d.type===v6.Element&&d.element===s)}}const ZS={createDocument(){return{nodeName:"#document",mode:C3.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(o,s,d){return{nodeName:o,tagName:o,attrs:d,namespaceURI:s,childNodes:[],parentNode:null}},createCommentNode(o){return{nodeName:"#comment",data:o,parentNode:null}},createTextNode(o){return{nodeName:"#text",value:o,parentNode:null}},appendChild(o,s){o.childNodes.push(s),s.parentNode=o},insertBefore(o,s,d){const y=o.childNodes.indexOf(d);o.childNodes.splice(y,0,s),s.parentNode=o},setTemplateContent(o,s){o.content=s},getTemplateContent(o){return o.content},setDocumentType(o,s,d,y){const S=o.childNodes.find(N=>N.nodeName==="#documentType");if(S)S.name=s,S.publicId=d,S.systemId=y;else{const N={nodeName:"#documentType",name:s,publicId:d,systemId:y,parentNode:null};ZS.appendChild(o,N)}},setDocumentMode(o,s){o.mode=s},getDocumentMode(o){return o.mode},detachNode(o){if(o.parentNode){const s=o.parentNode.childNodes.indexOf(o);o.parentNode.childNodes.splice(s,1),o.parentNode=null}},insertText(o,s){if(o.childNodes.length>0){const d=o.childNodes[o.childNodes.length-1];if(ZS.isTextNode(d)){d.value+=s;return}}ZS.appendChild(o,ZS.createTextNode(s))},insertTextBefore(o,s,d){const y=o.childNodes[o.childNodes.indexOf(d)-1];y&&ZS.isTextNode(y)?y.value+=s:ZS.insertBefore(o,ZS.createTextNode(s),d)},adoptAttributes(o,s){const d=new Set(o.attrs.map(y=>y.name));for(let y=0;y<s.length;y++)d.has(s[y].name)||o.attrs.push(s[y])},getFirstChild(o){return o.childNodes[0]},getChildNodes(o){return o.childNodes},getParentNode(o){return o.parentNode},getAttrList(o){return o.attrs},getTagName(o){return o.tagName},getNamespaceURI(o){return o.namespaceURI},getTextNodeContent(o){return o.value},getCommentNodeContent(o){return o.data},getDocumentTypeNodeName(o){return o.name},getDocumentTypeNodePublicId(o){return o.publicId},getDocumentTypeNodeSystemId(o){return o.systemId},isTextNode(o){return o.nodeName==="#text"},isCommentNode(o){return o.nodeName==="#comment"},isDocumentTypeNode(o){return o.nodeName==="#documentType"},isElementNode(o){return Object.prototype.hasOwnProperty.call(o,"tagName")},setNodeSourceCodeLocation(o,s){o.sourceCodeLocation=s},getNodeSourceCodeLocation(o){return o.sourceCodeLocation},updateNodeSourceCodeLocation(o,s){o.sourceCodeLocation={...o.sourceCodeLocation,...s}}},LMe="html",xKn="about:legacy-compat",EKn="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",MMe=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],TKn=[...MMe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],kKn=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),PMe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],CKn=[...PMe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function oIe(o,s){return s.some(d=>o.startsWith(d))}function SKn(o){return o.name===LMe&&o.publicId===null&&(o.systemId===null||o.systemId===xKn)}function AKn(o){if(o.name!==LMe)return C3.QUIRKS;const{systemId:s}=o;if(s&&s.toLowerCase()===EKn)return C3.QUIRKS;let{publicId:d}=o;if(d!==null){if(d=d.toLowerCase(),kKn.has(d))return C3.QUIRKS;let y=s===null?TKn:MMe;if(oIe(d,y))return C3.QUIRKS;if(y=s===null?PMe:CKn,oIe(d,y))return C3.LIMITED_QUIRKS}return C3.NO_QUIRKS}const cIe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},IKn="definitionurl",OKn="definitionURL",NKn=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(o=>[o.toLowerCase(),o])),LKn=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Bi.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Bi.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Bi.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Bi.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Bi.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Bi.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Bi.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Bi.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Bi.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Bi.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Bi.XMLNS}]]),MKn=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(o=>[o.toLowerCase(),o])),PKn=new Set([ft.B,ft.BIG,ft.BLOCKQUOTE,ft.BODY,ft.BR,ft.CENTER,ft.CODE,ft.DD,ft.DIV,ft.DL,ft.DT,ft.EM,ft.EMBED,ft.H1,ft.H2,ft.H3,ft.H4,ft.H5,ft.H6,ft.HEAD,ft.HR,ft.I,ft.IMG,ft.LI,ft.LISTING,ft.MENU,ft.META,ft.NOBR,ft.OL,ft.P,ft.PRE,ft.RUBY,ft.S,ft.SMALL,ft.SPAN,ft.STRONG,ft.STRIKE,ft.SUB,ft.SUP,ft.TABLE,ft.TT,ft.U,ft.UL,ft.VAR]);function RKn(o){const s=o.tagID;return s===ft.FONT&&o.attrs.some(({name:y})=>y===iL.COLOR||y===iL.SIZE||y===iL.FACE)||PKn.has(s)}function RMe(o){for(let s=0;s<o.attrs.length;s++)if(o.attrs[s].name===IKn){o.attrs[s].name=OKn;break}}function DMe(o){for(let s=0;s<o.attrs.length;s++){const d=NKn.get(o.attrs[s].name);d!=null&&(o.attrs[s].name=d)}}function cjt(o){for(let s=0;s<o.attrs.length;s++){const d=LKn.get(o.attrs[s].name);d&&(o.attrs[s].prefix=d.prefix,o.attrs[s].name=d.name,o.attrs[s].namespace=d.namespace)}}function DKn(o){const s=MKn.get(o.tagName);s!=null&&(o.tagName=s,o.tagID=s$(o.tagName))}function BKn(o,s){return s===Bi.MATHML&&(o===ft.MI||o===ft.MO||o===ft.MN||o===ft.MS||o===ft.MTEXT)}function FKn(o,s,d){if(s===Bi.MATHML&&o===ft.ANNOTATION_XML){for(let y=0;y<d.length;y++)if(d[y].name===iL.ENCODING){const S=d[y].value.toLowerCase();return S===cIe.TEXT_HTML||S===cIe.APPLICATION_XML}}return s===Bi.SVG&&(o===ft.FOREIGN_OBJECT||o===ft.DESC||o===ft.TITLE)}function $Kn(o,s,d,y){return(!y||y===Bi.HTML)&&FKn(o,s,d)||(!y||y===Bi.MATHML)&&BKn(o,s)}const jKn="hidden",HKn=8,zKn=3;var Qe;(function(o){o[o.INITIAL=0]="INITIAL",o[o.BEFORE_HTML=1]="BEFORE_HTML",o[o.BEFORE_HEAD=2]="BEFORE_HEAD",o[o.IN_HEAD=3]="IN_HEAD",o[o.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",o[o.AFTER_HEAD=5]="AFTER_HEAD",o[o.IN_BODY=6]="IN_BODY",o[o.TEXT=7]="TEXT",o[o.IN_TABLE=8]="IN_TABLE",o[o.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",o[o.IN_CAPTION=10]="IN_CAPTION",o[o.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",o[o.IN_TABLE_BODY=12]="IN_TABLE_BODY",o[o.IN_ROW=13]="IN_ROW",o[o.IN_CELL=14]="IN_CELL",o[o.IN_SELECT=15]="IN_SELECT",o[o.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",o[o.IN_TEMPLATE=17]="IN_TEMPLATE",o[o.AFTER_BODY=18]="AFTER_BODY",o[o.IN_FRAMESET=19]="IN_FRAMESET",o[o.AFTER_FRAMESET=20]="AFTER_FRAMESET",o[o.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",o[o.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(Qe||(Qe={}));const UKn={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},BMe=new Set([ft.TABLE,ft.TBODY,ft.TFOOT,ft.THEAD,ft.TR]),uIe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ZS,onParseError:null};class lIe{constructor(s,d,y=null,S=null){this.fragmentContext=y,this.scriptHandler=S,this.currentToken=null,this.stopped=!1,this.insertionMode=Qe.INITIAL,this.originalInsertionMode=Qe.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...uIe,...s},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=d??this.treeAdapter.createDocument(),this.tokenizer=new dKn(this.options,this),this.activeFormattingElements=new _Kn(this.treeAdapter),this.fragmentContextID=y?s$(this.treeAdapter.getTagName(y)):ft.UNKNOWN,this._setContextModes(y??this.document,this.fragmentContextID),this.openElements=new vKn(this.document,this.treeAdapter,this)}static parse(s,d){const y=new this(d);return y.tokenizer.write(s,!0),y.document}static getFragmentParser(s,d){const y={...uIe,...d};s??(s=y.treeAdapter.createElement(tr.TEMPLATE,Bi.HTML,[]));const S=y.treeAdapter.createElement("documentmock",Bi.HTML,[]),N=new this(y,S,s);return N.fragmentContextID===ft.TEMPLATE&&N.tmplInsertionModeStack.unshift(Qe.IN_TEMPLATE),N._initTokenizerForFragmentParsing(),N._insertFakeRootElement(),N._resetInsertionMode(),N._findFormInFragmentContext(),N}getFragment(){const s=this.treeAdapter.getFirstChild(this.document),d=this.treeAdapter.createDocumentFragment();return this._adoptNodes(s,d),d}_err(s,d,y){var S;if(!this.onParseError)return;const N=(S=s.location)!==null&&S!==void 0?S:UKn,B={code:d,startLine:N.startLine,startCol:N.startCol,startOffset:N.startOffset,endLine:y?N.startLine:N.endLine,endCol:y?N.startCol:N.endCol,endOffset:y?N.startOffset:N.endOffset};this.onParseError(B)}onItemPush(s,d,y){var S,N;(N=(S=this.treeAdapter).onItemPush)===null||N===void 0||N.call(S,s),y&&this.openElements.stackTop>0&&this._setContextModes(s,d)}onItemPop(s,d){var y,S;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(s,this.currentToken),(S=(y=this.treeAdapter).onItemPop)===null||S===void 0||S.call(y,s,this.openElements.current),d){let N,B;this.openElements.stackTop===0&&this.fragmentContext?(N=this.fragmentContext,B=this.fragmentContextID):{current:N,currentTagId:B}=this.openElements,this._setContextModes(N,B)}}_setContextModes(s,d){const y=s===this.document||this.treeAdapter.getNamespaceURI(s)===Bi.HTML;this.currentNotInHTML=!y,this.tokenizer.inForeignNode=!y&&!this._isIntegrationPoint(d,s)}_switchToTextParsing(s,d){this._insertElement(s,Bi.HTML),this.tokenizer.state=d,this.originalInsertionMode=this.insertionMode,this.insertionMode=Qe.TEXT}switchToPlaintextParsing(){this.insertionMode=Qe.TEXT,this.originalInsertionMode=Qe.IN_BODY,this.tokenizer.state=I1.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let s=this.fragmentContext;for(;s;){if(this.treeAdapter.getTagName(s)===tr.FORM){this.formElement=s;break}s=this.treeAdapter.getParentNode(s)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Bi.HTML))switch(this.fragmentContextID){case ft.TITLE:case ft.TEXTAREA:{this.tokenizer.state=I1.RCDATA;break}case ft.STYLE:case ft.XMP:case ft.IFRAME:case ft.NOEMBED:case ft.NOFRAMES:case ft.NOSCRIPT:{this.tokenizer.state=I1.RAWTEXT;break}case ft.SCRIPT:{this.tokenizer.state=I1.SCRIPT_DATA;break}case ft.PLAINTEXT:{this.tokenizer.state=I1.PLAINTEXT;break}}}_setDocumentType(s){const d=s.name||"",y=s.publicId||"",S=s.systemId||"";if(this.treeAdapter.setDocumentType(this.document,d,y,S),s.location){const B=this.treeAdapter.getChildNodes(this.document).find(H=>this.treeAdapter.isDocumentTypeNode(H));B&&this.treeAdapter.setNodeSourceCodeLocation(B,s.location)}}_attachElementToTree(s,d){if(this.options.sourceCodeLocationInfo){const y=d&&{...d,startTag:d};this.treeAdapter.setNodeSourceCodeLocation(s,y)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(s);else{const y=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(y,s)}}_appendElement(s,d){const y=this.treeAdapter.createElement(s.tagName,d,s.attrs);this._attachElementToTree(y,s.location)}_insertElement(s,d){const y=this.treeAdapter.createElement(s.tagName,d,s.attrs);this._attachElementToTree(y,s.location),this.openElements.push(y,s.tagID)}_insertFakeElement(s,d){const y=this.treeAdapter.createElement(s,Bi.HTML,[]);this._attachElementToTree(y,null),this.openElements.push(y,d)}_insertTemplate(s){const d=this.treeAdapter.createElement(s.tagName,Bi.HTML,s.attrs),y=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(d,y),this._attachElementToTree(d,s.location),this.openElements.push(d,s.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(y,null)}_insertFakeRootElement(){const s=this.treeAdapter.createElement(tr.HTML,Bi.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null),this.treeAdapter.appendChild(this.openElements.current,s),this.openElements.push(s,ft.HTML)}_appendCommentNode(s,d){const y=this.treeAdapter.createCommentNode(s.data);this.treeAdapter.appendChild(d,y),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(y,s.location)}_insertCharacters(s){let d,y;if(this._shouldFosterParentOnInsertion()?({parent:d,beforeElement:y}=this._findFosterParentingLocation(),y?this.treeAdapter.insertTextBefore(d,s.chars,y):this.treeAdapter.insertText(d,s.chars)):(d=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(d,s.chars)),!s.location)return;const S=this.treeAdapter.getChildNodes(d),N=y?S.lastIndexOf(y):S.length,B=S[N-1];if(this.treeAdapter.getNodeSourceCodeLocation(B)){const{endLine:et,endCol:W,endOffset:nt}=s.location;this.treeAdapter.updateNodeSourceCodeLocation(B,{endLine:et,endCol:W,endOffset:nt})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(B,s.location)}_adoptNodes(s,d){for(let y=this.treeAdapter.getFirstChild(s);y;y=this.treeAdapter.getFirstChild(s))this.treeAdapter.detachNode(y),this.treeAdapter.appendChild(d,y)}_setEndLocation(s,d){if(this.treeAdapter.getNodeSourceCodeLocation(s)&&d.location){const y=d.location,S=this.treeAdapter.getTagName(s),N=d.type===Su.END_TAG&&S===d.tagName?{endTag:{...y},endLine:y.endLine,endCol:y.endCol,endOffset:y.endOffset}:{endLine:y.startLine,endCol:y.startCol,endOffset:y.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(s,N)}}shouldProcessStartTagTokenInForeignContent(s){if(!this.currentNotInHTML)return!1;let d,y;return this.openElements.stackTop===0&&this.fragmentContext?(d=this.fragmentContext,y=this.fragmentContextID):{current:d,currentTagId:y}=this.openElements,s.tagID===ft.SVG&&this.treeAdapter.getTagName(d)===tr.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(d)===Bi.MATHML?!1:this.tokenizer.inForeignNode||(s.tagID===ft.MGLYPH||s.tagID===ft.MALIGNMARK)&&!this._isIntegrationPoint(y,d,Bi.HTML)}_processToken(s){switch(s.type){case Su.CHARACTER:{this.onCharacter(s);break}case Su.NULL_CHARACTER:{this.onNullCharacter(s);break}case Su.COMMENT:{this.onComment(s);break}case Su.DOCTYPE:{this.onDoctype(s);break}case Su.START_TAG:{this._processStartTag(s);break}case Su.END_TAG:{this.onEndTag(s);break}case Su.EOF:{this.onEof(s);break}case Su.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(s);break}}}_isIntegrationPoint(s,d,y){const S=this.treeAdapter.getNamespaceURI(d),N=this.treeAdapter.getAttrList(d);return $Kn(s,S,N,y)}_reconstructActiveFormattingElements(){const s=this.activeFormattingElements.entries.length;if(s){const d=this.activeFormattingElements.entries.findIndex(S=>S.type===v6.Marker||this.openElements.contains(S.element)),y=d<0?s-1:d-1;for(let S=y;S>=0;S--){const N=this.activeFormattingElements.entries[S];this._insertElement(N.token,this.treeAdapter.getNamespaceURI(N.element)),N.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Qe.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(ft.P),this.openElements.popUntilTagNamePopped(ft.P)}_resetInsertionMode(){for(let s=this.openElements.stackTop;s>=0;s--)switch(s===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[s]){case ft.TR:{this.insertionMode=Qe.IN_ROW;return}case ft.TBODY:case ft.THEAD:case ft.TFOOT:{this.insertionMode=Qe.IN_TABLE_BODY;return}case ft.CAPTION:{this.insertionMode=Qe.IN_CAPTION;return}case ft.COLGROUP:{this.insertionMode=Qe.IN_COLUMN_GROUP;return}case ft.TABLE:{this.insertionMode=Qe.IN_TABLE;return}case ft.BODY:{this.insertionMode=Qe.IN_BODY;return}case ft.FRAMESET:{this.insertionMode=Qe.IN_FRAMESET;return}case ft.SELECT:{this._resetInsertionModeForSelect(s);return}case ft.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case ft.HTML:{this.insertionMode=this.headElement?Qe.AFTER_HEAD:Qe.BEFORE_HEAD;return}case ft.TD:case ft.TH:{if(s>0){this.insertionMode=Qe.IN_CELL;return}break}case ft.HEAD:{if(s>0){this.insertionMode=Qe.IN_HEAD;return}break}}this.insertionMode=Qe.IN_BODY}_resetInsertionModeForSelect(s){if(s>0)for(let d=s-1;d>0;d--){const y=this.openElements.tagIDs[d];if(y===ft.TEMPLATE)break;if(y===ft.TABLE){this.insertionMode=Qe.IN_SELECT_IN_TABLE;return}}this.insertionMode=Qe.IN_SELECT}_isElementCausesFosterParenting(s){return BMe.has(s)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let s=this.openElements.stackTop;s>=0;s--){const d=this.openElements.items[s];switch(this.openElements.tagIDs[s]){case ft.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(d)===Bi.HTML)return{parent:this.treeAdapter.getTemplateContent(d),beforeElement:null};break}case ft.TABLE:{const y=this.treeAdapter.getParentNode(d);return y?{parent:y,beforeElement:d}:{parent:this.openElements.items[s-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(s){const d=this._findFosterParentingLocation();d.beforeElement?this.treeAdapter.insertBefore(d.parent,s,d.beforeElement):this.treeAdapter.appendChild(d.parent,s)}_isSpecialElement(s,d){const y=this.treeAdapter.getNamespaceURI(s);return uKn[y].has(d)}onCharacter(s){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){wGn(this,s);return}switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{LQ(this,s);break}case Qe.BEFORE_HEAD:{MQ(this,s);break}case Qe.IN_HEAD:{PQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{RQ(this,s);break}case Qe.AFTER_HEAD:{DQ(this,s);break}case Qe.IN_BODY:case Qe.IN_CAPTION:case Qe.IN_CELL:case Qe.IN_TEMPLATE:{$Me(this,s);break}case Qe.TEXT:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:{this._insertCharacters(s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{kBt(this,s);break}case Qe.IN_TABLE_TEXT:{WMe(this,s);break}case Qe.IN_COLUMN_GROUP:{$mt(this,s);break}case Qe.AFTER_BODY:{jmt(this,s);break}case Qe.AFTER_AFTER_BODY:{nmt(this,s);break}}}onNullCharacter(s){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){yGn(this,s);return}switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{LQ(this,s);break}case Qe.BEFORE_HEAD:{MQ(this,s);break}case Qe.IN_HEAD:{PQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{RQ(this,s);break}case Qe.AFTER_HEAD:{DQ(this,s);break}case Qe.TEXT:{this._insertCharacters(s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{kBt(this,s);break}case Qe.IN_COLUMN_GROUP:{$mt(this,s);break}case Qe.AFTER_BODY:{jmt(this,s);break}case Qe.AFTER_AFTER_BODY:{nmt(this,s);break}}}onComment(s){if(this.skipNextNewLine=!1,this.currentNotInHTML){UFt(this,s);return}switch(this.insertionMode){case Qe.INITIAL:case Qe.BEFORE_HTML:case Qe.BEFORE_HEAD:case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:case Qe.IN_BODY:case Qe.IN_TABLE:case Qe.IN_CAPTION:case Qe.IN_COLUMN_GROUP:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:case Qe.IN_CELL:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:case Qe.IN_TEMPLATE:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:{UFt(this,s);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}case Qe.AFTER_BODY:{XKn(this,s);break}case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{QKn(this,s);break}}}onDoctype(s){switch(this.skipNextNewLine=!1,this.insertionMode){case Qe.INITIAL:{JKn(this,s);break}case Qe.BEFORE_HEAD:case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:{this._err(s,Dr.misplacedDoctype);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}}}onStartTag(s){this.skipNextNewLine=!1,this.currentToken=s,this._processStartTag(s),s.selfClosing&&!s.ackSelfClosing&&this._err(s,Dr.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(s){this.shouldProcessStartTagTokenInForeignContent(s)?vGn(this,s):this._startTagOutsideForeignContent(s)}_startTagOutsideForeignContent(s){switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{ZKn(this,s);break}case Qe.BEFORE_HEAD:{eYn(this,s);break}case Qe.IN_HEAD:{i5(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{iYn(this,s);break}case Qe.AFTER_HEAD:{sYn(this,s);break}case Qe.IN_BODY:{Tb(this,s);break}case Qe.IN_TABLE:{YF(this,s);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}case Qe.IN_CAPTION:{nGn(this,s);break}case Qe.IN_COLUMN_GROUP:{hjt(this,s);break}case Qe.IN_TABLE_BODY:{x2t(this,s);break}case Qe.IN_ROW:{E2t(this,s);break}case Qe.IN_CELL:{aGn(this,s);break}case Qe.IN_SELECT:{GMe(this,s);break}case Qe.IN_SELECT_IN_TABLE:{oGn(this,s);break}case Qe.IN_TEMPLATE:{uGn(this,s);break}case Qe.AFTER_BODY:{hGn(this,s);break}case Qe.IN_FRAMESET:{fGn(this,s);break}case Qe.AFTER_FRAMESET:{pGn(this,s);break}case Qe.AFTER_AFTER_BODY:{bGn(this,s);break}case Qe.AFTER_AFTER_FRAMESET:{mGn(this,s);break}}}onEndTag(s){this.skipNextNewLine=!1,this.currentToken=s,this.currentNotInHTML?_Gn(this,s):this._endTagOutsideForeignContent(s)}_endTagOutsideForeignContent(s){switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{tYn(this,s);break}case Qe.BEFORE_HEAD:{nYn(this,s);break}case Qe.IN_HEAD:{rYn(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{aYn(this,s);break}case Qe.AFTER_HEAD:{oYn(this,s);break}case Qe.IN_BODY:{_2t(this,s);break}case Qe.TEXT:{KYn(this,s);break}case Qe.IN_TABLE:{YQ(this,s);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}case Qe.IN_CAPTION:{rGn(this,s);break}case Qe.IN_COLUMN_GROUP:{iGn(this,s);break}case Qe.IN_TABLE_BODY:{qFt(this,s);break}case Qe.IN_ROW:{YMe(this,s);break}case Qe.IN_CELL:{sGn(this,s);break}case Qe.IN_SELECT:{VMe(this,s);break}case Qe.IN_SELECT_IN_TABLE:{cGn(this,s);break}case Qe.IN_TEMPLATE:{lGn(this,s);break}case Qe.AFTER_BODY:{QMe(this,s);break}case Qe.IN_FRAMESET:{dGn(this,s);break}case Qe.AFTER_FRAMESET:{gGn(this,s);break}case Qe.AFTER_AFTER_BODY:{nmt(this,s);break}}}onEof(s){switch(this.insertionMode){case Qe.INITIAL:{oQ(this,s);break}case Qe.BEFORE_HTML:{LQ(this,s);break}case Qe.BEFORE_HEAD:{MQ(this,s);break}case Qe.IN_HEAD:{PQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{RQ(this,s);break}case Qe.AFTER_HEAD:{DQ(this,s);break}case Qe.IN_BODY:case Qe.IN_TABLE:case Qe.IN_CAPTION:case Qe.IN_COLUMN_GROUP:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:case Qe.IN_CELL:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:{UMe(this,s);break}case Qe.TEXT:{YYn(this,s);break}case Qe.IN_TABLE_TEXT:{cQ(this,s);break}case Qe.IN_TEMPLATE:{XMe(this,s);break}case Qe.AFTER_BODY:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{ljt(this,s);break}}}onWhitespaceCharacter(s){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,s.chars.charCodeAt(0)===_e.LINE_FEED)){if(s.chars.length===1)return;s.chars=s.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(s);return}switch(this.insertionMode){case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:case Qe.TEXT:case Qe.IN_COLUMN_GROUP:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:{this._insertCharacters(s);break}case Qe.IN_BODY:case Qe.IN_CAPTION:case Qe.IN_CELL:case Qe.IN_TEMPLATE:case Qe.AFTER_BODY:case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{FMe(this,s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{kBt(this,s);break}case Qe.IN_TABLE_TEXT:{qMe(this,s);break}}}}function qKn(o,s){let d=o.activeFormattingElements.getElementEntryInScopeWithTagName(s.tagName);return d?o.openElements.contains(d.element)?o.openElements.hasInScope(s.tagID)||(d=null):(o.activeFormattingElements.removeEntry(d),d=null):zMe(o,s),d}function WKn(o,s){let d=null,y=o.openElements.stackTop;for(;y>=0;y--){const S=o.openElements.items[y];if(S===s.element)break;o._isSpecialElement(S,o.openElements.tagIDs[y])&&(d=S)}return d||(o.openElements.shortenToLength(y<0?0:y),o.activeFormattingElements.removeEntry(s)),d}function KKn(o,s,d){let y=s,S=o.openElements.getCommonAncestor(s);for(let N=0,B=S;B!==d;N++,B=S){S=o.openElements.getCommonAncestor(B);const H=o.activeFormattingElements.getElementEntry(B),et=H&&N>=zKn;!H||et?(et&&o.activeFormattingElements.removeEntry(H),o.openElements.remove(B)):(B=YKn(o,H),y===s&&(o.activeFormattingElements.bookmark=H),o.treeAdapter.detachNode(y),o.treeAdapter.appendChild(B,y),y=B)}return y}function YKn(o,s){const d=o.treeAdapter.getNamespaceURI(s.element),y=o.treeAdapter.createElement(s.token.tagName,d,s.token.attrs);return o.openElements.replace(s.element,y),s.element=y,y}function GKn(o,s,d){const y=o.treeAdapter.getTagName(s),S=s$(y);if(o._isElementCausesFosterParenting(S))o._fosterParentElement(d);else{const N=o.treeAdapter.getNamespaceURI(s);S===ft.TEMPLATE&&N===Bi.HTML&&(s=o.treeAdapter.getTemplateContent(s)),o.treeAdapter.appendChild(s,d)}}function VKn(o,s,d){const y=o.treeAdapter.getNamespaceURI(d.element),{token:S}=d,N=o.treeAdapter.createElement(S.tagName,y,S.attrs);o._adoptNodes(s,N),o.treeAdapter.appendChild(s,N),o.activeFormattingElements.insertElementAfterBookmark(N,S),o.activeFormattingElements.removeEntry(d),o.openElements.remove(d.element),o.openElements.insertAfter(s,N,S.tagID)}function ujt(o,s){for(let d=0;d<HKn;d++){const y=qKn(o,s);if(!y)break;const S=WKn(o,y);if(!S)break;o.activeFormattingElements.bookmark=y;const N=KKn(o,S,y.element),B=o.openElements.getCommonAncestor(y.element);o.treeAdapter.detachNode(N),B&&GKn(o,B,N),VKn(o,S,y)}}function UFt(o,s){o._appendCommentNode(s,o.openElements.currentTmplContentOrNode)}function XKn(o,s){o._appendCommentNode(s,o.openElements.items[0])}function QKn(o,s){o._appendCommentNode(s,o.document)}function ljt(o,s){if(o.stopped=!0,s.location){const d=o.fragmentContext?0:2;for(let y=o.openElements.stackTop;y>=d;y--)o._setEndLocation(o.openElements.items[y],s);if(!o.fragmentContext&&o.openElements.stackTop>=0){const y=o.openElements.items[0],S=o.treeAdapter.getNodeSourceCodeLocation(y);if(S&&!S.endTag&&(o._setEndLocation(y,s),o.openElements.stackTop>=1)){const N=o.openElements.items[1],B=o.treeAdapter.getNodeSourceCodeLocation(N);B&&!B.endTag&&o._setEndLocation(N,s)}}}}function JKn(o,s){o._setDocumentType(s);const d=s.forceQuirks?C3.QUIRKS:AKn(s);SKn(s)||o._err(s,Dr.nonConformingDoctype),o.treeAdapter.setDocumentMode(o.document,d),o.insertionMode=Qe.BEFORE_HTML}function oQ(o,s){o._err(s,Dr.missingDoctype,!0),o.treeAdapter.setDocumentMode(o.document,C3.QUIRKS),o.insertionMode=Qe.BEFORE_HTML,o._processToken(s)}function ZKn(o,s){s.tagID===ft.HTML?(o._insertElement(s,Bi.HTML),o.insertionMode=Qe.BEFORE_HEAD):LQ(o,s)}function tYn(o,s){const d=s.tagID;(d===ft.HTML||d===ft.HEAD||d===ft.BODY||d===ft.BR)&&LQ(o,s)}function LQ(o,s){o._insertFakeRootElement(),o.insertionMode=Qe.BEFORE_HEAD,o._processToken(s)}function eYn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.HEAD:{o._insertElement(s,Bi.HTML),o.headElement=o.openElements.current,o.insertionMode=Qe.IN_HEAD;break}default:MQ(o,s)}}function nYn(o,s){const d=s.tagID;d===ft.HEAD||d===ft.BODY||d===ft.HTML||d===ft.BR?MQ(o,s):o._err(s,Dr.endTagWithoutMatchingOpenElement)}function MQ(o,s){o._insertFakeElement(tr.HEAD,ft.HEAD),o.headElement=o.openElements.current,o.insertionMode=Qe.IN_HEAD,o._processToken(s)}function i5(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.BASE:case ft.BASEFONT:case ft.BGSOUND:case ft.LINK:case ft.META:{o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0;break}case ft.TITLE:{o._switchToTextParsing(s,I1.RCDATA);break}case ft.NOSCRIPT:{o.options.scriptingEnabled?o._switchToTextParsing(s,I1.RAWTEXT):(o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_HEAD_NO_SCRIPT);break}case ft.NOFRAMES:case ft.STYLE:{o._switchToTextParsing(s,I1.RAWTEXT);break}case ft.SCRIPT:{o._switchToTextParsing(s,I1.SCRIPT_DATA);break}case ft.TEMPLATE:{o._insertTemplate(s),o.activeFormattingElements.insertMarker(),o.framesetOk=!1,o.insertionMode=Qe.IN_TEMPLATE,o.tmplInsertionModeStack.unshift(Qe.IN_TEMPLATE);break}case ft.HEAD:{o._err(s,Dr.misplacedStartTagForHeadElement);break}default:PQ(o,s)}}function rYn(o,s){switch(s.tagID){case ft.HEAD:{o.openElements.pop(),o.insertionMode=Qe.AFTER_HEAD;break}case ft.BODY:case ft.BR:case ft.HTML:{PQ(o,s);break}case ft.TEMPLATE:{fL(o,s);break}default:o._err(s,Dr.endTagWithoutMatchingOpenElement)}}function fL(o,s){o.openElements.tmplCount>0?(o.openElements.generateImpliedEndTagsThoroughly(),o.openElements.currentTagId!==ft.TEMPLATE&&o._err(s,Dr.closingOfElementWithOpenChildElements),o.openElements.popUntilTagNamePopped(ft.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode()):o._err(s,Dr.endTagWithoutMatchingOpenElement)}function PQ(o,s){o.openElements.pop(),o.insertionMode=Qe.AFTER_HEAD,o._processToken(s)}function iYn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.BASEFONT:case ft.BGSOUND:case ft.HEAD:case ft.LINK:case ft.META:case ft.NOFRAMES:case ft.STYLE:{i5(o,s);break}case ft.NOSCRIPT:{o._err(s,Dr.nestedNoscriptInHead);break}default:RQ(o,s)}}function aYn(o,s){switch(s.tagID){case ft.NOSCRIPT:{o.openElements.pop(),o.insertionMode=Qe.IN_HEAD;break}case ft.BR:{RQ(o,s);break}default:o._err(s,Dr.endTagWithoutMatchingOpenElement)}}function RQ(o,s){const d=s.type===Su.EOF?Dr.openElementsLeftAfterEof:Dr.disallowedContentInNoscriptInHead;o._err(s,d),o.openElements.pop(),o.insertionMode=Qe.IN_HEAD,o._processToken(s)}function sYn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.BODY:{o._insertElement(s,Bi.HTML),o.framesetOk=!1,o.insertionMode=Qe.IN_BODY;break}case ft.FRAMESET:{o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_FRAMESET;break}case ft.BASE:case ft.BASEFONT:case ft.BGSOUND:case ft.LINK:case ft.META:case ft.NOFRAMES:case ft.SCRIPT:case ft.STYLE:case ft.TEMPLATE:case ft.TITLE:{o._err(s,Dr.abandonedHeadElementChild),o.openElements.push(o.headElement,ft.HEAD),i5(o,s),o.openElements.remove(o.headElement);break}case ft.HEAD:{o._err(s,Dr.misplacedStartTagForHeadElement);break}default:DQ(o,s)}}function oYn(o,s){switch(s.tagID){case ft.BODY:case ft.HTML:case ft.BR:{DQ(o,s);break}case ft.TEMPLATE:{fL(o,s);break}default:o._err(s,Dr.endTagWithoutMatchingOpenElement)}}function DQ(o,s){o._insertFakeElement(tr.BODY,ft.BODY),o.insertionMode=Qe.IN_BODY,v2t(o,s)}function v2t(o,s){switch(s.type){case Su.CHARACTER:{$Me(o,s);break}case Su.WHITESPACE_CHARACTER:{FMe(o,s);break}case Su.COMMENT:{UFt(o,s);break}case Su.START_TAG:{Tb(o,s);break}case Su.END_TAG:{_2t(o,s);break}case Su.EOF:{UMe(o,s);break}}}function FMe(o,s){o._reconstructActiveFormattingElements(),o._insertCharacters(s)}function $Me(o,s){o._reconstructActiveFormattingElements(),o._insertCharacters(s),o.framesetOk=!1}function cYn(o,s){o.openElements.tmplCount===0&&o.treeAdapter.adoptAttributes(o.openElements.items[0],s.attrs)}function uYn(o,s){const d=o.openElements.tryPeekProperlyNestedBodyElement();d&&o.openElements.tmplCount===0&&(o.framesetOk=!1,o.treeAdapter.adoptAttributes(d,s.attrs))}function lYn(o,s){const d=o.openElements.tryPeekProperlyNestedBodyElement();o.framesetOk&&d&&(o.treeAdapter.detachNode(d),o.openElements.popAllUpToHtmlElement(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_FRAMESET)}function hYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML)}function fYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),zFt.has(o.openElements.currentTagId)&&o.openElements.pop(),o._insertElement(s,Bi.HTML)}function dYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML),o.skipNextNewLine=!0,o.framesetOk=!1}function pYn(o,s){const d=o.openElements.tmplCount>0;(!o.formElement||d)&&(o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML),d||(o.formElement=o.openElements.current))}function gYn(o,s){o.framesetOk=!1;const d=s.tagID;for(let y=o.openElements.stackTop;y>=0;y--){const S=o.openElements.tagIDs[y];if(d===ft.LI&&S===ft.LI||(d===ft.DD||d===ft.DT)&&(S===ft.DD||S===ft.DT)){o.openElements.generateImpliedEndTagsWithExclusion(S),o.openElements.popUntilTagNamePopped(S);break}if(S!==ft.ADDRESS&&S!==ft.DIV&&S!==ft.P&&o._isSpecialElement(o.openElements.items[y],S))break}o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML)}function bYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML),o.tokenizer.state=I1.PLAINTEXT}function mYn(o,s){o.openElements.hasInScope(ft.BUTTON)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(ft.BUTTON)),o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.framesetOk=!1}function yYn(o,s){const d=o.activeFormattingElements.getElementEntryInScopeWithTagName(tr.A);d&&(ujt(o,s),o.openElements.remove(d.element),o.activeFormattingElements.removeEntry(d)),o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function wYn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function vYn(o,s){o._reconstructActiveFormattingElements(),o.openElements.hasInScope(ft.NOBR)&&(ujt(o,s),o._reconstructActiveFormattingElements()),o._insertElement(s,Bi.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function _Yn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.activeFormattingElements.insertMarker(),o.framesetOk=!1}function xYn(o,s){o.treeAdapter.getDocumentMode(o.document)!==C3.QUIRKS&&o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._insertElement(s,Bi.HTML),o.framesetOk=!1,o.insertionMode=Qe.IN_TABLE}function jMe(o,s){o._reconstructActiveFormattingElements(),o._appendElement(s,Bi.HTML),o.framesetOk=!1,s.ackSelfClosing=!0}function HMe(o){const s=CMe(o,iL.TYPE);return s!=null&&s.toLowerCase()===jKn}function EYn(o,s){o._reconstructActiveFormattingElements(),o._appendElement(s,Bi.HTML),HMe(s)||(o.framesetOk=!1),s.ackSelfClosing=!0}function TYn(o,s){o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0}function kYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._appendElement(s,Bi.HTML),o.framesetOk=!1,s.ackSelfClosing=!0}function CYn(o,s){s.tagName=tr.IMG,s.tagID=ft.IMG,jMe(o,s)}function SYn(o,s){o._insertElement(s,Bi.HTML),o.skipNextNewLine=!0,o.tokenizer.state=I1.RCDATA,o.originalInsertionMode=o.insertionMode,o.framesetOk=!1,o.insertionMode=Qe.TEXT}function AYn(o,s){o.openElements.hasInButtonScope(ft.P)&&o._closePElement(),o._reconstructActiveFormattingElements(),o.framesetOk=!1,o._switchToTextParsing(s,I1.RAWTEXT)}function IYn(o,s){o.framesetOk=!1,o._switchToTextParsing(s,I1.RAWTEXT)}function hIe(o,s){o._switchToTextParsing(s,I1.RAWTEXT)}function OYn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML),o.framesetOk=!1,o.insertionMode=o.insertionMode===Qe.IN_TABLE||o.insertionMode===Qe.IN_CAPTION||o.insertionMode===Qe.IN_TABLE_BODY||o.insertionMode===Qe.IN_ROW||o.insertionMode===Qe.IN_CELL?Qe.IN_SELECT_IN_TABLE:Qe.IN_SELECT}function NYn(o,s){o.openElements.currentTagId===ft.OPTION&&o.openElements.pop(),o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML)}function LYn(o,s){o.openElements.hasInScope(ft.RUBY)&&o.openElements.generateImpliedEndTags(),o._insertElement(s,Bi.HTML)}function MYn(o,s){o.openElements.hasInScope(ft.RUBY)&&o.openElements.generateImpliedEndTagsWithExclusion(ft.RTC),o._insertElement(s,Bi.HTML)}function PYn(o,s){o._reconstructActiveFormattingElements(),RMe(s),cjt(s),s.selfClosing?o._appendElement(s,Bi.MATHML):o._insertElement(s,Bi.MATHML),s.ackSelfClosing=!0}function RYn(o,s){o._reconstructActiveFormattingElements(),DMe(s),cjt(s),s.selfClosing?o._appendElement(s,Bi.SVG):o._insertElement(s,Bi.SVG),s.ackSelfClosing=!0}function fIe(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Bi.HTML)}function Tb(o,s){switch(s.tagID){case ft.I:case ft.S:case ft.B:case ft.U:case ft.EM:case ft.TT:case ft.BIG:case ft.CODE:case ft.FONT:case ft.SMALL:case ft.STRIKE:case ft.STRONG:{wYn(o,s);break}case ft.A:{yYn(o,s);break}case ft.H1:case ft.H2:case ft.H3:case ft.H4:case ft.H5:case ft.H6:{fYn(o,s);break}case ft.P:case ft.DL:case ft.OL:case ft.UL:case ft.DIV:case ft.DIR:case ft.NAV:case ft.MAIN:case ft.MENU:case ft.ASIDE:case ft.CENTER:case ft.FIGURE:case ft.FOOTER:case ft.HEADER:case ft.HGROUP:case ft.DIALOG:case ft.DETAILS:case ft.ADDRESS:case ft.ARTICLE:case ft.SEARCH:case ft.SECTION:case ft.SUMMARY:case ft.FIELDSET:case ft.BLOCKQUOTE:case ft.FIGCAPTION:{hYn(o,s);break}case ft.LI:case ft.DD:case ft.DT:{gYn(o,s);break}case ft.BR:case ft.IMG:case ft.WBR:case ft.AREA:case ft.EMBED:case ft.KEYGEN:{jMe(o,s);break}case ft.HR:{kYn(o,s);break}case ft.RB:case ft.RTC:{LYn(o,s);break}case ft.RT:case ft.RP:{MYn(o,s);break}case ft.PRE:case ft.LISTING:{dYn(o,s);break}case ft.XMP:{AYn(o,s);break}case ft.SVG:{RYn(o,s);break}case ft.HTML:{cYn(o,s);break}case ft.BASE:case ft.LINK:case ft.META:case ft.STYLE:case ft.TITLE:case ft.SCRIPT:case ft.BGSOUND:case ft.BASEFONT:case ft.TEMPLATE:{i5(o,s);break}case ft.BODY:{uYn(o,s);break}case ft.FORM:{pYn(o,s);break}case ft.NOBR:{vYn(o,s);break}case ft.MATH:{PYn(o,s);break}case ft.TABLE:{xYn(o,s);break}case ft.INPUT:{EYn(o,s);break}case ft.PARAM:case ft.TRACK:case ft.SOURCE:{TYn(o,s);break}case ft.IMAGE:{CYn(o,s);break}case ft.BUTTON:{mYn(o,s);break}case ft.APPLET:case ft.OBJECT:case ft.MARQUEE:{_Yn(o,s);break}case ft.IFRAME:{IYn(o,s);break}case ft.SELECT:{OYn(o,s);break}case ft.OPTION:case ft.OPTGROUP:{NYn(o,s);break}case ft.NOEMBED:case ft.NOFRAMES:{hIe(o,s);break}case ft.FRAMESET:{lYn(o,s);break}case ft.TEXTAREA:{SYn(o,s);break}case ft.NOSCRIPT:{o.options.scriptingEnabled?hIe(o,s):fIe(o,s);break}case ft.PLAINTEXT:{bYn(o,s);break}case ft.COL:case ft.TH:case ft.TD:case ft.TR:case ft.HEAD:case ft.FRAME:case ft.TBODY:case ft.TFOOT:case ft.THEAD:case ft.CAPTION:case ft.COLGROUP:break;default:fIe(o,s)}}function DYn(o,s){if(o.openElements.hasInScope(ft.BODY)&&(o.insertionMode=Qe.AFTER_BODY,o.options.sourceCodeLocationInfo)){const d=o.openElements.tryPeekProperlyNestedBodyElement();d&&o._setEndLocation(d,s)}}function BYn(o,s){o.openElements.hasInScope(ft.BODY)&&(o.insertionMode=Qe.AFTER_BODY,QMe(o,s))}function FYn(o,s){const d=s.tagID;o.openElements.hasInScope(d)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(d))}function $Yn(o){const s=o.openElements.tmplCount>0,{formElement:d}=o;s||(o.formElement=null),(d||s)&&o.openElements.hasInScope(ft.FORM)&&(o.openElements.generateImpliedEndTags(),s?o.openElements.popUntilTagNamePopped(ft.FORM):d&&o.openElements.remove(d))}function jYn(o){o.openElements.hasInButtonScope(ft.P)||o._insertFakeElement(tr.P,ft.P),o._closePElement()}function HYn(o){o.openElements.hasInListItemScope(ft.LI)&&(o.openElements.generateImpliedEndTagsWithExclusion(ft.LI),o.openElements.popUntilTagNamePopped(ft.LI))}function zYn(o,s){const d=s.tagID;o.openElements.hasInScope(d)&&(o.openElements.generateImpliedEndTagsWithExclusion(d),o.openElements.popUntilTagNamePopped(d))}function UYn(o){o.openElements.hasNumberedHeaderInScope()&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilNumberedHeaderPopped())}function qYn(o,s){const d=s.tagID;o.openElements.hasInScope(d)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(d),o.activeFormattingElements.clearToLastMarker())}function WYn(o){o._reconstructActiveFormattingElements(),o._insertFakeElement(tr.BR,ft.BR),o.openElements.pop(),o.framesetOk=!1}function zMe(o,s){const d=s.tagName,y=s.tagID;for(let S=o.openElements.stackTop;S>0;S--){const N=o.openElements.items[S],B=o.openElements.tagIDs[S];if(y===B&&(y!==ft.UNKNOWN||o.treeAdapter.getTagName(N)===d)){o.openElements.generateImpliedEndTagsWithExclusion(y),o.openElements.stackTop>=S&&o.openElements.shortenToLength(S);break}if(o._isSpecialElement(N,B))break}}function _2t(o,s){switch(s.tagID){case ft.A:case ft.B:case ft.I:case ft.S:case ft.U:case ft.EM:case ft.TT:case ft.BIG:case ft.CODE:case ft.FONT:case ft.NOBR:case ft.SMALL:case ft.STRIKE:case ft.STRONG:{ujt(o,s);break}case ft.P:{jYn(o);break}case ft.DL:case ft.UL:case ft.OL:case ft.DIR:case ft.DIV:case ft.NAV:case ft.PRE:case ft.MAIN:case ft.MENU:case ft.ASIDE:case ft.BUTTON:case ft.CENTER:case ft.FIGURE:case ft.FOOTER:case ft.HEADER:case ft.HGROUP:case ft.DIALOG:case ft.ADDRESS:case ft.ARTICLE:case ft.DETAILS:case ft.SEARCH:case ft.SECTION:case ft.SUMMARY:case ft.LISTING:case ft.FIELDSET:case ft.BLOCKQUOTE:case ft.FIGCAPTION:{FYn(o,s);break}case ft.LI:{HYn(o);break}case ft.DD:case ft.DT:{zYn(o,s);break}case ft.H1:case ft.H2:case ft.H3:case ft.H4:case ft.H5:case ft.H6:{UYn(o);break}case ft.BR:{WYn(o);break}case ft.BODY:{DYn(o,s);break}case ft.HTML:{BYn(o,s);break}case ft.FORM:{$Yn(o);break}case ft.APPLET:case ft.OBJECT:case ft.MARQUEE:{qYn(o,s);break}case ft.TEMPLATE:{fL(o,s);break}default:zMe(o,s)}}function UMe(o,s){o.tmplInsertionModeStack.length>0?XMe(o,s):ljt(o,s)}function KYn(o,s){var d;s.tagID===ft.SCRIPT&&((d=o.scriptHandler)===null||d===void 0||d.call(o,o.openElements.current)),o.openElements.pop(),o.insertionMode=o.originalInsertionMode}function YYn(o,s){o._err(s,Dr.eofInElementThatCanContainOnlyText),o.openElements.pop(),o.insertionMode=o.originalInsertionMode,o.onEof(s)}function kBt(o,s){if(BMe.has(o.openElements.currentTagId))switch(o.pendingCharacterTokens.length=0,o.hasNonWhitespacePendingCharacterToken=!1,o.originalInsertionMode=o.insertionMode,o.insertionMode=Qe.IN_TABLE_TEXT,s.type){case Su.CHARACTER:{WMe(o,s);break}case Su.WHITESPACE_CHARACTER:{qMe(o,s);break}}else aJ(o,s)}function GYn(o,s){o.openElements.clearBackToTableContext(),o.activeFormattingElements.insertMarker(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_CAPTION}function VYn(o,s){o.openElements.clearBackToTableContext(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_COLUMN_GROUP}function XYn(o,s){o.openElements.clearBackToTableContext(),o._insertFakeElement(tr.COLGROUP,ft.COLGROUP),o.insertionMode=Qe.IN_COLUMN_GROUP,hjt(o,s)}function QYn(o,s){o.openElements.clearBackToTableContext(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_TABLE_BODY}function JYn(o,s){o.openElements.clearBackToTableContext(),o._insertFakeElement(tr.TBODY,ft.TBODY),o.insertionMode=Qe.IN_TABLE_BODY,x2t(o,s)}function ZYn(o,s){o.openElements.hasInTableScope(ft.TABLE)&&(o.openElements.popUntilTagNamePopped(ft.TABLE),o._resetInsertionMode(),o._processStartTag(s))}function tGn(o,s){HMe(s)?o._appendElement(s,Bi.HTML):aJ(o,s),s.ackSelfClosing=!0}function eGn(o,s){!o.formElement&&o.openElements.tmplCount===0&&(o._insertElement(s,Bi.HTML),o.formElement=o.openElements.current,o.openElements.pop())}function YF(o,s){switch(s.tagID){case ft.TD:case ft.TH:case ft.TR:{JYn(o,s);break}case ft.STYLE:case ft.SCRIPT:case ft.TEMPLATE:{i5(o,s);break}case ft.COL:{XYn(o,s);break}case ft.FORM:{eGn(o,s);break}case ft.TABLE:{ZYn(o,s);break}case ft.TBODY:case ft.TFOOT:case ft.THEAD:{QYn(o,s);break}case ft.INPUT:{tGn(o,s);break}case ft.CAPTION:{GYn(o,s);break}case ft.COLGROUP:{VYn(o,s);break}default:aJ(o,s)}}function YQ(o,s){switch(s.tagID){case ft.TABLE:{o.openElements.hasInTableScope(ft.TABLE)&&(o.openElements.popUntilTagNamePopped(ft.TABLE),o._resetInsertionMode());break}case ft.TEMPLATE:{fL(o,s);break}case ft.BODY:case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.HTML:case ft.TBODY:case ft.TD:case ft.TFOOT:case ft.TH:case ft.THEAD:case ft.TR:break;default:aJ(o,s)}}function aJ(o,s){const d=o.fosterParentingEnabled;o.fosterParentingEnabled=!0,v2t(o,s),o.fosterParentingEnabled=d}function qMe(o,s){o.pendingCharacterTokens.push(s)}function WMe(o,s){o.pendingCharacterTokens.push(s),o.hasNonWhitespacePendingCharacterToken=!0}function cQ(o,s){let d=0;if(o.hasNonWhitespacePendingCharacterToken)for(;d<o.pendingCharacterTokens.length;d++)aJ(o,o.pendingCharacterTokens[d]);else for(;d<o.pendingCharacterTokens.length;d++)o._insertCharacters(o.pendingCharacterTokens[d]);o.insertionMode=o.originalInsertionMode,o._processToken(s)}const KMe=new Set([ft.CAPTION,ft.COL,ft.COLGROUP,ft.TBODY,ft.TD,ft.TFOOT,ft.TH,ft.THEAD,ft.TR]);function nGn(o,s){const d=s.tagID;KMe.has(d)?o.openElements.hasInTableScope(ft.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(ft.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_TABLE,YF(o,s)):Tb(o,s)}function rGn(o,s){const d=s.tagID;switch(d){case ft.CAPTION:case ft.TABLE:{o.openElements.hasInTableScope(ft.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(ft.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_TABLE,d===ft.TABLE&&YQ(o,s));break}case ft.BODY:case ft.COL:case ft.COLGROUP:case ft.HTML:case ft.TBODY:case ft.TD:case ft.TFOOT:case ft.TH:case ft.THEAD:case ft.TR:break;default:_2t(o,s)}}function hjt(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.COL:{o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0;break}case ft.TEMPLATE:{i5(o,s);break}default:$mt(o,s)}}function iGn(o,s){switch(s.tagID){case ft.COLGROUP:{o.openElements.currentTagId===ft.COLGROUP&&(o.openElements.pop(),o.insertionMode=Qe.IN_TABLE);break}case ft.TEMPLATE:{fL(o,s);break}case ft.COL:break;default:$mt(o,s)}}function $mt(o,s){o.openElements.currentTagId===ft.COLGROUP&&(o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,o._processToken(s))}function x2t(o,s){switch(s.tagID){case ft.TR:{o.openElements.clearBackToTableBodyContext(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_ROW;break}case ft.TH:case ft.TD:{o.openElements.clearBackToTableBodyContext(),o._insertFakeElement(tr.TR,ft.TR),o.insertionMode=Qe.IN_ROW,E2t(o,s);break}case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.TBODY:case ft.TFOOT:case ft.THEAD:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,YF(o,s));break}default:YF(o,s)}}function qFt(o,s){const d=s.tagID;switch(s.tagID){case ft.TBODY:case ft.TFOOT:case ft.THEAD:{o.openElements.hasInTableScope(d)&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE);break}case ft.TABLE:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,YQ(o,s));break}case ft.BODY:case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.HTML:case ft.TD:case ft.TH:case ft.TR:break;default:YQ(o,s)}}function E2t(o,s){switch(s.tagID){case ft.TH:case ft.TD:{o.openElements.clearBackToTableRowContext(),o._insertElement(s,Bi.HTML),o.insertionMode=Qe.IN_CELL,o.activeFormattingElements.insertMarker();break}case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.TBODY:case ft.TFOOT:case ft.THEAD:case ft.TR:{o.openElements.hasInTableScope(ft.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,x2t(o,s));break}default:YF(o,s)}}function YMe(o,s){switch(s.tagID){case ft.TR:{o.openElements.hasInTableScope(ft.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY);break}case ft.TABLE:{o.openElements.hasInTableScope(ft.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,qFt(o,s));break}case ft.TBODY:case ft.TFOOT:case ft.THEAD:{(o.openElements.hasInTableScope(s.tagID)||o.openElements.hasInTableScope(ft.TR))&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,qFt(o,s));break}case ft.BODY:case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.HTML:case ft.TD:case ft.TH:break;default:YQ(o,s)}}function aGn(o,s){const d=s.tagID;KMe.has(d)?(o.openElements.hasInTableScope(ft.TD)||o.openElements.hasInTableScope(ft.TH))&&(o._closeTableCell(),E2t(o,s)):Tb(o,s)}function sGn(o,s){const d=s.tagID;switch(d){case ft.TD:case ft.TH:{o.openElements.hasInTableScope(d)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(d),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_ROW);break}case ft.TABLE:case ft.TBODY:case ft.TFOOT:case ft.THEAD:case ft.TR:{o.openElements.hasInTableScope(d)&&(o._closeTableCell(),YMe(o,s));break}case ft.BODY:case ft.CAPTION:case ft.COL:case ft.COLGROUP:case ft.HTML:break;default:_2t(o,s)}}function GMe(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.OPTION:{o.openElements.currentTagId===ft.OPTION&&o.openElements.pop(),o._insertElement(s,Bi.HTML);break}case ft.OPTGROUP:{o.openElements.currentTagId===ft.OPTION&&o.openElements.pop(),o.openElements.currentTagId===ft.OPTGROUP&&o.openElements.pop(),o._insertElement(s,Bi.HTML);break}case ft.HR:{o.openElements.currentTagId===ft.OPTION&&o.openElements.pop(),o.openElements.currentTagId===ft.OPTGROUP&&o.openElements.pop(),o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0;break}case ft.INPUT:case ft.KEYGEN:case ft.TEXTAREA:case ft.SELECT:{o.openElements.hasInSelectScope(ft.SELECT)&&(o.openElements.popUntilTagNamePopped(ft.SELECT),o._resetInsertionMode(),s.tagID!==ft.SELECT&&o._processStartTag(s));break}case ft.SCRIPT:case ft.TEMPLATE:{i5(o,s);break}}}function VMe(o,s){switch(s.tagID){case ft.OPTGROUP:{o.openElements.stackTop>0&&o.openElements.currentTagId===ft.OPTION&&o.openElements.tagIDs[o.openElements.stackTop-1]===ft.OPTGROUP&&o.openElements.pop(),o.openElements.currentTagId===ft.OPTGROUP&&o.openElements.pop();break}case ft.OPTION:{o.openElements.currentTagId===ft.OPTION&&o.openElements.pop();break}case ft.SELECT:{o.openElements.hasInSelectScope(ft.SELECT)&&(o.openElements.popUntilTagNamePopped(ft.SELECT),o._resetInsertionMode());break}case ft.TEMPLATE:{fL(o,s);break}}}function oGn(o,s){const d=s.tagID;d===ft.CAPTION||d===ft.TABLE||d===ft.TBODY||d===ft.TFOOT||d===ft.THEAD||d===ft.TR||d===ft.TD||d===ft.TH?(o.openElements.popUntilTagNamePopped(ft.SELECT),o._resetInsertionMode(),o._processStartTag(s)):GMe(o,s)}function cGn(o,s){const d=s.tagID;d===ft.CAPTION||d===ft.TABLE||d===ft.TBODY||d===ft.TFOOT||d===ft.THEAD||d===ft.TR||d===ft.TD||d===ft.TH?o.openElements.hasInTableScope(d)&&(o.openElements.popUntilTagNamePopped(ft.SELECT),o._resetInsertionMode(),o.onEndTag(s)):VMe(o,s)}function uGn(o,s){switch(s.tagID){case ft.BASE:case ft.BASEFONT:case ft.BGSOUND:case ft.LINK:case ft.META:case ft.NOFRAMES:case ft.SCRIPT:case ft.STYLE:case ft.TEMPLATE:case ft.TITLE:{i5(o,s);break}case ft.CAPTION:case ft.COLGROUP:case ft.TBODY:case ft.TFOOT:case ft.THEAD:{o.tmplInsertionModeStack[0]=Qe.IN_TABLE,o.insertionMode=Qe.IN_TABLE,YF(o,s);break}case ft.COL:{o.tmplInsertionModeStack[0]=Qe.IN_COLUMN_GROUP,o.insertionMode=Qe.IN_COLUMN_GROUP,hjt(o,s);break}case ft.TR:{o.tmplInsertionModeStack[0]=Qe.IN_TABLE_BODY,o.insertionMode=Qe.IN_TABLE_BODY,x2t(o,s);break}case ft.TD:case ft.TH:{o.tmplInsertionModeStack[0]=Qe.IN_ROW,o.insertionMode=Qe.IN_ROW,E2t(o,s);break}default:o.tmplInsertionModeStack[0]=Qe.IN_BODY,o.insertionMode=Qe.IN_BODY,Tb(o,s)}}function lGn(o,s){s.tagID===ft.TEMPLATE&&fL(o,s)}function XMe(o,s){o.openElements.tmplCount>0?(o.openElements.popUntilTagNamePopped(ft.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode(),o.onEof(s)):ljt(o,s)}function hGn(o,s){s.tagID===ft.HTML?Tb(o,s):jmt(o,s)}function QMe(o,s){var d;if(s.tagID===ft.HTML){if(o.fragmentContext||(o.insertionMode=Qe.AFTER_AFTER_BODY),o.options.sourceCodeLocationInfo&&o.openElements.tagIDs[0]===ft.HTML){o._setEndLocation(o.openElements.items[0],s);const y=o.openElements.items[1];y&&!(!((d=o.treeAdapter.getNodeSourceCodeLocation(y))===null||d===void 0)&&d.endTag)&&o._setEndLocation(y,s)}}else jmt(o,s)}function jmt(o,s){o.insertionMode=Qe.IN_BODY,v2t(o,s)}function fGn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.FRAMESET:{o._insertElement(s,Bi.HTML);break}case ft.FRAME:{o._appendElement(s,Bi.HTML),s.ackSelfClosing=!0;break}case ft.NOFRAMES:{i5(o,s);break}}}function dGn(o,s){s.tagID===ft.FRAMESET&&!o.openElements.isRootHtmlElementCurrent()&&(o.openElements.pop(),!o.fragmentContext&&o.openElements.currentTagId!==ft.FRAMESET&&(o.insertionMode=Qe.AFTER_FRAMESET))}function pGn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.NOFRAMES:{i5(o,s);break}}}function gGn(o,s){s.tagID===ft.HTML&&(o.insertionMode=Qe.AFTER_AFTER_FRAMESET)}function bGn(o,s){s.tagID===ft.HTML?Tb(o,s):nmt(o,s)}function nmt(o,s){o.insertionMode=Qe.IN_BODY,v2t(o,s)}function mGn(o,s){switch(s.tagID){case ft.HTML:{Tb(o,s);break}case ft.NOFRAMES:{i5(o,s);break}}}function yGn(o,s){s.chars=Yf,o._insertCharacters(s)}function wGn(o,s){o._insertCharacters(s),o.framesetOk=!1}function JMe(o){for(;o.treeAdapter.getNamespaceURI(o.openElements.current)!==Bi.HTML&&!o._isIntegrationPoint(o.openElements.currentTagId,o.openElements.current);)o.openElements.pop()}function vGn(o,s){if(RKn(s))JMe(o),o._startTagOutsideForeignContent(s);else{const d=o._getAdjustedCurrentElement(),y=o.treeAdapter.getNamespaceURI(d);y===Bi.MATHML?RMe(s):y===Bi.SVG&&(DKn(s),DMe(s)),cjt(s),s.selfClosing?o._appendElement(s,y):o._insertElement(s,y),s.ackSelfClosing=!0}}function _Gn(o,s){if(s.tagID===ft.P||s.tagID===ft.BR){JMe(o),o._endTagOutsideForeignContent(s);return}for(let d=o.openElements.stackTop;d>0;d--){const y=o.openElements.items[d];if(o.treeAdapter.getNamespaceURI(y)===Bi.HTML){o._endTagOutsideForeignContent(s);break}const S=o.treeAdapter.getTagName(y);if(S.toLowerCase()===s.tagName){s.tagName=S,o.openElements.shortenToLength(d);break}}}tr.AREA,tr.BASE,tr.BASEFONT,tr.BGSOUND,tr.BR,tr.COL,tr.EMBED,tr.FRAME,tr.HR,tr.IMG,tr.INPUT,tr.KEYGEN,tr.LINK,tr.META,tr.PARAM,tr.SOURCE,tr.TRACK,tr.WBR;const xGn=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,EGn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),dIe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function ZMe(o,s){const d=MGn(o),y=sjt("type",{handlers:{root:TGn,element:kGn,text:CGn,comment:ePe,doctype:SGn,raw:IGn},unknown:OGn}),S={parser:d?new lIe(dIe):lIe.getFragmentParser(void 0,dIe),handle(H){y(H,S)},stitches:!1,options:s||{}};y(o,S),o$(S,A6());const N=d?S.parser.document:S.parser.getFragment(),B=kWn(N,{file:S.options.file});return S.stitches&&njt(B,"comment",function(H,et,W){const nt=H;if(nt.value.stitch&&W&&et!==void 0){const K=W.children;return K[et]=nt.value.stitch,et}}),B.type==="root"&&B.children.length===1&&B.children[0].type===o.type?B.children[0]:B}function tPe(o,s){let d=-1;if(o)for(;++d<o.length;)s.handle(o[d])}function TGn(o,s){tPe(o.children,s)}function kGn(o,s){NGn(o,s),tPe(o.children,s),LGn(o,s)}function CGn(o,s){s.parser.tokenizer.state>4&&(s.parser.tokenizer.state=0);const d={type:Su.CHARACTER,chars:o.value,location:sJ(o)};o$(s,A6(o)),s.parser.currentToken=d,s.parser._processToken(s.parser.currentToken)}function SGn(o,s){const d={type:Su.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:sJ(o)};o$(s,A6(o)),s.parser.currentToken=d,s.parser._processToken(s.parser.currentToken)}function AGn(o,s){s.stitches=!0;const d=PGn(o);if("children"in o&&"children"in d){const y=ZMe({type:"root",children:o.children},s.options);d.children=y.children}ePe({type:"comment",value:{stitch:d}},s)}function ePe(o,s){const d=o.value,y={type:Su.COMMENT,data:d,location:sJ(o)};o$(s,A6(o)),s.parser.currentToken=y,s.parser._processToken(s.parser.currentToken)}function IGn(o,s){if(s.parser.tokenizer.preprocessor.html="",s.parser.tokenizer.preprocessor.pos=-1,s.parser.tokenizer.preprocessor.lastGapPos=-2,s.parser.tokenizer.preprocessor.gapStack=[],s.parser.tokenizer.preprocessor.skipNextNewLine=!1,s.parser.tokenizer.preprocessor.lastChunkWritten=!1,s.parser.tokenizer.preprocessor.endOfChunkHit=!1,s.parser.tokenizer.preprocessor.isEol=!1,nPe(s,A6(o)),s.parser.tokenizer.write(s.options.tagfilter?o.value.replace(xGn,"&lt;$1$2"):o.value,!1),s.parser.tokenizer._runParsingLoop(),s.parser.tokenizer.state===72||s.parser.tokenizer.state===78){s.parser.tokenizer.preprocessor.lastChunkWritten=!0;const d=s.parser.tokenizer._consume();s.parser.tokenizer._callState(d)}}function OGn(o,s){const d=o;if(s.options.passThrough&&s.options.passThrough.includes(d.type))AGn(d,s);else{let y="";throw EGn.has(d.type)&&(y=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+d.type+"` node"+y)}}function o$(o,s){nPe(o,s);const d=o.parser.tokenizer.currentCharacterToken;d&&d.location&&(d.location.endLine=o.parser.tokenizer.preprocessor.line,d.location.endCol=o.parser.tokenizer.preprocessor.col+1,d.location.endOffset=o.parser.tokenizer.preprocessor.offset+1,o.parser.currentToken=d,o.parser._processToken(o.parser.currentToken)),o.parser.tokenizer.paused=!1,o.parser.tokenizer.inLoop=!1,o.parser.tokenizer.active=!1,o.parser.tokenizer.returnState=I1.DATA,o.parser.tokenizer.charRefCode=-1,o.parser.tokenizer.consumedAfterSnapshot=-1,o.parser.tokenizer.currentLocation=null,o.parser.tokenizer.currentCharacterToken=null,o.parser.tokenizer.currentToken=null,o.parser.tokenizer.currentAttr={name:"",value:""}}function nPe(o,s){if(s&&s.offset!==void 0){const d={startLine:s.line,startCol:s.column,startOffset:s.offset,endLine:-1,endCol:-1,endOffset:-1};o.parser.tokenizer.preprocessor.lineStartPos=-s.column+1,o.parser.tokenizer.preprocessor.droppedBufferSize=s.offset,o.parser.tokenizer.preprocessor.line=s.line,o.parser.tokenizer.currentLocation=d}}function NGn(o,s){const d=o.tagName.toLowerCase();if(s.parser.tokenizer.state===I1.PLAINTEXT)return;o$(s,A6(o));const y=s.parser.openElements.current;let S="namespaceURI"in y?y.namespaceURI:tL.html;S===tL.html&&d==="svg"&&(S=tL.svg);const N=jWn({...o,children:[]},{space:S===tL.svg?"svg":"html"}),B={type:Su.START_TAG,tagName:d,tagID:s$(d),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in N?N.attrs:[],location:sJ(o)};s.parser.currentToken=B,s.parser._processToken(s.parser.currentToken),s.parser.tokenizer.lastStartTagName=d}function LGn(o,s){const d=o.tagName.toLowerCase();if(!s.parser.tokenizer.inForeignNode&&xMe.includes(d)||s.parser.tokenizer.state===I1.PLAINTEXT)return;o$(s,b2t(o));const y={type:Su.END_TAG,tagName:d,tagID:s$(d),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:sJ(o)};s.parser.currentToken=y,s.parser._processToken(s.parser.currentToken),d===s.parser.tokenizer.lastStartTagName&&(s.parser.tokenizer.state===I1.RCDATA||s.parser.tokenizer.state===I1.RAWTEXT||s.parser.tokenizer.state===I1.SCRIPT_DATA)&&(s.parser.tokenizer.state=I1.DATA)}function MGn(o){const s=o.type==="root"?o.children[0]:o;return!!(s&&(s.type==="doctype"||s.type==="element"&&s.tagName.toLowerCase()==="html"))}function sJ(o){const s=A6(o)||{line:void 0,column:void 0,offset:void 0},d=b2t(o)||{line:void 0,column:void 0,offset:void 0};return{startLine:s.line,startCol:s.column,startOffset:s.offset,endLine:d.line,endCol:d.column,endOffset:d.offset}}function PGn(o){return"children"in o?KF({...o,children:[]}):KF(o)}function RGn(o){return function(s,d){return ZMe(s,{...o,file:d})}}const DGn=/["&'<>`]/g,BGn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,FGn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,$Gn=/[|\\{}()[\]^$+*?.]/g,pIe=new WeakMap;function jGn(o,s){if(o=o.replace(s.subset?HGn(s.subset):DGn,y),s.subset||s.escapeOnly)return o;return o.replace(BGn,d).replace(FGn,y);function d(S,N,B){return s.format((S.charCodeAt(0)-55296)*1024+S.charCodeAt(1)-56320+65536,B.charCodeAt(N+2),s)}function y(S,N,B){return s.format(S.charCodeAt(0),B.charCodeAt(N+1),s)}}function HGn(o){let s=pIe.get(o);return s||(s=zGn(o),pIe.set(o,s)),s}function zGn(o){const s=[];let d=-1;for(;++d<o.length;)s.push(o[d].replace($Gn,"\\$&"));return new RegExp("(?:"+s.join("|")+")","g")}const UGn=/[\dA-Fa-f]/;function qGn(o,s,d){const y="&#x"+o.toString(16).toUpperCase();return d&&s&&!UGn.test(String.fromCharCode(s))?y:y+";"}const WGn=/\d/;function KGn(o,s,d){const y="&#"+String(o);return d&&s&&!WGn.test(String.fromCharCode(s))?y:y+";"}const YGn=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],CBt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},GGn=["cent","copy","divide","gt","lt","not","para","times"],rPe={}.hasOwnProperty,WFt={};let Bbt;for(Bbt in CBt)rPe.call(CBt,Bbt)&&(WFt[CBt[Bbt]]=Bbt);const VGn=/[^\dA-Za-z]/;function XGn(o,s,d,y){const S=String.fromCharCode(o);if(rPe.call(WFt,S)){const N=WFt[S],B="&"+N;return d&&YGn.includes(N)&&!GGn.includes(N)&&(!y||s&&s!==61&&VGn.test(String.fromCharCode(s)))?B:B+";"}return""}function QGn(o,s,d){let y=qGn(o,s,d.omitOptionalSemicolons),S;if((d.useNamedReferences||d.useShortestReferences)&&(S=XGn(o,s,d.omitOptionalSemicolons,d.attribute)),(d.useShortestReferences||!S)&&d.useShortestReferences){const N=KGn(o,s,d.omitOptionalSemicolons);N.length<y.length&&(y=N)}return S&&(!d.useShortestReferences||S.length<y.length)?S:y}function BF(o,s){return jGn(o,Object.assign({format:QGn},s))}const JGn=/^>|^->|<!--|-->|--!>|<!-$/g,ZGn=[">"],tVn=["<",">"];function eVn(o,s,d,y){return y.settings.bogusComments?"<?"+BF(o.value,Object.assign({},y.settings.characterReferences,{subset:ZGn}))+">":"<!--"+o.value.replace(JGn,S)+"-->";function S(N){return BF(N,Object.assign({},y.settings.characterReferences,{subset:tVn}))}}function nVn(o,s,d,y){return"<!"+(y.settings.upperDoctype?"DOCTYPE":"doctype")+(y.settings.tightDoctype?"":" ")+"html>"}function gIe(o,s){const d=String(o);if(typeof s!="string")throw new TypeError("Expected character");let y=0,S=d.indexOf(s);for(;S!==-1;)y++,S=d.indexOf(s,S+s.length);return y}const rp=aPe(1),iPe=aPe(-1),rVn=[];function aPe(o){return s;function s(d,y,S){const N=d?d.children:rVn;let B=(y||0)+o,H=N[B];if(!S)for(;H&&d2t(H);)B+=o,H=N[B];return H}}const iVn={}.hasOwnProperty;function sPe(o){return s;function s(d,y,S){return iVn.call(o,d.tagName)&&o[d.tagName](d,y,S)}}const fjt=sPe({body:sVn,caption:SBt,colgroup:SBt,dd:lVn,dt:uVn,head:SBt,html:aVn,li:cVn,optgroup:hVn,option:fVn,p:oVn,rp:bIe,rt:bIe,tbody:pVn,td:mIe,tfoot:gVn,th:mIe,thead:dVn,tr:bVn});function SBt(o,s,d){const y=rp(d,s,!0);return!y||y.type!=="comment"&&!(y.type==="text"&&d2t(y.value.charAt(0)))}function aVn(o,s,d){const y=rp(d,s);return!y||y.type!=="comment"}function sVn(o,s,d){const y=rp(d,s);return!y||y.type!=="comment"}function oVn(o,s,d){const y=rp(d,s);return y?y.type==="element"&&(y.tagName==="address"||y.tagName==="article"||y.tagName==="aside"||y.tagName==="blockquote"||y.tagName==="details"||y.tagName==="div"||y.tagName==="dl"||y.tagName==="fieldset"||y.tagName==="figcaption"||y.tagName==="figure"||y.tagName==="footer"||y.tagName==="form"||y.tagName==="h1"||y.tagName==="h2"||y.tagName==="h3"||y.tagName==="h4"||y.tagName==="h5"||y.tagName==="h6"||y.tagName==="header"||y.tagName==="hgroup"||y.tagName==="hr"||y.tagName==="main"||y.tagName==="menu"||y.tagName==="nav"||y.tagName==="ol"||y.tagName==="p"||y.tagName==="pre"||y.tagName==="section"||y.tagName==="table"||y.tagName==="ul"):!d||!(d.type==="element"&&(d.tagName==="a"||d.tagName==="audio"||d.tagName==="del"||d.tagName==="ins"||d.tagName==="map"||d.tagName==="noscript"||d.tagName==="video"))}function cVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&y.tagName==="li"}function uVn(o,s,d){const y=rp(d,s);return!!(y&&y.type==="element"&&(y.tagName==="dt"||y.tagName==="dd"))}function lVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="dt"||y.tagName==="dd")}function bIe(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="rp"||y.tagName==="rt")}function hVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&y.tagName==="optgroup"}function fVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="option"||y.tagName==="optgroup")}function dVn(o,s,d){const y=rp(d,s);return!!(y&&y.type==="element"&&(y.tagName==="tbody"||y.tagName==="tfoot"))}function pVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="tbody"||y.tagName==="tfoot")}function gVn(o,s,d){return!rp(d,s)}function bVn(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&y.tagName==="tr"}function mIe(o,s,d){const y=rp(d,s);return!y||y.type==="element"&&(y.tagName==="td"||y.tagName==="th")}const mVn=sPe({body:vVn,colgroup:_Vn,head:wVn,html:yVn,tbody:xVn});function yVn(o){const s=rp(o,-1);return!s||s.type!=="comment"}function wVn(o){const s=new Set;for(const y of o.children)if(y.type==="element"&&(y.tagName==="base"||y.tagName==="title")){if(s.has(y.tagName))return!1;s.add(y.tagName)}const d=o.children[0];return!d||d.type==="element"}function vVn(o){const s=rp(o,-1,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&d2t(s.value.charAt(0)))&&!(s.type==="element"&&(s.tagName==="meta"||s.tagName==="link"||s.tagName==="script"||s.tagName==="style"||s.tagName==="template"))}function _Vn(o,s,d){const y=iPe(d,s),S=rp(o,-1,!0);return d&&y&&y.type==="element"&&y.tagName==="colgroup"&&fjt(y,d.children.indexOf(y),d)?!1:!!(S&&S.type==="element"&&S.tagName==="col")}function xVn(o,s,d){const y=iPe(d,s),S=rp(o,-1);return d&&y&&y.type==="element"&&(y.tagName==="thead"||y.tagName==="tbody")&&fjt(y,d.children.indexOf(y),d)?!1:!!(S&&S.type==="element"&&S.tagName==="tr")}const Fbt={name:[[`
1931
1931
  \f\r &/=>`.split(""),`
1932
1932
  \f\r "&'/=>\``.split("")],[`\0
1933
1933
  \f\r "&'/<=>`.split(""),`\0
@@ -1935,7 +1935,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
1935
1935
  \f\r &>`.split(""),`\0
1936
1936
  \f\r "&'<=>\``.split("")],[`\0
1937
1937
  \f\r "&'<=>\``.split(""),`\0
1938
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function _Vn(o,s,d,y){const S=y.schema,N=S.space==="svg"?!1:y.settings.omitOptionalTags;let B=S.space==="svg"?y.settings.closeEmptyElements:y.settings.voids.includes(o.tagName.toLowerCase());const H=[];let et;S.space==="html"&&o.tagName==="svg"&&(y.schema=c7);const W=xVn(y,o.properties),nt=y.all(S.space==="html"&&o.tagName==="template"?o.content:o);return y.schema=S,nt&&(B=!1),(W||!N||!gVn(o,s,d))&&(H.push("<",o.tagName,W?" "+W:""),B&&(S.space==="svg"||y.settings.closeSelfClosing)&&(et=W.charAt(W.length-1),(!y.settings.tightSelfClosing||et==="/"||et&&et!=='"'&&et!=="'")&&H.push(" "),H.push("/")),H.push(">")),H.push(nt),!B&&(!N||!fjt(o,s,d))&&H.push("</"+o.tagName+">"),H.join("")}function xVn(o,s){const d=[];let y=-1,S;if(s){for(S in s)if(s[S]!==null&&s[S]!==void 0){const N=EVn(o,S,s[S]);N&&d.push(N)}}for(;++y<d.length;){const N=o.settings.tightAttributes?d[y].charAt(d[y].length-1):void 0;y!==d.length-1&&N!=='"'&&N!=="'"&&(d[y]+=" ")}return d.join("")}function EVn(o,s,d){const y=p2t(o.schema,s),S=o.settings.allowParseErrors&&o.schema.space==="html"?0:1,N=o.settings.allowDangerousCharacters?0:1;let B=o.quote,H;if(y.overloadedBoolean&&(d===y.attribute||d==="")?d=!0:(y.boolean||y.overloadedBoolean)&&(typeof d!="string"||d===y.attribute||d==="")&&(d=!!d),d==null||d===!1||typeof d=="number"&&Number.isNaN(d))return"";const et=BF(y.attribute,Object.assign({},o.settings.characterReferences,{subset:Fbt.name[S][N]}));return d===!0||(d=Array.isArray(d)?(y.commaSeparated?z$t:q$t)(d,{padLeft:!o.settings.tightCommaSeparatedLists}):String(d),o.settings.collapseEmptyAttributes&&!d)?et:(o.settings.preferUnquoted&&(H=BF(d,Object.assign({},o.settings.characterReferences,{attribute:!0,subset:Fbt.unquoted[S][N]}))),H!==d&&(o.settings.quoteSmart&&gIe(d,B)>gIe(d,o.alternative)&&(B=o.alternative),H=B+BF(d,Object.assign({},o.settings.characterReferences,{subset:(B==="'"?Fbt.single:Fbt.double)[S][N],attribute:!0}))+B),et+(H&&"="+H))}const TVn=["<","&"];function oPe(o,s,d,y){return d&&d.type==="element"&&(d.tagName==="script"||d.tagName==="style")?o.value:BF(o.value,Object.assign({},y.settings.characterReferences,{subset:TVn}))}function kVn(o,s,d,y){return y.settings.allowDangerousHtml?o.value:oPe(o,s,d,y)}function CVn(o,s,d,y){return y.all(o)}const SVn=sjt("type",{invalid:AVn,unknown:IVn,handlers:{comment:ZGn,doctype:tVn,element:_Vn,raw:kVn,root:CVn,text:oPe}});function AVn(o){throw new Error("Expected node, not `"+o+"`")}function IVn(o){const s=o;throw new Error("Cannot compile unknown node `"+s.type+"`")}const OVn={},NVn={},LVn=[];function MVn(o,s){const d=s||OVn,y=d.quote||'"',S=y==='"'?"'":'"';if(y!=='"'&&y!=="'")throw new Error("Invalid quote `"+y+"`, expected `'` or `\"`");return{one:PVn,all:RVn,settings:{omitOptionalTags:d.omitOptionalTags||!1,allowParseErrors:d.allowParseErrors||!1,allowDangerousCharacters:d.allowDangerousCharacters||!1,quoteSmart:d.quoteSmart||!1,preferUnquoted:d.preferUnquoted||!1,tightAttributes:d.tightAttributes||!1,upperDoctype:d.upperDoctype||!1,tightDoctype:d.tightDoctype||!1,bogusComments:d.bogusComments||!1,tightCommaSeparatedLists:d.tightCommaSeparatedLists||!1,tightSelfClosing:d.tightSelfClosing||!1,collapseEmptyAttributes:d.collapseEmptyAttributes||!1,allowDangerousHtml:d.allowDangerousHtml||!1,voids:d.voids||xMe,characterReferences:d.characterReferences||NVn,closeSelfClosing:d.closeSelfClosing||!1,closeEmptyElements:d.closeEmptyElements||!1},schema:d.space==="svg"?c7:nJ,quote:y,alternative:S}.one(Array.isArray(o)?{type:"root",children:o}:o,void 0,void 0)}function PVn(o,s,d){return SVn(o,s,d,this)}function RVn(o){const s=[],d=o&&o.children||LVn;let y=-1;for(;++y<d.length;)s[y]=this.one(d[y],y,o);return s.join("")}function DVn(o){const s=this,d={...s.data("settings"),...o};s.compiler=y;function y(S){return MVn(S,d)}}var cPe={};const uPe=function(o){if(o==null)return jVn;if(typeof o=="string")return $Vn(o);if(typeof o=="object")return Array.isArray(o)?BVn(o):FVn(o);if(typeof o=="function")return T2t(o);throw new Error("Expected function, string, or object as test")};function BVn(o){const s=[];let d=-1;for(;++d<o.length;)s[d]=uPe(o[d]);return T2t(y);function y(...S){let N=-1;for(;++N<s.length;)if(s[N].call(this,...S))return!0;return!1}}function FVn(o){return T2t(s);function s(d){let y;for(y in o)if(d[y]!==o[y])return!1;return!0}}function $Vn(o){return T2t(s);function s(d){return d&&d.type===o}}function T2t(o){return s;function s(d,...y){return!!(d&&typeof d=="object"&&"type"in d&&o.call(this,d,...y))}}function jVn(){return!0}const lPe=!0,KFt=!1,hPe="skip",HVn=function(o,s,d,y){typeof s=="function"&&typeof d!="function"&&(y=d,d=s,s=null);const S=uPe(s),N=y?-1:1;B(o,void 0,[])();function B(H,et,W){const nt=H&&typeof H=="object"?H:{};if(typeof nt.type=="string"){const Q=typeof nt.tagName=="string"?nt.tagName:typeof nt.name=="string"?nt.name:void 0;Object.defineProperty(K,"name",{value:"node ("+(H.type+(Q?"<"+Q+">":""))+")"})}return K;function K(){let Q=[],at,mt,Lt;if((!s||S(H,et,W[W.length-1]||null))&&(Q=zVn(d(H,W)),Q[0]===KFt))return Q;if(H.children&&Q[0]!==hPe)for(mt=(y?H.children.length:-1)+N,Lt=W.concat(H);mt>-1&&mt<H.children.length;){if(at=B(H.children[mt],mt,Lt)(),at[0]===KFt)return at;mt=typeof at[1]=="number"?at[1]:mt+N}return Q}}};function zVn(o){return Array.isArray(o)?o:typeof o=="number"?[lPe,o]:[o]}const UVn=function(o,s,d,y){typeof s=="function"&&typeof d!="function"&&(y=d,d=s,s=null),HVn(o,s,S,y);function S(N,B){const H=B[B.length-1];return d(N,H?H.children.indexOf(N):null,H)}},qVn=Object.freeze(Object.defineProperty({__proto__:null,CONTINUE:lPe,EXIT:KFt,SKIP:hPe,visit:UVn},Symbol.toStringTag,{value:"Module"})),WVn=iNn(qVn);var Hmt={exports:{}};Hmt.exports;(function(o,s){(function(d,y){o.exports=y()})(A1,function(){function d(i){for(var l=[],b=1;b<arguments.length;b++)l[b-1]=arguments[b];var v=Array.from(typeof i=="string"?[i]:i);v[v.length-1]=v[v.length-1].replace(/\r?\n([\t ]*)$/,"");var E=v.reduce(function(I,L){var $=L.match(/\n([\t ]+|(?!\s).)/g);return $?I.concat($.map(function(q){var Y,tt;return(tt=(Y=q.match(/[\t ]/g))===null||Y===void 0?void 0:Y.length)!==null&&tt!==void 0?tt:0})):I},[]);if(E.length){var T=new RegExp(`
1938
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function EVn(o,s,d,y){const S=y.schema,N=S.space==="svg"?!1:y.settings.omitOptionalTags;let B=S.space==="svg"?y.settings.closeEmptyElements:y.settings.voids.includes(o.tagName.toLowerCase());const H=[];let et;S.space==="html"&&o.tagName==="svg"&&(y.schema=c7);const W=TVn(y,o.properties),nt=y.all(S.space==="html"&&o.tagName==="template"?o.content:o);return y.schema=S,nt&&(B=!1),(W||!N||!mVn(o,s,d))&&(H.push("<",o.tagName,W?" "+W:""),B&&(S.space==="svg"||y.settings.closeSelfClosing)&&(et=W.charAt(W.length-1),(!y.settings.tightSelfClosing||et==="/"||et&&et!=='"'&&et!=="'")&&H.push(" "),H.push("/")),H.push(">")),H.push(nt),!B&&(!N||!fjt(o,s,d))&&H.push("</"+o.tagName+">"),H.join("")}function TVn(o,s){const d=[];let y=-1,S;if(s){for(S in s)if(s[S]!==null&&s[S]!==void 0){const N=kVn(o,S,s[S]);N&&d.push(N)}}for(;++y<d.length;){const N=o.settings.tightAttributes?d[y].charAt(d[y].length-1):void 0;y!==d.length-1&&N!=='"'&&N!=="'"&&(d[y]+=" ")}return d.join("")}function kVn(o,s,d){const y=p2t(o.schema,s),S=o.settings.allowParseErrors&&o.schema.space==="html"?0:1,N=o.settings.allowDangerousCharacters?0:1;let B=o.quote,H;if(y.overloadedBoolean&&(d===y.attribute||d==="")?d=!0:(y.boolean||y.overloadedBoolean)&&(typeof d!="string"||d===y.attribute||d==="")&&(d=!!d),d==null||d===!1||typeof d=="number"&&Number.isNaN(d))return"";const et=BF(y.attribute,Object.assign({},o.settings.characterReferences,{subset:Fbt.name[S][N]}));return d===!0||(d=Array.isArray(d)?(y.commaSeparated?z$t:q$t)(d,{padLeft:!o.settings.tightCommaSeparatedLists}):String(d),o.settings.collapseEmptyAttributes&&!d)?et:(o.settings.preferUnquoted&&(H=BF(d,Object.assign({},o.settings.characterReferences,{attribute:!0,subset:Fbt.unquoted[S][N]}))),H!==d&&(o.settings.quoteSmart&&gIe(d,B)>gIe(d,o.alternative)&&(B=o.alternative),H=B+BF(d,Object.assign({},o.settings.characterReferences,{subset:(B==="'"?Fbt.single:Fbt.double)[S][N],attribute:!0}))+B),et+(H&&"="+H))}const CVn=["<","&"];function oPe(o,s,d,y){return d&&d.type==="element"&&(d.tagName==="script"||d.tagName==="style")?o.value:BF(o.value,Object.assign({},y.settings.characterReferences,{subset:CVn}))}function SVn(o,s,d,y){return y.settings.allowDangerousHtml?o.value:oPe(o,s,d,y)}function AVn(o,s,d,y){return y.all(o)}const IVn=sjt("type",{invalid:OVn,unknown:NVn,handlers:{comment:eVn,doctype:nVn,element:EVn,raw:SVn,root:AVn,text:oPe}});function OVn(o){throw new Error("Expected node, not `"+o+"`")}function NVn(o){const s=o;throw new Error("Cannot compile unknown node `"+s.type+"`")}const LVn={},MVn={},PVn=[];function RVn(o,s){const d=s||LVn,y=d.quote||'"',S=y==='"'?"'":'"';if(y!=='"'&&y!=="'")throw new Error("Invalid quote `"+y+"`, expected `'` or `\"`");return{one:DVn,all:BVn,settings:{omitOptionalTags:d.omitOptionalTags||!1,allowParseErrors:d.allowParseErrors||!1,allowDangerousCharacters:d.allowDangerousCharacters||!1,quoteSmart:d.quoteSmart||!1,preferUnquoted:d.preferUnquoted||!1,tightAttributes:d.tightAttributes||!1,upperDoctype:d.upperDoctype||!1,tightDoctype:d.tightDoctype||!1,bogusComments:d.bogusComments||!1,tightCommaSeparatedLists:d.tightCommaSeparatedLists||!1,tightSelfClosing:d.tightSelfClosing||!1,collapseEmptyAttributes:d.collapseEmptyAttributes||!1,allowDangerousHtml:d.allowDangerousHtml||!1,voids:d.voids||xMe,characterReferences:d.characterReferences||MVn,closeSelfClosing:d.closeSelfClosing||!1,closeEmptyElements:d.closeEmptyElements||!1},schema:d.space==="svg"?c7:nJ,quote:y,alternative:S}.one(Array.isArray(o)?{type:"root",children:o}:o,void 0,void 0)}function DVn(o,s,d){return IVn(o,s,d,this)}function BVn(o){const s=[],d=o&&o.children||PVn;let y=-1;for(;++y<d.length;)s[y]=this.one(d[y],y,o);return s.join("")}function FVn(o){const s=this,d={...s.data("settings"),...o};s.compiler=y;function y(S){return RVn(S,d)}}var cPe={};const uPe=function(o){if(o==null)return zVn;if(typeof o=="string")return HVn(o);if(typeof o=="object")return Array.isArray(o)?$Vn(o):jVn(o);if(typeof o=="function")return T2t(o);throw new Error("Expected function, string, or object as test")};function $Vn(o){const s=[];let d=-1;for(;++d<o.length;)s[d]=uPe(o[d]);return T2t(y);function y(...S){let N=-1;for(;++N<s.length;)if(s[N].call(this,...S))return!0;return!1}}function jVn(o){return T2t(s);function s(d){let y;for(y in o)if(d[y]!==o[y])return!1;return!0}}function HVn(o){return T2t(s);function s(d){return d&&d.type===o}}function T2t(o){return s;function s(d,...y){return!!(d&&typeof d=="object"&&"type"in d&&o.call(this,d,...y))}}function zVn(){return!0}const lPe=!0,KFt=!1,hPe="skip",UVn=function(o,s,d,y){typeof s=="function"&&typeof d!="function"&&(y=d,d=s,s=null);const S=uPe(s),N=y?-1:1;B(o,void 0,[])();function B(H,et,W){const nt=H&&typeof H=="object"?H:{};if(typeof nt.type=="string"){const Q=typeof nt.tagName=="string"?nt.tagName:typeof nt.name=="string"?nt.name:void 0;Object.defineProperty(K,"name",{value:"node ("+(H.type+(Q?"<"+Q+">":""))+")"})}return K;function K(){let Q=[],at,mt,Lt;if((!s||S(H,et,W[W.length-1]||null))&&(Q=qVn(d(H,W)),Q[0]===KFt))return Q;if(H.children&&Q[0]!==hPe)for(mt=(y?H.children.length:-1)+N,Lt=W.concat(H);mt>-1&&mt<H.children.length;){if(at=B(H.children[mt],mt,Lt)(),at[0]===KFt)return at;mt=typeof at[1]=="number"?at[1]:mt+N}return Q}}};function qVn(o){return Array.isArray(o)?o:typeof o=="number"?[lPe,o]:[o]}const WVn=function(o,s,d,y){typeof s=="function"&&typeof d!="function"&&(y=d,d=s,s=null),UVn(o,s,S,y);function S(N,B){const H=B[B.length-1];return d(N,H?H.children.indexOf(N):null,H)}},KVn=Object.freeze(Object.defineProperty({__proto__:null,CONTINUE:lPe,EXIT:KFt,SKIP:hPe,visit:WVn},Symbol.toStringTag,{value:"Module"})),YVn=iNn(KVn);var Hmt={exports:{}};Hmt.exports;(function(o,s){(function(d,y){o.exports=y()})(A1,function(){function d(i){for(var l=[],b=1;b<arguments.length;b++)l[b-1]=arguments[b];var v=Array.from(typeof i=="string"?[i]:i);v[v.length-1]=v[v.length-1].replace(/\r?\n([\t ]*)$/,"");var E=v.reduce(function(I,L){var $=L.match(/\n([\t ]+|(?!\s).)/g);return $?I.concat($.map(function(q){var Y,tt;return(tt=(Y=q.match(/[\t ]/g))===null||Y===void 0?void 0:Y.length)!==null&&tt!==void 0?tt:0})):I},[]);if(E.length){var T=new RegExp(`
1939
1939
  [ ]{`+Math.min.apply(Math,E)+"}","g");v=v.map(function(I){return I.replace(T,`
1940
1940
  `)})}v[0]=v[0].replace(/^\r?\n/,"");var _=v[0];return l.forEach(function(I,L){var $=_.match(/(?:^|\n)( *)$/),q=$?$[1]:"",Y=I;typeof I=="string"&&I.includes(`
1941
1941
  `)&&(Y=String(I).split(`
@@ -3513,6 +3513,6 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
3513
3513
  .edge {
3514
3514
  fill: none;
3515
3515
  }
3516
- `}},Symbol.toStringTag,{value:"Module"}));return Dw})})(Hmt,Hmt.exports);var KVn=Hmt.exports,YVn=A1&&A1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(cPe,"__esModule",{value:!0});var GVn=WVn,yIe=YVn(KVn),VVn=function(s){var d=s===void 0?{}:s,y=d.theme,S=y===void 0?"default":y;return function(N){var B=[];if((0,GVn.visit)(N,{type:"code",lang:"mermaid"},function(et,W,nt){B.push([et.value,W,nt])}),!B.length)return N;var H=B.map(function(et){var W=et[0],nt="mermaid"+Math.random().toString(36).slice(2);yIe.default.initialize({theme:S});var K=document.createElement("div");return K.innerHTML='<pre><code class="hljs language-mermaid">'.concat(yIe.default.render(nt,W),"</code></pre>"),K.innerHTML});B.forEach(function(et,W){var nt=et[1],K=et[2],Q=H[W];K.children.splice(nt,1,{type:"html",value:Q})})}},XVn=cPe.default=VVn;function T6(o){return pe.jsx(cWn,{remarkPlugins:[XVn],rehypePlugins:[MGn,DVn],components:{img:({...s})=>pe.jsx("img",{...s,style:{display:"block",maxWidth:"100%",height:"auto"}})},children:o.children})}function QVn({prompt:o}){return pe.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:pe.jsx(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%",textAlign:"left"},children:pe.jsxs(sL,{children:[pe.jsx(XQ,{icon:pe.jsx(SLe,{}),label:"Assistant",variant:"outlined",color:"success"}),pe.jsx(T6,{children:o.text})]})})})}const fPe=n5(pe.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");function JVn({execute:o}){return pe.jsxs(QN.Fragment,{children:[pe.jsxs(S3,{variant:"h5",children:[" ",ZVn(o)," "]}),pe.jsx("hr",{}),pe.jsx(S3,{variant:"h6",children:" Description "}),pe.jsx(T6,{children:o.operation.function.description}),pe.jsx("br",{}),pe.jsx(S3,{variant:"h6",children:" Arguments "}),pe.jsx(T6,{children:["```json",JSON.stringify(o.arguments,null,2),"```"].join(`
3516
+ `}},Symbol.toStringTag,{value:"Module"}));return Dw})})(Hmt,Hmt.exports);var GVn=Hmt.exports,VVn=A1&&A1.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(cPe,"__esModule",{value:!0});var XVn=YVn,yIe=VVn(GVn),QVn=function(s){var d=s===void 0?{}:s,y=d.theme,S=y===void 0?"default":y;return function(N){var B=[];if((0,XVn.visit)(N,{type:"code",lang:"mermaid"},function(et,W,nt){B.push([et.value,W,nt])}),!B.length)return N;var H=B.map(function(et){var W=et[0],nt="mermaid"+Math.random().toString(36).slice(2);yIe.default.initialize({theme:S});var K=document.createElement("div");return K.innerHTML='<pre><code class="hljs language-mermaid">'.concat(yIe.default.render(nt,W),"</code></pre>"),K.innerHTML});B.forEach(function(et,W){var nt=et[1],K=et[2],Q=H[W];K.children.splice(nt,1,{type:"html",value:Q})})}},JVn=cPe.default=QVn;function T6(o){return pe.jsx(lWn,{remarkPlugins:[JVn],rehypePlugins:[RGn,FVn],components:{img:({...s})=>pe.jsx("img",{...s,style:{display:"block",maxWidth:"100%",height:"auto"}})},children:o.children})}function ZVn({prompt:o}){return pe.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:pe.jsx(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%",textAlign:"left"},children:pe.jsxs(sL,{children:[pe.jsx(XQ,{icon:pe.jsx(SLe,{}),label:"Assistant",variant:"outlined",color:"success"}),pe.jsx(T6,{children:o.text})]})})})}const fPe=n5(pe.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");function tXn({execute:o}){return pe.jsxs(QN.Fragment,{children:[pe.jsxs(S3,{variant:"h5",children:[" ",eXn(o)," "]}),pe.jsx("hr",{}),pe.jsx(S3,{variant:"h6",children:" Description "}),pe.jsx(T6,{children:o.operation.function.description}),pe.jsx("br",{}),pe.jsx(S3,{variant:"h6",children:" Arguments "}),pe.jsx(T6,{children:["```json",JSON.stringify(o.arguments,null,2),"```"].join(`
3517
3517
  `)}),pe.jsx("br",{}),pe.jsx(S3,{variant:"h6",children:" Return Value "}),pe.jsx(T6,{children:["```json",JSON.stringify(o.value,null,2),"```"].join(`
3518
- `)})]})}function ZVn(o){return o.operation.protocol==="http"?`${o.operation.function.method.toUpperCase()} ${o.operation.function.path}`:o.operation.function.name}function tXn({history:o}){const[s,d]=hn.useState(!1);return pe.jsxs(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[pe.jsxs(sL,{children:[pe.jsx(XQ,{label:"Function Describer",variant:"outlined",color:"secondary"}),pe.jsx(T6,{children:o.text})]}),pe.jsx(jIe,{style:{textAlign:"right"},children:pe.jsx(imt,{startIcon:pe.jsx(fPe,{style:{transform:`rotate(${s?180:0}deg)`}}),onClick:()=>d(!s),children:s?"Hide Function Calls":"Show Function Calls"})}),pe.jsx(FQ,{in:s,timeout:"auto",unmountOnExit:!0,children:pe.jsx(sL,{children:o.executes.map(y=>pe.jsx(JVn,{execute:y}))})})]})}const eXn=n5(pe.jsx("path",{d:"M4 7h16v2H4zm0 6h16v-2H4zm0 4h7v-2H4zm0 4h7v-2H4zm11.41-2.83L14 16.75l-1.41 1.41L15.41 21 20 16.42 18.58 15zM4 3v2h16V3z"}),"Grading");function nXn({selection:o}){const[s,d]=hn.useState(!1);return pe.jsxs(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[pe.jsxs(sL,{children:[pe.jsx(XQ,{icon:pe.jsx(eXn,{}),label:"Function Selector",variant:"outlined",color:"warning"}),pe.jsx("br",{}),pe.jsx("br",{}),"Operation:",o.operation.protocol==="http"?pe.jsxs("ul",{children:[pe.jsx("li",{children:o.operation.function.method.toUpperCase()}),pe.jsx("li",{children:o.operation.function.path})]}):pe.jsx("ul",{children:pe.jsx("li",{children:o.operation.function.name})}),pe.jsx(T6,{children:o.reason})]}),pe.jsx(jIe,{style:{textAlign:"right"},children:pe.jsx(imt,{onClick:()=>d(!s),children:s?"Hide Function Description":"Show Function Description"})}),pe.jsx(FQ,{in:s,timeout:"auto",unmountOnExit:!0,children:pe.jsx(sL,{children:pe.jsx(T6,{children:o.operation.function.description})})})]})}function rXn({prompt:o}){return pe.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:pe.jsx(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%",textAlign:"left"},children:pe.jsxs(sL,{children:[pe.jsx(XQ,{icon:pe.jsx(SLe,{}),label:"System",variant:"outlined",color:"success"}),pe.jsx(T6,{children:o.text})]})})})}const iXn=n5(pe.jsx("path",{d:"M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25m6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"}),"Face");function aXn({prompt:o}){return pe.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:o.contents.map((s,d)=>s.type==="text"?pe.jsx(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginLeft:"15%",textAlign:"right",backgroundColor:"lightyellow"},children:pe.jsxs(sL,{children:[pe.jsx(XQ,{icon:pe.jsx(iXn,{}),label:"User",variant:"outlined",color:"primary"}),pe.jsx(T6,{children:s.text})]})},d):null)})}function sXn({prompt:o}){return o.type==="assistantMessage"?pe.jsx(QVn,{prompt:o}):o.type==="select"?pe.jsx(nXn,{selection:o.selection}):o.type==="describe"?pe.jsx(tXn,{history:o}):o.type==="cancel"||o.type==="execute"?null:o.type==="userMessage"?pe.jsx(aXn,{prompt:o}):o.type==="systemMessage"?pe.jsx(rXn,{prompt:o}):null}function oXn(o){return pe.jsxs(QN.Fragment,{children:[pe.jsx(S3,{variant:"h5",children:" Function Stack "}),pe.jsx("hr",{}),o.selections.map(s=>pe.jsxs(LNn,{children:[pe.jsx(zNn,{expandIcon:pe.jsx(fPe,{}),children:pe.jsx(S3,{component:"h6",children:s.operation.protocol==="http"?`${s.operation.function.method.toUpperCase()} ${s.operation.function.path}`:s.operation.function.name})}),pe.jsxs(DNn,{children:[pe.jsx("hr",{}),s.reason,pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(T6,{children:s.operation.function.description})]})]}))]})}function cXn(o){const s=uXn(o.usage);return pe.jsxs(QN.Fragment,{children:[pe.jsx(S3,{variant:"h5",children:" Token Usage "}),pe.jsx("hr",{}),pe.jsxs(nRn,{children:[pe.jsx(bRn,{children:pe.jsxs(Ebt,{children:[pe.jsx(T3,{children:"Type"}),pe.jsx(T3,{children:"Token Usage"}),pe.jsx(T3,{children:"Price"})]})}),pe.jsxs(oRn,{children:[pe.jsxs(Ebt,{children:[pe.jsx(T3,{children:"Total"}),pe.jsx(T3,{children:o.usage.aggregate.total.toLocaleString()}),pe.jsxs(T3,{children:["$",s.total.toLocaleString()]})]}),pe.jsxs(Ebt,{children:[pe.jsx(T3,{children:"Input"}),pe.jsx(T3,{children:o.usage.aggregate.input.total.toLocaleString()}),pe.jsxs(T3,{children:["$",s.prompt.toLocaleString()]})]}),pe.jsxs(Ebt,{children:[pe.jsx(T3,{children:"Output"}),pe.jsx(T3,{children:o.usage.aggregate.output.total.toLocaleString()}),pe.jsxs(T3,{children:["$",s.completion.toLocaleString()]})]})]})]})]})}function uXn(o){const s=(o.aggregate.input.total-o.aggregate.input.cached)*25e-7+o.aggregate.input.cached*125e-8,d=o.aggregate.output.total*(10/1e6);return{total:s+d,prompt:s,completion:d}}function lXn(o){var s,d;return pe.jsxs("div",{style:{padding:25},children:[o.error!==null?pe.jsxs(pe.Fragment,{children:[pe.jsx(S3,{variant:"h5",color:"error",children:"OpenAI Error"}),pe.jsx("hr",{}),o.error.message,pe.jsx("br",{}),pe.jsx("br",{}),"Your OpenAI API key may not valid.",pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx("br",{})]}):null,pe.jsx(S3,{variant:"h5",children:"Agent Information"}),pe.jsx("hr",{}),pe.jsxs("ul",{children:[pe.jsxs("li",{children:["Vendor Model:"," ",o.vendor.model]}),pe.jsxs("li",{children:["Locale:"," ",((s=o.config)==null?void 0:s.locale)??navigator.language]}),pe.jsxs("li",{children:["Timezone:"," ",((d=o.config)==null?void 0:d.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(cXn,{usage:o.usage}),pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(oXn,{selections:o.selections})]})}const wIe=450;function hXn({agent:o,title:s}){const d=hn.useRef(null),y=hn.useRef(null),S=hn.useRef(null),N=hn.useRef(null),B=hn.useRef(null),[H,et]=hn.useState(null),[W,nt]=hn.useState(""),[K,Q]=hn.useState(o.getHistories().slice()),[at,mt]=hn.useState(JSON.parse(JSON.stringify(o.getTokenUsage()))),[Lt,Pt]=hn.useState(122),[Mt,ie]=hn.useState(!0),[se,ve]=hn.useState([]),[gn,fe]=hn.useState(!1),cn=async ka=>{Q(rs=>[...rs,ka.toHistory()])},sr=async ka=>{await ka.join(),Q(rs=>[...rs,ka.toHistory()])},Fn=async ka=>{await ka.join(),Q(rs=>[...rs,ka.toHistory()])},qn=ka=>{Q(rs=>[...rs,ka.toHistory()]),ve(rs=>[...rs,ka.selection])},nr=ka=>{console.error(ka)},hr=ka=>{console.error(ka)};hn.useEffect(()=>(B.current!==null&&B.current.select(),mt(o.getTokenUsage()),o instanceof kmt?(o.on("select",qn),o.on("assistantMessage",sr),o.on("userMessage",cn),o.on("describe",Fn),o.on("validate",nr),o.on("jsonParseError",hr)):(o.on("assistantMessage",sr),o.on("userMessage",cn),o.on("describe",Fn),o.on("validate",nr),o.on("jsonParseError",hr)),()=>{o instanceof kmt?(o.off("select",qn),o.off("assistantMessage",sr),o.off("userMessage",cn),o.off("describe",Fn),o.off("validate",nr),o.off("jsonParseError",hr)):(o.off("assistantMessage",sr),o.off("userMessage",cn),o.off("describe",Fn),o.off("validate",nr),o.off("jsonParseError",hr))}),[]);const di=()=>{setTimeout(()=>{if(d.current===null||y.current===null||S.current===null)return;const ka=d.current.clientHeight+S.current.clientHeight;ka!==Lt&&Pt(ka)})};hn.useEffect(()=>{var ka;K.length!==0&&((ka=N.current)==null||ka.scrollIntoView({behavior:"smooth",block:"end"}))},[K.length]);const gi=async()=>{nt(""),ie(!1),di();try{await o.conversate(W)}catch(rs){rs instanceof Error?(alert(rs.message),et(rs)):et(new Error("Unknown error"));return}K.splice(0,K.length),K.push(...o.getHistories()),Q(K),mt(o.getTokenUsage()),ie(!0);const ka=o.getHistories().filter(rs=>rs.type==="select").map(rs=>rs.selection);for(const rs of o.getHistories().filter(We=>We.type==="cancel").map(We=>We.selection)){const We=ka.findIndex(za=>za.operation.protocol===rs.operation.protocol&&za.operation.controller.name===rs.operation.controller.name&&za.operation.function.name===rs.operation.function.name);We!==-1&&ka.splice(We,1)}ve(ka)},Ar=async ka=>{ka.key==="Enter"&&ka.shiftKey===!1&&(Mt===!1?ka.preventDefault():await gi())},hi=async()=>{if(N.current===null)return;const ka=await Njn(N.current,{}),rs=document.createElement("a");rs.download="nestia-chat-screenshot.png",rs.href=ka,rs.click(),rs.remove()},_a=uL(),fr=VMn(_a.breakpoints.down("lg")),yr=()=>pe.jsx("div",{style:{overflowY:"auto",height:"100%",width:fr?"100%":`calc(100% - ${wIe}px)`,margin:0,backgroundColor:"lightblue"},children:pe.jsx(C7e,{style:{paddingBottom:50,width:"100%",minHeight:"100%",backgroundColor:"lightblue",margin:0},ref:N,children:K.map((ka,rs)=>pe.jsx(sXn,{prompt:ka},rs)).filter(ka=>ka!==null)})}),Oe=()=>pe.jsx("div",{style:{width:fr?void 0:wIe,height:"100%",overflowY:"auto",backgroundColor:"#eeeeee"},children:pe.jsx(C7e,{maxWidth:!1,onClick:fr?()=>fe(!1):void 0,children:pe.jsx(lXn,{vendor:o.getVendor(),config:o.getConfig(),usage:at,selections:se,error:H})})});return pe.jsxs("div",{style:{width:"100%",height:"100%"},children:[pe.jsx(w7e,{ref:d,position:"relative",component:"div",children:pe.jsxs(U7e,{children:[pe.jsx(S3,{variant:"h6",component:"div",sx:{flexGrow:1},children:s??"Agentica Chatbot"}),fr?pe.jsxs(pe.Fragment,{children:[pe.jsx(m7e,{onClick:()=>void hi().catch(()=>{}),children:pe.jsx(G9e,{})}),pe.jsx(m7e,{onClick:()=>fe(!0),children:pe.jsx(B$n,{})})]}):pe.jsx(imt,{color:"inherit",startIcon:pe.jsx(G9e,{}),onClick:()=>void hi().catch(()=>{}),children:"Screenshot Capture"})]})}),pe.jsx("div",{ref:y,style:{width:"100%",height:`calc(100% - ${Lt}px)`,display:"flex",flexDirection:"row"},children:fr?pe.jsxs(pe.Fragment,{children:[yr(),pe.jsx(EMn,{anchor:"right",open:gn,onClose:()=>fe(!1),children:Oe()})]}):pe.jsxs(pe.Fragment,{children:[yr(),Oe()]})}),pe.jsx(w7e,{ref:S,position:"static",component:"div",color:"inherit",children:pe.jsxs(U7e,{children:[pe.jsx(Kmt,{inputRef:B,fullWidth:!0,placeholder:"Conversate with AI Chatbot",value:W,multiline:!0,onKeyUp:ka=>void Ar(ka).catch(()=>{}),onChange:ka=>{nt(ka.target.value),di()}}),pe.jsx(imt,{variant:"contained",style:{marginLeft:10},startIcon:pe.jsx(F$n,{}),disabled:!Mt,onClick:()=>void gi().catch(()=>{}),children:"Send"})]})})]})}function AXn(o){return pe.jsx(hXn,{...o})}function vIe(o){const[s,d]=hn.useState(o.config.apiKey),[y,S]=hn.useState(o.config.baseURL===void 0&&(o.config.vendorModel==="gpt-4o"||o.config.vendorModel==="gpt-4o-mini")?o.config.vendorModel:"manual"),[N,B]=hn.useState(o.config.vendorModel),[H,et]=hn.useState(o.config.baseURL),W=()=>({vendorModel:N,apiKey:s,baseURL:H}),nt=mt=>{const Lt=W();Lt.apiKey=mt,d(mt),o.onChange(Lt)},K=mt=>{const Lt=W();Lt.baseURL=mt,et(mt),o.onChange(Lt)},Q=(mt,Lt)=>{const Pt=W();S(Lt),Lt==="gpt-4o"||Lt==="gpt-4o-mini"?(Pt.vendorModel=Lt,Pt.baseURL=void 0,et(void 0),B(Lt)):(Pt.vendorModel="qwen/qwen3-30b-a3b",Pt.baseURL="http://localhost:1234/v1",Pt.apiKey="Local LLM does not require an API key",B(Pt.vendorModel),et(Pt.baseURL),d(Pt.apiKey)),o.onChange(Pt)},at=mt=>{const Lt=W();Lt.vendorModel=mt,B(mt),o.onChange(Lt)};return pe.jsxs(pe.Fragment,{children:[pe.jsx(GDt,{onChange:mt=>nt(mt.target.value),value:s,label:"OpenAI API Key",variant:"outlined",placeholder:"Your OpenAI API Key",error:s.length===0}),pe.jsx("br",{}),pe.jsxs(zPn,{defaultValue:y,onChange:Q,style:{paddingLeft:15},children:[pe.jsx(qDt,{control:pe.jsx(YDt,{}),label:"GPT-4o Mini",value:"gpt-4o-mini"}),pe.jsx(qDt,{control:pe.jsx(YDt,{}),label:"GPT-4o",value:"gpt-4o"}),pe.jsx(qDt,{control:pe.jsx(YDt,{}),label:"Manual Configuration",value:"manual"})]}),y==="manual"?pe.jsxs(pe.Fragment,{children:[pe.jsx("br",{}),pe.jsx(GDt,{fullWidth:!0,label:"Base URL",defaultValue:H,onChange:mt=>K(mt.target.value)}),pe.jsx("br",{}),pe.jsx(GDt,{fullWidth:!0,label:"Vendor Model",defaultValue:N,onChange:mt=>at(mt.target.value)}),pe.jsx("br",{})]}):null,pe.jsx("br",{})]})}(o=>{function s(){return{vendorModel:"gpt-4o-mini",apiKey:"",baseURL:void 0}}o.defaultConfig=s})(vIe||(vIe={}));export{kmt as A,imt as B,OMn as F,lFt as H,m7e as I,kQ as L,KBt as O,VQ as P,jBt as S,GDt as T,vIe as V,ZF as _,VMn as a,YMn as b,bu as c,AXn as d,UBt as e,li as f,LIe as g,_mt as h,dDn as i,XBt as j,s0 as k,FBt as l,$Bt as m,YRn as n,eL as o,BBt as p,uDn as q,oFn as r,yFn as s,TFn as t,uL as u,NFn as v,wOe as w,r5 as x};
3518
+ `)})]})}function eXn(o){return o.operation.protocol==="http"?`${o.operation.function.method.toUpperCase()} ${o.operation.function.path}`:o.operation.function.name}function nXn({history:o}){const[s,d]=hn.useState(!1);return pe.jsxs(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[pe.jsxs(sL,{children:[pe.jsx(XQ,{label:"Function Describer",variant:"outlined",color:"secondary"}),pe.jsx(T6,{children:o.text})]}),pe.jsx(jIe,{style:{textAlign:"right"},children:pe.jsx(imt,{startIcon:pe.jsx(fPe,{style:{transform:`rotate(${s?180:0}deg)`}}),onClick:()=>d(!s),children:s?"Hide Function Calls":"Show Function Calls"})}),pe.jsx(FQ,{in:s,timeout:"auto",unmountOnExit:!0,children:pe.jsx(sL,{children:o.executes.map(y=>pe.jsx(tXn,{execute:y}))})})]})}const rXn=n5(pe.jsx("path",{d:"M4 7h16v2H4zm0 6h16v-2H4zm0 4h7v-2H4zm0 4h7v-2H4zm11.41-2.83L14 16.75l-1.41 1.41L15.41 21 20 16.42 18.58 15zM4 3v2h16V3z"}),"Grading");function iXn({selection:o}){const[s,d]=hn.useState(!1);return pe.jsxs(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[pe.jsxs(sL,{children:[pe.jsx(XQ,{icon:pe.jsx(rXn,{}),label:"Function Selector",variant:"outlined",color:"warning"}),pe.jsx("br",{}),pe.jsx("br",{}),"Operation:",o.operation.protocol==="http"?pe.jsxs("ul",{children:[pe.jsx("li",{children:o.operation.function.method.toUpperCase()}),pe.jsx("li",{children:o.operation.function.path})]}):pe.jsx("ul",{children:pe.jsx("li",{children:o.operation.function.name})}),pe.jsx(T6,{children:o.reason})]}),pe.jsx(jIe,{style:{textAlign:"right"},children:pe.jsx(imt,{onClick:()=>d(!s),children:s?"Hide Function Description":"Show Function Description"})}),pe.jsx(FQ,{in:s,timeout:"auto",unmountOnExit:!0,children:pe.jsx(sL,{children:pe.jsx(T6,{children:o.operation.function.description})})})]})}function aXn({prompt:o}){return pe.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:pe.jsx(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%",textAlign:"left"},children:pe.jsxs(sL,{children:[pe.jsx(XQ,{icon:pe.jsx(SLe,{}),label:"System",variant:"outlined",color:"success"}),pe.jsx(T6,{children:o.text})]})})})}const sXn=n5(pe.jsx("path",{d:"M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25m6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"}),"Face");function oXn({prompt:o}){return pe.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:o.contents.map((s,d)=>s.type==="text"?pe.jsx(QQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginLeft:"15%",textAlign:"right",backgroundColor:"lightyellow"},children:pe.jsxs(sL,{children:[pe.jsx(XQ,{icon:pe.jsx(sXn,{}),label:"User",variant:"outlined",color:"primary"}),pe.jsx(T6,{children:s.text})]})},d):null)})}function cXn({prompt:o}){return o.type==="assistantMessage"?pe.jsx(ZVn,{prompt:o}):o.type==="select"?pe.jsx(iXn,{selection:o.selection}):o.type==="describe"?pe.jsx(nXn,{history:o}):o.type==="cancel"||o.type==="execute"?null:o.type==="userMessage"?pe.jsx(oXn,{prompt:o}):o.type==="systemMessage"?pe.jsx(aXn,{prompt:o}):null}function uXn(o){return pe.jsxs(QN.Fragment,{children:[pe.jsx(S3,{variant:"h5",children:" Function Stack "}),pe.jsx("hr",{}),o.selections.map(s=>pe.jsxs(LNn,{children:[pe.jsx(zNn,{expandIcon:pe.jsx(fPe,{}),children:pe.jsx(S3,{component:"h6",children:s.operation.protocol==="http"?`${s.operation.function.method.toUpperCase()} ${s.operation.function.path}`:s.operation.function.name})}),pe.jsxs(DNn,{children:[pe.jsx("hr",{}),s.reason,pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(T6,{children:s.operation.function.description})]})]}))]})}function lXn(o){const s=hXn(o.usage);return pe.jsxs(QN.Fragment,{children:[pe.jsx(S3,{variant:"h5",children:" Token Usage "}),pe.jsx("hr",{}),pe.jsxs(nRn,{children:[pe.jsx(bRn,{children:pe.jsxs(Ebt,{children:[pe.jsx(T3,{children:"Type"}),pe.jsx(T3,{children:"Token Usage"}),pe.jsx(T3,{children:"Price"})]})}),pe.jsxs(oRn,{children:[pe.jsxs(Ebt,{children:[pe.jsx(T3,{children:"Total"}),pe.jsx(T3,{children:o.usage.aggregate.total.toLocaleString()}),pe.jsxs(T3,{children:["$",s.total.toLocaleString()]})]}),pe.jsxs(Ebt,{children:[pe.jsx(T3,{children:"Input"}),pe.jsx(T3,{children:o.usage.aggregate.input.total.toLocaleString()}),pe.jsxs(T3,{children:["$",s.prompt.toLocaleString()]})]}),pe.jsxs(Ebt,{children:[pe.jsx(T3,{children:"Output"}),pe.jsx(T3,{children:o.usage.aggregate.output.total.toLocaleString()}),pe.jsxs(T3,{children:["$",s.completion.toLocaleString()]})]})]})]})]})}function hXn(o){const s=(o.aggregate.input.total-o.aggregate.input.cached)*25e-7+o.aggregate.input.cached*125e-8,d=o.aggregate.output.total*(10/1e6);return{total:s+d,prompt:s,completion:d}}function fXn(o){var s,d;return pe.jsxs("div",{style:{padding:25},children:[o.error!==null?pe.jsxs(pe.Fragment,{children:[pe.jsx(S3,{variant:"h5",color:"error",children:"OpenAI Error"}),pe.jsx("hr",{}),o.error.message,pe.jsx("br",{}),pe.jsx("br",{}),"Your OpenAI API key may not valid.",pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx("br",{})]}):null,pe.jsx(S3,{variant:"h5",children:"Agent Information"}),pe.jsx("hr",{}),pe.jsxs("ul",{children:[pe.jsxs("li",{children:["Vendor Model:"," ",o.vendor.model]}),pe.jsxs("li",{children:["Locale:"," ",((s=o.config)==null?void 0:s.locale)??navigator.language]}),pe.jsxs("li",{children:["Timezone:"," ",((d=o.config)==null?void 0:d.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(lXn,{usage:o.usage}),pe.jsx("br",{}),pe.jsx("br",{}),pe.jsx(uXn,{selections:o.selections})]})}const wIe=450;function dXn({agent:o,title:s}){const d=hn.useRef(null),y=hn.useRef(null),S=hn.useRef(null),N=hn.useRef(null),B=hn.useRef(null),[H,et]=hn.useState(null),[W,nt]=hn.useState(""),[K,Q]=hn.useState(o.getHistories().slice()),[at,mt]=hn.useState(JSON.parse(JSON.stringify(o.getTokenUsage()))),[Lt,Pt]=hn.useState(122),[Mt,ie]=hn.useState(!0),[se,ve]=hn.useState([]),[gn,fe]=hn.useState(!1),cn=async ka=>{Q(rs=>[...rs,ka.toHistory()])},sr=async ka=>{await ka.join(),Q(rs=>[...rs,ka.toHistory()])},Fn=async ka=>{await ka.join(),Q(rs=>[...rs,ka.toHistory()])},qn=ka=>{Q(rs=>[...rs,ka.toHistory()]),ve(rs=>[...rs,ka.selection])},nr=ka=>{console.error(ka)},hr=ka=>{console.error(ka)};hn.useEffect(()=>(B.current!==null&&B.current.select(),mt(o.getTokenUsage()),o instanceof kmt?(o.on("select",qn),o.on("assistantMessage",sr),o.on("userMessage",cn),o.on("describe",Fn),o.on("validate",nr),o.on("jsonParseError",hr)):(o.on("assistantMessage",sr),o.on("userMessage",cn),o.on("describe",Fn),o.on("validate",nr),o.on("jsonParseError",hr)),()=>{o instanceof kmt?(o.off("select",qn),o.off("assistantMessage",sr),o.off("userMessage",cn),o.off("describe",Fn),o.off("validate",nr),o.off("jsonParseError",hr)):(o.off("assistantMessage",sr),o.off("userMessage",cn),o.off("describe",Fn),o.off("validate",nr),o.off("jsonParseError",hr))}),[]);const di=()=>{setTimeout(()=>{if(d.current===null||y.current===null||S.current===null)return;const ka=d.current.clientHeight+S.current.clientHeight;ka!==Lt&&Pt(ka)})};hn.useEffect(()=>{var ka;K.length!==0&&((ka=N.current)==null||ka.scrollIntoView({behavior:"smooth",block:"end"}))},[K.length]);const gi=async()=>{nt(""),ie(!1),di();try{await o.conversate(W)}catch(rs){rs instanceof Error?(alert(rs.message),et(rs)):et(new Error("Unknown error"));return}K.splice(0,K.length),K.push(...o.getHistories()),Q(K),mt(o.getTokenUsage()),ie(!0);const ka=o.getHistories().filter(rs=>rs.type==="select").map(rs=>rs.selection);for(const rs of o.getHistories().filter(We=>We.type==="cancel").map(We=>We.selection)){const We=ka.findIndex(za=>za.operation.protocol===rs.operation.protocol&&za.operation.controller.name===rs.operation.controller.name&&za.operation.function.name===rs.operation.function.name);We!==-1&&ka.splice(We,1)}ve(ka)},Ar=async ka=>{ka.key==="Enter"&&ka.shiftKey===!1&&(Mt===!1?ka.preventDefault():await gi())},hi=async()=>{if(N.current===null)return;const ka=await Mjn(N.current,{}),rs=document.createElement("a");rs.download="nestia-chat-screenshot.png",rs.href=ka,rs.click(),rs.remove()},_a=uL(),fr=VMn(_a.breakpoints.down("lg")),yr=()=>pe.jsx("div",{style:{overflowY:"auto",height:"100%",width:fr?"100%":`calc(100% - ${wIe}px)`,margin:0,backgroundColor:"lightblue"},children:pe.jsx(C7e,{style:{paddingBottom:50,width:"100%",minHeight:"100%",backgroundColor:"lightblue",margin:0},ref:N,children:K.map((ka,rs)=>pe.jsx(cXn,{prompt:ka},rs)).filter(ka=>ka!==null)})}),Oe=()=>pe.jsx("div",{style:{width:fr?void 0:wIe,height:"100%",overflowY:"auto",backgroundColor:"#eeeeee"},children:pe.jsx(C7e,{maxWidth:!1,onClick:fr?()=>fe(!1):void 0,children:pe.jsx(fXn,{vendor:o.getVendor(),config:o.getConfig(),usage:at,selections:se,error:H})})});return pe.jsxs("div",{style:{width:"100%",height:"100%"},children:[pe.jsx(w7e,{ref:d,position:"relative",component:"div",children:pe.jsxs(U7e,{children:[pe.jsx(S3,{variant:"h6",component:"div",sx:{flexGrow:1},children:s??"Agentica Chatbot"}),fr?pe.jsxs(pe.Fragment,{children:[pe.jsx(m7e,{onClick:()=>void hi().catch(()=>{}),children:pe.jsx(G9e,{})}),pe.jsx(m7e,{onClick:()=>fe(!0),children:pe.jsx($$n,{})})]}):pe.jsx(imt,{color:"inherit",startIcon:pe.jsx(G9e,{}),onClick:()=>void hi().catch(()=>{}),children:"Screenshot Capture"})]})}),pe.jsx("div",{ref:y,style:{width:"100%",height:`calc(100% - ${Lt}px)`,display:"flex",flexDirection:"row"},children:fr?pe.jsxs(pe.Fragment,{children:[yr(),pe.jsx(EMn,{anchor:"right",open:gn,onClose:()=>fe(!1),children:Oe()})]}):pe.jsxs(pe.Fragment,{children:[yr(),Oe()]})}),pe.jsx(w7e,{ref:S,position:"static",component:"div",color:"inherit",children:pe.jsxs(U7e,{children:[pe.jsx(Kmt,{inputRef:B,fullWidth:!0,placeholder:"Conversate with AI Chatbot",value:W,multiline:!0,onKeyUp:ka=>void Ar(ka).catch(()=>{}),onChange:ka=>{nt(ka.target.value),di()}}),pe.jsx(imt,{variant:"contained",style:{marginLeft:10},startIcon:pe.jsx(j$n,{}),disabled:!Mt,onClick:()=>void gi().catch(()=>{}),children:"Send"})]})})]})}function OXn(o){return pe.jsx(dXn,{...o})}function vIe(o){const[s,d]=hn.useState(o.config.apiKey),[y,S]=hn.useState(o.config.baseURL===void 0&&(o.config.vendorModel==="gpt-4o"||o.config.vendorModel==="gpt-4o-mini")?o.config.vendorModel:"manual"),[N,B]=hn.useState(o.config.vendorModel),[H,et]=hn.useState(o.config.baseURL),W=()=>({vendorModel:N,apiKey:s,baseURL:H}),nt=mt=>{const Lt=W();Lt.apiKey=mt,d(mt),o.onChange(Lt)},K=mt=>{const Lt=W();Lt.baseURL=mt,et(mt),o.onChange(Lt)},Q=(mt,Lt)=>{const Pt=W();S(Lt),Lt==="gpt-4o"||Lt==="gpt-4o-mini"?(Pt.vendorModel=Lt,Pt.baseURL=void 0,et(void 0),B(Lt)):(Pt.vendorModel="qwen/qwen3-30b-a3b",Pt.baseURL="http://localhost:1234/v1",Pt.apiKey="Local LLM does not require an API key",B(Pt.vendorModel),et(Pt.baseURL),d(Pt.apiKey)),o.onChange(Pt)},at=mt=>{const Lt=W();Lt.vendorModel=mt,B(mt),o.onChange(Lt)};return pe.jsxs(pe.Fragment,{children:[pe.jsx(GDt,{onChange:mt=>nt(mt.target.value),value:s,label:"OpenAI API Key",variant:"outlined",placeholder:"Your OpenAI API Key",error:s.length===0}),pe.jsx("br",{}),pe.jsxs(zPn,{defaultValue:y,onChange:Q,style:{paddingLeft:15},children:[pe.jsx(qDt,{control:pe.jsx(YDt,{}),label:"GPT-4o Mini",value:"gpt-4o-mini"}),pe.jsx(qDt,{control:pe.jsx(YDt,{}),label:"GPT-4o",value:"gpt-4o"}),pe.jsx(qDt,{control:pe.jsx(YDt,{}),label:"Manual Configuration",value:"manual"})]}),y==="manual"?pe.jsxs(pe.Fragment,{children:[pe.jsx("br",{}),pe.jsx(GDt,{fullWidth:!0,label:"Base URL",defaultValue:H,onChange:mt=>K(mt.target.value)}),pe.jsx("br",{}),pe.jsx(GDt,{fullWidth:!0,label:"Vendor Model",defaultValue:N,onChange:mt=>at(mt.target.value)}),pe.jsx("br",{})]}):null,pe.jsx("br",{})]})}(o=>{function s(){return{vendorModel:"gpt-4o-mini",apiKey:"",baseURL:void 0}}o.defaultConfig=s})(vIe||(vIe={}));export{kmt as A,imt as B,OMn as F,lFt as H,m7e as I,kQ as L,KBt as O,VQ as P,jBt as S,GDt as T,vIe as V,ZF as _,VMn as a,YMn as b,bu as c,OXn as d,UBt as e,li as f,LIe as g,_mt as h,dDn as i,XBt as j,s0 as k,FBt as l,$Bt as m,YRn as n,eL as o,BBt as p,uDn as q,uFn as r,vFn as s,CFn as t,uL as u,MFn as v,wOe as w,r5 as x};