@aiiware/aii 0.22.2 → 0.22.3

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.
Files changed (2) hide show
  1. package/bin/aii +22 -22
  2. package/package.json +1 -1
package/bin/aii CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @aiiware/aii v0.22.2
3
+ * @aiiware/aii v0.22.3
4
4
  *
5
5
  * AI-powered CLI assistant for terminal productivity
6
6
  *
@@ -219,7 +219,7 @@ Unhandled rejection:`,n),Y(`Unhandled rejection: ${n}`),await lb(),process.exit(
219
219
  `)),a=Nl(t),l=e.requestTimeoutMs??1e4,c=async(g,_)=>{let E=new AbortController,y=setTimeout(()=>E.abort(),l);try{let S=await r(g,{..._,signal:E.signal}),T=await S.text();return{ok:S.ok,status:S.status,text:T}}finally{clearTimeout(y)}},u=Jwe(e.hostname??Vwe),d;try{d=await c(`${a}/v1/auth/device/start`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_type:"cli",...u?{device_name:u}:{}})})}catch(g){throw g.name==="AbortError"?new da(`Aii Cloud unreachable (${new URL(a).hostname} timed out). Check your network and retry.`):g}if(!d.ok)throw new da(`Device authorization failed to start (HTTP ${d.status}).`);let p=JSON.parse(d.text);i(`
220
220
  Open this URL to sign in:
221
221
  ${p.verify_url}
222
- `),n(p.verify_url),i(" Waiting for authentication... (press Ctrl+C to cancel)");let h=Math.max(1,p.interval||2)*1e3,f=Zwe(p.expires_at,o());for(;;){try{let g=await c(p.poll_url);if(g.ok){let _=JSON.parse(g.text);if(_.status==="completed"&&_.api_key)return{apiKey:_.api_key};if(_.status==="expired")throw new da("The sign-in code expired. Run the command again to retry.")}}catch(g){if(g instanceof da)throw g}if(o()>=f)throw new da("Timed out waiting for sign-in. Run the command again to retry.");await s(h)}}var da,Qwe,Ol=k(()=>{"use strict";da=class extends Error{constructor(e){super(e),this.name="DeviceAuthError"}},Qwe=3e5});function LG(t){return typeof t=="number"&&Number.isInteger(t)&&t>0?t:1}function Lb(t,e){if(typeof t!="object"||t===null)return{kind:"malformed",reason:"frame is not an object"};let r=t.type;return typeof r!="string"?{kind:"malformed",reason:'frame has no string "type"'}:e.has(r)?{kind:"ok",frame:t}:{kind:"unknown",type:r,protocolVersion:LG(t.protocol_version)}}function Fb(t){if(typeof t!="object"||t===null||typeof t.type=="string")return null;let e=t.error;return typeof e!="string"||e===""?null:{unknown_model:"That model is not available on Aii Cloud. Pick a model from your cloud dashboard (cloud.aiiware.com) or run with --local.",insufficient_credits:"Out of Aii Cloud credits.",quota_exceeded:"Daily free-tier budget reached on Aii Cloud.",quota_check_failed:"Aii Cloud could not verify your quota \u2014 please retry.",worker_unavailable:"Aii Cloud is temporarily unavailable \u2014 please retry, or run with --local."}[e]??`Aii Cloud error: ${e}`}function mu(t){switch((t??"").toLowerCase()){case"quota_exceeded":case"insufficient_credits":return"budget_exhausted";case"worker_unavailable":case"quota_check_failed":return"transient";default:return"fatal"}}function $b(t){if(!t)return null;try{let e=JSON.parse(t);if(e&&typeof e.error=="string")return e.error}catch{}return t}function KR(t){return t==null||typeof t=="object"}function Bb(t){switch(t.type){case"tool_request":return KR(t.input);case"mcp_tool_request":return KR(t.params);case"tool_batch_request":{let e=t.tools;return e==null||Array.isArray(e)&&e.every(r=>r==null||typeof r=="object"&&KR(r.input))}default:return!0}}function Gb(t){return LG(t)>2?"hard":"compatible"}function zb(t){return`This Aii Server speaks protocol v${t}, but your CLI speaks v2. Some responses may not work correctly. Update with: aii upgrade`}var xn,FG,$G,Ub,xl=k(()=>{"use strict";xn=class extends Error{wireCode;origin;code="CLOUD_EXHAUSTED";constructor(e,r){super("cloud_exhausted"),this.wireCode=e,this.origin=r,this.name="CloudExhaustedError"}};FG=new Set(["token","complete","error","purpose_ack","mcp_query_tools","mcp_tool_request","reasoning","reasoning_label","web_search_started","web_search_completed","follow_ups","task.step.updated","task.artifact.added"]),$G=new Set(["session_started","turn_ready","token","iteration_tokens_usage","tool_request","tool_batch_request","tool_status","complete","error","mcp_tools_loaded","permission_request","permission_resolution","mcp_query_tools","mcp_tool_request","reasoning","reasoning_label","web_search_started","web_search_completed","follow_ups","task.step.updated","task.artifact.added"]),Ub=new Set(["tool_request","tool_batch_request","mcp_tool_request"])});var eCe,tCe,rCe,nCe,sCe,oCe,iCe,fu,Hb,Ml,VR=k(()=>{"use strict";ye();eCe={name:"classic",label:"Classic",description:"Aii jellyfish blue-purple (default)",accentColorName:"#3B82F6",userInputTextColorName:"#93C5FD",colors:{accent:m.hex("#3B82F6"),userInput:m.hex("#3B82F6"),userInputText:m.hex("#93C5FD"),success:m.hex("#22C55E"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#A855F7"),link:m.hex("#3B82F6").underline,heading:m.hex("#A855F7").bold,filePath:m.hex("#3B82F6"),indicator:m.hex("#3B82F6")}},tCe={name:"brand",label:"Brand",description:"aiiware.com official palette",accentColorName:"#4E6BF5",userInputTextColorName:"#A5B4FC",colors:{accent:m.hex("#4E6BF5"),userInput:m.hex("#4E6BF5"),userInputText:m.hex("#A5B4FC"),success:m.hex("#28CA41"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#4E6BF5"),link:m.hex("#4E6BF5").underline,heading:m.hex("#4E6BF5").bold,filePath:m.hex("#4E6BF5"),indicator:m.hex("#4E6BF5")}},rCe={name:"teal",label:"Teal",description:"Original teal accent",accentColorName:"#00BCD4",userInputTextColorName:"#67E8F9",colors:{accent:m.hex("#00BCD4"),userInput:m.hex("#00BCD4"),userInputText:m.hex("#67E8F9"),success:m.hex("#22C55E"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#00BCD4"),link:m.hex("#00BCD4").underline,heading:m.hex("#00BCD4").bold,filePath:m.hex("#00BCD4"),indicator:m.hex("#00BCD4")}},nCe={name:"indigo",label:"Indigo",description:"Bright periwinkle-blue",accentColorName:"#6B8AFF",userInputTextColorName:"#A5B4FC",colors:{accent:m.hex("#6B8AFF"),userInput:m.hex("#6B8AFF"),userInputText:m.hex("#A5B4FC"),success:m.hex("#28CA41"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#6B8AFF"),link:m.hex("#6B8AFF").underline,heading:m.hex("#6B8AFF").bold,filePath:m.hex("#6B8AFF"),indicator:m.hex("#6B8AFF")}},sCe={name:"forest",label:"Forest",description:"Natural green",accentColorName:"#22C55E",userInputTextColorName:"#86EFAC",colors:{accent:m.hex("#22C55E"),userInput:m.hex("#22C55E"),userInputText:m.hex("#86EFAC"),success:m.hex("#22C55E"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#22C55E"),link:m.hex("#22C55E").underline,heading:m.hex("#22C55E").bold,filePath:m.hex("#22C55E"),indicator:m.hex("#22C55E")}},oCe={name:"amber",label:"Amber",description:"Warm orange-gold",accentColorName:"#F59E0B",userInputTextColorName:"#FCD34D",colors:{accent:m.hex("#F59E0B"),userInput:m.hex("#F59E0B"),userInputText:m.hex("#FCD34D"),success:m.hex("#22C55E"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#F59E0B"),link:m.hex("#F59E0B").underline,heading:m.hex("#F59E0B").bold,filePath:m.hex("#F59E0B"),indicator:m.hex("#F59E0B")}},iCe={name:"grayscale",label:"Grayscale",description:"Accessible, no colors",accentColorName:"white",userInputTextColorName:"#CBD5E1",colors:{accent:m.reset,userInput:m.reset,userInputText:m.hex("#CBD5E1"),success:m.reset,warning:m.reset,error:m.bold,muted:m.dim,dim:m.dim,code:m.reset,link:m.underline,heading:m.bold,filePath:m.reset,indicator:m.bold}},fu={classic:eCe,brand:tCe,teal:rCe,indigo:nCe,forest:sCe,amber:oCe,grayscale:iCe},Hb="classic",Ml=["classic","brand","teal","indigo","forest","amber","grayscale"]});var hu={};ie(hu,{BAND_STYLE_INFO:()=>zg,BAND_STYLE_ORDER:()=>Pl,DEFAULT_BAND_STYLE:()=>XR,ThemeManager:()=>Ro,getAccentColorName:()=>De,getThemeColors:()=>H,getUserInputTextColorName:()=>zp,resolveBandBg:()=>Gp});function Gp(t,e){let r=zg[t];if(r.blend===null)return aCe;let n=/^#[0-9a-fA-F]{6}$/.test(e)?e:"#8B98A9",s=parseInt(n.replace("#",""),16),o=r.blend,i=(a,l)=>Math.round(a*o+l*(1-o));return"#"+(i(s>>16&255,QR[0])<<16|i(s>>8&255,QR[1])<<8|i(s&255,QR[2])).toString(16).padStart(6,"0")}function H(){return Ro.getInstance().getColors()}function De(){return Ro.getInstance().getAccentColorName()}function zp(){return Ro.getInstance().getUserInputTextColorName()}var Pl,zg,XR,QR,aCe,Ro,Ll=k(()=>{"use strict";VR();Qe();Pl=["subtle","themed","neutral","bold"],zg={subtle:{blend:.16,description:"Faint theme tint \u2014 quietest"},themed:{blend:.28,description:"Theme-tinted band (default)"},neutral:{blend:null,description:"Fixed neutral gray (theme-independent)"},bold:{blend:.4,description:"Strong theme tint \u2014 selection-like"}},XR="themed",QR=[20,22,27],aCe="#262C34";Ro=class t{static instance=null;activeTheme;bandStyle=null;constructor(){this.activeTheme=fu[Hb]}static getInstance(){return t.instance||(t.instance=new t),t.instance}getTheme(){return this.activeTheme}getColors(){return this.activeTheme.colors}getThemeName(){return this.activeTheme.name}setTheme(e){let r=fu[e];if(!r){let n=Ml.join(", ");throw new Error(`Unknown theme: "${e}". Available themes: ${n}`)}this.activeTheme=r}isValidTheme(e){return e in fu}getAvailableThemes(){return Ml.map(e=>fu[e])}getAccentColorName(){return this.activeTheme.accentColorName}getUserInputTextColorName(){return this.activeTheme.userInputTextColorName}getBandStyle(){if(this.bandStyle)return this.bandStyle;try{let e=Se().get("theme_band");if(e&&this.isValidBandStyle(e))return this.bandStyle=e,this.bandStyle}catch{}return this.bandStyle=XR,this.bandStyle}setBandStyle(e){if(!this.isValidBandStyle(e))throw new Error(`Unknown band style: "${e}". Available: ${Pl.join(", ")}`);this.bandStyle=e}isValidBandStyle(e){return Pl.includes(e)}reset(){this.activeTheme=fu[Hb],this.bandStyle=null}}});var mt=k(()=>{"use strict";VR();Ll()});import{resolve as lCe}from"path";function cCe(){let t=process.env.TERM??"",e=process.env.TERM_PROGRAM??"",r=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",s=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return e==="iTerm.app"||e==="Hyper"||e==="vscode"||e==="WezTerm"||e==="Alacritty"||n||s||t.includes("xterm-256color")||t.includes("screen-256color")||t.includes("tmux")||t==="xterm-kitty"||r==="truecolor"?!0:!(t==="dumb"||!process.stdout.isTTY)}function Hg(){return JR===null&&(JR=cCe()),JR}function uCe(){return process.platform==="darwin"?"Cmd":"Ctrl"}function BG(){return UG||!Hg()?"":(UG=!0,` (${uCe()}+Click to open)`)}function dCe(t,e){return Hg()?`\x1B]8;;${e}\x07${t}\x1B]8;;\x07`:t}function GG(t,e){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;r&&t.startsWith(r)&&(n="~"+t.slice(r.length));let s=e?`${n}:${e}`:n;if(!Hg())return H().filePath(s);let o=H().accent(s),a=`file://${lCe(t)}`;return e!==void 0&&e>0&&(a+=`#L${e}`),dCe(o,a)}var JR,UG,zG=k(()=>{"use strict";mt();JR=null,UG=!1});var jG={};ie(jG,{VERSION:()=>gu,colors:()=>F,formatCode:()=>SCe,formatPath:()=>jg,getActionIndicator:()=>yCe,padEndAnsi:()=>CCe,printAction:()=>pCe,printDivider:()=>qG,printError:()=>_Ce,printExitSummary:()=>eN,printHeader:()=>ECe,printSuccess:()=>hCe,printToolComplete:()=>mCe,printToolFailed:()=>fCe,printToolResultCompact:()=>Fl,printWarning:()=>gCe,shortenPath:()=>TCe});function qg(t){return t.startsWith("/")||t.startsWith("~/")||t.startsWith("./")||t.startsWith("../")||/^[a-zA-Z]:\\/.test(t)||/\.(ts|tsx|js|jsx|json|md|py|go|rs|java|c|cpp|h|hpp|css|scss|html|xml|yaml|yml|toml|sh|bash|zsh)$/.test(t)||/^src\//.test(t)||/^lib\//.test(t)||/^test[s]?\//.test(t)}function pCe(t,e,r=console.log){let n=qg(e)?jg(e):F.filePath(e);r(F.dim("\u25CB ")+m.bold(t)+" "+n)}function mCe(t,e,r=console.log){let n=qg(e)?jg(e):F.filePath(e);r(F.success("\u2713 ")+m.bold(t)+" "+n)}function fCe(t,e,r,n=console.log){let s=qg(e)?jg(e):F.filePath(e);n(F.error("\u2717 ")+m.bold(t)+" "+s),r&&n(F.dim(" \u2192 ")+F.error(r))}function Fl(t,e,r=!0,n,s=console.log,o=!0){let i=r?F.success("\u25CF"):F.error("\u25CF"),a=60,l=e.length>a?e.slice(0,a-3)+"...":e;if(qg(e)){let d=e.match(/:(\d+)$/),p=d?parseInt(d[1],10):void 0,h=d?e.replace(/:(\d+)$/,""):e;l=jg(h,p)}s(`${i} ${m.bold(t)}(${l})`);let c=o&&qg(e)?F.dim(BG()):"",u=o&&!c&&!HG?F.dim(" (ctrl+o to expand)"):"";if(u&&(HG=!0),n){let d=r?F.dim:F.error;s(d(`\u2514 ${n}`)+c+u)}else{let d=r?"(No content)":"(Error)",p=r?F.dim:F.error;s(p(`\u2514 ${d}`)+c+u)}}function hCe(t){console.log(F.success("\u2713 ")+t)}function gCe(t){console.log(F.warning("\u26A0 ")+t)}function _Ce(t){console.log(F.error("\u2717 ")+t)}function qG(t=60){console.log(F.dim("\u2500".repeat(t)))}function ECe(t){console.log(F.logo(t)),qG(t.length)}function yCe(t){return F.thinking(`[${t}]`)}function jg(t,e){if(Hg())return GG(t,e);let r=process.env.HOME??process.env.USERPROFILE??"",n=t;return r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),e&&(n+=`:${e}`),F.filePath(n)}function SCe(t){return F.code(t)}function bCe(){return process.stdout.columns||80}function TCe(t,e=40){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;if(r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),n.length<=e)return n;let s=n.split("/").filter(i=>i.length>0);if(s.length>=2){let i=s.slice(-2).join("/");if(i.length<=e-4)return".../"+i}return".../"+(s[s.length-1]||s[s.length-2])}function wCe(t){return t.replace(/\x1b\[[0-9;]*m/g,"").length}function CCe(t,e){let r=wCe(t),n=Math.max(0,e-r);return t+" ".repeat(n)}function vCe(t){if(t<60)return`${t}s`;let e=Math.floor(t/60),r=t%60;return r>0?`${e}m ${r}s`:`${e}m`}function ZR(t){return t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function eN(t){let e=bCe(),r=Math.min(e-2,76),n=r-4,s=(_,E)=>{let y=_.replace(/\x1b\[[0-9;]*m/g,"").length;return _+" ".repeat(Math.max(0,E-y))},o=_=>F.border("\u2502")+" "+s(_,n)+" "+F.border("\u2502"),i=(_,E,y,S)=>{let T=Math.floor(n/2),C=F.dim(_.padEnd(15))+E,v=F.dim(y.padEnd(15))+S;return o(s(C,T)+v)},a=vCe(t.durationSeconds),l=ZR(t.tokensIn),c=ZR(t.tokensOut),u=`$${t.totalCost.toFixed(4)}`,d=t.cloud?`\u2601\uFE0F Cloud \xB7 ${t.model}`:`${t.provider}/${t.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(F.border("\u250C"+"\u2500".repeat(r-2)+"\u2510")),console.log(o(F.logo("Session complete. \u{1FABC}"))),console.log(F.border("\u251C"+"\u2500".repeat(r-2)+"\u2524")),console.log(o(F.logo("Session Summary"))),console.log(o(F.dim("\u2500".repeat(15)))),console.log(i("Duration",a,"Tool Calls",t.toolCalls.toString())),console.log(i("Turns",t.turns.toString(),"Files Modified",t.filesModified.toString())),console.log(o("")),console.log(o(F.logo("Token Usage"))),console.log(o(F.dim("\u2500".repeat(11)))),console.log(i("Input",l,"Output",c));let p=t.cachedTokens??0;if(p>0){let _=Math.min(100,Math.round(100*p/Math.max(1,t.tokensIn)));console.log(o(F.dim("Cached".padEnd(15))+`${ZR(p)} (${_}%)`))}let h=t.cacheSavings??0,f=h>0?F.dim(` \xB7 saved ~$${h.toFixed(4)} by prompt caching`):"";console.log(o(F.dim("Cost".padEnd(15))+u+f)),console.log(o(""));let g=(_,E)=>_.length>E?`${_.slice(0,Math.max(0,E-1))}\u2026`:_;if(t.goalLine){let _=t.goalLine.replace(/^Goal:\s*/,"");console.log(o(F.dim("Goal: ")+g(_,n-6)))}t.goalResumeLine&&console.log(o(F.dim(g(` ${t.goalResumeLine}`,n)))),console.log(o(F.dim("Model: ")+F.model(d))),console.log(F.border("\u2514"+"\u2500".repeat(r-2)+"\u2518")),console.log("")}var gu,F,HG,hr=k(()=>{"use strict";ye();zG();mt();gu="0.22.2",F={get logo(){return H().accent.bold},get prompt(){return H().accent.bold},get model(){return H().accent},get success(){return H().success},get warning(){return H().warning},get error(){return H().error},get thinking(){return H().dim},get filePath(){return H().filePath},get code(){return H().code},get muted(){return H().muted},get dim(){return H().dim},get safe(){return H().success},get risky(){return H().warning},get destructive(){return H().error},get border(){return H().accent},get bannerBorder(){return H().accent}};HG=!1});function _u({onlyFirst:t=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,t?void 0:"g")}var qb=k(()=>{});function tN(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(kCe,"")}var kCe,YG=k(()=>{qb();kCe=_u()});function WG(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function KG(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function VG(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}var QG=k(()=>{});function ACe(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function XG(t,{ambiguousAsWide:e=!1}={}){return ACe(t),KG(t)||VG(t)||e&&WG(t)?2:1}var JG=k(()=>{QG()});var ez=w((Jnt,ZG)=>{ZG.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});function Hp(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=tN(t)),t.length===0)return 0;let s=0,o={ambiguousAsWide:!r};for(let{segment:i}of ICe.segment(t)){let a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!DCe.test(i)){if((0,tz.default)().test(i)){s+=2;continue}s+=XG(a,o)}}return s}var tz,ICe,DCe,rN=k(()=>{YG();JG();tz=Dt(ez(),1),ICe=new Intl.Segmenter,DCe=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});var $s,qp,nN=k(()=>{"use strict";$s={maxConcurrent:5,maxIterations:100,timeout:3e5,autoBackgroundTimeout:12e4,compressionLevel:"medium",permissionMode:"default"},qp={maxConcurrent:3,timeout:30*60*1e3,permissionMode:"dontAsk"}});var jb,sN=k(()=>{"use strict";jb=`You are an expert codebase explorer. Your task is to efficiently explore and understand codebases.
222
+ `),n(p.verify_url),i(" Waiting for authentication... (press Ctrl+C to cancel)");let h=Math.max(1,p.interval||2)*1e3,f=Zwe(p.expires_at,o());for(;;){try{let g=await c(p.poll_url);if(g.ok){let _=JSON.parse(g.text);if(_.status==="completed"&&_.api_key)return{apiKey:_.api_key};if(_.status==="expired")throw new da("The sign-in code expired. Run the command again to retry.")}}catch(g){if(g instanceof da)throw g}if(o()>=f)throw new da("Timed out waiting for sign-in. Run the command again to retry.");await s(h)}}var da,Qwe,Ol=k(()=>{"use strict";da=class extends Error{constructor(e){super(e),this.name="DeviceAuthError"}},Qwe=3e5});function LG(t){return typeof t=="number"&&Number.isInteger(t)&&t>0?t:1}function Lb(t,e){if(typeof t!="object"||t===null)return{kind:"malformed",reason:"frame is not an object"};let r=t.type;return typeof r!="string"?{kind:"malformed",reason:'frame has no string "type"'}:e.has(r)?{kind:"ok",frame:t}:{kind:"unknown",type:r,protocolVersion:LG(t.protocol_version)}}function Fb(t){if(typeof t!="object"||t===null||typeof t.type=="string")return null;let e=t.error;return typeof e!="string"||e===""?null:{unknown_model:"That model is not available on Aii Cloud. Pick a model from your cloud dashboard (cloud.aiiware.com) or run with --local.",insufficient_credits:"Out of Aii Cloud credits.",quota_exceeded:"Daily free-tier budget reached on Aii Cloud.",quota_check_failed:"Aii Cloud could not verify your quota \u2014 please retry.",worker_unavailable:"Aii Cloud is temporarily unavailable \u2014 please retry, or run with --local."}[e]??`Aii Cloud error: ${e}`}function mu(t){switch((t??"").toLowerCase()){case"quota_exceeded":case"insufficient_credits":return"budget_exhausted";case"worker_unavailable":case"quota_check_failed":return"transient";default:return"fatal"}}function $b(t){if(!t)return null;try{let e=JSON.parse(t);if(e&&typeof e.error=="string")return e.error}catch{}return t}function KR(t){return t==null||typeof t=="object"}function Bb(t){switch(t.type){case"tool_request":return KR(t.input);case"mcp_tool_request":return KR(t.params);case"tool_batch_request":{let e=t.tools;return e==null||Array.isArray(e)&&e.every(r=>r==null||typeof r=="object"&&KR(r.input))}default:return!0}}function Gb(t){return LG(t)>2?"hard":"compatible"}function zb(t){return`This Aii Server speaks protocol v${t}, but your CLI speaks v2. Some responses may not work correctly. Update with: aii upgrade`}var xn,FG,$G,Ub,xl=k(()=>{"use strict";xn=class extends Error{wireCode;origin;code="CLOUD_EXHAUSTED";constructor(e,r){super("cloud_exhausted"),this.wireCode=e,this.origin=r,this.name="CloudExhaustedError"}};FG=new Set(["token","complete","error","purpose_ack","mcp_query_tools","mcp_tool_request","reasoning","reasoning_label","web_search_started","web_search_completed","follow_ups","task.step.updated","task.artifact.added"]),$G=new Set(["session_started","turn_ready","token","iteration_tokens_usage","tool_request","tool_batch_request","tool_status","complete","error","mcp_tools_loaded","permission_request","permission_resolution","mcp_query_tools","mcp_tool_request","reasoning","reasoning_label","web_search_started","web_search_completed","follow_ups","task.step.updated","task.artifact.added"]),Ub=new Set(["tool_request","tool_batch_request","mcp_tool_request"])});var eCe,tCe,rCe,nCe,sCe,oCe,iCe,fu,Hb,Ml,VR=k(()=>{"use strict";ye();eCe={name:"classic",label:"Classic",description:"Aii jellyfish blue-purple (default)",accentColorName:"#3B82F6",userInputTextColorName:"#93C5FD",colors:{accent:m.hex("#3B82F6"),userInput:m.hex("#3B82F6"),userInputText:m.hex("#93C5FD"),success:m.hex("#22C55E"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#A855F7"),link:m.hex("#3B82F6").underline,heading:m.hex("#A855F7").bold,filePath:m.hex("#3B82F6"),indicator:m.hex("#3B82F6")}},tCe={name:"brand",label:"Brand",description:"aiiware.com official palette",accentColorName:"#4E6BF5",userInputTextColorName:"#A5B4FC",colors:{accent:m.hex("#4E6BF5"),userInput:m.hex("#4E6BF5"),userInputText:m.hex("#A5B4FC"),success:m.hex("#28CA41"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#4E6BF5"),link:m.hex("#4E6BF5").underline,heading:m.hex("#4E6BF5").bold,filePath:m.hex("#4E6BF5"),indicator:m.hex("#4E6BF5")}},rCe={name:"teal",label:"Teal",description:"Original teal accent",accentColorName:"#00BCD4",userInputTextColorName:"#67E8F9",colors:{accent:m.hex("#00BCD4"),userInput:m.hex("#00BCD4"),userInputText:m.hex("#67E8F9"),success:m.hex("#22C55E"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#00BCD4"),link:m.hex("#00BCD4").underline,heading:m.hex("#00BCD4").bold,filePath:m.hex("#00BCD4"),indicator:m.hex("#00BCD4")}},nCe={name:"indigo",label:"Indigo",description:"Bright periwinkle-blue",accentColorName:"#6B8AFF",userInputTextColorName:"#A5B4FC",colors:{accent:m.hex("#6B8AFF"),userInput:m.hex("#6B8AFF"),userInputText:m.hex("#A5B4FC"),success:m.hex("#28CA41"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#6B8AFF"),link:m.hex("#6B8AFF").underline,heading:m.hex("#6B8AFF").bold,filePath:m.hex("#6B8AFF"),indicator:m.hex("#6B8AFF")}},sCe={name:"forest",label:"Forest",description:"Natural green",accentColorName:"#22C55E",userInputTextColorName:"#86EFAC",colors:{accent:m.hex("#22C55E"),userInput:m.hex("#22C55E"),userInputText:m.hex("#86EFAC"),success:m.hex("#22C55E"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#22C55E"),link:m.hex("#22C55E").underline,heading:m.hex("#22C55E").bold,filePath:m.hex("#22C55E"),indicator:m.hex("#22C55E")}},oCe={name:"amber",label:"Amber",description:"Warm orange-gold",accentColorName:"#F59E0B",userInputTextColorName:"#FCD34D",colors:{accent:m.hex("#F59E0B"),userInput:m.hex("#F59E0B"),userInputText:m.hex("#FCD34D"),success:m.hex("#22C55E"),warning:m.hex("#EAB308"),error:m.hex("#EF4444"),muted:m.hex("#94A3B8"),dim:m.dim,code:m.hex("#F59E0B"),link:m.hex("#F59E0B").underline,heading:m.hex("#F59E0B").bold,filePath:m.hex("#F59E0B"),indicator:m.hex("#F59E0B")}},iCe={name:"grayscale",label:"Grayscale",description:"Accessible, no colors",accentColorName:"white",userInputTextColorName:"#CBD5E1",colors:{accent:m.reset,userInput:m.reset,userInputText:m.hex("#CBD5E1"),success:m.reset,warning:m.reset,error:m.bold,muted:m.dim,dim:m.dim,code:m.reset,link:m.underline,heading:m.bold,filePath:m.reset,indicator:m.bold}},fu={classic:eCe,brand:tCe,teal:rCe,indigo:nCe,forest:sCe,amber:oCe,grayscale:iCe},Hb="classic",Ml=["classic","brand","teal","indigo","forest","amber","grayscale"]});var hu={};ie(hu,{BAND_STYLE_INFO:()=>zg,BAND_STYLE_ORDER:()=>Pl,DEFAULT_BAND_STYLE:()=>XR,ThemeManager:()=>Ro,getAccentColorName:()=>De,getThemeColors:()=>H,getUserInputTextColorName:()=>zp,resolveBandBg:()=>Gp});function Gp(t,e){let r=zg[t];if(r.blend===null)return aCe;let n=/^#[0-9a-fA-F]{6}$/.test(e)?e:"#8B98A9",s=parseInt(n.replace("#",""),16),o=r.blend,i=(a,l)=>Math.round(a*o+l*(1-o));return"#"+(i(s>>16&255,QR[0])<<16|i(s>>8&255,QR[1])<<8|i(s&255,QR[2])).toString(16).padStart(6,"0")}function H(){return Ro.getInstance().getColors()}function De(){return Ro.getInstance().getAccentColorName()}function zp(){return Ro.getInstance().getUserInputTextColorName()}var Pl,zg,XR,QR,aCe,Ro,Ll=k(()=>{"use strict";VR();Qe();Pl=["subtle","themed","neutral","bold"],zg={subtle:{blend:.16,description:"Faint theme tint \u2014 quietest"},themed:{blend:.28,description:"Theme-tinted band (default)"},neutral:{blend:null,description:"Fixed neutral gray (theme-independent)"},bold:{blend:.4,description:"Strong theme tint \u2014 selection-like"}},XR="themed",QR=[20,22,27],aCe="#262C34";Ro=class t{static instance=null;activeTheme;bandStyle=null;constructor(){this.activeTheme=fu[Hb]}static getInstance(){return t.instance||(t.instance=new t),t.instance}getTheme(){return this.activeTheme}getColors(){return this.activeTheme.colors}getThemeName(){return this.activeTheme.name}setTheme(e){let r=fu[e];if(!r){let n=Ml.join(", ");throw new Error(`Unknown theme: "${e}". Available themes: ${n}`)}this.activeTheme=r}isValidTheme(e){return e in fu}getAvailableThemes(){return Ml.map(e=>fu[e])}getAccentColorName(){return this.activeTheme.accentColorName}getUserInputTextColorName(){return this.activeTheme.userInputTextColorName}getBandStyle(){if(this.bandStyle)return this.bandStyle;try{let e=Se().get("theme_band");if(e&&this.isValidBandStyle(e))return this.bandStyle=e,this.bandStyle}catch{}return this.bandStyle=XR,this.bandStyle}setBandStyle(e){if(!this.isValidBandStyle(e))throw new Error(`Unknown band style: "${e}". Available: ${Pl.join(", ")}`);this.bandStyle=e}isValidBandStyle(e){return Pl.includes(e)}reset(){this.activeTheme=fu[Hb],this.bandStyle=null}}});var mt=k(()=>{"use strict";VR();Ll()});import{resolve as lCe}from"path";function cCe(){let t=process.env.TERM??"",e=process.env.TERM_PROGRAM??"",r=process.env.COLORTERM??"",n=process.env.WT_SESSION??"",s=process.env.VSCODE_INJECTION??process.env.TERM_PROGRAM==="vscode";return e==="iTerm.app"||e==="Hyper"||e==="vscode"||e==="WezTerm"||e==="Alacritty"||n||s||t.includes("xterm-256color")||t.includes("screen-256color")||t.includes("tmux")||t==="xterm-kitty"||r==="truecolor"?!0:!(t==="dumb"||!process.stdout.isTTY)}function Hg(){return JR===null&&(JR=cCe()),JR}function uCe(){return process.platform==="darwin"?"Cmd":"Ctrl"}function BG(){return UG||!Hg()?"":(UG=!0,` (${uCe()}+Click to open)`)}function dCe(t,e){return Hg()?`\x1B]8;;${e}\x07${t}\x1B]8;;\x07`:t}function GG(t,e){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;r&&t.startsWith(r)&&(n="~"+t.slice(r.length));let s=e?`${n}:${e}`:n;if(!Hg())return H().filePath(s);let o=H().accent(s),a=`file://${lCe(t)}`;return e!==void 0&&e>0&&(a+=`#L${e}`),dCe(o,a)}var JR,UG,zG=k(()=>{"use strict";mt();JR=null,UG=!1});var jG={};ie(jG,{VERSION:()=>gu,colors:()=>F,formatCode:()=>SCe,formatPath:()=>jg,getActionIndicator:()=>yCe,padEndAnsi:()=>CCe,printAction:()=>pCe,printDivider:()=>qG,printError:()=>_Ce,printExitSummary:()=>eN,printHeader:()=>ECe,printSuccess:()=>hCe,printToolComplete:()=>mCe,printToolFailed:()=>fCe,printToolResultCompact:()=>Fl,printWarning:()=>gCe,shortenPath:()=>TCe});function qg(t){return t.startsWith("/")||t.startsWith("~/")||t.startsWith("./")||t.startsWith("../")||/^[a-zA-Z]:\\/.test(t)||/\.(ts|tsx|js|jsx|json|md|py|go|rs|java|c|cpp|h|hpp|css|scss|html|xml|yaml|yml|toml|sh|bash|zsh)$/.test(t)||/^src\//.test(t)||/^lib\//.test(t)||/^test[s]?\//.test(t)}function pCe(t,e,r=console.log){let n=qg(e)?jg(e):F.filePath(e);r(F.dim("\u25CB ")+m.bold(t)+" "+n)}function mCe(t,e,r=console.log){let n=qg(e)?jg(e):F.filePath(e);r(F.success("\u2713 ")+m.bold(t)+" "+n)}function fCe(t,e,r,n=console.log){let s=qg(e)?jg(e):F.filePath(e);n(F.error("\u2717 ")+m.bold(t)+" "+s),r&&n(F.dim(" \u2192 ")+F.error(r))}function Fl(t,e,r=!0,n,s=console.log,o=!0){let i=r?F.success("\u25CF"):F.error("\u25CF"),a=60,l=e.length>a?e.slice(0,a-3)+"...":e;if(qg(e)){let d=e.match(/:(\d+)$/),p=d?parseInt(d[1],10):void 0,h=d?e.replace(/:(\d+)$/,""):e;l=jg(h,p)}s(`${i} ${m.bold(t)}(${l})`);let c=o&&qg(e)?F.dim(BG()):"",u=o&&!c&&!HG?F.dim(" (ctrl+o to expand)"):"";if(u&&(HG=!0),n){let d=r?F.dim:F.error;s(d(`\u2514 ${n}`)+c+u)}else{let d=r?"(No content)":"(Error)",p=r?F.dim:F.error;s(p(`\u2514 ${d}`)+c+u)}}function hCe(t){console.log(F.success("\u2713 ")+t)}function gCe(t){console.log(F.warning("\u26A0 ")+t)}function _Ce(t){console.log(F.error("\u2717 ")+t)}function qG(t=60){console.log(F.dim("\u2500".repeat(t)))}function ECe(t){console.log(F.logo(t)),qG(t.length)}function yCe(t){return F.thinking(`[${t}]`)}function jg(t,e){if(Hg())return GG(t,e);let r=process.env.HOME??process.env.USERPROFILE??"",n=t;return r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),e&&(n+=`:${e}`),F.filePath(n)}function SCe(t){return F.code(t)}function bCe(){return process.stdout.columns||80}function TCe(t,e=40){let r=process.env.HOME??process.env.USERPROFILE??"",n=t;if(r&&t.startsWith(r)&&(n="~"+t.slice(r.length)),n.length<=e)return n;let s=n.split("/").filter(i=>i.length>0);if(s.length>=2){let i=s.slice(-2).join("/");if(i.length<=e-4)return".../"+i}return".../"+(s[s.length-1]||s[s.length-2])}function wCe(t){return t.replace(/\x1b\[[0-9;]*m/g,"").length}function CCe(t,e){let r=wCe(t),n=Math.max(0,e-r);return t+" ".repeat(n)}function vCe(t){if(t<60)return`${t}s`;let e=Math.floor(t/60),r=t%60;return r>0?`${e}m ${r}s`:`${e}m`}function ZR(t){return t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function eN(t){let e=bCe(),r=Math.min(e-2,76),n=r-4,s=(_,E)=>{let y=_.replace(/\x1b\[[0-9;]*m/g,"").length;return _+" ".repeat(Math.max(0,E-y))},o=_=>F.border("\u2502")+" "+s(_,n)+" "+F.border("\u2502"),i=(_,E,y,S)=>{let T=Math.floor(n/2),C=F.dim(_.padEnd(15))+E,v=F.dim(y.padEnd(15))+S;return o(s(C,T)+v)},a=vCe(t.durationSeconds),l=ZR(t.tokensIn),c=ZR(t.tokensOut),u=`$${t.totalCost.toFixed(4)}`,d=t.cloud?`\u2601\uFE0F Cloud \xB7 ${t.model}`:`${t.provider}/${t.model.replace("claude-","").replace("-latest","")}`;console.log(""),console.log(F.border("\u250C"+"\u2500".repeat(r-2)+"\u2510")),console.log(o(F.logo("Session complete. \u{1FABC}"))),console.log(F.border("\u251C"+"\u2500".repeat(r-2)+"\u2524")),console.log(o(F.logo("Session Summary"))),console.log(o(F.dim("\u2500".repeat(15)))),console.log(i("Duration",a,"Tool Calls",t.toolCalls.toString())),console.log(i("Turns",t.turns.toString(),"Files Modified",t.filesModified.toString())),console.log(o("")),console.log(o(F.logo("Token Usage"))),console.log(o(F.dim("\u2500".repeat(11)))),console.log(i("Input",l,"Output",c));let p=t.cachedTokens??0;if(p>0){let _=Math.min(100,Math.round(100*p/Math.max(1,t.tokensIn)));console.log(o(F.dim("Cached".padEnd(15))+`${ZR(p)} (${_}%)`))}let h=t.cacheSavings??0,f=h>0?F.dim(` \xB7 saved ~$${h.toFixed(4)} by prompt caching`):"";console.log(o(F.dim("Cost".padEnd(15))+u+f)),console.log(o(""));let g=(_,E)=>_.length>E?`${_.slice(0,Math.max(0,E-1))}\u2026`:_;if(t.goalLine){let _=t.goalLine.replace(/^Goal:\s*/,"");console.log(o(F.dim("Goal: ")+g(_,n-6)))}t.goalResumeLine&&console.log(o(F.dim(g(` ${t.goalResumeLine}`,n)))),console.log(o(F.dim("Model: ")+F.model(d))),console.log(F.border("\u2514"+"\u2500".repeat(r-2)+"\u2518")),console.log("")}var gu,F,HG,hr=k(()=>{"use strict";ye();zG();mt();gu="0.22.3",F={get logo(){return H().accent.bold},get prompt(){return H().accent.bold},get model(){return H().accent},get success(){return H().success},get warning(){return H().warning},get error(){return H().error},get thinking(){return H().dim},get filePath(){return H().filePath},get code(){return H().code},get muted(){return H().muted},get dim(){return H().dim},get safe(){return H().success},get risky(){return H().warning},get destructive(){return H().error},get border(){return H().accent},get bannerBorder(){return H().accent}};HG=!1});function _u({onlyFirst:t=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,t?void 0:"g")}var qb=k(()=>{});function tN(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(kCe,"")}var kCe,YG=k(()=>{qb();kCe=_u()});function WG(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function KG(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function VG(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t>=94192&&t<=94198||t>=94208&&t<=101589||t>=101631&&t<=101662||t>=101760&&t<=101874||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128728||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129674||t>=129678&&t<=129734||t===129736||t>=129741&&t<=129756||t>=129759&&t<=129770||t>=129775&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}var QG=k(()=>{});function ACe(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function XG(t,{ambiguousAsWide:e=!1}={}){return ACe(t),KG(t)||VG(t)||e&&WG(t)?2:1}var JG=k(()=>{QG()});var ez=w((Jnt,ZG)=>{ZG.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});function Hp(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=tN(t)),t.length===0)return 0;let s=0,o={ambiguousAsWide:!r};for(let{segment:i}of ICe.segment(t)){let a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!DCe.test(i)){if((0,tz.default)().test(i)){s+=2;continue}s+=XG(a,o)}}return s}var tz,ICe,DCe,rN=k(()=>{YG();JG();tz=Dt(ez(),1),ICe=new Intl.Segmenter,DCe=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});var $s,qp,nN=k(()=>{"use strict";$s={maxConcurrent:5,maxIterations:100,timeout:3e5,autoBackgroundTimeout:12e4,compressionLevel:"medium",permissionMode:"default"},qp={maxConcurrent:3,timeout:30*60*1e3,permissionMode:"dontAsk"}});var jb,sN=k(()=>{"use strict";jb=`You are an expert codebase explorer. Your task is to efficiently explore and understand codebases.
223
223
 
224
224
  ## Core Capabilities
225
225
  You have access to these tools for codebase exploration:
@@ -1011,7 +1011,7 @@ Create ${e.projectConfigPath||".aii/hooks.json"} to add custom hooks.`;let r=[];
1011
1011
 
1012
1012
  [System] Consider verifying your recent changes (e.g., run tests) before continuing.`,Hs().resetConsecutiveCompletions()),this.success(n,u)}formatAction(e){let r=e.id??"",n=e.status??"";return n?`${r} \u2192 ${n}`:r}}});var Om,aH=k(()=>{"use strict";gr();Dm();Om=class extends Ge{name="TaskList";get description(){return"List all current tasks with their status. Read-only \u2014 use to check progress when context is long."}permissionLevel="SAFE";inputSchema={type:"object",properties:{}};async execute(e,r){let n=e._callId||`tasklist_${Date.now()}`,s=Hs().getTasks();return this.success(n,JSON.stringify({tasks:s}))}formatAction(){let e=Hs().getTasks().length;return`${e} task${e!==1?"s":""}`}}});var Lx=k(()=>{"use strict";X7();iH();aH()});function lH(t){return(t||24)-1}function z_(t){return Math.max(0,(t??24)-1)}function u0(t,e){return Math.min(t,e)}function cH(t,e){return t.length>e?t.slice(t.length-e):t}function uH(t,e,r){return Math.min(Math.max(t,e),z_(r))}var dH=k(()=>{"use strict"});function d0(t){return(t??"").replace(/\x1b\[[0-9;:<=>?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]|\x1b/g,e=>/^\x1b\[[0-9;:<=>?]*[ -/]*m$/.test(e)?e:"").replace(/[\x00-\x08\x0b-\x1a\x1c-\x1f\x7f]/g,"")}function H_(t){return d0(t).replace(/[\r\n\t]+/g," ")}function ZAe(t,e){if(t.length<=e)return t;if(e<=3)return t.slice(0,Math.max(0,e));let r=e-3,n=Math.ceil(r/2),s=r-n,o=t.length-n-s;return[...t.slice(0,n),"",` ... ${o} lines hidden ...`,"",...t.slice(t.length-s)]}function pH(t,e){if(e<=0)return"";if(t.length<=e)return t;let r=0,n="",s=0,o=!1,i=!1;for(;s<t.length;){if(t[s]==="\x1B"){let a=/^\x1b\[[0-9;:<=>?]*[ -/]*[@-~]/.exec(t.slice(s));if(a){n+=a[0],i=!0,s+=a[0].length;continue}}if(r>=e){o=!0;break}n+=t[s],r++,s++}return o&&i&&!n.endsWith("\x1B[0m")&&(n+="\x1B[0m"),n}function gH(t,e,r,n,s){let i=`-- [${`${e+1}/${r}`}] ${H_(t.toolName)}(${H_(t.target)}) -- (ctrl+o to close, up/down to navigate) --`,a="-".repeat(48),l=d0(t.output).split(`
1013
1013
  `);if(l.length>50){let c=l.length-25-25;l=[...l.slice(0,25),"",` ... ${c} lines hidden ...`,"",...l.slice(l.length-25)]}return l=ZAe(l,Math.max(1,n-2)),l=l.map(c=>pH(c,s)),[pH(i,s),...l,a].join(`
1014
- `)}var mH,fH,hH,p0=k(()=>{"use strict";mH="\x1B[?1049h\x1B[H",fH="\x1B[?1049l",hH="\x1B[2J\x1B[H"});var m0={};ie(m0,{getUIStore:()=>nt,useUIStore:()=>es});import{create as eIe}from"zustand";var _H,es,nt,tc=k(()=>{"use strict";_H={mode:"welcome",agentMode:"normal",status:"",isThinking:!1,isStreaming:!1,currentIteration:0,iterationStartTime:Date.now(),iterationTokens:0,contextPercent:0,contextLevel:"normal",contextTokens:0,contextLimit:2e5,sessionCost:0,freeBudgetRemaining:null,goalSegment:"",goalTurnActive:!1,sessionTokensIn:0,sessionCachedTokens:0,provider:"",model:"",openrouterProvider:"",connectionMode:"local",projectPath:process.cwd(),branch:void 0,worktreeName:void 0,baseBranch:void 0,soulName:"",personaName:"",toolsCount:0,mcpServersCount:0,mcpFailedCount:0,contextFilesCount:0,skillsCount:0,sessionStartTime:Date.now(),agentExecMs:0,agentTurnStartTime:null,renderEpoch:0,loopMode:!1,loopStartTime:null,loopMaxIterations:0,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0,loopPaused:!1,loopPauseUntil:null,loopDurationSeconds:0},es=eIe(t=>({..._H,setMode:e=>t({mode:e}),setAgentMode:e=>t({agentMode:e}),setStatus:e=>t({status:e}),setThinking:e=>t({isThinking:e}),setStreaming:e=>t(r=>{if(e&&!r.agentTurnStartTime)return{isStreaming:e,agentTurnStartTime:Date.now()};if(!e&&r.agentTurnStartTime){let n=Date.now()-r.agentTurnStartTime;return{isStreaming:e,agentExecMs:r.agentExecMs+n,agentTurnStartTime:null}}return{isStreaming:e}}),incrementIteration:()=>t(e=>({currentIteration:e.currentIteration+1,iterationStartTime:Date.now(),iterationTokens:0})),addIterationTokens:e=>t(r=>({iterationTokens:r.iterationTokens+e})),setIterationTokens:e=>t({iterationTokens:e}),updateContext:(e,r)=>{let n=r>0?Math.round(e/r*100):0,s=n>=90?"critical":n>=70?"warning":"normal";t({contextTokens:e,contextLimit:r,contextPercent:n,contextLevel:s})},updateSession:e=>t(e),updateResources:e=>t(e),setLoopMode:e=>t(e?{loopMode:e}:{loopMode:e,loopStartTime:null,loopMaxIterations:0,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0,loopPaused:!1,loopPauseUntil:null,loopDurationSeconds:0}),startLoop:(e,r)=>t({loopStartTime:e,loopMaxIterations:r,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0}),updateLoopStats:(e,r,n,s)=>t({loopTotalInputTokens:e,loopTotalOutputTokens:r,loopCost:n,loopToolCalls:s}),setLoopIteration:e=>t({loopCurrentIteration:e}),setLoopPaused:(e,r)=>t({loopPaused:e,loopPauseUntil:r}),setLoopDurationSeconds:e=>t({loopDurationSeconds:e}),incrementRenderEpoch:()=>t(e=>({renderEpoch:e.renderEpoch+1})),reset:()=>t(_H)})),nt=es.getState});function Bx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function wH(t){Lu=t}function pt(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(s,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(Ln.caret,"$1"),r=r.replace(s,i),n},getRegex:()=>new RegExp(r,e)};return n}function Ti(t,e){if(e){if(Ln.escapeTest.test(t))return t.replace(Ln.escapeReplace,yH)}else if(Ln.escapeTestNoEncode.test(t))return t.replace(Ln.escapeReplaceNoEncode,yH);return t}function SH(t){try{t=encodeURI(t).replace(Ln.percentDecode,"%")}catch{return null}return t}function bH(t,e){let r=t.replace(Ln.findPipe,(o,i,a)=>{let l=!1,c=i;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(Ln.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(Ln.slashPipe,"|");return n}function j_(t,e,r){let n=t.length;if(n===0)return"";let s=0;for(;s<n;){let o=t.charAt(n-s-1);if(o===e&&!r)s++;else if(o!==e&&r)s++;else break}return t.slice(0,n-s)}function MIe(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function TH(t,e,r,n,s){let o=e.href,i=e.title||null,a=t[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:i,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,l}function PIe(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
1014
+ `)}var mH,fH,hH,p0=k(()=>{"use strict";mH="\x1B[?1049h\x1B[H",fH="\x1B[?1049l",hH="\x1B[2J\x1B[H"});var m0={};ie(m0,{getUIStore:()=>et,useUIStore:()=>es});import{create as eIe}from"zustand";var _H,es,et,tc=k(()=>{"use strict";_H={mode:"welcome",agentMode:"normal",status:"",isThinking:!1,isStreaming:!1,currentIteration:0,iterationStartTime:Date.now(),iterationTokens:0,contextPercent:0,contextLevel:"normal",contextTokens:0,contextLimit:2e5,sessionCost:0,freeBudgetRemaining:null,goalSegment:"",goalTurnActive:!1,sessionTokensIn:0,sessionCachedTokens:0,provider:"",model:"",openrouterProvider:"",connectionMode:"local",projectPath:process.cwd(),branch:void 0,worktreeName:void 0,baseBranch:void 0,soulName:"",personaName:"",toolsCount:0,mcpServersCount:0,mcpFailedCount:0,contextFilesCount:0,skillsCount:0,sessionStartTime:Date.now(),agentExecMs:0,agentTurnStartTime:null,renderEpoch:0,loopMode:!1,loopStartTime:null,loopMaxIterations:0,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0,loopPaused:!1,loopPauseUntil:null,loopDurationSeconds:0},es=eIe(t=>({..._H,setMode:e=>t({mode:e}),setAgentMode:e=>t({agentMode:e}),setStatus:e=>t({status:e}),setThinking:e=>t({isThinking:e}),setStreaming:e=>t(r=>{if(e&&!r.agentTurnStartTime)return{isStreaming:e,agentTurnStartTime:Date.now()};if(!e&&r.agentTurnStartTime){let n=Date.now()-r.agentTurnStartTime;return{isStreaming:e,agentExecMs:r.agentExecMs+n,agentTurnStartTime:null}}return{isStreaming:e}}),incrementIteration:()=>t(e=>({currentIteration:e.currentIteration+1,iterationStartTime:Date.now(),iterationTokens:0})),addIterationTokens:e=>t(r=>({iterationTokens:r.iterationTokens+e})),setIterationTokens:e=>t({iterationTokens:e}),updateContext:(e,r)=>{let n=r>0?Math.round(e/r*100):0,s=n>=90?"critical":n>=70?"warning":"normal";t({contextTokens:e,contextLimit:r,contextPercent:n,contextLevel:s})},updateSession:e=>t(e),updateResources:e=>t(e),setLoopMode:e=>t(e?{loopMode:e}:{loopMode:e,loopStartTime:null,loopMaxIterations:0,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0,loopPaused:!1,loopPauseUntil:null,loopDurationSeconds:0}),startLoop:(e,r)=>t({loopStartTime:e,loopMaxIterations:r,loopTotalInputTokens:0,loopTotalOutputTokens:0,loopCost:0,loopToolCalls:0,loopCurrentIteration:0}),updateLoopStats:(e,r,n,s)=>t({loopTotalInputTokens:e,loopTotalOutputTokens:r,loopCost:n,loopToolCalls:s}),setLoopIteration:e=>t({loopCurrentIteration:e}),setLoopPaused:(e,r)=>t({loopPaused:e,loopPauseUntil:r}),setLoopDurationSeconds:e=>t({loopDurationSeconds:e}),incrementRenderEpoch:()=>t(e=>({renderEpoch:e.renderEpoch+1})),reset:()=>t(_H)})),et=es.getState});function Bx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function wH(t){Lu=t}function pt(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(s,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(Ln.caret,"$1"),r=r.replace(s,i),n},getRegex:()=>new RegExp(r,e)};return n}function Ti(t,e){if(e){if(Ln.escapeTest.test(t))return t.replace(Ln.escapeReplace,yH)}else if(Ln.escapeTestNoEncode.test(t))return t.replace(Ln.escapeReplaceNoEncode,yH);return t}function SH(t){try{t=encodeURI(t).replace(Ln.percentDecode,"%")}catch{return null}return t}function bH(t,e){let r=t.replace(Ln.findPipe,(o,i,a)=>{let l=!1,c=i;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(Ln.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(Ln.slashPipe,"|");return n}function j_(t,e,r){let n=t.length;if(n===0)return"";let s=0;for(;s<n;){let o=t.charAt(n-s-1);if(o===e&&!r)s++;else if(o!==e&&r)s++;else break}return t.slice(0,n-s)}function MIe(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function TH(t,e,r,n,s){let o=e.href,i=e.title||null,a=t[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:i,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,l}function PIe(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
1015
1015
  `).map(o=>{let i=o.match(r.other.beginningSpace);if(i===null)return o;let[a]=i;return a.length>=s.length?o.slice(s.length):o}).join(`
1016
1016
  `)}function gt(t,e){return Pu.parse(t,e)}var Lu,Y_,Ln,tIe,rIe,nIe,W_,sIe,Gx,CH,vH,oIe,zx,iIe,Hx,aIe,lIe,y0,qx,cIe,kH,uIe,jx,EH,dIe,pIe,mIe,fIe,AH,hIe,S0,Yx,IH,gIe,DH,_Ie,EIe,yIe,RH,SIe,bIe,NH,TIe,wIe,CIe,vIe,kIe,AIe,IIe,g0,DIe,OH,xH,RIe,Wx,NIe,Fx,OIe,f0,q_,xIe,yH,_0,Sa,E0,Kx,ba,h0,Vx,Pu,Sut,but,Tut,wut,Cut,vut,kut,MH=k(()=>{Lu=Bx();Y_={exec:()=>null};Ln={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},tIe=/^(?:[ \t]*(?:\n|$))+/,rIe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,nIe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,W_=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,sIe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gx=/(?:[*+-]|\d{1,9}[.)])/,CH=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vH=pt(CH).replace(/bull/g,Gx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),oIe=pt(CH).replace(/bull/g,Gx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zx=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,iIe=/^[^\n]+/,Hx=/(?!\s*\])(?:\\.|[^\[\]\\])+/,aIe=pt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hx).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lIe=pt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gx).getRegex(),y0="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",qx=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cIe=pt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",qx).replace("tag",y0).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kH=pt(zx).replace("hr",W_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y0).getRegex(),uIe=pt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",kH).getRegex(),jx={blockquote:uIe,code:rIe,def:aIe,fences:nIe,heading:sIe,hr:W_,html:cIe,lheading:vH,list:lIe,newline:tIe,paragraph:kH,table:Y_,text:iIe},EH=pt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",W_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y0).getRegex(),dIe={...jx,lheading:oIe,table:EH,paragraph:pt(zx).replace("hr",W_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",EH).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y0).getRegex()},pIe={...jx,html:pt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qx).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Y_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pt(zx).replace("hr",W_).replace("heading",` *#{1,6} *[^
1017
1017
  ]`).replace("lheading",vH).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},mIe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fIe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,AH=/^( {2,}|\\)\n(?!\s*$)/,hIe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,S0=/[\p{P}\p{S}]/u,Yx=/[\s\p{P}\p{S}]/u,IH=/[^\s\p{P}\p{S}]/u,gIe=pt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yx).getRegex(),DH=/(?!~)[\p{P}\p{S}]/u,_Ie=/(?!~)[\s\p{P}\p{S}]/u,EIe=/(?:[^\s\p{P}\p{S}]|~)/u,yIe=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,RH=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,SIe=pt(RH,"u").replace(/punct/g,S0).getRegex(),bIe=pt(RH,"u").replace(/punct/g,DH).getRegex(),NH="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",TIe=pt(NH,"gu").replace(/notPunctSpace/g,IH).replace(/punctSpace/g,Yx).replace(/punct/g,S0).getRegex(),wIe=pt(NH,"gu").replace(/notPunctSpace/g,EIe).replace(/punctSpace/g,_Ie).replace(/punct/g,DH).getRegex(),CIe=pt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,IH).replace(/punctSpace/g,Yx).replace(/punct/g,S0).getRegex(),vIe=pt(/\\(punct)/,"gu").replace(/punct/g,S0).getRegex(),kIe=pt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),AIe=pt(qx).replace("(?:-->|$)","-->").getRegex(),IIe=pt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",AIe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),g0=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,DIe=pt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",g0).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),OH=pt(/^!?\[(label)\]\[(ref)\]/).replace("label",g0).replace("ref",Hx).getRegex(),xH=pt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hx).getRegex(),RIe=pt("reflink|nolink(?!\\()","g").replace("reflink",OH).replace("nolink",xH).getRegex(),Wx={_backpedal:Y_,anyPunctuation:vIe,autolink:kIe,blockSkip:yIe,br:AH,code:fIe,del:Y_,emStrongLDelim:SIe,emStrongRDelimAst:TIe,emStrongRDelimUnd:CIe,escape:mIe,link:DIe,nolink:xH,punctuation:gIe,reflink:OH,reflinkSearch:RIe,tag:IIe,text:hIe,url:Y_},NIe={...Wx,link:pt(/^!?\[(label)\]\((.*?)\)/).replace("label",g0).getRegex(),reflink:pt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",g0).getRegex()},Fx={...Wx,emStrongRDelimAst:wIe,emStrongLDelim:bIe,url:pt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},OIe={...Fx,br:pt(AH).replace("{2,}","*").getRegex(),text:pt(Fx.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},f0={normal:jx,gfm:dIe,pedantic:pIe},q_={normal:Wx,gfm:Fx,breaks:OIe,pedantic:NIe},xIe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},yH=t=>xIe[t];_0=class{options;rules;lexer;constructor(t){this.options=t||Lu}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:j_(r,`
@@ -1086,7 +1086,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Pe=U,ue=J);let Ne={cod
1086
1086
  `},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}PX.exports=_Pe});var jX=w((pft,qX)=>{function BX(t){return t?typeof t=="string"?t:t.source:null}function Um(t){return Tt("(?=",t,")")}function Tt(...t){return t.map(r=>BX(r)).join("")}function $n(...t){return"("+t.map(r=>BX(r)).join("|")+")"}var RM=t=>Tt(/\b/,t,/\w$/.test(t)?/\b/:/\B/),FX=["Protocol","Type"].map(RM),kM=["init","self"].map(RM),EPe=["Any","Self"],AM=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],$X=["false","nil","true"],yPe=["assignment","associativity","higherThan","left","lowerThan","none","right"],SPe=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],UX=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],GX=$n(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),zX=$n(GX,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),IM=Tt(GX,zX,"*"),HX=$n(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),$0=$n(HX,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),wa=Tt(HX,$0,"*"),DM=Tt(/[A-Z]/,$0,"*"),bPe=["autoclosure",Tt(/convention\(/,$n("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Tt(/objc\(/,wa,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],TPe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function wPe(t){let e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[t.C_LINE_COMMENT_MODE,r],s={className:"keyword",begin:Tt(/\./,Um($n(...FX,...kM))),end:$n(...FX,...kM),excludeBegin:!0},o={match:Tt(/\./,$n(...AM)),relevance:0},i=AM.filter(ee=>typeof ee=="string").concat(["_|0"]),a=AM.filter(ee=>typeof ee!="string").concat(EPe).map(RM),l={variants:[{className:"keyword",match:$n(...a,...kM)}]},c={$pattern:$n(/\b\w+/,/#\w+/),keyword:i.concat(SPe),literal:$X},u=[s,o,l],d={match:Tt(/\./,$n(...UX)),relevance:0},p={className:"built_in",match:Tt(/\b/,$n(...UX),/(?=\()/)},h=[d,p],f={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:IM},{match:`\\.(\\.|${zX})+`}]},_=[f,g],E="([0-9]_*)+",y="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${E})(\\.(${E}))?([eE][+-]?(${E}))?\\b`},{match:`\\b0x(${y})(\\.(${y}))?([pP][+-]?(${E}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},T=(ee="")=>({className:"subst",variants:[{match:Tt(/\\/,ee,/[0\\tnr"']/)},{match:Tt(/\\/,ee,/u\{[0-9a-fA-F]{1,8}\}/)}]}),C=(ee="")=>({className:"subst",match:Tt(/\\/,ee,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(ee="")=>({className:"subst",label:"interpol",begin:Tt(/\\/,ee,/\(/),end:/\)/}),A=(ee="")=>({begin:Tt(ee,/"""/),end:Tt(/"""/,ee),contains:[T(ee),C(ee),v(ee)]}),D=(ee="")=>({begin:Tt(ee,/"/),end:Tt(/"/,ee),contains:[T(ee),v(ee)]}),I={className:"string",variants:[A(),A("#"),A("##"),A("###"),D(),D("#"),D("##"),D("###")]},x={match:Tt(/`/,wa,/`/)},B={className:"variable",match:/\$\d+/},$={className:"variable",match:`\\$${$0}+`},L=[x,B,$],q={match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:TPe,contains:[..._,S,I]}]}},z={className:"keyword",match:Tt(/@/,$n(...bPe))},Q={className:"meta",match:Tt(/@/,wa)},K=[q,z,Q],me={match:Um(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Tt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,$0,"+")},{className:"type",match:DM,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Tt(/\s+&\s+/,Um(DM)),relevance:0}]},Z={begin:/</,end:/>/,keywords:c,contains:[...n,...u,...K,f,me]};me.contains.push(Z);let ce={match:Tt(wa,/\s*:/),keywords:"_|0",relevance:0},te={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",ce,...n,...u,...h,..._,S,I,...L,...K,me]},Ae={beginKeywords:"func",contains:[{className:"title",match:$n(x.match,wa,IM),endsParent:!0,relevance:0},e]},U={begin:/</,end:/>/,contains:[...n,me]},J={begin:$n(Um(Tt(wa,/\s*:/)),Um(Tt(wa,/\s+/,wa,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:wa}]},j={begin:/\(/,end:/\)/,keywords:c,contains:[J,...n,...u,..._,S,I,...K,me,te],endsParent:!0,illegal:/["']/},V={className:"function",match:Um(/\bfunc\b/),contains:[Ae,U,j,e],illegal:[/\[/,/%/]},ue={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[U,j,e],illegal:/\[|%/},Pe={beginKeywords:"operator",end:t.MATCH_NOTHING_RE,contains:[{className:"title",match:IM,endsParent:!0,relevance:0}]},Ne={beginKeywords:"precedencegroup",end:t.MATCH_NOTHING_RE,contains:[{className:"title",match:DM,relevance:0},{begin:/{/,end:/}/,relevance:0,endsParent:!0,keywords:[...yPe,...$X],contains:[me]}]};for(let ee of I.variants){let Oe=ee.contains.find(It=>It.label==="interpol");Oe.keywords=c;let Yt=[...u,...h,..._,S,I,...L];Oe.contains=[...Yt,{begin:/\(/,end:/\)/,contains:["self",...Yt]}]}return{name:"Swift",keywords:c,contains:[...n,V,ue,{className:"class",beginKeywords:"struct protocol class extension enum",end:"\\{",excludeEnd:!0,keywords:c,contains:[t.inherit(t.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...u]},Pe,Ne,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},...u,...h,..._,S,I,...L,...K,me,te]}}qX.exports=wPe});var WX=w((mft,YX)=>{function CPe(t){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\(/,end:/\)/,contains:["self",{begin:/\\./}]}],relevance:10},{className:"keyword",begin:/\$(?!noop)[a-zA-Z][_a-zA-Z0-9]*/,end:/\(/,excludeEnd:!0},{className:"variable",begin:/%[_a-zA-Z0-9:]*/,end:"%"},{className:"symbol",begin:/\\./}]}}YX.exports=CPe});var VX=w((fft,KX)=>{function vPe(t){var e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,s]},i=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",c="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+a+l+c+u+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},h={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},f={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},g=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},h,f,o],_=[...g];return _.pop(),_.push(i),p.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}KX.exports=vPe});var XX=w((hft,QX)=>{function kPe(t){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[t.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}QX.exports=kPe});var eJ=w((gft,ZX)=>{function APe(t){return t?typeof t=="string"?t:t.source:null}function IPe(t){return JX("(",t,")?")}function JX(...t){return t.map(r=>APe(r)).join("")}function DPe(t){let e=/[a-zA-Z_][a-zA-Z0-9_]*/,r={className:"number",variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:"after append apply array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock close concat continue dde dict encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent filename flush for foreach format gets glob global history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename return safe scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update uplevel upvar variable vwait while",contains:[t.COMMENT(";[ \\t]*#","$"),t.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:JX(/\$/,IPe(/::/),e,"(::",e,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[r]}]},{className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},r]}}ZX.exports=DPe});var rJ=w((_ft,tJ)=>{function RPe(t){let e="bool byte i16 i32 i64 double string binary";return{name:"Thrift",keywords:{keyword:"namespace const typedef struct enum service exception void oneway set list map required optional",built_in:e,literal:"true false"},contains:[t.QUOTE_STRING_MODE,t.NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",end:">",keywords:e,contains:["self"]}]}}tJ.exports=RPe});var sJ=w((Eft,nJ)=>{function NPe(t){let e={className:"number",begin:"[1-9][0-9]*",relevance:0},r={className:"symbol",begin:":[^\\]]+"},n={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",e,r]},s={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",e,t.QUOTE_STRING_MODE,r]};return{name:"TP",keywords:{keyword:"ABORT ACC ADJUST AND AP_LD BREAK CALL CNT COL CONDITION CONFIG DA DB DIV DETECT ELSE END ENDFOR ERR_NUM ERROR_PROG FINE FOR GP GUARD INC IF JMP LINEAR_MAX_SPEED LOCK MOD MONITOR OFFSET Offset OR OVERRIDE PAUSE PREG PTH RT_LD RUN SELECT SKIP Skip TA TB TO TOOL_OFFSET Tool_Offset UF UT UFRAME_NUM UTOOL_NUM UNLOCK WAIT X Y Z W P R STRLEN SUBSTR FINDSTR VOFFSET PROG ATTR MN POS",literal:"ON OFF max_speed LPOS JPOS ENABLE DISABLE START STOP RESET"},contains:[n,s,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},t.COMMENT("//","[;$]"),t.COMMENT("!","[;$]"),t.COMMENT("--eg:","$"),t.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"'"},t.C_NUMBER_MODE,{className:"variable",begin:"\\$[A-Za-z0-9_]+"}]}}nJ.exports=NPe});var iJ=w((yft,oJ)=>{function OPe(t){var e={className:"params",begin:"\\(",end:"\\)"},r="attribute block constant cycle date dump include max min parent random range source template_from_string",n={beginKeywords:r,keywords:{name:r},relevance:0,contains:[e]},s={begin:/\|[A-Za-z_]+:?/,keywords:"abs batch capitalize column convert_encoding date date_modify default escape filter first format inky_to_html inline_css join json_encode keys last length lower map markdown merge nl2br number_format raw reduce replace reverse round slice sort spaceless split striptags title trim upper url_encode",contains:[n]},o="apply autoescape block deprecated do embed extends filter flush for from if import include macro sandbox set use verbatim with";return o=o+" "+o.split(" ").map(function(i){return"end"+i}).join(" "),{name:"Twig",aliases:["craftcms"],case_insensitive:!0,subLanguage:"xml",contains:[t.COMMENT(/\{#/,/#\}/),{className:"template-tag",begin:/\{%/,end:/%\}/,contains:[{className:"name",begin:/\w+/,keywords:o,starts:{endsWithParent:!0,contains:[s,n],relevance:0}}]},{className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:["self",s,n]}]}}oJ.exports=OPe});var pJ=w((Sft,dJ)=>{var U0="[A-Za-z$_][0-9A-Za-z$_]*",lJ=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],cJ=["true","false","null","undefined","NaN","Infinity"],xPe=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],MPe=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],PPe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],LPe=["arguments","this","super","console","window","document","localStorage","module","global"],uJ=[].concat(PPe,LPe,xPe,MPe);function FPe(t){return t?typeof t=="string"?t:t.source:null}function aJ(t){return NM("(?=",t,")")}function NM(...t){return t.map(r=>FPe(r)).join("")}function $Pe(t){let e=(T,{after:C})=>{let v="</"+T[0].slice(1);return T.input.indexOf(v,C)!==-1},r=U0,n={begin:"<>",end:"</>"},s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(T,C)=>{let v=T[0].length+T.index,A=T.input[v];if(A==="<"){C.ignoreMatch();return}A===">"&&(e(T,{after:v})||C.ignoreMatch())}},o={$pattern:U0,keyword:lJ,literal:cJ,built_in:uJ},i="[0-9](_?[0-9])*",a=`\\.(${i})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${l})((${a})|\\.)?|(${a}))[eE][+-]?(${i})\\b`},{begin:`\\b(${l})\\b((${a})\\b|\\.)?|(${a})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},p={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,u],subLanguage:"css"}},h={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,u]},g={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},_=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,p,h,c,t.REGEXP_MODE];u.contains=_.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(_)});let E=[].concat(g,u.contains),y=E.concat([{begin:/\(/,end:/\)/,keywords:o,contains:["self"].concat(E)}]),S={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:y};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:y},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,p,h,g,c,{begin:NM(/[{,\n]\s*/,aJ(NM(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,r+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:r+aJ("\\s*:"),relevance:0}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[g,t.REGEXP_MODE,{className:"function",begin:"(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:y}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:n.begin,end:n.end},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:o,contains:["self",t.inherit(t.TITLE_MODE,{begin:r}),S],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[S,t.inherit(t.TITLE_MODE,{begin:r})]},{variants:[{begin:"\\."+r},{begin:"\\$"+r}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},t.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:r}),"self",S]},{begin:"(get|set)\\s+(?="+r+"\\()",end:/\{/,keywords:"get set",contains:[t.inherit(t.TITLE_MODE,{begin:r}),{begin:/\(\)/},S]},{begin:/\$[(.]/}]}}function UPe(t){let e=U0,r={beginKeywords:"namespace",end:/\{/,excludeEnd:!0},n={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:"interface extends"},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},o=["any","void","number","boolean","string","object","never","enum"],i=["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"],a={$pattern:U0,keyword:lJ.concat(i),literal:cJ,built_in:uJ.concat(o)},l={className:"meta",begin:"@"+e},c=(p,h,f)=>{let g=p.contains.findIndex(_=>_.label===h);if(g===-1)throw new Error("can not find mode to replace");p.contains.splice(g,1,f)},u=$Pe(t);Object.assign(u.keywords,a),u.exports.PARAMS_CONTAINS.push(l),u.contains=u.contains.concat([l,r,n]),c(u,"shebang",t.SHEBANG()),c(u,"use_strict",s);let d=u.contains.find(p=>p.className==="function");return d.relevance=0,Object.assign(u,{name:"TypeScript",aliases:["ts","tsx"]}),u}dJ.exports=UPe});var fJ=w((bft,mJ)=>{function BPe(t){return{name:"Vala",keywords:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override virtual delegate if while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object Gtk Posix",literal:"false true null"},contains:[{className:"class",beginKeywords:"class interface namespace",end:/\{/,excludeEnd:!0,illegal:"[^,:\\n\\s\\.]",contains:[t.UNDERSCORE_TITLE_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",begin:'"""',end:'"""',relevance:5},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,t.C_NUMBER_MODE,{className:"meta",begin:"^#",end:"$",relevance:2}]}}mJ.exports=BPe});var _J=w((Tft,gJ)=>{function hJ(t){return t?typeof t=="string"?t:t.source:null}function B0(...t){return t.map(r=>hJ(r)).join("")}function OM(...t){return"("+t.map(r=>hJ(r)).join("|")+")"}function GPe(t){let e={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},n=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,i=/\d{1,2}(:\d{1,2}){1,2}/,a={className:"literal",variants:[{begin:B0(/# */,OM(s,n),/ *#/)},{begin:B0(/# */,i,/ *#/)},{begin:B0(/# */,o,/ *#/)},{begin:B0(/# */,OM(s,n),/ +/,OM(o,i),/ *#/)}]},l={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},c={className:"label",begin:/^\w+:/},u=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[e,r,a,l,c,u,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{"meta-keyword":"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}gJ.exports=GPe});var SJ=w((wft,yJ)=>{function EJ(t){return t?typeof t=="string"?t:t.source:null}function zPe(...t){return t.map(r=>EJ(r)).join("")}function HPe(...t){return"("+t.map(r=>EJ(r)).join("|")+")"}function qPe(t){let e="lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid split cint sin datepart ltrim sqr time derived eval date formatpercent exp inputbox left ascw chrw regexp cstr err".split(" "),r=["server","response","request","scriptengine","scriptenginebuildversion","scriptengineminorversion","scriptenginemajorversion"],n={begin:zPe(HPe(...e),"\\s*\\("),relevance:0,keywords:{built_in:e}};return{name:"VBScript",aliases:["vbs"],case_insensitive:!0,keywords:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:r,literal:"true false null nothing empty"},illegal:"//",contains:[n,t.inherit(t.QUOTE_STRING_MODE,{contains:[{begin:'""'}]}),t.COMMENT(/'/,/$/,{relevance:0}),t.C_NUMBER_MODE]}}yJ.exports=qPe});var TJ=w((Cft,bJ)=>{function jPe(t){return{name:"VBScript in HTML",subLanguage:"xml",contains:[{begin:"<%",end:"%>",subLanguage:"vbscript"}]}}bJ.exports=jPe});var CJ=w((vft,wJ)=>{function YPe(t){return{name:"Verilog",aliases:["v","sv","svh"],case_insensitive:!1,keywords:{$pattern:/[\w\$]+/,keyword:"accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf|0 bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate|5 genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor",literal:"null",built_in:"$finish $stop $exit $fatal $error $warning $info $realtime $time $printtimescale $bitstoreal $bitstoshortreal $itor $signed $cast $bits $stime $timeformat $realtobits $shortrealtobits $rtoi $unsigned $asserton $assertkill $assertpasson $assertfailon $assertnonvacuouson $assertoff $assertcontrol $assertpassoff $assertfailoff $assertvacuousoff $isunbounded $sampled $fell $changed $past_gclk $fell_gclk $changed_gclk $rising_gclk $steady_gclk $coverage_control $coverage_get $coverage_save $set_coverage_db_name $rose $stable $past $rose_gclk $stable_gclk $future_gclk $falling_gclk $changing_gclk $display $coverage_get_max $coverage_merge $get_coverage $load_coverage_db $typename $unpacked_dimensions $left $low $increment $clog2 $ln $log10 $exp $sqrt $pow $floor $ceil $sin $cos $tan $countbits $onehot $isunknown $fatal $warning $dimensions $right $high $size $asin $acos $atan $atan2 $hypot $sinh $cosh $tanh $asinh $acosh $atanh $countones $onehot0 $error $info $random $dist_chi_square $dist_erlang $dist_exponential $dist_normal $dist_poisson $dist_t $dist_uniform $q_initialize $q_remove $q_exam $async$and$array $async$nand$array $async$or$array $async$nor$array $sync$and$array $sync$nand$array $sync$or$array $sync$nor$array $q_add $q_full $psprintf $async$and$plane $async$nand$plane $async$or$plane $async$nor$plane $sync$and$plane $sync$nand$plane $sync$or$plane $sync$nor$plane $system $display $displayb $displayh $displayo $strobe $strobeb $strobeh $strobeo $write $readmemb $readmemh $writememh $value$plusargs $dumpvars $dumpon $dumplimit $dumpports $dumpportson $dumpportslimit $writeb $writeh $writeo $monitor $monitorb $monitorh $monitoro $writememb $dumpfile $dumpoff $dumpall $dumpflush $dumpportsoff $dumpportsall $dumpportsflush $fclose $fdisplay $fdisplayb $fdisplayh $fdisplayo $fstrobe $fstrobeb $fstrobeh $fstrobeo $swrite $swriteb $swriteh $swriteo $fscanf $fread $fseek $fflush $feof $fopen $fwrite $fwriteb $fwriteh $fwriteo $fmonitor $fmonitorb $fmonitorh $fmonitoro $sformat $sformatf $fgetc $ungetc $fgets $sscanf $rewind $ftell $ferror"},contains:[t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.QUOTE_STRING_MODE,{className:"number",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"\\b((\\d+'(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)"},{begin:"\\B(('(b|h|o|d|B|H|O|D))[0-9xzXZa-fA-F_]+)"},{begin:"\\b([0-9_])+",relevance:0}]},{className:"variable",variants:[{begin:"#\\((?!parameter).+\\)"},{begin:"\\.\\w+",relevance:0}]},{className:"meta",begin:"`",end:"$",keywords:{"meta-keyword":"define __FILE__ __LINE__ begin_keywords celldefine default_nettype define else elsif end_keywords endcelldefine endif ifdef ifndef include line nounconnected_drive pragma resetall timescale unconnected_drive undef undefineall"},relevance:0}]}}wJ.exports=YPe});var kJ=w((kft,vJ)=>{function WPe(t){let e="\\d(_|\\d)*",r="[eE][-+]?"+e,n=e+"(\\."+e+")?("+r+")?",s="\\w+",i="\\b("+(e+"#"+s+"(\\."+s+")?#("+r+")?")+"|"+n+")";return{name:"VHDL",case_insensitive:!0,keywords:{keyword:"abs access after alias all and architecture array assert assume assume_guarantee attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package parameter port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable view vmode vprop vunit wait when while with xnor xor",built_in:"boolean bit character integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_logic std_logic_vector unsigned signed boolean_vector integer_vector std_ulogic std_ulogic_vector unresolved_unsigned u_unsigned unresolved_signed u_signed real_vector time_vector",literal:"false true note warning error failure line text side width"},illegal:/\{/,contains:[t.C_BLOCK_COMMENT_MODE,t.COMMENT("--","$"),t.QUOTE_STRING_MODE,{className:"number",begin:i,relevance:0},{className:"string",begin:"'(U|X|0|1|Z|W|L|H|-)'",contains:[t.BACKSLASH_ESCAPE]},{className:"symbol",begin:"'[A-Za-z](_?[A-Za-z0-9])*",contains:[t.BACKSLASH_ESCAPE]}]}}vJ.exports=WPe});var IJ=w((Aft,AJ)=>{function KPe(t){return{name:"Vim Script",keywords:{$pattern:/[!#@\w]+/,keyword:"N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank",built_in:"synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp"},illegal:/;/,contains:[t.NUMBER_MODE,{className:"string",begin:"'",end:"'",illegal:"\\n"},{className:"string",begin:/"(\\"|\n\\|[^"\n])*"/},t.COMMENT('"',"$"),{className:"variable",begin:/[bwtglsav]:[\w\d_]*/},{className:"function",beginKeywords:"function function!",end:"$",relevance:0,contains:[t.TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{className:"symbol",begin:/<[\w-]+>/}]}}AJ.exports=KPe});var RJ=w((Ift,DJ)=>{function VPe(t){return{name:"Intel x86 Assembly",case_insensitive:!0,keywords:{$pattern:"[.%]?"+t.IDENT_RE,keyword:"lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63",built_in:"ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr",meta:"%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %if %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist __FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__"},contains:[t.COMMENT(";","$",{relevance:0}),{className:"number",variants:[{begin:"\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*(\\.[0-9_]*)?(?:[pP](?:[+-]?[0-9_]+)?)?)\\b",relevance:0},{begin:"\\$[0-9][0-9A-Fa-f]*",relevance:0},{begin:"\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[Hh]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b"},{begin:"\\b(?:0[Xx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b"}]},t.QUOTE_STRING_MODE,{className:"string",variants:[{begin:"'",end:"[^\\\\]'"},{begin:"`",end:"[^\\\\]`"}],relevance:0},{className:"symbol",variants:[{begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)"},{begin:"^\\s*%%[A-Za-z0-9_$#@~.?]*:"}],relevance:0},{className:"subst",begin:"%[0-9]+",relevance:0},{className:"subst",begin:"%!S+",relevance:0},{className:"meta",begin:/^\s*\.[\w_-]+/}]}}DJ.exports=VPe});var OJ=w((Dft,NJ)=>{function QPe(t){let r={$pattern:/[a-zA-Z][a-zA-Z0-9_?]*/,keyword:"if then else do while until for loop import with is as where when by data constant integer real text name boolean symbol infix prefix postfix block tree",literal:"true false nil",built_in:"in mod rem and or xor not abs sign floor ceil sqrt sin cos tan asin acos atan exp expm1 log log2 log10 log1p pi at text_length text_range text_find text_replace contains page slide basic_slide title_slide title subtitle fade_in fade_out fade_at clear_color color line_color line_width texture_wrap texture_transform texture scale_?x scale_?y scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y rotate_?z? rectangle circle ellipse sphere path line_to move_to quad_to curve_to theme background contents locally time mouse_?x mouse_?y mouse_buttons "+"ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts"},n={className:"string",begin:'"',end:'"',illegal:"\\n"},s={className:"string",begin:"'",end:"'",illegal:"\\n"},o={className:"string",begin:"<<",end:">>"},i={className:"number",begin:"[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?"},a={beginKeywords:"import",end:"$",keywords:r,contains:[n]},l={className:"function",begin:/[a-z][^\n]*->/,returnBegin:!0,end:/->/,contains:[t.inherit(t.TITLE_MODE,{starts:{endsWithParent:!0,keywords:r}})]};return{name:"XL",aliases:["tao"],keywords:r,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,n,s,o,l,a,i,t.NUMBER_MODE]}}NJ.exports=QPe});var MJ=w((Rft,xJ)=>{function XPe(t){return{name:"XQuery",aliases:["xpath","xq"],case_insensitive:!1,illegal:/(proc)|(abstract)|(extends)|(until)|(#)/,keywords:{$pattern:/[a-zA-Z$][a-zA-Z0-9_:-]*/,keyword:"module schema namespace boundary-space preserve no-preserve strip default collation base-uri ordering context decimal-format decimal-separator copy-namespaces empty-sequence except exponent-separator external grouping-separator inherit no-inherit lax minus-sign per-mille percent schema-attribute schema-element strict unordered zero-digit declare import option function validate variable for at in let where order group by return if then else tumbling sliding window start when only end previous next stable ascending descending allowing empty greatest least some every satisfies switch case typeswitch try catch and or to union intersect instance of treat as castable cast map array delete insert into replace value rename copy modify update",type:"item document-node node attribute document element comment namespace namespace-node processing-instruction text construction xs:anyAtomicType xs:untypedAtomic xs:duration xs:time xs:decimal xs:float xs:double xs:gYearMonth xs:gYear xs:gMonthDay xs:gMonth xs:gDay xs:boolean xs:base64Binary xs:hexBinary xs:anyURI xs:QName xs:NOTATION xs:dateTime xs:dateTimeStamp xs:date xs:string xs:normalizedString xs:token xs:language xs:NMTOKEN xs:Name xs:NCName xs:ID xs:IDREF xs:ENTITY xs:integer xs:nonPositiveInteger xs:negativeInteger xs:long xs:int xs:short xs:byte xs:nonNegativeInteger xs:unisignedLong xs:unsignedInt xs:unsignedShort xs:unsignedByte xs:positiveInteger xs:yearMonthDuration xs:dayTimeDuration",literal:"eq ne lt le gt ge is self:: child:: descendant:: descendant-or-self:: attribute:: following:: following-sibling:: parent:: ancestor:: ancestor-or-self:: preceding:: preceding-sibling:: NaN"},contains:[{className:"variable",begin:/[$][\w\-:]+/},{className:"built_in",variants:[{begin:/\barray:/,end:/(?:append|filter|flatten|fold-(?:left|right)|for-each(?:-pair)?|get|head|insert-before|join|put|remove|reverse|size|sort|subarray|tail)\b/},{begin:/\bmap:/,end:/(?:contains|entry|find|for-each|get|keys|merge|put|remove|size)\b/},{begin:/\bmath:/,end:/(?:a(?:cos|sin|tan[2]?)|cos|exp(?:10)?|log(?:10)?|pi|pow|sin|sqrt|tan)\b/},{begin:/\bop:/,end:/\(/,excludeEnd:!0},{begin:/\bfn:/,end:/\(/,excludeEnd:!0},{begin:/[^</$:'"-]\b(?:abs|accumulator-(?:after|before)|adjust-(?:date(?:Time)?|time)-to-timezone|analyze-string|apply|available-(?:environment-variables|system-properties)|avg|base-uri|boolean|ceiling|codepoints?-(?:equal|to-string)|collation-key|collection|compare|concat|contains(?:-token)?|copy-of|count|current(?:-)?(?:date(?:Time)?|time|group(?:ing-key)?|output-uri|merge-(?:group|key))?data|dateTime|days?-from-(?:date(?:Time)?|duration)|deep-equal|default-(?:collation|language)|distinct-values|document(?:-uri)?|doc(?:-available)?|element-(?:available|with-id)|empty|encode-for-uri|ends-with|environment-variable|error|escape-html-uri|exactly-one|exists|false|filter|floor|fold-(?:left|right)|for-each(?:-pair)?|format-(?:date(?:Time)?|time|integer|number)|function-(?:arity|available|lookup|name)|generate-id|has-children|head|hours-from-(?:dateTime|duration|time)|id(?:ref)?|implicit-timezone|in-scope-prefixes|index-of|innermost|insert-before|iri-to-uri|json-(?:doc|to-xml)|key|lang|last|load-xquery-module|local-name(?:-from-QName)?|(?:lower|upper)-case|matches|max|minutes-from-(?:dateTime|duration|time)|min|months?-from-(?:date(?:Time)?|duration)|name(?:space-uri-?(?:for-prefix|from-QName)?)?|nilled|node-name|normalize-(?:space|unicode)|not|number|one-or-more|outermost|parse-(?:ietf-date|json)|path|position|(?:prefix-from-)?QName|random-number-generator|regex-group|remove|replace|resolve-(?:QName|uri)|reverse|root|round(?:-half-to-even)?|seconds-from-(?:dateTime|duration|time)|snapshot|sort|starts-with|static-base-uri|stream-available|string-?(?:join|length|to-codepoints)?|subsequence|substring-?(?:after|before)?|sum|system-property|tail|timezone-from-(?:date(?:Time)?|time)|tokenize|trace|trans(?:form|late)|true|type-available|unordered|unparsed-(?:entity|text)?-?(?:public-id|uri|available|lines)?|uri-collection|xml-to-json|years?-from-(?:date(?:Time)?|duration)|zero-or-one)\b/},{begin:/\blocal:/,end:/\(/,excludeEnd:!0},{begin:/\bzip:/,end:/(?:zip-file|(?:xml|html|text|binary)-entry| (?:update-)?entries)\b/},{begin:/\b(?:util|db|functx|app|xdmp|xmldb):/,end:/\(/,excludeEnd:!0}]},{className:"string",variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},{className:"number",begin:/(\b0[0-7_]+)|(\b0x[0-9a-fA-F_]+)|(\b[1-9][0-9_]*(\.[0-9_]+)?)|[0_]\b/,relevance:0},{className:"comment",begin:/\(:/,end:/:\)/,relevance:10,contains:[{className:"doctag",begin:/@\w+/}]},{className:"meta",begin:/%[\w\-:]+/},{className:"title",begin:/\bxquery version "[13]\.[01]"\s?(?:encoding ".+")?/,end:/;/},{beginKeywords:"element attribute comment document processing-instruction",end:/\{/,excludeEnd:!0},{begin:/<([\w._:-]+)(\s+\S*=('|").*('|"))?>/,end:/(\/[\w._:-]+>)/,subLanguage:"xml",contains:[{begin:/\{/,end:/\}/,subLanguage:"xquery"},"self"]}]}}xJ.exports=XPe});var LJ=w((Nft,PJ)=>{function JPe(t){let e={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.inherit(t.APOS_STRING_MODE,{illegal:null}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null})]},r=t.UNDERSCORE_TITLE_MODE,n={variants:[t.BINARY_NUMBER_MODE,t.C_NUMBER_MODE]},s="namespace class interface use extends function return abstract final public protected private static deprecated throw try catch Exception echo empty isset instanceof unset let var new const self require if else elseif switch case default do while loop for continue break likely unlikely __LINE__ __FILE__ __DIR__ __FUNCTION__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__ array boolean float double integer object resource string char long unsigned bool int uint ulong uchar true false null undefined";return{name:"Zephir",aliases:["zep"],keywords:s,contains:[t.C_LINE_COMMENT_MODE,t.COMMENT(/\/\*/,/\*\//,{contains:[{className:"doctag",begin:/@[A-Za-z]+/}]}),{className:"string",begin:/<<<['"]?\w+['"]?$/,end:/^\w+;/,contains:[t.BACKSLASH_ESCAPE]},{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",beginKeywords:"function fn",end:/[;{]/,excludeEnd:!0,illegal:/\$|\[|%/,contains:[r,{className:"params",begin:/\(/,end:/\)/,keywords:s,contains:["self",t.C_BLOCK_COMMENT_MODE,e,n]}]},{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,illegal:/[:($"]/,contains:[{beginKeywords:"extends implements"},r]},{beginKeywords:"namespace",end:/;/,illegal:/[.']/,contains:[r]},{beginKeywords:"use",end:/;/,contains:[r]},{begin:/=>/},e,n]}}PJ.exports=JPe});var $J=w((Oft,FJ)=>{var M=Qq();M.registerLanguage("1c",Jq());M.registerLanguage("abnf",ej());M.registerLanguage("accesslog",nj());M.registerLanguage("actionscript",oj());M.registerLanguage("ada",aj());M.registerLanguage("angelscript",cj());M.registerLanguage("apache",dj());M.registerLanguage("applescript",gj());M.registerLanguage("arcade",Ej());M.registerLanguage("arduino",Sj());M.registerLanguage("armasm",Tj());M.registerLanguage("xml",kj());M.registerLanguage("asciidoc",Dj());M.registerLanguage("aspectj",Nj());M.registerLanguage("autohotkey",xj());M.registerLanguage("autoit",Pj());M.registerLanguage("avrasm",Fj());M.registerLanguage("awk",Uj());M.registerLanguage("axapta",Gj());M.registerLanguage("bash",Hj());M.registerLanguage("basic",jj());M.registerLanguage("bnf",Wj());M.registerLanguage("brainfuck",Vj());M.registerLanguage("c-like",Xj());M.registerLanguage("c",Zj());M.registerLanguage("cal",tY());M.registerLanguage("capnproto",nY());M.registerLanguage("ceylon",oY());M.registerLanguage("clean",aY());M.registerLanguage("clojure",cY());M.registerLanguage("clojure-repl",dY());M.registerLanguage("cmake",mY());M.registerLanguage("coffeescript",hY());M.registerLanguage("coq",_Y());M.registerLanguage("cos",yY());M.registerLanguage("cpp",bY());M.registerLanguage("crmsh",wY());M.registerLanguage("crystal",vY());M.registerLanguage("csharp",AY());M.registerLanguage("csp",DY());M.registerLanguage("css",NY());M.registerLanguage("d",xY());M.registerLanguage("markdown",PY());M.registerLanguage("dart",FY());M.registerLanguage("delphi",UY());M.registerLanguage("diff",GY());M.registerLanguage("django",HY());M.registerLanguage("dns",jY());M.registerLanguage("dockerfile",WY());M.registerLanguage("dos",VY());M.registerLanguage("dsconfig",XY());M.registerLanguage("dts",ZY());M.registerLanguage("dust",tW());M.registerLanguage("ebnf",nW());M.registerLanguage("elixir",oW());M.registerLanguage("elm",aW());M.registerLanguage("ruby",uW());M.registerLanguage("erb",pW());M.registerLanguage("erlang-repl",fW());M.registerLanguage("erlang",gW());M.registerLanguage("excel",EW());M.registerLanguage("fix",SW());M.registerLanguage("flix",TW());M.registerLanguage("fortran",CW());M.registerLanguage("fsharp",kW());M.registerLanguage("gams",IW());M.registerLanguage("gauss",RW());M.registerLanguage("gcode",OW());M.registerLanguage("gherkin",MW());M.registerLanguage("glsl",LW());M.registerLanguage("gml",$W());M.registerLanguage("go",BW());M.registerLanguage("golo",zW());M.registerLanguage("gradle",qW());M.registerLanguage("groovy",YW());M.registerLanguage("haml",KW());M.registerLanguage("handlebars",XW());M.registerLanguage("haskell",ZW());M.registerLanguage("haxe",tK());M.registerLanguage("hsp",nK());M.registerLanguage("htmlbars",iK());M.registerLanguage("http",lK());M.registerLanguage("hy",uK());M.registerLanguage("inform7",pK());M.registerLanguage("ini",gK());M.registerLanguage("irpf90",EK());M.registerLanguage("isbl",SK());M.registerLanguage("java",TK());M.registerLanguage("javascript",kK());M.registerLanguage("jboss-cli",IK());M.registerLanguage("json",RK());M.registerLanguage("julia",OK());M.registerLanguage("julia-repl",MK());M.registerLanguage("kotlin",LK());M.registerLanguage("lasso",$K());M.registerLanguage("latex",BK());M.registerLanguage("ldif",zK());M.registerLanguage("leaf",qK());M.registerLanguage("less",KK());M.registerLanguage("lisp",QK());M.registerLanguage("livecodeserver",JK());M.registerLanguage("livescript",eV());M.registerLanguage("llvm",rV());M.registerLanguage("lsl",sV());M.registerLanguage("lua",iV());M.registerLanguage("makefile",lV());M.registerLanguage("mathematica",mV());M.registerLanguage("matlab",hV());M.registerLanguage("maxima",_V());M.registerLanguage("mel",yV());M.registerLanguage("mercury",bV());M.registerLanguage("mipsasm",wV());M.registerLanguage("mizar",vV());M.registerLanguage("perl",DV());M.registerLanguage("mojolicious",NV());M.registerLanguage("monkey",xV());M.registerLanguage("moonscript",PV());M.registerLanguage("n1ql",FV());M.registerLanguage("nginx",UV());M.registerLanguage("nim",GV());M.registerLanguage("nix",HV());M.registerLanguage("node-repl",jV());M.registerLanguage("nsis",WV());M.registerLanguage("objectivec",VV());M.registerLanguage("ocaml",XV());M.registerLanguage("openscad",ZV());M.registerLanguage("oxygene",tQ());M.registerLanguage("parser3",nQ());M.registerLanguage("pf",oQ());M.registerLanguage("pgsql",aQ());M.registerLanguage("php",cQ());M.registerLanguage("php-template",dQ());M.registerLanguage("plaintext",mQ());M.registerLanguage("pony",hQ());M.registerLanguage("powershell",_Q());M.registerLanguage("processing",yQ());M.registerLanguage("profile",bQ());M.registerLanguage("prolog",wQ());M.registerLanguage("properties",vQ());M.registerLanguage("protobuf",AQ());M.registerLanguage("puppet",DQ());M.registerLanguage("purebasic",NQ());M.registerLanguage("python",xQ());M.registerLanguage("python-repl",PQ());M.registerLanguage("q",FQ());M.registerLanguage("qml",UQ());M.registerLanguage("r",GQ());M.registerLanguage("reasonml",HQ());M.registerLanguage("rib",jQ());M.registerLanguage("roboconf",WQ());M.registerLanguage("routeros",VQ());M.registerLanguage("rsl",XQ());M.registerLanguage("ruleslanguage",ZQ());M.registerLanguage("rust",tX());M.registerLanguage("sas",nX());M.registerLanguage("scala",oX());M.registerLanguage("scheme",aX());M.registerLanguage("scilab",cX());M.registerLanguage("scss",dX());M.registerLanguage("shell",mX());M.registerLanguage("smali",hX());M.registerLanguage("smalltalk",_X());M.registerLanguage("sml",yX());M.registerLanguage("sqf",bX());M.registerLanguage("sql_more",wX());M.registerLanguage("sql",kX());M.registerLanguage("stan",IX());M.registerLanguage("stata",RX());M.registerLanguage("step21",OX());M.registerLanguage("stylus",MX());M.registerLanguage("subunit",LX());M.registerLanguage("swift",jX());M.registerLanguage("taggerscript",WX());M.registerLanguage("yaml",VX());M.registerLanguage("tap",XX());M.registerLanguage("tcl",eJ());M.registerLanguage("thrift",rJ());M.registerLanguage("tp",sJ());M.registerLanguage("twig",iJ());M.registerLanguage("typescript",pJ());M.registerLanguage("vala",fJ());M.registerLanguage("vbnet",_J());M.registerLanguage("vbscript",SJ());M.registerLanguage("vbscript-html",TJ());M.registerLanguage("verilog",CJ());M.registerLanguage("vhdl",kJ());M.registerLanguage("vim",IJ());M.registerLanguage("x86asm",RJ());M.registerLanguage("xl",OJ());M.registerLanguage("xquery",MJ());M.registerLanguage("zephir",LJ());FJ.exports=M});var G0=w(Ca=>{"use strict";var ZPe=[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];Ca.REPLACEMENT_CHARACTER="\uFFFD";Ca.CODE_POINTS={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APOSTROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,RIGHT_SQUARE_BRACKET:93,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,REPLACEMENT_CHARACTER:65533};Ca.CODE_POINT_SEQUENCES={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]};Ca.isSurrogate=function(t){return t>=55296&&t<=57343};Ca.isSurrogatePair=function(t){return t>=56320&&t<=57343};Ca.getSurrogatePairCodePoint=function(t,e){return(t-55296)*1024+9216+e};Ca.isControlCodePoint=function(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159};Ca.isUndefinedCodePoint=function(t){return t>=64976&&t<=65007||ZPe.indexOf(t)>-1}});var z0=w((Mft,UJ)=>{"use strict";UJ.exports={controlCharacterInInputStream:"control-character-in-input-stream",noncharacterInInputStream:"noncharacter-in-input-stream",surrogateInInputStream:"surrogate-in-input-stream",nonVoidHtmlElementStartTagWithTrailingSolidus:"non-void-html-element-start-tag-with-trailing-solidus",endTagWithAttributes:"end-tag-with-attributes",endTagWithTrailingSolidus:"end-tag-with-trailing-solidus",unexpectedSolidusInTag:"unexpected-solidus-in-tag",unexpectedNullCharacter:"unexpected-null-character",unexpectedQuestionMarkInsteadOfTagName:"unexpected-question-mark-instead-of-tag-name",invalidFirstCharacterOfTagName:"invalid-first-character-of-tag-name",unexpectedEqualsSignBeforeAttributeName:"unexpected-equals-sign-before-attribute-name",missingEndTagName:"missing-end-tag-name",unexpectedCharacterInAttributeName:"unexpected-character-in-attribute-name",unknownNamedCharacterReference:"unknown-named-character-reference",missingSemicolonAfterCharacterReference:"missing-semicolon-after-character-reference",unexpectedCharacterAfterDoctypeSystemIdentifier:"unexpected-character-after-doctype-system-identifier",unexpectedCharacterInUnquotedAttributeValue:"unexpected-character-in-unquoted-attribute-value",eofBeforeTagName:"eof-before-tag-name",eofInTag:"eof-in-tag",missingAttributeValue:"missing-attribute-value",missingWhitespaceBetweenAttributes:"missing-whitespace-between-attributes",missingWhitespaceAfterDoctypePublicKeyword:"missing-whitespace-after-doctype-public-keyword",missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:"missing-whitespace-between-doctype-public-and-system-identifiers",missingWhitespaceAfterDoctypeSystemKeyword:"missing-whitespace-after-doctype-system-keyword",missingQuoteBeforeDoctypePublicIdentifier:"missing-quote-before-doctype-public-identifier",missingQuoteBeforeDoctypeSystemIdentifier:"missing-quote-before-doctype-system-identifier",missingDoctypePublicIdentifier:"missing-doctype-public-identifier",missingDoctypeSystemIdentifier:"missing-doctype-system-identifier",abruptDoctypePublicIdentifier:"abrupt-doctype-public-identifier",abruptDoctypeSystemIdentifier:"abrupt-doctype-system-identifier",cdataInHtmlContent:"cdata-in-html-content",incorrectlyOpenedComment:"incorrectly-opened-comment",eofInScriptHtmlCommentLikeText:"eof-in-script-html-comment-like-text",eofInDoctype:"eof-in-doctype",nestedComment:"nested-comment",abruptClosingOfEmptyComment:"abrupt-closing-of-empty-comment",eofInComment:"eof-in-comment",incorrectlyClosedComment:"incorrectly-closed-comment",eofInCdata:"eof-in-cdata",absenceOfDigitsInNumericCharacterReference:"absence-of-digits-in-numeric-character-reference",nullCharacterReference:"null-character-reference",surrogateCharacterReference:"surrogate-character-reference",characterReferenceOutsideUnicodeRange:"character-reference-outside-unicode-range",controlCharacterReference:"control-character-reference",noncharacterCharacterReference:"noncharacter-character-reference",missingWhitespaceBeforeDoctypeName:"missing-whitespace-before-doctype-name",missingDoctypeName:"missing-doctype-name",invalidCharacterSequenceAfterDoctypeName:"invalid-character-sequence-after-doctype-name",duplicateAttribute:"duplicate-attribute",nonConformingDoctype:"non-conforming-doctype",missingDoctype:"missing-doctype",misplacedDoctype:"misplaced-doctype",endTagWithoutMatchingOpenElement:"end-tag-without-matching-open-element",closingOfElementWithOpenChildElements:"closing-of-element-with-open-child-elements",disallowedContentInNoscriptInHead:"disallowed-content-in-noscript-in-head",openElementsLeftAfterEof:"open-elements-left-after-eof",abandonedHeadElementChild:"abandoned-head-element-child",misplacedStartTagForHeadElement:"misplaced-start-tag-for-head-element",nestedNoscriptInHead:"nested-noscript-in-head",eofInElementThatCanContainOnlyText:"eof-in-element-that-can-contain-only-text"}});var GJ=w((Pft,BJ)=>{"use strict";var Bm=G0(),xM=z0(),Uu=Bm.CODE_POINTS,eLe=65536,MM=class{constructor(){this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=eLe}_err(){}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.lastCharPos){let r=this.html.charCodeAt(this.pos+1);if(Bm.isSurrogatePair(r))return this.pos++,this._addGap(),Bm.getSurrogatePairCodePoint(e,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Uu.EOF;return this._err(xM.surrogateInInputStream),e}dropParsedChunk(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[])}write(e,r){this.html?this.html+=e:this.html=e,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=r}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1}advance(){if(this.pos++,this.pos>this.lastCharPos)return this.endOfChunkHit=!this.lastChunkWritten,Uu.EOF;let e=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&e===Uu.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):e===Uu.CARRIAGE_RETURN?(this.skipNextNewLine=!0,Uu.LINE_FEED):(this.skipNextNewLine=!1,Bm.isSurrogate(e)&&(e=this._processSurrogate(e)),e>31&&e<127||e===Uu.LINE_FEED||e===Uu.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Bm.isControlCodePoint(e)?this._err(xM.controlCharacterInInputStream):Bm.isUndefinedCodePoint(e)&&this._err(xM.noncharacterInInputStream)}retreat(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--}};BJ.exports=MM});var HJ=w((Lft,zJ)=>{"use strict";zJ.exports=new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4e3,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,1e4,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13e3,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204])});var lE=w((Fft,GZ)=>{"use strict";var tLe=GJ(),_t=G0(),zu=HJ(),W=z0(),N=_t.CODE_POINTS,Bu=_t.CODE_POINT_SEQUENCES,rLe={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},PZ=1,LZ=2,FZ=4,nLe=PZ|LZ|FZ,Ke="DATA_STATE",zm="RCDATA_STATE",iE="RAWTEXT_STATE",Aa="SCRIPT_DATA_STATE",$Z="PLAINTEXT_STATE",qJ="TAG_OPEN_STATE",jJ="END_TAG_OPEN_STATE",PM="TAG_NAME_STATE",YJ="RCDATA_LESS_THAN_SIGN_STATE",WJ="RCDATA_END_TAG_OPEN_STATE",KJ="RCDATA_END_TAG_NAME_STATE",VJ="RAWTEXT_LESS_THAN_SIGN_STATE",QJ="RAWTEXT_END_TAG_OPEN_STATE",XJ="RAWTEXT_END_TAG_NAME_STATE",JJ="SCRIPT_DATA_LESS_THAN_SIGN_STATE",ZJ="SCRIPT_DATA_END_TAG_OPEN_STATE",eZ="SCRIPT_DATA_END_TAG_NAME_STATE",tZ="SCRIPT_DATA_ESCAPE_START_STATE",rZ="SCRIPT_DATA_ESCAPE_START_DASH_STATE",Fo="SCRIPT_DATA_ESCAPED_STATE",nZ="SCRIPT_DATA_ESCAPED_DASH_STATE",LM="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",H0="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",sZ="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",oZ="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",iZ="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",va="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",aZ="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",lZ="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",q0="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",cZ="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",Ci="BEFORE_ATTRIBUTE_NAME_STATE",j0="ATTRIBUTE_NAME_STATE",FM="AFTER_ATTRIBUTE_NAME_STATE",$M="BEFORE_ATTRIBUTE_VALUE_STATE",Y0="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",W0="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",K0="ATTRIBUTE_VALUE_UNQUOTED_STATE",UM="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",nc="SELF_CLOSING_START_TAG_STATE",rE="BOGUS_COMMENT_STATE",uZ="MARKUP_DECLARATION_OPEN_STATE",dZ="COMMENT_START_STATE",pZ="COMMENT_START_DASH_STATE",sc="COMMENT_STATE",mZ="COMMENT_LESS_THAN_SIGN_STATE",fZ="COMMENT_LESS_THAN_SIGN_BANG_STATE",hZ="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",gZ="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",V0="COMMENT_END_DASH_STATE",Q0="COMMENT_END_STATE",_Z="COMMENT_END_BANG_STATE",EZ="DOCTYPE_STATE",X0="BEFORE_DOCTYPE_NAME_STATE",J0="DOCTYPE_NAME_STATE",yZ="AFTER_DOCTYPE_NAME_STATE",SZ="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",bZ="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",BM="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",GM="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",zM="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",TZ="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",wZ="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",CZ="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",nE="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",sE="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",HM="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",ka="BOGUS_DOCTYPE_STATE",Z0="CDATA_SECTION_STATE",vZ="CDATA_SECTION_BRACKET_STATE",kZ="CDATA_SECTION_END_STATE",Gm="CHARACTER_REFERENCE_STATE",AZ="NAMED_CHARACTER_REFERENCE_STATE",IZ="AMBIGUOS_AMPERSAND_STATE",DZ="NUMERIC_CHARACTER_REFERENCE_STATE",RZ="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",NZ="DECIMAL_CHARACTER_REFERENCE_START_STATE",OZ="HEXADEMICAL_CHARACTER_REFERENCE_STATE",xZ="DECIMAL_CHARACTER_REFERENCE_STATE",oE="NUMERIC_CHARACTER_REFERENCE_END_STATE";function Mt(t){return t===N.SPACE||t===N.LINE_FEED||t===N.TABULATION||t===N.FORM_FEED}function aE(t){return t>=N.DIGIT_0&&t<=N.DIGIT_9}function $o(t){return t>=N.LATIN_CAPITAL_A&&t<=N.LATIN_CAPITAL_Z}function Gu(t){return t>=N.LATIN_SMALL_A&&t<=N.LATIN_SMALL_Z}function ic(t){return Gu(t)||$o(t)}function qM(t){return ic(t)||aE(t)}function UZ(t){return t>=N.LATIN_CAPITAL_A&&t<=N.LATIN_CAPITAL_F}function BZ(t){return t>=N.LATIN_SMALL_A&&t<=N.LATIN_SMALL_F}function sLe(t){return aE(t)||UZ(t)||BZ(t)}function ew(t){return t+32}function tr(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(t>>>10&1023|55296)+String.fromCharCode(56320|t&1023))}function oc(t){return String.fromCharCode(ew(t))}function MZ(t,e){let r=zu[++t],n=++t,s=n+r-1;for(;n<=s;){let o=n+s>>>1,i=zu[o];if(i<e)n=o+1;else if(i>e)s=o-1;else return zu[o+r]}return-1}var ts=class t{constructor(){this.preprocessor=new tLe,this.tokenQueue=[],this.allowCDATA=!1,this.state=Ke,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}_err(){}_errOnNextCodePoint(e){this._consume(),this._err(e),this._unconsume()}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this[this.state](e)}return this.tokenQueue.shift()}write(e,r){this.active=!0,this.preprocessor.write(e,r)}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e)}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:t.HIBERNATION_TOKEN}),!0}return!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}_reconsumeInState(e){this.state=e,this._unconsume()}_consumeSequenceIfMatch(e,r,n){let s=0,o=!0,i=e.length,a=0,l=r,c;for(;a<i;a++){if(a>0&&(l=this._consume(),s++),l===N.EOF){o=!1;break}if(c=e[a],l!==c&&(n||l!==ew(c))){o=!1;break}}if(!o)for(;s--;)this._unconsume();return o}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==Bu.SCRIPT_STRING.length)return!1;for(let e=0;e<this.tempBuff.length;e++)if(this.tempBuff[e]!==Bu.SCRIPT_STRING[e])return!1;return!0}_createStartTagToken(){this.currentToken={type:t.START_TAG_TOKEN,tagName:"",selfClosing:!1,ackSelfClosing:!1,attrs:[]}}_createEndTagToken(){this.currentToken={type:t.END_TAG_TOKEN,tagName:"",selfClosing:!1,attrs:[]}}_createCommentToken(){this.currentToken={type:t.COMMENT_TOKEN,data:""}}_createDoctypeToken(e){this.currentToken={type:t.DOCTYPE_TOKEN,name:e,forceQuirks:!1,publicId:null,systemId:null}}_createCharacterToken(e,r){this.currentCharacterToken={type:e,chars:r}}_createEOFToken(){this.currentToken={type:t.EOF_TOKEN}}_createAttr(e){this.currentAttr={name:e,value:""}}_leaveAttrName(e){t.getTokenAttr(this.currentToken,this.currentAttr.name)===null?this.currentToken.attrs.push(this.currentAttr):this._err(W.duplicateAttribute),this.state=e}_leaveAttrValue(e){this.state=e}_emitCurrentToken(){this._emitCurrentCharacterToken();let e=this.currentToken;this.currentToken=null,e.type===t.START_TAG_TOKEN?this.lastStartTagName=e.tagName:e.type===t.END_TAG_TOKEN&&(e.attrs.length>0&&this._err(W.endTagWithAttributes),e.selfClosing&&this._err(W.endTagWithTrailingSolidus)),this.tokenQueue.push(e)}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken()}_appendCharToCurrentCharacterToken(e,r){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=r:this._createCharacterToken(e,r)}_emitCodePoint(e){let r=t.CHARACTER_TOKEN;Mt(e)?r=t.WHITESPACE_CHARACTER_TOKEN:e===N.NULL&&(r=t.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(r,tr(e))}_emitSeveralCodePoints(e){for(let r=0;r<e.length;r++)this._emitCodePoint(e[r])}_emitChars(e){this._appendCharToCurrentCharacterToken(t.CHARACTER_TOKEN,e)}_matchNamedCharacterReference(e){let r=null,n=1,s=MZ(0,e);for(this.tempBuff.push(e);s>-1;){let o=zu[s],i=o<nLe;i&&o&PZ&&(r=o&LZ?[zu[++s],zu[++s]]:[zu[++s]],n=0);let l=this._consume();if(this.tempBuff.push(l),n++,l===N.EOF)break;i?s=o&FZ?MZ(s,l):-1:s=l===o?++s:-1}for(;n--;)this.tempBuff.pop(),this._unconsume();return r}_isCharacterReferenceInAttribute(){return this.returnState===Y0||this.returnState===W0||this.returnState===K0}_isCharacterReferenceAttributeQuirk(e){if(!e&&this._isCharacterReferenceInAttribute()){let r=this._consume();return this._unconsume(),r===N.EQUALS_SIGN||qM(r)}return!1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let e=0;e<this.tempBuff.length;e++)this.currentAttr.value+=tr(this.tempBuff[e]);else this._emitSeveralCodePoints(this.tempBuff);this.tempBuff=[]}[Ke](e){this.preprocessor.dropParsedChunk(),e===N.LESS_THAN_SIGN?this.state=qJ:e===N.AMPERSAND?(this.returnState=Ke,this.state=Gm):e===N.NULL?(this._err(W.unexpectedNullCharacter),this._emitCodePoint(e)):e===N.EOF?this._emitEOFToken():this._emitCodePoint(e)}[zm](e){this.preprocessor.dropParsedChunk(),e===N.AMPERSAND?(this.returnState=zm,this.state=Gm):e===N.LESS_THAN_SIGN?this.state=YJ:e===N.NULL?(this._err(W.unexpectedNullCharacter),this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?this._emitEOFToken():this._emitCodePoint(e)}[iE](e){this.preprocessor.dropParsedChunk(),e===N.LESS_THAN_SIGN?this.state=VJ:e===N.NULL?(this._err(W.unexpectedNullCharacter),this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?this._emitEOFToken():this._emitCodePoint(e)}[Aa](e){this.preprocessor.dropParsedChunk(),e===N.LESS_THAN_SIGN?this.state=JJ:e===N.NULL?(this._err(W.unexpectedNullCharacter),this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?this._emitEOFToken():this._emitCodePoint(e)}[$Z](e){this.preprocessor.dropParsedChunk(),e===N.NULL?(this._err(W.unexpectedNullCharacter),this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?this._emitEOFToken():this._emitCodePoint(e)}[qJ](e){e===N.EXCLAMATION_MARK?this.state=uZ:e===N.SOLIDUS?this.state=jJ:ic(e)?(this._createStartTagToken(),this._reconsumeInState(PM)):e===N.QUESTION_MARK?(this._err(W.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(),this._reconsumeInState(rE)):e===N.EOF?(this._err(W.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken()):(this._err(W.invalidFirstCharacterOfTagName),this._emitChars("<"),this._reconsumeInState(Ke))}[jJ](e){ic(e)?(this._createEndTagToken(),this._reconsumeInState(PM)):e===N.GREATER_THAN_SIGN?(this._err(W.missingEndTagName),this.state=Ke):e===N.EOF?(this._err(W.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken()):(this._err(W.invalidFirstCharacterOfTagName),this._createCommentToken(),this._reconsumeInState(rE))}[PM](e){Mt(e)?this.state=Ci:e===N.SOLIDUS?this.state=nc:e===N.GREATER_THAN_SIGN?(this.state=Ke,this._emitCurrentToken()):$o(e)?this.currentToken.tagName+=oc(e):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentToken.tagName+=_t.REPLACEMENT_CHARACTER):e===N.EOF?(this._err(W.eofInTag),this._emitEOFToken()):this.currentToken.tagName+=tr(e)}[YJ](e){e===N.SOLIDUS?(this.tempBuff=[],this.state=WJ):(this._emitChars("<"),this._reconsumeInState(zm))}[WJ](e){ic(e)?(this._createEndTagToken(),this._reconsumeInState(KJ)):(this._emitChars("</"),this._reconsumeInState(zm))}[KJ](e){if($o(e))this.currentToken.tagName+=oc(e),this.tempBuff.push(e);else if(Gu(e))this.currentToken.tagName+=tr(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(Mt(e)){this.state=Ci;return}if(e===N.SOLIDUS){this.state=nc;return}if(e===N.GREATER_THAN_SIGN){this.state=Ke,this._emitCurrentToken();return}}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(zm)}}[VJ](e){e===N.SOLIDUS?(this.tempBuff=[],this.state=QJ):(this._emitChars("<"),this._reconsumeInState(iE))}[QJ](e){ic(e)?(this._createEndTagToken(),this._reconsumeInState(XJ)):(this._emitChars("</"),this._reconsumeInState(iE))}[XJ](e){if($o(e))this.currentToken.tagName+=oc(e),this.tempBuff.push(e);else if(Gu(e))this.currentToken.tagName+=tr(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(Mt(e)){this.state=Ci;return}if(e===N.SOLIDUS){this.state=nc;return}if(e===N.GREATER_THAN_SIGN){this._emitCurrentToken(),this.state=Ke;return}}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(iE)}}[JJ](e){e===N.SOLIDUS?(this.tempBuff=[],this.state=ZJ):e===N.EXCLAMATION_MARK?(this.state=tZ,this._emitChars("<!")):(this._emitChars("<"),this._reconsumeInState(Aa))}[ZJ](e){ic(e)?(this._createEndTagToken(),this._reconsumeInState(eZ)):(this._emitChars("</"),this._reconsumeInState(Aa))}[eZ](e){if($o(e))this.currentToken.tagName+=oc(e),this.tempBuff.push(e);else if(Gu(e))this.currentToken.tagName+=tr(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(Mt(e)){this.state=Ci;return}else if(e===N.SOLIDUS){this.state=nc;return}else if(e===N.GREATER_THAN_SIGN){this._emitCurrentToken(),this.state=Ke;return}}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(Aa)}}[tZ](e){e===N.HYPHEN_MINUS?(this.state=rZ,this._emitChars("-")):this._reconsumeInState(Aa)}[rZ](e){e===N.HYPHEN_MINUS?(this.state=LM,this._emitChars("-")):this._reconsumeInState(Aa)}[Fo](e){e===N.HYPHEN_MINUS?(this.state=nZ,this._emitChars("-")):e===N.LESS_THAN_SIGN?this.state=H0:e===N.NULL?(this._err(W.unexpectedNullCharacter),this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?(this._err(W.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):this._emitCodePoint(e)}[nZ](e){e===N.HYPHEN_MINUS?(this.state=LM,this._emitChars("-")):e===N.LESS_THAN_SIGN?this.state=H0:e===N.NULL?(this._err(W.unexpectedNullCharacter),this.state=Fo,this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?(this._err(W.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=Fo,this._emitCodePoint(e))}[LM](e){e===N.HYPHEN_MINUS?this._emitChars("-"):e===N.LESS_THAN_SIGN?this.state=H0:e===N.GREATER_THAN_SIGN?(this.state=Aa,this._emitChars(">")):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.state=Fo,this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?(this._err(W.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=Fo,this._emitCodePoint(e))}[H0](e){e===N.SOLIDUS?(this.tempBuff=[],this.state=sZ):ic(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState(iZ)):(this._emitChars("<"),this._reconsumeInState(Fo))}[sZ](e){ic(e)?(this._createEndTagToken(),this._reconsumeInState(oZ)):(this._emitChars("</"),this._reconsumeInState(Fo))}[oZ](e){if($o(e))this.currentToken.tagName+=oc(e),this.tempBuff.push(e);else if(Gu(e))this.currentToken.tagName+=tr(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(Mt(e)){this.state=Ci;return}if(e===N.SOLIDUS){this.state=nc;return}if(e===N.GREATER_THAN_SIGN){this._emitCurrentToken(),this.state=Ke;return}}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(Fo)}}[iZ](e){Mt(e)||e===N.SOLIDUS||e===N.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?va:Fo,this._emitCodePoint(e)):$o(e)?(this.tempBuff.push(ew(e)),this._emitCodePoint(e)):Gu(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(Fo)}[va](e){e===N.HYPHEN_MINUS?(this.state=aZ,this._emitChars("-")):e===N.LESS_THAN_SIGN?(this.state=q0,this._emitChars("<")):e===N.NULL?(this._err(W.unexpectedNullCharacter),this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?(this._err(W.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):this._emitCodePoint(e)}[aZ](e){e===N.HYPHEN_MINUS?(this.state=lZ,this._emitChars("-")):e===N.LESS_THAN_SIGN?(this.state=q0,this._emitChars("<")):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.state=va,this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?(this._err(W.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=va,this._emitCodePoint(e))}[lZ](e){e===N.HYPHEN_MINUS?this._emitChars("-"):e===N.LESS_THAN_SIGN?(this.state=q0,this._emitChars("<")):e===N.GREATER_THAN_SIGN?(this.state=Aa,this._emitChars(">")):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.state=va,this._emitChars(_t.REPLACEMENT_CHARACTER)):e===N.EOF?(this._err(W.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=va,this._emitCodePoint(e))}[q0](e){e===N.SOLIDUS?(this.tempBuff=[],this.state=cZ,this._emitChars("/")):this._reconsumeInState(va)}[cZ](e){Mt(e)||e===N.SOLIDUS||e===N.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?Fo:va,this._emitCodePoint(e)):$o(e)?(this.tempBuff.push(ew(e)),this._emitCodePoint(e)):Gu(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(va)}[Ci](e){Mt(e)||(e===N.SOLIDUS||e===N.GREATER_THAN_SIGN||e===N.EOF?this._reconsumeInState(FM):e===N.EQUALS_SIGN?(this._err(W.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=j0):(this._createAttr(""),this._reconsumeInState(j0)))}[j0](e){Mt(e)||e===N.SOLIDUS||e===N.GREATER_THAN_SIGN||e===N.EOF?(this._leaveAttrName(FM),this._unconsume()):e===N.EQUALS_SIGN?this._leaveAttrName($M):$o(e)?this.currentAttr.name+=oc(e):e===N.QUOTATION_MARK||e===N.APOSTROPHE||e===N.LESS_THAN_SIGN?(this._err(W.unexpectedCharacterInAttributeName),this.currentAttr.name+=tr(e)):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentAttr.name+=_t.REPLACEMENT_CHARACTER):this.currentAttr.name+=tr(e)}[FM](e){Mt(e)||(e===N.SOLIDUS?this.state=nc:e===N.EQUALS_SIGN?this.state=$M:e===N.GREATER_THAN_SIGN?(this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState(j0)))}[$M](e){Mt(e)||(e===N.QUOTATION_MARK?this.state=Y0:e===N.APOSTROPHE?this.state=W0:e===N.GREATER_THAN_SIGN?(this._err(W.missingAttributeValue),this.state=Ke,this._emitCurrentToken()):this._reconsumeInState(K0))}[Y0](e){e===N.QUOTATION_MARK?this.state=UM:e===N.AMPERSAND?(this.returnState=Y0,this.state=Gm):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentAttr.value+=_t.REPLACEMENT_CHARACTER):e===N.EOF?(this._err(W.eofInTag),this._emitEOFToken()):this.currentAttr.value+=tr(e)}[W0](e){e===N.APOSTROPHE?this.state=UM:e===N.AMPERSAND?(this.returnState=W0,this.state=Gm):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentAttr.value+=_t.REPLACEMENT_CHARACTER):e===N.EOF?(this._err(W.eofInTag),this._emitEOFToken()):this.currentAttr.value+=tr(e)}[K0](e){Mt(e)?this._leaveAttrValue(Ci):e===N.AMPERSAND?(this.returnState=K0,this.state=Gm):e===N.GREATER_THAN_SIGN?(this._leaveAttrValue(Ke),this._emitCurrentToken()):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentAttr.value+=_t.REPLACEMENT_CHARACTER):e===N.QUOTATION_MARK||e===N.APOSTROPHE||e===N.LESS_THAN_SIGN||e===N.EQUALS_SIGN||e===N.GRAVE_ACCENT?(this._err(W.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=tr(e)):e===N.EOF?(this._err(W.eofInTag),this._emitEOFToken()):this.currentAttr.value+=tr(e)}[UM](e){Mt(e)?this._leaveAttrValue(Ci):e===N.SOLIDUS?this._leaveAttrValue(nc):e===N.GREATER_THAN_SIGN?(this._leaveAttrValue(Ke),this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInTag),this._emitEOFToken()):(this._err(W.missingWhitespaceBetweenAttributes),this._reconsumeInState(Ci))}[nc](e){e===N.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInTag),this._emitEOFToken()):(this._err(W.unexpectedSolidusInTag),this._reconsumeInState(Ci))}[rE](e){e===N.GREATER_THAN_SIGN?(this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentToken.data+=_t.REPLACEMENT_CHARACTER):this.currentToken.data+=tr(e)}[uZ](e){this._consumeSequenceIfMatch(Bu.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state=dZ):this._consumeSequenceIfMatch(Bu.DOCTYPE_STRING,e,!1)?this.state=EZ:this._consumeSequenceIfMatch(Bu.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state=Z0:(this._err(W.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state=rE):this._ensureHibernation()||(this._err(W.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState(rE))}[dZ](e){e===N.HYPHEN_MINUS?this.state=pZ:e===N.GREATER_THAN_SIGN?(this._err(W.abruptClosingOfEmptyComment),this.state=Ke,this._emitCurrentToken()):this._reconsumeInState(sc)}[pZ](e){e===N.HYPHEN_MINUS?this.state=Q0:e===N.GREATER_THAN_SIGN?(this._err(W.abruptClosingOfEmptyComment),this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(sc))}[sc](e){e===N.HYPHEN_MINUS?this.state=V0:e===N.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state=mZ):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentToken.data+=_t.REPLACEMENT_CHARACTER):e===N.EOF?(this._err(W.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=tr(e)}[mZ](e){e===N.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state=fZ):e===N.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState(sc)}[fZ](e){e===N.HYPHEN_MINUS?this.state=hZ:this._reconsumeInState(sc)}[hZ](e){e===N.HYPHEN_MINUS?this.state=gZ:this._reconsumeInState(V0)}[gZ](e){e!==N.GREATER_THAN_SIGN&&e!==N.EOF&&this._err(W.nestedComment),this._reconsumeInState(Q0)}[V0](e){e===N.HYPHEN_MINUS?this.state=Q0:e===N.EOF?(this._err(W.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(sc))}[Q0](e){e===N.GREATER_THAN_SIGN?(this.state=Ke,this._emitCurrentToken()):e===N.EXCLAMATION_MARK?this.state=_Z:e===N.HYPHEN_MINUS?this.currentToken.data+="-":e===N.EOF?(this._err(W.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState(sc))}[_Z](e){e===N.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state=V0):e===N.GREATER_THAN_SIGN?(this._err(W.incorrectlyClosedComment),this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState(sc))}[EZ](e){Mt(e)?this.state=X0:e===N.GREATER_THAN_SIGN?this._reconsumeInState(X0):e===N.EOF?(this._err(W.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(W.missingWhitespaceBeforeDoctypeName),this._reconsumeInState(X0))}[X0](e){Mt(e)||($o(e)?(this._createDoctypeToken(oc(e)),this.state=J0):e===N.NULL?(this._err(W.unexpectedNullCharacter),this._createDoctypeToken(_t.REPLACEMENT_CHARACTER),this.state=J0):e===N.GREATER_THAN_SIGN?(this._err(W.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=Ke):e===N.EOF?(this._err(W.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(tr(e)),this.state=J0))}[J0](e){Mt(e)?this.state=yZ:e===N.GREATER_THAN_SIGN?(this.state=Ke,this._emitCurrentToken()):$o(e)?this.currentToken.name+=oc(e):e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentToken.name+=_t.REPLACEMENT_CHARACTER):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=tr(e)}[yZ](e){Mt(e)||(e===N.GREATER_THAN_SIGN?(this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(Bu.PUBLIC_STRING,e,!1)?this.state=SZ:this._consumeSequenceIfMatch(Bu.SYSTEM_STRING,e,!1)?this.state=wZ:this._ensureHibernation()||(this._err(W.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState(ka)))}[SZ](e){Mt(e)?this.state=bZ:e===N.QUOTATION_MARK?(this._err(W.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=BM):e===N.APOSTROPHE?(this._err(W.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=GM):e===N.GREATER_THAN_SIGN?(this._err(W.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(W.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(ka))}[bZ](e){Mt(e)||(e===N.QUOTATION_MARK?(this.currentToken.publicId="",this.state=BM):e===N.APOSTROPHE?(this.currentToken.publicId="",this.state=GM):e===N.GREATER_THAN_SIGN?(this._err(W.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(W.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(ka)))}[BM](e){e===N.QUOTATION_MARK?this.state=zM:e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentToken.publicId+=_t.REPLACEMENT_CHARACTER):e===N.GREATER_THAN_SIGN?(this._err(W.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=Ke):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=tr(e)}[GM](e){e===N.APOSTROPHE?this.state=zM:e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentToken.publicId+=_t.REPLACEMENT_CHARACTER):e===N.GREATER_THAN_SIGN?(this._err(W.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=Ke):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=tr(e)}[zM](e){Mt(e)?this.state=TZ:e===N.GREATER_THAN_SIGN?(this.state=Ke,this._emitCurrentToken()):e===N.QUOTATION_MARK?(this._err(W.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=nE):e===N.APOSTROPHE?(this._err(W.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=sE):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(W.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(ka))}[TZ](e){Mt(e)||(e===N.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=Ke):e===N.QUOTATION_MARK?(this.currentToken.systemId="",this.state=nE):e===N.APOSTROPHE?(this.currentToken.systemId="",this.state=sE):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(W.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(ka)))}[wZ](e){Mt(e)?this.state=CZ:e===N.QUOTATION_MARK?(this._err(W.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=nE):e===N.APOSTROPHE?(this._err(W.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=sE):e===N.GREATER_THAN_SIGN?(this._err(W.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(W.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(ka))}[CZ](e){Mt(e)||(e===N.QUOTATION_MARK?(this.currentToken.systemId="",this.state=nE):e===N.APOSTROPHE?(this.currentToken.systemId="",this.state=sE):e===N.GREATER_THAN_SIGN?(this._err(W.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=Ke,this._emitCurrentToken()):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(W.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(ka)))}[nE](e){e===N.QUOTATION_MARK?this.state=HM:e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentToken.systemId+=_t.REPLACEMENT_CHARACTER):e===N.GREATER_THAN_SIGN?(this._err(W.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=Ke):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=tr(e)}[sE](e){e===N.APOSTROPHE?this.state=HM:e===N.NULL?(this._err(W.unexpectedNullCharacter),this.currentToken.systemId+=_t.REPLACEMENT_CHARACTER):e===N.GREATER_THAN_SIGN?(this._err(W.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=Ke):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=tr(e)}[HM](e){Mt(e)||(e===N.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=Ke):e===N.EOF?(this._err(W.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(W.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState(ka)))}[ka](e){e===N.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=Ke):e===N.NULL?this._err(W.unexpectedNullCharacter):e===N.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}[Z0](e){e===N.RIGHT_SQUARE_BRACKET?this.state=vZ:e===N.EOF?(this._err(W.eofInCdata),this._emitEOFToken()):this._emitCodePoint(e)}[vZ](e){e===N.RIGHT_SQUARE_BRACKET?this.state=kZ:(this._emitChars("]"),this._reconsumeInState(Z0))}[kZ](e){e===N.GREATER_THAN_SIGN?this.state=Ke:e===N.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState(Z0))}[Gm](e){this.tempBuff=[N.AMPERSAND],e===N.NUMBER_SIGN?(this.tempBuff.push(e),this.state=DZ):qM(e)?this._reconsumeInState(AZ):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}[AZ](e){let r=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[N.AMPERSAND];else if(r){let n=this.tempBuff[this.tempBuff.length-1]===N.SEMICOLON;this._isCharacterReferenceAttributeQuirk(n)||(n||this._errOnNextCodePoint(W.missingSemicolonAfterCharacterReference),this.tempBuff=r),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state=IZ}[IZ](e){qM(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=tr(e):this._emitCodePoint(e):(e===N.SEMICOLON&&this._err(W.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}[DZ](e){this.charRefCode=0,e===N.LATIN_SMALL_X||e===N.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state=RZ):this._reconsumeInState(NZ)}[RZ](e){sLe(e)?this._reconsumeInState(OZ):(this._err(W.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}[NZ](e){aE(e)?this._reconsumeInState(xZ):(this._err(W.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}[OZ](e){UZ(e)?this.charRefCode=this.charRefCode*16+e-55:BZ(e)?this.charRefCode=this.charRefCode*16+e-87:aE(e)?this.charRefCode=this.charRefCode*16+e-48:e===N.SEMICOLON?this.state=oE:(this._err(W.missingSemicolonAfterCharacterReference),this._reconsumeInState(oE))}[xZ](e){aE(e)?this.charRefCode=this.charRefCode*10+e-48:e===N.SEMICOLON?this.state=oE:(this._err(W.missingSemicolonAfterCharacterReference),this._reconsumeInState(oE))}[oE](){if(this.charRefCode===N.NULL)this._err(W.nullCharacterReference),this.charRefCode=N.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(W.characterReferenceOutsideUnicodeRange),this.charRefCode=N.REPLACEMENT_CHARACTER;else if(_t.isSurrogate(this.charRefCode))this._err(W.surrogateCharacterReference),this.charRefCode=N.REPLACEMENT_CHARACTER;else if(_t.isUndefinedCodePoint(this.charRefCode))this._err(W.noncharacterCharacterReference);else if(_t.isControlCodePoint(this.charRefCode)||this.charRefCode===N.CARRIAGE_RETURN){this._err(W.controlCharacterReference);let e=rLe[this.charRefCode];e&&(this.charRefCode=e)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}};ts.CHARACTER_TOKEN="CHARACTER_TOKEN";ts.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN";ts.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN";ts.START_TAG_TOKEN="START_TAG_TOKEN";ts.END_TAG_TOKEN="END_TAG_TOKEN";ts.COMMENT_TOKEN="COMMENT_TOKEN";ts.DOCTYPE_TOKEN="DOCTYPE_TOKEN";ts.EOF_TOKEN="EOF_TOKEN";ts.HIBERNATION_TOKEN="HIBERNATION_TOKEN";ts.MODE={DATA:Ke,RCDATA:zm,RAWTEXT:iE,SCRIPT_DATA:Aa,PLAINTEXT:$Z};ts.getTokenAttr=function(t,e){for(let r=t.attrs.length-1;r>=0;r--)if(t.attrs[r].name===e)return t.attrs[r].value;return null};GZ.exports=ts});var ac=w(Hm=>{"use strict";var jM=Hm.NAMESPACES={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/"};Hm.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"};Hm.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};var re=Hm.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};Hm.SPECIAL_ELEMENTS={[jM.HTML]:{[re.ADDRESS]:!0,[re.APPLET]:!0,[re.AREA]:!0,[re.ARTICLE]:!0,[re.ASIDE]:!0,[re.BASE]:!0,[re.BASEFONT]:!0,[re.BGSOUND]:!0,[re.BLOCKQUOTE]:!0,[re.BODY]:!0,[re.BR]:!0,[re.BUTTON]:!0,[re.CAPTION]:!0,[re.CENTER]:!0,[re.COL]:!0,[re.COLGROUP]:!0,[re.DD]:!0,[re.DETAILS]:!0,[re.DIR]:!0,[re.DIV]:!0,[re.DL]:!0,[re.DT]:!0,[re.EMBED]:!0,[re.FIELDSET]:!0,[re.FIGCAPTION]:!0,[re.FIGURE]:!0,[re.FOOTER]:!0,[re.FORM]:!0,[re.FRAME]:!0,[re.FRAMESET]:!0,[re.H1]:!0,[re.H2]:!0,[re.H3]:!0,[re.H4]:!0,[re.H5]:!0,[re.H6]:!0,[re.HEAD]:!0,[re.HEADER]:!0,[re.HGROUP]:!0,[re.HR]:!0,[re.HTML]:!0,[re.IFRAME]:!0,[re.IMG]:!0,[re.INPUT]:!0,[re.LI]:!0,[re.LINK]:!0,[re.LISTING]:!0,[re.MAIN]:!0,[re.MARQUEE]:!0,[re.MENU]:!0,[re.META]:!0,[re.NAV]:!0,[re.NOEMBED]:!0,[re.NOFRAMES]:!0,[re.NOSCRIPT]:!0,[re.OBJECT]:!0,[re.OL]:!0,[re.P]:!0,[re.PARAM]:!0,[re.PLAINTEXT]:!0,[re.PRE]:!0,[re.SCRIPT]:!0,[re.SECTION]:!0,[re.SELECT]:!0,[re.SOURCE]:!0,[re.STYLE]:!0,[re.SUMMARY]:!0,[re.TABLE]:!0,[re.TBODY]:!0,[re.TD]:!0,[re.TEMPLATE]:!0,[re.TEXTAREA]:!0,[re.TFOOT]:!0,[re.TH]:!0,[re.THEAD]:!0,[re.TITLE]:!0,[re.TR]:!0,[re.TRACK]:!0,[re.UL]:!0,[re.WBR]:!0,[re.XMP]:!0},[jM.MATHML]:{[re.MI]:!0,[re.MO]:!0,[re.MN]:!0,[re.MS]:!0,[re.MTEXT]:!0,[re.ANNOTATION_XML]:!0},[jM.SVG]:{[re.TITLE]:!0,[re.FOREIGN_OBJECT]:!0,[re.DESC]:!0}}});var jZ=w((Uft,qZ)=>{"use strict";var HZ=ac(),se=HZ.TAG_NAMES,Et=HZ.NAMESPACES;function zZ(t){switch(t.length){case 1:return t===se.P;case 2:return t===se.RB||t===se.RP||t===se.RT||t===se.DD||t===se.DT||t===se.LI;case 3:return t===se.RTC;case 6:return t===se.OPTION;case 8:return t===se.OPTGROUP}return!1}function oLe(t){switch(t.length){case 1:return t===se.P;case 2:return t===se.RB||t===se.RP||t===se.RT||t===se.DD||t===se.DT||t===se.LI||t===se.TD||t===se.TH||t===se.TR;case 3:return t===se.RTC;case 5:return t===se.TBODY||t===se.TFOOT||t===se.THEAD;case 6:return t===se.OPTION;case 7:return t===se.CAPTION;case 8:return t===se.OPTGROUP||t===se.COLGROUP}return!1}function tw(t,e){switch(t.length){case 2:if(t===se.TD||t===se.TH)return e===Et.HTML;if(t===se.MI||t===se.MO||t===se.MN||t===se.MS)return e===Et.MATHML;break;case 4:if(t===se.HTML)return e===Et.HTML;if(t===se.DESC)return e===Et.SVG;break;case 5:if(t===se.TABLE)return e===Et.HTML;if(t===se.MTEXT)return e===Et.MATHML;if(t===se.TITLE)return e===Et.SVG;break;case 6:return(t===se.APPLET||t===se.OBJECT)&&e===Et.HTML;case 7:return(t===se.CAPTION||t===se.MARQUEE)&&e===Et.HTML;case 8:return t===se.TEMPLATE&&e===Et.HTML;case 13:return t===se.FOREIGN_OBJECT&&e===Et.SVG;case 14:return t===se.ANNOTATION_XML&&e===Et.MATHML}return!1}var YM=class{constructor(e,r){this.stackTop=-1,this.items=[],this.current=e,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=r}_indexOf(e){let r=-1;for(let n=this.stackTop;n>=0;n--)if(this.items[n]===e){r=n;break}return r}_isInTemplate(){return this.currentTagName===se.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Et.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null}push(e){this.items[++this.stackTop]=e,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++}pop(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement()}replace(e,r){let n=this._indexOf(e);this.items[n]=r,n===this.stackTop&&this._updateCurrentElement()}insertAfter(e,r){let n=this._indexOf(e)+1;this.items.splice(n,0,r),n===++this.stackTop&&this._updateCurrentElement()}popUntilTagNamePopped(e){for(;this.stackTop>-1;){let r=this.currentTagName,n=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),r===e&&n===Et.HTML)break}}popUntilElementPopped(e){for(;this.stackTop>-1;){let r=this.current;if(this.pop(),r===e)break}}popUntilNumberedHeaderPopped(){for(;this.stackTop>-1;){let e=this.currentTagName,r=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===se.H1||e===se.H2||e===se.H3||e===se.H4||e===se.H5||e===se.H6&&r===Et.HTML)break}}popUntilTableCellPopped(){for(;this.stackTop>-1;){let e=this.currentTagName,r=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===se.TD||e===se.TH&&r===Et.HTML)break}}popAllUpToHtmlElement(){this.stackTop=0,this._updateCurrentElement()}clearBackToTableContext(){for(;this.currentTagName!==se.TABLE&&this.currentTagName!==se.TEMPLATE&&this.currentTagName!==se.HTML||this.treeAdapter.getNamespaceURI(this.current)!==Et.HTML;)this.pop()}clearBackToTableBodyContext(){for(;this.currentTagName!==se.TBODY&&this.currentTagName!==se.TFOOT&&this.currentTagName!==se.THEAD&&this.currentTagName!==se.TEMPLATE&&this.currentTagName!==se.HTML||this.treeAdapter.getNamespaceURI(this.current)!==Et.HTML;)this.pop()}clearBackToTableRowContext(){for(;this.currentTagName!==se.TR&&this.currentTagName!==se.TEMPLATE&&this.currentTagName!==se.HTML||this.treeAdapter.getNamespaceURI(this.current)!==Et.HTML;)this.pop()}remove(e){for(let r=this.stackTop;r>=0;r--)if(this.items[r]===e){this.items.splice(r,1),this.stackTop--,this._updateCurrentElement();break}}tryPeekProperlyNestedBodyElement(){let e=this.items[1];return e&&this.treeAdapter.getTagName(e)===se.BODY?e:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let r=this._indexOf(e);return--r>=0?this.items[r]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.currentTagName===se.HTML}hasInScope(e){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]),s=this.treeAdapter.getNamespaceURI(this.items[r]);if(n===e&&s===Et.HTML)return!0;if(tw(n,s))return!1}return!0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let r=this.treeAdapter.getTagName(this.items[e]),n=this.treeAdapter.getNamespaceURI(this.items[e]);if((r===se.H1||r===se.H2||r===se.H3||r===se.H4||r===se.H5||r===se.H6)&&n===Et.HTML)return!0;if(tw(r,n))return!1}return!0}hasInListItemScope(e){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]),s=this.treeAdapter.getNamespaceURI(this.items[r]);if(n===e&&s===Et.HTML)return!0;if((n===se.UL||n===se.OL)&&s===Et.HTML||tw(n,s))return!1}return!0}hasInButtonScope(e){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]),s=this.treeAdapter.getNamespaceURI(this.items[r]);if(n===e&&s===Et.HTML)return!0;if(n===se.BUTTON&&s===Et.HTML||tw(n,s))return!1}return!0}hasInTableScope(e){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]);if(this.treeAdapter.getNamespaceURI(this.items[r])===Et.HTML){if(n===e)return!0;if(n===se.TABLE||n===se.TEMPLATE||n===se.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){let r=this.treeAdapter.getTagName(this.items[e]);if(this.treeAdapter.getNamespaceURI(this.items[e])===Et.HTML){if(r===se.TBODY||r===se.THEAD||r===se.TFOOT)return!0;if(r===se.TABLE||r===se.HTML)return!1}}return!0}hasInSelectScope(e){for(let r=this.stackTop;r>=0;r--){let n=this.treeAdapter.getTagName(this.items[r]);if(this.treeAdapter.getNamespaceURI(this.items[r])===Et.HTML){if(n===e)return!0;if(n!==se.OPTION&&n!==se.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;zZ(this.currentTagName);)this.pop()}generateImpliedEndTagsThoroughly(){for(;oLe(this.currentTagName);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;zZ(this.currentTagName)&&this.currentTagName!==e;)this.pop()}};qZ.exports=YM});var WZ=w((Bft,YZ)=>{"use strict";var cE=class t{constructor(e){this.length=0,this.entries=[],this.treeAdapter=e,this.bookmark=null}_getNoahArkConditionCandidates(e){let r=[];if(this.length>=3){let n=this.treeAdapter.getAttrList(e).length,s=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let i=this.length-1;i>=0;i--){let a=this.entries[i];if(a.type===t.MARKER_ENTRY)break;let l=a.element,c=this.treeAdapter.getAttrList(l);this.treeAdapter.getTagName(l)===s&&this.treeAdapter.getNamespaceURI(l)===o&&c.length===n&&r.push({idx:i,attrs:c})}}return r.length<3?[]:r}_ensureNoahArkCondition(e){let r=this._getNoahArkConditionCandidates(e),n=r.length;if(n){let s=this.treeAdapter.getAttrList(e),o=s.length,i=Object.create(null);for(let a=0;a<o;a++){let l=s[a];i[l.name]=l.value}for(let a=0;a<o;a++)for(let l=0;l<n;l++){let c=r[l].attrs[a];if(i[c.name]!==c.value&&(r.splice(l,1),n--),r.length<3)return}for(let a=n-1;a>=2;a--)this.entries.splice(r[a].idx,1),this.length--}}insertMarker(){this.entries.push({type:t.MARKER_ENTRY}),this.length++}pushElement(e,r){this._ensureNoahArkCondition(e),this.entries.push({type:t.ELEMENT_ENTRY,element:e,token:r}),this.length++}insertElementAfterBookmark(e,r){let n=this.length-1;for(;n>=0&&this.entries[n]!==this.bookmark;n--);this.entries.splice(n+1,0,{type:t.ELEMENT_ENTRY,element:e,token:r}),this.length++}removeEntry(e){for(let r=this.length-1;r>=0;r--)if(this.entries[r]===e){this.entries.splice(r,1),this.length--;break}}clearToLastMarker(){for(;this.length;){let e=this.entries.pop();if(this.length--,e.type===t.MARKER_ENTRY)break}}getElementEntryInScopeWithTagName(e){for(let r=this.length-1;r>=0;r--){let n=this.entries[r];if(n.type===t.MARKER_ENTRY)return null;if(this.treeAdapter.getTagName(n.element)===e)return n}return null}getElementEntry(e){for(let r=this.length-1;r>=0;r--){let n=this.entries[r];if(n.type===t.ELEMENT_ENTRY&&n.element===e)return n}return null}};cE.MARKER_ENTRY="MARKER_ENTRY";cE.ELEMENT_ENTRY="ELEMENT_ENTRY";YZ.exports=cE});var vi=w((Gft,KZ)=>{"use strict";var rw=class{constructor(e){let r={},n=this._getOverriddenMethods(this,r);for(let s of Object.keys(n))typeof n[s]=="function"&&(r[s]=e[s],e[s]=n[s])}_getOverriddenMethods(){throw new Error("Not implemented")}};rw.install=function(t,e,r){t.__mixins||(t.__mixins=[]);for(let s=0;s<t.__mixins.length;s++)if(t.__mixins[s].constructor===e)return t.__mixins[s];let n=new e(t,r);return t.__mixins.push(n),n};KZ.exports=rw});var KM=w((zft,VZ)=>{"use strict";var iLe=vi(),WM=class extends iLe{constructor(e){super(e),this.preprocessor=e,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.offset=0,this.col=0,this.line=1}_getOverriddenMethods(e,r){return{advance(){let n=this.pos+1,s=this.html[n];return e.isEol&&(e.isEol=!1,e.line++,e.lineStartPos=n),(s===`
1087
1087
  `||s==="\r"&&this.html[n+1]!==`
1088
1088
  `)&&(e.isEol=!0),e.col=n-e.lineStartPos+1,e.offset=e.droppedBufferSize+n,r.advance.call(this)},retreat(){r.retreat.call(this),e.isEol=!1,e.col=this.pos-e.lineStartPos+1},dropParsedChunk(){let n=this.pos;r.dropParsedChunk.call(this);let s=n-this.pos;e.lineStartPos-=s,e.droppedBufferSize+=s,e.offset=e.droppedBufferSize+this.pos}}}};VZ.exports=WM});var XM=w((Hft,XZ)=>{"use strict";var QZ=vi(),VM=lE(),aLe=KM(),QM=class extends QZ{constructor(e){super(e),this.tokenizer=e,this.posTracker=QZ.install(e.preprocessor,aLe),this.currentAttrLocation=null,this.ctLoc=null}_getCurrentLocation(){return{startLine:this.posTracker.line,startCol:this.posTracker.col,startOffset:this.posTracker.offset,endLine:-1,endCol:-1,endOffset:-1}}_attachCurrentAttrLocationInfo(){this.currentAttrLocation.endLine=this.posTracker.line,this.currentAttrLocation.endCol=this.posTracker.col,this.currentAttrLocation.endOffset=this.posTracker.offset;let e=this.tokenizer.currentToken,r=this.tokenizer.currentAttr;e.location.attrs||(e.location.attrs=Object.create(null)),e.location.attrs[r.name]=this.currentAttrLocation}_getOverriddenMethods(e,r){let n={_createStartTagToken(){r._createStartTagToken.call(this),this.currentToken.location=e.ctLoc},_createEndTagToken(){r._createEndTagToken.call(this),this.currentToken.location=e.ctLoc},_createCommentToken(){r._createCommentToken.call(this),this.currentToken.location=e.ctLoc},_createDoctypeToken(s){r._createDoctypeToken.call(this,s),this.currentToken.location=e.ctLoc},_createCharacterToken(s,o){r._createCharacterToken.call(this,s,o),this.currentCharacterToken.location=e.ctLoc},_createEOFToken(){r._createEOFToken.call(this),this.currentToken.location=e._getCurrentLocation()},_createAttr(s){r._createAttr.call(this,s),e.currentAttrLocation=e._getCurrentLocation()},_leaveAttrName(s){r._leaveAttrName.call(this,s),e._attachCurrentAttrLocationInfo()},_leaveAttrValue(s){r._leaveAttrValue.call(this,s),e._attachCurrentAttrLocationInfo()},_emitCurrentToken(){let s=this.currentToken.location;this.currentCharacterToken&&(this.currentCharacterToken.location.endLine=s.startLine,this.currentCharacterToken.location.endCol=s.startCol,this.currentCharacterToken.location.endOffset=s.startOffset),this.currentToken.type===VM.EOF_TOKEN?(s.endLine=s.startLine,s.endCol=s.startCol,s.endOffset=s.startOffset):(s.endLine=e.posTracker.line,s.endCol=e.posTracker.col+1,s.endOffset=e.posTracker.offset+1),r._emitCurrentToken.call(this)},_emitCurrentCharacterToken(){let s=this.currentCharacterToken&&this.currentCharacterToken.location;s&&s.endOffset===-1&&(s.endLine=e.posTracker.line,s.endCol=e.posTracker.col,s.endOffset=e.posTracker.offset),r._emitCurrentCharacterToken.call(this)}};return Object.keys(VM.MODE).forEach(s=>{let o=VM.MODE[s];n[o]=function(i){e.ctLoc=e._getCurrentLocation(),r[o].call(this,i)}}),n}};XZ.exports=QM});var ZZ=w((qft,JZ)=>{"use strict";var lLe=vi(),JM=class extends lLe{constructor(e,r){super(e),this.onItemPop=r.onItemPop}_getOverriddenMethods(e,r){return{pop(){e.onItemPop(this.current),r.pop.call(this)},popAllUpToHtmlElement(){for(let n=this.stackTop;n>0;n--)e.onItemPop(this.items[n]);r.popAllUpToHtmlElement.call(this)},remove(n){e.onItemPop(this.current),r.remove.call(this,n)}}}};JZ.exports=JM});var ree=w((jft,tee)=>{"use strict";var ZM=vi(),eee=lE(),cLe=XM(),uLe=ZZ(),dLe=ac(),eP=dLe.TAG_NAMES,tP=class extends ZM{constructor(e){super(e),this.parser=e,this.treeAdapter=this.parser.treeAdapter,this.posTracker=null,this.lastStartTagToken=null,this.lastFosterParentingLocation=null,this.currentToken=null}_setStartLocation(e){let r=null;this.lastStartTagToken&&(r=Object.assign({},this.lastStartTagToken.location),r.startTag=this.lastStartTagToken.location),this.treeAdapter.setNodeSourceCodeLocation(e,r)}_setEndLocation(e,r){let n=this.treeAdapter.getNodeSourceCodeLocation(e);if(n&&r.location){let s=r.location,o=this.treeAdapter.getTagName(e);r.type===eee.END_TAG_TOKEN&&o===r.tagName?(n.endTag=Object.assign({},s),n.endLine=s.endLine,n.endCol=s.endCol,n.endOffset=s.endOffset):(n.endLine=s.startLine,n.endCol=s.startCol,n.endOffset=s.startOffset)}}_getOverriddenMethods(e,r){return{_bootstrap(n,s){r._bootstrap.call(this,n,s),e.lastStartTagToken=null,e.lastFosterParentingLocation=null,e.currentToken=null;let o=ZM.install(this.tokenizer,cLe);e.posTracker=o.posTracker,ZM.install(this.openElements,uLe,{onItemPop:function(i){e._setEndLocation(i,e.currentToken)}})},_runParsingLoop(n){r._runParsingLoop.call(this,n);for(let s=this.openElements.stackTop;s>=0;s--)e._setEndLocation(this.openElements.items[s],e.currentToken)},_processTokenInForeignContent(n){e.currentToken=n,r._processTokenInForeignContent.call(this,n)},_processToken(n){if(e.currentToken=n,r._processToken.call(this,n),n.type===eee.END_TAG_TOKEN&&(n.tagName===eP.HTML||n.tagName===eP.BODY&&this.openElements.hasInScope(eP.BODY)))for(let o=this.openElements.stackTop;o>=0;o--){let i=this.openElements.items[o];if(this.treeAdapter.getTagName(i)===n.tagName){e._setEndLocation(i,n);break}}},_setDocumentType(n){r._setDocumentType.call(this,n);let s=this.treeAdapter.getChildNodes(this.document),o=s.length;for(let i=0;i<o;i++){let a=s[i];if(this.treeAdapter.isDocumentTypeNode(a)){this.treeAdapter.setNodeSourceCodeLocation(a,n.location);break}}},_attachElementToTree(n){e._setStartLocation(n),e.lastStartTagToken=null,r._attachElementToTree.call(this,n)},_appendElement(n,s){e.lastStartTagToken=n,r._appendElement.call(this,n,s)},_insertElement(n,s){e.lastStartTagToken=n,r._insertElement.call(this,n,s)},_insertTemplate(n){e.lastStartTagToken=n,r._insertTemplate.call(this,n);let s=this.treeAdapter.getTemplateContent(this.openElements.current);this.treeAdapter.setNodeSourceCodeLocation(s,null)},_insertFakeRootElement(){r._insertFakeRootElement.call(this),this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current,null)},_appendCommentNode(n,s){r._appendCommentNode.call(this,n,s);let o=this.treeAdapter.getChildNodes(s),i=o[o.length-1];this.treeAdapter.setNodeSourceCodeLocation(i,n.location)},_findFosterParentingLocation(){return e.lastFosterParentingLocation=r._findFosterParentingLocation.call(this),e.lastFosterParentingLocation},_insertCharacters(n){r._insertCharacters.call(this,n);let s=this._shouldFosterParentOnInsertion(),o=s&&e.lastFosterParentingLocation.parent||this.openElements.currentTmplContent||this.openElements.current,i=this.treeAdapter.getChildNodes(o),a=s&&e.lastFosterParentingLocation.beforeElement?i.indexOf(e.lastFosterParentingLocation.beforeElement)-1:i.length-1,l=i[a],c=this.treeAdapter.getNodeSourceCodeLocation(l);c?(c.endLine=n.location.endLine,c.endCol=n.location.endCol,c.endOffset=n.location.endOffset):this.treeAdapter.setNodeSourceCodeLocation(l,n.location)}}}};tee.exports=tP});var nw=w((Yft,nee)=>{"use strict";var pLe=vi(),rP=class extends pLe{constructor(e,r){super(e),this.posTracker=null,this.onParseError=r.onParseError}_setErrorLocation(e){e.startLine=e.endLine=this.posTracker.line,e.startCol=e.endCol=this.posTracker.col,e.startOffset=e.endOffset=this.posTracker.offset}_reportError(e){let r={code:e,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(r),this.onParseError(r)}_getOverriddenMethods(e){return{_err(r){e._reportError(r)}}}};nee.exports=rP});var oee=w((Wft,see)=>{"use strict";var mLe=nw(),fLe=KM(),hLe=vi(),nP=class extends mLe{constructor(e,r){super(e,r),this.posTracker=hLe.install(e,fLe),this.lastErrOffset=-1}_reportError(e){this.lastErrOffset!==this.posTracker.offset&&(this.lastErrOffset=this.posTracker.offset,super._reportError(e))}};see.exports=nP});var aee=w((Kft,iee)=>{"use strict";var gLe=nw(),_Le=oee(),ELe=vi(),sP=class extends gLe{constructor(e,r){super(e,r);let n=ELe.install(e.preprocessor,_Le,r);this.posTracker=n.posTracker}};iee.exports=sP});var uee=w((Vft,cee)=>{"use strict";var yLe=nw(),SLe=aee(),bLe=XM(),lee=vi(),oP=class extends yLe{constructor(e,r){super(e,r),this.opts=r,this.ctLoc=null,this.locBeforeToken=!1}_setErrorLocation(e){this.ctLoc&&(e.startLine=this.ctLoc.startLine,e.startCol=this.ctLoc.startCol,e.startOffset=this.ctLoc.startOffset,e.endLine=this.locBeforeToken?this.ctLoc.startLine:this.ctLoc.endLine,e.endCol=this.locBeforeToken?this.ctLoc.startCol:this.ctLoc.endCol,e.endOffset=this.locBeforeToken?this.ctLoc.startOffset:this.ctLoc.endOffset)}_getOverriddenMethods(e,r){return{_bootstrap(n,s){r._bootstrap.call(this,n,s),lee.install(this.tokenizer,SLe,e.opts),lee.install(this.tokenizer,bLe)},_processInputToken(n){e.ctLoc=n.location,r._processInputToken.call(this,n)},_err(n,s){e.locBeforeToken=s&&s.beforeToken,e._reportError(n)}}}};cee.exports=oP});var iP=w(st=>{"use strict";var{DOCUMENT_MODE:TLe}=ac();st.createDocument=function(){return{nodeName:"#document",mode:TLe.NO_QUIRKS,childNodes:[]}};st.createDocumentFragment=function(){return{nodeName:"#document-fragment",childNodes:[]}};st.createElement=function(t,e,r){return{nodeName:t,tagName:t,attrs:r,namespaceURI:e,childNodes:[],parentNode:null}};st.createCommentNode=function(t){return{nodeName:"#comment",data:t,parentNode:null}};var dee=function(t){return{nodeName:"#text",value:t,parentNode:null}},pee=st.appendChild=function(t,e){t.childNodes.push(e),e.parentNode=t},wLe=st.insertBefore=function(t,e,r){let n=t.childNodes.indexOf(r);t.childNodes.splice(n,0,e),e.parentNode=t};st.setTemplateContent=function(t,e){t.content=e};st.getTemplateContent=function(t){return t.content};st.setDocumentType=function(t,e,r,n){let s=null;for(let o=0;o<t.childNodes.length;o++)if(t.childNodes[o].nodeName==="#documentType"){s=t.childNodes[o];break}s?(s.name=e,s.publicId=r,s.systemId=n):pee(t,{nodeName:"#documentType",name:e,publicId:r,systemId:n})};st.setDocumentMode=function(t,e){t.mode=e};st.getDocumentMode=function(t){return t.mode};st.detachNode=function(t){if(t.parentNode){let e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}};st.insertText=function(t,e){if(t.childNodes.length){let r=t.childNodes[t.childNodes.length-1];if(r.nodeName==="#text"){r.value+=e;return}}pee(t,dee(e))};st.insertTextBefore=function(t,e,r){let n=t.childNodes[t.childNodes.indexOf(r)-1];n&&n.nodeName==="#text"?n.value+=e:wLe(t,dee(e),r)};st.adoptAttributes=function(t,e){let r=[];for(let n=0;n<t.attrs.length;n++)r.push(t.attrs[n].name);for(let n=0;n<e.length;n++)r.indexOf(e[n].name)===-1&&t.attrs.push(e[n])};st.getFirstChild=function(t){return t.childNodes[0]};st.getChildNodes=function(t){return t.childNodes};st.getParentNode=function(t){return t.parentNode};st.getAttrList=function(t){return t.attrs};st.getTagName=function(t){return t.tagName};st.getNamespaceURI=function(t){return t.namespaceURI};st.getTextNodeContent=function(t){return t.value};st.getCommentNodeContent=function(t){return t.data};st.getDocumentTypeNodeName=function(t){return t.name};st.getDocumentTypeNodePublicId=function(t){return t.publicId};st.getDocumentTypeNodeSystemId=function(t){return t.systemId};st.isTextNode=function(t){return t.nodeName==="#text"};st.isCommentNode=function(t){return t.nodeName==="#comment"};st.isDocumentTypeNode=function(t){return t.nodeName==="#documentType"};st.isElementNode=function(t){return!!t.tagName};st.setNodeSourceCodeLocation=function(t,e){t.sourceCodeLocation=e};st.getNodeSourceCodeLocation=function(t){return t.sourceCodeLocation}});var aP=w((Xft,mee)=>{"use strict";mee.exports=function(e,r){return r=r||Object.create(null),[e,r].reduce((n,s)=>(Object.keys(s).forEach(o=>{n[o]=s[o]}),n),Object.create(null))}});var lP=w(sw=>{"use strict";var{DOCUMENT_MODE:qm}=ac(),gee="html",CLe="about:legacy-compat",vLe="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",_ee=["+//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//"],kLe=_ee.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),ALe=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],Eee=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],ILe=Eee.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function fee(t){let e=t.indexOf('"')!==-1?"'":'"';return e+t+e}function hee(t,e){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])===0)return!0;return!1}sw.isConforming=function(t){return t.name===gee&&t.publicId===null&&(t.systemId===null||t.systemId===CLe)};sw.getDocumentMode=function(t){if(t.name!==gee)return qm.QUIRKS;let e=t.systemId;if(e&&e.toLowerCase()===vLe)return qm.QUIRKS;let r=t.publicId;if(r!==null){if(r=r.toLowerCase(),ALe.indexOf(r)>-1)return qm.QUIRKS;let n=e===null?kLe:_ee;if(hee(r,n))return qm.QUIRKS;if(n=e===null?Eee:ILe,hee(r,n))return qm.LIMITED_QUIRKS}return qm.NO_QUIRKS};sw.serializeContent=function(t,e,r){let n="!DOCTYPE ";return t&&(n+=t),e?n+=" PUBLIC "+fee(e):r&&(n+=" SYSTEM"),r!==null&&(n+=" "+fee(r)),n}});var See=w(lc=>{"use strict";var cP=lE(),uP=ac(),ve=uP.TAG_NAMES,qr=uP.NAMESPACES,ow=uP.ATTRS,yee={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},DLe="definitionurl",RLe="definitionURL",NLe={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},OLe={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:qr.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:qr.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:qr.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:qr.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:qr.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:qr.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:qr.XLINK},"xml:base":{prefix:"xml",name:"base",namespace:qr.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:qr.XML},"xml:space":{prefix:"xml",name:"space",namespace:qr.XML},xmlns:{prefix:"",name:"xmlns",namespace:qr.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:qr.XMLNS}},xLe=lc.SVG_TAG_NAMES_ADJUSTMENT_MAP={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},MLe={[ve.B]:!0,[ve.BIG]:!0,[ve.BLOCKQUOTE]:!0,[ve.BODY]:!0,[ve.BR]:!0,[ve.CENTER]:!0,[ve.CODE]:!0,[ve.DD]:!0,[ve.DIV]:!0,[ve.DL]:!0,[ve.DT]:!0,[ve.EM]:!0,[ve.EMBED]:!0,[ve.H1]:!0,[ve.H2]:!0,[ve.H3]:!0,[ve.H4]:!0,[ve.H5]:!0,[ve.H6]:!0,[ve.HEAD]:!0,[ve.HR]:!0,[ve.I]:!0,[ve.IMG]:!0,[ve.LI]:!0,[ve.LISTING]:!0,[ve.MENU]:!0,[ve.META]:!0,[ve.NOBR]:!0,[ve.OL]:!0,[ve.P]:!0,[ve.PRE]:!0,[ve.RUBY]:!0,[ve.S]:!0,[ve.SMALL]:!0,[ve.SPAN]:!0,[ve.STRONG]:!0,[ve.STRIKE]:!0,[ve.SUB]:!0,[ve.SUP]:!0,[ve.TABLE]:!0,[ve.TT]:!0,[ve.U]:!0,[ve.UL]:!0,[ve.VAR]:!0};lc.causesExit=function(t){let e=t.tagName;return e===ve.FONT&&(cP.getTokenAttr(t,ow.COLOR)!==null||cP.getTokenAttr(t,ow.SIZE)!==null||cP.getTokenAttr(t,ow.FACE)!==null)?!0:MLe[e]};lc.adjustTokenMathMLAttrs=function(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===DLe){t.attrs[e].name=RLe;break}};lc.adjustTokenSVGAttrs=function(t){for(let e=0;e<t.attrs.length;e++){let r=NLe[t.attrs[e].name];r&&(t.attrs[e].name=r)}};lc.adjustTokenXMLAttrs=function(t){for(let e=0;e<t.attrs.length;e++){let r=OLe[t.attrs[e].name];r&&(t.attrs[e].prefix=r.prefix,t.attrs[e].name=r.name,t.attrs[e].namespace=r.namespace)}};lc.adjustTokenSVGTagName=function(t){let e=xLe[t.tagName];e&&(t.tagName=e)};function PLe(t,e){return e===qr.MATHML&&(t===ve.MI||t===ve.MO||t===ve.MN||t===ve.MS||t===ve.MTEXT)}function LLe(t,e,r){if(e===qr.MATHML&&t===ve.ANNOTATION_XML){for(let n=0;n<r.length;n++)if(r[n].name===ow.ENCODING){let s=r[n].value.toLowerCase();return s===yee.TEXT_HTML||s===yee.APPLICATION_XML}}return e===qr.SVG&&(t===ve.FOREIGN_OBJECT||t===ve.DESC||t===ve.TITLE)}lc.isIntegrationPoint=function(t,e,r,n){return!!((!n||n===qr.HTML)&&LLe(t,e,r)||(!n||n===qr.MATHML)&&PLe(t,e))}});var jee=w((eht,qee)=>{"use strict";var O=lE(),FLe=jZ(),bee=WZ(),$Le=ree(),ULe=uee(),Tee=vi(),BLe=iP(),GLe=aP(),wee=lP(),ki=See(),jr=z0(),zLe=G0(),qu=ac(),b=qu.TAG_NAMES,Ee=qu.NAMESPACES,xee=qu.ATTRS,HLe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,onParseError:null,treeAdapter:BLe},Mee="hidden",qLe=8,jLe=3,Pee="INITIAL_MODE",pP="BEFORE_HTML_MODE",mw="BEFORE_HEAD_MODE",Wm="IN_HEAD_MODE",Lee="IN_HEAD_NO_SCRIPT_MODE",fw="AFTER_HEAD_MODE",Ai="IN_BODY_MODE",cw="TEXT_MODE",mn="IN_TABLE_MODE",Fee="IN_TABLE_TEXT_MODE",hw="IN_CAPTION_MODE",EE="IN_COLUMN_GROUP_MODE",Ws="IN_TABLE_BODY_MODE",Na="IN_ROW_MODE",gw="IN_CELL_MODE",mP="IN_SELECT_MODE",fP="IN_SELECT_IN_TABLE_MODE",uw="IN_TEMPLATE_MODE",hP="AFTER_BODY_MODE",_w="IN_FRAMESET_MODE",$ee="AFTER_FRAMESET_MODE",Uee="AFTER_AFTER_BODY_MODE",Bee="AFTER_AFTER_FRAMESET_MODE",YLe={[b.TR]:Na,[b.TBODY]:Ws,[b.THEAD]:Ws,[b.TFOOT]:Ws,[b.CAPTION]:hw,[b.COLGROUP]:EE,[b.TABLE]:mn,[b.BODY]:Ai,[b.FRAMESET]:_w},WLe={[b.CAPTION]:mn,[b.COLGROUP]:mn,[b.TBODY]:mn,[b.TFOOT]:mn,[b.THEAD]:mn,[b.COL]:EE,[b.TR]:Ws,[b.TD]:Na,[b.TH]:Na},Cee={[Pee]:{[O.CHARACTER_TOKEN]:dE,[O.NULL_CHARACTER_TOKEN]:dE,[O.WHITESPACE_CHARACTER_TOKEN]:Ve,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:tFe,[O.START_TAG_TOKEN]:dE,[O.END_TAG_TOKEN]:dE,[O.EOF_TOKEN]:dE},[pP]:{[O.CHARACTER_TOKEN]:mE,[O.NULL_CHARACTER_TOKEN]:mE,[O.WHITESPACE_CHARACTER_TOKEN]:Ve,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:rFe,[O.END_TAG_TOKEN]:nFe,[O.EOF_TOKEN]:mE},[mw]:{[O.CHARACTER_TOKEN]:fE,[O.NULL_CHARACTER_TOKEN]:fE,[O.WHITESPACE_CHARACTER_TOKEN]:Ve,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:iw,[O.START_TAG_TOKEN]:sFe,[O.END_TAG_TOKEN]:oFe,[O.EOF_TOKEN]:fE},[Wm]:{[O.CHARACTER_TOKEN]:hE,[O.NULL_CHARACTER_TOKEN]:hE,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:iw,[O.START_TAG_TOKEN]:Fr,[O.END_TAG_TOKEN]:ju,[O.EOF_TOKEN]:hE},[Lee]:{[O.CHARACTER_TOKEN]:gE,[O.NULL_CHARACTER_TOKEN]:gE,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:iw,[O.START_TAG_TOKEN]:iFe,[O.END_TAG_TOKEN]:aFe,[O.EOF_TOKEN]:gE},[fw]:{[O.CHARACTER_TOKEN]:_E,[O.NULL_CHARACTER_TOKEN]:_E,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:iw,[O.START_TAG_TOKEN]:lFe,[O.END_TAG_TOKEN]:cFe,[O.EOF_TOKEN]:_E},[Ai]:{[O.CHARACTER_TOKEN]:aw,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:Hu,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:ns,[O.END_TAG_TOKEN]:gP,[O.EOF_TOKEN]:Da},[cw]:{[O.CHARACTER_TOKEN]:rs,[O.NULL_CHARACTER_TOKEN]:rs,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:Ve,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:Ve,[O.END_TAG_TOKEN]:BFe,[O.EOF_TOKEN]:GFe},[mn]:{[O.CHARACTER_TOKEN]:Ra,[O.NULL_CHARACTER_TOKEN]:Ra,[O.WHITESPACE_CHARACTER_TOKEN]:Ra,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:_P,[O.END_TAG_TOKEN]:EP,[O.EOF_TOKEN]:Da},[Fee]:{[O.CHARACTER_TOKEN]:XFe,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:QFe,[O.COMMENT_TOKEN]:pE,[O.DOCTYPE_TOKEN]:pE,[O.START_TAG_TOKEN]:pE,[O.END_TAG_TOKEN]:pE,[O.EOF_TOKEN]:pE},[hw]:{[O.CHARACTER_TOKEN]:aw,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:Hu,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:JFe,[O.END_TAG_TOKEN]:ZFe,[O.EOF_TOKEN]:Da},[EE]:{[O.CHARACTER_TOKEN]:dw,[O.NULL_CHARACTER_TOKEN]:dw,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:e2e,[O.END_TAG_TOKEN]:t2e,[O.EOF_TOKEN]:Da},[Ws]:{[O.CHARACTER_TOKEN]:Ra,[O.NULL_CHARACTER_TOKEN]:Ra,[O.WHITESPACE_CHARACTER_TOKEN]:Ra,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:r2e,[O.END_TAG_TOKEN]:n2e,[O.EOF_TOKEN]:Da},[Na]:{[O.CHARACTER_TOKEN]:Ra,[O.NULL_CHARACTER_TOKEN]:Ra,[O.WHITESPACE_CHARACTER_TOKEN]:Ra,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:s2e,[O.END_TAG_TOKEN]:o2e,[O.EOF_TOKEN]:Da},[gw]:{[O.CHARACTER_TOKEN]:aw,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:Hu,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:i2e,[O.END_TAG_TOKEN]:a2e,[O.EOF_TOKEN]:Da},[mP]:{[O.CHARACTER_TOKEN]:rs,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:Gee,[O.END_TAG_TOKEN]:zee,[O.EOF_TOKEN]:Da},[fP]:{[O.CHARACTER_TOKEN]:rs,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:l2e,[O.END_TAG_TOKEN]:c2e,[O.EOF_TOKEN]:Da},[uw]:{[O.CHARACTER_TOKEN]:aw,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:Hu,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:u2e,[O.END_TAG_TOKEN]:d2e,[O.EOF_TOKEN]:Hee},[hP]:{[O.CHARACTER_TOKEN]:pw,[O.NULL_CHARACTER_TOKEN]:pw,[O.WHITESPACE_CHARACTER_TOKEN]:Hu,[O.COMMENT_TOKEN]:eFe,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:p2e,[O.END_TAG_TOKEN]:m2e,[O.EOF_TOKEN]:uE},[_w]:{[O.CHARACTER_TOKEN]:Ve,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:f2e,[O.END_TAG_TOKEN]:h2e,[O.EOF_TOKEN]:uE},[$ee]:{[O.CHARACTER_TOKEN]:Ve,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:rs,[O.COMMENT_TOKEN]:vr,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:g2e,[O.END_TAG_TOKEN]:_2e,[O.EOF_TOKEN]:uE},[Uee]:{[O.CHARACTER_TOKEN]:lw,[O.NULL_CHARACTER_TOKEN]:lw,[O.WHITESPACE_CHARACTER_TOKEN]:Hu,[O.COMMENT_TOKEN]:vee,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:E2e,[O.END_TAG_TOKEN]:lw,[O.EOF_TOKEN]:uE},[Bee]:{[O.CHARACTER_TOKEN]:Ve,[O.NULL_CHARACTER_TOKEN]:Ve,[O.WHITESPACE_CHARACTER_TOKEN]:Hu,[O.COMMENT_TOKEN]:vee,[O.DOCTYPE_TOKEN]:Ve,[O.START_TAG_TOKEN]:y2e,[O.END_TAG_TOKEN]:Ve,[O.EOF_TOKEN]:uE}},dP=class{constructor(e){this.options=GLe(HLe,e),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.sourceCodeLocationInfo&&Tee.install(this,$Le),this.options.onParseError&&Tee.install(this,ULe,{onParseError:this.options.onParseError})}parse(e){let r=this.treeAdapter.createDocument();return this._bootstrap(r,null),this.tokenizer.write(e,!0),this._runParsingLoop(null),r}parseFragment(e,r){r||(r=this.treeAdapter.createElement(b.TEMPLATE,Ee.HTML,[]));let n=this.treeAdapter.createElement("documentmock",Ee.HTML,[]);this._bootstrap(n,r),this.treeAdapter.getTagName(r)===b.TEMPLATE&&this._pushTmplInsertionMode(uw),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(e,!0),this._runParsingLoop(null);let s=this.treeAdapter.getFirstChild(n),o=this.treeAdapter.createDocumentFragment();return this._adoptNodes(s,o),o}_bootstrap(e,r){this.tokenizer=new O(this.options),this.stopped=!1,this.insertionMode=Pee,this.originalInsertionMode="",this.document=e,this.fragmentContext=r,this.headElement=null,this.formElement=null,this.openElements=new FLe(this.document,this.treeAdapter),this.activeFormattingElements=new bee(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1}_err(){}_runParsingLoop(e){for(;!this.stopped;){this._setupTokenizerCDATAMode();let r=this.tokenizer.getNextToken();if(r.type===O.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,r.type===O.WHITESPACE_CHARACTER_TOKEN&&r.chars[0]===`
1089
- `)){if(r.chars.length===1)continue;r.chars=r.chars.substr(1)}if(this._processInputToken(r),e&&this.pendingScript)break}}runParsingLoopForCurrentChunk(e,r){if(this._runParsingLoop(r),r&&this.pendingScript){let n=this.pendingScript;this.pendingScript=null,r(n);return}e&&e()}_setupTokenizerCDATAMode(){let e=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=e&&e!==this.document&&this.treeAdapter.getNamespaceURI(e)!==Ee.HTML&&!this._isIntegrationPoint(e)}_switchToTextParsing(e,r){this._insertElement(e,Ee.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=cw}switchToPlaintextParsing(){this.insertionMode=cw,this.originalInsertionMode=Ai,this.tokenizer.state=O.MODE.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;do{if(this.treeAdapter.getTagName(e)===b.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}while(e)}_initTokenizerForFragmentParsing(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===Ee.HTML){let e=this.treeAdapter.getTagName(this.fragmentContext);e===b.TITLE||e===b.TEXTAREA?this.tokenizer.state=O.MODE.RCDATA:e===b.STYLE||e===b.XMP||e===b.IFRAME||e===b.NOEMBED||e===b.NOFRAMES||e===b.NOSCRIPT?this.tokenizer.state=O.MODE.RAWTEXT:e===b.SCRIPT?this.tokenizer.state=O.MODE.SCRIPT_DATA:e===b.PLAINTEXT&&(this.tokenizer.state=O.MODE.PLAINTEXT)}}_setDocumentType(e){let r=e.name||"",n=e.publicId||"",s=e.systemId||"";this.treeAdapter.setDocumentType(this.document,r,n,s)}_attachElementToTree(e){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let r=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(r,e)}}_appendElement(e,r){let n=this.treeAdapter.createElement(e.tagName,r,e.attrs);this._attachElementToTree(n)}_insertElement(e,r){let n=this.treeAdapter.createElement(e.tagName,r,e.attrs);this._attachElementToTree(n),this.openElements.push(n)}_insertFakeElement(e){let r=this.treeAdapter.createElement(e,Ee.HTML,[]);this._attachElementToTree(r),this.openElements.push(r)}_insertTemplate(e){let r=this.treeAdapter.createElement(e.tagName,Ee.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r),this.openElements.push(r)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(b.HTML,Ee.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e)}_appendCommentNode(e,r){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(r,n)}_insertCharacters(e){if(this._shouldFosterParentOnInsertion())this._fosterParentText(e.chars);else{let r=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(r,e.chars)}}_adoptNodes(e,r){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_shouldProcessTokenInForeignContent(e){let r=this._getAdjustedCurrentElement();if(!r||r===this.document)return!1;let n=this.treeAdapter.getNamespaceURI(r);if(n===Ee.HTML||this.treeAdapter.getTagName(r)===b.ANNOTATION_XML&&n===Ee.MATHML&&e.type===O.START_TAG_TOKEN&&e.tagName===b.SVG)return!1;let s=e.type===O.CHARACTER_TOKEN||e.type===O.NULL_CHARACTER_TOKEN||e.type===O.WHITESPACE_CHARACTER_TOKEN;return(e.type===O.START_TAG_TOKEN&&e.tagName!==b.MGLYPH&&e.tagName!==b.MALIGNMARK||s)&&this._isIntegrationPoint(r,Ee.MATHML)||(e.type===O.START_TAG_TOKEN||s)&&this._isIntegrationPoint(r,Ee.HTML)?!1:e.type!==O.EOF_TOKEN}_processToken(e){Cee[this.insertionMode][e.type](this,e)}_processTokenInBodyMode(e){Cee[Ai][e.type](this,e)}_processTokenInForeignContent(e){e.type===O.CHARACTER_TOKEN?b2e(this,e):e.type===O.NULL_CHARACTER_TOKEN?S2e(this,e):e.type===O.WHITESPACE_CHARACTER_TOKEN?rs(this,e):e.type===O.COMMENT_TOKEN?vr(this,e):e.type===O.START_TAG_TOKEN?T2e(this,e):e.type===O.END_TAG_TOKEN&&w2e(this,e)}_processInputToken(e){this._shouldProcessTokenInForeignContent(e)?this._processTokenInForeignContent(e):this._processToken(e),e.type===O.START_TAG_TOKEN&&e.selfClosing&&!e.ackSelfClosing&&this._err(jr.nonVoidHtmlElementStartTagWithTrailingSolidus)}_isIntegrationPoint(e,r){let n=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e),o=this.treeAdapter.getAttrList(e);return ki.isIntegrationPoint(n,s,o,r)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.length;if(e){let r=e,n=null;do if(r--,n=this.activeFormattingElements.entries[r],n.type===bee.MARKER_ENTRY||this.openElements.contains(n.element)){r++;break}while(r>0);for(let s=r;s<e;s++)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=Na}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(b.P),this.openElements.popUntilTagNamePopped(b.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop,r=!1;e>=0;e--){let n=this.openElements.items[e];e===0&&(r=!0,this.fragmentContext&&(n=this.fragmentContext));let s=this.treeAdapter.getTagName(n),o=YLe[s];if(o){this.insertionMode=o;break}else if(!r&&(s===b.TD||s===b.TH)){this.insertionMode=gw;break}else if(!r&&s===b.HEAD){this.insertionMode=Wm;break}else if(s===b.SELECT){this._resetInsertionModeForSelect(e);break}else if(s===b.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}else if(s===b.HTML){this.insertionMode=this.headElement?fw:mw;break}else if(r){this.insertionMode=Ai;break}}}_resetInsertionModeForSelect(e){if(e>0)for(let r=e-1;r>0;r--){let n=this.openElements.items[r],s=this.treeAdapter.getTagName(n);if(s===b.TEMPLATE)break;if(s===b.TABLE){this.insertionMode=fP;return}}this.insertionMode=mP}_pushTmplInsertionMode(e){this.tmplInsertionModeStack.push(e),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=e}_popTmplInsertionMode(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]}_isElementCausesFosterParenting(e){let r=this.treeAdapter.getTagName(e);return r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}_findFosterParentingLocation(){let e={parent:null,beforeElement:null};for(let r=this.openElements.stackTop;r>=0;r--){let n=this.openElements.items[r],s=this.treeAdapter.getTagName(n),o=this.treeAdapter.getNamespaceURI(n);if(s===b.TEMPLATE&&o===Ee.HTML){e.parent=this.treeAdapter.getTemplateContent(n);break}else if(s===b.TABLE){e.parent=this.treeAdapter.getParentNode(n),e.parent?e.beforeElement=n:e.parent=this.openElements.items[r-1];break}}return e.parent||(e.parent=this.openElements.items[0]),e}_fosterParentElement(e){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,e,r.beforeElement):this.treeAdapter.appendChild(r.parent,e)}_fosterParentText(e){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertTextBefore(r.parent,e,r.beforeElement):this.treeAdapter.insertText(r.parent,e)}_isSpecialElement(e){let r=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);return qu.SPECIAL_ELEMENTS[n][r]}};qee.exports=dP;function KLe(t,e){let r=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return r?t.openElements.contains(r.element)?t.openElements.hasInScope(e.tagName)||(r=null):(t.activeFormattingElements.removeEntry(r),r=null):Uo(t,e),r}function VLe(t,e){let r=null;for(let n=t.openElements.stackTop;n>=0;n--){let s=t.openElements.items[n];if(s===e.element)break;t._isSpecialElement(s)&&(r=s)}return r||(t.openElements.popUntilElementPopped(e.element),t.activeFormattingElements.removeEntry(e)),r}function QLe(t,e,r){let n=e,s=t.openElements.getCommonAncestor(e);for(let o=0,i=s;i!==r;o++,i=s){s=t.openElements.getCommonAncestor(i);let a=t.activeFormattingElements.getElementEntry(i),l=a&&o>=jLe;!a||l?(l&&t.activeFormattingElements.removeEntry(a),t.openElements.remove(i)):(i=XLe(t,a),n===e&&(t.activeFormattingElements.bookmark=a),t.treeAdapter.detachNode(n),t.treeAdapter.appendChild(i,n),n=i)}return n}function XLe(t,e){let r=t.treeAdapter.getNamespaceURI(e.element),n=t.treeAdapter.createElement(e.token.tagName,r,e.token.attrs);return t.openElements.replace(e.element,n),e.element=n,n}function JLe(t,e,r){if(t._isElementCausesFosterParenting(e))t._fosterParentElement(r);else{let n=t.treeAdapter.getTagName(e),s=t.treeAdapter.getNamespaceURI(e);n===b.TEMPLATE&&s===Ee.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,r)}}function ZLe(t,e,r){let n=t.treeAdapter.getNamespaceURI(r.element),s=r.token,o=t.treeAdapter.createElement(s.tagName,n,s.attrs);t._adoptNodes(e,o),t.treeAdapter.appendChild(e,o),t.activeFormattingElements.insertElementAfterBookmark(o,r.token),t.activeFormattingElements.removeEntry(r),t.openElements.remove(r.element),t.openElements.insertAfter(e,o)}function uc(t,e){let r;for(let n=0;n<qLe&&(r=KLe(t,e,r),!!r);n++){let s=VLe(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;let o=QLe(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(o),JLe(t,i,o),ZLe(t,s,r)}}function Ve(){}function iw(t){t._err(jr.misplacedDoctype)}function vr(t,e){t._appendCommentNode(e,t.openElements.currentTmplContent||t.openElements.current)}function eFe(t,e){t._appendCommentNode(e,t.openElements.items[0])}function vee(t,e){t._appendCommentNode(e,t.document)}function rs(t,e){t._insertCharacters(e)}function uE(t){t.stopped=!0}function tFe(t,e){t._setDocumentType(e);let r=e.forceQuirks?qu.DOCUMENT_MODE.QUIRKS:wee.getDocumentMode(e);wee.isConforming(e)||t._err(jr.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,r),t.insertionMode=pP}function dE(t,e){t._err(jr.missingDoctype,{beforeToken:!0}),t.treeAdapter.setDocumentMode(t.document,qu.DOCUMENT_MODE.QUIRKS),t.insertionMode=pP,t._processToken(e)}function rFe(t,e){e.tagName===b.HTML?(t._insertElement(e,Ee.HTML),t.insertionMode=mw):mE(t,e)}function nFe(t,e){let r=e.tagName;(r===b.HTML||r===b.HEAD||r===b.BODY||r===b.BR)&&mE(t,e)}function mE(t,e){t._insertFakeRootElement(),t.insertionMode=mw,t._processToken(e)}function sFe(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.HEAD?(t._insertElement(e,Ee.HTML),t.headElement=t.openElements.current,t.insertionMode=Wm):fE(t,e)}function oFe(t,e){let r=e.tagName;r===b.HEAD||r===b.BODY||r===b.HTML||r===b.BR?fE(t,e):t._err(jr.endTagWithoutMatchingOpenElement)}function fE(t,e){t._insertFakeElement(b.HEAD),t.headElement=t.openElements.current,t.insertionMode=Wm,t._processToken(e)}function Fr(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.BASE||r===b.BASEFONT||r===b.BGSOUND||r===b.LINK||r===b.META?(t._appendElement(e,Ee.HTML),e.ackSelfClosing=!0):r===b.TITLE?t._switchToTextParsing(e,O.MODE.RCDATA):r===b.NOSCRIPT?t.options.scriptingEnabled?t._switchToTextParsing(e,O.MODE.RAWTEXT):(t._insertElement(e,Ee.HTML),t.insertionMode=Lee):r===b.NOFRAMES||r===b.STYLE?t._switchToTextParsing(e,O.MODE.RAWTEXT):r===b.SCRIPT?t._switchToTextParsing(e,O.MODE.SCRIPT_DATA):r===b.TEMPLATE?(t._insertTemplate(e,Ee.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=uw,t._pushTmplInsertionMode(uw)):r===b.HEAD?t._err(jr.misplacedStartTagForHeadElement):hE(t,e)}function ju(t,e){let r=e.tagName;r===b.HEAD?(t.openElements.pop(),t.insertionMode=fw):r===b.BODY||r===b.BR||r===b.HTML?hE(t,e):r===b.TEMPLATE&&t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagName!==b.TEMPLATE&&t._err(jr.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(b.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t._popTmplInsertionMode(),t._resetInsertionMode()):t._err(jr.endTagWithoutMatchingOpenElement)}function hE(t,e){t.openElements.pop(),t.insertionMode=fw,t._processToken(e)}function iFe(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.BASEFONT||r===b.BGSOUND||r===b.HEAD||r===b.LINK||r===b.META||r===b.NOFRAMES||r===b.STYLE?Fr(t,e):r===b.NOSCRIPT?t._err(jr.nestedNoscriptInHead):gE(t,e)}function aFe(t,e){let r=e.tagName;r===b.NOSCRIPT?(t.openElements.pop(),t.insertionMode=Wm):r===b.BR?gE(t,e):t._err(jr.endTagWithoutMatchingOpenElement)}function gE(t,e){let r=e.type===O.EOF_TOKEN?jr.openElementsLeftAfterEof:jr.disallowedContentInNoscriptInHead;t._err(r),t.openElements.pop(),t.insertionMode=Wm,t._processToken(e)}function lFe(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.BODY?(t._insertElement(e,Ee.HTML),t.framesetOk=!1,t.insertionMode=Ai):r===b.FRAMESET?(t._insertElement(e,Ee.HTML),t.insertionMode=_w):r===b.BASE||r===b.BASEFONT||r===b.BGSOUND||r===b.LINK||r===b.META||r===b.NOFRAMES||r===b.SCRIPT||r===b.STYLE||r===b.TEMPLATE||r===b.TITLE?(t._err(jr.abandonedHeadElementChild),t.openElements.push(t.headElement),Fr(t,e),t.openElements.remove(t.headElement)):r===b.HEAD?t._err(jr.misplacedStartTagForHeadElement):_E(t,e)}function cFe(t,e){let r=e.tagName;r===b.BODY||r===b.HTML||r===b.BR?_E(t,e):r===b.TEMPLATE?ju(t,e):t._err(jr.endTagWithoutMatchingOpenElement)}function _E(t,e){t._insertFakeElement(b.BODY),t.insertionMode=Ai,t._processToken(e)}function Hu(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function aw(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function uFe(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function dFe(t,e){let r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(r,e.attrs))}function pFe(t,e){let r=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&r&&(t.treeAdapter.detachNode(r),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Ee.HTML),t.insertionMode=_w)}function Ia(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML)}function mFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement();let r=t.openElements.currentTagName;(r===b.H1||r===b.H2||r===b.H3||r===b.H4||r===b.H5||r===b.H6)&&t.openElements.pop(),t._insertElement(e,Ee.HTML)}function kee(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function fFe(t,e){let r=t.openElements.tmplCount>0;(!t.formElement||r)&&(t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML),r||(t.formElement=t.openElements.current))}function hFe(t,e){t.framesetOk=!1;let r=e.tagName;for(let n=t.openElements.stackTop;n>=0;n--){let s=t.openElements.items[n],o=t.treeAdapter.getTagName(s),i=null;if(r===b.LI&&o===b.LI?i=b.LI:(r===b.DD||r===b.DT)&&(o===b.DD||o===b.DT)&&(i=o),i){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(o!==b.ADDRESS&&o!==b.DIV&&o!==b.P&&t._isSpecialElement(s))break}t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML)}function gFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML),t.tokenizer.state=O.MODE.PLAINTEXT}function _Fe(t,e){t.openElements.hasInScope(b.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.framesetOk=!1}function EFe(t,e){let r=t.activeFormattingElements.getElementEntryInScopeWithTagName(b.A);r&&(uc(t,e),t.openElements.remove(r.element),t.activeFormattingElements.removeEntry(r)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function jm(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function yFe(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(b.NOBR)&&(uc(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ee.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Aee(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function SFe(t,e){t.treeAdapter.getDocumentMode(t.document)!==qu.DOCUMENT_MODE.QUIRKS&&t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML),t.framesetOk=!1,t.insertionMode=mn}function Ym(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ee.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function bFe(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ee.HTML);let r=O.getTokenAttr(e,xee.TYPE);(!r||r.toLowerCase()!==Mee)&&(t.framesetOk=!1),e.ackSelfClosing=!0}function Iee(t,e){t._appendElement(e,Ee.HTML),e.ackSelfClosing=!0}function TFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._appendElement(e,Ee.HTML),t.framesetOk=!1,t.ackSelfClosing=!0}function wFe(t,e){e.tagName=b.IMG,Ym(t,e)}function CFe(t,e){t._insertElement(e,Ee.HTML),t.skipNextNewLine=!0,t.tokenizer.state=O.MODE.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=cw}function vFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,O.MODE.RAWTEXT)}function kFe(t,e){t.framesetOk=!1,t._switchToTextParsing(e,O.MODE.RAWTEXT)}function Dee(t,e){t._switchToTextParsing(e,O.MODE.RAWTEXT)}function AFe(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.framesetOk=!1,t.insertionMode===mn||t.insertionMode===hw||t.insertionMode===Ws||t.insertionMode===Na||t.insertionMode===gw?t.insertionMode=fP:t.insertionMode=mP}function Ree(t,e){t.openElements.currentTagName===b.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML)}function Nee(t,e){t.openElements.hasInScope(b.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ee.HTML)}function IFe(t,e){t.openElements.hasInScope(b.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(b.RTC),t._insertElement(e,Ee.HTML)}function DFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML)}function RFe(t,e){t._reconstructActiveFormattingElements(),ki.adjustTokenMathMLAttrs(e),ki.adjustTokenXMLAttrs(e),e.selfClosing?t._appendElement(e,Ee.MATHML):t._insertElement(e,Ee.MATHML),e.ackSelfClosing=!0}function NFe(t,e){t._reconstructActiveFormattingElements(),ki.adjustTokenSVGAttrs(e),ki.adjustTokenXMLAttrs(e),e.selfClosing?t._appendElement(e,Ee.SVG):t._insertElement(e,Ee.SVG),e.ackSelfClosing=!0}function js(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML)}function ns(t,e){let r=e.tagName;switch(r.length){case 1:r===b.I||r===b.S||r===b.B||r===b.U?jm(t,e):r===b.P?Ia(t,e):r===b.A?EFe(t,e):js(t,e);break;case 2:r===b.DL||r===b.OL||r===b.UL?Ia(t,e):r===b.H1||r===b.H2||r===b.H3||r===b.H4||r===b.H5||r===b.H6?mFe(t,e):r===b.LI||r===b.DD||r===b.DT?hFe(t,e):r===b.EM||r===b.TT?jm(t,e):r===b.BR?Ym(t,e):r===b.HR?TFe(t,e):r===b.RB?Nee(t,e):r===b.RT||r===b.RP?IFe(t,e):r!==b.TH&&r!==b.TD&&r!==b.TR&&js(t,e);break;case 3:r===b.DIV||r===b.DIR||r===b.NAV?Ia(t,e):r===b.PRE?kee(t,e):r===b.BIG?jm(t,e):r===b.IMG||r===b.WBR?Ym(t,e):r===b.XMP?vFe(t,e):r===b.SVG?NFe(t,e):r===b.RTC?Nee(t,e):r!==b.COL&&js(t,e);break;case 4:r===b.HTML?uFe(t,e):r===b.BASE||r===b.LINK||r===b.META?Fr(t,e):r===b.BODY?dFe(t,e):r===b.MAIN||r===b.MENU?Ia(t,e):r===b.FORM?fFe(t,e):r===b.CODE||r===b.FONT?jm(t,e):r===b.NOBR?yFe(t,e):r===b.AREA?Ym(t,e):r===b.MATH?RFe(t,e):r===b.MENU?DFe(t,e):r!==b.HEAD&&js(t,e);break;case 5:r===b.STYLE||r===b.TITLE?Fr(t,e):r===b.ASIDE?Ia(t,e):r===b.SMALL?jm(t,e):r===b.TABLE?SFe(t,e):r===b.EMBED?Ym(t,e):r===b.INPUT?bFe(t,e):r===b.PARAM||r===b.TRACK?Iee(t,e):r===b.IMAGE?wFe(t,e):r!==b.FRAME&&r!==b.TBODY&&r!==b.TFOOT&&r!==b.THEAD&&js(t,e);break;case 6:r===b.SCRIPT?Fr(t,e):r===b.CENTER||r===b.FIGURE||r===b.FOOTER||r===b.HEADER||r===b.HGROUP||r===b.DIALOG?Ia(t,e):r===b.BUTTON?_Fe(t,e):r===b.STRIKE||r===b.STRONG?jm(t,e):r===b.APPLET||r===b.OBJECT?Aee(t,e):r===b.KEYGEN?Ym(t,e):r===b.SOURCE?Iee(t,e):r===b.IFRAME?kFe(t,e):r===b.SELECT?AFe(t,e):r===b.OPTION?Ree(t,e):js(t,e);break;case 7:r===b.BGSOUND?Fr(t,e):r===b.DETAILS||r===b.ADDRESS||r===b.ARTICLE||r===b.SECTION||r===b.SUMMARY?Ia(t,e):r===b.LISTING?kee(t,e):r===b.MARQUEE?Aee(t,e):r===b.NOEMBED?Dee(t,e):r!==b.CAPTION&&js(t,e);break;case 8:r===b.BASEFONT?Fr(t,e):r===b.FRAMESET?pFe(t,e):r===b.FIELDSET?Ia(t,e):r===b.TEXTAREA?CFe(t,e):r===b.TEMPLATE?Fr(t,e):r===b.NOSCRIPT?t.options.scriptingEnabled?Dee(t,e):js(t,e):r===b.OPTGROUP?Ree(t,e):r!==b.COLGROUP&&js(t,e);break;case 9:r===b.PLAINTEXT?gFe(t,e):js(t,e);break;case 10:r===b.BLOCKQUOTE||r===b.FIGCAPTION?Ia(t,e):js(t,e);break;default:js(t,e)}}function OFe(t){t.openElements.hasInScope(b.BODY)&&(t.insertionMode=hP)}function xFe(t,e){t.openElements.hasInScope(b.BODY)&&(t.insertionMode=hP,t._processToken(e))}function cc(t,e){let r=e.tagName;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r))}function MFe(t){let e=t.openElements.tmplCount>0,r=t.formElement;e||(t.formElement=null),(r||e)&&t.openElements.hasInScope(b.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(b.FORM):t.openElements.remove(r))}function PFe(t){t.openElements.hasInButtonScope(b.P)||t._insertFakeElement(b.P),t._closePElement()}function LFe(t){t.openElements.hasInListItemScope(b.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(b.LI),t.openElements.popUntilTagNamePopped(b.LI))}function FFe(t,e){let r=e.tagName;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r))}function $Fe(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function Oee(t,e){let r=e.tagName;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker())}function UFe(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(b.BR),t.openElements.pop(),t.framesetOk=!1}function Uo(t,e){let r=e.tagName;for(let n=t.openElements.stackTop;n>0;n--){let s=t.openElements.items[n];if(t.treeAdapter.getTagName(s)===r){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilElementPopped(s);break}if(t._isSpecialElement(s))break}}function gP(t,e){let r=e.tagName;switch(r.length){case 1:r===b.A||r===b.B||r===b.I||r===b.S||r===b.U?uc(t,e):r===b.P?PFe(t,e):Uo(t,e);break;case 2:r===b.DL||r===b.UL||r===b.OL?cc(t,e):r===b.LI?LFe(t,e):r===b.DD||r===b.DT?FFe(t,e):r===b.H1||r===b.H2||r===b.H3||r===b.H4||r===b.H5||r===b.H6?$Fe(t,e):r===b.BR?UFe(t,e):r===b.EM||r===b.TT?uc(t,e):Uo(t,e);break;case 3:r===b.BIG?uc(t,e):r===b.DIR||r===b.DIV||r===b.NAV||r===b.PRE?cc(t,e):Uo(t,e);break;case 4:r===b.BODY?OFe(t,e):r===b.HTML?xFe(t,e):r===b.FORM?MFe(t,e):r===b.CODE||r===b.FONT||r===b.NOBR?uc(t,e):r===b.MAIN||r===b.MENU?cc(t,e):Uo(t,e);break;case 5:r===b.ASIDE?cc(t,e):r===b.SMALL?uc(t,e):Uo(t,e);break;case 6:r===b.CENTER||r===b.FIGURE||r===b.FOOTER||r===b.HEADER||r===b.HGROUP||r===b.DIALOG?cc(t,e):r===b.APPLET||r===b.OBJECT?Oee(t,e):r===b.STRIKE||r===b.STRONG?uc(t,e):Uo(t,e);break;case 7:r===b.ADDRESS||r===b.ARTICLE||r===b.DETAILS||r===b.SECTION||r===b.SUMMARY||r===b.LISTING?cc(t,e):r===b.MARQUEE?Oee(t,e):Uo(t,e);break;case 8:r===b.FIELDSET?cc(t,e):r===b.TEMPLATE?ju(t,e):Uo(t,e);break;case 10:r===b.BLOCKQUOTE||r===b.FIGCAPTION?cc(t,e):Uo(t,e);break;default:Uo(t,e)}}function Da(t,e){t.tmplInsertionModeStackTop>-1?Hee(t,e):t.stopped=!0}function BFe(t,e){e.tagName===b.SCRIPT&&(t.pendingScript=t.openElements.current),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function GFe(t,e){t._err(jr.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t._processToken(e)}function Ra(t,e){let r=t.openElements.currentTagName;r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR?(t.pendingCharacterTokens=[],t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=Fee,t._processToken(e)):Ys(t,e)}function zFe(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ee.HTML),t.insertionMode=hw}function HFe(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ee.HTML),t.insertionMode=EE}function qFe(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(b.COLGROUP),t.insertionMode=EE,t._processToken(e)}function jFe(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ee.HTML),t.insertionMode=Ws}function YFe(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(b.TBODY),t.insertionMode=Ws,t._processToken(e)}function WFe(t,e){t.openElements.hasInTableScope(b.TABLE)&&(t.openElements.popUntilTagNamePopped(b.TABLE),t._resetInsertionMode(),t._processToken(e))}function KFe(t,e){let r=O.getTokenAttr(e,xee.TYPE);r&&r.toLowerCase()===Mee?t._appendElement(e,Ee.HTML):Ys(t,e),e.ackSelfClosing=!0}function VFe(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ee.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function _P(t,e){let r=e.tagName;switch(r.length){case 2:r===b.TD||r===b.TH||r===b.TR?YFe(t,e):Ys(t,e);break;case 3:r===b.COL?qFe(t,e):Ys(t,e);break;case 4:r===b.FORM?VFe(t,e):Ys(t,e);break;case 5:r===b.TABLE?WFe(t,e):r===b.STYLE?Fr(t,e):r===b.TBODY||r===b.TFOOT||r===b.THEAD?jFe(t,e):r===b.INPUT?KFe(t,e):Ys(t,e);break;case 6:r===b.SCRIPT?Fr(t,e):Ys(t,e);break;case 7:r===b.CAPTION?zFe(t,e):Ys(t,e);break;case 8:r===b.COLGROUP?HFe(t,e):r===b.TEMPLATE?Fr(t,e):Ys(t,e);break;default:Ys(t,e)}}function EP(t,e){let r=e.tagName;r===b.TABLE?t.openElements.hasInTableScope(b.TABLE)&&(t.openElements.popUntilTagNamePopped(b.TABLE),t._resetInsertionMode()):r===b.TEMPLATE?ju(t,e):r!==b.BODY&&r!==b.CAPTION&&r!==b.COL&&r!==b.COLGROUP&&r!==b.HTML&&r!==b.TBODY&&r!==b.TD&&r!==b.TFOOT&&r!==b.TH&&r!==b.THEAD&&r!==b.TR&&Ys(t,e)}function Ys(t,e){let r=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,t._processTokenInBodyMode(e),t.fosterParentingEnabled=r}function QFe(t,e){t.pendingCharacterTokens.push(e)}function XFe(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function pE(t,e){let r=0;if(t.hasNonWhitespacePendingCharacterToken)for(;r<t.pendingCharacterTokens.length;r++)Ys(t,t.pendingCharacterTokens[r]);else for(;r<t.pendingCharacterTokens.length;r++)t._insertCharacters(t.pendingCharacterTokens[r]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}function JFe(t,e){let r=e.tagName;r===b.CAPTION||r===b.COL||r===b.COLGROUP||r===b.TBODY||r===b.TD||r===b.TFOOT||r===b.TH||r===b.THEAD||r===b.TR?t.openElements.hasInTableScope(b.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=mn,t._processToken(e)):ns(t,e)}function ZFe(t,e){let r=e.tagName;r===b.CAPTION||r===b.TABLE?t.openElements.hasInTableScope(b.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=mn,r===b.TABLE&&t._processToken(e)):r!==b.BODY&&r!==b.COL&&r!==b.COLGROUP&&r!==b.HTML&&r!==b.TBODY&&r!==b.TD&&r!==b.TFOOT&&r!==b.TH&&r!==b.THEAD&&r!==b.TR&&gP(t,e)}function e2e(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.COL?(t._appendElement(e,Ee.HTML),e.ackSelfClosing=!0):r===b.TEMPLATE?Fr(t,e):dw(t,e)}function t2e(t,e){let r=e.tagName;r===b.COLGROUP?t.openElements.currentTagName===b.COLGROUP&&(t.openElements.pop(),t.insertionMode=mn):r===b.TEMPLATE?ju(t,e):r!==b.COL&&dw(t,e)}function dw(t,e){t.openElements.currentTagName===b.COLGROUP&&(t.openElements.pop(),t.insertionMode=mn,t._processToken(e))}function r2e(t,e){let r=e.tagName;r===b.TR?(t.openElements.clearBackToTableBodyContext(),t._insertElement(e,Ee.HTML),t.insertionMode=Na):r===b.TH||r===b.TD?(t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(b.TR),t.insertionMode=Na,t._processToken(e)):r===b.CAPTION||r===b.COL||r===b.COLGROUP||r===b.TBODY||r===b.TFOOT||r===b.THEAD?t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=mn,t._processToken(e)):_P(t,e)}function n2e(t,e){let r=e.tagName;r===b.TBODY||r===b.TFOOT||r===b.THEAD?t.openElements.hasInTableScope(r)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=mn):r===b.TABLE?t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=mn,t._processToken(e)):(r!==b.BODY&&r!==b.CAPTION&&r!==b.COL&&r!==b.COLGROUP||r!==b.HTML&&r!==b.TD&&r!==b.TH&&r!==b.TR)&&EP(t,e)}function s2e(t,e){let r=e.tagName;r===b.TH||r===b.TD?(t.openElements.clearBackToTableRowContext(),t._insertElement(e,Ee.HTML),t.insertionMode=gw,t.activeFormattingElements.insertMarker()):r===b.CAPTION||r===b.COL||r===b.COLGROUP||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR?t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=Ws,t._processToken(e)):_P(t,e)}function o2e(t,e){let r=e.tagName;r===b.TR?t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=Ws):r===b.TABLE?t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=Ws,t._processToken(e)):r===b.TBODY||r===b.TFOOT||r===b.THEAD?(t.openElements.hasInTableScope(r)||t.openElements.hasInTableScope(b.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=Ws,t._processToken(e)):(r!==b.BODY&&r!==b.CAPTION&&r!==b.COL&&r!==b.COLGROUP||r!==b.HTML&&r!==b.TD&&r!==b.TH)&&EP(t,e)}function i2e(t,e){let r=e.tagName;r===b.CAPTION||r===b.COL||r===b.COLGROUP||r===b.TBODY||r===b.TD||r===b.TFOOT||r===b.TH||r===b.THEAD||r===b.TR?(t.openElements.hasInTableScope(b.TD)||t.openElements.hasInTableScope(b.TH))&&(t._closeTableCell(),t._processToken(e)):ns(t,e)}function a2e(t,e){let r=e.tagName;r===b.TD||r===b.TH?t.openElements.hasInTableScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=Na):r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR?t.openElements.hasInTableScope(r)&&(t._closeTableCell(),t._processToken(e)):r!==b.BODY&&r!==b.CAPTION&&r!==b.COL&&r!==b.COLGROUP&&r!==b.HTML&&gP(t,e)}function Gee(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.OPTION?(t.openElements.currentTagName===b.OPTION&&t.openElements.pop(),t._insertElement(e,Ee.HTML)):r===b.OPTGROUP?(t.openElements.currentTagName===b.OPTION&&t.openElements.pop(),t.openElements.currentTagName===b.OPTGROUP&&t.openElements.pop(),t._insertElement(e,Ee.HTML)):r===b.INPUT||r===b.KEYGEN||r===b.TEXTAREA||r===b.SELECT?t.openElements.hasInSelectScope(b.SELECT)&&(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),r!==b.SELECT&&t._processToken(e)):(r===b.SCRIPT||r===b.TEMPLATE)&&Fr(t,e)}function zee(t,e){let r=e.tagName;if(r===b.OPTGROUP){let n=t.openElements.items[t.openElements.stackTop-1],s=n&&t.treeAdapter.getTagName(n);t.openElements.currentTagName===b.OPTION&&s===b.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagName===b.OPTGROUP&&t.openElements.pop()}else r===b.OPTION?t.openElements.currentTagName===b.OPTION&&t.openElements.pop():r===b.SELECT&&t.openElements.hasInSelectScope(b.SELECT)?(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode()):r===b.TEMPLATE&&ju(t,e)}function l2e(t,e){let r=e.tagName;r===b.CAPTION||r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR||r===b.TD||r===b.TH?(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),t._processToken(e)):Gee(t,e)}function c2e(t,e){let r=e.tagName;r===b.CAPTION||r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR||r===b.TD||r===b.TH?t.openElements.hasInTableScope(r)&&(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),t._processToken(e)):zee(t,e)}function u2e(t,e){let r=e.tagName;if(r===b.BASE||r===b.BASEFONT||r===b.BGSOUND||r===b.LINK||r===b.META||r===b.NOFRAMES||r===b.SCRIPT||r===b.STYLE||r===b.TEMPLATE||r===b.TITLE)Fr(t,e);else{let n=WLe[r]||Ai;t._popTmplInsertionMode(),t._pushTmplInsertionMode(n),t.insertionMode=n,t._processToken(e)}}function d2e(t,e){e.tagName===b.TEMPLATE&&ju(t,e)}function Hee(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(b.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t._popTmplInsertionMode(),t._resetInsertionMode(),t._processToken(e)):t.stopped=!0}function p2e(t,e){e.tagName===b.HTML?ns(t,e):pw(t,e)}function m2e(t,e){e.tagName===b.HTML?t.fragmentContext||(t.insertionMode=Uee):pw(t,e)}function pw(t,e){t.insertionMode=Ai,t._processToken(e)}function f2e(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.FRAMESET?t._insertElement(e,Ee.HTML):r===b.FRAME?(t._appendElement(e,Ee.HTML),e.ackSelfClosing=!0):r===b.NOFRAMES&&Fr(t,e)}function h2e(t,e){e.tagName===b.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagName!==b.FRAMESET&&(t.insertionMode=$ee))}function g2e(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.NOFRAMES&&Fr(t,e)}function _2e(t,e){e.tagName===b.HTML&&(t.insertionMode=Bee)}function E2e(t,e){e.tagName===b.HTML?ns(t,e):lw(t,e)}function lw(t,e){t.insertionMode=Ai,t._processToken(e)}function y2e(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.NOFRAMES&&Fr(t,e)}function S2e(t,e){e.chars=zLe.REPLACEMENT_CHARACTER,t._insertCharacters(e)}function b2e(t,e){t._insertCharacters(e),t.framesetOk=!1}function T2e(t,e){if(ki.causesExit(e)&&!t.fragmentContext){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Ee.HTML&&!t._isIntegrationPoint(t.openElements.current);)t.openElements.pop();t._processToken(e)}else{let r=t._getAdjustedCurrentElement(),n=t.treeAdapter.getNamespaceURI(r);n===Ee.MATHML?ki.adjustTokenMathMLAttrs(e):n===Ee.SVG&&(ki.adjustTokenSVGTagName(e),ki.adjustTokenSVGAttrs(e)),ki.adjustTokenXMLAttrs(e),e.selfClosing?t._appendElement(e,n):t._insertElement(e,n),e.ackSelfClosing=!0}}function w2e(t,e){for(let r=t.openElements.stackTop;r>0;r--){let n=t.openElements.items[r];if(t.treeAdapter.getNamespaceURI(n)===Ee.HTML){t._processToken(e);break}if(t.treeAdapter.getTagName(n).toLowerCase()===e.tagName){t.openElements.popUntilElementPopped(n);break}}}});var Kee=w((tht,Wee)=>{"use strict";var C2e=iP(),v2e=aP(),k2e=lP(),Yee=ac(),wt=Yee.TAG_NAMES,Ew=Yee.NAMESPACES,A2e={treeAdapter:C2e},I2e=/&/g,D2e=/\u00a0/g,R2e=/"/g,N2e=/</g,O2e=/>/g,yw=class t{constructor(e,r){this.options=v2e(A2e,r),this.treeAdapter=this.options.treeAdapter,this.html="",this.startNode=e}serialize(){return this._serializeChildNodes(this.startNode),this.html}_serializeChildNodes(e){let r=this.treeAdapter.getChildNodes(e);if(r)for(let n=0,s=r.length;n<s;n++){let o=r[n];this.treeAdapter.isElementNode(o)?this._serializeElement(o):this.treeAdapter.isTextNode(o)?this._serializeTextNode(o):this.treeAdapter.isCommentNode(o)?this._serializeCommentNode(o):this.treeAdapter.isDocumentTypeNode(o)&&this._serializeDocumentTypeNode(o)}}_serializeElement(e){let r=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);if(this.html+="<"+r,this._serializeAttributes(e),this.html+=">",r!==wt.AREA&&r!==wt.BASE&&r!==wt.BASEFONT&&r!==wt.BGSOUND&&r!==wt.BR&&r!==wt.COL&&r!==wt.EMBED&&r!==wt.FRAME&&r!==wt.HR&&r!==wt.IMG&&r!==wt.INPUT&&r!==wt.KEYGEN&&r!==wt.LINK&&r!==wt.META&&r!==wt.PARAM&&r!==wt.SOURCE&&r!==wt.TRACK&&r!==wt.WBR){let s=r===wt.TEMPLATE&&n===Ew.HTML?this.treeAdapter.getTemplateContent(e):e;this._serializeChildNodes(s),this.html+="</"+r+">"}}_serializeAttributes(e){let r=this.treeAdapter.getAttrList(e);for(let n=0,s=r.length;n<s;n++){let o=r[n],i=t.escapeString(o.value,!0);this.html+=" ",o.namespace?o.namespace===Ew.XML?this.html+="xml:"+o.name:o.namespace===Ew.XMLNS?(o.name!=="xmlns"&&(this.html+="xmlns:"),this.html+=o.name):o.namespace===Ew.XLINK?this.html+="xlink:"+o.name:this.html+=o.prefix+":"+o.name:this.html+=o.name,this.html+='="'+i+'"'}}_serializeTextNode(e){let r=this.treeAdapter.getTextNodeContent(e),n=this.treeAdapter.getParentNode(e),s;n&&this.treeAdapter.isElementNode(n)&&(s=this.treeAdapter.getTagName(n)),s===wt.STYLE||s===wt.SCRIPT||s===wt.XMP||s===wt.IFRAME||s===wt.NOEMBED||s===wt.NOFRAMES||s===wt.PLAINTEXT||s===wt.NOSCRIPT?this.html+=r:this.html+=t.escapeString(r,!1)}_serializeCommentNode(e){this.html+="<!--"+this.treeAdapter.getCommentNodeContent(e)+"-->"}_serializeDocumentTypeNode(e){let r=this.treeAdapter.getDocumentTypeNodeName(e);this.html+="<"+k2e.serializeContent(r,null,null)+">"}};yw.escapeString=function(t,e){return t=t.replace(I2e,"&amp;").replace(D2e,"&nbsp;"),e?t=t.replace(R2e,"&quot;"):t=t.replace(N2e,"&lt;").replace(O2e,"&gt;"),t};Wee.exports=yw});var Qee=w(Sw=>{"use strict";var Vee=jee(),x2e=Kee();Sw.parse=function(e,r){return new Vee(r).parse(e)};Sw.parseFragment=function(e,r,n){return typeof e=="string"&&(n=r,r=e,e=null),new Vee(n).parseFragment(r,e)};Sw.serialize=function(t,e){return new x2e(t,e).serialize()}});var SP=w(Km=>{"use strict";var yP=Km.NAMESPACES={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/"};Km.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"};Km.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};var ne=Km.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};Km.SPECIAL_ELEMENTS={[yP.HTML]:{[ne.ADDRESS]:!0,[ne.APPLET]:!0,[ne.AREA]:!0,[ne.ARTICLE]:!0,[ne.ASIDE]:!0,[ne.BASE]:!0,[ne.BASEFONT]:!0,[ne.BGSOUND]:!0,[ne.BLOCKQUOTE]:!0,[ne.BODY]:!0,[ne.BR]:!0,[ne.BUTTON]:!0,[ne.CAPTION]:!0,[ne.CENTER]:!0,[ne.COL]:!0,[ne.COLGROUP]:!0,[ne.DD]:!0,[ne.DETAILS]:!0,[ne.DIR]:!0,[ne.DIV]:!0,[ne.DL]:!0,[ne.DT]:!0,[ne.EMBED]:!0,[ne.FIELDSET]:!0,[ne.FIGCAPTION]:!0,[ne.FIGURE]:!0,[ne.FOOTER]:!0,[ne.FORM]:!0,[ne.FRAME]:!0,[ne.FRAMESET]:!0,[ne.H1]:!0,[ne.H2]:!0,[ne.H3]:!0,[ne.H4]:!0,[ne.H5]:!0,[ne.H6]:!0,[ne.HEAD]:!0,[ne.HEADER]:!0,[ne.HGROUP]:!0,[ne.HR]:!0,[ne.HTML]:!0,[ne.IFRAME]:!0,[ne.IMG]:!0,[ne.INPUT]:!0,[ne.LI]:!0,[ne.LINK]:!0,[ne.LISTING]:!0,[ne.MAIN]:!0,[ne.MARQUEE]:!0,[ne.MENU]:!0,[ne.META]:!0,[ne.NAV]:!0,[ne.NOEMBED]:!0,[ne.NOFRAMES]:!0,[ne.NOSCRIPT]:!0,[ne.OBJECT]:!0,[ne.OL]:!0,[ne.P]:!0,[ne.PARAM]:!0,[ne.PLAINTEXT]:!0,[ne.PRE]:!0,[ne.SCRIPT]:!0,[ne.SECTION]:!0,[ne.SELECT]:!0,[ne.SOURCE]:!0,[ne.STYLE]:!0,[ne.SUMMARY]:!0,[ne.TABLE]:!0,[ne.TBODY]:!0,[ne.TD]:!0,[ne.TEMPLATE]:!0,[ne.TEXTAREA]:!0,[ne.TFOOT]:!0,[ne.TH]:!0,[ne.THEAD]:!0,[ne.TITLE]:!0,[ne.TR]:!0,[ne.TRACK]:!0,[ne.UL]:!0,[ne.WBR]:!0,[ne.XMP]:!0},[yP.MATHML]:{[ne.MI]:!0,[ne.MO]:!0,[ne.MN]:!0,[ne.MS]:!0,[ne.MTEXT]:!0,[ne.ANNOTATION_XML]:!0},[yP.SVG]:{[ne.TITLE]:!0,[ne.FOREIGN_OBJECT]:!0,[ne.DESC]:!0}}});var rte=w(bw=>{"use strict";var{DOCUMENT_MODE:Vm}=SP(),Zee="html",M2e="about:legacy-compat",P2e="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ete=["+//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//"],L2e=ete.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),F2e=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],tte=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],$2e=tte.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function Xee(t){let e=t.indexOf('"')!==-1?"'":'"';return e+t+e}function Jee(t,e){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])===0)return!0;return!1}bw.isConforming=function(t){return t.name===Zee&&t.publicId===null&&(t.systemId===null||t.systemId===M2e)};bw.getDocumentMode=function(t){if(t.name!==Zee)return Vm.QUIRKS;let e=t.systemId;if(e&&e.toLowerCase()===P2e)return Vm.QUIRKS;let r=t.publicId;if(r!==null){if(r=r.toLowerCase(),F2e.indexOf(r)>-1)return Vm.QUIRKS;let n=e===null?L2e:ete;if(Jee(r,n))return Vm.QUIRKS;if(n=e===null?tte:$2e,Jee(r,n))return Vm.LIMITED_QUIRKS}return Vm.NO_QUIRKS};bw.serializeContent=function(t,e,r){let n="!DOCTYPE ";return t&&(n+=t),e?n+=" PUBLIC "+Xee(e):r&&(n+=" SYSTEM"),r!==null&&(n+=" "+Xee(r)),n}});var ite=w(et=>{"use strict";var U2e=rte(),{DOCUMENT_MODE:B2e}=SP(),nte={element:1,text:3,cdata:4,comment:8},ste={tagName:"name",childNodes:"children",parentNode:"parent",previousSibling:"prev",nextSibling:"next",nodeValue:"data"},Oa=class{constructor(e){for(let r of Object.keys(e))this[r]=e[r]}get firstChild(){let e=this.children;return e&&e[0]||null}get lastChild(){let e=this.children;return e&&e[e.length-1]||null}get nodeType(){return nte[this.type]||nte.element}};Object.keys(ste).forEach(t=>{let e=ste[t];Object.defineProperty(Oa.prototype,t,{get:function(){return this[e]||null},set:function(r){return this[e]=r,r}})});et.createDocument=function(){return new Oa({type:"root",name:"root",parent:null,prev:null,next:null,children:[],"x-mode":B2e.NO_QUIRKS})};et.createDocumentFragment=function(){return new Oa({type:"root",name:"root",parent:null,prev:null,next:null,children:[]})};et.createElement=function(t,e,r){let n=Object.create(null),s=Object.create(null),o=Object.create(null);for(let i=0;i<r.length;i++){let a=r[i].name;n[a]=r[i].value,s[a]=r[i].namespace,o[a]=r[i].prefix}return new Oa({type:t==="script"||t==="style"?t:"tag",name:t,namespace:e,attribs:n,"x-attribsNamespace":s,"x-attribsPrefix":o,children:[],parent:null,prev:null,next:null})};et.createCommentNode=function(t){return new Oa({type:"comment",data:t,parent:null,prev:null,next:null})};var ote=function(t){return new Oa({type:"text",data:t,parent:null,prev:null,next:null})},bP=et.appendChild=function(t,e){let r=t.children[t.children.length-1];r&&(r.next=e,e.prev=r),t.children.push(e),e.parent=t},G2e=et.insertBefore=function(t,e,r){let n=t.children.indexOf(r),s=r.prev;s&&(s.next=e,e.prev=s),r.prev=e,e.next=r,t.children.splice(n,0,e),e.parent=t};et.setTemplateContent=function(t,e){bP(t,e)};et.getTemplateContent=function(t){return t.children[0]};et.setDocumentType=function(t,e,r,n){let s=U2e.serializeContent(e,r,n),o=null;for(let i=0;i<t.children.length;i++)if(t.children[i].type==="directive"&&t.children[i].name==="!doctype"){o=t.children[i];break}o?(o.data=s,o["x-name"]=e,o["x-publicId"]=r,o["x-systemId"]=n):bP(t,new Oa({type:"directive",name:"!doctype",data:s,"x-name":e,"x-publicId":r,"x-systemId":n}))};et.setDocumentMode=function(t,e){t["x-mode"]=e};et.getDocumentMode=function(t){return t["x-mode"]};et.detachNode=function(t){if(t.parent){let e=t.parent.children.indexOf(t),r=t.prev,n=t.next;t.prev=null,t.next=null,r&&(r.next=n),n&&(n.prev=r),t.parent.children.splice(e,1),t.parent=null}};et.insertText=function(t,e){let r=t.children[t.children.length-1];r&&r.type==="text"?r.data+=e:bP(t,ote(e))};et.insertTextBefore=function(t,e,r){let n=t.children[t.children.indexOf(r)-1];n&&n.type==="text"?n.data+=e:G2e(t,ote(e),r)};et.adoptAttributes=function(t,e){for(let r=0;r<e.length;r++){let n=e[r].name;typeof t.attribs[n]>"u"&&(t.attribs[n]=e[r].value,t["x-attribsNamespace"][n]=e[r].namespace,t["x-attribsPrefix"][n]=e[r].prefix)}};et.getFirstChild=function(t){return t.children[0]};et.getChildNodes=function(t){return t.children};et.getParentNode=function(t){return t.parent};et.getAttrList=function(t){let e=[];for(let r in t.attribs)e.push({name:r,value:t.attribs[r],namespace:t["x-attribsNamespace"][r],prefix:t["x-attribsPrefix"][r]});return e};et.getTagName=function(t){return t.name};et.getNamespaceURI=function(t){return t.namespace};et.getTextNodeContent=function(t){return t.data};et.getCommentNodeContent=function(t){return t.data};et.getDocumentTypeNodeName=function(t){return t["x-name"]};et.getDocumentTypeNodePublicId=function(t){return t["x-publicId"]};et.getDocumentTypeNodeSystemId=function(t){return t["x-systemId"]};et.isTextNode=function(t){return t.type==="text"};et.isCommentNode=function(t){return t.type==="comment"};et.isDocumentTypeNode=function(t){return t.type==="directive"&&t.name==="!doctype"};et.isElementNode=function(t){return!!t.attribs};et.setNodeSourceCodeLocation=function(t,e){t.sourceCodeLocation=e};et.getNodeSourceCodeLocation=function(t){return t.sourceCodeLocation};et.updateNodeSourceCodeLocation=function(t,e){t.sourceCodeLocation=Object.assign(t.sourceCodeLocation,e)}});var lte=w((iht,ate)=>{"use strict";ate.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var TP=w((aht,ute)=>{var yE=lte(),cte={};for(let t of Object.keys(yE))cte[yE[t]]=t;var be={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};ute.exports=be;for(let t of Object.keys(be)){if(!("channels"in be[t]))throw new Error("missing channels property: "+t);if(!("labels"in be[t]))throw new Error("missing channel labels property: "+t);if(be[t].labels.length!==be[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=be[t];delete be[t].channels,delete be[t].labels,Object.defineProperty(be[t],"channels",{value:e}),Object.defineProperty(be[t],"labels",{value:r})}be.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,s=Math.min(e,r,n),o=Math.max(e,r,n),i=o-s,a,l;o===s?a=0:e===o?a=(r-n)/i:r===o?a=2+(n-e)/i:n===o&&(a=4+(e-r)/i),a=Math.min(a*60,360),a<0&&(a+=360);let c=(s+o)/2;return o===s?l=0:c<=.5?l=i/(o+s):l=i/(2-o-s),[a,l*100,c*100]};be.rgb.hsv=function(t){let e,r,n,s,o,i=t[0]/255,a=t[1]/255,l=t[2]/255,c=Math.max(i,a,l),u=c-Math.min(i,a,l),d=function(p){return(c-p)/6/u+1/2};return u===0?(s=0,o=0):(o=u/c,e=d(i),r=d(a),n=d(l),i===c?s=n-r:a===c?s=1/3+e-n:l===c&&(s=2/3+r-e),s<0?s+=1:s>1&&(s-=1)),[s*360,o*100,c*100]};be.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],s=be.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[s,o*100,n*100]};be.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,s=Math.min(1-e,1-r,1-n),o=(1-e-s)/(1-s)||0,i=(1-r-s)/(1-s)||0,a=(1-n-s)/(1-s)||0;return[o*100,i*100,a*100,s*100]};function z2e(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}be.rgb.keyword=function(t){let e=cte[t];if(e)return e;let r=1/0,n;for(let s of Object.keys(yE)){let o=yE[s],i=z2e(t,o);i<r&&(r=i,n=s)}return n};be.keyword.rgb=function(t){return yE[t]};be.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let s=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,i=e*.0193+r*.1192+n*.9505;return[s*100,o*100,i*100]};be.rgb.lab=function(t){let e=be.rgb.xyz(t),r=e[0],n=e[1],s=e[2];r/=95.047,n/=100,s/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let o=116*n-16,i=500*(r-n),a=200*(n-s);return[o,i,a]};be.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,s,o,i;if(r===0)return i=n*255,[i,i,i];n<.5?s=n*(1+r):s=n+r-n*r;let a=2*n-s,l=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?i=a+(s-a)*6*o:2*o<1?i=s:3*o<2?i=a+(s-a)*(2/3-o)*6:i=a,l[c]=i*255;return l};be.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,s=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,s*=o<=1?o:2-o;let i=(n+r)/2,a=n===0?2*s/(o+s):2*r/(n+r);return[e,a*100,i*100]};be.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,s=Math.floor(e)%6,o=e-Math.floor(e),i=255*n*(1-r),a=255*n*(1-r*o),l=255*n*(1-r*(1-o));switch(n*=255,s){case 0:return[n,l,i];case 1:return[a,n,i];case 2:return[i,n,l];case 3:return[i,a,n];case 4:return[l,i,n];case 5:return[n,i,a]}};be.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,s=Math.max(n,.01),o,i;i=(2-r)*n;let a=(2-r)*s;return o=r*s,o/=a<=1?a:2-a,o=o||0,i/=2,[e,o*100,i*100]};be.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,s=r+n,o;s>1&&(r/=s,n/=s);let i=Math.floor(6*e),a=1-n;o=6*e-i,i&1&&(o=1-o);let l=r+o*(a-r),c,u,d;switch(i){default:case 6:case 0:c=a,u=l,d=r;break;case 1:c=l,u=a,d=r;break;case 2:c=r,u=a,d=l;break;case 3:c=r,u=l,d=a;break;case 4:c=l,u=r,d=a;break;case 5:c=a,u=r,d=l;break}return[c*255,u*255,d*255]};be.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,s=t[3]/100,o=1-Math.min(1,e*(1-s)+s),i=1-Math.min(1,r*(1-s)+s),a=1-Math.min(1,n*(1-s)+s);return[o*255,i*255,a*255]};be.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,s,o,i;return s=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,i=e*.0557+r*-.204+n*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),[s*255,o*255,i*255]};be.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let s=116*r-16,o=500*(e-r),i=200*(r-n);return[s,o,i]};be.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],s,o,i;o=(e+16)/116,s=r/500+o,i=o-n/200;let a=o**3,l=s**3,c=i**3;return o=a>.008856?a:(o-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,s*=95.047,o*=100,i*=108.883,[s,o,i]};be.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],s;s=Math.atan2(n,r)*360/2/Math.PI,s<0&&(s+=360);let i=Math.sqrt(r*r+n*n);return[e,i,s]};be.lch.lab=function(t){let e=t[0],r=t[1],s=t[2]/360*2*Math.PI,o=r*Math.cos(s),i=r*Math.sin(s);return[e,o,i]};be.rgb.ansi16=function(t,e=null){let[r,n,s]=t,o=e===null?be.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let i=30+(Math.round(s/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(i+=60),i};be.hsv.ansi16=function(t){return be.rgb.ansi16(be.hsv.rgb(t),t[2])};be.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};be.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,s=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,s,o]};be.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,s=e%6/5*255;return[r,n,s]};be.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};be.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),s=n>>16&255,o=n>>8&255,i=n&255;return[s,o,i]};be.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,s=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),i=s-o,a,l;return i<1?a=o/(1-i):a=0,i<=0?l=0:s===e?l=(r-n)/i%6:s===r?l=2+(n-e)/i:l=4+(e-r)/i,l/=6,l%=1,[l*360,i*100,a*100]};be.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),s=0;return n<1&&(s=(r-.5*n)/(1-n)),[t[0],n*100,s*100]};be.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,s=0;return n<1&&(s=(r-n)/(1-n)),[t[0],n*100,s*100]};be.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let s=[0,0,0],o=e%1*6,i=o%1,a=1-i,l=0;switch(Math.floor(o)){case 0:s[0]=1,s[1]=i,s[2]=0;break;case 1:s[0]=a,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=i;break;case 3:s[0]=0,s[1]=a,s[2]=1;break;case 4:s[0]=i,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=a}return l=(1-r)*n,[(r*s[0]+l)*255,(r*s[1]+l)*255,(r*s[2]+l)*255]};be.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),s=0;return n>0&&(s=e/n),[t[0],s*100,n*100]};be.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,s=0;return n>0&&n<.5?s=e/(2*n):n>=.5&&n<1&&(s=e/(2*(1-n))),[t[0],s*100,n*100]};be.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};be.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,s=n-e,o=0;return s<1&&(o=(n-s)/(1-s)),[t[0],s*100,o*100]};be.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};be.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};be.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};be.gray.hsl=function(t){return[0,0,t[0]]};be.gray.hsv=be.gray.hsl;be.gray.hwb=function(t){return[0,100,t[0]]};be.gray.cmyk=function(t){return[0,0,0,t[0]]};be.gray.lab=function(t){return[t[0],0,0]};be.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};be.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var pte=w((lht,dte)=>{var Tw=TP();function H2e(){let t={},e=Object.keys(Tw);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function q2e(t){let e=H2e(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),s=Object.keys(Tw[n]);for(let o=s.length,i=0;i<o;i++){let a=s[i],l=e[a];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,r.unshift(a))}}return e}function j2e(t,e){return function(r){return e(t(r))}}function Y2e(t,e){let r=[e[t].parent,t],n=Tw[e[t].parent][t],s=e[t].parent;for(;e[s].parent;)r.unshift(e[s].parent),n=j2e(Tw[e[s].parent][s],n),s=e[s].parent;return n.conversion=r,n}dte.exports=function(t){let e=q2e(t),r={},n=Object.keys(e);for(let s=n.length,o=0;o<s;o++){let i=n[o];e[i].parent!==null&&(r[i]=Y2e(i,e))}return r}});var fte=w((cht,mte)=>{var wP=TP(),W2e=pte(),Qm={},K2e=Object.keys(wP);function V2e(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function Q2e(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let s=t(r);if(typeof s=="object")for(let o=s.length,i=0;i<o;i++)s[i]=Math.round(s[i]);return s};return"conversion"in t&&(e.conversion=t.conversion),e}K2e.forEach(t=>{Qm[t]={},Object.defineProperty(Qm[t],"channels",{value:wP[t].channels}),Object.defineProperty(Qm[t],"labels",{value:wP[t].labels});let e=W2e(t);Object.keys(e).forEach(n=>{let s=e[n];Qm[t][n]=Q2e(s),Qm[t][n].raw=V2e(s)})});mte.exports=Qm});var Ste=w((uht,yte)=>{"use strict";var hte=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,gte=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},_te=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},ww=t=>t,Ete=(t,e,r)=>[t,e,r],Xm=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},CP,Jm=(t,e,r,n)=>{CP===void 0&&(CP=fte());let s=n?10:0,o={};for(let[i,a]of Object.entries(CP)){let l=i==="ansi16"?"ansi":i;i===e?o[l]=t(r,s):typeof a=="object"&&(o[l]=t(a[e],s))}return o};function X2e(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[s,o]of Object.entries(n))e[s]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[s]=e[s],t.set(o[0],o[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Xm(e.color,"ansi",()=>Jm(hte,"ansi16",ww,!1)),Xm(e.color,"ansi256",()=>Jm(gte,"ansi256",ww,!1)),Xm(e.color,"ansi16m",()=>Jm(_te,"rgb",Ete,!1)),Xm(e.bgColor,"ansi",()=>Jm(hte,"ansi16",ww,!0)),Xm(e.bgColor,"ansi256",()=>Jm(gte,"ansi256",ww,!0)),Xm(e.bgColor,"ansi16m",()=>Jm(_te,"rgb",Ete,!0)),e}Object.defineProperty(yte,"exports",{enumerable:!0,get:X2e})});var vP=w((dht,bte)=>{"use strict";bte.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),s=e.indexOf("--");return n!==-1&&(s===-1||n<s)}});var IP=w((pht,wte)=>{"use strict";var J2e=fe("os"),Tte=fe("tty"),Ks=vP(),{env:$r}=process,dc;Ks("no-color")||Ks("no-colors")||Ks("color=false")||Ks("color=never")?dc=0:(Ks("color")||Ks("colors")||Ks("color=true")||Ks("color=always"))&&(dc=1);"FORCE_COLOR"in $r&&($r.FORCE_COLOR==="true"?dc=1:$r.FORCE_COLOR==="false"?dc=0:dc=$r.FORCE_COLOR.length===0?1:Math.min(parseInt($r.FORCE_COLOR,10),3));function kP(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function AP(t,e){if(dc===0)return 0;if(Ks("color=16m")||Ks("color=full")||Ks("color=truecolor"))return 3;if(Ks("color=256"))return 2;if(t&&!e&&dc===void 0)return 0;let r=dc||0;if($r.TERM==="dumb")return r;if(process.platform==="win32"){let n=J2e.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in $r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in $r)||$r.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in $r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($r.TEAMCITY_VERSION)?1:0;if($r.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $r){let n=parseInt(($r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($r.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($r.TERM)||"COLORTERM"in $r?1:r}function Z2e(t){let e=AP(t,t&&t.isTTY);return kP(e)}wte.exports={supportsColor:Z2e,stdout:kP(AP(!0,Tte.isatty(1))),stderr:kP(AP(!0,Tte.isatty(2)))}});var vte=w((mht,Cte)=>{"use strict";var e$e=(t,e,r)=>{let n=t.indexOf(e);if(n===-1)return t;let s=e.length,o=0,i="";do i+=t.substr(o,n-o)+e+r,o=n+s,n=t.indexOf(e,o);while(n!==-1);return i+=t.substr(o),i},t$e=(t,e,r,n)=>{let s=0,o="";do{let i=t[n-1]==="\r";o+=t.substr(s,(i?n-1:n)-s)+e+(i?`\r
1089
+ `)){if(r.chars.length===1)continue;r.chars=r.chars.substr(1)}if(this._processInputToken(r),e&&this.pendingScript)break}}runParsingLoopForCurrentChunk(e,r){if(this._runParsingLoop(r),r&&this.pendingScript){let n=this.pendingScript;this.pendingScript=null,r(n);return}e&&e()}_setupTokenizerCDATAMode(){let e=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=e&&e!==this.document&&this.treeAdapter.getNamespaceURI(e)!==Ee.HTML&&!this._isIntegrationPoint(e)}_switchToTextParsing(e,r){this._insertElement(e,Ee.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=cw}switchToPlaintextParsing(){this.insertionMode=cw,this.originalInsertionMode=Ai,this.tokenizer.state=O.MODE.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;do{if(this.treeAdapter.getTagName(e)===b.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}while(e)}_initTokenizerForFragmentParsing(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===Ee.HTML){let e=this.treeAdapter.getTagName(this.fragmentContext);e===b.TITLE||e===b.TEXTAREA?this.tokenizer.state=O.MODE.RCDATA:e===b.STYLE||e===b.XMP||e===b.IFRAME||e===b.NOEMBED||e===b.NOFRAMES||e===b.NOSCRIPT?this.tokenizer.state=O.MODE.RAWTEXT:e===b.SCRIPT?this.tokenizer.state=O.MODE.SCRIPT_DATA:e===b.PLAINTEXT&&(this.tokenizer.state=O.MODE.PLAINTEXT)}}_setDocumentType(e){let r=e.name||"",n=e.publicId||"",s=e.systemId||"";this.treeAdapter.setDocumentType(this.document,r,n,s)}_attachElementToTree(e){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let r=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(r,e)}}_appendElement(e,r){let n=this.treeAdapter.createElement(e.tagName,r,e.attrs);this._attachElementToTree(n)}_insertElement(e,r){let n=this.treeAdapter.createElement(e.tagName,r,e.attrs);this._attachElementToTree(n),this.openElements.push(n)}_insertFakeElement(e){let r=this.treeAdapter.createElement(e,Ee.HTML,[]);this._attachElementToTree(r),this.openElements.push(r)}_insertTemplate(e){let r=this.treeAdapter.createElement(e.tagName,Ee.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r),this.openElements.push(r)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(b.HTML,Ee.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e)}_appendCommentNode(e,r){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(r,n)}_insertCharacters(e){if(this._shouldFosterParentOnInsertion())this._fosterParentText(e.chars);else{let r=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(r,e.chars)}}_adoptNodes(e,r){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_shouldProcessTokenInForeignContent(e){let r=this._getAdjustedCurrentElement();if(!r||r===this.document)return!1;let n=this.treeAdapter.getNamespaceURI(r);if(n===Ee.HTML||this.treeAdapter.getTagName(r)===b.ANNOTATION_XML&&n===Ee.MATHML&&e.type===O.START_TAG_TOKEN&&e.tagName===b.SVG)return!1;let s=e.type===O.CHARACTER_TOKEN||e.type===O.NULL_CHARACTER_TOKEN||e.type===O.WHITESPACE_CHARACTER_TOKEN;return(e.type===O.START_TAG_TOKEN&&e.tagName!==b.MGLYPH&&e.tagName!==b.MALIGNMARK||s)&&this._isIntegrationPoint(r,Ee.MATHML)||(e.type===O.START_TAG_TOKEN||s)&&this._isIntegrationPoint(r,Ee.HTML)?!1:e.type!==O.EOF_TOKEN}_processToken(e){Cee[this.insertionMode][e.type](this,e)}_processTokenInBodyMode(e){Cee[Ai][e.type](this,e)}_processTokenInForeignContent(e){e.type===O.CHARACTER_TOKEN?b2e(this,e):e.type===O.NULL_CHARACTER_TOKEN?S2e(this,e):e.type===O.WHITESPACE_CHARACTER_TOKEN?rs(this,e):e.type===O.COMMENT_TOKEN?vr(this,e):e.type===O.START_TAG_TOKEN?T2e(this,e):e.type===O.END_TAG_TOKEN&&w2e(this,e)}_processInputToken(e){this._shouldProcessTokenInForeignContent(e)?this._processTokenInForeignContent(e):this._processToken(e),e.type===O.START_TAG_TOKEN&&e.selfClosing&&!e.ackSelfClosing&&this._err(jr.nonVoidHtmlElementStartTagWithTrailingSolidus)}_isIntegrationPoint(e,r){let n=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e),o=this.treeAdapter.getAttrList(e);return ki.isIntegrationPoint(n,s,o,r)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.length;if(e){let r=e,n=null;do if(r--,n=this.activeFormattingElements.entries[r],n.type===bee.MARKER_ENTRY||this.openElements.contains(n.element)){r++;break}while(r>0);for(let s=r;s<e;s++)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=Na}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(b.P),this.openElements.popUntilTagNamePopped(b.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop,r=!1;e>=0;e--){let n=this.openElements.items[e];e===0&&(r=!0,this.fragmentContext&&(n=this.fragmentContext));let s=this.treeAdapter.getTagName(n),o=YLe[s];if(o){this.insertionMode=o;break}else if(!r&&(s===b.TD||s===b.TH)){this.insertionMode=gw;break}else if(!r&&s===b.HEAD){this.insertionMode=Wm;break}else if(s===b.SELECT){this._resetInsertionModeForSelect(e);break}else if(s===b.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}else if(s===b.HTML){this.insertionMode=this.headElement?fw:mw;break}else if(r){this.insertionMode=Ai;break}}}_resetInsertionModeForSelect(e){if(e>0)for(let r=e-1;r>0;r--){let n=this.openElements.items[r],s=this.treeAdapter.getTagName(n);if(s===b.TEMPLATE)break;if(s===b.TABLE){this.insertionMode=fP;return}}this.insertionMode=mP}_pushTmplInsertionMode(e){this.tmplInsertionModeStack.push(e),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=e}_popTmplInsertionMode(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]}_isElementCausesFosterParenting(e){let r=this.treeAdapter.getTagName(e);return r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}_findFosterParentingLocation(){let e={parent:null,beforeElement:null};for(let r=this.openElements.stackTop;r>=0;r--){let n=this.openElements.items[r],s=this.treeAdapter.getTagName(n),o=this.treeAdapter.getNamespaceURI(n);if(s===b.TEMPLATE&&o===Ee.HTML){e.parent=this.treeAdapter.getTemplateContent(n);break}else if(s===b.TABLE){e.parent=this.treeAdapter.getParentNode(n),e.parent?e.beforeElement=n:e.parent=this.openElements.items[r-1];break}}return e.parent||(e.parent=this.openElements.items[0]),e}_fosterParentElement(e){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,e,r.beforeElement):this.treeAdapter.appendChild(r.parent,e)}_fosterParentText(e){let r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertTextBefore(r.parent,e,r.beforeElement):this.treeAdapter.insertText(r.parent,e)}_isSpecialElement(e){let r=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);return qu.SPECIAL_ELEMENTS[n][r]}};qee.exports=dP;function KLe(t,e){let r=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return r?t.openElements.contains(r.element)?t.openElements.hasInScope(e.tagName)||(r=null):(t.activeFormattingElements.removeEntry(r),r=null):Uo(t,e),r}function VLe(t,e){let r=null;for(let n=t.openElements.stackTop;n>=0;n--){let s=t.openElements.items[n];if(s===e.element)break;t._isSpecialElement(s)&&(r=s)}return r||(t.openElements.popUntilElementPopped(e.element),t.activeFormattingElements.removeEntry(e)),r}function QLe(t,e,r){let n=e,s=t.openElements.getCommonAncestor(e);for(let o=0,i=s;i!==r;o++,i=s){s=t.openElements.getCommonAncestor(i);let a=t.activeFormattingElements.getElementEntry(i),l=a&&o>=jLe;!a||l?(l&&t.activeFormattingElements.removeEntry(a),t.openElements.remove(i)):(i=XLe(t,a),n===e&&(t.activeFormattingElements.bookmark=a),t.treeAdapter.detachNode(n),t.treeAdapter.appendChild(i,n),n=i)}return n}function XLe(t,e){let r=t.treeAdapter.getNamespaceURI(e.element),n=t.treeAdapter.createElement(e.token.tagName,r,e.token.attrs);return t.openElements.replace(e.element,n),e.element=n,n}function JLe(t,e,r){if(t._isElementCausesFosterParenting(e))t._fosterParentElement(r);else{let n=t.treeAdapter.getTagName(e),s=t.treeAdapter.getNamespaceURI(e);n===b.TEMPLATE&&s===Ee.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,r)}}function ZLe(t,e,r){let n=t.treeAdapter.getNamespaceURI(r.element),s=r.token,o=t.treeAdapter.createElement(s.tagName,n,s.attrs);t._adoptNodes(e,o),t.treeAdapter.appendChild(e,o),t.activeFormattingElements.insertElementAfterBookmark(o,r.token),t.activeFormattingElements.removeEntry(r),t.openElements.remove(r.element),t.openElements.insertAfter(e,o)}function uc(t,e){let r;for(let n=0;n<qLe&&(r=KLe(t,e,r),!!r);n++){let s=VLe(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;let o=QLe(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(o),JLe(t,i,o),ZLe(t,s,r)}}function Ve(){}function iw(t){t._err(jr.misplacedDoctype)}function vr(t,e){t._appendCommentNode(e,t.openElements.currentTmplContent||t.openElements.current)}function eFe(t,e){t._appendCommentNode(e,t.openElements.items[0])}function vee(t,e){t._appendCommentNode(e,t.document)}function rs(t,e){t._insertCharacters(e)}function uE(t){t.stopped=!0}function tFe(t,e){t._setDocumentType(e);let r=e.forceQuirks?qu.DOCUMENT_MODE.QUIRKS:wee.getDocumentMode(e);wee.isConforming(e)||t._err(jr.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,r),t.insertionMode=pP}function dE(t,e){t._err(jr.missingDoctype,{beforeToken:!0}),t.treeAdapter.setDocumentMode(t.document,qu.DOCUMENT_MODE.QUIRKS),t.insertionMode=pP,t._processToken(e)}function rFe(t,e){e.tagName===b.HTML?(t._insertElement(e,Ee.HTML),t.insertionMode=mw):mE(t,e)}function nFe(t,e){let r=e.tagName;(r===b.HTML||r===b.HEAD||r===b.BODY||r===b.BR)&&mE(t,e)}function mE(t,e){t._insertFakeRootElement(),t.insertionMode=mw,t._processToken(e)}function sFe(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.HEAD?(t._insertElement(e,Ee.HTML),t.headElement=t.openElements.current,t.insertionMode=Wm):fE(t,e)}function oFe(t,e){let r=e.tagName;r===b.HEAD||r===b.BODY||r===b.HTML||r===b.BR?fE(t,e):t._err(jr.endTagWithoutMatchingOpenElement)}function fE(t,e){t._insertFakeElement(b.HEAD),t.headElement=t.openElements.current,t.insertionMode=Wm,t._processToken(e)}function Fr(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.BASE||r===b.BASEFONT||r===b.BGSOUND||r===b.LINK||r===b.META?(t._appendElement(e,Ee.HTML),e.ackSelfClosing=!0):r===b.TITLE?t._switchToTextParsing(e,O.MODE.RCDATA):r===b.NOSCRIPT?t.options.scriptingEnabled?t._switchToTextParsing(e,O.MODE.RAWTEXT):(t._insertElement(e,Ee.HTML),t.insertionMode=Lee):r===b.NOFRAMES||r===b.STYLE?t._switchToTextParsing(e,O.MODE.RAWTEXT):r===b.SCRIPT?t._switchToTextParsing(e,O.MODE.SCRIPT_DATA):r===b.TEMPLATE?(t._insertTemplate(e,Ee.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=uw,t._pushTmplInsertionMode(uw)):r===b.HEAD?t._err(jr.misplacedStartTagForHeadElement):hE(t,e)}function ju(t,e){let r=e.tagName;r===b.HEAD?(t.openElements.pop(),t.insertionMode=fw):r===b.BODY||r===b.BR||r===b.HTML?hE(t,e):r===b.TEMPLATE&&t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagName!==b.TEMPLATE&&t._err(jr.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(b.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t._popTmplInsertionMode(),t._resetInsertionMode()):t._err(jr.endTagWithoutMatchingOpenElement)}function hE(t,e){t.openElements.pop(),t.insertionMode=fw,t._processToken(e)}function iFe(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.BASEFONT||r===b.BGSOUND||r===b.HEAD||r===b.LINK||r===b.META||r===b.NOFRAMES||r===b.STYLE?Fr(t,e):r===b.NOSCRIPT?t._err(jr.nestedNoscriptInHead):gE(t,e)}function aFe(t,e){let r=e.tagName;r===b.NOSCRIPT?(t.openElements.pop(),t.insertionMode=Wm):r===b.BR?gE(t,e):t._err(jr.endTagWithoutMatchingOpenElement)}function gE(t,e){let r=e.type===O.EOF_TOKEN?jr.openElementsLeftAfterEof:jr.disallowedContentInNoscriptInHead;t._err(r),t.openElements.pop(),t.insertionMode=Wm,t._processToken(e)}function lFe(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.BODY?(t._insertElement(e,Ee.HTML),t.framesetOk=!1,t.insertionMode=Ai):r===b.FRAMESET?(t._insertElement(e,Ee.HTML),t.insertionMode=_w):r===b.BASE||r===b.BASEFONT||r===b.BGSOUND||r===b.LINK||r===b.META||r===b.NOFRAMES||r===b.SCRIPT||r===b.STYLE||r===b.TEMPLATE||r===b.TITLE?(t._err(jr.abandonedHeadElementChild),t.openElements.push(t.headElement),Fr(t,e),t.openElements.remove(t.headElement)):r===b.HEAD?t._err(jr.misplacedStartTagForHeadElement):_E(t,e)}function cFe(t,e){let r=e.tagName;r===b.BODY||r===b.HTML||r===b.BR?_E(t,e):r===b.TEMPLATE?ju(t,e):t._err(jr.endTagWithoutMatchingOpenElement)}function _E(t,e){t._insertFakeElement(b.BODY),t.insertionMode=Ai,t._processToken(e)}function Hu(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function aw(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function uFe(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function dFe(t,e){let r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(r,e.attrs))}function pFe(t,e){let r=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&r&&(t.treeAdapter.detachNode(r),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Ee.HTML),t.insertionMode=_w)}function Ia(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML)}function mFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement();let r=t.openElements.currentTagName;(r===b.H1||r===b.H2||r===b.H3||r===b.H4||r===b.H5||r===b.H6)&&t.openElements.pop(),t._insertElement(e,Ee.HTML)}function kee(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function fFe(t,e){let r=t.openElements.tmplCount>0;(!t.formElement||r)&&(t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML),r||(t.formElement=t.openElements.current))}function hFe(t,e){t.framesetOk=!1;let r=e.tagName;for(let n=t.openElements.stackTop;n>=0;n--){let s=t.openElements.items[n],o=t.treeAdapter.getTagName(s),i=null;if(r===b.LI&&o===b.LI?i=b.LI:(r===b.DD||r===b.DT)&&(o===b.DD||o===b.DT)&&(i=o),i){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(o!==b.ADDRESS&&o!==b.DIV&&o!==b.P&&t._isSpecialElement(s))break}t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML)}function gFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML),t.tokenizer.state=O.MODE.PLAINTEXT}function _Fe(t,e){t.openElements.hasInScope(b.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.framesetOk=!1}function EFe(t,e){let r=t.activeFormattingElements.getElementEntryInScopeWithTagName(b.A);r&&(uc(t,e),t.openElements.remove(r.element),t.activeFormattingElements.removeEntry(r)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function jm(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function yFe(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(b.NOBR)&&(uc(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ee.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Aee(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function SFe(t,e){t.treeAdapter.getDocumentMode(t.document)!==qu.DOCUMENT_MODE.QUIRKS&&t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML),t.framesetOk=!1,t.insertionMode=mn}function Ym(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ee.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function bFe(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ee.HTML);let r=O.getTokenAttr(e,xee.TYPE);(!r||r.toLowerCase()!==Mee)&&(t.framesetOk=!1),e.ackSelfClosing=!0}function Iee(t,e){t._appendElement(e,Ee.HTML),e.ackSelfClosing=!0}function TFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._appendElement(e,Ee.HTML),t.framesetOk=!1,t.ackSelfClosing=!0}function wFe(t,e){e.tagName=b.IMG,Ym(t,e)}function CFe(t,e){t._insertElement(e,Ee.HTML),t.skipNextNewLine=!0,t.tokenizer.state=O.MODE.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=cw}function vFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,O.MODE.RAWTEXT)}function kFe(t,e){t.framesetOk=!1,t._switchToTextParsing(e,O.MODE.RAWTEXT)}function Dee(t,e){t._switchToTextParsing(e,O.MODE.RAWTEXT)}function AFe(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML),t.framesetOk=!1,t.insertionMode===mn||t.insertionMode===hw||t.insertionMode===Ws||t.insertionMode===Na||t.insertionMode===gw?t.insertionMode=fP:t.insertionMode=mP}function Ree(t,e){t.openElements.currentTagName===b.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML)}function Nee(t,e){t.openElements.hasInScope(b.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ee.HTML)}function IFe(t,e){t.openElements.hasInScope(b.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(b.RTC),t._insertElement(e,Ee.HTML)}function DFe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Ee.HTML)}function RFe(t,e){t._reconstructActiveFormattingElements(),ki.adjustTokenMathMLAttrs(e),ki.adjustTokenXMLAttrs(e),e.selfClosing?t._appendElement(e,Ee.MATHML):t._insertElement(e,Ee.MATHML),e.ackSelfClosing=!0}function NFe(t,e){t._reconstructActiveFormattingElements(),ki.adjustTokenSVGAttrs(e),ki.adjustTokenXMLAttrs(e),e.selfClosing?t._appendElement(e,Ee.SVG):t._insertElement(e,Ee.SVG),e.ackSelfClosing=!0}function js(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ee.HTML)}function ns(t,e){let r=e.tagName;switch(r.length){case 1:r===b.I||r===b.S||r===b.B||r===b.U?jm(t,e):r===b.P?Ia(t,e):r===b.A?EFe(t,e):js(t,e);break;case 2:r===b.DL||r===b.OL||r===b.UL?Ia(t,e):r===b.H1||r===b.H2||r===b.H3||r===b.H4||r===b.H5||r===b.H6?mFe(t,e):r===b.LI||r===b.DD||r===b.DT?hFe(t,e):r===b.EM||r===b.TT?jm(t,e):r===b.BR?Ym(t,e):r===b.HR?TFe(t,e):r===b.RB?Nee(t,e):r===b.RT||r===b.RP?IFe(t,e):r!==b.TH&&r!==b.TD&&r!==b.TR&&js(t,e);break;case 3:r===b.DIV||r===b.DIR||r===b.NAV?Ia(t,e):r===b.PRE?kee(t,e):r===b.BIG?jm(t,e):r===b.IMG||r===b.WBR?Ym(t,e):r===b.XMP?vFe(t,e):r===b.SVG?NFe(t,e):r===b.RTC?Nee(t,e):r!==b.COL&&js(t,e);break;case 4:r===b.HTML?uFe(t,e):r===b.BASE||r===b.LINK||r===b.META?Fr(t,e):r===b.BODY?dFe(t,e):r===b.MAIN||r===b.MENU?Ia(t,e):r===b.FORM?fFe(t,e):r===b.CODE||r===b.FONT?jm(t,e):r===b.NOBR?yFe(t,e):r===b.AREA?Ym(t,e):r===b.MATH?RFe(t,e):r===b.MENU?DFe(t,e):r!==b.HEAD&&js(t,e);break;case 5:r===b.STYLE||r===b.TITLE?Fr(t,e):r===b.ASIDE?Ia(t,e):r===b.SMALL?jm(t,e):r===b.TABLE?SFe(t,e):r===b.EMBED?Ym(t,e):r===b.INPUT?bFe(t,e):r===b.PARAM||r===b.TRACK?Iee(t,e):r===b.IMAGE?wFe(t,e):r!==b.FRAME&&r!==b.TBODY&&r!==b.TFOOT&&r!==b.THEAD&&js(t,e);break;case 6:r===b.SCRIPT?Fr(t,e):r===b.CENTER||r===b.FIGURE||r===b.FOOTER||r===b.HEADER||r===b.HGROUP||r===b.DIALOG?Ia(t,e):r===b.BUTTON?_Fe(t,e):r===b.STRIKE||r===b.STRONG?jm(t,e):r===b.APPLET||r===b.OBJECT?Aee(t,e):r===b.KEYGEN?Ym(t,e):r===b.SOURCE?Iee(t,e):r===b.IFRAME?kFe(t,e):r===b.SELECT?AFe(t,e):r===b.OPTION?Ree(t,e):js(t,e);break;case 7:r===b.BGSOUND?Fr(t,e):r===b.DETAILS||r===b.ADDRESS||r===b.ARTICLE||r===b.SECTION||r===b.SUMMARY?Ia(t,e):r===b.LISTING?kee(t,e):r===b.MARQUEE?Aee(t,e):r===b.NOEMBED?Dee(t,e):r!==b.CAPTION&&js(t,e);break;case 8:r===b.BASEFONT?Fr(t,e):r===b.FRAMESET?pFe(t,e):r===b.FIELDSET?Ia(t,e):r===b.TEXTAREA?CFe(t,e):r===b.TEMPLATE?Fr(t,e):r===b.NOSCRIPT?t.options.scriptingEnabled?Dee(t,e):js(t,e):r===b.OPTGROUP?Ree(t,e):r!==b.COLGROUP&&js(t,e);break;case 9:r===b.PLAINTEXT?gFe(t,e):js(t,e);break;case 10:r===b.BLOCKQUOTE||r===b.FIGCAPTION?Ia(t,e):js(t,e);break;default:js(t,e)}}function OFe(t){t.openElements.hasInScope(b.BODY)&&(t.insertionMode=hP)}function xFe(t,e){t.openElements.hasInScope(b.BODY)&&(t.insertionMode=hP,t._processToken(e))}function cc(t,e){let r=e.tagName;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r))}function MFe(t){let e=t.openElements.tmplCount>0,r=t.formElement;e||(t.formElement=null),(r||e)&&t.openElements.hasInScope(b.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(b.FORM):t.openElements.remove(r))}function PFe(t){t.openElements.hasInButtonScope(b.P)||t._insertFakeElement(b.P),t._closePElement()}function LFe(t){t.openElements.hasInListItemScope(b.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(b.LI),t.openElements.popUntilTagNamePopped(b.LI))}function FFe(t,e){let r=e.tagName;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r))}function $Fe(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function Oee(t,e){let r=e.tagName;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker())}function UFe(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(b.BR),t.openElements.pop(),t.framesetOk=!1}function Uo(t,e){let r=e.tagName;for(let n=t.openElements.stackTop;n>0;n--){let s=t.openElements.items[n];if(t.treeAdapter.getTagName(s)===r){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilElementPopped(s);break}if(t._isSpecialElement(s))break}}function gP(t,e){let r=e.tagName;switch(r.length){case 1:r===b.A||r===b.B||r===b.I||r===b.S||r===b.U?uc(t,e):r===b.P?PFe(t,e):Uo(t,e);break;case 2:r===b.DL||r===b.UL||r===b.OL?cc(t,e):r===b.LI?LFe(t,e):r===b.DD||r===b.DT?FFe(t,e):r===b.H1||r===b.H2||r===b.H3||r===b.H4||r===b.H5||r===b.H6?$Fe(t,e):r===b.BR?UFe(t,e):r===b.EM||r===b.TT?uc(t,e):Uo(t,e);break;case 3:r===b.BIG?uc(t,e):r===b.DIR||r===b.DIV||r===b.NAV||r===b.PRE?cc(t,e):Uo(t,e);break;case 4:r===b.BODY?OFe(t,e):r===b.HTML?xFe(t,e):r===b.FORM?MFe(t,e):r===b.CODE||r===b.FONT||r===b.NOBR?uc(t,e):r===b.MAIN||r===b.MENU?cc(t,e):Uo(t,e);break;case 5:r===b.ASIDE?cc(t,e):r===b.SMALL?uc(t,e):Uo(t,e);break;case 6:r===b.CENTER||r===b.FIGURE||r===b.FOOTER||r===b.HEADER||r===b.HGROUP||r===b.DIALOG?cc(t,e):r===b.APPLET||r===b.OBJECT?Oee(t,e):r===b.STRIKE||r===b.STRONG?uc(t,e):Uo(t,e);break;case 7:r===b.ADDRESS||r===b.ARTICLE||r===b.DETAILS||r===b.SECTION||r===b.SUMMARY||r===b.LISTING?cc(t,e):r===b.MARQUEE?Oee(t,e):Uo(t,e);break;case 8:r===b.FIELDSET?cc(t,e):r===b.TEMPLATE?ju(t,e):Uo(t,e);break;case 10:r===b.BLOCKQUOTE||r===b.FIGCAPTION?cc(t,e):Uo(t,e);break;default:Uo(t,e)}}function Da(t,e){t.tmplInsertionModeStackTop>-1?Hee(t,e):t.stopped=!0}function BFe(t,e){e.tagName===b.SCRIPT&&(t.pendingScript=t.openElements.current),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function GFe(t,e){t._err(jr.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t._processToken(e)}function Ra(t,e){let r=t.openElements.currentTagName;r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR?(t.pendingCharacterTokens=[],t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=Fee,t._processToken(e)):Ys(t,e)}function zFe(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ee.HTML),t.insertionMode=hw}function HFe(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ee.HTML),t.insertionMode=EE}function qFe(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(b.COLGROUP),t.insertionMode=EE,t._processToken(e)}function jFe(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ee.HTML),t.insertionMode=Ws}function YFe(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(b.TBODY),t.insertionMode=Ws,t._processToken(e)}function WFe(t,e){t.openElements.hasInTableScope(b.TABLE)&&(t.openElements.popUntilTagNamePopped(b.TABLE),t._resetInsertionMode(),t._processToken(e))}function KFe(t,e){let r=O.getTokenAttr(e,xee.TYPE);r&&r.toLowerCase()===Mee?t._appendElement(e,Ee.HTML):Ys(t,e),e.ackSelfClosing=!0}function VFe(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ee.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function _P(t,e){let r=e.tagName;switch(r.length){case 2:r===b.TD||r===b.TH||r===b.TR?YFe(t,e):Ys(t,e);break;case 3:r===b.COL?qFe(t,e):Ys(t,e);break;case 4:r===b.FORM?VFe(t,e):Ys(t,e);break;case 5:r===b.TABLE?WFe(t,e):r===b.STYLE?Fr(t,e):r===b.TBODY||r===b.TFOOT||r===b.THEAD?jFe(t,e):r===b.INPUT?KFe(t,e):Ys(t,e);break;case 6:r===b.SCRIPT?Fr(t,e):Ys(t,e);break;case 7:r===b.CAPTION?zFe(t,e):Ys(t,e);break;case 8:r===b.COLGROUP?HFe(t,e):r===b.TEMPLATE?Fr(t,e):Ys(t,e);break;default:Ys(t,e)}}function EP(t,e){let r=e.tagName;r===b.TABLE?t.openElements.hasInTableScope(b.TABLE)&&(t.openElements.popUntilTagNamePopped(b.TABLE),t._resetInsertionMode()):r===b.TEMPLATE?ju(t,e):r!==b.BODY&&r!==b.CAPTION&&r!==b.COL&&r!==b.COLGROUP&&r!==b.HTML&&r!==b.TBODY&&r!==b.TD&&r!==b.TFOOT&&r!==b.TH&&r!==b.THEAD&&r!==b.TR&&Ys(t,e)}function Ys(t,e){let r=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,t._processTokenInBodyMode(e),t.fosterParentingEnabled=r}function QFe(t,e){t.pendingCharacterTokens.push(e)}function XFe(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function pE(t,e){let r=0;if(t.hasNonWhitespacePendingCharacterToken)for(;r<t.pendingCharacterTokens.length;r++)Ys(t,t.pendingCharacterTokens[r]);else for(;r<t.pendingCharacterTokens.length;r++)t._insertCharacters(t.pendingCharacterTokens[r]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}function JFe(t,e){let r=e.tagName;r===b.CAPTION||r===b.COL||r===b.COLGROUP||r===b.TBODY||r===b.TD||r===b.TFOOT||r===b.TH||r===b.THEAD||r===b.TR?t.openElements.hasInTableScope(b.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=mn,t._processToken(e)):ns(t,e)}function ZFe(t,e){let r=e.tagName;r===b.CAPTION||r===b.TABLE?t.openElements.hasInTableScope(b.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=mn,r===b.TABLE&&t._processToken(e)):r!==b.BODY&&r!==b.COL&&r!==b.COLGROUP&&r!==b.HTML&&r!==b.TBODY&&r!==b.TD&&r!==b.TFOOT&&r!==b.TH&&r!==b.THEAD&&r!==b.TR&&gP(t,e)}function e2e(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.COL?(t._appendElement(e,Ee.HTML),e.ackSelfClosing=!0):r===b.TEMPLATE?Fr(t,e):dw(t,e)}function t2e(t,e){let r=e.tagName;r===b.COLGROUP?t.openElements.currentTagName===b.COLGROUP&&(t.openElements.pop(),t.insertionMode=mn):r===b.TEMPLATE?ju(t,e):r!==b.COL&&dw(t,e)}function dw(t,e){t.openElements.currentTagName===b.COLGROUP&&(t.openElements.pop(),t.insertionMode=mn,t._processToken(e))}function r2e(t,e){let r=e.tagName;r===b.TR?(t.openElements.clearBackToTableBodyContext(),t._insertElement(e,Ee.HTML),t.insertionMode=Na):r===b.TH||r===b.TD?(t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(b.TR),t.insertionMode=Na,t._processToken(e)):r===b.CAPTION||r===b.COL||r===b.COLGROUP||r===b.TBODY||r===b.TFOOT||r===b.THEAD?t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=mn,t._processToken(e)):_P(t,e)}function n2e(t,e){let r=e.tagName;r===b.TBODY||r===b.TFOOT||r===b.THEAD?t.openElements.hasInTableScope(r)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=mn):r===b.TABLE?t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=mn,t._processToken(e)):(r!==b.BODY&&r!==b.CAPTION&&r!==b.COL&&r!==b.COLGROUP||r!==b.HTML&&r!==b.TD&&r!==b.TH&&r!==b.TR)&&EP(t,e)}function s2e(t,e){let r=e.tagName;r===b.TH||r===b.TD?(t.openElements.clearBackToTableRowContext(),t._insertElement(e,Ee.HTML),t.insertionMode=gw,t.activeFormattingElements.insertMarker()):r===b.CAPTION||r===b.COL||r===b.COLGROUP||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR?t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=Ws,t._processToken(e)):_P(t,e)}function o2e(t,e){let r=e.tagName;r===b.TR?t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=Ws):r===b.TABLE?t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=Ws,t._processToken(e)):r===b.TBODY||r===b.TFOOT||r===b.THEAD?(t.openElements.hasInTableScope(r)||t.openElements.hasInTableScope(b.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=Ws,t._processToken(e)):(r!==b.BODY&&r!==b.CAPTION&&r!==b.COL&&r!==b.COLGROUP||r!==b.HTML&&r!==b.TD&&r!==b.TH)&&EP(t,e)}function i2e(t,e){let r=e.tagName;r===b.CAPTION||r===b.COL||r===b.COLGROUP||r===b.TBODY||r===b.TD||r===b.TFOOT||r===b.TH||r===b.THEAD||r===b.TR?(t.openElements.hasInTableScope(b.TD)||t.openElements.hasInTableScope(b.TH))&&(t._closeTableCell(),t._processToken(e)):ns(t,e)}function a2e(t,e){let r=e.tagName;r===b.TD||r===b.TH?t.openElements.hasInTableScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=Na):r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR?t.openElements.hasInTableScope(r)&&(t._closeTableCell(),t._processToken(e)):r!==b.BODY&&r!==b.CAPTION&&r!==b.COL&&r!==b.COLGROUP&&r!==b.HTML&&gP(t,e)}function Gee(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.OPTION?(t.openElements.currentTagName===b.OPTION&&t.openElements.pop(),t._insertElement(e,Ee.HTML)):r===b.OPTGROUP?(t.openElements.currentTagName===b.OPTION&&t.openElements.pop(),t.openElements.currentTagName===b.OPTGROUP&&t.openElements.pop(),t._insertElement(e,Ee.HTML)):r===b.INPUT||r===b.KEYGEN||r===b.TEXTAREA||r===b.SELECT?t.openElements.hasInSelectScope(b.SELECT)&&(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),r!==b.SELECT&&t._processToken(e)):(r===b.SCRIPT||r===b.TEMPLATE)&&Fr(t,e)}function zee(t,e){let r=e.tagName;if(r===b.OPTGROUP){let n=t.openElements.items[t.openElements.stackTop-1],s=n&&t.treeAdapter.getTagName(n);t.openElements.currentTagName===b.OPTION&&s===b.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagName===b.OPTGROUP&&t.openElements.pop()}else r===b.OPTION?t.openElements.currentTagName===b.OPTION&&t.openElements.pop():r===b.SELECT&&t.openElements.hasInSelectScope(b.SELECT)?(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode()):r===b.TEMPLATE&&ju(t,e)}function l2e(t,e){let r=e.tagName;r===b.CAPTION||r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR||r===b.TD||r===b.TH?(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),t._processToken(e)):Gee(t,e)}function c2e(t,e){let r=e.tagName;r===b.CAPTION||r===b.TABLE||r===b.TBODY||r===b.TFOOT||r===b.THEAD||r===b.TR||r===b.TD||r===b.TH?t.openElements.hasInTableScope(r)&&(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),t._processToken(e)):zee(t,e)}function u2e(t,e){let r=e.tagName;if(r===b.BASE||r===b.BASEFONT||r===b.BGSOUND||r===b.LINK||r===b.META||r===b.NOFRAMES||r===b.SCRIPT||r===b.STYLE||r===b.TEMPLATE||r===b.TITLE)Fr(t,e);else{let n=WLe[r]||Ai;t._popTmplInsertionMode(),t._pushTmplInsertionMode(n),t.insertionMode=n,t._processToken(e)}}function d2e(t,e){e.tagName===b.TEMPLATE&&ju(t,e)}function Hee(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(b.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t._popTmplInsertionMode(),t._resetInsertionMode(),t._processToken(e)):t.stopped=!0}function p2e(t,e){e.tagName===b.HTML?ns(t,e):pw(t,e)}function m2e(t,e){e.tagName===b.HTML?t.fragmentContext||(t.insertionMode=Uee):pw(t,e)}function pw(t,e){t.insertionMode=Ai,t._processToken(e)}function f2e(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.FRAMESET?t._insertElement(e,Ee.HTML):r===b.FRAME?(t._appendElement(e,Ee.HTML),e.ackSelfClosing=!0):r===b.NOFRAMES&&Fr(t,e)}function h2e(t,e){e.tagName===b.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagName!==b.FRAMESET&&(t.insertionMode=$ee))}function g2e(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.NOFRAMES&&Fr(t,e)}function _2e(t,e){e.tagName===b.HTML&&(t.insertionMode=Bee)}function E2e(t,e){e.tagName===b.HTML?ns(t,e):lw(t,e)}function lw(t,e){t.insertionMode=Ai,t._processToken(e)}function y2e(t,e){let r=e.tagName;r===b.HTML?ns(t,e):r===b.NOFRAMES&&Fr(t,e)}function S2e(t,e){e.chars=zLe.REPLACEMENT_CHARACTER,t._insertCharacters(e)}function b2e(t,e){t._insertCharacters(e),t.framesetOk=!1}function T2e(t,e){if(ki.causesExit(e)&&!t.fragmentContext){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Ee.HTML&&!t._isIntegrationPoint(t.openElements.current);)t.openElements.pop();t._processToken(e)}else{let r=t._getAdjustedCurrentElement(),n=t.treeAdapter.getNamespaceURI(r);n===Ee.MATHML?ki.adjustTokenMathMLAttrs(e):n===Ee.SVG&&(ki.adjustTokenSVGTagName(e),ki.adjustTokenSVGAttrs(e)),ki.adjustTokenXMLAttrs(e),e.selfClosing?t._appendElement(e,n):t._insertElement(e,n),e.ackSelfClosing=!0}}function w2e(t,e){for(let r=t.openElements.stackTop;r>0;r--){let n=t.openElements.items[r];if(t.treeAdapter.getNamespaceURI(n)===Ee.HTML){t._processToken(e);break}if(t.treeAdapter.getTagName(n).toLowerCase()===e.tagName){t.openElements.popUntilElementPopped(n);break}}}});var Kee=w((tht,Wee)=>{"use strict";var C2e=iP(),v2e=aP(),k2e=lP(),Yee=ac(),wt=Yee.TAG_NAMES,Ew=Yee.NAMESPACES,A2e={treeAdapter:C2e},I2e=/&/g,D2e=/\u00a0/g,R2e=/"/g,N2e=/</g,O2e=/>/g,yw=class t{constructor(e,r){this.options=v2e(A2e,r),this.treeAdapter=this.options.treeAdapter,this.html="",this.startNode=e}serialize(){return this._serializeChildNodes(this.startNode),this.html}_serializeChildNodes(e){let r=this.treeAdapter.getChildNodes(e);if(r)for(let n=0,s=r.length;n<s;n++){let o=r[n];this.treeAdapter.isElementNode(o)?this._serializeElement(o):this.treeAdapter.isTextNode(o)?this._serializeTextNode(o):this.treeAdapter.isCommentNode(o)?this._serializeCommentNode(o):this.treeAdapter.isDocumentTypeNode(o)&&this._serializeDocumentTypeNode(o)}}_serializeElement(e){let r=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);if(this.html+="<"+r,this._serializeAttributes(e),this.html+=">",r!==wt.AREA&&r!==wt.BASE&&r!==wt.BASEFONT&&r!==wt.BGSOUND&&r!==wt.BR&&r!==wt.COL&&r!==wt.EMBED&&r!==wt.FRAME&&r!==wt.HR&&r!==wt.IMG&&r!==wt.INPUT&&r!==wt.KEYGEN&&r!==wt.LINK&&r!==wt.META&&r!==wt.PARAM&&r!==wt.SOURCE&&r!==wt.TRACK&&r!==wt.WBR){let s=r===wt.TEMPLATE&&n===Ew.HTML?this.treeAdapter.getTemplateContent(e):e;this._serializeChildNodes(s),this.html+="</"+r+">"}}_serializeAttributes(e){let r=this.treeAdapter.getAttrList(e);for(let n=0,s=r.length;n<s;n++){let o=r[n],i=t.escapeString(o.value,!0);this.html+=" ",o.namespace?o.namespace===Ew.XML?this.html+="xml:"+o.name:o.namespace===Ew.XMLNS?(o.name!=="xmlns"&&(this.html+="xmlns:"),this.html+=o.name):o.namespace===Ew.XLINK?this.html+="xlink:"+o.name:this.html+=o.prefix+":"+o.name:this.html+=o.name,this.html+='="'+i+'"'}}_serializeTextNode(e){let r=this.treeAdapter.getTextNodeContent(e),n=this.treeAdapter.getParentNode(e),s;n&&this.treeAdapter.isElementNode(n)&&(s=this.treeAdapter.getTagName(n)),s===wt.STYLE||s===wt.SCRIPT||s===wt.XMP||s===wt.IFRAME||s===wt.NOEMBED||s===wt.NOFRAMES||s===wt.PLAINTEXT||s===wt.NOSCRIPT?this.html+=r:this.html+=t.escapeString(r,!1)}_serializeCommentNode(e){this.html+="<!--"+this.treeAdapter.getCommentNodeContent(e)+"-->"}_serializeDocumentTypeNode(e){let r=this.treeAdapter.getDocumentTypeNodeName(e);this.html+="<"+k2e.serializeContent(r,null,null)+">"}};yw.escapeString=function(t,e){return t=t.replace(I2e,"&amp;").replace(D2e,"&nbsp;"),e?t=t.replace(R2e,"&quot;"):t=t.replace(N2e,"&lt;").replace(O2e,"&gt;"),t};Wee.exports=yw});var Qee=w(Sw=>{"use strict";var Vee=jee(),x2e=Kee();Sw.parse=function(e,r){return new Vee(r).parse(e)};Sw.parseFragment=function(e,r,n){return typeof e=="string"&&(n=r,r=e,e=null),new Vee(n).parseFragment(r,e)};Sw.serialize=function(t,e){return new x2e(t,e).serialize()}});var SP=w(Km=>{"use strict";var yP=Km.NAMESPACES={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/"};Km.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"};Km.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};var ne=Km.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};Km.SPECIAL_ELEMENTS={[yP.HTML]:{[ne.ADDRESS]:!0,[ne.APPLET]:!0,[ne.AREA]:!0,[ne.ARTICLE]:!0,[ne.ASIDE]:!0,[ne.BASE]:!0,[ne.BASEFONT]:!0,[ne.BGSOUND]:!0,[ne.BLOCKQUOTE]:!0,[ne.BODY]:!0,[ne.BR]:!0,[ne.BUTTON]:!0,[ne.CAPTION]:!0,[ne.CENTER]:!0,[ne.COL]:!0,[ne.COLGROUP]:!0,[ne.DD]:!0,[ne.DETAILS]:!0,[ne.DIR]:!0,[ne.DIV]:!0,[ne.DL]:!0,[ne.DT]:!0,[ne.EMBED]:!0,[ne.FIELDSET]:!0,[ne.FIGCAPTION]:!0,[ne.FIGURE]:!0,[ne.FOOTER]:!0,[ne.FORM]:!0,[ne.FRAME]:!0,[ne.FRAMESET]:!0,[ne.H1]:!0,[ne.H2]:!0,[ne.H3]:!0,[ne.H4]:!0,[ne.H5]:!0,[ne.H6]:!0,[ne.HEAD]:!0,[ne.HEADER]:!0,[ne.HGROUP]:!0,[ne.HR]:!0,[ne.HTML]:!0,[ne.IFRAME]:!0,[ne.IMG]:!0,[ne.INPUT]:!0,[ne.LI]:!0,[ne.LINK]:!0,[ne.LISTING]:!0,[ne.MAIN]:!0,[ne.MARQUEE]:!0,[ne.MENU]:!0,[ne.META]:!0,[ne.NAV]:!0,[ne.NOEMBED]:!0,[ne.NOFRAMES]:!0,[ne.NOSCRIPT]:!0,[ne.OBJECT]:!0,[ne.OL]:!0,[ne.P]:!0,[ne.PARAM]:!0,[ne.PLAINTEXT]:!0,[ne.PRE]:!0,[ne.SCRIPT]:!0,[ne.SECTION]:!0,[ne.SELECT]:!0,[ne.SOURCE]:!0,[ne.STYLE]:!0,[ne.SUMMARY]:!0,[ne.TABLE]:!0,[ne.TBODY]:!0,[ne.TD]:!0,[ne.TEMPLATE]:!0,[ne.TEXTAREA]:!0,[ne.TFOOT]:!0,[ne.TH]:!0,[ne.THEAD]:!0,[ne.TITLE]:!0,[ne.TR]:!0,[ne.TRACK]:!0,[ne.UL]:!0,[ne.WBR]:!0,[ne.XMP]:!0},[yP.MATHML]:{[ne.MI]:!0,[ne.MO]:!0,[ne.MN]:!0,[ne.MS]:!0,[ne.MTEXT]:!0,[ne.ANNOTATION_XML]:!0},[yP.SVG]:{[ne.TITLE]:!0,[ne.FOREIGN_OBJECT]:!0,[ne.DESC]:!0}}});var rte=w(bw=>{"use strict";var{DOCUMENT_MODE:Vm}=SP(),Zee="html",M2e="about:legacy-compat",P2e="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ete=["+//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//"],L2e=ete.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),F2e=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],tte=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],$2e=tte.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function Xee(t){let e=t.indexOf('"')!==-1?"'":'"';return e+t+e}function Jee(t,e){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])===0)return!0;return!1}bw.isConforming=function(t){return t.name===Zee&&t.publicId===null&&(t.systemId===null||t.systemId===M2e)};bw.getDocumentMode=function(t){if(t.name!==Zee)return Vm.QUIRKS;let e=t.systemId;if(e&&e.toLowerCase()===P2e)return Vm.QUIRKS;let r=t.publicId;if(r!==null){if(r=r.toLowerCase(),F2e.indexOf(r)>-1)return Vm.QUIRKS;let n=e===null?L2e:ete;if(Jee(r,n))return Vm.QUIRKS;if(n=e===null?tte:$2e,Jee(r,n))return Vm.LIMITED_QUIRKS}return Vm.NO_QUIRKS};bw.serializeContent=function(t,e,r){let n="!DOCTYPE ";return t&&(n+=t),e?n+=" PUBLIC "+Xee(e):r&&(n+=" SYSTEM"),r!==null&&(n+=" "+Xee(r)),n}});var ite=w(tt=>{"use strict";var U2e=rte(),{DOCUMENT_MODE:B2e}=SP(),nte={element:1,text:3,cdata:4,comment:8},ste={tagName:"name",childNodes:"children",parentNode:"parent",previousSibling:"prev",nextSibling:"next",nodeValue:"data"},Oa=class{constructor(e){for(let r of Object.keys(e))this[r]=e[r]}get firstChild(){let e=this.children;return e&&e[0]||null}get lastChild(){let e=this.children;return e&&e[e.length-1]||null}get nodeType(){return nte[this.type]||nte.element}};Object.keys(ste).forEach(t=>{let e=ste[t];Object.defineProperty(Oa.prototype,t,{get:function(){return this[e]||null},set:function(r){return this[e]=r,r}})});tt.createDocument=function(){return new Oa({type:"root",name:"root",parent:null,prev:null,next:null,children:[],"x-mode":B2e.NO_QUIRKS})};tt.createDocumentFragment=function(){return new Oa({type:"root",name:"root",parent:null,prev:null,next:null,children:[]})};tt.createElement=function(t,e,r){let n=Object.create(null),s=Object.create(null),o=Object.create(null);for(let i=0;i<r.length;i++){let a=r[i].name;n[a]=r[i].value,s[a]=r[i].namespace,o[a]=r[i].prefix}return new Oa({type:t==="script"||t==="style"?t:"tag",name:t,namespace:e,attribs:n,"x-attribsNamespace":s,"x-attribsPrefix":o,children:[],parent:null,prev:null,next:null})};tt.createCommentNode=function(t){return new Oa({type:"comment",data:t,parent:null,prev:null,next:null})};var ote=function(t){return new Oa({type:"text",data:t,parent:null,prev:null,next:null})},bP=tt.appendChild=function(t,e){let r=t.children[t.children.length-1];r&&(r.next=e,e.prev=r),t.children.push(e),e.parent=t},G2e=tt.insertBefore=function(t,e,r){let n=t.children.indexOf(r),s=r.prev;s&&(s.next=e,e.prev=s),r.prev=e,e.next=r,t.children.splice(n,0,e),e.parent=t};tt.setTemplateContent=function(t,e){bP(t,e)};tt.getTemplateContent=function(t){return t.children[0]};tt.setDocumentType=function(t,e,r,n){let s=U2e.serializeContent(e,r,n),o=null;for(let i=0;i<t.children.length;i++)if(t.children[i].type==="directive"&&t.children[i].name==="!doctype"){o=t.children[i];break}o?(o.data=s,o["x-name"]=e,o["x-publicId"]=r,o["x-systemId"]=n):bP(t,new Oa({type:"directive",name:"!doctype",data:s,"x-name":e,"x-publicId":r,"x-systemId":n}))};tt.setDocumentMode=function(t,e){t["x-mode"]=e};tt.getDocumentMode=function(t){return t["x-mode"]};tt.detachNode=function(t){if(t.parent){let e=t.parent.children.indexOf(t),r=t.prev,n=t.next;t.prev=null,t.next=null,r&&(r.next=n),n&&(n.prev=r),t.parent.children.splice(e,1),t.parent=null}};tt.insertText=function(t,e){let r=t.children[t.children.length-1];r&&r.type==="text"?r.data+=e:bP(t,ote(e))};tt.insertTextBefore=function(t,e,r){let n=t.children[t.children.indexOf(r)-1];n&&n.type==="text"?n.data+=e:G2e(t,ote(e),r)};tt.adoptAttributes=function(t,e){for(let r=0;r<e.length;r++){let n=e[r].name;typeof t.attribs[n]>"u"&&(t.attribs[n]=e[r].value,t["x-attribsNamespace"][n]=e[r].namespace,t["x-attribsPrefix"][n]=e[r].prefix)}};tt.getFirstChild=function(t){return t.children[0]};tt.getChildNodes=function(t){return t.children};tt.getParentNode=function(t){return t.parent};tt.getAttrList=function(t){let e=[];for(let r in t.attribs)e.push({name:r,value:t.attribs[r],namespace:t["x-attribsNamespace"][r],prefix:t["x-attribsPrefix"][r]});return e};tt.getTagName=function(t){return t.name};tt.getNamespaceURI=function(t){return t.namespace};tt.getTextNodeContent=function(t){return t.data};tt.getCommentNodeContent=function(t){return t.data};tt.getDocumentTypeNodeName=function(t){return t["x-name"]};tt.getDocumentTypeNodePublicId=function(t){return t["x-publicId"]};tt.getDocumentTypeNodeSystemId=function(t){return t["x-systemId"]};tt.isTextNode=function(t){return t.type==="text"};tt.isCommentNode=function(t){return t.type==="comment"};tt.isDocumentTypeNode=function(t){return t.type==="directive"&&t.name==="!doctype"};tt.isElementNode=function(t){return!!t.attribs};tt.setNodeSourceCodeLocation=function(t,e){t.sourceCodeLocation=e};tt.getNodeSourceCodeLocation=function(t){return t.sourceCodeLocation};tt.updateNodeSourceCodeLocation=function(t,e){t.sourceCodeLocation=Object.assign(t.sourceCodeLocation,e)}});var lte=w((iht,ate)=>{"use strict";ate.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var TP=w((aht,ute)=>{var yE=lte(),cte={};for(let t of Object.keys(yE))cte[yE[t]]=t;var be={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};ute.exports=be;for(let t of Object.keys(be)){if(!("channels"in be[t]))throw new Error("missing channels property: "+t);if(!("labels"in be[t]))throw new Error("missing channel labels property: "+t);if(be[t].labels.length!==be[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=be[t];delete be[t].channels,delete be[t].labels,Object.defineProperty(be[t],"channels",{value:e}),Object.defineProperty(be[t],"labels",{value:r})}be.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,s=Math.min(e,r,n),o=Math.max(e,r,n),i=o-s,a,l;o===s?a=0:e===o?a=(r-n)/i:r===o?a=2+(n-e)/i:n===o&&(a=4+(e-r)/i),a=Math.min(a*60,360),a<0&&(a+=360);let c=(s+o)/2;return o===s?l=0:c<=.5?l=i/(o+s):l=i/(2-o-s),[a,l*100,c*100]};be.rgb.hsv=function(t){let e,r,n,s,o,i=t[0]/255,a=t[1]/255,l=t[2]/255,c=Math.max(i,a,l),u=c-Math.min(i,a,l),d=function(p){return(c-p)/6/u+1/2};return u===0?(s=0,o=0):(o=u/c,e=d(i),r=d(a),n=d(l),i===c?s=n-r:a===c?s=1/3+e-n:l===c&&(s=2/3+r-e),s<0?s+=1:s>1&&(s-=1)),[s*360,o*100,c*100]};be.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],s=be.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[s,o*100,n*100]};be.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,s=Math.min(1-e,1-r,1-n),o=(1-e-s)/(1-s)||0,i=(1-r-s)/(1-s)||0,a=(1-n-s)/(1-s)||0;return[o*100,i*100,a*100,s*100]};function z2e(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}be.rgb.keyword=function(t){let e=cte[t];if(e)return e;let r=1/0,n;for(let s of Object.keys(yE)){let o=yE[s],i=z2e(t,o);i<r&&(r=i,n=s)}return n};be.keyword.rgb=function(t){return yE[t]};be.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let s=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,i=e*.0193+r*.1192+n*.9505;return[s*100,o*100,i*100]};be.rgb.lab=function(t){let e=be.rgb.xyz(t),r=e[0],n=e[1],s=e[2];r/=95.047,n/=100,s/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let o=116*n-16,i=500*(r-n),a=200*(n-s);return[o,i,a]};be.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,s,o,i;if(r===0)return i=n*255,[i,i,i];n<.5?s=n*(1+r):s=n+r-n*r;let a=2*n-s,l=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?i=a+(s-a)*6*o:2*o<1?i=s:3*o<2?i=a+(s-a)*(2/3-o)*6:i=a,l[c]=i*255;return l};be.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,s=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,s*=o<=1?o:2-o;let i=(n+r)/2,a=n===0?2*s/(o+s):2*r/(n+r);return[e,a*100,i*100]};be.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,s=Math.floor(e)%6,o=e-Math.floor(e),i=255*n*(1-r),a=255*n*(1-r*o),l=255*n*(1-r*(1-o));switch(n*=255,s){case 0:return[n,l,i];case 1:return[a,n,i];case 2:return[i,n,l];case 3:return[i,a,n];case 4:return[l,i,n];case 5:return[n,i,a]}};be.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,s=Math.max(n,.01),o,i;i=(2-r)*n;let a=(2-r)*s;return o=r*s,o/=a<=1?a:2-a,o=o||0,i/=2,[e,o*100,i*100]};be.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,s=r+n,o;s>1&&(r/=s,n/=s);let i=Math.floor(6*e),a=1-n;o=6*e-i,i&1&&(o=1-o);let l=r+o*(a-r),c,u,d;switch(i){default:case 6:case 0:c=a,u=l,d=r;break;case 1:c=l,u=a,d=r;break;case 2:c=r,u=a,d=l;break;case 3:c=r,u=l,d=a;break;case 4:c=l,u=r,d=a;break;case 5:c=a,u=r,d=l;break}return[c*255,u*255,d*255]};be.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,s=t[3]/100,o=1-Math.min(1,e*(1-s)+s),i=1-Math.min(1,r*(1-s)+s),a=1-Math.min(1,n*(1-s)+s);return[o*255,i*255,a*255]};be.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,s,o,i;return s=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,i=e*.0557+r*-.204+n*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),[s*255,o*255,i*255]};be.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let s=116*r-16,o=500*(e-r),i=200*(r-n);return[s,o,i]};be.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],s,o,i;o=(e+16)/116,s=r/500+o,i=o-n/200;let a=o**3,l=s**3,c=i**3;return o=a>.008856?a:(o-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,s*=95.047,o*=100,i*=108.883,[s,o,i]};be.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],s;s=Math.atan2(n,r)*360/2/Math.PI,s<0&&(s+=360);let i=Math.sqrt(r*r+n*n);return[e,i,s]};be.lch.lab=function(t){let e=t[0],r=t[1],s=t[2]/360*2*Math.PI,o=r*Math.cos(s),i=r*Math.sin(s);return[e,o,i]};be.rgb.ansi16=function(t,e=null){let[r,n,s]=t,o=e===null?be.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let i=30+(Math.round(s/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(i+=60),i};be.hsv.ansi16=function(t){return be.rgb.ansi16(be.hsv.rgb(t),t[2])};be.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};be.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,s=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,s,o]};be.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,s=e%6/5*255;return[r,n,s]};be.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};be.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),s=n>>16&255,o=n>>8&255,i=n&255;return[s,o,i]};be.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,s=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),i=s-o,a,l;return i<1?a=o/(1-i):a=0,i<=0?l=0:s===e?l=(r-n)/i%6:s===r?l=2+(n-e)/i:l=4+(e-r)/i,l/=6,l%=1,[l*360,i*100,a*100]};be.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),s=0;return n<1&&(s=(r-.5*n)/(1-n)),[t[0],n*100,s*100]};be.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,s=0;return n<1&&(s=(r-n)/(1-n)),[t[0],n*100,s*100]};be.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let s=[0,0,0],o=e%1*6,i=o%1,a=1-i,l=0;switch(Math.floor(o)){case 0:s[0]=1,s[1]=i,s[2]=0;break;case 1:s[0]=a,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=i;break;case 3:s[0]=0,s[1]=a,s[2]=1;break;case 4:s[0]=i,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=a}return l=(1-r)*n,[(r*s[0]+l)*255,(r*s[1]+l)*255,(r*s[2]+l)*255]};be.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),s=0;return n>0&&(s=e/n),[t[0],s*100,n*100]};be.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,s=0;return n>0&&n<.5?s=e/(2*n):n>=.5&&n<1&&(s=e/(2*(1-n))),[t[0],s*100,n*100]};be.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};be.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,s=n-e,o=0;return s<1&&(o=(n-s)/(1-s)),[t[0],s*100,o*100]};be.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};be.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};be.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};be.gray.hsl=function(t){return[0,0,t[0]]};be.gray.hsv=be.gray.hsl;be.gray.hwb=function(t){return[0,100,t[0]]};be.gray.cmyk=function(t){return[0,0,0,t[0]]};be.gray.lab=function(t){return[t[0],0,0]};be.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};be.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var pte=w((lht,dte)=>{var Tw=TP();function H2e(){let t={},e=Object.keys(Tw);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function q2e(t){let e=H2e(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),s=Object.keys(Tw[n]);for(let o=s.length,i=0;i<o;i++){let a=s[i],l=e[a];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,r.unshift(a))}}return e}function j2e(t,e){return function(r){return e(t(r))}}function Y2e(t,e){let r=[e[t].parent,t],n=Tw[e[t].parent][t],s=e[t].parent;for(;e[s].parent;)r.unshift(e[s].parent),n=j2e(Tw[e[s].parent][s],n),s=e[s].parent;return n.conversion=r,n}dte.exports=function(t){let e=q2e(t),r={},n=Object.keys(e);for(let s=n.length,o=0;o<s;o++){let i=n[o];e[i].parent!==null&&(r[i]=Y2e(i,e))}return r}});var fte=w((cht,mte)=>{var wP=TP(),W2e=pte(),Qm={},K2e=Object.keys(wP);function V2e(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function Q2e(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let s=t(r);if(typeof s=="object")for(let o=s.length,i=0;i<o;i++)s[i]=Math.round(s[i]);return s};return"conversion"in t&&(e.conversion=t.conversion),e}K2e.forEach(t=>{Qm[t]={},Object.defineProperty(Qm[t],"channels",{value:wP[t].channels}),Object.defineProperty(Qm[t],"labels",{value:wP[t].labels});let e=W2e(t);Object.keys(e).forEach(n=>{let s=e[n];Qm[t][n]=Q2e(s),Qm[t][n].raw=V2e(s)})});mte.exports=Qm});var Ste=w((uht,yte)=>{"use strict";var hte=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,gte=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},_te=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},ww=t=>t,Ete=(t,e,r)=>[t,e,r],Xm=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},CP,Jm=(t,e,r,n)=>{CP===void 0&&(CP=fte());let s=n?10:0,o={};for(let[i,a]of Object.entries(CP)){let l=i==="ansi16"?"ansi":i;i===e?o[l]=t(r,s):typeof a=="object"&&(o[l]=t(a[e],s))}return o};function X2e(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[s,o]of Object.entries(n))e[s]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[s]=e[s],t.set(o[0],o[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Xm(e.color,"ansi",()=>Jm(hte,"ansi16",ww,!1)),Xm(e.color,"ansi256",()=>Jm(gte,"ansi256",ww,!1)),Xm(e.color,"ansi16m",()=>Jm(_te,"rgb",Ete,!1)),Xm(e.bgColor,"ansi",()=>Jm(hte,"ansi16",ww,!0)),Xm(e.bgColor,"ansi256",()=>Jm(gte,"ansi256",ww,!0)),Xm(e.bgColor,"ansi16m",()=>Jm(_te,"rgb",Ete,!0)),e}Object.defineProperty(yte,"exports",{enumerable:!0,get:X2e})});var vP=w((dht,bte)=>{"use strict";bte.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),s=e.indexOf("--");return n!==-1&&(s===-1||n<s)}});var IP=w((pht,wte)=>{"use strict";var J2e=fe("os"),Tte=fe("tty"),Ks=vP(),{env:$r}=process,dc;Ks("no-color")||Ks("no-colors")||Ks("color=false")||Ks("color=never")?dc=0:(Ks("color")||Ks("colors")||Ks("color=true")||Ks("color=always"))&&(dc=1);"FORCE_COLOR"in $r&&($r.FORCE_COLOR==="true"?dc=1:$r.FORCE_COLOR==="false"?dc=0:dc=$r.FORCE_COLOR.length===0?1:Math.min(parseInt($r.FORCE_COLOR,10),3));function kP(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function AP(t,e){if(dc===0)return 0;if(Ks("color=16m")||Ks("color=full")||Ks("color=truecolor"))return 3;if(Ks("color=256"))return 2;if(t&&!e&&dc===void 0)return 0;let r=dc||0;if($r.TERM==="dumb")return r;if(process.platform==="win32"){let n=J2e.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in $r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in $r)||$r.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in $r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($r.TEAMCITY_VERSION)?1:0;if($r.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $r){let n=parseInt(($r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($r.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($r.TERM)||"COLORTERM"in $r?1:r}function Z2e(t){let e=AP(t,t&&t.isTTY);return kP(e)}wte.exports={supportsColor:Z2e,stdout:kP(AP(!0,Tte.isatty(1))),stderr:kP(AP(!0,Tte.isatty(2)))}});var vte=w((mht,Cte)=>{"use strict";var e$e=(t,e,r)=>{let n=t.indexOf(e);if(n===-1)return t;let s=e.length,o=0,i="";do i+=t.substr(o,n-o)+e+r,o=n+s,n=t.indexOf(e,o);while(n!==-1);return i+=t.substr(o),i},t$e=(t,e,r,n)=>{let s=0,o="";do{let i=t[n-1]==="\r";o+=t.substr(s,(i?n-1:n)-s)+e+(i?`\r
1090
1090
  `:`
1091
1091
  `)+r,s=n+1,n=t.indexOf(`
1092
1092
  `,s)}while(n!==-1);return o+=t.substr(s),o};Cte.exports={stringReplaceAll:e$e,stringEncaseCRLFWithFirstIndex:t$e}});var Rte=w((fht,Dte)=>{"use strict";var r$e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,kte=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,n$e=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s$e=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o$e=new Map([["n",`
@@ -1124,14 +1124,14 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Pe=U,ue=J);let Ne={cod
1124
1124
 
1125
1125
  [Truncated: ${s.length} chars total]`:s,i=[...n.results,{...r,toolName:r.toolName??"",target:r.target??"",output:o,timestamp:Date.now()}];return i.length>n.maxResults&&i.shift(),{results:i,peekIndex:i.length-1}})},togglePeek:()=>{let r=e();r.results.length!==0&&t({peekOpen:!r.peekOpen})},closePeek:()=>t({peekOpen:!1}),navigatePeek:r=>{let n=e();if(n.results.length===0)return;let s=r==="prev"?-1:1,o=(n.peekIndex+s+n.results.length)%n.results.length;t({peekIndex:o})},clear:()=>t({results:[],peekOpen:!1,peekIndex:-1})})),$a=Qs.getState});import{jsxs as Ane,jsx as Ine}from"react/jsx-runtime";import{Box as h5e,Text as aL}from"ink";function Dne(){let t=Qs(u=>u.results),e=Qs(u=>u.peekOpen),r=Qs(u=>u.peekIndex);if(!e||t.length===0||r<0)return null;let n=t[r];if(!n)return null;let s=d0(n.output).split(`
1126
1126
  `),o=s.length,i=`${r+1}/${t.length}`,a=H_(n.toolName),l=H_(n.target),c;if(o>50){let u=s.slice(0,25),d=s.slice(-25),p=o-25-25;c=[...u,"",` ... ${p} lines hidden ...`,"",...d]}else c=s;return Ane(h5e,{flexDirection:"column",paddingLeft:2,children:[Ane(aL,{dimColor:!0,children:["-- ","[",i,"] ",a,"(",l,") -- (ctrl+o to close, up/down to navigate) --"]}),c.map((u,d)=>Ine(aL,{children:u},d)),Ine(aL,{dimColor:!0,children:"-".repeat(48)})]})}var Rne=k(()=>{"use strict";Ju();p0()});import{jsx as gn,jsxs as Yw}from"react/jsx-runtime";import{Box as Ww,Text as _n}from"ink";function Nne({commands:t,selectedIndex:e,isVisible:r,maxItems:n=8,menuWidth:s}){let o=process.stdout.columns||80,i=s??Math.min(100,Math.max(60,Math.floor(o*.5)));if(!r||t.length===0)return null;let a=t.length,l=0;e>=n&&(l=e-n+1);let c=Math.min(l+n,a),u=t.slice(l,c),d=a>n,p=i-2,h=t.filter(C=>C.type==="project").length,f=t.filter(C=>C.type==="skill").length,_=[`Commands (${a-f-h})`];f>0&&_.push(`Skills (${f})`),h>0&&_.push(`Project (${h})`);let E=` ${_.join(" + ")} `,y=Math.max(0,p-E.length-2),S="\u2191\u2193 navigate \u2022 Enter select \u2022 Esc cancel",T=Math.max(0,p-S.length-2);return Yw(Ww,{flexDirection:"column",children:[gn(_n,{color:De(),children:"\u250C\u2500"+E+"\u2500".repeat(y)+"\u2500\u2510"}),u.map((C,v)=>{let D=l+v===e,I=C.type==="project",x=C.type==="skill"?" [skill]":I?" [project]":"",B=I&&C.hint?` ${C.hint}`:"",$=`/${C.name}${B}`,L=p-$.length-x.length-3,q=C.description.length>L?C.description.slice(0,Math.max(0,L-1))+"\u2026":C.description,z=` ${$}${x} ${q}`,Q=z.length,K=Math.max(0,p-Q);return D?Yw(Ww,{children:[gn(_n,{color:De(),children:"\u2502"}),gn(_n,{backgroundColor:De(),color:"black",children:z+" ".repeat(K)}),gn(_n,{color:De(),children:"\u2502"})]},C.name):Yw(Ww,{children:[gn(_n,{color:De(),children:"\u2502"}),gn(_n,{children:" "}),gn(_n,{color:De(),children:$}),x&&gn(_n,{dimColor:!0,children:x}),gn(_n,{dimColor:!0,children:" "+q}),gn(_n,{children:" ".repeat(K)}),gn(_n,{color:De(),children:"\u2502"})]},C.name)}),d&&(()=>{let C=l>0?"\u25B2":" ",v=c<a?"\u25BC":" ",A=` ${C} ${e+1}/${a} ${v}`,D=Math.max(0,p-A.length);return Yw(Ww,{children:[gn(_n,{color:De(),children:"\u2502"}),gn(_n,{dimColor:!0,children:A}),gn(_n,{children:" ".repeat(D)}),gn(_n,{color:De(),children:"\u2502"})]})})(),gn(_n,{color:De(),children:"\u2514\u2500"+S+"\u2500".repeat(T)+"\u2500\u2518"})]})}var One=k(()=>{"use strict";mt()});import{jsxs as NE,jsx as g5e}from"react/jsx-runtime";import{useEffect as xne,useRef as Mne,useState as Pne}from"react";import{Box as _5e,Text as Kw}from"ink";function E5e(t){let e=Math.max(0,Math.floor(t/1e3)),r=Math.floor(e/60),n=e%60;return r>0?`${r}m ${n}s`:`${n}s`}var lL,y5e,Lne,Fne=k(()=>{"use strict";Di();lL=10;y5e=({toast:t})=>{let e=Ur(l=>l.clearToast),r=Mne(null),n=Mne(null),[s,o]=Pne(lL),[i,a]=Pne("");return xne(()=>{if(!t.expiresAt){a("");return}let l=()=>{let u=t.expiresAt-Date.now();u<=0?a("\u2014 resumes now"):a(`\u2014 resumes in ${E5e(u)}`)};l();let c=setInterval(l,1e3);return()=>clearInterval(c)},[t.expiresAt]),xne(()=>(r.current&&(clearTimeout(r.current),r.current=null),n.current&&(clearInterval(n.current),n.current=null),t.persistent||(o(lL),n.current=setInterval(()=>{o(l=>Math.max(0,l-1))},1e3),r.current=setTimeout(()=>{e(t.id),r.current=null,n.current&&(clearInterval(n.current),n.current=null)},lL*1e3)),()=>{r.current&&(clearTimeout(r.current),r.current=null),n.current&&(clearInterval(n.current),n.current=null)}),[t.id,t.persistent,e]),NE(Kw,{children:[t.text,t.expiresAt&&i?NE(Kw,{dimColor:!0,children:[" ",i]}):"",!t.persistent&&!t.expiresAt&&s>0?NE(Kw,{dimColor:!0,children:[" \xB7 ",s,"s"]}):""]})},Lne=()=>{let t=Ur(o=>o.toasts),e=Ur(o=>o.visibleToasts),r=Ur(o=>o.overflowCount);if(t.length===0)return null;let n=e(),s=r();return NE(_5e,{flexDirection:"column",children:[n.map(o=>g5e(y5e,{toast:o},o.id)),s>0&&NE(Kw,{dimColor:!0,children:[" +",s," more"]})]})}});import{create as S5e}from"zustand";var cf,Yr,uf=k(()=>{"use strict";cf=null,Yr=S5e((t,e)=>({active:!1,startedAt:null,bgAgentCount:0,elapsedSec:0,lastRelease:null,begin:r=>{t({active:!0,startedAt:Date.now(),bgAgentCount:r,elapsedSec:0,lastRelease:null}),cf!==null&&clearInterval(cf),cf=setInterval(()=>{let n=e();!n.active||n.startedAt===null||t({elapsedSec:Math.floor((Date.now()-n.startedAt)/1e3)})},1e3)},release:r=>{cf!==null&&(clearInterval(cf),cf=null),t({active:!1,startedAt:null,bgAgentCount:0,elapsedSec:0,lastRelease:r})},setCount:r=>t({bgAgentCount:r})}))});import{create as b5e}from"zustand";function T5e(t){switch(t){case"done":return $ne;case"failed":return Une;case"cancelled":return Bne}}var OE,$ne,Une,Bne,df,mc,cL,pf=k(()=>{"use strict";OE=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],$ne=1e4,Une=15e3,Bne=1e4,df=5;mc=b5e((t,e)=>({rows:[],spinnerFrame:0,timerRef:null,sessionSubagentTokens:0,sessionSubagentCost:0,addRow:r=>{t(n=>({rows:[...n.rows,{...r,elapsedSeconds:0,dismissAt:void 0,resultSummary:void 0}]})),e().startTimer()},incrementToolUses:r=>{t(n=>({rows:n.rows.map(s=>s.agentId===r?{...s,toolUses:s.toolUses+1}:s)}))},updateTokens:(r,n)=>{t(s=>({rows:s.rows.map(o=>o.agentId===r?{...o,tokens:n}:o)}))},addCost:(r,n)=>{t(s=>({rows:s.rows.map(o=>o.agentId!==r?o:{...o,cost:(o.cost??0)+n,hasPricing:!0})}))},completeRow:(r,n,s)=>{let o=Date.now();t(i=>({rows:i.rows.map(a=>a.agentId!==r?a:{...a,status:n,resultSummary:s,completedAt:o,dismissAt:o+T5e(n),elapsedSeconds:Math.floor((o-a.startedAt)/1e3)})}))},markAutoBackgrounded:r=>{t(n=>({rows:n.rows.map(s=>s.agentId===r?{...s,status:"auto-backgrounded",background:!0}:s)}))},tick:()=>{let r=Date.now();t(o=>{let i=o.rows.map(d=>d.status==="auto-backgrounded"?{...d,status:"running",background:!0}:d);i=i.map(d=>d.status==="running"?{...d,elapsedSeconds:Math.floor((r-d.startedAt)/1e3)}:d);let a=i.filter(d=>d.dismissAt!=null&&d.dismissAt<=r);i=i.filter(d=>!d.dismissAt||d.dismissAt>r);let l=0,c=0;for(let d of a)l+=d.tokens,d.cost!==null&&(c+=d.cost);let u=(o.spinnerFrame+1)%OE.length;return{rows:i,spinnerFrame:u,sessionSubagentTokens:o.sessionSubagentTokens+l,sessionSubagentCost:o.sessionSubagentCost+c}});let{rows:n,stopTimer:s}=e();n.length===0&&s()},getVisibleRowCount:()=>{let{rows:r}=e(),n=r.length;return n<=df?n:df+1},getSubagentTotals:()=>{let{rows:r,sessionSubagentTokens:n,sessionSubagentCost:s}=e(),o=n,i=s;for(let a of r)o+=a.tokens,a.cost!==null&&(i+=a.cost);return{tokens:o,cost:i}},startTimer:()=>{let{timerRef:r,tick:n}=e();if(r)return;let s=setInterval(n,1e3);t({timerRef:s})},stopTimer:()=>{let{timerRef:r}=e();r&&(clearInterval(r),t({timerRef:null}))},clear:()=>{let{timerRef:r}=e();r&&clearInterval(r),t({rows:[],spinnerFrame:0,timerRef:null,sessionSubagentTokens:0,sessionSubagentCost:0})}})),cL=mc.getState});function Vw(t){if(t<60)return`${t}s`;let e=Math.floor(t/60),r=t%60;return`${e}m ${r}s`}function Gne(t){return t<1e3?`${t} tokens`:`${(t/1e3).toFixed(1)}K tokens`}function zne(t){return t===0?"$0.00":t<.001?`$${t.toFixed(4)}`:t<.01?`$${t.toFixed(3)}`:`$${t.toFixed(2)}`}function Hne(t,e){return t.length<=e?t:t.slice(0,e-1)+"\u2026"}function qne(t,e){switch(t){case"running":return OE[e%OE.length];case"done":return"\u2713";case"failed":return"\u2717";case"cancelled":return"\u25FC";case"auto-backgrounded":return"\u27F3"}}function jne(t){switch(t){case"running":return"green";case"done":return"green";case"failed":return"red";case"cancelled":return"gray";case"auto-backgrounded":return"yellow"}}var uL=k(()=>{"use strict";pf()});import{jsx as Yne,jsxs as w5e}from"react/jsx-runtime";import{Box as C5e,Text as Wne}from"ink";function Kne(){let t=Yr(s=>s.active),e=Yr(s=>s.elapsedSec),r=Yr(s=>s.bgAgentCount);return t?w5e(C5e,{flexDirection:"column",children:[Yne(Wne,{dimColor:!0,children:`\u23F3 Waiting for ${r} ${r===1?"background job":"background jobs"}\u2026 \xB7 ${Vw(e)} elapsed`}),Yne(Wne,{dimColor:!0,children:" Press Esc to release \xB7 type to interject"})]}):null}var Vne=k(()=>{"use strict";uf();uL()});import{jsx as Qw,jsxs as xE}from"react/jsx-runtime";import{Box as v5e,Text as Zu}from"ink";function k5e({row:t,spinnerFrame:e}){let r=qne(t.status,e),n=jne(t.status),s=t.resultSummary??Hne(t.prompt,40),i=[Vw(t.elapsedSeconds)];return t.toolUses>0&&i.push(`${t.toolUses} tool${t.toolUses===1?"":"s"}`),t.tokens>0&&(i.push(Gne(t.tokens)),t.hasPricing&&t.cost!==null&&t.cost>0&&i.push(zne(t.cost))),xE(Zu,{children:[Qw(Zu,{color:n,children:r}),xE(Zu,{children:[" ",t.agentName,": "]}),Qw(Zu,{dimColor:!0,children:s}),xE(Zu,{children:[" \u2014 ",i.join(" \xB7 ")]})]})}function Qne(){let t=mc(s=>s.rows),e=mc(s=>s.spinnerFrame);if(process.env.AII_DEBUG_NO_TOAST==="1"||t.length===0)return null;let r=t.slice(0,df),n=Math.max(0,t.length-df);return xE(v5e,{flexDirection:"column",children:[Qw(Zu,{children:" "}),r.map(s=>Qw(k5e,{row:s,spinnerFrame:e},s.agentId)),n>0&&xE(Zu,{dimColor:!0,children:[" +",n," more (use /tasks to see all)"]})]})}var Xne=k(()=>{"use strict";pf();uL()});var Zne={};ie(Zne,{getUserEchoSink:()=>dL,setUserEchoSink:()=>A5e});function A5e(t){Jne=t}function dL(){return Jne}var Jne,pL=k(()=>{"use strict";Jne=null});import{create as I5e}from"zustand";var ese,ME,mL=k(()=>{"use strict";Di();pL();ese=I5e((t,e)=>({pendingNote:null,noteToastId:null,setPendingNote:r=>t({pendingNote:r}),setNoteToastId:r=>t({noteToastId:r}),getPendingNote:()=>e().pendingNote,onNoteInjected:()=>{let r=e().pendingNote,n=e().noteToastId;if(n!==null&&qe().clearToast(n),t({pendingNote:null,noteToastId:null}),r){let s=dL();if(s)try{s(r)}catch{}}},reset:()=>t({pendingNote:null,noteToastId:null})})),ME=ese.getState});var Xw=k(()=>{"use strict";tc();xw();Vu();Pw();pc();Di();mL();pf();Dm();Ju();uf()});import{jsxs as mf,jsx as Ht}from"react/jsx-runtime";import D5e,{useRef as R5e,useState as N5e,useEffect as O5e}from"react";import{Box as Jw,Static as x5e,Text as ed}from"ink";function M5e(){let t=hn(e=>e.runningBackgroundCount);if(t===0)return null;try{let e=Re.getInstance();if(!e.isInitialized())return null;let r=e.getActiveAgents().filter(s=>s.background);if(r.length===0)return null;let n=r.map(s=>{let o=Math.round((Date.now()-s.startedAt.getTime())/1e3),i=o<60?`${o}s`:`${Math.floor(o/60)}m${o%60}s`;return`${s.agentName} (${i})`});return mf(ed,{dimColor:!0,children:[" ","\u27F3 ",n.join(" \xB7 ")]})}catch{return mf(ed,{dimColor:!0,children:[" ","\u27F3 ",t," background agent",t!==1?"s":""," running"]})}}function P5e(){let t=Qu(n=>n.isVisible),e=Qu(n=>n.selectedIndex),r=Qu(n=>n.filteredCommands);return t?Ht(Nne,{commands:r,selectedIndex:e,isVisible:t}):null}var tse,rse=k(()=>{"use strict";Jre();tne();rne();ine();une();wne();Rne();One();Fne();Vne();Xne();Xw();Vu();pf();Di();pc();Ju();ss();uf();ya();tse=D5e.memo(function({permanentContent:e,streamingContent:r,isStreaming:n,isThinking:s,thinkingStatus:o,thinkingElapsedSeconds:i,thinkingTokensGenerated:a,currentIteration:l,iterationStartTime:c,inputLines:u,inputCursorLine:d,inputCursorCol:p,inputFocused:h=!0,resourceCounts:f,statusBar:g,width:_}){let E=_??(process.stdout.columns||80),y=process.stdout.rows||24,S=hn(Xu),T=n||s||S,C=f&&(f.soulName||f.personaName||f.modelName||f.tools>0||f.mcpServers>0||f.contextFiles>0||f.skills>0),v=hn(ee=>ee.nodes.length),A=v>0?1+v*2:0,D=hn(ee=>ee.runningBackgroundCount),x=process.env.AII_DEBUG_NO_TOAST==="1"&&v===0&&D>0,B=x?1:0,$=mc(ee=>ee.getVisibleRowCount()),L=$>0?$+1:0,q=Yr(ee=>ee.active),z=mc(ee=>ee.getSubagentTotals()),Q=Ku(ee=>ee.typeAheadQueue.length),K=Ur(ee=>ee.toasts.length),me=Ur(ee=>ee.overflowCount()),Z=Math.min(K,CE)+(me>0?1:0),ce=A+B+(n||s?2:0)+(Z>0?Z+(T?1:0):0)+L+(q?2:0)+(C?2:0)+(2+u.length)+1+2,te=Math.max(3,y-ce-1),Ae=hn(ee=>ee.expanded),U=hn(ee=>ee.nodes.some(Oe=>Oe.streamingContent)||ee.transcripts.size>0),J=Ae&&U,j=Qs(ee=>ee.peekOpen),V=s||n,[ue,Pe]=N5e(V),Ne=R5e(null);return O5e(()=>(V?(Ne.current&&(clearTimeout(Ne.current),Ne.current=null),Pe(!0)):Ne.current=setTimeout(()=>{Pe(!1),Ne.current=null},500),()=>{Ne.current&&clearTimeout(Ne.current)}),[V]),J?mf(Jw,{flexDirection:"column",width:E,children:[Ht(iL,{}),Ht(Tne,{width:E}),mf(Jw,{flexDirection:"column",children:[C&&Ht(ed,{children:" "}),C&&f&&Ht(JP,{...f}),Ht(KP,{lines:u,cursorLine:d,cursorCol:p,isFocused:h,width:E}),Ht(XP,{...g,width:E})]})]}):mf(Jw,{flexDirection:"column",width:E,children:[e.length>0&&Ht(x5e,{items:e,children:(ee,Oe)=>Ht(ed,{children:ee},Oe)}),r&&Ht(cne,{content:r,isStreaming:n,width:E,maxVisibleLines:te}),Ht(iL,{}),j&&!PE()&&Ht(Dne,{}),x&&Ht(M5e,{}),ue&&Ht(ed,{children:" "}),Ht(one,{status:o,isActive:ue,elapsedSeconds:i,tokensGenerated:a,showInterruptHint:!0,goalTurnActive:g.goalTurnActive===!0,resetKey:l}),K>0&&T&&Ht(ed,{children:" "}),Ht(Lne,{}),Ht(Kne,{}),Ht(Qne,{}),mf(Jw,{flexDirection:"column",children:[C&&Ht(ed,{children:" "}),C&&f&&Ht(JP,{soulName:f.soulName,personaName:f.personaName,modelName:f.modelName,connectionMode:f.connectionMode,tools:f.tools,mcpServers:f.mcpServers,mcpFailedCount:f.mcpFailedCount,contextFiles:f.contextFiles,skills:f.skills}),Ht(KP,{lines:u,cursorLine:d,cursorCol:p,isFocused:h,queuedCount:Q,loopPaused:g.loopStats?.paused,width:E}),Ht(XP,{projectPath:g.projectPath,branch:g.branch,worktreeName:g.worktreeName,baseBranch:g.baseBranch,mode:g.mode,contextPercent:g.contextPercent,contextLevel:g.contextLevel,contextTokens:g.contextTokens,contextLimit:g.contextLimit,sessionCost:g.sessionCost,freeBudgetRemaining:g.freeBudgetRemaining,goalSegment:g.goalSegment,sessionTokensIn:g.sessionTokensIn,sessionCachedTokens:g.sessionCachedTokens,subagentTokens:z.tokens,subagentCost:z.cost,memoryMB:g.memoryMB,sessionDuration:g.sessionDuration,agentExecTime:g.agentExecTime,loopStats:g.loopStats,width:E}),Ht(P5e,{})]})]})})});import{jsx as fc,jsxs as Zw}from"react/jsx-runtime";import{Box as ase,Text as Ua}from"ink";function $5e(t){let e=t.match(/^(\s*\d+\s*)([+-])(.*)$/);if(e){let[,n,s,o]=e;return{text:s+o,color:s==="+"?nse:sse,backgroundColor:s==="+"?ose:ise,lineNumber:n}}let r=t.match(/^(\s*\d+)(\s{3})(.*)$/);if(r){let[,n,s,o]=r;return{text:" "+s+o,color:fL,lineNumber:n,isContext:!0}}return t.startsWith("+")?{text:t,color:nse,backgroundColor:ose}:t.startsWith("-")?{text:t,color:sse,backgroundColor:ise}:t.startsWith("@@")?{text:t,color:L5e}:t.startsWith("$")?{text:t,color:fL}:{text:t,color:fL,isContext:!0}}function U5e({line:t,width:e}){let r=$5e(t),n=r.lineNumber?r.lineNumber.length:0,s=Math.max(0,e-n),o=r.text;o.length>s&&(o=o.slice(0,s-3)+"...");let i=r.backgroundColor?o+" ".repeat(Math.max(0,s-o.length)):o;return r.lineNumber?Zw(ase,{children:[fc(Ua,{color:F5e,children:r.lineNumber}),r.backgroundColor?fc(Ua,{backgroundColor:r.backgroundColor,color:r.color,children:i}):fc(Ua,{color:r.color,children:i})]}):r.backgroundColor?fc(Ua,{backgroundColor:r.backgroundColor,color:r.color,children:i}):fc(Ua,{color:r.color,children:o})}function hL({lines:t,scrollOffset:e=0,maxVisibleLines:r=15,isScrollMode:n=!1,width:s}){let o=s??(process.stdout.columns||80),i=o-4,a=e,l=Math.min(a+r,t.length),c=t.slice(a,l),u=e,d=t.length-l,p=t.length>r;return Zw(ase,{flexDirection:"column",width:o,children:[p&&(u>0?Zw(Ua,{color:"yellow",children:["\u2191 ",u," more lines above"]}):fc(Ua,{children:" "})),c.map((h,f)=>fc(U5e,{line:h,width:i},a+f)),p&&(d>0?Zw(Ua,{color:"yellow",children:["\u2193 +",d," more lines below"]}):fc(Ua,{children:" "}))]})}var nse,sse,ose,ise,L5e,fL,F5e,lse=k(()=>{"use strict";nse="#A6E22E",sse="#F92672",ose="#243524",ise="#3b2028",L5e="#66D9EF",fL="#F8F8F2",F5e="#75715E"});import{jsxs as gL,jsx as cse}from"react/jsx-runtime";import{Box as dse,Text as use}from"ink";function B5e({option:t,isSelected:e,isActive:r}){let n=e&&r?">":" ",s=e&&r?"cyan":"white";return gL(dse,{children:[gL(use,{color:e&&r?"cyan":void 0,children:[n," "]}),gL(use,{color:s,children:[t.key,". ",t.label]})]})}function mse({options:t,selectedIndex:e,isActive:r=!0}){return cse(dse,{flexDirection:"column",children:t.map((n,s)=>cse(B5e,{option:n,isSelected:s===e,isActive:r},n.key))})}var pse,fse=k(()=>{"use strict";pse=[{key:"1",label:"Yes",value:"yes"},{key:"2",label:"Yes, and don't ask again for this session",value:"session"},{key:"3",label:"No",value:"no"},{key:"4",label:"Provide feedback",value:"feedback"}]});import{jsxs as Xs,Fragment as _L,jsx as ar}from"react/jsx-runtime";import{Box as Ni,Text as Wr}from"ink";function hse({toolName:t,description:e,details:r,showDiff:n=!1,options:s=pse,selectedIndex:o,isScrollMode:i=!1,scrollOffset:a=0,maxVisibleDiffLines:l=15,width:c,isResolved:u=!1,result:d,isFeedbackMode:p=!1,feedbackText:h=""}){let f=c??(process.stdout.columns||80),g=r&&r.length>0;if(u&&d){let _=d==="yes"||d==="session"||d==="always",E=_?"\u2713":"\u2717",y=_?"green":"red",S=t==="Edit"||t==="Write";return Xs(Ni,{flexDirection:"column",children:[Xs(Ni,{children:[Xs(Wr,{color:y,children:[E," "]}),S?ar(_L,{children:Xs(Wr,{bold:!0,children:[t," file"]})}):ar(Wr,{bold:!0,color:De(),children:t}),Xs(Wr,{dimColor:!0,children:[": ",e]})]}),g&&n&&Xs(Ni,{flexDirection:"column",marginTop:1,marginLeft:2,children:[ar(hL,{lines:r.slice(0,10),maxVisibleLines:10,width:f-4}),r.length>10&&Xs(Wr,{dimColor:!0,children:[" ... +",r.length-10," more lines"]})]})]})}return Xs(Ni,{flexDirection:"column",children:[ar(Wr,{dimColor:!0,children:"\u2500".repeat(Math.min(f,60))}),ar(Ni,{marginTop:1,children:t==="Edit"||t==="Write"?Xs(Wr,{bold:!0,children:[t," file"]}):Xs(_L,{children:[ar(Wr,{bold:!0,color:De(),children:"Aii"}),ar(Wr,{children:" wants to execute "}),ar(Wr,{bold:!0,children:t})]})}),ar(Ni,{marginLeft:2,children:ar(Wr,{dimColor:!0,children:e})}),g&&ar(Ni,{flexDirection:"column",marginTop:1,marginLeft:2,children:ar(hL,{lines:r,scrollOffset:a,maxVisibleLines:l,isScrollMode:i,width:f-4})}),ar(Wr,{children:" "}),p?Xs(_L,{children:[Xs(Ni,{children:[ar(Wr,{color:De(),children:"> "}),ar(Wr,{children:h}),ar(Wr,{color:De(),children:"\u2588"})]}),ar(Ni,{marginTop:1,children:ar(Wr,{dimColor:!0,children:"Type your feedback, then press Enter to submit \u2022 Esc to cancel"})})]}):ar(mse,{options:s,selectedIndex:o,isActive:!i}),ar(Ni,{marginTop:1,children:ar(Wr,{dimColor:!0,children:"\u2500".repeat(Math.min(f,60))})})]})}var gse=k(()=>{"use strict";lse();fse();mt()});import{jsx as Oi,jsxs as hc}from"react/jsx-runtime";import{Box as td,Text as Go}from"ink";function _se({question:t,description:e,options:r,selectedIndex:n,otherMode:s,otherText:o,width:i}){let a=De(),l=i??(process.stdout.columns||80);return hc(td,{flexDirection:"column",borderStyle:"round",borderColor:a,paddingX:1,width:l,children:[Oi(Go,{bold:!0,color:a,children:t}),e?Oi(Go,{dimColor:!0,children:e}):null,Oi(td,{height:1}),s?hc(td,{flexDirection:"column",children:[Oi(Go,{children:"Other:"}),hc(Go,{children:[Oi(Go,{color:a,children:"\u2503 "}),Oi(Go,{children:o}),Oi(Go,{color:a,children:"_"})]}),Oi(td,{height:1}),Oi(Go,{dimColor:!0,children:"[Enter submit \xB7 Esc back to options]"})]}):hc(td,{flexDirection:"column",children:[r.map((c,u)=>hc(td,{flexDirection:"column",children:[hc(Go,{color:u===n?a:void 0,children:[u===n?"\u25CF ":"\u25CB ",u+1,". ",c.label]}),c.description?hc(Go,{dimColor:!0,children:[" ",c.description]}):null]},u)),Oi(td,{height:1}),hc(Go,{dimColor:!0,children:["[\u2191\u2193 navigate \xB7 1-",r.length," jump \xB7 Enter submit \xB7 Esc cancel]"]})]})]})}var Ese=k(()=>{"use strict";mt()});function eC(){yse=Date.now()}function Sse(){return yse}var yse,tC=k(()=>{"use strict";yse=Date.now()});function bse(t){if(t==="\r")return!0;if(t.length===1){let e=t.charCodeAt(0);return e>=32&&e<=126}return!1}var Tse=k(()=>{"use strict"});function LE(t){for(let e of G5e)if(t===e||t.startsWith(e+" "))return{prefix:e,noteText:t.slice(e.length).trim()};return null}var G5e,EL=k(()=>{"use strict";G5e=["/note","/inject","/now"]});function wse(t){let{permanentContent:e,frozenCount:r,showWelcome:n,headerKey:s,staticEpoch:o}=t,i=r!==null?e.slice(0,r):e;return[...n&&o===0?[{id:`__header__:welcome:${s}`,type:"welcome",line:""},{id:`__header__:spacer:${s}`,type:"spacer",line:""}]:[],...i.map(a=>({id:a.id,type:"content",line:a.line}))]}var Cse=k(()=>{"use strict"});import{useEffect as vse}from"react";function kse(){let t=Qs(s=>s.peekOpen),e=Qs(s=>s.peekIndex),r=Qs(s=>s.results),n=es(s=>s.renderEpoch);return vse(()=>{if(!PE())return;let s=t&&e>=0?r[e]:void 0;t&&s?yL(gH(s,e,r.length,process.stdout.rows||24,process.stdout.columns||80)):rC()},[t,e,r,n]),vse(()=>()=>rC(),[]),null}var Ase=k(()=>{"use strict";Ju();Xw();ss();p0()});function z5e(){return process.stdin.listenerCount("data")}function rd(t){if(!process.env.AII_DEBUG&&!process.env.AII_LOOP_DEBUG)return;let e=z5e();e>1&&console.error(`[input] WARNING: ${e} stdin 'data' listeners live (${t}) \u2014 MF-1 double-listener class`)}var SL=k(()=>{"use strict"});var Ose={};ie(Ose,{App:()=>Nse,default:()=>J5e});import{jsx as Kr,jsxs as bL,Fragment as H5e}from"react/jsx-runtime";import q5e,{useEffect as sd,useCallback as ff,useState as Ba,useRef as En,useMemo as Ise}from"react";import{Box as hf,Text as TL,Static as j5e}from"ink";import{useShallow as nd}from"zustand/react/shallow";function Y5e({onInterrupt:t}){let e=En(t);return e.current=t,sd(()=>{if(!process.stdin.isTTY)return;process.stdin.resume();let r=n=>{eC();let s=n.toString();if(Yr.getState().active){if(s==="\x1B"){Yr.getState().release("esc");return}s===""?Yr.getState().release("ctrl_c"):bse(s)&&Yr.getState().release("typed")}let i=Mw(),a=()=>{let d=sf().getText();d.startsWith("/")&&!d.includes(`
1127
- `)&&!d.includes(" ")?(i.isVisible||i.show(),i.setFilter(d)):i.isVisible&&i.hide()},l=()=>{let d=i.getSelected();if(!d)return!1;let p=sf();p.clear();for(let h of`/${d.name} `)p.insertChar(h);return i.hide(),!0};if(s==="\x1B"){if(i.isVisible){i.hide();return}e.current();return}if(s===""){Cl(0);return}if(s===""){let d=$a();if(d.peekOpen){d.closePeek();return}let p=Bo();p.nodes.length>0||p.transcripts.size>0?p.toggleExpanded():d.togglePeek();return}let c=$a();if(c.peekOpen){if(s==="\x1B[A"){c.navigatePeek("prev");return}if(s==="\x1B[B"){c.navigatePeek("next");return}}let u=sf();if(s===" "){i.isVisible&&l();return}if(s==="\r"){if(i.isVisible){l();return}let d=u.getText().trim();if(!d)return;let p=nt().loopMode,h=LE(d);if(h){let f=h.noteText;if(!f){qe().showToast(F.dim(`\u25C6 ${h.prefix} requires a message (usage: ${h.prefix} <text>)`)),u.clear();return}if(!p){let S=ME();S.noteToastId!==null&&qe().clearToast(S.noteToastId),S.setPendingNote(f);let T=process.stdout.columns||80,C=Math.floor(T*.618)-16,v=f.replace(/\n/g," "),A=v.length>C?v.slice(0,C)+"\u2026":v,D=qe(),I=D.nextId;D.showToast(F.success(`\u25C6 Injecting: "${A}"`),!0),S.setNoteToastId(I),u.clear();return}let g=process.stdout.columns||80,_=Math.floor(g*.618)-16,E=f.replace(/\n/g," "),y=E.length>_?E.slice(0,_)+"\u2026":E;qe().showToast(F.success(`\u25C6 Injecting: "${y}"`),!0),u.enqueueTypeAhead({silent:!0});return}if(p&&(d==="/pause"||d.startsWith("/pause ")||d==="/resume"||d==="/stop")){let f=d.startsWith("/pause")?"Pausing":d==="/resume"?"Resuming":"Stopping";qe().showToast(F.success(`\u25C6 ${f}...`)),u.enqueueTypeAhead({silent:!0});return}if(p&&d.startsWith("/")&&!d.includes(`
1127
+ `)&&!d.includes(" ")?(i.isVisible||i.show(),i.setFilter(d)):i.isVisible&&i.hide()},l=()=>{let d=i.getSelected();if(!d)return!1;let p=sf();p.clear();for(let h of`/${d.name} `)p.insertChar(h);return i.hide(),!0};if(s==="\x1B"){if(i.isVisible){i.hide();return}e.current();return}if(s===""){Cl(0);return}if(s===""){let d=$a();if(d.peekOpen){d.closePeek();return}let p=Bo();p.nodes.length>0||p.transcripts.size>0?p.toggleExpanded():d.togglePeek();return}let c=$a();if(c.peekOpen){if(s==="\x1B[A"){c.navigatePeek("prev");return}if(s==="\x1B[B"){c.navigatePeek("next");return}}let u=sf();if(s===" "){i.isVisible&&l();return}if(s==="\r"){if(i.isVisible){l();return}let d=u.getText().trim();if(!d)return;let p=et().loopMode,h=LE(d);if(h){let f=h.noteText;if(!f){qe().showToast(F.dim(`\u25C6 ${h.prefix} requires a message (usage: ${h.prefix} <text>)`)),u.clear();return}if(!p){let S=ME();S.noteToastId!==null&&qe().clearToast(S.noteToastId),S.setPendingNote(f);let T=process.stdout.columns||80,C=Math.floor(T*.618)-16,v=f.replace(/\n/g," "),A=v.length>C?v.slice(0,C)+"\u2026":v,D=qe(),I=D.nextId;D.showToast(F.success(`\u25C6 Injecting: "${A}"`),!0),S.setNoteToastId(I),u.clear();return}let g=process.stdout.columns||80,_=Math.floor(g*.618)-16,E=f.replace(/\n/g," "),y=E.length>_?E.slice(0,_)+"\u2026":E;qe().showToast(F.success(`\u25C6 Injecting: "${y}"`),!0),u.enqueueTypeAhead({silent:!0});return}if(p&&(d==="/pause"||d.startsWith("/pause ")||d==="/resume"||d==="/stop")){let f=d.startsWith("/pause")?"Pausing":d==="/resume"?"Resuming":"Stopping";qe().showToast(F.success(`\u25C6 ${f}...`)),u.enqueueTypeAhead({silent:!0});return}if(p&&d.startsWith("/")&&!d.includes(`
1128
1128
  `)){u.enqueueTypeAhead({silent:!0});return}u.enqueueTypeAhead();return}if(s===`
1129
1129
  `){i.hide(),u.newLine();return}if(s==="\x7F"||s==="\b"){u.deleteChar(),a();return}if(s==="\x1B[A"){if(i.isVisible){i.moveUp();return}u.moveCursor("up");return}if(s==="\x1B[B"){if(i.isVisible){i.moveDown();return}u.moveCursor("down");return}if(s==="\x1B[C"){u.moveCursor("right");return}if(s==="\x1B[D"){u.moveCursor("left");return}if(s===""){u.undo();return}if(s===""){u.redo();return}if(s===""){u.hasQueuedMessages()&&!u.getText().trim()?u.clearTypeAheadQueue():u.clear(),i.hide();return}if(!s.startsWith("\x1B")){for(let d of Array.from(s))if(d===`
1130
1130
  `||d==="\r")u.newLine();else{let p=d.codePointAt(0)??0;(p>=32&&p<=126||p>=128)&&u.insertChar(d)}a()}};return process.stdin.on("data",r),rd("InterruptHandler.mount"),()=>{process.stdin.removeListener("data",r)}},[]),null}function W5e({optionsCount:t,selectedIndex:e,hasScrollableContent:r,isScrollMode:n,onScroll:s,onNavigate:o,onSelect:i,onToggleMode:a,onInterrupt:l}){let c=En(e),u=En(t),d=En(r),p=En(n),h=En(s),f=En(o),g=En(i),_=En(a),E=En(l);return c.current=e,u.current=t,d.current=r,p.current=n,h.current=s,f.current=o,g.current=i,_.current=a,E.current=l,sd(()=>{if(!process.stdin.isTTY)return;let y=process.stdin.isRaw;process.stdin.setRawMode(!0),process.stdin.resume();let S=T=>{let C=T.toString();if(C===" "){d.current&&_.current();return}if(C==="\x1B[A"){p.current?h.current("up"):f.current("up");return}if(C==="\x1B[B"){p.current?h.current("down"):f.current("down");return}if(C==="\x1B[5~"){d.current&&h.current("up");return}if(C==="\x1B[6~"){d.current&&h.current("down");return}if(C==="\r"||C===`
1131
1131
  `){g.current(c.current);return}if(C===""){Cl(0);return}if(C==="\x1B"){E.current&&E.current(),g.current(u.current-1);return}let v=parseInt(C,10);if(v>=1&&v<=u.current){g.current(v-1);return}};return process.stdin.on("data",S),rd("DialogKeyHandler.mount"),()=>{process.stdin.removeListener("data",S),!y&&process.stdin.isTTY&&process.stdin.setRawMode(!1)}},[]),null}function K5e({feedbackText:t,onTextChange:e,onSubmit:r,onCancel:n}){let s=En(t),o=En(e),i=En(r),a=En(n);return s.current=t,o.current=e,i.current=r,a.current=n,sd(()=>{if(!process.stdin.isTTY)return;let l=process.stdin.isRaw;process.stdin.setRawMode(!0),process.stdin.resume();let c=u=>{let d=u.toString();if(d==="\r"||d===`
1132
1132
  `){let p=s.current.trim();p.length>0&&i.current(p);return}if(d==="\x1B"){a.current();return}if(d===""){Cl(0);return}if(d==="\x7F"||d==="\b"){o.current(s.current.slice(0,-1));return}d.charCodeAt(0)<32||d.startsWith("\x1B[")||o.current(s.current+d)};return process.stdin.on("data",c),rd("FeedbackKeyHandler.mount"),()=>{process.stdin.removeListener("data",c),!l&&process.stdin.isTTY&&process.stdin.setRawMode(!1)}},[]),null}function V5e(t){let e=En(t);return e.current=t,sd(()=>{if(!process.stdin.isTTY)return;let r=process.stdin.isRaw;process.stdin.setRawMode(!0),process.stdin.resume();let n=s=>{let o=s.toString(),i=e.current;if(o===""){Cl(0);return}if(i.otherMode){if(o==="\r"||o===`
1133
1133
  `){let l=i.otherText.trim();l.length>0&&i.onSubmitOther(l);return}if(o==="\x1B"){i.onCancelOther();return}if(o==="\x7F"||o==="\b"){i.onOtherTextChange(i.otherText.slice(0,-1));return}if(o.charCodeAt(0)<32||o.startsWith("\x1B["))return;i.onOtherTextChange(i.otherText+o);return}if(o==="\x1B"){i.onCancelDialog();return}if(o==="\x1B[A"){i.onSelectIndex(Math.max(0,i.selectedIndex-1));return}if(o==="\x1B[B"){i.onSelectIndex(Math.min(i.optionCount-1,i.selectedIndex+1));return}if(o==="\r"||o===`
1134
- `){i.isOnOther?i.onPickOther():i.onSubmitOption();return}let a=o.charCodeAt(0);if(a>=49&&a<=57){let l=a-49;l<i.optionCount&&i.onSelectIndex(l)}};return process.stdin.on("data",n),rd("QuestionDialogKeyHandler.mount"),()=>{process.stdin.removeListener("data",n),!r&&process.stdin.isTTY&&process.stdin.setRawMode(!1)}},[]),null}function Q5e(){let t=Date.now();return t-Rse>1e3&&(Dse=process.memoryUsage().heapUsed/1024/1024,Rse=t),Dse}function X5e(t,e){sd(()=>{if(!t)return;let r=nt(),n=nf(),s=i=>{n.appendToken(i)},o=(i,a,l,c,u)=>{if(r.updateContext(a,e),c>0){let d=nt().sessionCost??0;nt().updateSession({sessionCost:d+c})}if(u&&(u.billedInputTokens||u.cachedTokens)){let d=nt();d.updateSession({sessionTokensIn:(d.sessionTokensIn??0)+(u.billedInputTokens??0),sessionCachedTokens:(d.sessionCachedTokens??0)+(u.cachedTokens??0)})}};return t.on("token",s),t.on("iterationUsage",o),()=>{t.off("token",s),t.off("iterationUsage",o)}},[t,e])}function Nse({initialMode:t="welcome",agentEmitter:e,projectPath:r=process.cwd(),branch:n,model:s="sonnet-4",contextLimit:o=2e5,width:i,version:a="0.0.0",initialToolsCount:l=0,initialMcpServersCount:c=0,initialContextFilesCount:u=0,initialSkillsCount:d=0,permissionDialog:p,questionDialog:h,onInterrupt:f}){let g=i??(process.stdout.columns||80);sd(()=>{let X=nt();X.updateSession({projectPath:r,model:s,branch:n}),(l>0||c>0||u>0||d>0)&&X.updateResources({toolsCount:l,mcpServersCount:c,contextFilesCount:u,skillsCount:d})},[r,s,n,l,c,u,d]),X5e(e,o);let{mode:_,isThinking:E,isStreaming:y,status:S,renderEpoch:T}=es(nd(X=>({mode:X.mode,isThinking:X.isThinking,isStreaming:X.isStreaming,status:X.status,renderEpoch:X.renderEpoch}))),{currentIteration:C,iterationStartTime:v,iterationTokens:A}=es(nd(X=>({currentIteration:X.currentIteration,iterationStartTime:X.iterationStartTime,iterationTokens:X.iterationTokens}))),{contextPercent:D,contextLevel:I,contextTokens:x,uiContextLimit:B}=es(nd(X=>({contextPercent:X.contextPercent,contextLevel:X.contextLevel,contextTokens:X.contextTokens,uiContextLimit:X.contextLimit}))),{sessionCost:$,freeBudgetRemaining:L,goalSegment:q,goalTurnActive:z,sessionTokensIn:Q,sessionCachedTokens:K,provider:me,uiModel:Z,uiOpenrouterProvider:ce,connectionMode:te,uiBranch:Ae,uiProjectPath:U,worktreeName:J,baseBranch:j,agentMode:V,sessionStartTime:ue,agentExecMs:Pe,agentTurnStartTime:Ne}=es(nd(X=>({sessionCost:X.sessionCost,freeBudgetRemaining:X.freeBudgetRemaining,goalSegment:X.goalSegment,goalTurnActive:X.goalTurnActive,sessionTokensIn:X.sessionTokensIn,sessionCachedTokens:X.sessionCachedTokens,provider:X.provider,uiModel:X.model,uiOpenrouterProvider:X.openrouterProvider,connectionMode:X.connectionMode,uiBranch:X.branch,uiProjectPath:X.projectPath,worktreeName:X.worktreeName,baseBranch:X.baseBranch,agentMode:X.agentMode,sessionStartTime:X.sessionStartTime,agentExecMs:X.agentExecMs,agentTurnStartTime:X.agentTurnStartTime}))),{soulName:ee,personaName:Oe,toolsCount:Yt,mcpServersCount:It,mcpFailedCount:nn,contextFilesCount:Dn,skillsCount:Rn}=es(nd(X=>({soulName:X.soulName,personaName:X.personaName,toolsCount:X.toolsCount,mcpServersCount:X.mcpServersCount,mcpFailedCount:X.mcpFailedCount,contextFilesCount:X.contextFilesCount,skillsCount:X.skillsCount}))),{loopMode:sr,loopStartTime:go,loopMaxIterations:ms,loopTotalInputTokens:sn,loopTotalOutputTokens:_o,loopCost:Fe,loopToolCalls:Eo,loopCurrentIteration:or,loopPaused:Je,loopPauseUntil:yo,loopDurationSeconds:fs}=es(nd(X=>({loopMode:X.loopMode,loopStartTime:X.loopStartTime,loopMaxIterations:X.loopMaxIterations,loopTotalInputTokens:X.loopTotalInputTokens,loopTotalOutputTokens:X.loopTotalOutputTokens,loopCost:X.loopCost,loopToolCalls:X.loopToolCalls,loopCurrentIteration:X.loopCurrentIteration,loopPaused:X.loopPaused,loopPauseUntil:X.loopPauseUntil,loopDurationSeconds:X.loopDurationSeconds}))),ii=sr&&go!==null?{currentIteration:or,maxIterations:ms,totalInputTokens:sn,totalOutputTokens:_o,totalCost:Fe,startTime:go,toolCalls:Eo,paused:Je,pauseUntil:yo,durationSeconds:fs,agentBusy:y||E||Xu(Bo())}:void 0,Rr=Wu(X=>X.renderedContent),pe=Wu(X=>X.permanentContent),_e=Wu(X=>X.staticEpoch),{inputLines:Le,cursorLine:lt,cursorCol:Gr}=Ku(nd(X=>({inputLines:X.lines,cursorLine:X.cursorLine,cursorCol:X.cursorCol}))),[al,xh]=Ba(0),[vU,DA]=Ba(0),[RA,kU]=Ba(!1),[PS,LS]=Ba(!1),[NA,Mh]=Ba(""),[Ph,OA]=Ba(0),[xA,FS]=Ba(!1),[MA,$S]=Ba("");sd(()=>{h&&(OA(0),FS(!1),$S(""))},[h]);let Lh=Ise(()=>h?h.allowOther?[...h.options,{label:"Other"}]:h.options:[],[h]),[PA,AU]=Ba(0);q5e.useEffect(()=>(globalThis.__inkResetHeader=()=>AU(X=>X+1),()=>{delete globalThis.__inkResetHeader}),[]);let LA=!0,IU=process.stdout.rows||24,FA=p?.options?.length??3,DU=14+FA+2+2,US=Math.max(3,Math.min(15,IU-DU)),$A=p?.details?.length??0,Fh=$A>US,UA=Math.max(0,$A-US),RU=ff(X=>{if(!p||!Fh)return;let So=3;DA(X==="up"?hs=>Math.max(0,hs-So):hs=>Math.min(UA,hs+So))},[p,Fh,UA]),NU=ff(X=>{if(!p)return;let So=p.options?.length??3;xh(X==="up"?hs=>Math.max(0,hs-1):hs=>Math.min(So-1,hs+1))},[p]),OU=ff(X=>{if(!p)return;let So=p.options??[{key:"1",label:"Yes",value:"yes"},{key:"2",label:"Yes, and don't ask again for this session",value:"session"},{key:"3",label:"No",value:"no"},{key:"4",label:"Provide feedback",value:"feedback"}];if(X>=0&&X<So.length){let hs=So[X].value;if(hs==="feedback"){LS(!0),Mh("");return}p.onResult?.(hs)}},[p]),xU=ff(X=>{p&&(LS(!1),Mh(""),p.onResult?.(`feedback:${X}`))},[p]),MU=ff(()=>{LS(!1),Mh("")},[]),PU=ff(()=>{kU(X=>!X)},[]),LU=Yt||l,FU=It||c,$U=Dn||u,UU=Rn||d,BA=_==="dialog"&&p,GA=_==="dialog"&&h,$h=BA||GA,rp=En(null);$h&&rp.current===null?rp.current=pe.length:!$h&&rp.current!==null&&(rp.current=null);let zA=rp.current,BU=Ise(()=>wse({permanentContent:pe,frozenCount:zA,showWelcome:LA,headerKey:PA,staticEpoch:_e}),[pe,zA,LA,PA,_e]);return bL(hf,{flexDirection:"column",width:g,children:[Kr(kse,{}),Kr(j5e,{items:BU,children:X=>X.type==="welcome"?Kr(hf,{marginBottom:1,children:Kr(qre,{version:a,width:g})},X.id):X.type==="spacer"?Kr(hf,{},X.id):X.id.startsWith("blank-")||X.line===""||X.line===" "||X.line==="\xA0"?Kr(TL,{children:"\u200B"},X.id):Kr(TL,{children:X.line},X.id)},_e),BA&&bL(hf,{flexDirection:"column",children:[Kr(hse,{toolName:p.toolName,description:p.description,details:p.details,showDiff:p.showDiff,options:p.options,selectedIndex:al,isScrollMode:RA,scrollOffset:vU,maxVisibleDiffLines:US,width:g,isFeedbackMode:PS,feedbackText:NA}),!PS&&Kr(hf,{marginTop:1,children:Kr(TL,{dimColor:!0,children:Fh?`\u2191/\u2193 select \u2022 Tab to scroll diff \u2022 1-${FA} direct select`:"\u2191/\u2193 select option \u2022 Enter to confirm"})}),PS?Kr(K5e,{feedbackText:NA,onTextChange:Mh,onSubmit:xU,onCancel:MU}):Kr(W5e,{optionsCount:p.options?.length??4,selectedIndex:al,hasScrollableContent:Fh,isScrollMode:RA,onScroll:RU,onNavigate:NU,onSelect:OU,onToggleMode:PU,onInterrupt:f})]}),GA&&h&&bL(hf,{flexDirection:"column",children:[Kr(_se,{question:h.question,description:h.description,options:Lh,selectedIndex:Ph,otherMode:xA,otherText:MA,width:g}),Kr(V5e,{optionCount:Lh.length,selectedIndex:Ph,isOnOther:h.allowOther&&Ph===Lh.length-1,otherMode:xA,otherText:MA,onSelectIndex:OA,onSubmitOption:()=>{let X=Lh[Ph];h.onResult({type:"option",label:X.label})},onPickOther:()=>FS(!0),onOtherTextChange:$S,onSubmitOther:X=>h.onResult({type:"other",text:X}),onCancelOther:()=>{FS(!1),$S("")},onCancelDialog:()=>h.onResult({type:"cancelled"})})]}),!$h&&Kr(H5e,{children:f&&Kr(Y5e,{onInterrupt:f})}),!$h&&Kr(tse,{permanentContent:[],streamingContent:Rr,isStreaming:y,isThinking:E,thinkingStatus:S||"Thinking...",currentIteration:C,thinkingTokensGenerated:A,iterationStartTime:v,inputLines:Le,inputCursorLine:lt,inputCursorCol:Gr,inputFocused:!0,resourceCounts:{soulName:ee||"",personaName:Oe||"",modelName:(()=>{let X=(Z||s).replace(/-latest$/,"");if(te==="cloud")return X;let So=me?X.startsWith(`${me}/`)?X:`${me}/${X}`:X,hs=ce?`@${ce}`:"";return So+hs})(),connectionMode:te,tools:LU,mcpServers:FU,mcpFailedCount:nn,contextFiles:$U,skills:UU},statusBar:{projectPath:U||r,branch:Ae||n,worktreeName:J,baseBranch:j,mode:V,contextPercent:D,contextLevel:I,contextTokens:x,contextLimit:B,sessionCost:$,freeBudgetRemaining:te==="cloud"?L:null,goalSegment:q,goalTurnActive:z,sessionTokensIn:Q,sessionCachedTokens:K,memoryMB:Q5e(),sessionDuration:Math.floor((Date.now()-ue)/1e3),agentExecTime:Math.floor((Pe+(Ne?Date.now()-Ne:0))/1e3),loopStats:ii},width:g})]})}var Dse,Rse,J5e,xse=k(()=>{"use strict";jre();rse();gse();Ese();Xw();pc();ru();hr();tC();uf();Tse();EL();Cse();Ase();SL();Dse=0,Rse=0;J5e=Nse});var Js={};ie(Js,{appendToken:()=>dUe,clearStream:()=>mUe,commitToStatic:()=>pUe,createAgentEmitter:()=>bUe,getCommandMenuStore:()=>oUe,getInputStore:()=>sUe,getNotificationStore:()=>iUe,getStreamStore:()=>dC,getUIStore:()=>za,hidePeekOverlay:()=>rC,hidePermissionDialog:()=>$se,hideQuestionDialog:()=>Use,isInkAppRunning:()=>Gse,isOnRenderPatchInstalled:()=>PE,loadInkModules:()=>nUe,matchesPendingDialog:()=>Fse,reanchorRenderState:()=>EUe,resetRenderState:()=>Bse,resolvePermissionDialogFromRelay:()=>gUe,setAppMode:()=>id,setInterruptCallback:()=>TUe,setStreaming:()=>cUe,setThinking:()=>lUe,showPeekOverlay:()=>yL,showPermissionDialog:()=>Lse,showPermissionDialogAsync:()=>hUe,showQuestionDialogAsync:()=>_Ue,startInkApp:()=>aUe,stopInkApp:()=>yUe,updateContext:()=>fUe,updateInkApp:()=>Sf,waitForInkApp:()=>SUe});import{EventEmitter as Z5e}from"node:events";import{appendFileSync as eUe}from"node:fs";import{tmpdir as tUe}from"node:os";import{join as rUe}from"node:path";function gf(){if(nC!==void 0)return nC;let t=process.env.AII_RENDER_DEBUG;return nC=t?t==="1"||t==="true"?rUe(tUe(),"aii-render-debug.log"):t:null,nC}function FE(t){let e=gf();if(e)try{eUe(e,t+`
1134
+ `){i.isOnOther?i.onPickOther():i.onSubmitOption();return}let a=o.charCodeAt(0);if(a>=49&&a<=57){let l=a-49;l<i.optionCount&&i.onSelectIndex(l)}};return process.stdin.on("data",n),rd("QuestionDialogKeyHandler.mount"),()=>{process.stdin.removeListener("data",n),!r&&process.stdin.isTTY&&process.stdin.setRawMode(!1)}},[]),null}function Q5e(){let t=Date.now();return t-Rse>1e3&&(Dse=process.memoryUsage().heapUsed/1024/1024,Rse=t),Dse}function X5e(t,e){sd(()=>{if(!t)return;let r=et(),n=nf(),s=i=>{n.appendToken(i)},o=(i,a,l,c,u)=>{if(r.updateContext(a,e),c>0){let d=et().sessionCost??0;et().updateSession({sessionCost:d+c})}if(u&&(u.billedInputTokens||u.cachedTokens)){let d=et();d.updateSession({sessionTokensIn:(d.sessionTokensIn??0)+(u.billedInputTokens??0),sessionCachedTokens:(d.sessionCachedTokens??0)+(u.cachedTokens??0)})}};return t.on("token",s),t.on("iterationUsage",o),()=>{t.off("token",s),t.off("iterationUsage",o)}},[t,e])}function Nse({initialMode:t="welcome",agentEmitter:e,projectPath:r=process.cwd(),branch:n,model:s="sonnet-4",contextLimit:o=2e5,width:i,version:a="0.0.0",initialToolsCount:l=0,initialMcpServersCount:c=0,initialContextFilesCount:u=0,initialSkillsCount:d=0,permissionDialog:p,questionDialog:h,onInterrupt:f}){let g=i??(process.stdout.columns||80);sd(()=>{let X=et();X.updateSession({projectPath:r,model:s,branch:n}),(l>0||c>0||u>0||d>0)&&X.updateResources({toolsCount:l,mcpServersCount:c,contextFilesCount:u,skillsCount:d})},[r,s,n,l,c,u,d]),X5e(e,o);let{mode:_,isThinking:E,isStreaming:y,status:S,renderEpoch:T}=es(nd(X=>({mode:X.mode,isThinking:X.isThinking,isStreaming:X.isStreaming,status:X.status,renderEpoch:X.renderEpoch}))),{currentIteration:C,iterationStartTime:v,iterationTokens:A}=es(nd(X=>({currentIteration:X.currentIteration,iterationStartTime:X.iterationStartTime,iterationTokens:X.iterationTokens}))),{contextPercent:D,contextLevel:I,contextTokens:x,uiContextLimit:B}=es(nd(X=>({contextPercent:X.contextPercent,contextLevel:X.contextLevel,contextTokens:X.contextTokens,uiContextLimit:X.contextLimit}))),{sessionCost:$,freeBudgetRemaining:L,goalSegment:q,goalTurnActive:z,sessionTokensIn:Q,sessionCachedTokens:K,provider:me,uiModel:Z,uiOpenrouterProvider:ce,connectionMode:te,uiBranch:Ae,uiProjectPath:U,worktreeName:J,baseBranch:j,agentMode:V,sessionStartTime:ue,agentExecMs:Pe,agentTurnStartTime:Ne}=es(nd(X=>({sessionCost:X.sessionCost,freeBudgetRemaining:X.freeBudgetRemaining,goalSegment:X.goalSegment,goalTurnActive:X.goalTurnActive,sessionTokensIn:X.sessionTokensIn,sessionCachedTokens:X.sessionCachedTokens,provider:X.provider,uiModel:X.model,uiOpenrouterProvider:X.openrouterProvider,connectionMode:X.connectionMode,uiBranch:X.branch,uiProjectPath:X.projectPath,worktreeName:X.worktreeName,baseBranch:X.baseBranch,agentMode:X.agentMode,sessionStartTime:X.sessionStartTime,agentExecMs:X.agentExecMs,agentTurnStartTime:X.agentTurnStartTime}))),{soulName:ee,personaName:Oe,toolsCount:Yt,mcpServersCount:It,mcpFailedCount:nn,contextFilesCount:Dn,skillsCount:Rn}=es(nd(X=>({soulName:X.soulName,personaName:X.personaName,toolsCount:X.toolsCount,mcpServersCount:X.mcpServersCount,mcpFailedCount:X.mcpFailedCount,contextFilesCount:X.contextFilesCount,skillsCount:X.skillsCount}))),{loopMode:sr,loopStartTime:go,loopMaxIterations:ms,loopTotalInputTokens:sn,loopTotalOutputTokens:_o,loopCost:Fe,loopToolCalls:Eo,loopCurrentIteration:or,loopPaused:Je,loopPauseUntil:yo,loopDurationSeconds:fs}=es(nd(X=>({loopMode:X.loopMode,loopStartTime:X.loopStartTime,loopMaxIterations:X.loopMaxIterations,loopTotalInputTokens:X.loopTotalInputTokens,loopTotalOutputTokens:X.loopTotalOutputTokens,loopCost:X.loopCost,loopToolCalls:X.loopToolCalls,loopCurrentIteration:X.loopCurrentIteration,loopPaused:X.loopPaused,loopPauseUntil:X.loopPauseUntil,loopDurationSeconds:X.loopDurationSeconds}))),ii=sr&&go!==null?{currentIteration:or,maxIterations:ms,totalInputTokens:sn,totalOutputTokens:_o,totalCost:Fe,startTime:go,toolCalls:Eo,paused:Je,pauseUntil:yo,durationSeconds:fs,agentBusy:y||E||Xu(Bo())}:void 0,Rr=Wu(X=>X.renderedContent),pe=Wu(X=>X.permanentContent),_e=Wu(X=>X.staticEpoch),{inputLines:Le,cursorLine:lt,cursorCol:Gr}=Ku(nd(X=>({inputLines:X.lines,cursorLine:X.cursorLine,cursorCol:X.cursorCol}))),[al,xh]=Ba(0),[vU,DA]=Ba(0),[RA,kU]=Ba(!1),[PS,LS]=Ba(!1),[NA,Mh]=Ba(""),[Ph,OA]=Ba(0),[xA,FS]=Ba(!1),[MA,$S]=Ba("");sd(()=>{h&&(OA(0),FS(!1),$S(""))},[h]);let Lh=Ise(()=>h?h.allowOther?[...h.options,{label:"Other"}]:h.options:[],[h]),[PA,AU]=Ba(0);q5e.useEffect(()=>(globalThis.__inkResetHeader=()=>AU(X=>X+1),()=>{delete globalThis.__inkResetHeader}),[]);let LA=!0,IU=process.stdout.rows||24,FA=p?.options?.length??3,DU=14+FA+2+2,US=Math.max(3,Math.min(15,IU-DU)),$A=p?.details?.length??0,Fh=$A>US,UA=Math.max(0,$A-US),RU=ff(X=>{if(!p||!Fh)return;let So=3;DA(X==="up"?hs=>Math.max(0,hs-So):hs=>Math.min(UA,hs+So))},[p,Fh,UA]),NU=ff(X=>{if(!p)return;let So=p.options?.length??3;xh(X==="up"?hs=>Math.max(0,hs-1):hs=>Math.min(So-1,hs+1))},[p]),OU=ff(X=>{if(!p)return;let So=p.options??[{key:"1",label:"Yes",value:"yes"},{key:"2",label:"Yes, and don't ask again for this session",value:"session"},{key:"3",label:"No",value:"no"},{key:"4",label:"Provide feedback",value:"feedback"}];if(X>=0&&X<So.length){let hs=So[X].value;if(hs==="feedback"){LS(!0),Mh("");return}p.onResult?.(hs)}},[p]),xU=ff(X=>{p&&(LS(!1),Mh(""),p.onResult?.(`feedback:${X}`))},[p]),MU=ff(()=>{LS(!1),Mh("")},[]),PU=ff(()=>{kU(X=>!X)},[]),LU=Yt||l,FU=It||c,$U=Dn||u,UU=Rn||d,BA=_==="dialog"&&p,GA=_==="dialog"&&h,$h=BA||GA,rp=En(null);$h&&rp.current===null?rp.current=pe.length:!$h&&rp.current!==null&&(rp.current=null);let zA=rp.current,BU=Ise(()=>wse({permanentContent:pe,frozenCount:zA,showWelcome:LA,headerKey:PA,staticEpoch:_e}),[pe,zA,LA,PA,_e]);return bL(hf,{flexDirection:"column",width:g,children:[Kr(kse,{}),Kr(j5e,{items:BU,children:X=>X.type==="welcome"?Kr(hf,{marginBottom:1,children:Kr(qre,{version:a,width:g})},X.id):X.type==="spacer"?Kr(hf,{},X.id):X.id.startsWith("blank-")||X.line===""||X.line===" "||X.line==="\xA0"?Kr(TL,{children:"\u200B"},X.id):Kr(TL,{children:X.line},X.id)},_e),BA&&bL(hf,{flexDirection:"column",children:[Kr(hse,{toolName:p.toolName,description:p.description,details:p.details,showDiff:p.showDiff,options:p.options,selectedIndex:al,isScrollMode:RA,scrollOffset:vU,maxVisibleDiffLines:US,width:g,isFeedbackMode:PS,feedbackText:NA}),!PS&&Kr(hf,{marginTop:1,children:Kr(TL,{dimColor:!0,children:Fh?`\u2191/\u2193 select \u2022 Tab to scroll diff \u2022 1-${FA} direct select`:"\u2191/\u2193 select option \u2022 Enter to confirm"})}),PS?Kr(K5e,{feedbackText:NA,onTextChange:Mh,onSubmit:xU,onCancel:MU}):Kr(W5e,{optionsCount:p.options?.length??4,selectedIndex:al,hasScrollableContent:Fh,isScrollMode:RA,onScroll:RU,onNavigate:NU,onSelect:OU,onToggleMode:PU,onInterrupt:f})]}),GA&&h&&bL(hf,{flexDirection:"column",children:[Kr(_se,{question:h.question,description:h.description,options:Lh,selectedIndex:Ph,otherMode:xA,otherText:MA,width:g}),Kr(V5e,{optionCount:Lh.length,selectedIndex:Ph,isOnOther:h.allowOther&&Ph===Lh.length-1,otherMode:xA,otherText:MA,onSelectIndex:OA,onSubmitOption:()=>{let X=Lh[Ph];h.onResult({type:"option",label:X.label})},onPickOther:()=>FS(!0),onOtherTextChange:$S,onSubmitOther:X=>h.onResult({type:"other",text:X}),onCancelOther:()=>{FS(!1),$S("")},onCancelDialog:()=>h.onResult({type:"cancelled"})})]}),!$h&&Kr(H5e,{children:f&&Kr(Y5e,{onInterrupt:f})}),!$h&&Kr(tse,{permanentContent:[],streamingContent:Rr,isStreaming:y,isThinking:E,thinkingStatus:S||"Thinking...",currentIteration:C,thinkingTokensGenerated:A,iterationStartTime:v,inputLines:Le,inputCursorLine:lt,inputCursorCol:Gr,inputFocused:!0,resourceCounts:{soulName:ee||"",personaName:Oe||"",modelName:(()=>{let X=(Z||s).replace(/-latest$/,"");if(te==="cloud")return X;let So=me?X.startsWith(`${me}/`)?X:`${me}/${X}`:X,hs=ce?`@${ce}`:"";return So+hs})(),connectionMode:te,tools:LU,mcpServers:FU,mcpFailedCount:nn,contextFiles:$U,skills:UU},statusBar:{projectPath:U||r,branch:Ae||n,worktreeName:J,baseBranch:j,mode:V,contextPercent:D,contextLevel:I,contextTokens:x,contextLimit:B,sessionCost:$,freeBudgetRemaining:te==="cloud"?L:null,goalSegment:q,goalTurnActive:z,sessionTokensIn:Q,sessionCachedTokens:K,memoryMB:Q5e(),sessionDuration:Math.floor((Date.now()-ue)/1e3),agentExecTime:Math.floor((Pe+(Ne?Date.now()-Ne:0))/1e3),loopStats:ii},width:g})]})}var Dse,Rse,J5e,xse=k(()=>{"use strict";jre();rse();gse();Ese();Xw();pc();ru();hr();tC();uf();Tse();EL();Cse();Ase();SL();Dse=0,Rse=0;J5e=Nse});var Js={};ie(Js,{appendToken:()=>dUe,clearStream:()=>mUe,commitToStatic:()=>pUe,createAgentEmitter:()=>bUe,getCommandMenuStore:()=>oUe,getInputStore:()=>sUe,getNotificationStore:()=>iUe,getStreamStore:()=>dC,getUIStore:()=>za,hidePeekOverlay:()=>rC,hidePermissionDialog:()=>$se,hideQuestionDialog:()=>Use,isInkAppRunning:()=>Gse,isOnRenderPatchInstalled:()=>PE,loadInkModules:()=>nUe,matchesPendingDialog:()=>Fse,reanchorRenderState:()=>EUe,resetRenderState:()=>Bse,resolvePermissionDialogFromRelay:()=>gUe,setAppMode:()=>id,setInterruptCallback:()=>TUe,setStreaming:()=>cUe,setThinking:()=>lUe,showPeekOverlay:()=>yL,showPermissionDialog:()=>Lse,showPermissionDialogAsync:()=>hUe,showQuestionDialogAsync:()=>_Ue,startInkApp:()=>aUe,stopInkApp:()=>yUe,updateContext:()=>fUe,updateInkApp:()=>Sf,waitForInkApp:()=>SUe});import{EventEmitter as Z5e}from"node:events";import{appendFileSync as eUe}from"node:fs";import{tmpdir as tUe}from"node:os";import{join as rUe}from"node:path";function gf(){if(nC!==void 0)return nC;let t=process.env.AII_RENDER_DEBUG;return nC=t?t==="1"||t==="true"?rUe(tUe(),"aii-render-debug.log"):t:null,nC}function FE(t){let e=gf();if(e)try{eUe(e,t+`
1135
1135
  `)}catch{}}async function nUe(){if(iC&&Ef&&yf&&aC)return;Ef=await import("react"),iC=await import("ink");try{let e=await import("ansi-escapes"),r=e.default??e;DL=r,r.clearTerminal&&(r.clearTerminal="\x1B[2J\x1B[H")}catch{}try{let e=import.meta.resolve("ink"),r=await import(new URL("instances.js",e).href);AL=r.default??r;let n=await import(new URL("renderer.js",e).href);IL=n.default??n,sC=(await import("es-toolkit/compat")).throttle}catch{}aC=await Promise.resolve().then(()=>(tc(),m0)),wL=await Promise.resolve().then(()=>(xw(),Ure)),CL=await Promise.resolve().then(()=>(Vu(),vE)),vL=await Promise.resolve().then(()=>(Pw(),jP)),kL=await Promise.resolve().then(()=>(Di(),qP)),yf={App:(await Promise.resolve().then(()=>(xse(),Ose))).App}}function za(){if(!aC)throw new Error("Ink modules not loaded. Call loadInkModules() first.");return aC.getUIStore()}function dC(){if(!wL)throw new Error("Ink modules not loaded. Call loadInkModules() first.");return wL.getStreamStore()}function sUe(){if(!CL)throw new Error("Ink modules not loaded. Call loadInkModules() first.");return CL.getInputStore()}function oUe(){if(!vL)throw new Error("Ink modules not loaded. Call loadInkModules() first.");return vL.getCommandMenuStore()}function iUe(){if(!kL)throw new Error("Ink modules not loaded. Call loadInkModules() first.");return kL.getNotificationStore()}function aUe(t={}){if(!iC||!Ef||!yf)throw new Error("Ink modules not loaded. Call loadInkModules() first.");Ga&&(process.stdout.write("\x1B[?1049l"),Ga=!1),lC=null,cC=null,Vr&&Vr.unmount(),_f={...t};let{render:e}=iC,r=Ef,{App:n}=yf;if(process.stdout.write("\x1B[?25l"),Vr=e(r.createElement(n,_f),{exitOnCtrlC:!1,patchConsole:!1}),AL&&IL&&sC&&DL)try{let s=AL.get(process.stdout);if(s&&typeof s.onRender=="function"){let o=IL,i=s.options.stdout,a=DL,l=s.log,c=0,u="",d="",p=!1,h="",f="",g=(_,E)=>{let y=_+`
1136
1136
  `;if(y===u)return;let S=y.split(`
1137
1137
  `),T=lH(i.rows);S=cH(S,T);let C="\x1B[0m"+S.join(`
@@ -1181,13 +1181,13 @@ Use ${i} to retrieve the full results.`}function Ale(t){return`${t.map(WF).join(
1181
1181
  `)}
1182
1182
 
1183
1183
  The above background work finished while you were idle. Report the outcome to the user. Do NOT re-run, restart, or re-issue any earlier command \u2014 the work is already complete.`}var Ile=k(()=>{"use strict"});var Af,Ed,KF,Tn,dy=k(()=>{"use strict";Af={soul:"SOUL.md",identity:"IDENTITY.md",style:"STYLE.md",heartbeat:"HEARTBEAT.md",workflow:"AGENTS.md"},Ed="thinker",KF="aiiware",Tn={soul:{warn:6144,hard:8192},identity:{warn:3072,hard:4096},style:{warn:6144,hard:8192},heartbeat:{warn:2048,hard:4096},workflow:{warn:6144,hard:8192},examples:{warn:6144,hard:8192},total:{warn:29696,hard:40960}}});function Dle(t,e){let r=[],n;try{n=JSON.parse(t)}catch(i){return{valid:!1,manifest:null,errors:[`Invalid JSON in ${e}: ${i.message}`]}}n.specVersion!=="0.4"&&r.push(`specVersion must be "0.4", got "${n.specVersion}"`),typeof n.name!="string"||!n.name?r.push("name must be a non-empty string"):P6e.test(n.name)||r.push(`name must match /^[a-z0-9-]+$/, got "${n.name}"`),n.files!==void 0&&(typeof n.files!="object"||n.files===null||Array.isArray(n.files))&&r.push("files must be an object");let s=typeof n.files=="object"&&n.files!==null&&!Array.isArray(n.files)?n.files:{};for(let[i,a]of Object.entries(s))typeof a=="string"&&(a.startsWith("/")&&r.push(`files.${i}: absolute paths not allowed ("${a}")`),a.includes("..")&&r.push(`files.${i}: path traversal not allowed ("${a}")`));if(r.length>0){for(let i of r)P.debug(`[soul] Manifest validation: ${i}`);return{valid:!1,manifest:null,errors:r}}return{valid:!0,manifest:{specVersion:n.specVersion,name:n.name,displayName:n.displayName??n.name,version:n.version??"0.0.0",description:n.description??"",license:n.license,tags:n.tags,compatibility:n.compatibility,files:n.files??{}},errors:[]}}var P6e,Rle=k(()=>{"use strict";ct();P6e=/^[a-z0-9-]+$/});import*as wn from"fs";import*as qo from"path";async function VF(t,e,r){let s=[{dir:qo.join(t,".aii","soul"),sourceType:"project"},{dir:e,sourceType:"global-loose"},{dir:r,sourceType:"global-installed"}];for(let{dir:o}of s){let i=qo.join(o,"soul.json");if(wn.existsSync(i))try{let a=wn.readFileSync(i,"utf-8"),l=Dle(a,i);if(l.valid&&l.manifest)return P.debug(`[soul] Found manifest at ${i}`),L6e(l.manifest,i,o,s);P.debug(`[soul] Invalid manifest at ${i}, falling through`)}catch{P.debug(`[soul] Failed to read ${i}, falling through`)}}return P.debug("[soul] No manifest found, using file-level discovery"),F6e(s)}function L6e(t,e,r,n){let s={manifest:t,manifestPath:e,files:{soul:null,identity:null,style:null,heartbeat:null,workflow:null,examples:null},examplesSource:null},o=["soul","identity","style","heartbeat"];for(let l of o){let c=t.files[l];if(c){let u=qo.join(r,c);if(wn.existsSync(u)){s.files[l]={path:u,source:{type:"manifest",path:u,manifestDir:r}};continue}}for(let{dir:u,sourceType:d}of n){if(u===r)continue;let p=qo.join(u,Af[l]);if(wn.existsSync(p)){s.files[l]={path:p,source:{type:d,path:p}};break}}}let i=t.files.agents;if(i){let l=qo.join(r,i);wn.existsSync(l)&&(s.files.workflow={path:l,source:{type:"manifest",path:l,manifestDir:r}})}if(!s.files.workflow)for(let{dir:l,sourceType:c}of n){if(l===r)continue;let u=qo.join(l,Af.workflow);if(wn.existsSync(u)){s.files.workflow={path:u,source:{type:c,path:u}};break}}let a=t.files.examples;if(a){let l=qo.join(r,a);wn.existsSync(l)&&wn.statSync(l).isDirectory()&&(s.files.examples=l,s.examplesSource={type:"manifest",path:l,manifestDir:r})}if(!s.files.examples)for(let{dir:l,sourceType:c}of n){if(l===r)continue;let u=qo.join(l,"examples");if(wn.existsSync(u)&&wn.statSync(u).isDirectory()){s.files.examples=u,s.examplesSource={type:c,path:u};break}}return s}function F6e(t){let e={manifest:null,manifestPath:null,files:{soul:null,identity:null,style:null,heartbeat:null,workflow:null,examples:null},examplesSource:null},r=["soul","identity","style","heartbeat","workflow"];for(let n of r)for(let{dir:s,sourceType:o}of t){let i=qo.join(s,Af[n]);if(wn.existsSync(i)){e.files[n]={path:i,source:{type:o,path:i}};break}}for(let{dir:n,sourceType:s}of t){let o=qo.join(n,"examples");if(wn.existsSync(o)&&wn.statSync(o).isDirectory()){e.files.examples=o,e.examplesSource={type:s,path:o};break}}return e}var Nle=k(()=>{"use strict";dy();Rle();ct()});import*as yd from"fs";import*as QF from"path";async function nv(t,e,r){try{let n=yd.readFileSync(t,"utf-8"),s=wo(n);if(s.modified){let a=s.zeroWidthRemoved+s.bidirectionalRemoved+s.separatorsRemoved;P.debug(`[soul] Sanitized ${a} dangerous chars from ${t}`)}n=s.sanitized;let o=Buffer.byteLength(n,"utf-8"),i=Tn[e];if(o>i.warn){let a=(o/1024).toFixed(1),l=(i.warn/1024).toFixed(0);P.debug(`[soul] WARNING: ${e} (${t}) is ${a}KB (warning threshold: ${l}KB)`)}if(o>i.hard){let a=(i.hard/1024).toFixed(0);P.debug(`[soul] ERROR: ${e} exceeds ${a}KB hard limit \u2014 truncating`),n=n.slice(0,i.hard)}return{content:n,source:r,sizeBytes:Math.min(o,i.hard)}}catch{return P.debug(`[soul] Failed to read ${t}`),null}}async function sv(t,e){let r=QF.join(t,"good-outputs.md"),n=QF.join(t,"bad-outputs.md"),s=null,o=null,i=0;if(yd.existsSync(r))try{s=wo(yd.readFileSync(r,"utf-8")).sanitized,i+=Buffer.byteLength(s,"utf-8")}catch{}if(yd.existsSync(n))try{o=wo(yd.readFileSync(n,"utf-8")).sanitized,i+=Buffer.byteLength(o,"utf-8")}catch{}if(!s&&!o)return null;if(i>Tn.examples.warn&&P.debug(`[soul] WARNING: examples/ combined is ${(i/1024).toFixed(1)}KB`),i>Tn.examples.hard){if(P.debug("[soul] ERROR: examples/ exceeds hard limit \u2014 truncating"),o&&s){let a=Buffer.byteLength(s,"utf-8"),l=Tn.examples.hard-a;l>0?o=o.slice(0,l):(o=null,s=s.slice(0,Tn.examples.hard))}i=Tn.examples.hard}return{goodOutputs:s,badOutputs:o,source:e,sizeBytes:i}}var Ole=k(()=>{"use strict";dy();yp();ct()});var Fi={};ie(Fi,{SoulManager:()=>Cn,parseSoulIdentifier:()=>Li});import*as JF from"os";import*as qa from"path";import*as ov from"fs";function Li(t){if(t.includes("/")){let[e,...r]=t.split("/");return{owner:e,name:r.join("/")}}return{owner:KF,name:t}}var XF,Cn,no=k(()=>{"use strict";dy();Nle();Ole();Qe();ct();XF={warm:"thinker",chill:"doer"},Cn=class t{static instance=null;resolved=null;soulName=Ed;identifier={owner:KF,name:Ed};constructor(){}static getInstance(){return t.instance||(t.instance=new t),t.instance}static reset(){t.instance=null}async initialize(e){try{let d=Se().getConfig().soul??Ed;this.soulName=XF[d]??d}catch{this.soulName=Ed}this.identifier=Li(this.soulName);let r=JF.homedir(),n=qa.join(r,".aii","soul"),s=qa.join(r,".aii","souls",this.identifier.owner,this.identifier.name),o=await VF(e,n,s),i={manifest:o.manifest,soul:null,identity:null,style:null,heartbeat:null,workflow:null,calibration:null},a=["soul","identity","style","heartbeat","workflow"];for(let c of a){let u=o.files[c];u&&(i[c]=await nv(u.path,c,u.source))}o.files.examples&&o.examplesSource&&(i.calibration=await sv(o.files.examples,o.examplesSource));let l=this.computeTotalSize(i);if(l>Tn.total.warn&&P.debug(`[soul] WARNING: total soul size ${(l/1024).toFixed(1)}KB exceeds ${(Tn.total.warn/1024).toFixed(0)}KB warning threshold`),l>Tn.total.hard&&(P.debug(`[soul] ERROR: total soul size ${(l/1024).toFixed(1)}KB exceeds ${(Tn.total.hard/1024).toFixed(0)}KB hard limit`),i.calibration&&(i.calibration=null)),this.resolved=i,process.env.AII_DEBUG){let c=this.getDebugInfo();console.error(`[soul] Config: soul=${this.soulName} \u2192 resolved to ${this.identifier.owner}/${this.identifier.name}`),console.error(`[soul] Installed dir: ${s}`),c.manifest&&console.error(`[soul] Manifest: specVersion=${c.manifest.specVersion}, name=${c.manifest.name}`);for(let u of c.files){let d=u.source.type==="builtin"?"builtin (server)":`${u.source.type}:${u.source.path??""}`;console.error(`[soul] Resolved ${u.type}: ${d} (${(u.sizeBytes/1024).toFixed(1)}KB)`)}console.error(`[soul] Total soul size: ${(c.totalSizeBytes/1024).toFixed(1)}KB / ${(Tn.total.hard/1024).toFixed(0)}KB budget`),console.error(`[soul] Sending overrides: ${c.overrideFields.join(", ")||"none"}`)}}async switchSoul(e,r,n=!0){let s=XF[e]??e;this.soulName=s,this.identifier=Li(s),this.resolved=null;let o=this.soulName;if(await this.initializeWithName(r,o),n)try{let i=Se();await i.load(),await i.set("soul",s)}catch{}}async initializeWithName(e,r){let n=XF[r]??r;this.soulName=n,this.identifier=Li(n);let s=JF.homedir(),o=qa.join(s,".aii","soul"),i=qa.join(s,".aii","souls",this.identifier.owner,this.identifier.name),a=await VF(e,o,i),l={manifest:a.manifest,soul:null,identity:null,style:null,heartbeat:null,workflow:null,calibration:null},c=["soul","identity","style","heartbeat","workflow"];for(let d of c){let p=a.files[d];p&&(l[d]=await nv(p.path,d,p.source))}a.files.examples&&a.examplesSource&&(l.calibration=await sv(a.files.examples,a.examplesSource)),this.computeTotalSize(l)>Tn.total.hard&&l.calibration&&(l.calibration=null),this.resolved=l}getAvailableSouls(){return["thinker","doer","coder"]}getSoulName(){return`${this.identifier.owner}/${this.identifier.name}`}getContent(e){return this.resolved?.[e]?.content??null}getCalibration(){return this.resolved?.calibration??null}getManifest(){return this.resolved?.manifest??null}getDebugInfo(){let e=[],r=[];if(this.resolved){for(let n of["soul","identity","style","heartbeat","workflow"]){let s=this.resolved[n];s&&(e.push({type:n,source:s.source,sizeBytes:s.sizeBytes}),r.push(`agent_${n}`))}this.resolved.calibration&&(e.push({type:"calibration",source:this.resolved.calibration.source,sizeBytes:this.resolved.calibration.sizeBytes}),r.push("agent_calibration"))}return{soulName:this.soulName,resolvedIdentifier:this.identifier,manifest:this.resolved?.manifest??null,files:e,totalSizeBytes:this.resolved?this.computeTotalSize(this.resolved):0,overrideFields:r}}async loadFromPersonaPath(e){if(!ov.existsSync(e)){P.debug(`[soul] Persona soul directory not found: ${e}`);return}let r={manifest:this.resolved?.manifest??null,soul:null,identity:null,style:null,heartbeat:null,workflow:null,calibration:null},n=["soul","identity","style","heartbeat","workflow"];for(let i of n){let a=Af[i],l=qa.join(e,a);if(ov.existsSync(l)){let c={type:"manifest",path:l,manifestDir:e};r[i]=await nv(l,i,c)}}let s=qa.join(e,"examples");if(ov.existsSync(s)){let i={type:"manifest",path:s,manifestDir:e};r.calibration=await sv(s,i)}this.resolved=r;let o=qa.basename(e);o&&o!=="souls"&&(this.soulName=o,this.identifier=Li(o)),P.debug(`[soul] Loaded soul from persona path: ${e} (name: ${this.soulName})`)}async loadFromContent(e,r){let n={type:"builtin"},s=i=>({content:i,source:n,sizeBytes:Buffer.byteLength(i)});this.resolved={manifest:null,soul:e.soul?s(e.soul):null,identity:e.identity?s(e.identity):null,style:e.style?s(e.style):null,heartbeat:e.heartbeat?s(e.heartbeat):null,workflow:e.workflow?s(e.workflow):null,calibration:e.calibration?.good||e.calibration?.bad?{goodOutputs:e.calibration.good||null,badOutputs:e.calibration.bad||null,source:n,sizeBytes:Buffer.byteLength(e.calibration.good||"")+Buffer.byteLength(e.calibration.bad||"")}:null};let o=r??"built-in";this.soulName=o,this.identifier={owner:"aiiware",name:o}}async restoreStandaloneSoul(e){await this.initialize(e)}computeTotalSize(e){let r=0;for(let n of["soul","identity","style","heartbeat","workflow"])r+=e[n]?.sizeBytes??0;return r+=e.calibration?.sizeBytes??0,r}}});var xle={};ie(xle,{DEFAULT_SOUL_NAME:()=>Ed,SOUL_BUDGETS:()=>Tn,SoulManager:()=>Cn,parseSoulIdentifier:()=>Li});var Sd=k(()=>{"use strict";no();dy()});import{existsSync as bd,mkdirSync as Mle,readFileSync as Ple,readdirSync as py,writeFileSync as Lle,unlinkSync as $6e}from"fs";import{join as is}from"path";function Fle(t,e){let r=t.split(".").map(Number),n=e.split(".").map(Number);for(let s=0;s<3;s++){let o=r[s]??0,i=n[s]??0;if(o!==i)return o-i}return 0}function ZF(t){return/^\d+\.\d+\.\d+$/.test(t)}var lr,e2=k(()=>{"use strict";bs();lr=class t{static cacheBase(e){switch(e){case"personas":return qN();case"skills":return HN();case"souls":return jN()}}static getVersionDir(e,r,n,s){return is(t.cacheBase(e),r,n,s)}static writePackMeta(e,r){Mle(e,{recursive:!0}),Lle(is(e,Vp),JSON.stringify(r,null,2),"utf-8")}static readPackMeta(e){let r=is(e,Vp);if(!bd(r))return null;let n=Ple(r,"utf-8");return JSON.parse(n)}static markOrphaned(e){Mle(e,{recursive:!0}),Lle(is(e,Gl),String(Date.now()),"utf-8")}static isOrphaned(e){return bd(is(e,Gl))}static unmarkOrphaned(e){let r=is(e,Gl);bd(r)&&$6e(r)}static findActiveVersion(e,r,n){let s=is(t.cacheBase(e),r,n);if(!bd(s))return null;let o;try{o=py(s,{withFileTypes:!0}).filter(a=>a.isDirectory()&&ZF(a.name)).map(a=>a.name)}catch{return null}let i=null;for(let a of o){let l=is(s,a);t.isOrphaned(l)||(i===null||Fle(a,i)>0)&&(i=a)}return i}static listVersions(e,r,n){let s=is(t.cacheBase(e),r,n);if(!bd(s))return[];let o;try{o=py(s,{withFileTypes:!0}).filter(a=>a.isDirectory()&&ZF(a.name)).map(a=>a.name)}catch{return[]}let i=o.map(a=>{let l=is(s,a),c=t.readPackMeta(l),u=is(l,Gl),d=null;return bd(u)&&(d=Ple(u,"utf-8").trim()),{version:a,path:l,installedAt:c?.installedAt??"",orphanedAt:d}});return i.sort((a,l)=>Fle(l.version,a.version)),i}static listInstalled(e){let r=t.cacheBase(e);if(!bd(r))return[];let n=[],s;try{s=py(r,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name)}catch{return[]}for(let o of s){let i=is(r,o),a;try{a=py(i,{withFileTypes:!0}).filter(l=>l.isDirectory()).map(l=>l.name)}catch{continue}for(let l of a){let c=is(i,l),u;try{u=py(c,{withFileTypes:!0}).filter(d=>d.isDirectory()&&ZF(d.name)).map(d=>d.name)}catch{continue}for(let d of u)n.push({owner:o,name:l,version:d,path:is(c,d)})}}return n}}});var hy=w(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.regexpCode=it.getEsmExportName=it.getProperty=it.safeStringify=it.stringify=it.strConcat=it.addCodeArg=it.str=it._=it.nil=it._Code=it.Name=it.IDENTIFIER=it._CodeOrName=void 0;var my=class{};it._CodeOrName=my;it.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Td=class extends my{constructor(e){if(super(),!it.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};it.Name=Td;var so=class extends my{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Td&&(r[n.str]=(r[n.str]||0)+1),r),{})}};it._Code=so;it.nil=new so("");function $le(t,...e){let r=[t[0]],n=0;for(;n<e.length;)r2(r,e[n]),r.push(t[++n]);return new so(r)}it._=$le;var t2=new so("+");function Ule(t,...e){let r=[fy(t[0])],n=0;for(;n<e.length;)r.push(t2),r2(r,e[n]),r.push(t2,fy(t[++n]));return U6e(r),new so(r)}it.str=Ule;function r2(t,e){e instanceof so?t.push(...e._items):e instanceof Td?t.push(e):t.push(z6e(e))}it.addCodeArg=r2;function U6e(t){let e=1;for(;e<t.length-1;){if(t[e]===t2){let r=B6e(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function B6e(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Td||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Td))return`"${t}${e.slice(1)}`}function G6e(t,e){return e.emptyStr()?t:t.emptyStr()?e:Ule`${t}${e}`}it.strConcat=G6e;function z6e(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:fy(Array.isArray(t)?t.join(","):t)}function H6e(t){return new so(fy(t))}it.stringify=H6e;function fy(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}it.safeStringify=fy;function q6e(t){return typeof t=="string"&&it.IDENTIFIER.test(t)?new so(`.${t}`):$le`[${t}]`}it.getProperty=q6e;function j6e(t){if(typeof t=="string"&&it.IDENTIFIER.test(t))return new so(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}it.getEsmExportName=j6e;function Y6e(t){return new so(t.toString())}it.regexpCode=Y6e});var o2=w(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.ValueScope=ls.ValueScopeName=ls.Scope=ls.varKinds=ls.UsedValueState=void 0;var as=hy(),n2=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},iv;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(iv||(ls.UsedValueState=iv={}));ls.varKinds={const:new as.Name("const"),let:new as.Name("let"),var:new as.Name("var")};var av=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof as.Name?e:this.name(e)}name(e){return new as.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};ls.Scope=av;var lv=class extends as.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,as._)`.${new as.Name(r)}[${n}]`}};ls.ValueScopeName=lv;var W6e=(0,as._)`\n`,s2=class extends av{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?W6e:as.nil}}get(){return this._scope}name(e){return new lv(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(i);if(u)return u}else a=this._values[o]=new Map;a.set(i,s);let l=this._scope[o]||(this._scope[o]=[]),c=l.length;return l[c]=r.ref,s.setValue(r,{property:o,itemIndex:c}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,as._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=as.nil;for(let i in e){let a=e[i];if(!a)continue;let l=n[i]=n[i]||new Map;a.forEach(c=>{if(l.has(c))return;l.set(c,iv.Started);let u=r(c);if(u){let d=this.opts.es5?ls.varKinds.var:ls.varKinds.const;o=(0,as._)`${o}${d} ${c} = ${u};${this.opts._n}`}else if(u=s?.(c))o=(0,as._)`${o}${u}${this.opts._n}`;else throw new n2(c);l.set(c,iv.Completed)})}return o}};ls.ValueScope=s2});var je=w(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.or=He.and=He.not=He.CodeGen=He.operators=He.varKinds=He.ValueScopeName=He.ValueScope=He.Scope=He.Name=He.regexpCode=He.stringify=He.getProperty=He.nil=He.strConcat=He.str=He._=void 0;var Xe=hy(),jo=o2(),Tc=hy();Object.defineProperty(He,"_",{enumerable:!0,get:function(){return Tc._}});Object.defineProperty(He,"str",{enumerable:!0,get:function(){return Tc.str}});Object.defineProperty(He,"strConcat",{enumerable:!0,get:function(){return Tc.strConcat}});Object.defineProperty(He,"nil",{enumerable:!0,get:function(){return Tc.nil}});Object.defineProperty(He,"getProperty",{enumerable:!0,get:function(){return Tc.getProperty}});Object.defineProperty(He,"stringify",{enumerable:!0,get:function(){return Tc.stringify}});Object.defineProperty(He,"regexpCode",{enumerable:!0,get:function(){return Tc.regexpCode}});Object.defineProperty(He,"Name",{enumerable:!0,get:function(){return Tc.Name}});var pv=o2();Object.defineProperty(He,"Scope",{enumerable:!0,get:function(){return pv.Scope}});Object.defineProperty(He,"ValueScope",{enumerable:!0,get:function(){return pv.ValueScope}});Object.defineProperty(He,"ValueScopeName",{enumerable:!0,get:function(){return pv.ValueScopeName}});Object.defineProperty(He,"varKinds",{enumerable:!0,get:function(){return pv.varKinds}});He.operators={GT:new Xe._Code(">"),GTE:new Xe._Code(">="),LT:new Xe._Code("<"),LTE:new Xe._Code("<="),EQ:new Xe._Code("==="),NEQ:new Xe._Code("!=="),NOT:new Xe._Code("!"),OR:new Xe._Code("||"),AND:new Xe._Code("&&"),ADD:new Xe._Code("+")};var ja=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},i2=class extends ja{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?jo.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Df(this.rhs,e,r)),this}get names(){return this.rhs instanceof Xe._CodeOrName?this.rhs.names:{}}},cv=class extends ja{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Xe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Df(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Xe.Name?{}:{...this.lhs.names};return dv(e,this.rhs)}},a2=class extends cv{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l2=class extends ja{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},c2=class extends ja{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},u2=class extends ja{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},d2=class extends ja{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Df(this.code,e,r),this}get names(){return this.code instanceof Xe._CodeOrName?this.code.names:{}}},gy=class extends ja{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(K6e(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>vd(e,r.names),{})}},Ya=class extends gy{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},p2=class extends gy{},If=class extends Ya{};If.kind="else";var wd=class t extends Ya{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new If(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Ble(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Df(this.condition,e,r),this}get names(){let e=super.names;return dv(e,this.condition),this.else&&vd(e,this.else.names),e}};wd.kind="if";var Cd=class extends Ya{};Cd.kind="for";var m2=class extends Cd{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Df(this.iteration,e,r),this}get names(){return vd(super.names,this.iteration.names)}},f2=class extends Cd{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?jo.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=dv(super.names,this.from);return dv(e,this.to)}},uv=class extends Cd{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Df(this.iterable,e,r),this}get names(){return vd(super.names,this.iterable.names)}},_y=class extends Ya{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};_y.kind="func";var Ey=class extends gy{render(e){return"return "+super.render(e)}};Ey.kind="return";var h2=class extends Ya{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&vd(e,this.catch.names),this.finally&&vd(e,this.finally.names),e}},yy=class extends Ya{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};yy.kind="catch";var Sy=class extends Ya{render(e){return"finally"+super.render(e)}};Sy.kind="finally";var g2=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
1184
- `:""},this._extScope=e,this._scope=new jo.Scope({parent:e}),this._nodes=[new p2]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let o=this._scope.toName(r);return n!==void 0&&s&&(this._constants[o.str]=n),this._leafNode(new i2(e,o,n)),o}const(e,r,n){return this._def(jo.varKinds.const,e,r,n)}let(e,r,n){return this._def(jo.varKinds.let,e,r,n)}var(e,r,n){return this._def(jo.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new cv(e,r,n))}add(e,r){return this._leafNode(new a2(e,He.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Xe.nil&&this._leafNode(new d2(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,Xe.addCodeArg)(r,s));return r.push("}"),new Xe._Code(r)}if(e,r,n){if(this._blockNode(new wd(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new wd(e))}else(){return this._elseNode(new If)}endIf(){return this._endBlockNode(wd,If)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new m2(e),r)}forRange(e,r,n,s,o=this.opts.es5?jo.varKinds.var:jo.varKinds.let){let i=this._scope.toName(e);return this._for(new f2(o,i,r,n),()=>s(i))}forOf(e,r,n,s=jo.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=r instanceof Xe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Xe._)`${i}.length`,a=>{this.var(o,(0,Xe._)`${i}[${a}]`),n(o)})}return this._for(new uv("of",s,o,r),()=>n(o))}forIn(e,r,n,s=this.opts.es5?jo.varKinds.var:jo.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Xe._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new uv("in",s,o,r),()=>n(o))}endFor(){return this._endBlockNode(Cd)}label(e){return this._leafNode(new l2(e))}break(e){return this._leafNode(new c2(e))}return(e){let r=new Ey;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ey)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new h2;if(this._blockNode(s),this.code(e),r){let o=this.name("e");this._currNode=s.catch=new yy(o),r(o)}return n&&(this._currNode=s.finally=new Sy,this.code(n)),this._endBlockNode(yy,Sy)}throw(e){return this._leafNode(new u2(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Xe.nil,n,s){return this._blockNode(new _y(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(_y)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof wd))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};He.CodeGen=g2;function vd(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function dv(t,e){return e instanceof Xe._CodeOrName?vd(t,e.names):t}function Df(t,e,r){if(t instanceof Xe.Name)return n(t);if(!s(t))return t;return new Xe._Code(t._items.reduce((o,i)=>(i instanceof Xe.Name&&(i=n(i)),i instanceof Xe._Code?o.push(...i._items):o.push(i),o),[]));function n(o){let i=r[o.str];return i===void 0||e[o.str]!==1?o:(delete e[o.str],i)}function s(o){return o instanceof Xe._Code&&o._items.some(i=>i instanceof Xe.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function K6e(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Ble(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Xe._)`!${_2(t)}`}He.not=Ble;var V6e=Gle(He.operators.AND);function Q6e(...t){return t.reduce(V6e)}He.and=Q6e;var X6e=Gle(He.operators.OR);function J6e(...t){return t.reduce(X6e)}He.or=J6e;function Gle(t){return(e,r)=>e===Xe.nil?r:r===Xe.nil?e:(0,Xe._)`${_2(e)} ${t} ${_2(r)}`}function _2(t){return t instanceof Xe.Name?t:(0,Xe._)`(${t})`}});var tt=w(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.checkStrictMode=Ye.getErrorPath=Ye.Type=Ye.useFunc=Ye.setEvaluated=Ye.evaluatedPropsToName=Ye.mergeEvaluated=Ye.eachItem=Ye.unescapeJsonPointer=Ye.escapeJsonPointer=Ye.escapeFragment=Ye.unescapeFragment=Ye.schemaRefOrVal=Ye.schemaHasRulesButRef=Ye.schemaHasRules=Ye.checkUnknownRules=Ye.alwaysValidSchema=Ye.toHash=void 0;var kt=je(),Z6e=hy();function eGe(t){let e={};for(let r of t)e[r]=!0;return e}Ye.toHash=eGe;function tGe(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(qle(t,e),!jle(e,t.self.RULES.all))}Ye.alwaysValidSchema=tGe;function qle(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let o in e)s[o]||Kle(t,`unknown keyword: "${o}"`)}Ye.checkUnknownRules=qle;function jle(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ye.schemaHasRules=jle;function rGe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ye.schemaHasRulesButRef=rGe;function nGe({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,kt._)`${r}`}return(0,kt._)`${t}${e}${(0,kt.getProperty)(n)}`}Ye.schemaRefOrVal=nGe;function sGe(t){return Yle(decodeURIComponent(t))}Ye.unescapeFragment=sGe;function oGe(t){return encodeURIComponent(y2(t))}Ye.escapeFragment=oGe;function y2(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ye.escapeJsonPointer=y2;function Yle(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ye.unescapeJsonPointer=Yle;function iGe(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ye.eachItem=iGe;function zle({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let l=i===void 0?o:i instanceof kt.Name?(o instanceof kt.Name?t(s,o,i):e(s,o,i),i):o instanceof kt.Name?(e(s,i,o),o):r(o,i);return a===kt.Name&&!(l instanceof kt.Name)?n(s,l):l}}Ye.mergeEvaluated={props:zle({mergeNames:(t,e,r)=>t.if((0,kt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,kt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,kt._)`${r} || {}`).code((0,kt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,kt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,kt._)`${r} || {}`),S2(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Wle}),items:zle({mergeNames:(t,e,r)=>t.if((0,kt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,kt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,kt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,kt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Wle(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,kt._)`{}`);return e!==void 0&&S2(t,r,e),r}Ye.evaluatedPropsToName=Wle;function S2(t,e,r){Object.keys(r).forEach(n=>t.assign((0,kt._)`${e}${(0,kt.getProperty)(n)}`,!0))}Ye.setEvaluated=S2;var Hle={};function aGe(t,e){return t.scopeValue("func",{ref:e,code:Hle[e.code]||(Hle[e.code]=new Z6e._Code(e.code))})}Ye.useFunc=aGe;var E2;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(E2||(Ye.Type=E2={}));function lGe(t,e,r){if(t instanceof kt.Name){let n=e===E2.Num;return r?n?(0,kt._)`"[" + ${t} + "]"`:(0,kt._)`"['" + ${t} + "']"`:n?(0,kt._)`"/" + ${t}`:(0,kt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,kt.getProperty)(t).toString():"/"+y2(t)}Ye.getErrorPath=lGe;function Kle(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ye.checkStrictMode=Kle});var Wa=w(b2=>{"use strict";Object.defineProperty(b2,"__esModule",{value:!0});var vn=je(),cGe={data:new vn.Name("data"),valCxt:new vn.Name("valCxt"),instancePath:new vn.Name("instancePath"),parentData:new vn.Name("parentData"),parentDataProperty:new vn.Name("parentDataProperty"),rootData:new vn.Name("rootData"),dynamicAnchors:new vn.Name("dynamicAnchors"),vErrors:new vn.Name("vErrors"),errors:new vn.Name("errors"),this:new vn.Name("this"),self:new vn.Name("self"),scope:new vn.Name("scope"),json:new vn.Name("json"),jsonPos:new vn.Name("jsonPos"),jsonLen:new vn.Name("jsonLen"),jsonPart:new vn.Name("jsonPart")};b2.default=cGe});var by=w(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.extendErrors=kn.resetErrorsCount=kn.reportExtraError=kn.reportError=kn.keyword$DataError=kn.keywordError=void 0;var rt=je(),mv=tt(),zn=Wa();kn.keywordError={message:({keyword:t})=>(0,rt.str)`must pass "${t}" keyword validation`};kn.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,rt.str)`"${t}" keyword must be ${e} ($data)`:(0,rt.str)`"${t}" keyword is invalid ($data)`};function uGe(t,e=kn.keywordError,r,n){let{it:s}=t,{gen:o,compositeRule:i,allErrors:a}=s,l=Xle(t,e,r);n??(i||a)?Vle(o,l):Qle(s,(0,rt._)`[${l}]`)}kn.reportError=uGe;function dGe(t,e=kn.keywordError,r){let{it:n}=t,{gen:s,compositeRule:o,allErrors:i}=n,a=Xle(t,e,r);Vle(s,a),o||i||Qle(n,zn.default.vErrors)}kn.reportExtraError=dGe;function pGe(t,e){t.assign(zn.default.errors,e),t.if((0,rt._)`${zn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,rt._)`${zn.default.vErrors}.length`,e),()=>t.assign(zn.default.vErrors,null)))}kn.resetErrorsCount=pGe;function mGe({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",s,zn.default.errors,a=>{t.const(i,(0,rt._)`${zn.default.vErrors}[${a}]`),t.if((0,rt._)`${i}.instancePath === undefined`,()=>t.assign((0,rt._)`${i}.instancePath`,(0,rt.strConcat)(zn.default.instancePath,o.errorPath))),t.assign((0,rt._)`${i}.schemaPath`,(0,rt.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,rt._)`${i}.schema`,r),t.assign((0,rt._)`${i}.data`,n))})}kn.extendErrors=mGe;function Vle(t,e){let r=t.const("err",e);t.if((0,rt._)`${zn.default.vErrors} === null`,()=>t.assign(zn.default.vErrors,(0,rt._)`[${r}]`),(0,rt._)`${zn.default.vErrors}.push(${r})`),t.code((0,rt._)`${zn.default.errors}++`)}function Qle(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,rt._)`new ${t.ValidationError}(${e})`):(r.assign((0,rt._)`${n}.errors`,e),r.return(!1))}var kd={keyword:new rt.Name("keyword"),schemaPath:new rt.Name("schemaPath"),params:new rt.Name("params"),propertyName:new rt.Name("propertyName"),message:new rt.Name("message"),schema:new rt.Name("schema"),parentSchema:new rt.Name("parentSchema")};function Xle(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,rt._)`{}`:fGe(t,e,r)}function fGe(t,e,r={}){let{gen:n,it:s}=t,o=[hGe(s,r),gGe(t,r)];return _Ge(t,e,o),n.object(...o)}function hGe({errorPath:t},{instancePath:e}){let r=e?(0,rt.str)`${t}${(0,mv.getErrorPath)(e,mv.Type.Str)}`:t;return[zn.default.instancePath,(0,rt.strConcat)(zn.default.instancePath,r)]}function gGe({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,rt.str)`${e}/${t}`;return r&&(s=(0,rt.str)`${s}${(0,mv.getErrorPath)(r,mv.Type.Str)}`),[kd.schemaPath,s]}function _Ge(t,{params:e,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=t,{opts:l,propertyName:c,topSchemaRef:u,schemaPath:d}=a;n.push([kd.keyword,s],[kd.params,typeof e=="function"?e(t):e||(0,rt._)`{}`]),l.messages&&n.push([kd.message,typeof r=="function"?r(t):r]),l.verbose&&n.push([kd.schema,i],[kd.parentSchema,(0,rt._)`${u}${d}`],[zn.default.data,o]),c&&n.push([kd.propertyName,c])}});var Zle=w(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.boolOrEmptySchema=Rf.topBoolOrEmptySchema=void 0;var EGe=by(),yGe=je(),SGe=Wa(),bGe={message:"boolean schema is false"};function TGe(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Jle(t,!1):typeof r=="object"&&r.$async===!0?e.return(SGe.default.data):(e.assign((0,yGe._)`${n}.errors`,null),e.return(!0))}Rf.topBoolOrEmptySchema=TGe;function wGe(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Jle(t)):r.var(e,!0)}Rf.boolOrEmptySchema=wGe;function Jle(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,EGe.reportError)(s,bGe,void 0,e)}});var T2=w(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.getRules=Nf.isJSONType=void 0;var CGe=["string","number","integer","boolean","null","object","array"],vGe=new Set(CGe);function kGe(t){return typeof t=="string"&&vGe.has(t)}Nf.isJSONType=kGe;function AGe(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Nf.getRules=AGe});var w2=w(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.shouldUseRule=wc.shouldUseGroup=wc.schemaHasRulesForType=void 0;function IGe({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&ece(t,n)}wc.schemaHasRulesForType=IGe;function ece(t,e){return e.rules.some(r=>tce(t,r))}wc.shouldUseGroup=ece;function tce(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}wc.shouldUseRule=tce});var Ty=w(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.reportTypeError=An.checkDataTypes=An.checkDataType=An.coerceAndCheckDataType=An.getJSONTypes=An.getSchemaTypes=An.DataType=void 0;var DGe=T2(),RGe=w2(),NGe=by(),Ue=je(),rce=tt(),Of;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Of||(An.DataType=Of={}));function OGe(t){let e=nce(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}An.getSchemaTypes=OGe;function nce(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(DGe.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}An.getJSONTypes=nce;function xGe(t,e){let{gen:r,data:n,opts:s}=t,o=MGe(e,s.coerceTypes),i=e.length>0&&!(o.length===0&&e.length===1&&(0,RGe.schemaHasRulesForType)(t,e[0]));if(i){let a=v2(e,n,s.strictNumbers,Of.Wrong);r.if(a,()=>{o.length?PGe(t,e,o):k2(t)})}return i}An.coerceAndCheckDataType=xGe;var sce=new Set(["string","number","integer","boolean","null"]);function MGe(t,e){return e?t.filter(r=>sce.has(r)||e==="array"&&r==="array"):[]}function PGe(t,e,r){let{gen:n,data:s,opts:o}=t,i=n.let("dataType",(0,Ue._)`typeof ${s}`),a=n.let("coerced",(0,Ue._)`undefined`);o.coerceTypes==="array"&&n.if((0,Ue._)`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,Ue._)`${s}[0]`).assign(i,(0,Ue._)`typeof ${s}`).if(v2(e,s,o.strictNumbers),()=>n.assign(a,s))),n.if((0,Ue._)`${a} !== undefined`);for(let c of r)(sce.has(c)||c==="array"&&o.coerceTypes==="array")&&l(c);n.else(),k2(t),n.endIf(),n.if((0,Ue._)`${a} !== undefined`,()=>{n.assign(s,a),LGe(t,a)});function l(c){switch(c){case"string":n.elseIf((0,Ue._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,Ue._)`"" + ${s}`).elseIf((0,Ue._)`${s} === null`).assign(a,(0,Ue._)`""`);return;case"number":n.elseIf((0,Ue._)`${i} == "boolean" || ${s} === null
1184
+ `:""},this._extScope=e,this._scope=new jo.Scope({parent:e}),this._nodes=[new p2]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let o=this._scope.toName(r);return n!==void 0&&s&&(this._constants[o.str]=n),this._leafNode(new i2(e,o,n)),o}const(e,r,n){return this._def(jo.varKinds.const,e,r,n)}let(e,r,n){return this._def(jo.varKinds.let,e,r,n)}var(e,r,n){return this._def(jo.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new cv(e,r,n))}add(e,r){return this._leafNode(new a2(e,He.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Xe.nil&&this._leafNode(new d2(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,Xe.addCodeArg)(r,s));return r.push("}"),new Xe._Code(r)}if(e,r,n){if(this._blockNode(new wd(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new wd(e))}else(){return this._elseNode(new If)}endIf(){return this._endBlockNode(wd,If)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new m2(e),r)}forRange(e,r,n,s,o=this.opts.es5?jo.varKinds.var:jo.varKinds.let){let i=this._scope.toName(e);return this._for(new f2(o,i,r,n),()=>s(i))}forOf(e,r,n,s=jo.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=r instanceof Xe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Xe._)`${i}.length`,a=>{this.var(o,(0,Xe._)`${i}[${a}]`),n(o)})}return this._for(new uv("of",s,o,r),()=>n(o))}forIn(e,r,n,s=this.opts.es5?jo.varKinds.var:jo.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Xe._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new uv("in",s,o,r),()=>n(o))}endFor(){return this._endBlockNode(Cd)}label(e){return this._leafNode(new l2(e))}break(e){return this._leafNode(new c2(e))}return(e){let r=new Ey;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ey)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new h2;if(this._blockNode(s),this.code(e),r){let o=this.name("e");this._currNode=s.catch=new yy(o),r(o)}return n&&(this._currNode=s.finally=new Sy,this.code(n)),this._endBlockNode(yy,Sy)}throw(e){return this._leafNode(new u2(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Xe.nil,n,s){return this._blockNode(new _y(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(_y)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof wd))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};He.CodeGen=g2;function vd(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function dv(t,e){return e instanceof Xe._CodeOrName?vd(t,e.names):t}function Df(t,e,r){if(t instanceof Xe.Name)return n(t);if(!s(t))return t;return new Xe._Code(t._items.reduce((o,i)=>(i instanceof Xe.Name&&(i=n(i)),i instanceof Xe._Code?o.push(...i._items):o.push(i),o),[]));function n(o){let i=r[o.str];return i===void 0||e[o.str]!==1?o:(delete e[o.str],i)}function s(o){return o instanceof Xe._Code&&o._items.some(i=>i instanceof Xe.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function K6e(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Ble(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Xe._)`!${_2(t)}`}He.not=Ble;var V6e=Gle(He.operators.AND);function Q6e(...t){return t.reduce(V6e)}He.and=Q6e;var X6e=Gle(He.operators.OR);function J6e(...t){return t.reduce(X6e)}He.or=J6e;function Gle(t){return(e,r)=>e===Xe.nil?r:r===Xe.nil?e:(0,Xe._)`${_2(e)} ${t} ${_2(r)}`}function _2(t){return t instanceof Xe.Name?t:(0,Xe._)`(${t})`}});var rt=w(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.checkStrictMode=Ye.getErrorPath=Ye.Type=Ye.useFunc=Ye.setEvaluated=Ye.evaluatedPropsToName=Ye.mergeEvaluated=Ye.eachItem=Ye.unescapeJsonPointer=Ye.escapeJsonPointer=Ye.escapeFragment=Ye.unescapeFragment=Ye.schemaRefOrVal=Ye.schemaHasRulesButRef=Ye.schemaHasRules=Ye.checkUnknownRules=Ye.alwaysValidSchema=Ye.toHash=void 0;var kt=je(),Z6e=hy();function eGe(t){let e={};for(let r of t)e[r]=!0;return e}Ye.toHash=eGe;function tGe(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(qle(t,e),!jle(e,t.self.RULES.all))}Ye.alwaysValidSchema=tGe;function qle(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let o in e)s[o]||Kle(t,`unknown keyword: "${o}"`)}Ye.checkUnknownRules=qle;function jle(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ye.schemaHasRules=jle;function rGe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ye.schemaHasRulesButRef=rGe;function nGe({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,kt._)`${r}`}return(0,kt._)`${t}${e}${(0,kt.getProperty)(n)}`}Ye.schemaRefOrVal=nGe;function sGe(t){return Yle(decodeURIComponent(t))}Ye.unescapeFragment=sGe;function oGe(t){return encodeURIComponent(y2(t))}Ye.escapeFragment=oGe;function y2(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ye.escapeJsonPointer=y2;function Yle(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ye.unescapeJsonPointer=Yle;function iGe(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ye.eachItem=iGe;function zle({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let l=i===void 0?o:i instanceof kt.Name?(o instanceof kt.Name?t(s,o,i):e(s,o,i),i):o instanceof kt.Name?(e(s,i,o),o):r(o,i);return a===kt.Name&&!(l instanceof kt.Name)?n(s,l):l}}Ye.mergeEvaluated={props:zle({mergeNames:(t,e,r)=>t.if((0,kt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,kt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,kt._)`${r} || {}`).code((0,kt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,kt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,kt._)`${r} || {}`),S2(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Wle}),items:zle({mergeNames:(t,e,r)=>t.if((0,kt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,kt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,kt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,kt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Wle(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,kt._)`{}`);return e!==void 0&&S2(t,r,e),r}Ye.evaluatedPropsToName=Wle;function S2(t,e,r){Object.keys(r).forEach(n=>t.assign((0,kt._)`${e}${(0,kt.getProperty)(n)}`,!0))}Ye.setEvaluated=S2;var Hle={};function aGe(t,e){return t.scopeValue("func",{ref:e,code:Hle[e.code]||(Hle[e.code]=new Z6e._Code(e.code))})}Ye.useFunc=aGe;var E2;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(E2||(Ye.Type=E2={}));function lGe(t,e,r){if(t instanceof kt.Name){let n=e===E2.Num;return r?n?(0,kt._)`"[" + ${t} + "]"`:(0,kt._)`"['" + ${t} + "']"`:n?(0,kt._)`"/" + ${t}`:(0,kt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,kt.getProperty)(t).toString():"/"+y2(t)}Ye.getErrorPath=lGe;function Kle(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ye.checkStrictMode=Kle});var Wa=w(b2=>{"use strict";Object.defineProperty(b2,"__esModule",{value:!0});var vn=je(),cGe={data:new vn.Name("data"),valCxt:new vn.Name("valCxt"),instancePath:new vn.Name("instancePath"),parentData:new vn.Name("parentData"),parentDataProperty:new vn.Name("parentDataProperty"),rootData:new vn.Name("rootData"),dynamicAnchors:new vn.Name("dynamicAnchors"),vErrors:new vn.Name("vErrors"),errors:new vn.Name("errors"),this:new vn.Name("this"),self:new vn.Name("self"),scope:new vn.Name("scope"),json:new vn.Name("json"),jsonPos:new vn.Name("jsonPos"),jsonLen:new vn.Name("jsonLen"),jsonPart:new vn.Name("jsonPart")};b2.default=cGe});var by=w(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.extendErrors=kn.resetErrorsCount=kn.reportExtraError=kn.reportError=kn.keyword$DataError=kn.keywordError=void 0;var nt=je(),mv=rt(),zn=Wa();kn.keywordError={message:({keyword:t})=>(0,nt.str)`must pass "${t}" keyword validation`};kn.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,nt.str)`"${t}" keyword must be ${e} ($data)`:(0,nt.str)`"${t}" keyword is invalid ($data)`};function uGe(t,e=kn.keywordError,r,n){let{it:s}=t,{gen:o,compositeRule:i,allErrors:a}=s,l=Xle(t,e,r);n??(i||a)?Vle(o,l):Qle(s,(0,nt._)`[${l}]`)}kn.reportError=uGe;function dGe(t,e=kn.keywordError,r){let{it:n}=t,{gen:s,compositeRule:o,allErrors:i}=n,a=Xle(t,e,r);Vle(s,a),o||i||Qle(n,zn.default.vErrors)}kn.reportExtraError=dGe;function pGe(t,e){t.assign(zn.default.errors,e),t.if((0,nt._)`${zn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,nt._)`${zn.default.vErrors}.length`,e),()=>t.assign(zn.default.vErrors,null)))}kn.resetErrorsCount=pGe;function mGe({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",s,zn.default.errors,a=>{t.const(i,(0,nt._)`${zn.default.vErrors}[${a}]`),t.if((0,nt._)`${i}.instancePath === undefined`,()=>t.assign((0,nt._)`${i}.instancePath`,(0,nt.strConcat)(zn.default.instancePath,o.errorPath))),t.assign((0,nt._)`${i}.schemaPath`,(0,nt.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,nt._)`${i}.schema`,r),t.assign((0,nt._)`${i}.data`,n))})}kn.extendErrors=mGe;function Vle(t,e){let r=t.const("err",e);t.if((0,nt._)`${zn.default.vErrors} === null`,()=>t.assign(zn.default.vErrors,(0,nt._)`[${r}]`),(0,nt._)`${zn.default.vErrors}.push(${r})`),t.code((0,nt._)`${zn.default.errors}++`)}function Qle(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,nt._)`new ${t.ValidationError}(${e})`):(r.assign((0,nt._)`${n}.errors`,e),r.return(!1))}var kd={keyword:new nt.Name("keyword"),schemaPath:new nt.Name("schemaPath"),params:new nt.Name("params"),propertyName:new nt.Name("propertyName"),message:new nt.Name("message"),schema:new nt.Name("schema"),parentSchema:new nt.Name("parentSchema")};function Xle(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,nt._)`{}`:fGe(t,e,r)}function fGe(t,e,r={}){let{gen:n,it:s}=t,o=[hGe(s,r),gGe(t,r)];return _Ge(t,e,o),n.object(...o)}function hGe({errorPath:t},{instancePath:e}){let r=e?(0,nt.str)`${t}${(0,mv.getErrorPath)(e,mv.Type.Str)}`:t;return[zn.default.instancePath,(0,nt.strConcat)(zn.default.instancePath,r)]}function gGe({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,nt.str)`${e}/${t}`;return r&&(s=(0,nt.str)`${s}${(0,mv.getErrorPath)(r,mv.Type.Str)}`),[kd.schemaPath,s]}function _Ge(t,{params:e,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=t,{opts:l,propertyName:c,topSchemaRef:u,schemaPath:d}=a;n.push([kd.keyword,s],[kd.params,typeof e=="function"?e(t):e||(0,nt._)`{}`]),l.messages&&n.push([kd.message,typeof r=="function"?r(t):r]),l.verbose&&n.push([kd.schema,i],[kd.parentSchema,(0,nt._)`${u}${d}`],[zn.default.data,o]),c&&n.push([kd.propertyName,c])}});var Zle=w(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.boolOrEmptySchema=Rf.topBoolOrEmptySchema=void 0;var EGe=by(),yGe=je(),SGe=Wa(),bGe={message:"boolean schema is false"};function TGe(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Jle(t,!1):typeof r=="object"&&r.$async===!0?e.return(SGe.default.data):(e.assign((0,yGe._)`${n}.errors`,null),e.return(!0))}Rf.topBoolOrEmptySchema=TGe;function wGe(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Jle(t)):r.var(e,!0)}Rf.boolOrEmptySchema=wGe;function Jle(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,EGe.reportError)(s,bGe,void 0,e)}});var T2=w(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.getRules=Nf.isJSONType=void 0;var CGe=["string","number","integer","boolean","null","object","array"],vGe=new Set(CGe);function kGe(t){return typeof t=="string"&&vGe.has(t)}Nf.isJSONType=kGe;function AGe(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Nf.getRules=AGe});var w2=w(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.shouldUseRule=wc.shouldUseGroup=wc.schemaHasRulesForType=void 0;function IGe({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&ece(t,n)}wc.schemaHasRulesForType=IGe;function ece(t,e){return e.rules.some(r=>tce(t,r))}wc.shouldUseGroup=ece;function tce(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}wc.shouldUseRule=tce});var Ty=w(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.reportTypeError=An.checkDataTypes=An.checkDataType=An.coerceAndCheckDataType=An.getJSONTypes=An.getSchemaTypes=An.DataType=void 0;var DGe=T2(),RGe=w2(),NGe=by(),Ue=je(),rce=rt(),Of;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Of||(An.DataType=Of={}));function OGe(t){let e=nce(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}An.getSchemaTypes=OGe;function nce(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(DGe.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}An.getJSONTypes=nce;function xGe(t,e){let{gen:r,data:n,opts:s}=t,o=MGe(e,s.coerceTypes),i=e.length>0&&!(o.length===0&&e.length===1&&(0,RGe.schemaHasRulesForType)(t,e[0]));if(i){let a=v2(e,n,s.strictNumbers,Of.Wrong);r.if(a,()=>{o.length?PGe(t,e,o):k2(t)})}return i}An.coerceAndCheckDataType=xGe;var sce=new Set(["string","number","integer","boolean","null"]);function MGe(t,e){return e?t.filter(r=>sce.has(r)||e==="array"&&r==="array"):[]}function PGe(t,e,r){let{gen:n,data:s,opts:o}=t,i=n.let("dataType",(0,Ue._)`typeof ${s}`),a=n.let("coerced",(0,Ue._)`undefined`);o.coerceTypes==="array"&&n.if((0,Ue._)`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,Ue._)`${s}[0]`).assign(i,(0,Ue._)`typeof ${s}`).if(v2(e,s,o.strictNumbers),()=>n.assign(a,s))),n.if((0,Ue._)`${a} !== undefined`);for(let c of r)(sce.has(c)||c==="array"&&o.coerceTypes==="array")&&l(c);n.else(),k2(t),n.endIf(),n.if((0,Ue._)`${a} !== undefined`,()=>{n.assign(s,a),LGe(t,a)});function l(c){switch(c){case"string":n.elseIf((0,Ue._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,Ue._)`"" + ${s}`).elseIf((0,Ue._)`${s} === null`).assign(a,(0,Ue._)`""`);return;case"number":n.elseIf((0,Ue._)`${i} == "boolean" || ${s} === null
1185
1185
  || (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,Ue._)`+${s}`);return;case"integer":n.elseIf((0,Ue._)`${i} === "boolean" || ${s} === null
1186
1186
  || (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,Ue._)`+${s}`);return;case"boolean":n.elseIf((0,Ue._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,Ue._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Ue._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Ue._)`${i} === "string" || ${i} === "number"
1187
- || ${i} === "boolean" || ${s} === null`).assign(a,(0,Ue._)`[${s}]`)}}}function LGe({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ue._)`${e} !== undefined`,()=>t.assign((0,Ue._)`${e}[${r}]`,n))}function C2(t,e,r,n=Of.Correct){let s=n===Of.Correct?Ue.operators.EQ:Ue.operators.NEQ,o;switch(t){case"null":return(0,Ue._)`${e} ${s} null`;case"array":o=(0,Ue._)`Array.isArray(${e})`;break;case"object":o=(0,Ue._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=i((0,Ue._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=i();break;default:return(0,Ue._)`typeof ${e} ${s} ${t}`}return n===Of.Correct?o:(0,Ue.not)(o);function i(a=Ue.nil){return(0,Ue.and)((0,Ue._)`typeof ${e} == "number"`,a,r?(0,Ue._)`isFinite(${e})`:Ue.nil)}}An.checkDataType=C2;function v2(t,e,r,n){if(t.length===1)return C2(t[0],e,r,n);let s,o=(0,rce.toHash)(t);if(o.array&&o.object){let i=(0,Ue._)`typeof ${e} != "object"`;s=o.null?i:(0,Ue._)`!${e} || ${i}`,delete o.null,delete o.array,delete o.object}else s=Ue.nil;o.number&&delete o.integer;for(let i in o)s=(0,Ue.and)(s,C2(i,e,r,n));return s}An.checkDataTypes=v2;var FGe={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ue._)`{type: ${t}}`:(0,Ue._)`{type: ${e}}`};function k2(t){let e=$Ge(t);(0,NGe.reportError)(e,FGe)}An.reportTypeError=k2;function $Ge(t){let{gen:e,data:r,schema:n}=t,s=(0,rce.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var ice=w(fv=>{"use strict";Object.defineProperty(fv,"__esModule",{value:!0});fv.assignDefaults=void 0;var xf=je(),UGe=tt();function BGe(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)oce(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,o)=>oce(t,o,s.default))}fv.assignDefaults=BGe;function oce(t,e,r){let{gen:n,compositeRule:s,data:o,opts:i}=t;if(r===void 0)return;let a=(0,xf._)`${o}${(0,xf.getProperty)(e)}`;if(s){(0,UGe.checkStrictMode)(t,`default is ignored for: ${a}`);return}let l=(0,xf._)`${a} === undefined`;i.useDefaults==="empty"&&(l=(0,xf._)`${l} || ${a} === null || ${a} === ""`),n.if(l,(0,xf._)`${a} = ${(0,xf.stringify)(r)}`)}});var oo=w(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.validateUnion=yt.validateArray=yt.usePattern=yt.callValidateCode=yt.schemaProperties=yt.allSchemaProperties=yt.noPropertyInData=yt.propertyInData=yt.isOwnProperty=yt.hasPropFunc=yt.reportMissingProp=yt.checkMissingProp=yt.checkReportMissingProp=void 0;var Ft=je(),A2=tt(),Cc=Wa(),GGe=tt();function zGe(t,e){let{gen:r,data:n,it:s}=t;r.if(D2(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ft._)`${e}`},!0),t.error()})}yt.checkReportMissingProp=zGe;function HGe({gen:t,data:e,it:{opts:r}},n,s){return(0,Ft.or)(...n.map(o=>(0,Ft.and)(D2(t,e,o,r.ownProperties),(0,Ft._)`${s} = ${o}`)))}yt.checkMissingProp=HGe;function qGe(t,e){t.setParams({missingProperty:e},!0),t.error()}yt.reportMissingProp=qGe;function ace(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ft._)`Object.prototype.hasOwnProperty`})}yt.hasPropFunc=ace;function I2(t,e,r){return(0,Ft._)`${ace(t)}.call(${e}, ${r})`}yt.isOwnProperty=I2;function jGe(t,e,r,n){let s=(0,Ft._)`${e}${(0,Ft.getProperty)(r)} !== undefined`;return n?(0,Ft._)`${s} && ${I2(t,e,r)}`:s}yt.propertyInData=jGe;function D2(t,e,r,n){let s=(0,Ft._)`${e}${(0,Ft.getProperty)(r)} === undefined`;return n?(0,Ft.or)(s,(0,Ft.not)(I2(t,e,r))):s}yt.noPropertyInData=D2;function lce(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}yt.allSchemaProperties=lce;function YGe(t,e){return lce(e).filter(r=>!(0,A2.alwaysValidSchema)(t,e[r]))}yt.schemaProperties=YGe;function WGe({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,l,c){let u=c?(0,Ft._)`${t}, ${e}, ${n}${s}`:e,d=[[Cc.default.instancePath,(0,Ft.strConcat)(Cc.default.instancePath,o)],[Cc.default.parentData,i.parentData],[Cc.default.parentDataProperty,i.parentDataProperty],[Cc.default.rootData,Cc.default.rootData]];i.opts.dynamicRef&&d.push([Cc.default.dynamicAnchors,Cc.default.dynamicAnchors]);let p=(0,Ft._)`${u}, ${r.object(...d)}`;return l!==Ft.nil?(0,Ft._)`${a}.call(${l}, ${p})`:(0,Ft._)`${a}(${p})`}yt.callValidateCode=WGe;var KGe=(0,Ft._)`new RegExp`;function VGe({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,o=s(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Ft._)`${s.code==="new RegExp"?KGe:(0,GGe.useFunc)(t,s)}(${r}, ${n})`})}yt.usePattern=VGe;function QGe(t){let{gen:e,data:r,keyword:n,it:s}=t,o=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(o,!0),i(()=>e.break()),o;function i(a){let l=e.const("len",(0,Ft._)`${r}.length`);e.forRange("i",0,l,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:A2.Type.Num},o),e.if((0,Ft.not)(o),a)})}}yt.validateArray=QGe;function XGe(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,A2.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((l,c)=>{let u=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},a);e.assign(i,(0,Ft._)`${i} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,Ft.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}yt.validateUnion=XGe});var dce=w($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.validateKeywordUsage=$i.validSchemaType=$i.funcKeywordCode=$i.macroKeywordCode=void 0;var Hn=je(),Ad=Wa(),JGe=oo(),ZGe=by();function eze(t,e){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=t,a=e.macro.call(i.self,s,o,i),l=uce(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let c=r.name("valid");t.subschema({schema:a,schemaPath:Hn.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}$i.macroKeywordCode=eze;function tze(t,e){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:l}=t;nze(l,e);let c=!a&&e.compile?e.compile.call(l.self,o,i,l):e.validate,u=uce(n,s,c),d=n.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)g(),e.modifying&&cce(t),_(()=>t.error());else{let E=e.async?h():f();e.modifying&&cce(t),_(()=>rze(t,E))}}function h(){let E=n.let("ruleErrs",null);return n.try(()=>g((0,Hn._)`await `),y=>n.assign(d,!1).if((0,Hn._)`${y} instanceof ${l.ValidationError}`,()=>n.assign(E,(0,Hn._)`${y}.errors`),()=>n.throw(y))),E}function f(){let E=(0,Hn._)`${u}.errors`;return n.assign(E,null),g(Hn.nil),E}function g(E=e.async?(0,Hn._)`await `:Hn.nil){let y=l.opts.passContext?Ad.default.this:Ad.default.self,S=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Hn._)`${E}${(0,JGe.callValidateCode)(t,u,y,S)}`,e.modifying)}function _(E){var y;n.if((0,Hn.not)((y=e.valid)!==null&&y!==void 0?y:d),E)}}$i.funcKeywordCode=tze;function cce(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Hn._)`${n.parentData}[${n.parentDataProperty}]`))}function rze(t,e){let{gen:r}=t;r.if((0,Hn._)`Array.isArray(${e})`,()=>{r.assign(Ad.default.vErrors,(0,Hn._)`${Ad.default.vErrors} === null ? ${e} : ${Ad.default.vErrors}.concat(${e})`).assign(Ad.default.errors,(0,Hn._)`${Ad.default.vErrors}.length`),(0,ZGe.extendErrors)(t)},()=>t.error())}function nze({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function uce(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Hn.stringify)(r)})}function sze(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}$i.validSchemaType=sze;function oze({schema:t,opts:e,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");let i=s.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[o])){let l=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}$i.validateKeywordUsage=oze});var mce=w(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.extendSubschemaMode=vc.extendSubschemaData=vc.getSubschema=void 0;var Ui=je(),pce=tt();function ize(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ui._)`${t.schemaPath}${(0,Ui.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ui._)`${t.schemaPath}${(0,Ui.getProperty)(e)}${(0,Ui.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,pce.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}vc.getSubschema=ize;function aze(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:c,dataPathArr:u,opts:d}=e,p=a.let("data",(0,Ui._)`${e.data}${(0,Ui.getProperty)(r)}`,!0);l(p),t.errorPath=(0,Ui.str)`${c}${(0,pce.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ui._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(s!==void 0){let c=s instanceof Ui.Name?s:a.let("data",s,!0);l(c),i!==void 0&&(t.propertyName=i)}o&&(t.dataTypes=o);function l(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}vc.extendSubschemaData=aze;function lze(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}vc.extendSubschemaMode=lze});var R2=w((FTt,fce)=>{"use strict";fce.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var gce=w(($Tt,hce)=>{"use strict";var kc=hce.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};hv(e,n,s,t,"",t)};kc.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};kc.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};kc.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};kc.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function hv(t,e,r,n,s,o,i,a,l,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,o,i,a,l,c);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in kc.arrayKeywords)for(var p=0;p<d.length;p++)hv(t,e,r,d[p],s+"/"+u+"/"+p,o,s,u,n,p)}else if(u in kc.propsKeywords){if(d&&typeof d=="object")for(var h in d)hv(t,e,r,d[h],s+"/"+u+"/"+cze(h),o,s,u,n,h)}else(u in kc.keywords||t.allKeys&&!(u in kc.skipKeywords))&&hv(t,e,r,d,s+"/"+u,o,s,u,n)}r(n,s,o,i,a,l,c)}}function cze(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var wy=w(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.getSchemaRefs=cs.resolveUrl=cs.normalizeId=cs._getFullPath=cs.getFullPath=cs.inlineRef=void 0;var uze=tt(),dze=R2(),pze=gce(),mze=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fze(t,e=!0){return typeof t=="boolean"?!0:e===!0?!N2(t):e?_ce(t)<=e:!1}cs.inlineRef=fze;var hze=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function N2(t){for(let e in t){if(hze.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(N2)||typeof r=="object"&&N2(r))return!0}return!1}function _ce(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!mze.has(r)&&(typeof t[r]=="object"&&(0,uze.eachItem)(t[r],n=>e+=_ce(n)),e===1/0))return 1/0}return e}function Ece(t,e="",r){r!==!1&&(e=Mf(e));let n=t.parse(e);return yce(t,n)}cs.getFullPath=Ece;function yce(t,e){return t.serialize(e).split("#")[0]+"#"}cs._getFullPath=yce;var gze=/#\/?$/;function Mf(t){return t?t.replace(gze,""):""}cs.normalizeId=Mf;function _ze(t,e,r){return r=Mf(r),t.resolve(e,r)}cs.resolveUrl=_ze;var Eze=/^[a-z_][-a-z0-9._]*$/i;function yze(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Mf(t[r]||e),o={"":s},i=Ece(n,s,!1),a={},l=new Set;return pze(t,{allKeys:!0},(d,p,h,f)=>{if(f===void 0)return;let g=i+p,_=o[f];typeof d[r]=="string"&&(_=E.call(this,d[r])),y.call(this,d.$anchor),y.call(this,d.$dynamicAnchor),o[p]=_;function E(S){let T=this.opts.uriResolver.resolve;if(S=Mf(_?T(_,S):S),l.has(S))throw u(S);l.add(S);let C=this.refs[S];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?c(d,C.schema,S):S!==Mf(g)&&(S[0]==="#"?(c(d,a[S],S),a[S]=d):this.refs[S]=g),S}function y(S){if(typeof S=="string"){if(!Eze.test(S))throw new Error(`invalid anchor "${S}"`);E.call(this,`#${S}`)}}}),a;function c(d,p,h){if(p!==void 0&&!dze(d,p))throw u(h)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}cs.getSchemaRefs=yze});var ky=w(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.getData=Ac.KeywordCxt=Ac.validateFunctionCode=void 0;var Cce=Zle(),Sce=Ty(),x2=w2(),gv=Ty(),Sze=ice(),vy=dce(),O2=mce(),we=je(),Me=Wa(),bze=wy(),Ka=tt(),Cy=by();function Tze(t){if(Ace(t)&&(Ice(t),kce(t))){vze(t);return}vce(t,()=>(0,Cce.topBoolOrEmptySchema)(t))}Ac.validateFunctionCode=Tze;function vce({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},o){s.code.es5?t.func(e,(0,we._)`${Me.default.data}, ${Me.default.valCxt}`,n.$async,()=>{t.code((0,we._)`"use strict"; ${bce(r,s)}`),Cze(t,s),t.code(o)}):t.func(e,(0,we._)`${Me.default.data}, ${wze(s)}`,n.$async,()=>t.code(bce(r,s)).code(o))}function wze(t){return(0,we._)`{${Me.default.instancePath}="", ${Me.default.parentData}, ${Me.default.parentDataProperty}, ${Me.default.rootData}=${Me.default.data}${t.dynamicRef?(0,we._)`, ${Me.default.dynamicAnchors}={}`:we.nil}}={}`}function Cze(t,e){t.if(Me.default.valCxt,()=>{t.var(Me.default.instancePath,(0,we._)`${Me.default.valCxt}.${Me.default.instancePath}`),t.var(Me.default.parentData,(0,we._)`${Me.default.valCxt}.${Me.default.parentData}`),t.var(Me.default.parentDataProperty,(0,we._)`${Me.default.valCxt}.${Me.default.parentDataProperty}`),t.var(Me.default.rootData,(0,we._)`${Me.default.valCxt}.${Me.default.rootData}`),e.dynamicRef&&t.var(Me.default.dynamicAnchors,(0,we._)`${Me.default.valCxt}.${Me.default.dynamicAnchors}`)},()=>{t.var(Me.default.instancePath,(0,we._)`""`),t.var(Me.default.parentData,(0,we._)`undefined`),t.var(Me.default.parentDataProperty,(0,we._)`undefined`),t.var(Me.default.rootData,Me.default.data),e.dynamicRef&&t.var(Me.default.dynamicAnchors,(0,we._)`{}`)})}function vze(t){let{schema:e,opts:r,gen:n}=t;vce(t,()=>{r.$comment&&e.$comment&&Rce(t),Rze(t),n.let(Me.default.vErrors,null),n.let(Me.default.errors,0),r.unevaluated&&kze(t),Dce(t),xze(t)})}function kze(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,we._)`${r}.evaluated`),e.if((0,we._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,we._)`${t.evaluated}.props`,(0,we._)`undefined`)),e.if((0,we._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,we._)`${t.evaluated}.items`,(0,we._)`undefined`))}function bce(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,we._)`/*# sourceURL=${r} */`:we.nil}function Aze(t,e){if(Ace(t)&&(Ice(t),kce(t))){Ize(t,e);return}(0,Cce.boolOrEmptySchema)(t,e)}function kce({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Ace(t){return typeof t.schema!="boolean"}function Ize(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&Rce(t),Nze(t),Oze(t);let o=n.const("_errs",Me.default.errors);Dce(t,o),n.var(e,(0,we._)`${o} === ${Me.default.errors}`)}function Ice(t){(0,Ka.checkUnknownRules)(t),Dze(t)}function Dce(t,e){if(t.opts.jtd)return Tce(t,[],!1,e);let r=(0,Sce.getSchemaTypes)(t.schema),n=(0,Sce.coerceAndCheckDataType)(t,r);Tce(t,r,!n,e)}function Dze(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ka.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Rze(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ka.checkStrictMode)(t,"default is ignored in the schema root")}function Nze(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,bze.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Oze(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Rce({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)t.code((0,we._)`${Me.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let i=(0,we.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,we._)`${Me.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function xze(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=t;r.$async?e.if((0,we._)`${Me.default.errors} === 0`,()=>e.return(Me.default.data),()=>e.throw((0,we._)`new ${s}(${Me.default.vErrors})`)):(e.assign((0,we._)`${n}.errors`,Me.default.vErrors),o.unevaluated&&Mze(t),e.return((0,we._)`${Me.default.errors} === 0`))}function Mze({gen:t,evaluated:e,props:r,items:n}){r instanceof we.Name&&t.assign((0,we._)`${e}.props`,r),n instanceof we.Name&&t.assign((0,we._)`${e}.items`,n)}function Tce(t,e,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:l,self:c}=t,{RULES:u}=c;if(o.$ref&&(l.ignoreKeywordsWithRef||!(0,Ka.schemaHasRulesButRef)(o,u))){s.block(()=>Oce(t,"$ref",u.all.$ref.definition));return}l.jtd||Pze(t,e),s.block(()=>{for(let p of u.rules)d(p);d(u.post)});function d(p){(0,x2.shouldUseGroup)(o,p)&&(p.type?(s.if((0,gv.checkDataType)(p.type,i,l.strictNumbers)),wce(t,p),e.length===1&&e[0]===p.type&&r&&(s.else(),(0,gv.reportTypeError)(t)),s.endIf()):wce(t,p),a||s.if((0,we._)`${Me.default.errors} === ${n||0}`))}}function wce(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,Sze.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,x2.shouldUseRule)(n,o)&&Oce(t,o.keyword,o.definition,e.type)})}function Pze(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Lze(t,e),t.opts.allowUnionTypes||Fze(t,e),$ze(t,t.dataTypes))}function Lze(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Nce(t.dataTypes,r)||M2(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Bze(t,e)}}function Fze(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&M2(t,"use allowUnionTypes to allow union type keyword")}function $ze(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,x2.shouldUseRule)(t.schema,s)){let{type:o}=s.definition;o.length&&!o.some(i=>Uze(e,i))&&M2(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Uze(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Nce(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Bze(t,e){let r=[];for(let n of t.dataTypes)Nce(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function M2(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ka.checkStrictMode)(t,e,t.opts.strictTypes)}var _v=class{constructor(e,r,n){if((0,vy.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ka.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",xce(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,vy.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Me.default.errors))}result(e,r,n){this.failResult((0,we.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,we.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,we._)`${r} !== undefined && (${(0,we.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Cy.reportExtraError:Cy.reportError)(this,this.def.error,r)}$dataError(){(0,Cy.reportError)(this,this.def.$dataError||Cy.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Cy.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=we.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=we.nil,r=we.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:o,def:i}=this;n.if((0,we.or)((0,we._)`${s} === undefined`,r)),e!==we.nil&&n.assign(e,!0),(o.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==we.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:o}=this;return(0,we.or)(i(),a());function i(){if(n.length){if(!(r instanceof we.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,we._)`${(0,gv.checkDataTypes)(l,r,o.opts.strictNumbers,gv.DataType.Wrong)}`}return we.nil}function a(){if(s.validateSchema){let l=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,we._)`!${l}(${r})`}return we.nil}}subschema(e,r){let n=(0,O2.getSubschema)(this.it,e);(0,O2.extendSubschemaData)(n,this.it,e),(0,O2.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return Aze(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ka.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ka.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,we.Name)),!0}};Ac.KeywordCxt=_v;function Oce(t,e,r,n){let s=new _v(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,vy.funcKeywordCode)(s,r):"macro"in r?(0,vy.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,vy.funcKeywordCode)(s,r)}var Gze=/^\/(?:[^~]|~0|~1)*$/,zze=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function xce(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,o;if(t==="")return Me.default.rootData;if(t[0]==="/"){if(!Gze.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,o=Me.default.rootData}else{let c=zze.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+c[1];if(s=c[2],s==="#"){if(u>=e)throw new Error(l("property/index",u));return n[e-u]}if(u>e)throw new Error(l("data",u));if(o=r[e-u],!s)return o}let i=o,a=s.split("/");for(let c of a)c&&(o=(0,we._)`${o}${(0,we.getProperty)((0,Ka.unescapeJsonPointer)(c))}`,i=(0,we._)`${i} && ${o}`);return i;function l(c,u){return`Cannot access ${c} ${u} levels up, current level is ${e}`}}Ac.getData=xce});var Ev=w(L2=>{"use strict";Object.defineProperty(L2,"__esModule",{value:!0});var P2=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};L2.default=P2});var Ay=w(U2=>{"use strict";Object.defineProperty(U2,"__esModule",{value:!0});var F2=wy(),$2=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,F2.resolveUrl)(e,r,n),this.missingSchema=(0,F2.normalizeId)((0,F2.getFullPath)(e,this.missingRef))}};U2.default=$2});var Sv=w(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.resolveSchema=io.getCompilingSchema=io.resolveRef=io.compileSchema=io.SchemaEnv=void 0;var Yo=je(),Hze=Ev(),Id=Wa(),Wo=wy(),Mce=tt(),qze=ky(),Pf=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Wo.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};io.SchemaEnv=Pf;function G2(t){let e=Pce.call(this,t);if(e)return e;let r=(0,Wo.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Yo.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;t.$async&&(a=i.scopeValue("Error",{ref:Hze.default,code:(0,Yo._)`require("ajv/dist/runtime/validation_error").default`}));let l=i.scopeName("validate");t.validateName=l;let c={gen:i,allErrors:this.opts.allErrors,data:Id.default.data,parentData:Id.default.parentData,parentDataProperty:Id.default.parentDataProperty,dataNames:[Id.default.data],dataPathArr:[Yo.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Yo.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Yo.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Yo._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,qze.validateFunctionCode)(c),i.optimize(this.opts.code.optimize);let d=i.toString();u=`${i.scopeRefs(Id.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let h=new Function(`${Id.default.self}`,`${Id.default.scope}`,u)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:g}=c;h.evaluated={props:f instanceof Yo.Name?void 0:f,items:g instanceof Yo.Name?void 0:g,dynamicProps:f instanceof Yo.Name,dynamicItems:g instanceof Yo.Name},h.source&&(h.source.evaluated=(0,Yo.stringify)(h.evaluated))}return t.validate=h,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}io.compileSchema=G2;function jze(t,e,r){var n;r=(0,Wo.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let o=Kze.call(this,t,r);if(o===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(o=new Pf({schema:i,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=Yze.call(this,o)}io.resolveRef=jze;function Yze(t){return(0,Wo.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:G2.call(this,t)}function Pce(t){for(let e of this._compilations)if(Wze(e,t))return e}io.getCompilingSchema=Pce;function Wze(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Kze(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||yv.call(this,t,e)}function yv(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Wo._getFullPath)(this.opts.uriResolver,r),s=(0,Wo.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return B2.call(this,r,t);let o=(0,Wo.normalizeId)(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=yv.call(this,t,i);return typeof a?.schema!="object"?void 0:B2.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||G2.call(this,i),o===(0,Wo.normalizeId)(e)){let{schema:a}=i,{schemaId:l}=this.opts,c=a[l];return c&&(s=(0,Wo.resolveUrl)(this.opts.uriResolver,s,c)),new Pf({schema:a,schemaId:l,root:t,baseId:s})}return B2.call(this,r,i)}}io.resolveSchema=yv;var Vze=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function B2(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,Mce.unescapeFragment)(a)];if(l===void 0)return;r=l;let c=typeof r=="object"&&r[this.opts.schemaId];!Vze.has(a)&&c&&(e=(0,Wo.resolveUrl)(this.opts.uriResolver,e,c))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,Mce.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Wo.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=yv.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new Pf({schema:r,schemaId:i,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var Lce=w((qTt,Qze)=>{Qze.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var q2=w((jTt,zce)=>{"use strict";var Xze=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),$ce=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),z2=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Uce=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Jze=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function H2(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var Zze=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Fce(t){return t.length=0,!0}function e7e(t,e,r){if(t.length){let n=H2(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function t7e(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,i=!1,a=e7e;for(let l=0;l<t.length;l++){let c=t[l];if(!(c==="["||c==="]"))if(c===":"){if(o===!0&&(i=!0),!a(s,n,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(o=!0),n.push(":");continue}else if(c==="%"){if(!a(s,n,r))break;a=Fce}else{s.push(c);continue}}return s.length&&(a===Fce?r.zone=s.join(""):i?n.push(s.join("")):n.push(H2(s))),r.address=n.join(""),r}function Bce(t){if(r7e(t,":")<2)return{host:t,isIPV6:!1};let e=t7e(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function r7e(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function n7e(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(s===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var s7e={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},o7e=/[@/?#:]/g,i7e=/[@/?#]/g;function Gce(t,e){let r=e?i7e:o7e;return r.lastIndex=0,t.replace(r,n=>s7e[n])}function a7e(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let s=t.slice(n+1,n+3);if(z2(s)){let o=s.toUpperCase(),i=String.fromCharCode(parseInt(o,16));e&&Uce(i)?r+=i:r+="%"+o,n+=2;continue}}r+=t[n]}return r}function l7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(z2(n)){let s=n.toUpperCase(),o=String.fromCharCode(parseInt(s,16));o!=="."&&Uce(o)?e+=o:e+="%"+s,r+=2;continue}}Jze(t[r])?e+=t[r]:e+=escape(t[r])}return e}function c7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(z2(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function u7e(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!$ce(r)){let n=Bce(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Gce(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}zce.exports={nonSimpleDomain:Zze,recomposeAuthority:u7e,reescapeHostDelimiters:Gce,normalizePercentEncoding:a7e,normalizePathEncoding:l7e,escapePreservingEscapes:c7e,removeDotSegments:n7e,isIPv4:$ce,isUUID:Xze,normalizeIPv6:Bce,stringArrayToHexStripped:H2}});var Wce=w((YTt,Yce)=>{"use strict";var{isUUID:d7e}=q2(),p7e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,m7e=["http","https","ws","wss","urn","urn:uuid"];function f7e(t){return m7e.indexOf(t)!==-1}function j2(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function Hce(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function qce(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function h7e(t){return t.secure=j2(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function g7e(t){if((t.port===(j2(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function _7e(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(p7e);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,o=Y2(s);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function E7e(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,o=Y2(s);o&&(t=o.serialize(t,e));let i=t,a=t.nss;return i.path=`${n||e.nid}:${a}`,e.skipEscape=!0,i}function y7e(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!d7e(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function S7e(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var jce={scheme:"http",domainHost:!0,parse:Hce,serialize:qce},b7e={scheme:"https",domainHost:jce.domainHost,parse:Hce,serialize:qce},bv={scheme:"ws",domainHost:!0,parse:h7e,serialize:g7e},T7e={scheme:"wss",domainHost:bv.domainHost,parse:bv.parse,serialize:bv.serialize},w7e={scheme:"urn",parse:_7e,serialize:E7e,skipNormalize:!0},C7e={scheme:"urn:uuid",parse:y7e,serialize:S7e,skipNormalize:!0},Tv={http:jce,https:b7e,ws:bv,wss:T7e,urn:w7e,"urn:uuid":C7e};Object.setPrototypeOf(Tv,null);function Y2(t){return t&&(Tv[t]||Tv[t.toLowerCase()])||void 0}Yce.exports={wsIsSecure:j2,SCHEMES:Tv,isValidSchemeName:f7e,getSchemeHandler:Y2}});var Jce=w((WTt,vv)=>{"use strict";var{normalizeIPv6:v7e,removeDotSegments:Iy,recomposeAuthority:k7e,normalizePercentEncoding:A7e,normalizePathEncoding:I7e,escapePreservingEscapes:D7e,reescapeHostDelimiters:R7e,isIPv4:N7e,nonSimpleDomain:O7e}=q2(),{SCHEMES:x7e,getSchemeHandler:Vce}=Wce();function M7e(t,e){return typeof t=="string"?t=G7e(t,e):typeof t=="object"&&(t=Cv(Dd(t,e),e)),t}function P7e(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:s,malformedAuthorityOrPort:o}=wv(t,n),{parsed:i,malformedAuthorityOrPort:a}=wv(e,n);if(o||a)throw new Error(s.error||i.error||"URI is malformed.");let l=Qce(s,i,n,!0);return n.skipEscape=!0,Dd(l,n)}function Qce(t,e,r,n){let s={};return n||(t=Cv(Dd(t,r),r),e=Cv(Dd(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=Iy(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=Iy(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=Iy(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=Iy(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function L7e(t,e,r){let n=Kce(t,r),s=Kce(e,r);return n!==void 0&&s!==void 0&&n.toLowerCase()===s.toLowerCase()}function Dd(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),s=[],o=Vce(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=A7e(r.path):(r.path=D7e(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let i=k7e(r);if(i!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(i),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=Iy(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var F7e=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,$7e=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,U7e=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function B7e(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function wv(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match($7e);i!==null&&i[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",s=!0);let a=t.match(U7e);if(a!==null){let c=a[1],u=c.replace(/[\t\n\r]/g,"");u.length>=2&&(u.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",s=!0):c.length!==u.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",s=!0))}let l=t.match(F7e);if(l){n.scheme=l[1],n.userinfo=l[3],n.host=l[4],n.port=parseInt(l[5],10),n.path=l[6]||"",n.query=l[7],n.fragment=l[8],isNaN(n.port)&&(n.port=l[5]);let c=B7e(n,l);if(c!==void 0&&(n.error=n.error||c,s=!0),n.host)if(N7e(n.host)===!1){let p=v7e(n.host);n.host=p.host.toLowerCase(),o=p.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let u=Vce(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&o===!1&&O7e(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=R7e(unescape(n.host),o))),n.path&&(n.path=I7e(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s}}function Cv(t,e){return wv(t,e).parsed}function G7e(t,e){return Xce(t,e).normalized}function Xce(t,e){let{parsed:r,malformedAuthorityOrPort:n}=wv(t,e);return{normalized:n?t:Dd(r,e),malformedAuthorityOrPort:n}}function Kce(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Xce(t,e);return n?void 0:r}if(typeof t=="object")return Dd(t,e)}var W2={SCHEMES:x7e,normalize:M7e,resolve:P7e,resolveComponent:Qce,equal:L7e,serialize:Dd,parse:Cv};vv.exports=W2;vv.exports.default=W2;vv.exports.fastUri=W2});var eue=w(K2=>{"use strict";Object.defineProperty(K2,"__esModule",{value:!0});var Zce=Jce();Zce.code='require("ajv/dist/runtime/uri").default';K2.default=Zce});var lue=w(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.CodeGen=Xr.Name=Xr.nil=Xr.stringify=Xr.str=Xr._=Xr.KeywordCxt=void 0;var z7e=ky();Object.defineProperty(Xr,"KeywordCxt",{enumerable:!0,get:function(){return z7e.KeywordCxt}});var Lf=je();Object.defineProperty(Xr,"_",{enumerable:!0,get:function(){return Lf._}});Object.defineProperty(Xr,"str",{enumerable:!0,get:function(){return Lf.str}});Object.defineProperty(Xr,"stringify",{enumerable:!0,get:function(){return Lf.stringify}});Object.defineProperty(Xr,"nil",{enumerable:!0,get:function(){return Lf.nil}});Object.defineProperty(Xr,"Name",{enumerable:!0,get:function(){return Lf.Name}});Object.defineProperty(Xr,"CodeGen",{enumerable:!0,get:function(){return Lf.CodeGen}});var H7e=Ev(),oue=Ay(),q7e=T2(),Dy=Sv(),j7e=je(),Ry=wy(),kv=Ty(),Q2=tt(),tue=Lce(),Y7e=eue(),iue=(t,e)=>new RegExp(t,e);iue.code="new RegExp";var W7e=["removeAdditional","useDefaults","coerceTypes"],K7e=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),V7e={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Q7e={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},rue=200;function X7e(t){var e,r,n,s,o,i,a,l,c,u,d,p,h,f,g,_,E,y,S,T,C,v,A,D,I;let x=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,$=B===!0||B===void 0?1:B||0,L=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:iue,q=(s=t.uriResolver)!==null&&s!==void 0?s:Y7e.default;return{strictSchema:(i=(o=t.strictSchema)!==null&&o!==void 0?o:x)!==null&&i!==void 0?i:!0,strictNumbers:(l=(a=t.strictNumbers)!==null&&a!==void 0?a:x)!==null&&l!==void 0?l:!0,strictTypes:(u=(c=t.strictTypes)!==null&&c!==void 0?c:x)!==null&&u!==void 0?u:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:x)!==null&&p!==void 0?p:"log",strictRequired:(f=(h=t.strictRequired)!==null&&h!==void 0?h:x)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:$,regExp:L}:{optimize:$,regExp:L},loopRequired:(g=t.loopRequired)!==null&&g!==void 0?g:rue,loopEnum:(_=t.loopEnum)!==null&&_!==void 0?_:rue,meta:(E=t.meta)!==null&&E!==void 0?E:!0,messages:(y=t.messages)!==null&&y!==void 0?y:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(v=t.validateSchema)!==null&&v!==void 0?v:!0,validateFormats:(A=t.validateFormats)!==null&&A!==void 0?A:!0,unicodeRegExp:(D=t.unicodeRegExp)!==null&&D!==void 0?D:!0,int32range:(I=t.int32range)!==null&&I!==void 0?I:!0,uriResolver:q}}var Ny=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...X7e(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new j7e.ValueScope({scope:{},prefixes:K7e,es5:r,lines:n}),this.logger=nHe(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,q7e.getRules)(),nue.call(this,V7e,e,"NOT SUPPORTED"),nue.call(this,Q7e,e,"DEPRECATED","warn"),this._metaOpts=tHe.call(this),e.formats&&Z7e.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&eHe.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),J7e.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=tue;n==="id"&&(s={...tue},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(u,d){await o.call(this,u.$schema);let p=this._addSchema(u,d);return p.validate||i.call(this,p)}async function o(u){u&&!this.getSchema(u)&&await s.call(this,{$ref:u},!0)}async function i(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof oue.default))throw d;return a.call(this,d),await l.call(this,d.missingSchema),i.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function l(u){let d=await c.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function c(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,s);return this}let o;if(typeof e=="object"){let{schemaId:i}=this.opts;if(o=e[i],o!==void 0&&typeof o!="string")throw new Error(`schema ${i} must be string`)}return r=(0,Ry.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return s}getSchema(e){let r;for(;typeof(r=sue.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new Dy.SchemaEnv({schema:{},schemaId:n});if(r=Dy.resolveSchema.call(this,s,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=sue.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Ry.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(oHe.call(this,n,r),!r)return(0,Q2.eachItem)(n,o=>V2.call(this,o)),this;aHe.call(this,r);let s={...r,type:(0,kv.getJSONTypes)(r.type),schemaType:(0,kv.getJSONTypes)(r.schemaType)};return(0,Q2.eachItem)(n,s.type.length===0?o=>V2.call(this,o,s):o=>s.type.forEach(i=>V2.call(this,o,s,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let s=n.rules.findIndex(o=>o.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,o)=>s+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let o=s.split("/").slice(1),i=e;for(let a of o)i=i[a];for(let a in n){let l=n[a];if(typeof l!="object")continue;let{$data:c}=l.definition,u=i[a];c&&u&&(i[a]=aue(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=this.opts.validateSchema,o=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(l!==void 0)return l;n=(0,Ry.normalizeId)(i||n);let c=Ry.getSchemaRefs.call(this,e,n);return l=new Dy.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:c}),this._cache.set(l.schema,l),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),s&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Dy.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Dy.compileSchema.call(this,e)}finally{this.opts=r}}};Ny.ValidationError=H7e.default;Ny.MissingRefError=oue.default;Xr.default=Ny;function nue(t,e,r,n="error"){for(let s in t){let o=s;o in e&&this.logger[n](`${r}: option ${s}. ${t[o]}`)}}function sue(t){return t=(0,Ry.normalizeId)(t),this.schemas[t]||this.refs[t]}function J7e(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Z7e(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function eHe(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function tHe(){let t={...this.opts};for(let e of W7e)delete t[e];return t}var rHe={log(){},warn(){},error(){}};function nHe(t){if(t===!1)return rHe;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var sHe=/^[a-z_$][a-z0-9_$:-]*$/i;function oHe(t,e){let{RULES:r}=this;if((0,Q2.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!sHe.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function V2(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,i=s?o.post:o.rules.find(({type:l})=>l===r);if(i||(i={type:r,rules:[]},o.rules.push(i)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,kv.getJSONTypes)(e.type),schemaType:(0,kv.getJSONTypes)(e.schemaType)}};e.before?iHe.call(this,i,a,e.before):i.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function iHe(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function aHe(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=aue(e)),t.validateSchema=this.compile(e,!0))}var lHe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function aue(t){return{anyOf:[t,lHe]}}});var cue=w(X2=>{"use strict";Object.defineProperty(X2,"__esModule",{value:!0});var cHe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};X2.default=cHe});var mue=w(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.callRef=Rd.getValidate=void 0;var uHe=Ay(),uue=oo(),us=je(),Ff=Wa(),due=Sv(),Av=tt(),dHe={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:l}=n,{root:c}=o;if((r==="#"||r==="#/")&&s===c.baseId)return d();let u=due.resolveRef.call(l,c,s,r);if(u===void 0)throw new uHe.default(n.opts.uriResolver,s,r);if(u instanceof due.SchemaEnv)return p(u);return h(u);function d(){if(o===c)return Iv(t,i,o,o.$async);let f=e.scopeValue("root",{ref:c});return Iv(t,(0,us._)`${f}.validate`,c,c.$async)}function p(f){let g=pue(t,f);Iv(t,g,f,f.$async)}function h(f){let g=e.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,us.stringify)(f)}:{ref:f}),_=e.name("valid"),E=t.subschema({schema:f,dataTypes:[],schemaPath:us.nil,topSchemaRef:g,errSchemaPath:r},_);t.mergeEvaluated(E),t.ok(_)}}};function pue(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,us._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Rd.getValidate=pue;function Iv(t,e,r,n){let{gen:s,it:o}=t,{allErrors:i,schemaEnv:a,opts:l}=o,c=l.passContext?Ff.default.this:us.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=s.let("valid");s.try(()=>{s.code((0,us._)`await ${(0,uue.callValidateCode)(t,e,c)}`),h(e),i||s.assign(f,!0)},g=>{s.if((0,us._)`!(${g} instanceof ${o.ValidationError})`,()=>s.throw(g)),p(g),i||s.assign(f,!1)}),t.ok(f)}function d(){t.result((0,uue.callValidateCode)(t,e,c),()=>h(e),()=>p(e))}function p(f){let g=(0,us._)`${f}.errors`;s.assign(Ff.default.vErrors,(0,us._)`${Ff.default.vErrors} === null ? ${g} : ${Ff.default.vErrors}.concat(${g})`),s.assign(Ff.default.errors,(0,us._)`${Ff.default.vErrors}.length`)}function h(f){var g;if(!o.opts.unevaluated)return;let _=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(o.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(o.props=Av.mergeEvaluated.props(s,_.props,o.props));else{let E=s.var("props",(0,us._)`${f}.evaluated.props`);o.props=Av.mergeEvaluated.props(s,E,o.props,us.Name)}if(o.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(o.items=Av.mergeEvaluated.items(s,_.items,o.items));else{let E=s.var("items",(0,us._)`${f}.evaluated.items`);o.items=Av.mergeEvaluated.items(s,E,o.items,us.Name)}}}Rd.callRef=Iv;Rd.default=dHe});var fue=w(J2=>{"use strict";Object.defineProperty(J2,"__esModule",{value:!0});var pHe=cue(),mHe=mue(),fHe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",pHe.default,mHe.default];J2.default=fHe});var hue=w(Z2=>{"use strict";Object.defineProperty(Z2,"__esModule",{value:!0});var Dv=je(),Ic=Dv.operators,Rv={maximum:{okStr:"<=",ok:Ic.LTE,fail:Ic.GT},minimum:{okStr:">=",ok:Ic.GTE,fail:Ic.LT},exclusiveMaximum:{okStr:"<",ok:Ic.LT,fail:Ic.GTE},exclusiveMinimum:{okStr:">",ok:Ic.GT,fail:Ic.LTE}},hHe={message:({keyword:t,schemaCode:e})=>(0,Dv.str)`must be ${Rv[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Dv._)`{comparison: ${Rv[t].okStr}, limit: ${e}}`},gHe={keyword:Object.keys(Rv),type:"number",schemaType:"number",$data:!0,error:hHe,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Dv._)`${r} ${Rv[e].fail} ${n} || isNaN(${r})`)}};Z2.default=gHe});var gue=w(e$=>{"use strict";Object.defineProperty(e$,"__esModule",{value:!0});var Oy=je(),_He={message:({schemaCode:t})=>(0,Oy.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Oy._)`{multipleOf: ${t}}`},EHe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:_He,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,o=s.opts.multipleOfPrecision,i=e.let("res"),a=o?(0,Oy._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:(0,Oy._)`${i} !== parseInt(${i})`;t.fail$data((0,Oy._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};e$.default=EHe});var Eue=w(t$=>{"use strict";Object.defineProperty(t$,"__esModule",{value:!0});function _ue(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}t$.default=_ue;_ue.code='require("ajv/dist/runtime/ucs2length").default'});var yue=w(r$=>{"use strict";Object.defineProperty(r$,"__esModule",{value:!0});var Nd=je(),yHe=tt(),SHe=Eue(),bHe={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Nd.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Nd._)`{limit: ${t}}`},THe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:bHe,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,o=e==="maxLength"?Nd.operators.GT:Nd.operators.LT,i=s.opts.unicode===!1?(0,Nd._)`${r}.length`:(0,Nd._)`${(0,yHe.useFunc)(t.gen,SHe.default)}(${r})`;t.fail$data((0,Nd._)`${i} ${o} ${n}`)}};r$.default=THe});var Sue=w(n$=>{"use strict";Object.defineProperty(n$,"__esModule",{value:!0});var wHe=oo(),CHe=tt(),$f=je(),vHe={message:({schemaCode:t})=>(0,$f.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,$f._)`{pattern: ${t}}`},kHe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:vHe,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:o,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:l}=i.opts.code,c=l.code==="new RegExp"?(0,$f._)`new RegExp`:(0,CHe.useFunc)(e,l),u=e.let("valid");e.try(()=>e.assign(u,(0,$f._)`${c}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,$f._)`!${u}`)}else{let l=(0,wHe.usePattern)(t,s);t.fail$data((0,$f._)`!${l}.test(${r})`)}}};n$.default=kHe});var bue=w(s$=>{"use strict";Object.defineProperty(s$,"__esModule",{value:!0});var xy=je(),AHe={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,xy.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,xy._)`{limit: ${t}}`},IHe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:AHe,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?xy.operators.GT:xy.operators.LT;t.fail$data((0,xy._)`Object.keys(${r}).length ${s} ${n}`)}};s$.default=IHe});var Tue=w(o$=>{"use strict";Object.defineProperty(o$,"__esModule",{value:!0});var My=oo(),Py=je(),DHe=tt(),RHe={message:({params:{missingProperty:t}})=>(0,Py.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Py._)`{missingProperty: ${t}}`},NHe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:RHe,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:o,it:i}=t,{opts:a}=i;if(!o&&r.length===0)return;let l=r.length>=a.loopRequired;if(i.allErrors?c():u(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:f}=t.it;for(let g of r)if(h?.[g]===void 0&&!f.has(g)){let _=i.schemaEnv.baseId+i.errSchemaPath,E=`required property "${g}" is not defined at "${_}" (strictRequired)`;(0,DHe.checkStrictMode)(i,E,i.opts.strictRequired)}}function c(){if(l||o)t.block$data(Py.nil,d);else for(let h of r)(0,My.checkReportMissingProp)(t,h)}function u(){let h=e.let("missing");if(l||o){let f=e.let("valid",!0);t.block$data(f,()=>p(h,f)),t.ok(f)}else e.if((0,My.checkMissingProp)(t,r,h)),(0,My.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",n,h=>{t.setParams({missingProperty:h}),e.if((0,My.noPropertyInData)(e,s,h,a.ownProperties),()=>t.error())})}function p(h,f){t.setParams({missingProperty:h}),e.forOf(h,n,()=>{e.assign(f,(0,My.propertyInData)(e,s,h,a.ownProperties)),e.if((0,Py.not)(f),()=>{t.error(),e.break()})},Py.nil)}}};o$.default=NHe});var wue=w(i$=>{"use strict";Object.defineProperty(i$,"__esModule",{value:!0});var Ly=je(),OHe={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Ly.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Ly._)`{limit: ${t}}`},xHe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:OHe,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?Ly.operators.GT:Ly.operators.LT;t.fail$data((0,Ly._)`${r}.length ${s} ${n}`)}};i$.default=xHe});var Nv=w(a$=>{"use strict";Object.defineProperty(a$,"__esModule",{value:!0});var Cue=R2();Cue.code='require("ajv/dist/runtime/equal").default';a$.default=Cue});var vue=w(c$=>{"use strict";Object.defineProperty(c$,"__esModule",{value:!0});var l$=Ty(),Jr=je(),MHe=tt(),PHe=Nv(),LHe={message:({params:{i:t,j:e}})=>(0,Jr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Jr._)`{i: ${t}, j: ${e}}`},FHe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:LHe,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=t;if(!n&&!s)return;let l=e.let("valid"),c=o.items?(0,l$.getSchemaTypes)(o.items):[];t.block$data(l,u,(0,Jr._)`${i} === false`),t.ok(l);function u(){let f=e.let("i",(0,Jr._)`${r}.length`),g=e.let("j");t.setParams({i:f,j:g}),e.assign(l,!0),e.if((0,Jr._)`${f} > 1`,()=>(d()?p:h)(f,g))}function d(){return c.length>0&&!c.some(f=>f==="object"||f==="array")}function p(f,g){let _=e.name("item"),E=(0,l$.checkDataTypes)(c,_,a.opts.strictNumbers,l$.DataType.Wrong),y=e.const("indices",(0,Jr._)`{}`);e.for((0,Jr._)`;${f}--;`,()=>{e.let(_,(0,Jr._)`${r}[${f}]`),e.if(E,(0,Jr._)`continue`),c.length>1&&e.if((0,Jr._)`typeof ${_} == "string"`,(0,Jr._)`${_} += "_"`),e.if((0,Jr._)`typeof ${y}[${_}] == "number"`,()=>{e.assign(g,(0,Jr._)`${y}[${_}]`),t.error(),e.assign(l,!1).break()}).code((0,Jr._)`${y}[${_}] = ${f}`)})}function h(f,g){let _=(0,MHe.useFunc)(e,PHe.default),E=e.name("outer");e.label(E).for((0,Jr._)`;${f}--;`,()=>e.for((0,Jr._)`${g} = ${f}; ${g}--;`,()=>e.if((0,Jr._)`${_}(${r}[${f}], ${r}[${g}])`,()=>{t.error(),e.assign(l,!1).break(E)})))}}};c$.default=FHe});var kue=w(d$=>{"use strict";Object.defineProperty(d$,"__esModule",{value:!0});var u$=je(),$He=tt(),UHe=Nv(),BHe={message:"must be equal to constant",params:({schemaCode:t})=>(0,u$._)`{allowedValue: ${t}}`},GHe={keyword:"const",$data:!0,error:BHe,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,u$._)`!${(0,$He.useFunc)(e,UHe.default)}(${r}, ${s})`):t.fail((0,u$._)`${o} !== ${r}`)}};d$.default=GHe});var Aue=w(p$=>{"use strict";Object.defineProperty(p$,"__esModule",{value:!0});var Fy=je(),zHe=tt(),HHe=Nv(),qHe={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Fy._)`{allowedValues: ${t}}`},jHe={keyword:"enum",schemaType:"array",$data:!0,error:qHe,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:o,it:i}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,l,c=()=>l??(l=(0,zHe.useFunc)(e,HHe.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=e.const("vSchema",o);u=(0,Fy.or)(...s.map((f,g)=>p(h,g)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,h=>e.if((0,Fy._)`${c()}(${r}, ${h})`,()=>e.assign(u,!0).break()))}function p(h,f){let g=s[f];return typeof g=="object"&&g!==null?(0,Fy._)`${c()}(${r}, ${h}[${f}])`:(0,Fy._)`${r} === ${g}`}}};p$.default=jHe});var Iue=w(m$=>{"use strict";Object.defineProperty(m$,"__esModule",{value:!0});var YHe=hue(),WHe=gue(),KHe=yue(),VHe=Sue(),QHe=bue(),XHe=Tue(),JHe=wue(),ZHe=vue(),eqe=kue(),tqe=Aue(),rqe=[YHe.default,WHe.default,KHe.default,VHe.default,QHe.default,XHe.default,JHe.default,ZHe.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},eqe.default,tqe.default];m$.default=rqe});var h$=w($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});$y.validateAdditionalItems=void 0;var Od=je(),f$=tt(),nqe={message:({params:{len:t}})=>(0,Od.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Od._)`{limit: ${t}}`},sqe={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:nqe,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,f$.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Due(t,n)}};function Due(t,e){let{gen:r,schema:n,data:s,keyword:o,it:i}=t;i.items=!0;let a=r.const("len",(0,Od._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Od._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,f$.alwaysValidSchema)(i,n)){let c=r.var("valid",(0,Od._)`${a} <= ${e.length}`);r.if((0,Od.not)(c),()=>l(c)),t.ok(c)}function l(c){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:f$.Type.Num},c),i.allErrors||r.if((0,Od.not)(c),()=>r.break())})}}$y.validateAdditionalItems=Due;$y.default=sqe});var g$=w(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});Uy.validateTuple=void 0;var Rue=je(),Ov=tt(),oqe=oo(),iqe={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Nue(t,"additionalItems",e);r.items=!0,!(0,Ov.alwaysValidSchema)(r,e)&&t.ok((0,oqe.validateArray)(t))}};function Nue(t,e,r=t.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=t;u(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Ov.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),c=n.const("len",(0,Rue._)`${o}.length`);r.forEach((d,p)=>{(0,Ov.alwaysValidSchema)(a,d)||(n.if((0,Rue._)`${c} > ${p}`,()=>t.subschema({keyword:i,schemaProp:p,dataProp:p},l)),t.ok(l))});function u(d){let{opts:p,errSchemaPath:h}=a,f=r.length,g=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(p.strictTuples&&!g){let _=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,Ov.checkStrictMode)(a,_,p.strictTuples)}}}Uy.validateTuple=Nue;Uy.default=iqe});var Oue=w(_$=>{"use strict";Object.defineProperty(_$,"__esModule",{value:!0});var aqe=g$(),lqe={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,aqe.validateTuple)(t,"items")};_$.default=lqe});var Mue=w(E$=>{"use strict";Object.defineProperty(E$,"__esModule",{value:!0});var xue=je(),cqe=tt(),uqe=oo(),dqe=h$(),pqe={message:({params:{len:t}})=>(0,xue.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,xue._)`{limit: ${t}}`},mqe={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:pqe,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,cqe.alwaysValidSchema)(n,e)&&(s?(0,dqe.validateAdditionalItems)(t,s):t.ok((0,uqe.validateArray)(t)))}};E$.default=mqe});var Pue=w(y$=>{"use strict";Object.defineProperty(y$,"__esModule",{value:!0});var ao=je(),xv=tt(),fqe={message:({params:{min:t,max:e}})=>e===void 0?(0,ao.str)`must contain at least ${t} valid item(s)`:(0,ao.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,ao._)`{minContains: ${t}}`:(0,ao._)`{minContains: ${t}, maxContains: ${e}}`},hqe={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:fqe,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:o}=t,i,a,{minContains:l,maxContains:c}=n;o.opts.next?(i=l===void 0?1:l,a=c):i=1;let u=e.const("len",(0,ao._)`${s}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,xv.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,xv.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,xv.alwaysValidSchema)(o,r)){let g=(0,ao._)`${u} >= ${i}`;a!==void 0&&(g=(0,ao._)`${g} && ${u} <= ${a}`),t.pass(g);return}o.items=!0;let d=e.name("valid");a===void 0&&i===1?h(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,ao._)`${s}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let g=e.name("_valid"),_=e.let("count",0);h(g,()=>e.if(g,()=>f(_)))}function h(g,_){e.forRange("i",0,u,E=>{t.subschema({keyword:"contains",dataProp:E,dataPropType:xv.Type.Num,compositeRule:!0},g),_()})}function f(g){e.code((0,ao._)`${g}++`),a===void 0?e.if((0,ao._)`${g} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,ao._)`${g} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,ao._)`${g} >= ${i}`,()=>e.assign(d,!0)))}}};y$.default=hqe});var $ue=w(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.validateSchemaDeps=Bi.validatePropertyDeps=Bi.error=void 0;var S$=je(),gqe=tt(),By=oo();Bi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,S$.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,S$._)`{property: ${t},
1187
+ || ${i} === "boolean" || ${s} === null`).assign(a,(0,Ue._)`[${s}]`)}}}function LGe({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ue._)`${e} !== undefined`,()=>t.assign((0,Ue._)`${e}[${r}]`,n))}function C2(t,e,r,n=Of.Correct){let s=n===Of.Correct?Ue.operators.EQ:Ue.operators.NEQ,o;switch(t){case"null":return(0,Ue._)`${e} ${s} null`;case"array":o=(0,Ue._)`Array.isArray(${e})`;break;case"object":o=(0,Ue._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=i((0,Ue._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=i();break;default:return(0,Ue._)`typeof ${e} ${s} ${t}`}return n===Of.Correct?o:(0,Ue.not)(o);function i(a=Ue.nil){return(0,Ue.and)((0,Ue._)`typeof ${e} == "number"`,a,r?(0,Ue._)`isFinite(${e})`:Ue.nil)}}An.checkDataType=C2;function v2(t,e,r,n){if(t.length===1)return C2(t[0],e,r,n);let s,o=(0,rce.toHash)(t);if(o.array&&o.object){let i=(0,Ue._)`typeof ${e} != "object"`;s=o.null?i:(0,Ue._)`!${e} || ${i}`,delete o.null,delete o.array,delete o.object}else s=Ue.nil;o.number&&delete o.integer;for(let i in o)s=(0,Ue.and)(s,C2(i,e,r,n));return s}An.checkDataTypes=v2;var FGe={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ue._)`{type: ${t}}`:(0,Ue._)`{type: ${e}}`};function k2(t){let e=$Ge(t);(0,NGe.reportError)(e,FGe)}An.reportTypeError=k2;function $Ge(t){let{gen:e,data:r,schema:n}=t,s=(0,rce.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var ice=w(fv=>{"use strict";Object.defineProperty(fv,"__esModule",{value:!0});fv.assignDefaults=void 0;var xf=je(),UGe=rt();function BGe(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)oce(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,o)=>oce(t,o,s.default))}fv.assignDefaults=BGe;function oce(t,e,r){let{gen:n,compositeRule:s,data:o,opts:i}=t;if(r===void 0)return;let a=(0,xf._)`${o}${(0,xf.getProperty)(e)}`;if(s){(0,UGe.checkStrictMode)(t,`default is ignored for: ${a}`);return}let l=(0,xf._)`${a} === undefined`;i.useDefaults==="empty"&&(l=(0,xf._)`${l} || ${a} === null || ${a} === ""`),n.if(l,(0,xf._)`${a} = ${(0,xf.stringify)(r)}`)}});var oo=w(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.validateUnion=yt.validateArray=yt.usePattern=yt.callValidateCode=yt.schemaProperties=yt.allSchemaProperties=yt.noPropertyInData=yt.propertyInData=yt.isOwnProperty=yt.hasPropFunc=yt.reportMissingProp=yt.checkMissingProp=yt.checkReportMissingProp=void 0;var Ft=je(),A2=rt(),Cc=Wa(),GGe=rt();function zGe(t,e){let{gen:r,data:n,it:s}=t;r.if(D2(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ft._)`${e}`},!0),t.error()})}yt.checkReportMissingProp=zGe;function HGe({gen:t,data:e,it:{opts:r}},n,s){return(0,Ft.or)(...n.map(o=>(0,Ft.and)(D2(t,e,o,r.ownProperties),(0,Ft._)`${s} = ${o}`)))}yt.checkMissingProp=HGe;function qGe(t,e){t.setParams({missingProperty:e},!0),t.error()}yt.reportMissingProp=qGe;function ace(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ft._)`Object.prototype.hasOwnProperty`})}yt.hasPropFunc=ace;function I2(t,e,r){return(0,Ft._)`${ace(t)}.call(${e}, ${r})`}yt.isOwnProperty=I2;function jGe(t,e,r,n){let s=(0,Ft._)`${e}${(0,Ft.getProperty)(r)} !== undefined`;return n?(0,Ft._)`${s} && ${I2(t,e,r)}`:s}yt.propertyInData=jGe;function D2(t,e,r,n){let s=(0,Ft._)`${e}${(0,Ft.getProperty)(r)} === undefined`;return n?(0,Ft.or)(s,(0,Ft.not)(I2(t,e,r))):s}yt.noPropertyInData=D2;function lce(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}yt.allSchemaProperties=lce;function YGe(t,e){return lce(e).filter(r=>!(0,A2.alwaysValidSchema)(t,e[r]))}yt.schemaProperties=YGe;function WGe({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,l,c){let u=c?(0,Ft._)`${t}, ${e}, ${n}${s}`:e,d=[[Cc.default.instancePath,(0,Ft.strConcat)(Cc.default.instancePath,o)],[Cc.default.parentData,i.parentData],[Cc.default.parentDataProperty,i.parentDataProperty],[Cc.default.rootData,Cc.default.rootData]];i.opts.dynamicRef&&d.push([Cc.default.dynamicAnchors,Cc.default.dynamicAnchors]);let p=(0,Ft._)`${u}, ${r.object(...d)}`;return l!==Ft.nil?(0,Ft._)`${a}.call(${l}, ${p})`:(0,Ft._)`${a}(${p})`}yt.callValidateCode=WGe;var KGe=(0,Ft._)`new RegExp`;function VGe({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,o=s(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Ft._)`${s.code==="new RegExp"?KGe:(0,GGe.useFunc)(t,s)}(${r}, ${n})`})}yt.usePattern=VGe;function QGe(t){let{gen:e,data:r,keyword:n,it:s}=t,o=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(o,!0),i(()=>e.break()),o;function i(a){let l=e.const("len",(0,Ft._)`${r}.length`);e.forRange("i",0,l,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:A2.Type.Num},o),e.if((0,Ft.not)(o),a)})}}yt.validateArray=QGe;function XGe(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,A2.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((l,c)=>{let u=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},a);e.assign(i,(0,Ft._)`${i} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,Ft.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}yt.validateUnion=XGe});var dce=w($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.validateKeywordUsage=$i.validSchemaType=$i.funcKeywordCode=$i.macroKeywordCode=void 0;var Hn=je(),Ad=Wa(),JGe=oo(),ZGe=by();function eze(t,e){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=t,a=e.macro.call(i.self,s,o,i),l=uce(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let c=r.name("valid");t.subschema({schema:a,schemaPath:Hn.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}$i.macroKeywordCode=eze;function tze(t,e){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:l}=t;nze(l,e);let c=!a&&e.compile?e.compile.call(l.self,o,i,l):e.validate,u=uce(n,s,c),d=n.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)g(),e.modifying&&cce(t),_(()=>t.error());else{let E=e.async?h():f();e.modifying&&cce(t),_(()=>rze(t,E))}}function h(){let E=n.let("ruleErrs",null);return n.try(()=>g((0,Hn._)`await `),y=>n.assign(d,!1).if((0,Hn._)`${y} instanceof ${l.ValidationError}`,()=>n.assign(E,(0,Hn._)`${y}.errors`),()=>n.throw(y))),E}function f(){let E=(0,Hn._)`${u}.errors`;return n.assign(E,null),g(Hn.nil),E}function g(E=e.async?(0,Hn._)`await `:Hn.nil){let y=l.opts.passContext?Ad.default.this:Ad.default.self,S=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Hn._)`${E}${(0,JGe.callValidateCode)(t,u,y,S)}`,e.modifying)}function _(E){var y;n.if((0,Hn.not)((y=e.valid)!==null&&y!==void 0?y:d),E)}}$i.funcKeywordCode=tze;function cce(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Hn._)`${n.parentData}[${n.parentDataProperty}]`))}function rze(t,e){let{gen:r}=t;r.if((0,Hn._)`Array.isArray(${e})`,()=>{r.assign(Ad.default.vErrors,(0,Hn._)`${Ad.default.vErrors} === null ? ${e} : ${Ad.default.vErrors}.concat(${e})`).assign(Ad.default.errors,(0,Hn._)`${Ad.default.vErrors}.length`),(0,ZGe.extendErrors)(t)},()=>t.error())}function nze({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function uce(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Hn.stringify)(r)})}function sze(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}$i.validSchemaType=sze;function oze({schema:t,opts:e,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");let i=s.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[o])){let l=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}$i.validateKeywordUsage=oze});var mce=w(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.extendSubschemaMode=vc.extendSubschemaData=vc.getSubschema=void 0;var Ui=je(),pce=rt();function ize(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ui._)`${t.schemaPath}${(0,Ui.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ui._)`${t.schemaPath}${(0,Ui.getProperty)(e)}${(0,Ui.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,pce.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}vc.getSubschema=ize;function aze(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:c,dataPathArr:u,opts:d}=e,p=a.let("data",(0,Ui._)`${e.data}${(0,Ui.getProperty)(r)}`,!0);l(p),t.errorPath=(0,Ui.str)`${c}${(0,pce.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ui._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(s!==void 0){let c=s instanceof Ui.Name?s:a.let("data",s,!0);l(c),i!==void 0&&(t.propertyName=i)}o&&(t.dataTypes=o);function l(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}vc.extendSubschemaData=aze;function lze(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}vc.extendSubschemaMode=lze});var R2=w((FTt,fce)=>{"use strict";fce.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var gce=w(($Tt,hce)=>{"use strict";var kc=hce.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};hv(e,n,s,t,"",t)};kc.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};kc.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};kc.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};kc.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function hv(t,e,r,n,s,o,i,a,l,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,o,i,a,l,c);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in kc.arrayKeywords)for(var p=0;p<d.length;p++)hv(t,e,r,d[p],s+"/"+u+"/"+p,o,s,u,n,p)}else if(u in kc.propsKeywords){if(d&&typeof d=="object")for(var h in d)hv(t,e,r,d[h],s+"/"+u+"/"+cze(h),o,s,u,n,h)}else(u in kc.keywords||t.allKeys&&!(u in kc.skipKeywords))&&hv(t,e,r,d,s+"/"+u,o,s,u,n)}r(n,s,o,i,a,l,c)}}function cze(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var wy=w(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.getSchemaRefs=cs.resolveUrl=cs.normalizeId=cs._getFullPath=cs.getFullPath=cs.inlineRef=void 0;var uze=rt(),dze=R2(),pze=gce(),mze=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fze(t,e=!0){return typeof t=="boolean"?!0:e===!0?!N2(t):e?_ce(t)<=e:!1}cs.inlineRef=fze;var hze=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function N2(t){for(let e in t){if(hze.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(N2)||typeof r=="object"&&N2(r))return!0}return!1}function _ce(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!mze.has(r)&&(typeof t[r]=="object"&&(0,uze.eachItem)(t[r],n=>e+=_ce(n)),e===1/0))return 1/0}return e}function Ece(t,e="",r){r!==!1&&(e=Mf(e));let n=t.parse(e);return yce(t,n)}cs.getFullPath=Ece;function yce(t,e){return t.serialize(e).split("#")[0]+"#"}cs._getFullPath=yce;var gze=/#\/?$/;function Mf(t){return t?t.replace(gze,""):""}cs.normalizeId=Mf;function _ze(t,e,r){return r=Mf(r),t.resolve(e,r)}cs.resolveUrl=_ze;var Eze=/^[a-z_][-a-z0-9._]*$/i;function yze(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Mf(t[r]||e),o={"":s},i=Ece(n,s,!1),a={},l=new Set;return pze(t,{allKeys:!0},(d,p,h,f)=>{if(f===void 0)return;let g=i+p,_=o[f];typeof d[r]=="string"&&(_=E.call(this,d[r])),y.call(this,d.$anchor),y.call(this,d.$dynamicAnchor),o[p]=_;function E(S){let T=this.opts.uriResolver.resolve;if(S=Mf(_?T(_,S):S),l.has(S))throw u(S);l.add(S);let C=this.refs[S];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?c(d,C.schema,S):S!==Mf(g)&&(S[0]==="#"?(c(d,a[S],S),a[S]=d):this.refs[S]=g),S}function y(S){if(typeof S=="string"){if(!Eze.test(S))throw new Error(`invalid anchor "${S}"`);E.call(this,`#${S}`)}}}),a;function c(d,p,h){if(p!==void 0&&!dze(d,p))throw u(h)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}cs.getSchemaRefs=yze});var ky=w(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.getData=Ac.KeywordCxt=Ac.validateFunctionCode=void 0;var Cce=Zle(),Sce=Ty(),x2=w2(),gv=Ty(),Sze=ice(),vy=dce(),O2=mce(),we=je(),Me=Wa(),bze=wy(),Ka=rt(),Cy=by();function Tze(t){if(Ace(t)&&(Ice(t),kce(t))){vze(t);return}vce(t,()=>(0,Cce.topBoolOrEmptySchema)(t))}Ac.validateFunctionCode=Tze;function vce({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},o){s.code.es5?t.func(e,(0,we._)`${Me.default.data}, ${Me.default.valCxt}`,n.$async,()=>{t.code((0,we._)`"use strict"; ${bce(r,s)}`),Cze(t,s),t.code(o)}):t.func(e,(0,we._)`${Me.default.data}, ${wze(s)}`,n.$async,()=>t.code(bce(r,s)).code(o))}function wze(t){return(0,we._)`{${Me.default.instancePath}="", ${Me.default.parentData}, ${Me.default.parentDataProperty}, ${Me.default.rootData}=${Me.default.data}${t.dynamicRef?(0,we._)`, ${Me.default.dynamicAnchors}={}`:we.nil}}={}`}function Cze(t,e){t.if(Me.default.valCxt,()=>{t.var(Me.default.instancePath,(0,we._)`${Me.default.valCxt}.${Me.default.instancePath}`),t.var(Me.default.parentData,(0,we._)`${Me.default.valCxt}.${Me.default.parentData}`),t.var(Me.default.parentDataProperty,(0,we._)`${Me.default.valCxt}.${Me.default.parentDataProperty}`),t.var(Me.default.rootData,(0,we._)`${Me.default.valCxt}.${Me.default.rootData}`),e.dynamicRef&&t.var(Me.default.dynamicAnchors,(0,we._)`${Me.default.valCxt}.${Me.default.dynamicAnchors}`)},()=>{t.var(Me.default.instancePath,(0,we._)`""`),t.var(Me.default.parentData,(0,we._)`undefined`),t.var(Me.default.parentDataProperty,(0,we._)`undefined`),t.var(Me.default.rootData,Me.default.data),e.dynamicRef&&t.var(Me.default.dynamicAnchors,(0,we._)`{}`)})}function vze(t){let{schema:e,opts:r,gen:n}=t;vce(t,()=>{r.$comment&&e.$comment&&Rce(t),Rze(t),n.let(Me.default.vErrors,null),n.let(Me.default.errors,0),r.unevaluated&&kze(t),Dce(t),xze(t)})}function kze(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,we._)`${r}.evaluated`),e.if((0,we._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,we._)`${t.evaluated}.props`,(0,we._)`undefined`)),e.if((0,we._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,we._)`${t.evaluated}.items`,(0,we._)`undefined`))}function bce(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,we._)`/*# sourceURL=${r} */`:we.nil}function Aze(t,e){if(Ace(t)&&(Ice(t),kce(t))){Ize(t,e);return}(0,Cce.boolOrEmptySchema)(t,e)}function kce({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Ace(t){return typeof t.schema!="boolean"}function Ize(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&Rce(t),Nze(t),Oze(t);let o=n.const("_errs",Me.default.errors);Dce(t,o),n.var(e,(0,we._)`${o} === ${Me.default.errors}`)}function Ice(t){(0,Ka.checkUnknownRules)(t),Dze(t)}function Dce(t,e){if(t.opts.jtd)return Tce(t,[],!1,e);let r=(0,Sce.getSchemaTypes)(t.schema),n=(0,Sce.coerceAndCheckDataType)(t,r);Tce(t,r,!n,e)}function Dze(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ka.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Rze(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ka.checkStrictMode)(t,"default is ignored in the schema root")}function Nze(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,bze.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Oze(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Rce({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)t.code((0,we._)`${Me.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let i=(0,we.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,we._)`${Me.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function xze(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=t;r.$async?e.if((0,we._)`${Me.default.errors} === 0`,()=>e.return(Me.default.data),()=>e.throw((0,we._)`new ${s}(${Me.default.vErrors})`)):(e.assign((0,we._)`${n}.errors`,Me.default.vErrors),o.unevaluated&&Mze(t),e.return((0,we._)`${Me.default.errors} === 0`))}function Mze({gen:t,evaluated:e,props:r,items:n}){r instanceof we.Name&&t.assign((0,we._)`${e}.props`,r),n instanceof we.Name&&t.assign((0,we._)`${e}.items`,n)}function Tce(t,e,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:l,self:c}=t,{RULES:u}=c;if(o.$ref&&(l.ignoreKeywordsWithRef||!(0,Ka.schemaHasRulesButRef)(o,u))){s.block(()=>Oce(t,"$ref",u.all.$ref.definition));return}l.jtd||Pze(t,e),s.block(()=>{for(let p of u.rules)d(p);d(u.post)});function d(p){(0,x2.shouldUseGroup)(o,p)&&(p.type?(s.if((0,gv.checkDataType)(p.type,i,l.strictNumbers)),wce(t,p),e.length===1&&e[0]===p.type&&r&&(s.else(),(0,gv.reportTypeError)(t)),s.endIf()):wce(t,p),a||s.if((0,we._)`${Me.default.errors} === ${n||0}`))}}function wce(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,Sze.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,x2.shouldUseRule)(n,o)&&Oce(t,o.keyword,o.definition,e.type)})}function Pze(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Lze(t,e),t.opts.allowUnionTypes||Fze(t,e),$ze(t,t.dataTypes))}function Lze(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Nce(t.dataTypes,r)||M2(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Bze(t,e)}}function Fze(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&M2(t,"use allowUnionTypes to allow union type keyword")}function $ze(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,x2.shouldUseRule)(t.schema,s)){let{type:o}=s.definition;o.length&&!o.some(i=>Uze(e,i))&&M2(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Uze(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Nce(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Bze(t,e){let r=[];for(let n of t.dataTypes)Nce(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function M2(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ka.checkStrictMode)(t,e,t.opts.strictTypes)}var _v=class{constructor(e,r,n){if((0,vy.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ka.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",xce(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,vy.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Me.default.errors))}result(e,r,n){this.failResult((0,we.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,we.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,we._)`${r} !== undefined && (${(0,we.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Cy.reportExtraError:Cy.reportError)(this,this.def.error,r)}$dataError(){(0,Cy.reportError)(this,this.def.$dataError||Cy.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Cy.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=we.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=we.nil,r=we.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:o,def:i}=this;n.if((0,we.or)((0,we._)`${s} === undefined`,r)),e!==we.nil&&n.assign(e,!0),(o.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==we.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:o}=this;return(0,we.or)(i(),a());function i(){if(n.length){if(!(r instanceof we.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,we._)`${(0,gv.checkDataTypes)(l,r,o.opts.strictNumbers,gv.DataType.Wrong)}`}return we.nil}function a(){if(s.validateSchema){let l=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,we._)`!${l}(${r})`}return we.nil}}subschema(e,r){let n=(0,O2.getSubschema)(this.it,e);(0,O2.extendSubschemaData)(n,this.it,e),(0,O2.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return Aze(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ka.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ka.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,we.Name)),!0}};Ac.KeywordCxt=_v;function Oce(t,e,r,n){let s=new _v(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,vy.funcKeywordCode)(s,r):"macro"in r?(0,vy.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,vy.funcKeywordCode)(s,r)}var Gze=/^\/(?:[^~]|~0|~1)*$/,zze=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function xce(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,o;if(t==="")return Me.default.rootData;if(t[0]==="/"){if(!Gze.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,o=Me.default.rootData}else{let c=zze.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+c[1];if(s=c[2],s==="#"){if(u>=e)throw new Error(l("property/index",u));return n[e-u]}if(u>e)throw new Error(l("data",u));if(o=r[e-u],!s)return o}let i=o,a=s.split("/");for(let c of a)c&&(o=(0,we._)`${o}${(0,we.getProperty)((0,Ka.unescapeJsonPointer)(c))}`,i=(0,we._)`${i} && ${o}`);return i;function l(c,u){return`Cannot access ${c} ${u} levels up, current level is ${e}`}}Ac.getData=xce});var Ev=w(L2=>{"use strict";Object.defineProperty(L2,"__esModule",{value:!0});var P2=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};L2.default=P2});var Ay=w(U2=>{"use strict";Object.defineProperty(U2,"__esModule",{value:!0});var F2=wy(),$2=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,F2.resolveUrl)(e,r,n),this.missingSchema=(0,F2.normalizeId)((0,F2.getFullPath)(e,this.missingRef))}};U2.default=$2});var Sv=w(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.resolveSchema=io.getCompilingSchema=io.resolveRef=io.compileSchema=io.SchemaEnv=void 0;var Yo=je(),Hze=Ev(),Id=Wa(),Wo=wy(),Mce=rt(),qze=ky(),Pf=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Wo.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};io.SchemaEnv=Pf;function G2(t){let e=Pce.call(this,t);if(e)return e;let r=(0,Wo.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Yo.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;t.$async&&(a=i.scopeValue("Error",{ref:Hze.default,code:(0,Yo._)`require("ajv/dist/runtime/validation_error").default`}));let l=i.scopeName("validate");t.validateName=l;let c={gen:i,allErrors:this.opts.allErrors,data:Id.default.data,parentData:Id.default.parentData,parentDataProperty:Id.default.parentDataProperty,dataNames:[Id.default.data],dataPathArr:[Yo.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Yo.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Yo.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Yo._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,qze.validateFunctionCode)(c),i.optimize(this.opts.code.optimize);let d=i.toString();u=`${i.scopeRefs(Id.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let h=new Function(`${Id.default.self}`,`${Id.default.scope}`,u)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:g}=c;h.evaluated={props:f instanceof Yo.Name?void 0:f,items:g instanceof Yo.Name?void 0:g,dynamicProps:f instanceof Yo.Name,dynamicItems:g instanceof Yo.Name},h.source&&(h.source.evaluated=(0,Yo.stringify)(h.evaluated))}return t.validate=h,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}io.compileSchema=G2;function jze(t,e,r){var n;r=(0,Wo.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let o=Kze.call(this,t,r);if(o===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(o=new Pf({schema:i,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=Yze.call(this,o)}io.resolveRef=jze;function Yze(t){return(0,Wo.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:G2.call(this,t)}function Pce(t){for(let e of this._compilations)if(Wze(e,t))return e}io.getCompilingSchema=Pce;function Wze(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Kze(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||yv.call(this,t,e)}function yv(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Wo._getFullPath)(this.opts.uriResolver,r),s=(0,Wo.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return B2.call(this,r,t);let o=(0,Wo.normalizeId)(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=yv.call(this,t,i);return typeof a?.schema!="object"?void 0:B2.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||G2.call(this,i),o===(0,Wo.normalizeId)(e)){let{schema:a}=i,{schemaId:l}=this.opts,c=a[l];return c&&(s=(0,Wo.resolveUrl)(this.opts.uriResolver,s,c)),new Pf({schema:a,schemaId:l,root:t,baseId:s})}return B2.call(this,r,i)}}io.resolveSchema=yv;var Vze=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function B2(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,Mce.unescapeFragment)(a)];if(l===void 0)return;r=l;let c=typeof r=="object"&&r[this.opts.schemaId];!Vze.has(a)&&c&&(e=(0,Wo.resolveUrl)(this.opts.uriResolver,e,c))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,Mce.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Wo.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=yv.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new Pf({schema:r,schemaId:i,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var Lce=w((qTt,Qze)=>{Qze.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var q2=w((jTt,zce)=>{"use strict";var Xze=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),$ce=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),z2=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Uce=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Jze=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function H2(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var Zze=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Fce(t){return t.length=0,!0}function e7e(t,e,r){if(t.length){let n=H2(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function t7e(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,i=!1,a=e7e;for(let l=0;l<t.length;l++){let c=t[l];if(!(c==="["||c==="]"))if(c===":"){if(o===!0&&(i=!0),!a(s,n,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(o=!0),n.push(":");continue}else if(c==="%"){if(!a(s,n,r))break;a=Fce}else{s.push(c);continue}}return s.length&&(a===Fce?r.zone=s.join(""):i?n.push(s.join("")):n.push(H2(s))),r.address=n.join(""),r}function Bce(t){if(r7e(t,":")<2)return{host:t,isIPV6:!1};let e=t7e(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function r7e(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function n7e(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(s===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var s7e={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},o7e=/[@/?#:]/g,i7e=/[@/?#]/g;function Gce(t,e){let r=e?i7e:o7e;return r.lastIndex=0,t.replace(r,n=>s7e[n])}function a7e(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let s=t.slice(n+1,n+3);if(z2(s)){let o=s.toUpperCase(),i=String.fromCharCode(parseInt(o,16));e&&Uce(i)?r+=i:r+="%"+o,n+=2;continue}}r+=t[n]}return r}function l7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(z2(n)){let s=n.toUpperCase(),o=String.fromCharCode(parseInt(s,16));o!=="."&&Uce(o)?e+=o:e+="%"+s,r+=2;continue}}Jze(t[r])?e+=t[r]:e+=escape(t[r])}return e}function c7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(z2(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function u7e(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!$ce(r)){let n=Bce(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Gce(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}zce.exports={nonSimpleDomain:Zze,recomposeAuthority:u7e,reescapeHostDelimiters:Gce,normalizePercentEncoding:a7e,normalizePathEncoding:l7e,escapePreservingEscapes:c7e,removeDotSegments:n7e,isIPv4:$ce,isUUID:Xze,normalizeIPv6:Bce,stringArrayToHexStripped:H2}});var Wce=w((YTt,Yce)=>{"use strict";var{isUUID:d7e}=q2(),p7e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,m7e=["http","https","ws","wss","urn","urn:uuid"];function f7e(t){return m7e.indexOf(t)!==-1}function j2(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function Hce(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function qce(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function h7e(t){return t.secure=j2(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function g7e(t){if((t.port===(j2(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function _7e(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(p7e);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,o=Y2(s);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function E7e(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,o=Y2(s);o&&(t=o.serialize(t,e));let i=t,a=t.nss;return i.path=`${n||e.nid}:${a}`,e.skipEscape=!0,i}function y7e(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!d7e(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function S7e(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var jce={scheme:"http",domainHost:!0,parse:Hce,serialize:qce},b7e={scheme:"https",domainHost:jce.domainHost,parse:Hce,serialize:qce},bv={scheme:"ws",domainHost:!0,parse:h7e,serialize:g7e},T7e={scheme:"wss",domainHost:bv.domainHost,parse:bv.parse,serialize:bv.serialize},w7e={scheme:"urn",parse:_7e,serialize:E7e,skipNormalize:!0},C7e={scheme:"urn:uuid",parse:y7e,serialize:S7e,skipNormalize:!0},Tv={http:jce,https:b7e,ws:bv,wss:T7e,urn:w7e,"urn:uuid":C7e};Object.setPrototypeOf(Tv,null);function Y2(t){return t&&(Tv[t]||Tv[t.toLowerCase()])||void 0}Yce.exports={wsIsSecure:j2,SCHEMES:Tv,isValidSchemeName:f7e,getSchemeHandler:Y2}});var Jce=w((WTt,vv)=>{"use strict";var{normalizeIPv6:v7e,removeDotSegments:Iy,recomposeAuthority:k7e,normalizePercentEncoding:A7e,normalizePathEncoding:I7e,escapePreservingEscapes:D7e,reescapeHostDelimiters:R7e,isIPv4:N7e,nonSimpleDomain:O7e}=q2(),{SCHEMES:x7e,getSchemeHandler:Vce}=Wce();function M7e(t,e){return typeof t=="string"?t=G7e(t,e):typeof t=="object"&&(t=Cv(Dd(t,e),e)),t}function P7e(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:s,malformedAuthorityOrPort:o}=wv(t,n),{parsed:i,malformedAuthorityOrPort:a}=wv(e,n);if(o||a)throw new Error(s.error||i.error||"URI is malformed.");let l=Qce(s,i,n,!0);return n.skipEscape=!0,Dd(l,n)}function Qce(t,e,r,n){let s={};return n||(t=Cv(Dd(t,r),r),e=Cv(Dd(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=Iy(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=Iy(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=Iy(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=Iy(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function L7e(t,e,r){let n=Kce(t,r),s=Kce(e,r);return n!==void 0&&s!==void 0&&n.toLowerCase()===s.toLowerCase()}function Dd(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),s=[],o=Vce(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=A7e(r.path):(r.path=D7e(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let i=k7e(r);if(i!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(i),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=Iy(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var F7e=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,$7e=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,U7e=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function B7e(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function wv(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match($7e);i!==null&&i[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",s=!0);let a=t.match(U7e);if(a!==null){let c=a[1],u=c.replace(/[\t\n\r]/g,"");u.length>=2&&(u.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",s=!0):c.length!==u.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",s=!0))}let l=t.match(F7e);if(l){n.scheme=l[1],n.userinfo=l[3],n.host=l[4],n.port=parseInt(l[5],10),n.path=l[6]||"",n.query=l[7],n.fragment=l[8],isNaN(n.port)&&(n.port=l[5]);let c=B7e(n,l);if(c!==void 0&&(n.error=n.error||c,s=!0),n.host)if(N7e(n.host)===!1){let p=v7e(n.host);n.host=p.host.toLowerCase(),o=p.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let u=Vce(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&o===!1&&O7e(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=R7e(unescape(n.host),o))),n.path&&(n.path=I7e(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s}}function Cv(t,e){return wv(t,e).parsed}function G7e(t,e){return Xce(t,e).normalized}function Xce(t,e){let{parsed:r,malformedAuthorityOrPort:n}=wv(t,e);return{normalized:n?t:Dd(r,e),malformedAuthorityOrPort:n}}function Kce(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Xce(t,e);return n?void 0:r}if(typeof t=="object")return Dd(t,e)}var W2={SCHEMES:x7e,normalize:M7e,resolve:P7e,resolveComponent:Qce,equal:L7e,serialize:Dd,parse:Cv};vv.exports=W2;vv.exports.default=W2;vv.exports.fastUri=W2});var eue=w(K2=>{"use strict";Object.defineProperty(K2,"__esModule",{value:!0});var Zce=Jce();Zce.code='require("ajv/dist/runtime/uri").default';K2.default=Zce});var lue=w(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.CodeGen=Xr.Name=Xr.nil=Xr.stringify=Xr.str=Xr._=Xr.KeywordCxt=void 0;var z7e=ky();Object.defineProperty(Xr,"KeywordCxt",{enumerable:!0,get:function(){return z7e.KeywordCxt}});var Lf=je();Object.defineProperty(Xr,"_",{enumerable:!0,get:function(){return Lf._}});Object.defineProperty(Xr,"str",{enumerable:!0,get:function(){return Lf.str}});Object.defineProperty(Xr,"stringify",{enumerable:!0,get:function(){return Lf.stringify}});Object.defineProperty(Xr,"nil",{enumerable:!0,get:function(){return Lf.nil}});Object.defineProperty(Xr,"Name",{enumerable:!0,get:function(){return Lf.Name}});Object.defineProperty(Xr,"CodeGen",{enumerable:!0,get:function(){return Lf.CodeGen}});var H7e=Ev(),oue=Ay(),q7e=T2(),Dy=Sv(),j7e=je(),Ry=wy(),kv=Ty(),Q2=rt(),tue=Lce(),Y7e=eue(),iue=(t,e)=>new RegExp(t,e);iue.code="new RegExp";var W7e=["removeAdditional","useDefaults","coerceTypes"],K7e=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),V7e={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Q7e={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},rue=200;function X7e(t){var e,r,n,s,o,i,a,l,c,u,d,p,h,f,g,_,E,y,S,T,C,v,A,D,I;let x=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,$=B===!0||B===void 0?1:B||0,L=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:iue,q=(s=t.uriResolver)!==null&&s!==void 0?s:Y7e.default;return{strictSchema:(i=(o=t.strictSchema)!==null&&o!==void 0?o:x)!==null&&i!==void 0?i:!0,strictNumbers:(l=(a=t.strictNumbers)!==null&&a!==void 0?a:x)!==null&&l!==void 0?l:!0,strictTypes:(u=(c=t.strictTypes)!==null&&c!==void 0?c:x)!==null&&u!==void 0?u:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:x)!==null&&p!==void 0?p:"log",strictRequired:(f=(h=t.strictRequired)!==null&&h!==void 0?h:x)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:$,regExp:L}:{optimize:$,regExp:L},loopRequired:(g=t.loopRequired)!==null&&g!==void 0?g:rue,loopEnum:(_=t.loopEnum)!==null&&_!==void 0?_:rue,meta:(E=t.meta)!==null&&E!==void 0?E:!0,messages:(y=t.messages)!==null&&y!==void 0?y:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(v=t.validateSchema)!==null&&v!==void 0?v:!0,validateFormats:(A=t.validateFormats)!==null&&A!==void 0?A:!0,unicodeRegExp:(D=t.unicodeRegExp)!==null&&D!==void 0?D:!0,int32range:(I=t.int32range)!==null&&I!==void 0?I:!0,uriResolver:q}}var Ny=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...X7e(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new j7e.ValueScope({scope:{},prefixes:K7e,es5:r,lines:n}),this.logger=nHe(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,q7e.getRules)(),nue.call(this,V7e,e,"NOT SUPPORTED"),nue.call(this,Q7e,e,"DEPRECATED","warn"),this._metaOpts=tHe.call(this),e.formats&&Z7e.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&eHe.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),J7e.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=tue;n==="id"&&(s={...tue},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(u,d){await o.call(this,u.$schema);let p=this._addSchema(u,d);return p.validate||i.call(this,p)}async function o(u){u&&!this.getSchema(u)&&await s.call(this,{$ref:u},!0)}async function i(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof oue.default))throw d;return a.call(this,d),await l.call(this,d.missingSchema),i.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function l(u){let d=await c.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function c(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,s);return this}let o;if(typeof e=="object"){let{schemaId:i}=this.opts;if(o=e[i],o!==void 0&&typeof o!="string")throw new Error(`schema ${i} must be string`)}return r=(0,Ry.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return s}getSchema(e){let r;for(;typeof(r=sue.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new Dy.SchemaEnv({schema:{},schemaId:n});if(r=Dy.resolveSchema.call(this,s,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=sue.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Ry.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(oHe.call(this,n,r),!r)return(0,Q2.eachItem)(n,o=>V2.call(this,o)),this;aHe.call(this,r);let s={...r,type:(0,kv.getJSONTypes)(r.type),schemaType:(0,kv.getJSONTypes)(r.schemaType)};return(0,Q2.eachItem)(n,s.type.length===0?o=>V2.call(this,o,s):o=>s.type.forEach(i=>V2.call(this,o,s,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let s=n.rules.findIndex(o=>o.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,o)=>s+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let o=s.split("/").slice(1),i=e;for(let a of o)i=i[a];for(let a in n){let l=n[a];if(typeof l!="object")continue;let{$data:c}=l.definition,u=i[a];c&&u&&(i[a]=aue(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=this.opts.validateSchema,o=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(l!==void 0)return l;n=(0,Ry.normalizeId)(i||n);let c=Ry.getSchemaRefs.call(this,e,n);return l=new Dy.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:c}),this._cache.set(l.schema,l),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),s&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Dy.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Dy.compileSchema.call(this,e)}finally{this.opts=r}}};Ny.ValidationError=H7e.default;Ny.MissingRefError=oue.default;Xr.default=Ny;function nue(t,e,r,n="error"){for(let s in t){let o=s;o in e&&this.logger[n](`${r}: option ${s}. ${t[o]}`)}}function sue(t){return t=(0,Ry.normalizeId)(t),this.schemas[t]||this.refs[t]}function J7e(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Z7e(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function eHe(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function tHe(){let t={...this.opts};for(let e of W7e)delete t[e];return t}var rHe={log(){},warn(){},error(){}};function nHe(t){if(t===!1)return rHe;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var sHe=/^[a-z_$][a-z0-9_$:-]*$/i;function oHe(t,e){let{RULES:r}=this;if((0,Q2.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!sHe.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function V2(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,i=s?o.post:o.rules.find(({type:l})=>l===r);if(i||(i={type:r,rules:[]},o.rules.push(i)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,kv.getJSONTypes)(e.type),schemaType:(0,kv.getJSONTypes)(e.schemaType)}};e.before?iHe.call(this,i,a,e.before):i.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function iHe(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function aHe(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=aue(e)),t.validateSchema=this.compile(e,!0))}var lHe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function aue(t){return{anyOf:[t,lHe]}}});var cue=w(X2=>{"use strict";Object.defineProperty(X2,"__esModule",{value:!0});var cHe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};X2.default=cHe});var mue=w(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.callRef=Rd.getValidate=void 0;var uHe=Ay(),uue=oo(),us=je(),Ff=Wa(),due=Sv(),Av=rt(),dHe={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:l}=n,{root:c}=o;if((r==="#"||r==="#/")&&s===c.baseId)return d();let u=due.resolveRef.call(l,c,s,r);if(u===void 0)throw new uHe.default(n.opts.uriResolver,s,r);if(u instanceof due.SchemaEnv)return p(u);return h(u);function d(){if(o===c)return Iv(t,i,o,o.$async);let f=e.scopeValue("root",{ref:c});return Iv(t,(0,us._)`${f}.validate`,c,c.$async)}function p(f){let g=pue(t,f);Iv(t,g,f,f.$async)}function h(f){let g=e.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,us.stringify)(f)}:{ref:f}),_=e.name("valid"),E=t.subschema({schema:f,dataTypes:[],schemaPath:us.nil,topSchemaRef:g,errSchemaPath:r},_);t.mergeEvaluated(E),t.ok(_)}}};function pue(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,us._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Rd.getValidate=pue;function Iv(t,e,r,n){let{gen:s,it:o}=t,{allErrors:i,schemaEnv:a,opts:l}=o,c=l.passContext?Ff.default.this:us.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=s.let("valid");s.try(()=>{s.code((0,us._)`await ${(0,uue.callValidateCode)(t,e,c)}`),h(e),i||s.assign(f,!0)},g=>{s.if((0,us._)`!(${g} instanceof ${o.ValidationError})`,()=>s.throw(g)),p(g),i||s.assign(f,!1)}),t.ok(f)}function d(){t.result((0,uue.callValidateCode)(t,e,c),()=>h(e),()=>p(e))}function p(f){let g=(0,us._)`${f}.errors`;s.assign(Ff.default.vErrors,(0,us._)`${Ff.default.vErrors} === null ? ${g} : ${Ff.default.vErrors}.concat(${g})`),s.assign(Ff.default.errors,(0,us._)`${Ff.default.vErrors}.length`)}function h(f){var g;if(!o.opts.unevaluated)return;let _=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(o.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(o.props=Av.mergeEvaluated.props(s,_.props,o.props));else{let E=s.var("props",(0,us._)`${f}.evaluated.props`);o.props=Av.mergeEvaluated.props(s,E,o.props,us.Name)}if(o.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(o.items=Av.mergeEvaluated.items(s,_.items,o.items));else{let E=s.var("items",(0,us._)`${f}.evaluated.items`);o.items=Av.mergeEvaluated.items(s,E,o.items,us.Name)}}}Rd.callRef=Iv;Rd.default=dHe});var fue=w(J2=>{"use strict";Object.defineProperty(J2,"__esModule",{value:!0});var pHe=cue(),mHe=mue(),fHe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",pHe.default,mHe.default];J2.default=fHe});var hue=w(Z2=>{"use strict";Object.defineProperty(Z2,"__esModule",{value:!0});var Dv=je(),Ic=Dv.operators,Rv={maximum:{okStr:"<=",ok:Ic.LTE,fail:Ic.GT},minimum:{okStr:">=",ok:Ic.GTE,fail:Ic.LT},exclusiveMaximum:{okStr:"<",ok:Ic.LT,fail:Ic.GTE},exclusiveMinimum:{okStr:">",ok:Ic.GT,fail:Ic.LTE}},hHe={message:({keyword:t,schemaCode:e})=>(0,Dv.str)`must be ${Rv[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Dv._)`{comparison: ${Rv[t].okStr}, limit: ${e}}`},gHe={keyword:Object.keys(Rv),type:"number",schemaType:"number",$data:!0,error:hHe,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Dv._)`${r} ${Rv[e].fail} ${n} || isNaN(${r})`)}};Z2.default=gHe});var gue=w(e$=>{"use strict";Object.defineProperty(e$,"__esModule",{value:!0});var Oy=je(),_He={message:({schemaCode:t})=>(0,Oy.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Oy._)`{multipleOf: ${t}}`},EHe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:_He,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,o=s.opts.multipleOfPrecision,i=e.let("res"),a=o?(0,Oy._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:(0,Oy._)`${i} !== parseInt(${i})`;t.fail$data((0,Oy._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};e$.default=EHe});var Eue=w(t$=>{"use strict";Object.defineProperty(t$,"__esModule",{value:!0});function _ue(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}t$.default=_ue;_ue.code='require("ajv/dist/runtime/ucs2length").default'});var yue=w(r$=>{"use strict";Object.defineProperty(r$,"__esModule",{value:!0});var Nd=je(),yHe=rt(),SHe=Eue(),bHe={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Nd.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Nd._)`{limit: ${t}}`},THe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:bHe,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,o=e==="maxLength"?Nd.operators.GT:Nd.operators.LT,i=s.opts.unicode===!1?(0,Nd._)`${r}.length`:(0,Nd._)`${(0,yHe.useFunc)(t.gen,SHe.default)}(${r})`;t.fail$data((0,Nd._)`${i} ${o} ${n}`)}};r$.default=THe});var Sue=w(n$=>{"use strict";Object.defineProperty(n$,"__esModule",{value:!0});var wHe=oo(),CHe=rt(),$f=je(),vHe={message:({schemaCode:t})=>(0,$f.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,$f._)`{pattern: ${t}}`},kHe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:vHe,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:o,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:l}=i.opts.code,c=l.code==="new RegExp"?(0,$f._)`new RegExp`:(0,CHe.useFunc)(e,l),u=e.let("valid");e.try(()=>e.assign(u,(0,$f._)`${c}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,$f._)`!${u}`)}else{let l=(0,wHe.usePattern)(t,s);t.fail$data((0,$f._)`!${l}.test(${r})`)}}};n$.default=kHe});var bue=w(s$=>{"use strict";Object.defineProperty(s$,"__esModule",{value:!0});var xy=je(),AHe={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,xy.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,xy._)`{limit: ${t}}`},IHe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:AHe,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?xy.operators.GT:xy.operators.LT;t.fail$data((0,xy._)`Object.keys(${r}).length ${s} ${n}`)}};s$.default=IHe});var Tue=w(o$=>{"use strict";Object.defineProperty(o$,"__esModule",{value:!0});var My=oo(),Py=je(),DHe=rt(),RHe={message:({params:{missingProperty:t}})=>(0,Py.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Py._)`{missingProperty: ${t}}`},NHe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:RHe,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:o,it:i}=t,{opts:a}=i;if(!o&&r.length===0)return;let l=r.length>=a.loopRequired;if(i.allErrors?c():u(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:f}=t.it;for(let g of r)if(h?.[g]===void 0&&!f.has(g)){let _=i.schemaEnv.baseId+i.errSchemaPath,E=`required property "${g}" is not defined at "${_}" (strictRequired)`;(0,DHe.checkStrictMode)(i,E,i.opts.strictRequired)}}function c(){if(l||o)t.block$data(Py.nil,d);else for(let h of r)(0,My.checkReportMissingProp)(t,h)}function u(){let h=e.let("missing");if(l||o){let f=e.let("valid",!0);t.block$data(f,()=>p(h,f)),t.ok(f)}else e.if((0,My.checkMissingProp)(t,r,h)),(0,My.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",n,h=>{t.setParams({missingProperty:h}),e.if((0,My.noPropertyInData)(e,s,h,a.ownProperties),()=>t.error())})}function p(h,f){t.setParams({missingProperty:h}),e.forOf(h,n,()=>{e.assign(f,(0,My.propertyInData)(e,s,h,a.ownProperties)),e.if((0,Py.not)(f),()=>{t.error(),e.break()})},Py.nil)}}};o$.default=NHe});var wue=w(i$=>{"use strict";Object.defineProperty(i$,"__esModule",{value:!0});var Ly=je(),OHe={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Ly.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Ly._)`{limit: ${t}}`},xHe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:OHe,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?Ly.operators.GT:Ly.operators.LT;t.fail$data((0,Ly._)`${r}.length ${s} ${n}`)}};i$.default=xHe});var Nv=w(a$=>{"use strict";Object.defineProperty(a$,"__esModule",{value:!0});var Cue=R2();Cue.code='require("ajv/dist/runtime/equal").default';a$.default=Cue});var vue=w(c$=>{"use strict";Object.defineProperty(c$,"__esModule",{value:!0});var l$=Ty(),Jr=je(),MHe=rt(),PHe=Nv(),LHe={message:({params:{i:t,j:e}})=>(0,Jr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Jr._)`{i: ${t}, j: ${e}}`},FHe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:LHe,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=t;if(!n&&!s)return;let l=e.let("valid"),c=o.items?(0,l$.getSchemaTypes)(o.items):[];t.block$data(l,u,(0,Jr._)`${i} === false`),t.ok(l);function u(){let f=e.let("i",(0,Jr._)`${r}.length`),g=e.let("j");t.setParams({i:f,j:g}),e.assign(l,!0),e.if((0,Jr._)`${f} > 1`,()=>(d()?p:h)(f,g))}function d(){return c.length>0&&!c.some(f=>f==="object"||f==="array")}function p(f,g){let _=e.name("item"),E=(0,l$.checkDataTypes)(c,_,a.opts.strictNumbers,l$.DataType.Wrong),y=e.const("indices",(0,Jr._)`{}`);e.for((0,Jr._)`;${f}--;`,()=>{e.let(_,(0,Jr._)`${r}[${f}]`),e.if(E,(0,Jr._)`continue`),c.length>1&&e.if((0,Jr._)`typeof ${_} == "string"`,(0,Jr._)`${_} += "_"`),e.if((0,Jr._)`typeof ${y}[${_}] == "number"`,()=>{e.assign(g,(0,Jr._)`${y}[${_}]`),t.error(),e.assign(l,!1).break()}).code((0,Jr._)`${y}[${_}] = ${f}`)})}function h(f,g){let _=(0,MHe.useFunc)(e,PHe.default),E=e.name("outer");e.label(E).for((0,Jr._)`;${f}--;`,()=>e.for((0,Jr._)`${g} = ${f}; ${g}--;`,()=>e.if((0,Jr._)`${_}(${r}[${f}], ${r}[${g}])`,()=>{t.error(),e.assign(l,!1).break(E)})))}}};c$.default=FHe});var kue=w(d$=>{"use strict";Object.defineProperty(d$,"__esModule",{value:!0});var u$=je(),$He=rt(),UHe=Nv(),BHe={message:"must be equal to constant",params:({schemaCode:t})=>(0,u$._)`{allowedValue: ${t}}`},GHe={keyword:"const",$data:!0,error:BHe,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,u$._)`!${(0,$He.useFunc)(e,UHe.default)}(${r}, ${s})`):t.fail((0,u$._)`${o} !== ${r}`)}};d$.default=GHe});var Aue=w(p$=>{"use strict";Object.defineProperty(p$,"__esModule",{value:!0});var Fy=je(),zHe=rt(),HHe=Nv(),qHe={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Fy._)`{allowedValues: ${t}}`},jHe={keyword:"enum",schemaType:"array",$data:!0,error:qHe,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:o,it:i}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,l,c=()=>l??(l=(0,zHe.useFunc)(e,HHe.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=e.const("vSchema",o);u=(0,Fy.or)(...s.map((f,g)=>p(h,g)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,h=>e.if((0,Fy._)`${c()}(${r}, ${h})`,()=>e.assign(u,!0).break()))}function p(h,f){let g=s[f];return typeof g=="object"&&g!==null?(0,Fy._)`${c()}(${r}, ${h}[${f}])`:(0,Fy._)`${r} === ${g}`}}};p$.default=jHe});var Iue=w(m$=>{"use strict";Object.defineProperty(m$,"__esModule",{value:!0});var YHe=hue(),WHe=gue(),KHe=yue(),VHe=Sue(),QHe=bue(),XHe=Tue(),JHe=wue(),ZHe=vue(),eqe=kue(),tqe=Aue(),rqe=[YHe.default,WHe.default,KHe.default,VHe.default,QHe.default,XHe.default,JHe.default,ZHe.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},eqe.default,tqe.default];m$.default=rqe});var h$=w($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});$y.validateAdditionalItems=void 0;var Od=je(),f$=rt(),nqe={message:({params:{len:t}})=>(0,Od.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Od._)`{limit: ${t}}`},sqe={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:nqe,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,f$.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Due(t,n)}};function Due(t,e){let{gen:r,schema:n,data:s,keyword:o,it:i}=t;i.items=!0;let a=r.const("len",(0,Od._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Od._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,f$.alwaysValidSchema)(i,n)){let c=r.var("valid",(0,Od._)`${a} <= ${e.length}`);r.if((0,Od.not)(c),()=>l(c)),t.ok(c)}function l(c){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:f$.Type.Num},c),i.allErrors||r.if((0,Od.not)(c),()=>r.break())})}}$y.validateAdditionalItems=Due;$y.default=sqe});var g$=w(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});Uy.validateTuple=void 0;var Rue=je(),Ov=rt(),oqe=oo(),iqe={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Nue(t,"additionalItems",e);r.items=!0,!(0,Ov.alwaysValidSchema)(r,e)&&t.ok((0,oqe.validateArray)(t))}};function Nue(t,e,r=t.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=t;u(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Ov.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),c=n.const("len",(0,Rue._)`${o}.length`);r.forEach((d,p)=>{(0,Ov.alwaysValidSchema)(a,d)||(n.if((0,Rue._)`${c} > ${p}`,()=>t.subschema({keyword:i,schemaProp:p,dataProp:p},l)),t.ok(l))});function u(d){let{opts:p,errSchemaPath:h}=a,f=r.length,g=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(p.strictTuples&&!g){let _=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,Ov.checkStrictMode)(a,_,p.strictTuples)}}}Uy.validateTuple=Nue;Uy.default=iqe});var Oue=w(_$=>{"use strict";Object.defineProperty(_$,"__esModule",{value:!0});var aqe=g$(),lqe={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,aqe.validateTuple)(t,"items")};_$.default=lqe});var Mue=w(E$=>{"use strict";Object.defineProperty(E$,"__esModule",{value:!0});var xue=je(),cqe=rt(),uqe=oo(),dqe=h$(),pqe={message:({params:{len:t}})=>(0,xue.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,xue._)`{limit: ${t}}`},mqe={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:pqe,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,cqe.alwaysValidSchema)(n,e)&&(s?(0,dqe.validateAdditionalItems)(t,s):t.ok((0,uqe.validateArray)(t)))}};E$.default=mqe});var Pue=w(y$=>{"use strict";Object.defineProperty(y$,"__esModule",{value:!0});var ao=je(),xv=rt(),fqe={message:({params:{min:t,max:e}})=>e===void 0?(0,ao.str)`must contain at least ${t} valid item(s)`:(0,ao.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,ao._)`{minContains: ${t}}`:(0,ao._)`{minContains: ${t}, maxContains: ${e}}`},hqe={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:fqe,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:o}=t,i,a,{minContains:l,maxContains:c}=n;o.opts.next?(i=l===void 0?1:l,a=c):i=1;let u=e.const("len",(0,ao._)`${s}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,xv.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,xv.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,xv.alwaysValidSchema)(o,r)){let g=(0,ao._)`${u} >= ${i}`;a!==void 0&&(g=(0,ao._)`${g} && ${u} <= ${a}`),t.pass(g);return}o.items=!0;let d=e.name("valid");a===void 0&&i===1?h(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,ao._)`${s}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let g=e.name("_valid"),_=e.let("count",0);h(g,()=>e.if(g,()=>f(_)))}function h(g,_){e.forRange("i",0,u,E=>{t.subschema({keyword:"contains",dataProp:E,dataPropType:xv.Type.Num,compositeRule:!0},g),_()})}function f(g){e.code((0,ao._)`${g}++`),a===void 0?e.if((0,ao._)`${g} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,ao._)`${g} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,ao._)`${g} >= ${i}`,()=>e.assign(d,!0)))}}};y$.default=hqe});var $ue=w(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.validateSchemaDeps=Bi.validatePropertyDeps=Bi.error=void 0;var S$=je(),gqe=rt(),By=oo();Bi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,S$.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,S$._)`{property: ${t},
1188
1188
  missingProperty: ${n},
1189
1189
  depsCount: ${e},
1190
- deps: ${r}}`};var _qe={keyword:"dependencies",type:"object",schemaType:"object",error:Bi.error,code(t){let[e,r]=Eqe(t);Lue(t,e),Fue(t,r)}};function Eqe({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function Lue(t,e=t.schema){let{gen:r,data:n,it:s}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let l=(0,By.propertyInData)(r,n,i,s.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors?r.if(l,()=>{for(let c of a)(0,By.checkReportMissingProp)(t,c)}):(r.if((0,S$._)`${l} && (${(0,By.checkMissingProp)(t,a,o)})`),(0,By.reportMissingProp)(t,o),r.else())}}Bi.validatePropertyDeps=Lue;function Fue(t,e=t.schema){let{gen:r,data:n,keyword:s,it:o}=t,i=r.name("valid");for(let a in e)(0,gqe.alwaysValidSchema)(o,e[a])||(r.if((0,By.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let l=t.subschema({keyword:s,schemaProp:a},i);t.mergeValidEvaluated(l,i)},()=>r.var(i,!0)),t.ok(i))}Bi.validateSchemaDeps=Fue;Bi.default=_qe});var Bue=w(b$=>{"use strict";Object.defineProperty(b$,"__esModule",{value:!0});var Uue=je(),yqe=tt(),Sqe={message:"property name must be valid",params:({params:t})=>(0,Uue._)`{propertyName: ${t.propertyName}}`},bqe={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Sqe,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,yqe.alwaysValidSchema)(s,r))return;let o=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),e.if((0,Uue.not)(o),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(o)}};b$.default=bqe});var w$=w(T$=>{"use strict";Object.defineProperty(T$,"__esModule",{value:!0});var Mv=oo(),Ko=je(),Tqe=Wa(),Pv=tt(),wqe={message:"must NOT have additional properties",params:({params:t})=>(0,Ko._)`{additionalProperty: ${t.additionalProperty}}`},Cqe={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:wqe,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:l}=i;if(i.props=!0,l.removeAdditional!=="all"&&(0,Pv.alwaysValidSchema)(i,r))return;let c=(0,Mv.allSchemaProperties)(n.properties),u=(0,Mv.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Ko._)`${o} === ${Tqe.default.errors}`);function d(){e.forIn("key",s,_=>{!c.length&&!u.length?f(_):e.if(p(_),()=>f(_))})}function p(_){let E;if(c.length>8){let y=(0,Pv.schemaRefOrVal)(i,n.properties,"properties");E=(0,Mv.isOwnProperty)(e,y,_)}else c.length?E=(0,Ko.or)(...c.map(y=>(0,Ko._)`${_} === ${y}`)):E=Ko.nil;return u.length&&(E=(0,Ko.or)(E,...u.map(y=>(0,Ko._)`${(0,Mv.usePattern)(t,y)}.test(${_})`))),(0,Ko.not)(E)}function h(_){e.code((0,Ko._)`delete ${s}[${_}]`)}function f(_){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(_);return}if(r===!1){t.setParams({additionalProperty:_}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Pv.alwaysValidSchema)(i,r)){let E=e.name("valid");l.removeAdditional==="failing"?(g(_,E,!1),e.if((0,Ko.not)(E),()=>{t.reset(),h(_)})):(g(_,E),a||e.if((0,Ko.not)(E),()=>e.break()))}}function g(_,E,y){let S={keyword:"additionalProperties",dataProp:_,dataPropType:Pv.Type.Str};y===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,E)}}};T$.default=Cqe});var Hue=w(v$=>{"use strict";Object.defineProperty(v$,"__esModule",{value:!0});var vqe=ky(),Gue=oo(),C$=tt(),zue=w$(),kqe={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&zue.default.code(new vqe.KeywordCxt(o,zue.default,"additionalProperties"));let i=(0,Gue.allSchemaProperties)(r);for(let d of i)o.definedProperties.add(d);o.opts.unevaluated&&i.length&&o.props!==!0&&(o.props=C$.mergeEvaluated.props(e,(0,C$.toHash)(i),o.props));let a=i.filter(d=>!(0,C$.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let l=e.name("valid");for(let d of a)c(d)?u(d):(e.if((0,Gue.propertyInData)(e,s,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(l);function c(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},l)}}};v$.default=kqe});var Wue=w(k$=>{"use strict";Object.defineProperty(k$,"__esModule",{value:!0});var que=oo(),Lv=je(),jue=tt(),Yue=tt(),Aqe={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:o}=t,{opts:i}=o,a=(0,que.allSchemaProperties)(r),l=a.filter(g=>(0,jue.alwaysValidSchema)(o,r[g]));if(a.length===0||l.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let c=i.strictSchema&&!i.allowMatchingProperties&&s.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof Lv.Name)&&(o.props=(0,Yue.evaluatedPropsToName)(e,o.props));let{props:d}=o;p();function p(){for(let g of a)c&&h(g),o.allErrors?f(g):(e.var(u,!0),f(g),e.if(u))}function h(g){for(let _ in c)new RegExp(g).test(_)&&(0,jue.checkStrictMode)(o,`property ${_} matches pattern ${g} (use allowMatchingProperties)`)}function f(g){e.forIn("key",n,_=>{e.if((0,Lv._)`${(0,que.usePattern)(t,g)}.test(${_})`,()=>{let E=l.includes(g);E||t.subschema({keyword:"patternProperties",schemaProp:g,dataProp:_,dataPropType:Yue.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,Lv._)`${d}[${_}]`,!0):!E&&!o.allErrors&&e.if((0,Lv.not)(u),()=>e.break())})})}}};k$.default=Aqe});var Kue=w(A$=>{"use strict";Object.defineProperty(A$,"__esModule",{value:!0});var Iqe=tt(),Dqe={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Iqe.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};A$.default=Dqe});var Vue=w(I$=>{"use strict";Object.defineProperty(I$,"__esModule",{value:!0});var Rqe=oo(),Nqe={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Rqe.validateUnion,error:{message:"must match a schema in anyOf"}};I$.default=Nqe});var Que=w(D$=>{"use strict";Object.defineProperty(D$,"__esModule",{value:!0});var Fv=je(),Oqe=tt(),xqe={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Fv._)`{passingSchemas: ${t.passing}}`},Mqe={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:xqe,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,i=e.let("valid",!1),a=e.let("passing",null),l=e.name("_valid");t.setParams({passing:a}),e.block(c),t.result(i,()=>t.reset(),()=>t.error(!0));function c(){o.forEach((u,d)=>{let p;(0,Oqe.alwaysValidSchema)(s,u)?e.var(l,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},l),d>0&&e.if((0,Fv._)`${l} && ${i}`).assign(i,!1).assign(a,(0,Fv._)`[${a}, ${d}]`).else(),e.if(l,()=>{e.assign(i,!0),e.assign(a,d),p&&t.mergeEvaluated(p,Fv.Name)})})}}};D$.default=Mqe});var Xue=w(R$=>{"use strict";Object.defineProperty(R$,"__esModule",{value:!0});var Pqe=tt(),Lqe={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((o,i)=>{if((0,Pqe.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:i},s);t.ok(s),t.mergeEvaluated(a)})}};R$.default=Lqe});var ede=w(N$=>{"use strict";Object.defineProperty(N$,"__esModule",{value:!0});var $v=je(),Zue=tt(),Fqe={message:({params:t})=>(0,$v.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,$v._)`{failingKeyword: ${t.ifClause}}`},$qe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Fqe,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Zue.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=Jue(n,"then"),o=Jue(n,"else");if(!s&&!o)return;let i=e.let("valid",!0),a=e.name("_valid");if(l(),t.reset(),s&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,c("then",u),c("else",u))}else s?e.if(a,c("then")):e.if((0,$v.not)(a),c("else"));t.pass(i,()=>t.error(!0));function l(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function c(u,d){return()=>{let p=t.subschema({keyword:u},a);e.assign(i,a),t.mergeValidEvaluated(p,i),d?e.assign(d,(0,$v._)`${u}`):t.setParams({ifClause:u})}}}};function Jue(t,e){let r=t.schema[e];return r!==void 0&&!(0,Zue.alwaysValidSchema)(t,r)}N$.default=$qe});var tde=w(O$=>{"use strict";Object.defineProperty(O$,"__esModule",{value:!0});var Uqe=tt(),Bqe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Uqe.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};O$.default=Bqe});var rde=w(x$=>{"use strict";Object.defineProperty(x$,"__esModule",{value:!0});var Gqe=h$(),zqe=Oue(),Hqe=g$(),qqe=Mue(),jqe=Pue(),Yqe=$ue(),Wqe=Bue(),Kqe=w$(),Vqe=Hue(),Qqe=Wue(),Xqe=Kue(),Jqe=Vue(),Zqe=Que(),eje=Xue(),tje=ede(),rje=tde();function nje(t=!1){let e=[Xqe.default,Jqe.default,Zqe.default,eje.default,tje.default,rje.default,Wqe.default,Kqe.default,Yqe.default,Vqe.default,Qqe.default];return t?e.push(zqe.default,qqe.default):e.push(Gqe.default,Hqe.default),e.push(jqe.default),e}x$.default=nje});var nde=w(M$=>{"use strict";Object.defineProperty(M$,"__esModule",{value:!0});var cr=je(),sje={message:({schemaCode:t})=>(0,cr.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,cr._)`{format: ${t}}`},oje={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:sje,code(t,e){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=t,{opts:l,errSchemaPath:c,schemaEnv:u,self:d}=a;if(!l.validateFormats)return;s?p():h();function p(){let f=r.scopeValue("formats",{ref:d.formats,code:l.code.formats}),g=r.const("fDef",(0,cr._)`${f}[${i}]`),_=r.let("fType"),E=r.let("format");r.if((0,cr._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(_,(0,cr._)`${g}.type || "string"`).assign(E,(0,cr._)`${g}.validate`),()=>r.assign(_,(0,cr._)`"string"`).assign(E,g)),t.fail$data((0,cr.or)(y(),S()));function y(){return l.strictSchema===!1?cr.nil:(0,cr._)`${i} && !${E}`}function S(){let T=u.$async?(0,cr._)`(${g}.async ? await ${E}(${n}) : ${E}(${n}))`:(0,cr._)`${E}(${n})`,C=(0,cr._)`(typeof ${E} == "function" ? ${T} : ${E}.test(${n}))`;return(0,cr._)`${E} && ${E} !== true && ${_} === ${e} && !${C}`}}function h(){let f=d.formats[o];if(!f){y();return}if(f===!0)return;let[g,_,E]=S(f);g===e&&t.pass(T());function y(){if(l.strictSchema===!1){d.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${o}" ignored in schema at path "${c}"`}}function S(C){let v=C instanceof RegExp?(0,cr.regexpCode)(C):l.code.formats?(0,cr._)`${l.code.formats}${(0,cr.getProperty)(o)}`:void 0,A=r.scopeValue("formats",{key:o,ref:C,code:v});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,cr._)`${A}.validate`]:["string",C,A]}function T(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!u.$async)throw new Error("async format in sync schema");return(0,cr._)`await ${E}(${n})`}return typeof _=="function"?(0,cr._)`${E}(${n})`:(0,cr._)`${E}.test(${n})`}}}};M$.default=oje});var sde=w(P$=>{"use strict";Object.defineProperty(P$,"__esModule",{value:!0});var ije=nde(),aje=[ije.default];P$.default=aje});var ode=w(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.contentVocabulary=Uf.metadataVocabulary=void 0;Uf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Uf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ade=w(L$=>{"use strict";Object.defineProperty(L$,"__esModule",{value:!0});var lje=fue(),cje=Iue(),uje=rde(),dje=sde(),ide=ode(),pje=[lje.default,cje.default,(0,uje.default)(),dje.default,ide.metadataVocabulary,ide.contentVocabulary];L$.default=pje});var cde=w(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});Uv.DiscrError=void 0;var lde;(function(t){t.Tag="tag",t.Mapping="mapping"})(lde||(Uv.DiscrError=lde={}))});var dde=w($$=>{"use strict";Object.defineProperty($$,"__esModule",{value:!0});var Bf=je(),F$=cde(),ude=Sv(),mje=Ay(),fje=tt(),hje={message:({params:{discrError:t,tagName:e}})=>t===F$.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Bf._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},gje={keyword:"discriminator",type:"object",schemaType:"object",error:hje,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:o}=t,{oneOf:i}=s;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),c=e.const("tag",(0,Bf._)`${r}${(0,Bf.getProperty)(a)}`);e.if((0,Bf._)`typeof ${c} == "string"`,()=>u(),()=>t.error(!1,{discrError:F$.DiscrError.Tag,tag:c,tagName:a})),t.ok(l);function u(){let h=p();e.if(!1);for(let f in h)e.elseIf((0,Bf._)`${c} === ${f}`),e.assign(l,d(h[f]));e.else(),t.error(!1,{discrError:F$.DiscrError.Mapping,tag:c,tagName:a}),e.endIf()}function d(h){let f=e.name("valid"),g=t.subschema({keyword:"oneOf",schemaProp:h},f);return t.mergeEvaluated(g,Bf.Name),f}function p(){var h;let f={},g=E(s),_=!0;for(let T=0;T<i.length;T++){let C=i[T];if(C?.$ref&&!(0,fje.schemaHasRulesButRef)(C,o.self.RULES)){let A=C.$ref;if(C=ude.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,A),C instanceof ude.SchemaEnv&&(C=C.schema),C===void 0)throw new mje.default(o.opts.uriResolver,o.baseId,A)}let v=(h=C?.properties)===null||h===void 0?void 0:h[a];if(typeof v!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);_=_&&(g||E(C)),y(v,T)}if(!_)throw new Error(`discriminator: "${a}" must be required`);return f;function E({required:T}){return Array.isArray(T)&&T.includes(a)}function y(T,C){if(T.const)S(T.const,C);else if(T.enum)for(let v of T.enum)S(v,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function S(T,C){if(typeof T!="string"||T in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[T]=C}}}};$$.default=gje});var pde=w((P0t,_je)=>{_je.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var fde=w(($t,U$)=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.MissingRefError=$t.ValidationError=$t.CodeGen=$t.Name=$t.nil=$t.stringify=$t.str=$t._=$t.KeywordCxt=$t.Ajv=void 0;var Eje=lue(),yje=ade(),Sje=dde(),mde=pde(),bje=["/properties"],Bv="http://json-schema.org/draft-07/schema",Gf=class extends Eje.default{_addVocabularies(){super._addVocabularies(),yje.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Sje.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(mde,bje):mde;this.addMetaSchema(e,Bv,!1),this.refs["http://json-schema.org/schema"]=Bv}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Bv)?Bv:void 0)}};$t.Ajv=Gf;U$.exports=$t=Gf;U$.exports.Ajv=Gf;Object.defineProperty($t,"__esModule",{value:!0});$t.default=Gf;var Tje=ky();Object.defineProperty($t,"KeywordCxt",{enumerable:!0,get:function(){return Tje.KeywordCxt}});var zf=je();Object.defineProperty($t,"_",{enumerable:!0,get:function(){return zf._}});Object.defineProperty($t,"str",{enumerable:!0,get:function(){return zf.str}});Object.defineProperty($t,"stringify",{enumerable:!0,get:function(){return zf.stringify}});Object.defineProperty($t,"nil",{enumerable:!0,get:function(){return zf.nil}});Object.defineProperty($t,"Name",{enumerable:!0,get:function(){return zf.Name}});Object.defineProperty($t,"CodeGen",{enumerable:!0,get:function(){return zf.CodeGen}});var wje=Ev();Object.defineProperty($t,"ValidationError",{enumerable:!0,get:function(){return wje.default}});var Cje=Ay();Object.defineProperty($t,"MissingRefError",{enumerable:!0,get:function(){return Cje.default}})});var hde,gde=k(()=>{"use strict";hde={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://aiiware.com/schema/persona.v0.1.json",title:"Aii Persona Manifest",description:"Schema for persona.json \u2014 the manifest file for Aii workspace personas.",type:"object",required:["name","version","description","author"],patternProperties:{"^x-[a-z]+-":{description:"Vendor extension fields."}},properties:{$schema:{type:"string",description:"JSON Schema reference URL."},specVersion:{type:"string",description:"Schema version (e.g., '0.1'). Required for structured instructions and agents field."},name:{type:"string",pattern:"^[a-z0-9-]+/[a-z0-9-]+$",description:"Unique identifier in owner/name format (lowercase, hyphens only)."},version:{type:"string",pattern:"^v?\\d+\\.\\d+\\.\\d+",description:"Semantic version (e.g., '1.0.0' or 'v1.0.0')."},displayName:{type:"string",maxLength:100,description:"Human-readable display name."},description:{type:"string",maxLength:500,description:"Short description of the persona."},author:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string"},email:{type:"string",format:"email"}},description:"Persona author information."},license:{type:"string",description:"SPDX license identifier (e.g., 'MIT', 'Apache-2.0')."},homepage:{type:"string",format:"uri",description:"URL to the persona's homepage or documentation."},repository:{type:"string",description:"URL to the persona's source repository."},components:{$ref:"#/definitions/ComponentsBlock"},soul:{oneOf:[{$ref:"#/definitions/InlineSoulDef"},{$ref:"#/definitions/SoulPathRef"},{$ref:"#/definitions/SoulNamespace"}],description:"Soul definition \u2014 inline, path reference, or SoulSpec namespace."},skills:{type:"array",items:{type:"string"},description:"List of bundled skill directory names."},hooks:{type:"object",additionalProperties:{type:"array",items:{$ref:"#/definitions/HookDefinition"}},description:"Hook event handlers keyed by event name."},mcpServers:{type:"object",additionalProperties:!0,description:"MCP server configurations."},instructions:{oneOf:[{type:"string",description:"Flat instructions string."},{type:"object",properties:{soul:{type:"string",description:"Core personality, values, character traits."},identity:{type:"string",description:"Name, role, brand presence."},style:{type:"string",description:"Tone, vocabulary, communication patterns."},heartbeat:{type:"string",description:"Availability, response rhythm."},workflow:{type:"string",description:"Step-by-step behavioral workflow."}},description:"Structured instructions object (requires specVersion 0.1+)."}],description:"Persona-specific instructions \u2014 string or structured object."},theme:{type:"string",description:"Theme name to apply when persona is activated."},tags:{type:"array",items:{type:"string"},description:"Discovery tags."},category:{type:"string",description:"Primary category for persona discovery."},keywords:{type:"array",items:{type:"string"},description:"Search keywords."},agents:{type:"object",additionalProperties:{type:"string"},description:'Cross-agent compatibility \u2014 product-level canonical IDs with semver ranges (e.g., { "aii": ">=0.14.6", "claude-code": "*" }).'},model:{type:"object",properties:{providers:{type:"array",items:{type:"string"},description:"Supported LLM providers."},recommended:{type:"object",properties:{provider:{type:"string"},model:{type:"string"},reason:{type:"string"}},description:"Recommended model configuration."},minimumTier:{type:"string",description:"Minimum model capability tier (e.g., 'mid', 'high')."}},description:"LLM model requirements."},compatibility:{type:"object",properties:{"aii-cli":{type:"string",description:"Minimum Aii CLI version required (semver range)."},providers:{type:"array",items:{type:"string"},description:"Supported LLM provider names."},recommended:{type:"object",properties:{provider:{type:"string"},model:{type:"string"},reason:{type:"string"}}},minimumTier:{type:"string"},souls:{type:"array",items:{type:"string"},description:"Compatible soul names."}},description:"DEPRECATED: Use 'agents' + 'model' instead. Compatibility constraints."},performance:{type:"object",additionalProperties:!1,properties:{estimatedMetadataTokens:{type:"integer",minimum:0,description:"Estimated token count for persona metadata."},maxSkills:{type:"integer",minimum:1,description:"Maximum recommended skills for this persona."}},description:"Performance hints."}},definitions:{InlineSoulDef:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string"},identity:{type:"string"},style:{type:"string"},heartbeat:{type:"string"},workflow:{type:"string"}}},SoulPathRef:{type:"object",required:["name","path"],additionalProperties:!1,properties:{name:{type:"string"},path:{type:"string"}}},SoulNamespace:{type:"object",required:["files"],properties:{specVersion:{type:"string"},files:{type:"object",properties:{soul:{type:"string"},identity:{type:"string"},style:{type:"string"},heartbeat:{type:"string"},workflow:{type:"string"}},description:"Soul file paths (relative to persona root)."},calibration:{type:"object",properties:{good:{type:"string"},bad:{type:"string"}},description:"Calibration example file paths."}},description:"Full SoulSpec namespace with dedicated files."},HookDefinition:{type:"object",properties:{type:{type:"string",enum:["script","prompt"]},command:{type:"string"},prompt:{type:"string"},tools:{type:"array",items:{type:"string"}},timeout:{type:"number",minimum:0},enabled:{type:"boolean"}}},ComponentsBlock:{type:"object",additionalProperties:!1,properties:{soul:{$ref:"#/definitions/ComponentRef"},skills:{type:"array",items:{$ref:"#/definitions/ComponentRef"}},mcpServers:{type:"array",items:{$ref:"#/definitions/ComponentRef"}},hooks:{$ref:"#/definitions/ComponentRef"},theme:{$ref:"#/definitions/ComponentRef"}}},ComponentRef:{type:"object",required:["source"],additionalProperties:!1,properties:{source:{type:"string",enum:["bundled","pack","registry","npm","pip","local"]},name:{type:"string"},path:{type:"string"},ref:{type:"string"},version:{type:"string"},skills:{type:"array",items:{type:"string"}},package:{type:"string"},config:{type:"object",additionalProperties:!0}}}}}});function kje(){return _de??=vje.compile(hde),_de}function Aje(t){return`${t.instancePath&&t.instancePath.length>0?t.instancePath:"(root)"} ${t.message??"is invalid"}`.trim()}function Hf(t){if(t===null||typeof t!="object"||Array.isArray(t))return{ok:!1,errors:["manifest is not a JSON object"]};let e=kje();return e(t)?{ok:!0,errors:[]}:{ok:!1,errors:(e.errors??[]).map(Aje)}}var Ede,vje,_de,B$=k(()=>{"use strict";Ede=Dt(fde(),1);gde();vje=new Ede.Ajv({allErrors:!0,strict:!1,validateFormats:!1}),_de=null});var yde,Va,G$=k(()=>{"use strict";yde=Dt(MC(),1);bs();Va=class t{static parse(e,r){if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`Invalid persona.json at ${r}: expected a JSON object`);let n=e;if(typeof n.name!="string")throw new Error(`Invalid persona.json at ${r}: "name" is required and must be a string`);if(t.validateName(n.name),typeof n.version!="string")throw new Error(`Invalid persona.json at ${r}: "version" is required and must be a string`);if(t.validateVersion(n.version),n.version=t.normalizeVersion(n.version),typeof n.description!="string")throw new Error(`Invalid persona.json at ${r}: "description" is required and must be a string`);if(n.description.length>dT)throw new Error(`Invalid persona.json at ${r}: "description" exceeds maximum length of ${dT} characters`);if(n.author===null||typeof n.author!="object"||Array.isArray(n.author))throw new Error(`Invalid persona.json at ${r}: "author" is required and must be an object with a "name" field`);if(typeof n.author.name!="string")throw new Error(`Invalid persona.json at ${r}: "author.name" is required and must be a string`);if(n.specVersion&&typeof n.specVersion!="string")throw new Error(`Invalid specVersion: expected string, got ${typeof n.specVersion}`);if(n.agents){if(typeof n.agents!="object"||Array.isArray(n.agents))throw new Error("Invalid agents field: expected Record<string, string>");for(let[o,i]of Object.entries(n.agents))if(typeof i!="string")throw new Error(`Invalid agents value for '${o}': expected semver range string`)}if(n.instructions&&typeof n.instructions=="object"&&!n.specVersion)throw new Error('Structured instructions require specVersion "0.1" or later');if(n.compatibility){let o=n.compatibility;if(!n.agents&&o["aii-cli"]&&(n.agents={aii:o["aii-cli"]}),!n.model){let{providers:i,recommended:a,minimumTier:l}=o;(i||a||l)&&(n.model={providers:i,recommended:a,minimumTier:l})}}return n}static validateName(e){if(e.length>uT)throw new Error(`Pack name "${e}" exceeds maximum length of ${uT} characters`);if(!KN.test(e))throw new Error(`Pack name "${e}" is invalid. Must match owner/name format using lowercase alphanumeric characters and hyphens (e.g., "my-org/my-pack")`)}static validateVersion(e){let r=e.startsWith("v")?e.slice(1):e;if(!yde.default.valid(r))throw new Error(`Pack version "${e}" is not valid semver. Expected format: 0.1.0 or v0.1.0`)}static normalizeVersion(e){return e.startsWith("v")?e.slice(1):e}static normalizeToComponents(e){if(e.components)return e.components;let r={};return e.soul&&(r.soul={source:"bundled",...e.soul}),e.skills&&e.skills.length>0&&(r.skills=e.skills.map(n=>({source:"bundled",name:n}))),e.hooks&&(r.hooks={source:"bundled"}),e.theme&&(r.theme={source:"bundled",name:e.theme}),r}static filterBundledOnly(e){let r={},n=[];if(e.soul&&(e.soul.source==="bundled"?r.soul=e.soul:n.push(`Non-bundled component source '${e.soul.source}' not supported in this version. Skipping.`)),e.skills){let s=[];for(let o of e.skills)o.source==="bundled"?s.push(o):n.push(`Non-bundled component source '${o.source}' not supported in this version. Skipping.`);s.length>0&&(r.skills=s)}if(e.mcpServers){let s=[];for(let o of e.mcpServers)o.source==="bundled"?s.push(o):n.push(`Non-bundled component source '${o.source}' not supported in this version. Skipping.`);s.length>0&&(r.mcpServers=s)}return e.hooks&&(e.hooks.source==="bundled"?r.hooks=e.hooks:n.push(`Non-bundled component source '${e.hooks.source}' not supported in this version. Skipping.`)),e.theme&&(e.theme.source==="bundled"?r.theme=e.theme:n.push(`Non-bundled component source '${e.theme.source}' not supported in this version. Skipping.`)),{filtered:r,warnings:n}}}});function Sde(t){if(t==null)return;if(typeof t=="string")return t;let e=[];for(let r of Ije){let n=t[r];n&&e.push(`<${r}>
1190
+ deps: ${r}}`};var _qe={keyword:"dependencies",type:"object",schemaType:"object",error:Bi.error,code(t){let[e,r]=Eqe(t);Lue(t,e),Fue(t,r)}};function Eqe({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function Lue(t,e=t.schema){let{gen:r,data:n,it:s}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let l=(0,By.propertyInData)(r,n,i,s.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors?r.if(l,()=>{for(let c of a)(0,By.checkReportMissingProp)(t,c)}):(r.if((0,S$._)`${l} && (${(0,By.checkMissingProp)(t,a,o)})`),(0,By.reportMissingProp)(t,o),r.else())}}Bi.validatePropertyDeps=Lue;function Fue(t,e=t.schema){let{gen:r,data:n,keyword:s,it:o}=t,i=r.name("valid");for(let a in e)(0,gqe.alwaysValidSchema)(o,e[a])||(r.if((0,By.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let l=t.subschema({keyword:s,schemaProp:a},i);t.mergeValidEvaluated(l,i)},()=>r.var(i,!0)),t.ok(i))}Bi.validateSchemaDeps=Fue;Bi.default=_qe});var Bue=w(b$=>{"use strict";Object.defineProperty(b$,"__esModule",{value:!0});var Uue=je(),yqe=rt(),Sqe={message:"property name must be valid",params:({params:t})=>(0,Uue._)`{propertyName: ${t.propertyName}}`},bqe={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Sqe,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,yqe.alwaysValidSchema)(s,r))return;let o=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),e.if((0,Uue.not)(o),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(o)}};b$.default=bqe});var w$=w(T$=>{"use strict";Object.defineProperty(T$,"__esModule",{value:!0});var Mv=oo(),Ko=je(),Tqe=Wa(),Pv=rt(),wqe={message:"must NOT have additional properties",params:({params:t})=>(0,Ko._)`{additionalProperty: ${t.additionalProperty}}`},Cqe={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:wqe,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:l}=i;if(i.props=!0,l.removeAdditional!=="all"&&(0,Pv.alwaysValidSchema)(i,r))return;let c=(0,Mv.allSchemaProperties)(n.properties),u=(0,Mv.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Ko._)`${o} === ${Tqe.default.errors}`);function d(){e.forIn("key",s,_=>{!c.length&&!u.length?f(_):e.if(p(_),()=>f(_))})}function p(_){let E;if(c.length>8){let y=(0,Pv.schemaRefOrVal)(i,n.properties,"properties");E=(0,Mv.isOwnProperty)(e,y,_)}else c.length?E=(0,Ko.or)(...c.map(y=>(0,Ko._)`${_} === ${y}`)):E=Ko.nil;return u.length&&(E=(0,Ko.or)(E,...u.map(y=>(0,Ko._)`${(0,Mv.usePattern)(t,y)}.test(${_})`))),(0,Ko.not)(E)}function h(_){e.code((0,Ko._)`delete ${s}[${_}]`)}function f(_){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(_);return}if(r===!1){t.setParams({additionalProperty:_}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Pv.alwaysValidSchema)(i,r)){let E=e.name("valid");l.removeAdditional==="failing"?(g(_,E,!1),e.if((0,Ko.not)(E),()=>{t.reset(),h(_)})):(g(_,E),a||e.if((0,Ko.not)(E),()=>e.break()))}}function g(_,E,y){let S={keyword:"additionalProperties",dataProp:_,dataPropType:Pv.Type.Str};y===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,E)}}};T$.default=Cqe});var Hue=w(v$=>{"use strict";Object.defineProperty(v$,"__esModule",{value:!0});var vqe=ky(),Gue=oo(),C$=rt(),zue=w$(),kqe={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&zue.default.code(new vqe.KeywordCxt(o,zue.default,"additionalProperties"));let i=(0,Gue.allSchemaProperties)(r);for(let d of i)o.definedProperties.add(d);o.opts.unevaluated&&i.length&&o.props!==!0&&(o.props=C$.mergeEvaluated.props(e,(0,C$.toHash)(i),o.props));let a=i.filter(d=>!(0,C$.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let l=e.name("valid");for(let d of a)c(d)?u(d):(e.if((0,Gue.propertyInData)(e,s,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(l);function c(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},l)}}};v$.default=kqe});var Wue=w(k$=>{"use strict";Object.defineProperty(k$,"__esModule",{value:!0});var que=oo(),Lv=je(),jue=rt(),Yue=rt(),Aqe={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:o}=t,{opts:i}=o,a=(0,que.allSchemaProperties)(r),l=a.filter(g=>(0,jue.alwaysValidSchema)(o,r[g]));if(a.length===0||l.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let c=i.strictSchema&&!i.allowMatchingProperties&&s.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof Lv.Name)&&(o.props=(0,Yue.evaluatedPropsToName)(e,o.props));let{props:d}=o;p();function p(){for(let g of a)c&&h(g),o.allErrors?f(g):(e.var(u,!0),f(g),e.if(u))}function h(g){for(let _ in c)new RegExp(g).test(_)&&(0,jue.checkStrictMode)(o,`property ${_} matches pattern ${g} (use allowMatchingProperties)`)}function f(g){e.forIn("key",n,_=>{e.if((0,Lv._)`${(0,que.usePattern)(t,g)}.test(${_})`,()=>{let E=l.includes(g);E||t.subschema({keyword:"patternProperties",schemaProp:g,dataProp:_,dataPropType:Yue.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,Lv._)`${d}[${_}]`,!0):!E&&!o.allErrors&&e.if((0,Lv.not)(u),()=>e.break())})})}}};k$.default=Aqe});var Kue=w(A$=>{"use strict";Object.defineProperty(A$,"__esModule",{value:!0});var Iqe=rt(),Dqe={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Iqe.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};A$.default=Dqe});var Vue=w(I$=>{"use strict";Object.defineProperty(I$,"__esModule",{value:!0});var Rqe=oo(),Nqe={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Rqe.validateUnion,error:{message:"must match a schema in anyOf"}};I$.default=Nqe});var Que=w(D$=>{"use strict";Object.defineProperty(D$,"__esModule",{value:!0});var Fv=je(),Oqe=rt(),xqe={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Fv._)`{passingSchemas: ${t.passing}}`},Mqe={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:xqe,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,i=e.let("valid",!1),a=e.let("passing",null),l=e.name("_valid");t.setParams({passing:a}),e.block(c),t.result(i,()=>t.reset(),()=>t.error(!0));function c(){o.forEach((u,d)=>{let p;(0,Oqe.alwaysValidSchema)(s,u)?e.var(l,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},l),d>0&&e.if((0,Fv._)`${l} && ${i}`).assign(i,!1).assign(a,(0,Fv._)`[${a}, ${d}]`).else(),e.if(l,()=>{e.assign(i,!0),e.assign(a,d),p&&t.mergeEvaluated(p,Fv.Name)})})}}};D$.default=Mqe});var Xue=w(R$=>{"use strict";Object.defineProperty(R$,"__esModule",{value:!0});var Pqe=rt(),Lqe={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((o,i)=>{if((0,Pqe.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:i},s);t.ok(s),t.mergeEvaluated(a)})}};R$.default=Lqe});var ede=w(N$=>{"use strict";Object.defineProperty(N$,"__esModule",{value:!0});var $v=je(),Zue=rt(),Fqe={message:({params:t})=>(0,$v.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,$v._)`{failingKeyword: ${t.ifClause}}`},$qe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Fqe,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Zue.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=Jue(n,"then"),o=Jue(n,"else");if(!s&&!o)return;let i=e.let("valid",!0),a=e.name("_valid");if(l(),t.reset(),s&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,c("then",u),c("else",u))}else s?e.if(a,c("then")):e.if((0,$v.not)(a),c("else"));t.pass(i,()=>t.error(!0));function l(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function c(u,d){return()=>{let p=t.subschema({keyword:u},a);e.assign(i,a),t.mergeValidEvaluated(p,i),d?e.assign(d,(0,$v._)`${u}`):t.setParams({ifClause:u})}}}};function Jue(t,e){let r=t.schema[e];return r!==void 0&&!(0,Zue.alwaysValidSchema)(t,r)}N$.default=$qe});var tde=w(O$=>{"use strict";Object.defineProperty(O$,"__esModule",{value:!0});var Uqe=rt(),Bqe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Uqe.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};O$.default=Bqe});var rde=w(x$=>{"use strict";Object.defineProperty(x$,"__esModule",{value:!0});var Gqe=h$(),zqe=Oue(),Hqe=g$(),qqe=Mue(),jqe=Pue(),Yqe=$ue(),Wqe=Bue(),Kqe=w$(),Vqe=Hue(),Qqe=Wue(),Xqe=Kue(),Jqe=Vue(),Zqe=Que(),eje=Xue(),tje=ede(),rje=tde();function nje(t=!1){let e=[Xqe.default,Jqe.default,Zqe.default,eje.default,tje.default,rje.default,Wqe.default,Kqe.default,Yqe.default,Vqe.default,Qqe.default];return t?e.push(zqe.default,qqe.default):e.push(Gqe.default,Hqe.default),e.push(jqe.default),e}x$.default=nje});var nde=w(M$=>{"use strict";Object.defineProperty(M$,"__esModule",{value:!0});var cr=je(),sje={message:({schemaCode:t})=>(0,cr.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,cr._)`{format: ${t}}`},oje={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:sje,code(t,e){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=t,{opts:l,errSchemaPath:c,schemaEnv:u,self:d}=a;if(!l.validateFormats)return;s?p():h();function p(){let f=r.scopeValue("formats",{ref:d.formats,code:l.code.formats}),g=r.const("fDef",(0,cr._)`${f}[${i}]`),_=r.let("fType"),E=r.let("format");r.if((0,cr._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(_,(0,cr._)`${g}.type || "string"`).assign(E,(0,cr._)`${g}.validate`),()=>r.assign(_,(0,cr._)`"string"`).assign(E,g)),t.fail$data((0,cr.or)(y(),S()));function y(){return l.strictSchema===!1?cr.nil:(0,cr._)`${i} && !${E}`}function S(){let T=u.$async?(0,cr._)`(${g}.async ? await ${E}(${n}) : ${E}(${n}))`:(0,cr._)`${E}(${n})`,C=(0,cr._)`(typeof ${E} == "function" ? ${T} : ${E}.test(${n}))`;return(0,cr._)`${E} && ${E} !== true && ${_} === ${e} && !${C}`}}function h(){let f=d.formats[o];if(!f){y();return}if(f===!0)return;let[g,_,E]=S(f);g===e&&t.pass(T());function y(){if(l.strictSchema===!1){d.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${o}" ignored in schema at path "${c}"`}}function S(C){let v=C instanceof RegExp?(0,cr.regexpCode)(C):l.code.formats?(0,cr._)`${l.code.formats}${(0,cr.getProperty)(o)}`:void 0,A=r.scopeValue("formats",{key:o,ref:C,code:v});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,cr._)`${A}.validate`]:["string",C,A]}function T(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!u.$async)throw new Error("async format in sync schema");return(0,cr._)`await ${E}(${n})`}return typeof _=="function"?(0,cr._)`${E}(${n})`:(0,cr._)`${E}.test(${n})`}}}};M$.default=oje});var sde=w(P$=>{"use strict";Object.defineProperty(P$,"__esModule",{value:!0});var ije=nde(),aje=[ije.default];P$.default=aje});var ode=w(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.contentVocabulary=Uf.metadataVocabulary=void 0;Uf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Uf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ade=w(L$=>{"use strict";Object.defineProperty(L$,"__esModule",{value:!0});var lje=fue(),cje=Iue(),uje=rde(),dje=sde(),ide=ode(),pje=[lje.default,cje.default,(0,uje.default)(),dje.default,ide.metadataVocabulary,ide.contentVocabulary];L$.default=pje});var cde=w(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});Uv.DiscrError=void 0;var lde;(function(t){t.Tag="tag",t.Mapping="mapping"})(lde||(Uv.DiscrError=lde={}))});var dde=w($$=>{"use strict";Object.defineProperty($$,"__esModule",{value:!0});var Bf=je(),F$=cde(),ude=Sv(),mje=Ay(),fje=rt(),hje={message:({params:{discrError:t,tagName:e}})=>t===F$.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Bf._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},gje={keyword:"discriminator",type:"object",schemaType:"object",error:hje,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:o}=t,{oneOf:i}=s;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),c=e.const("tag",(0,Bf._)`${r}${(0,Bf.getProperty)(a)}`);e.if((0,Bf._)`typeof ${c} == "string"`,()=>u(),()=>t.error(!1,{discrError:F$.DiscrError.Tag,tag:c,tagName:a})),t.ok(l);function u(){let h=p();e.if(!1);for(let f in h)e.elseIf((0,Bf._)`${c} === ${f}`),e.assign(l,d(h[f]));e.else(),t.error(!1,{discrError:F$.DiscrError.Mapping,tag:c,tagName:a}),e.endIf()}function d(h){let f=e.name("valid"),g=t.subschema({keyword:"oneOf",schemaProp:h},f);return t.mergeEvaluated(g,Bf.Name),f}function p(){var h;let f={},g=E(s),_=!0;for(let T=0;T<i.length;T++){let C=i[T];if(C?.$ref&&!(0,fje.schemaHasRulesButRef)(C,o.self.RULES)){let A=C.$ref;if(C=ude.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,A),C instanceof ude.SchemaEnv&&(C=C.schema),C===void 0)throw new mje.default(o.opts.uriResolver,o.baseId,A)}let v=(h=C?.properties)===null||h===void 0?void 0:h[a];if(typeof v!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);_=_&&(g||E(C)),y(v,T)}if(!_)throw new Error(`discriminator: "${a}" must be required`);return f;function E({required:T}){return Array.isArray(T)&&T.includes(a)}function y(T,C){if(T.const)S(T.const,C);else if(T.enum)for(let v of T.enum)S(v,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function S(T,C){if(typeof T!="string"||T in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[T]=C}}}};$$.default=gje});var pde=w((P0t,_je)=>{_je.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var fde=w(($t,U$)=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.MissingRefError=$t.ValidationError=$t.CodeGen=$t.Name=$t.nil=$t.stringify=$t.str=$t._=$t.KeywordCxt=$t.Ajv=void 0;var Eje=lue(),yje=ade(),Sje=dde(),mde=pde(),bje=["/properties"],Bv="http://json-schema.org/draft-07/schema",Gf=class extends Eje.default{_addVocabularies(){super._addVocabularies(),yje.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Sje.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(mde,bje):mde;this.addMetaSchema(e,Bv,!1),this.refs["http://json-schema.org/schema"]=Bv}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Bv)?Bv:void 0)}};$t.Ajv=Gf;U$.exports=$t=Gf;U$.exports.Ajv=Gf;Object.defineProperty($t,"__esModule",{value:!0});$t.default=Gf;var Tje=ky();Object.defineProperty($t,"KeywordCxt",{enumerable:!0,get:function(){return Tje.KeywordCxt}});var zf=je();Object.defineProperty($t,"_",{enumerable:!0,get:function(){return zf._}});Object.defineProperty($t,"str",{enumerable:!0,get:function(){return zf.str}});Object.defineProperty($t,"stringify",{enumerable:!0,get:function(){return zf.stringify}});Object.defineProperty($t,"nil",{enumerable:!0,get:function(){return zf.nil}});Object.defineProperty($t,"Name",{enumerable:!0,get:function(){return zf.Name}});Object.defineProperty($t,"CodeGen",{enumerable:!0,get:function(){return zf.CodeGen}});var wje=Ev();Object.defineProperty($t,"ValidationError",{enumerable:!0,get:function(){return wje.default}});var Cje=Ay();Object.defineProperty($t,"MissingRefError",{enumerable:!0,get:function(){return Cje.default}})});var hde,gde=k(()=>{"use strict";hde={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://aiiware.com/schema/persona.v0.1.json",title:"Aii Persona Manifest",description:"Schema for persona.json \u2014 the manifest file for Aii workspace personas.",type:"object",required:["name","version","description","author"],patternProperties:{"^x-[a-z]+-":{description:"Vendor extension fields."}},properties:{$schema:{type:"string",description:"JSON Schema reference URL."},specVersion:{type:"string",description:"Schema version (e.g., '0.1'). Required for structured instructions and agents field."},name:{type:"string",pattern:"^[a-z0-9-]+/[a-z0-9-]+$",description:"Unique identifier in owner/name format (lowercase, hyphens only)."},version:{type:"string",pattern:"^v?\\d+\\.\\d+\\.\\d+",description:"Semantic version (e.g., '1.0.0' or 'v1.0.0')."},displayName:{type:"string",maxLength:100,description:"Human-readable display name."},description:{type:"string",maxLength:500,description:"Short description of the persona."},author:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string"},email:{type:"string",format:"email"}},description:"Persona author information."},license:{type:"string",description:"SPDX license identifier (e.g., 'MIT', 'Apache-2.0')."},homepage:{type:"string",format:"uri",description:"URL to the persona's homepage or documentation."},repository:{type:"string",description:"URL to the persona's source repository."},components:{$ref:"#/definitions/ComponentsBlock"},soul:{oneOf:[{$ref:"#/definitions/InlineSoulDef"},{$ref:"#/definitions/SoulPathRef"},{$ref:"#/definitions/SoulNamespace"}],description:"Soul definition \u2014 inline, path reference, or SoulSpec namespace."},skills:{type:"array",items:{type:"string"},description:"List of bundled skill directory names."},hooks:{type:"object",additionalProperties:{type:"array",items:{$ref:"#/definitions/HookDefinition"}},description:"Hook event handlers keyed by event name."},mcpServers:{type:"object",additionalProperties:!0,description:"MCP server configurations."},instructions:{oneOf:[{type:"string",description:"Flat instructions string."},{type:"object",properties:{soul:{type:"string",description:"Core personality, values, character traits."},identity:{type:"string",description:"Name, role, brand presence."},style:{type:"string",description:"Tone, vocabulary, communication patterns."},heartbeat:{type:"string",description:"Availability, response rhythm."},workflow:{type:"string",description:"Step-by-step behavioral workflow."}},description:"Structured instructions object (requires specVersion 0.1+)."}],description:"Persona-specific instructions \u2014 string or structured object."},theme:{type:"string",description:"Theme name to apply when persona is activated."},tags:{type:"array",items:{type:"string"},description:"Discovery tags."},category:{type:"string",description:"Primary category for persona discovery."},keywords:{type:"array",items:{type:"string"},description:"Search keywords."},agents:{type:"object",additionalProperties:{type:"string"},description:'Cross-agent compatibility \u2014 product-level canonical IDs with semver ranges (e.g., { "aii": ">=0.14.6", "claude-code": "*" }).'},model:{type:"object",properties:{providers:{type:"array",items:{type:"string"},description:"Supported LLM providers."},recommended:{type:"object",properties:{provider:{type:"string"},model:{type:"string"},reason:{type:"string"}},description:"Recommended model configuration."},minimumTier:{type:"string",description:"Minimum model capability tier (e.g., 'mid', 'high')."}},description:"LLM model requirements."},compatibility:{type:"object",properties:{"aii-cli":{type:"string",description:"Minimum Aii CLI version required (semver range)."},providers:{type:"array",items:{type:"string"},description:"Supported LLM provider names."},recommended:{type:"object",properties:{provider:{type:"string"},model:{type:"string"},reason:{type:"string"}}},minimumTier:{type:"string"},souls:{type:"array",items:{type:"string"},description:"Compatible soul names."}},description:"DEPRECATED: Use 'agents' + 'model' instead. Compatibility constraints."},performance:{type:"object",additionalProperties:!1,properties:{estimatedMetadataTokens:{type:"integer",minimum:0,description:"Estimated token count for persona metadata."},maxSkills:{type:"integer",minimum:1,description:"Maximum recommended skills for this persona."}},description:"Performance hints."}},definitions:{InlineSoulDef:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string"},identity:{type:"string"},style:{type:"string"},heartbeat:{type:"string"},workflow:{type:"string"}}},SoulPathRef:{type:"object",required:["name","path"],additionalProperties:!1,properties:{name:{type:"string"},path:{type:"string"}}},SoulNamespace:{type:"object",required:["files"],properties:{specVersion:{type:"string"},files:{type:"object",properties:{soul:{type:"string"},identity:{type:"string"},style:{type:"string"},heartbeat:{type:"string"},workflow:{type:"string"}},description:"Soul file paths (relative to persona root)."},calibration:{type:"object",properties:{good:{type:"string"},bad:{type:"string"}},description:"Calibration example file paths."}},description:"Full SoulSpec namespace with dedicated files."},HookDefinition:{type:"object",properties:{type:{type:"string",enum:["script","prompt"]},command:{type:"string"},prompt:{type:"string"},tools:{type:"array",items:{type:"string"}},timeout:{type:"number",minimum:0},enabled:{type:"boolean"}}},ComponentsBlock:{type:"object",additionalProperties:!1,properties:{soul:{$ref:"#/definitions/ComponentRef"},skills:{type:"array",items:{$ref:"#/definitions/ComponentRef"}},mcpServers:{type:"array",items:{$ref:"#/definitions/ComponentRef"}},hooks:{$ref:"#/definitions/ComponentRef"},theme:{$ref:"#/definitions/ComponentRef"}}},ComponentRef:{type:"object",required:["source"],additionalProperties:!1,properties:{source:{type:"string",enum:["bundled","pack","registry","npm","pip","local"]},name:{type:"string"},path:{type:"string"},ref:{type:"string"},version:{type:"string"},skills:{type:"array",items:{type:"string"}},package:{type:"string"},config:{type:"object",additionalProperties:!0}}}}}});function kje(){return _de??=vje.compile(hde),_de}function Aje(t){return`${t.instancePath&&t.instancePath.length>0?t.instancePath:"(root)"} ${t.message??"is invalid"}`.trim()}function Hf(t){if(t===null||typeof t!="object"||Array.isArray(t))return{ok:!1,errors:["manifest is not a JSON object"]};let e=kje();return e(t)?{ok:!0,errors:[]}:{ok:!1,errors:(e.errors??[]).map(Aje)}}var Ede,vje,_de,B$=k(()=>{"use strict";Ede=Dt(fde(),1);gde();vje=new Ede.Ajv({allErrors:!0,strict:!1,validateFormats:!1}),_de=null});var yde,Va,G$=k(()=>{"use strict";yde=Dt(MC(),1);bs();Va=class t{static parse(e,r){if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`Invalid persona.json at ${r}: expected a JSON object`);let n=e;if(typeof n.name!="string")throw new Error(`Invalid persona.json at ${r}: "name" is required and must be a string`);if(t.validateName(n.name),typeof n.version!="string")throw new Error(`Invalid persona.json at ${r}: "version" is required and must be a string`);if(t.validateVersion(n.version),n.version=t.normalizeVersion(n.version),typeof n.description!="string")throw new Error(`Invalid persona.json at ${r}: "description" is required and must be a string`);if(n.description.length>dT)throw new Error(`Invalid persona.json at ${r}: "description" exceeds maximum length of ${dT} characters`);if(n.author===null||typeof n.author!="object"||Array.isArray(n.author))throw new Error(`Invalid persona.json at ${r}: "author" is required and must be an object with a "name" field`);if(typeof n.author.name!="string")throw new Error(`Invalid persona.json at ${r}: "author.name" is required and must be a string`);if(n.specVersion&&typeof n.specVersion!="string")throw new Error(`Invalid specVersion: expected string, got ${typeof n.specVersion}`);if(n.agents){if(typeof n.agents!="object"||Array.isArray(n.agents))throw new Error("Invalid agents field: expected Record<string, string>");for(let[o,i]of Object.entries(n.agents))if(typeof i!="string")throw new Error(`Invalid agents value for '${o}': expected semver range string`)}if(n.instructions&&typeof n.instructions=="object"&&!n.specVersion)throw new Error('Structured instructions require specVersion "0.1" or later');if(n.compatibility){let o=n.compatibility;if(!n.agents&&o["aii-cli"]&&(n.agents={aii:o["aii-cli"]}),!n.model){let{providers:i,recommended:a,minimumTier:l}=o;(i||a||l)&&(n.model={providers:i,recommended:a,minimumTier:l})}}return n}static validateName(e){if(e.length>uT)throw new Error(`Pack name "${e}" exceeds maximum length of ${uT} characters`);if(!KN.test(e))throw new Error(`Pack name "${e}" is invalid. Must match owner/name format using lowercase alphanumeric characters and hyphens (e.g., "my-org/my-pack")`)}static validateVersion(e){let r=e.startsWith("v")?e.slice(1):e;if(!yde.default.valid(r))throw new Error(`Pack version "${e}" is not valid semver. Expected format: 0.1.0 or v0.1.0`)}static normalizeVersion(e){return e.startsWith("v")?e.slice(1):e}static normalizeToComponents(e){if(e.components)return e.components;let r={};return e.soul&&(r.soul={source:"bundled",...e.soul}),e.skills&&e.skills.length>0&&(r.skills=e.skills.map(n=>({source:"bundled",name:n}))),e.hooks&&(r.hooks={source:"bundled"}),e.theme&&(r.theme={source:"bundled",name:e.theme}),r}static filterBundledOnly(e){let r={},n=[];if(e.soul&&(e.soul.source==="bundled"?r.soul=e.soul:n.push(`Non-bundled component source '${e.soul.source}' not supported in this version. Skipping.`)),e.skills){let s=[];for(let o of e.skills)o.source==="bundled"?s.push(o):n.push(`Non-bundled component source '${o.source}' not supported in this version. Skipping.`);s.length>0&&(r.skills=s)}if(e.mcpServers){let s=[];for(let o of e.mcpServers)o.source==="bundled"?s.push(o):n.push(`Non-bundled component source '${o.source}' not supported in this version. Skipping.`);s.length>0&&(r.mcpServers=s)}return e.hooks&&(e.hooks.source==="bundled"?r.hooks=e.hooks:n.push(`Non-bundled component source '${e.hooks.source}' not supported in this version. Skipping.`)),e.theme&&(e.theme.source==="bundled"?r.theme=e.theme:n.push(`Non-bundled component source '${e.theme.source}' not supported in this version. Skipping.`)),{filtered:r,warnings:n}}}});function Sde(t){if(t==null)return;if(typeof t=="string")return t;let e=[];for(let r of Ije){let n=t[r];n&&e.push(`<${r}>
1191
1191
  ${n}
1192
1192
  </${r}>`)}return e.length>0?e.join(`
1193
1193
  `):void 0}var Ije,bde=k(()=>{"use strict";Ije=["soul","identity","style","heartbeat","workflow"]});function Gi(){return{addedSkills:[],removedSkills:[],soul:null,theme:null,updatedAt:new Date().toISOString()}}var Tde=k(()=>{"use strict"});var wde,Cde,vde,kde=k(()=>{"use strict";wde={specVersion:"0.1",name:"aiiware/thinker",version:"0.1.0",displayName:"Aii Thinker",description:"Patient and collaborative AI assistant that explains reasoning",author:{name:"AiiWare",email:"hello@aiiware.com"},license:"MIT",homepage:"https://aiiware.com",soul:{specVersion:"0.4",files:{soul:"SOUL.md",identity:"IDENTITY.md",style:"STYLE.md",heartbeat:"HEARTBEAT.md",workflow:"AGENTS.md"},calibration:{good:"examples/good-outputs.md",bad:"examples/bad-outputs.md"}},instructions:"Be patient, explain your reasoning, think before acting.",theme:"classic",skills:["brainstorm","write-plan"],hooks:{},mcpServers:{},agents:{aii:">=0.14.6"},model:{providers:["anthropic","openai","gemini","deepseek"],recommended:{provider:"anthropic",model:"claude-sonnet-4-6",reason:"Soul identity adherence requires strong instruction-following"},minimumTier:"mid"},tags:["default","collaborative","thoughtful"],category:"general"},Cde={specVersion:"0.1",name:"aiiware/doer",version:"0.1.0",displayName:"Aii Doer",description:"Direct and efficient AI assistant that leads with the answer",author:{name:"AiiWare",email:"hello@aiiware.com"},license:"MIT",homepage:"https://aiiware.com",soul:{specVersion:"0.4",files:{soul:"SOUL.md",identity:"IDENTITY.md",style:"STYLE.md",heartbeat:"HEARTBEAT.md",workflow:"AGENTS.md"},calibration:{good:"examples/good-outputs.md",bad:"examples/bad-outputs.md"}},instructions:"Lead with the answer. Be direct, efficient, and concise.",theme:"classic",skills:["tdd","debug"],hooks:{},mcpServers:{},agents:{aii:">=0.14.6"},model:{providers:["anthropic","openai","gemini","deepseek"],recommended:{provider:"anthropic",model:"claude-sonnet-4-6",reason:"Soul identity adherence requires strong instruction-following"},minimumTier:"mid"},tags:["efficient","direct","action-oriented"],category:"general"},vde={specVersion:"0.1",name:"aiiware/coder",version:"0.1.0",displayName:"Aii Coder",description:"Pair-programming partner that reads code, references lines, and explains changes",author:{name:"AiiWare",email:"hello@aiiware.com"},license:"MIT",homepage:"https://aiiware.com",soul:{specVersion:"0.4",files:{soul:"SOUL.md",identity:"IDENTITY.md",style:"STYLE.md",heartbeat:"HEARTBEAT.md",workflow:"AGENTS.md"},calibration:{good:"examples/good-outputs.md",bad:"examples/bad-outputs.md"}},instructions:"Be a pair-programming partner. Read code, reference specific lines, explain what changed and why.",theme:"classic",skills:["tdd","debug","code-review"],hooks:{},mcpServers:{},agents:{aii:">=0.14.6"},model:{providers:["anthropic","openai","gemini","deepseek"],recommended:{provider:"anthropic",model:"claude-sonnet-4-6",reason:"Soul identity adherence requires strong instruction-following"},minimumTier:"mid"},tags:["coding","pair-programming","technical"],category:"development"}});var Gv,Ade,Ide,Dde,Rde,Nde,Ode,xde,Mde,Pde,Lde,Fde,$de,Ude,Bde,Gde,zde,Hde,qde,jde=k(()=>{"use strict";Gv=`# HEARTBEAT.md \u2014 What I Check On My Own
@@ -3642,7 +3642,7 @@ User: ${e}`}async function hJe(t,e,r){if(t.authType==="oauth_bearer"){let o=Ns(t
3642
3642
  `)),console.log(" aii cloud login Sign in to Aii Cloud (verifies an existing sign-in;"),console.log(" --force re-authenticates)"),console.log(" aii cloud connect Stay online to run tasks dispatched from the Portal"),console.log(" aii cloud status Show connection + credit balance"),console.log(m.gray(`
3643
3643
  \`aii cloud connect\` registers this machine so you can start a task from the
3644
3644
  web ("Run on \u25BE \xB7 this machine") and approve its tool calls from the Portal.
3645
- `))}var wU=k(()=>{"use strict";ye();Ja();Ol();yS();Ege();wge();kge();Fge();Uge();wS()});var Hge={};ie(Hge,{handleUpgrade:()=>NJe});import{execSync as Gge}from"node:child_process";async function NJe(t){let e=t.args[0]||null,r="0.22.2",n=e?`${zge}@${e}`:`${zge}@latest`;console.log(""),console.log(e?`Upgrading Aii CLI to v${e}...`:"Upgrading Aii CLI to latest..."),console.log(` Current version: ${r}`),console.log("");try{Gge(`npm install -g ${n}`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
3645
+ `))}var wU=k(()=>{"use strict";ye();Ja();Ol();yS();Ege();wge();kge();Fge();Uge();wS()});var Hge={};ie(Hge,{handleUpgrade:()=>NJe});import{execSync as Gge}from"node:child_process";async function NJe(t){let e=t.args[0]||null,r="0.22.3",n=e?`${zge}@${e}`:`${zge}@latest`;console.log(""),console.log(e?`Upgrading Aii CLI to v${e}...`:"Upgrading Aii CLI to latest..."),console.log(` Current version: ${r}`),console.log("");try{Gge(`npm install -g ${n}`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
3646
3646
  Upgrade failed. Try running with sudo or check npm permissions.`),console.error(` Manual: npm install -g ${n}`),process.exit(1)}try{let s=Gge("aii --version 2>/dev/null",{encoding:"utf-8",timeout:1e4,stdio:"pipe"}).trim();console.log(""),console.log(s===r?`Already up to date (${r})`:`Upgraded: ${r} -> ${s}`)}catch{console.log(""),console.log("Installed. Restart your terminal to use the new version.")}}var zge,qge=k(()=>{"use strict";zge="@aiiware/aii"});var jge={};ie(jge,{handleSkillCmd:()=>xJe});function OJe(t){return t.userInvocable&&t.modelInvocable?"":t.userInvocable?"(CLI only)":t.modelInvocable?"(agent only)":"(disabled)"}async function xJe(t,e){let r=t.args.filter(i=>!i.startsWith("-")),n=t.flags.yes||t.args.includes("--yes")||t.args.includes("-y"),s=(t.subcommand??r[0]??"help").toLowerCase(),o=t.subcommand?r[0]??null:r[1]??null;switch(s){case"list":return MJe();case"info":return PJe(o);case"install":return FJe(o,n);case"help":default:return $Je()}}async function MJe(){let{SkillManager:t}=await Promise.resolve().then(()=>(Ei(),Cu)),e;if(t.hasInstance())e=t.getInstance();else{e=t.getInstance(process.cwd());let o;try{let{PersonaManager:i}=await Promise.resolve().then(()=>(At(),Ot)),a=i.getInstance(process.cwd());await a.initialize(),a.isActive()&&(o=a.getActive()?.skillPaths)}catch{}await e.discover(o)}let r=e.getRegistry().getAll();if(r.length===0){console.log("No skills installed."),console.log(" Install one: aii skill install <owner/repo/skill>");return}let n=new Map;for(let o of r){let i=n.get(o.source)||[];i.push(o),n.set(o.source,i)}let s=["project-command","project","user","persona-bundled","universal","built-in","plugin","remote"];console.log(""),console.log(" Name Source Invocation Description"),console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");for(let o of s){let i=n.get(o);if(i)for(let a of i){let l=a.name.padEnd(18),c=a.source.padEnd(16),u=OJe(a).padEnd(14),d=(a.description||"").slice(0,34);console.log(` ${l}${c}${u}${d}`)}}console.log("")}async function PJe(t){if(!t){console.log("Usage: aii skill info <name>");return}let{SkillManager:e}=await Promise.resolve().then(()=>(Ei(),Cu)),r;if(e.hasInstance())r=e.getInstance();else{r=e.getInstance(process.cwd());let s;try{let{PersonaManager:o}=await Promise.resolve().then(()=>(At(),Ot)),i=o.getInstance(process.cwd());await i.initialize(),i.isActive()&&(s=i.getActive()?.skillPaths)}catch{}await r.discover(s)}let n=r.getRegistry().getByName(t);if(!n){let o=r.getRegistry().getAll().map(i=>i.name).join(", ");console.error(`Skill "${t}" not found.`),o&&console.error(`Available skills: ${o}`),process.exit(1)}console.log(""),console.log(` Name: ${n.name}`),console.log(` Source: ${n.source}`),console.log(` Description: ${n.description||"(none)"}`),console.log(` Invocable: ${[n.userInvocable?"user":"",n.modelInvocable?"model":""].filter(Boolean).join(" + ")||"none"}`),n.allowedTools?.length&&console.log(` Tools: ${n.allowedTools.join(" ")}`),console.log(` Path: ${n.path||"(embedded)"}`),console.log("")}function LJe(){return!process.stdin.isTTY||!process.stdout.isTTY?null:async({bodyLines:t})=>{console.log("");for(let n of t)console.log(` ${n}`);let{createInterface:e}=await import("node:readline/promises"),r=e({input:process.stdin,output:process.stdout});try{let n=await r.question("Install this skill? [y/N] ");return/^y(es)?$/i.test(n.trim())}finally{r.close()}}}async function FJe(t,e=!1){if(!t){console.log("Usage: aii skill install <owner/repo | owner/repo/skill> [--yes]");return}let{SkillInstaller:r}=await Promise.resolve().then(()=>(g_(),wT)),n=new r({projectRoot:process.cwd(),onProgress:s=>console.error(s),prompter:LJe()});try{let s=await n.install(t,{scope:"user",yes:e});s.success?(console.log(`Installed skill: ${s.skillName}`),s.installPath&&console.log(` Location: ${s.installPath}`)):s.status==="ambiguous"?(console.error(s.error||"Repository contains multiple skills."),process.exit(1)):(console.error(`Failed to install skill: ${s.error||"Unknown error"}`),process.exit(1))}catch(s){let o=s instanceof Error?s.message:String(s);console.error(`Failed to install skill: ${o}`),process.exit(1)}}function $Je(){let t=[""];t.push(m.cyan.bold(" Skill System")),t.push(""),t.push(m.yellow(" USAGE:")),t.push(` ${m.green("aii skill list")} List all available skills`),t.push(` ${m.green("aii skill info <name>")} Show details for a skill`),t.push(` ${m.green("aii skill install <ref>")} Install a skill from GitHub`),t.push(` ${m.green("aii skill help")} Show this help`),t.push(""),t.push(m.yellow(" INSTALL FORMS:")),t.push(m.dim(" owner/repo Bare repo \u2014 resolves a root skill or a")),t.push(m.dim(" single-skill subdirectory automatically")),t.push(m.dim(" owner/repo/skill-path Explicit skill within a repository")),t.push(m.dim(" https://github.com/... Full tree/blob URL")),t.push(""),t.push(m.dim(" Installs show a trust preview and ask for confirmation;")),t.push(m.dim(" pass --yes (-y) to skip the prompt (required when non-interactive).")),t.push(""),t.push(m.yellow(" EXAMPLES:")),t.push(m.dim(" aii skill list")),t.push(m.dim(" aii skill info commit")),t.push(m.dim(" aii skill install tt-a1i/archify")),t.push(m.dim(" aii skill install aiiware/aii-skills/skills/commit --yes")),t.push(""),console.log(t.join(`
3647
3647
  `))}var Yge=k(()=>{"use strict";ye()});var Wge={};ie(Wge,{handlePluginCmd:()=>UJe});async function UJe(t,e){let r=(t.subcommand??t.args[0]??"help").toLowerCase(),n=t.subcommand?t.args[0]:t.args[1]??null,s=t.subcommand?t.args.slice(1):t.args.slice(2);switch(r){case"install":return BJe(n,s);case"uninstall":case"remove":return GJe(n);case"update":return zJe(n);case"list":case"ls":return HJe();case"help":default:return qJe()}}async function BJe(t,e){if(!t){console.log("Usage: aii plugin install <owner/repo>");return}let{PluginInstaller:r}=await Promise.resolve().then(()=>(jl(),wu)),n=e.includes("--force")||e.includes("-f"),s=t,o;if(t.includes("@")){let a=t.lastIndexOf("@");s=t.slice(0,a),o=t.slice(a+1)}let i=new r({onProgress:a=>console.log(` ${m.dim(a)}`)});try{console.log(""),console.log(` Installing plugin from ${m.cyan(s)}...`),console.log("");let a=await i.install(s,{version:o,force:n});a.success?(console.log(""),console.log(` ${m.green("\u2713")} Plugin ${m.bold(a.pluginName)} v${a.version} installed`),console.log(` ${a.skillCount} skills available (use ${m.cyan("aii skill list")} to see them)`),a.installPath&&console.log(` Stored in ${m.dim(a.installPath)}`),console.log("")):(console.error(` ${m.red("\u2717")} ${a.error||"Unknown error"}`),process.exit(1))}catch(a){let l=a instanceof Error?a.message:String(a);console.error(` ${m.red("\u2717")} Failed to install plugin: ${l}`),process.exit(1)}}async function GJe(t){if(!t){console.log("Usage: aii plugin uninstall <name>");return}let{PluginInstaller:e}=await Promise.resolve().then(()=>(jl(),wu)),r=new e;try{let n=await r.uninstall(t);n.success?(console.log(""),console.log(` ${m.green("\u2713")} Plugin ${m.bold(t)} uninstalled`),n.skillCount&&console.log(` ${n.skillCount} skills removed`),console.log("")):(console.error(` ${m.red("\u2717")} ${n.error||"Unknown error"}`),process.exit(1))}catch(n){let s=n instanceof Error?n.message:String(n);console.error(` ${m.red("\u2717")} Failed to uninstall plugin: ${s}`),process.exit(1)}}async function zJe(t){if(!t){console.log("Usage: aii plugin update <name>");return}let{PluginInstaller:e}=await Promise.resolve().then(()=>(jl(),wu)),r=new e({onProgress:n=>console.log(` ${m.dim(n)}`)});try{console.log(""),console.log(` Checking for updates to ${m.cyan(t)}...`);let n=await r.update(t);n.success?(n.error?.includes("already up to date")?console.log(` ${m.green("\u2713")} ${n.error}`):(console.log(` ${m.green("\u2713")} Plugin ${m.bold(t)} updated to v${n.version}`),n.skillCount&&console.log(` ${n.skillCount} skills available`)),console.log("")):(console.error(` ${m.red("\u2717")} ${n.error||"Unknown error"}`),process.exit(1))}catch(n){let s=n instanceof Error?n.message:String(n);console.error(` ${m.red("\u2717")} Failed to update plugin: ${s}`),process.exit(1)}}async function HJe(){let{PluginManager:t}=await Promise.resolve().then(()=>(d_(),u_)),r=await new t().listInstalled();if(r.length===0){console.log(""),console.log(" No plugins installed."),console.log(` Install one: ${m.cyan("aii plugin install <owner/repo>")}`),console.log("");return}console.log(""),console.log(m.bold(" INSTALLED PLUGINS")),console.log(""),console.log(" Name Version Skills Installed"),console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");for(let n of r){let s=n.name.padEnd(18),o=`v${n.version}`.padEnd(12),i=String(n.skillCount).padEnd(8),a=new Date(n.installedAt).toLocaleDateString();console.log(` ${s}${o}${i}${a}`)}console.log("")}function qJe(){let t=[""];t.push(m.cyan.bold("Plugin System")),t.push(""),t.push(m.yellow("USAGE:")),t.push(` ${m.green("aii plugin install <source>")} Install a plugin from GitHub`),t.push(` ${m.green("aii plugin uninstall <name>")} Uninstall a plugin`),t.push(` ${m.green("aii plugin update <name>")} Update a plugin to latest`),t.push(` ${m.green("aii plugin list")} List installed plugins`),t.push(` ${m.green("aii plugin help")} Show this help`),t.push(""),t.push(m.yellow("EXAMPLES:")),t.push(m.dim(" aii plugin install aiiware/aii-skills")),t.push(m.dim(" aii plugin install aiiware/aii-skills@v0.1.0")),t.push(m.dim(" aii plugin list")),t.push(m.dim(" aii plugin update aii-skills")),t.push(m.dim(" aii plugin uninstall aii-skills")),t.push(""),console.log(t.join(`
3648
3648
  `))}var Kge=k(()=>{"use strict";ye()});var Vge={};ie(Vge,{handlePersona:()=>YJe});function jJe(t){return process.stdin.isTTY?async({originId:e,event:r,command:n,index:s,total:o})=>{s===1&&(console.log(`
@@ -3667,7 +3667,7 @@ Upgrade failed. Try running with sudo or check npm permissions.`),console.error(
3667
3667
  ${t}
3668
3668
  </context>
3669
3669
 
3670
- ${e}`:e}var Te;(function(t){t[t.LOCAL=1]="LOCAL",t[t.SERVER=2]="SERVER"})(Te||(Te={}));var aI={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function ai(t,e,r,n){return t.clean?"clean":t.thinking||t.verbose?"thinking":t.standard?"standard":e&&r?.[e]?r[e]:e&&aI[e]?aI[e]:n||aI._default}var jS=[{name:"config",tier:Te.LOCAL},{name:"help",tier:Te.LOCAL},{name:"version",tier:Te.LOCAL},{name:"doctor",tier:Te.LOCAL},{name:"mcp",tier:Te.LOCAL},{name:"prompt",tier:Te.LOCAL},{name:"stats",tier:Te.LOCAL},{name:"history",tier:Te.LOCAL},{name:"query",tier:Te.SERVER},{name:"chat",tier:Te.SERVER},{name:"run",tier:Te.SERVER},{name:"agent",tier:Te.SERVER},{name:"loop",tier:Te.SERVER},{name:"telegram",tier:Te.SERVER},{name:"sessions",tier:Te.SERVER},{name:"goals",tier:Te.LOCAL},{name:"install",tier:Te.LOCAL},{name:"worktree",tier:Te.LOCAL},{name:"soul",tier:Te.LOCAL},{name:"skill",tier:Te.LOCAL},{name:"plugin",tier:Te.LOCAL},{name:"persona",tier:Te.LOCAL},{name:"cloud",tier:Te.LOCAL},{name:"login",tier:Te.LOCAL},{name:"upgrade",tier:Te.LOCAL}];function F_e(t){let e=new Map;for(let r of t){if(!r.name)throw new Error("CLI command descriptor is missing a name");if(r.tier!==Te.LOCAL&&r.tier!==Te.SERVER)throw new Error(`CLI command "${r.name}" has an invalid tier: ${String(r.tier)}`);for(let n of[r.name,...r.aliases??[]]){if(e.has(n))throw new Error(`Duplicate CLI command name/alias: "${n}"`);e.set(n,r)}}return e}var $_e=F_e(jS);function dB(t){return $_e.get(t)?.tier}var eet=Object.fromEntries(jS.map(t=>[t.name,t.tier]));var mB=new Set(jS.filter(t=>t.name!=="query").flatMap(t=>[t.name,...t.aliases??[]])),U_e="0.22.2",B_e=new Set(["--clean","--standard","--thinking","-v","--verbose","-d","--debug","--model","--openrouter-provider","--host","-y","--yes","--offline","-D","--direct","-i","--interactive","-c","--continue-chat","-n","--new-chat","--auto","--auto-background-timeout","--no-colors","--colors","--no-emojis","--emojis","--no-animations","--animations","--no-streaming","--streaming","--show-tokens","--show-cost","--output-format","--tools","--exclude-tools","--max-turns","--max-budget-usd","--bare","--append-system-prompt","--append-system-prompt-file","--continue","--signature","--no-signature","--no-project-config","--project-config","--local","-h","--help","-V","--version"]),lI=new Set(["--model","--openrouter-provider","--host","-c","--continue-chat","--auto-background-timeout","--output-format","--tools","--exclude-tools","--max-turns","--max-budget-usd","--append-system-prompt","--append-system-prompt-file","--signature"]);function G_e(t){let e=[];for(let r=0;r<t.length;r++){let n=t[r],s=n.indexOf("="),o=s>0?n.slice(0,s):n;if(B_e.has(o)){s===-1&&lI.has(o)&&r++;continue}e.push(n)}return e}var pB=/^[a-z0-9_]{2,40}$/i;function z_e(t){for(let e=2;e<t.length;e++){let r=t[e];if(r.startsWith("-")){!r.includes("=")&&lI.has(r)&&e++;continue}return r}}function H_e(t){for(let e=0;e<t.length;e++){let r=t[e];if(r.startsWith("-")){!r.includes("=")&&lI.has(r)&&e++;continue}return!0}return!1}function q_e(t){let e=z_e(t);if(e!==void 0&&e!=="agent"&&mB.has(e))return{argv:t};let r=[],n,s;for(let o=0;o<t.length;o++){let i=t[o];if(i==="--continue"){r.push(i);let a=t[o+1];n===void 0&&s===void 0&&a!==void 0&&!a.startsWith("-")&&pB.test(a)&&(H_e(t.slice(o+2))?s=`--continue ${a} \u2026: ambiguous \u2014 quote the text (aii --continue "${a} \u2026") to run it as a prompt, or run \`aii --continue ${a}\` alone to resume that session.`:(n=a,o++));continue}if(i.startsWith("--continue=")){let a=i.slice(11);r.push("--continue"),pB.test(a)?n===void 0&&(n=a):s=`--continue=${a}: not a session id (2-40 letters/digits/underscores). \`aii goals\` lists this project's sessions.`;continue}r.push(i)}return{argv:r,continueId:n,error:s}}function j_e(t){if(t===void 0)return;let e=Number(t);if(!Number.isInteger(e)||e<0)throw new Error(`Invalid --max-turns "${t}": expected a non-negative integer`);return e}function Y_e(t){if(t===void 0)return;let e=Number(t);if(!Number.isFinite(e)||e<0)throw new Error(`Invalid --max-budget-usd "${t}": expected a non-negative number`);return e}function W_e(){let t=new cB;return t.name("aii").description("AI-powered CLI assistant").version(U_e,"-V, --version","Show version number").helpOption(!1).enablePositionalOptions().argument("[query...]","Natural language query").option("--clean","Clean output mode (just the result)").option("--standard","Standard output mode (result + metrics)").option("--thinking","Thinking mode (full reasoning)").option("-v, --verbose","Verbose output (alias for --thinking)").option("-d, --debug","Debug output").option("--model <model>","Override LLM model (e.g., ollama/llama3.1:8b, deepseek/deepseek-chat)").option("--openrouter-provider <slug>","Pin OpenRouter requests to a specific backend provider").option("--host <host>","API server host:port").option("--local","Force the local backend for this run (ignore managed cloud)").option("-y, --yes","Auto-confirm shell commands").option("--offline","Offline mode (no web/MCP)").option("-D, --direct","Direct mode (bypass server intent recognition)").option("-i, --interactive","Interactive chat mode").option("-c, --continue-chat <id>","Continue chat session").option("-n, --new-chat","Force new chat session").option("--auto","Auto mode - auto-approve all actions").option("--auto-background-timeout <seconds>","Auto-convert foreground agents to background after N seconds (0 to disable)","120").option("--no-project-config","Skip project .aii/settings.json + settings.local.json and their deny rules for this session").option("--no-colors","Disable colored output").option("--no-emojis","Disable emoji icons").option("--no-animations","Disable animations").option("--no-streaming","Disable streaming").option("--show-tokens","Show token usage").option("--show-cost","Show cost estimates").option("--output-format <format>","Output format: json or stream-json (one-shot only)").option("--tools <list>",'Allowlist of tools (comma-separated, e.g., "Read,Bash,Edit")').option("--exclude-tools <list>",'Exclude tools (comma-separated, e.g., "WebSearch,WebFetch")').option("--max-turns <n>","Max ReAct iterations within a turn (0/unset = default 500)").option("--max-budget-usd <amount>","Stop before a new turn once cumulative est. cost reaches $amount").option("--bare","Result to stdout only; all status/chrome to stderr (one-shot)").option("--append-system-prompt <text>","Append additive instructions to this run").option("--append-system-prompt-file <path>","Append a workspace file of additive instructions to this run").option("--continue","Resume the most recent local session of this project (conversation + goal)").option("-h, --help","Show help"),t.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").allowUnknownOption().helpOption(!1).action(()=>{}),t.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),t.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),t.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),t.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),t.command("doctor").description("System health check").action(()=>{}),t.command("install [target...]").description("Install or update Aii CLI, skills, or MCP servers").allowUnknownOption().helpOption(!1).action(()=>{}),t.command("chat").description("Interactive chat mode").action(()=>{}),t.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),t.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),t.command("telegram").description("Telegram bot channel (chat with Aii from Telegram)").argument("[action]","Action: start, pair, status, unpair").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("sessions").description("Manage server sessions (list, info, resume, rename, delete)").argument("[action]","Action: list, info, resume, rename, delete").argument("[args...]","Additional arguments (session ID, name, etc.)").allowUnknownOption().action(()=>{}),t.command("goals").description("List goals across this project's local sessions (pick one up with --continue <id>)").action(()=>{}),t.command("worktree").description("Manage git worktrees for isolated development").argument("[action]","Action: create, list, remove, clean").argument("[name]","Worktree name (for create/remove)").allowUnknownOption().action(()=>{}),t.command("soul").description("Manage agent soul (personality & identity)").argument("[action]","Action: switch, show").argument("[name]","Soul name (for switch)").allowUnknownOption().action(()=>{}),t.command("cloud").description("Manage the Aii Cloud connection (login, connect, status)").argument("[action]","Action: login, connect, status").allowUnknownOption().action(()=>{}),t.command("login").description("Sign in to an AI provider with your subscription (e.g., xAI SuperGrok)").argument("[args...]","Flags: --provider <name>, --status, --logout").allowUnknownOption().action(()=>{}),t.command("skill").description("Manage AI skills").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("plugin").description("Manage skill plugins").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("persona").description("Manage workspace personas").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("upgrade").description("Update Aii CLI to latest version").argument("[version]","Target version (default: latest)").action(()=>{}),t.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),t.command("version").description("Show version number").action(()=>{}),t}async function fB(t){let e=q_e(t),r=e.argv,n=W_e();n.exitOverride(),n.configureOutput({writeErr:()=>{}});let s="query",o,i=[];try{n.parse(r),i=n.args;let d=n.args[0];d&&mB.has(d)&&(s=d,o=n.args[1],i=n.args.slice(2))}catch(d){d instanceof lB&&(d.code==="commander.version"||d.code==="commander.helpDisplayed")&&process.exit(0),i=G_e(r.slice(2))}let a=n.opts(),l={clean:a.clean??!1,standard:a.standard??!1,thinking:a.thinking??!1,verbose:a.verbose??!1,debug:a.debug??!1,model:a.model,host:a.host,local:a.local??!1,openrouterProvider:a.openrouterProvider,yes:a.yes??!1,offline:a.offline??!1,direct:a.direct??!1,interactive:a.interactive??!1,continueChat:a.continueChat,newChat:a.newChat??!1,auto:a.auto??!1,quiet:!1,noProjectConfig:a.projectConfig===!1,autoBackgroundTimeout:(()=>{let d=parseInt(a.autoBackgroundTimeout??"120",10);return isNaN(d)||d===0?0:Math.max(30,Math.min(600,d))*1e3})(),noColors:!a.colors,noEmojis:!a.emojis,noAnimations:!a.animations,noStreaming:!a.streaming,showTokens:a.showTokens??!1,showCost:a.showCost??!1,outputFormat:a.outputFormat,tools:a.tools,excludeTools:a.excludeTools,maxTurns:j_e(a.maxTurns),maxBudgetUsd:Y_e(a.maxBudgetUsd),bare:a.bare??!1,appendSystemPrompt:a.appendSystemPrompt,appendSystemPromptFile:a.appendSystemPromptFile,continue:a.continue??!1,continueId:e.continueId,continueIdError:e.error,help:a.help??!1,version:a.version??!1},c;iI()&&(c=await uB()),(s==="chat"||l.interactive)&&(s="agent"),s==="query"&&!i.length&&!c&&(s="agent");let u;if(s==="query"&&i.length>0)u=i.join(" ");else if(s==="agent"){let d=[];o&&d.push(o),i.length>0&&d.push(...i),d.length>0&&(u=d.join(" "))}return{command:s,subcommand:o,args:i,flags:l,stdinContent:c,query:u}}function hB(t){let e=dB(t.command)??Te.SERVER;switch(t.command){case"config":return K_e(t);case"mcp":return V_e(t);case"prompt":return Q_e(t);case"stats":return X_e(t);case"history":return J_e(t);case"doctor":return{tier:Te.LOCAL,handler:"doctor",params:{}};case"goals":return{tier:Te.LOCAL,handler:"goals",params:{}};case"install":return{tier:Te.LOCAL,handler:"install",params:{}};case"chat":return{tier:Te.SERVER,handler:"chat",params:{continueChat:t.flags.continueChat}};case"run":return eEe(t);case"agent":return{tier:Te.SERVER,handler:"agent",params:{interactive:!t.query}};case"loop":return{tier:Te.SERVER,handler:"loop",params:{}};case"telegram":return{tier:Te.SERVER,handler:"telegram",params:{action:t.subcommand??t.args[0]??"start"}};case"sessions":return{tier:Te.SERVER,handler:"sessions",params:{action:t.subcommand??t.args[0]??"list"}};case"worktree":return{tier:Te.LOCAL,handler:"worktree",params:{action:t.subcommand??t.args[0]??"list",name:t.subcommand?t.args[0]:t.args[1]}};case"soul":return{tier:Te.LOCAL,handler:"soul",params:{action:t.subcommand??t.args[0]??"show",name:t.subcommand?t.args[0]:t.args[1]}};case"cloud":return{tier:Te.LOCAL,handler:"cloud",params:{action:t.subcommand??t.args[0]??"status"}};case"login":return{tier:Te.LOCAL,handler:"login",params:{}};case"skill":return{tier:Te.LOCAL,handler:"skill",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"plugin":return{tier:Te.LOCAL,handler:"plugin",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"persona":return{tier:Te.LOCAL,handler:"persona",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"upgrade":return{tier:Te.LOCAL,handler:"upgrade",params:{version:t.args[0]||null}};case"help":return{tier:Te.LOCAL,handler:"help",params:{command:t.subcommand}};case"version":return{tier:Te.LOCAL,handler:"version",params:{}};case"query":default:return{tier:e,handler:"query",params:{query:t.query,stdinContent:t.stdinContent}}}}function K_e(t){let e=t.subcommand??t.args[0]??"show";return{tier:Te.LOCAL,handler:`config:${e}`,params:{key:t.args[0],value:t.args[1]}}}function V_e(t){let e=t.subcommand??t.args[0]??"list";return{tier:Te.LOCAL,handler:`mcp:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function Q_e(t){let e=t.subcommand??t.args[0]??"list";return{tier:Te.LOCAL,handler:`prompt:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function X_e(t){let e=t.subcommand??t.args[0];return{tier:Te.LOCAL,handler:e?`stats:${e}`:"stats",params:{}}}function J_e(t){let e=t.subcommand??t.args[0]??"list";return{tier:Te.LOCAL,handler:`history:${e}`,params:{query:t.args[0],id:t.args[0]}}}var Z_e=new Set(["--model","--host","--continue-chat","-c","--signature","--base"]);function eEe(t){let e=[...t.subcommand?[t.subcommand]:[],...t.args],r=[];for(let s=0;s<e.length;s++){let o=e[s];if(Z_e.has(o)){e[s+1]!==void 0&&!e[s+1].startsWith("-")&&s++;continue}o.startsWith("-")||r.push(o)}let n=r.join(" ");return{tier:Te.SERVER,handler:"run",params:{operation:n}}}Qe();eb();ru();di();ye();import{createInterface as PVe}from"readline";import{spawn as LVe}from"child_process";ku();ye();import gk from"node:process";import lme from"node:process";import mk from"node:process";var jYe=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(t,r),o=Object.getOwnPropertyDescriptor(e,r);!YYe(s,o)&&n||Object.defineProperty(t,r,o)},YYe=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},WYe=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},KYe=(t,e)=>`/* Wrapped ${t}*/
3670
+ ${e}`:e}var Te;(function(t){t[t.LOCAL=1]="LOCAL",t[t.SERVER=2]="SERVER"})(Te||(Te={}));var aI={translate:"clean",shell:"clean",shell_generate:"clean",mcp:"standard",explain:"standard",code_generate:"standard",code_review:"standard",summarize:"standard",research:"standard",_default:"standard"};function ai(t,e,r,n){return t.clean?"clean":t.thinking||t.verbose?"thinking":t.standard?"standard":e&&r?.[e]?r[e]:e&&aI[e]?aI[e]:n||aI._default}var jS=[{name:"config",tier:Te.LOCAL},{name:"help",tier:Te.LOCAL},{name:"version",tier:Te.LOCAL},{name:"doctor",tier:Te.LOCAL},{name:"mcp",tier:Te.LOCAL},{name:"prompt",tier:Te.LOCAL},{name:"stats",tier:Te.LOCAL},{name:"history",tier:Te.LOCAL},{name:"query",tier:Te.SERVER},{name:"chat",tier:Te.SERVER},{name:"run",tier:Te.SERVER},{name:"agent",tier:Te.SERVER},{name:"loop",tier:Te.SERVER},{name:"telegram",tier:Te.SERVER},{name:"sessions",tier:Te.SERVER},{name:"goals",tier:Te.LOCAL},{name:"install",tier:Te.LOCAL},{name:"worktree",tier:Te.LOCAL},{name:"soul",tier:Te.LOCAL},{name:"skill",tier:Te.LOCAL},{name:"plugin",tier:Te.LOCAL},{name:"persona",tier:Te.LOCAL},{name:"cloud",tier:Te.LOCAL},{name:"login",tier:Te.LOCAL},{name:"upgrade",tier:Te.LOCAL}];function F_e(t){let e=new Map;for(let r of t){if(!r.name)throw new Error("CLI command descriptor is missing a name");if(r.tier!==Te.LOCAL&&r.tier!==Te.SERVER)throw new Error(`CLI command "${r.name}" has an invalid tier: ${String(r.tier)}`);for(let n of[r.name,...r.aliases??[]]){if(e.has(n))throw new Error(`Duplicate CLI command name/alias: "${n}"`);e.set(n,r)}}return e}var $_e=F_e(jS);function dB(t){return $_e.get(t)?.tier}var eet=Object.fromEntries(jS.map(t=>[t.name,t.tier]));var mB=new Set(jS.filter(t=>t.name!=="query").flatMap(t=>[t.name,...t.aliases??[]])),U_e="0.22.3",B_e=new Set(["--clean","--standard","--thinking","-v","--verbose","-d","--debug","--model","--openrouter-provider","--host","-y","--yes","--offline","-D","--direct","-i","--interactive","-c","--continue-chat","-n","--new-chat","--auto","--auto-background-timeout","--no-colors","--colors","--no-emojis","--emojis","--no-animations","--animations","--no-streaming","--streaming","--show-tokens","--show-cost","--output-format","--tools","--exclude-tools","--max-turns","--max-budget-usd","--bare","--append-system-prompt","--append-system-prompt-file","--continue","--signature","--no-signature","--no-project-config","--project-config","--local","-h","--help","-V","--version"]),lI=new Set(["--model","--openrouter-provider","--host","-c","--continue-chat","--auto-background-timeout","--output-format","--tools","--exclude-tools","--max-turns","--max-budget-usd","--append-system-prompt","--append-system-prompt-file","--signature"]);function G_e(t){let e=[];for(let r=0;r<t.length;r++){let n=t[r],s=n.indexOf("="),o=s>0?n.slice(0,s):n;if(B_e.has(o)){s===-1&&lI.has(o)&&r++;continue}e.push(n)}return e}var pB=/^[a-z0-9_]{2,40}$/i;function z_e(t){for(let e=2;e<t.length;e++){let r=t[e];if(r.startsWith("-")){!r.includes("=")&&lI.has(r)&&e++;continue}return r}}function H_e(t){for(let e=0;e<t.length;e++){let r=t[e];if(r.startsWith("-")){!r.includes("=")&&lI.has(r)&&e++;continue}return!0}return!1}function q_e(t){let e=z_e(t);if(e!==void 0&&e!=="agent"&&mB.has(e))return{argv:t};let r=[],n,s;for(let o=0;o<t.length;o++){let i=t[o];if(i==="--continue"){r.push(i);let a=t[o+1];n===void 0&&s===void 0&&a!==void 0&&!a.startsWith("-")&&pB.test(a)&&(H_e(t.slice(o+2))?s=`--continue ${a} \u2026: ambiguous \u2014 quote the text (aii --continue "${a} \u2026") to run it as a prompt, or run \`aii --continue ${a}\` alone to resume that session.`:(n=a,o++));continue}if(i.startsWith("--continue=")){let a=i.slice(11);r.push("--continue"),pB.test(a)?n===void 0&&(n=a):s=`--continue=${a}: not a session id (2-40 letters/digits/underscores). \`aii goals\` lists this project's sessions.`;continue}r.push(i)}return{argv:r,continueId:n,error:s}}function j_e(t){if(t===void 0)return;let e=Number(t);if(!Number.isInteger(e)||e<0)throw new Error(`Invalid --max-turns "${t}": expected a non-negative integer`);return e}function Y_e(t){if(t===void 0)return;let e=Number(t);if(!Number.isFinite(e)||e<0)throw new Error(`Invalid --max-budget-usd "${t}": expected a non-negative number`);return e}function W_e(){let t=new cB;return t.name("aii").description("AI-powered CLI assistant").version(U_e,"-V, --version","Show version number").helpOption(!1).enablePositionalOptions().argument("[query...]","Natural language query").option("--clean","Clean output mode (just the result)").option("--standard","Standard output mode (result + metrics)").option("--thinking","Thinking mode (full reasoning)").option("-v, --verbose","Verbose output (alias for --thinking)").option("-d, --debug","Debug output").option("--model <model>","Override LLM model (e.g., ollama/llama3.1:8b, deepseek/deepseek-chat)").option("--openrouter-provider <slug>","Pin OpenRouter requests to a specific backend provider").option("--host <host>","API server host:port").option("--local","Force the local backend for this run (ignore managed cloud)").option("-y, --yes","Auto-confirm shell commands").option("--offline","Offline mode (no web/MCP)").option("-D, --direct","Direct mode (bypass server intent recognition)").option("-i, --interactive","Interactive chat mode").option("-c, --continue-chat <id>","Continue chat session").option("-n, --new-chat","Force new chat session").option("--auto","Auto mode - auto-approve all actions").option("--auto-background-timeout <seconds>","Auto-convert foreground agents to background after N seconds (0 to disable)","120").option("--no-project-config","Skip project .aii/settings.json + settings.local.json and their deny rules for this session").option("--no-colors","Disable colored output").option("--no-emojis","Disable emoji icons").option("--no-animations","Disable animations").option("--no-streaming","Disable streaming").option("--show-tokens","Show token usage").option("--show-cost","Show cost estimates").option("--output-format <format>","Output format: json or stream-json (one-shot only)").option("--tools <list>",'Allowlist of tools (comma-separated, e.g., "Read,Bash,Edit")').option("--exclude-tools <list>",'Exclude tools (comma-separated, e.g., "WebSearch,WebFetch")').option("--max-turns <n>","Max ReAct iterations within a turn (0/unset = default 500)").option("--max-budget-usd <amount>","Stop before a new turn once cumulative est. cost reaches $amount").option("--bare","Result to stdout only; all status/chrome to stderr (one-shot)").option("--append-system-prompt <text>","Append additive instructions to this run").option("--append-system-prompt-file <path>","Append a workspace file of additive instructions to this run").option("--continue","Resume the most recent local session of this project (conversation + goal)").option("-h, --help","Show help"),t.command("config").description("Configuration management").argument("[action]","Action: init, show, validate, set").argument("[key]","Config key (for set)").argument("[value]","Config value (for set)").allowUnknownOption().helpOption(!1).action(()=>{}),t.command("mcp").description("MCP server management").argument("[action]","Action: list, add, remove, status, etc.").argument("[rest...]","Server name and arguments").passThroughOptions().action(()=>{}),t.command("prompt").description("Prompt library").argument("[action]","Action: list, show, use, create").argument("[rest...]","Prompt name and arguments").allowUnknownOption().action(()=>{}),t.command("stats").description("Usage statistics").argument("[type]","Type: models, cost").action(()=>{}),t.command("history").description("Chat history").argument("[action]","Action: list, search, export, delete").argument("[query]","Search query or ID").action(()=>{}),t.command("doctor").description("System health check").action(()=>{}),t.command("install [target...]").description("Install or update Aii CLI, skills, or MCP servers").allowUnknownOption().helpOption(!1).action(()=>{}),t.command("chat").description("Interactive chat mode").action(()=>{}),t.command("agent").description("Interactive agent mode with tool execution").argument("[query...]","Optional query (non-interactive if provided)").action(()=>{}),t.command("loop").description("Autonomous agent loop (Ralph Wiggum pattern)").argument("[args...]","Loop arguments (prompt, --max, --verify, --budget, etc.)").allowUnknownOption().action(()=>{}),t.command("telegram").description("Telegram bot channel (chat with Aii from Telegram)").argument("[action]","Action: start, pair, status, unpair").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("sessions").description("Manage server sessions (list, info, resume, rename, delete)").argument("[action]","Action: list, info, resume, rename, delete").argument("[args...]","Additional arguments (session ID, name, etc.)").allowUnknownOption().action(()=>{}),t.command("goals").description("List goals across this project's local sessions (pick one up with --continue <id>)").action(()=>{}),t.command("worktree").description("Manage git worktrees for isolated development").argument("[action]","Action: create, list, remove, clean").argument("[name]","Worktree name (for create/remove)").allowUnknownOption().action(()=>{}),t.command("soul").description("Manage agent soul (personality & identity)").argument("[action]","Action: switch, show").argument("[name]","Soul name (for switch)").allowUnknownOption().action(()=>{}),t.command("cloud").description("Manage the Aii Cloud connection (login, connect, status)").argument("[action]","Action: login, connect, status").allowUnknownOption().action(()=>{}),t.command("login").description("Sign in to an AI provider with your subscription (e.g., xAI SuperGrok)").argument("[args...]","Flags: --provider <name>, --status, --logout").allowUnknownOption().action(()=>{}),t.command("skill").description("Manage AI skills").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("plugin").description("Manage skill plugins").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("persona").description("Manage workspace personas").allowUnknownOption().passThroughOptions().action(()=>{}),t.command("upgrade").description("Update Aii CLI to latest version").argument("[version]","Target version (default: latest)").action(()=>{}),t.command("run").description("Run domain-specific operations").argument("<operation>","Operation (e.g., git commit)").argument("[args...]","Additional arguments").allowUnknownOption().action(()=>{}),t.command("help").description("display help for command").argument("[command]","Command to show help for").action(()=>{}),t.command("version").description("Show version number").action(()=>{}),t}async function fB(t){let e=q_e(t),r=e.argv,n=W_e();n.exitOverride(),n.configureOutput({writeErr:()=>{}});let s="query",o,i=[];try{n.parse(r),i=n.args;let d=n.args[0];d&&mB.has(d)&&(s=d,o=n.args[1],i=n.args.slice(2))}catch(d){d instanceof lB&&(d.code==="commander.version"||d.code==="commander.helpDisplayed")&&process.exit(0),i=G_e(r.slice(2))}let a=n.opts(),l={clean:a.clean??!1,standard:a.standard??!1,thinking:a.thinking??!1,verbose:a.verbose??!1,debug:a.debug??!1,model:a.model,host:a.host,local:a.local??!1,openrouterProvider:a.openrouterProvider,yes:a.yes??!1,offline:a.offline??!1,direct:a.direct??!1,interactive:a.interactive??!1,continueChat:a.continueChat,newChat:a.newChat??!1,auto:a.auto??!1,quiet:!1,noProjectConfig:a.projectConfig===!1,autoBackgroundTimeout:(()=>{let d=parseInt(a.autoBackgroundTimeout??"120",10);return isNaN(d)||d===0?0:Math.max(30,Math.min(600,d))*1e3})(),noColors:!a.colors,noEmojis:!a.emojis,noAnimations:!a.animations,noStreaming:!a.streaming,showTokens:a.showTokens??!1,showCost:a.showCost??!1,outputFormat:a.outputFormat,tools:a.tools,excludeTools:a.excludeTools,maxTurns:j_e(a.maxTurns),maxBudgetUsd:Y_e(a.maxBudgetUsd),bare:a.bare??!1,appendSystemPrompt:a.appendSystemPrompt,appendSystemPromptFile:a.appendSystemPromptFile,continue:a.continue??!1,continueId:e.continueId,continueIdError:e.error,help:a.help??!1,version:a.version??!1},c;iI()&&(c=await uB()),(s==="chat"||l.interactive)&&(s="agent"),s==="query"&&!i.length&&!c&&(s="agent");let u;if(s==="query"&&i.length>0)u=i.join(" ");else if(s==="agent"){let d=[];o&&d.push(o),i.length>0&&d.push(...i),d.length>0&&(u=d.join(" "))}return{command:s,subcommand:o,args:i,flags:l,stdinContent:c,query:u}}function hB(t){let e=dB(t.command)??Te.SERVER;switch(t.command){case"config":return K_e(t);case"mcp":return V_e(t);case"prompt":return Q_e(t);case"stats":return X_e(t);case"history":return J_e(t);case"doctor":return{tier:Te.LOCAL,handler:"doctor",params:{}};case"goals":return{tier:Te.LOCAL,handler:"goals",params:{}};case"install":return{tier:Te.LOCAL,handler:"install",params:{}};case"chat":return{tier:Te.SERVER,handler:"chat",params:{continueChat:t.flags.continueChat}};case"run":return eEe(t);case"agent":return{tier:Te.SERVER,handler:"agent",params:{interactive:!t.query}};case"loop":return{tier:Te.SERVER,handler:"loop",params:{}};case"telegram":return{tier:Te.SERVER,handler:"telegram",params:{action:t.subcommand??t.args[0]??"start"}};case"sessions":return{tier:Te.SERVER,handler:"sessions",params:{action:t.subcommand??t.args[0]??"list"}};case"worktree":return{tier:Te.LOCAL,handler:"worktree",params:{action:t.subcommand??t.args[0]??"list",name:t.subcommand?t.args[0]:t.args[1]}};case"soul":return{tier:Te.LOCAL,handler:"soul",params:{action:t.subcommand??t.args[0]??"show",name:t.subcommand?t.args[0]:t.args[1]}};case"cloud":return{tier:Te.LOCAL,handler:"cloud",params:{action:t.subcommand??t.args[0]??"status"}};case"login":return{tier:Te.LOCAL,handler:"login",params:{}};case"skill":return{tier:Te.LOCAL,handler:"skill",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"plugin":return{tier:Te.LOCAL,handler:"plugin",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"persona":return{tier:Te.LOCAL,handler:"persona",params:{action:t.args[0]||"help",target:t.args[1]||null,extraArgs:t.args.slice(2)}};case"upgrade":return{tier:Te.LOCAL,handler:"upgrade",params:{version:t.args[0]||null}};case"help":return{tier:Te.LOCAL,handler:"help",params:{command:t.subcommand}};case"version":return{tier:Te.LOCAL,handler:"version",params:{}};case"query":default:return{tier:e,handler:"query",params:{query:t.query,stdinContent:t.stdinContent}}}}function K_e(t){let e=t.subcommand??t.args[0]??"show";return{tier:Te.LOCAL,handler:`config:${e}`,params:{key:t.args[0],value:t.args[1]}}}function V_e(t){let e=t.subcommand??t.args[0]??"list";return{tier:Te.LOCAL,handler:`mcp:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function Q_e(t){let e=t.subcommand??t.args[0]??"list";return{tier:Te.LOCAL,handler:`prompt:${e}`,params:{name:t.args[0],args:t.args.slice(1)}}}function X_e(t){let e=t.subcommand??t.args[0];return{tier:Te.LOCAL,handler:e?`stats:${e}`:"stats",params:{}}}function J_e(t){let e=t.subcommand??t.args[0]??"list";return{tier:Te.LOCAL,handler:`history:${e}`,params:{query:t.args[0],id:t.args[0]}}}var Z_e=new Set(["--model","--host","--continue-chat","-c","--signature","--base"]);function eEe(t){let e=[...t.subcommand?[t.subcommand]:[],...t.args],r=[];for(let s=0;s<e.length;s++){let o=e[s];if(Z_e.has(o)){e[s+1]!==void 0&&!e[s+1].startsWith("-")&&s++;continue}o.startsWith("-")||r.push(o)}let n=r.join(" ");return{tier:Te.SERVER,handler:"run",params:{operation:n}}}Qe();eb();ru();di();ye();import{createInterface as PVe}from"readline";import{spawn as LVe}from"child_process";ku();ye();import gk from"node:process";import lme from"node:process";import mk from"node:process";var jYe=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(t,r),o=Object.getOwnPropertyDescriptor(e,r);!YYe(s,o)&&n||Object.defineProperty(t,r,o)},YYe=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},WYe=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},KYe=(t,e)=>`/* Wrapped ${t}*/
3671
3671
  ${e}`,VYe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),QYe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),XYe=(t,e,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=KYe.bind(null,n,e.toString());Object.defineProperty(s,"name",QYe);let{writable:o,enumerable:i,configurable:a}=VYe;Object.defineProperty(t,"toString",{value:s,writable:o,enumerable:i,configurable:a})};function R9(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:n}=t;for(let s of Reflect.ownKeys(e))jYe(t,e,s,r);return WYe(t,e),XYe(t,e,n),t}var uk=new WeakMap,nme=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,n=0,s=t.displayName||t.name||"<anonymous>",o=function(...i){if(uk.set(o,++n),n===1)r=t.apply(this,i),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return R9(o,t),uk.set(o,n),o};nme.callCount=t=>{if(!uk.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return uk.get(t)};var sme=nme;var jd=[];jd.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&jd.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&jd.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var dk=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",N9=Symbol.for("signal-exit emitter"),O9=globalThis,JYe=Object.defineProperty.bind(Object),x9=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(O9[N9])return O9[N9];JYe(O9,N9,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],s=n.indexOf(r);s!==-1&&(s===0&&n.length===1?n.length=0:n.splice(s,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let o of this.listeners[e])s=o(r,n)===!0||s;return e==="exit"&&(s=this.emit("afterExit",r,n)||s),s}},pk=class{},ZYe=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),M9=class extends pk{onExit(){return()=>{}}load(){}unload(){}},P9=class extends pk{#i=L9.platform==="win32"?"SIGINT":"SIGHUP";#r=new x9;#e;#s;#p;#t={};#o=!1;constructor(e){super(),this.#e=e,this.#t={};for(let r of jd)this.#t[r]=()=>{let n=this.#e.listeners(r),{count:s}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(s+=o.__signal_exit_emitter__.count),n.length===s){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#i:r;i||e.kill(e.pid,a)}};this.#p=e.reallyExit,this.#s=e.emit}onExit(e,r){if(!dk(this.#e))return()=>{};this.#o===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#r.count+=1;for(let e of jd)try{let r=this.#t[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#m(e,...r),this.#e.reallyExit=e=>this.#n(e)}}unload(){this.#o&&(this.#o=!1,jd.forEach(e=>{let r=this.#t[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#s,this.#e.reallyExit=this.#p,this.#r.count-=1)}#n(e){return dk(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#p.call(this.#e,this.#e.exitCode)):0}#m(e,...r){let n=this.#s;if(e==="exit"&&dk(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return n.call(this.#e,e,...r)}},L9=globalThis.process,{onExit:ome,load:Skt,unload:bkt}=ZYe(dk(L9)?new P9(L9):new M9);var ime=mk.stderr.isTTY?mk.stderr:mk.stdout.isTTY?mk.stdout:void 0,eWe=ime?sme(()=>{ome(()=>{ime.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},ame=eWe;var fk=!1,oh={};oh.show=(t=lme.stderr)=>{t.isTTY&&(fk=!1,t.write("\x1B[?25h"))};oh.hide=(t=lme.stderr)=>{t.isTTY&&(ame(),fk=!0,t.write("\x1B[?25l"))};oh.toggle=(t,e)=>{t!==void 0&&(fk=t),fk?oh.show(e):oh.hide(e)};var F9=oh;var nS=Dt($9(),1);ye();import ei from"node:process";function U9(){return ei.platform!=="win32"?ei.env.TERM!=="linux":!!ei.env.CI||!!ei.env.WT_SESSION||!!ei.env.TERMINUS_SUBLIME||ei.env.ConEmuTask==="{cmd::Cmder}"||ei.env.TERM_PROGRAM==="Terminus-Sublime"||ei.env.TERM_PROGRAM==="vscode"||ei.env.TERM==="xterm-256color"||ei.env.TERM==="alacritty"||ei.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var rWe={info:m.blue("\u2139"),success:m.green("\u2714"),warning:m.yellow("\u26A0"),error:m.red("\u2716")},nWe={info:m.blue("i"),success:m.green("\u221A"),warning:m.yellow("\u203C"),error:m.red("\xD7")},sWe=U9()?rWe:nWe,rS=sWe;qb();var oWe=_u();function B9(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(oWe,"")}rN();function G9({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import pme from"node:process";function z9(){let{env:t}=pme,{TERM:e,TERM_PROGRAM:r}=t;return pme.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import qi from"node:process";var iWe=3,H9=class{#i=0;start(){this.#i++,this.#i===1&&this.#r()}stop(){if(this.#i<=0)throw new Error("`stop` called more times than `start`");this.#i--,this.#i===0&&this.#e()}#r(){qi.platform==="win32"||!qi.stdin.isTTY||(qi.stdin.setRawMode(!0),qi.stdin.on("data",this.#s),qi.stdin.resume())}#e(){qi.stdin.isTTY&&(qi.stdin.off("data",this.#s),qi.stdin.pause(),qi.stdin.setRawMode(!1))}#s(e){e[0]===iWe&&qi.emit("SIGINT")}},aWe=new H9,q9=aWe;var lWe=Dt($9(),1),j9=class{#i=0;#r=!1;#e=0;#s=-1;#p=0;#t;#o;#n;#m;#h;#c;#u;#d;#g;#a;#l;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#t={color:"cyan",stream:gk.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#h=this.#t.interval,this.#n=this.#t.stream,this.#c=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:G9({stream:this.#n}),this.#u=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,gk.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#c,Object.defineProperty(this,"_linesToClear",{get(){return this.#i},set(r){this.#i=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#s}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#f()}get interval(){return this.#h??this.#o.interval??100}get spinner(){return this.#o}set spinner(e){if(this.#s=-1,this.#h=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#o=e}else if(!z9())this.#o=nS.default.line;else if(e===void 0)this.#o=nS.default.dots;else if(e!=="default"&&nS.default[e])this.#o=nS.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#f()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#f()}get suffixText(){return this.#l}set suffixText(e=""){this.#l=e,this.#f()}get isSpinning(){return this.#m!==void 0}#_(e=this.#a,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}#E(e=this.#l,r=" "){return typeof e=="string"&&e!==""?r+e:typeof e=="function"?r+e():""}#f(){let e=this.#n.columns??80,r=this.#_(this.#a,"-"),n=this.#E(this.#l,"-"),s=" ".repeat(this.#d)+r+"--"+this.#g+"--"+n;this.#e=0;for(let o of B9(s).split(`
3672
3672
  `))this.#e+=Math.max(1,Math.ceil(Hp(o,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#c&&!this.#u}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#c=e}get isSilent(){return this.#u}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#u=e}frame(){let e=Date.now();(this.#s===-1||e-this.#p>=this.interval)&&(this.#s=++this.#s%this.#o.frames.length,this.#p=e);let{frames:r}=this.#o,n=r[this.#s];this.color&&(n=m[this.color](n));let s=typeof this.#a=="string"&&this.#a!==""?this.#a+" ":"",o=typeof this.text=="string"?" "+this.text:"",i=typeof this.#l=="string"&&this.#l!==""?" "+this.#l:"";return s+n+o+i}clear(){if(!this.#c||!this.#n.isTTY)return this;this.#n.cursorTo(0);for(let e=0;e<this.#i;e++)e>0&&this.#n.moveCursor(0,-1),this.#n.clearLine(1);return(this.#d||this.lastIndent!==this.#d)&&this.#n.cursorTo(this.#d),this.lastIndent=this.#d,this.#i=0,this}render(){return this.#u?this:(this.clear(),this.#n.write(this.frame()),this.#i=this.#e,this)}start(e){return e&&(this.text=e),this.#u?this:this.#c?this.isSpinning?this:(this.#t.hideCursor&&F9.hide(this.#n),this.#t.discardStdin&&gk.stdin.isTTY&&(this.#r=!0,q9.start()),this.render(),this.#m=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
3673
3673
  `),this)}stop(){return this.#c?(clearInterval(this.#m),this.#m=void 0,this.#s=0,this.clear(),this.#t.hideCursor&&F9.show(this.#n),this.#t.discardStdin&&gk.stdin.isTTY&&this.#r&&(q9.stop(),this.#r=!1),this):this}succeed(e){return this.stopAndPersist({symbol:rS.success,text:e})}fail(e){return this.stopAndPersist({symbol:rS.error,text:e})}warn(e){return this.stopAndPersist({symbol:rS.warning,text:e})}info(e){return this.stopAndPersist({symbol:rS.info,text:e})}stopAndPersist(e={}){if(this.#u)return this;let r=e.prefixText??this.#a,n=this.#_(r," "),s=e.symbol??" ",o=e.text??this.text,a=typeof o=="string"?(s?" ":"")+o:"",l=e.suffixText??this.#l,c=this.#E(l," "),u=n+s+a+c+`
@@ -3677,7 +3677,7 @@ ${e}`,VYe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),QYe=Obj
3677
3677
  `+this.color(s,m.dim)}formatError(e){let r=[];return r.push(this.color(`${this.emoji("\u274C ")}${e.message}`,m.red)),e.suggestions&&e.suggestions.length>0&&(r.push(""),r.push(this.color(`${this.emoji("\u{1F4A1} ")}Solutions:`,m.yellow)),e.suggestions.forEach((n,s)=>{r.push(this.color(` ${s+1}. ${n}`,m.gray))})),r.join(`
3678
3678
  `)}formatConfig(e){let r=[];r.push(this.color(`${this.emoji("\u{1F4CB} ")}Current AII Configuration:`,F.model)),r.push(`- Config file: ${e.configFile}`),r.push(`- Storage path: ${e.storagePath}`),e.apiUrl&&r.push(`- Aii Server: ${e.apiUrl}`);let n=e.hasApiKey?this.color("\u2713",m.green):this.color("\u2717",m.red),s=e.model.startsWith(e.provider+"/")?e.model.slice(e.provider.length+1):e.model;if(r.push(`- LLM provider: ${e.provider} (${s}) - ${n}`),e.webSearch){let o=e.webSearch.enabled?this.color("\u2713",m.green):this.color("\u2717",m.red);r.push(`- Web search: ${e.webSearch.provider??"none"} - ${o}`)}return e.issues&&e.issues.length>0&&r.push(`- Configuration issues: ${e.issues.length}`),r.join(`
3679
3679
  `)}formatHealthCheck(e,r){let n=[],s=r?`Aii Doctor v${r}`:"Aii Doctor";n.push(this.color(s,F.model)),n.push("");let o=22;for(let l of e){let c=o-l.name.length-1,u=".".repeat(Math.max(2,c)),d,p;switch(l.status){case"ok":d="OK",p=m.green;break;case"warn":d="WARN",p=m.yellow;break;case"error":d="FAIL",p=m.red;break}let h=this.color(d,p),f=l.message?` (${l.message})`:"";n.push(` ${l.name} ${this.color(u,m.gray)} ${h}${f}`)}let i=e.filter(l=>l.status==="error").length,a=e.filter(l=>l.status==="warn").length;return n.push(""),i>0?n.push(` ${this.color(`${i} check${i>1?"s":""} failed.`,m.red)}`):a>0?n.push(` ${this.color("All checks passed with warnings.",m.yellow)}`):n.push(` ${this.color("All checks passed.",m.green)}`),n.join(`
3680
- `)}};function ds(t={}){return new V9(t)}Yn();po();ye();ku();import*as Eme from"readline";Yn();dn();po();j1();import*as mo from"fs";import*as Ek from"path";import*as mme from"os";var sS=Ek.join(mme.homedir(),".aii","conversations"),X9=Ek.join(sS,"current.json");function yk(){mo.existsSync(sS)||mo.mkdirSync(sS,{recursive:!0,mode:448});try{mo.chmodSync(sS,448)}catch{}}function dWe(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function pWe(t){let r=t.trim().replace(/\s+/g," ");return r.length>50&&(r=r.substring(0,50).trim()+"..."),r}function fme(t){return Ek.join(sS,`${t}.json`)}function hme(){yk();try{if(mo.existsSync(X9)){let t=mo.readFileSync(X9,"utf-8"),e=JSON.parse(t),r=fme(e.id);if(mo.existsSync(r)){let n=mo.readFileSync(r,"utf-8");return JSON.parse(n)}}}catch{}return gme()}function gme(){yk();let t={id:dWe(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return oS(t),mWe(t.id),t}function oS(t){if(yk(),t.title==="New Conversation"&&t.messages.length>0){let r=t.messages.find(n=>n.role==="user");r&&(t.title=pWe(r.content))}t.updatedAt=Date.now();let e=fme(t.id);Wc(e,JSON.stringify(t,null,2))}function mWe(t){yk(),Wc(X9,JSON.stringify({id:t}))}function _me(){return gme()}Sd();var fWe="0.22.2",J9=class{configManager;parsed;running=!1;conversation;stats;formatter;effectiveProvider="";constructor(e,r){this.parsed=e,this.configManager=r,this.conversation=hme(),this.stats={startTime:Date.now(),totalRequests:0,cumulativeTokens:0,cumulativeCost:0},this.formatter=ds({colors:!e.flags.noColors,emojis:!e.flags.noEmojis})}async start(){for(this.running=!0,this.displayWelcome();this.running;)try{let e=await this.getUserInput();if(!e.trim()||await this.handleSpecialCommands(e))continue;this.conversation.messages.push({role:"user",content:e,timestamp:Date.now()}),oS(this.conversation),await this.processWithContext(e)}catch(e){if(e instanceof Error&&e.message==="EXIT")break;if(e instanceof Error&&e.message==="INTERRUPTED"){console.log(`
3680
+ `)}};function ds(t={}){return new V9(t)}Yn();po();ye();ku();import*as Eme from"readline";Yn();dn();po();j1();import*as mo from"fs";import*as Ek from"path";import*as mme from"os";var sS=Ek.join(mme.homedir(),".aii","conversations"),X9=Ek.join(sS,"current.json");function yk(){mo.existsSync(sS)||mo.mkdirSync(sS,{recursive:!0,mode:448});try{mo.chmodSync(sS,448)}catch{}}function dWe(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function pWe(t){let r=t.trim().replace(/\s+/g," ");return r.length>50&&(r=r.substring(0,50).trim()+"..."),r}function fme(t){return Ek.join(sS,`${t}.json`)}function hme(){yk();try{if(mo.existsSync(X9)){let t=mo.readFileSync(X9,"utf-8"),e=JSON.parse(t),r=fme(e.id);if(mo.existsSync(r)){let n=mo.readFileSync(r,"utf-8");return JSON.parse(n)}}}catch{}return gme()}function gme(){yk();let t={id:dWe(),title:"New Conversation",messages:[],createdAt:Date.now(),updatedAt:Date.now()};return oS(t),mWe(t.id),t}function oS(t){if(yk(),t.title==="New Conversation"&&t.messages.length>0){let r=t.messages.find(n=>n.role==="user");r&&(t.title=pWe(r.content))}t.updatedAt=Date.now();let e=fme(t.id);Wc(e,JSON.stringify(t,null,2))}function mWe(t){yk(),Wc(X9,JSON.stringify({id:t}))}function _me(){return gme()}Sd();var fWe="0.22.3",J9=class{configManager;parsed;running=!1;conversation;stats;formatter;effectiveProvider="";constructor(e,r){this.parsed=e,this.configManager=r,this.conversation=hme(),this.stats={startTime:Date.now(),totalRequests:0,cumulativeTokens:0,cumulativeCost:0},this.formatter=ds({colors:!e.flags.noColors,emojis:!e.flags.noEmojis})}async start(){for(this.running=!0,this.displayWelcome();this.running;)try{let e=await this.getUserInput();if(!e.trim()||await this.handleSpecialCommands(e))continue;this.conversation.messages.push({role:"user",content:e,timestamp:Date.now()}),oS(this.conversation),await this.processWithContext(e)}catch(e){if(e instanceof Error&&e.message==="EXIT")break;if(e instanceof Error&&e.message==="INTERRUPTED"){console.log(`
3681
3681
  \u26A0\uFE0F Interrupted. Type /exit to quit or continue chatting.`);continue}console.error(m.red(`
3682
3682
  \u274C Error: ${e instanceof Error?e.message:String(e)}`)),this.conversation.messages.length>0&&this.conversation.messages[this.conversation.messages.length-1].role==="user"&&(this.conversation.messages.pop(),oS(this.conversation))}}displayWelcome(){console.log("\u{1FABC} Entering interactive mode."),console.log(""),console.log("Controls:"),console.log(" \u2022 Enter - Send message"),console.log(" \u2022 End with \\ - Multi-line mode"),console.log(" \u2022 /exit - Quit chat"),console.log(" \u2022 /help - Show all commands"),console.log("")}getUserInput(){return new Promise((e,r)=>{let n=Eme.createInterface({input:process.stdin,output:process.stdout}),s=[],o=!1,i=()=>{o=!0,n.close()},a=l=>{n.question(l,c=>{if(s.length===0&&c.trim().startsWith("/")){i(),e(c.trim());return}c.endsWith("\\")?(s.push(c.slice(0,-1)),a(" ")):(s.push(c),i(),e(s.join(`
3683
3683
  `).trim()))})};n.on("SIGINT",()=>{i(),r(new Error("INTERRUPTED"))}),n.on("close",()=>{o||r(new Error("EXIT"))}),a("> ")})}async handleSpecialCommands(e){let r=e.trim().toLowerCase();if(r.startsWith("/"))r=r.slice(1);else return!1;switch(r){case"exit":case"quit":return await this.handleExit(),!0;case"help":return this.displayHelp(),!0;case"clear":case"new":return this.clearConversation(),!0;case"history":return this.displayConversationHistory(),!0;case"stats":return this.displayStats(),!0;case"version":return this.displayVersion(),!0;default:return console.log(m.yellow(`Unknown command: /${r}. Type /help for available commands.`)),console.log(""),!0}}async processWithContext(e){let r=await this.configManager.load(),n=this.configManager.validate();if(!n.valid)throw new on(n.issues.join(", "));let o=this.configManager.getServerApiKey()||"aii_sk_7WyvfQ0PRzufJ1G66Qn8Sm4gW9Tealpo6vOWDDUeiv4",i=Ar(this.parsed.flags.model??""),a=Zr(i||void 0,r.llm.provider),l=ur(i||r.llm.model,a);this.effectiveProvider=a;let c=this.parsed.flags.host?`http://${this.parsed.flags.host}`:r.api.url,u=await ut(a,this.configManager,{serverBaseUrl:c,serverApiKey:o}),d=u?.key;if(!d)throw new Xt(`Missing API key for provider: ${a}`);this.stats.totalRequests++;let p=ji(!this.parsed.flags.noAnimations);p.start("");let h=Yi({spinner:p,enabled:!this.parsed.flags.noStreaming}),f=this.conversation.messages.slice(-21,-1).map(T=>({role:T.role,content:T.content})),g={api_key:o,system_prompt:null,user_prompt:e,user_message:e,output_mode:"CLEAN",streaming:!this.parsed.flags.noStreaming,model:l,llm_provider:a,llm_api_key:d,provider_api_key:d,...u?.authType?{auth_type:u.authType}:{},...u?.accountId?{account_id:u.accountId}:{},client_type:"cli",offline:this.parsed.flags.offline,conversation_history:f.length>0?f:void 0,soul:Cn.getInstance().getSoulName()},_=this.parsed.flags.host?`http://${this.parsed.flags.host}`:r.api.url,E=new Zn({url:_}),y="",S=!1;try{let T=await E.executeRequest(g,{onToken:v=>{y+=v,S=!0,h.onToken(v)}});h.flush();let C=T.result||y;!S&&C&&console.log(C),console.log(""),T.metadata&&this.displayExecutionSummary(T.metadata),C&&(this.conversation.messages.push({role:"assistant",content:C,timestamp:Date.now()}),oS(this.conversation))}catch(T){throw p.stop(!0),T}finally{E.disconnect()}}displayExecutionSummary(e){let r=e.cost||0,n=e.tokens_in||0,s=e.tokens_out||0,o=n+s;this.stats.cumulativeTokens+=o,this.stats.cumulativeCost+=r;let i=e.provider,a=!i;console.log(this.formatter.formatExecutionSummary({provider:i||this.effectiveProvider,providerInferred:a,model:e.model,tokens_in:n,tokens_out:s,cost:r,execution_time:e.execution_time})),console.log("")}clearConversation(){this.conversation=_me(),console.clear(),this.displayWelcome()}displayConversationHistory(){if(this.conversation.messages.length===0){console.log(`
@@ -4040,12 +4040,12 @@ Additional rules:
4040
4040
  - needs_agent=true if the input references local files, this project, the codebase, shell commands, or git operations
4041
4041
  - needs_agent=false for general knowledge questions that don't need local file or tool access
4042
4042
  - IMPORTANT: If the input is a conversational request that mentions "this project", "the codebase", "explore", or asks to work with local files, set should_invoke=false and needs_agent=true \u2014 route to the agent, not a skill
4043
- - Only invoke skills when the user's intent is clearly to run a specific workflow (e.g., "brainstorm the auth design" vs "explore this project to figure out the API design")`}parseResponse(e){let r=e.match(/\{[\s\S]*\}/);if(!r)return{shouldInvoke:!1,confidence:0};try{let n=JSON.parse(r[0]);return{shouldInvoke:n.should_invoke===!0,skillName:n.skill_name??void 0,skillArgs:n.skill_args??"",confidence:typeof n.confidence=="number"?n.confidence:0,needsAgent:n.needs_agent??!1}}catch{return{shouldInvoke:!1,confidence:0}}}timeout(){return new Promise((e,r)=>{setTimeout(()=>r(new Error("Classification timed out")),this.timeoutMs).unref()})}};mt();ye();Sh();gS();Qg();import{execSync as rKe}from"child_process";function E5(t,e){return!t||!e?!1:t.includes(e)}function y5(t,e,r){let n=Date.now();try{return{passed:!0,stdout:rKe(t,{cwd:e,timeout:r,encoding:"utf-8",stdio:["pipe","pipe","pipe"],env:{...process.env}})??"",stderr:"",exitCode:0,durationMs:Date.now()-n}}catch(s){let o=s;return{passed:!1,stdout:o.stdout??"",stderr:o.stderr??o.message??"",exitCode:o.status??1,durationMs:Date.now()-n}}}function Qme(t){let e=t?.target??process,r=t?.exit??(i=>process.exit(i)),n=t?.restoreTerminal??(()=>{try{process.stdin.isTTY&&process.stdin.setRawMode(!1),process.stdout.write("\x1B[?25h")}catch{}}),s=()=>{n(),r(130)};e.on("SIGINT",s);let o=!1;return()=>{o||(o=!0,e.removeListener("SIGINT",s))}}hr();ye();Sh();hr();tc();function S5(){return Math.min((process.stdout.columns||80)-2,76)}function nKe(t){return t.replace(/\x1b\[[0-9;]*m/g,"").length}function Xme(t,e){return t+" ".repeat(Math.max(0,e-nKe(t)))}function en(t,e){let r=e-4;return F.model("\u2502")+" "+Xme(t,r)+" "+F.model("\u2502")}function Pc(t,e,r,n,s){let o=s-4,i=Math.floor(o/2),a=m.dim(t.padEnd(13))+e,l=m.dim(r.padEnd(13))+n;return en(Xme(a,i)+l,s)}function Vd(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:`${t}`}function Lc(t){let e=Math.floor(t/1e3),r=Math.floor(e/31536e3);e%=31536e3;let n=Math.floor(e/86400);e%=86400;let s=Math.floor(e/3600);e%=3600;let o=Math.floor(e/60);e%=60;let i=[];return r>0&&i.push(`${r}y`),n>0&&i.push(`${n}d`),s>0&&i.push(`${s}h`),o>0&&i.push(`${o}m`),(e>0||i.length===0)&&i.push(`${e}s`),i.join(" ")}function Jme(t){return{completion_promise:"Completion promise detected",verification_passed:"Verification command passed",both_passed:"Promise + verification passed",max_iterations:"Max iterations reached",budget_exceeded:"Estimated cost budget exceeded",input_tokens_exceeded:"Input token limit reached",output_tokens_exceeded:"Output token limit reached",duration_exceeded:"Time limit reached",graceful_stop:"Stopped gracefully by user",user_abort:"Aborted by user",error:"Error occurred",stagnation:"Stagnation detected"}[t]??t}function b5(t,e=console.log,r){let n=S5(),s=r?" Loop (resumed) ":" Loop ",o=Math.max(0,n-3-s.length);if(e(F.model("\u250C\u2500")+m.white.bold(s)+F.model("\u2500".repeat(o)+"\u2510")),t.prompt){let u=n-12,d=t.prompt.length>u?t.prompt.slice(0,u-3)+"...":t.prompt;e(en(`Task: ${d}`,n))}else e(en(m.dim("Mode: AGENTS.md-driven activity"),n));if(r){let u=r.maxIterations>0?`iteration ${r.iteration+1}/${r.maxIterations}`:`iteration ${r.iteration+1}`,d=r.budgetUsd>0?` \xB7 $${r.spentUsd.toFixed(2)} of $${r.budgetUsd} already spent`:r.spentUsd>0?` \xB7 ~$${r.spentUsd.toFixed(2)} already spent`:"";if(e(en(`Continuing at ${u}${d}`,n)),t.verifyCommand){let p=n-14,h=t.verifyCommand.length>p?t.verifyCommand.slice(0,p-1)+"\u2026":t.verifyCommand;e(en(m.dim(`verify: ${h}`),n))}}let i=[];t.maxIterations>0&&i.push(`max ${t.maxIterations} iterations`),t.durationSeconds>0&&i.push(`time ${Lc(t.durationSeconds*1e3)}`),t.budgetUsd>0&&i.push(`budget ~$${t.budgetUsd}`),t.inputTokensLimit>0&&i.push(`input limit ${Vd(t.inputTokensLimit)} tokens`),t.outputTokensLimit>0&&i.push(`output limit ${Vd(t.outputTokensLimit)} tokens`),i.length>0?e(en(`Limits: ${i.join(", ")}`,n)):e(en(m.dim("Limits: none (hard cap: 1000 iterations)"),n)),yh(t)&&(t.verifyCommand&&e(en(`Verify: ${t.verifyCommand}`,n)),t.completionPromise&&e(en(`Promise: "${t.completionPromise}"`,n)));let a="Type to queue \xB7 /note injects now \xB7 /pause /stop /stats \xB7 Esc cancels",l=n-4,c=a.length>l?a.slice(0,Math.max(0,l-1))+"\u2026":a;e(en(m.dim(c),n)),e(F.model("\u2514"+"\u2500".repeat(n-2)+"\u2518"))}function Zme(t,e,r,n=console.log){let s=S5(),o=" Loop Stats ",i=Math.max(0,s-3-o.length),a=Date.now()-t.startTime,l=Lc(a),c=t.config.maxIterations>0?`${t.iteration}/${t.config.maxIterations}`:`${t.iteration}`,u=nt(),d=u.loopTotalInputTokens,p=u.loopTotalOutputTokens,h=u.loopCost,f=u.loopToolCalls;if(n(F.model("\u250C\u2500")+m.white.bold(o)+F.model("\u2500".repeat(i)+"\u2510")),n(Pc("Iteration:",c,"Wall clock:",l,s)),t.totalPauseMs>0||t.pauseStartTime){let g=t.pauseStartTime?Date.now()-t.pauseStartTime:0,_=t.totalPauseMs+g,E=a-_;n(Pc("Active:",Lc(E),"Paused:",Lc(_),s))}n(Pc("Cost:",`~$${h.toFixed(2)}`,"Tokens:",`${Vd(d)} in / ${Vd(p)} out`,s)),n(Pc("Tool calls:",`${f}`,"Failures:",`${r}`,s)),n(F.model("\u2514"+"\u2500".repeat(s-2)+"\u2518"))}function Ok(t,e,r=console.log){switch(e){case"running_verify":r(""),r(m.dim(` \u25CB Verifying: ${t.config.verifyCommand}`));break;case"verify_passed":r(m.green(" \u2713 Verification passed"));break;case"verify_failed":if(r(m.red(" \u2717 Verification failed")),t.lastVerifyOutput){let n=(t.lastVerifyOutput.stdout+t.lastVerifyOutput.stderr).trim();n&&n.split(`
4043
+ - Only invoke skills when the user's intent is clearly to run a specific workflow (e.g., "brainstorm the auth design" vs "explore this project to figure out the API design")`}parseResponse(e){let r=e.match(/\{[\s\S]*\}/);if(!r)return{shouldInvoke:!1,confidence:0};try{let n=JSON.parse(r[0]);return{shouldInvoke:n.should_invoke===!0,skillName:n.skill_name??void 0,skillArgs:n.skill_args??"",confidence:typeof n.confidence=="number"?n.confidence:0,needsAgent:n.needs_agent??!1}}catch{return{shouldInvoke:!1,confidence:0}}}timeout(){return new Promise((e,r)=>{setTimeout(()=>r(new Error("Classification timed out")),this.timeoutMs).unref()})}};mt();ye();Sh();gS();Qg();import{execSync as rKe}from"child_process";function E5(t,e){return!t||!e?!1:t.includes(e)}function y5(t,e,r){let n=Date.now();try{return{passed:!0,stdout:rKe(t,{cwd:e,timeout:r,encoding:"utf-8",stdio:["pipe","pipe","pipe"],env:{...process.env}})??"",stderr:"",exitCode:0,durationMs:Date.now()-n}}catch(s){let o=s;return{passed:!1,stdout:o.stdout??"",stderr:o.stderr??o.message??"",exitCode:o.status??1,durationMs:Date.now()-n}}}function Qme(t){let e=t?.target??process,r=t?.exit??(i=>process.exit(i)),n=t?.restoreTerminal??(()=>{try{process.stdin.isTTY&&process.stdin.setRawMode(!1),process.stdout.write("\x1B[?25h")}catch{}}),s=()=>{n(),r(130)};e.on("SIGINT",s);let o=!1;return()=>{o||(o=!0,e.removeListener("SIGINT",s))}}hr();ye();Sh();hr();tc();function S5(){return Math.min((process.stdout.columns||80)-2,76)}function nKe(t){return t.replace(/\x1b\[[0-9;]*m/g,"").length}function Xme(t,e){return t+" ".repeat(Math.max(0,e-nKe(t)))}function en(t,e){let r=e-4;return F.model("\u2502")+" "+Xme(t,r)+" "+F.model("\u2502")}function Pc(t,e,r,n,s){let o=s-4,i=Math.floor(o/2),a=m.dim(t.padEnd(13))+e,l=m.dim(r.padEnd(13))+n;return en(Xme(a,i)+l,s)}function Vd(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:`${t}`}function Lc(t){let e=Math.floor(t/1e3),r=Math.floor(e/31536e3);e%=31536e3;let n=Math.floor(e/86400);e%=86400;let s=Math.floor(e/3600);e%=3600;let o=Math.floor(e/60);e%=60;let i=[];return r>0&&i.push(`${r}y`),n>0&&i.push(`${n}d`),s>0&&i.push(`${s}h`),o>0&&i.push(`${o}m`),(e>0||i.length===0)&&i.push(`${e}s`),i.join(" ")}function Jme(t){return{completion_promise:"Completion promise detected",verification_passed:"Verification command passed",both_passed:"Promise + verification passed",max_iterations:"Max iterations reached",budget_exceeded:"Estimated cost budget exceeded",input_tokens_exceeded:"Input token limit reached",output_tokens_exceeded:"Output token limit reached",duration_exceeded:"Time limit reached",graceful_stop:"Stopped gracefully by user",user_abort:"Aborted by user",error:"Error occurred",stagnation:"Stagnation detected"}[t]??t}function b5(t,e=console.log,r){let n=S5(),s=r?" Loop (resumed) ":" Loop ",o=Math.max(0,n-3-s.length);if(e(F.model("\u250C\u2500")+m.white.bold(s)+F.model("\u2500".repeat(o)+"\u2510")),t.prompt){let u=n-12,d=t.prompt.length>u?t.prompt.slice(0,u-3)+"...":t.prompt;e(en(`Task: ${d}`,n))}else e(en(m.dim("Mode: AGENTS.md-driven activity"),n));if(r){let u=r.maxIterations>0?`iteration ${r.iteration+1}/${r.maxIterations}`:`iteration ${r.iteration+1}`,d=r.budgetUsd>0?` \xB7 $${r.spentUsd.toFixed(2)} of $${r.budgetUsd} already spent`:r.spentUsd>0?` \xB7 ~$${r.spentUsd.toFixed(2)} already spent`:"";if(e(en(`Continuing at ${u}${d}`,n)),t.verifyCommand){let p=n-14,h=t.verifyCommand.length>p?t.verifyCommand.slice(0,p-1)+"\u2026":t.verifyCommand;e(en(m.dim(`verify: ${h}`),n))}}let i=[];t.maxIterations>0&&i.push(`max ${t.maxIterations} iterations`),t.durationSeconds>0&&i.push(`time ${Lc(t.durationSeconds*1e3)}`),t.budgetUsd>0&&i.push(`budget ~$${t.budgetUsd}`),t.inputTokensLimit>0&&i.push(`input limit ${Vd(t.inputTokensLimit)} tokens`),t.outputTokensLimit>0&&i.push(`output limit ${Vd(t.outputTokensLimit)} tokens`),i.length>0?e(en(`Limits: ${i.join(", ")}`,n)):e(en(m.dim("Limits: none (hard cap: 1000 iterations)"),n)),yh(t)&&(t.verifyCommand&&e(en(`Verify: ${t.verifyCommand}`,n)),t.completionPromise&&e(en(`Promise: "${t.completionPromise}"`,n)));let a="Type to queue \xB7 /note injects now \xB7 /pause /stop /stats \xB7 Esc cancels",l=n-4,c=a.length>l?a.slice(0,Math.max(0,l-1))+"\u2026":a;e(en(m.dim(c),n)),e(F.model("\u2514"+"\u2500".repeat(n-2)+"\u2518"))}function Zme(t,e,r,n=console.log){let s=S5(),o=" Loop Stats ",i=Math.max(0,s-3-o.length),a=Date.now()-t.startTime,l=Lc(a),c=t.config.maxIterations>0?`${t.iteration}/${t.config.maxIterations}`:`${t.iteration}`,u=et(),d=u.loopTotalInputTokens,p=u.loopTotalOutputTokens,h=u.loopCost,f=u.loopToolCalls;if(n(F.model("\u250C\u2500")+m.white.bold(o)+F.model("\u2500".repeat(i)+"\u2510")),n(Pc("Iteration:",c,"Wall clock:",l,s)),t.totalPauseMs>0||t.pauseStartTime){let g=t.pauseStartTime?Date.now()-t.pauseStartTime:0,_=t.totalPauseMs+g,E=a-_;n(Pc("Active:",Lc(E),"Paused:",Lc(_),s))}n(Pc("Cost:",`~$${h.toFixed(2)}`,"Tokens:",`${Vd(d)} in / ${Vd(p)} out`,s)),n(Pc("Tool calls:",`${f}`,"Failures:",`${r}`,s)),n(F.model("\u2514"+"\u2500".repeat(s-2)+"\u2518"))}function Ok(t,e,r=console.log){switch(e){case"running_verify":r(""),r(m.dim(` \u25CB Verifying: ${t.config.verifyCommand}`));break;case"verify_passed":r(m.green(" \u2713 Verification passed"));break;case"verify_failed":if(r(m.red(" \u2717 Verification failed")),t.lastVerifyOutput){let n=(t.lastVerifyOutput.stdout+t.lastVerifyOutput.stderr).trim();n&&n.split(`
4044
4044
  `).slice(-5).forEach(o=>r(m.dim(` ${o}`)))}break}}function T5(t,e=console.log){e(m.yellow(` \u26A0 No tool calls for ${t} consecutive iterations`))}function xk(t,e,r=console.log,n){let s=S5();if(r(""),r(F.model("\u250C"+"\u2500".repeat(s-2)+"\u2510")),t.success?r(en(m.green.bold("\u2713 Loop Complete"),s)):r(en(m.yellow.bold("\u26A0 Loop Stopped"),s)),r(F.model("\u251C"+"\u2500".repeat(s-2)+"\u2524")),e.prompt){let l=s-12,c=e.prompt.length>l?e.prompt.slice(0,l-3)+"...":e.prompt;r(en(m.dim("Task: ")+c,s)),r(en("",s))}process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] displayLoopSummary received:"),console.error(` result.totalCost=${t.totalCost}`),console.error(` result.totalInputTokens=${t.totalInputTokens}`),console.error(` result.totalOutputTokens=${t.totalOutputTokens}`));let o=e.maxIterations>0?`${t.iterations}/${e.maxIterations}`:`${t.iterations}`;r(Pc("Iteration:",o,"Wall clock:",Lc(t.durationMs),s)),t.totalPauseMs&&t.totalPauseMs>0&&r(Pc("Active:",Lc(t.activeExecutionMs),"Paused:",Lc(t.totalPauseMs),s)),r(Pc("Cost:",`~$${t.totalCost.toFixed(2)}`,"Tokens:",`${Vd(t.totalInputTokens)} in / ${Vd(t.totalOutputTokens)} out`,s)),r(Pc("Tool calls:",`${t.totalToolCalls}`,"Failures:",`${t.consecutiveFailures??0}`,s));let i=Jme(t.exitReason),a=t.success?m.green:m.yellow;if(r(en(m.dim("Result:".padEnd(13))+a(i),s)),n){r(en("",s));let l=s-12,c=n.length>l?n.slice(0,Math.max(0,l-1))+"\u2026":n;r(en(m.green("Resume: ")+c,s))}r(F.model("\u2514"+"\u2500".repeat(s-2)+"\u2518")),r("")}function efe(t){return async(e,r)=>{if(t.isPauseRequested()){e.controller.suspendStallDetection(),t.onPauseEntered();let n=await t.waitForResume();if(e.controller.resumeStallDetection(),t.onPauseExited(),n==="aborted")return{success:!1,output:"",error:"Loop aborted during pause"}}return r()}}function Mk(t){let e=!1;return async(r,n)=>{e&&(e=!1,t.onNoteProcessed?.());let s=t.getPendingNote();return s?(t.onNoteInjected(),e=!0,{success:!0,output:["[USER NOTE]",s,"[/USER NOTE]","","The user has sent a note. Please acknowledge this note and adjust your current approach accordingly.",`The tool "${r.toolName}" was not executed \u2014 address the user's note first, then decide whether to proceed with the original tool call or take a different action.`].join(`
4045
- `)}):n()}}tc();EL();wh();Di();pc();ya();var pKe=["WebSocket disconnected unexpectedly","ECONNRESET","EPIPE","ETIMEDOUT","ECONNREFUSED","socket hang up","WebSocket was closed","WebSocket error","StallTimeout","No response for","fetch failed","Failed to fetch","AbnormalDisconnect","unexpected EOF","connection reset by peer","LLM call failed","HTTP request failed","server error","502 Bad Gateway","503 Service Unavailable","504 Gateway Timeout","overloaded"],mKe=["status 401","status 403","authentication_error","Authentication Fails","api key","API key","Invalid API key","invalid_api_key","Unauthorized","Forbidden","model not found","invalid model","does not exist"],fKe=["maximum context length","context_length_exceeded","reduce the length of the messages","maximum number of tokens","token limit exceeded","context window"],Ch={THRESHOLD:3,INITIAL_WAIT_MS:12e4,MAX_WAIT_MS:9e5,MULTIPLIER:2},hKe=250;function vh(t){return t instanceof Error?t.message:typeof t=="object"&&t!==null&&"message"in t?String(t.message):typeof t=="string"?t:JSON.stringify(t)}function afe(t){let e=vh(t);if(typeof t=="object"&&t!==null&&"retryable"in t&&t.retryable===!0)return!0;if(mKe.some(n=>e.includes(n)))return!1;let r=typeof t=="object"&&t!==null&&"name"in t?String(t.name):"";return pKe.some(n=>e.includes(n)||r.includes(n))}function lfe(t){let e=vh(t).toLowerCase();return fKe.some(r=>e.includes(r.toLowerCase()))}function at(t){(process.env.AII_DEBUG||process.env.AII_LOOP_DEBUG)&&console.error(t)}var Qd=class{config;agentController;session;state;effectiveMaxIterations;printer;durationExpired=!1;record;loopsDir;isResumed=!1;startIteration=1;initialTokensIn;initialTokensOut;initialCost;consecutiveFailedIterations=0;circuitState="closed";circuitWaitMs=Ch.INITIAL_WAIT_MS;processingQueue=!1;pausePromise=null;pauseResolver=null;pauseAutoResumeTimeout=null;pauseToastId=null;stoppingToastId=null;pendingNote=null;noteToastId=null;uiRefs=null;constructor(e,r,n,s,o){this.config=e,this.agentController=r,this.session=n,this.printer=s??console.log,this.effectiveMaxIterations=e.maxIterations>0?Math.min(e.maxIterations,pr.HARD_MAX_ITERATIONS):pr.HARD_MAX_ITERATIONS,process.env.AII_DEBUG&&console.error(`[loop] config.maxIterations=${e.maxIterations}, effectiveMaxIterations=${this.effectiveMaxIterations}`),this.initialTokensIn=n.stats.tokensIn,this.initialTokensOut=n.stats.tokensOut,this.initialCost=n.stats.totalCost,this.loopsDir=v5(n.projectPath);let i=o?.carry;if(this.state={iteration:i?.iteration??0,config:this.config,totalCost:i?.totalCost??0,totalInputTokens:i?.totalInputTokens??0,totalOutputTokens:i?.totalOutputTokens??0,totalToolCalls:i?.totalToolCalls??0,startTime:Date.now()-(i?.elapsedWallMs??0),phase:"running",pauseUntil:null,totalPauseMs:i?.totalPauseMs??0,pauseStartTime:null,lastAgentOutput:"",iterationCosts:i?[...i.iterationCosts]:[],iterationTokens:i?[...i.iterationTokens]:[],lastIterationHadToolCalls:!0,consecutiveNoToolCallIterations:i?.consecutiveNoToolCallIterations??0,capacityWarningsIssued:new Set(i?.capacityWarningsIssued??[]),userNotes:i?[...i.userNotes]:[]},i?.lastVerifyOutput&&(this.state.lastVerifyOutput={...i.lastVerifyOutput,durationMs:0}),this.startIteration=(i?.iteration??0)+1,o){let a=o.config;e.budgetUsd!==a.budgetUsd&&this.state.capacityWarningsIssued.delete("budget"),e.durationSeconds!==a.durationSeconds&&this.state.capacityWarningsIssued.delete("duration"),e.inputTokensLimit!==a.inputTokensLimit&&this.state.capacityWarningsIssued.delete("input_tokens"),e.outputTokensLimit!==a.outputTokensLimit&&this.state.capacityWarningsIssued.delete("output_tokens"),this.record={...o,config:e,pid:process.pid,status:"running",updatedAt:new Date().toISOString()},this.isResumed=!0}else this.record={version:1,id:Pk(),status:"running",pid:process.pid,projectRoot:Th(n.projectPath),cwd:n.projectPath,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),config:e,carry:this.buildCarry()};process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] LoopController initialized with session stats:"),console.error(` initial: tokensIn=${this.initialTokensIn}, tokensOut=${this.initialTokensOut}, totalCost=${this.initialCost}`))}buildCarry(){let e=this.state.lastVerifyOutput;return{iteration:this.state.iteration,totalCost:this.state.totalCost,totalInputTokens:this.state.totalInputTokens,totalOutputTokens:this.state.totalOutputTokens,totalToolCalls:this.state.totalToolCalls,iterationCosts:[...this.state.iterationCosts],iterationTokens:[...this.state.iterationTokens],consecutiveNoToolCallIterations:this.state.consecutiveNoToolCallIterations,capacityWarningsIssued:[...this.state.capacityWarningsIssued],userNotes:[...this.state.userNotes],lastVerifyOutput:e?{passed:e.passed,exitCode:e.exitCode,stdout:e.stdout.slice(-4096),stderr:e.stderr.slice(-4096)}:null,elapsedWallMs:Date.now()-this.state.startTime,totalPauseMs:this.state.totalPauseMs}}checkpoint(e,r){this.record={...this.record,status:e,exitReason:r??this.record.exitReason,pid:e==="running"?process.pid:void 0,updatedAt:new Date().toISOString(),carry:this.buildCarry()},D5(this.record,this.loopsDir)}getLoopRecordId(){return this.record.id}getPhase(){return this.state.phase}async pollableSleep(e){let r=Date.now()+e;for(;Date.now()<r&&this.getPhase()==="running";)await new Promise(n=>setTimeout(n,Math.min(hKe,r-Date.now())))}async blockWhilePaused(){this.state.pauseStartTime=Date.now(),nt().setThinking(!1),nt().setStreaming(!1),this.pauseToastId!==null&&qe().clearToast(this.pauseToastId),this.state.pauseUntil?(this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop paused"),{toast:!0,persistent:!0,expiresAt:this.state.pauseUntil})):(this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop paused \u2014 type /resume to continue, Esc to abort"),{toast:!0,persistent:!0})),await this.pausePromise}transition(e){let r=this.state.phase;({running:["paused","stopping","aborted"],paused:["running","stopping","aborted"],stopping:["aborted"],aborted:[]})[r].includes(e)&&(this.state.phase=e)}finalizePause(){this.state.pauseStartTime&&(this.state.totalPauseMs+=Date.now()-this.state.pauseStartTime,this.state.pauseStartTime=null),this.state.pauseUntil=null,this.pauseAutoResumeTimeout&&(clearTimeout(this.pauseAutoResumeTimeout),this.pauseAutoResumeTimeout=null)}resolvePausePromise(){this.pauseResolver&&(this.pauseResolver(),this.pauseResolver=null,this.pausePromise=null)}enterPause(e){e?this.state.pauseUntil=Date.now()+e*1e3:this.state.pauseUntil=null,this.pausePromise=new Promise(r=>{this.pauseResolver=r}),this.transition("paused"),e&&(this.pauseAutoResumeTimeout=setTimeout(()=>{this.resumeFromPause("auto")},e*1e3)),nt().setLoopPaused(!0,this.state.pauseUntil)}resumeFromPause(e){this.pauseAutoResumeTimeout&&(clearTimeout(this.pauseAutoResumeTimeout),this.pauseAutoResumeTimeout=null),this.state.pauseStartTime&&(this.state.totalPauseMs+=Date.now()-this.state.pauseStartTime,this.state.pauseStartTime=null),this.state.pauseUntil=null,this.transition("running"),nt().setLoopPaused(!1,null),this.pauseToastId!==null&&(qe().clearToast(this.pauseToastId),this.pauseToastId=null);let r=e==="auto"?"\u25C6 Loop resumed (auto)":"\u25C6 Loop resumed";this.printer(F.success(r),{toast:!0}),this.resolvePausePromise()}updatePause(e){this.pauseAutoResumeTimeout&&(clearTimeout(this.pauseAutoResumeTimeout),this.pauseAutoResumeTimeout=null),e?(this.state.pauseUntil=Date.now()+e*1e3,this.pauseAutoResumeTimeout=setTimeout(()=>{this.resumeFromPause("auto")},e*1e3)):this.state.pauseUntil=null,nt().setLoopPaused(!0,this.state.pauseUntil)}isPauseRequested(){return this.getPhase()==="paused"}async waitForResume(){let r=null;return r=setInterval(()=>{try{this.agentController.ping()}catch{}},3e4),this.pausePromise&&await this.pausePromise,r&&clearInterval(r),this.getPhase()==="aborted"||this.getPhase()==="stopping"?"aborted":"resumed"}onPauseEntered(){this.state.pauseStartTime=Date.now(),nt().setThinking(!1),nt().setStreaming(!1),this.pauseToastId!==null&&qe().clearToast(this.pauseToastId),this.state.pauseUntil?(this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop paused"),{toast:!0,persistent:!0,expiresAt:this.state.pauseUntil})):(this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop paused \u2014 type /resume to continue, Esc to abort"),{toast:!0,persistent:!0}))}onPauseExited(){nt().setThinking(!0)}clearStoppingToast(){this.stoppingToastId!==null&&(qe().clearToast(this.stoppingToastId),this.stoppingToastId=null)}getPendingNote(){return this.pendingNote}onNoteInjected(){let e=this.pendingNote;this.pendingNote=null,this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),e&&this.echoUserInput(e)}echoUserInput(e){if(this.uiRefs?.isUIInitialized()){try{this.uiRefs.getUI().displayUserMessage(e,{preserveStream:!0})}catch(r){at(`[loop] echo failed (non-fatal): ${r}`)}return}for(let[r,n]of e.split(`
4046
- `).entries())this.printer((r===0?"> ":" ")+n)}async run(){if(this.isResumed){let L=this.checkLimits();if(L){this.checkpoint("stopped",L),Uk(this.record.id,this.loopsDir);let q={success:!1,iterations:this.state.iteration,totalCost:this.state.totalCost,totalInputTokens:this.state.totalInputTokens,totalOutputTokens:this.state.totalOutputTokens,totalToolCalls:this.state.totalToolCalls,durationMs:Date.now()-this.state.startTime,exitReason:L,consecutiveFailures:0};return xk(q,this.config,this.printer,this.buildResumeHint(L)),q}this.checkpoint("running")}else try{this.record=I5(this.record,this.loopsDir);let L=(await Promise.resolve().then(()=>(Qe(),Qn))).getConfigManager().get("loops.keep"),q=typeof L=="number"&&Number.isFinite(L)?L:C5;O5(q,this.loopsDir)}catch(L){at(`[loop] registry create/prune failed (non-fatal): ${L}`)}let e=()=>{at("[loop] Interrupt handler called (Esc)"),this.getPhase()==="paused"&&this.finalizePause(),this.transition("aborted"),nt().setLoopPaused(!1,null),at(`[loop] state.phase set to ${this.getPhase()}`),this.agentController.interrupt(),this.resolvePausePromise()},{isUIInitialized:r,getUI:n}=await Promise.resolve().then(()=>(_r(),el));this.uiRefs={isUIInitialized:r,getUI:n};let s=null,o=null,i="max_iterations",a=this.session.mode,l=this.state.totalInputTokens,c=this.state.totalOutputTokens,u=this.state.totalCost,d=this.state.totalToolCalls,p=0,h=0,f=0,g=0,_=(L,q,z,Q)=>{let K=q-z,me=z;p+=K,h+=me,f+=Q,nt().updateLoopStats(l+p,c+h,u+f,d+g)},E=()=>{g++,nt().updateLoopStats(l+p,c+h,u+f,d+g)},y=()=>{};try{y=Qme(),this.uiRefs.isUIInitialized()?(at("[loop] UI is initialized, registering loop baseline interrupt callback"),this.uiRefs.getUI().setLoopBaselineCallback(e)):at("[loop] WARNING: UI not initialized - Esc key will not work!");try{let{useInputStore:L}=await Promise.resolve().then(()=>(Vu(),vE));s=L.subscribe(q=>{q.typeAheadQueue.length>0&&this.processQueuedMessages()}),at("[loop] Type-ahead queue subscription registered")}catch{at("[loop] WARNING: Could not subscribe to type-ahead queue")}try{let{getCommandMenuStore:L}=await Promise.resolve().then(()=>(Pw(),jP));L().setCommands([{name:"pause",description:"Pause the loop (optional duration: 30s, 5m, 2h)"},{name:"resume",description:"Resume the paused loop"},{name:"stop",description:"Stop the loop gracefully after current turn"},{name:"note",description:"Inject a note immediately (between tool calls)"},{name:"inject",description:"Alias for /note \u2014 inject a note now"},{name:"now",description:"Alias for /note \u2014 removing in a future version"},{name:"stats",description:"Show loop statistics"}]),at("[loop] Command menu populated with loop commands")}catch{at("[loop] WARNING: Could not populate command menu")}if(this.agentController.use(efe(this)),this.agentController.use(Mk(this)),this.config.durationSeconds>0){let L=Date.now()-this.state.startTime,q=Math.max(0,this.config.durationSeconds*1e3-L);q<=2147483647&&(o=setTimeout(()=>{this.durationExpired=!0,this.getPhase()==="paused"&&this.finalizePause(),this.transition("aborted"),nt().setLoopPaused(!1,null),this.agentController.interrupt(),this.resolvePausePromise()},q))}this.agentController.setLoopMode(!0),nt().startLoop(this.state.startTime,this.config.maxIterations??0),this.isResumed&&(nt().setLoopIteration(this.state.iteration),nt().updateLoopStats(this.state.totalInputTokens,this.state.totalOutputTokens,this.state.totalCost,this.state.totalToolCalls)),nt().setLoopDurationSeconds(this.config.durationSeconds),b5(this.config,this.printer,this.isResumed?{shortId:ol(this.record.id),iteration:this.state.iteration,maxIterations:this.config.maxIterations,spentUsd:this.state.totalCost,budgetUsd:this.config.budgetUsd}:void 0),this.agentController.resetInterrupt(),this.session.mode="auto",this.agentController.on("iterationUsage",_),this.agentController.on("toolCall",E),at(`[loop] Starting: effectiveMaxIterations=${this.effectiveMaxIterations}`);for(let L=this.startIteration;L<=this.effectiveMaxIterations;L++){if(at(`[loop] >>> Iteration ${L}/${this.effectiveMaxIterations}`),this.getPhase()==="aborted"||this.agentController.isInterrupted())if(this.agentController.isPauseRequested()&&this.getPhase()!=="aborted")at("[loop] Stale compaction flag at iteration start \u2014 resetting"),this.agentController.resetInterrupt();else if(this.agentController.isInterrupted()&&!this.durationExpired){i="user_abort",this.printer(m.red(`
4045
+ `)}):n()}}tc();EL();wh();Di();pc();ya();var pKe=["WebSocket disconnected unexpectedly","ECONNRESET","EPIPE","ETIMEDOUT","ECONNREFUSED","socket hang up","WebSocket was closed","WebSocket error","StallTimeout","No response for","fetch failed","Failed to fetch","AbnormalDisconnect","unexpected EOF","connection reset by peer","LLM call failed","HTTP request failed","server error","502 Bad Gateway","503 Service Unavailable","504 Gateway Timeout","overloaded"],mKe=["status 401","status 403","authentication_error","Authentication Fails","api key","API key","Invalid API key","invalid_api_key","Unauthorized","Forbidden","model not found","invalid model","does not exist"],fKe=["maximum context length","context_length_exceeded","reduce the length of the messages","maximum number of tokens","token limit exceeded","context window"],Ch={THRESHOLD:3,INITIAL_WAIT_MS:12e4,MAX_WAIT_MS:9e5,MULTIPLIER:2},hKe=250;function vh(t){return t instanceof Error?t.message:typeof t=="object"&&t!==null&&"message"in t?String(t.message):typeof t=="string"?t:JSON.stringify(t)}function afe(t){let e=vh(t);if(typeof t=="object"&&t!==null&&"retryable"in t&&t.retryable===!0)return!0;if(mKe.some(n=>e.includes(n)))return!1;let r=typeof t=="object"&&t!==null&&"name"in t?String(t.name):"";return pKe.some(n=>e.includes(n)||r.includes(n))}function lfe(t){let e=vh(t).toLowerCase();return fKe.some(r=>e.includes(r.toLowerCase()))}function at(t){(process.env.AII_DEBUG||process.env.AII_LOOP_DEBUG)&&console.error(t)}var Qd=class{config;agentController;session;state;effectiveMaxIterations;printer;durationExpired=!1;record;loopsDir;isResumed=!1;startIteration=1;initialTokensIn;initialTokensOut;initialCost;consecutiveFailedIterations=0;circuitState="closed";circuitWaitMs=Ch.INITIAL_WAIT_MS;processingQueue=!1;pausePromise=null;pauseResolver=null;pendingPauseDurationSec=null;pauseAutoResumeTimeout=null;pauseToastId=null;stoppingToastId=null;pendingNote=null;noteToastId=null;uiRefs=null;constructor(e,r,n,s,o){this.config=e,this.agentController=r,this.session=n,this.printer=s??console.log,this.effectiveMaxIterations=e.maxIterations>0?Math.min(e.maxIterations,pr.HARD_MAX_ITERATIONS):pr.HARD_MAX_ITERATIONS,process.env.AII_DEBUG&&console.error(`[loop] config.maxIterations=${e.maxIterations}, effectiveMaxIterations=${this.effectiveMaxIterations}`),this.initialTokensIn=n.stats.tokensIn,this.initialTokensOut=n.stats.tokensOut,this.initialCost=n.stats.totalCost,this.loopsDir=v5(n.projectPath);let i=o?.carry;if(this.state={iteration:i?.iteration??0,config:this.config,totalCost:i?.totalCost??0,totalInputTokens:i?.totalInputTokens??0,totalOutputTokens:i?.totalOutputTokens??0,totalToolCalls:i?.totalToolCalls??0,startTime:Date.now()-(i?.elapsedWallMs??0),phase:"running",pauseUntil:null,totalPauseMs:i?.totalPauseMs??0,pauseStartTime:null,lastAgentOutput:"",iterationCosts:i?[...i.iterationCosts]:[],iterationTokens:i?[...i.iterationTokens]:[],lastIterationHadToolCalls:!0,consecutiveNoToolCallIterations:i?.consecutiveNoToolCallIterations??0,capacityWarningsIssued:new Set(i?.capacityWarningsIssued??[]),userNotes:i?[...i.userNotes]:[]},i?.lastVerifyOutput&&(this.state.lastVerifyOutput={...i.lastVerifyOutput,durationMs:0}),this.startIteration=(i?.iteration??0)+1,o){let a=o.config;e.budgetUsd!==a.budgetUsd&&this.state.capacityWarningsIssued.delete("budget"),e.durationSeconds!==a.durationSeconds&&this.state.capacityWarningsIssued.delete("duration"),e.inputTokensLimit!==a.inputTokensLimit&&this.state.capacityWarningsIssued.delete("input_tokens"),e.outputTokensLimit!==a.outputTokensLimit&&this.state.capacityWarningsIssued.delete("output_tokens"),this.record={...o,config:e,pid:process.pid,status:"running",updatedAt:new Date().toISOString()},this.isResumed=!0}else this.record={version:1,id:Pk(),status:"running",pid:process.pid,projectRoot:Th(n.projectPath),cwd:n.projectPath,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),config:e,carry:this.buildCarry()};process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] LoopController initialized with session stats:"),console.error(` initial: tokensIn=${this.initialTokensIn}, tokensOut=${this.initialTokensOut}, totalCost=${this.initialCost}`))}buildCarry(){let e=this.state.lastVerifyOutput;return{iteration:this.state.iteration,totalCost:this.state.totalCost,totalInputTokens:this.state.totalInputTokens,totalOutputTokens:this.state.totalOutputTokens,totalToolCalls:this.state.totalToolCalls,iterationCosts:[...this.state.iterationCosts],iterationTokens:[...this.state.iterationTokens],consecutiveNoToolCallIterations:this.state.consecutiveNoToolCallIterations,capacityWarningsIssued:[...this.state.capacityWarningsIssued],userNotes:[...this.state.userNotes],lastVerifyOutput:e?{passed:e.passed,exitCode:e.exitCode,stdout:e.stdout.slice(-4096),stderr:e.stderr.slice(-4096)}:null,elapsedWallMs:Date.now()-this.state.startTime,totalPauseMs:this.state.totalPauseMs}}checkpoint(e,r){this.record={...this.record,status:e,exitReason:r??this.record.exitReason,pid:e==="running"?process.pid:void 0,updatedAt:new Date().toISOString(),carry:this.buildCarry()},D5(this.record,this.loopsDir)}getLoopRecordId(){return this.record.id}getPhase(){return this.state.phase}async pollableSleep(e){let r=Date.now()+e;for(;Date.now()<r&&this.getPhase()==="running";)await new Promise(n=>setTimeout(n,Math.min(hKe,r-Date.now())))}async blockWhilePaused(){this.state.pauseStartTime=Date.now(),this.armPauseCountdown(),et().setThinking(!1),et().setStreaming(!1),this.pauseToastId!==null&&qe().clearToast(this.pauseToastId),this.state.pauseUntil?(this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop paused"),{toast:!0,persistent:!0,expiresAt:this.state.pauseUntil})):(this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop paused \u2014 type /resume to continue, Esc to abort"),{toast:!0,persistent:!0})),await this.pausePromise}transition(e){let r=this.state.phase;({running:["paused","stopping","aborted"],paused:["running","stopping","aborted"],stopping:["aborted"],aborted:[]})[r].includes(e)&&(this.state.phase=e)}finalizePause(){this.state.pauseStartTime&&(this.state.totalPauseMs+=Date.now()-this.state.pauseStartTime,this.state.pauseStartTime=null),this.state.pauseUntil=null,this.pendingPauseDurationSec=null,this.pauseAutoResumeTimeout&&(clearTimeout(this.pauseAutoResumeTimeout),this.pauseAutoResumeTimeout=null)}resolvePausePromise(){this.pauseResolver&&(this.pauseResolver(),this.pauseResolver=null,this.pausePromise=null)}enterPause(e){this.pendingPauseDurationSec=e??null,this.state.pauseUntil=null,this.pausePromise=new Promise(r=>{this.pauseResolver=r}),this.transition("paused"),et().setLoopPaused(!0,this.state.pauseUntil)}armPauseCountdown(){let e=this.pendingPauseDurationSec;e&&(this.pendingPauseDurationSec=null,this.state.pauseUntil=Date.now()+e*1e3,this.pauseAutoResumeTimeout=setTimeout(()=>{this.resumeFromPause("auto")},e*1e3),et().setLoopPaused(!0,this.state.pauseUntil))}resumeFromPause(e){this.pendingPauseDurationSec=null,this.pauseAutoResumeTimeout&&(clearTimeout(this.pauseAutoResumeTimeout),this.pauseAutoResumeTimeout=null),this.state.pauseStartTime&&(this.state.totalPauseMs+=Date.now()-this.state.pauseStartTime,this.state.pauseStartTime=null),this.state.pauseUntil=null,this.transition("running"),et().setLoopPaused(!1,null),this.pauseToastId!==null&&(qe().clearToast(this.pauseToastId),this.pauseToastId=null);let r=e==="auto"?"\u25C6 Loop resumed (auto)":"\u25C6 Loop resumed";this.printer(F.success(r),{toast:!0}),this.resolvePausePromise()}updatePause(e){if(this.state.pauseStartTime===null){this.pendingPauseDurationSec=e??null,this.state.pauseUntil=null;return}this.pauseAutoResumeTimeout&&(clearTimeout(this.pauseAutoResumeTimeout),this.pauseAutoResumeTimeout=null),e?(this.state.pauseUntil=Date.now()+e*1e3,this.pauseAutoResumeTimeout=setTimeout(()=>{this.resumeFromPause("auto")},e*1e3)):this.state.pauseUntil=null,et().setLoopPaused(!0,this.state.pauseUntil)}isPauseRequested(){return this.getPhase()==="paused"}async waitForResume(){let r=null;return r=setInterval(()=>{try{this.agentController.ping()}catch{}},3e4),this.pausePromise&&await this.pausePromise,r&&clearInterval(r),this.getPhase()==="aborted"||this.getPhase()==="stopping"?"aborted":"resumed"}onPauseEntered(){this.state.pauseStartTime=Date.now(),this.armPauseCountdown(),et().setThinking(!1),et().setStreaming(!1),this.pauseToastId!==null&&qe().clearToast(this.pauseToastId),this.state.pauseUntil?(this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop paused"),{toast:!0,persistent:!0,expiresAt:this.state.pauseUntil})):(this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop paused \u2014 type /resume to continue, Esc to abort"),{toast:!0,persistent:!0}))}onPauseExited(){et().setThinking(!0)}clearStoppingToast(){this.stoppingToastId!==null&&(qe().clearToast(this.stoppingToastId),this.stoppingToastId=null)}getPendingNote(){return this.pendingNote}onNoteInjected(){let e=this.pendingNote;this.pendingNote=null,this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),e&&this.echoUserInput(e)}echoUserInput(e){if(this.uiRefs?.isUIInitialized()){try{this.uiRefs.getUI().displayUserMessage(e,{preserveStream:!0})}catch(r){at(`[loop] echo failed (non-fatal): ${r}`)}return}for(let[r,n]of e.split(`
4046
+ `).entries())this.printer((r===0?"> ":" ")+n)}async run(){if(this.isResumed){let L=this.checkLimits();if(L){this.checkpoint("stopped",L),Uk(this.record.id,this.loopsDir);let q={success:!1,iterations:this.state.iteration,totalCost:this.state.totalCost,totalInputTokens:this.state.totalInputTokens,totalOutputTokens:this.state.totalOutputTokens,totalToolCalls:this.state.totalToolCalls,durationMs:Date.now()-this.state.startTime,exitReason:L,consecutiveFailures:0};return xk(q,this.config,this.printer,this.buildResumeHint(L)),q}this.checkpoint("running")}else try{this.record=I5(this.record,this.loopsDir);let L=(await Promise.resolve().then(()=>(Qe(),Qn))).getConfigManager().get("loops.keep"),q=typeof L=="number"&&Number.isFinite(L)?L:C5;O5(q,this.loopsDir)}catch(L){at(`[loop] registry create/prune failed (non-fatal): ${L}`)}let e=()=>{at("[loop] Interrupt handler called (Esc)"),this.getPhase()==="paused"&&this.finalizePause(),this.transition("aborted"),et().setLoopPaused(!1,null),at(`[loop] state.phase set to ${this.getPhase()}`),this.agentController.interrupt(),this.resolvePausePromise()},{isUIInitialized:r,getUI:n}=await Promise.resolve().then(()=>(_r(),el));this.uiRefs={isUIInitialized:r,getUI:n};let s=null,o=null,i="max_iterations",a=this.session.mode,l=this.state.totalInputTokens,c=this.state.totalOutputTokens,u=this.state.totalCost,d=this.state.totalToolCalls,p=0,h=0,f=0,g=0,_=(L,q,z,Q)=>{let K=q-z,me=z;p+=K,h+=me,f+=Q,et().updateLoopStats(l+p,c+h,u+f,d+g)},E=()=>{g++,et().updateLoopStats(l+p,c+h,u+f,d+g)},y=()=>{};try{y=Qme(),this.uiRefs.isUIInitialized()?(at("[loop] UI is initialized, registering loop baseline interrupt callback"),this.uiRefs.getUI().setLoopBaselineCallback(e)):at("[loop] WARNING: UI not initialized - Esc key will not work!");try{let{useInputStore:L}=await Promise.resolve().then(()=>(Vu(),vE));s=L.subscribe(q=>{q.typeAheadQueue.length>0&&this.processQueuedMessages()}),at("[loop] Type-ahead queue subscription registered")}catch{at("[loop] WARNING: Could not subscribe to type-ahead queue")}try{let{getCommandMenuStore:L}=await Promise.resolve().then(()=>(Pw(),jP));L().setCommands([{name:"pause",description:"Pause the loop (optional duration: 30s, 5m, 2h)"},{name:"resume",description:"Resume the paused loop"},{name:"stop",description:"Stop the loop gracefully after current turn"},{name:"note",description:"Inject a note immediately (between tool calls)"},{name:"inject",description:"Alias for /note \u2014 inject a note now"},{name:"now",description:"Alias for /note \u2014 removing in a future version"},{name:"stats",description:"Show loop statistics"}]),at("[loop] Command menu populated with loop commands")}catch{at("[loop] WARNING: Could not populate command menu")}if(this.agentController.use(efe(this)),this.agentController.use(Mk(this)),this.config.durationSeconds>0){let L=Date.now()-this.state.startTime,q=Math.max(0,this.config.durationSeconds*1e3-L);q<=2147483647&&(o=setTimeout(()=>{this.durationExpired=!0,this.getPhase()==="paused"&&this.finalizePause(),this.transition("aborted"),et().setLoopPaused(!1,null),this.agentController.interrupt(),this.resolvePausePromise()},q))}this.agentController.setLoopMode(!0),et().startLoop(this.state.startTime,this.config.maxIterations??0),this.isResumed&&(et().setLoopIteration(this.state.iteration),et().updateLoopStats(this.state.totalInputTokens,this.state.totalOutputTokens,this.state.totalCost,this.state.totalToolCalls)),et().setLoopDurationSeconds(this.config.durationSeconds),b5(this.config,this.printer,this.isResumed?{shortId:ol(this.record.id),iteration:this.state.iteration,maxIterations:this.config.maxIterations,spentUsd:this.state.totalCost,budgetUsd:this.config.budgetUsd}:void 0),this.agentController.resetInterrupt(),this.session.mode="auto",this.agentController.on("iterationUsage",_),this.agentController.on("toolCall",E),at(`[loop] Starting: effectiveMaxIterations=${this.effectiveMaxIterations}`);for(let L=this.startIteration;L<=this.effectiveMaxIterations;L++){if(at(`[loop] >>> Iteration ${L}/${this.effectiveMaxIterations}`),this.getPhase()==="aborted"||this.agentController.isInterrupted())if(this.agentController.isPauseRequested()&&this.getPhase()!=="aborted")at("[loop] Stale compaction flag at iteration start \u2014 resetting"),this.agentController.resetInterrupt();else if(this.agentController.isInterrupted()&&!this.durationExpired){i="user_abort",this.printer(m.red(`
4047
4047
  Loop aborted by user (Esc)
4048
- `));break}else{i=this.durationExpired?"duration_exceeded":"user_abort";break}if(this.getPhase()==="stopping"){i="graceful_stop",this.clearStoppingToast(),this.printer(F.success(" \u25C6 Loop stopped gracefully by user (/stop)"));break}if(this.getPhase()==="paused"){if(await this.blockWhilePaused(),this.getPhase()==="stopping"){i="graceful_stop",this.clearStoppingToast(),this.printer(F.success(" \u25C6 Loop stopped gracefully by user (/stop)"));break}if(this.getPhase()==="aborted"){i=this.durationExpired?"duration_exceeded":"user_abort";break}}this.state.iteration=L,this.agentController.setCurrentIteration(L),nt().setLoopIteration(L),p=0,h=0,f=0,g=0;let q=!1;this.pendingNote&&(this.state.userNotes.unshift(this.pendingNote),this.pendingNote=null,this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),q=!0);let z=this.buildIterationPrompt(),Q=null;this.state.userNotes.length>0&&(Q=this.state.userNotes.shift(),q||qe().clearFirstPersistent()),this.clearSessionMessages();let K;try{({reanchorRenderState:K}=await Promise.resolve().then(()=>(ss(),Js)))}catch{}if(K)try{K()}catch(j){at(`[loop] re-anchor failed (non-fatal): ${j}`)}try{Re.getInstance().pruneStaleEntries(),Bo().pruneTranscripts()}catch(j){at(`[loop] prune step failed (non-fatal): ${j}`)}Q&&this.echoUserInput(Q);let me=this.session.stats.toolCalls,Z=this.session.stats.tokensIn,ce=this.session.stats.tokensOut,te=this.session.stats.totalCost;try{await this.runWithRetry(z),this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),this.consecutiveFailedIterations=0,this.circuitState!=="closed"&&(this.printer(m.green("\u2713 Provider recovered \u2014 resuming loop."),{toast:!0}),this.circuitState="closed",this.circuitWaitMs=Ch.INITIAL_WAIT_MS);{let j=this.session.stats.totalCost-te,V=this.session.stats.tokensIn-Z,ue=this.session.stats.tokensOut-ce,Pe=this.session.stats.toolCalls-me;this.state.iterationCosts.push(j),this.state.iterationTokens.push({input:V,output:ue}),this.state.totalCost+=j,this.state.totalInputTokens+=V,this.state.totalOutputTokens+=ue,this.state.totalToolCalls+=Pe,l=this.state.totalInputTokens,c=this.state.totalOutputTokens,u=this.state.totalCost,d=this.state.totalToolCalls,nt().updateLoopStats(this.state.totalInputTokens,this.state.totalOutputTokens,this.state.totalCost,this.state.totalToolCalls)}}catch(j){if(this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),at(`[loop] Iteration ${L} caught error: ${vh(j)}`),at(`[loop] state.phase=${this.getPhase()}, agentController.isInterrupted()=${this.agentController.isInterrupted()}, durationExpired=${this.durationExpired}`),this.agentController.isInterrupted()&&!this.durationExpired&&!this.agentController.isPauseRequested()){this.transition("aborted"),i="user_abort",at("[loop] Agent interrupted by user - aborting loop"),this.printer(m.red(`
4048
+ `));break}else{i=this.durationExpired?"duration_exceeded":"user_abort";break}if(this.getPhase()==="stopping"){i="graceful_stop",this.clearStoppingToast(),this.printer(F.success(" \u25C6 Loop stopped gracefully by user (/stop)"));break}if(this.getPhase()==="paused"){if(await this.blockWhilePaused(),this.getPhase()==="stopping"){i="graceful_stop",this.clearStoppingToast(),this.printer(F.success(" \u25C6 Loop stopped gracefully by user (/stop)"));break}if(this.getPhase()==="aborted"){i=this.durationExpired?"duration_exceeded":"user_abort";break}}this.state.iteration=L,this.agentController.setCurrentIteration(L),et().setLoopIteration(L),p=0,h=0,f=0,g=0;let q=!1;this.pendingNote&&(this.state.userNotes.unshift(this.pendingNote),this.pendingNote=null,this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),q=!0);let z=this.buildIterationPrompt(),Q=null;this.state.userNotes.length>0&&(Q=this.state.userNotes.shift(),q||qe().clearFirstPersistent()),this.clearSessionMessages();let K;try{({reanchorRenderState:K}=await Promise.resolve().then(()=>(ss(),Js)))}catch{}if(K)try{K()}catch(j){at(`[loop] re-anchor failed (non-fatal): ${j}`)}try{Re.getInstance().pruneStaleEntries(),Bo().pruneTranscripts()}catch(j){at(`[loop] prune step failed (non-fatal): ${j}`)}Q&&this.echoUserInput(Q);let me=this.session.stats.toolCalls,Z=this.session.stats.tokensIn,ce=this.session.stats.tokensOut,te=this.session.stats.totalCost;try{await this.runWithRetry(z),this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),this.consecutiveFailedIterations=0,this.circuitState!=="closed"&&(this.printer(m.green("\u2713 Provider recovered \u2014 resuming loop."),{toast:!0}),this.circuitState="closed",this.circuitWaitMs=Ch.INITIAL_WAIT_MS);{let j=this.session.stats.totalCost-te,V=this.session.stats.tokensIn-Z,ue=this.session.stats.tokensOut-ce,Pe=this.session.stats.toolCalls-me;this.state.iterationCosts.push(j),this.state.iterationTokens.push({input:V,output:ue}),this.state.totalCost+=j,this.state.totalInputTokens+=V,this.state.totalOutputTokens+=ue,this.state.totalToolCalls+=Pe,l=this.state.totalInputTokens,c=this.state.totalOutputTokens,u=this.state.totalCost,d=this.state.totalToolCalls,et().updateLoopStats(this.state.totalInputTokens,this.state.totalOutputTokens,this.state.totalCost,this.state.totalToolCalls)}}catch(j){if(this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),at(`[loop] Iteration ${L} caught error: ${vh(j)}`),at(`[loop] state.phase=${this.getPhase()}, agentController.isInterrupted()=${this.agentController.isInterrupted()}, durationExpired=${this.durationExpired}`),this.agentController.isInterrupted()&&!this.durationExpired&&!this.agentController.isPauseRequested()){this.transition("aborted"),i="user_abort",at("[loop] Agent interrupted by user - aborting loop"),this.printer(m.red(`
4049
4049
  Loop aborted by user (Esc)
4050
4050
  `));break}if(this.agentController.isPauseRequested()&&(at("[loop] Compaction interrupt at iteration catch \u2014 resetting"),this.agentController.resetInterrupt()),this.getPhase()==="aborted"){i=this.durationExpired?"duration_exceeded":"user_abort",at(`[loop] Aborting loop due to: ${i}`),this.printer(m.red(`
4051
4051
  Loop aborted (${i})
@@ -4053,7 +4053,7 @@ Additional rules:
4053
4053
  Loop aborted during pause (Esc/Ctrl+C)
4054
4054
  `));break}this.circuitState="half_open",this.printer(m.dim(" Probing provider...")),this.agentController.resetInterrupt(),this.clearSessionMessages();continue}else{let V=Math.min(2e3*Math.pow(2,this.consecutiveFailedIterations-1),6e4),ue=V/1e3;if(this.printer(m.yellow(` \u26A0 Iteration ${L} failed after retries: ${vh(j)}`)),this.printer(m.dim(` Waiting ${ue}s before next iteration (backoff attempt ${this.consecutiveFailedIterations})...`)),at(`[loop] Iteration ${L} failed, backing off ${V}ms before retry`),await this.pollableSleep(V),this.getPhase()==="aborted"||this.getPhase()==="stopping"){i=this.getPhase()==="stopping"?"graceful_stop":this.durationExpired?"duration_exceeded":"user_abort",this.clearStoppingToast(),at(`[loop] Aborted during backoff: ${i}`),this.printer(m.red(`
4055
4055
  Loop aborted during backoff (Esc/Ctrl+C)
4056
- `));break}this.agentController.resetInterrupt(),this.clearSessionMessages();continue}}let Ae=this.session.stats.toolCalls-me;this.state.lastAgentOutput=this.getLastAssistantText();let U=Ae>0;if(this.state.lastIterationHadToolCalls=U,U?this.state.consecutiveNoToolCallIterations=0:(this.state.consecutiveNoToolCallIterations++,this.state.consecutiveNoToolCallIterations>=pr.NO_TOOL_CALL_WARN_THRESHOLD&&T5(this.state.consecutiveNoToolCallIterations,this.printer),this.printer(m.dim(" Auto-recovering \u2014 starting next iteration"))),this.getPhase()==="aborted"){i="user_abort";break}if(await this.processQueuedMessages(),this.getPhase()==="stopping"){i="graceful_stop",this.clearStoppingToast(),this.printer(F.success(" \u25C6 Loop stopped gracefully by user (/stop)"));break}if(yh(this.config)){let j=!1;this.config.completionPromise&&(j=E5(this.state.lastAgentOutput,this.config.completionPromise));let V=!1;if(this.config.verifyCommand){Ok(this.state,"running_verify",this.printer);let Pe=y5(this.config.verifyCommand,this.session.projectPath,this.config.verifyTimeoutMs??pr.DEFAULT_VERIFY_TIMEOUT_MS);this.state.lastVerifyOutput=Pe,V=Pe.passed,Ok(this.state,V?"verify_passed":"verify_failed",this.printer)}let ue=this.checkCompletion(j,V);if(ue){i=ue;break}}let J=this.checkLimits();if(J){process.env.AII_DEBUG&&console.error(`[loop] Limit exceeded: ${J}`),i=J,this.checkpoint("running");break}this.checkpoint("running"),at(`[loop] <<< Iteration ${L} complete`)}at(`[loop] Exited: completed all ${this.effectiveMaxIterations} iterations`)}catch(L){let q=typeof L=="object"&&L!==null&&"name"in L&&L.name==="AgentInterrupt";this.getPhase()==="aborted"?i=this.durationExpired?"duration_exceeded":"user_abort":q||(i="error",this.printer(m.red(` Loop error: ${vh(L)}`)))}finally{this.uiRefs?.isUIInitialized()&&(at("[loop] Clearing loop baseline callback - restoring normal input mode"),this.uiRefs.getUI().clearLoopBaselineCallback()),this.pauseToastId!==null&&(qe().clearToast(this.pauseToastId),this.pauseToastId=null),this.agentController.removeListener("iterationUsage",_),this.agentController.removeListener("toolCall",E),s&&(s(),at("[loop] Type-ahead queue subscription removed")),o&&clearTimeout(o),this.pauseAutoResumeTimeout&&clearTimeout(this.pauseAutoResumeTimeout),this.state.pauseStartTime&&(this.state.totalPauseMs+=Date.now()-this.state.pauseStartTime,this.state.pauseStartTime=null),nt().setLoopPaused(!1,null),this.session.mode=a,this.agentController.setLoopMode(!1),this.agentController.clearMiddleware(),this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),this.pendingNote&&(this.pendingNote=null,this.printer(F.dim("\u25C6 Note discarded \u2014 loop is stopping."),{toast:!0}));try{let{useInputStore:L}=await Promise.resolve().then(()=>(Vu(),vE)),q=L.getState();q.hasQueuedMessages()&&(q.clearTypeAheadQueue(),this.printer(F.dim("\u25C6 Queued input discarded \u2014 loop ended."),{toast:!0}))}catch{}if(this.state.userNotes.length>0){for(let L=0;L<this.state.userNotes.length;L++)qe().clearFirstPersistent();this.state.userNotes=[],this.printer(F.dim("\u25C6 Queued input discarded \u2014 loop ended."),{toast:!0})}y()}let S=this.session.stats.tokensIn-this.initialTokensIn,T=this.session.stats.tokensOut-this.initialTokensOut,C=this.session.stats.totalCost-this.initialCost,v=nt(),A=Math.max(S,v.loopTotalInputTokens),D=Math.max(T,v.loopTotalOutputTokens),I=Math.max(C,v.loopCost);process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] Loop ending, final state:"),console.error(` state.totalCost=${this.state.totalCost} (from per-iteration accumulation)`),console.error(` state.totalInputTokens=${this.state.totalInputTokens}`),console.error(` state.totalOutputTokens=${this.state.totalOutputTokens}`),console.error(` session.stats: tokensIn=${this.session.stats.tokensIn}, tokensOut=${this.session.stats.tokensOut}, totalCost=${this.session.stats.totalCost}`),console.error(` initial: tokensIn=${this.initialTokensIn}, tokensOut=${this.initialTokensOut}, totalCost=${this.initialCost}`),console.error(` loop delta: tokensIn=${A}, tokensOut=${D}, totalCost=${I}`),console.error(" iterationCosts array:",this.state.iterationCosts),console.error(" iterationTokens array:",this.state.iterationTokens));let x=Date.now()-this.state.startTime,B={success:["completion_promise","verification_passed","both_passed"].includes(i),exitReason:i,iterations:this.state.iteration,totalCost:I,totalInputTokens:A,totalOutputTokens:D,durationMs:x,finalVerification:this.state.lastVerifyOutput,totalToolCalls:Math.max(this.state.totalToolCalls,v.loopToolCalls),consecutiveFailures:this.consecutiveFailedIterations,...this.state.totalPauseMs>0?{totalPauseMs:this.state.totalPauseMs,activeExecutionMs:x-this.state.totalPauseMs}:{}};this.state.totalCost=Math.max(this.state.totalCost,B.totalCost),this.state.totalInputTokens=Math.max(this.state.totalInputTokens,B.totalInputTokens),this.state.totalOutputTokens=Math.max(this.state.totalOutputTokens,B.totalOutputTokens),this.state.totalToolCalls=Math.max(this.state.totalToolCalls,B.totalToolCalls);let $=this.buildResumeHint(i);this.checkpoint(B.success?"completed":"stopped",i),Uk(this.record.id,this.loopsDir);try{let{getConfigManager:L}=await Promise.resolve().then(()=>(Qe(),Qn));if((L().getConfig().subagent?.notifications?.in_loop??"final")!=="suppress"){let{Notifier:z}=await Promise.resolve().then(()=>(YF(),Tle));await z.notifyLoopEnd({success:i!=="error",iterations:this.state.iteration,durationMs:x,summary:`${i} \xB7 ${this.state.iteration} iters${$?` \xB7 resume ${ol(this.record.id)}`:""}`})}}catch{}return xk(B,this.config,this.printer,$),B}buildResumeHint(e){if(["completion_promise","verification_passed","both_passed"].includes(e))return;let r=`/loop resume ${ol(this.record.id)}`;switch(e){case"budget_exceeded":return`${r} --budget ${Math.max(Math.ceil(this.config.budgetUsd*2),Math.ceil(this.state.totalCost)+1)}`;case"max_iterations":{if(this.state.iteration>=pr.HARD_MAX_ITERATIONS)return;let n=Math.min((this.config.maxIterations>0?this.config.maxIterations:this.state.iteration)*2,pr.HARD_MAX_ITERATIONS);return`${r} --max ${n}`}case"duration_exceeded":{let n=Math.ceil((Date.now()-this.state.startTime)/6e4),s=Math.max(1,Math.ceil(this.config.durationSeconds*2/60),n+1);return`${r} --duration ${s}m`}case"input_tokens_exceeded":return`${r} --input-tokens-limit ${Math.max(this.config.inputTokensLimit*2,this.state.totalInputTokens+1)}`;case"output_tokens_exceeded":return`${r} --output-tokens-limit ${Math.max(this.config.outputTokensLimit*2,this.state.totalOutputTokens+1)}`;default:{let n=[];return this.config.maxIterations>0&&n.push(`${Math.max(0,this.config.maxIterations-this.state.iteration)} iterations left`),this.config.budgetUsd>0&&n.push(`~$${Math.max(0,this.config.budgetUsd-this.state.totalCost).toFixed(2)} left`),n.length>0?`${r} \u2014 ${n.join(" + ")}`:r}}}checkCapacityWarnings(){let e=[];if(this.config.durationSeconds>0&&!this.state.capacityWarningsIssued.has("duration")){let n=(Date.now()-this.state.startTime)/1e3,s=n/this.config.durationSeconds;if(s>=.9){let o=Math.max(0,this.config.durationSeconds-n);e.push(`\u26A0\uFE0F TIME WARNING: ${o.toFixed(0)}s remaining (${(s*100).toFixed(0)}% used). Prepare to wrap up gracefully.`),this.state.capacityWarningsIssued.add("duration")}}if(this.config.budgetUsd>0&&!this.state.capacityWarningsIssued.has("budget")){let n=this.state.totalCost/this.config.budgetUsd;if(n>=.9){let s=Math.max(0,this.config.budgetUsd-this.state.totalCost);e.push(`\u26A0\uFE0F BUDGET WARNING: $${s.toFixed(2)} remaining (${(n*100).toFixed(0)}% used). Prepare to wrap up gracefully.`),this.state.capacityWarningsIssued.add("budget")}}if(this.config.inputTokensLimit>0&&!this.state.capacityWarningsIssued.has("input_tokens")){let n=this.state.totalInputTokens/this.config.inputTokensLimit;if(n>=.9){let s=Math.max(0,this.config.inputTokensLimit-this.state.totalInputTokens);e.push(`\u26A0\uFE0F INPUT TOKENS WARNING: ${s.toLocaleString()} remaining (${(n*100).toFixed(0)}% used). Prepare to wrap up gracefully.`),this.state.capacityWarningsIssued.add("input_tokens")}}if(this.config.outputTokensLimit>0&&!this.state.capacityWarningsIssued.has("output_tokens")){let n=this.state.totalOutputTokens/this.config.outputTokensLimit;if(n>=.9){let s=Math.max(0,this.config.outputTokensLimit-this.state.totalOutputTokens);e.push(`\u26A0\uFE0F OUTPUT TOKENS WARNING: ${s.toLocaleString()} remaining (${(n*100).toFixed(0)}% used). Prepare to wrap up gracefully.`),this.state.capacityWarningsIssued.add("output_tokens")}}return e}buildIterationPrompt(){return yh(this.config)?this.buildTaskPrompt():this.buildActivityPrompt()}buildTaskPrompt(){let e=[],r=this.config.maxIterations>0?`${this.state.iteration} of ${this.config.maxIterations}`:`${this.state.iteration}`;if(e.push(`You are in iteration ${r} of an autonomous coding loop.
4056
+ `));break}this.agentController.resetInterrupt(),this.clearSessionMessages();continue}}let Ae=this.session.stats.toolCalls-me;this.state.lastAgentOutput=this.getLastAssistantText();let U=Ae>0;if(this.state.lastIterationHadToolCalls=U,U?this.state.consecutiveNoToolCallIterations=0:(this.state.consecutiveNoToolCallIterations++,this.state.consecutiveNoToolCallIterations>=pr.NO_TOOL_CALL_WARN_THRESHOLD&&T5(this.state.consecutiveNoToolCallIterations,this.printer),this.printer(m.dim(" Auto-recovering \u2014 starting next iteration"))),this.getPhase()==="aborted"){i="user_abort";break}if(await this.processQueuedMessages(),this.getPhase()==="stopping"){i="graceful_stop",this.clearStoppingToast(),this.printer(F.success(" \u25C6 Loop stopped gracefully by user (/stop)"));break}if(yh(this.config)){let j=!1;this.config.completionPromise&&(j=E5(this.state.lastAgentOutput,this.config.completionPromise));let V=!1;if(this.config.verifyCommand){Ok(this.state,"running_verify",this.printer);let Pe=y5(this.config.verifyCommand,this.session.projectPath,this.config.verifyTimeoutMs??pr.DEFAULT_VERIFY_TIMEOUT_MS);this.state.lastVerifyOutput=Pe,V=Pe.passed,Ok(this.state,V?"verify_passed":"verify_failed",this.printer)}let ue=this.checkCompletion(j,V);if(ue){i=ue;break}}let J=this.checkLimits();if(J){process.env.AII_DEBUG&&console.error(`[loop] Limit exceeded: ${J}`),i=J,this.checkpoint("running");break}this.checkpoint("running"),at(`[loop] <<< Iteration ${L} complete`)}at(`[loop] Exited: completed all ${this.effectiveMaxIterations} iterations`)}catch(L){let q=typeof L=="object"&&L!==null&&"name"in L&&L.name==="AgentInterrupt";this.getPhase()==="aborted"?i=this.durationExpired?"duration_exceeded":"user_abort":q||(i="error",this.printer(m.red(` Loop error: ${vh(L)}`)))}finally{this.uiRefs?.isUIInitialized()&&(at("[loop] Clearing loop baseline callback - restoring normal input mode"),this.uiRefs.getUI().clearLoopBaselineCallback()),this.pauseToastId!==null&&(qe().clearToast(this.pauseToastId),this.pauseToastId=null),this.agentController.removeListener("iterationUsage",_),this.agentController.removeListener("toolCall",E),s&&(s(),at("[loop] Type-ahead queue subscription removed")),o&&clearTimeout(o),this.pauseAutoResumeTimeout&&clearTimeout(this.pauseAutoResumeTimeout),this.state.pauseStartTime&&(this.state.totalPauseMs+=Date.now()-this.state.pauseStartTime,this.state.pauseStartTime=null),et().setLoopPaused(!1,null),this.session.mode=a,this.agentController.setLoopMode(!1),this.agentController.clearMiddleware(),this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),this.pendingNote&&(this.pendingNote=null,this.printer(F.dim("\u25C6 Note discarded \u2014 loop is stopping."),{toast:!0}));try{let{useInputStore:L}=await Promise.resolve().then(()=>(Vu(),vE)),q=L.getState();q.hasQueuedMessages()&&(q.clearTypeAheadQueue(),this.printer(F.dim("\u25C6 Queued input discarded \u2014 loop ended."),{toast:!0}))}catch{}if(this.state.userNotes.length>0){for(let L=0;L<this.state.userNotes.length;L++)qe().clearFirstPersistent();this.state.userNotes=[],this.printer(F.dim("\u25C6 Queued input discarded \u2014 loop ended."),{toast:!0})}y()}let S=this.session.stats.tokensIn-this.initialTokensIn,T=this.session.stats.tokensOut-this.initialTokensOut,C=this.session.stats.totalCost-this.initialCost,v=et(),A=Math.max(S,v.loopTotalInputTokens),D=Math.max(T,v.loopTotalOutputTokens),I=Math.max(C,v.loopCost);process.env.AII_LOOP_DEBUG&&(console.error("[LOOP-DEBUG] Loop ending, final state:"),console.error(` state.totalCost=${this.state.totalCost} (from per-iteration accumulation)`),console.error(` state.totalInputTokens=${this.state.totalInputTokens}`),console.error(` state.totalOutputTokens=${this.state.totalOutputTokens}`),console.error(` session.stats: tokensIn=${this.session.stats.tokensIn}, tokensOut=${this.session.stats.tokensOut}, totalCost=${this.session.stats.totalCost}`),console.error(` initial: tokensIn=${this.initialTokensIn}, tokensOut=${this.initialTokensOut}, totalCost=${this.initialCost}`),console.error(` loop delta: tokensIn=${A}, tokensOut=${D}, totalCost=${I}`),console.error(" iterationCosts array:",this.state.iterationCosts),console.error(" iterationTokens array:",this.state.iterationTokens));let x=Date.now()-this.state.startTime,B={success:["completion_promise","verification_passed","both_passed"].includes(i),exitReason:i,iterations:this.state.iteration,totalCost:I,totalInputTokens:A,totalOutputTokens:D,durationMs:x,finalVerification:this.state.lastVerifyOutput,totalToolCalls:Math.max(this.state.totalToolCalls,v.loopToolCalls),consecutiveFailures:this.consecutiveFailedIterations,...this.state.totalPauseMs>0?{totalPauseMs:this.state.totalPauseMs,activeExecutionMs:x-this.state.totalPauseMs}:{}};this.state.totalCost=Math.max(this.state.totalCost,B.totalCost),this.state.totalInputTokens=Math.max(this.state.totalInputTokens,B.totalInputTokens),this.state.totalOutputTokens=Math.max(this.state.totalOutputTokens,B.totalOutputTokens),this.state.totalToolCalls=Math.max(this.state.totalToolCalls,B.totalToolCalls);let $=this.buildResumeHint(i);this.checkpoint(B.success?"completed":"stopped",i),Uk(this.record.id,this.loopsDir);try{let{getConfigManager:L}=await Promise.resolve().then(()=>(Qe(),Qn));if((L().getConfig().subagent?.notifications?.in_loop??"final")!=="suppress"){let{Notifier:z}=await Promise.resolve().then(()=>(YF(),Tle));await z.notifyLoopEnd({success:i!=="error",iterations:this.state.iteration,durationMs:x,summary:`${i} \xB7 ${this.state.iteration} iters${$?` \xB7 resume ${ol(this.record.id)}`:""}`})}}catch{}return xk(B,this.config,this.printer,$),B}buildResumeHint(e){if(["completion_promise","verification_passed","both_passed"].includes(e))return;let r=`/loop resume ${ol(this.record.id)}`;switch(e){case"budget_exceeded":return`${r} --budget ${Math.max(Math.ceil(this.config.budgetUsd*2),Math.ceil(this.state.totalCost)+1)}`;case"max_iterations":{if(this.state.iteration>=pr.HARD_MAX_ITERATIONS)return;let n=Math.min((this.config.maxIterations>0?this.config.maxIterations:this.state.iteration)*2,pr.HARD_MAX_ITERATIONS);return`${r} --max ${n}`}case"duration_exceeded":{let n=Math.ceil((Date.now()-this.state.startTime)/6e4),s=Math.max(1,Math.ceil(this.config.durationSeconds*2/60),n+1);return`${r} --duration ${s}m`}case"input_tokens_exceeded":return`${r} --input-tokens-limit ${Math.max(this.config.inputTokensLimit*2,this.state.totalInputTokens+1)}`;case"output_tokens_exceeded":return`${r} --output-tokens-limit ${Math.max(this.config.outputTokensLimit*2,this.state.totalOutputTokens+1)}`;default:{let n=[];return this.config.maxIterations>0&&n.push(`${Math.max(0,this.config.maxIterations-this.state.iteration)} iterations left`),this.config.budgetUsd>0&&n.push(`~$${Math.max(0,this.config.budgetUsd-this.state.totalCost).toFixed(2)} left`),n.length>0?`${r} \u2014 ${n.join(" + ")}`:r}}}checkCapacityWarnings(){let e=[];if(this.config.durationSeconds>0&&!this.state.capacityWarningsIssued.has("duration")){let n=(Date.now()-this.state.startTime)/1e3,s=n/this.config.durationSeconds;if(s>=.9){let o=Math.max(0,this.config.durationSeconds-n);e.push(`\u26A0\uFE0F TIME WARNING: ${o.toFixed(0)}s remaining (${(s*100).toFixed(0)}% used). Prepare to wrap up gracefully.`),this.state.capacityWarningsIssued.add("duration")}}if(this.config.budgetUsd>0&&!this.state.capacityWarningsIssued.has("budget")){let n=this.state.totalCost/this.config.budgetUsd;if(n>=.9){let s=Math.max(0,this.config.budgetUsd-this.state.totalCost);e.push(`\u26A0\uFE0F BUDGET WARNING: $${s.toFixed(2)} remaining (${(n*100).toFixed(0)}% used). Prepare to wrap up gracefully.`),this.state.capacityWarningsIssued.add("budget")}}if(this.config.inputTokensLimit>0&&!this.state.capacityWarningsIssued.has("input_tokens")){let n=this.state.totalInputTokens/this.config.inputTokensLimit;if(n>=.9){let s=Math.max(0,this.config.inputTokensLimit-this.state.totalInputTokens);e.push(`\u26A0\uFE0F INPUT TOKENS WARNING: ${s.toLocaleString()} remaining (${(n*100).toFixed(0)}% used). Prepare to wrap up gracefully.`),this.state.capacityWarningsIssued.add("input_tokens")}}if(this.config.outputTokensLimit>0&&!this.state.capacityWarningsIssued.has("output_tokens")){let n=this.state.totalOutputTokens/this.config.outputTokensLimit;if(n>=.9){let s=Math.max(0,this.config.outputTokensLimit-this.state.totalOutputTokens);e.push(`\u26A0\uFE0F OUTPUT TOKENS WARNING: ${s.toLocaleString()} remaining (${(n*100).toFixed(0)}% used). Prepare to wrap up gracefully.`),this.state.capacityWarningsIssued.add("output_tokens")}}return e}buildIterationPrompt(){return yh(this.config)?this.buildTaskPrompt():this.buildActivityPrompt()}buildTaskPrompt(){let e=[],r=this.config.maxIterations>0?`${this.state.iteration} of ${this.config.maxIterations}`:`${this.state.iteration}`;if(e.push(`You are in iteration ${r} of an autonomous coding loop.
4057
4057
  `),this.config.prompt&&e.push(`TASK: ${this.config.prompt}
4058
4058
  `),this.state.iteration>1&&this.state.lastVerifyOutput){let s=this.state.lastVerifyOutput;if(!s.passed){e.push(`PREVIOUS ITERATION VERIFICATION FAILED (exit code ${s.exitCode}):`);let o=(s.stdout+`
4059
4059
  `+s.stderr).trim();e.push(o.length>2e3?o.slice(-2e3):o),e.push("")}}else this.state.iteration===1&&e.push(`This is the first iteration. Start by reading relevant files to understand the current state.
@@ -4066,8 +4066,8 @@ Additional rules:
4066
4066
  `):e.push(`State from previous iterations persists in the filesystem (modified files, memory files, external API state).
4067
4067
  `),this.state.consecutiveNoToolCallIterations>0&&(e.push(`NOTE: Your previous ${this.state.consecutiveNoToolCallIterations} iteration(s) ended without any tool calls.`),e.push("You MUST take action this iteration. Start by reading your instruction files or checking the current state of your work."),e.push(`Do NOT produce text-only responses. Every response must include at least one tool call.
4068
4068
  `));let r=this.checkCapacityWarnings();return r.length>0&&(e.push("\u2550".repeat(60)),e.push(...r),e.push("SUNSET STAGE: Loop will terminate soon. Focus on wrapping up gracefully:"),e.push("- Save your current work"),e.push("- Update any status files or memory"),e.push("- Ensure external systems are in a stable state"),e.push("\u2550".repeat(60)),e.push("")),e.push("IMPORTANT: Every response MUST include at least one tool call."),e.push("Do not summarize, do not ask questions, do not produce text-only responses."),e.push("If unsure what to do, read your instruction files."),this.state.userNotes.length>0&&(e.push(""),e.push("USER NOTE (typed by the user during loop execution):"),e.push(`- ${this.state.userNotes[0]}`),this.state.userNotes.length>1&&e.push(`(${this.state.userNotes.length-1} more note(s) queued for subsequent iterations)`),e.push("Take this note into account for this iteration.")),e.join(`
4069
- `)}checkLimits(){return this.config.durationSeconds>0&&(Date.now()-this.state.startTime)/1e3>=this.config.durationSeconds?"duration_exceeded":$l(this.state.totalCost,this.config.budgetUsd)?"budget_exceeded":this.config.inputTokensLimit>0&&this.state.totalInputTokens>=this.config.inputTokensLimit?"input_tokens_exceeded":this.config.outputTokensLimit>0&&this.state.totalOutputTokens>=this.config.outputTokensLimit?"output_tokens_exceeded":null}clearSessionMessages(){this.session.messages=[]}async processQueuedMessages(){if(!this.processingQueue){this.processingQueue=!0;try{let{useInputStore:e}=await Promise.resolve().then(()=>(Vu(),vE)),r=e.getState();if(!r.hasQueuedMessages())return;for(;r.hasQueuedMessages();){let n=r.dequeueTypeAhead();if(!n?.trim())continue;let s=n.trim(),o=LE(s);if(s==="/stop"){for(this.getPhase()==="paused"&&(this.finalizePause(),this.transition("running"),nt().setLoopPaused(!1,null),this.resolvePausePromise()),this.transition("stopping"),this.stoppingToastId=qe().nextId,this.printer(F.success("\u25C6 Stopping after current turn completes..."),{toast:!0,persistent:!0}),this.pendingNote&&(this.pendingNote=null,this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),this.printer(F.dim("\u25C6 Note discarded \u2014 loop is stopping."),{toast:!0}));r.hasQueuedMessages();){let a=r.dequeueTypeAhead()?.trim()??"",l=a.startsWith("/")&&!a.includes(`
4070
- `)&&!LE(a)?.noteText;a&&!l&&(qe().clearFirstPersistent(),this.printer(F.dim("\u25C6 Note discarded \u2014 loop is stopping."),{toast:!0}))}return}else if(s==="/resume")this.getPhase()==="paused"?this.resumeFromPause("manual"):this.getPhase()==="stopping"?this.printer(F.dim("\u25C6 Loop is stopping \u2014 cannot resume"),{toast:!0}):this.printer(F.dim("\u25C6 Loop is not paused"),{toast:!0});else if(s.startsWith("/pause")){if(this.getPhase()==="stopping")this.printer(F.dim("\u25C6 Loop is stopping \u2014 cannot pause"),{toast:!0});else if(this.getPhase()==="paused"){let i=s.slice(6).trim();if(i){let a=h5(i);a===0?this.printer(F.dim(`\u25C6 Invalid duration: ${i} (use e.g. 30s, 5m, 2h)`),{toast:!0}):(this.updatePause(a),this.pauseToastId!==null&&qe().clearToast(this.pauseToastId),this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Pause updated"),{toast:!0,persistent:!0,expiresAt:this.state.pauseUntil}))}else this.updatePause(),this.pauseToastId!==null&&qe().clearToast(this.pauseToastId),this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Pause updated \u2014 indefinite, type /resume to continue, Esc to abort"),{toast:!0,persistent:!0})}else if(this.getPhase()==="running"){let i=s.slice(6).trim();if(i){let a=h5(i);a===0?this.printer(F.dim(`\u25C6 Invalid duration: ${i} (use e.g. 30s, 5m, 2h)`),{toast:!0}):(this.enterPause(a),this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop pausing \u2014 will pause after current tool completes"),{toast:!0,persistent:!0}))}else this.enterPause(),this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop pausing \u2014 will pause after current tool completes"),{toast:!0,persistent:!0})}}else if(s==="/stats"||s==="/status")Zme(this.state,this.state.totalToolCalls,this.consecutiveFailedIterations,this.printer);else if(o){let i=o.noteText;if(!i)this.printer(F.dim(`\u25C6 ${o.prefix} requires a message (usage: ${o.prefix} <text>)`),{toast:!0});else{this.noteToastId!==null&&qe().clearToast(this.noteToastId),this.pendingNote=i;let l=[...qe().toasts].reverse().find(c=>c.persistent);this.noteToastId=l?.id??null}}else if(s.startsWith("/")&&!s.includes(`
4069
+ `)}checkLimits(){return this.config.durationSeconds>0&&(Date.now()-this.state.startTime)/1e3>=this.config.durationSeconds?"duration_exceeded":$l(this.state.totalCost,this.config.budgetUsd)?"budget_exceeded":this.config.inputTokensLimit>0&&this.state.totalInputTokens>=this.config.inputTokensLimit?"input_tokens_exceeded":this.config.outputTokensLimit>0&&this.state.totalOutputTokens>=this.config.outputTokensLimit?"output_tokens_exceeded":null}clearSessionMessages(){this.session.messages=[]}async processQueuedMessages(){if(!this.processingQueue){this.processingQueue=!0;try{let{useInputStore:e}=await Promise.resolve().then(()=>(Vu(),vE)),r=e.getState();if(!r.hasQueuedMessages())return;for(;r.hasQueuedMessages();){let n=r.dequeueTypeAhead();if(!n?.trim())continue;let s=n.trim(),o=LE(s);if(s==="/stop"){for(this.getPhase()==="paused"&&(this.finalizePause(),this.transition("running"),et().setLoopPaused(!1,null),this.resolvePausePromise()),this.transition("stopping"),this.stoppingToastId=qe().nextId,this.printer(F.success("\u25C6 Stopping after current turn completes..."),{toast:!0,persistent:!0}),this.pendingNote&&(this.pendingNote=null,this.noteToastId!==null&&(qe().clearToast(this.noteToastId),this.noteToastId=null),this.printer(F.dim("\u25C6 Note discarded \u2014 loop is stopping."),{toast:!0}));r.hasQueuedMessages();){let a=r.dequeueTypeAhead()?.trim()??"",l=a.startsWith("/")&&!a.includes(`
4070
+ `)&&!LE(a)?.noteText;a&&!l&&(qe().clearFirstPersistent(),this.printer(F.dim("\u25C6 Note discarded \u2014 loop is stopping."),{toast:!0}))}return}else if(s==="/resume")this.getPhase()==="paused"?this.resumeFromPause("manual"):this.getPhase()==="stopping"?this.printer(F.dim("\u25C6 Loop is stopping \u2014 cannot resume"),{toast:!0}):this.printer(F.dim("\u25C6 Loop is not paused"),{toast:!0});else if(s.startsWith("/pause")){if(this.getPhase()==="stopping")this.printer(F.dim("\u25C6 Loop is stopping \u2014 cannot pause"),{toast:!0});else if(this.getPhase()==="paused"){let i=s.slice(6).trim();if(i){let a=h5(i);a===0?this.printer(F.dim(`\u25C6 Invalid duration: ${i} (use e.g. 30s, 5m, 2h)`),{toast:!0}):(this.updatePause(a),this.pauseToastId!==null&&qe().clearToast(this.pauseToastId),this.pauseToastId=qe().nextId,this.state.pauseUntil?this.printer(F.success("\u25C6 Pause updated"),{toast:!0,persistent:!0,expiresAt:this.state.pauseUntil}):this.printer(F.success(`\u25C6 Pause updated \u2014 ${i} once it engages`),{toast:!0,persistent:!0}))}else this.updatePause(),this.pauseToastId!==null&&qe().clearToast(this.pauseToastId),this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Pause updated \u2014 indefinite, type /resume to continue, Esc to abort"),{toast:!0,persistent:!0})}else if(this.getPhase()==="running"){let i=s.slice(6).trim();if(i){let a=h5(i);a===0?this.printer(F.dim(`\u25C6 Invalid duration: ${i} (use e.g. 30s, 5m, 2h)`),{toast:!0}):(this.enterPause(a),this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop pausing \u2014 will pause after current tool completes"),{toast:!0,persistent:!0}))}else this.enterPause(),this.pauseToastId=qe().nextId,this.printer(F.success("\u25C6 Loop pausing \u2014 will pause after current tool completes"),{toast:!0,persistent:!0})}}else if(s==="/stats"||s==="/status")Zme(this.state,this.state.totalToolCalls,this.consecutiveFailedIterations,this.printer);else if(o){let i=o.noteText;if(!i)this.printer(F.dim(`\u25C6 ${o.prefix} requires a message (usage: ${o.prefix} <text>)`),{toast:!0});else{this.noteToastId!==null&&qe().clearToast(this.noteToastId),this.pendingNote=i;let l=[...qe().toasts].reverse().find(c=>c.persistent);this.noteToastId=l?.id??null}}else if(s.startsWith("/")&&!s.includes(`
4071
4071
  `)){let i=s.split(/\s+/)[0],a=Array.from(i).slice(0,24).join("").replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,"");i==="/loop"?this.printer(F.dim("\u25C6 A loop is already running \u2014 /stop it first to start a new one."),{toast:!0}):this.printer(F.dim(`\u25C6 "${a}" isn't a loop command \u2014 /note /inject /pause /resume /stop /stats only; /stop to run other commands.`),{toast:!0})}else s&&this.state.userNotes.push(s)}}finally{this.processingQueue=!1}}}getLastAssistantText(){let e=this.session.messages.filter(n=>n.role==="assistant");if(e.length===0)return"";let r=e[e.length-1];return typeof r.content=="string"?r.content:""}async runWithRetry(e){let n=0;for(;;){n++;try{await this.agentController.run(e,this.session);return}catch(s){if(this.getPhase()==="aborted"||this.getPhase()==="stopping")throw s;if(this.agentController.isPauseRequested()){at("[loop] Context compaction interrupted iteration \u2014 restarting"),this.printer(m.dim(" Context compacted \u2014 restarting iteration...")),this.agentController.resetInterrupt(),this.agentController.markSkipInitialDraw(),this.agentController.markTurnContinuation(),this.clearSessionMessages();continue}if(lfe(s)){at("[loop] Context overflow detected \u2014 clearing context and retrying"),this.printer(m.yellow(" \u26A0 Context window full \u2014 restarting iteration with fresh context")),this.agentController.resetInterrupt(),this.agentController.markSkipInitialDraw(),this.agentController.markTurnContinuation(),this.clearSessionMessages();continue}if(!afe(s)||this.checkLimits())throw s;if(n>=10)throw this.printer(m.yellow(" \u26A0 Max retries (10) exceeded for this iteration")),s;let o=Math.min(2e3*Math.pow(2,n-1),3e4);if(this.printer(m.yellow(` \u26A0 Connection lost: ${vh(s)}`)),this.printer(m.dim(` Retrying in ${o/1e3}s (attempt ${n}/10)...`)),at(`[loop] Before backoff sleep: state.phase=${this.getPhase()}`),await this.pollableSleep(o),at(`[loop] After backoff sleep: state.phase=${this.getPhase()}`),this.getPhase()==="paused"&&(await this.blockWhilePaused(),n=0),this.getPhase()==="aborted"||this.getPhase()==="stopping")throw s;this.agentController.resetInterrupt(),this.agentController.markSkipInitialDraw(),this.agentController.markTurnContinuation(),this.clearSessionMessages()}}}checkCompletion(e,r){let n=!!this.config.completionPromise,s=!!this.config.verifyCommand;return n&&s?e&&r?"both_passed":null:n&&e?"completion_promise":s&&r?"verification_passed":null}};gS();Sh();function dfe(t){t.register({name:"loop",description:"Start autonomous agent loop (all options optional)",usage:'/loop ["<prompt>"] [--max <N>] [--promise "<string>"] [--verify "<cmd>"] [--budget <$N>] [--duration <N>[s|m|h]]',handler:async(e,r)=>{if(e.trim()==="help"||e.trim()==="--help"||e.trim()==="-h")return{continue:!0,handled:!0,output:[H().accent.bold("Ralph Wiggum Loop - Autonomous Agent Loop"),"",m.yellow("Usage:"),' /loop ["<prompt>"] [options]',"",m.yellow("Options:")," --max <N> Maximum iterations (default: unlimited, hard cap: 1000)",' --promise "<string>" Completion string to detect in agent output',' --verify "<command>" Shell command that must exit 0 for completion'," --budget <$N> Cost budget in USD (estimated)"," --input-tokens-limit <N> Input token limit (exact)"," --output-tokens-limit <N> Output token limit (exact)"," --duration <N>[s|m|h] Maximum duration (seconds/minutes/hours)"," --time <N>[s|m|h] Alias for --duration","",m.yellow("Modes:")," \u2022 With --verify/--promise: Task completion mode (loop until criteria met)"," \u2022 Without: AGENTS.md-driven continuous activity (loop until Ctrl+C)","",m.yellow("Subcommands:")," /loop list Show saved loops in this project with status"," /loop resume <id> Resume a stopped/interrupted loop by its #id"," (add --max/--budget/--duration/... to raise a limit;"," --force to override a live-process lock)","",m.yellow("Examples:")," /loop # Continuous AGENTS.md-driven activity",' /loop "fix the tests" --verify "npm test" # Loop until tests pass'," /loop --budget $5 --max 20 # Limited by cost and iterations"," /loop --duration 5m # Run for 5 minutes"," /loop list # List saved loops (canceled, stopped, completed\u2026)"," /loop resume k3x9 --budget 10 # Resume a saved loop, raising its budget","",m.yellow("Using with Skills:")," To use loop with a skill: invoke the skill first, then start /loop without prompt",m.dim(" (The loop prompt is for task descriptions, not skill invocations)"),"",m.yellow("Limits:")," \u2022 Press Ctrl+C to abort at any time"," \u2022 Sunset warnings at 90% of any capacity limit"," \u2022 All permissions auto-approved during loop"].join(`
4072
4072
  `)};if(!t.agentController)return{continue:!0,handled:!0,output:m.red("Loop unavailable: agent controller not initialized")};let n,s,o;{let{routeLoopArgs:d,resolveResumeTarget:p,formatLoopList:h}=await Promise.resolve().then(()=>(P5(),M5)),{resolveLoopsDir:f,listLoops:g,claimLoop:_}=await Promise.resolve().then(()=>(wh(),Gk)),E=e.trim().split(/\s+/).filter(Boolean),y=d(E);if(y?.sub==="list"){let S=h(g(f(r.projectPath)));return{continue:!0,handled:!0,output:["",m.yellow(" Saved loops:"),...S,""].join(`
4073
4073
  `)}}if(y?.sub==="resume"){let S=f(r.projectPath),T=p(y.rest,S,r.projectPath);if(T.kind==="usage"){let C=h(g(S),!0);return{continue:!0,handled:!0,output:["",m.yellow(" Resumable loops:"),...C,"",m.dim(" Usage: /loop resume <id> [--max N] [--budget N] [--duration Nm] [--force]"),""].join(`
@@ -4396,10 +4396,10 @@ ${r.yellow("CONFIG FILE:")}
4396
4396
  .aii/settings.json Project config (committed, restrict-only)
4397
4397
  .aii/settings.local.json Your local overrides (gitignored)
4398
4398
  ${r.gray("Skip both for a session with: aii --no-project-config")}
4399
- `)}import*as Ji from"fs";hr();async function Fhe(t,e){let r=ds({colors:!t.flags.noColors,emojis:!t.flags.noEmojis}),n=[],s=`${e.getConfigDir()}/config.yaml`;e.configExists()?n.push({name:"Config",status:"ok",message:s.replace(process.env.HOME||"","~")}):n.push({name:"Config",status:"warn",message:"Not found (using defaults)"});let o=await e.load();e.getApiKey()?n.push({name:"API Key",status:"ok",message:`${o.llm.provider}:${o.llm.model.replace(`${o.llm.provider}/`,"")}`}):n.push({name:"API Key",status:"error",message:`Not configured for ${o.llm.provider}`});let a=await uQe(o.api.url);n.push({name:"Aii Server",status:a.ok?"ok":"error",message:a.message});let l=`${e.getConfigDir()}/mcp_servers.json`;if(Ji.existsSync(l))try{let h=Ji.readFileSync(l,"utf-8"),f=JSON.parse(h),g=Object.keys(f.mcpServers??{}).length;g>0?n.push({name:"MCP Servers",status:"ok",message:`${g} configured`}):n.push({name:"MCP Servers",status:"warn",message:"Not configured"})}catch{n.push({name:"MCP Servers",status:"warn",message:"Invalid config"})}else n.push({name:"MCP Servers",status:"warn",message:"Not configured"});if(wk())try{let{execSync:h}=await import("child_process"),g=h("docker --version",{timeout:5e3,encoding:"utf-8"}).trim().match(/Docker version ([\d.]+)/);n.push({name:"Docker",status:"ok",message:g?`v${g[1]}`:"Installed"})}catch{n.push({name:"Docker",status:"ok",message:"Installed"})}else n.push({name:"Docker",status:"error",message:"Not installed (brew install --cask docker)"});wk()?Ck()?n.push({name:"Docker Daemon",status:"ok",message:"Running"}):n.push({name:"Docker Daemon",status:"error",message:"Not running (open -a Docker)"}):n.push({name:"Docker Daemon",status:"warn",message:"N/A (Docker not installed)"});let c=process.version;parseInt(c.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js",status:"ok",message:c}):n.push({name:"Node.js",status:"error",message:`${c} (requires >= 18)`});let d=await dQe();n.push(...d),console.log(r.formatHealthCheck(n,gu)),n.some(h=>h.status==="error")&&process.exit(1)}async function uQe(t){try{let e=new AbortController,r=setTimeout(()=>e.abort(),3e3),n=await fetch(`${t}/api/status`,{signal:e.signal});if(clearTimeout(r),n.ok){let s=new URL(t);return{ok:!0,message:`${s.hostname}:${s.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(e){return e instanceof Error&&e.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}async function dQe(){let t=[];try{let{getAiiHome:e}=await Promise.resolve().then(()=>(bs(),pT)),r=`${e()}/skills`;if(!Ji.existsSync(r))return t;let n=Ji.readdirSync(r,{withFileTypes:!0});for(let s of n){if(!s.isDirectory()||s.name.startsWith("."))continue;let o=`${r}/${s.name}/SKILL.md`;Ji.existsSync(o)||t.push({name:"Skill Shadow",status:"warn",message:`~/.aii/skills/${s.name}/ has no SKILL.md \u2014 may shadow other skills`})}try{let{PersonaManager:s}=await Promise.resolve().then(()=>(At(),Ot));if(s.hasInstance()&&s.getInstance().isActive()){let o=s.getInstance().getActive();if(o)for(let i of o.skillPaths){let a=i.split("/").pop()||"",l=`${r}/${a}`;Ji.existsSync(l)&&Ji.existsSync(`${l}/SKILL.md`)&&t.push({name:"Skill Shadow",status:"ok",message:`"${a}" user-authored shadows persona-bundled (intentional?)`})}}}catch{}}catch{}return t}ye();hr();import{execSync as nU}from"node:child_process";var gA="@aiiware/aii";async function $he(t){let e=t.args||[],r=t.subcommand||e[0]||"";if(t.flags.help||r==="help"||r==="--help"||e.includes("--help")){let n="0.22.2";console.log(""),console.log(F.logo(" Install")),console.log(""),console.log(` Current version: ${F.model(n)}`),console.log(""),console.log(m.yellow(" USAGE:")),console.log(` ${m.green("aii install")} Update to latest version`),console.log(` ${m.green("aii install <version>")} Install specific version`),console.log(` ${m.green("aii install skill <src>")} Install a skill package ${m.dim("(coming soon)")}`),console.log(` ${m.green("aii install mcp <name>")} Install an MCP server ${m.dim("(coming soon)")}`),console.log(""),console.log(m.yellow(" EXAMPLES:")),console.log(` ${m.green("aii install")} ${m.dim("# Self-update to latest")}`),console.log(` ${m.green("aii install 0.13.10")} ${m.dim("# Pin to specific version")}`),console.log("");return}if(r==="skill"){console.log("Skill installation coming soon. For now use: /skills install owner/repo");return}if(r==="mcp"){console.log("MCP installation coming soon. For now use: aii mcp install <server>");return}console.log("\x1B[33m\u26A0 `aii install` for self-update is deprecated. Use `aii upgrade` instead.\x1B[0m"),console.log(`\x1B[33m This alias will be removed in v0.16.x.\x1B[0m
4400
- `),await pQe(r)}async function pQe(t){let e="0.22.2",r=t&&t!=="latest"?t:"";if(console.log(""),r){console.log(`\u{1FABC} Installing Aii CLI v${r}...`),console.log("");try{nU(`npm install -g ${gA}@${r}`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
4399
+ `)}import*as Ji from"fs";hr();async function Fhe(t,e){let r=ds({colors:!t.flags.noColors,emojis:!t.flags.noEmojis}),n=[],s=`${e.getConfigDir()}/config.yaml`;e.configExists()?n.push({name:"Config",status:"ok",message:s.replace(process.env.HOME||"","~")}):n.push({name:"Config",status:"warn",message:"Not found (using defaults)"});let o=await e.load();e.getApiKey()?n.push({name:"API Key",status:"ok",message:`${o.llm.provider}:${o.llm.model.replace(`${o.llm.provider}/`,"")}`}):n.push({name:"API Key",status:"error",message:`Not configured for ${o.llm.provider}`});let a=await uQe(o.api.url);n.push({name:"Aii Server",status:a.ok?"ok":"error",message:a.message});let l=`${e.getConfigDir()}/mcp_servers.json`;if(Ji.existsSync(l))try{let h=Ji.readFileSync(l,"utf-8"),f=JSON.parse(h),g=Object.keys(f.mcpServers??{}).length;g>0?n.push({name:"MCP Servers",status:"ok",message:`${g} configured`}):n.push({name:"MCP Servers",status:"warn",message:"Not configured"})}catch{n.push({name:"MCP Servers",status:"warn",message:"Invalid config"})}else n.push({name:"MCP Servers",status:"warn",message:"Not configured"});if(wk())try{let{execSync:h}=await import("child_process"),g=h("docker --version",{timeout:5e3,encoding:"utf-8"}).trim().match(/Docker version ([\d.]+)/);n.push({name:"Docker",status:"ok",message:g?`v${g[1]}`:"Installed"})}catch{n.push({name:"Docker",status:"ok",message:"Installed"})}else n.push({name:"Docker",status:"error",message:"Not installed (brew install --cask docker)"});wk()?Ck()?n.push({name:"Docker Daemon",status:"ok",message:"Running"}):n.push({name:"Docker Daemon",status:"error",message:"Not running (open -a Docker)"}):n.push({name:"Docker Daemon",status:"warn",message:"N/A (Docker not installed)"});let c=process.version;parseInt(c.slice(1).split(".")[0],10)>=18?n.push({name:"Node.js",status:"ok",message:c}):n.push({name:"Node.js",status:"error",message:`${c} (requires >= 18)`});let d=await dQe();n.push(...d),console.log(r.formatHealthCheck(n,gu)),n.some(h=>h.status==="error")&&process.exit(1)}async function uQe(t){try{let e=new AbortController,r=setTimeout(()=>e.abort(),3e3),n=await fetch(`${t}/api/status`,{signal:e.signal});if(clearTimeout(r),n.ok){let s=new URL(t);return{ok:!0,message:`${s.hostname}:${s.port||26169}`}}else return{ok:!1,message:`Not responding (${n.status})`}}catch(e){return e instanceof Error&&e.name==="AbortError"?{ok:!1,message:"Connection timeout"}:{ok:!1,message:"Not running"}}}async function dQe(){let t=[];try{let{getAiiHome:e}=await Promise.resolve().then(()=>(bs(),pT)),r=`${e()}/skills`;if(!Ji.existsSync(r))return t;let n=Ji.readdirSync(r,{withFileTypes:!0});for(let s of n){if(!s.isDirectory()||s.name.startsWith("."))continue;let o=`${r}/${s.name}/SKILL.md`;Ji.existsSync(o)||t.push({name:"Skill Shadow",status:"warn",message:`~/.aii/skills/${s.name}/ has no SKILL.md \u2014 may shadow other skills`})}try{let{PersonaManager:s}=await Promise.resolve().then(()=>(At(),Ot));if(s.hasInstance()&&s.getInstance().isActive()){let o=s.getInstance().getActive();if(o)for(let i of o.skillPaths){let a=i.split("/").pop()||"",l=`${r}/${a}`;Ji.existsSync(l)&&Ji.existsSync(`${l}/SKILL.md`)&&t.push({name:"Skill Shadow",status:"ok",message:`"${a}" user-authored shadows persona-bundled (intentional?)`})}}}catch{}}catch{}return t}ye();hr();import{execSync as nU}from"node:child_process";var gA="@aiiware/aii";async function $he(t){let e=t.args||[],r=t.subcommand||e[0]||"";if(t.flags.help||r==="help"||r==="--help"||e.includes("--help")){let n="0.22.3";console.log(""),console.log(F.logo(" Install")),console.log(""),console.log(` Current version: ${F.model(n)}`),console.log(""),console.log(m.yellow(" USAGE:")),console.log(` ${m.green("aii install")} Update to latest version`),console.log(` ${m.green("aii install <version>")} Install specific version`),console.log(` ${m.green("aii install skill <src>")} Install a skill package ${m.dim("(coming soon)")}`),console.log(` ${m.green("aii install mcp <name>")} Install an MCP server ${m.dim("(coming soon)")}`),console.log(""),console.log(m.yellow(" EXAMPLES:")),console.log(` ${m.green("aii install")} ${m.dim("# Self-update to latest")}`),console.log(` ${m.green("aii install 0.13.10")} ${m.dim("# Pin to specific version")}`),console.log("");return}if(r==="skill"){console.log("Skill installation coming soon. For now use: /skills install owner/repo");return}if(r==="mcp"){console.log("MCP installation coming soon. For now use: aii mcp install <server>");return}console.log("\x1B[33m\u26A0 `aii install` for self-update is deprecated. Use `aii upgrade` instead.\x1B[0m"),console.log(`\x1B[33m This alias will be removed in v0.16.x.\x1B[0m
4400
+ `),await pQe(r)}async function pQe(t){let e="0.22.3",r=t&&t!=="latest"?t:"";if(console.log(""),r){console.log(`\u{1FABC} Installing Aii CLI v${r}...`),console.log("");try{nU(`npm install -g ${gA}@${r}`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
4401
4401
  \u274C Failed to install v${r}`),console.error(` Try manually: npm install -g ${gA}@${r}`),process.exit(1)}}else{console.log("\u{1FABC} Updating Aii CLI to latest..."),console.log(` Current version: ${e}`),console.log("");try{nU(`npm install -g ${gA}@latest`,{stdio:"inherit",timeout:12e4})}catch{console.error(`
4402
- \u274C Failed to update Aii CLI`),console.error(` Try manually: npm install -g ${gA}@latest`),process.exit(1)}}try{let n=nU("aii --version 2>/dev/null",{encoding:"utf-8",timeout:1e4,stdio:"pipe"}).trim();console.log(""),console.log(n===e?`\u2713 Aii CLI is already up to date (${e})`:`\u2713 Aii CLI updated: ${e} \u2192 ${n}`)}catch{console.log(""),console.log("\u2713 Aii CLI installed. Restart your terminal to use the new version.")}}ye();var Uhe="0.22.2";function sU(t){let r=!t.flags.noColors?m:{cyan:n=>n,yellow:n=>n,gray:n=>n,green:n=>n};console.log(`
4402
+ \u274C Failed to update Aii CLI`),console.error(` Try manually: npm install -g ${gA}@latest`),process.exit(1)}}try{let n=nU("aii --version 2>/dev/null",{encoding:"utf-8",timeout:1e4,stdio:"pipe"}).trim();console.log(""),console.log(n===e?`\u2713 Aii CLI is already up to date (${e})`:`\u2713 Aii CLI updated: ${e} \u2192 ${n}`)}catch{console.log(""),console.log("\u2713 Aii CLI installed. Restart your terminal to use the new version.")}}ye();var Uhe="0.22.3";function sU(t){let r=!t.flags.noColors?m:{cyan:n=>n,yellow:n=>n,gray:n=>n,green:n=>n};console.log(`
4403
4403
  ${r.cyan("AII")} - AI-powered CLI assistant v${Uhe}
4404
4404
 
4405
4405
  ${r.yellow("USAGE:")}