oh-my-agent 8.10.1 → 8.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +17 -3
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -1748,7 +1748,7 @@ spawn_error:${Y.message}`})})})}async function vX2($,z,G={}){let J=G.host??"gith
|
|
|
1748
1748
|
spawn_error:${Z.message}`})})})}async function RX2($,z,G={}){let J=performance.now(),U=["--dump-json","--no-warnings","--skip-download"];if(G.format)U.push("-f",G.format);if(G.subtitles){if(U.push("--write-sub","--write-auto-sub","--sub-format","vtt"),G.subLangs?.length)U.push("--sub-lang",G.subLangs.join(","))}U.push($.toString());let{code:K,stdout:Q,stderr:Z}=await cA5(U,z),Y=Math.round(performance.now()-J);if(K===null||K!==0){let W=Z.trim();if(/executable not found|ENOENT/i.test(W))return{url:$.toString(),status:"error",strategy:"api",platform:"media",content:"",elapsedMs:Y,signals:[],error:"yt-dlp not installed. Install via `pip install yt-dlp` or `brew install yt-dlp`."};return{url:$.toString(),status:"error",strategy:"api",platform:"media",content:Q,elapsedMs:Y,signals:[],error:W||`yt-dlp exited with code ${K}`}}return{url:$.toString(),status:"ok",strategy:"api",platform:"media",content:Q.trim(),contentType:"application/json",elapsedMs:Y,signals:[]}}A0();var AI=/<meta\s+([^>]+)>/gi,MI=/(\w[\w-]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g,Sl=/<script[^>]+type=["']application\/ld\+json["'][^>]*>([\s\S]*?)<\/script>/gi,lA5=/<title[^>]*>([\s\S]*?)<\/title>/i,_l=/<link\s+([^>]+)>/gi;function wX2($){let z={};MI.lastIndex=0;let G=MI.exec($);while(G!==null){let J=G[1]?.toLowerCase();if(!J){G=MI.exec($);continue}z[J]=G[2]??G[3]??G[4]??"",G=MI.exec($)}return z}function DI($){let z={},G=[],J=[],U;AI.lastIndex=0;let K=AI.exec($);while(K!==null){let B=K[1];if(!B){K=AI.exec($);continue}let k=wX2(B),L=k.property??"",X=k.name??"",H=k.content??"";if(L.startsWith("og:"))z[L.slice(3)]=H;if(X==="description"&&!U)U=H;if(X==="twitter:description"&&!U)U=H;K=AI.exec($)}_l.lastIndex=0;let Q=_l.exec($);while(Q!==null){let B=Q[1];if(B){let k=wX2(B);if(k.rel==="alternate"&&k.type&&(k.type.includes("rss")||k.type.includes("atom")))G.push({type:k.type,href:k.href??"",title:k.title})}Q=_l.exec($)}Sl.lastIndex=0;let Z=Sl.exec($);while(Z!==null){let B=Z[1];if(B)try{J.push(JSON.parse(B))}catch{}Z=Sl.exec($)}let W=lA5.exec($)?.[1]?.trim(),V={};if(Object.keys(z).length>0)V.ogp=z;if(J.length>0)V.jsonLd=J;if(U)V.description=U;if(W)V.title=W;if(G.length>0)V.alternate=G;return V}async function uX2($,z){try{let G=await F3($.toString(),{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal}),J=DI(G.text);return{url:$.toString(),status:G.ok?"ok":"error",strategy:"probe",platform:"metadata",httpStatus:G.status,content:G.text,contentType:G.headers.get("content-type")??void 0,elapsedMs:G.elapsedMs,signals:[],metadata:J}}catch(G){return{url:$.toString(),status:"error",strategy:"probe",platform:"metadata",content:"",elapsedMs:0,signals:[],error:G instanceof Error?G.message:String(G)}}}IG();AX();A0();IG();t3();var nA5=["archive.ph","archive.is","archive.md","archive.vn","archive.li"];function dA5($){return`https://${$.hostname.replace(/\./g,"-")}.cdn.ampproject.org/c/s/${$.hostname}${$.pathname}${$.search}`}async function pA5($,z){try{let G=dA5($),J=await F3(G,{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(!J.ok||J.text.length<200)return null;let U=p7(J);return{url:$.toString(),status:R9(J,U),strategy:"archive",provenance:"amp",platform:"amp",httpStatus:J.status,content:J.text,contentType:J.headers.get("content-type")??void 0,elapsedMs:J.elapsedMs,signals:U}}catch{return null}}async function aA5($,z){for(let G of nA5){if(z.signal?.aborted)break;try{let J=`https://${G}/newest/${$.toString()}`,U=await F3(J,{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(!U.ok||U.text.length<200)continue;let K=p7(U);return{url:$.toString(),status:R9(U,K),strategy:"archive",provenance:"archive-today",platform:G,httpStatus:U.status,content:U.text,contentType:U.headers.get("content-type")??void 0,elapsedMs:U.elapsedMs,signals:K}}catch{}}return null}async function oA5($,z){try{let G=await F3(`https://archive.org/wayback/available?url=${encodeURIComponent($.toString())}`,{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(!G.ok)return null;let U=JSON.parse(G.text).archived_snapshots?.closest;if(!U?.available||!U.url)return null;let K=await F3(U.url,{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(!K.ok||K.text.length<200)return null;let Q=p7(K);return{url:$.toString(),status:R9(K,Q),strategy:"archive",provenance:"wayback",platform:"wayback",httpStatus:K.status,content:K.text,contentType:K.headers.get("content-type")??void 0,elapsedMs:K.elapsedMs,signals:Q}}catch{return null}}async function pX($,z){let G=[()=>pA5($,z),()=>aA5($,z),()=>oA5($,z)],J=performance.now();for(let U of G){if(z.signal?.aborted)break;let K=await U();if(K)return K}return{...P1({url:$.toString(),strategy:"archive",error:Error("all archive sources exhausted")}),elapsedMs:Math.round(performance.now()-J)}}Lz();Vi();A0();IG();t3();var fS2="https://r.jina.ai/";function Ma5($){let z=`${$.protocol}//${$.hostname}`,G=$.hostname.startsWith("m.")?$.hostname:`m.${$.hostname.replace(/^www\./,"")}`,J=new URL($.toString());return J.hostname=G,[{label:"jina",url:`${fS2}${$.toString()}`,headers:rU({accept:"text/plain"})},{label:"jina-json",url:`${fS2}${$.toString()}`,headers:rU({accept:"application/json"})},{label:"curl-desktop",url:$.toString(),headers:rU({userAgent:N0.desktopFirefox,referer:z})},{label:"curl-mobile",url:J.toString(),headers:rU({userAgent:N0.mobileSafari,referer:z})},{label:"curl-googlebot",url:$.toString(),headers:rU({userAgent:N0.googlebot})}]}function Da5($,z){if(!$.startsWith("jina"))return z;return z}async function mS2($,z){let G=Ma5($),J=new AbortController;if(z.signal)if(z.signal.aborted)J.abort(z.signal.reason);else z.signal.addEventListener("abort",()=>J.abort(z.signal?.reason));let U=performance.now(),K={},Q=null,Z=G.map(async(Y)=>{let W=await F3(Y.url,{headers:Y.headers,timeoutMs:z.timeoutMs,signal:J.signal,locale:z.locale}),V=p7(W);if(Y.label.startsWith("jina")){let B=yW2(W);if(B)throw Q=B,Error(`jina-quota:${B.detail}`)}if(!Oa5(W,V))throw K[Y.label]=`status=${W.status} size=${W.text.length}`,Error(`weak-response:${Y.label}`);return{label:Y.label,resp:W,signals:V}});try{let Y=await Promise.any(Z);J.abort();let W=Math.round(performance.now()-U);return{url:$.toString(),status:R9(Y.resp,Y.signals),strategy:"probe",platform:Y.label,httpStatus:Y.resp.status,content:Da5(Y.label,Y.resp.text),contentType:Y.resp.headers.get("content-type")??void 0,elapsedMs:W,signals:Q?[...Y.signals,Q]:Y.signals}}catch(Y){let W=Math.round(performance.now()-U),V=Object.entries(K).map(([B,k])=>`${B}:${k}`).join(" ");if(Q)return{...P1({url:$.toString(),error:Error(`probe failed — ${V}`),strategy:"probe"}),elapsedMs:W,signals:[Q]};return{...P1({url:$.toString(),error:Y instanceof AggregateError?Error(V):Y,strategy:"probe"}),elapsedMs:W}}}function Oa5($,z){if(!$.ok)return!1;if($.text.length<200)return!1;if(z.some((G)=>G.kind==="waf-body"||G.kind==="challenge-body"||G.kind==="js-essential"||G.kind==="http-status"))return!1;return!0}var Ia5=["api","probe","impersonate","browser","archive"];function va5($){if($.only?.length)return $.only;let z=Ia5.slice();if(!$.includeArchive)z=z.filter((G)=>G!=="archive");if($.skip?.length)z=z.filter((G)=>!$.skip?.includes(G));return z}async function iS2($,z,G){switch($){case"api":return await VO(z,G)??null;case"probe":return mS2(z,G);case"impersonate":return YO(z,G);case"browser":return ts(z,G);case"archive":return pX(z,G)}}function es($){if($.status==="ok")return!0;if($.status==="auth-required"&&xW2($.signals))return!0;return!1}function Ra5($){return $.status==="auth-required"||$.status==="invalid-input"||$.status==="not-found"}async function wa5($){let z=Math.floor(Math.random()*500);await new Promise((G)=>setTimeout(G,$+z))}function ua5($){let z=$.find((U)=>U.kind==="rate-limit");if(!z)return 1500;let G=z.detail.match(/retry-after=(\d+)/);if(!G?.[1])return 1500;let J=Number.parseInt(G[1],10);if(Number.isNaN(J)||J>10)return 1500;return J*1000}async function cS2($,z,G={}){let J=va5(G),U=[],K=new Set,Q=null,Z=!1;for(let Y of J){if(z.signal?.aborted)break;if(Z&&Y==="impersonate")continue;let W=await iS2(Y,$,z);if(!W)continue;if(U.push({strategy:Y,platform:W.platform,status:W.status,httpStatus:W.httpStatus,elapsedMs:W.elapsedMs,signals:W.signals,error:W.error}),W.signals.some((V)=>V.kind==="js-essential"))Z=!0;if(es(W))return W.attempts=U,W;if(Ra5(W))return W.attempts=U,W;if(G.retryOnRateLimit!==!1&&hW2(W.signals)&&!K.has(Y)){K.add(Y),await wa5(ua5(W.signals));let V=await iS2(Y,$,z);if(V){if(U.push({strategy:Y,platform:V.platform,status:V.status,httpStatus:V.httpStatus,elapsedMs:V.elapsedMs,signals:V.signals,error:V.error}),es(V))return V.attempts=U,V;Q=V;continue}}Q=W}if(!J.includes("archive")&&G.includeArchive!==!1){let Y=await pX($,z);if(U.push({strategy:"archive",platform:Y.platform,status:Y.status,httpStatus:Y.httpStatus,elapsedMs:Y.elapsedMs,signals:Y.signals,error:Y.error}),es(Y))return Y.attempts=U,Y;Q=Y}if(Q)return Q.attempts=U,Q;return{url:$.toString(),status:"error",strategy:J[0]??"probe",content:"",elapsedMs:0,signals:[],attempts:U,error:"all strategies failed"}}var Ta5=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ea5="[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]["+Ta5+"]*",Pa5=new RegExp("^"+Ea5+"$");function ru($,z){let G=[],J=z.exec($);while(J){let U=[];U.startIndex=z.lastIndex-J[0].length;let K=J.length;for(let Q=0;Q<K;Q++)U.push(J[Q]);G.push(U),J=z.exec($)}return G}var $t=function($){let z=Pa5.exec($);return!(z===null||typeof z>"u")};function lS2($){return typeof $<"u"}var UF=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],su=["__proto__","constructor","prototype"];var Ca5={allowBooleanAttributes:!1,unpairedTags:[]};function oS2($,z){z=Object.assign({},Ca5,z);let G=[],J=!1,U=!1;if($[0]==="\uFEFF")$=$.substr(1);for(let K=0;K<$.length;K++)if($[K]==="<"&&$[K+1]==="?"){if(K+=2,K=dS2($,K),K.err)return K}else if($[K]==="<"){let Q=K;if(K++,$[K]==="!"){K=pS2($,K);continue}else{let Z=!1;if($[K]==="/")Z=!0,K++;let Y="";for(;K<$.length&&$[K]!==">"&&$[K]!==" "&&$[K]!=="\t"&&$[K]!==`
|
|
1749
1749
|
`&&$[K]!=="\r";K++)Y+=$[K];if(Y=Y.trim(),Y[Y.length-1]==="/")Y=Y.substring(0,Y.length-1),K--;if(!fa5(Y)){let B;if(Y.trim().length===0)B="Invalid space after '<'.";else B="Tag '"+Y+"' is an invalid name.";return $3("InvalidTag",B,U6($,K))}let W=Sa5($,K);if(W===!1)return $3("InvalidAttr","Attributes for '"+Y+"' have open quote.",U6($,K));let V=W.value;if(K=W.index,V[V.length-1]==="/"){let B=K-V.length;V=V.substring(0,V.length-1);let k=aS2(V,z);if(k===!0)J=!0;else return $3(k.err.code,k.err.msg,U6($,B+k.err.line))}else if(Z)if(!W.tagClosed)return $3("InvalidTag","Closing tag '"+Y+"' doesn't have proper closing.",U6($,K));else if(V.trim().length>0)return $3("InvalidTag","Closing tag '"+Y+"' can't have attributes or invalid starting.",U6($,Q));else if(G.length===0)return $3("InvalidTag","Closing tag '"+Y+"' has not been opened.",U6($,Q));else{let B=G.pop();if(Y!==B.tagName){let k=U6($,B.tagStartPos);return $3("InvalidTag","Expected closing tag '"+B.tagName+"' (opened in line "+k.line+", col "+k.col+") instead of closing tag '"+Y+"'.",U6($,Q))}if(G.length==0)U=!0}else{let B=aS2(V,z);if(B!==!0)return $3(B.err.code,B.err.msg,U6($,K-V.length+B.err.line));if(U===!0)return $3("InvalidXml","Multiple possible root nodes found.",U6($,K));else if(z.unpairedTags.indexOf(Y)!==-1);else G.push({tagName:Y,tagStartPos:Q});J=!0}for(K++;K<$.length;K++)if($[K]==="<")if($[K+1]==="!"){K++,K=pS2($,K);continue}else if($[K+1]==="?"){if(K=dS2($,++K),K.err)return K}else break;else if($[K]==="&"){let B=ha5($,K);if(B==-1)return $3("InvalidChar","char '&' is not expected.",U6($,K));K=B}else if(U===!0&&!nS2($[K]))return $3("InvalidXml","Extra text at the end",U6($,K));if($[K]==="<")K--}}else{if(nS2($[K]))continue;return $3("InvalidChar","char '"+$[K]+"' is not expected.",U6($,K))}if(!J)return $3("InvalidXml","Start tag expected.",1);else if(G.length==1)return $3("InvalidTag","Unclosed tag '"+G[0].tagName+"'.",U6($,G[0].tagStartPos));else if(G.length>0)return $3("InvalidXml","Invalid '"+JSON.stringify(G.map((K)=>K.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0}function nS2($){return $===" "||$==="\t"||$===`
|
|
1750
1750
|
`||$==="\r"}function dS2($,z){let G=z;for(;z<$.length;z++)if($[z]=="?"||$[z]==" "){let J=$.substr(G,z-G);if(z>5&&J==="xml")return $3("InvalidXml","XML declaration allowed only at the start of the document.",U6($,z));else if($[z]=="?"&&$[z+1]==">"){z++;break}else continue}return z}function pS2($,z){if($.length>z+5&&$[z+1]==="-"&&$[z+2]==="-"){for(z+=3;z<$.length;z++)if($[z]==="-"&&$[z+1]==="-"&&$[z+2]===">"){z+=2;break}}else if($.length>z+8&&$[z+1]==="D"&&$[z+2]==="O"&&$[z+3]==="C"&&$[z+4]==="T"&&$[z+5]==="Y"&&$[z+6]==="P"&&$[z+7]==="E"){let G=1;for(z+=8;z<$.length;z++)if($[z]==="<")G++;else if($[z]===">"){if(G--,G===0)break}}else if($.length>z+9&&$[z+1]==="["&&$[z+2]==="C"&&$[z+3]==="D"&&$[z+4]==="A"&&$[z+5]==="T"&&$[z+6]==="A"&&$[z+7]==="["){for(z+=8;z<$.length;z++)if($[z]==="]"&&$[z+1]==="]"&&$[z+2]===">"){z+=2;break}}return z}var ba5='"',ya5="'";function Sa5($,z){let G="",J="",U=!1;for(;z<$.length;z++){if($[z]===ba5||$[z]===ya5)if(J==="")J=$[z];else if(J!==$[z]);else J="";else if($[z]===">"){if(J===""){U=!0;break}}G+=$[z]}if(J!=="")return!1;return{value:G,index:z,tagClosed:U}}var _a5=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function aS2($,z){let G=ru($,_a5),J={};for(let U=0;U<G.length;U++){if(G[U][1].length===0)return $3("InvalidAttr","Attribute '"+G[U][2]+"' has no space in starting.",KF(G[U]));else if(G[U][3]!==void 0&&G[U][4]===void 0)return $3("InvalidAttr","Attribute '"+G[U][2]+"' is without value.",KF(G[U]));else if(G[U][3]===void 0&&!z.allowBooleanAttributes)return $3("InvalidAttr","boolean attribute '"+G[U][2]+"' is not allowed.",KF(G[U]));let K=G[U][2];if(!ga5(K))return $3("InvalidAttr","Attribute '"+K+"' is an invalid name.",KF(G[U]));if(!Object.prototype.hasOwnProperty.call(J,K))J[K]=1;else return $3("InvalidAttr","Attribute '"+K+"' is repeated.",KF(G[U]))}return!0}function xa5($,z){let G=/\d/;if($[z]==="x")z++,G=/[\da-fA-F]/;for(;z<$.length;z++){if($[z]===";")return z;if(!$[z].match(G))break}return-1}function ha5($,z){if(z++,$[z]===";")return-1;if($[z]==="#")return z++,xa5($,z);let G=0;for(;z<$.length;z++,G++){if($[z].match(/\w/)&&G<20)continue;if($[z]===";")break;return-1}return z}function $3($,z,G){return{err:{code:$,msg:z,line:G.line||G,col:G.col}}}function ga5($){return $t($)}function fa5($){return $t($)}function U6($,z){let G=$.substring(0,z).split(/\r?\n/);return{line:G.length,col:G[G.length-1].length+1}}function KF($){return $.startIndex+$[1].length}var rS2={amp:"&",AMP:"&",lt:"<",LT:"<",gt:">",GT:">",quot:'"',QUOT:'"',apos:"'",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",lsquor:"‚",rsquor:"’",ldquor:"„",bdquo:"„",comma:",",period:".",colon:":",semi:";",excl:"!",quest:"?",num:"#",dollar:"$",percent:"%",amp:"&",ast:"*",commat:"@",lowbar:"_",verbar:"|",vert:"|",sol:"/",bsol:"\\",lbrace:"{",rbrace:"}",lbrack:"[",rbrack:"]",lpar:"(",rpar:")",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",COPY:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",REG:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",half:"½",frac34:"¾",iquest:"¿",times:"×",div:"÷",divide:"÷"},sS2={Agrave:"À",agrave:"à",Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",Aring:"Å",aring:"å",AElig:"Æ",aelig:"æ",Ccedil:"Ç",ccedil:"ç",Egrave:"È",egrave:"è",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Euml:"Ë",euml:"ë",Igrave:"Ì",igrave:"ì",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",Iuml:"Ï",iuml:"ï",ETH:"Ð",eth:"ð",Ntilde:"Ñ",ntilde:"ñ",Ograve:"Ò",ograve:"ò",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",Oslash:"Ø",oslash:"ø",Ugrave:"Ù",ugrave:"ù",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",THORN:"Þ",thorn:"þ",szlig:"ß",yuml:"ÿ",Yuml:"Ÿ"},tS2={Amacr:"Ā",amacr:"ā",Abreve:"Ă",abreve:"ă",Aogon:"Ą",aogon:"ą",Cacute:"Ć",cacute:"ć",Ccirc:"Ĉ",ccirc:"ĉ",Cdot:"Ċ",cdot:"ċ",Ccaron:"Č",ccaron:"č",Dcaron:"Ď",dcaron:"ď",Dstrok:"Đ",dstrok:"đ",Emacr:"Ē",emacr:"ē",Ecaron:"Ě",ecaron:"ě",Edot:"Ė",edot:"ė",Eogon:"Ę",eogon:"ę",Gcirc:"Ĝ",gcirc:"ĝ",Gbreve:"Ğ",gbreve:"ğ",Gdot:"Ġ",gdot:"ġ",Gcedil:"Ģ",Hcirc:"Ĥ",hcirc:"ĥ",Hstrok:"Ħ",hstrok:"ħ",Itilde:"Ĩ",itilde:"ĩ",Imacr:"Ī",imacr:"ī",Iogon:"Į",iogon:"į",Idot:"İ",IJlig:"IJ",ijlig:"ij",Jcirc:"Ĵ",jcirc:"ĵ",Kcedil:"Ķ",kcedil:"ķ",kgreen:"ĸ",Lacute:"Ĺ",lacute:"ĺ",Lcedil:"Ļ",lcedil:"ļ",Lcaron:"Ľ",lcaron:"ľ",Lmidot:"Ŀ",lmidot:"ŀ",Lstrok:"Ł",lstrok:"ł",Nacute:"Ń",nacute:"ń",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ENG:"Ŋ",eng:"ŋ",Omacr:"Ō",omacr:"ō",Odblac:"Ő",odblac:"ő",OElig:"Œ",oelig:"œ",Racute:"Ŕ",racute:"ŕ",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",Sacute:"Ś",sacute:"ś",Scirc:"Ŝ",scirc:"ŝ",Scedil:"Ş",scedil:"ş",Scaron:"Š",scaron:"š",Tcedil:"Ţ",tcedil:"ţ",Tcaron:"Ť",tcaron:"ť",Tstrok:"Ŧ",tstrok:"ŧ",Utilde:"Ũ",utilde:"ũ",Umacr:"Ū",umacr:"ū",Ubreve:"Ŭ",ubreve:"ŭ",Uring:"Ů",uring:"ů",Udblac:"Ű",udblac:"ű",Uogon:"Ų",uogon:"ų",Wcirc:"Ŵ",wcirc:"ŵ",Ycirc:"Ŷ",ycirc:"ŷ",Zacute:"Ź",zacute:"ź",Zdot:"Ż",zdot:"ż",Zcaron:"Ž",zcaron:"ž"},eS2={Alpha:"Α",alpha:"α",Beta:"Β",beta:"β",Gamma:"Γ",gamma:"γ",Delta:"Δ",delta:"δ",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",varepsilon:"ϵ",Zeta:"Ζ",zeta:"ζ",Eta:"Η",eta:"η",Theta:"Θ",theta:"θ",thetasym:"ϑ",vartheta:"ϑ",Iota:"Ι",iota:"ι",Kappa:"Κ",kappa:"κ",kappav:"ϰ",varkappa:"ϰ",Lambda:"Λ",lambda:"λ",Mu:"Μ",mu:"μ",Nu:"Ν",nu:"ν",Xi:"Ξ",xi:"ξ",Omicron:"Ο",omicron:"ο",Pi:"Π",pi:"π",piv:"ϖ",varpi:"ϖ",Rho:"Ρ",rho:"ρ",rhov:"ϱ",varrho:"ϱ",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",varsigma:"ς",Tau:"Τ",tau:"τ",Upsilon:"Υ",upsilon:"υ",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Phi:"Φ",phi:"φ",phiv:"ϕ",varphi:"ϕ",Chi:"Χ",chi:"χ",Psi:"Ψ",psi:"ψ",Omega:"Ω",omega:"ω",ohm:"Ω",Gammad:"Ϝ",gammad:"ϝ",digamma:"ϝ"},$_2={Afr:"\uD835\uDD04",afr:"\uD835\uDD1E",Acy:"А",acy:"а",Bcy:"Б",bcy:"б",Vcy:"В",vcy:"в",Gcy:"Г",gcy:"г",Dcy:"Д",dcy:"д",IEcy:"Е",iecy:"е",IOcy:"Ё",iocy:"ё",ZHcy:"Ж",zhcy:"ж",Zcy:"З",zcy:"з",Icy:"И",icy:"и",Jcy:"Й",jcy:"й",Kcy:"К",kcy:"к",Lcy:"Л",lcy:"л",Mcy:"М",mcy:"м",Ncy:"Н",ncy:"н",Ocy:"О",ocy:"о",Pcy:"П",pcy:"п",Rcy:"Р",rcy:"р",Scy:"С",scy:"с",Tcy:"Т",tcy:"т",Ucy:"У",ucy:"у",Fcy:"Ф",fcy:"ф",KHcy:"Х",khcy:"х",TScy:"Ц",tscy:"ц",CHcy:"Ч",chcy:"ч",SHcy:"Ш",shcy:"ш",SHCHcy:"Щ",shchcy:"щ",HARDcy:"Ъ",hardcy:"ъ",Ycy:"Ы",ycy:"ы",SOFTcy:"Ь",softcy:"ь",Ecy:"Э",ecy:"э",YUcy:"Ю",yucy:"ю",YAcy:"Я",yacy:"я",DJcy:"Ђ",djcy:"ђ",GJcy:"Ѓ",gjcy:"ѓ",Jukcy:"Є",jukcy:"є",DScy:"Ѕ",dscy:"ѕ",Iukcy:"І",iukcy:"і",YIcy:"Ї",yicy:"ї",Jsercy:"Ј",jsercy:"ј",LJcy:"Љ",ljcy:"љ",NJcy:"Њ",njcy:"њ",TSHcy:"Ћ",tshcy:"ћ",KJcy:"Ќ",kjcy:"ќ",Ubrcy:"Ў",ubrcy:"ў",DZcy:"Џ",dzcy:"џ"},z_2={plus:"+",minus:"−",mnplus:"∓",mp:"∓",pm:"±",times:"×",div:"÷",divide:"÷",sdot:"⋅",star:"☆",starf:"★",bigstar:"★",lowast:"∗",ast:"*",midast:"*",compfn:"∘",smallcircle:"∘",bullet:"•",bull:"•",nbsp:" ",hellip:"…",mldr:"…",prime:"′",Prime:"″",tprime:"‴",bprime:"‵",backprime:"‵",minus:"−",minusd:"∸",dotminus:"∸",plusdo:"∔",dotplus:"∔",plusmn:"±",minusplus:"∓",mnplus:"∓",mp:"∓",setminus:"∖",smallsetminus:"∖",Backslash:"∖",setmn:"∖",ssetmn:"∖",lowbar:"_",verbar:"|",vert:"|",VerticalLine:"|",colon:":",Colon:"∷",Proportion:"∷",ratio:"∶",equals:"=",ne:"≠",nequiv:"≢",equiv:"≡",Congruent:"≡",sim:"∼",thicksim:"∼",thksim:"∼",sime:"≃",simeq:"≃",TildeEqual:"≃",asymp:"≈",approx:"≈",thickapprox:"≈",thkap:"≈",TildeTilde:"≈",ncong:"≇",cong:"≅",TildeFullEqual:"≅",asympeq:"≍",CupCap:"≍",bump:"≎",Bumpeq:"≎",HumpDownHump:"≎",bumpe:"≏",bumpeq:"≏",HumpEqual:"≏",dotminus:"∸",minusd:"∸",plusdo:"∔",dotplus:"∔",le:"≤",LessEqual:"≤",ge:"≥",GreaterEqual:"≥",lesseqgtr:"⋚",lesseqqgtr:"⪋",greater:">",less:"<"},G_2={alefsym:"ℵ",aleph:"ℵ",beth:"ℶ",gimel:"ℷ",daleth:"ℸ",forall:"∀",ForAll:"∀",part:"∂",PartialD:"∂",exist:"∃",Exists:"∃",nexist:"∄",nexists:"∄",empty:"∅",emptyset:"∅",emptyv:"∅",varnothing:"∅",nabla:"∇",Del:"∇",isin:"∈",isinv:"∈",in:"∈",Element:"∈",notin:"∉",notinva:"∉",ni:"∋",niv:"∋",SuchThat:"∋",ReverseElement:"∋",notni:"∌",notniva:"∌",prod:"∏",Product:"∏",coprod:"∐",Coproduct:"∐",sum:"∑",Sum:"∑",minus:"−",mp:"∓",plusdo:"∔",dotplus:"∔",setminus:"∖",lowast:"∗",radic:"√",Sqrt:"√",prop:"∝",propto:"∝",Proportional:"∝",varpropto:"∝",infin:"∞",infintie:"⧝",ang:"∠",angle:"∠",angmsd:"∡",measuredangle:"∡",angsph:"∢",mid:"∣",VerticalBar:"∣",nmid:"∤",nsmid:"∤",npar:"∦",parallel:"∥",spar:"∥",nparallel:"∦",nspar:"∦",and:"∧",wedge:"∧",or:"∨",vee:"∨",cap:"∩",cup:"∪",int:"∫",Integral:"∫",conint:"∮",ContourIntegral:"∮",Conint:"∯",DoubleContourIntegral:"∯",Cconint:"∰",there4:"∴",therefore:"∴",Therefore:"∴",becaus:"∵",because:"∵",Because:"∵",ratio:"∶",Proportion:"∷",minusd:"∸",dotminus:"∸",mDDot:"∺",homtht:"∻",sim:"∼",bsimg:"∽",backsim:"∽",ac:"∾",mstpos:"∾",acd:"∿",VerticalTilde:"≀",wr:"≀",wreath:"≀",nsime:"≄",nsimeq:"≄",nsimeq:"≄",ncong:"≇",simne:"≆",ncongdot:"⩭̸",ngsim:"≵",nsim:"≁",napprox:"≉",nap:"≉",ngeq:"≱",nge:"≱",nleq:"≰",nle:"≰",ngtr:"≯",ngt:"≯",nless:"≮",nlt:"≮",nprec:"⊀",npr:"⊀",nsucc:"⊁",nsc:"⊁"},J_2={larr:"←",leftarrow:"←",LeftArrow:"←",uarr:"↑",uparrow:"↑",UpArrow:"↑",rarr:"→",rightarrow:"→",RightArrow:"→",darr:"↓",downarrow:"↓",DownArrow:"↓",harr:"↔",leftrightarrow:"↔",LeftRightArrow:"↔",varr:"↕",updownarrow:"↕",UpDownArrow:"↕",nwarr:"↖",nwarrow:"↖",UpperLeftArrow:"↖",nearr:"↗",nearrow:"↗",UpperRightArrow:"↗",searr:"↘",searrow:"↘",LowerRightArrow:"↘",swarr:"↙",swarrow:"↙",LowerLeftArrow:"↙",lArr:"⇐",Leftarrow:"⇐",uArr:"⇑",Uparrow:"⇑",rArr:"⇒",Rightarrow:"⇒",dArr:"⇓",Downarrow:"⇓",hArr:"⇔",Leftrightarrow:"⇔",iff:"⇔",vArr:"⇕",Updownarrow:"⇕",lAarr:"⇚",Lleftarrow:"⇚",rAarr:"⇛",Rrightarrow:"⇛",lrarr:"⇆",leftrightarrows:"⇆",rlarr:"⇄",rightleftarrows:"⇄",lrhar:"⇋",leftrightharpoons:"⇋",ReverseEquilibrium:"⇋",rlhar:"⇌",rightleftharpoons:"⇌",Equilibrium:"⇌",udarr:"⇅",UpArrowDownArrow:"⇅",duarr:"⇵",DownArrowUpArrow:"⇵",llarr:"⇇",leftleftarrows:"⇇",rrarr:"⇉",rightrightarrows:"⇉",ddarr:"⇊",downdownarrows:"⇊",har:"↽",lhard:"↽",leftharpoondown:"↽",lharu:"↼",leftharpoonup:"↼",rhard:"⇁",rightharpoondown:"⇁",rharu:"⇀",rightharpoonup:"⇀",lsh:"↰",Lsh:"↰",rsh:"↱",Rsh:"↱",ldsh:"↲",rdsh:"↳",hookleftarrow:"↩",hookrightarrow:"↪",mapstoleft:"↤",mapstoup:"↥",map:"↦",mapsto:"↦",mapstodown:"↧",crarr:"↵",nwarrow:"↖",nearrow:"↗",searrow:"↘",swarrow:"↙",nleftarrow:"↚",nleftrightarrow:"↮",nrightarrow:"↛",nrarr:"↛",larrtl:"↢",rarrtl:"↣",leftarrowtail:"↢",rightarrowtail:"↣",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Larr:"↞",Rarr:"↠",larrhk:"↩",rarrhk:"↪",larrlp:"↫",looparrowleft:"↫",rarrlp:"↬",looparrowright:"↬",harrw:"↭",leftrightsquigarrow:"↭",nrarrw:"↝̸",rarrw:"↝",rightsquigarrow:"↝",larrbfs:"⤟",rarrbfs:"⤠",nvHarr:"⤄",nvlArr:"⤂",nvrArr:"⤃",larrfs:"⤝",rarrfs:"⤞",Map:"⤅",larrsim:"⥳",rarrsim:"⥴",harrcir:"⥈",Uarrocir:"⥉",lurdshar:"⥊",ldrdhar:"⥧",ldrushar:"⥋",rdldhar:"⥩",lrhard:"⥭",rlhar:"⇌",uharr:"↾",uharl:"↿",dharr:"⇂",dharl:"⇃",Uarr:"↟",Darr:"↡",zigrarr:"⇝",nwArr:"⇖",neArr:"⇗",seArr:"⇘",swArr:"⇙",nharr:"↮",nhArr:"⇎",nlarr:"↚",nlArr:"⇍",nrarr:"↛",nrArr:"⇏",larrb:"⇤",LeftArrowBar:"⇤",rarrb:"⇥",RightArrowBar:"⇥"},U_2={square:"□",Square:"□",squ:"□",squf:"▪",squarf:"▪",blacksquar:"▪",blacksquare:"▪",FilledVerySmallSquare:"▪",blk34:"▓",blk12:"▒",blk14:"░",block:"█",srect:"▭",rect:"▭",sdot:"⋅",sdotb:"⊡",dotsquare:"⊡",triangle:"▵",tri:"▵",trine:"▵",utri:"▵",triangledown:"▿",dtri:"▿",tridown:"▿",triangleleft:"◃",ltri:"◃",triangleright:"▹",rtri:"▹",blacktriangle:"▴",utrif:"▴",blacktriangledown:"▾",dtrif:"▾",blacktriangleleft:"◂",ltrif:"◂",blacktriangleright:"▸",rtrif:"▸",loz:"◊",lozenge:"◊",blacklozenge:"⧫",lozf:"⧫",bigcirc:"◯",xcirc:"◯",circ:"ˆ",Circle:"○",cir:"○",o:"○",bullet:"•",bull:"•",hellip:"…",mldr:"…",nldr:"‥",boxh:"─",HorizontalLine:"─",boxv:"│",boxdr:"┌",boxdl:"┐",boxur:"└",boxul:"┘",boxvr:"├",boxvl:"┤",boxhd:"┬",boxhu:"┴",boxvh:"┼",boxH:"═",boxV:"║",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxDl:"╕",boxdL:"╖",boxDL:"╗",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxUl:"╜",boxuL:"╛",boxUL:"╝",boxvR:"╞",boxVr:"╟",boxVR:"╠",boxVl:"╢",boxvL:"╡",boxVL:"╣",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxvH:"╪",boxVh:"╫",boxVH:"╬"},K_2={excl:"!",iexcl:"¡",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",nbsp:" ",comma:",",period:".",colon:":",semi:";",vert:"|",Verbar:"‖",verbar:"|",dblac:"˝",circ:"ˆ",caron:"ˇ",breve:"˘",dot:"˙",ring:"˚",ogon:"˛",tilde:"˜",DiacriticalGrave:"`",DiacriticalAcute:"´",DiacriticalTilde:"˜",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",grave:"`",acute:"´"},tu={cent:"¢",pound:"£",curren:"¤",yen:"¥",euro:"€",dollar:"$",euro:"€",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"¥",cedil:"¸"},Q_2={frac12:"½",half:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄"},Z_2={trade:"™",TRADE:"™",telrec:"⌕",target:"⌖",ulcorn:"⌜",ulcorner:"⌜",urcorn:"⌝",urcorner:"⌝",dlcorn:"⌞",llcorner:"⌞",drcorn:"⌟",lrcorner:"⌟",intercal:"⊺",intcal:"⊺",oplus:"⊕",CirclePlus:"⊕",ominus:"⊖",CircleMinus:"⊖",otimes:"⊗",CircleTimes:"⊗",osol:"⊘",odot:"⊙",CircleDot:"⊙",oast:"⊛",circledast:"⊛",odash:"⊝",circleddash:"⊝",ocirc:"⊚",circledcirc:"⊚",boxplus:"⊞",plusb:"⊞",boxminus:"⊟",minusb:"⊟",boxtimes:"⊠",timesb:"⊠",boxdot:"⊡",sdotb:"⊡",veebar:"⊻",vee:"∨",barvee:"⊽",and:"∧",wedge:"∧",Cap:"⋒",Cup:"⋓",Fork:"⋔",pitchfork:"⋔",epar:"⋕",ltlarr:"⥶",nvap:"≍⃒",nvsim:"∼⃒",nvge:"≥⃒",nvle:"≤⃒",nvlt:"<⃒",nvgt:">⃒",nvltrie:"⊴⃒",nvrtrie:"⊵⃒",Vdash:"⊩",dashv:"⊣",vDash:"⊨",Vdash:"⊩",Vvdash:"⊪",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯"},ma5={...rS2,...sS2,...tS2,...eS2,...$_2,...z_2,...G_2,...J_2,...U_2,...K_2,...tu,...Q_2,...Z_2},QF={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},zt={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"};var ia5=new Set("!?\\\\/[]$%{}^&*()<>|+");function W_2($){if($[0]==="#")throw Error(`[EntityReplacer] Invalid character '#' in entity name: "${$}"`);for(let z of $)if(ia5.has(z))throw Error(`[EntityReplacer] Invalid character '${z}' in entity name: "${$}"`);return $}function Gt(...$){let z=Object.create(null);for(let G of $){if(!G)continue;for(let J of Object.keys(G)){let U=G[J];if(typeof U==="string")z[J]=U;else if(U&&typeof U==="object"&&U.val!==void 0){let K=U.val;if(typeof K==="string")z[J]=K}}}return z}var VQ="external",eu="base",Jt="all";function ca5($){if(!$||$===VQ)return new Set([VQ]);if($===Jt)return new Set([Jt]);if($===eu)return new Set([eu]);if(Array.isArray($))return new Set($);return new Set([VQ])}var w6=Object.freeze({allow:0,leave:1,remove:2,throw:3}),la5=new Set([9,10,13]);function na5($){if(!$)return{xmlVersion:1,onLevel:w6.allow,nullLevel:w6.remove};let z=$.xmlVersion===1.1?1.1:1,G=w6[$.onNCR]??w6.allow,J=w6[$.nullNCR]??w6.remove,U=Math.max(J,w6.remove);return{xmlVersion:z,onLevel:G,nullLevel:U}}class ZF{constructor($={}){this._limit=$.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof $.postCheck==="function"?$.postCheck:(G)=>G,this._limitTiers=ca5(this._limit.applyLimitsTo??VQ),this._numericAllowed=$.numericAllowed??!0,this._baseMap=Gt(QF,$.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set($.remove&&Array.isArray($.remove)?$.remove:[]),this._leaveSet=new Set($.leave&&Array.isArray($.leave)?$.leave:[]);let z=na5($.ncr);this._ncrXmlVersion=z.xmlVersion,this._ncrOnLevel=z.onLevel,this._ncrNullLevel=z.nullLevel}setExternalEntities($){if($)for(let z of Object.keys($))W_2(z);this._externalMap=Gt($)}addExternalEntity($,z){if(W_2($),typeof z==="string"&&z.indexOf("&")===-1)this._externalMap[$]=z}addInputEntities($){this._totalExpansions=0,this._expandedLength=0,this._inputMap=Gt($)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion($){this._ncrXmlVersion=$===1.1?1.1:1}decode($){if(typeof $!=="string"||$.length===0)return $;let z=$,G=[],J=$.length,U=0,K=0,Q=this._maxTotalExpansions>0,Z=this._maxExpandedLength>0,Y=Q||Z;while(K<J){if($.charCodeAt(K)!==38){K++;continue}let V=K+1;while(V<J&&$.charCodeAt(V)!==59&&V-K<=32)V++;if(V>=J||$.charCodeAt(V)!==59){K++;continue}let B=$.slice(K+1,V);if(B.length===0){K++;continue}let k,L;if(this._removeSet.has(B)){if(k="",L===void 0)L=VQ}else if(this._leaveSet.has(B)){K++;continue}else if(B.charCodeAt(0)===35){let X=this._resolveNCR(B);if(X===void 0){K++;continue}k=X,L=eu}else{let X=this._resolveName(B);k=X?.value,L=X?.tier}if(k===void 0){K++;continue}if(K>U)G.push($.slice(U,K));if(G.push(k),U=V+1,K=U,Y&&this._tierCounts(L)){if(Q){if(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions)throw Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`)}if(Z){let X=k.length-(B.length+2);if(X>0){if(this._expandedLength+=X,this._expandedLength>this._maxExpandedLength)throw Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}}if(U<J)G.push($.slice(U));let W=G.length===0?$:G.join("");return this._postCheck(W,z)}_tierCounts($){if(this._limitTiers.has(Jt))return!0;return this._limitTiers.has($)}_resolveName($){if($ in this._inputMap)return{value:this._inputMap[$],tier:VQ};if($ in this._externalMap)return{value:this._externalMap[$],tier:VQ};if($ in this._baseMap)return{value:this._baseMap[$],tier:eu};return}_classifyNCR($){if($===0)return this._ncrNullLevel;if($>=55296&&$<=57343)return w6.remove;if(this._ncrXmlVersion===1){if($>=1&&$<=31&&!la5.has($))return w6.remove}return-1}_applyNCRAction($,z,G){switch($){case w6.allow:return String.fromCodePoint(G);case w6.remove:return"";case w6.leave:return;case w6.throw:throw Error(`[EntityDecoder] Prohibited numeric character reference &${z}; (U+${G.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(G)}}_resolveNCR($){let z=$.charCodeAt(1),G;if(z===120||z===88)G=parseInt($.slice(2),16);else G=parseInt($.slice(1),10);if(Number.isNaN(G)||G<0||G>1114111)return;let J=this._classifyNCR(G);if(!this._numericAllowed&&J<w6.remove)return;let U=J===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,J);return this._applyNCRAction(U,$,G)}}var Y_2=($)=>{if(UF.includes($))return"__"+$;return $},da5={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function($,z){return z},attributeValueProcessor:function($,z){return z},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function($,z,G){return $},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Y_2};function pa5($,z){if(typeof $!=="string")return;let G=$.toLowerCase();if(UF.some((J)=>G===J.toLowerCase()))throw Error(`[SECURITY] Invalid ${z}: "${$}" is a reserved JavaScript keyword that could cause prototype pollution`);if(su.some((J)=>G===J.toLowerCase()))throw Error(`[SECURITY] Invalid ${z}: "${$}" is a reserved JavaScript keyword that could cause prototype pollution`)}function V_2($,z){if(typeof $==="boolean")return{enabled:$,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1000,allowedTags:null,tagFilter:null,appliesTo:"all"};if(typeof $==="object"&&$!==null)return{enabled:$.enabled!==!1,maxEntitySize:Math.max(1,$.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,$.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,$.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,$.maxExpandedLength??1e5),maxEntityCount:Math.max(1,$.maxEntityCount??1000),allowedTags:$.allowedTags??null,tagFilter:$.tagFilter??null,appliesTo:$.appliesTo??"all"};return V_2(!0)}var B_2=function($){let z=Object.assign({},da5,$),G=[{value:z.attributeNamePrefix,name:"attributeNamePrefix"},{value:z.attributesGroupName,name:"attributesGroupName"},{value:z.textNodeName,name:"textNodeName"},{value:z.cdataPropName,name:"cdataPropName"},{value:z.commentPropName,name:"commentPropName"}];for(let{value:J,name:U}of G)if(J)pa5(J,U);if(z.onDangerousProperty===null)z.onDangerousProperty=Y_2;if(z.processEntities=V_2(z.processEntities,z.htmlEntities),z.unpairedTagsSet=new Set(z.unpairedTags),z.stopNodes&&Array.isArray(z.stopNodes))z.stopNodes=z.stopNodes.map((J)=>{if(typeof J==="string"&&J.startsWith("*."))return".."+J.substring(2);return J});return z};var $T;if(typeof Symbol!=="function")$T="@@xmlMetadata";else $T=Symbol("XML Node Metadata");class Y9{constructor($){this.tagname=$,this.child=[],this[":@"]=Object.create(null)}add($,z){if($==="__proto__")$="#__proto__";this.child.push({[$]:z})}addChild($,z){if($.tagname==="__proto__")$.tagname="#__proto__";if($[":@"]&&Object.keys($[":@"]).length>0)this.child.push({[$.tagname]:$.child,[":@"]:$[":@"]});else this.child.push({[$.tagname]:$.child});if(z!==void 0)this.child[this.child.length-1][$T]={startIndex:z}}static getMetaDataSymbol(){return $T}}var L_2=":A-Za-z_"+"À-ÖØ-öø-˿"+"Ͱ-ͽ"+"Ϳ-҆҈-"+"-"+"⁰-"+"Ⰰ-"+"、-"+"豈-﷏"+"ﷰ-�",aa5=L_2+"\\-\\.\\d"+"·"+"̀-ͯ"+"‿-⁀",k_2=":A-Za-z_"+"À-˿"+"Ͱ-ͽ"+"Ϳ-҆҈-"+"-"+"⁰-"+"Ⰰ-"+"、-"+"豈-﷏"+"ﷰ-�"+"\uD800\uDC00-\uDB7F\uDFFF",oa5=k_2+"\\-\\.\\d"+"·"+"̀-ͯ"+"҇"+"‿-⁀",X_2=($,z,G="")=>{let J=$.replace(":",""),U=z.replace(":",""),K=`[${J}][${U}]*`;return{name:new RegExp(`^[${$}][${z}]*$`,G),ncName:new RegExp(`^${K}$`,G),qName:new RegExp(`^${K}(?::${K})?$`,G),nmToken:new RegExp(`^[${z}]+$`,G),nmTokens:new RegExp(`^[${z}]+(?:\\s+[${z}]+)*$`,G)}},ra5=X_2(L_2,aa5),sa5=X_2(k_2,oa5,"u"),ta5=($="1.0")=>$==="1.1"?sa5:ra5;var Ut=($,{xmlVersion:z="1.0"}={})=>ta5(z).qName.test($);class zT{constructor($,z){this.suppressValidationErr=!$,this.options=$,this.xmlVersion=z||1}setXmlVersion($=1){this.xmlVersion=$}readDocType($,z){let G=Object.create(null),J=0;if($[z+3]==="O"&&$[z+4]==="C"&&$[z+5]==="T"&&$[z+6]==="Y"&&$[z+7]==="P"&&$[z+8]==="E"){z=z+9;let U=1,K=!1,Q=!1,Z="";for(;z<$.length;z++)if($[z]==="<"&&!Q){if(K&&BQ($,"!ENTITY",z)){z+=7;let Y,W;if([Y,W,z]=this.readEntityExp($,z+1,this.suppressValidationErr),W.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&J>=this.options.maxEntityCount)throw Error(`Entity count (${J+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);G[Y]=W,J++}}else if(K&&BQ($,"!ELEMENT",z)){z+=8;let{index:Y}=this.readElementExp($,z+1);z=Y}else if(K&&BQ($,"!ATTLIST",z))z+=8;else if(K&&BQ($,"!NOTATION",z)){z+=9;let{index:Y}=this.readNotationExp($,z+1,this.suppressValidationErr);z=Y}else if(BQ($,"!--",z))Q=!0;else throw Error("Invalid DOCTYPE");U++,Z=""}else if($[z]===">"){if(Q){if($[z-1]==="-"&&$[z-2]==="-")Q=!1,U--}else U--;if(U===0)break}else if($[z]==="[")K=!0;else Z+=$[z];if(U!==0)throw Error("Unclosed DOCTYPE")}else throw Error("Invalid Tag instead of DOCTYPE");return{entities:G,i:z}}readEntityExp($,z){z=u6($,z);let G=z;while(z<$.length&&!/\s/.test($[z])&&$[z]!=='"'&&$[z]!=="'")z++;let J=$.substring(G,z);if(WF(J,{xmlVersion:this.xmlVersion}),z=u6($,z),!this.suppressValidationErr){if($.substring(z,z+6).toUpperCase()==="SYSTEM")throw Error("External entities are not supported");else if($[z]==="%")throw Error("Parameter entities are not supported")}let U="";if([z,U]=this.readIdentifierVal($,z,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&U.length>this.options.maxEntitySize)throw Error(`Entity "${J}" size (${U.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return z--,[J,U,z]}readNotationExp($,z){z=u6($,z);let G=z;while(z<$.length&&!/\s/.test($[z]))z++;let J=$.substring(G,z);!this.suppressValidationErr&&WF(J,{xmlVersion:this.xmlVersion}),z=u6($,z);let U=$.substring(z,z+6).toUpperCase();if(!this.suppressValidationErr&&U!=="SYSTEM"&&U!=="PUBLIC")throw Error(`Expected SYSTEM or PUBLIC, found "${U}"`);z+=U.length,z=u6($,z);let K=null,Q=null;if(U==="PUBLIC"){if([z,K]=this.readIdentifierVal($,z,"publicIdentifier"),z=u6($,z),$[z]==='"'||$[z]==="'")[z,Q]=this.readIdentifierVal($,z,"systemIdentifier")}else if(U==="SYSTEM"){if([z,Q]=this.readIdentifierVal($,z,"systemIdentifier"),!this.suppressValidationErr&&!Q)throw Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:J,publicIdentifier:K,systemIdentifier:Q,index:--z}}readIdentifierVal($,z,G){let J="",U=$[z];if(U!=='"'&&U!=="'")throw Error(`Expected quoted string, found "${U}"`);z++;let K=z;while(z<$.length&&$[z]!==U)z++;if(J=$.substring(K,z),$[z]!==U)throw Error(`Unterminated ${G} value`);return z++,[z,J]}readElementExp($,z){z=u6($,z);let G=z;while(z<$.length&&!/\s/.test($[z]))z++;let J=$.substring(G,z);if(!this.suppressValidationErr&&!Ut(J,{xmlVersion:this.xmlVersion}))throw Error(`Invalid element name: "${J}"`);z=u6($,z);let U="";if($[z]==="E"&&BQ($,"MPTY",z))z+=4;else if($[z]==="A"&&BQ($,"NY",z))z+=2;else if($[z]==="("){z++;let K=z;while(z<$.length&&$[z]!==")")z++;if(U=$.substring(K,z),$[z]!==")")throw Error("Unterminated content model")}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${$[z]}"`);return{elementName:J,contentModel:U.trim(),index:z}}readAttlistExp($,z){z=u6($,z);let G=z;while(z<$.length&&!/\s/.test($[z]))z++;let J=$.substring(G,z);WF(J,{xmlVersion:this.xmlVersion}),z=u6($,z),G=z;while(z<$.length&&!/\s/.test($[z]))z++;let U=$.substring(G,z);if(!WF(U,{xmlVersion:this.xmlVersion}))throw Error(`Invalid attribute name: "${U}"`);z=u6($,z);let K="";if($.substring(z,z+8).toUpperCase()==="NOTATION"){if(K="NOTATION",z+=8,z=u6($,z),$[z]!=="(")throw Error(`Expected '(', found "${$[z]}"`);z++;let Z=[];while(z<$.length&&$[z]!==")"){let Y=z;while(z<$.length&&$[z]!=="|"&&$[z]!==")")z++;let W=$.substring(Y,z);if(W=W.trim(),!WF(W,{xmlVersion:this.xmlVersion}))throw Error(`Invalid notation name: "${W}"`);if(Z.push(W),$[z]==="|")z++,z=u6($,z)}if($[z]!==")")throw Error("Unterminated list of notations");z++,K+=" ("+Z.join("|")+")"}else{let Z=z;while(z<$.length&&!/\s/.test($[z]))z++;K+=$.substring(Z,z);let Y=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!Y.includes(K.toUpperCase()))throw Error(`Invalid attribute type: "${K}"`)}z=u6($,z);let Q="";if($.substring(z,z+8).toUpperCase()==="#REQUIRED")Q="#REQUIRED",z+=8;else if($.substring(z,z+7).toUpperCase()==="#IMPLIED")Q="#IMPLIED",z+=7;else[z,Q]=this.readIdentifierVal($,z,"ATTLIST");return{elementName:J,attributeName:U,attributeType:K,defaultValue:Q,index:z}}}var u6=($,z)=>{while(z<$.length&&/\s/.test($[z]))z++;return z};function BQ($,z,G){for(let J=0;J<z.length;J++)if(z[J]!==$[G+J+1])return!1;return!0}function WF($,z){if(Ut($,{xmlVersion:z}))return $;else throw Error(`Invalid entity name ${$}`)}var ea5=/^[-+]?0x[a-fA-F0-9]+$/,$o5=/^0b[01]+$/,zo5=/^0o[0-7]+$/,Go5=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Jo5={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function Qt($,z={}){if(z=Object.assign({},Jo5,z),!$||typeof $!=="string")return $;let G=$.trim();if(G.length===0)return $;else if(z.skipLike!==void 0&&z.skipLike.test(G))return $;else if(G==="0")return 0;else if(z.hex&&ea5.test(G))return Kt(G,16);else if(z.binary&&$o5.test(G))return Kt(G,2);else if(z.octal&&zo5.test(G))return Kt(G,8);else if(!isFinite(G))return Zo5($,Number(G),z);else if(G.includes("e")||G.includes("E"))return Ko5($,G,z);else{let J=Go5.exec(G);if(J){let U=J[1]||"",K=J[2],Q=Qo5(J[3]),Z=U?$[K.length+1]===".":$[K.length]===".";if(!z.leadingZeros&&(K.length>1||K.length===1&&!Z))return $;else{let Y=Number(G),W=String(Y);if(Y===0)return Y;if(W.search(/[eE]/)!==-1)if(z.eNotation)return Y;else return $;else if(G.indexOf(".")!==-1)if(W==="0")return Y;else if(W===Q)return Y;else if(W===`${U}${Q}`)return Y;else return $;let V=K?Q:G;if(K)return V===W||U+V===W?Y:$;else return V===W||V===U+W?Y:$}}else return $}}var Uo5=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Ko5($,z,G){if(!G.eNotation)return $;let J=z.match(Uo5);if(J){let U=J[1]||"",K=J[3].indexOf("e")===-1?"E":"e",Q=J[2],Z=U?$[Q.length+1]===K:$[Q.length]===K;if(Q.length>1&&Z)return $;else if(Q.length===1&&(J[3].startsWith(`.${K}`)||J[3][0]===K))return Number(z);else if(Q.length>0)if(G.leadingZeros&&!Z)return z=(J[1]||"")+J[3],Number(z);else return $;else return Number(z)}else return $}function Qo5($){if($&&$.indexOf(".")!==-1){if($=$.replace(/0+$/,""),$===".")$="0";else if($[0]===".")$="0"+$;else if($[$.length-1]===".")$=$.substring(0,$.length-1);return $}return $}function Kt($,z){let G=$.trim();if(z===2||z===8)$=G.substring(2);if(parseInt)return parseInt($,z);else if(Number.parseInt)return Number.parseInt($,z);else if(window&&window.parseInt)return window.parseInt($,z);else throw Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Zo5($,z,G){let J=z===1/0;switch(G.infinity.toLowerCase()){case"null":return null;case"infinity":return z;case"string":return J?"Infinity":"-Infinity";case"original":default:return $}}function Zt($){if(typeof $==="function")return $;if(Array.isArray($))return(z)=>{for(let G of $){if(typeof G==="string"&&z===G)return!0;if(G instanceof RegExp&&G.test(z))return!0}};return()=>!1}class zB{constructor($,z={},G){this.pattern=$,this.separator=z.separator||".",this.segments=this._parse($),this.data=G,this._hasDeepWildcard=this.segments.some((J)=>J.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some((J)=>J.attrName!==void 0),this._hasPositionSelector=this.segments.some((J)=>J.position!==void 0)}_parse($){let z=[],G=0,J="";while(G<$.length)if($[G]===this.separator)if(G+1<$.length&&$[G+1]===this.separator){if(J.trim())z.push(this._parseSegment(J.trim())),J="";z.push({type:"deep-wildcard"}),G+=2}else{if(J.trim())z.push(this._parseSegment(J.trim()));J="",G++}else J+=$[G],G++;if(J.trim())z.push(this._parseSegment(J.trim()));return z}_parseSegment($){let z={type:"tag"},G=null,J=$,U=$.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(U){if(J=U[1]+U[3],U[2]){let W=U[2].slice(1,-1);if(W)G=W}}let K=void 0,Q=J;if(J.includes("::")){let W=J.indexOf("::");if(K=J.substring(0,W).trim(),Q=J.substring(W+2).trim(),!K)throw Error(`Invalid namespace in pattern: ${$}`)}let Z=void 0,Y=null;if(Q.includes(":")){let W=Q.lastIndexOf(":"),V=Q.substring(0,W).trim(),B=Q.substring(W+1).trim();if(["first","last","odd","even"].includes(B)||/^nth\(\d+\)$/.test(B))Z=V,Y=B;else Z=Q}else Z=Q;if(!Z)throw Error(`Invalid segment pattern: ${$}`);if(z.tag=Z,K)z.namespace=K;if(G)if(G.includes("=")){let W=G.indexOf("=");z.attrName=G.substring(0,W).trim(),z.attrValue=G.substring(W+1).trim()}else z.attrName=G.trim();if(Y){let W=Y.match(/^nth\((\d+)\)$/);if(W)z.position="nth",z.positionValue=parseInt(W[1],10);else z.position=Y}return z}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class YF{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add($){if(this._sealed)throw TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has($.pattern))return this;if(this._patterns.add($.pattern),$.hasDeepWildcard())return this._deepWildcards.push($),this;let z=$.length,J=$.segments[$.segments.length-1]?.tag;if(!J||J==="*"){if(!this._wildcardByDepth.has(z))this._wildcardByDepth.set(z,[]);this._wildcardByDepth.get(z).push($)}else{let U=`${z}:${J}`;if(!this._byDepthAndTag.has(U))this._byDepthAndTag.set(U,[]);this._byDepthAndTag.get(U).push($)}return this}addAll($){for(let z of $)this.add(z);return this}has($){return this._patterns.has($.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny($){return this.findMatch($)!==null}findMatch($){let z=$.getDepth(),G=$.getCurrentTag(),J=`${z}:${G}`,U=this._byDepthAndTag.get(J);if(U){for(let Q=0;Q<U.length;Q++)if($.matches(U[Q]))return U[Q]}let K=this._wildcardByDepth.get(z);if(K){for(let Q=0;Q<K.length;Q++)if($.matches(K[Q]))return K[Q]}for(let Q=0;Q<this._deepWildcards.length;Q++)if($.matches(this._deepWildcards[Q]))return this._deepWildcards[Q];return null}}class H_2{constructor($){this._matcher=$}get separator(){return this._matcher.separator}getCurrentTag(){let $=this._matcher.path;return $.length>0?$[$.length-1].tag:void 0}getCurrentNamespace(){let $=this._matcher.path;return $.length>0?$[$.length-1].namespace:void 0}getAttrValue($){let z=this._matcher.path;if(z.length===0)return;return z[z.length-1].values?.[$]}hasAttr($){let z=this._matcher.path;if(z.length===0)return!1;let G=z[z.length-1];return G.values!==void 0&&$ in G.values}getPosition(){let $=this._matcher.path;if($.length===0)return-1;return $[$.length-1].position??0}getCounter(){let $=this._matcher.path;if($.length===0)return-1;return $[$.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString($,z=!0){return this._matcher.toString($,z)}toArray(){return this._matcher.path.map(($)=>$.tag)}matches($){return this._matcher.matches($)}matchesAny($){return $.matchesAny(this._matcher)}}class VF{constructor($={}){this.separator=$.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new H_2(this)}push($,z=null,G=null){if(this._pathStringCache=null,this.path.length>0)this.path[this.path.length-1].values=void 0;let J=this.path.length;if(!this.siblingStacks[J])this.siblingStacks[J]=new Map;let U=this.siblingStacks[J],K=G?`${G}:${$}`:$,Q=U.get(K)||0,Z=0;for(let W of U.values())Z+=W;U.set(K,Q+1);let Y={tag:$,position:Z,counter:Q};if(G!==null&&G!==void 0)Y.namespace=G;if(z!==null&&z!==void 0)Y.values=z;this.path.push(Y)}pop(){if(this.path.length===0)return;this._pathStringCache=null;let $=this.path.pop();if(this.siblingStacks.length>this.path.length+1)this.siblingStacks.length=this.path.length+1;return $}updateCurrent($){if(this.path.length>0){let z=this.path[this.path.length-1];if($!==null&&$!==void 0)z.values=$}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue($){if(this.path.length===0)return;return this.path[this.path.length-1].values?.[$]}hasAttr($){if(this.path.length===0)return!1;let z=this.path[this.path.length-1];return z.values!==void 0&&$ in z.values}getPosition(){if(this.path.length===0)return-1;return this.path[this.path.length-1].position??0}getCounter(){if(this.path.length===0)return-1;return this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString($,z=!0){let G=$||this.separator;if(G===this.separator&&z===!0){if(this._pathStringCache!==null)return this._pathStringCache;let U=this.path.map((K)=>K.namespace?`${K.namespace}:${K.tag}`:K.tag).join(G);return this._pathStringCache=U,U}return this.path.map((U)=>z&&U.namespace?`${U.namespace}:${U.tag}`:U.tag).join(G)}toArray(){return this.path.map(($)=>$.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches($){let z=$.segments;if(z.length===0)return!1;if($.hasDeepWildcard())return this._matchWithDeepWildcard(z);return this._matchSimple(z)}_matchSimple($){if(this.path.length!==$.length)return!1;for(let z=0;z<$.length;z++)if(!this._matchSegment($[z],this.path[z],z===this.path.length-1))return!1;return!0}_matchWithDeepWildcard($){let z=this.path.length-1,G=$.length-1;while(G>=0&&z>=0){let J=$[G];if(J.type==="deep-wildcard"){if(G--,G<0)return!0;let U=$[G],K=!1;for(let Q=z;Q>=0;Q--)if(this._matchSegment(U,this.path[Q],Q===this.path.length-1)){z=Q-1,G--,K=!0;break}if(!K)return!1}else{if(!this._matchSegment(J,this.path[z],z===this.path.length-1))return!1;z--,G--}}return G<0}_matchSegment($,z,G){if($.tag!=="*"&&$.tag!==z.tag)return!1;if($.namespace!==void 0){if($.namespace!=="*"&&$.namespace!==z.namespace)return!1}if($.attrName!==void 0){if(!G)return!1;if(!z.values||!($.attrName in z.values))return!1;if($.attrValue!==void 0){if(String(z.values[$.attrName])!==String($.attrValue))return!1}}if($.position!==void 0){if(!G)return!1;let J=z.counter??0;if($.position==="first"&&J!==0)return!1;else if($.position==="odd"&&J%2!==1)return!1;else if($.position==="even"&&J%2!==0)return!1;else if($.position==="nth"&&J!==$.positionValue)return!1}return!0}matchesAny($){return $.matchesAny(this)}snapshot(){return{path:this.path.map(($)=>({...$})),siblingStacks:this.siblingStacks.map(($)=>new Map($))}}restore($){this._pathStringCache=null,this.path=$.path.map((z)=>({...z})),this.siblingStacks=$.siblingStacks.map((z)=>new Map(z))}readOnly(){return this._view}}function Wo5($,z){if(!$)return{};let G=z.attributesGroupName?$[z.attributesGroupName]:$;if(!G)return{};let J={};for(let U in G)if(U.startsWith(z.attributeNamePrefix)){let K=U.substring(z.attributeNamePrefix.length);J[K]=G[U]}else J[U]=G[U];return J}function Yo5($){if(!$||typeof $!=="string")return;let z=$.indexOf(":");if(z!==-1&&z>0){let G=$.substring(0,z);if(G!=="xmlns")return G}return}class GT{constructor($,z){this.options=$,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Xo5,this.parseTextData=Vo5,this.resolveNameSpace=Bo5,this.buildAttributesMap=ko5,this.isItStopNode=qo5,this.replaceEntitiesValue=jo5,this.readStopNodeData=Mo5,this.saveTextToParentTag=Fo5,this.addChild=Ho5,this.ignoreAttributesFn=Zt(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let G={...QF};if(this.options.entityDecoder)this.entityDecoder=this.options.entityDecoder;else{if(typeof this.options.htmlEntities==="object")G=this.options.htmlEntities;else if(this.options.htmlEntities===!0)G={...zt,...tu};this.entityDecoder=new ZF({namedEntities:{...G,...z},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})}this.matcher=new VF,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new YF;let J=this.options.stopNodes;if(J&&J.length>0){for(let U=0;U<J.length;U++){let K=J[U];if(typeof K==="string")this.stopNodeExpressionsSet.add(new zB(K));else if(K instanceof zB)this.stopNodeExpressionsSet.add(K)}this.stopNodeExpressionsSet.seal()}}}function Vo5($,z,G,J,U,K,Q){let Z=this.options;if($!==void 0){if(Z.trimValues&&!J)$=$.trim();if($.length>0){if(!Q)$=this.replaceEntitiesValue($,z,G);let Y=Z.jPath?G.toString():G,W=Z.tagValueProcessor(z,$,Y,U,K);if(W===null||W===void 0)return $;else if(typeof W!==typeof $||W!==$)return W;else if(Z.trimValues)return Vt($,Z.parseTagValue,Z.numberParseOptions);else if($.trim()===$)return Vt($,Z.parseTagValue,Z.numberParseOptions);else return $}}}function Bo5($){if(this.options.removeNSPrefix){let z=$.split(":"),G=$.charAt(0)==="/"?"/":"";if(z[0]==="xmlns")return"";if(z.length===2)$=G+z[1]}return $}var Lo5=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function ko5($,z,G,J=!1){let U=this.options;if(J===!0||U.ignoreAttributes!==!0&&typeof $==="string"){let K=ru($,Lo5),Q=K.length,Z={},Y=Array(Q),W=!1,V={};for(let L=0;L<Q;L++){let X=this.resolveNameSpace(K[L][1]),H=K[L][4];if(X.length&&H!==void 0){let j=H;if(U.trimValues)j=j.trim();j=this.replaceEntitiesValue(j,G,this.readonlyMatcher),Y[L]=j,V[X]=j,W=!0}}if(W&&typeof z==="object"&&z.updateCurrent)z.updateCurrent(V);let B=U.jPath?z.toString():this.readonlyMatcher,k=!1;for(let L=0;L<Q;L++){let X=this.resolveNameSpace(K[L][1]);if(this.ignoreAttributesFn(X,B))continue;let H=U.attributeNamePrefix+X;if(X.length){if(U.transformAttributeName)H=U.transformAttributeName(H);if(H=j_2(H,U),K[L][4]!==void 0){let j=Y[L],F=U.attributeValueProcessor(X,j,B);if(F===null||F===void 0)Z[H]=j;else if(typeof F!==typeof j||F!==j)Z[H]=F;else Z[H]=Vt(j,U.parseAttributeValue,U.numberParseOptions);k=!0}else if(U.allowBooleanAttributes)Z[H]=!0,k=!0}}if(!k)return;if(U.attributesGroupName&&!U.preserveOrder){let L={};return L[U.attributesGroupName]=Z,L}return Z}}var Xo5=function($){$=$.replace(/\r\n?/g,`
|
|
1751
|
-
`);let z=new Y9("!xml"),G=z,J="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let U=this.options,K=new zT(U.processEntities),Q=$.length;for(let Z=0;Z<Q;Z++)if($[Z]==="<"){let W=$.charCodeAt(Z+1);if(W===47){let V=GB($,">",Z,"Closing Tag is not closed."),B=$.substring(Z+2,V).trim();if(U.removeNSPrefix){let L=B.indexOf(":");if(L!==-1)B=B.substr(L+1)}if(B=Wt(U.transformTagName,B,"",U).tagName,G)J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let k=this.matcher.getCurrentTag();if(B&&U.unpairedTagsSet.has(B))throw Error(`Unpaired tag can not be used as closing tag: </${B}>`);if(k&&U.unpairedTagsSet.has(k))this.matcher.pop(),this.tagsNodeStack.pop();this.matcher.pop(),this.isCurrentNodeStopNode=!1,G=this.tagsNodeStack.pop(),J="",Z=V}else if(W===63){let V=Yt($,Z,!1,"?>");if(!V)throw Error("Pi Tag is not closed.");J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let B=this.buildAttributesMap(V.tagExp,this.matcher,V.tagName,!0);if(B){let k=B[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(k)||1),K.setXmlVersion(Number(k)||1)}if(U.ignoreDeclaration&&V.tagName==="?xml"||U.ignorePiTags);else{let k=new Y9(V.tagName);if(k.add(U.textNodeName,""),V.tagName!==V.tagExp&&V.attrExpPresent&&U.ignoreAttributes!==!0)k[":@"]=B;this.addChild(G,k,this.readonlyMatcher,Z)}Z=V.closeIndex+1}else if(W===33&&$.charCodeAt(Z+2)===45&&$.charCodeAt(Z+3)===45){let V=GB($,"-->",Z+4,"Comment is not closed.");if(U.commentPropName){let B=$.substring(Z+4,V-2);J=this.saveTextToParentTag(J,G,this.readonlyMatcher),G.add(U.commentPropName,[{[U.textNodeName]:B}])}Z=V}else if(W===33&&$.charCodeAt(Z+2)===68){let V=K.readDocType($,Z);this.entityDecoder.addInputEntities(V.entities),Z=V.i}else if(W===33&&$.charCodeAt(Z+2)===91){let V=GB($,"]]>",Z,"CDATA is not closed.")-2,B=$.substring(Z+9,V);J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let k=this.parseTextData(B,G.tagname,this.readonlyMatcher,!0,!1,!0,!0);if(k==null)k="";if(U.cdataPropName)G.add(U.cdataPropName,[{[U.textNodeName]:B}]);else G.add(U.textNodeName,k);Z=V+2}else{let V=Yt($,Z,U.removeNSPrefix);if(!V){let I=$.substring(Math.max(0,Z-50),Math.min(Q,Z+50));throw Error(`readTagExp returned undefined at position ${Z}. Context: "${I}"`)}let{tagName:B,rawTagName:k,tagExp:L,attrExpPresent:X,closeIndex:H}=V;if({tagName:B,tagExp:L}=Wt(U.transformTagName,B,L,U),U.strictReservedNames&&(B===U.commentPropName||B===U.cdataPropName||B===U.textNodeName||B===U.attributesGroupName))throw Error(`Invalid tag name: ${B}`);if(G&&J){if(G.tagname!=="!xml")J=this.saveTextToParentTag(J,G,this.readonlyMatcher,!1)}let j=G;if(j&&U.unpairedTagsSet.has(j.tagname))G=this.tagsNodeStack.pop(),this.matcher.pop();let F=!1;if(L.length>0&&L.lastIndexOf("/")===L.length-1){if(F=!0,B[B.length-1]==="/")B=B.substr(0,B.length-1),L=B;else L=L.substr(0,L.length-1);X=B!==L}let q=null,N={},A=void 0;if(A=Yo5(k),B!==z.tagname)this.matcher.push(B,{},A);if(B!==L&&X){if(q=this.buildAttributesMap(L,this.matcher,B),q)N=Wo5(q,U)}if(B!==z.tagname)this.isCurrentNodeStopNode=this.isItStopNode();let M=Z;if(this.isCurrentNodeStopNode){let I="";if(F)Z=V.closeIndex;else if(U.unpairedTagsSet.has(B))Z=V.closeIndex;else{let D=this.readStopNodeData($,k,H+1);if(!D)throw Error(`Unexpected end of ${k}`);Z=D.i,I=D.tagContent}let O=new Y9(B);if(q)O[":@"]=q;O.add(U.textNodeName,I),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(G,O,this.readonlyMatcher,M)}else{if(F){({tagName:B,tagExp:L}=Wt(U.transformTagName,B,L,U));let I=new Y9(B);if(q)I[":@"]=q;this.addChild(G,I,this.readonlyMatcher,M),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(U.unpairedTagsSet.has(B)){let I=new Y9(B);if(q)I[":@"]=q;this.addChild(G,I,this.readonlyMatcher,M),this.matcher.pop(),this.isCurrentNodeStopNode=!1,Z=V.closeIndex;continue}else{let I=new Y9(B);if(this.tagsNodeStack.length>U.maxNestedTags)throw Error("Maximum nested tags exceeded");if(this.tagsNodeStack.push(G),q)I[":@"]=q;this.addChild(G,I,this.readonlyMatcher,M),G=I}J="",Z=H}}}else J+=$[Z];return z.child};function Ho5($,z,G,J){if(!this.options.captureMetaData)J=void 0;let U=this.options.jPath?G.toString():G,K=this.options.updateTag(z.tagname,U,z[":@"]);if(K===!1);else if(typeof K==="string")z.tagname=K,$.addChild(z,J);else $.addChild(z,J)}function jo5($,z,G){let J=this.options.processEntities;if(!J||!J.enabled)return $;if(J.allowedTags){let U=this.options.jPath?G.toString():G;if(!(Array.isArray(J.allowedTags)?J.allowedTags.includes(z):J.allowedTags(z,U)))return $}if(J.tagFilter){let U=this.options.jPath?G.toString():G;if(!J.tagFilter(z,U))return $}return this.entityDecoder.decode($)}function Fo5($,z,G,J){if($){if(J===void 0)J=z.child.length===0;if($=this.parseTextData($,z.tagname,G,!1,z[":@"]?Object.keys(z[":@"]).length!==0:!1,J),$!==void 0&&$!=="")z.add(this.options.textNodeName,$);$=""}return $}function qo5(){if(this.stopNodeExpressionsSet.size===0)return!1;return this.matcher.matchesAny(this.stopNodeExpressionsSet)}function No5($,z,G=">"){let J=0,U=$.length,K=G.charCodeAt(0),Q=G.length>1?G.charCodeAt(1):-1,Z="",Y=z;for(let W=z;W<U;W++){let V=$.charCodeAt(W);if(J){if(V===J)J=0}else if(V===34||V===39)J=V;else if(V===K)if(Q!==-1){if($.charCodeAt(W+1)===Q)return Z+=$.substring(Y,W),{data:Z,index:W}}else return Z+=$.substring(Y,W),{data:Z,index:W};else if(V===9&&!J)Z+=$.substring(Y,W)+" ",Y=W+1}}function GB($,z,G,J){let U=$.indexOf(z,G);if(U===-1)throw Error(J);else return U+z.length-1}function Ao5($,z,G,J){let U=$.indexOf(z,G);if(U===-1)throw Error(J);return U}function Yt($,z,G,J=">"){let U=No5($,z+1,J);if(!U)return;let{data:K,index:Q}=U,Z=K.search(/\s/),Y=K,W=!0;if(Z!==-1)Y=K.substring(0,Z),K=K.substring(Z+1).trimStart();let V=Y;if(G){let B=Y.indexOf(":");if(B!==-1)Y=Y.substr(B+1),W=Y!==U.data.substr(B+1)}return{tagName:Y,tagExp:K,closeIndex:Q,attrExpPresent:W,rawTagName:V}}function Mo5($,z,G){let J=G,U=1,K=$.length;for(;G<K;G++)if($[G]==="<"){let Q=$.charCodeAt(G+1);if(Q===47){let Z=Ao5($,">",G,`${z} is not closed`);if($.substring(G+2,Z).trim()===z){if(U--,U===0)return{tagContent:$.substring(J,G),i:Z}}G=Z}else if(Q===63)G=GB($,"?>",G+1,"StopNode is not closed.");else if(Q===33&&$.charCodeAt(G+2)===45&&$.charCodeAt(G+3)===45)G=GB($,"-->",G+3,"StopNode is not closed.");else if(Q===33&&$.charCodeAt(G+2)===91)G=GB($,"]]>",G,"StopNode is not closed.")-2;else{let Z=Yt($,G,!1);if(Z){if((Z&&Z.tagName)===z&&Z.tagExp[Z.tagExp.length-1]!=="/")U++;G=Z.closeIndex}}}}function Vt($,z,G){if(z&&typeof $==="string"){let J=$.trim();if(J==="true")return!0;else if(J==="false")return!1;else return Qt($,G)}else if(lS2($))return $;else return""}function Wt($,z,G,J){if($){let U=$(z);if(G===z)G=U;z=U}return z=j_2(z,J),{tagName:z,tagExp:G}}function j_2($,z){if(su.includes($))throw Error(`[SECURITY] Invalid name: "${$}" is a reserved JavaScript keyword that could cause prototype pollution`);else if(UF.includes($))return z.onDangerousProperty($);return $}var Bt=Y9.getMetaDataSymbol();function Do5($,z){if(!$||typeof $!=="object")return{};if(!z)return $;let G={};for(let J in $)if(J.startsWith(z)){let U=J.substring(z.length);G[U]=$[J]}else G[J]=$[J];return G}function Lt($,z,G,J){return F_2($,z,G,J)}function F_2($,z,G,J){let U,K={};for(let Q=0;Q<$.length;Q++){let Z=$[Q],Y=Oo5(Z);if(Y!==void 0&&Y!==z.textNodeName){let W=Do5(Z[":@"]||{},z.attributeNamePrefix);G.push(Y,W)}if(Y===z.textNodeName)if(U===void 0)U=Z[Y];else U+=""+Z[Y];else if(Y===void 0)continue;else if(Z[Y]){let W=F_2(Z[Y],z,G,J),V=vo5(W,z);if(Object.keys(W).length===0&&z.alwaysCreateTextNode)W[z.textNodeName]="";if(Z[":@"])Io5(W,Z[":@"],J,z);else if(Object.keys(W).length===1&&W[z.textNodeName]!==void 0&&!z.alwaysCreateTextNode)W=W[z.textNodeName];else if(Object.keys(W).length===0)if(z.alwaysCreateTextNode)W[z.textNodeName]="";else W="";if(Z[Bt]!==void 0&&typeof W==="object"&&W!==null)W[Bt]=Z[Bt];if(K[Y]!==void 0&&Object.prototype.hasOwnProperty.call(K,Y)){if(!Array.isArray(K[Y]))K[Y]=[K[Y]];K[Y].push(W)}else{let B=z.jPath?J.toString():J;if(z.isArray(Y,B,V))K[Y]=[W];else K[Y]=W}if(Y!==void 0&&Y!==z.textNodeName)G.pop()}}if(typeof U==="string"){if(U.length>0)K[z.textNodeName]=U}else if(U!==void 0)K[z.textNodeName]=U;return K}function Oo5($){let z=Object.keys($);for(let G=0;G<z.length;G++){let J=z[G];if(J!==":@")return J}}function Io5($,z,G,J){if(z){let U=Object.keys(z),K=U.length;for(let Q=0;Q<K;Q++){let Z=U[Q],Y=Z.startsWith(J.attributeNamePrefix)?Z.substring(J.attributeNamePrefix.length):Z,W=J.jPath?G.toString()+"."+Y:G;if(J.isArray(Z,W,!0,!0))$[Z]=[z[Z]];else $[Z]=z[Z]}}}function vo5($,z){let{textNodeName:G}=z,J=Object.keys($).length;if(J===0)return!0;if(J===1&&($[G]||typeof $[G]==="boolean"||$[G]===0))return!0;return!1}class BF{constructor($){this.externalEntities={},this.options=B_2($)}parse($,z){if(typeof $!=="string"&&$.toString)$=$.toString();else if(typeof $!=="string")throw Error("XML data is accepted in String or Bytes[] form.");if(z){if(z===!0)z={};let U=oS2($,z);if(U!==!0)throw Error(`${U.err.msg}:${U.err.line}:${U.err.col}`)}let G=new GT(this.options,this.externalEntities),J=G.parseXml($);if(this.options.preserveOrder||J===void 0)return J;else return Lt(J,this.options,G.matcher,G.readonlyMatcher)}addEntity($,z){if(z.indexOf("&")!==-1)throw Error("Entity value can't have '&'");else if($.indexOf("&")!==-1||$.indexOf(";")!==-1)throw Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");else if(z==="&")throw Error("An entity with value '&' is not permitted");else this.externalEntities[$]=z}static getMetaDataSymbol(){return Y9.getMetaDataSymbol()}}A0();var Ro5=["/rss","/feed","/atom.xml","/rss.xml","/index.xml"],wo5=new BF({ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text"});function kt($){if($===void 0||$===null)return[];return Array.isArray($)?$:[$]}function K7($){if($==null)return;if(typeof $==="string")return $;if(typeof $==="object"){let z=$;if(typeof z["#text"]==="string")return z["#text"];if(typeof z["#cdata"]==="string")return z["#cdata"]}return}function q_2($){for(let z of kt($)){let G=z?.["@_href"],J=z?.["@_rel"];if(typeof G==="string"&&(J===void 0||J==="alternate"))return G}return}function N_2($){let z;try{z=wo5.parse($)}catch{return null}let G=z.rss;if(G){let U=G.channel;if(!U)return null;let K=kt(U.item);return{kind:"rss",title:K7(U.title),description:K7(U.description),link:K7(U.link),entries:K.map((Q)=>({title:K7(Q.title),link:K7(Q.link),pubDate:K7(Q.pubDate),description:K7(Q.description),content:K7(Q["content:encoded"])??K7(Q.content)}))}}let J=z.feed;if(J){let U=kt(J.entry);return{kind:"atom",title:K7(J.title),description:K7(J.subtitle),link:q_2(J.link),entries:U.map((K)=>({title:K7(K.title),link:q_2(K.link),pubDate:K7(K.published)??K7(K.updated),description:K7(K.summary),content:K7(K.content)??K7(K.summary)}))}}return null}async function A_2($,z){let G=performance.now(),J;try{let K=await F3($.toString(),{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(K.ok)J=DI(K.text).alternate?.[0]?.href}catch{}let U=new Set;if(J)try{U.add(new URL(J,$).toString())}catch{}for(let K of Ro5)U.add(new URL(K,`${$.protocol}//${$.host}`).toString());for(let K of U){if(z.signal?.aborted)break;try{let Q=await F3(K,{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(!Q.ok||Q.text.length<50)continue;let Z=N_2(Q.text);if(!Z||Z.entries.length===0)continue;return{url:$.toString(),status:"ok",strategy:"probe",platform:"rss",httpStatus:Q.status,content:Q.text,contentType:Q.headers.get("content-type")??void 0,elapsedMs:Math.round(performance.now()-G),signals:[],feedUrl:K,feed:Z}}catch{}}return{url:$.toString(),status:"not-found",strategy:"probe",platform:"rss",content:"",elapsedMs:Math.round(performance.now()-G),signals:[],error:"no RSS/Atom feed discovered"}}function M_2($,z="en-US"){let[G,J]=z.split("-"),U=new URL("https://news.google.com/rss/search");return U.searchParams.set("q",$),U.searchParams.set("hl",G??"en"),U.searchParams.set("gl",J??"US"),U.searchParams.set("ceid",`${J??"US"}:${G??"en"}`),U.toString()}AX();Lz();A0();var JT={"github.com":{domain:"github.com",level:"verified",score:0.95,tags:["code-host"],source:"registry"},"docs.github.com":{domain:"docs.github.com",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"developer.mozilla.org":{domain:"developer.mozilla.org",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"nextjs.org":{domain:"nextjs.org",level:"verified",score:0.9,tags:["vendor","lang-docs"],source:"registry"},"vercel.com":{domain:"vercel.com",level:"verified",score:0.9,tags:["vendor"],source:"registry"},"typescriptlang.org":{domain:"typescriptlang.org",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"stackoverflow.com":{domain:"stackoverflow.com",level:"community",score:0.7,tags:["qna"],source:"registry"},"dev.to":{domain:"dev.to",level:"external",score:0.4,tags:["blog"],source:"registry"},"medium.com":{domain:"medium.com",level:"external",score:0.35,tags:["blog"],source:"registry"},"npmjs.com":{domain:"npmjs.com",level:"verified",score:0.9,tags:["registry"],source:"registry"},"pypi.org":{domain:"pypi.org",level:"verified",score:0.9,tags:["registry"],source:"registry"},"news.ycombinator.com":{domain:"news.ycombinator.com",level:"community",score:0.65,tags:["news"],source:"registry"},"reddit.com":{domain:"reddit.com",level:"community",score:0.55,tags:["forum"],source:"registry"},"wikipedia.org":{domain:"wikipedia.org",level:"community",score:0.75,tags:["encyclopedia"],source:"registry"},"arxiv.org":{domain:"arxiv.org",level:"verified",score:0.9,tags:["academic"],source:"registry"},"doi.org":{domain:"doi.org",level:"verified",score:0.95,tags:["academic"],source:"registry"}};function uo5($){return $.replace(/^www\./,"")}function To5($){if($ in JT){let G=JT[$];return G?{...G}:null}let z=uo5($);if(z in JT){let G=JT[z];return G?{...G}:null}return null}function Eo5($){let z=$.split(".").pop();if(z==="gov"||z==="edu"||z==="mil")return{domain:$,level:"verified",score:0.9,tags:["institution"],source:"heuristic"};if(/\.gov\.[a-z]{2}$/.test($)||/\.ac\.[a-z]{2}$/.test($))return{domain:$,level:"verified",score:0.85,tags:["institution"],source:"heuristic"};return null}async function Po5($){try{let z=await F3(`https://tranco-list.eu/api/ranks/domain/${$}`,{timeoutMs:5000});if(!z.ok)return null;let J=JSON.parse(z.text).ranks?.[0]?.rank;if(!J)return null;let U=J<1e4?0.6:J<1e5?0.4:0.2;return{domain:$,level:J<1e4?"community":"external",score:U,tags:["tranco"],source:"tranco",rank:J}}catch{return null}}async function D_2($){let z=To5($);if(z)return z;let G=Eo5($);if(G)return G;let J=await Po5($);if(J)return J;return{domain:$,level:"unknown",score:null,tags:[],source:"heuristic"}}var O_2=["api","probe","impersonate","browser","archive"];function I_2($){if(!$)return;let z=$.split(",").map((J)=>J.trim()).filter(Boolean),G=z.filter((J)=>!O_2.includes(J));if(G.length>0)throw Error(`Unknown strategy: ${G.join(", ")}. Valid: ${O_2.join(", ")}`);return z}function JB($){try{return new URL($)}catch{throw Error(`Invalid URL: ${$}`)}}function CJ($){return{timeoutMs:$.timeout?Math.max(1000,Math.floor(Number($.timeout)*1000)):15000,locale:$.locale??"en-US,en;q=0.9"}}function kz($,z){if(z)console.log(JSON.stringify($,null,2));else console.log(JSON.stringify($))}function LQ($){if(!$){process.exitCode=1;return}if($.status==="ok")process.exitCode=0;else if($.status==="blocked")process.exitCode=2;else if($.status==="not-found")process.exitCode=3;else if($.status==="invalid-input")process.exitCode=4;else if($.status==="auth-required")process.exitCode=5;else if($.status==="timeout")process.exitCode=6;else process.exitCode=1}function v_2($){let z=$.command("search").description("Mechanical search primitives — fetch, meta, rss, media, trust, code").alias("s");z.command("fetch <url>").description("Fetch URL via auto-escalating strategy pipeline").option("--only <strategies>","Comma-separated strategies to run").option("--skip <strategies>","Comma-separated strategies to skip").option("--include-archive","Include archive strategy as last fallback").option("--timeout <seconds>","Per-strategy timeout","15").option("--locale <value>","Accept-Language header","en-US,en;q=0.9").option("--pretty","Pretty-print JSON output").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=await cS2(U,K,{only:I_2(J.only),skip:I_2(J.skip),includeArchive:J.includeArchive});kz(Q,Boolean(J.pretty)),LQ(Q)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("api <url>").description("Fetch via matched platform API (Phase 0)").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G);if(!ki(U)){console.error(n0.default.yellow(`No API handler matches host ${U.hostname}`)),process.exitCode=3;return}let Q=CJ(J),Z=await VO(U,Q);if(!Z){process.exitCode=3;return}kz(Z,Boolean(J.pretty)),LQ(Z)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("api:search <query>").description("Fan-out keyword search across platforms that support it").option("--platforms <list>","Comma-separated platform ids").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=CJ(J),K=J.platforms?J.platforms.split(",").map((Z)=>Z.trim()).filter(Boolean):void 0,Q=await vG(G,U,K);kz(Q,Boolean(J.pretty))}),z.command("meta <url>").description("Extract OGP / JSON-LD / Schema.org from URL").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=await uX2(U,K),{content:Z,...Y}=Q;kz(Y,Boolean(J.pretty)),LQ(Q)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("rss <url>").description("Discover and parse RSS/Atom feed for a URL").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=await A_2(U,K),{content:Z,...Y}=Q;kz(Y,Boolean(J.pretty)),LQ(Q)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("rss:google <query>").description("Build Google News RSS URL for a query").option("--locale <value>","Locale (e.g., ko-KR)","en-US").action((G,J)=>{let U=M_2(G,J.locale??"en-US");console.log(U)}),z.command("media <url>").description("Extract media metadata via yt-dlp (1858 sites)").option("--subs","Write subtitles").option("--sub-lang <list>","Subtitle languages (comma-separated)","en").option("--format <spec>","yt-dlp format spec").option("--timeout <seconds>","Timeout","30").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=J.subLang?J.subLang.split(",").map((Y)=>Y.trim()).filter(Boolean):void 0,Z=await RX2(U,K,{subtitles:J.subs,...Q?{subLangs:Q}:{},...J.format?{format:J.format}:{}});kz(Z,Boolean(J.pretty)),LQ(Z)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("archive <url>").description("Fetch via AMP / archive.today / Wayback").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=await pX(U,K);kz(Q,Boolean(J.pretty)),LQ(Q)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("trust <domain>").description("Resolve trust level / score for a domain").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=await D_2(G.toLowerCase());kz(U,Boolean(J.pretty))}),z.command("code <query>").description("Search code via gh / glab").option("--host <github|gitlab>","Host","github").option("--language <lang>","Language filter").option("--repo <owner/repo>","Scope to a repo").option("--limit <n>","Max results","20").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=J.host==="gitlab"||J.host==="github"?J.host:"github",K=CJ({}),Q=await vX2(G,K,{host:U,...J.language?{language:J.language}:{},...J.repo?{repo:J.repo}:{},...J.limit?{limit:Number.parseInt(J.limit,10)}:{}});kz(Q,Boolean(J.pretty)),LQ(Q)}),z.command("doctor").description("Check dependencies (Chrome, python3 curl_cffi, yt-dlp, gh)").action(async()=>{let G=[],J=R6();G.push({name:"chrome",ok:Boolean(J),detail:J??"Install Chrome or set OMA_CHROME_PATH"}),G.push(await Xt("python3",["--version"])),G.push(await Co5()),G.push(await Xt("yt-dlp",["--version"])),G.push(await Xt("gh",["--version"]));for(let U of G){let K=U.ok?n0.default.green("✓"):n0.default.yellow("!");console.log(`${K} ${U.name}: ${U.detail}`)}if(G.some((U)=>!U.ok))process.exitCode=1})}async function Xt($,z){return new Promise((G)=>{let{spawn:J}=Z2("node:child_process"),U=J($,z,{stdio:["ignore","pipe","pipe"]}),K="";U.stdout?.on("data",(Q)=>{K+=Q.toString()}),U.on("error",()=>G({name:$,ok:!1,detail:"not found"})),U.on("close",(Q)=>{if(Q===0)G({name:$,ok:!0,detail:K.trim()});else G({name:$,ok:!1,detail:`exit code ${Q}`})})})}async function Co5(){return new Promise(($)=>{let{spawn:z}=Z2("node:child_process"),G=z("python3",["-c","import curl_cffi; print(curl_cffi.__version__)"],{stdio:["ignore","pipe","pipe"]}),J="";G.stdout?.on("data",(U)=>{J+=U.toString()}),G.on("error",()=>$({name:"curl_cffi",ok:!1,detail:"python3 not found"})),G.on("close",(U)=>{if(U===0)$({name:"curl_cffi",ok:!0,detail:`v${J.trim()}`});else $({name:"curl_cffi",ok:!1,detail:"not installed (pip install curl_cffi)"})})})}function R_2($){let z=$.command("skills").description("Inspect and audit installed skills");Z1(z.command("audit").description("Check frontmatter description similarity between installed skills"),"Output as JSON for CI/CD").action(z5((G)=>{qQ2(G1(G))},{supportsJsonOutput:!0}))}var Q6=i2(C5(),1);var E6=i2(C5(),1);import{existsSync as Ot,mkdirSync as to5,readFileSync as It,writeFileSync as eo5}from"node:fs";import{dirname as $r5,join as WT,resolve as zr5}from"node:path";var bo5=/\.slide(?![\w-])/g,yo5=new Set(["media","supports","container","layer"]);function So5($){let z=[],G="",J=0,U="",K=!1;for(let Q=0;Q<$.length;Q++){let Z=$[Q];if(!K)if(Z==="{")K=!0,J=1,U="";else if(Z===";"){let Y=G.trim();if(Y)z.push({prelude:`${Y};`});G=""}else G+=Z;else if(Z==="{")J++,U+=Z;else if(Z==="}")if(J--,J===0)z.push({prelude:G.trim(),body:U}),G="",U="",K=!1;else U+=Z;else U+=Z}return z}function _o5($){let z=[],G="",J=0;for(let U of $){if(U==="(")J++;else if(U===")")J=Math.max(0,J-1);if(U===","&&J===0)z.push(G),G="";else G+=U}if(G.trim())z.push(G);return z}function xo5($,z){let G=$.trim();if(!G)return G;let J=G.replace(bo5,z);return J.includes(z)?J:`${z} ${J}`}function w_2($,z){let G=`#${z}`,J=[];for(let U of So5($)){if(U.body===void 0){J.push(U.prelude);continue}if(U.prelude.startsWith("@")){let Q=(/^@([\w-]+)/.exec(U.prelude)?.[1]??"").toLowerCase();if(yo5.has(Q))J.push(`${U.prelude} {
|
|
1751
|
+
`);let z=new Y9("!xml"),G=z,J="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let U=this.options,K=new zT(U.processEntities),Q=$.length;for(let Z=0;Z<Q;Z++)if($[Z]==="<"){let W=$.charCodeAt(Z+1);if(W===47){let V=GB($,">",Z,"Closing Tag is not closed."),B=$.substring(Z+2,V).trim();if(U.removeNSPrefix){let L=B.indexOf(":");if(L!==-1)B=B.substr(L+1)}if(B=Wt(U.transformTagName,B,"",U).tagName,G)J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let k=this.matcher.getCurrentTag();if(B&&U.unpairedTagsSet.has(B))throw Error(`Unpaired tag can not be used as closing tag: </${B}>`);if(k&&U.unpairedTagsSet.has(k))this.matcher.pop(),this.tagsNodeStack.pop();this.matcher.pop(),this.isCurrentNodeStopNode=!1,G=this.tagsNodeStack.pop(),J="",Z=V}else if(W===63){let V=Yt($,Z,!1,"?>");if(!V)throw Error("Pi Tag is not closed.");J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let B=this.buildAttributesMap(V.tagExp,this.matcher,V.tagName,!0);if(B){let k=B[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(k)||1),K.setXmlVersion(Number(k)||1)}if(U.ignoreDeclaration&&V.tagName==="?xml"||U.ignorePiTags);else{let k=new Y9(V.tagName);if(k.add(U.textNodeName,""),V.tagName!==V.tagExp&&V.attrExpPresent&&U.ignoreAttributes!==!0)k[":@"]=B;this.addChild(G,k,this.readonlyMatcher,Z)}Z=V.closeIndex+1}else if(W===33&&$.charCodeAt(Z+2)===45&&$.charCodeAt(Z+3)===45){let V=GB($,"-->",Z+4,"Comment is not closed.");if(U.commentPropName){let B=$.substring(Z+4,V-2);J=this.saveTextToParentTag(J,G,this.readonlyMatcher),G.add(U.commentPropName,[{[U.textNodeName]:B}])}Z=V}else if(W===33&&$.charCodeAt(Z+2)===68){let V=K.readDocType($,Z);this.entityDecoder.addInputEntities(V.entities),Z=V.i}else if(W===33&&$.charCodeAt(Z+2)===91){let V=GB($,"]]>",Z,"CDATA is not closed.")-2,B=$.substring(Z+9,V);J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let k=this.parseTextData(B,G.tagname,this.readonlyMatcher,!0,!1,!0,!0);if(k==null)k="";if(U.cdataPropName)G.add(U.cdataPropName,[{[U.textNodeName]:B}]);else G.add(U.textNodeName,k);Z=V+2}else{let V=Yt($,Z,U.removeNSPrefix);if(!V){let I=$.substring(Math.max(0,Z-50),Math.min(Q,Z+50));throw Error(`readTagExp returned undefined at position ${Z}. Context: "${I}"`)}let{tagName:B,rawTagName:k,tagExp:L,attrExpPresent:X,closeIndex:H}=V;if({tagName:B,tagExp:L}=Wt(U.transformTagName,B,L,U),U.strictReservedNames&&(B===U.commentPropName||B===U.cdataPropName||B===U.textNodeName||B===U.attributesGroupName))throw Error(`Invalid tag name: ${B}`);if(G&&J){if(G.tagname!=="!xml")J=this.saveTextToParentTag(J,G,this.readonlyMatcher,!1)}let j=G;if(j&&U.unpairedTagsSet.has(j.tagname))G=this.tagsNodeStack.pop(),this.matcher.pop();let F=!1;if(L.length>0&&L.lastIndexOf("/")===L.length-1){if(F=!0,B[B.length-1]==="/")B=B.substr(0,B.length-1),L=B;else L=L.substr(0,L.length-1);X=B!==L}let q=null,N={},A=void 0;if(A=Yo5(k),B!==z.tagname)this.matcher.push(B,{},A);if(B!==L&&X){if(q=this.buildAttributesMap(L,this.matcher,B),q)N=Wo5(q,U)}if(B!==z.tagname)this.isCurrentNodeStopNode=this.isItStopNode();let M=Z;if(this.isCurrentNodeStopNode){let I="";if(F)Z=V.closeIndex;else if(U.unpairedTagsSet.has(B))Z=V.closeIndex;else{let D=this.readStopNodeData($,k,H+1);if(!D)throw Error(`Unexpected end of ${k}`);Z=D.i,I=D.tagContent}let O=new Y9(B);if(q)O[":@"]=q;O.add(U.textNodeName,I),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(G,O,this.readonlyMatcher,M)}else{if(F){({tagName:B,tagExp:L}=Wt(U.transformTagName,B,L,U));let I=new Y9(B);if(q)I[":@"]=q;this.addChild(G,I,this.readonlyMatcher,M),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(U.unpairedTagsSet.has(B)){let I=new Y9(B);if(q)I[":@"]=q;this.addChild(G,I,this.readonlyMatcher,M),this.matcher.pop(),this.isCurrentNodeStopNode=!1,Z=V.closeIndex;continue}else{let I=new Y9(B);if(this.tagsNodeStack.length>U.maxNestedTags)throw Error("Maximum nested tags exceeded");if(this.tagsNodeStack.push(G),q)I[":@"]=q;this.addChild(G,I,this.readonlyMatcher,M),G=I}J="",Z=H}}}else J+=$[Z];return z.child};function Ho5($,z,G,J){if(!this.options.captureMetaData)J=void 0;let U=this.options.jPath?G.toString():G,K=this.options.updateTag(z.tagname,U,z[":@"]);if(K===!1);else if(typeof K==="string")z.tagname=K,$.addChild(z,J);else $.addChild(z,J)}function jo5($,z,G){let J=this.options.processEntities;if(!J||!J.enabled)return $;if(J.allowedTags){let U=this.options.jPath?G.toString():G;if(!(Array.isArray(J.allowedTags)?J.allowedTags.includes(z):J.allowedTags(z,U)))return $}if(J.tagFilter){let U=this.options.jPath?G.toString():G;if(!J.tagFilter(z,U))return $}return this.entityDecoder.decode($)}function Fo5($,z,G,J){if($){if(J===void 0)J=z.child.length===0;if($=this.parseTextData($,z.tagname,G,!1,z[":@"]?Object.keys(z[":@"]).length!==0:!1,J),$!==void 0&&$!=="")z.add(this.options.textNodeName,$);$=""}return $}function qo5(){if(this.stopNodeExpressionsSet.size===0)return!1;return this.matcher.matchesAny(this.stopNodeExpressionsSet)}function No5($,z,G=">"){let J=0,U=$.length,K=G.charCodeAt(0),Q=G.length>1?G.charCodeAt(1):-1,Z="",Y=z;for(let W=z;W<U;W++){let V=$.charCodeAt(W);if(J){if(V===J)J=0}else if(V===34||V===39)J=V;else if(V===K)if(Q!==-1){if($.charCodeAt(W+1)===Q)return Z+=$.substring(Y,W),{data:Z,index:W}}else return Z+=$.substring(Y,W),{data:Z,index:W};else if(V===9&&!J)Z+=$.substring(Y,W)+" ",Y=W+1}}function GB($,z,G,J){let U=$.indexOf(z,G);if(U===-1)throw Error(J);else return U+z.length-1}function Ao5($,z,G,J){let U=$.indexOf(z,G);if(U===-1)throw Error(J);return U}function Yt($,z,G,J=">"){let U=No5($,z+1,J);if(!U)return;let{data:K,index:Q}=U,Z=K.search(/\s/),Y=K,W=!0;if(Z!==-1)Y=K.substring(0,Z),K=K.substring(Z+1).trimStart();let V=Y;if(G){let B=Y.indexOf(":");if(B!==-1)Y=Y.substr(B+1),W=Y!==U.data.substr(B+1)}return{tagName:Y,tagExp:K,closeIndex:Q,attrExpPresent:W,rawTagName:V}}function Mo5($,z,G){let J=G,U=1,K=$.length;for(;G<K;G++)if($[G]==="<"){let Q=$.charCodeAt(G+1);if(Q===47){let Z=Ao5($,">",G,`${z} is not closed`);if($.substring(G+2,Z).trim()===z){if(U--,U===0)return{tagContent:$.substring(J,G),i:Z}}G=Z}else if(Q===63)G=GB($,"?>",G+1,"StopNode is not closed.");else if(Q===33&&$.charCodeAt(G+2)===45&&$.charCodeAt(G+3)===45)G=GB($,"-->",G+3,"StopNode is not closed.");else if(Q===33&&$.charCodeAt(G+2)===91)G=GB($,"]]>",G,"StopNode is not closed.")-2;else{let Z=Yt($,G,!1);if(Z){if((Z&&Z.tagName)===z&&Z.tagExp[Z.tagExp.length-1]!=="/")U++;G=Z.closeIndex}}}}function Vt($,z,G){if(z&&typeof $==="string"){let J=$.trim();if(J==="true")return!0;else if(J==="false")return!1;else return Qt($,G)}else if(lS2($))return $;else return""}function Wt($,z,G,J){if($){let U=$(z);if(G===z)G=U;z=U}return z=j_2(z,J),{tagName:z,tagExp:G}}function j_2($,z){if(su.includes($))throw Error(`[SECURITY] Invalid name: "${$}" is a reserved JavaScript keyword that could cause prototype pollution`);else if(UF.includes($))return z.onDangerousProperty($);return $}var Bt=Y9.getMetaDataSymbol();function Do5($,z){if(!$||typeof $!=="object")return{};if(!z)return $;let G={};for(let J in $)if(J.startsWith(z)){let U=J.substring(z.length);G[U]=$[J]}else G[J]=$[J];return G}function Lt($,z,G,J){return F_2($,z,G,J)}function F_2($,z,G,J){let U,K={};for(let Q=0;Q<$.length;Q++){let Z=$[Q],Y=Oo5(Z);if(Y!==void 0&&Y!==z.textNodeName){let W=Do5(Z[":@"]||{},z.attributeNamePrefix);G.push(Y,W)}if(Y===z.textNodeName)if(U===void 0)U=Z[Y];else U+=""+Z[Y];else if(Y===void 0)continue;else if(Z[Y]){let W=F_2(Z[Y],z,G,J),V=vo5(W,z);if(Object.keys(W).length===0&&z.alwaysCreateTextNode)W[z.textNodeName]="";if(Z[":@"])Io5(W,Z[":@"],J,z);else if(Object.keys(W).length===1&&W[z.textNodeName]!==void 0&&!z.alwaysCreateTextNode)W=W[z.textNodeName];else if(Object.keys(W).length===0)if(z.alwaysCreateTextNode)W[z.textNodeName]="";else W="";if(Z[Bt]!==void 0&&typeof W==="object"&&W!==null)W[Bt]=Z[Bt];if(K[Y]!==void 0&&Object.prototype.hasOwnProperty.call(K,Y)){if(!Array.isArray(K[Y]))K[Y]=[K[Y]];K[Y].push(W)}else{let B=z.jPath?J.toString():J;if(z.isArray(Y,B,V))K[Y]=[W];else K[Y]=W}if(Y!==void 0&&Y!==z.textNodeName)G.pop()}}if(typeof U==="string"){if(U.length>0)K[z.textNodeName]=U}else if(U!==void 0)K[z.textNodeName]=U;return K}function Oo5($){let z=Object.keys($);for(let G=0;G<z.length;G++){let J=z[G];if(J!==":@")return J}}function Io5($,z,G,J){if(z){let U=Object.keys(z),K=U.length;for(let Q=0;Q<K;Q++){let Z=U[Q],Y=Z.startsWith(J.attributeNamePrefix)?Z.substring(J.attributeNamePrefix.length):Z,W=J.jPath?G.toString()+"."+Y:G;if(J.isArray(Z,W,!0,!0))$[Z]=[z[Z]];else $[Z]=z[Z]}}}function vo5($,z){let{textNodeName:G}=z,J=Object.keys($).length;if(J===0)return!0;if(J===1&&($[G]||typeof $[G]==="boolean"||$[G]===0))return!0;return!1}class BF{constructor($){this.externalEntities={},this.options=B_2($)}parse($,z){if(typeof $!=="string"&&$.toString)$=$.toString();else if(typeof $!=="string")throw Error("XML data is accepted in String or Bytes[] form.");if(z){if(z===!0)z={};let U=oS2($,z);if(U!==!0)throw Error(`${U.err.msg}:${U.err.line}:${U.err.col}`)}let G=new GT(this.options,this.externalEntities),J=G.parseXml($);if(this.options.preserveOrder||J===void 0)return J;else return Lt(J,this.options,G.matcher,G.readonlyMatcher)}addEntity($,z){if(z.indexOf("&")!==-1)throw Error("Entity value can't have '&'");else if($.indexOf("&")!==-1||$.indexOf(";")!==-1)throw Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");else if(z==="&")throw Error("An entity with value '&' is not permitted");else this.externalEntities[$]=z}static getMetaDataSymbol(){return Y9.getMetaDataSymbol()}}A0();var Ro5=["/rss","/feed","/atom.xml","/rss.xml","/index.xml"],wo5=new BF({ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text"});function kt($){if($===void 0||$===null)return[];return Array.isArray($)?$:[$]}function K7($){if($==null)return;if(typeof $==="string")return $;if(typeof $==="object"){let z=$;if(typeof z["#text"]==="string")return z["#text"];if(typeof z["#cdata"]==="string")return z["#cdata"]}return}function q_2($){for(let z of kt($)){let G=z?.["@_href"],J=z?.["@_rel"];if(typeof G==="string"&&(J===void 0||J==="alternate"))return G}return}function N_2($){let z;try{z=wo5.parse($)}catch{return null}let G=z.rss;if(G){let U=G.channel;if(!U)return null;let K=kt(U.item);return{kind:"rss",title:K7(U.title),description:K7(U.description),link:K7(U.link),entries:K.map((Q)=>({title:K7(Q.title),link:K7(Q.link),pubDate:K7(Q.pubDate),description:K7(Q.description),content:K7(Q["content:encoded"])??K7(Q.content)}))}}let J=z.feed;if(J){let U=kt(J.entry);return{kind:"atom",title:K7(J.title),description:K7(J.subtitle),link:q_2(J.link),entries:U.map((K)=>({title:K7(K.title),link:q_2(K.link),pubDate:K7(K.published)??K7(K.updated),description:K7(K.summary),content:K7(K.content)??K7(K.summary)}))}}return null}async function A_2($,z){let G=performance.now(),J;try{let K=await F3($.toString(),{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(K.ok)J=DI(K.text).alternate?.[0]?.href}catch{}let U=new Set;if(J)try{U.add(new URL(J,$).toString())}catch{}for(let K of Ro5)U.add(new URL(K,`${$.protocol}//${$.host}`).toString());for(let K of U){if(z.signal?.aborted)break;try{let Q=await F3(K,{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(!Q.ok||Q.text.length<50)continue;let Z=N_2(Q.text);if(!Z||Z.entries.length===0)continue;return{url:$.toString(),status:"ok",strategy:"probe",platform:"rss",httpStatus:Q.status,content:Q.text,contentType:Q.headers.get("content-type")??void 0,elapsedMs:Math.round(performance.now()-G),signals:[],feedUrl:K,feed:Z}}catch{}}return{url:$.toString(),status:"not-found",strategy:"probe",platform:"rss",content:"",elapsedMs:Math.round(performance.now()-G),signals:[],error:"no RSS/Atom feed discovered"}}function M_2($,z="en-US"){let[G,J]=z.split("-"),U=new URL("https://news.google.com/rss/search");return U.searchParams.set("q",$),U.searchParams.set("hl",G??"en"),U.searchParams.set("gl",J??"US"),U.searchParams.set("ceid",`${J??"US"}:${G??"en"}`),U.toString()}AX();Lz();A0();var JT={"github.com":{domain:"github.com",level:"verified",score:0.95,tags:["code-host"],source:"registry"},"docs.github.com":{domain:"docs.github.com",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"developer.mozilla.org":{domain:"developer.mozilla.org",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"nextjs.org":{domain:"nextjs.org",level:"verified",score:0.9,tags:["vendor","lang-docs"],source:"registry"},"vercel.com":{domain:"vercel.com",level:"verified",score:0.9,tags:["vendor"],source:"registry"},"typescriptlang.org":{domain:"typescriptlang.org",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"stackoverflow.com":{domain:"stackoverflow.com",level:"community",score:0.7,tags:["qna"],source:"registry"},"dev.to":{domain:"dev.to",level:"external",score:0.4,tags:["blog"],source:"registry"},"medium.com":{domain:"medium.com",level:"external",score:0.35,tags:["blog"],source:"registry"},"npmjs.com":{domain:"npmjs.com",level:"verified",score:0.9,tags:["registry"],source:"registry"},"pypi.org":{domain:"pypi.org",level:"verified",score:0.9,tags:["registry"],source:"registry"},"news.ycombinator.com":{domain:"news.ycombinator.com",level:"community",score:0.65,tags:["news"],source:"registry"},"reddit.com":{domain:"reddit.com",level:"community",score:0.55,tags:["forum"],source:"registry"},"wikipedia.org":{domain:"wikipedia.org",level:"community",score:0.75,tags:["encyclopedia"],source:"registry"},"arxiv.org":{domain:"arxiv.org",level:"verified",score:0.9,tags:["academic"],source:"registry"},"doi.org":{domain:"doi.org",level:"verified",score:0.95,tags:["academic"],source:"registry"}};function uo5($){return $.replace(/^www\./,"")}function To5($){if($ in JT){let G=JT[$];return G?{...G}:null}let z=uo5($);if(z in JT){let G=JT[z];return G?{...G}:null}return null}function Eo5($){let z=$.split(".").pop();if(z==="gov"||z==="edu"||z==="mil")return{domain:$,level:"verified",score:0.9,tags:["institution"],source:"heuristic"};if(/\.gov\.[a-z]{2}$/.test($)||/\.ac\.[a-z]{2}$/.test($))return{domain:$,level:"verified",score:0.85,tags:["institution"],source:"heuristic"};return null}async function Po5($){try{let z=await F3(`https://tranco-list.eu/api/ranks/domain/${$}`,{timeoutMs:5000});if(!z.ok)return null;let J=JSON.parse(z.text).ranks?.[0]?.rank;if(!J)return null;let U=J<1e4?0.6:J<1e5?0.4:0.2;return{domain:$,level:J<1e4?"community":"external",score:U,tags:["tranco"],source:"tranco",rank:J}}catch{return null}}async function D_2($){let z=To5($);if(z)return z;let G=Eo5($);if(G)return G;let J=await Po5($);if(J)return J;return{domain:$,level:"unknown",score:null,tags:[],source:"heuristic"}}var O_2=["api","probe","impersonate","browser","archive"];function I_2($){if(!$)return;let z=$.split(",").map((J)=>J.trim()).filter(Boolean),G=z.filter((J)=>!O_2.includes(J));if(G.length>0)throw Error(`Unknown strategy: ${G.join(", ")}. Valid: ${O_2.join(", ")}`);return z}function JB($){try{return new URL($)}catch{throw Error(`Invalid URL: ${$}`)}}function CJ($){return{timeoutMs:$.timeout?Math.max(1000,Math.floor(Number($.timeout)*1000)):15000,locale:$.locale??"en-US,en;q=0.9"}}function kz($,z){if(z)console.log(JSON.stringify($,null,2));else console.log(JSON.stringify($))}function LQ($){if(!$){process.exitCode=1;return}if($.status==="ok")process.exitCode=0;else if($.status==="blocked")process.exitCode=2;else if($.status==="not-found")process.exitCode=3;else if($.status==="invalid-input")process.exitCode=4;else if($.status==="auth-required")process.exitCode=5;else if($.status==="timeout")process.exitCode=6;else process.exitCode=1}function v_2($){let z=$.command("search").description("Mechanical search primitives — fetch, meta, rss, media, trust, code").alias("s");z.command("fetch <url>").description("Fetch URL via auto-escalating strategy pipeline").option("--only <strategies>","Comma-separated strategies to run").option("--skip <strategies>","Comma-separated strategies to skip").option("--include-archive","Include archive strategy as last fallback").option("--timeout <seconds>","Per-strategy timeout","15").option("--locale <value>","Accept-Language header","en-US,en;q=0.9").option("--pretty","Pretty-print JSON output").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=await cS2(U,K,{only:I_2(J.only),skip:I_2(J.skip),includeArchive:J.includeArchive});kz(Q,Boolean(J.pretty)),LQ(Q)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("api <url>").description("Fetch via matched platform API (Phase 0)").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G);if(!ki(U)){console.error(n0.default.yellow(`No API handler matches host ${U.hostname}`)),process.exitCode=3;return}let Q=CJ(J),Z=await VO(U,Q);if(!Z){process.exitCode=3;return}kz(Z,Boolean(J.pretty)),LQ(Z)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("api:search <query>").description("Fan-out keyword search across platforms that support it").option("--platforms <list>","Comma-separated platform ids").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=CJ(J),K=J.platforms?J.platforms.split(",").map((Z)=>Z.trim()).filter(Boolean):void 0,Q=await vG(G,U,K);kz(Q,Boolean(J.pretty))}),z.command("meta <url>").description("Extract OGP / JSON-LD / Schema.org from URL").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=await uX2(U,K),{content:Z,...Y}=Q;kz(Y,Boolean(J.pretty)),LQ(Q)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("rss <url>").description("Discover and parse RSS/Atom feed for a URL").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=await A_2(U,K),{content:Z,...Y}=Q;kz(Y,Boolean(J.pretty)),LQ(Q)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("rss:google <query>").description("Build Google News RSS URL for a query").option("--locale <value>","Locale (e.g., ko-KR)","en-US").action((G,J)=>{let U=M_2(G,J.locale??"en-US");console.log(U)}),z.command("media <url>").description("Extract media metadata via yt-dlp (1858 sites)").option("--subs","Write subtitles").option("--sub-lang <list>","Subtitle languages (comma-separated)","en").option("--format <spec>","yt-dlp format spec").option("--timeout <seconds>","Timeout","30").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=J.subLang?J.subLang.split(",").map((Y)=>Y.trim()).filter(Boolean):void 0,Z=await RX2(U,K,{subtitles:J.subs,...Q?{subLangs:Q}:{},...J.format?{format:J.format}:{}});kz(Z,Boolean(J.pretty)),LQ(Z)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("archive <url>").description("Fetch via AMP / archive.today / Wayback").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=JB(G),K=CJ(J),Q=await pX(U,K);kz(Q,Boolean(J.pretty)),LQ(Q)}catch(U){console.error(n0.default.red(U.message)),process.exitCode=1}}),z.command("trust <domain>").description("Resolve trust level / score for a domain").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=await D_2(G.toLowerCase());kz(U,Boolean(J.pretty))}),z.command("code <query>").description("Search code via gh / glab").option("--host <github|gitlab>","Host","github").option("--language <lang>","Language filter").option("--repo <owner/repo>","Scope to a repo").option("--limit <n>","Max results","20").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=J.host==="gitlab"||J.host==="github"?J.host:"github",K=CJ({}),Q=await vX2(G,K,{host:U,...J.language?{language:J.language}:{},...J.repo?{repo:J.repo}:{},...J.limit?{limit:Number.parseInt(J.limit,10)}:{}});kz(Q,Boolean(J.pretty)),LQ(Q)}),z.command("doctor").description("Check dependencies (Chrome, python3 curl_cffi, yt-dlp, gh)").action(async()=>{let G=[],J=R6();G.push({name:"chrome",ok:Boolean(J),detail:J??"Install Chrome or set OMA_CHROME_PATH"}),G.push(await Xt("python3",["--version"])),G.push(await Co5()),G.push(await Xt("yt-dlp",["--version"])),G.push(await Xt("gh",["--version"]));for(let U of G){let K=U.ok?n0.default.green("✓"):n0.default.yellow("!");console.log(`${K} ${U.name}: ${U.detail}`)}if(G.some((U)=>!U.ok))process.exitCode=1})}async function Xt($,z){return new Promise((G)=>{let{spawn:J}=Z2("node:child_process"),U=J($,z,{stdio:["ignore","pipe","pipe"]}),K="";U.stdout?.on("data",(Q)=>{K+=Q.toString()}),U.on("error",()=>G({name:$,ok:!1,detail:"not found"})),U.on("close",(Q)=>{if(Q===0)G({name:$,ok:!0,detail:K.trim()});else G({name:$,ok:!1,detail:`exit code ${Q}`})})})}async function Co5(){return new Promise(($)=>{let{spawn:z}=Z2("node:child_process"),G=z("python3",["-c","import curl_cffi; print(curl_cffi.__version__)"],{stdio:["ignore","pipe","pipe"]}),J="";G.stdout?.on("data",(U)=>{J+=U.toString()}),G.on("error",()=>$({name:"curl_cffi",ok:!1,detail:"python3 not found"})),G.on("close",(U)=>{if(U===0)$({name:"curl_cffi",ok:!0,detail:`v${J.trim()}`});else $({name:"curl_cffi",ok:!1,detail:"not installed (pip install curl_cffi)"})})})}function R_2($){let z=$.command("skills").description("Inspect and audit installed skills");Z1(z.command("audit").description("Check frontmatter description similarity between installed skills"),"Output as JSON for CI/CD").action(z5((G)=>{qQ2(G1(G))},{supportsJsonOutput:!0}))}var Q6=i2(C5(),1);var E6=i2(C5(),1);import{existsSync as Ot,mkdirSync as to5,readFileSync as It,writeFileSync as eo5}from"node:fs";import{dirname as $r5,join as WT,resolve as zr5}from"node:path";var bo5=/\.slide(?![\w-])/g,yo5=new Set(["media","supports","container","layer"]);function So5($){let z=[],G="",J=0,U="",K=!1;for(let Q=0;Q<$.length;Q++){let Z=$[Q];if(!K)if(Z==="{")K=!0,J=1,U="";else if(Z===";"){let Y=G.trim();if(Y)z.push({prelude:`${Y};`});G=""}else G+=Z;else if(Z==="{")J++,U+=Z;else if(Z==="}")if(J--,J===0)z.push({prelude:G.trim(),body:U}),G="",U="",K=!1;else U+=Z;else U+=Z}return z}function _o5($){let z=[],G="",J=0;for(let U of $){if(U==="(")J++;else if(U===")")J=Math.max(0,J-1);if(U===","&&J===0)z.push(G),G="";else G+=U}if(G.trim())z.push(G);return z}function xo5($,z){let G=$.trim();if(!G)return G;if(G===":root"||G==="html"||G==="body")return z;let J=G.replace(bo5,z);return J.includes(z)?J:`${z} ${J}`}function w_2($,z){let G=`#${z}`,J=[];for(let U of So5($)){if(U.body===void 0){J.push(U.prelude);continue}if(U.prelude.startsWith("@")){let Q=(/^@([\w-]+)/.exec(U.prelude)?.[1]??"").toLowerCase();if(yo5.has(Q))J.push(`${U.prelude} {
|
|
1752
1752
|
${w_2(U.body,z)}
|
|
1753
1753
|
}`);else J.push(`${U.prelude} {${U.body}}`);continue}let K=_o5(U.prelude).map((Q)=>xo5(Q,G)).join(", ");J.push(`${K} {${U.body}}`)}return J.join(`
|
|
1754
1754
|
`)}function UT($){return(/<section[^>]*\bclass="[^"]*\bslide\b[^"]*"[^>]*\bid="([^"]+)"/i.exec($)??/<section[^>]*\bid="([^"]+)"[^>]*\bclass="[^"]*\bslide\b/i.exec($))?.[1]??null}function KT($,z){return $.map((G)=>{let J=/^<style([^>]*)>([\s\S]*)<\/style>$/i.exec(G.trim());if(!J)return G;let U=J[1]??"",K=J[2]??"";return`<style${U}>
|
|
@@ -1866,6 +1866,13 @@ ${G}
|
|
|
1866
1866
|
overflow: hidden;
|
|
1867
1867
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
1868
1868
|
}
|
|
1869
|
+
|
|
1870
|
+
@media print {
|
|
1871
|
+
body {
|
|
1872
|
+
background: transparent;
|
|
1873
|
+
overflow: visible;
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1869
1876
|
</style>
|
|
1870
1877
|
</head>
|
|
1871
1878
|
<body>
|
|
@@ -1921,6 +1928,13 @@ ${G}
|
|
|
1921
1928
|
overflow: hidden;
|
|
1922
1929
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
1923
1930
|
}
|
|
1931
|
+
|
|
1932
|
+
@media print {
|
|
1933
|
+
body {
|
|
1934
|
+
background: transparent;
|
|
1935
|
+
overflow: visible;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1924
1938
|
</style>
|
|
1925
1939
|
</head>
|
|
1926
1940
|
<body>
|
|
@@ -2007,7 +2021,7 @@ data: ${z}
|
|
|
2007
2021
|
'box-sizing:border-box'
|
|
2008
2022
|
].join(';');
|
|
2009
2023
|
document.body.appendChild(div);
|
|
2010
|
-
})()`),`data:image/png;base64,${
|
|
2024
|
+
})()`),`data:image/png;base64,${await K.screenshot({type:"png",clip:{x:0,y:0,width:m_2,height:i_2},encoding:"base64"})}`}finally{await K.close().catch(()=>{}),await U.close().catch(()=>{})}}function c_2($){if(typeof $!=="object"||$===null)return!1;let z=$;return typeof z.x==="number"&&typeof z.y==="number"&&typeof z.width==="number"&&typeof z.height==="number"&&z.width>0&&z.height>0}async function l_2($){let z;try{z=P7($.dir)}catch(j){return console.error(c8.default.red(j.message)),4}let{dir:G,meta:J}=z,U=$.port??0,K=U>0?U:Mr5,Q;try{Q=await Ir5(K)}catch(j){return console.error(c8.default.red(j.message)),1}let Z=(()=>{try{return Xz(Ar5(new URL(".",import.meta.url)),"ui")}catch{return Xz(process.cwd(),"cli","commands","slide","editor","ui")}})(),Y=Xz(Z,"editor.html"),W=(j)=>{let F=J.order.map((q,N)=>({file:q,index:N,path:Xz(G,q),exists:QB(Xz(G,q))}));m3(j,200,{title:J.title,slideCount:F.length,slides:F})},V=(j,F)=>{try{KB(F)}catch(N){WB(j,400,"text/plain",N.message);return}let q=Xz(G,F);if(!QB(q)){WB(j,404,"text/plain",`Slide not found: ${F}`);return}WB(j,200,"text/html; charset=utf-8",f_2(q,"utf8"))},B=async(j,F)=>{let{slideFile:q,bbox:N}=F;if(typeof q!=="string"){m3(j,400,{error:"slideFile must be a string"});return}try{KB(q)}catch(M){m3(j,400,{error:M.message});return}if(!c_2(N)){m3(j,400,{error:"bbox must be { x, y, width, height } with positive dimensions"});return}let A=Xz(G,q);if(!QB(A)){m3(j,404,{error:`Slide not found: ${q}`});return}try{let M=await ur5(A,N);m3(j,200,{dataUrl:M})}catch(M){m3(j,500,{error:M.message})}},k=(j,F)=>{let{slideFile:q,bbox:N,prompt:A}=F;if(typeof q!=="string"){m3(j,400,{error:"slideFile must be a string"});return}try{KB(q)}catch(O){m3(j,400,{error:O.message});return}if(!c_2(N)){m3(j,400,{error:"bbox must be { x, y, width, height } with positive dimensions"});return}if(typeof A!=="string"||A.trim().length===0){m3(j,400,{error:"prompt must be a non-empty string"});return}let M=Xz(G,q);if(!QB(M)){m3(j,404,{error:`Slide not found: ${q}`});return}let I=`edit-${Date.now()}`;m3(j,200,{editId:I,status:"dispatched"}),vr5(q,()=>new Promise((O)=>{g_2({workDir:G,slideFile:q,bbox:N,prompt:A.trim(),onProgress:(D)=>{ZB("progress",D.replace(/\n/g,"\\n"))},onDone:(D)=>{ZB("done",String(D)),O()},onError:(D)=>{ZB("progress",`[error] ${D.message}`),ZB("done","1"),O()}})})).catch((O)=>{ZB("progress",`[lock error] ${O.message}`),ZB("done","1")})},L=(j,F)=>{F.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","X-Accel-Buffering":"no"});let q={res:F,editId:String(Date.now())};kQ.add(q);let N=setInterval(()=>{try{F.write(`: heartbeat
|
|
2011
2025
|
|
|
2012
2026
|
`)}catch{clearInterval(N),kQ.delete(q)}},15000),A=()=>{clearInterval(N),kQ.delete(q)};j.on("close",A),F.on("close",A)},X=(j,F)=>{let q=F.slideFile;if(typeof q!=="string"){m3(j,400,{error:"slideFile must be a string"});return}try{KB(q)}catch(A){m3(j,400,{error:A.message});return}let N=Xz(G,q);if(!QB(N)){m3(j,404,{error:`Slide not found: ${q}`});return}m3(j,200,{ok:!0,file:q,path:N})},H=async(j,F)=>{let q=j.method??"GET",A=new URL(j.url??"/",`http://${VT}`).pathname;if(q==="GET"&&A==="/"){if(QB(Y))WB(F,200,"text/html; charset=utf-8",f_2(Y,"utf8"));else WB(F,500,"text/plain","Editor UI not found");return}if(q==="GET"&&A==="/slides"){W(F);return}if(q==="GET"&&A.startsWith("/slide-file/")){V(F,decodeURIComponent(A.slice(12)));return}if(q==="GET"&&A==="/events"){L(j,F);return}if(q==="POST"&&A==="/screenshot"){await B(F,await vt(j));return}if(q==="POST"&&A==="/edit"){k(F,await vt(j));return}if(q==="POST"&&A==="/save"){X(F,await vt(j));return}WB(F,404,"text/plain","Not found")};return new Promise((j)=>{let F=qr5((N,A)=>{H(N,A).catch((M)=>{try{m3(A,500,{error:M.message})}catch{}})});F.listen(Q,VT,()=>{let N=`http://${VT}:${Q}`;console.log(c8.default.bold(`
|
|
2013
2027
|
oma slide editor`)),console.log(c8.default.green(` Listening: ${N}`)),console.log(c8.default.dim(` Workspace: ${G}`)),console.log(c8.default.dim(` Slides: ${J.order.length}`)),console.log(c8.default.dim(` Press Ctrl+C to stop.
|
|
@@ -2232,7 +2246,7 @@ Fetched and cached design.md for "${z}"`)),console.log(M5.default.dim(` Cached
|
|
|
2232
2246
|
`);if(e2(X,"Overview"),L.totalSpawns>0){let j=Object.entries(L.byVendor).sort(([,q],[,N])=>N.tokens-q.tokens).map(([q,N])=>` ${q.padEnd(12)} ${Ri2(N.tokens).padStart(12)} tokens · ${String(N.spawns).padStart(3)} spawns · ${wi2(N.usd).padStart(7)}`),F=[Y7.default.bold("\uD83D\uDCB0 Cost Telemetry (all sessions)"),"┌─────────────────────┬──────────────┐",`│ ${Y7.default.bold("Metric")} │ ${Y7.default.bold("Value")} │`,"├─────────────────────┼──────────────┤",`│ Total tokens (est.) │ ${Ri2(L.totalTokens).padEnd(12)} │`,`│ Total spawns │ ${String(L.totalSpawns).padEnd(12)} │`,`│ Estimated USD │ ${wi2(L.estimatedUsd).padEnd(12)} │`,"└─────────────────────┴──────────────┘",Y7.default.dim("By vendor (sorted by tokens):"),...j,Y7.default.dim("Estimate is input-only (prompt char approximation); output tokens not yet tracked."),Y7.default.dim("Configure session.quota_cap in .agents/oma-config.yaml to enforce budgets.")].join(`
|
|
2233
2247
|
`);e2(F,"Cost")}let H=Object.entries(U.skillsUsed).sort(([,j],[,F])=>F-j).slice(0,5);if(H.length>0){let j=[Y7.default.bold("\uD83C\uDFC6 Top Skills Used"),...H.map(([F,q],N)=>` ${N+1}. ${F} (${q})`)].join(`
|
|
2234
2248
|
`);e2(j,"Skills")}O5(Y7.default.dim(`Data stored in: ${J}`))}function Ei2($){Z1($.command("stats").description("View productivity metrics").option("--reset","Reset metrics data")).action(z5(async(z)=>{await Ti2(G1(z),z.reset)},{supportsJsonOutput:!0}))}H7();var Q8=i2(C5(),1);import*as o8 from"node:fs";import*as c3 from"node:path";var k64="oma-config.yaml",X64="mcp.json",H64="<!-- oma:generated -->";function yQ($){try{let z=o8.lstatSync($);if(z.isSymbolicLink())return"symlink";if(z.isDirectory())return"dir";return"file"}catch{return null}}function j64($){try{return o8.readFileSync($,"utf-8").includes(H64)}catch{return!1}}function d22($){try{return o8.readdirSync($,{withFileTypes:!0})}catch{return[]}}function F64($){let z=[],G=[],J=c3.join($,T1);for(let V of d22(J)){let B=c3.join(J,V.name),k=yQ(B);if(k===null)continue;let L;if(V.name==="_version.json")L="oma install metadata (saveLocalVersion)";else if(V.name==="_shared")L="shared assets (installShared)";else L="skill directory (installSkill)";z.push({path:B,kind:k,reason:L})}let U=c3.join($,".agents","workflows");if(yQ(U)==="dir")z.push({path:U,kind:"dir",reason:"created by installWorkflows"});let K=c3.join($,".agents","rules");if(yQ(K)==="dir")z.push({path:K,kind:"dir",reason:"created by installRules"});let Q=c3.join($,".agents","config");if(yQ(Q)==="dir")z.push({path:Q,kind:"dir",reason:"created by installConfigs"});let Z=c3.join($,".agents",k64);if(yQ(Z)!==null)G.push({path:Z,kind:"file",reason:"user preferences"});let Y=c3.join($,".agents",X64);if(yQ(Y)!==null)G.push({path:Y,kind:"file",reason:"may contain user MCP servers"});for(let[V,B]of Object.entries(Z8)){let L=i7()==="global"?B.homePath:B.projectPath,X=c3.join($,L);for(let H of d22(X)){let j=c3.join(X,H.name),F=yQ(j);if(F===null)continue;if(F==="symlink")z.push({path:j,kind:"symlink",reason:`created by createVendorSymlinks (${V})`});else G.push({path:j,kind:F,reason:"user-authored skill"})}}let W=c3.join($,".github","prompts");for(let V of d22(W)){if(!V.isFile()||!V.name.endsWith(".prompt.md"))continue;let B=c3.join(W,V.name);if(j64(B))z.push({path:B,kind:"file",reason:"generated by installCopilotWorkflowPrompts (oma:generated)"})}return{omaOwned:z,userOwned:G}}function Pi2($,z){let G=c3.relative(z,$);return c3.join("<root>",G)}function q64($,z,G){let J=$.length===0?[Q8.default.dim(" (nothing to remove)")]:$.map((Q)=>` ${Q8.default.red("✗")} ${Pi2(Q.path,G).padEnd(55)} ${Q8.default.dim(`(${Q.kind}, ${Q.reason})`)}`),U=z.length===0?[Q8.default.dim(" (none)")]:z.map((Q)=>` ${Q8.default.green("✓")} ${Pi2(Q.path,G).padEnd(55)} ${Q8.default.dim(`(${Q.reason})`)}`),K=[Q8.default.bold("The following oma-owned entries will be removed:"),...J,"",Q8.default.bold("The following user-owned entries will be preserved:"),...U].join(`
|
|
2235
|
-
`);e2(K,"Uninstall preview")}function N64($){for(let G of $){if(G.kind!=="symlink")continue;try{o8.unlinkSync(G.path)}catch{}}for(let G of $){if(G.kind!=="file")continue;try{o8.unlinkSync(G.path)}catch{}}let z=$.filter((G)=>G.kind==="dir").sort((G,J)=>J.path.split(c3.sep).length-G.path.split(c3.sep).length);for(let G of z)try{o8.rmSync(G.path,{recursive:!0,force:!0})}catch{}}async function Ci2($={}){let z=yZ(),G=$.yes===!0||process.env.OMA_YES==="1"||process.env.CI==="true"||process.env.CI==="1",{omaOwned:J,userOwned:U}=F64(z);if(q64(J,U,z),$.dryRun){O5(Q8.default.yellow("Dry-run — no files were changed."));return}if(J.length===0){O5(Q8.default.dim("Nothing to remove."));return}if(!G){let K=await _1({message:`Remove ${J.length} oma-owned entries from ${z}?`,initialValue:!1});if($4(K)||!K){c4("Uninstall cancelled.");return}}N64(J),O5(Q8.default.green("Uninstall complete. User-owned files were preserved."))}function bi2($){$.command("uninstall").description("Remove oh-my-agent's owned files (preserves oma-config.yaml, mcp.json, and user-authored skills)").option("--dry-run","Preview what would be removed without deleting").option("-y, --yes","Skip confirmation prompt").action(z5(async(z)=>{let G=$.opts();await Ci2({yes:z.yes,dryRun:z.dryRun,global:G.global})}))}H7();var Q1=i2(C5(),1);import{execSync as hi2}from"node:child_process";import{cpSync as OE,existsSync as vz,mkdirSync as p22,readFileSync as IE,rmSync as a22,writeFileSync as o22}from"node:fs";import{homedir as u64,tmpdir as T64}from"node:os";import{join as b7}from"node:path";var ME=i2(C5(),1);import{execSync as A64,spawn as M64}from"node:child_process";import{realpathSync as yi2}from"node:fs";import Zq from"node:process";var SQ="oh-my-agent";function D64($=Zq.argv[1]){if(!$)return{packageManager:"unknown",isGlobal:!1};if(Zq.env.IS_BINARY==="true")return{packageManager:"binary",isGlobal:!0,updateMessage:"Running as a standalone binary. Download the latest release from GitHub."};let z;try{z=k8(yi2($))}catch{return{packageManager:"unknown",isGlobal:!1}}if(z.includes("/.npm/_npx")||z.includes("/npm/_npx"))return{packageManager:"npx",isGlobal:!1,updateMessage:"Running via npx, auto-update not applicable."};if(z.includes("/.pnpm/_pnpx")||z.includes("/.cache/pnpm/dlx"))return{packageManager:"pnpx",isGlobal:!1,updateMessage:"Running via pnpx, auto-update not applicable."};if(z.includes("/.bun/install/cache"))return{packageManager:"bunx",isGlobal:!1,updateMessage:"Running via bunx, auto-update not applicable."};if(Zq.platform==="darwin")try{let G=A64(`brew --prefix ${SQ}`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(G){let J=k8(yi2(G));if(z.startsWith(J))return{packageManager:"homebrew",isGlobal:!0,updateCommand:`brew upgrade ${SQ}`,updateMessage:"Installed via Homebrew. Updating in background..."}}}catch{}if(z.includes("/.pnpm/global")||z.includes("/.local/share/pnpm"))return{packageManager:"pnpm",isGlobal:!0,updateCommand:`pnpm add -g ${SQ}@latest`,updateMessage:"Installed via pnpm. Updating in background..."};if(z.includes("/.yarn/global"))return{packageManager:"yarn",isGlobal:!0,updateCommand:`yarn global add ${SQ}@latest`,updateMessage:"Installed via yarn. Updating in background..."};if(z.includes("/.bun/install/global"))return{packageManager:"bun",isGlobal:!0,updateCommand:`bun add -g ${SQ}@latest`,updateMessage:"Installed via bun. Updating in background..."};return{packageManager:"npm",isGlobal:!0,updateCommand:`npm install -g ${SQ}@latest`,updateMessage:"Installed via npm. Updating in background..."}}var Si2=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/;function O64($,z){let G=$.match(Si2),J=z.match(Si2);if(!G||!J)return!1;for(let U=1;U<=3;U++){let K=Number(G[U]),Q=Number(J[U]);if(K<Q)return!0;if(K>Q)return!1}return!1}async function I64($=SQ,z=2000){try{let G=await D8.get(`https://registry.npmjs.org/${$}/latest`,{timeout:z});return typeof G.data?.version==="string"?G.data.version:null}catch{return null}}async function _i2($){if(!$.enabled)return{triggered:!1,reason:"disabled"};if(Zq.env.OMA_SKIP_VERSION_CHECK==="1")return{triggered:!1,reason:"skipped-env"};if(Zq.env.NODE_ENV==="development")return{triggered:!1,reason:"skipped-env"};let z=await I64();if(!z)return{triggered:!1,reason:"fetch-failed"};if(!O64($.currentVersion,z))return{triggered:!1,reason:"up-to-date",latest:z};let G=D64();if(!G.updateCommand)return $.onNotice?.(ME.default.yellow(`global oh-my-agent ${$.currentVersion} → ${z} available. ${G.updateMessage??"Update manually."}`)),{triggered:!1,reason:"non-upgradable",latest:z};try{return M64(G.updateCommand,{stdio:"ignore",shell:!0,detached:!0}).unref(),$.onSpawnStart?.(ME.default.cyan(`global oh-my-agent ${$.currentVersion} → ${z} updating in background. New version applies on next run.`)),{triggered:!0,latest:z}}catch{return $.onNotice?.(ME.default.yellow(`global oh-my-agent ${$.currentVersion} → ${z} available. Run: ${G.updateCommand}`)),{triggered:!1,reason:"spawn-failed",latest:z}}}var DE={name:"oh-my-agent",version:"8.
|
|
2249
|
+
`);e2(K,"Uninstall preview")}function N64($){for(let G of $){if(G.kind!=="symlink")continue;try{o8.unlinkSync(G.path)}catch{}}for(let G of $){if(G.kind!=="file")continue;try{o8.unlinkSync(G.path)}catch{}}let z=$.filter((G)=>G.kind==="dir").sort((G,J)=>J.path.split(c3.sep).length-G.path.split(c3.sep).length);for(let G of z)try{o8.rmSync(G.path,{recursive:!0,force:!0})}catch{}}async function Ci2($={}){let z=yZ(),G=$.yes===!0||process.env.OMA_YES==="1"||process.env.CI==="true"||process.env.CI==="1",{omaOwned:J,userOwned:U}=F64(z);if(q64(J,U,z),$.dryRun){O5(Q8.default.yellow("Dry-run — no files were changed."));return}if(J.length===0){O5(Q8.default.dim("Nothing to remove."));return}if(!G){let K=await _1({message:`Remove ${J.length} oma-owned entries from ${z}?`,initialValue:!1});if($4(K)||!K){c4("Uninstall cancelled.");return}}N64(J),O5(Q8.default.green("Uninstall complete. User-owned files were preserved."))}function bi2($){$.command("uninstall").description("Remove oh-my-agent's owned files (preserves oma-config.yaml, mcp.json, and user-authored skills)").option("--dry-run","Preview what would be removed without deleting").option("-y, --yes","Skip confirmation prompt").action(z5(async(z)=>{let G=$.opts();await Ci2({yes:z.yes,dryRun:z.dryRun,global:G.global})}))}H7();var Q1=i2(C5(),1);import{execSync as hi2}from"node:child_process";import{cpSync as OE,existsSync as vz,mkdirSync as p22,readFileSync as IE,rmSync as a22,writeFileSync as o22}from"node:fs";import{homedir as u64,tmpdir as T64}from"node:os";import{join as b7}from"node:path";var ME=i2(C5(),1);import{execSync as A64,spawn as M64}from"node:child_process";import{realpathSync as yi2}from"node:fs";import Zq from"node:process";var SQ="oh-my-agent";function D64($=Zq.argv[1]){if(!$)return{packageManager:"unknown",isGlobal:!1};if(Zq.env.IS_BINARY==="true")return{packageManager:"binary",isGlobal:!0,updateMessage:"Running as a standalone binary. Download the latest release from GitHub."};let z;try{z=k8(yi2($))}catch{return{packageManager:"unknown",isGlobal:!1}}if(z.includes("/.npm/_npx")||z.includes("/npm/_npx"))return{packageManager:"npx",isGlobal:!1,updateMessage:"Running via npx, auto-update not applicable."};if(z.includes("/.pnpm/_pnpx")||z.includes("/.cache/pnpm/dlx"))return{packageManager:"pnpx",isGlobal:!1,updateMessage:"Running via pnpx, auto-update not applicable."};if(z.includes("/.bun/install/cache"))return{packageManager:"bunx",isGlobal:!1,updateMessage:"Running via bunx, auto-update not applicable."};if(Zq.platform==="darwin")try{let G=A64(`brew --prefix ${SQ}`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(G){let J=k8(yi2(G));if(z.startsWith(J))return{packageManager:"homebrew",isGlobal:!0,updateCommand:`brew upgrade ${SQ}`,updateMessage:"Installed via Homebrew. Updating in background..."}}}catch{}if(z.includes("/.pnpm/global")||z.includes("/.local/share/pnpm"))return{packageManager:"pnpm",isGlobal:!0,updateCommand:`pnpm add -g ${SQ}@latest`,updateMessage:"Installed via pnpm. Updating in background..."};if(z.includes("/.yarn/global"))return{packageManager:"yarn",isGlobal:!0,updateCommand:`yarn global add ${SQ}@latest`,updateMessage:"Installed via yarn. Updating in background..."};if(z.includes("/.bun/install/global"))return{packageManager:"bun",isGlobal:!0,updateCommand:`bun add -g ${SQ}@latest`,updateMessage:"Installed via bun. Updating in background..."};return{packageManager:"npm",isGlobal:!0,updateCommand:`npm install -g ${SQ}@latest`,updateMessage:"Installed via npm. Updating in background..."}}var Si2=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/;function O64($,z){let G=$.match(Si2),J=z.match(Si2);if(!G||!J)return!1;for(let U=1;U<=3;U++){let K=Number(G[U]),Q=Number(J[U]);if(K<Q)return!0;if(K>Q)return!1}return!1}async function I64($=SQ,z=2000){try{let G=await D8.get(`https://registry.npmjs.org/${$}/latest`,{timeout:z});return typeof G.data?.version==="string"?G.data.version:null}catch{return null}}async function _i2($){if(!$.enabled)return{triggered:!1,reason:"disabled"};if(Zq.env.OMA_SKIP_VERSION_CHECK==="1")return{triggered:!1,reason:"skipped-env"};if(Zq.env.NODE_ENV==="development")return{triggered:!1,reason:"skipped-env"};let z=await I64();if(!z)return{triggered:!1,reason:"fetch-failed"};if(!O64($.currentVersion,z))return{triggered:!1,reason:"up-to-date",latest:z};let G=D64();if(!G.updateCommand)return $.onNotice?.(ME.default.yellow(`global oh-my-agent ${$.currentVersion} → ${z} available. ${G.updateMessage??"Update manually."}`)),{triggered:!1,reason:"non-upgradable",latest:z};try{return M64(G.updateCommand,{stdio:"ignore",shell:!0,detached:!0}).unref(),$.onSpawnStart?.(ME.default.cyan(`global oh-my-agent ${$.currentVersion} → ${z} updating in background. New version applies on next run.`)),{triggered:!0,latest:z}}catch{return $.onNotice?.(ME.default.yellow(`global oh-my-agent ${$.currentVersion} → ${z} available. Run: ${G.updateCommand}`)),{triggered:!1,reason:"spawn-failed",latest:z}}}var DE={name:"oh-my-agent",version:"8.11.0",description:"Portable multi-agent harness for .agents-based skills and workflows across Antigravity, Claude Code, Codex, OpenCode, and more",type:"module",bin:{"oh-my-agent":"./bin/cli.js",oma:"./bin/cli.js"},files:["bin"],keywords:["oh-my-agent","antigravity",".agents","agent","skills","agent-skills","multi-agent","orchestrator","claude","claude-code","codex","opencode","copilot","cursor","chatgpt","pm","frontend","backend","mobile","qa","debug","terraform","database","workflow","bug-fixing","gemini"],author:"our.first.fluke <our.first.fluke@gmail.com>",contributors:["gracefullight <gracefullight.dev@gmail.com>","gahyun-git <go4it.gh@gmail.com>"],license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/first-fluke"},{type:"buymeacoffee",url:"https://buymeacoffee.com/firstfluke"}],scripts:{"sync:readme":"node ./scripts/sync-readme.mjs","generate:skill-data":"node ./scripts/generate-skill-data.mjs",build:"bun run generate:skill-data && bun run sync:readme && bun build cli.ts --outfile bin/cli.js --target node --minify --external @napi-rs/keyring",dev:"bun run generate:skill-data && bun run cli.ts",lint:"biome check .","lint:fix":"biome check --write --unsafe .","check:boundaries":"node ./scripts/check-boundaries.mjs",test:"vitest run","test:coverage":"vitest run --coverage",prepublishOnly:"bun run build"},dependencies:{"@clack/prompts":"^1.1.0","@date-fns/tz":"^1.4.1","@napi-rs/keyring":"^1.3.0",axios:"^1.15.0","better-sqlite3":"^12.9.0",chokidar:"^5.0.0",commander:"^14.0.3","date-fns":"^4.2.1",eld:"^2.0.3","fast-xml-parser":"^5",minimatch:"^10.2.5","p-map":"^7.0.4",picocolors:"^1.1.1","puppeteer-core":"^24",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-parse":"^11.0.0","smol-toml":"^1.6.1",unified:"^11.0.5",ws:"^8.18.0",yaml:"^2.8.2",zod:"^4.3.6"},optionalDependencies:{pptxgenjs:"^3.12.0"},devDependencies:{"@biomejs/biome":"^2.4.15","@types/better-sqlite3":"^7.6.13","@types/mdast":"^4.0.4","@types/node":"^24","@types/ws":"^8.18.1","@vitest/coverage-v8":"^4.1.4",typescript:"^6",vitest:"^4.0.18"},repository:{type:"git",url:"https://github.com/first-fluke/oh-my-agent"},antigravity:{skillsPath:".agents/skills",skills:["oma-architecture","oma-brainstorm","oma-coordination","oma-pm","oma-frontend","oma-backend","oma-db","oma-mobile","oma-qa","oma-debug","oma-orchestrator","oma-dev-workflow","oma-tf-infra","oma-scm","oma-pdf","oma-recap"]}};function R64(){if((process.env.LANG??"").toLowerCase().startsWith("ko"))return"ko";return"en"}var w64={"install.sudoRefused":{en:"Refusing to install under sudo. Re-run as the target user.",ko:"sudo로는 설치할 수 없습니다. 대상 사용자로 다시 실행하세요."},"install.cwdHomeWarn":{en:"Running in your HOME directory without --global. This will scatter files in ~/. Are you sure?",ko:"HOME 디렉토리에서 --global 없이 실행 중입니다. ~/ 에 파일이 흩어집니다. 진행할까요?"},"install.ciGlobalWarn":{en:"Running `oma install --global` in CI. This will modify the CI user's HOME.",ko:"CI에서 `oma install --global`을 실행합니다. CI 사용자의 HOME을 수정합니다."},"install.wslHomeInfo":{en:"WSL detected. $HOME is distinct from Windows %USERPROFILE%; oma installs only to the WSL HOME. To install on the Windows side, run from PowerShell.",ko:"WSL이 감지됐습니다. $HOME은 Windows %USERPROFILE%과 다릅니다; oma는 WSL HOME에만 설치합니다. Windows 쪽에 설치하려면 PowerShell에서 실행하세요."},"install.firstGlobalIntro":{en:"This is your first global install of oh-my-agent.",ko:"oh-my-agent를 글로벌로 처음 설치합니다."},"install.lockHeld":{en:"Another oma install/update is running (pid={pid}). Try again in a moment.",ko:"다른 oma install/update가 실행 중입니다 (pid={pid}). 잠시 후 다시 시도하세요."},"install.outroSuccess":{en:`Done! Next steps:
|
|
2236
2250
|
1. Open your project in your IDE
|
|
2237
2251
|
2. Type /orchestrate to spawn a multi-agent workflow
|
|
2238
2252
|
3. Run \`oma doctor\` if anything looks off`,ko:`완료! 다음 단계:
|
package/package.json
CHANGED